Bläddra i källkod

任务列表接口对接

1004749546@qq.com 4 år sedan
förälder
incheckning
ef0d0e6064

+ 1 - 1
pagesA/luckDraw/luckDraw.vue

@@ -431,7 +431,7 @@ export default {
 		// 任务列表
 		toTaskList(){
 			uni.navigateTo({
-				url: '/pagesA/taskList/taskList'
+				url: '/pagesA/taskList/taskList?id='+this.luckDraw.luckyDrawNo
 			})
 		}
 	},

+ 25 - 7
pagesA/taskList/taskList.vue

@@ -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
 			},

+ 0 - 0
static/taskIcon3.png → static/FIRST_DELIVER.png


+ 0 - 0
static/taskIcon1.png → static/NEW_CUSTOMER.png


+ 0 - 0
static/taskIcon4.png → static/OLD_CUSTOMER_BACK.png


+ 0 - 0
static/taskIcon2.png → static/SHARE_FRIEND.png