forked from zhongyuanhaiju/uniapp
【增加】注册后弹窗奖励
This commit is contained in:
parent
2c8ca40458
commit
728c118fd4
|
|
@ -403,7 +403,10 @@ export default {
|
||||||
});
|
});
|
||||||
this.$refs.completeInfoPopup.close();
|
this.$refs.completeInfoPopup.close();
|
||||||
this.$store.commit('setBottomNavHidden', false); // 显示底部导航
|
this.$store.commit('setBottomNavHidden', false); // 显示底部导航
|
||||||
if (res.data.is_register) this.$refs.registerReward.open();
|
// if (res.data.is_register) this.$refs.registerReward.open();
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.registerReward.open();
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.isSub = false;
|
this.isSub = false;
|
||||||
this.getCaptcha();
|
this.getCaptcha();
|
||||||
|
|
@ -464,7 +467,11 @@ export default {
|
||||||
this.cancelCompleteInfo();
|
this.cancelCompleteInfo();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (res.data.is_register) this.$refs.registerReward.open();
|
// if (res.data.is_register) this.$refs.registerReward.open();
|
||||||
|
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.registerReward.open();
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.$util.showToast({ title: res.message });
|
this.$util.showToast({ title: res.message });
|
||||||
}
|
}
|
||||||
|
|
@ -496,7 +503,11 @@ export default {
|
||||||
success: () => {
|
success: () => {
|
||||||
this.$store.dispatch('getCartNumber');
|
this.$store.dispatch('getCartNumber');
|
||||||
this.$store.commit('setToken', res.data.token);
|
this.$store.commit('setToken', res.data.token);
|
||||||
if (res.data.is_register) this.$refs.registerReward.open();
|
// if (res.data.is_register) this.$refs.registerReward.open();
|
||||||
|
|
||||||
|
this.$nextTick(()=>{
|
||||||
|
this.$refs.registerReward.open();
|
||||||
|
})
|
||||||
this.cancelCompleteInfo();
|
this.cancelCompleteInfo();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,76 +1,92 @@
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view @touchmove.prevent.stop v-if="reward" class="reward-popup">
|
<view @touchmove.prevent.stop v-if="reward" class="reward-popup">
|
||||||
<uni-popup ref="registerReward" type="center" :maskClick="false">
|
<!-- <uni-popup ref="registerReward" type="center" :maskClick="false">-->
|
||||||
<view class="reward-wrap">
|
<!-- <view class="reward-wrap">-->
|
||||||
<image :src="$util.img('public/uniapp/register_reward/register_reward_img.png')" mode="widthFix" class="bg-img-head"></image>
|
<!-- <image :src="$util.img('public/uniapp/register_reward/register_reward_img.png')" mode="widthFix" class="bg-img-head"></image>-->
|
||||||
<image :src="$util.img('public/uniapp/register_reward/register_reward_money.png')" mode="widthFix" class="bg-img-money"></image>
|
<!-- <image :src="$util.img('public/uniapp/register_reward/register_reward_money.png')" mode="widthFix" class="bg-img-money"></image>-->
|
||||||
<image :src="$util.img('public/uniapp/register_reward/register_reward_head.png')" mode="widthFix" class="bg-img"></image>
|
<!-- <image :src="$util.img('public/uniapp/register_reward/register_reward_head.png')" mode="widthFix" class="bg-img"></image>-->
|
||||||
<view class="wrap">
|
<!-- <view class="wrap">-->
|
||||||
<view>
|
<!-- <view>-->
|
||||||
<scroll-view scroll-y="true" class="register-box">
|
<!-- <scroll-view scroll-y="true" class="register-box">-->
|
||||||
<view class="reward-content">
|
<!-- <view class="reward-content">-->
|
||||||
<view class="reward-item" v-if="reward.point > 0">
|
<!-- <view class="reward-item" v-if="reward.point > 0">-->
|
||||||
<view class="head">兑换券奖励</view>
|
<!-- <view class="head">兑换券奖励</view>-->
|
||||||
<view class="content">
|
<!-- <view class="content">-->
|
||||||
<view class="info">
|
<!-- <view class="info">-->
|
||||||
<view>
|
<!-- <view>-->
|
||||||
<text class="num">{{ reward.point }}</text>
|
<!-- <text class="num">{{ reward.point }}</text>-->
|
||||||
<text class="type">兑换券</text>
|
<!-- <text class="type">兑换券</text>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="desc">用于下单时抵现或兑换商品等</view>
|
<!-- <view class="desc">用于下单时抵现或兑换商品等</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="tip" @click="closeRewardPopup('point')">立即查看</view>
|
<!-- <view class="tip" @click="closeRewardPopup('point')">立即查看</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="reward-item" v-if="reward.growth > 0">
|
<!-- <view class="reward-item" v-if="reward.growth > 0">-->
|
||||||
<view class="head">成长值</view>
|
<!-- <view class="head">成长值</view>-->
|
||||||
<view class="content">
|
<!-- <view class="content">-->
|
||||||
<view class="info">
|
<!-- <view class="info">-->
|
||||||
<view>
|
<!-- <view>-->
|
||||||
<text class="num">{{ reward.growth }}</text>
|
<!-- <text class="num">{{ reward.growth }}</text>-->
|
||||||
<text class="type">成长值</text>
|
<!-- <text class="type">成长值</text>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="desc">用于提升会员等级</view>
|
<!-- <view class="desc">用于提升会员等级</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="tip" @click="closeRewardPopup('growth')">立即查看</view>
|
<!-- <view class="tip" @click="closeRewardPopup('growth')">立即查看</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="reward-item" v-if="reward.balance > 0">
|
<!-- <view class="reward-item" v-if="reward.balance > 0">-->
|
||||||
<view class="head">红包奖励</view>
|
<!-- <view class="head">红包奖励</view>-->
|
||||||
<view class="content">
|
<!-- <view class="content">-->
|
||||||
<view class="info">
|
<!-- <view class="info">-->
|
||||||
<view>
|
<!-- <view>-->
|
||||||
<text class="num">{{ reward.balance }}</text>
|
<!-- <text class="num">{{ reward.balance }}</text>-->
|
||||||
<text class="type">元</text>
|
<!-- <text class="type">元</text>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="desc">不可提现下单时可用</view>
|
<!-- <view class="desc">不可提现下单时可用</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="tip" @click="closeRewardPopup('balance')">立即查看</view>
|
<!-- <view class="tip" @click="closeRewardPopup('balance')">立即查看</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="reward-item" v-if="reward.coupon_list.length > 0">
|
<!-- <view class="reward-item" v-if="reward.coupon_list.length > 0">-->
|
||||||
<view class="head">优惠券奖励</view>
|
<!-- <view class="head">优惠券奖励</view>-->
|
||||||
<view class="content" v-for="(item, index) in reward.coupon_list" :key="index">
|
<!-- <view class="content" v-for="(item, index) in reward.coupon_list" :key="index">-->
|
||||||
<view class="info">
|
<!-- <view class="info">-->
|
||||||
<view>
|
<!-- <view>-->
|
||||||
<text class="num coupon-name">{{ item.coupon_name }}</text>
|
<!-- <text class="num coupon-name">{{ item.coupon_name }}</text>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="desc" v-if="item.at_least > 0">
|
<!-- <view class="desc" v-if="item.at_least > 0">-->
|
||||||
满{{ item.at_least }}{{ item.type == 'discount' ? '打' + item.discount + '折' : '减' + item.money }}
|
<!-- 满{{ item.at_least }}{{ item.type == 'discount' ? '打' + item.discount + '折' : '减' + item.money }}-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="desc" v-else>无门槛,{{ item.type == 'discount' ? '打' + item.discount + '折' : '减' + item.money }}</view>
|
<!-- <view class="desc" v-else>无门槛,{{ item.type == 'discount' ? '打' + item.discount + '折' : '减' + item.money }}</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="tip" @click="closeRewardPopup('coupon')">立即查看</view>
|
<!-- <view class="tip" @click="closeRewardPopup('coupon')">立即查看</view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</scroll-view>
|
<!-- </scroll-view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
<view class="close-btn" @click="closeRewardPopup()"><text class="iconfont icon-close"></text></view>
|
<!-- <view class="close-btn" @click="closeRewardPopup()"><text class="iconfont icon-close"></text></view>-->
|
||||||
</view>
|
<!-- </view>-->
|
||||||
</uni-popup>
|
<!-- </uni-popup>-->
|
||||||
|
<!-- 版本更新弹窗弹窗 -->
|
||||||
|
<uni-popup ref="registerReward" type="center" :maskClick="false">
|
||||||
|
<view class="version-popup-content">
|
||||||
|
<image class="img" :src="$util.img('app/shop/view/public/img/login/new_member.png')" mode="widthFix"></image>
|
||||||
|
<!-- <view class="title" >版本更新</view>-->
|
||||||
|
<view class="text">
|
||||||
|
恭喜你获得新人专属福利<br>
|
||||||
|
现送给你
|
||||||
|
</view>
|
||||||
|
<view class="jifen">
|
||||||
|
<view class="num">{{newuser_points}}</view>
|
||||||
|
<view class="jifen_text">积分</view>
|
||||||
|
</view>
|
||||||
|
<view class="button_img" @click="$refs.registerReward.close()">立即领取</view>
|
||||||
|
</view>
|
||||||
|
</uni-popup>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -87,7 +103,8 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
reward: null,
|
reward: null,
|
||||||
back: ''
|
back: '',
|
||||||
|
newuser_points: ''
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -98,11 +115,12 @@ export default {
|
||||||
},
|
},
|
||||||
open(back) {
|
open(back) {
|
||||||
if (back) this.back = back;
|
if (back) this.back = back;
|
||||||
if (this.addonIsExist.memberregister) {
|
// if (this.addonIsExist.memberregister) {
|
||||||
|
this.getFenxiaoBasics();
|
||||||
this.getRegisterReward();
|
this.getRegisterReward();
|
||||||
} else {
|
// } else {
|
||||||
this.closeRewardPopup();
|
// this.closeRewardPopup();
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
cancel() {
|
cancel() {
|
||||||
this.$refs.registerReward.close();
|
this.$refs.registerReward.close();
|
||||||
|
|
@ -116,14 +134,37 @@ export default {
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.code >= 0) {
|
if (res.code >= 0) {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
if (data.is_use == 1 && (data.value.point > 0 || data.value.balance > 0 || data.value.growth > 0 || data.value.coupon_list.length > 0)) {
|
// if (data.is_use == 1 && (data.value.point > 0 || data.value.balance > 0 || data.value.growth > 0 || data.value.coupon_list.length > 0)) {
|
||||||
this.reward = data.value;
|
this.reward = data.value;
|
||||||
setTimeout(()=> {
|
setTimeout(()=> {
|
||||||
this.$refs.registerReward.open();
|
this.$refs.registerReward.open();
|
||||||
})
|
})
|
||||||
} else {
|
// } else {
|
||||||
this.closeRewardPopup();
|
// this.closeRewardPopup();
|
||||||
}
|
// }
|
||||||
|
} else {
|
||||||
|
this.closeRewardPopup();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
* 获取新人礼配置
|
||||||
|
*/
|
||||||
|
getFenxiaoBasics() {
|
||||||
|
this.$api.sendRequest({
|
||||||
|
url: '/fenxiao/api/config/basics',
|
||||||
|
success: res => {
|
||||||
|
if (res.code >= 0) {
|
||||||
|
let data = res.data;
|
||||||
|
// if (data.is_use == 1 && (data.value.point > 0 || data.value.balance > 0 || data.value.growth > 0 || data.value.coupon_list.length > 0)) {
|
||||||
|
this.newuser_points = data.newuser_points;
|
||||||
|
// setTimeout(()=> {
|
||||||
|
// this.$refs.registerReward.open();
|
||||||
|
// })
|
||||||
|
// } else {
|
||||||
|
// this.closeRewardPopup();
|
||||||
|
// }
|
||||||
} else {
|
} else {
|
||||||
this.closeRewardPopup();
|
this.closeRewardPopup();
|
||||||
}
|
}
|
||||||
|
|
@ -283,4 +324,80 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.version-popup-content{
|
||||||
|
.img{
|
||||||
|
width: 580rpx;
|
||||||
|
left: -5rpx;
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
position: absolute;
|
||||||
|
top: 68rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
text-align: center;
|
||||||
|
font-size: large;
|
||||||
|
font-weight: 900;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.con_title{
|
||||||
|
margin-top: 44rpx;
|
||||||
|
//margin-bottom: 14rpx;
|
||||||
|
font-size: 44rpx;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #B6634F;
|
||||||
|
}
|
||||||
|
.text{
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #ffeed2;
|
||||||
|
line-height: 1.5;
|
||||||
|
position: absolute;
|
||||||
|
top: 300rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 400rpx;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.jifen{
|
||||||
|
|
||||||
|
margin: auto;
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
top: 400rpx;
|
||||||
|
width: 400rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
align-items: baseline;
|
||||||
|
justify-content: center;
|
||||||
|
.num{
|
||||||
|
font-size: 88rpx;
|
||||||
|
color: #ffeed2;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.jifen_text{
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #ffeed2;
|
||||||
|
line-height: 1.5;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.button_img{
|
||||||
|
//background: url("./public/img/index/friend-farm-button.png");
|
||||||
|
top: 590rpx;
|
||||||
|
width: 240rpx;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
position: absolute;
|
||||||
|
background-size: cover;
|
||||||
|
height: 80rpx;
|
||||||
|
font-size: 35rpx;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 900;
|
||||||
|
color: #e63c3d;
|
||||||
|
line-height: 80rpx;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue