Commit 5985997f by 谢中龙

优化功能

parent 21ff127a
...@@ -171,5 +171,24 @@ App({ ...@@ -171,5 +171,24 @@ App({
isPlusVip: isPlusVip, isPlusVip: isPlusVip,
cityJson: cityJson, cityJson: cityJson,
brandId: envInfo.brandId, brandId: envInfo.brandId,
},
//跳转10级
navigateTo(routerObj){
//参数object : {url : ''}
if(!routerObj){
console.error('跳转页面需要路径');
return ;
}
if(Object.keys(routerObj).length == 0){
console.error('跳转页面需要路径');
return ;
}
if(getCurrentPages().length > 9){
wx.redirectTo(routerObj);
}
else{
wx.navigateTo(routerObj)
} }
},
}) })
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id // 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应 // app.js 中brandId 修改为对应
const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre const PROJECT_ENV = 'test' // 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 : //仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播 //3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播 //2006 泰华 , wx40fec8944623c8b3 有直播
...@@ -25,7 +25,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门 ...@@ -25,7 +25,7 @@ const PROJECT_ENV = 'prod' // 生产 prod, 开发 dev, 测试 test , 测试门
//2992 山东盛联微商城 wx53dedc202ae0d0c2 //2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab //2002 巴黎贝甜 wx21968cb3a486d4ab
const BRANCH_ID = 3001 const BRANCH_ID = 1002
const isMall = true const isMall = true
// const needMock = '' // // const needMock = '' //
......
...@@ -64,7 +64,7 @@ wxService.page({ ...@@ -64,7 +64,7 @@ wxService.page({
}, },
// 查询 /trolley/query // 查询 /trolley/query
getCartList() { getCartList(refresh) {
wx.showLoading({ wx.showLoading({
title: '加载中' title: '加载中'
}) })
...@@ -91,9 +91,18 @@ wxService.page({ ...@@ -91,9 +91,18 @@ wxService.page({
this.setData({ this.setData({
cartList: validateCarts, cartList: validateCarts,
invalidCarts : invalidCarts, invalidCarts : invalidCarts,
checkAll : false,
shopCartTotalFee : 0,
}) })
} }
} }
if(refresh){
wx.showToast({
title: '刷新成功',
});
wx.stopPullDownRefresh();
}
}) })
}, },
minusNumChange(e) { minusNumChange(e) {
...@@ -442,14 +451,24 @@ wxService.page({ ...@@ -442,14 +451,24 @@ wxService.page({
//清空有效宝贝 //清空有效宝贝
onTapEmptyValidCarts(){ onTapEmptyValidCarts(){
let self = this; let self = this;
let checked = self.data.cartList.filter(item => item.checked);
if(checked.length == 0){
wx.showToast({
title: '请先勾选需要删除的商品',
icon : 'none'
});
return ;
}
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '确认清空购物车中所有有效宝贝?', content: '确认删除购物车中勾选的宝贝?',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
wx.showLoading('清除中...'); wx.showLoading('清除中...');
let promiseArr = []; let promiseArr = [];
self.data.cartList.forEach(item => { checked.forEach(item => {
let skuId = item.skuId; let skuId = item.skuId;
let tempPromise = wxService.post(`/sale/trolley/remove?skuId=${skuId}`); let tempPromise = wxService.post(`/sale/trolley/remove?skuId=${skuId}`);
promiseArr.push(tempPromise); promiseArr.push(tempPromise);
...@@ -460,11 +479,7 @@ wxService.page({ ...@@ -460,11 +479,7 @@ wxService.page({
wx.showToast({ wx.showToast({
title: '清除成功', title: '清除成功',
}); });
self.setData({ self.getCartList();
cartList : [],
checkAll : false,
shopCartTotalFee : 0,
});
}).catch(err => { }).catch(err => {
wx.hideLoading(); wx.hideLoading();
wx.showToast({ wx.showToast({
...@@ -593,4 +608,11 @@ wxService.page({ ...@@ -593,4 +608,11 @@ wxService.page({
} else { } else {
} }
}, },
//
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
this.getCartList(true);
},
}) })
\ No newline at end of file
{ {
"navigationBarTitleText": "购物车", "navigationBarTitleText": "购物车",
"enablePullDownRefresh": true,
"usingComponents": { "usingComponents": {
"scroll-del": "/component/scrollDel/scrollDel", "scroll-del": "/component/scrollDel/scrollDel",
"go-home": "/component/goHome/goHome", "go-home": "/component/goHome/goHome",
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="cart-content" wx:if="{{cartList.length}}"> <view class="cart-content" wx:if="{{cartList.length}}">
<view class="invalid-title"> <view class="invalid-title">
<label>有效宝贝</label> <label>有效宝贝</label>
<text class="theme-text-color" bindtap="onTapEmptyValidCarts">清空</text> <text class="theme-text-color" bindtap="onTapEmptyValidCarts">删除</text>
</view> </view>
<!-- 购物车列表 --> <!-- 购物车列表 -->
<scroll-del <scroll-del
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
hover-class="none" hover-class="none"
class="sec-menu-image" class="sec-menu-image"
open-type="navigate" open-type="navigate"
url="/subPackage/page/pages/fun/fun?id={{menuSec.id}}&name={{menuSec.label}}" url="/subPackage/page/pages/categoryPro/categoryPro?id={{menuSec.id}}&name={{menuSec.label}}"
> >
<image src="{{menuSec.image}}" mode="widthFix" /> <image src="{{menuSec.image}}" mode="widthFix" />
</navigator> </navigator>
......
...@@ -100,12 +100,16 @@ wxService.page({ ...@@ -100,12 +100,16 @@ wxService.page({
title: '没有可用积分抵扣', title: '没有可用积分抵扣',
icon : 'none' icon : 'none'
}); });
return ;
} }
this.data.deductCheckStatus = !this.data.deductCheckStatus; this.data.deductCheckStatus = !this.data.deductCheckStatus;
this.setData({ this.setData({
deductCheckStatus : this.data.deductCheckStatus deductCheckStatus : this.data.deductCheckStatus
}); });
//需要计算显示订单价格
}, },
//显示积分抵扣规则 //显示积分抵扣规则
onTapShowDeductRule(){ onTapShowDeductRule(){
...@@ -354,6 +358,7 @@ wxService.page({ ...@@ -354,6 +358,7 @@ wxService.page({
// 实付款 // 实付款
this.setPayPrice(); this.setPayPrice();
}, },
//计算显示订单价格
setPayPrice() { setPayPrice() {
const { const {
currentCoupon, currentCoupon,
...@@ -369,6 +374,10 @@ wxService.page({ ...@@ -369,6 +374,10 @@ wxService.page({
let calCouponPrice = orderCoupon ? orderCoupon : defalutCoupon let calCouponPrice = orderCoupon ? orderCoupon : defalutCoupon
//获取计算优惠后的价格 //获取计算优惠后的价格
let promotionPrice = (orderInitPrice - calCouponPrice) > 0 ? (orderInitPrice - calCouponPrice) : 0; let promotionPrice = (orderInitPrice - calCouponPrice) > 0 ? (orderInitPrice - calCouponPrice) : 0;
//看一下积分是否勾选了
if(this.data.deductCheckStatus){
promotionPrice = parseFloat(promotionPrice - this.data.pointDeductMoney).toString(2);
}
// 实际价格 - 优惠价 + plus // 实际价格 - 优惠价 + plus
this.setData({ this.setData({
// orderPrice: Math.round(orderInitPrice - orderCoupon) // orderPrice: Math.round(orderInitPrice - orderCoupon)
......
...@@ -32,7 +32,6 @@ wxService.page({ ...@@ -32,7 +32,6 @@ wxService.page({
if(res){ if(res){
let obj = res.data.data ? res.data.data : null; let obj = res.data.data ? res.data.data : null;
if (obj){ if (obj){
console.log(obj)
let arr = obj.definition ? JSON.parse(obj.definition) : []; let arr = obj.definition ? JSON.parse(obj.definition) : [];
obj.desc = arr.filter(item => item.type == 2); obj.desc = arr.filter(item => item.type == 2);
obj.hasExpDate = arr.filter(item => item.type == 1).length > 0 ; obj.hasExpDate = arr.filter(item => item.type == 1).length > 0 ;
......
...@@ -173,7 +173,7 @@ class Scratch { ...@@ -173,7 +173,7 @@ class Scratch {
if (!this.isStart) return if (!this.isStart) return
// 自动清楚采用点范围值方式判断 // 自动清楚采用点范围值方式判断
const { canvasWidth, canvasHeight, minX, minY, maxX, maxY } = this const { canvasWidth, canvasHeight, minX, minY, maxX, maxY } = this
if (maxX - minX > .3 * canvasWidth && maxY - minY > .3 * canvasHeight) { if (maxX - minX > .2 * canvasWidth && maxY - minY > .2 * canvasHeight) {
this.ctx.draw() this.ctx.draw()
this.endCallBack && this.endCallBack() this.endCallBack && this.endCallBack()
this.isStart = false this.isStart = false
......
...@@ -42,9 +42,20 @@ wxService.page({ ...@@ -42,9 +42,20 @@ wxService.page({
let data = res.data.data ? res.data.data : null; let data = res.data.data ? res.data.data : null;
if(data){ if(data){
if(data.type == 3){ if(data.type == 3){
//判断打开着是不是自己
let currentLogginUser = wx.getStorageSync('_baseUserInfo');
if(!currentLogginUser){
let memberId = data.tentacleId; let memberId = data.tentacleId;
this.markShareRecords(memberId,this.data.activityId); this.markShareRecords(memberId,this.data.activityId);
} }
else{
let curLoginMemberId = currentLogginUser.memberId;
if(curLoginMemberId != memberId){ // 不是自己打开的分享链接时才调用分享成功的接口 防止自己刷次数
let memberId = data.tentacleId;
this.markShareRecords(memberId,this.data.activityId);
}
}
}
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment