|
@@ -25,15 +25,12 @@
|
|
|
class="active"
|
|
|
v-if="pageIndex == 1"
|
|
|
:style="
|
|
|
- isGetReward
|
|
|
- ? 'background-image:url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/get-reward-background.png)'
|
|
|
- : product_list.length == 0
|
|
|
- ? 'background-image:url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/no-product-background.png)'
|
|
|
- : 'background-image:url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/active-background.png)'
|
|
|
+ product_list.length == 0
|
|
|
+ ? 'background-image:url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/no-product-background.png);background-size: cover;'
|
|
|
+ : 'background-image:url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/active-background.png);background-size: contain;'
|
|
|
"
|
|
|
>
|
|
|
- <view class="active-text" v-if="isGetReward">{{ rewardInfo?.money || 0 }} <text style="font-size: 36rpx">元</text></view>
|
|
|
- <view class="active_btn" v-if="!isGetReward" :style="product_list.length == 0 ? 'top:285rpx' : 'top: 280rpx'" @click="get_reward"> </view>
|
|
|
+ <view class="active_btn" :style="product_list.length == 0 ? 'top:442rpx' : 'top: 280rpx'" @click="get_reward"> </view>
|
|
|
<view class="active_rule_btn" @click="showRule">活动规则</view>
|
|
|
<view class="active_record_btn" @click="showRecord">领取记录</view>
|
|
|
<view class="left-number">领取机会剩余 {{ activeInfo.number }} 次</view>
|
|
@@ -72,9 +69,26 @@
|
|
|
</uni-popup>
|
|
|
<uni-popup ref="rewardDialog" type="center">
|
|
|
<view class="active_rule_box">
|
|
|
- <view class="activity-reward">
|
|
|
- <view class="reward-text">{{ rewardInfo?.money || 0 }} <text style="font-size: 36rpx">元</text></view>
|
|
|
- <view class="reward-btn" @click="closeReward"></view>
|
|
|
+ <view
|
|
|
+ class="activity-reward"
|
|
|
+ :style="
|
|
|
+ rewardInfo.money !== 0
|
|
|
+ ? 'background-image: url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/reward-dialog.png);'
|
|
|
+ : 'background-image: url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/no_money.png)'
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <view v-if="rewardInfo?.money !== 0" class="reward-text">{{ rewardInfo?.money || 0 }} <text style="font-size: 36rpx">元</text></view>
|
|
|
+ <view class="reward-text" style="font-size: 32rpx">手气不是很好</view>
|
|
|
+
|
|
|
+ <view
|
|
|
+ class="reward-btn"
|
|
|
+ :style="
|
|
|
+ rewardInfo.money !== 0
|
|
|
+ ? 'background-image: url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/happy-get.png)'
|
|
|
+ : 'background-image: url(https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/no_money_btn.png)'
|
|
|
+ "
|
|
|
+ @click="closeReward"
|
|
|
+ ></view>
|
|
|
</view>
|
|
|
<view class="close-btn" @click="closeReward"></view>
|
|
|
</view>
|
|
@@ -121,7 +135,6 @@ export default {
|
|
|
pageIndex: 0,
|
|
|
product_list: [],
|
|
|
rewardInfo: {},
|
|
|
- isGetReward: false, //记录本次是否领取
|
|
|
recordList: [],
|
|
|
};
|
|
|
},
|
|
@@ -278,8 +291,38 @@ export default {
|
|
|
this.$refs.rewardDialog.open('center');
|
|
|
},
|
|
|
closeReward() {
|
|
|
- this.isGetReward = true;
|
|
|
this.$refs.rewardDialog.close();
|
|
|
+ // 如果存在产品ID的话
|
|
|
+ if (this.requestParam?.id > 0) {
|
|
|
+ // 设置请求中
|
|
|
+ this.isReqing = true;
|
|
|
+ // 请求
|
|
|
+ this.$http.request('api/redpacket_active/get_detail', this.requestParam).then((re) => {
|
|
|
+ // 设置非请求中
|
|
|
+ this.isReqing = false;
|
|
|
+ // 成功结果
|
|
|
+ if (re.code == 'success') {
|
|
|
+ this.activeInfo = re.data;
|
|
|
+ this.prizeList = re.data.reward_list;
|
|
|
+
|
|
|
+ this.product_list = Object.values(re.data.product_list || {});
|
|
|
+
|
|
|
+ this._getRecordList();
|
|
|
+ } else {
|
|
|
+ if (re.code != 'no_login') {
|
|
|
+ uni.showModal({
|
|
|
+ content: re.msg,
|
|
|
+ showCancel: false,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ uni.showModal({
|
|
|
+ content: '未知的活动ID',
|
|
|
+ showCancel: false,
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
closeRecord() {
|
|
|
this.$refs.activeRecord.close();
|
|
@@ -308,6 +351,8 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
height: 100vh;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
.activity-info {
|
|
|
padding-top: 60rpx;
|
|
|
display: flex;
|
|
@@ -408,15 +453,16 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
.active {
|
|
|
- background-size: contain;
|
|
|
+ background-size: cover;
|
|
|
background-repeat: no-repeat;
|
|
|
width: 100vw;
|
|
|
- min-height: 100vh;
|
|
|
position: relative;
|
|
|
background-color: #db1101;
|
|
|
padding: 0 32rpx;
|
|
|
box-sizing: border-box;
|
|
|
padding-top: 702rpx;
|
|
|
+ flex: 1;
|
|
|
+ padding-bottom: 32rpx;
|
|
|
.left-number {
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
@@ -460,8 +506,7 @@ export default {
|
|
|
line-height: 60rpx;
|
|
|
}
|
|
|
.active_record_btn {
|
|
|
- left: 0rpx;
|
|
|
- border-radius: 0 500rpx 500rpx 0;
|
|
|
+ top: 120rpx;
|
|
|
}
|
|
|
.active_rule_box {
|
|
|
display: flex;
|
|
@@ -469,7 +514,6 @@ export default {
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
.activity-reward {
|
|
|
- background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/reward-dialog.png');
|
|
|
background-repeat: no-repeat;
|
|
|
background-size: 100% 100%;
|
|
|
width: 671rpx;
|
|
@@ -484,7 +528,6 @@ export default {
|
|
|
text-align: center;
|
|
|
}
|
|
|
.reward-btn {
|
|
|
- background-image: url('https://kailin-mp.oss-cn-shenzhen.aliyuncs.com/static/redpacket/happy-get.png');
|
|
|
background-repeat: no-repeat;
|
|
|
background-size: 100% 100%;
|
|
|
width: 258rpx;
|
|
@@ -507,7 +550,7 @@ export default {
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
.product_list {
|
|
|
- display: block;
|
|
|
+ display: flex;
|
|
|
overflow: hidden;
|
|
|
margin: 0rpx auto;
|
|
|
.product_item {
|