圣诞快乐

# v1.3 更新列表
    1. 【新增】砍价
	2. 【新增】拼团
	3. 【新增】一号通
	4. 【修复】商品sku 编辑时出现商品属性对应错误的问题
	5. 【修复】商品推广海报生成二维码可能会出错的问题【小程序调试中】
	6. 【修复】微信公众号和小程序头像可能获取不到的问题
	7. 【修复】下单时可能会出错的问题
	8. 【修复】pc管理端用户访问量
	9. 【修复】微信退款
	10. 【修复】管理端订单状态可能出现不正确的情况
	11. 【修复】WEB管理端-菜单色调,短信API更新,首页用户访问量,系统设置tab是自动选择下一及表单
	12. 【修复】系统设置出现更新不正确的问题
pull/1/MERGE
stivepeim 2020-12-23 15:56:45 +08:00
parent 9b39c27876
commit 3c0b73f100
59 changed files with 2527 additions and 1392 deletions

View File

@ -35,6 +35,13 @@ export function postCombinationRemove(data) {
return request.post("combination/remove",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) { 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) { export function postBargainHelpList(params,data) {
return request.post("bargain/help/list", data); return request.get("bargain/help/list?limit="+params.limit+"&page="+params.page, data,{});
} }
/** /**
* 砍价 砍价帮总人数剩余金额进度条已经砍掉的价格 * 砍价 砍价帮总人数剩余金额进度条已经砍掉的价格
*/ */
export function postBargainHelpCount(data) { export function postBargainHelpCount(data) {
return request.post("bargain/help/count", data); return request.get("bargain/help/count", data,1);
} }
/** /**
* 砍价 观看/分享/参与次数 * 砍价 观看/分享/参与次数
*/ */
export function postBargainShare(bargainId) { export function postBargainShare(bargainId) {
return request.post("bargain/share", { bargainId: bargainId}); return request.get("bargain/share/" + bargainId);
} }
/** /**

View File

@ -168,12 +168,14 @@ export function orderRefundVerify(data) {
* 订单确认获取订单详细信息 * 订单确认获取订单详细信息
* @param string cartId * @param string cartId
*/ */
export function orderConfirm(cartId, isNew, addAgain,secKill) { export function orderConfirm(cartId, isNew, addAgain,secKill,combination,bargain) {
return request.post('order/confirm', { return request.post('order/confirm', {
cartIds: cartId, cartIds: cartId,
isNew: isNew, isNew: isNew,
addAgain: addAgain, addAgain: addAgain,
secKill: secKill secKill: secKill,
combination:combination,
bargain:bargain
}, {}, 1); }, {}, 1);
} }

View File

@ -68,7 +68,7 @@
function runTime() { function runTime() {
// //
let intDiff = that.datatime - Date.parse(new Date()) / 1000; // let intDiff = that.datatime - Date.parse(new Date())/1000; //
let day = 0, let day = 0,
hour = 0, hour = 0,
minute = 0, minute = 0,

View File

@ -30,7 +30,7 @@
</view> </view>
<!-- 无优惠券 --> <!-- 无优惠券 -->
<view class='pictrue' v-else> <view class='pictrue' v-else>
<image src='/static/images/noCoupon.png'></image> <image src='../../static/images/noCoupon.png'></image>
</view> </view>
</view> </view>
<view class='mask' catchtouchmove="true" :hidden='coupon.coupon==false' @click='close'></view> <view class='mask' catchtouchmove="true" :hidden='coupon.coupon==false' @click='close'></view>

View File

@ -161,7 +161,6 @@
}); });
}, },
upload(){ upload(){
debugger
if(!this.uploadUrl) { if(!this.uploadUrl) {
uni.showModal({ uni.showModal({
content: '请填写上传接口' content: '请填写上传接口'

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="empty-box"> <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 class="txt">{{title}}</view>
</view> </view>
</template> </template>

View File

@ -77,8 +77,12 @@
'from': 'routine', 'from': 'routine',
// #endif // #endif
// #ifdef H5 || APP-PLUS // #ifdef H5 || APP-PLUS
'from': this.$wechat.isWeixin() ? 'weixin' : 'weixinh5', 'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5'
// #endif // #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 => { }).then(res => {
switch (paytype) { switch (paytype) {
case 'weixin': case 'weixin':
@ -87,11 +91,11 @@
}); });
// #ifdef MP || APP-PLUS // #ifdef MP || APP-PLUS
let jsConfig = res.data.jsConfig; let jsConfig = res.data.jsConfig;
let packages = 'prepay_id=' + jsConfig.prepayId; // let packages = 'prepay_id=' + jsConfig.prepayId;
uni.requestPayment({ uni.requestPayment({
timeStamp: jsConfig.timeStamp.toString(), timeStamp: jsConfig.timeStamp.toString(),
nonceStr: jsConfig.nonceStr, nonceStr: jsConfig.nonceStr,
package: packages, package: jsConfig.package,
signType: jsConfig.signType, signType: jsConfig.signType,
paySign: jsConfig.paySign, paySign: jsConfig.paySign,
success: function(res) { success: function(res) {
@ -128,30 +132,18 @@
}); });
// #endif // #endif
// #ifdef H5 // #ifdef H5
let data = res.data; if (res.data.status === "WECHAT_PAY") {
if (data.status == "WECHAT_H5_PAY") { let jsConfig = res.data.jsConfig;
uni.hideLoading(); //let packages = 'prepay_id=' + jsConfig.prepayId;
location.replace(data.result.jsConfig.h5PayUrl); let datas = {
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 = {
timestamp:jsConfig.timeStamp, timestamp:jsConfig.timeStamp,
nonceStr:jsConfig.nonceStr, nonceStr:jsConfig.nonceStr,
package:packages, package:jsConfig.package,
signType:jsConfig.signType, signType:jsConfig.signType,
paySign:jsConfig.paySign paySign:jsConfig.paySign
}; };
that.$wechat.pay(data) that.$wechat.pay(datas)
.finally(() => { .then(() => {
return that.$util.Tips({ return that.$util.Tips({
title: "支付成功", title: "支付成功",
icon: 'success' icon: 'success'
@ -166,6 +158,17 @@
title: '支付失败' title: '支付失败'
}); });
}); });
} else {
uni.hideLoading();
location.replace(res.data.jsConfig.h5PayUrl);
return that.$util.Tips({
title: "支付成功",
icon: 'success'
}, () => {
that.$emit('onChangeFun', {
action: 'pay_complete'
});
});
} }
// #endif // #endif
break; break;

View File

@ -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 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 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="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 class="joinBnt on" v-else-if="(iScart && !attr.productSelect.stock)">已售罄</view>
</view> </view>
<view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view> <view class="mask" @touchmove.prevent :hidden="attr.cartAttr === false" @click="closeAttr"></view>

View File

@ -5,12 +5,16 @@
<view class="pictrue"> <view class="pictrue">
<image :src="item.avatar"></image> <image :src="item.avatar"></image>
</view> </view>
<view class="acea-row row-middle"> <view class="acea-row row-between-wrapper" style="width: 87%;">
<view class="name line1">{{ item.nickname }}</view> <view class="acea-row row-middle">
<view class="start" :class="'star' + Math.round((item.productScore+item.serviceScore)/2)"></view> <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> </view>
<view class="time">{{ item.createTime }} {{ item.suk }}</view>
<view class="evaluate-infor">{{ item.comment }}</view> <view class="evaluate-infor">{{ item.comment }}</view>
<view class="imgList acea-row" v-if="item.pics.length && item.pics[0]"> <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"> <view class="pictrue" v-for="(itemn, indexn) in item.pics" :key="indexn">
@ -51,75 +55,74 @@
background-color: #fff; background-color: #fff;
padding-bottom: 25rpx; padding-bottom: 25rpx;
} }
.evaluateWtapper .evaluateItem~.evaluateItem { .evaluateWtapper .evaluateItem~.evaluateItem {
border-top: 1rpx solid #f5f5f5; border-top: 1rpx solid #f5f5f5;
} }
.evaluateWtapper .evaluateItem .pic-text { .evaluateWtapper .evaluateItem .pic-text {
font-size: 26rpx; font-size: 26rpx;
color: #282828; color: #282828;
height: 95rpx; height: 95rpx;
padding: 0 30rpx; padding: 0 30rpx;
} }
.evaluateWtapper .evaluateItem .pic-text .pictrue { .evaluateWtapper .evaluateItem .pic-text .pictrue {
width: 56rpx; width: 56rpx;
height: 56rpx; height: 56rpx;
margin-right: 20rpx; margin-right: 20rpx;
} }
.evaluateWtapper .evaluateItem .pic-text .pictrue image { .evaluateWtapper .evaluateItem .pic-text .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
background: #f4f4f4;
} }
.evaluateWtapper .evaluateItem .pic-text .name { .evaluateWtapper .evaluateItem .pic-text .name {
max-width: 450rpx; max-width: 450rpx;
margin-right: 15rpx;
} }
.evaluateWtapper .evaluateItem .time { .evaluateWtapper .evaluateItem .time {
font-size: 24rpx; font-size: 24rpx;
color: #82848f; color: #82848f;
padding: 0 30rpx; padding: 0 30rpx;
} }
.evaluateWtapper .evaluateItem .evaluate-infor { .evaluateWtapper .evaluateItem .evaluate-infor {
font-size: 28rpx; font-size: 28rpx;
color: #282828; color: #282828;
margin-top: 19rpx; margin-top: 19rpx;
padding: 0 30rpx; padding: 0 30rpx;
} }
.evaluateWtapper .evaluateItem .imgList { .evaluateWtapper .evaluateItem .imgList {
padding: 0 30rpx 0 15rpx; padding: 0 30rpx 0 15rpx;
margin-top: 25rpx; margin-top: 25rpx;
} }
.evaluateWtapper .evaluateItem .imgList .pictrue { .evaluateWtapper .evaluateItem .imgList .pictrue {
width: 156rpx; width: 156rpx;
height: 156rpx; height: 156rpx;
margin: 0 0 15rpx 15rpx; margin: 0 0 15rpx 15rpx;
} }
.evaluateWtapper .evaluateItem .imgList .pictrue image { .evaluateWtapper .evaluateItem .imgList .pictrue image {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: #f7f7f7;
} }
.evaluateWtapper .evaluateItem .reply { .evaluateWtapper .evaluateItem .reply {
font-size: 26rpx; font-size: 26rpx;
color: #454545; color: #454545;
background-color: #f7f7f7; background-color: #f7f7f7;
border-radius: 5rpx; border-radius: 5rpx;
margin: 20rpx 30rpx 0 30rpx; margin: 20rpx 30rpx 0 30rpx;
padding: 30rpx; padding: 20rpx;
position: relative; position: relative;
} }
.evaluateWtapper .evaluateItem .reply::before { .evaluateWtapper .evaluateItem .reply::before {
content: ""; content: "";
width: 0; width: 0;
@ -128,7 +131,7 @@
border-right: 20rpx solid transparent; border-right: 20rpx solid transparent;
border-bottom: 30rpx solid #f7f7f7; border-bottom: 30rpx solid #f7f7f7;
position: absolute; position: absolute;
top: -30rpx; top: -14rpx;
left: 40rpx; left: 40rpx;
} }
</style> </style>

View File

@ -1,32 +1,32 @@
module.exports = { module.exports = {
//token //token
LOGIN_STATUS: 'LOGIN_STATUS_TOKEN', LOGIN_STATUS: 'LOGIN_STATUS_TOKEN',
// uid // uid
UID:'UID', UID:'UID',
//<2F>û<EFBFBD> //用户信息
USER_INFO: 'USER_INFO', USER_INFO: 'USER_INFO',
//token<65><6E><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> //token 过期时间
EXPIRES_TIME: 'EXPIRES_TIME', EXPIRES_TIME: 'EXPIRES_TIME',
//<2F>Ƿ<EFBFBD><C7B7><EFBFBD>Ȩ //微信授权
WX_AUTH: 'WX_AUTH', WX_AUTH: 'WX_AUTH',
//<2F><><EFBFBD>ں<EFBFBD><DABA><EFBFBD>Ȩcode //微信授权状态
STATE_KEY: 'wx_authorize_state', STATE_KEY: 'wx_authorize_state',
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD> //登录类型
LOGINTYPE: 'loginType', LOGINTYPE: 'loginType',
//<2F><><EFBFBD>ں<EFBFBD><DABA><EFBFBD>ת<EFBFBD><D7AA><EFBFBD><EFBFBD> //登录回调地址
BACK_URL: 'login_back_url', BACK_URL: 'login_back_url',
// С<><D0A1><EFBFBD><EFBFBD>code // 小程序授权状态
STATE_R_KEY: 'roution_authorize_state', STATE_R_KEY: 'roution_authorize_state',
//<2F><>ȨlogoС<6F><D0A1><EFBFBD><EFBFBD> //logo Url
LOGO_URL: 'LOGO_URL', LOGO_URL: 'LOGO_URL',
//模板缓存 //模板缓存
// SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE', // SUBSCRIBE_MESSAGE: 'SUBSCRIBE_MESSAGE',
TIPS_KEY: 'TIPS_KEY', TIPS_KEY: 'TIPS_KEY',
SPREAD: 'spread', SPREAD: 'spread',
//缓存经度 //缓存经度
CACHE_LONGITUDE: 'LONGITUDE', CACHE_LONGITUDE: 'LONGITUDE',
//缓存纬度 //缓存纬度
CACHE_LATITUDE: 'LATITUDE', CACHE_LATITUDE: 'LATITUDE',
} }

View File

@ -109,6 +109,14 @@
// #endif // #endif
} }
} }
,{
"path" : "pages/index/components/a_seckill",
"style" : {}
}
,{
"path" : "pages/index/components/b_combination",
"style" : {}
}
], ],
"subPackages": [ "subPackages": [
{ {

View File

@ -1,7 +1,7 @@
<template> <template>
<view> <view>
<view class='bargain-list'> <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='header'></view>
<view class='list'> <view class='list'>
<block v-for="(item,index) in bargainList" :key="index"> <block v-for="(item,index) in bargainList" :key="index">
@ -11,12 +11,15 @@
</view> </view>
<view class='text acea-row row-column-around'> <view class='text acea-row row-column-around'>
<view class='name line1'>{{item.title}}</view> <view class='name line1'>{{item.title}}</view>
<view class='num'><text class='iconfont icon-pintuan'></text>{{item.people}}人正在参与</view> <view class='num'><text class='iconfont icon-pintuan'></text>{{item.countPeopleAll}}人正在参与</view>
<view class='money font-color'>最低: <text class='price'>{{item.min_price}}</text></view> <view class='money font-color'>最低: <text class='price'>{{item.minPrice}}</text></view>
</view> </view>
<view class='cutBnt bg-color'><text class='iconfont icon-kanjia'></text>参与砍价</view> <view class='cutBnt bg-color'><text class='iconfont icon-kanjia'></text>参与砍价</view>
</view> </view>
</block> </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>
</view> </view>
<!-- #ifdef MP --> <!-- #ifdef MP -->
@ -57,21 +60,24 @@
return { return {
bargainList: [], bargainList: [],
page: 1, page: 1,
limit: 20, limit: 10,
loading: false, loading: false,
loadend: false, loadend: false,
userInfo: {}, userInfo: {},
navH: '', navH: '',
isAuto: false, // isAuto: false, //
isShowAuth: false // isShowAuth: false, //
returnShow:true,
loadTitle: '加载更多'
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
onLoad: function(options) { onLoad: function(options) {
var pages = getCurrentPages();
this.returnShow = pages.length===1?false:true;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:"砍价列表" title:"砍价列表"
}) })
this.navH = app.globalData.navHeight; this.navH = app.globalData.navHeight;
if (this.isLogin) { if (this.isLogin) {
this.getUserInfo(); this.getUserInfo();
@ -136,16 +142,22 @@
if (that.loadend) return; if (that.loadend) return;
if (that.loading) return; if (that.loading) return;
that.loading = true; that.loading = true;
that.loadTitle = '';
getBargainList({ getBargainList({
page: that.page, page: that.page,
limit: that.limit limit: that.limit
}).then(function(res) { }).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, 'page', that.page + 1);
that.$set(that, 'loadend', that.limit > res.data.length);
that.$set(that, 'loading', false);
}).catch(res => { }).catch(res => {
that.loading = false; that.loading = false;
that.loadTitle = '加载更多';
}); });
} }
}, },

