圣诞快乐
# v1.3 更新列表 1. 【新增】砍价 2. 【新增】拼团 3. 【新增】一号通 4. 【修复】商品sku 编辑时出现商品属性对应错误的问题 5. 【修复】商品推广海报生成二维码可能会出错的问题【小程序调试中】 6. 【修复】微信公众号和小程序头像可能获取不到的问题 7. 【修复】下单时可能会出错的问题 8. 【修复】pc管理端用户访问量 9. 【修复】微信退款 10. 【修复】管理端订单状态可能出现不正确的情况 11. 【修复】WEB管理端-菜单色调,短信API更新,首页用户访问量,系统设置tab是自动选择下一及表单 12. 【修复】系统设置出现更新不正确的问题pull/1/MERGE
|
@ -35,6 +35,13 @@ export function postCombinationRemove(data) {
|
|||
return request.post("combination/remove",data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼团 更多拼团
|
||||
*/
|
||||
export function getCombinationMore(data) {
|
||||
return request.get("combination/more",data,{noAuth:true});
|
||||
}
|
||||
|
||||
/**
|
||||
* 砍价列表
|
||||
*/
|
||||
|
@ -72,7 +79,7 @@ export function getBargainDetail(id) {
|
|||
* 砍价 开启砍价用户信息
|
||||
*/
|
||||
export function postBargainStartUser(data) {
|
||||
return request.post("bargain/start/user", data);
|
||||
return request.get("bargain/start/user", data);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -97,24 +104,24 @@ export function postBargainHelpPrice(data) {
|
|||
}
|
||||
|
||||
/**
|
||||
* 砍价 砍价帮
|
||||
* 砍价 砍价帮
|
||||
*/
|
||||
export function postBargainHelpList(data) {
|
||||
return request.post("bargain/help/list", data);
|
||||
export function postBargainHelpList(params,data) {
|
||||
return request.get("bargain/help/list?limit="+params.limit+"&page="+params.page, data,{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 砍价 砍价帮总人数、剩余金额、进度条、已经砍掉的价格
|
||||
*/
|
||||
export function postBargainHelpCount(data) {
|
||||
return request.post("bargain/help/count", data);
|
||||
return request.get("bargain/help/count", data,1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 砍价 观看/分享/参与次数
|
||||
*/
|
||||
export function postBargainShare(bargainId) {
|
||||
return request.post("bargain/share", { bargainId: bargainId});
|
||||
return request.get("bargain/share/" + bargainId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -168,12 +168,14 @@ export function orderRefundVerify(data) {
|
|||
* 订单确认获取订单详细信息
|
||||
* @param string cartId
|
||||
*/
|
||||
export function orderConfirm(cartId, isNew, addAgain,secKill) {
|
||||
export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain) {
|
||||
return request.post('order/confirm', {
|
||||
cartIds: cartId,
|
||||
isNew: isNew,
|
||||
addAgain: addAgain,
|
||||
secKill: secKill
|
||||
secKill: secKill,
|
||||
combination:combination,
|
||||
bargain:bargain
|
||||
}, {}, 1);
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
function runTime() {
|
||||
//时间函数
|
||||
let intDiff = that.datatime - Date.parse(new Date()) / 1000; //获取数据中的时间戳的时间差;
|
||||
let intDiff = that.datatime - Date.parse(new Date())/1000; //获取数据中的时间戳的时间差;
|
||||
let day = 0,
|
||||
hour = 0,
|
||||
minute = 0,
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
</view>
|
||||
<!-- 无优惠券 -->
|
||||
<view class='pictrue' v-else>
|
||||
<image src='/static/images/noCoupon.png'></image>
|
||||
<image src='../../static/images/noCoupon.png'></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class='mask' catchtouchmove="true" :hidden='coupon.coupon==false' @click='close'></view>
|
||||
|
|
|
@ -161,7 +161,6 @@
|
|||
});
|
||||
},
|
||||
upload(){
|
||||
debugger
|
||||
if(!this.uploadUrl) {
|
||||
uni.showModal({
|
||||
content: '请填写上传接口'
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="empty-box">
|
||||
<image src="/static/images/empty-box.png"></image>
|
||||
<image src="../static/images/empty-box.png"></image>
|
||||
<view class="txt">{{title}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
|
|
@ -77,8 +77,12 @@
|
|||
'from': 'routine',
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
'from': this.$wechat.isWeixin() ? 'weixin' : 'weixinh5',
|
||||
'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5'
|
||||
// #endif
|
||||
// // #ifdef H5
|
||||
// quitUrl: location.port ? location.protocol + '//' + location.hostname + ':' + location.port + '/pages/users/order_details/index?order_id=' + this.order_id : location.protocol + '//' + location.hostname +
|
||||
// '/pages/users/order_details/index?order_id=' + that.order_id
|
||||
// // #endif
|
||||
}).then(res => {
|
||||
switch (paytype) {
|
||||
case 'weixin':
|
||||
|
@ -87,11 +91,11 @@
|
|||
});
|
||||
// #ifdef MP || APP-PLUS
|
||||
let jsConfig = res.data.jsConfig;
|
||||
let packages = 'prepay_id=' + jsConfig.prepayId;
|
||||
// let packages = 'prepay_id=' + jsConfig.prepayId;
|
||||
uni.requestPayment({
|
||||
timeStamp: jsConfig.timeStamp.toString(),
|
||||
nonceStr: jsConfig.nonceStr,
|
||||
package: packages,
|
||||
package: jsConfig.package,
|
||||
signType: jsConfig.signType,
|
||||
paySign: jsConfig.paySign,
|
||||
success: function(res) {
|
||||
|
@ -128,30 +132,18 @@
|
|||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
let data = res.data;
|
||||
if (data.status == "WECHAT_H5_PAY") {
|
||||
uni.hideLoading();
|
||||
location.replace(data.result.jsConfig.h5PayUrl);
|
||||
return that.$util.Tips({
|
||||
title: "支付成功",
|
||||
icon: 'success'
|
||||
}, () => {
|
||||
that.$emit('onChangeFun', {
|
||||
action: 'pay_complete'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
let jsConfig = data.result.jsConfig;
|
||||
let packages = 'prepay_id=' + jsConfig.prepayId;
|
||||
let data = {
|
||||
if (res.data.status === "WECHAT_PAY") {
|
||||
let jsConfig = res.data.jsConfig;
|
||||
//let packages = 'prepay_id=' + jsConfig.prepayId;
|
||||
let datas = {
|
||||
timestamp:jsConfig.timeStamp,
|
||||
nonceStr:jsConfig.nonceStr,
|
||||
package:packages,
|
||||
package:jsConfig.package,
|
||||
signType:jsConfig.signType,
|
||||
paySign:jsConfig.paySign
|
||||
};
|
||||
that.$wechat.pay(data)
|
||||
.finally(() => {
|
||||
that.$wechat.pay(datas)
|
||||
.then(() => {
|
||||
return that.$util.Tips({
|
||||
title: "支付成功",
|
||||
icon: 'success'
|
||||
|
@ -166,6 +158,17 @@
|
|||
title: '支付失败'
|
||||
});
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
location.replace(res.data.jsConfig.h5PayUrl);
|
||||
return that.$util.Tips({
|
||||
title: "支付成功",
|
||||
icon: 'success'
|
||||
}, () => {
|
||||
that.$emit('onChangeFun', {
|
||||
action: 'pay_complete'
|
||||
});
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
break;
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
<view class="joinBnt bg-color" v-if="iSbnt && attr.productSelect.stock>0 &&attr.productSelect.quota>0" @click="goCat">我要参团</view>
|
||||
<view class="joinBnt on" v-else-if="(iSbnt && attr.productSelect.quota<=0)||(iSbnt &&attr.productSelect.stock<=0)">已售罄</view>
|
||||
<view class="joinBnt bg-color" v-if="iScart && attr.productSelect.stock" @click="goCat">确定</view>
|
||||
<view class="joinBnt bg-color" v-if="iSbnt && attr.productSelect.stock && attr.productSelect.quota" @click="goCat">确定</view>
|
||||
<!-- <view class="joinBnt bg-color" v-if="iSbnt && attr.productSelect.stock && attr.productSelect.quota" @click="goCat">确定</view> -->
|
||||
<view class="joinBnt on" v-else-if="(iScart && !attr.productSelect.stock)">已售罄</view>
|
||||
</view>
|
||||
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>
|
||||
|
|
|
@ -5,12 +5,16 @@
|
|||
<view class="pictrue">
|
||||
<image :src="item.avatar"></image>
|
||||
</view>
|
||||
<view class="acea-row row-middle">
|
||||
<view class="name line1">{{ item.nickname }}</view>
|
||||
<view class="start" :class="'star' + Math.round((item.productScore+item.serviceScore)/2)"></view>
|
||||
<view class="acea-row row-between-wrapper" style="width: 87%;">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="name line1">{{ item.nickname }}</view>
|
||||
<view class="start" :class="'star' + item.productScore"></view>
|
||||
</view>
|
||||
<view class="time">{{ item.createTime }}</view>
|
||||
<!-- <view class="time">{{ item.createTime }} {{ item.suk }}</view> -->
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="time">{{ item.createTime }} {{ item.suk }}</view>
|
||||
<view class="evaluate-infor">{{ item.comment }}</view>
|
||||
<view class="imgList acea-row" v-if="item.pics.length && item.pics[0]">
|
||||
<view class="pictrue" v-for="(itemn, indexn) in item.pics" :key="indexn">
|
||||
|
@ -51,75 +55,74 @@
|
|||
background-color: #fff;
|
||||
padding-bottom: 25rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem~.evaluateItem {
|
||||
border-top: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .pic-text {
|
||||
font-size: 26rpx;
|
||||
color: #282828;
|
||||
height: 95rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .pic-text .pictrue {
|
||||
width: 56rpx;
|
||||
height: 56rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .pic-text .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
background: #f4f4f4;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .pic-text .name {
|
||||
max-width: 450rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .time {
|
||||
font-size: 24rpx;
|
||||
color: #82848f;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .evaluate-infor {
|
||||
font-size: 28rpx;
|
||||
color: #282828;
|
||||
margin-top: 19rpx;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .imgList {
|
||||
padding: 0 30rpx 0 15rpx;
|
||||
margin-top: 25rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .imgList .pictrue {
|
||||
width: 156rpx;
|
||||
height: 156rpx;
|
||||
margin: 0 0 15rpx 15rpx;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .imgList .pictrue image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #f7f7f7;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .reply {
|
||||
font-size: 26rpx;
|
||||
color: #454545;
|
||||
background-color: #f7f7f7;
|
||||
border-radius: 5rpx;
|
||||
margin: 20rpx 30rpx 0 30rpx;
|
||||
padding: 30rpx;
|
||||
padding: 20rpx;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
.evaluateWtapper .evaluateItem .reply::before {
|
||||
content: "";
|
||||
width: 0;
|
||||
|
@ -128,7 +131,7 @@
|
|||
border-right: 20rpx solid transparent;
|
||||
border-bottom: 30rpx solid #f7f7f7;
|
||||
position: absolute;
|
||||
top: -30rpx;
|
||||
top: -14rpx;
|
||||
left: 40rpx;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
module.exports = {
|
||||
//token
|
||||
LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
|
||||
// uid
|
||||
UID:'UID',
|
||||
//<2F>û<EFBFBD>
|
||||
USER_INFO: 'USER_INFO',
|
||||
//token<65><6E><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD>
|
||||
EXPIRES_TIME: 'EXPIRES_TIME',
|
||||
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ȩ
|
||||
WX_AUTH: 'WX_AUTH',
|
||||
//<2F><><EFBFBD>ں<EFBFBD><DABA><EFBFBD>Ȩcode
|
||||
STATE_KEY: 'wx_authorize_state',
|
||||
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD>
|
||||
LOGINTYPE: 'loginType',
|
||||
//<2F><><EFBFBD>ں<EFBFBD><DABA><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD>
|
||||
BACK_URL: 'login_back_url',
|
||||
// С<><D0A1><EFBFBD><EFBFBD>code
|
||||
STATE_R_KEY: 'roution_authorize_state',
|
||||
//<2F><>ȨlogoС<6F><D0A1><EFBFBD><EFBFBD>
|
||||
LOGO_URL: 'LOGO_URL',
|
||||
//模板缓存
|
||||
// SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
|
||||
//token
|
||||
LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
|
||||
// uid
|
||||
UID:'UID',
|
||||
//用户信息
|
||||
USER_INFO: 'USER_INFO',
|
||||
//token 过期时间
|
||||
EXPIRES_TIME: 'EXPIRES_TIME',
|
||||
//微信授权
|
||||
WX_AUTH: 'WX_AUTH',
|
||||
//微信授权状态
|
||||
STATE_KEY: 'wx_authorize_state',
|
||||
//登录类型
|
||||
LOGINTYPE: 'loginType',
|
||||
//登录回调地址
|
||||
BACK_URL: 'login_back_url',
|
||||
// 小程序授权状态
|
||||
STATE_R_KEY: 'roution_authorize_state',
|
||||
//logo Url
|
||||
LOGO_URL: 'LOGO_URL',
|
||||
//模板缓存
|
||||
// SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
|
||||
|
||||
TIPS_KEY: 'TIPS_KEY',
|
||||
TIPS_KEY: 'TIPS_KEY',
|
||||
|
||||
SPREAD: 'spread',
|
||||
//缓存经度
|
||||
CACHE_LONGITUDE: 'LONGITUDE',
|
||||
//缓存纬度
|
||||
CACHE_LATITUDE: 'LATITUDE',
|
||||
}
|
||||
SPREAD: 'spread',
|
||||
//缓存经度
|
||||
CACHE_LONGITUDE: 'LONGITUDE',
|
||||
//缓存纬度
|
||||
CACHE_LATITUDE: 'LATITUDE',
|
||||
}
|
|
@ -109,6 +109,14 @@
|
|||
// #endif
|
||||
}
|
||||
}
|
||||
,{
|
||||
"path" : "pages/index/components/a_seckill",
|
||||
"style" : {}
|
||||
}
|
||||
,{
|
||||
"path" : "pages/index/components/b_combination",
|
||||
"style" : {}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<view>
|
||||
<view class='bargain-list'>
|
||||
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (navH/2) +'rpx'"></view>
|
||||
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (navH/2) +'rpx'" v-if="returnShow"></view>
|
||||
<view class='header'></view>
|
||||
<view class='list'>
|
||||
<block v-for="(item,index) in bargainList" :key="index">
|
||||
|
@ -11,12 +11,15 @@
|
|||
</view>
|
||||
<view class='text acea-row row-column-around'>
|
||||
<view class='name line1'>{{item.title}}</view>
|
||||
<view class='num'><text class='iconfont icon-pintuan'></text>{{item.people}}人正在参与</view>
|
||||
<view class='money font-color'>最低: ¥<text class='price'>{{item.min_price}}</text></view>
|
||||
<view class='num'><text class='iconfont icon-pintuan'></text>{{item.countPeopleAll}}人正在参与</view>
|
||||
<view class='money font-color'>最低: ¥<text class='price'>{{item.minPrice}}</text></view>
|
||||
</view>
|
||||
<view class='cutBnt bg-color'><text class='iconfont icon-kanjia'></text>参与砍价</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if='bargainList.length > 0'>
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
|
@ -57,21 +60,24 @@
|
|||
return {
|
||||
bargainList: [],
|
||||
page: 1,
|
||||
limit: 20,
|
||||
limit: 10,
|
||||
loading: false,
|
||||
loadend: false,
|
||||
userInfo: {},
|
||||
navH: '',
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false //是否隐藏授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
returnShow:true,
|
||||
loadTitle: '加载更多'
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad: function(options) {
|
||||
var pages = getCurrentPages();
|
||||
this.returnShow = pages.length===1?false:true;
|
||||
uni.setNavigationBarTitle({
|
||||
title:"砍价列表"
|
||||
})
|
||||
|
||||
this.navH = app.globalData.navHeight;
|
||||
if (this.isLogin) {
|
||||
this.getUserInfo();
|
||||
|
@ -136,16 +142,22 @@
|
|||
if (that.loadend) return;
|
||||
if (that.loading) return;
|
||||
that.loading = true;
|
||||
that.loadTitle = '';
|
||||
getBargainList({
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
}).then(function(res) {
|
||||
that.$set(that, 'bargainList', that.bargainList.concat(res.data));
|
||||
let list = res.data.list;
|
||||
let bargainList = that.$util.SplitArray(list, that.bargainList);
|
||||
let loadend = list.length < that.limit;
|
||||
that.loadend = loadend;
|
||||
that.loading = false;
|
||||
that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
||||
that.$set(that, 'bargainList', bargainList);
|
||||
that.$set(that, 'page', that.page + 1);
|
||||
that.$set(that, 'loadend', that.limit > res.data.length);
|
||||
that.$set(that, 'loading', false);
|
||||
}).catch(res => {
|
||||
that.loading = false;
|
||||
that.loadTitle = '加载更多';
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<view class="header" :class="bargainUid != userInfo.uid ? 'on' : ''">
|
||||
<view class='people' >
|
||||
<!-- :style="'top:'+navH/2+'rpx'" -->
|
||||
{{bargainCount.lookCount}}人查看 丨 {{bargainCount.shareCount}}人分享 丨 {{bargainCount.userCount}}人参与
|
||||
{{bargainCount.lookCount || 0}}人查看 丨 {{bargainCount.shareCount || 0}}人分享 丨 {{bargainCount.userCount || 0}}人参与
|
||||
</view>
|
||||
<!-- <view class='time font-color' v-if="bargainUid == userInfo.uid">
|
||||
倒计时
|
||||
|
@ -25,7 +25,7 @@
|
|||
<image :src='bargainUserInfo.avatar'></image>
|
||||
</view>
|
||||
<view class='text'>
|
||||
{{bargainUserInfo.nickname}}
|
||||
{{bargainUserInfo.nickname || ''}}
|
||||
<text>邀请您帮忙砍价</text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -45,7 +45,7 @@
|
|||
当前: ¥
|
||||
<text class='num'>{{bargainInfo.price}}</text>
|
||||
</view>
|
||||
<view class='successNum'>最低:¥{{bargainInfo.min_price}}</view>
|
||||
<view class='successNum'>最低:¥{{bargainInfo.minPrice}}</view>
|
||||
<!-- <view class='successNum'>已有{{bargainSumCount}}人砍价成功</view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
@ -60,14 +60,20 @@
|
|||
</view>
|
||||
</block>
|
||||
<!-- 自己砍价 -->
|
||||
<view v-if="bargainUid == userInfo.uid && !userBargainStatus && bargainUserHelpInfo.price > 0">
|
||||
<view v-if="bargainUid == userInfo.uid && (userBargainStatus===0 || userBargainStatus === bargainSumCount) && bargainUserHelpInfo.price > 0">
|
||||
<view class='bargainBnt' @tap='userBargain' v-if="productStock>0&"a>0">
|
||||
立即参与砍价
|
||||
</view>
|
||||
<view class='bargainBnt grey' v-if="productStock<=0||quota<=0">商品暂无库存</view>
|
||||
</view>
|
||||
<!-- <view v-if="bargainUid == userInfo.uid && !userBargainStatus && bargainUserHelpInfo.price > 0">
|
||||
<view class='bargainBnt' @tap='userBargain' v-if="productStock>0&"a>0">
|
||||
立即参与砍价
|
||||
</view>
|
||||
<view class='bargainBnt grey' v-if="productStock<=0||quota<=0">立即参与砍价</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 帮助砍价、帮砍成功: -->
|
||||
<view v-if="bargainUid == userInfo.uid && bargainUserHelpInfo.price > 0 && userBargainStatus">
|
||||
<view v-if="bargainUid == userInfo.uid && bargainUserHelpInfo.price > 0 && userBargainStatus != bargainSumCount">
|
||||
<!-- #ifdef H5 -->
|
||||
<view class='bargainBnt' v-if="$wechat.isWeixin()" @click="H5ShareBox = true">邀请好友帮砍价</view>
|
||||
<view class='bargainBnt' v-else @tap='getBargainUserBargainPricePoster'>邀请好友帮砍价</view>
|
||||
|
@ -92,8 +98,14 @@
|
|||
</view>
|
||||
<view class='bargainBnt' @tap='currentBargainUser'>我也要参与</view>
|
||||
</view>
|
||||
|
||||
<view v-if="bargainUid != userInfo.uid && !userBargainStatusHelp">
|
||||
<view v-if="bargainUid != userInfo.uid && !userBargainStatusHelp && isHelp">
|
||||
<view class='bargainSuccess'>
|
||||
<text class='iconfont icon-xiaolian'></text>
|
||||
您已帮其他好友砍过此商品
|
||||
</view>
|
||||
<view class='bargainBnt' @tap='currentBargainUser'>我也要参与</view>
|
||||
</view>
|
||||
<view v-if="bargainUid != userInfo.uid && !userBargainStatusHelp && !isHelp">
|
||||
<view class='bargainSuccess'>
|
||||
<text class='iconfont icon-xiaolian'></text>
|
||||
已成功帮助好友砍价
|
||||
|
@ -122,7 +134,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class='list'>
|
||||
<block v-for="(item,index) in bargainUserHelpList" :key='index'>
|
||||
<block v-for="(item,index) in bargainUserHelpList" :key='index' v-if="index<3 || !couponsHidden">
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view class='pictxt acea-row row-between-wrapper'>
|
||||
<view class='pictrue'>
|
||||
|
@ -139,6 +151,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="open acea-row row-center-wrapper" @click="openTap" v-if="bargainUserHelpList.length>3">{{couponsHidden?'展开更多':'关闭展开'}}<text class="iconfont" :class='couponsHidden==true?"icon-xiangxia":"icon-xiangshang"'></text></view>
|
||||
</view>
|
||||
<view class='load font-color' v-if="!limitStatus" @tap='getBargainUser'>点击加载更多</view>
|
||||
<view class='lock'></view>
|
||||
|
@ -155,7 +168,7 @@
|
|||
</view>
|
||||
<view class='conter'>
|
||||
<!-- <template is="wxParse" data="{{wxParseData:description.nodes}}" /> -->
|
||||
<jyf-parser :html="bargainInfo.description" ref="article" :tag-style="tagStyle"></jyf-parser>
|
||||
<jyf-parser :html="bargainInfo.content" ref="article" :tag-style="tagStyle"></jyf-parser>
|
||||
<!-- <rich-text :nodes="bargainInfo.description" class="conter"></rich-text> -->
|
||||
</view>
|
||||
<view class='lock'></view>
|
||||
|
@ -182,7 +195,7 @@
|
|||
<view v-if="bargainUid == userInfo.uid">
|
||||
<view class='cutOff'>
|
||||
您已砍掉
|
||||
<text class='font-color'>{{bargainUserBargainPrice.price}}</text>
|
||||
<text class='font-color'>{{bargainUserBargainPrice}}</text>
|
||||
元,听说分享次数越多砍价成功的机会越大哦!
|
||||
</view>
|
||||
<!-- #ifdef MP -->
|
||||
|
@ -193,7 +206,7 @@
|
|||
<!-- #endif -->
|
||||
</view>
|
||||
<view v-else>
|
||||
<view class='help font-color'>成功帮砍{{bargainUserBargainPrice.price}}元</view>
|
||||
<view class='help font-color'>成功帮砍{{bargainUserBargainPrice}}元</view>
|
||||
<view class='cutOff on'>您也可以砍价低价拿哦,快去挑选心仪的商品吧~</view>
|
||||
<view @tap='currentBargainUser' class='tipBnt'>我也要参与</view>
|
||||
</view>
|
||||
|
@ -267,26 +280,26 @@
|
|||
bargainUid: 0, //开启砍价用户
|
||||
bargainUserInfo: {}, //开启砍价用户信息
|
||||
bargainUserId: 0, //开启砍价编号
|
||||
bargainInfo: [], //砍价产品
|
||||
offset: 0,
|
||||
limit: 20,
|
||||
bargainInfo: {}, //砍价产品
|
||||
page: 1,
|
||||
limit: 5,
|
||||
limitStatus: false,
|
||||
bargainUserHelpList: [],
|
||||
bargainUserHelpInfo: [],
|
||||
bargainUserBargainPrice: 0,
|
||||
bargainUserBargainPrice: 0, //砍了多少钱
|
||||
status: '', // 0 开启砍价 1 朋友帮忙砍价 2 朋友帮忙砍价成功 3 完成砍价 4 砍价失败 5已创建订单
|
||||
bargainCount: [], //分享人数 浏览人数 参与人数
|
||||
retunTop: true,
|
||||
bargainPartake: 0,
|
||||
isHelp: false,
|
||||
interval: null,
|
||||
userBargainStatus: 0, //判断自己是否砍价
|
||||
userBargainStatus: 0, // 用户开启的砍价活动次数
|
||||
productStock: 0, //判断是否售罄;
|
||||
quota: 0, //判断是否已限量;
|
||||
userBargainStatusHelp: true,
|
||||
navH: '',
|
||||
statusPay: '',
|
||||
bargainSumCount:0,
|
||||
statusPay: '', //活动状态,1参与中,2活动结束参与失败,3活动结束参与成功
|
||||
bargainSumCount:0, //用户成功支付的砍价订单数
|
||||
bargainPrice:0,
|
||||
datatime:0,
|
||||
offest:'',
|
||||
|
@ -298,6 +311,9 @@
|
|||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
pages:'',
|
||||
couponsHidden: true,
|
||||
loading: false,
|
||||
loadend: false
|
||||
}
|
||||
|
||||
},
|
||||
|
@ -369,6 +385,9 @@
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
openTap() {
|
||||
this.$set(this,'couponsHidden',!this.couponsHidden);
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e;
|
||||
|
@ -376,14 +395,21 @@
|
|||
// 去商品页
|
||||
goProduct(){
|
||||
uni.navigateTo({
|
||||
url:`/pages/goods_details/index?id=${this.bargainInfo.product_id}`
|
||||
url:`/pages/goods_details/index?id=${this.bargainInfo.productId}`
|
||||
})
|
||||
},
|
||||
// 自己砍价;
|
||||
userBargain:function(){
|
||||
let that = this;
|
||||
if (that.userInfo.uid == that.bargainUid){
|
||||
that.setBargain();
|
||||
if (that.userBargainStatus == that.bargainInfo.num) {
|
||||
return that.$util.Tips({
|
||||
title: `该商品每人限购${that.bargainInfo.num}${that.bargainInfo.unitName}`
|
||||
});
|
||||
} else {
|
||||
this.page = 1;
|
||||
that.setBargain();
|
||||
}
|
||||
}
|
||||
},
|
||||
goBack: function() {
|
||||
|
@ -393,9 +419,6 @@
|
|||
},
|
||||
gobargainUserInfo: function() { //获取开启砍价用户信息
|
||||
var that = this;
|
||||
var data = {
|
||||
userId: that.bargainUid
|
||||
};
|
||||
postBargainStartUser({
|
||||
bargainId: that.id,
|
||||
bargainUserUid: that.bargainUid
|
||||
|
@ -406,22 +429,18 @@
|
|||
goPay: function() { //立即支付
|
||||
var that = this;
|
||||
var data = {
|
||||
productId: that.bargainInfo.product_id,
|
||||
bargainId: that.id,
|
||||
cartNum: that.bargainInfo.num,
|
||||
uniqueId: '',
|
||||
combinationId: 0,
|
||||
secKillId: 0,
|
||||
'new': 1
|
||||
isNew: true,
|
||||
productId: that.bargainInfo.productId,
|
||||
bargainId: that.bargainInfo.id,
|
||||
cartNum: 1,
|
||||
productAttrUnique: that.bargainInfo.attrValue[0].id
|
||||
};
|
||||
postCartAdd(data).then(res => {
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + res.data.cartId
|
||||
url: '/pages/users/order_confirm/index?new=true&cartId=' + res.data.cartId + '&bargain=true'
|
||||
});
|
||||
}).catch(err => {
|
||||
return app.Tips({
|
||||
title: err
|
||||
})
|
||||
return that.$util.Tips({title:err})
|
||||
});
|
||||
},
|
||||
getBargainDetails: function() { //获取砍价产品详情
|
||||
|
@ -433,12 +452,11 @@
|
|||
that.userInfo = res.data.userInfo;
|
||||
that.bargainSumCount = res.data.bargainSumCount;
|
||||
that.userBargainStatus = res.data.userBargainStatus;
|
||||
that.productStock = res.data.bargain.attr.product_stock;
|
||||
that.quota = res.data.bargain.attr.quota;
|
||||
that.datatime = res.data.bargain.stop_time
|
||||
that.productStock = res.data.bargain.stock;
|
||||
that.quota = res.data.bargain.quota;
|
||||
that.datatime = res.data.bargain.endTime/1000;
|
||||
that.pages = '/pages/activity/goods_bargain_details/index?id=' + that.id + '&bargain=' +
|
||||
that.bargainUid + '&scene=' + that.userInfo.uid;
|
||||
console.log(that.pages);
|
||||
uni.setNavigationBarTitle({
|
||||
title:res.data.bargain.title.substring(0,13)+'...'
|
||||
})
|
||||
|
@ -450,7 +468,15 @@
|
|||
that.setOpenShare();
|
||||
//#endif
|
||||
}).catch(function(err) {
|
||||
that.$util.Tips({title:err})
|
||||
// uni.navigateTo({
|
||||
// url: window.location.protocol + "//" + window.location.host +'/pages/activity/goods_bargain/index',
|
||||
// });
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
}, {
|
||||
tab: 2,
|
||||
url: '/pages/activity/goods_bargain/index'
|
||||
});
|
||||
})
|
||||
},
|
||||
getBargainHelpCount: function () {//获取砍价帮总人数、剩余金额、进度条、已经砍掉的价格
|
||||
|
@ -462,6 +488,11 @@
|
|||
that.bargainInfo.price = parseFloat(price) <= 0 ? 0 : price;
|
||||
that.userBargainStatusHelp = res.data.userBargainStatus;
|
||||
that.statusPay = res.data.status;
|
||||
this.isHelp = res.data.isConsume;
|
||||
}).catch(function(err) {
|
||||
that.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
})
|
||||
},
|
||||
currentBargainUser: function() { //当前用户砍价
|
||||
|
@ -471,12 +502,20 @@
|
|||
setBargain: function() { //参与砍价
|
||||
var that = this;
|
||||
postBargainStart(that.id).then(res => {
|
||||
if (res.code === 'subscribe') {
|
||||
return;
|
||||
}
|
||||
that.$set(that, 'bargainUserId', res.data);
|
||||
that.getBargainUserBargainPrice();
|
||||
// that.getBargainUserBargainPrice();
|
||||
that.setBargainHelp();
|
||||
that.getBargainHelpCount();
|
||||
that.userBargainStatus = 1;
|
||||
})
|
||||
},error => {
|
||||
this.bargainUid = 0;
|
||||
that.$util.Tips({
|
||||
title: error
|
||||
})
|
||||
})
|
||||
},
|
||||
setBargainHelp: function() { //帮好友砍价
|
||||
var that = this;
|
||||
|
@ -485,10 +524,18 @@
|
|||
bargainUserUid: that.bargainUid
|
||||
};
|
||||
postBargainHelp(data).then(res => {
|
||||
// if(res.data.isConsume){
|
||||
// that.$set(that, 'isHelp', true);
|
||||
// }else{
|
||||
// that.$set(that, 'isHelp', false);
|
||||
// that.$set(that, 'active', true);
|
||||
// }
|
||||
that.page = 1;
|
||||
that.$set(that, 'bargainUserHelpList', []);
|
||||
that.$set(that, 'isHelp', true);
|
||||
that.getBargainUser();
|
||||
that.getBargainUserBargainPrice();
|
||||
that.$set(that, 'bargainUserBargainPrice', res.data.bargainPrice);
|
||||
that.$set(that, 'active', true);
|
||||
//that.getBargainUserBargainPrice();
|
||||
that.getBargainHelpCount();
|
||||
}).catch(err => {
|
||||
that.$util.Tips({
|
||||
|
@ -500,22 +547,36 @@
|
|||
},
|
||||
getBargainUser: function() { //获取砍价帮
|
||||
var that = this;
|
||||
// if (that.loadend) return;
|
||||
if (that.loading) return;
|
||||
var data = {
|
||||
bargainId: that.id,
|
||||
bargainUserUid: that.bargainUid,
|
||||
offset: that.offset,
|
||||
};
|
||||
var datas = {
|
||||
page: that.page,
|
||||
limit: that.limit,
|
||||
};
|
||||
postBargainHelpList(data).then(res => {
|
||||
var bargainUserHelpListNew = [];
|
||||
var bargainUserHelpList = that.bargainUserHelpList;
|
||||
var len = res.data.length;
|
||||
|
||||
bargainUserHelpListNew = bargainUserHelpList.concat(res.data);
|
||||
this.loading = true;
|
||||
postBargainHelpList(datas,data).then(res => {
|
||||
let list = res.data.list;
|
||||
let bargainUserHelpList = that.$util.SplitArray(list, that.bargainUserHelpList);
|
||||
let loadend = list.length < that.limit;
|
||||
let len = list.length;
|
||||
that.loadend = loadend;
|
||||
that.loading = false;
|
||||
that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
||||
that.$set(that, 'bargainUserHelpList', bargainUserHelpList);
|
||||
that.$set(that, 'limitStatus', datas.limit > len);
|
||||
that.$set(that, 'page', that.page + 1);
|
||||
|
||||
that.$set(that, 'bargainUserHelpList', res.data);
|
||||
that.$set(that, 'limitStatus', data.limit > len);
|
||||
that.$set(that, 'offest', (Number(data.offset) + Number(data.limit)));
|
||||
// var bargainUserHelpListNew = [];
|
||||
// var bargainUserHelpList = that.bargainUserHelpList;
|
||||
// var len = res.data.list.length;
|
||||
// bargainUserHelpListNew = bargainUserHelpList.concat(res.data.list);
|
||||
// that.$set(that, 'bargainUserHelpList', res.data.list);
|
||||
// that.$set(that, 'limitStatus', datas.limit > len);
|
||||
// that.$set(that, 'page', (Number(datas.page) + Number(datas.limit)));
|
||||
});
|
||||
},
|
||||
getBargainUserBargainPricePoster: function() {
|
||||
|
@ -669,6 +730,16 @@
|
|||
page {
|
||||
background-color: #e93323 !important;
|
||||
}
|
||||
.bargain .bargainGang .open {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.bargain .bargainGang .open .iconfont {
|
||||
font-size: 25rpx;
|
||||
margin: 5rpx 0 0 10rpx;
|
||||
}
|
||||
|
||||
.bargain .icon-xiangzuo {
|
||||
font-size: 40rpx;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<div>
|
||||
<view class='group-list'>
|
||||
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (navH/2) +'rpx'"></view>
|
||||
<view class='iconfont icon-xiangzuo' @tap='goBack' :style="'top:'+ (navH/2) +'rpx'" v-if="returnShow"></view>
|
||||
<view class='header'></view>
|
||||
<view class='list'>
|
||||
<block v-for="(item,index) in combinationList" :key='index'>
|
||||
|
@ -19,12 +19,15 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class='bottom acea-row row-between-wrapper'>
|
||||
<view class='money'>¥<text class='num'>{{item.price}}</text><text class='y-money'>¥{{item.product_price}}</text></view>
|
||||
<view class='money'>¥<text class='num'>{{item.price}}</text><text class='y-money'>¥{{item.otPrice}}</text></view>
|
||||
<view class='groupBnt bg-color'>去拼团<text class="iconfont icon-jiantou"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view class='loadingicon acea-row row-center-wrapper' v-if='combinationList.length > 0'>
|
||||
<text class='loading iconfont icon-jiazai' :hidden='loading==false'></text>{{loadTitle}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<home></home>
|
||||
|
@ -52,9 +55,13 @@
|
|||
page: 1,
|
||||
loading: false,
|
||||
loadend: false,
|
||||
returnShow: true,
|
||||
loadTitle: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
var pages = getCurrentPages();
|
||||
this.returnShow = pages.length===1?false:true;
|
||||
uni.setNavigationBarTitle({
|
||||
title:"拼团列表"
|
||||
})
|
||||
|
@ -90,21 +97,24 @@
|
|||
var that = this;
|
||||
if (that.loadend) return;
|
||||
if (that.loading) return;
|
||||
that.loadTitle = '';
|
||||
var data = {
|
||||
page: that.page,
|
||||
limit: that.limit
|
||||
};
|
||||
this.loading = true
|
||||
getCombinationList(data).then(function(res) {
|
||||
var combinationList = that.combinationList;
|
||||
var limit = that.limit;
|
||||
that.page++;
|
||||
that.loadend = limit > res.data.length;
|
||||
that.combinationList = combinationList.concat(res.data);
|
||||
that.page = that.data.page;
|
||||
let list = res.data.list;
|
||||
let combinationList = that.$util.SplitArray(list, that.combinationList);
|
||||
let loadend = list.length < that.limit;
|
||||
that.loadend = loadend;
|
||||
that.loading = false;
|
||||
that.loadTitle = loadend ? '已全部加载' : '加载更多';
|
||||
that.$set(that, 'combinationList', combinationList);
|
||||
that.$set(that, 'page', that.page + 1);
|
||||
}).catch(() => {
|
||||
that.loading = false
|
||||
that.loading = false;
|
||||
that.loadTitle = '加载更多';
|
||||
})
|
||||
},
|
||||
},
|
||||
|
|
|
@ -22,15 +22,15 @@
|
|||
<view class='wrapper'>
|
||||
<view class='share acea-row row-between row-bottom'>
|
||||
<view class='money font-color'>
|
||||
¥<text class='num'>{{storeInfo.price}}</text><text class='y-money'>¥{{storeInfo.product_price}}</text>
|
||||
¥<text class='num'>{{storeInfo.price || 0}}</text><text class='y-money'>¥{{storeInfo.product_price || 0}}</text>
|
||||
</view>
|
||||
<view class='iconfont icon-fenxiang' @click="listenerActionSheet"></view>
|
||||
</view>
|
||||
<view class='introduce'>{{storeInfo.title}}</view>
|
||||
<view class='label acea-row row-between-wrapper'>
|
||||
<view class='stock'>类型:{{storeInfo.people}}人团</view>
|
||||
<view>累计销量:{{storeInfo.total?storeInfo.total:0}}件</view>
|
||||
<view>限购: {{ storeInfo.quota ? storeInfo.quota : 0 }} 件</view>
|
||||
<view class='stock'>类型:{{storeInfo.people || 0}}人团</view>
|
||||
<view>累计销量:{{storeInfo.total?storeInfo.total:0}} {{storeInfo.unit_name || ''}}</view>
|
||||
<view>限购: {{ storeInfo.quotaShow ? storeInfo.quotaShow : 0 }} {{storeInfo.unit_name || ''}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class='attribute acea-row row-between-wrapper' @tap='selecAttr' v-if='attribute.productAttr.length'>
|
||||
|
@ -40,14 +40,14 @@
|
|||
<view class='notice acea-row row-middle'>
|
||||
<view class='num font-color'>
|
||||
<text class='iconfont icon-laba'></text>
|
||||
已拼{{pink_ok_sum}}件<text class='line'>|</text>
|
||||
已拼{{pinkOkSum}}件<text class='line'>|</text>
|
||||
</view>
|
||||
<view class='swiper'>
|
||||
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500" vertical="true"
|
||||
circular="true">
|
||||
<block v-for="(item,index) in itemNew" :key='index'>
|
||||
<swiper-item>
|
||||
<view class='line1'>{{item}}</view>
|
||||
<view class='line1'>{{item.nickname}}拼团成功</view>
|
||||
</swiper-item>
|
||||
</block>
|
||||
</swiper>
|
||||
|
@ -64,7 +64,10 @@
|
|||
<view class='right acea-row row-middle'>
|
||||
<view>
|
||||
<view class='lack'>还差<text class='font-color'>{{item.count}}</text>人成团</view>
|
||||
<view class='time'><count-down :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="':'" :minute-text="':'" :second-text="' '" :datatime="item.stop_time"></count-down></view>
|
||||
<view class='time'>
|
||||
<count-down :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="':'" :minute-text="':'" :second-text="' '"
|
||||
:datatime="item.stopTime/1000"></count-down>
|
||||
</view>
|
||||
</view>
|
||||
<navigator hover-class='none' :url="'/pages/activity/goods_combination_status/index?id='+item.id" class='spellBnt'>
|
||||
去拼单
|
||||
|
@ -72,8 +75,10 @@
|
|||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view class='more' @tap='showAll' v-if="pink.length >= AllIndex">查看更多<text class='iconfont icon-xiangxia'></text></view>
|
||||
<view class='more' @tap='hideAll' v-else="pink.length >= AllIndex && !pink.length">收起<text class='iconfont icon-xiangxia'></text></view> -->
|
||||
<template v-if="pink.length">
|
||||
<view class='more' @tap='showAll' v-if="pink.length > AllIndex">查看更多<text class='iconfont icon-xiangxia'></text></view>
|
||||
<view class='more' @tap='hideAll' v-else-if="pink.length === AllIndex && pink.length !== AllIndexDefault">收起<text class='iconfont icon-xiangshang'></text></view>
|
||||
</template>
|
||||
</view>
|
||||
<view class='playWay'>
|
||||
<view class='title acea-row row-between-wrapper'>
|
||||
|
@ -104,7 +109,7 @@
|
|||
<view class='userEvaluation' id="past1">
|
||||
<view class='title acea-row row-between-wrapper'>
|
||||
<view>用户评价({{replyCount}})</view>
|
||||
<navigator class='praise' hover-class='none' :url='"/pages/users/goods_comment_list/index?product_id="+storeInfo.product_id'>
|
||||
<navigator class='praise' hover-class='none' :url='"/pages/users/goods_comment_list/index?productId="+storeInfo.productId'>
|
||||
<text class='font-color'>{{replyChance || 0}}%</text>
|
||||
好评率
|
||||
<text class='iconfont icon-jiantou'></text>
|
||||
|
@ -129,7 +134,7 @@
|
|||
</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP -->
|
||||
<navigator hover-class="none" class="item" url="/pages/customer_list/index">
|
||||
<navigator hover-class="none" class="item" @click="kefuClick">
|
||||
<view class="iconfont icon-kefu"></view>
|
||||
<view>客服</view>
|
||||
</navigator>
|
||||
|
@ -141,20 +146,20 @@
|
|||
</view>
|
||||
<view class="bnt acea-row">
|
||||
<view class="joinCart bnts" @tap="goProduct">单独购买</view>
|
||||
<view class="buy bnts" @tap="goCat" v-if='attribute.productSelect.product_stock>0&&attribute.productSelect.quota>0'>
|
||||
<view class="buy bnts" @tap="goCat" v-if='attribute.productSelect.stock>0&&attribute.productSelect.quota>0'>
|
||||
立即开团
|
||||
</view>
|
||||
<view class="buy bnts bg-color-hui" v-if='attribute.productSelect.quota <= 0 || attribute.productSelect.product_stock <= 0'>
|
||||
<view class="buy bnts bg-color-hui" v-if='attribute.productSelect.quota <= 0 || attribute.productSelect.stock <= 0'>
|
||||
已售罄
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"></shareRedPackets>
|
||||
<!-- 分享按钮 -->
|
||||
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
|
||||
<!-- #ifndef MP -->
|
||||
<button class="item" hover-class='none' v-if="weixinStatus === true" @click="setShareInfoStatus">
|
||||
<button class="item" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
|
||||
<view class="iconfont icon-weixin3"></view>
|
||||
<view class="">发送给朋友</view>
|
||||
</button>
|
||||
|
@ -170,10 +175,12 @@
|
|||
<view class="">生成海报</view>
|
||||
</button>
|
||||
</view>
|
||||
<view class="mask" v-if="posters" @click="listenerActionClose"></view>
|
||||
<view class="mask" v-if="posters" @click="closePosters"></view>
|
||||
<view class="mask" v-if="canvasStatus" @click="listenerActionClose"></view>
|
||||
<!-- <view class="mask" v-if="posters" @click="listenerActionClose"></view> -->
|
||||
|
||||
<!-- 海报展示 -->
|
||||
<view class='poster-pop' v-if="posterImageStatus">
|
||||
<view class='poster-pop' v-if="canvasStatus">
|
||||
<image src='/static/images/poster-close.png' class='close' @click="posterImageClose"></image>
|
||||
<image :src='posterImage'></image>
|
||||
<!-- #ifndef H5 -->
|
||||
|
@ -183,37 +190,52 @@
|
|||
<view class="keep">长按图片可以保存到手机</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class='mask' v-if="posterImageStatus"></view>
|
||||
<canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas>
|
||||
<view class="canvas" v-else>
|
||||
<canvas style="width:750px;height:1190px;" canvas-id="firstCanvas"></canvas>
|
||||
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
|
||||
</view>
|
||||
<!-- 发送给朋友图片 -->
|
||||
<view class="share-box" v-if="H5ShareBox">
|
||||
<image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
|
||||
</view>
|
||||
<!-- <view class='mask' v-if="posterImageStatus"></view>
|
||||
<canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas> -->
|
||||
<!-- #ifdef MP -->
|
||||
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
|
||||
<!-- #endif -->
|
||||
<home></home>
|
||||
<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum" @iptCartNum="iptCartNum"
|
||||
@attrVal="attrVal"></product-window>
|
||||
<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
|
||||
@iptCartNum="iptCartNum" @attrVal="attrVal"></product-window>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const app = getApp();
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
||||
|
||||
import { base64src } from '@/utils/base64src.js'
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
// #ifdef MP
|
||||
import authorize from '@/components/Authorize';
|
||||
import {
|
||||
getQrcode
|
||||
} from '@/api/api.js';
|
||||
// #endif
|
||||
import productConSwiper from '@/components/productConSwiper/index.vue'
|
||||
import productConSwiper from '@/components/productConSwiper'
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
getCombinationDetail,
|
||||
scombinationCode
|
||||
getCombinationDetail
|
||||
} from '@/api/activity.js';
|
||||
import {
|
||||
postCartAdd,
|
||||
collectAdd,
|
||||
collectDel
|
||||
collectDel,
|
||||
getReplyList,
|
||||
getReplyConfig
|
||||
} from '@/api/store.js';
|
||||
import {
|
||||
imageBase64
|
||||
|
@ -223,9 +245,13 @@
|
|||
import productWindow from '@/components/productWindow/index.vue'
|
||||
import userEvaluation from '@/components/userEvaluation/index.vue'
|
||||
import countDown from '@/components/countDown/index.vue'
|
||||
import { getProductCode } from '@/api/store.js'
|
||||
import shareRedPackets from '@/components/shareRedPackets';
|
||||
import {
|
||||
getProductCode
|
||||
} from '@/api/store.js'
|
||||
export default {
|
||||
components: {
|
||||
shareRedPackets,
|
||||
productConSwiper,
|
||||
// #ifdef MP
|
||||
authorize,
|
||||
|
@ -236,7 +262,12 @@
|
|||
userEvaluation,
|
||||
countDown
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
computed: mapGetters({
|
||||
'isLogin': 'isLogin',
|
||||
'userData': 'userInfo',
|
||||
'uid': 'uid',
|
||||
'chatUrl': 'chatUrl'
|
||||
}),
|
||||
data() {
|
||||
return {
|
||||
navH: '',
|
||||
|
@ -258,6 +289,7 @@
|
|||
attr: '请选择',
|
||||
attrValue: '',
|
||||
AllIndex: 2,
|
||||
maxAllIndex: 0,
|
||||
replyChance: '',
|
||||
limitNum: 1,
|
||||
timeer: null,
|
||||
|
@ -273,12 +305,14 @@
|
|||
lock: false,
|
||||
scrollTop: 0,
|
||||
storeInfo: {},
|
||||
pink_ok_sum: 0,
|
||||
pinkOkSum: 0,
|
||||
pink: [],
|
||||
replyCount: 0,
|
||||
reply: [],
|
||||
imgUrls: [],
|
||||
sharePacket: '',
|
||||
sharePacket: {
|
||||
isState: true, //默认不显示
|
||||
},
|
||||
tagStyle: {
|
||||
img: 'width:100%;'
|
||||
},
|
||||
|
@ -296,10 +330,14 @@
|
|||
cart_num: '',
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
AllIndexDefault: 0,
|
||||
imgTop:'',
|
||||
qrcodeSize: 600,
|
||||
H5ShareBox: false, //公众号分享图片
|
||||
onceNum: 0 //一次可以购买几个
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
console.log(options,'options')
|
||||
let that = this
|
||||
// #ifdef MP
|
||||
this.navH = app.globalData.navHeight;
|
||||
|
@ -316,7 +354,7 @@
|
|||
});
|
||||
//扫码携带参数处理
|
||||
// #ifdef MP
|
||||
|
||||
|
||||
if (options.scene) {
|
||||
let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
|
||||
if (value.id) options.id = value.id;
|
||||
|
@ -367,6 +405,38 @@
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
getProductReplyCount: function() {
|
||||
let that = this;
|
||||
getReplyConfig(that.storeInfo.productId).then(res => {
|
||||
that.$set(that, 'replyChance', res.data.replyChance * 100);
|
||||
that.$set(that, 'replyCount', res.data.sumCount);
|
||||
});
|
||||
},
|
||||
getProductReplyList: function() {
|
||||
getReplyList(this.storeInfo.productId, {
|
||||
page: 1,
|
||||
limit: 3,
|
||||
type: 0,
|
||||
}).then(res => {
|
||||
this.reply = res.data.list;
|
||||
})
|
||||
},
|
||||
kefuClick(){
|
||||
location.href = this.chatUrl;
|
||||
},
|
||||
closePosters:function(){
|
||||
this.posters = false;
|
||||
},
|
||||
closeChange: function() {
|
||||
this.$set(this.sharePacket, 'isState', true);
|
||||
},
|
||||
showAll: function() {
|
||||
this.AllIndexDefault = this.AllIndex;
|
||||
this.AllIndex = this.pink.length;
|
||||
},
|
||||
hideAll: function() {
|
||||
this.AllIndex = this.AllIndexDefault;
|
||||
},
|
||||
// 授权关闭
|
||||
authColse: function(e) {
|
||||
this.isShowAuth = e;
|
||||
|
@ -374,10 +444,18 @@
|
|||
/**
|
||||
* 购物车手动填写
|
||||
*
|
||||
*/
|
||||
iptCartNum: function (e) {
|
||||
this.$set(this.attribute.productSelect,'cart_num',e);
|
||||
this.$set(this, "cart_num", e);
|
||||
*/
|
||||
iptCartNum: function(e) {
|
||||
if (e > this.onceNum) {
|
||||
this.$util.Tips({
|
||||
title: `该商品每次限购${this.onceNum}${this.storeInfo.unitName}`
|
||||
});
|
||||
this.$set(this.attribute.productSelect, 'cart_num', this.onceNum);
|
||||
this.$set(this, "cart_num", this.onceNum);
|
||||
}else{
|
||||
this.$set(this.attribute.productSelect, 'cart_num', e);
|
||||
this.$set(this, "cart_num", e);
|
||||
}
|
||||
},
|
||||
// 返回
|
||||
returns() {
|
||||
|
@ -391,38 +469,45 @@
|
|||
uni.setNavigationBarTitle({
|
||||
title: res.data.storeInfo.title.substring(0, 16)
|
||||
})
|
||||
that.imgUrls = res.data.storeInfo.images
|
||||
that.storeInfo = res.data.storeInfo;
|
||||
that.pink = res.data.pink;
|
||||
that.pindAll = res.data.pindAll;
|
||||
that.reply = res.data.reply ? [res.data.reply] : [];
|
||||
that.replyCount = res.data.replyCount;
|
||||
that.itemNew = res.data.pink_ok_list;
|
||||
that.pink_ok_sum = res.data.pink_ok_sum;
|
||||
that.replyChance = res.data.replyChance;
|
||||
that.attribute.productAttr = res.data.productAttr;
|
||||
that.getProductReplyList();
|
||||
that.getProductReplyCount();
|
||||
that.imgUrls = JSON.parse(res.data.storeInfo.images);
|
||||
that.attribute.productSelect.num = res.data.storeInfo.onceNum;
|
||||
that.pink = res.data.pink || [];
|
||||
that.pindAll = res.data.pindAll || [];
|
||||
// that.reply = res.data.reply ? res.data.reply : [];
|
||||
that.itemNew = res.data.pinkOkList || [];
|
||||
that.pinkOkSum = res.data.pinkOkSum;
|
||||
that.attribute.productAttr = res.data.productAttr || [];
|
||||
that.productValue = res.data.productValue;
|
||||
that.PromotionCode = res.data.storeInfo.code_base
|
||||
that.onceNum = res.data.storeInfo.onceNum;
|
||||
// that.PromotionCode = res.data.storeInfo.code_base
|
||||
// #ifdef H5
|
||||
that.setShare();
|
||||
that.storeImage = that.storeInfo.image
|
||||
that.getImageBase64();
|
||||
that.make();
|
||||
that.getImageBase64(that.storeImage);
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
that.getQrcode();
|
||||
that.imgTop = res.data.storeInfo.image;
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
that.downloadFilestoreImage();
|
||||
// #endif
|
||||
// that.setProductSelect();
|
||||
|
||||
|
||||
that.DefaultSelect();
|
||||
// setTimeout(function() {
|
||||
// that.infoScroll();
|
||||
// }, 500);
|
||||
|
||||
setTimeout(function() {
|
||||
that.infoScroll();
|
||||
}, 500);
|
||||
|
||||
}).catch(function(err) {
|
||||
that.$util.Tips({
|
||||
title:err
|
||||
},{
|
||||
tab:3
|
||||
title: err
|
||||
}, {
|
||||
tab: 3
|
||||
})
|
||||
})
|
||||
},
|
||||
|
@ -498,26 +583,25 @@
|
|||
*
|
||||
*/
|
||||
DefaultSelect: function() {
|
||||
|
||||
let self = this
|
||||
let productAttr = self.attribute.productAttr;
|
||||
let value = [];
|
||||
for (var key in this.productValue) {
|
||||
if (this.productValue[key].quota > 0) {
|
||||
value = this.attribute.productAttr.length ? key.split(",") : [];
|
||||
for (var key in self.productValue) {
|
||||
if (self.productValue[key].quota > 0) {
|
||||
value = self.attribute.productAttr.length ? key.split(",") : [];
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (let i = 0; i < productAttr.length; i++) {
|
||||
this.$set(productAttr[i], "index", value[i]);
|
||||
self.$set(productAttr[i], "index", value[i]);
|
||||
}
|
||||
//sort();排序函数:数字-英文-汉字;
|
||||
let productSelect = self.productValue[value.sort().join(",")];
|
||||
let productSelect = self.productValue[value.join(",")];
|
||||
|
||||
if (productSelect && productAttr.length) {
|
||||
self.$set(
|
||||
self.attribute.productSelect,
|
||||
"store_name",
|
||||
"storeName",
|
||||
self.storeInfo.title
|
||||
);
|
||||
self.$set(self.attribute.productSelect, "image", productSelect.image);
|
||||
|
@ -525,22 +609,20 @@
|
|||
self.$set(self.attribute.productSelect, "stock", productSelect.stock);
|
||||
self.$set(self.attribute.productSelect, "unique", productSelect.unique);
|
||||
self.$set(self.attribute.productSelect, "quota", productSelect.quota);
|
||||
self.$set(self.attribute.productSelect, "quota_show", productSelect.quota_show);
|
||||
self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
|
||||
self.$set(self.attribute.productSelect, "quotaShow", productSelect.quotaShow);
|
||||
self.$set(self.attribute.productSelect, "cart_num", 1);
|
||||
self.$set(self, "attrValue", value.sort().join(","));
|
||||
self.attrValue = value.sort().join(",")
|
||||
this.$set(this, "attrValue", value.join(","));
|
||||
this.$set(this, "attrTxt", "已选择");
|
||||
} else if (!productSelect && productAttr.length) {
|
||||
self.$set(
|
||||
self.attribute.productSelect,
|
||||
"store_name",
|
||||
"storeName",
|
||||
self.storeInfo.title
|
||||
);
|
||||
self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
|
||||
self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
|
||||
self.$set(self.attribute.productSelect, "quota", 0);
|
||||
self.$set(self.attribute.productSelect, "quota_show", 0);
|
||||
self.$set(self.attribute.productSelect, "product_stock", 0);
|
||||
self.$set(self.attribute.productSelect, "quotaShow", 0);
|
||||
self.$set(self.attribute.productSelect, "stock", 0);
|
||||
self.$set(self.attribute.productSelect, "unique", "");
|
||||
self.$set(self.attribute.productSelect, "cart_num", 0);
|
||||
|
@ -549,14 +631,14 @@
|
|||
} else if (!productSelect && !productAttr.length) {
|
||||
self.$set(
|
||||
self.attribute.productSelect,
|
||||
"store_name",
|
||||
"storeName",
|
||||
self.storeInfo.title
|
||||
);
|
||||
self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
|
||||
self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
|
||||
self.$set(self.attribute.productSelect, "stock", self.storeInfo.stock);
|
||||
self.$set(self.attribute.productSelect, "quota", 0);
|
||||
self.$set(self.attribute.productSelect, "product_stock", 0);
|
||||
self.$set(self.attribute.productSelect, "stock", 0);
|
||||
self.$set(
|
||||
self.attribute.productSelect,
|
||||
"unique",
|
||||
|
@ -574,7 +656,7 @@
|
|||
heightArr = [];
|
||||
for (var i = 0; i < that.navList.length; i++) { //productList
|
||||
//获取元素所在位置
|
||||
var query = wx.createSelectorQuery().in(this);
|
||||
var query = uni.createSelectorQuery().in(this);
|
||||
var idView = "#past" + i;
|
||||
// if (!that.data.good_list.length && i == 2) {
|
||||
// var idView = "#past" + 3;
|
||||
|
@ -594,8 +676,8 @@
|
|||
onLoadFun: function(e) {
|
||||
this.userInfo = e
|
||||
app.globalData.openPages = '/pages/activity/goods_combination_details/index?id=' + this.id + '&spid=' + e.uid;
|
||||
this.downloadFilePromotionCode();
|
||||
this.combinationDetail();
|
||||
//this.downloadFilePromotionCode();
|
||||
},
|
||||
selecAttr: function() {
|
||||
this.attribute.cartAttr = true
|
||||
|
@ -612,56 +694,61 @@
|
|||
//changeValue:是否 加|减
|
||||
//获取当前变动属性
|
||||
let productSelect = this.productValue[this.attrValue];
|
||||
if (this.buyNum === productSelect.quota) {
|
||||
return this.$util.Tips({title: '您已超出当前商品每人限购数量,请浏览其他商品'});
|
||||
}
|
||||
if (this.cart_num) {
|
||||
productSelect.cart_num = this.cart_num;
|
||||
this.attribute.productSelect.cart_num = this.cart_num;
|
||||
}
|
||||
productSelect.cart_num = this.cart_num;
|
||||
this.attribute.productSelect.cart_num = this.cart_num;
|
||||
}
|
||||
//如果没有属性,赋值给商品默认库存
|
||||
if (productSelect === undefined && !this.attribute.productAttr.length)
|
||||
productSelect = this.attribute.productSelect;
|
||||
if (productSelect === undefined && !this.attribute.productAttr.length) productSelect = this.attribute.productSelect;
|
||||
//无属性值即库存为0;不存在加减;
|
||||
if (productSelect === undefined) return;
|
||||
let stock = productSelect.stock || 0;
|
||||
let quotaShow = productSelect.quota_show || 0;
|
||||
let productStock = productSelect.product_stock || 0;
|
||||
let quota = productSelect.quota || 0;
|
||||
let num = this.attribute.productSelect;
|
||||
//设置默认数据
|
||||
if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
|
||||
if (changeValue) {
|
||||
num.cart_num ++;
|
||||
if(quotaShow >= productStock){
|
||||
if (num.cart_num > productStock) {
|
||||
this.$set(this.attribute.productSelect, "cart_num", productStock);
|
||||
this.$set(this, "cart_num", productStock);
|
||||
}
|
||||
}else{
|
||||
if (num.cart_num > quotaShow) {
|
||||
this.$set(this.attribute.productSelect, "cart_num", quotaShow);
|
||||
this.$set(this, "cart_num", quotaShow);
|
||||
let nums = this.storeInfo.onceNum || 0;
|
||||
//设置默认数据
|
||||
if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
|
||||
if (changeValue) {
|
||||
if (num.cart_num === this.onceNum) {
|
||||
return this.$util.Tips({
|
||||
title: `该商品每次限购${this.onceNum}${this.storeInfo.unitName}`
|
||||
});
|
||||
}
|
||||
num.cart_num++;
|
||||
let arrMin = [];
|
||||
arrMin.push(nums);
|
||||
arrMin.push(quota);
|
||||
arrMin.push(stock);
|
||||
let minN = Math.min.apply(null, arrMin);
|
||||
if (num.cart_num >= minN) {
|
||||
this.$set(this.attribute.productSelect, "cart_num", minN ? minN : 1);
|
||||
this.$set(this, "cart_num", minN ? minN : 1);
|
||||
}
|
||||
this.$set(this, "cart_num", num.cart_num);
|
||||
this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||
} else {
|
||||
num.cart_num--;
|
||||
if (num.cart_num < 1) {
|
||||
this.$set(this.attribute.productSelect, "cart_num", 1);
|
||||
this.$set(this, "cart_num", 1);
|
||||
}
|
||||
this.$set(this, "cart_num", num.cart_num);
|
||||
this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||
}
|
||||
this.$set(this, "cart_num", num.cart_num);
|
||||
this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||
|
||||
} else {
|
||||
num.cart_num--;
|
||||
if (num.cart_num < 1) {
|
||||
this.$set(this.attribute.productSelect, "cart_num", 1);
|
||||
this.$set(this, "cart_num", 1);
|
||||
}
|
||||
this.$set(this, "cart_num", num.cart_num);
|
||||
this.$set(this.attribute.productSelect, "cart_num", num.cart_num);
|
||||
}
|
||||
},
|
||||
},
|
||||
attrVal(val) {
|
||||
this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attr_values[val.indexn];
|
||||
this.attribute.productAttr[val.indexw].index = this.attribute.productAttr[val.indexw].attrValues[val.indexn];
|
||||
},
|
||||
/**
|
||||
* 属性变动赋值
|
||||
*
|
||||
*/
|
||||
ChangeAttr: function(res) {
|
||||
this.$set(this,'cart_num',1);
|
||||
this.$set(this, 'cart_num', 1);
|
||||
let productSelect = this.productValue[res];
|
||||
if (productSelect) {
|
||||
this.$set(this.attribute.productSelect, "image", productSelect.image);
|
||||
|
@ -670,7 +757,7 @@
|
|||
this.$set(this.attribute.productSelect, "unique", productSelect.unique);
|
||||
this.$set(this.attribute.productSelect, "cart_num", 1);
|
||||
this.$set(this.attribute.productSelect, "quota", productSelect.quota);
|
||||
this.$set(this.attribute.productSelect, "quota_show", productSelect.quota_show);
|
||||
this.$set(this.attribute.productSelect, "quotaShow", productSelect.quotaShow);
|
||||
this.$set(this, "attrValue", res);
|
||||
|
||||
this.attrTxt = "已选择"
|
||||
|
@ -681,7 +768,7 @@
|
|||
this.$set(this.attribute.productSelect, "unique", "");
|
||||
this.$set(this.attribute.productSelect, "cart_num", 0);
|
||||
this.$set(this.attribute.productSelect, "quota", 0);
|
||||
this.$set(this.attribute.productSelect, "quota_show", 0);
|
||||
this.$set(this.attribute.productSelect, "quotaShow", 0);
|
||||
this.$set(this, "attrValue", "");
|
||||
this.attrTxt = "已选择"
|
||||
}
|
||||
|
@ -689,7 +776,7 @@
|
|||
// 单独购买
|
||||
goProduct() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/goods_details/index?id=' + this.storeInfo.product_id
|
||||
url: '/pages/goods_details/index?id=' + this.storeInfo.productId
|
||||
})
|
||||
},
|
||||
// 立即购买
|
||||
|
@ -708,18 +795,16 @@
|
|||
title: '请选择属性'
|
||||
});
|
||||
var data = {
|
||||
productId: that.storeInfo.product_id,
|
||||
secKillId: 0,
|
||||
bargainId: 0,
|
||||
combinationId: that.id,
|
||||
cartNum: that.cart_num,
|
||||
uniqueId: productSelect !== undefined ? productSelect.unique : '',
|
||||
is_new: 1,
|
||||
productId: that.storeInfo.productId,
|
||||
combinationId:parseFloat(that.id),
|
||||
cartNum: that.cart_num ? this.cart_num : this.attribute.productSelect.cart_num,
|
||||
productAttrUnique: productSelect !== undefined ? productSelect.id : '',
|
||||
isNew: true,
|
||||
};
|
||||
postCartAdd(data).then(function(res) {
|
||||
that.isOpen = false
|
||||
uni.navigateTo({
|
||||
url: '/pages/users/order_confirm/index?cartId=' + res.data.cartId
|
||||
url: '/pages/users/order_confirm/index?new=true&cartId=' + res.data.cartId + '&combination=true'
|
||||
});
|
||||
}).catch(function(res) {
|
||||
uni.showToast({
|
||||
|
@ -734,11 +819,11 @@
|
|||
setCollect: function() {
|
||||
var that = this;
|
||||
if (this.storeInfo.userCollect) {
|
||||
collectDel(this.storeInfo.product_id).then(res => {
|
||||
collectDel(this.storeInfo.productId).then(res => {
|
||||
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||
})
|
||||
} else {
|
||||
collectAdd(this.storeInfo.product_id).then(res => {
|
||||
collectAdd(this.storeInfo.productId).then(res => {
|
||||
that.storeInfo.userCollect = !that.storeInfo.userCollect
|
||||
})
|
||||
}
|
||||
|
@ -773,7 +858,7 @@
|
|||
},
|
||||
//隐藏海报
|
||||
posterImageClose: function() {
|
||||
this.posterImageStatus = false
|
||||
this.canvasStatus = false
|
||||
},
|
||||
//替换安全域名
|
||||
setDomain: function(url) {
|
||||
|
@ -825,14 +910,11 @@
|
|||
that.$set(that, 'PromotionCode', '');
|
||||
});
|
||||
},
|
||||
getImageBase64: function() {
|
||||
getImageBase64: function(images) {
|
||||
let that = this;
|
||||
imageBase64(that.storeImage, that.PromotionCode)
|
||||
.then(res => {
|
||||
that.storeImage = res.data.image;
|
||||
that.PromotionCode = res.data.code;
|
||||
})
|
||||
.catch(() => {});
|
||||
imageBase64({url:images}).then(res=>{
|
||||
that.imgTop = res.data.code
|
||||
})
|
||||
},
|
||||
// 小程序关闭分享弹窗;
|
||||
goFriend: function() {
|
||||
|
@ -844,59 +926,61 @@
|
|||
goPoster: function() {
|
||||
let that = this;
|
||||
that.posters = false;
|
||||
that.$set(that, 'canvasStatus', true);
|
||||
let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
|
||||
// #ifndef H5
|
||||
if (that.isDown) return that.$util.Tips({
|
||||
title: '正在下载海报,请稍后再试!'
|
||||
});
|
||||
// #endif
|
||||
uni.getImageInfo({
|
||||
src: that.PromotionCode,
|
||||
fail: function(res) {
|
||||
return that.$util.Tips({
|
||||
title: '小程序二维码需要发布正式版后才能获取到'
|
||||
});
|
||||
},
|
||||
success() {
|
||||
if (arr2[2] == '') {
|
||||
//海报二维码不存在则从新下载
|
||||
// #ifndef H5
|
||||
that.downloadFilePromotionCode(function(msgPromotionCode) {
|
||||
arr2[2] = msgPromotionCode;
|
||||
if (arr2[2] == '')
|
||||
return that.$util.Tips({
|
||||
title: '海报二维码生成失败!'
|
||||
});
|
||||
that.$util.PosterCanvas(arr2, that.storeInfo.title, that.storeInfo.price, function(tempFilePath) {
|
||||
that.$set(that, 'posterImage', tempFilePath);
|
||||
that.$set(that, 'posterImageStatus', true);
|
||||
that.$set(that, 'canvasStatus', false);
|
||||
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
that.$util.PosterCanvas(arr2, that.storeInfo.title, that.storeInfo.price, function(tempFilePath) {
|
||||
that.$set(that, 'posterImage', tempFilePath);
|
||||
that.$set(that, 'posterImageStatus', true);
|
||||
that.$set(that, 'canvasStatus', false);
|
||||
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
|
||||
});
|
||||
// #endif
|
||||
} else {
|
||||
//生成推广海报
|
||||
that.$util.PosterCanvas(arr2, that.storeInfo.title, that.storeInfo.price, function(tempFilePath) {
|
||||
that.$set(that, 'posterImage', tempFilePath);
|
||||
that.$set(that, 'posterImageStatus', true);
|
||||
that.$set(that, 'canvasStatus', false);
|
||||
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden);
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
let arrImagesUrl = '';
|
||||
let arrImagesUrlTop = '';
|
||||
uni.downloadFile({
|
||||
url: that.imgTop, //仅为示例,并非真实的资源
|
||||
success: (res) => {
|
||||
arrImagesUrlTop = res.tempFilePath;
|
||||
let arrImages = [that.posterbackgd, arrImagesUrlTop, that.PromotionCode];
|
||||
let storeName = that.storeInfo.title;
|
||||
let price = that.storeInfo.price;
|
||||
setTimeout(() => {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
that.posterImage = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 小程序二维码
|
||||
getQrcode(){
|
||||
let that = this;
|
||||
let data = {
|
||||
pid: that.uid,
|
||||
id: that.id,
|
||||
path: 'pages/activity/goods_combination_details/index'
|
||||
}
|
||||
getQrcode(data).then(res=>{
|
||||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
});
|
||||
})
|
||||
},
|
||||
// 生成二维码;
|
||||
make() {
|
||||
let that = this;
|
||||
let href = location.href;
|
||||
let hrefs = href.indexOf("?") === -1 ? href + "?spread=" + uid : href + "&spread=" + that.uid;
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
text: hrefs,
|
||||
size: that.qrcodeSize,
|
||||
margin: 10,
|
||||
success: res => {
|
||||
that.PromotionCode = res;
|
||||
|
||||
},
|
||||
complete: (res) => {
|
||||
},
|
||||
fail:res=>{
|
||||
that.$util.Tips({
|
||||
title: '海报二维码生成失败!'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/*
|
||||
* 保存到手机相册
|
||||
*/
|
||||
|
@ -967,11 +1051,6 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
scroll: function(e) {
|
||||
var that = this,
|
||||
scrollY = e.detail.scrollTop;
|
||||
|
@ -1002,12 +1081,34 @@
|
|||
this.lock = true;
|
||||
this.scrollTop = index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[index]
|
||||
},
|
||||
},
|
||||
//#ifdef MP
|
||||
onShareAppMessage() {
|
||||
return {
|
||||
title: this.storeInfo.title,
|
||||
path: app.globalData.openPages,
|
||||
imageUrl: that.storeInfo.image
|
||||
};
|
||||
}
|
||||
//#endif
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
<style scoped lang="scss">
|
||||
.share-box {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.generate-posters {
|
||||
width: 100%;
|
||||
height: 170rpx;
|
||||
|
@ -1177,6 +1278,8 @@
|
|||
.product-con .assemble .item .pictxt .pictrue {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
background: #f0f0f0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.product-con .assemble .item .pictxt .pictrue image {
|
||||
|
@ -1197,6 +1300,7 @@
|
|||
color: #82848f;
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
|
||||
.product-con .assemble .item .right .spellBnt {
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
|
@ -1342,6 +1446,7 @@
|
|||
.canvas {
|
||||
width: 750px;
|
||||
height: 1190px;
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.poster-pop {
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
</view>
|
||||
<view class='noCommodity' v-if="seckillList.length == 0 && (page != 1 || active== 0)">
|
||||
<view class='pictrue'>
|
||||
<image src='/static/images/noShopper.png'></image>
|
||||
<image src='../../../static/images/noShopper.png'></image>
|
||||
</view>
|
||||
</view>
|
||||
<home></home>
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP -->
|
||||
<navigator hover-class="none" class="item" url="/pages/customer_list/index">
|
||||
<navigator hover-class="none" class="item" @click="kefuClick">
|
||||
<view class="iconfont icon-kefu"></view>
|
||||
<view>客服</view>
|
||||
</navigator>
|
||||
|
@ -106,6 +106,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"></shareRedPackets>
|
||||
<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
|
||||
@attrVal="attrVal" @iptCartNum="iptCartNum"></product-window>
|
||||
<!-- #ifdef MP -->
|
||||
|
@ -115,7 +116,7 @@
|
|||
<!-- 分享按钮 -->
|
||||
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
|
||||
<!-- #ifndef MP -->
|
||||
<button class="item" hover-class='none' v-if="weixinStatus === true" @click="setShareInfoStatus">
|
||||
<button class="item" hover-class='none' v-if="weixinStatus === true" @click="H5ShareBox = true">
|
||||
<view class="iconfont icon-weixin3"></view>
|
||||
<view class="">发送给朋友</view>
|
||||
</button>
|
||||
|
@ -149,6 +150,10 @@
|
|||
<canvas style="width:750px;height:1190px;" canvas-id="firstCanvas"></canvas>
|
||||
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
|
||||
</view>
|
||||
<!-- 发送给朋友图片 -->
|
||||
<view class="share-box" v-if="H5ShareBox">
|
||||
<image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
|
||||
</view>
|
||||
<!-- <view class='mask' v-if="canvasStatus"></view> -->
|
||||
<!--
|
||||
<canvas class="canvas" canvas-id='qrcode' v-if="canvasStatus"></canvas> -->
|
||||
|
@ -158,6 +163,7 @@
|
|||
<script>
|
||||
const app = getApp();
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
||||
import { base64src } from '@/utils/base64src.js'
|
||||
import {
|
||||
mapGetters
|
||||
} from "vuex";
|
||||
|
@ -184,6 +190,7 @@
|
|||
import parser from "@/components/jyf-parser/jyf-parser";
|
||||
import home from '@/components/home/index.vue'
|
||||
import countDown from '@/components/countDown';
|
||||
import shareRedPackets from '@/components/shareRedPackets';
|
||||
import {
|
||||
imageBase64
|
||||
} from "@/api/public";
|
||||
|
@ -260,10 +267,15 @@
|
|||
aloneAttrValueId: 0 ,//单规格规格id
|
||||
imagePath:'',//海报路径
|
||||
imgTop:'',
|
||||
H5ShareBox: false, //公众号分享图片
|
||||
sharePacket: {
|
||||
isState: true, //默认不显示
|
||||
},
|
||||
buyNum: 1
|
||||
}
|
||||
},
|
||||
components: {
|
||||
shareRedPackets,
|
||||
productConSwiper,
|
||||
'productWindow': productWindow,
|
||||
userEvaluation,
|
||||
|
@ -274,7 +286,7 @@
|
|||
authorize
|
||||
// #endif
|
||||
},
|
||||
computed: mapGetters(['isLogin','uid']),
|
||||
computed: mapGetters(['isLogin','uid','chatUrl']),
|
||||
onLoad(options) {
|
||||
|
||||
let that = this
|
||||
|
@ -334,6 +346,12 @@
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
kefuClick(){
|
||||
location.href = this.chatUrl;
|
||||
},
|
||||
closePosters:function(){
|
||||
this.posters = false;
|
||||
},
|
||||
getProductReplyList: function() {
|
||||
getReplyList(this.productId, {
|
||||
page: 1,
|
||||
|
@ -393,6 +411,7 @@
|
|||
// #endif
|
||||
// #ifdef MP
|
||||
that.getQrcode();
|
||||
that.imgTop = res.data.storeInfo.image
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
that.downloadFilestoreImage();
|
||||
|
@ -534,7 +553,6 @@
|
|||
//设置默认数据
|
||||
if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
|
||||
if (changeValue) {
|
||||
console.log(this.buyNum);
|
||||
if (num.cart_num === 1) {
|
||||
return this.$util.Tips({
|
||||
title: `该商品每次限购1${this.storeInfo.unitName}`
|
||||
|
@ -854,13 +872,30 @@
|
|||
goPoster: function() {
|
||||
let that = this;
|
||||
that.posters = false;
|
||||
let arrImages = [that.posterbackgd, that.imgTop, that.PromotionCode];
|
||||
let storeName = that.storeInfo.storeName;
|
||||
let price = that.storeInfo.price;
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
that.posterImage = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
let arrImagesUrl = '';
|
||||
let arrImagesUrlTop = '';
|
||||
uni.downloadFile({
|
||||
url: that.imgTop, //仅为示例,并非真实的资源
|
||||
success: (res) => {
|
||||
arrImagesUrlTop = res.tempFilePath;
|
||||
let arrImages = [that.posterbackgd, arrImagesUrlTop, that.PromotionCode];
|
||||
let storeName = that.storeInfo.storeName;
|
||||
let price = that.storeInfo.price;
|
||||
setTimeout(() => {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
that.posterImage = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
// let arrImages = [that.posterbackgd, that.imgTop, that.PromotionCode];
|
||||
// let storeName = that.storeInfo.storeName;
|
||||
// let price = that.storeInfo.price;
|
||||
// that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
// that.posterImage = tempFilePath;
|
||||
// that.canvasStatus = true;
|
||||
// });
|
||||
},
|
||||
// 小程序二维码
|
||||
getQrcode(){
|
||||
|
@ -868,10 +903,12 @@
|
|||
let data = {
|
||||
pid: that.uid,
|
||||
id: that.id,
|
||||
path: '/pages/goods_seckill_details/index'
|
||||
path: 'pages/activity/goods_seckill_details/index'
|
||||
}
|
||||
getQrcode(data).then(res=>{
|
||||
that.PromotionCode = res.data.code;
|
||||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
});
|
||||
})
|
||||
},
|
||||
// 生成二维码;
|
||||
|
@ -973,6 +1010,19 @@
|
|||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.share-box {
|
||||
z-index: 1000;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.generate-posters {
|
||||
width: 100%;
|
||||
height: 170rpx;
|
||||
|
|
|
@ -2,15 +2,24 @@
|
|||
<view>
|
||||
<view class='poster-poster'>
|
||||
<view class='tip'><text class='iconfont icon-shuoming'></text>提示:点击图片即可保存至手机相册 </view>
|
||||
<view class='pictrue'>
|
||||
<!-- <view class='pictrue'>
|
||||
<image :src='image' mode="widthFix"></image>
|
||||
</view> -->
|
||||
<view class='pictrue' v-if="canvasStatus">
|
||||
<image :src='imagePath'></image>
|
||||
</view>
|
||||
<view class="canvas">
|
||||
<canvas style="width:750px;height:1130px;" canvas-id="firstCanvas" id="firstCanvas"></canvas>
|
||||
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" style="opacity: 0;"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getBargainPoster, getCombinationPoster } from '../../../api/activity.js';
|
||||
import { getCombinationPink, getCombinationPoster } from '../../../api/activity.js';
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js';
|
||||
import { imageBase64 } from "@/api/public";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -24,7 +33,13 @@
|
|||
type: 0,
|
||||
id: 0,
|
||||
image: '',
|
||||
from:''
|
||||
from:'',
|
||||
storeCombination: {},
|
||||
qrcodeSize: 600,
|
||||
posterbackgd: '/static/images/canbj.png',
|
||||
PromotionCode: '',//二维码
|
||||
canvasStatus: false,
|
||||
imgTop: '' //商品图base64位
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
|
@ -64,26 +79,157 @@
|
|||
getPosterInfo: function() {
|
||||
var that = this,url = '';
|
||||
let data = {
|
||||
id: that.id,
|
||||
'from': that.from
|
||||
pinkId: parseFloat(that.id),
|
||||
from: that.from
|
||||
};
|
||||
if (that.type == 1) {
|
||||
getBargainPoster({
|
||||
bargainId: that.id,
|
||||
'from': that.from
|
||||
}).then(res => {
|
||||
that.image = res.data.url
|
||||
}).catch(err => {
|
||||
console.log(err)
|
||||
})
|
||||
|
||||
} else {
|
||||
getCombinationPoster(data).then(res => {
|
||||
that.image = res.data.url
|
||||
}).catch(err => {
|
||||
|
||||
})
|
||||
this.getCombinationPink();
|
||||
}
|
||||
},
|
||||
//拼团信息
|
||||
getCombinationPink: function() {
|
||||
var that = this;
|
||||
getCombinationPink(this.id)
|
||||
.then(res => {
|
||||
this.storeCombination = res.data;
|
||||
this.getImageBase64(res.data.storeCombination.image);
|
||||
// #ifdef H5
|
||||
that.make(res.data.userInfo.uid);
|
||||
// #endif
|
||||
})
|
||||
.catch(err => {
|
||||
this.$util.Tips({
|
||||
title: err
|
||||
});
|
||||
uni.redirectTo({
|
||||
success(){},
|
||||
fail() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/index/index',
|
||||
})
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
getImageBase64:function(images){
|
||||
let that = this;
|
||||
imageBase64({url:images}).then(res=>{
|
||||
that.imgTop = res.data.code
|
||||
})
|
||||
},
|
||||
// 生成二维码;
|
||||
make(uid) {
|
||||
let href = location.protocol + '//' + window.location.host + '/pages/activity/goods_combination_status/index?id=' + this.id + "&spread=" + uid;
|
||||
uQRCode.make({
|
||||
canvasId: 'qrcode',
|
||||
text: href,
|
||||
size: this.qrcodeSize,
|
||||
margin: 10,
|
||||
success: res => {
|
||||
this.PromotionCode = res;
|
||||
let arrImages = [this.posterbackgd, this.imgTop, this.PromotionCode];
|
||||
let storeName = this.storeCombination.storeCombination.title;
|
||||
let price = this.storeCombination.storeCombination.price;
|
||||
let people = this.storeCombination.storeCombination.people;
|
||||
let otPrice = this.storeCombination.storeCombination.otPrice;
|
||||
let count = this.storeCombination.count;
|
||||
this.PosterCanvas(arrImages, storeName, price, people,otPrice,count);
|
||||
},
|
||||
complete: () => {
|
||||
},
|
||||
fail:res=>{
|
||||
this.$util.Tips({
|
||||
title: '海报二维码生成失败!'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 生成海报
|
||||
PosterCanvas:function(arrImages, storeName, price, people,otPrice,count){
|
||||
uni.showLoading({
|
||||
title: '海报生成中',
|
||||
mask: true
|
||||
});
|
||||
let context = uni.createCanvasContext('firstCanvas')
|
||||
context.clearRect(0, 0, 0, 0);
|
||||
let that = this;
|
||||
uni.getImageInfo({
|
||||
src: arrImages[0],
|
||||
success: function (image) {
|
||||
console.log('啦啦', image)
|
||||
context.drawImage(arrImages[0], 0, 0, 750, 1190);
|
||||
context.setFontSize(36);
|
||||
context.setTextAlign('center');
|
||||
context.setFillStyle('#282828');
|
||||
let maxText = 17;
|
||||
let text = storeName;
|
||||
let topText = '';
|
||||
let bottomText = '';
|
||||
let len = text.length;
|
||||
if(len>maxText*2){
|
||||
text = text.slice(0,maxText*2-4)+'......';
|
||||
topText = text.slice(0,maxText-1);
|
||||
bottomText = text.slice(maxText-1,len);
|
||||
}else{
|
||||
if(len>maxText){
|
||||
topText = text.slice(0,maxText-1);
|
||||
bottomText = text.slice(maxText-1,len);
|
||||
}else{
|
||||
topText = text;
|
||||
bottomText = '';
|
||||
}
|
||||
}
|
||||
context.fillText(topText, 750/2, 60);
|
||||
context.fillText(bottomText, 750/2, 100);
|
||||
|
||||
context.drawImage(arrImages[1], 150, 350, 450, 450);
|
||||
context.save();
|
||||
context.drawImage(arrImages[2], 300, 950, 140, 140);
|
||||
context.restore();
|
||||
|
||||
context.setFontSize(72);
|
||||
context.setFillStyle('#fc4141');
|
||||
context.fillText(price, 220, 210);
|
||||
|
||||
context.setFontSize(32);
|
||||
context.setFillStyle('#FFFFFF');
|
||||
context.fillText( people+'人团', 538, 198);
|
||||
|
||||
|
||||
context.setFontSize(26);
|
||||
context.setFillStyle('#3F3F3F');
|
||||
context.setTextAlign('center');
|
||||
context.fillText( '原价:¥'+otPrice +' 还差 ' + count + '人 拼团成功', 750 / 2, 275);
|
||||
|
||||
context.draw(true,function(){
|
||||
uni.canvasToTempFilePath({
|
||||
destWidth: 750,
|
||||
destHeight: 1190,
|
||||
canvasId: 'firstCanvas',
|
||||
fileType: 'jpg',
|
||||
success: function(res) {
|
||||
console.log('啦啦222', res)
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
uni.hideLoading();
|
||||
//successFn && successFn(res.tempFilePath);
|
||||
that.imagePath = res.tempFilePath;
|
||||
console.log(that.imagePath)
|
||||
that.canvasStatus = true;
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log(err)
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: '无法获取图片信息'
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
showImage: function() {
|
||||
var that = this;
|
||||
let imgArr = this.image.split(',')
|
||||
|
@ -108,7 +254,11 @@
|
|||
page {
|
||||
background-color: #d22516 !important;
|
||||
}
|
||||
|
||||
.canvas {
|
||||
position:fixed;
|
||||
z-index: -5;
|
||||
opacity: 0;
|
||||
}
|
||||
.poster-poster .tip {
|
||||
height: 80rpx;
|
||||
font-size: 26rpx;
|
||||
|
@ -125,7 +275,7 @@
|
|||
|
||||
.poster-poster .pictrue {
|
||||
width: 690rpx;
|
||||
height: 100%;
|
||||
height: 1130rpx;
|
||||
margin: 0 auto 50rpx auto;
|
||||
}
|
||||
|
||||
|
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
@ -7,7 +7,7 @@
|
|||
placeholder-class='placeholder'></input>
|
||||
</view>
|
||||
</view>
|
||||
<view class='aside'>
|
||||
<view class='aside' :style="{bottom: tabbarH + 'px',height: height + 'rpx'}">
|
||||
<view class='item acea-row row-center-wrapper' :class='index==navActive?"on":""' v-for="(item,index) in productList"
|
||||
:key="index" @click='tap(index,"b"+index)'><text>{{item.name}}</text></view>
|
||||
</view>
|
||||
|
@ -54,19 +54,22 @@
|
|||
number: "",
|
||||
height: 0,
|
||||
hightArr: [],
|
||||
toView: ""
|
||||
toView: "",
|
||||
tabbarH: 0
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.getAllCategory();
|
||||
},
|
||||
onShow(){},
|
||||
onShow(){
|
||||
},
|
||||
methods: {
|
||||
infoScroll: function() {
|
||||
let that = this;
|
||||
let len = that.productList.length;
|
||||
let child = that.productList[len - 1]&&that.productList[len - 1].child?that.productList[len - 1].child:[];
|
||||
this.number = child?child.length:0;
|
||||
|
||||
//设置商品列表高度
|
||||
uni.getSystemInfo({
|
||||
success: function(res) {
|
||||
|
@ -139,7 +142,7 @@
|
|||
z-index: 9;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
|
||||
.productSort .header .input {
|
||||
width: 700rpx;
|
||||
height: 60rpx;
|
||||
|
@ -148,41 +151,41 @@
|
|||
box-sizing: border-box;
|
||||
padding: 0 25rpx;
|
||||
}
|
||||
|
||||
|
||||
.productSort .header .input .iconfont {
|
||||
font-size: 35rpx;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
|
||||
.productSort .header .input .placeholder {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
|
||||
.productSort .header .input input {
|
||||
font-size: 26rpx;
|
||||
height: 100%;
|
||||
width: 597rpx;
|
||||
}
|
||||
|
||||
|
||||
.productSort .aside {
|
||||
position: fixed;
|
||||
width: 180rpx;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
top:0;
|
||||
background-color: #f7f7f7;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
height: auto;
|
||||
margin-top: 96rpx;
|
||||
}
|
||||
|
||||
|
||||
.productSort .aside .item {
|
||||
height: 100rpx;
|
||||
width: 100%;
|
||||
font-size: 26rpx;
|
||||
color: #424242;
|
||||
}
|
||||
|
||||
|
||||
.productSort .aside .item.on {
|
||||
background-color: #fff;
|
||||
border-left: 4rpx solid #fc4141;
|
||||
|
@ -191,55 +194,55 @@
|
|||
color: #fc4141;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter {
|
||||
margin: 96rpx 0 0 180rpx;
|
||||
padding: 0 14rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .listw {
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .listw .title {
|
||||
height: 90rpx;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .listw .title .line {
|
||||
width: 100rpx;
|
||||
height: 2rpx;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .listw .title .name {
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
margin: 0 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .list {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .list .item {
|
||||
width: 177rpx;
|
||||
margin-top: 26rpx;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .list .item .picture {
|
||||
width: 120rpx;
|
||||
height: 120rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .list .item .picture image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
||||
.productSort .conter .list .item .name {
|
||||
font-size: 24rpx;
|
||||
color: #333;
|
||||
|
|
|
@ -216,6 +216,7 @@
|
|||
|
||||
<script>
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
||||
import { base64src } from '@/utils/base64src.js'
|
||||
// import yzf_chat from '@/plugin/chat/yzf_chat.js'
|
||||
import store from '@/store';
|
||||
import {
|
||||
|
@ -556,7 +557,7 @@
|
|||
getUserInfo: function() {
|
||||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
that.$set(that.sharePacket, 'isState', that.sharePacket.priceName != 0 ? false : true);
|
||||
that.$set(that.sharePacket, 'isState', that.sharePacket.priceName != '0' ? false : true);
|
||||
store.commit('SETUID', res.data.uid);
|
||||
// that.$set(that, 'uid', res.data.uid);
|
||||
// #ifdef H5
|
||||
|
@ -668,7 +669,7 @@
|
|||
that.$set(that.attr, 'productAttr', res.data.productAttr);
|
||||
that.$set(that, 'productValue', res.data.productValue);
|
||||
that.$set(that.sharePacket, 'priceName', res.data.priceName);
|
||||
that.$set(that, 'systemStore', res.data.system_store);
|
||||
that.$set(that, 'systemStore', storeInfo.systemStore);
|
||||
that.$set(that, 'good_list', goodArray);
|
||||
that.$set(that, 'activityH5', res.data.storeInfo.activityAllH5 ? res.data.storeInfo.activityAllH5 : []);
|
||||
uni.setNavigationBarTitle({
|
||||
|
@ -681,6 +682,7 @@
|
|||
that.$set(that, 'navList', navList);
|
||||
// #ifdef H5
|
||||
that.$set(that, 'storeImage', that.storeInfo.image);
|
||||
that.getImageBase64(res.data.storeInfo.image);
|
||||
if (that.isLogin) {
|
||||
that.getCartCount();
|
||||
that.ShareInfo();
|
||||
|
@ -697,11 +699,13 @@
|
|||
setTimeout(function() {
|
||||
that.infoScroll();
|
||||
}, 500);
|
||||
// #ifdef MP
|
||||
that.imgTop = res.data.storeInfo.image
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
that.downloadFilestoreImage();
|
||||
// #endif
|
||||
that.DefaultSelect();
|
||||
that.getImageBase64(res.data.storeInfo.image);
|
||||
}).catch(err => {
|
||||
//状态异常返回上级页面
|
||||
return that.$util.Tips({
|
||||
|
@ -1106,10 +1110,14 @@
|
|||
let data = {
|
||||
pid: that.uid,
|
||||
id: that.id,
|
||||
path: '/pages/goods_details/index'
|
||||
path: 'pages/goods_details/index'
|
||||
}
|
||||
getQrcode(data).then(res=>{
|
||||
that.PromotionCode = res.data.code;
|
||||
//that.PromotionCode = res.data.code;
|
||||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
console.log('第一张',that.PromotionCode)
|
||||
});
|
||||
})
|
||||
},
|
||||
// 生成二维码;
|
||||
|
@ -1139,21 +1147,99 @@
|
|||
let that = this;
|
||||
imageBase64({url:images}).then(res=>{
|
||||
that.imgTop = res.data.code
|
||||
//this.storeImage = res.data.code;
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 获取产品分销二维码
|
||||
* @param function successFn 下载完成回调
|
||||
*
|
||||
*/
|
||||
downloadFilePromotionCode: function(successFn) {
|
||||
let that = this;
|
||||
getProductCode(that.id)
|
||||
.then(res => {
|
||||
uni.downloadFile({
|
||||
url: that.setDomain(res.data.code),
|
||||
success: function(res) {
|
||||
that.$set(that, 'isDown', false);
|
||||
if (typeof successFn == 'function') successFn && successFn(res.tempFilePath);
|
||||
else that.$set(that, 'PromotionCode', res.tempFilePath);
|
||||
},
|
||||
fail: function() {
|
||||
that.$set(that, 'isDown', false);
|
||||
that.$set(that, 'PromotionCode', '');
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
that.$set(that, 'isDown', false);
|
||||
that.$set(that, 'PromotionCode', '');
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 生成海报
|
||||
*/
|
||||
// goPoster: function() {
|
||||
// debugger
|
||||
// let that = this;
|
||||
// that.posters = false;
|
||||
|
||||
// that.$set(that, 'canvasStatus', true);
|
||||
// let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode];
|
||||
|
||||
// // // #ifndef H5
|
||||
// if (that.isDown)
|
||||
// return that.$util.Tips({
|
||||
// title: '正在下载海报,请稍后再试!'
|
||||
// });
|
||||
// // // #endif
|
||||
// uni.getImageInfo({
|
||||
// src: that.PromotionCode,
|
||||
// fail: function(res) {
|
||||
// console.log(res)
|
||||
// // #ifdef H5
|
||||
// return that.$util.Tips({
|
||||
// title: res
|
||||
// });
|
||||
// // #endif
|
||||
// // #ifdef MP
|
||||
// return that.$util.Tips({
|
||||
// title: '小程序二维码需要发布正式版后才能获取到'
|
||||
// });
|
||||
// // #endif
|
||||
// },
|
||||
// success(res) {
|
||||
// console.log('成功',res)
|
||||
// //生成推广海报
|
||||
// that.$util.PosterCanvas(arr2, that.storeInfo.storeName, that.storeInfo.price, function(tempFilePath) {
|
||||
// that.imagePath = tempFilePath;
|
||||
// that.canvasStatus = true;
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
// },
|
||||
goPoster: function() {
|
||||
let that = this;
|
||||
that.posters = false;
|
||||
let arrImages = [that.posterbackgd, that.imgTop, that.PromotionCode];
|
||||
let storeName = that.storeInfo.storeName;
|
||||
let price = that.storeInfo.price;
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
that.imagePath = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
that.posters = false;
|
||||
let arrImagesUrl = '';
|
||||
let arrImagesUrlTop = '';
|
||||
uni.downloadFile({
|
||||
url: that.imgTop, //仅为示例,并非真实的资源
|
||||
success: (res) => {
|
||||
arrImagesUrlTop = res.tempFilePath;
|
||||
let arrImages = [that.posterbackgd, arrImagesUrlTop, that.PromotionCode];
|
||||
let storeName = that.storeInfo.storeName;
|
||||
let price = that.storeInfo.price;
|
||||
setTimeout(() => {
|
||||
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
|
||||
that.imagePath = tempFilePath;
|
||||
that.canvasStatus = true;
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
/*
|
||||
* 保存到手机相册
|
||||
|
|
|
@ -0,0 +1,239 @@
|
|||
<template>
|
||||
<!-- 秒杀 -->
|
||||
<view class="seckill" v-if="spikeList.length">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="pictrue">
|
||||
<image src="/static/images/seckillTitle.png"></image>
|
||||
</view>
|
||||
<view class="lines"></view>
|
||||
<view class="point">{{point}} 场</view>
|
||||
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '" :second-text="' '"
|
||||
:datatime="datatime"></countDown>
|
||||
</view>
|
||||
<navigator url="/pages/activity/goods_seckill/index" hover-class="none" class="more acea-row row-center-wrapper">更多<text class="iconfont icon-xiangyou"></text></navigator>
|
||||
</view>
|
||||
<view class="conter">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
|
||||
<view class="itemCon" v-for="(item, index) in spikeList" :key="index" @click="goDetail(item)">
|
||||
<view class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="item.image"></image>
|
||||
</view>
|
||||
<view class="name line1">{{item.title}}</view>
|
||||
<view class="money acea-row row-between-wrapper">
|
||||
<view class="y_money acea-row row-center-wrapper line1">¥{{item.otPrice}}</view>
|
||||
<view class="x_money acea-row row-center-wrapper line1">¥<text class="num">{{item.price}}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let app = getApp();
|
||||
import countDown from "@/components/countDown";
|
||||
import {
|
||||
getSeckillHeaderApi,
|
||||
getSeckillList
|
||||
} from '@/api/activity.js';
|
||||
export default {
|
||||
name: 'a_seckill',
|
||||
components: {
|
||||
countDown
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
spikeList: [], // 秒杀
|
||||
point: '',
|
||||
datatime: 0,
|
||||
status: 0
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getSeckillIndexTime();
|
||||
},
|
||||
methods: {
|
||||
getSeckillIndexTime() {
|
||||
let limit = this.$config.LIMIT;
|
||||
let params = {
|
||||
page: 1,
|
||||
limit: limit,
|
||||
type: 'index'
|
||||
}
|
||||
getSeckillHeaderApi().then(res => {
|
||||
if(res.data.seckillTime.length){
|
||||
this.datatime = parseFloat(res.data.seckillTime[res.data.seckillTimeIndex].timeSwap);
|
||||
let id = res.data.seckillTime[res.data.seckillTimeIndex].id;
|
||||
this.point = res.data.seckillTime[res.data.seckillTimeIndex].time;
|
||||
this.status = res.data.seckillTime[res.data.seckillTimeIndex].status;
|
||||
getSeckillList(id, params).then(({data}) => {
|
||||
data.list.forEach((item) => {
|
||||
let num = 0
|
||||
if (item.price > 0 && item.otPrice > 0) num = ((parseFloat(item.price) / parseFloat(item.otPrice)).toFixed(
|
||||
2))
|
||||
item.discountNum = this.$util.$h.Mul(num, 10)
|
||||
})
|
||||
this.spikeList = data.list
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
goDetail(item){
|
||||
uni.navigateTo({
|
||||
url: '/pages/activity/goods_seckill_details/index?id=' + item.id + '&time=' + this.datatime + '&status=' + this.status + '&productId=' + item.productId
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.default{
|
||||
width: 690rpx;
|
||||
height: 300rpx;
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
background-color: #ccc;
|
||||
text-align: center;
|
||||
line-height: 300rpx;
|
||||
.iconfont{
|
||||
font-size: 80rpx;
|
||||
}
|
||||
}
|
||||
.seckill {
|
||||
width: 690rpx;
|
||||
height: 420rpx;
|
||||
background: linear-gradient(139deg, #E4F1FD 0%, #C4D9EC 100%);
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
padding: 23rpx 12rpx 13rpx 12rpx;
|
||||
|
||||
.title {
|
||||
.pictrue {
|
||||
width: 148rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.lines {
|
||||
width: 1rpx;
|
||||
height: 24rpx;
|
||||
background-color: rgba(29, 176, 252, 0.6);
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
.point {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #00A4F8;
|
||||
margin-left: 16rpx;
|
||||
}
|
||||
|
||||
// /deep/.time {
|
||||
// font-size: 24rpx;
|
||||
|
||||
.styleAll {
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
background-color: #2F2F2F;
|
||||
border-radius: 6rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
// .red {
|
||||
// &~.red {
|
||||
// color: #2F2F2F;
|
||||
// padding: 0 4rpx;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
.more {
|
||||
width: 86rpx;
|
||||
height: 36rpx;
|
||||
background: linear-gradient(90deg, #3BBEFF 0%, #1DB0FC 100%);
|
||||
border-radius: 21rpx;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
padding-left: 8rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 21rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.conter {
|
||||
width: 666rpx;
|
||||
height: 320rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 24rpx 0 25rpx 16rpx;
|
||||
margin-top: 26rpx;
|
||||
|
||||
.itemCon {
|
||||
display: inline-block;
|
||||
width: 174rpx;
|
||||
margin-right: 24rpx;
|
||||
|
||||
.item {
|
||||
width: 100%;
|
||||
|
||||
.pictrue {
|
||||
width: 100%;
|
||||
height: 174rpx;
|
||||
border-radius: 6rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 24rpx;
|
||||
color: #000;
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
.money {
|
||||
background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK4AAAAiCAMAAADxoBJ/AAAC9FBMVEUAAAD/v4D/AAD/JCT/34D/dEb/MCD/Hh7/gFX4Ixz/fFH/25r53Jf/KiX/3Jb7Hx/72ZX7JSH8Ih//gFH/gU/825j8KSP83Zf/gFL8KiT/gE//gFH83Jb9Lyj63Zj7LSb7ISH73Zf8JCD/gFL83Jf8JiH/gFL7MSj8Ih/73Jf/gFL73Jf625b6IR/73Jf7Myn625f7ISD725f8LSb8ISD725f/gFH8JyP73Jb7IR//gFH7NCr8IyH/gFH725b/gFL7LCX8Lyj/gFH73Jf7KST725b8JiP7IB/7KST/gFL7IB/7ISD7IiD7IiH7IyH7JCH7JCL7JSL7JiL7JiP7JyP7KCP7KCT7KST7KiT7KiX7KyX7LCX7LCb7LSb7Lif7Lyf7Lyj7MCj7MSj7MSn7Min7Myn7Myr7NCr7NSr7woT7x4f7y4r7zIv7zoz70Y/71ZH72JT72pX725b73Jf8NSr8NSv8Niv8Nyv8Nyz8OCz8OSz8OS38Oi38Oy38Oy78PC78PS78PS/8Pi/8Py/8PzD8QDD8QTH8QjH8QjL8QzL8RDL8RDP8RTP8RjP8RjT8RzT8SDT8SDX8STX8SjX8Sjb8Szb8TDb8TDf8TTf8qXH8r3X8sHb8tHn8uX38voD9TTf9Tjf9Tjj9Tzj9UDj9UDn9UTn9Ujn9Ujr9Uzr9VDv9VTv9VTz9Vjz9Vzz9Vz39WD39WT39WT79Wj79Wz79Wz/9XD/9XT/9XUD9XkD9X0D9X0H9YEH9YUH9YUL9YkL9Y0L9Y0P9ZEP9kl/9k2D9lWL9l2P9nGf9oWr9pW7+ZUP+ZUT+ZkT+Z0X+aEX+aEb+aUb+akb+akf+a0f+bEf+bEj+bUj+bkj+bkn+b0n+cEn+cEr+cUr+ckr+ckv+c0v+dEv+dEz+dUz+dkz+dk3+d03+eE3+eE7+eU7+ek/+e0/+e1D+fFD+gFL+gVL+glP+glT+hVb+iVj+jVv+j13+kV//fFD/fVD/fVH/flH/f1H/f1L/gFIKQsJBAAAAS3RSTlMABAUHCAsQERIkKSssMDM5PEVLTE1PUVNUVlpeX2ZvfoWHlpaboK+xtL/By8/T09TX19fd4uPl5ufr6+3u8fPz9fX19/r7+/z8/P18NdbWAAAC60lEQVRYw72XO3PTQBSFT4QBJ/Y4jgkEnEkmUAR7xmNek4oZmjS0lFT8DP4XDcNjYKioKWgoPBlIk4rCD0mJfQ/FruSVtRg7vsKNpfVK+vbcs/fIayjgc/VWpV59B6EMJ6RQKELhxHyRoXCSDE6/QgpF7BQRighFvg6i0dl5cueSPmx5t/kJAEhSzBBBkqA5C0kC5owUM8oYpPnBXkuAGHSEk5Pe6aQo3O3DLynjCAAgGTxLRHjx3Dk0x4L9ve8/+gCAK9q0zcfvkeJekBQSpBFYSABjWjwzDDNlTIIQUxGChJCMzZSbldGwCNwbT94kh+Zh5sm0fCDMIhJUEbuU2OBZy1DMYd/6iNX6cKCPu/HorUM7YlLnKR4Z2RUYJc0UyDhdj1uRODEMy5XfERDo4h58TA+tD2XGh56tJ96tlxg6GW4cXtfGvf3NPUtQ5+PN23p9d+vt7TudobS1WW4crYj7wmGljCyHpLYFyNCLFzudAU5F4FTk7mlocUvN5tPVxT1vYcYLiTKpMxKxHbm5qNyVOz2DW7t3rOGF7mb2PNdAPc5I10NjXE6ncHYDNE9KALDTeahi3VaWdOVI62f2KtGolwDsdLsqtBdt1wtakeYuuRYAlfs6tDkvJOplCw1/oRfqdOUAawdHSm2s7UHNKykGlW6ni714/VxF1gPsPleiHWetO/IWOvIpme10bkVmDFMOsK2VEd0aCos0W5FaUD9GEV6AI8xCkTZ7gdu5UwFKwZYW7aSdjTRmUC1W6MWLvesZ5OVGUFbzQtUbaZ4WYF66low0c5+gWowX9CONABA8U6KVdsGRRlLxBTKqZKQtINIIRdxXmLGueqRBEZfFR5qmutGGYqT9xTCKuA+waqTNe3mfdgYl3Je5LgZHJv9/i2yk/bPTKeLG6xnjDt0G6kSaT+7FI00Pt4vLRNrynU4Jt3WpSFuu0ynidrQiTeZEGsDggwrutf8RacCvoPdZA/d1NC/SqBNpOPv5BzLdj5F4zSdUAAAAAElFTkSuQmCC") no-repeat;
|
||||
background-size: 100% 100%;
|
||||
width: 174rpx;
|
||||
height: 34rpx;
|
||||
margin-top: 14rpx;
|
||||
|
||||
.y_money {
|
||||
font-size: 20rpx;
|
||||
color: #905100;
|
||||
text-decoration: line-through;
|
||||
width: 75rpx;
|
||||
height: 28rpx;
|
||||
line-height: 28rpx;
|
||||
}
|
||||
|
||||
.x_money {
|
||||
width: 100rpx;
|
||||
color: #fff;
|
||||
font-size: 20rpx;
|
||||
height: 100%;
|
||||
|
||||
.num {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,182 @@
|
|||
<template>
|
||||
<view :class="{borderShow:isBorader}">
|
||||
<view class="combination" v-if="combinationList.length">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="sign">
|
||||
<image src="../../../static/images/sign02.png"></image>
|
||||
</view>
|
||||
<view class="name">拼团惠<text>享超值开团价</text></view>
|
||||
</view>
|
||||
<navigator url="/pages/activity/goods_combination/index" hover-class="none" class="more acea-row row-center-wrapper">超值精选<text class="iconfont icon-xiangyou"></text></navigator>
|
||||
</view>
|
||||
<view class="conter acea-row">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
|
||||
<view class="itemCon" v-for="(item, index) in combinationList" :key="index" @click="goDetail(item)">
|
||||
<view class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="item.image"></image>
|
||||
</view>
|
||||
<view class="text lines1">
|
||||
<text class="money">¥<text class="num">{{item.price}}</text></text>
|
||||
<!-- <text class="y_money">¥{{item.otPrice}}</text> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <navigator :url="`/pages/activity/goods_combination_details/index?id=${item.id}`" hover-class="none" class="item" v-for="(item, index) in combinationList" :key="index">
|
||||
<view class="pictrue">
|
||||
<image :src="item.image"></image>
|
||||
</view>
|
||||
<view class="text lines1">
|
||||
<text class="money">¥<text class="num">{{item.price}}</text></text>
|
||||
<text class="y_money">¥{{item.otPrice}}</text>
|
||||
</view>
|
||||
</navigator> -->
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let app = getApp();
|
||||
import {
|
||||
getCombinationList
|
||||
} from '@/api/activity.js';
|
||||
export default {
|
||||
name: 'b_combination',
|
||||
data() {
|
||||
return {
|
||||
combinationList: [],
|
||||
isBorader:false,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getCombinationList();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 拼团列表
|
||||
getCombinationList: function() {
|
||||
let that = this;
|
||||
// let limit = that.$config.LIMIT;
|
||||
let data = {
|
||||
page: 1,
|
||||
limit: 4
|
||||
};
|
||||
getCombinationList(data).then(function(res) {
|
||||
that.combinationList = res.data.list;
|
||||
}).catch((res) => {
|
||||
return that.$util.Tips({
|
||||
title: res
|
||||
});
|
||||
})
|
||||
},
|
||||
goDetail(item){
|
||||
uni.navigateTo({
|
||||
url: `/pages/activity/goods_combination_details/index?id=${item.id}`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.default{
|
||||
width: 690rpx;
|
||||
height: 300rpx;
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
background-color: #ccc;
|
||||
text-align: center;
|
||||
line-height: 300rpx;
|
||||
.iconfont{
|
||||
font-size: 80rpx;
|
||||
}
|
||||
}
|
||||
.combination{
|
||||
width: 690rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
padding: 25rpx 20rpx 21rpx 20rpx;
|
||||
|
||||
.title {
|
||||
.sign {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 32rpx;
|
||||
color: #282828;
|
||||
margin-left: 12rpx;
|
||||
font-weight: bold;
|
||||
|
||||
text {
|
||||
color: #797979;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.more {
|
||||
width: 122rpx;
|
||||
height: 37rpx;
|
||||
background: linear-gradient(270deg, #1DB0FC 0%, #22CAFD 100%);
|
||||
border-radius: 21rpx;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
padding-left: 2rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.conter{
|
||||
margin-top: 18rpx;
|
||||
.itemCon {
|
||||
display: inline-block;
|
||||
width: 174rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.item{
|
||||
width:100%;
|
||||
.pictrue{
|
||||
width: 100%;
|
||||
height: 174rpx;
|
||||
border-radius: 6rpx;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
.text{
|
||||
margin-top: 4rpx;
|
||||
.money{
|
||||
font-size: 24rpx;
|
||||
color: #FD502F;
|
||||
font-weight: bold;
|
||||
.num{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.y_money{
|
||||
color: #959595;
|
||||
text-decoration: line-through;
|
||||
font-size: 20rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,174 @@
|
|||
<template>
|
||||
<view :class="{borderShow:isBorader}">
|
||||
<view class="combination" v-if="bargList.length">
|
||||
<view class="title acea-row row-between-wrapper">
|
||||
<view class="acea-row row-middle">
|
||||
<view class="sign">
|
||||
<image src="../../../static/images/sign03.png"></image>
|
||||
</view>
|
||||
<view class="name">砍价活动<text>呼朋唤友来砍价</text></view>
|
||||
</view>
|
||||
<navigator url="/pages/activity/goods_bargain/index" hover-class="none" class="more acea-row row-center-wrapper">品质好货<text class="iconfont icon-xiangyou"></text></navigator>
|
||||
</view>
|
||||
<view class="conter acea-row">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; vertical-align: middle;" show-scrollbar="false">
|
||||
<view class="itemCon" v-for="(item, index) in bargList" :key="index" @click="bargDetail(item)">
|
||||
<view class="item">
|
||||
<view class="pictrue">
|
||||
<image :src="item.image"></image>
|
||||
</view>
|
||||
<view class="text lines1">
|
||||
<text class="money">¥<text class="num">{{item.minPrice}}</text></text>
|
||||
<text class="y_money">¥{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
let app = getApp();
|
||||
import {
|
||||
toLogin
|
||||
} from '@/libs/login.js';
|
||||
import {
|
||||
getBargainList
|
||||
} from '@/api/activity.js';
|
||||
import { mapGetters } from 'vuex';
|
||||
export default {
|
||||
name: 'c_bargain',
|
||||
computed: mapGetters(['uid']),
|
||||
data() {
|
||||
return {
|
||||
bargList: [],
|
||||
isBorader:false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getBargainList();
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
// 砍价列表
|
||||
getBargainList() {
|
||||
let limit = this.$config.LIMIT;
|
||||
getBargainList({
|
||||
page: 1,
|
||||
limit: limit
|
||||
}).then(res => {
|
||||
this.bargList = res.data.list
|
||||
})
|
||||
},
|
||||
bargDetail(item){
|
||||
uni.navigateTo({
|
||||
url: `/pages/activity/goods_bargain_details/index?id=${item.id}&bargain=${this.uid}`
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.default{
|
||||
width: 690rpx;
|
||||
height: 300rpx;
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
background-color: #ccc;
|
||||
text-align: center;
|
||||
line-height: 300rpx;
|
||||
.iconfont{
|
||||
font-size: 80rpx;
|
||||
}
|
||||
}
|
||||
.combination{
|
||||
width: 690rpx;
|
||||
// height: 288rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 14rpx;
|
||||
margin: 26rpx auto 0 auto;
|
||||
padding: 25rpx 20rpx 21rpx 20rpx;
|
||||
|
||||
.title {
|
||||
.sign {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-size: 32rpx;
|
||||
color: #282828;
|
||||
margin-left: 12rpx;
|
||||
font-weight: bold;
|
||||
|
||||
text {
|
||||
color: #797979;
|
||||
font-size: 24rpx;
|
||||
font-weight: 400;
|
||||
margin-left: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.more {
|
||||
width: 122rpx;
|
||||
height: 37rpx;
|
||||
background: linear-gradient(135deg, #FF9F6C 0%, #FD502F 100%);
|
||||
border-radius: 21rpx;
|
||||
font-size: 22rpx;
|
||||
color: #fff;
|
||||
padding-left: 2rpx;
|
||||
|
||||
.iconfont {
|
||||
font-size: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
.conter{
|
||||
margin-top: 18rpx;
|
||||
.itemCon {
|
||||
display: inline-block;
|
||||
width: 174rpx;
|
||||
margin-right: 24rpx;
|
||||
}
|
||||
.item{
|
||||
width:100%;
|
||||
.pictrue{
|
||||
width: 100%;
|
||||
height: 174rpx;
|
||||
border-radius: 6rpx;
|
||||
image{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 6rpx;
|
||||
}
|
||||
}
|
||||
.text{
|
||||
margin-top: 4rpx;
|
||||
.money{
|
||||
font-size: 24rpx;
|
||||
color: #FD502F;
|
||||
font-weight: bold;
|
||||
.num{
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
.y_money{
|
||||
color: #959595;
|
||||
text-decoration: line-through;
|
||||
font-size: 20rpx;
|
||||
margin-left: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -141,6 +141,9 @@
|
|||
</block>
|
||||
</swiper>
|
||||
</view>
|
||||
<a_seckill></a_seckill>
|
||||
<b_combination></b_combination>
|
||||
<c_bargain></c_bargain>
|
||||
<!-- 首页推荐 -->
|
||||
<view class="index-product-wrapper" :class="iSshowH?'on':''">
|
||||
<view class="nav-bd">
|
||||
|
@ -177,40 +180,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 秒杀 -->
|
||||
<view class="spike-box" :style="" v-if="spikeList.length>0">
|
||||
<view class="hd">
|
||||
<view class="left">
|
||||
<image :src="imgUrl" class="icon" v-if="imgUrl"></image>
|
||||
<image src="/static/images/spike-icon-002.gif" class="icon" v-else></image>
|
||||
|
||||
<view class="name">限时秒杀</view>
|
||||
<!-- <image src="/static/images/spike-icon-001.png" class="title"></image> -->
|
||||
<countDown :is-day="false" :tip-text="' '" :day-text="' '" :hour-text="' : '" :minute-text="' : '" :second-text="' '"
|
||||
:datatime="datatime" :bgColor="countDownColor" :colors="themeColor"></countDown>
|
||||
</view>
|
||||
<navigator class="more" url="/pages/activity/goods_seckill/index">更多 <text class="iconfont icon-jiantou"
|
||||
hover-class='none'></text></navigator>
|
||||
</view>
|
||||
<view class="spike-wrapper">
|
||||
<scroll-view scroll-x="true" style="white-space: nowrap; display: flex" show-scrollbar="false">
|
||||
<navigator class="spike-item" :style="'margin-right:'+ lrConfig +'rpx;'" v-for="(item,index) in spikeList" :key="index" :url="'/pages/activity/goods_seckill_details/index?id='+item.id+'&time='+datatime+'&status=1'"
|
||||
hover-class='none'>
|
||||
<view class="img-box">
|
||||
<image :src="item.image" mode=""></image>
|
||||
<view class="msg flex-aj-center" :style="'color:'+ themeColor +';border-color:'+ themeColor +';'">{{item.discountNum}}折起</view>
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="name line1">{{item.title}}</view>
|
||||
<view class="price-box">
|
||||
<text class="tips" :style="'background-color:'+ themeColor +';'">抢</text>
|
||||
<text class="price" :style="'color:'+themeColor+';'"><text>¥</text>{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 分类页 -->
|
||||
<view class="productList" v-if="navIndex>0" :style="'margin-top:'+prodeuctTop+'px'">
|
||||
<block v-if="sortProduct.length>0">
|
||||
|
@ -230,7 +199,7 @@
|
|||
<view class='vip-money' v-if="item.vipPrice && item.vipPrice > 0">¥{{item.vipPrice}}
|
||||
<image src='../../static/images/vip.png'></image>
|
||||
</view>
|
||||
<view>已售{{Number(item.sales) + Number(item.ficti) || 0}}{{item.unitName}</view>
|
||||
<view>已售{{Number(item.sales) + Number(item.ficti) || 0 }}{{item.unitName}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -242,11 +211,10 @@
|
|||
<block v-if="sortProduct.length == 0">
|
||||
<view class="noCommodity">
|
||||
<view class='pictrue'>
|
||||
<image src='/static/images/noShopper.png'></image>
|
||||
<image src='../../static/images/noShopper.png'></image>
|
||||
</view>
|
||||
<recommend :hostProduct="hostProduct"></recommend>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
</view>
|
||||
<coupon-window :window='window' :couponList="couponList" @onColse="onColse"></coupon-window>
|
||||
|
@ -265,10 +233,6 @@
|
|||
getIndexData,
|
||||
getCoupons
|
||||
} from '@/api/api.js';
|
||||
import {
|
||||
getSeckillHeaderApi,
|
||||
getSeckillList
|
||||
} from '@/api/activity.js';
|
||||
// #ifdef MP-WEIXIN
|
||||
import {
|
||||
getTemlIds
|
||||
|
@ -287,6 +251,9 @@
|
|||
import {
|
||||
getShare
|
||||
} from '@/api/public.js';
|
||||
import a_seckill from './components/a_seckill';
|
||||
import b_combination from './components/b_combination';
|
||||
import c_bargain from './components/c_bargain';
|
||||
import goodList from '@/components/goodList';
|
||||
import promotionGood from '@/components/promotionGood';
|
||||
import couponWindow from '@/components/couponWindow';
|
||||
|
@ -328,6 +295,9 @@
|
|||
promotionGood,
|
||||
couponWindow,
|
||||
countDown,
|
||||
a_seckill,
|
||||
b_combination,
|
||||
c_bargain,
|
||||
recommend,
|
||||
// #ifdef MP
|
||||
authorize
|
||||
|
@ -380,7 +350,6 @@
|
|||
}],
|
||||
ProductNavindex: 0,
|
||||
marTop: 0,
|
||||
datatime: 0,
|
||||
childID: 0,
|
||||
loadend: false,
|
||||
loading: false,
|
||||
|
@ -412,6 +381,7 @@
|
|||
iSshowH: false,
|
||||
configApi: {} ,//分享类容配置
|
||||
spikeList: [], // 秒杀
|
||||
point: ''
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
|
@ -424,7 +394,6 @@
|
|||
} catch {}
|
||||
}
|
||||
});
|
||||
this.getSeckillIndexTime();
|
||||
let self = this
|
||||
// #ifdef MP
|
||||
// 获取小程序头部高度
|
||||
|
@ -453,30 +422,6 @@
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
getSeckillIndexTime() {
|
||||
let limit = this.$config.LIMIT;
|
||||
let params = {
|
||||
page: 1,
|
||||
limit: limit,
|
||||
type: 'index'
|
||||
}
|
||||
getSeckillHeaderApi().then(res => {
|
||||
this.datatime = res.data.seckillTime[res.data.seckillTimeIndex].timeSwap
|
||||
let id = res.data.seckillTime[res.data.seckillTimeIndex].id
|
||||
getSeckillList(id, params).then(({
|
||||
data
|
||||
}) => {
|
||||
console.log(data)
|
||||
data.list.forEach((item) => {
|
||||
let num = 0
|
||||
if (item.price > 0 && item.otPrice > 0) num = ((parseFloat(item.price) / parseFloat(item.otPrice)).toFixed(
|
||||
2))
|
||||
item.discountNum = this.$util.$h.Mul(num, 10)
|
||||
})
|
||||
this.spikeList = data
|
||||
})
|
||||
})
|
||||
},
|
||||
// #ifdef MP
|
||||
getTemlIds() {
|
||||
for (var i in arrTemp) {
|
||||
|
@ -888,16 +833,6 @@
|
|||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
/deep/.spike-box .styleAll {
|
||||
display: inline-block;
|
||||
width: 44rpx;
|
||||
height: 40rpx;
|
||||
line-height: 40rpx;
|
||||
padding: 0;
|
||||
text-align: center;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
.page-index {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<view class='nav' v-if="navList.length > 0">
|
||||
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
|
||||
<block v-for="(item,index) in navList" :key="index">
|
||||
<view class='item' :class='active==item.id?"on":""' @click='tabSelect(item.id)'>
|
||||
<view class='item' :class='active==item.id?"on":""' @click='tabSelect(item.id, index)'>
|
||||
<view>{{item.name}}</view>
|
||||
<view class='line bg-color' v-if="active==item.id"></view>
|
||||
</view>
|
||||
|
@ -157,9 +157,10 @@
|
|||
that.$set(that, 'navList', list);
|
||||
});
|
||||
},
|
||||
tabSelect(active) {
|
||||
tabSelect(active,e) {
|
||||
this.active = active;
|
||||
this.scrollLeft = (active - 1) * 50;
|
||||
this.scrollLeft = e * 60;
|
||||
// this.scrollLeft = (active - 1) * 50;
|
||||
if (this.active == 0) this.getArticleHot();
|
||||
else {
|
||||
this.$set(this, 'articleList', []);
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
</view>
|
||||
<view class='noCart' v-if="cartList.valid.length == 0 && cartList.invalid.length == 0">
|
||||
<view class='pictrue'>
|
||||
<image src='../../static/images/noCart.png'></image>
|
||||
<image src='../columnGoods/static/noCart.png'></image>
|
||||
</view>
|
||||
<recommend :hostProduct='hostProduct'></recommend>
|
||||
</view>
|
||||
|
|
|
@ -210,7 +210,7 @@
|
|||
<view class='bnt bg-color' v-if="status.type==0" @tap='pay_open(orderInfo.orderId)'>立即付款</view>
|
||||
<!-- #ifdef MP -->
|
||||
<view @tap="openSubcribe('/pages/users/goods_return/index?orderId='+orderInfo.orderId)" class='bnt cancel'
|
||||
v-else-if="orderInfo.paid === 1 && orderInfo.refundStatus === 0">申请退款</view>
|
||||
v-else-if="orderInfo.paid === true && orderInfo.refundStatus === 0">申请退款</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP -->
|
||||
<navigator hover-class="none" :url="'/pages/users/goods_return/index?orderId='+orderInfo.orderId" class='bnt cancel'
|
||||
|
@ -829,6 +829,7 @@
|
|||
newCartInfo.push(item.info);
|
||||
});
|
||||
that.$set(that, 'cartInfo', newCartInfo);
|
||||
console.log(that.cartInfo)
|
||||
if (res.data.refundStatus != 0) {
|
||||
that.isGoodsReturn = true;
|
||||
};
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<view>
|
||||
<view class='payment-status'>
|
||||
<!--失败时: 用icon-iconfontguanbi fail替换icon-duihao2 bg-color-->
|
||||
<view class='iconfont icon-duihao2 bg-color' v-if="order_pay_info.paid || order_pay_info.payType == 'offline'"></view>
|
||||
<view class='iconfont icon-iconfontguanbi bg-color' v-else></view>
|
||||
<view class='iconfont icons icon-duihao2 bg-color' v-if="order_pay_info.paid || order_pay_info.payType == 'offline'"></view>
|
||||
<view class='iconfont icons icon-iconfontguanbi bg-color' v-else></view>
|
||||
<!-- 失败时:订单支付失败 -->
|
||||
<view class='status' v-if="order_pay_info.payType != 'offline'">{{order_pay_info.paid ? '订单支付成功':'订单支付失败'}}</view>
|
||||
<view class='status' v-else>订单创建成功</view>
|
||||
|
@ -14,7 +14,7 @@
|
|||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>下单时间</view>
|
||||
<view class='itemCom'>{{order_pay_info.payTime}}</view>
|
||||
<view class='itemCom'>{{order_pay_info.createTime}}</view>
|
||||
</view>
|
||||
<view class='item acea-row row-between-wrapper'>
|
||||
<view>支付方式</view>
|
||||
|
@ -185,6 +185,19 @@
|
|||
border-radius: 10rpx;
|
||||
padding: 1rpx 0 28rpx 0;
|
||||
}
|
||||
.payment-status .icons {
|
||||
font-size: 70rpx;
|
||||
width: 140rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 140rpx;
|
||||
text-shadow: 0px 4px 0px #df1e14;
|
||||
border: 6rpx solid #f5f5f5;
|
||||
margin: -76rpx auto 0 auto;
|
||||
background-color: #999;
|
||||
}
|
||||
|
||||
.payment-status .iconfont {
|
||||
font-size: 70rpx;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<view class="register absolute">
|
||||
<view class="shading">
|
||||
<view class="pictrue acea-row row-center-wrapper">
|
||||
<image src="/static/images/logo2.png"></image>
|
||||
<image src="../../static/images/logo2.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="whiteBg">
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
this.loadend = false;
|
||||
this.$set(this, 'rankList', []);
|
||||
this.getBrokerageRankList();
|
||||
this.getBrokerageRankNumber(this.type);
|
||||
this.getBrokerageRankNumber();
|
||||
},
|
||||
getBrokerageRankNumber(type) {
|
||||
brokerageRankNumber({
|
||||
|
@ -125,12 +125,19 @@
|
|||
}).then(res => {
|
||||
let list = res.data;
|
||||
let loadend = list.length < this.limit;
|
||||
this.rankList.push.apply(this.rankList, list);
|
||||
this.loading = false;
|
||||
this.rankList = this.$util.SplitArray(list, this.rankList);
|
||||
this.$set(that,'rankList',this.rankList);
|
||||
this.loadend = loadend;
|
||||
this.loadTitle = loadend ? '😕我也是有底线的' : '加载更多';
|
||||
this.$set(this, 'rankList', this.rankList);
|
||||
this.position = res.data.position;
|
||||
this.loading = false;
|
||||
this.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
|
||||
// let list = res.data;
|
||||
// let loadend = list.length < this.limit;
|
||||
// this.rankList.push.apply(this.rankList, list);
|
||||
// this.loading = false;
|
||||
// this.loadend = loadend;
|
||||
// this.loadTitle = loadend ? '😕我也是有底线的' : '加载更多';
|
||||
// this.$set(this, 'rankList', this.rankList);
|
||||
// this.position = res.data.position;
|
||||
}).catch(err => {
|
||||
this.loading = false;
|
||||
this.loadTitle = '加载更多';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<view class='generalComment acea-row row-between-wrapper'>
|
||||
<view class='acea-row row-middle font-color'>
|
||||
<view class='evaluate'>评分</view>
|
||||
<view class='start' :class="'star'+Math.round((replyData.replyChance)*5)"></view>
|
||||
<view class='start' :class="'star'+ (replyData.sumCount===0?'3':Math.round(replyData.replyStar/replyData.sumCount))"></view>
|
||||
</view>
|
||||
<view><text class='font-color'>{{(replyData.replyChance)*100}}%</text>好评率</view>
|
||||
</view>
|
||||
|
@ -21,7 +21,7 @@
|
|||
</view>
|
||||
<view class='noCommodity' v-if="!replyData.sumCount && page > 1">
|
||||
<view class='pictrue'>
|
||||
<image src='/images/noEvaluate.png'></image>
|
||||
<image src='../static/noEvaluate.png'></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
DelPic:function(e){
|
||||
let index = e, that = this;
|
||||
that.refund_reason_wap_imgPath.splice(index, 1);
|
||||
that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
||||
// that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
||||
},
|
||||
/**
|
||||
* 上传文件
|
||||
|
@ -150,10 +150,10 @@
|
|||
uploadpic:function(){
|
||||
let that=this;
|
||||
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){
|
||||
that.refund_reason_wap_img.push(res.data.url);
|
||||
that.refund_reason_wap_imgPath.push(res.data.localPath);
|
||||
that.$set(that,'refund_reason_wap_img',that.refund_reason_wap_img);
|
||||
that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
||||
// that.refund_reason_wap_img.push(res.data.url);
|
||||
that.refund_reason_wap_imgPath.push(res.data.url);
|
||||
// that.$set(that,'refund_reason_wap_img',that.refund_reason_wap_img);
|
||||
// that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -161,14 +161,15 @@
|
|||
* 申请退货
|
||||
*/
|
||||
subRefund:function(e){
|
||||
console.log(e);
|
||||
|
||||
let that = this, value = e.detail.value;
|
||||
console.log(that.refund_reason_wap_imgPath.join(','));
|
||||
//收集form表单
|
||||
// if (!value.refund_reason_wap_explain) return app.Tips({title:'请输入退款原因'});
|
||||
if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
|
||||
orderRefundVerify({
|
||||
text: that.RefundArray[that.index] || '',
|
||||
refund_reason_wap_explain: value.refund_reason_wap_explain,
|
||||
refund_reason_wap_img: that.refund_reason_wap_img.join(','),
|
||||
refund_reason_wap_img: that.refund_reason_wap_imgPath.join(','),
|
||||
uni: that.orderId
|
||||
}).then(res=>{
|
||||
return this.$util.Tips({ title: '申请成功', icon: 'success' }, { tab: 5, url: '/pages/users/user_return_list/index?isT=1' });
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="shading">
|
||||
<div class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="logoUrl" v-if="logoUrl" />
|
||||
<image src="/static/images/logo2.png" v-else />
|
||||
<image src="../../../static/images/logo2.png" v-else />
|
||||
</div>
|
||||
</div>
|
||||
<div class="whiteBg" v-if="formItem === 1">
|
||||
|
@ -324,7 +324,7 @@
|
|||
loginH5({
|
||||
account: that.account,
|
||||
password: that.password,
|
||||
spread: that.$Cache.get("spread")
|
||||
spread_spid: that.$Cache.get("spread")
|
||||
})
|
||||
.then(({
|
||||
data
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div class="shading">
|
||||
<div class="pictrue acea-row row-center-wrapper">
|
||||
<image :src="logoUrl" v-if="logoUrl" />
|
||||
<image src="/static/images/logo2.png" v-else />
|
||||
<image src="../../../static/images/logo2.png" v-else />
|
||||
</div>
|
||||
</div>
|
||||
<div class="whiteBg" v-if="formItem === 1">
|
||||
|
|
|
@ -272,7 +272,9 @@
|
|||
news: true,
|
||||
again: false,
|
||||
addAgain: false,
|
||||
secKill: false //是否是秒杀
|
||||
bargain: false, //是否是砍价
|
||||
combination: false, //是否是拼团
|
||||
secKill: false, //是否是秒杀
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
|
@ -290,7 +292,7 @@
|
|||
url: 1
|
||||
});
|
||||
this.couponId = options.couponId || 0;
|
||||
this.pinkId = options.pinkid ? parseInt(options.pinkid) : 0;
|
||||
this.pinkId = options.pinkId ? parseInt(options.pinkId) : 0;
|
||||
this.addressId = options.addressId || 0;
|
||||
this.cartId = options.cartId;
|
||||
this.is_address = options.is_address ? true : false;
|
||||
|
@ -298,6 +300,8 @@
|
|||
this.again = options.again || false;
|
||||
this.addAgain = options.addAgain || false;
|
||||
this.secKill = options.secKill || false;
|
||||
this.combination = options.combination || false;
|
||||
this.bargain = options.bargain || false;
|
||||
if (this.isLogin) {
|
||||
this.getaddressInfo();
|
||||
this.getConfirm();
|
||||
|
@ -507,7 +511,7 @@
|
|||
*/
|
||||
getConfirm: function() {
|
||||
let that = this;
|
||||
orderConfirm(that.cartId,that.news,this.addAgain,this.secKill).then(res => {
|
||||
orderConfirm(that.cartId,that.news,this.addAgain,this.secKill,this.combination,this.bargain).then(res => {
|
||||
that.$set(that, 'userInfo', res.data.userInfo);
|
||||
that.$set(that, 'integral', res.data.userInfo.integral);
|
||||
that.$set(that, 'cartInfo', res.data.cartInfo);
|
||||
|
@ -524,9 +528,9 @@
|
|||
that.cartArr[0].payStatus = res.data.payWeixinOpen || 0
|
||||
that.cartArr[1].payStatus = res.data.yuePayStatus || 0
|
||||
if (res.data.offlinePayStatus == 2) {
|
||||
that.cartArr[2].payStatus = 0
|
||||
} else {
|
||||
that.cartArr[2].payStatus = 1
|
||||
} else {
|
||||
that.cartArr[2].payStatus = 0
|
||||
}
|
||||
|
||||
// that.$set(that, 'cartArr', that.cartArr);
|
||||
|
@ -551,8 +555,8 @@
|
|||
let BargainId = 0;
|
||||
let combinationId = 0;
|
||||
cartINfo.forEach(function(value, index, cartINfo) {
|
||||
BargainId = cartINfo[index].bargain_id,
|
||||
combinationId = cartINfo[index].combination_id
|
||||
BargainId = cartINfo[index].bargainId,
|
||||
combinationId = cartINfo[index].combinationId
|
||||
})
|
||||
that.$set(that, 'BargainId', parseInt(BargainId));
|
||||
that.$set(that, 'combinationId', parseInt(combinationId));
|
||||
|
@ -623,8 +627,7 @@
|
|||
that.textareaStatus = false;
|
||||
that.address.address = true;
|
||||
that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId +
|
||||
'&couponId=' +
|
||||
this.couponId;
|
||||
'&couponId=' + this.couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain;
|
||||
},
|
||||
realName: function(e) {
|
||||
this.contacts = e.detail.value;
|
||||
|
@ -640,6 +643,10 @@
|
|||
orderId = result.orderId,
|
||||
jsConfig = res.data.jsConfig,
|
||||
message = res.data.message;
|
||||
if(that.totalPrice===0)return that.$util.Tips({
|
||||
title: '支付成功',
|
||||
icon: 'success'
|
||||
});
|
||||
if(that.news == "false"){
|
||||
orderPay({
|
||||
'paytype': that.payType,
|
||||
|
@ -648,7 +655,7 @@
|
|||
'from': 'routine',
|
||||
// #endif
|
||||
// #ifdef H5 || APP-PLUS
|
||||
'from': this.$wechat.isWeixin() ? 'weixin' : 'weixinh5',
|
||||
'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5',
|
||||
// #endif
|
||||
}).then(res=>{
|
||||
result = res.data.result;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="register absolute">
|
||||
<div class="shading">
|
||||
<div class="pictrue acea-row row-center-wrapper">
|
||||
<image src="/static/images/logo2.png" />
|
||||
<image src="../../../static/images/logo2.png" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="whiteBg">
|
||||
|
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
@ -95,7 +95,10 @@
|
|||
page: 1,
|
||||
limit: 20,
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false //是否隐藏授权
|
||||
isShowAuth: false, //是否隐藏授权
|
||||
bargain: false, //是否是砍价
|
||||
combination: false, //是否是拼团
|
||||
secKill: false, //是否是秒杀
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
|
@ -104,6 +107,9 @@
|
|||
this.cartId = options.cartId || '';
|
||||
this.pinkId = options.pinkId || 0;
|
||||
this.couponId = options.couponId || 0;
|
||||
this.secKill = options.secKill || false;
|
||||
this.combination = options.combination || false;
|
||||
this.bargain = options.bargain || false;
|
||||
this.getAddressList(true);
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
|
@ -353,7 +359,7 @@
|
|||
this.couponId = '';
|
||||
uni.redirectTo({
|
||||
url: '/pages/users/order_confirm/index?is_address=1&cartId=' + cartId + '&addressId=' + id + '&pinkId=' +
|
||||
pinkId + '&couponId=' + couponId
|
||||
pinkId + '&couponId=' + couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
let that = this;
|
||||
getUserCoupons({status:0}).then(res => {
|
||||
that.loading = true;
|
||||
that.$set(that, 'couponsList', res.data);
|
||||
that.$set(that, 'couponsList', res.data || []);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -118,9 +118,9 @@
|
|||
align-items: center;
|
||||
}
|
||||
.condition .line-title {
|
||||
width: 90rpx;
|
||||
/* width: 90rpx; */
|
||||
height: 40rpx !important;
|
||||
line-height: 1.5 !important;
|
||||
line-height: 40rpx !important;
|
||||
padding: 0 10rpx;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
</view>
|
||||
<view class='noCommodity' v-else-if="!collectProductList.length && page > 1">
|
||||
<view class='pictrue'>
|
||||
<image src='../../../static/images/noCollection.png'></image>
|
||||
<image src='../static/noCollection.png'></image>
|
||||
</view>
|
||||
<recommend :hostProduct="hostProduct"></recommend>
|
||||
</view>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<view>累计消费</view>
|
||||
</view>
|
||||
<view class='item'>
|
||||
<view class='num'>{{userInfo.today_integral||0}}</view>
|
||||
<view class='num'>{{userInfo.yesterdayIntegral||0}}</view>
|
||||
<view>今日获得</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
@ -13,16 +13,24 @@
|
|||
<navigator url="/pages/users/user_payment/index" hover-class="none" class='recharge font-color'>充值</navigator>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<view @click="openSubscribe('/pages/users/user_payment/index')" class='recharge font-color'>充值</view>
|
||||
<view v-if="rechargeSwitch" @click="openSubscribe('/pages/users/user_payment/index')" class='recharge font-color'>充值</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class='cumulative acea-row row-top'>
|
||||
<!-- #ifdef APP-PLUS || H5 -->
|
||||
<view class='item'>
|
||||
<view>累计收入(元)</view>
|
||||
<view>累计充值(元)</view>
|
||||
<view class='money'>{{statistics.recharge || 0}}</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef MP -->
|
||||
<view class='item' v-if="rechargeSwitch">
|
||||
<view>累计充值(元)</view>
|
||||
<view class='money'>{{statistics.recharge || 0}}</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class='item'>
|
||||
<view>累计支出(元)</view>
|
||||
<view>累计消费(元)</view>
|
||||
<view class='money'>{{statistics.orderStatusSum || 0}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -39,9 +47,9 @@
|
|||
<view class='pictrue'>
|
||||
<image src='../../../static/images/record2.png'></image>
|
||||
</view>
|
||||
<view>支出记录</view>
|
||||
<view>消费记录</view>
|
||||
</navigator>
|
||||
<navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=2' v-if="recharge_switch">
|
||||
<navigator class='item' hover-class='none' url='/pages/users/user_bill/index?type=2' v-if="rechargeSwitch">
|
||||
<view class='pictrue'>
|
||||
<image src='../../../static/images/record3.png'></image>
|
||||
</view>
|
||||
|
@ -155,7 +163,7 @@
|
|||
userInfo: {},
|
||||
hostProduct: [],
|
||||
isClose: false,
|
||||
recharge_switch: 0,
|
||||
rechargeSwitch: false,
|
||||
activity: {},
|
||||
isAuto: false, //没有授权的不会自动授权
|
||||
isShowAuth: false ,//是否隐藏授权
|
||||
|
@ -220,7 +228,7 @@
|
|||
let that = this;
|
||||
getUserInfo().then(res => {
|
||||
that.$set(that, 'userInfo', res.data);
|
||||
that.recharge_switch = res.data.recharge_switch;
|
||||
that.rechargeSwitch = res.data.rechargeSwitch;
|
||||
});
|
||||
},
|
||||
/**
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
// #ifdef H5
|
||||
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
|
||||
// #endif
|
||||
import { base64src } from '@/utils/base64src.js'
|
||||
import {
|
||||
getUserInfo,
|
||||
spreadBanner
|
||||
|
@ -78,15 +79,16 @@
|
|||
imagePath: '',
|
||||
qrcodeSize: 1000,
|
||||
PromotionCode: '',
|
||||
base64List: []
|
||||
base64List: [],
|
||||
posterbackgd: 'https://image.java.crmeb.net/image/product/2020/08/03/755bf516b1ca4b6db3bfeaa4dd5901cdh71kob20re.jpg'
|
||||
};
|
||||
},
|
||||
computed: mapGetters(['isLogin']),
|
||||
onLoad() {
|
||||
if (this.isLogin) {
|
||||
// #ifdef H5
|
||||
// // #ifdef H5
|
||||
this.userSpreadBannerList();
|
||||
// #endif
|
||||
// // #endif
|
||||
} else {
|
||||
// #ifdef H5 || APP-PLUS
|
||||
toLogin();
|
||||
|
@ -112,34 +114,69 @@
|
|||
onReady() {
|
||||
},
|
||||
methods: {
|
||||
userSpreadBannerList: function() {
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: '获取中',
|
||||
mask: true,
|
||||
})
|
||||
spreadBanner({
|
||||
page: 1,
|
||||
limit: 5
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
that.$set(that, 'spreadList', res.data);
|
||||
that.getImageBase64(res.data);
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
getImageBase64:function(images){
|
||||
uni.showLoading({
|
||||
title: '海报生成中',
|
||||
mask: true
|
||||
});
|
||||
let that = this;
|
||||
// #ifdef H5
|
||||
let spreadList = [];
|
||||
images.forEach((item,index)=>{
|
||||
imageBase64({url:item.pic}).then(res=>{
|
||||
spreadList[index] = res.data.code;
|
||||
that.$set(that,'base64List',spreadList);
|
||||
that.$set(that, 'poster', spreadList[0]);
|
||||
that.userInfos();
|
||||
//that.$set(that, 'poster', spreadList[0]);
|
||||
})
|
||||
})
|
||||
// #endif
|
||||
// #ifdef MP
|
||||
this.base64List = images.map(item => {
|
||||
return item.pic
|
||||
});
|
||||
// #endif
|
||||
that.userInfos();
|
||||
console.log('上',this.base64List)
|
||||
},
|
||||
// 小程序二维码
|
||||
getQrcode(){
|
||||
let that = this;
|
||||
let data = {
|
||||
pid: that.userInfo.uid,
|
||||
path: '/pages/index/index'
|
||||
path: 'pages/index/index'
|
||||
}
|
||||
let arrImagesUrl = "";
|
||||
uni.downloadFile({
|
||||
url: this.base64List[0], //仅为示例,并非真实的资源
|
||||
success: (res) => {
|
||||
arrImagesUrl = res.tempFilePath;
|
||||
}
|
||||
});
|
||||
getQrcode(data).then(res=>{
|
||||
that.PromotionCode = res.data.code;
|
||||
// let image = '../../../static/images/aa.jpg';
|
||||
// that.PosterCanvas(image, res.data.code, that.userInfo.nickname,0);
|
||||
that.PosterCanvas(this.base64List[0], res.data.code, that.userInfo.nickname,0);
|
||||
base64src(res.data.code, res => {
|
||||
that.PromotionCode = res;
|
||||
console.log('第一张',that.PromotionCode)
|
||||
});
|
||||
setTimeout(() => {
|
||||
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
|
||||
}, 200);
|
||||
})
|
||||
},
|
||||
// 生成二维码;
|
||||
|
@ -153,8 +190,6 @@
|
|||
margin: 10,
|
||||
success: res => {
|
||||
that.PromotionCode = res;
|
||||
// let image = '../../../static/images/aa.jpg';
|
||||
// that.PosterCanvas(image, that.PromotionCode, that.userInfo.nickname,0);
|
||||
that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo.nickname,0);
|
||||
},
|
||||
complete: () => {},
|
||||
|
@ -171,7 +206,7 @@
|
|||
let that = this;
|
||||
uni.getImageInfo({
|
||||
src: arrImages,
|
||||
success: function(image) {
|
||||
success: function(res) {
|
||||
context.drawImage(arrImages, 0, 0, 750, 1190);
|
||||
context.save();
|
||||
context.drawImage(code, 110, 925, 140, 140);
|
||||
|
@ -179,22 +214,43 @@
|
|||
context.setFontSize(28);
|
||||
context.fillText(nickname, 270, 980);
|
||||
context.fillText('邀请您加入', 270, 1020);
|
||||
context.draw(true,function(){
|
||||
uni.canvasToTempFilePath({
|
||||
destWidth: 750,
|
||||
destHeight: 1190,
|
||||
canvasId: 'canvasOne',
|
||||
fileType: 'jpg',
|
||||
success: function(res) {
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
uni.hideLoading();
|
||||
that.imagePath = res.tempFilePath;
|
||||
that.spreadList[index].pic = res.tempFilePath;
|
||||
}
|
||||
})
|
||||
})
|
||||
setTimeout(() => {
|
||||
context.draw(true,function(){
|
||||
uni.canvasToTempFilePath({
|
||||
destWidth: 750,
|
||||
destHeight: 1190,
|
||||
canvasId: 'canvasOne',
|
||||
fileType: 'jpg',
|
||||
success: function(res) {
|
||||
console.log("成功",res)
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
uni.hideLoading();
|
||||
that.imagePath = res.tempFilePath;
|
||||
that.spreadList[index].pic = res.tempFilePath;
|
||||
that.poster = res.tempFilePath;
|
||||
console.log("spreadList = ", that.spreadList[index].pic)
|
||||
}
|
||||
})
|
||||
})
|
||||
}, 100);
|
||||
// context.draw(true,function(){
|
||||
// uni.canvasToTempFilePath({
|
||||
// destWidth: 750,
|
||||
// destHeight: 1190,
|
||||
// canvasId: 'canvasOne',
|
||||
// fileType: 'jpg',
|
||||
// success: function(res) {
|
||||
// console.log("成功",res)
|
||||
// // 在H5平台下,tempFilePath 为 base64
|
||||
// uni.hideLoading();
|
||||
// that.imagePath = res.tempFilePath;
|
||||
// that.spreadList[index].pic = res.tempFilePath;
|
||||
// }
|
||||
// })
|
||||
// })
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log("失败",err)
|
||||
uni.hideLoading();
|
||||
that.$util.Tips({
|
||||
title: '无法获取图片信息'
|
||||
|
@ -216,10 +272,19 @@
|
|||
let base64List = this.base64List;
|
||||
let index = e.detail.current;
|
||||
this.swiperIndex = index;
|
||||
this.$set(this, 'poster', base64List[index]);
|
||||
this.PosterCanvas(base64List[index], this.PromotionCode, this.userInfo.nickname,index);
|
||||
// let aa = ['../../../static/images/aa.jpg','../../../static/images/aa.jpg','../../../static/images/aa.jpg'];
|
||||
// this.PosterCanvas(aa[index], this.PromotionCode, this.userInfo.nickname,index);
|
||||
let arrImagesUrl = "";
|
||||
uni.downloadFile({
|
||||
url: base64List[index], //仅为示例,并非真实的资源
|
||||
success: (res) => {
|
||||
console.log('移动',res)
|
||||
arrImagesUrl = res.tempFilePath;
|
||||
console.log('移动图片',arrImagesUrl)
|
||||
console.log('移动二维码',this.PromotionCode)
|
||||
setTimeout(() => {
|
||||
this.PosterCanvas(arrImagesUrl, this.PromotionCode, this.userInfo.nickname, index);
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 点击保存海报
|
||||
savePosterPath: function() {
|
||||
|
@ -326,23 +391,6 @@
|
|||
};
|
||||
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage)
|
||||
}
|
||||
},
|
||||
userSpreadBannerList: function() {
|
||||
let that = this;
|
||||
uni.showLoading({
|
||||
title: '获取中',
|
||||
mask: true,
|
||||
})
|
||||
spreadBanner({
|
||||
page: 1,
|
||||
limit: 5
|
||||
}).then(res => {
|
||||
uni.hideLoading();
|
||||
that.$set(that, 'spreadList', res.data);
|
||||
that.getImageBase64(res.data);
|
||||
}).catch(err => {
|
||||
uni.hideLoading();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -352,7 +400,7 @@
|
|||
page {
|
||||
background-color: #a3a3a3 !important;
|
||||
}
|
||||
.canvas canvas{
|
||||
.canvas{
|
||||
position: fixed;
|
||||
z-index: -5rpx;
|
||||
opacity: 0;
|
||||
|
|
|
@ -214,12 +214,14 @@
|
|||
page: page,
|
||||
limit: limit
|
||||
}, recordType).then(res => {
|
||||
let len = res.data.list.length;
|
||||
let recordListData = res.data.list;
|
||||
recordListNew = recordList.concat(recordListData);
|
||||
that.status = limit > len;
|
||||
that.page = page + 1;
|
||||
that.$set(that, 'recordList', recordListNew);
|
||||
if(res.data.list){
|
||||
let len = res.data.list.length;
|
||||
let recordListData = res.data.list;
|
||||
recordListNew = recordList.concat(recordListData);
|
||||
that.status = limit > len;
|
||||
that.page = page + 1;
|
||||
that.$set(that, 'recordList', recordListNew);
|
||||
}
|
||||
});
|
||||
},
|
||||
getRecordListCount: function() {
|
||||
|
|
|
@ -291,7 +291,7 @@
|
|||
border-radius: 23rpx;
|
||||
padding: 22rpx 27rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
.title {
|
||||
font-size: 24rpx;
|
||||
color: #AE8B4A;
|
||||
|
@ -305,7 +305,7 @@
|
|||
|
||||
.axis {
|
||||
margin: 10rpx 0 15rpx 0;
|
||||
|
||||
overflow: hidden;
|
||||
.bar {
|
||||
width: 630rpx;
|
||||
.spotw{
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<recommend :hostProduct="hostProduct"></recommend>
|
||||
<view class='growthValue' :class='growthValue==false?"on":""'>
|
||||
<view class='pictrue'>
|
||||
<image src='../../../static/images/value.jpg'></image><text class='iconfont icon-guanbi3' @click='growthValue'></text>
|
||||
<image src='../../columnGoods/static/value.jpg'></image><text class='iconfont icon-guanbi3' @click='growthValue'></text>
|
||||
</view>
|
||||
<view class='conter'>{{illustrate}}</view>
|
||||
</view>
|
||||
|
|
Before Width: | Height: | Size: 127 KiB |
After Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
|
@ -1,7 +1,7 @@
|
|||
// import {
|
||||
// SUBSCRIBE_MESSAGE
|
||||
// } from '../config/cache.js';
|
||||
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"];
|
||||
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe", 'pinkSubscribe', 'bargainSubscribe'];
|
||||
|
||||
// export function auth() {
|
||||
// let tmplIds = {};
|
||||
|
@ -37,26 +37,6 @@ export function openExtrctSubscribe() {
|
|||
return subscribe(tmplIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拼团成功
|
||||
*/
|
||||
export function openPinkSubscribe() {
|
||||
let tmplIds = auth();
|
||||
return subscribe([
|
||||
tmplIds.pink_true
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 砍价成功
|
||||
*/
|
||||
export function openBargainSubscribe() {
|
||||
let tmplIds = auth();
|
||||
return subscribe([
|
||||
tmplIds.bargain_success
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单退款
|
||||
*/
|
||||
|
@ -73,6 +53,30 @@ export function openRechargeSubscribe() {
|
|||
return subscribe(tmplIds);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 拼团成功
|
||||
*/
|
||||
export function openPinkSubscribe() {
|
||||
let tmplIds = uni.getStorageSync('tempID' + arrTemp[5]);
|
||||
return subscribe(tmplIds);
|
||||
// let tmplIds = auth();
|
||||
// return subscribe([
|
||||
// tmplIds.pink_true
|
||||
// ]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 砍价成功
|
||||
*/
|
||||
export function openBargainSubscribe() {
|
||||
let tmplIds = uni.getStorageSync('tempID' + arrTemp[6]);
|
||||
return subscribe(tmplIds);
|
||||
// let tmplIds = auth();
|
||||
// return subscribe([
|
||||
// tmplIds.bargain_success
|
||||
// ]);
|
||||
}
|
||||
// /**
|
||||
// * 提现
|
||||
// */
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
const fsm = wx.getFileSystemManager();
|
||||
const FILE_BASE_NAME = 'tmp_base64src'; //自定义文件名
|
||||
|
||||
export function base64src(base64data, cb) {
|
||||
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || [];
|
||||
if (!format) {
|
||||
return (new Error('ERROR_BASE64SRC_PARSE'));
|
||||
}
|
||||
const filePath = `${wx.env.USER_DATA_PATH}/${FILE_BASE_NAME}.${format}`;
|
||||
const buffer = wx.base64ToArrayBuffer(bodyData);
|
||||
fsm.writeFile({
|
||||
filePath,
|
||||
data: buffer,
|
||||
encoding: 'binary',
|
||||
success() {
|
||||
cb(filePath);
|
||||
},
|
||||
fail() {
|
||||
return (new Error('ERROR_BASE64SRC_WRITE'));
|
||||
},
|
||||
});
|
||||
};
|
||||
//module.exports = base64src;
|
|
@ -169,6 +169,7 @@ import {
|
|||
uni.getImageInfo({
|
||||
src: arrImages[0],
|
||||
success: function (image) {
|
||||
console.log('image成功', image)
|
||||
context.drawImage(arrImages[0], 0, 0, 750, 1190);
|
||||
context.drawImage(arrImages[1], 0, 0, 750, 750);
|
||||
context.save();
|
||||
|
@ -207,6 +208,7 @@ import {
|
|||
canvasId: 'firstCanvas',
|
||||
fileType: 'jpg',
|
||||
success: function(res) {
|
||||
console.log(res.tempFilePath)
|
||||
// 在H5平台下,tempFilePath 为 base64
|
||||
uni.hideLoading();
|
||||
successFn && successFn(res.tempFilePath);
|
||||
|
@ -217,6 +219,7 @@ import {
|
|||
})
|
||||
},
|
||||
fail: function(err) {
|
||||
console.log('image失败', err)
|
||||
uni.hideLoading();
|
||||
that.Tips({
|
||||
title: '无法获取图片信息'
|
||||
|
|