隐藏拼团和任务入口正式环境
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<view class="des"> 已领DT积分 </view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="count-item" @click="onTab('GetGoods')">
|
||||
<view class="count-item" @click="onTab('GetGoods')">
|
||||
<view class="number">123 </view>
|
||||
<view class="des"> 已领商品 </view>
|
||||
</view>
|
||||
@@ -23,28 +23,31 @@
|
||||
</view>
|
||||
|
||||
<!-- 看视频 得积分 -->
|
||||
<view class="list-content">
|
||||
<view class="list-content" v-if="videos.length>0">
|
||||
<view class="title">
|
||||
<image class="bind" src="/static/mission/icon-right.png" mode="widthFix" />
|
||||
<view class="name">看视频得积分</view>
|
||||
<view class="name">看视频得奖励</view>
|
||||
<image class="bind" src="/static/mission/icon-left.png" mode="widthFix" />
|
||||
<view class="right-title" @click="change('0')">
|
||||
<view class="right-title" @click="change('1')">
|
||||
<image :class="['change',canRotate0?'rotateChange':'']" src="/static/mission/change.png"
|
||||
mode="widthFix" />
|
||||
换一换
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="videos.length>0">
|
||||
<view class="list" v-for="item in videos" :key="item">
|
||||
<block>
|
||||
<view class="list" v-for="item in videos" :key="item.task_id">
|
||||
<image class='icon' src="/static/mission/video.png" mode="widthFix" />
|
||||
<view class="list-item">
|
||||
<view class="list-item-left">
|
||||
<view class="item-title">看视频<span>+100</span></view>
|
||||
<view class="item-des"> 观看2分钟视频可得15DT积分,一天封顶150DT积分</view>
|
||||
<view class="item-title">{{item.title}}<span
|
||||
v-if="item.gift_type && item.gift_type.code == 2">+{{item.attach_gift.price}}</span>
|
||||
</view>
|
||||
<view class="item-des"> {{item.description}}</view>
|
||||
</view>
|
||||
<view class="list-item-right">
|
||||
<view class="btn">去观看</view>
|
||||
<view class="count">(0/10)</view>
|
||||
<view class="btn" @click="goPlay(item.task_id)">去观看</view>
|
||||
<view class="count" v-if="item.type && item.type.code == 1 ">
|
||||
({{item.me.number}}/{{item.attach_type.num}})</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -57,13 +60,13 @@
|
||||
<image class="bind" src="/static/mission/icon-right.png" mode="widthFix" />
|
||||
<view class="name">做任务得积分</view>
|
||||
<image class="bind" src="/static/mission/icon-left.png" mode="widthFix" />
|
||||
<view class="right-title" @click="change('1')">
|
||||
<view class="right-title" @click="change('2')">
|
||||
<image :class="['change',canRotate1?'rotateChange':'']" src="/static/mission/change.png"
|
||||
mode="widthFix" /> 换一换
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="missions.length>0">
|
||||
<view class="list" v-for="item in missions" :key="item">
|
||||
<view class="list" v-for="item in missions" :key="item.task_id">
|
||||
<image class='icon' src="/static/mission/mission.png" mode="widthFix" />
|
||||
<view class="list-item">
|
||||
<view class="list-item-left">
|
||||
@@ -78,28 +81,87 @@
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
list
|
||||
} from '@/apis/interfaces/mission.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
videos: [1, 2, 3],
|
||||
videoPage: 1,
|
||||
videoHasMore: true,
|
||||
missions: [1, 2, 3],
|
||||
missionsPage: 1,
|
||||
missionsHasMore: true,
|
||||
canRotate0: false,
|
||||
canRotate1: false,
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getVideoList(1)
|
||||
},
|
||||
methods: {
|
||||
|
||||
goPlay(id) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mission/videoPlay/videoPlay?id=' + id,
|
||||
})
|
||||
},
|
||||
getVideoList(type) {
|
||||
let data = {
|
||||
page: type == 1 ? this.videoPage : this.missionsPage,
|
||||
type: type,
|
||||
}
|
||||
list(data).then(res => {
|
||||
console.log(res)
|
||||
if (type == 1) {
|
||||
if (this.videoPage == 1) {
|
||||
this.videos = [];
|
||||
}
|
||||
this.videoHasMore = res.page.has_more;
|
||||
this.videos = res.data
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == 2) {
|
||||
if (this.videoPage == 1) {
|
||||
this.videos = [];
|
||||
}
|
||||
this.missionsHasMore = res.page.has_more;
|
||||
this.missions = res.data
|
||||
return;
|
||||
}
|
||||
}).catch(err => {
|
||||
uni.showToast({
|
||||
title: err.message,
|
||||
icon: 'none',
|
||||
mask: true,
|
||||
duration: 2000,
|
||||
})
|
||||
})
|
||||
},
|
||||
change(num) {
|
||||
switch (num) {
|
||||
case '0':
|
||||
this.canRotate0 = true;
|
||||
break;
|
||||
case '1':
|
||||
this.canRotate1 = true;
|
||||
this.canRotate0 = true;
|
||||
if (this.videoHasMore) {
|
||||
this.videoPage = this.videoPage + 1;
|
||||
} else {
|
||||
this.videoPage = 1;
|
||||
}
|
||||
this.getVideoList(1);
|
||||
break;
|
||||
case '2':
|
||||
// if(this.videoHasMore){
|
||||
// this.videoPage = this.videoPage + 1;
|
||||
// }else{
|
||||
// this.videoPage = 1;
|
||||
// }
|
||||
break;
|
||||
}
|
||||
this.close();
|
||||
@@ -109,12 +171,12 @@
|
||||
this.canRotate0 = false;
|
||||
this.canRotate1 = false;
|
||||
}, 3000)
|
||||
},
|
||||
// 跳转已领取的 dt 积分和商品
|
||||
onTab(it){
|
||||
this.$Router.push({
|
||||
name:it
|
||||
})
|
||||
},
|
||||
// 跳转已领取的 dt 积分和商品
|
||||
onTab(it) {
|
||||
this.$Router.push({
|
||||
name: it
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -263,9 +325,9 @@
|
||||
|
||||
|
||||
.name {
|
||||
padding:$padding $padding - 10;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
padding: $padding $padding - 10;
|
||||
font-size: 34rpx;
|
||||
font-weight: bold;
|
||||
color: #454545;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user