View File

@ -6,7 +6,7 @@
<view class="header" :class="bargainUid != userInfo.uid ? 'on' : ''"> <view class="header" :class="bargainUid != userInfo.uid ? 'on' : ''">
<view class='people' > <view class='people' >
<!-- :style="'top:'+navH/2+'rpx'" --> <!-- :style="'top:'+navH/2+'rpx'" -->
{{bargainCount.lookCount}}人查看 {{bargainCount.shareCount}}人分享 {{bargainCount.userCount}}人参与 {{bargainCount.lookCount || 0}}人查看 {{bargainCount.shareCount || 0}}人分享 {{bargainCount.userCount || 0}}人参与
</view> </view>
<!-- <view class='time font-color' v-if="bargainUid == userInfo.uid"> <!-- <view class='time font-color' v-if="bargainUid == userInfo.uid">
倒计时 倒计时
@ -25,7 +25,7 @@
<image :src='bargainUserInfo.avatar'></image> <image :src='bargainUserInfo.avatar'></image>
</view> </view>
<view class='text'> <view class='text'>
{{bargainUserInfo.nickname}} {{bargainUserInfo.nickname || ''}}
<text>邀请您帮忙砍价</text> <text>邀请您帮忙砍价</text>
</view> </view>
</view> </view>
@ -45,7 +45,7 @@
当前: 当前:
<text class='num'>{{bargainInfo.price}}</text> <text class='num'>{{bargainInfo.price}}</text>
</view> </view>
<view class='successNum'>最低:{{bargainInfo.min_price}}</view> <view class='successNum'>最低:{{bargainInfo.minPrice}}</view>
<!-- <view class='successNum'>已有{{bargainSumCount}}人砍价成功</view> --> <!-- <view class='successNum'>已有{{bargainSumCount}}人砍价成功</view> -->
</view> </view>
</view> </view>
@ -60,14 +60,20 @@
</view> </view>
</block> </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&&quota>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&&quota>0"> <view class='bargainBnt' @tap='userBargain' v-if="productStock>0&&quota>0">
立即参与砍价 立即参与砍价
</view> </view>
<view class='bargainBnt grey' v-if="productStock<=0||quota<=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 --> <!-- #ifdef H5 -->
<view class='bargainBnt' v-if="$wechat.isWeixin()" @click="H5ShareBox = true"></view> <view class='bargainBnt' v-if="$wechat.isWeixin()" @click="H5ShareBox = true"></view>
<view class='bargainBnt' v-else @tap='getBargainUserBargainPricePoster'>邀请好友帮砍价</view> <view class='bargainBnt' v-else @tap='getBargainUserBargainPricePoster'>邀请好友帮砍价</view>
@ -92,8 +98,14 @@
</view> </view>
<view class='bargainBnt' @tap='currentBargainUser'>我也要参与</view> <view class='bargainBnt' @tap='currentBargainUser'>我也要参与</view>
</view> </view>
<view v-if="bargainUid != userInfo.uid && !userBargainStatusHelp && isHelp">
<view v-if="bargainUid != userInfo.uid && !userBargainStatusHelp"> <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'> <view class='bargainSuccess'>
<text class='iconfont icon-xiaolian'></text> <text class='iconfont icon-xiaolian'></text>
已成功帮助好友砍价 已成功帮助好友砍价
@ -122,7 +134,7 @@
</view> </view>
</view> </view>
<view class='list'> <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='item acea-row row-between-wrapper'>
<view class='pictxt acea-row row-between-wrapper'> <view class='pictxt acea-row row-between-wrapper'>
<view class='pictrue'> <view class='pictrue'>
@ -139,6 +151,7 @@
</view> </view>
</view> </view>
</block> </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>
<view class='load font-color' v-if="!limitStatus" @tap='getBargainUser'>点击加载更多</view> <view class='load font-color' v-if="!limitStatus" @tap='getBargainUser'>点击加载更多</view>
<view class='lock'></view> <view class='lock'></view>
@ -155,7 +168,7 @@
</view> </view>
<view class='conter'> <view class='conter'>
<!-- <template is="wxParse" data="{{wxParseData:description.nodes}}" /> --> <!-- <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> --> <!-- <rich-text :nodes="bargainInfo.description" class="conter"></rich-text> -->
</view> </view>
<view class='lock'></view> <view class='lock'></view>
@ -182,7 +195,7 @@
<view v-if="bargainUid == userInfo.uid"> <view v-if="bargainUid == userInfo.uid">
<view class='cutOff'> <view class='cutOff'>
您已砍掉 您已砍掉
<text class='font-color'>{{bargainUserBargainPrice.price}}</text> <text class='font-color'>{{bargainUserBargainPrice}}</text>
听说分享次数越多砍价成功的机会越大哦 听说分享次数越多砍价成功的机会越大哦
</view> </view>
<!-- #ifdef MP --> <!-- #ifdef MP -->
@ -193,7 +206,7 @@
<!-- #endif --> <!-- #endif -->
</view> </view>
<view v-else> <view v-else>
<view class='help font-color'>成功帮砍{{bargainUserBargainPrice.price}}</view> <view class='help font-color'>成功帮砍{{bargainUserBargainPrice}}</view>
<view class='cutOff on'>您也可以砍价低价拿哦快去挑选心仪的商品吧~</view> <view class='cutOff on'>您也可以砍价低价拿哦快去挑选心仪的商品吧~</view>
<view @tap='currentBargainUser' class='tipBnt'>我也要参与</view> <view @tap='currentBargainUser' class='tipBnt'>我也要参与</view>
</view> </view>
@ -267,26 +280,26 @@
bargainUid: 0, // bargainUid: 0, //
bargainUserInfo: {}, // bargainUserInfo: {}, //
bargainUserId: 0, // bargainUserId: 0, //
bargainInfo: [], // bargainInfo: {}, //
offset: 0, page: 1,
limit: 20, limit: 5,
limitStatus: false, limitStatus: false,
bargainUserHelpList: [], bargainUserHelpList: [],
bargainUserHelpInfo: [], bargainUserHelpInfo: [],
bargainUserBargainPrice: 0, bargainUserBargainPrice: 0, //
status: '', // 0 1 2 3 4 5 status: '', // 0 1 2 3 4 5
bargainCount: [], // bargainCount: [], //
retunTop: true, retunTop: true,
bargainPartake: 0, bargainPartake: 0,
isHelp: false, isHelp: false,
interval: null, interval: null,
userBargainStatus: 0, // userBargainStatus: 0, //
productStock: 0, // productStock: 0, //
quota: 0, // quota: 0, //
userBargainStatusHelp: true, userBargainStatusHelp: true,
navH: '', navH: '',
statusPay: '', statusPay: '', //123
bargainSumCount:0, bargainSumCount:0, //
bargainPrice:0, bargainPrice:0,
datatime:0, datatime:0,
offest:'', offest:'',
@ -298,6 +311,9 @@
isAuto: false, // isAuto: false, //
isShowAuth: false, // isShowAuth: false, //
pages:'', pages:'',
couponsHidden: true,
loading: false,
loadend: false
} }
}, },
@ -369,6 +385,9 @@
}) })
}, },
methods: { methods: {
openTap() {
this.$set(this,'couponsHidden',!this.couponsHidden);
},
// //
authColse: function(e) { authColse: function(e) {
this.isShowAuth = e; this.isShowAuth = e;
@ -376,14 +395,21 @@
// //
goProduct(){ goProduct(){
uni.navigateTo({ uni.navigateTo({
url:`/pages/goods_details/index?id=${this.bargainInfo.product_id}` url:`/pages/goods_details/index?id=${this.bargainInfo.productId}`
}) })
}, },
// //
userBargain:function(){ userBargain:function(){
let that = this; let that = this;
if (that.userInfo.uid == that.bargainUid){ 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() { goBack: function() {
@ -393,9 +419,6 @@
}, },
gobargainUserInfo: function() { // gobargainUserInfo: function() { //
var that = this; var that = this;
var data = {
userId: that.bargainUid
};
postBargainStartUser({ postBargainStartUser({
bargainId: that.id, bargainId: that.id,
bargainUserUid: that.bargainUid bargainUserUid: that.bargainUid
@ -406,22 +429,18 @@
goPay: function() { // goPay: function() { //
var that = this; var that = this;
var data = { var data = {
productId: that.bargainInfo.product_id, isNew: true,
bargainId: that.id, productId: that.bargainInfo.productId,
cartNum: that.bargainInfo.num, bargainId: that.bargainInfo.id,
uniqueId: '', cartNum: 1,
combinationId: 0, productAttrUnique: that.bargainInfo.attrValue[0].id
secKillId: 0,
'new': 1
}; };
postCartAdd(data).then(res => { postCartAdd(data).then(res => {
uni.navigateTo({ 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 => { }).catch(err => {
return app.Tips({ return that.$util.Tips({title:err})
title: err
})
}); });
}, },
getBargainDetails: function() { // getBargainDetails: function() { //
@ -433,12 +452,11 @@
that.userInfo = res.data.userInfo; that.userInfo = res.data.userInfo;
that.bargainSumCount = res.data.bargainSumCount; that.bargainSumCount = res.data.bargainSumCount;
that.userBargainStatus = res.data.userBargainStatus; that.userBargainStatus = res.data.userBargainStatus;
that.productStock = res.data.bargain.attr.product_stock; that.productStock = res.data.bargain.stock;
that.quota = res.data.bargain.attr.quota; that.quota = res.data.bargain.quota;
that.datatime = res.data.bargain.stop_time that.datatime = res.data.bargain.endTime/1000;
that.pages = '/pages/activity/goods_bargain_details/index?id=' + that.id + '&bargain=' + that.pages = '/pages/activity/goods_bargain_details/index?id=' + that.id + '&bargain=' +
that.bargainUid + '&scene=' + that.userInfo.uid; that.bargainUid + '&scene=' + that.userInfo.uid;
console.log(that.pages);
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:res.data.bargain.title.substring(0,13)+'...' title:res.data.bargain.title.substring(0,13)+'...'
}) })
@ -450,7 +468,15 @@
that.setOpenShare(); that.setOpenShare();
//#endif //#endif
}).catch(function(err) { }).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 () {// getBargainHelpCount: function () {//
@ -462,6 +488,11 @@
that.bargainInfo.price = parseFloat(price) <= 0 ? 0 : price; that.bargainInfo.price = parseFloat(price) <= 0 ? 0 : price;
that.userBargainStatusHelp = res.data.userBargainStatus; that.userBargainStatusHelp = res.data.userBargainStatus;
that.statusPay = res.data.status; that.statusPay = res.data.status;
this.isHelp = res.data.isConsume;
}).catch(function(err) {
that.$util.Tips({
title: err
});
}) })
}, },
currentBargainUser: function() { // currentBargainUser: function() { //
@ -471,12 +502,20 @@
setBargain: function() { // setBargain: function() { //
var that = this; var that = this;
postBargainStart(that.id).then(res => { postBargainStart(that.id).then(res => {
if (res.code === 'subscribe') {
return;
}
that.$set(that, 'bargainUserId', res.data); that.$set(that, 'bargainUserId', res.data);
that.getBargainUserBargainPrice(); // that.getBargainUserBargainPrice();
that.setBargainHelp(); that.setBargainHelp();
that.getBargainHelpCount(); that.getBargainHelpCount();
that.userBargainStatus = 1; that.userBargainStatus = 1;
}) },error => {
this.bargainUid = 0;
that.$util.Tips({
title: error
})
})
}, },
setBargainHelp: function() { // setBargainHelp: function() { //
var that = this; var that = this;
@ -485,10 +524,18 @@
bargainUserUid: that.bargainUid bargainUserUid: that.bargainUid
}; };
postBargainHelp(data).then(res => { 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, 'bargainUserHelpList', []);
that.$set(that, 'isHelp', true);
that.getBargainUser(); that.getBargainUser();
that.getBargainUserBargainPrice(); that.$set(that, 'bargainUserBargainPrice', res.data.bargainPrice);
that.$set(that, 'active', true);
//that.getBargainUserBargainPrice();
that.getBargainHelpCount(); that.getBargainHelpCount();
}).catch(err => { }).catch(err => {
that.$util.Tips({ that.$util.Tips({
@ -500,22 +547,36 @@
}, },
getBargainUser: function() { // getBargainUser: function() { //
var that = this; var that = this;
// if (that.loadend) return;
if (that.loading) return;
var data = { var data = {
bargainId: that.id, bargainId: that.id,
bargainUserUid: that.bargainUid, bargainUserUid: that.bargainUid,
offset: that.offset, };
var datas = {
page: that.page,
limit: that.limit, limit: that.limit,
}; };
postBargainHelpList(data).then(res => { this.loading = true;
var bargainUserHelpListNew = []; postBargainHelpList(datas,data).then(res => {
var bargainUserHelpList = that.bargainUserHelpList; let list = res.data.list;
var len = res.data.length; let bargainUserHelpList = that.$util.SplitArray(list, that.bargainUserHelpList);
let loadend = list.length < that.limit;
bargainUserHelpListNew = bargainUserHelpList.concat(res.data); 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); // var bargainUserHelpListNew = [];
that.$set(that, 'limitStatus', data.limit > len); // var bargainUserHelpList = that.bargainUserHelpList;
that.$set(that, 'offest', (Number(data.offset) + Number(data.limit))); // 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() { getBargainUserBargainPricePoster: function() {
@ -669,6 +730,16 @@
page { page {
background-color: #e93323 !important; 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 { .bargain .icon-xiangzuo {
font-size: 40rpx; font-size: 40rpx;

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<view class='group-list'> <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='header'></view>
<view class='list'> <view class='list'>
<block v-for="(item,index) in combinationList" :key='index'> <block v-for="(item,index) in combinationList" :key='index'>
@ -19,12 +19,15 @@
</view> </view>
</view> </view>
<view class='bottom acea-row row-between-wrapper'> <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 class='groupBnt bg-color'>去拼团<text class="iconfont icon-jiantou"></text></view>
</view> </view>
</view> </view>
</view> </view>
</block> </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>
</view> </view>
<home></home> <home></home>
@ -52,9 +55,13 @@
page: 1, page: 1,
loading: false, loading: false,
loadend: false, loadend: false,
returnShow: true,
loadTitle: ''
} }
}, },
onLoad() { onLoad() {
var pages = getCurrentPages();
this.returnShow = pages.length===1?false:true;
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title:"拼团列表" title:"拼团列表"
}) })
@ -90,21 +97,24 @@
var that = this; var that = this;
if (that.loadend) return; if (that.loadend) return;
if (that.loading) return; if (that.loading) return;
that.loadTitle = '';
var data = { var data = {
page: that.page, page: that.page,
limit: that.limit limit: that.limit
}; };
this.loading = true this.loading = true
getCombinationList(data).then(function(res) { getCombinationList(data).then(function(res) {
var combinationList = that.combinationList; let list = res.data.list;
var limit = that.limit; let combinationList = that.$util.SplitArray(list, that.combinationList);
that.page++; let loadend = list.length < that.limit;
that.loadend = limit > res.data.length; that.loadend = loadend;
that.combinationList = combinationList.concat(res.data);
that.page = that.data.page;
that.loading = false; that.loading = false;
that.loadTitle = loadend ? '已全部加载' : '加载更多';
that.$set(that, 'combinationList', combinationList);
that.$set(that, 'page', that.page + 1);
}).catch(() => { }).catch(() => {
that.loading = false that.loading = false;
that.loadTitle = '加载更多';
}) })
}, },
}, },

View File

@ -22,15 +22,15 @@
<view class='wrapper'> <view class='wrapper'>
<view class='share acea-row row-between row-bottom'> <view class='share acea-row row-between row-bottom'>
<view class='money font-color'> <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>
<view class='iconfont icon-fenxiang' @click="listenerActionSheet"></view> <view class='iconfont icon-fenxiang' @click="listenerActionSheet"></view>
</view> </view>
<view class='introduce'>{{storeInfo.title}}</view> <view class='introduce'>{{storeInfo.title}}</view>
<view class='label acea-row row-between-wrapper'> <view class='label acea-row row-between-wrapper'>
<view class='stock'>类型{{storeInfo.people}}人团</view> <view class='stock'>类型{{storeInfo.people || 0}}人团</view>
<view>累计销量{{storeInfo.total?storeInfo.total:0}}</view> <view>累计销量{{storeInfo.total?storeInfo.total:0}} {{storeInfo.unit_name || ''}}</view>
<view>限购: {{ storeInfo.quota ? storeInfo.quota : 0 }} </view> <view>限购: {{ storeInfo.quotaShow ? storeInfo.quotaShow : 0 }} {{storeInfo.unit_name || ''}}</view>
</view> </view>
</view> </view>
<view class='attribute acea-row row-between-wrapper' @tap='selecAttr' v-if='attribute.productAttr.length'> <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='notice acea-row row-middle'>
<view class='num font-color'> <view class='num font-color'>
<text class='iconfont icon-laba'></text> <text class='iconfont icon-laba'></text>
已拼{{pink_ok_sum}}<text class='line'>|</text> 已拼{{pinkOkSum}}<text class='line'>|</text>
</view> </view>
<view class='swiper'> <view class='swiper'>
<swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500" vertical="true" <swiper :indicator-dots="indicatorDots" :autoplay="autoplay" interval="2500" duration="500" vertical="true"
circular="true"> circular="true">
<block v-for="(item,index) in itemNew" :key='index'> <block v-for="(item,index) in itemNew" :key='index'>
<swiper-item> <swiper-item>
<view class='line1'>{{item}}</view> <view class='line1'>{{item.nickname}}拼团成功</view>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
@ -64,7 +64,10 @@
<view class='right acea-row row-middle'> <view class='right acea-row row-middle'>
<view> <view>
<view class='lack'>还差<text class='font-color'>{{item.count}}</text>人成团</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> </view>
<navigator hover-class='none' :url="'/pages/activity/goods_combination_status/index?id='+item.id" class='spellBnt'> <navigator hover-class='none' :url="'/pages/activity/goods_combination_status/index?id='+item.id" class='spellBnt'>
去拼单 去拼单
@ -72,8 +75,10 @@
</navigator> </navigator>
</view> </view>
</view> </view>
<!-- <view class='more' @tap='showAll' v-if="pink.length >= AllIndex"><text class='iconfont icon-xiangxia'></text></view> <template v-if="pink.length">
<view class='more' @tap='hideAll' v-else="pink.length >= AllIndex && !pink.length"><text class='iconfont icon-xiangxia'></text></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-if="pink.length === AllIndex && pink.length !== AllIndexDefault">收起<text class='iconfont icon-xiangshang'></text></view>
</template>
</view> </view>
<view class='playWay'> <view class='playWay'>
<view class='title acea-row row-between-wrapper'> <view class='title acea-row row-between-wrapper'>
@ -104,7 +109,7 @@
<view class='userEvaluation' id="past1"> <view class='userEvaluation' id="past1">
<view class='title acea-row row-between-wrapper'> <view class='title acea-row row-between-wrapper'>
<view>用户评价({{replyCount}})</view> <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='font-color'>{{replyChance || 0}}%</text>
好评率 好评率
<text class='iconfont icon-jiantou'></text> <text class='iconfont icon-jiantou'></text>
@ -129,7 +134,7 @@
</button> </button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP --> <!-- #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 class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</navigator> </navigator>
@ -141,20 +146,20 @@
</view> </view>
<view class="bnt acea-row"> <view class="bnt acea-row">
<view class="joinCart bnts" @tap="goProduct"></view> <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>
<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>
</view> </view>
</view> </view>
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"></shareRedPackets>
<!-- 分享按钮 --> <!-- 分享按钮 -->
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''"> <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<!-- #ifndef MP --> <!-- #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="iconfont icon-weixin3"></view>
<view class="">发送给朋友</view> <view class="">发送给朋友</view>
</button> </button>
@ -170,10 +175,12 @@
<view class="">生成海报</view> <view class="">生成海报</view>
</button> </button>
</view> </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='/static/images/poster-close.png' class='close' @click="posterImageClose"></image>
<image :src='posterImage'></image> <image :src='posterImage'></image>
<!-- #ifndef H5 --> <!-- #ifndef H5 -->
@ -183,37 +190,52 @@
<view class="keep">长按图片可以保存到手机</view> <view class="keep">长按图片可以保存到手机</view>
<!-- #endif --> <!-- #endif -->
</view> </view>
<view class='mask' v-if="posterImageStatus"></view> <view class="canvas" v-else>
<canvas class="canvas" canvas-id='myCanvas' v-if="canvasStatus"></canvas> <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 --> <!-- #ifdef MP -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize>
<!-- #endif --> <!-- #endif -->
<home></home> <home></home>
<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum" @iptCartNum="iptCartNum" <product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
@attrVal="attrVal"></product-window> @iptCartNum="iptCartNum" @attrVal="attrVal"></product-window>
</view> </view>
</template> </template>
<script> <script>
const app = getApp(); const app = getApp();
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
import { base64src } from '@/utils/base64src.js'
import { import {
mapGetters mapGetters
} from "vuex"; } from "vuex";
// #ifdef MP // #ifdef MP
import authorize from '@/components/Authorize'; import authorize from '@/components/Authorize';
import {
getQrcode
} from '@/api/api.js';
// #endif // #endif
import productConSwiper from '@/components/productConSwiper/index.vue' import productConSwiper from '@/components/productConSwiper'
import { import {
toLogin toLogin
} from '@/libs/login.js'; } from '@/libs/login.js';
import { import {
getCombinationDetail, getCombinationDetail
scombinationCode
} from '@/api/activity.js'; } from '@/api/activity.js';
import { import {
postCartAdd, postCartAdd,
collectAdd, collectAdd,
collectDel collectDel,
getReplyList,
getReplyConfig
} from '@/api/store.js'; } from '@/api/store.js';
import { import {
imageBase64 imageBase64
@ -223,9 +245,13 @@
import productWindow from '@/components/productWindow/index.vue' import productWindow from '@/components/productWindow/index.vue'
import userEvaluation from '@/components/userEvaluation/index.vue' import userEvaluation from '@/components/userEvaluation/index.vue'
import countDown from '@/components/countDown/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 { export default {
components: { components: {
shareRedPackets,
productConSwiper, productConSwiper,
// #ifdef MP // #ifdef MP
authorize, authorize,
@ -236,7 +262,12 @@
userEvaluation, userEvaluation,
countDown countDown
}, },
computed: mapGetters(['isLogin']), computed: mapGetters({
'isLogin': 'isLogin',
'userData': 'userInfo',
'uid': 'uid',
'chatUrl': 'chatUrl'
}),
data() { data() {
return { return {
navH: '', navH: '',
@ -258,6 +289,7 @@
attr: '请选择', attr: '请选择',
attrValue: '', attrValue: '',
AllIndex: 2, AllIndex: 2,
maxAllIndex: 0,
replyChance: '', replyChance: '',
limitNum: 1, limitNum: 1,
timeer: null, timeer: null,
@ -273,12 +305,14 @@
lock: false, lock: false,
scrollTop: 0, scrollTop: 0,
storeInfo: {}, storeInfo: {},
pink_ok_sum: 0, pinkOkSum: 0,
pink: [], pink: [],
replyCount: 0, replyCount: 0,
reply: [], reply: [],
imgUrls: [], imgUrls: [],
sharePacket: '', sharePacket: {
isState: true, //
},
tagStyle: { tagStyle: {
img: 'width:100%;' img: 'width:100%;'
}, },
@ -296,10 +330,14 @@
cart_num: '', cart_num: '',
isAuto: false, // isAuto: false, //
isShowAuth: false, // isShowAuth: false, //
AllIndexDefault: 0,
imgTop:'',
qrcodeSize: 600,
H5ShareBox: false, //
onceNum: 0 //
} }
}, },
onLoad(options) { onLoad(options) {
console.log(options,'options')
let that = this let that = this
// #ifdef MP // #ifdef MP
this.navH = app.globalData.navHeight; this.navH = app.globalData.navHeight;
@ -316,7 +354,7 @@
}); });
// //
// #ifdef MP // #ifdef MP
if (options.scene) { if (options.scene) {
let value = this.$util.getUrlParams(decodeURIComponent(options.scene)); let value = this.$util.getUrlParams(decodeURIComponent(options.scene));
if (value.id) options.id = value.id; if (value.id) options.id = value.id;
@ -367,6 +405,38 @@
}; };
}, },
methods: { 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) { authColse: function(e) {
this.isShowAuth = e; this.isShowAuth = e;
@ -374,10 +444,18 @@
/** /**
* 购物车手动填写 * 购物车手动填写
* *
*/ */
iptCartNum: function (e) { iptCartNum: function(e) {
this.$set(this.attribute.productSelect,'cart_num',e); if (e > this.onceNum) {
this.$set(this, "cart_num", e); 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() { returns() {
@ -391,38 +469,45 @@
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.data.storeInfo.title.substring(0, 16) title: res.data.storeInfo.title.substring(0, 16)
}) })
that.imgUrls = res.data.storeInfo.images
that.storeInfo = res.data.storeInfo; that.storeInfo = res.data.storeInfo;
that.pink = res.data.pink; that.getProductReplyList();
that.pindAll = res.data.pindAll; that.getProductReplyCount();
that.reply = res.data.reply ? [res.data.reply] : []; that.imgUrls = JSON.parse(res.data.storeInfo.images);
that.replyCount = res.data.replyCount; that.attribute.productSelect.num = res.data.storeInfo.onceNum;
that.itemNew = res.data.pink_ok_list; that.pink = res.data.pink || [];
that.pink_ok_sum = res.data.pink_ok_sum; that.pindAll = res.data.pindAll || [];
that.replyChance = res.data.replyChance; // that.reply = res.data.reply ? res.data.reply : [];
that.attribute.productAttr = res.data.productAttr; that.itemNew = res.data.pinkOkList || [];
that.pinkOkSum = res.data.pinkOkSum;
that.attribute.productAttr = res.data.productAttr || [];
that.productValue = res.data.productValue; 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 // #ifdef H5
that.setShare(); that.setShare();
that.storeImage = that.storeInfo.image 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 // #endif
// #ifndef H5 // #ifndef H5
that.downloadFilestoreImage(); that.downloadFilestoreImage();
// #endif // #endif
// that.setProductSelect(); // that.setProductSelect();
that.DefaultSelect(); that.DefaultSelect();
// setTimeout(function() { setTimeout(function() {
// that.infoScroll(); that.infoScroll();
// }, 500); }, 500);
}).catch(function(err) { }).catch(function(err) {
that.$util.Tips({ that.$util.Tips({
title:err title: err
},{ }, {
tab:3 tab: 3
}) })
}) })
}, },
@ -498,26 +583,25 @@
* *
*/ */
DefaultSelect: function() { DefaultSelect: function() {
let self = this let self = this
let productAttr = self.attribute.productAttr; let productAttr = self.attribute.productAttr;
let value = []; let value = [];
for (var key in this.productValue) { for (var key in self.productValue) {
if (this.productValue[key].quota > 0) { if (self.productValue[key].quota > 0) {
value = this.attribute.productAttr.length ? key.split(",") : []; value = self.attribute.productAttr.length ? key.split(",") : [];
break; break;
} }
} }
for (let i = 0; i < productAttr.length; i++) { for (let i = 0; i < productAttr.length; i++) {
this.$set(productAttr[i], "index", value[i]); self.$set(productAttr[i], "index", value[i]);
} }
//sort();:-- //sort();:--
let productSelect = self.productValue[value.sort().join(",")]; let productSelect = self.productValue[value.join(",")];
if (productSelect && productAttr.length) { if (productSelect && productAttr.length) {
self.$set( self.$set(
self.attribute.productSelect, self.attribute.productSelect,
"store_name", "storeName",
self.storeInfo.title self.storeInfo.title
); );
self.$set(self.attribute.productSelect, "image", productSelect.image); 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, "stock", productSelect.stock);
self.$set(self.attribute.productSelect, "unique", productSelect.unique); self.$set(self.attribute.productSelect, "unique", productSelect.unique);
self.$set(self.attribute.productSelect, "quota", productSelect.quota); self.$set(self.attribute.productSelect, "quota", productSelect.quota);
self.$set(self.attribute.productSelect, "quota_show", productSelect.quota_show); self.$set(self.attribute.productSelect, "quotaShow", productSelect.quotaShow);
self.$set(self.attribute.productSelect, "product_stock", productSelect.product_stock);
self.$set(self.attribute.productSelect, "cart_num", 1); self.$set(self.attribute.productSelect, "cart_num", 1);
self.$set(self, "attrValue", value.sort().join(",")); this.$set(this, "attrValue", value.join(","));
self.attrValue = value.sort().join(",") this.$set(this, "attrTxt", "已选择");
} else if (!productSelect && productAttr.length) { } else if (!productSelect && productAttr.length) {
self.$set( self.$set(
self.attribute.productSelect, self.attribute.productSelect,
"store_name", "storeName",
self.storeInfo.title self.storeInfo.title
); );
self.$set(self.attribute.productSelect, "image", self.storeInfo.image); self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
self.$set(self.attribute.productSelect, "price", self.storeInfo.price); self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
self.$set(self.attribute.productSelect, "quota", 0); self.$set(self.attribute.productSelect, "quota", 0);
self.$set(self.attribute.productSelect, "quota_show", 0); self.$set(self.attribute.productSelect, "quotaShow", 0);
self.$set(self.attribute.productSelect, "product_stock", 0);
self.$set(self.attribute.productSelect, "stock", 0); self.$set(self.attribute.productSelect, "stock", 0);
self.$set(self.attribute.productSelect, "unique", ""); self.$set(self.attribute.productSelect, "unique", "");
self.$set(self.attribute.productSelect, "cart_num", 0); self.$set(self.attribute.productSelect, "cart_num", 0);
@ -549,14 +631,14 @@
} else if (!productSelect && !productAttr.length) { } else if (!productSelect && !productAttr.length) {
self.$set( self.$set(
self.attribute.productSelect, self.attribute.productSelect,
"store_name", "storeName",
self.storeInfo.title self.storeInfo.title
); );
self.$set(self.attribute.productSelect, "image", self.storeInfo.image); self.$set(self.attribute.productSelect, "image", self.storeInfo.image);
self.$set(self.attribute.productSelect, "price", self.storeInfo.price); self.$set(self.attribute.productSelect, "price", self.storeInfo.price);
self.$set(self.attribute.productSelect, "stock", self.storeInfo.stock); self.$set(self.attribute.productSelect, "stock", self.storeInfo.stock);
self.$set(self.attribute.productSelect, "quota", 0); 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.$set(
self.attribute.productSelect, self.attribute.productSelect,
"unique", "unique",
@ -574,7 +656,7 @@
heightArr = []; heightArr = [];
for (var i = 0; i < that.navList.length; i++) { //productList 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; var idView = "#past" + i;
// if (!that.data.good_list.length && i == 2) { // if (!that.data.good_list.length && i == 2) {
// var idView = "#past" + 3; // var idView = "#past" + 3;
@ -594,8 +676,8 @@
onLoadFun: function(e) { onLoadFun: function(e) {
this.userInfo = e this.userInfo = e
app.globalData.openPages = '/pages/activity/goods_combination_details/index?id=' + this.id + '&spid=' + e.uid; app.globalData.openPages = '/pages/activity/goods_combination_details/index?id=' + this.id + '&spid=' + e.uid;
this.downloadFilePromotionCode();
this.combinationDetail(); this.combinationDetail();
//this.downloadFilePromotionCode();
}, },
selecAttr: function() { selecAttr: function() {
this.attribute.cartAttr = true this.attribute.cartAttr = true
@ -612,56 +694,61 @@
//changeValue: | //changeValue: |
// //
let productSelect = this.productValue[this.attrValue]; let productSelect = this.productValue[this.attrValue];
if (this.buyNum === productSelect.quota) {
return this.$util.Tips({title: '您已超出当前商品每人限购数量,请浏览其他商品'});
}
if (this.cart_num) { if (this.cart_num) {
productSelect.cart_num = this.cart_num; productSelect.cart_num = this.cart_num;
this.attribute.productSelect.cart_num = this.cart_num; this.attribute.productSelect.cart_num = this.cart_num;
} }
//, //,
if (productSelect === undefined && !this.attribute.productAttr.length) if (productSelect === undefined && !this.attribute.productAttr.length) productSelect = this.attribute.productSelect;
productSelect = this.attribute.productSelect;
//0 //0
if (productSelect === undefined) return; if (productSelect === undefined) return;
let stock = productSelect.stock || 0; let stock = productSelect.stock || 0;
let quotaShow = productSelect.quota_show || 0; let quotaShow = productSelect.quota_show || 0;
let productStock = productSelect.product_stock || 0; let quota = productSelect.quota || 0;
let num = this.attribute.productSelect; let num = this.attribute.productSelect;
// let nums = this.storeInfo.onceNum || 0;
if (productSelect.cart_num == undefined) productSelect.cart_num = 1; //
if (changeValue) { if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
num.cart_num ++; if (changeValue) {
if(quotaShow >= productStock){ if (num.cart_num === this.onceNum) {
if (num.cart_num > productStock) { return this.$util.Tips({
this.$set(this.attribute.productSelect, "cart_num", productStock); title: `该商品每次限购${this.onceNum}${this.storeInfo.unitName}`
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);
} }
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) { 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) { ChangeAttr: function(res) {
this.$set(this,'cart_num',1); this.$set(this, 'cart_num', 1);
let productSelect = this.productValue[res]; let productSelect = this.productValue[res];
if (productSelect) { if (productSelect) {
this.$set(this.attribute.productSelect, "image", productSelect.image); 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, "unique", productSelect.unique);
this.$set(this.attribute.productSelect, "cart_num", 1); this.$set(this.attribute.productSelect, "cart_num", 1);
this.$set(this.attribute.productSelect, "quota", productSelect.quota); 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.$set(this, "attrValue", res);
this.attrTxt = "已选择" this.attrTxt = "已选择"
@ -681,7 +768,7 @@
this.$set(this.attribute.productSelect, "unique", ""); this.$set(this.attribute.productSelect, "unique", "");
this.$set(this.attribute.productSelect, "cart_num", 0); this.$set(this.attribute.productSelect, "cart_num", 0);
this.$set(this.attribute.productSelect, "quota", 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.$set(this, "attrValue", "");
this.attrTxt = "已选择" this.attrTxt = "已选择"
} }
@ -689,7 +776,7 @@
// //
goProduct() { goProduct() {
uni.navigateTo({ 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: '请选择属性' title: '请选择属性'
}); });
var data = { var data = {
productId: that.storeInfo.product_id, productId: that.storeInfo.productId,
secKillId: 0, combinationId:parseFloat(that.id),
bargainId: 0, cartNum: that.cart_num ? this.cart_num : this.attribute.productSelect.cart_num,
combinationId: that.id, productAttrUnique: productSelect !== undefined ? productSelect.id : '',
cartNum: that.cart_num, isNew: true,
uniqueId: productSelect !== undefined ? productSelect.unique : '',
is_new: 1,
}; };
postCartAdd(data).then(function(res) { postCartAdd(data).then(function(res) {
that.isOpen = false that.isOpen = false
uni.navigateTo({ 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) { }).catch(function(res) {
uni.showToast({ uni.showToast({
@ -734,11 +819,11 @@
setCollect: function() { setCollect: function() {
var that = this; var that = this;
if (this.storeInfo.userCollect) { if (this.storeInfo.userCollect) {
collectDel(this.storeInfo.product_id).then(res => { collectDel(this.storeInfo.productId).then(res => {
that.storeInfo.userCollect = !that.storeInfo.userCollect that.storeInfo.userCollect = !that.storeInfo.userCollect
}) })
} else { } else {
collectAdd(this.storeInfo.product_id).then(res => { collectAdd(this.storeInfo.productId).then(res => {
that.storeInfo.userCollect = !that.storeInfo.userCollect that.storeInfo.userCollect = !that.storeInfo.userCollect
}) })
} }
@ -773,7 +858,7 @@
}, },
// //
posterImageClose: function() { posterImageClose: function() {
this.posterImageStatus = false this.canvasStatus = false
}, },
// //
setDomain: function(url) { setDomain: function(url) {
@ -825,14 +910,11 @@
that.$set(that, 'PromotionCode', ''); that.$set(that, 'PromotionCode', '');
}); });
}, },
getImageBase64: function() { getImageBase64: function(images) {
let that = this; let that = this;
imageBase64(that.storeImage, that.PromotionCode) imageBase64({url:images}).then(res=>{
.then(res => { that.imgTop = res.data.code
that.storeImage = res.data.image; })
that.PromotionCode = res.data.code;
})
.catch(() => {});
}, },
// //
goFriend: function() { goFriend: function() {
@ -844,59 +926,61 @@
goPoster: function() { goPoster: function() {
let that = this; let that = this;
that.posters = false; that.posters = false;
that.$set(that, 'canvasStatus', true); let arrImagesUrl = '';
let arr2 = [that.posterbackgd, that.storeImage, that.PromotionCode]; let arrImagesUrlTop = '';
// #ifndef H5 uni.downloadFile({
if (that.isDown) return that.$util.Tips({ url: that.imgTop, //
title: '正在下载海报,请稍后再试!' success: (res) => {
}); arrImagesUrlTop = res.tempFilePath;
// #endif let arrImages = [that.posterbackgd, arrImagesUrlTop, that.PromotionCode];
uni.getImageInfo({ let storeName = that.storeInfo.title;
src: that.PromotionCode, let price = that.storeInfo.price;
fail: function(res) { setTimeout(() => {
return that.$util.Tips({ that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) {
title: '小程序二维码需要发布正式版后才能获取到' that.posterImage = tempFilePath;
}); that.canvasStatus = true;
}, });
success() { }, 200);
if (arr2[2] == '') { }
// });
// #ifndef H5 },
that.downloadFilePromotionCode(function(msgPromotionCode) { //
arr2[2] = msgPromotionCode; getQrcode(){
if (arr2[2] == '') let that = this;
return that.$util.Tips({ let data = {
title: '海报二维码生成失败!' pid: that.uid,
}); id: that.id,
that.$util.PosterCanvas(arr2, that.storeInfo.title, that.storeInfo.price, function(tempFilePath) { path: 'pages/activity/goods_combination_details/index'
that.$set(that, 'posterImage', tempFilePath); }
that.$set(that, 'posterImageStatus', true); getQrcode(data).then(res=>{
that.$set(that, 'canvasStatus', false); base64src(res.data.code, res => {
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden); that.PromotionCode = res;
}); });
}); })
// #endif },
// #ifdef H5 //
that.$util.PosterCanvas(arr2, that.storeInfo.title, that.storeInfo.price, function(tempFilePath) { make() {
that.$set(that, 'posterImage', tempFilePath); let that = this;
that.$set(that, 'posterImageStatus', true); let href = location.href;
that.$set(that, 'canvasStatus', false); let hrefs = href.indexOf("?") === -1 ? href + "?spread=" + uid : href + "&spread=" + that.uid;
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden); uQRCode.make({
}); canvasId: 'qrcode',
// #endif text: hrefs,
} else { size: that.qrcodeSize,
//广 margin: 10,
that.$util.PosterCanvas(arr2, that.storeInfo.title, that.storeInfo.price, function(tempFilePath) { success: res => {
that.$set(that, 'posterImage', tempFilePath); that.PromotionCode = res;
that.$set(that, 'posterImageStatus', true);
that.$set(that, 'canvasStatus', false); },
that.$set(that, 'actionSheetHidden', !that.actionSheetHidden); complete: (res) => {
}); },
} fail:res=>{
}, that.$util.Tips({
}); title: '海报二维码生成失败!'
});
}
})
}, },
/* /*
* 保存到手机相册 * 保存到手机相册
*/ */
@ -967,11 +1051,6 @@
}); });
} }
}, },
scroll: function(e) { scroll: function(e) {
var that = this, var that = this,
scrollY = e.detail.scrollTop; scrollY = e.detail.scrollTop;
@ -1002,12 +1081,34 @@
this.lock = true; this.lock = true;
this.scrollTop = index > 0 ? that.topArr[index] - (app.globalData.navHeight / 2) : that.topArr[index] 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> </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 { .generate-posters {
width: 100%; width: 100%;
height: 170rpx; height: 170rpx;
@ -1177,6 +1278,8 @@
.product-con .assemble .item .pictxt .pictrue { .product-con .assemble .item .pictxt .pictrue {
width: 80rpx; width: 80rpx;
height: 80rpx; height: 80rpx;
background: #f0f0f0;
border-radius: 50%;
} }
.product-con .assemble .item .pictxt .pictrue image { .product-con .assemble .item .pictxt .pictrue image {
@ -1197,6 +1300,7 @@
color: #82848f; color: #82848f;
margin-top: 5rpx; margin-top: 5rpx;
} }
.product-con .assemble .item .right .spellBnt { .product-con .assemble .item .right .spellBnt {
font-size: 24rpx; font-size: 24rpx;
color: #fff; color: #fff;
@ -1342,6 +1446,7 @@
.canvas { .canvas {
width: 750px; width: 750px;
height: 1190px; height: 1190px;
opacity: 0;
} }
.poster-pop { .poster-pop {

File diff suppressed because it is too large Load Diff

View File

@ -61,7 +61,7 @@
</view> </view>
<view class='noCommodity' v-if="seckillList.length == 0 && (page != 1 || active== 0)"> <view class='noCommodity' v-if="seckillList.length == 0 && (page != 1 || active== 0)">
<view class='pictrue'> <view class='pictrue'>
<image src='/static/images/noShopper.png'></image> <image src='../../../static/images/noShopper.png'></image>
</view> </view>
</view> </view>
<home></home> <home></home>

View File

@ -74,7 +74,7 @@
</button> </button>
<!-- #endif --> <!-- #endif -->
<!-- #ifndef MP --> <!-- #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 class="iconfont icon-kefu"></view>
<view>客服</view> <view>客服</view>
</navigator> </navigator>
@ -106,6 +106,7 @@
</view> </view>
</view> </view>
</view> </view>
<shareRedPackets :sharePacket="sharePacket" @listenerActionSheet="listenerActionSheet" @closeChange="closeChange"></shareRedPackets>
<product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum" <product-window :attr='attribute' :limitNum='1' @myevent="onMyEvent" @ChangeAttr="ChangeAttr" @ChangeCartNum="ChangeCartNum"
@attrVal="attrVal" @iptCartNum="iptCartNum"></product-window> @attrVal="attrVal" @iptCartNum="iptCartNum"></product-window>
<!-- #ifdef MP --> <!-- #ifdef MP -->
@ -115,7 +116,7 @@
<!-- 分享按钮 --> <!-- 分享按钮 -->
<view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''"> <view class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
<!-- #ifndef MP --> <!-- #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="iconfont icon-weixin3"></view>
<view class="">发送给朋友</view> <view class="">发送给朋友</view>
</button> </button>
@ -149,6 +150,10 @@
<canvas style="width:750px;height:1190px;" canvas-id="firstCanvas"></canvas> <canvas style="width:750px;height:1190px;" canvas-id="firstCanvas"></canvas>
<canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/> <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}"/>
</view> </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> --> <!-- <view class='mask' v-if="canvasStatus"></view> -->
<!-- <!--
<canvas class="canvas" canvas-id='qrcode' v-if="canvasStatus"></canvas> --> <canvas class="canvas" canvas-id='qrcode' v-if="canvasStatus"></canvas> -->
@ -158,6 +163,7 @@
<script> <script>
const app = getApp(); const app = getApp();
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js' import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
import { base64src } from '@/utils/base64src.js'
import { import {
mapGetters mapGetters
} from "vuex"; } from "vuex";
@ -184,6 +190,7 @@
import parser from "@/components/jyf-parser/jyf-parser"; import parser from "@/components/jyf-parser/jyf-parser";
import home from '@/components/home/index.vue' import home from '@/components/home/index.vue'
import countDown from '@/components/countDown'; import countDown from '@/components/countDown';
import shareRedPackets from '@/components/shareRedPackets';
import { import {
imageBase64 imageBase64
} from "@/api/public"; } from "@/api/public";
@ -260,10 +267,15 @@
aloneAttrValueId: 0 ,//id aloneAttrValueId: 0 ,//id
imagePath:'',// imagePath:'',//
imgTop:'', imgTop:'',
H5ShareBox: false, //
sharePacket: {
isState: true, //
},
buyNum: 1 buyNum: 1
} }
}, },
components: { components: {
shareRedPackets,
productConSwiper, productConSwiper,
'productWindow': productWindow, 'productWindow': productWindow,
userEvaluation, userEvaluation,
@ -274,7 +286,7 @@
authorize authorize
// #endif // #endif
}, },
computed: mapGetters(['isLogin','uid']), computed: mapGetters(['isLogin','uid','chatUrl']),
onLoad(options) { onLoad(options) {
let that = this let that = this
@ -334,6 +346,12 @@
} }
}, },
methods: { methods: {
kefuClick(){
location.href = this.chatUrl;
},
closePosters:function(){
this.posters = false;
},
getProductReplyList: function() { getProductReplyList: function() {
getReplyList(this.productId, { getReplyList(this.productId, {
page: 1, page: 1,
@ -393,6 +411,7 @@
// #endif // #endif
// #ifdef MP // #ifdef MP
that.getQrcode(); that.getQrcode();
that.imgTop = res.data.storeInfo.image
// #endif // #endif
// #ifndef H5 // #ifndef H5
that.downloadFilestoreImage(); that.downloadFilestoreImage();
@ -534,7 +553,6 @@
// //
if (productSelect.cart_num == undefined) productSelect.cart_num = 1; if (productSelect.cart_num == undefined) productSelect.cart_num = 1;
if (changeValue) { if (changeValue) {
console.log(this.buyNum);
if (num.cart_num === 1) { if (num.cart_num === 1) {
return this.$util.Tips({ return this.$util.Tips({
title: `该商品每次限购1${this.storeInfo.unitName}` title: `该商品每次限购1${this.storeInfo.unitName}`
@ -854,13 +872,30 @@
goPoster: function() { goPoster: function() {
let that = this; let that = this;
that.posters = false; that.posters = false;
let arrImages = [that.posterbackgd, that.imgTop, that.PromotionCode]; let arrImagesUrl = '';
let storeName = that.storeInfo.storeName; let arrImagesUrlTop = '';
let price = that.storeInfo.price; uni.downloadFile({
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) { url: that.imgTop, //
that.posterImage = tempFilePath; success: (res) => {
that.canvasStatus = true; 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(){ getQrcode(){
@ -868,10 +903,12 @@
let data = { let data = {
pid: that.uid, pid: that.uid,
id: that.id, id: that.id,
path: '/pages/goods_seckill_details/index' path: 'pages/activity/goods_seckill_details/index'
} }
getQrcode(data).then(res=>{ getQrcode(data).then(res=>{
that.PromotionCode = res.data.code; base64src(res.data.code, res => {
that.PromotionCode = res;
});
}) })
}, },
// //
@ -973,6 +1010,19 @@
</script> </script>
<style scoped lang="scss"> <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 { .generate-posters {
width: 100%; width: 100%;
height: 170rpx; height: 170rpx;

View File

@ -2,15 +2,24 @@
<view> <view>
<view class='poster-poster'> <view class='poster-poster'>
<view class='tip'><text class='iconfont icon-shuoming'></text>提示点击图片即可保存至手机相册 </view> <view class='tip'><text class='iconfont icon-shuoming'></text>提示点击图片即可保存至手机相册 </view>
<view class='pictrue'> <!-- <view class='pictrue'>
<image :src='image' mode="widthFix"></image> <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> </view>
</view> </view>
</template> </template>
<script> <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 { export default {
data() { data() {
return { return {
@ -24,7 +33,13 @@
type: 0, type: 0,
id: 0, id: 0,
image: '', image: '',
from:'' from:'',
storeCombination: {},
qrcodeSize: 600,
posterbackgd: '/static/images/canbj.png',
PromotionCode: '',//
canvasStatus: false,
imgTop: '' //base64
} }
}, },
onLoad(options) { onLoad(options) {
@ -64,26 +79,157 @@
getPosterInfo: function() { getPosterInfo: function() {
var that = this,url = ''; var that = this,url = '';
let data = { let data = {
id: that.id, pinkId: parseFloat(that.id),
'from': that.from from: that.from
}; };
if (that.type == 1) { if (that.type == 1) {
getBargainPoster({
bargainId: that.id,
'from': that.from
}).then(res => {
that.image = res.data.url
}).catch(err => {
console.log(err)
})
} else { } else {
getCombinationPoster(data).then(res => { this.getCombinationPink();
that.image = res.data.url
}).catch(err => {
})
} }
}, },
//
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)
// H5tempFilePath 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() { showImage: function() {
var that = this; var that = this;
let imgArr = this.image.split(',') let imgArr = this.image.split(',')
@ -108,7 +254,11 @@
page { page {
background-color: #d22516 !important; background-color: #d22516 !important;
} }
.canvas {
position:fixed;
z-index: -5;
opacity: 0;
}
.poster-poster .tip { .poster-poster .tip {
height: 80rpx; height: 80rpx;
font-size: 26rpx; font-size: 26rpx;
@ -125,7 +275,7 @@
.poster-poster .pictrue { .poster-poster .pictrue {
width: 690rpx; width: 690rpx;
height: 100%; height: 1130rpx;
margin: 0 auto 50rpx auto; margin: 0 auto 50rpx auto;
} }

View File

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -7,7 +7,7 @@
placeholder-class='placeholder'></input> placeholder-class='placeholder'></input>
</view> </view>
</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" <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> :key="index" @click='tap(index,"b"+index)'><text>{{item.name}}</text></view>
</view> </view>
@ -54,19 +54,22 @@
number: "", number: "",
height: 0, height: 0,
hightArr: [], hightArr: [],
toView: "" toView: "",
tabbarH: 0
} }
}, },
onLoad(options) { onLoad(options) {
this.getAllCategory(); this.getAllCategory();
}, },
onShow(){}, onShow(){
},
methods: { methods: {
infoScroll: function() { infoScroll: function() {
let that = this; let that = this;
let len = that.productList.length; let len = that.productList.length;
let child = that.productList[len - 1]&&that.productList[len - 1].child?that.productList[len - 1].child:[]; let child = that.productList[len - 1]&&that.productList[len - 1].child?that.productList[len - 1].child:[];
this.number = child?child.length:0; this.number = child?child.length:0;
// //
uni.getSystemInfo({ uni.getSystemInfo({
success: function(res) { success: function(res) {
@ -139,7 +142,7 @@
z-index: 9; z-index: 9;
border-bottom: 1rpx solid #f5f5f5; border-bottom: 1rpx solid #f5f5f5;
} }
.productSort .header .input { .productSort .header .input {
width: 700rpx; width: 700rpx;
height: 60rpx; height: 60rpx;
@ -148,41 +151,41 @@
box-sizing: border-box; box-sizing: border-box;
padding: 0 25rpx; padding: 0 25rpx;
} }
.productSort .header .input .iconfont { .productSort .header .input .iconfont {
font-size: 35rpx; font-size: 35rpx;
color: #555; color: #555;
} }
.productSort .header .input .placeholder { .productSort .header .input .placeholder {
color: #999; color: #999;
} }
.productSort .header .input input { .productSort .header .input input {
font-size: 26rpx; font-size: 26rpx;
height: 100%; height: 100%;
width: 597rpx; width: 597rpx;
} }
.productSort .aside { .productSort .aside {
position: fixed; position: fixed;
width: 180rpx; width: 180rpx;
left: 0; left: 0;
bottom: 0;
top:0; top:0;
background-color: #f7f7f7; background-color: #f7f7f7;
overflow-y: auto; overflow-y: auto;
overflow-x: hidden; overflow-x: hidden;
height: auto;
margin-top: 96rpx; margin-top: 96rpx;
} }
.productSort .aside .item { .productSort .aside .item {
height: 100rpx; height: 100rpx;
width: 100%; width: 100%;
font-size: 26rpx; font-size: 26rpx;
color: #424242; color: #424242;
} }
.productSort .aside .item.on { .productSort .aside .item.on {
background-color: #fff; background-color: #fff;
border-left: 4rpx solid #fc4141; border-left: 4rpx solid #fc4141;
@ -191,55 +194,55 @@
color: #fc4141; color: #fc4141;
font-weight: bold; font-weight: bold;
} }
.productSort .conter { .productSort .conter {
margin: 96rpx 0 0 180rpx; margin: 96rpx 0 0 180rpx;
padding: 0 14rpx; padding: 0 14rpx;
background-color: #fff; background-color: #fff;
} }
.productSort .conter .listw { .productSort .conter .listw {
padding-top: 20rpx; padding-top: 20rpx;
} }
.productSort .conter .listw .title { .productSort .conter .listw .title {
height: 90rpx; height: 90rpx;
} }
.productSort .conter .listw .title .line { .productSort .conter .listw .title .line {
width: 100rpx; width: 100rpx;
height: 2rpx; height: 2rpx;
background-color: #f0f0f0; background-color: #f0f0f0;
} }
.productSort .conter .listw .title .name { .productSort .conter .listw .title .name {
font-size: 28rpx; font-size: 28rpx;
color: #333; color: #333;
margin: 0 30rpx; margin: 0 30rpx;
font-weight: bold; font-weight: bold;
} }
.productSort .conter .list { .productSort .conter .list {
flex-wrap: wrap; flex-wrap: wrap;
} }
.productSort .conter .list .item { .productSort .conter .list .item {
width: 177rpx; width: 177rpx;
margin-top: 26rpx; margin-top: 26rpx;
} }
.productSort .conter .list .item .picture { .productSort .conter .list .item .picture {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
border-radius: 50%; border-radius: 50%;
} }
.productSort .conter .list .item .picture image { .productSort .conter .list .item .picture image {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; border-radius: 50%;
} }
.productSort .conter .list .item .name { .productSort .conter .list .item .name {
font-size: 24rpx; font-size: 24rpx;
color: #333; color: #333;

View File

@ -216,6 +216,7 @@
<script> <script>
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js' 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 yzf_chat from '@/plugin/chat/yzf_chat.js'
import store from '@/store'; import store from '@/store';
import { import {
@ -556,7 +557,7 @@
getUserInfo: function() { getUserInfo: function() {
let that = this; let that = this;
getUserInfo().then(res => { 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); store.commit('SETUID', res.data.uid);
// that.$set(that, 'uid', res.data.uid); // that.$set(that, 'uid', res.data.uid);
// #ifdef H5 // #ifdef H5
@ -668,7 +669,7 @@
that.$set(that.attr, 'productAttr', res.data.productAttr); that.$set(that.attr, 'productAttr', res.data.productAttr);
that.$set(that, 'productValue', res.data.productValue); that.$set(that, 'productValue', res.data.productValue);
that.$set(that.sharePacket, 'priceName', res.data.priceName); 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, 'good_list', goodArray);
that.$set(that, 'activityH5', res.data.storeInfo.activityAllH5 ? res.data.storeInfo.activityAllH5 : []); that.$set(that, 'activityH5', res.data.storeInfo.activityAllH5 ? res.data.storeInfo.activityAllH5 : []);
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
@ -681,6 +682,7 @@
that.$set(that, 'navList', navList); that.$set(that, 'navList', navList);
// #ifdef H5 // #ifdef H5
that.$set(that, 'storeImage', that.storeInfo.image); that.$set(that, 'storeImage', that.storeInfo.image);
that.getImageBase64(res.data.storeInfo.image);
if (that.isLogin) { if (that.isLogin) {
that.getCartCount(); that.getCartCount();
that.ShareInfo(); that.ShareInfo();
@ -697,11 +699,13 @@
setTimeout(function() { setTimeout(function() {
that.infoScroll(); that.infoScroll();
}, 500); }, 500);
// #ifdef MP
that.imgTop = res.data.storeInfo.image
// #endif
// #ifndef H5 // #ifndef H5
that.downloadFilestoreImage(); that.downloadFilestoreImage();
// #endif // #endif
that.DefaultSelect(); that.DefaultSelect();
that.getImageBase64(res.data.storeInfo.image);
}).catch(err => { }).catch(err => {
// //
return that.$util.Tips({ return that.$util.Tips({
@ -1106,10 +1110,14 @@
let data = { let data = {
pid: that.uid, pid: that.uid,
id: that.id, id: that.id,
path: '/pages/goods_details/index' path: 'pages/goods_details/index'
} }
getQrcode(data).then(res=>{ 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; let that = this;
imageBase64({url:images}).then(res=>{ imageBase64({url:images}).then(res=>{
that.imgTop = res.data.code 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() { goPoster: function() {
let that = this; let that = this;
that.posters = false; that.posters = false;
let arrImages = [that.posterbackgd, that.imgTop, that.PromotionCode]; let arrImagesUrl = '';
let storeName = that.storeInfo.storeName; let arrImagesUrlTop = '';
let price = that.storeInfo.price; uni.downloadFile({
that.$util.PosterCanvas(arrImages, storeName, price, function(tempFilePath) { url: that.imgTop, //
that.imagePath = tempFilePath; success: (res) => {
that.canvasStatus = true; 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);
}
});
}, },
/* /*
* 保存到手机相册 * 保存到手机相册

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -141,6 +141,9 @@
</block> </block>
</swiper> </swiper>
</view> </view>
<a_seckill></a_seckill>
<b_combination></b_combination>
<c_bargain></c_bargain>
<!-- 首页推荐 --> <!-- 首页推荐 -->
<view class="index-product-wrapper" :class="iSshowH?'on':''"> <view class="index-product-wrapper" :class="iSshowH?'on':''">
<view class="nav-bd"> <view class="nav-bd">
@ -177,40 +180,6 @@
</view> </view>
</view> </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'"> <view class="productList" v-if="navIndex>0" :style="'margin-top:'+prodeuctTop+'px'">
<block v-if="sortProduct.length>0"> <block v-if="sortProduct.length>0">
@ -230,7 +199,7 @@
<view class='vip-money' v-if="item.vipPrice && item.vipPrice > 0">{{item.vipPrice}} <view class='vip-money' v-if="item.vipPrice && item.vipPrice > 0">{{item.vipPrice}}
<image src='../../static/images/vip.png'></image> <image src='../../static/images/vip.png'></image>
</view> </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> </view>
</view> </view>
@ -242,11 +211,10 @@
<block v-if="sortProduct.length == 0"> <block v-if="sortProduct.length == 0">
<view class="noCommodity"> <view class="noCommodity">
<view class='pictrue'> <view class='pictrue'>
<image src='/static/images/noShopper.png'></image> <image src='../../static/images/noShopper.png'></image>
</view> </view>
<recommend :hostProduct="hostProduct"></recommend> <recommend :hostProduct="hostProduct"></recommend>
</view> </view>
</block> </block>
</view> </view>
<coupon-window :window='window' :couponList="couponList" @onColse="onColse"></coupon-window> <coupon-window :window='window' :couponList="couponList" @onColse="onColse"></coupon-window>
@ -265,10 +233,6 @@
getIndexData, getIndexData,
getCoupons getCoupons
} from '@/api/api.js'; } from '@/api/api.js';
import {
getSeckillHeaderApi,
getSeckillList
} from '@/api/activity.js';
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
import { import {
getTemlIds getTemlIds
@ -287,6 +251,9 @@
import { import {
getShare getShare
} from '@/api/public.js'; } 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 goodList from '@/components/goodList';
import promotionGood from '@/components/promotionGood'; import promotionGood from '@/components/promotionGood';
import couponWindow from '@/components/couponWindow'; import couponWindow from '@/components/couponWindow';
@ -328,6 +295,9 @@
promotionGood, promotionGood,
couponWindow, couponWindow,
countDown, countDown,
a_seckill,
b_combination,
c_bargain,
recommend, recommend,
// #ifdef MP // #ifdef MP
authorize authorize
@ -380,7 +350,6 @@
}], }],
ProductNavindex: 0, ProductNavindex: 0,
marTop: 0, marTop: 0,
datatime: 0,
childID: 0, childID: 0,
loadend: false, loadend: false,
loading: false, loading: false,
@ -412,6 +381,7 @@
iSshowH: false, iSshowH: false,
configApi: {} ,// configApi: {} ,//
spikeList: [], // spikeList: [], //
point: ''
} }
}, },
onLoad() { onLoad() {
@ -424,7 +394,6 @@
} catch {} } catch {}
} }
}); });
this.getSeckillIndexTime();
let self = this let self = this
// #ifdef MP // #ifdef MP
// //
@ -453,30 +422,6 @@
}) })
}, },
methods: { 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 // #ifdef MP
getTemlIds() { getTemlIds() {
for (var i in arrTemp) { for (var i in arrTemp) {
@ -888,16 +833,6 @@
} }
</style> </style>
<style lang="scss"> <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 { .page-index {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -16,7 +16,7 @@
<view class='nav' v-if="navList.length > 0"> <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;"> <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"> <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>{{item.name}}</view>
<view class='line bg-color' v-if="active==item.id"></view> <view class='line bg-color' v-if="active==item.id"></view>
</view> </view>
@ -157,9 +157,10 @@
that.$set(that, 'navList', list); that.$set(that, 'navList', list);
}); });
}, },
tabSelect(active) { tabSelect(active,e) {
this.active = active; this.active = active;
this.scrollLeft = (active - 1) * 50; this.scrollLeft = e * 60;
// this.scrollLeft = (active - 1) * 50;
if (this.active == 0) this.getArticleHot(); if (this.active == 0) this.getArticleHot();
else { else {
this.$set(this, 'articleList', []); this.$set(this, 'articleList', []);

View File

@ -83,7 +83,7 @@
</view> </view>
<view class='noCart' v-if="cartList.valid.length == 0 && cartList.invalid.length == 0"> <view class='noCart' v-if="cartList.valid.length == 0 && cartList.invalid.length == 0">
<view class='pictrue'> <view class='pictrue'>
<image src='../../static/images/noCart.png'></image> <image src='../columnGoods/static/noCart.png'></image>
</view> </view>
<recommend :hostProduct='hostProduct'></recommend> <recommend :hostProduct='hostProduct'></recommend>
</view> </view>

View File

@ -210,7 +210,7 @@
<view class='bnt bg-color' v-if="status.type==0" @tap='pay_open(orderInfo.orderId)'>立即付款</view> <view class='bnt bg-color' v-if="status.type==0" @tap='pay_open(orderInfo.orderId)'>立即付款</view>
<!-- #ifdef MP --> <!-- #ifdef MP -->
<view @tap="openSubcribe('/pages/users/goods_return/index?orderId='+orderInfo.orderId)" class='bnt cancel' <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 --> <!-- #endif -->
<!-- #ifndef MP --> <!-- #ifndef MP -->
<navigator hover-class="none" :url="'/pages/users/goods_return/index?orderId='+orderInfo.orderId" class='bnt cancel' <navigator hover-class="none" :url="'/pages/users/goods_return/index?orderId='+orderInfo.orderId" class='bnt cancel'
@ -829,6 +829,7 @@
newCartInfo.push(item.info); newCartInfo.push(item.info);
}); });
that.$set(that, 'cartInfo', newCartInfo); that.$set(that, 'cartInfo', newCartInfo);
console.log(that.cartInfo)
if (res.data.refundStatus != 0) { if (res.data.refundStatus != 0) {
that.isGoodsReturn = true; that.isGoodsReturn = true;
}; };

View File

@ -2,8 +2,8 @@
<view> <view>
<view class='payment-status'> <view class='payment-status'>
<!--失败时 用icon-iconfontguanbi fail替换icon-duihao2 bg-color--> <!--失败时 用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 icons 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-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-if="order_pay_info.payType != 'offline'">{{order_pay_info.paid ? '':''}}</view>
<view class='status' v-else></view> <view class='status' v-else></view>
@ -14,7 +14,7 @@
</view> </view>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view>下单时间</view> <view>下单时间</view>
<view class='itemCom'>{{order_pay_info.payTime}}</view> <view class='itemCom'>{{order_pay_info.createTime}}</view>
</view> </view>
<view class='item acea-row row-between-wrapper'> <view class='item acea-row row-between-wrapper'>
<view>支付方式</view> <view>支付方式</view>
@ -185,6 +185,19 @@
border-radius: 10rpx; border-radius: 10rpx;
padding: 1rpx 0 28rpx 0; 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 { .payment-status .iconfont {
font-size: 70rpx; font-size: 70rpx;

View File

@ -2,7 +2,7 @@
<view class="register absolute"> <view class="register absolute">
<view class="shading"> <view class="shading">
<view class="pictrue acea-row row-center-wrapper"> <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> </view>
<view class="whiteBg"> <view class="whiteBg">

View File

@ -104,7 +104,7 @@
this.loadend = false; this.loadend = false;
this.$set(this, 'rankList', []); this.$set(this, 'rankList', []);
this.getBrokerageRankList(); this.getBrokerageRankList();
this.getBrokerageRankNumber(this.type); this.getBrokerageRankNumber();
}, },
getBrokerageRankNumber(type) { getBrokerageRankNumber(type) {
brokerageRankNumber({ brokerageRankNumber({
@ -125,12 +125,19 @@
}).then(res => { }).then(res => {
let list = res.data; let list = res.data;
let loadend = list.length < this.limit; let loadend = list.length < this.limit;
this.rankList.push.apply(this.rankList, list); this.rankList = this.$util.SplitArray(list, this.rankList);
this.loading = false; this.$set(that,'rankList',this.rankList);
this.loadend = loadend; this.loadend = loadend;
this.loadTitle = loadend ? '😕我也是有底线的' : '加载更多'; this.loading = false;
this.$set(this, 'rankList', this.rankList); this.loadtitle = loadend ? "哼😕~我也是有底线的~" : "加载更多"
this.position = res.data.position; // 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 => { }).catch(err => {
this.loading = false; this.loading = false;
this.loadTitle = '加载更多'; this.loadTitle = '加载更多';

View File

@ -4,7 +4,7 @@
<view class='generalComment acea-row row-between-wrapper'> <view class='generalComment acea-row row-between-wrapper'>
<view class='acea-row row-middle font-color'> <view class='acea-row row-middle font-color'>
<view class='evaluate'>评分</view> <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>
<view><text class='font-color'>{{(replyData.replyChance)*100}}%</text>好评率</view> <view><text class='font-color'>{{(replyData.replyChance)*100}}%</text>好评率</view>
</view> </view>
@ -21,7 +21,7 @@
</view> </view>
<view class='noCommodity' v-if="!replyData.sumCount && page > 1"> <view class='noCommodity' v-if="!replyData.sumCount && page > 1">
<view class='pictrue'> <view class='pictrue'>
<image src='/images/noEvaluate.png'></image> <image src='../static/noEvaluate.png'></image>
</view> </view>
</view> </view>
</view> </view>

View File

@ -141,7 +141,7 @@
DelPic:function(e){ DelPic:function(e){
let index = e, that = this; let index = e, that = this;
that.refund_reason_wap_imgPath.splice(index, 1); 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(){ uploadpic:function(){
let that=this; let that=this;
that.$util.uploadImageOne({url:'user/upload/image',name:'multipart', model:"product", pid:1}, function(res){ 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_img.push(res.data.url);
that.refund_reason_wap_imgPath.push(res.data.localPath); 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_img',that.refund_reason_wap_img);
that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath); // that.$set(that,'refund_reason_wap_imgPath',that.refund_reason_wap_imgPath);
}); });
}, },
@ -161,14 +161,15 @@
* 申请退货 * 申请退货
*/ */
subRefund:function(e){ subRefund:function(e){
console.log(e);
let that = this, value = e.detail.value; let that = this, value = e.detail.value;
console.log(that.refund_reason_wap_imgPath.join(','));
//form //form
// if (!value.refund_reason_wap_explain) return app.Tips({title:'退'}); if (!value.refund_reason_wap_explain) return this.$util.Tips({title:'请输入退款原因'});
orderRefundVerify({ orderRefundVerify({
text: that.RefundArray[that.index] || '', text: that.RefundArray[that.index] || '',
refund_reason_wap_explain: value.refund_reason_wap_explain, 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 uni: that.orderId
}).then(res=>{ }).then(res=>{
return this.$util.Tips({ title: '申请成功', icon: 'success' }, { tab: 5, url: '/pages/users/user_return_list/index?isT=1' }); return this.$util.Tips({ title: '申请成功', icon: 'success' }, { tab: 5, url: '/pages/users/user_return_list/index?isT=1' });

View File

@ -3,7 +3,7 @@
<div class="shading"> <div class="shading">
<div class="pictrue acea-row row-center-wrapper"> <div class="pictrue acea-row row-center-wrapper">
<image :src="logoUrl" v-if="logoUrl" /> <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> </div>
<div class="whiteBg" v-if="formItem === 1"> <div class="whiteBg" v-if="formItem === 1">
@ -324,7 +324,7 @@
loginH5({ loginH5({
account: that.account, account: that.account,
password: that.password, password: that.password,
spread: that.$Cache.get("spread") spread_spid: that.$Cache.get("spread")
}) })
.then(({ .then(({
data data

View File

@ -3,7 +3,7 @@
<div class="shading"> <div class="shading">
<div class="pictrue acea-row row-center-wrapper"> <div class="pictrue acea-row row-center-wrapper">
<image :src="logoUrl" v-if="logoUrl" /> <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> </div>
<div class="whiteBg" v-if="formItem === 1"> <div class="whiteBg" v-if="formItem === 1">

View File

@ -272,7 +272,9 @@
news: true, news: true,
again: false, again: false,
addAgain: false, addAgain: false,
secKill: false // bargain: false, //
combination: false, //
secKill: false, //
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
@ -290,7 +292,7 @@
url: 1 url: 1
}); });
this.couponId = options.couponId || 0; 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.addressId = options.addressId || 0;
this.cartId = options.cartId; this.cartId = options.cartId;
this.is_address = options.is_address ? true : false; this.is_address = options.is_address ? true : false;
@ -298,6 +300,8 @@
this.again = options.again || false; this.again = options.again || false;
this.addAgain = options.addAgain || false; this.addAgain = options.addAgain || false;
this.secKill = options.secKill || false; this.secKill = options.secKill || false;
this.combination = options.combination || false;
this.bargain = options.bargain || false;
if (this.isLogin) { if (this.isLogin) {
this.getaddressInfo(); this.getaddressInfo();
this.getConfirm(); this.getConfirm();
@ -507,7 +511,7 @@
*/ */
getConfirm: function() { getConfirm: function() {
let that = this; 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, 'userInfo', res.data.userInfo);
that.$set(that, 'integral', res.data.userInfo.integral); that.$set(that, 'integral', res.data.userInfo.integral);
that.$set(that, 'cartInfo', res.data.cartInfo); that.$set(that, 'cartInfo', res.data.cartInfo);
@ -524,9 +528,9 @@
that.cartArr[0].payStatus = res.data.payWeixinOpen || 0 that.cartArr[0].payStatus = res.data.payWeixinOpen || 0
that.cartArr[1].payStatus = res.data.yuePayStatus || 0 that.cartArr[1].payStatus = res.data.yuePayStatus || 0
if (res.data.offlinePayStatus == 2) { if (res.data.offlinePayStatus == 2) {
that.cartArr[2].payStatus = 0
} else {
that.cartArr[2].payStatus = 1 that.cartArr[2].payStatus = 1
} else {
that.cartArr[2].payStatus = 0
} }
// that.$set(that, 'cartArr', that.cartArr); // that.$set(that, 'cartArr', that.cartArr);
@ -551,8 +555,8 @@
let BargainId = 0; let BargainId = 0;
let combinationId = 0; let combinationId = 0;
cartINfo.forEach(function(value, index, cartINfo) { cartINfo.forEach(function(value, index, cartINfo) {
BargainId = cartINfo[index].bargain_id, BargainId = cartINfo[index].bargainId,
combinationId = cartINfo[index].combination_id combinationId = cartINfo[index].combinationId
}) })
that.$set(that, 'BargainId', parseInt(BargainId)); that.$set(that, 'BargainId', parseInt(BargainId));
that.$set(that, 'combinationId', parseInt(combinationId)); that.$set(that, 'combinationId', parseInt(combinationId));
@ -623,8 +627,7 @@
that.textareaStatus = false; that.textareaStatus = false;
that.address.address = true; that.address.address = true;
that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId + that.pagesUrl = '/pages/users/user_address_list/index?cartId=' + this.cartId + '&pinkId=' + this.pinkId +
'&couponId=' + '&couponId=' + this.couponId + '&secKill=' + this.secKill + '&combination=' + this.combination + '&bargain=' + this.bargain;
this.couponId;
}, },
realName: function(e) { realName: function(e) {
this.contacts = e.detail.value; this.contacts = e.detail.value;
@ -640,6 +643,10 @@
orderId = result.orderId, orderId = result.orderId,
jsConfig = res.data.jsConfig, jsConfig = res.data.jsConfig,
message = res.data.message; message = res.data.message;
if(that.totalPrice===0)return that.$util.Tips({
title: '支付成功',
icon: 'success'
});
if(that.news == "false"){ if(that.news == "false"){
orderPay({ orderPay({
'paytype': that.payType, 'paytype': that.payType,
@ -648,7 +655,7 @@
'from': 'routine', 'from': 'routine',
// #endif // #endif
// #ifdef H5 || APP-PLUS // #ifdef H5 || APP-PLUS
'from': this.$wechat.isWeixin() ? 'weixin' : 'weixinh5', 'from': this.$wechat.isWeixin() ? 'public' : 'weixinh5',
// #endif // #endif
}).then(res=>{ }).then(res=>{
result = res.data.result; result = res.data.result;

View File

@ -2,7 +2,7 @@
<div class="register absolute"> <div class="register absolute">
<div class="shading"> <div class="shading">
<div class="pictrue acea-row row-center-wrapper"> <div class="pictrue acea-row row-center-wrapper">
<image src="/static/images/logo2.png" /> <image src="../../../static/images/logo2.png" />
</div> </div>
</div> </div>
<div class="whiteBg"> <div class="whiteBg">

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -95,7 +95,10 @@
page: 1, page: 1,
limit: 20, limit: 20,
isAuto: false, // isAuto: false, //
isShowAuth: false // isShowAuth: false, //
bargain: false, //
combination: false, //
secKill: false, //
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
@ -104,6 +107,9 @@
this.cartId = options.cartId || ''; this.cartId = options.cartId || '';
this.pinkId = options.pinkId || 0; this.pinkId = options.pinkId || 0;
this.couponId = options.couponId || 0; this.couponId = options.couponId || 0;
this.secKill = options.secKill || false;
this.combination = options.combination || false;
this.bargain = options.bargain || false;
this.getAddressList(true); this.getAddressList(true);
} else { } else {
// #ifdef H5 || APP-PLUS // #ifdef H5 || APP-PLUS
@ -353,7 +359,7 @@
this.couponId = ''; this.couponId = '';
uni.redirectTo({ uni.redirectTo({
url: '/pages/users/order_confirm/index?is_address=1&cartId=' + cartId + '&addressId=' + id + '&pinkId=' + 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
}) })
} }
} }

View File

@ -95,7 +95,7 @@
let that = this; let that = this;
getUserCoupons({status:0}).then(res => { getUserCoupons({status:0}).then(res => {
that.loading = true; that.loading = true;
that.$set(that, 'couponsList', res.data); that.$set(that, 'couponsList', res.data || []);
}) })
} }
} }
@ -118,9 +118,9 @@
align-items: center; align-items: center;
} }
.condition .line-title { .condition .line-title {
width: 90rpx; /* width: 90rpx; */
height: 40rpx !important; height: 40rpx !important;
line-height: 1.5 !important; line-height: 40rpx !important;
padding: 0 10rpx; padding: 0 10rpx;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;

View File

@ -20,7 +20,7 @@
</view> </view>
<view class='noCommodity' v-else-if="!collectProductList.length && page > 1"> <view class='noCommodity' v-else-if="!collectProductList.length && page > 1">
<view class='pictrue'> <view class='pictrue'>
<image src='../../../static/images/noCollection.png'></image> <image src='../static/noCollection.png'></image>
</view> </view>
<recommend :hostProduct="hostProduct"></recommend> <recommend :hostProduct="hostProduct"></recommend>
</view> </view>

View File

@ -15,7 +15,7 @@
<view>累计消费</view> <view>累计消费</view>
</view> </view>
<view class='item'> <view class='item'>
<view class='num'>{{userInfo.today_integral||0}}</view> <view class='num'>{{userInfo.yesterdayIntegral||0}}</view>
<view>今日获得</view> <view>今日获得</view>
</view> </view>
</view> </view>

View File

@ -13,16 +13,24 @@
<navigator url="/pages/users/user_payment/index" hover-class="none" class='recharge font-color'>充值</navigator> <navigator url="/pages/users/user_payment/index" hover-class="none" class='recharge font-color'>充值</navigator>
<!-- #endif --> <!-- #endif -->
<!-- #ifdef MP --> <!-- #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 --> <!-- #endif -->
</view> </view>
<view class='cumulative acea-row row-top'> <view class='cumulative acea-row row-top'>
<!-- #ifdef APP-PLUS || H5 -->
<view class='item'> <view class='item'>
<view>累计收入()</view> <view>累计充值()</view>
<view class='money'>{{statistics.recharge || 0}}</view> <view class='money'>{{statistics.recharge || 0}}</view>
</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 class='item'>
<view>累计支出()</view> <view>累计消费()</view>
<view class='money'>{{statistics.orderStatusSum || 0}}</view> <view class='money'>{{statistics.orderStatusSum || 0}}</view>
</view> </view>
</view> </view>
@ -39,9 +47,9 @@
<view class='pictrue'> <view class='pictrue'>
<image src='../../../static/images/record2.png'></image> <image src='../../../static/images/record2.png'></image>
</view> </view>
<view>支出记录</view> <view>消费记录</view>
</navigator> </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'> <view class='pictrue'>
<image src='../../../static/images/record3.png'></image> <image src='../../../static/images/record3.png'></image>
</view> </view>
@ -155,7 +163,7 @@
userInfo: {}, userInfo: {},
hostProduct: [], hostProduct: [],
isClose: false, isClose: false,
recharge_switch: 0, rechargeSwitch: false,
activity: {}, activity: {},
isAuto: false, // isAuto: false, //
isShowAuth: false ,// isShowAuth: false ,//
@ -220,7 +228,7 @@
let that = this; let that = this;
getUserInfo().then(res => { getUserInfo().then(res => {
that.$set(that, 'userInfo', res.data); that.$set(that, 'userInfo', res.data);
that.recharge_switch = res.data.recharge_switch; that.rechargeSwitch = res.data.rechargeSwitch;
}); });
}, },
/** /**

View File

@ -34,6 +34,7 @@
// #ifdef H5 // #ifdef H5
import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js' import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js'
// #endif // #endif
import { base64src } from '@/utils/base64src.js'
import { import {
getUserInfo, getUserInfo,
spreadBanner spreadBanner
@ -78,15 +79,16 @@
imagePath: '', imagePath: '',
qrcodeSize: 1000, qrcodeSize: 1000,
PromotionCode: '', PromotionCode: '',
base64List: [] base64List: [],
posterbackgd: 'https://image.java.crmeb.net/image/product/2020/08/03/755bf516b1ca4b6db3bfeaa4dd5901cdh71kob20re.jpg'
}; };
}, },
computed: mapGetters(['isLogin']), computed: mapGetters(['isLogin']),
onLoad() { onLoad() {
if (this.isLogin) { if (this.isLogin) {
// #ifdef H5 // // #ifdef H5
this.userSpreadBannerList(); this.userSpreadBannerList();
// #endif // // #endif
} else { } else {
// #ifdef H5 || APP-PLUS // #ifdef H5 || APP-PLUS
toLogin(); toLogin();
@ -112,34 +114,69 @@
onReady() { onReady() {
}, },
methods: { 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){ getImageBase64:function(images){
uni.showLoading({ uni.showLoading({
title: '海报生成中', title: '海报生成中',
mask: true mask: true
}); });
let that = this; let that = this;
// #ifdef H5
let spreadList = []; let spreadList = [];
images.forEach((item,index)=>{ images.forEach((item,index)=>{
imageBase64({url:item.pic}).then(res=>{ imageBase64({url:item.pic}).then(res=>{
spreadList[index] = res.data.code; spreadList[index] = res.data.code;
that.$set(that,'base64List',spreadList); that.$set(that,'base64List',spreadList);
that.$set(that, 'poster', spreadList[0]); //that.$set(that, 'poster', spreadList[0]);
that.userInfos();
}) })
}) })
// #endif
// #ifdef MP
this.base64List = images.map(item => {
return item.pic
});
// #endif
that.userInfos();
console.log('上',this.base64List)
}, },
// //
getQrcode(){ getQrcode(){
let that = this; let that = this;
let data = { let data = {
pid: that.userInfo.uid, 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=>{ getQrcode(data).then(res=>{
that.PromotionCode = res.data.code; base64src(res.data.code, res => {
// let image = '../../../static/images/aa.jpg'; that.PromotionCode = res;
// that.PosterCanvas(image, res.data.code, that.userInfo.nickname,0); console.log('第一张',that.PromotionCode)
that.PosterCanvas(this.base64List[0], res.data.code, that.userInfo.nickname,0); });
setTimeout(() => {
that.PosterCanvas(arrImagesUrl, that.PromotionCode, that.userInfo.nickname, 0);
}, 200);
}) })
}, },
// //
@ -153,8 +190,6 @@
margin: 10, margin: 10,
success: res => { success: res => {
that.PromotionCode = 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); that.PosterCanvas(this.base64List[0], that.PromotionCode, that.userInfo.nickname,0);
}, },
complete: () => {}, complete: () => {},
@ -171,7 +206,7 @@
let that = this; let that = this;
uni.getImageInfo({ uni.getImageInfo({
src: arrImages, src: arrImages,
success: function(image) { success: function(res) {
context.drawImage(arrImages, 0, 0, 750, 1190); context.drawImage(arrImages, 0, 0, 750, 1190);
context.save(); context.save();
context.drawImage(code, 110, 925, 140, 140); context.drawImage(code, 110, 925, 140, 140);
@ -179,22 +214,43 @@
context.setFontSize(28); context.setFontSize(28);
context.fillText(nickname, 270, 980); context.fillText(nickname, 270, 980);
context.fillText('邀请您加入', 270, 1020); context.fillText('邀请您加入', 270, 1020);
context.draw(true,function(){ setTimeout(() => {
uni.canvasToTempFilePath({ context.draw(true,function(){
destWidth: 750, uni.canvasToTempFilePath({
destHeight: 1190, destWidth: 750,
canvasId: 'canvasOne', destHeight: 1190,
fileType: 'jpg', canvasId: 'canvasOne',
success: function(res) { fileType: 'jpg',
// H5tempFilePath base64 success: function(res) {
uni.hideLoading(); console.log("成功",res)
that.imagePath = res.tempFilePath; // H5tempFilePath base64
that.spreadList[index].pic = res.tempFilePath; 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)
// // H5tempFilePath base64
// uni.hideLoading();
// that.imagePath = res.tempFilePath;
// that.spreadList[index].pic = res.tempFilePath;
// }
// })
// })
}, },
fail: function(err) { fail: function(err) {
console.log("失败",err)
uni.hideLoading(); uni.hideLoading();
that.$util.Tips({ that.$util.Tips({
title: '无法获取图片信息' title: '无法获取图片信息'
@ -216,10 +272,19 @@
let base64List = this.base64List; let base64List = this.base64List;
let index = e.detail.current; let index = e.detail.current;
this.swiperIndex = index; this.swiperIndex = index;
this.$set(this, 'poster', base64List[index]); let arrImagesUrl = "";
this.PosterCanvas(base64List[index], this.PromotionCode, this.userInfo.nickname,index); uni.downloadFile({
// let aa = ['../../../static/images/aa.jpg','../../../static/images/aa.jpg','../../../static/images/aa.jpg']; url: base64List[index], //
// this.PosterCanvas(aa[index], this.PromotionCode, this.userInfo.nickname,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() { savePosterPath: function() {
@ -326,23 +391,6 @@
}; };
this.$wechat.wechatEvevt(["updateAppMessageShareData", "updateTimelineShareData"], configAppMessage) 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 { page {
background-color: #a3a3a3 !important; background-color: #a3a3a3 !important;
} }
.canvas canvas{ .canvas{
position: fixed; position: fixed;
z-index: -5rpx; z-index: -5rpx;
opacity: 0; opacity: 0;

View File

@ -214,12 +214,14 @@
page: page, page: page,
limit: limit limit: limit
}, recordType).then(res => { }, recordType).then(res => {
let len = res.data.list.length; if(res.data.list){
let recordListData = res.data.list; let len = res.data.list.length;
recordListNew = recordList.concat(recordListData); let recordListData = res.data.list;
that.status = limit > len; recordListNew = recordList.concat(recordListData);
that.page = page + 1; that.status = limit > len;
that.$set(that, 'recordList', recordListNew); that.page = page + 1;
that.$set(that, 'recordList', recordListNew);
}
}); });
}, },
getRecordListCount: function() { getRecordListCount: function() {

View File

@ -291,7 +291,7 @@
border-radius: 23rpx; border-radius: 23rpx;
padding: 22rpx 27rpx; padding: 22rpx 27rpx;
box-sizing: border-box; box-sizing: border-box;
.title { .title {
font-size: 24rpx; font-size: 24rpx;
color: #AE8B4A; color: #AE8B4A;
@ -305,7 +305,7 @@
.axis { .axis {
margin: 10rpx 0 15rpx 0; margin: 10rpx 0 15rpx 0;
overflow: hidden;
.bar { .bar {
width: 630rpx; width: 630rpx;
.spotw{ .spotw{

View File

@ -50,7 +50,7 @@
<recommend :hostProduct="hostProduct"></recommend> <recommend :hostProduct="hostProduct"></recommend>
<view class='growthValue' :class='growthValue==false?"on":""'> <view class='growthValue' :class='growthValue==false?"on":""'>
<view class='pictrue'> <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>
<view class='conter'>{{illustrate}}</view> <view class='conter'>{{illustrate}}</view>
</view> </view>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 KiB

BIN
static/images/canbj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
static/images/sign02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
static/images/sign03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,7 +1,7 @@
// import { // import {
// SUBSCRIBE_MESSAGE // SUBSCRIBE_MESSAGE
// } from '../config/cache.js'; // } from '../config/cache.js';
const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe"]; const arrTemp = ["paySubscribe","orderSubscribe","extrctSubscribe", "orderRefundSubscribe", "rechargeSubscribe", 'pinkSubscribe', 'bargainSubscribe'];
// export function auth() { // export function auth() {
// let tmplIds = {}; // let tmplIds = {};
@ -37,26 +37,6 @@ export function openExtrctSubscribe() {
return subscribe(tmplIds); 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); 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
// ]);
}
// /** // /**
// * 提现 // * 提现
// */ // */

23
utils/base64src.js Normal file
View File

@ -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;

View File

@ -169,6 +169,7 @@ import {
uni.getImageInfo({ uni.getImageInfo({
src: arrImages[0], src: arrImages[0],
success: function (image) { success: function (image) {
console.log('image成功', image)
context.drawImage(arrImages[0], 0, 0, 750, 1190); context.drawImage(arrImages[0], 0, 0, 750, 1190);
context.drawImage(arrImages[1], 0, 0, 750, 750); context.drawImage(arrImages[1], 0, 0, 750, 750);
context.save(); context.save();
@ -207,6 +208,7 @@ import {
canvasId: 'firstCanvas', canvasId: 'firstCanvas',
fileType: 'jpg', fileType: 'jpg',
success: function(res) { success: function(res) {
console.log(res.tempFilePath)
// 在H5平台下tempFilePath 为 base64 // 在H5平台下tempFilePath 为 base64
uni.hideLoading(); uni.hideLoading();
successFn && successFn(res.tempFilePath); successFn && successFn(res.tempFilePath);
@ -217,6 +219,7 @@ import {
}) })
}, },
fail: function(err) { fail: function(err) {
console.log('image失败', err)
uni.hideLoading(); uni.hideLoading();
that.Tips({ that.Tips({
title: '无法获取图片信息' title: '无法获取图片信息'