|
@@ -1,16 +1,16 @@
|
|
|
<template>
|
|
|
<view class="content">
|
|
|
- <view class="task-list" v-for="(item,index) in 4" :key="index">
|
|
|
+ <view class="task-list" v-for="(item,index) in list" :key="index">
|
|
|
<view class="task-l">
|
|
|
- <u-image width="80rpx" height="80rpx" :src="`/static/taskIcon${index+1}.png`"></u-image>
|
|
|
+ <u-image width="80rpx" height="80rpx" :src="`/static/${item.taskCode}.png`"></u-image>
|
|
|
<view class="task-l-info">
|
|
|
- <view class="task-l-title">新用户登录</view>
|
|
|
- <view class="task-l-desc">赚<text>1</text>次抽奖 <u-image width="22rpx" height="22rpx" src="/static/zpIcon.png"></u-image></view>
|
|
|
+ <view class="task-l-title">{{item.taskCodeDictValue}}</view>
|
|
|
+ <view class="task-l-desc">赚<text>{{item.giveTimes}}</text>次抽奖 <u-image width="22rpx" height="22rpx" src="/static/zpIcon.png"></u-image></view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="task-r">
|
|
|
- <u-button size="medium" v-if="index==0" :custom-style="{padding:'6px 10px',width:'100%',background:'#989898',color:'#ffffff'}">已完成</u-button>
|
|
|
- <u-button size="medium" v-else-if="index==1" open-type="share" :custom-style="{padding:'6px 10px',width:'100%',background:'#02c9b2',color:'#ffffff'}">立即分享</u-button>
|
|
|
+ <u-button size="medium" v-if="item.state==1||item.taskCode=='NEW_CUSTOMER'" :custom-style="{padding:'6px 10px',width:'100%',background:'#989898',color:'#ffffff'}">已完成</u-button>
|
|
|
+ <u-button size="medium" v-else-if="item.state==0 && item.taskCode=='SHARE_FRIEND'" open-type="share" :custom-style="{padding:'6px 10px',width:'100%',background:'#02c9b2',color:'#ffffff'}">立即分享</u-button>
|
|
|
<u-button size="medium" v-else @click="showYdao" :custom-style="{padding:'6px 10px',width:'100%',background:'#02c9b2',color:'#ffffff'}">立即前往</u-button>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -29,13 +29,31 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import { findCustomerTask } from '@/api/luckyDraw.js'
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- showYd: false
|
|
|
+ showYd: false,
|
|
|
+ list: [], // 任务列表
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onLoad(option) {
|
|
|
+ if(option.id) {
|
|
|
+ this.getTaskList(option.id)
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取任务列表
|
|
|
+ getTaskList (id) {
|
|
|
+ findCustomerTask({id:id}).then(res =>{
|
|
|
+ if(res.status == 200) {
|
|
|
+ console.log(res)
|
|
|
+ this.list = res.data
|
|
|
+ } else {
|
|
|
+ this.list = []
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
showYdao(){
|
|
|
this.showYd = true
|
|
|
},
|