Commit 333d78d8 by 谢中龙

提交版本

parent 5985997f
......@@ -79,6 +79,7 @@ const prod_brand_config = {
logo: 'https://img3.bigaka.com/prd/3001/202003/20200331/3001842823fb-2601-4b58-a648-79ad799ad425.png',
openRefundTips : true,//是否开启退货须知显示
refundTips : '温馨提示:退货通过审核后需将清单随包裹一起寄回或纸条备注(订单号与退货商品款号)【请务必审核通过后24小时内填写寄回运单号,拒签到付/顺丰/EMS/天天快递 不影响二次销售】',//退货须知文本
//wx654ce96a7324e76f 小程序微信支付券
},
//泰华配置
2006: {
......
......@@ -60,7 +60,11 @@ wxService.page({
pointDeductRuleUrl : '',//积分规则说明
avaliablePoint : 0,//可用积分数
pointDeductMoney : 0.00,
//积分支付数据
pointPayInfo : {
point : 0,
pointAmount : 0
},
},
//获取积分抵扣配置信息
......@@ -110,6 +114,7 @@ wxService.page({
});
//需要计算显示订单价格
this.setPayPrice();
},
//显示积分抵扣规则
onTapShowDeductRule(){
......@@ -289,7 +294,7 @@ wxService.page({
this.setData({
useNotUserCoupon: true,
defalutCoupon: 0,
couponId: '',
couponId: 0,
couponSettingId: '',
defalutCouponId: '',
currentCoupon: 0,
......@@ -376,8 +381,9 @@ wxService.page({
let promotionPrice = (orderInitPrice - calCouponPrice) > 0 ? (orderInitPrice - calCouponPrice) : 0;
//看一下积分是否勾选了
if(this.data.deductCheckStatus){
promotionPrice = parseFloat(promotionPrice - this.data.pointDeductMoney).toString(2);
promotionPrice = promotionPrice*1 - this.data.pointDeductMoney*1;
}
// 实际价格 - 优惠价 + plus
this.setData({
// orderPrice: Math.round(orderInitPrice - orderCoupon)
......@@ -679,6 +685,9 @@ wxService.page({
if (this.data.couponId) {
params.couponId = this.data.couponId;
}
else if(this.data.couponId === 0){
params.couponId = 0;
}
wxService.post(`/sale/trade/buyer/preview`, params).then(res => {
if (res) {
......@@ -710,6 +719,19 @@ wxService.page({
noSelectPrice: sum
})
}
//获取是否有积分抵扣的
let pointPayInfo = data.pointPayInfo ? data.pointPayInfo : null;
if(pointPayInfo){
this.data.avaliablePoint = pointPayInfo.point;
this.data.pointDeductMoney = pointPayInfo.pointAmount;
if(pointPayInfo.point == 0 || pointPayInfo.pointAmount){
this.data.deductCheckStatus = false;
}
}
this.data.pointPayInfo = data.pointPayInfo;
//如果没有couponId则认为是第一次进来没有自己选择优惠券
if (!this.data.couponId) {
if (!this.data.useNotUserCoupon) {
......@@ -736,7 +758,10 @@ wxService.page({
defalutCouponId: defalutCouponId,
couponSettingId: couponSettingId,
orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
totalGoodsPrice: this.data.totalGoodsPrice,
avaliablePoint : this.data.avaliablePoint,
pointDeductMoney : this.data.pointDeductMoney,
deductCheckStatus : this.data.deductCheckStatus
}, () => {
// 实付款
this.setPayPrice()
......@@ -747,7 +772,10 @@ wxService.page({
this.setData({
currentOrderList: data,
orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
totalGoodsPrice: this.data.totalGoodsPrice,
avaliablePoint : this.data.avaliablePoint,
pointDeductMoney : this.data.pointDeductMoney,
deductCheckStatus : this.data.deductCheckStatus
}, () => {
// 实付款
this.setPayPrice()
......@@ -761,7 +789,10 @@ wxService.page({
defalutCouponId: this.data.defalutCouponId,
couponSettingId: this.data.couponSettingId,
orderInitPrice: data.amount,
totalGoodsPrice: this.data.totalGoodsPrice
totalGoodsPrice: this.data.totalGoodsPrice,
avaliablePoint : this.data.avaliablePoint,
pointDeductMoney : this.data.pointDeductMoney,
deductCheckStatus : this.data.deductCheckStatus
}, () => {
// 实付款
this.setPayPrice()
......@@ -898,15 +929,22 @@ wxService.page({
params.storeInfo = this.data.orderStoreInfo.storeInfo;
}
}
//处理积分抵扣
if(this.data.deductCheckStatus){
params.pointPayInfo = this.data.pointPayInfo;
}
else{
params.pointPayInfo = {
point : 0,
pointAmount : 0
}
}
let _this = this;
let url = isSelect ? '/sale/payment/merged/buyer/bill' : '/sale/trade/buyer/bill'
wxService.post(`${url}`, params).then(res => {
if (res) {
const {
result,
data
} = res.data
const {result,data} = res.data
let tradeId = data.tradeId;
wx.removeStorageSync('choosedStoreInfo');
wx.removeStorageSync('orderRemark');
......
......@@ -96,6 +96,9 @@ wxService.page({
data.logistic = null;
}
// 处理积分抵扣
data.pointPayInfo = data.pointPayInfo ? data.pointPayInfo : {point:0,pointAmount:0};
//处理能不能退款
let canApplyRefund = true;
let filter = skuVOList.filter(c => c.canRefundNum > 0);
......
......@@ -144,6 +144,10 @@
<text>¥{{utils.numberFormat(detail.promotionDiscount)}}</text>
</view>
<view class="order-pro-list">
<text>积分抵扣</text>
<text>使用{{detail.pointPayInfo.point}}积分,抵扣¥{{detail.pointPayInfo.pointAmount}}</text>
</view>
<view class="order-pro-list">
<text>优惠券优惠</text>
<text>¥{{utils.numberFormat(detail.coouponDiscount)}}</text>
</view>
......
......@@ -55,53 +55,59 @@ wxService.page({
};
this.generatePointObject(tentacleInfo);
}
this.getOptionsData();
},
watch: {
experAccessible(newVal, oldVal) {
if(newVal) {
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let id
if (baseUserInfo && !reLoginErrFlag) {
this.setData({
isAuthorization: false
}, () => {
const option = this.options || {}
const { scene } = option
if (scene) {
let idParam = decodeURIComponent(scene).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0
id = shareId
} else {
id = option.id
}
if (id) {
this.setData({
id
}, () => {
this.getPointDetail(id)
})
}
// 隐藏 dialog
this.isShowDialog(false)
})
}
else if (!baseUserInfo && reLoginErrFlag) {
this.setData({
isAuthorization: true
})
// experAccessible(newVal, oldVal) {
// if(newVal) {
// this.getOptionsData();
// } else {
// // 去别的页面
// wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
// }
// }
},
//获取集点详情
getOptionsData(){
// 登录接口返回err
const reLoginErrFlag = wx.getStorageSync('reLoginErr')
const baseUserInfo = wx.getStorageSync('_baseUserInfo')
let id
if (baseUserInfo && !reLoginErrFlag) {
this.setData({
isAuthorization: false
}, () => {
const option = this.options || {}
const { scene } = option
if (scene) {
let idParam = decodeURIComponent(scene).split('&')[0]
let shareId = idParam && idParam.split('=')[1] || 0
id = shareId
} else {
id = option.id
}
else {
if (id) {
this.setData({
isAuthorization: true
id
}, () => {
this.getPointDetail(id)
})
}
} else {
// 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
}
// 隐藏 dialog
this.isShowDialog(false)
})
}
else if (!baseUserInfo && reLoginErrFlag) {
this.setData({
isAuthorization: true
})
}
else {
this.setData({
isAuthorization: true
})
}
},
// 集点详情
......@@ -156,13 +162,72 @@ wxService.page({
this.showTimeStatus('活动已经失效啦,看看其他的')
} else {
// 会员集点活动统计信息 进行中且有效
this.getPointConsumptionCount(id)
this.getPointConsumptionCount(id);
//限制必须是扫码进来的才调用
// let scene = wx.getLaunchOptionsSync().scene;
// if(scene == 1011){
this.getUserShowRewardCollectionPoint(id);
// }
}
})
}
}
})
},
//获取用户扫码进来是否需要弹出领取集点的
getUserShowRewardCollectionPoint(id){
wxService.post(`/sale/touchpoints/pointConsumptionActivity/verifyWhetherReward?id=${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
//如果需要 弹出提示框
if(data == 1){
this.showConfirmModal(id);
}
}
}
})
},
//弹出原生提示框让用户去点击
showConfirmModal(id){
let self = this;
if(this.showModal){
return ;
}
this.showModal = true;
wx.showModal({
title : '集点领取提示',
content : '恭喜您获得一个集点',
showCancel : false,
confirmText : '确认领取',
confirmColor : '#05C35B',
success (res) {
if(res.confirm){
self.userConfirmGetCollectionPoint(id);
}
self.showModal = false;
}
})
},
//调用领取接口
userConfirmGetCollectionPoint(id){
wxService.post(`/sale/touchpoints/pointConsumptionActivity/award?id=${id}`).then(res => {
if (res) {
const { result, data } = res.data
if (result == 0) {
//如果需要 弹出提示框
wx.showToast({
title: '领取成功~',
});
this.getPointDetail(this.data.id);
}
}
});
},
showTimeStatus(status) {
wx.showToast({
title: `${status}`,
......
......@@ -15,14 +15,15 @@ wxService.page({
currentTimeStatus: 1, // 1 进行中 2 已结束 3 未开始
},
watch: {
experAccessible(newVal, oldVal) {
if(newVal) {
this.getPointList()
} else {
// 去别的页面
wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
}
}
// 暂时先不要体验版
// experAccessible(newVal, oldVal) {
// if(newVal) {
// this.getPointList()
// } else {
// // 去别的页面
// wxService.router(`/subPackage/page/pages/goToHome/goToHome`).replace()
// }
// }
},
/**
* 生命周期函数--监听页面加载
......@@ -39,6 +40,9 @@ wxService.page({
};
this.generatePointObject(tentacleInfo);
}
//获取集点
this.getPointList();
},
/**
......
......@@ -46,10 +46,11 @@
"current": 16,
"list": [
{
"id": -1,
"id": 0,
"name": "会员中心",
"pathName": "pages/userCenter/userCenter",
"query": ""
"query": "m=b)XQE0mX00",
"scene": null
},
{
"id": -1,
......@@ -637,6 +638,13 @@
"pathName": "subPackageMarketing/page/pages/scratch/scratch",
"query": "id=700043642982764548",
"scene": null
},
{
"id": -1,
"name": "集点活动列表",
"pathName": "pages/pointList/pointList",
"query": "",
"scene": null
}
]
}
......
......@@ -28,10 +28,19 @@ wxService.page({
//判断用户是不是已经登录了
let userInfo = wx.getStorageSync('_baseUserInfo');
if (userInfo) {
wx.reLaunch({
url: '/pages/userCenter/userCenter',
});
return;
if(userInfo.member.cardNoWeixin){
wx.showToast({
title: '您已开过卡',
icon : 'none'
});
setTimeout(() => {
wx.reLaunch({
url: '/pages/userCenter/userCenter',
});
},300);
return;
}
}
//未登录 需要授权登录 弹出设置的开卡图片
......
......@@ -42,19 +42,23 @@ wxService.page({
let data = res.data.data ? res.data.data : null;
if(data){
if(data.type == 3){
//判断打开着是不是自己
let currentLogginUser = wx.getStorageSync('_baseUserInfo');
if(!currentLogginUser){
let memberId = data.tentacleId;
this.markShareRecords(memberId,this.data.activityId);
}
else{
let curLoginMemberId = currentLogginUser.memberId;
if(curLoginMemberId != memberId){ // 不是自己打开的分享链接时才调用分享成功的接口 防止自己刷次数
let memberId = data.tentacleId;
this.markShareRecords(memberId,this.data.activityId);
}
}
let memberId = data.tentacleId;
this.markShareRecords(memberId,this.data.activityId);
// //判断打开着是不是自己
// let currentLogginUser = wx.getStorageSync('_baseUserInfo');
// if(!currentLogginUser){
// let memberId = data.tentacleId;
// this.markShareRecords(memberId,this.data.activityId);
// }
// else{
// let curLoginMemberId = currentLogginUser.memberId;
// if(curLoginMemberId != memberId){ // 不是自己打开的分享链接时才调用分享成功的接口 防止自己刷次数
// let memberId = data.tentacleId;
// this.markShareRecords(memberId,this.data.activityId);
// }
// }
}
}
}
......@@ -174,9 +178,6 @@ wxService.page({
awardTxtFontSize: '22px',
callback: () => {
if(self.data.leftNum > 0){
wx.showLoading({
title: '开奖中..',
});
self.getAwardInfo();
}
else{
......@@ -271,7 +272,6 @@ wxService.page({
}
this.getUserCanScratchCount();
wx.hideLoading();
});
},
......
......@@ -148,7 +148,6 @@ class Http {
channel: channel
})
}
}
checkStatus (resp) {
......@@ -189,15 +188,28 @@ class Http {
content: '请求数据超时'
})
}
if (error.msg && error.msg !='该用户尚未登录'){
//针对刮刮卡错误语单独处理
else if(error.msg == '对不起,您已超过此活动设置刮奖最大次数!!' || error.msg == '当前活动已失效!'){
wx.showModal({
title: '刮刮卡提示',
content: error.msg,
showCancel: false,
confirmText: '好的',
confirmColor: '#cb3c3c',
success: function (modalRes) {
}
});
}
else if (error.msg && error.msg !='该用户尚未登录'){
setTimeout(() => {
wx.showToast({
title: `${error.msg}`,
icon: 'none',
duration:2500
})
})
});
}
return Promise.reject(error)
}
......
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