Commit 99228c2b authored by ziyu's avatar ziyu

improvement: 活动弹窗功能

parent 163d32b4
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<van-loading slot="loading" type="spinner" size="20" vertical/> <van-loading slot="loading" type="spinner" size="20" vertical/>
</van-image> </van-image>
<view class="rightcont" v-show="item.id > 0"> <view class="rightcont" v-show="item.id > 0">
<view class="info">奖品剩余: {{item.stock}}/{{item.totalStock}}</view> <view class="info">奖品剩余: {{item.stock}}</view>
<view class="info">中奖概率: {{item.probability}}</view> <view class="info">中奖概率: {{item.probability}}</view>
<view class="progress"> <view class="progress">
<view class="text">{{item.progress}}</view> <view class="text">{{item.progress}}</view>
......
...@@ -221,7 +221,7 @@ ...@@ -221,7 +221,7 @@
<!--活动图片弹窗--> <!--活动图片弹窗-->
<van-popup show="{{ avtivityModal }}" bind:close="ModalClose" round closeable> <van-popup show="{{ avtivityModal }}" bind:close="ModalClose" round closeable>
<view class="img-wrapper"> <view class="img-wrapper">
<van-image use-loading-slot src="{{ mainInfo.activity }}" width="400rpx" fit="widthFix" radius="10rpx"> <van-image use-loading-slot src="{{ mainInfo.activity && mainInfo.activity.link_url }}" width="400rpx" fit="widthFix" radius="10rpx">
<van-loading slot="loading" type="spinner" size="30" vertical /> <van-loading slot="loading" type="spinner" size="30" vertical />
</van-image> </van-image>
</view> </view>
...@@ -407,14 +407,14 @@ ...@@ -407,14 +407,14 @@
this.mainInfo = await getMainInfo(); this.mainInfo = await getMainInfo();
this.sign = this.mainInfo && this.mainInfo.signin; this.sign = this.mainInfo && this.mainInfo.signin;
wx.setStorageSync('hasPhone', this.mainInfo.phone); wx.setStorageSync('hasPhone', this.mainInfo.phone);
const show = wx.getStorageSync('hasShowActivity'); const activityId = wx.getStorageSync('activityId');
if (this.mainInfo && this.mainInfo.innerActivity) { if (this.mainInfo && this.mainInfo.innerActivity) {
wx.setStorageSync('innerActivity', this.mainInfo.innerActivity); wx.setStorageSync('innerActivity', this.mainInfo.innerActivity);
} else { } else {
wx.setStorageSync('innerActivity', ''); wx.setStorageSync('innerActivity', '');
} }
// 弹窗有多个,展示顺序 1、活动弹窗 2、邀请好友 3、购买获得克币 4、开奖宝箱 // 弹窗有多个,展示顺序 1、活动弹窗 2、邀请好友 3、购买获得克币 4、开奖宝箱
if(this.mainInfo.activity && !show) { if(this.mainInfo.activity && this.mainInfo.activity.id && this.mainInfo.activity.id !== +activityId) {
this.avtivityModal = true; this.avtivityModal = true;
} else if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) { } else if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
this.showModal = 1; this.showModal = 1;
...@@ -455,7 +455,7 @@ ...@@ -455,7 +455,7 @@
ModalClose() { ModalClose() {
this.cornModal && (this.cornModal = false); this.cornModal && (this.cornModal = false);
if(this.avtivityModal) { if(this.avtivityModal) {
wx.setStorageSync('hasShowActivity', 1); wx.setStorageSync('activityId', this.mainInfo.activity.id);
this.avtivityModal = false; this.avtivityModal = false;
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) { if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
this.showModal = 1; this.showModal = 1;
......
...@@ -98,7 +98,7 @@ ...@@ -98,7 +98,7 @@
</script> </script>
<config> <config>
{ {
navigationBarTitleText: 'Luckii', navigationBarTitleText: '搜索',
"usingComponents": { "usingComponents": {
"van-field": "../components/vant/field/index", "van-field": "../components/vant/field/index",
"van-image": "../components/vant/image/index", "van-image": "../components/vant/image/index",
......
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