|
|
@ -1,6 +1,7 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<view> |
|
|
|
<view> |
|
|
|
<view class="imgshead"></view> |
|
|
|
<view class="imgshead backroundimgfit" v-if="partakeWay == 2"></view> |
|
|
|
|
|
|
|
<view class="imgshead backroundimgsed" v-if="partakeWay == 3"></view> |
|
|
|
<view class="imgscontent"> |
|
|
|
<view class="imgscontent"> |
|
|
|
<view class="conts paddtop13"> |
|
|
|
<view class="conts paddtop13"> |
|
|
|
<view v-for="(item,index) in couponList" :key="index" class="conpon border-r height90 flleft marb10 "> |
|
|
|
<view v-for="(item,index) in couponList" :key="index" class="conpon border-r height90 flleft marb10 "> |
|
|
@ -50,21 +51,33 @@ |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
imagewxUrl: app.globalData.imageWxImg, |
|
|
|
couponList: [], |
|
|
|
couponList: [], |
|
|
|
shareNum: 0, //次数, |
|
|
|
shareNum: 0, //次数, |
|
|
|
orderNo: '' |
|
|
|
orderNo: '', //订单号 |
|
|
|
|
|
|
|
partakeWay: '' //区分类型 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
created() { |
|
|
|
created() { |
|
|
|
|
|
|
|
if (app.globalData.accountType == '0000012&key') { |
|
|
|
this.doShare(); |
|
|
|
this.doShare(); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
onShow() { |
|
|
|
let that = this; |
|
|
|
let that = this; |
|
|
|
uni.getStorage({ |
|
|
|
if (app.globalData.accountType == '0000012&key') { |
|
|
|
key: 'shareNum', |
|
|
|
uni.removeStorage({ |
|
|
|
success(e) { |
|
|
|
key: 'shareNum' |
|
|
|
that.shareNum = e.data; |
|
|
|
}); |
|
|
|
|
|
|
|
that.partakeWay = 2; |
|
|
|
|
|
|
|
that.getOrderByOutTradeOrder(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (app.globalData.accountType == '0000014&key') { |
|
|
|
|
|
|
|
that.partakeWay = 3; |
|
|
|
|
|
|
|
uni.getStorage({ |
|
|
|
|
|
|
|
key: 'staffCode', |
|
|
|
|
|
|
|
success: (res) => { |
|
|
|
|
|
|
|
that.getReceiveDiscountList(res.data); |
|
|
|
|
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.getOrderByOutTradeOrder(); |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
//查询订单详情 |
|
|
|
//查询订单详情 |
|
|
@ -79,7 +92,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
getOrderByOutTradeOrder(datas).then(res => { |
|
|
|
getOrderByOutTradeOrder(datas).then(res => { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
that.getReceiveDiscountList(res.return_data.storeId); |
|
|
|
that.getReceiveDiscountList(res.return_data.order.qrCodeSn); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: res.return_msg, |
|
|
|
title: res.return_msg, |
|
|
@ -94,12 +107,13 @@ |
|
|
|
//查询门店活动 |
|
|
|
//查询门店活动 |
|
|
|
getReceiveDiscountList(items) { |
|
|
|
getReceiveDiscountList(items) { |
|
|
|
let datas = { |
|
|
|
let datas = { |
|
|
|
qrCodeSn: items |
|
|
|
qrCodeSn: items, |
|
|
|
|
|
|
|
partakeWay: this.partakeWay |
|
|
|
// 1000017476 |
|
|
|
// 1000017476 |
|
|
|
} |
|
|
|
} |
|
|
|
getReceiveDiscountList(datas).then(res => { |
|
|
|
getReceiveDiscountList(datas).then(res => { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
if (res.return_code == '000000') { |
|
|
|
that.couponList = res.return_data; |
|
|
|
this.couponList = res.return_data; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: res.return_msg, |
|
|
|
title: res.return_msg, |
|
|
@ -111,6 +125,20 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
//领取优惠券 |
|
|
|
//领取优惠券 |
|
|
|
payReceiveDiscount() { |
|
|
|
payReceiveDiscount() { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
|
|
|
|
if (that.partakeWay == 2) { |
|
|
|
|
|
|
|
uni.getStorage({ |
|
|
|
|
|
|
|
key: 'shareNum', |
|
|
|
|
|
|
|
success(e) { |
|
|
|
|
|
|
|
if (e.data) { |
|
|
|
|
|
|
|
that.shareNum = e.data; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
that.shareNum = 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (app.globalData.userInfo.phone == '' || app.globalData.userInfo.phone == null || app.globalData.userInfo |
|
|
|
if (app.globalData.userInfo.phone == '' || app.globalData.userInfo.phone == null || app.globalData.userInfo |
|
|
|
.phone == undefined) { |
|
|
|
.phone == undefined) { |
|
|
|
uni.showModal({ |
|
|
|
uni.showModal({ |
|
|
@ -126,7 +154,7 @@ |
|
|
|
}) |
|
|
|
}) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
if (this.shareNum == 0) { |
|
|
|
if (that.shareNum == 0 && that.partakeWay == 2) { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: "分享活动得领取机会", |
|
|
|
title: "分享活动得领取机会", |
|
|
|
duration: 2000, |
|
|
|
duration: 2000, |
|
|
@ -135,9 +163,9 @@ |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
let actividatas = []; |
|
|
|
let actividatas = []; |
|
|
|
for (var i = 0; i < this.couponList.length; i++) { |
|
|
|
for (var i = 0; i < that.couponList.length; i++) { |
|
|
|
let acid = { |
|
|
|
let acid = { |
|
|
|
id: this.couponList[i].id |
|
|
|
id: that.couponList[i].id |
|
|
|
}; |
|
|
|
}; |
|
|
|
actividatas.push(acid); |
|
|
|
actividatas.push(acid); |
|
|
|
} |
|
|
|
} |
|
|
@ -152,11 +180,14 @@ |
|
|
|
duration: 2000, |
|
|
|
duration: 2000, |
|
|
|
icon: 'none' |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.shareNum = this.shareNum - 1 |
|
|
|
if (that.partakeWay == 2) { |
|
|
|
|
|
|
|
that.shareNum--; |
|
|
|
uni.setStorage({ |
|
|
|
uni.setStorage({ |
|
|
|
key: "shareNum", |
|
|
|
key: "shareNum", |
|
|
|
data: this.shareNum |
|
|
|
data: that.shareNum |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
|
title: res.return_msg, |
|
|
|
title: res.return_msg, |
|
|
@ -168,6 +199,7 @@ |
|
|
|
}, |
|
|
|
}, |
|
|
|
//分享 |
|
|
|
//分享 |
|
|
|
doShare() { |
|
|
|
doShare() { |
|
|
|
|
|
|
|
let that = this; |
|
|
|
let theUrl = window.location.href.split('#')[0]; |
|
|
|
let theUrl = window.location.href.split('#')[0]; |
|
|
|
let datas = { |
|
|
|
let datas = { |
|
|
|
url: theUrl |
|
|
|
url: theUrl |
|
|
@ -188,9 +220,9 @@ |
|
|
|
wx.onMenuShareTimeline({ |
|
|
|
wx.onMenuShareTimeline({ |
|
|
|
title: '分享好友,立获大额优惠券', // 分享标题 |
|
|
|
title: '分享好友,立获大额优惠券', // 分享标题 |
|
|
|
desc: '分享好友,立获大额优惠券', // 分享描述 |
|
|
|
desc: '分享好友,立获大额优惠券', // 分享描述 |
|
|
|
link: 'https://hsg.dctpay.com/hsgH5?accountId=0000013&key=&code=' + |
|
|
|
link: 'https://hsgcs.dctpay.com/hsgH5?accountId=0000013&key=&code=' + |
|
|
|
this.orderNo, // 分享链接 |
|
|
|
that.orderNo, // 分享链接 |
|
|
|
imgUrl: 'https://hsg.dctpay.com/filesystem/wxApplets/logo.png', // 分享图标 |
|
|
|
imgUrl: 'https://hsgcs.dctpay.com/filesystem/wxApplets/logo.png', // 分享图标 |
|
|
|
success: function(res) { |
|
|
|
success: function(res) { |
|
|
|
// 支付成功后的回调函数 |
|
|
|
// 支付成功后的回调函数 |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -198,10 +230,10 @@ |
|
|
|
duration: 2000, |
|
|
|
duration: 2000, |
|
|
|
icon: 'none' |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.shareNum = this.shareNum + 1; |
|
|
|
that.shareNum++; |
|
|
|
uni.setStorage({ |
|
|
|
uni.setStorage({ |
|
|
|
key: "shareNum", |
|
|
|
key: "shareNum", |
|
|
|
data: this.shareNum |
|
|
|
data: that.shareNum |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
cancel: function(r) {}, |
|
|
|
cancel: function(r) {}, |
|
|
@ -211,9 +243,9 @@ |
|
|
|
wx.onMenuShareAppMessage({ |
|
|
|
wx.onMenuShareAppMessage({ |
|
|
|
title: '分享好友,立获大额优惠券', // 分享标题 |
|
|
|
title: '分享好友,立获大额优惠券', // 分享标题 |
|
|
|
desc: '分享好友,立获大额优惠券', // 分享描述 |
|
|
|
desc: '分享好友,立获大额优惠券', // 分享描述 |
|
|
|
link: 'https://hsg.dctpay.com/hsgH5?accountId=0000013&key=&code=' + |
|
|
|
link: 'https://hsgcs.dctpay.com/hsgH5?accountId=0000013&key=&code=' + |
|
|
|
this.orderNo, // 分享链接 |
|
|
|
that.orderNo, // 分享链接 |
|
|
|
imgUrl: 'https://hsg.dctpay.com/filesystem/wxApplets/logo.png', // 分享图标 |
|
|
|
imgUrl: 'https://hsgcs.dctpay.com/filesystem/wxApplets/logo.png', // 分享图标 |
|
|
|
success: function(res) { |
|
|
|
success: function(res) { |
|
|
|
// 支付成功后的回调函数 |
|
|
|
// 支付成功后的回调函数 |
|
|
|
uni.showToast({ |
|
|
|
uni.showToast({ |
|
|
@ -221,10 +253,10 @@ |
|
|
|
duration: 2000, |
|
|
|
duration: 2000, |
|
|
|
icon: 'none' |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.shareNum = this.shareNum + 1; |
|
|
|
that.shareNum++; |
|
|
|
uni.setStorage({ |
|
|
|
uni.setStorage({ |
|
|
|
key: "shareNum", |
|
|
|
key: "shareNum", |
|
|
|
data: this.shareNum |
|
|
|
data: that.shareNum |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
cancel: function(r) {}, |
|
|
|
cancel: function(r) {}, |
|
|
@ -247,12 +279,19 @@ |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
<style lang="scss"> |
|
|
|
.imgshead { |
|
|
|
.imgshead { |
|
|
|
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share1.png); |
|
|
|
|
|
|
|
background-size: 100% 230px; |
|
|
|
background-size: 100% 230px; |
|
|
|
height: 230px; |
|
|
|
height: 230px; |
|
|
|
background-repeat: no-repeat; |
|
|
|
background-repeat: no-repeat; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.backroundimgfit { |
|
|
|
|
|
|
|
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share1.png); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.backroundimgsed { |
|
|
|
|
|
|
|
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share4.png); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.imgscontent { |
|
|
|
.imgscontent { |
|
|
|
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share2.png); |
|
|
|
background-image: url(https://hsg.dctpay.com/filesystem/wxApplets/share2.png); |
|
|
|
background-size: 100% 320px; |
|
|
|
background-size: 100% 320px; |
|
|
|