|
|
@@ -26,12 +26,12 @@
|
|
|
<view class="phone">{{ userInfo.ncikName || '' }}</view>
|
|
|
<!-- <view class="welcome">尊敬的{{ userInfo.ncikName || ''}},下午好~</view>-->
|
|
|
</view>
|
|
|
- <view v-if="myActivityList.length > 0" @click="goQrCode" class="arrow-right">
|
|
|
+ <view v-if="isShowCoupon" @click="goQrCode" class="arrow-right">
|
|
|
<!-- <image v-if="userInfo.wxQrCode" class="qrcode" :src="userInfo.qrcode" mode=""></image> -->
|
|
|
<!-- <image class="qrcode" src="../../static/index/qrcode.png" mode=""></image>
|
|
|
<view class="h-text">会员码</view> -->
|
|
|
- <view class="coupon-wrap">
|
|
|
-<!-- <u-icon name="/static/me/u5.png" color="#ffb83d" size="22"></u-icon>-->
|
|
|
+ <view class="coupon-wrap">
|
|
|
+ <!-- <u-icon name="/static/me/u5.png" color="#ffb83d" size="22"></u-icon>-->
|
|
|
<text>邀约有礼</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -240,8 +240,9 @@
|
|
|
<uni-popup :mask-click="false" ref="strategyListPoup">
|
|
|
|
|
|
<view class="flex-col justify-start expirePopup" style="position: relative;">
|
|
|
- <view class="flex-row justify-between" style="position: absolute;top: 20rpx;right: 20rpx" @click="closeStrategyListPoup">
|
|
|
- <u-icon size="20" name="close-circle-fill"></u-icon>
|
|
|
+ <view class="flex-row justify-between" style="position: absolute;top: 20rpx;right: 20rpx"
|
|
|
+ @click="closeStrategyListPoup">
|
|
|
+ <u-icon size="20" name="close-circle-fill"></u-icon>
|
|
|
</view>
|
|
|
<view class="flex-row justify-center">
|
|
|
<text class="popupTitle">新人专享</text>
|
|
|
@@ -305,29 +306,30 @@
|
|
|
</u--form>
|
|
|
|
|
|
<view class="flex-col justify-start">
|
|
|
- <text style="font-size: 28rpx;color: #333333;text-align: center">{{rule.title}}</text>
|
|
|
+ <text style="font-size: 28rpx;color: #333333;text-align: center">{{ rule.title }}</text>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
- <view class="flex-col " v-for="(item,index) in rule.strategyList" :key="index" >
|
|
|
- <view class="flex-row justify-start quan " :class="[item.select == 1 ? 'row-list' : 'listBackground']" @click="selectQuan(item,index)">
|
|
|
+ <view class="flex-col " v-for="(item,index) in rule.strategyList" :key="index">
|
|
|
+ <view class="flex-row justify-start quan " :class="[item.select == 1 ? 'row-list' : 'listBackground']"
|
|
|
+ @click="selectQuan(item,index)">
|
|
|
<view class=" h-text flex-col justify-center ">
|
|
|
<view class="money">
|
|
|
- <text class="money" v-if="item.discountsType == 2">{{item.discount}}折</text>
|
|
|
- <text class="money" v-else>{{`减` + item.discountsPrice}}</text>
|
|
|
+ <text class="money" v-if="item.discountsType == 2">{{ item.discount }}折</text>
|
|
|
+ <text class="money" v-else>{{ `减` + item.discountsPrice }}</text>
|
|
|
</view>
|
|
|
<view class="desc">
|
|
|
- <text>满{{item.reachPrice}}可用</text>
|
|
|
+ <text>满{{ item.reachPrice }}可用</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<view class=" h-center-content flex-col justify-around">
|
|
|
<view class="h-value">
|
|
|
- <text>{{item.name}}</text>
|
|
|
+ <text>{{ item.name }}</text>
|
|
|
</view>
|
|
|
<view>
|
|
|
<view class="title">
|
|
|
- 可用次数:{{item.degree}}
|
|
|
+ 可用次数:{{ item.degree }}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -338,16 +340,19 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
|
|
|
- <view class="remarkText">
|
|
|
+ <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
|
|
|
+ <view class="remarkText">
|
|
|
<view>
|
|
|
- 可用门店:<text>{{item.useStoreDesc}}</text>
|
|
|
+ 可用门店:
|
|
|
+ <text>{{ item.useStoreDesc }}</text>
|
|
|
</view>
|
|
|
<view>
|
|
|
- 适用项目:<text>{{item.useServiceDesc}}</text>
|
|
|
+ 适用项目:
|
|
|
+ <text>{{ item.useServiceDesc }}</text>
|
|
|
</view>
|
|
|
<view v-if="item.remark !=null">
|
|
|
- 使用说明:<text>{{item.remark}}</text>
|
|
|
+ 使用说明:
|
|
|
+ <text>{{ item.remark }}</text>
|
|
|
</view>
|
|
|
<text v-else class="remarkText">该优惠券暂无使用说明</text>
|
|
|
</view>
|
|
|
@@ -359,7 +364,7 @@
|
|
|
<view @click="userBindMember" class="op-btn-wrap">
|
|
|
<view class="h-btn">
|
|
|
<text v-if="rule.isAllReceived == 1">全部领取</text>
|
|
|
- <text v-else>确定 (可选{{rule.receivedCount}}张优惠券)</text>
|
|
|
+ <text v-else>确定 (可选{{ rule.receivedCount }}张优惠券)</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
@@ -383,7 +388,7 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
-
|
|
|
+ isShowCoupon: false,
|
|
|
isGetAddress: true, //是否获取到了经纬度
|
|
|
noticeList: [],
|
|
|
notice: '',
|
|
|
@@ -399,8 +404,8 @@ export default {
|
|
|
storeList: [],
|
|
|
storeInfo: {},
|
|
|
|
|
|
- showRemarkId:'',
|
|
|
- rule:[],
|
|
|
+ showRemarkId: '',
|
|
|
+ rule: [],
|
|
|
tips2: '',
|
|
|
|
|
|
phoneParam: {
|
|
|
@@ -435,7 +440,7 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
|
|
|
- myActivityList:[],
|
|
|
+ myActivityList: [],
|
|
|
|
|
|
};
|
|
|
},
|
|
|
@@ -443,6 +448,7 @@ export default {
|
|
|
onShow() {
|
|
|
// this.getRuleById()
|
|
|
this.myActivity()
|
|
|
+
|
|
|
this.updateApp()
|
|
|
this.userInfo = uni.getStorageSync('userInfo');
|
|
|
if (this.userInfo.selfPhoto) {
|
|
|
@@ -469,7 +475,7 @@ export default {
|
|
|
|
|
|
//程序启动时自动登录成功时触发的事件
|
|
|
uni.$off('loginSuccess')
|
|
|
- uni.$on('loginSuccess',this.getRuleById)
|
|
|
+ uni.$on('loginSuccess', this.getRuleById)
|
|
|
|
|
|
console.log(e)
|
|
|
if (e.shareUserId) {
|
|
|
@@ -567,86 +573,90 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
- myActivity(){
|
|
|
- this.$api.myActivity({
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- }).then(res=>{
|
|
|
- this.myActivityList = res.data.rows
|
|
|
+ myActivity() {
|
|
|
+ // this.$api.myActivity({
|
|
|
+ // pageNum: 1,
|
|
|
+ // pageSize: 10,
|
|
|
+ // }).then(res => {
|
|
|
+ // this.myActivityList = res.data.rows
|
|
|
+ //
|
|
|
+ // })
|
|
|
+ this.$api.myActivityIsShow().then(res =>{
|
|
|
+ this.isShowCoupon = res.data.data
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- closeStrategyListPoup(){
|
|
|
+ closeStrategyListPoup() {
|
|
|
this.$refs.strategyListPoup.close()
|
|
|
//关闭弹窗
|
|
|
console.log('拓客端推广用户绑定失败!')
|
|
|
- console.log('+++++++++++++++expandParam+++++++++++++++++++++++',expandParam)
|
|
|
+ console.log('+++++++++++++++expandParam+++++++++++++++++++++++', expandParam)
|
|
|
that.$api.addRecordForAttach({
|
|
|
...expandParam,
|
|
|
- isNew:1,
|
|
|
- isBindSuccess:0,
|
|
|
- }).then(res=>{
|
|
|
+ isNew: 1,
|
|
|
+ isBindSuccess: 0,
|
|
|
+ }).then(res => {
|
|
|
console.log('+++++++++新用户,扫码推广失败记录!++++++++++++++++')
|
|
|
})
|
|
|
uni.removeStorageSync('expandParam');
|
|
|
},
|
|
|
|
|
|
- userBindMember (){
|
|
|
+ userBindMember() {
|
|
|
let expandParam = uni.getStorageSync('expandParam')
|
|
|
let that = this
|
|
|
this.$refs.form1.validate().then(res => {
|
|
|
let couponIds = []
|
|
|
for (const strategy of this.rule.strategyList) {
|
|
|
- if (strategy.select == 1){
|
|
|
+ if (strategy.select == 1) {
|
|
|
couponIds.push(strategy.id)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (couponIds.length !== this.rule.receivedCount){
|
|
|
+ if (couponIds.length !== this.rule.receivedCount) {
|
|
|
uni.showToast({
|
|
|
title: '请选择' + this.rule.receivedCount + '张优惠券',
|
|
|
duration: 2000,
|
|
|
- icon:"error"
|
|
|
+ icon: "error"
|
|
|
});
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- //用户扫码拓客端进入小程序
|
|
|
- that.$api.userBindMember(
|
|
|
- {
|
|
|
- ...expandParam,
|
|
|
- memberId: this.userInfo.id,
|
|
|
- memberPhone:this.phoneParam.phonenumber,
|
|
|
- smsCode:this.phoneParam.smsCode,
|
|
|
- couponIds: couponIds
|
|
|
- }
|
|
|
- ).then(res1 => {
|
|
|
+ //用户扫码拓客端进入小程序
|
|
|
+ that.$api.userBindMember(
|
|
|
+ {
|
|
|
+ ...expandParam,
|
|
|
+ memberId: this.userInfo.id,
|
|
|
+ memberPhone: this.phoneParam.phonenumber,
|
|
|
+ smsCode: this.phoneParam.smsCode,
|
|
|
+ couponIds: couponIds
|
|
|
+ }
|
|
|
+ ).then(res1 => {
|
|
|
|
|
|
- //关闭弹窗
|
|
|
- this.$refs.strategyListPoup.close()
|
|
|
- uni.showToast({
|
|
|
- title: '领取成功',
|
|
|
- duration: 2000,
|
|
|
- icon:"success"
|
|
|
- });
|
|
|
-
|
|
|
- setTimeout(()=>{
|
|
|
- uni.navigateTo({
|
|
|
- url:"/orderPages/myCoupon/index"
|
|
|
+ //关闭弹窗
|
|
|
+ this.$refs.strategyListPoup.close()
|
|
|
+ uni.showToast({
|
|
|
+ title: '领取成功',
|
|
|
+ duration: 2000,
|
|
|
+ icon: "success"
|
|
|
+ });
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/orderPages/myCoupon/index"
|
|
|
+ })
|
|
|
+ }, 2000)
|
|
|
+
|
|
|
+ console.log('拓客端推广用户绑定成功!')
|
|
|
+ console.log('+++++++++++++++expandParam+++++++++++++++++++++++', expandParam)
|
|
|
+ that.$api.addRecordForAttach({
|
|
|
+ ...expandParam,
|
|
|
+ isNew: 1,
|
|
|
+ isBindSuccess: 1,
|
|
|
+ }).then(res => {
|
|
|
+ console.log('+++++++++新用户,扫码推广成功记录!++++++++++++++++')
|
|
|
})
|
|
|
- },2000)
|
|
|
-
|
|
|
- console.log('拓客端推广用户绑定成功!')
|
|
|
- console.log('+++++++++++++++expandParam+++++++++++++++++++++++',expandParam)
|
|
|
- that.$api.addRecordForAttach({
|
|
|
- ...expandParam,
|
|
|
- isNew:1,
|
|
|
- isBindSuccess:1,
|
|
|
- }).then(res=>{
|
|
|
- console.log('+++++++++新用户,扫码推广成功记录!++++++++++++++++')
|
|
|
+ uni.removeStorageSync('expandParam');
|
|
|
})
|
|
|
- uni.removeStorageSync('expandParam');
|
|
|
- })
|
|
|
|
|
|
}).catch(errors => {
|
|
|
console.log(errors)
|
|
|
@@ -683,43 +693,43 @@ export default {
|
|
|
},
|
|
|
|
|
|
|
|
|
- showRemark(item){
|
|
|
- if (this.showRemarkId == item.id ){
|
|
|
+ showRemark(item) {
|
|
|
+ if (this.showRemarkId == item.id) {
|
|
|
this.showRemarkId = ''
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
this.showRemarkId = item.id
|
|
|
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- getRuleById(){
|
|
|
+ getRuleById() {
|
|
|
let expandParam = uni.getStorageSync('expandParam')
|
|
|
this.$api.getRuleById({
|
|
|
id: expandParam.ruleId
|
|
|
- }).then(res=>{
|
|
|
- this.rule = res.data.data
|
|
|
+ }).then(res => {
|
|
|
+ this.rule = res.data.data
|
|
|
|
|
|
- if (this.rule.strategyList.length > 0){
|
|
|
+ if (this.rule.strategyList.length > 0) {
|
|
|
for (const strategy of this.rule.strategyList) {
|
|
|
- if (this.rule.isAllReceived == 1){
|
|
|
- strategy.select = 1
|
|
|
- }else {
|
|
|
- strategy.select = 0
|
|
|
- }
|
|
|
+ if (this.rule.isAllReceived == 1) {
|
|
|
+ strategy.select = 1
|
|
|
+ } else {
|
|
|
+ strategy.select = 0
|
|
|
+ }
|
|
|
}
|
|
|
this.$refs.strategyListPoup.open()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- selectQuan(item,index){
|
|
|
- if (this.rule.isAllReceived == 1){
|
|
|
+ selectQuan(item, index) {
|
|
|
+ if (this.rule.isAllReceived == 1) {
|
|
|
return
|
|
|
}
|
|
|
console.log(item)
|
|
|
item.select = item.select ? 0 : 1
|
|
|
- this.$set(this.rule.strategyList,index,item)
|
|
|
+ this.$set(this.rule.strategyList, index, item)
|
|
|
},
|
|
|
|
|
|
operLog() {
|