任务中心调试

This commit is contained in:
GaoHao
2024-12-09 16:39:33 +08:00
parent ca6baa5254
commit 6f931f7157
4 changed files with 85 additions and 28 deletions

View File

@@ -22,7 +22,7 @@
<view class="subhead u-font-24">{{ item.detail }}</view>
</view>
<view class="cell_right flex">
<view v-if=" !item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.buttonTitle }}</view>
<view v-if=" item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.buttonTitle }}</view>
<view v-else class="btn u-font-24 text-bold disabled">{{ item.buttonTitle }}</view>
<!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> -->
<!-- <view v-if=" item.type ==4 " class="u-font-20 tip" @click="goNav('/me/gift/gift', item.type)">查看奖品列表</view> -->
@@ -36,8 +36,7 @@
<script>
export default {
components: {
},
data() {
return {
title: '',
@@ -69,31 +68,60 @@
}
},
onShow() {
this.getvipdata()
this.getTaskdata()
},
methods: {
//
/**
* 跳转
* @param {Object} item
*/
goNav( item ) {
console.log(url)
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
// buttonUrl
if ( item.jumpType == 1) {
uni.navigateTo({
url: item.buttonUrl
})
} else if( item.jumpType == 3) {
uni.switchTab({
url: item.buttonUrl
})
if ( item.type == 1) {
if ( item.jumpType == 1) {
console.log(item.buttonUrl)
uni.navigateTo({
url: item.buttonUrl
})
} else if( item.jumpType == 3) {
uni.switchTab({
url: item.buttonUrl
})
} else {
plus.runtime.openURL(item.buttonUrl)
}
} else {
this.taskReceive(item.id)
}
},
getvipdata() {
/**
* 领取
*/
taskReceive(id) {
let data = {
id: id
}
this.$Request.getT('app/taskCenter/taskReceive', data).then(res => {
if (res.code == 0 ) {
uni.showToast({
title: '领取成功',
icon: 'none'
})
this.getTaskdata()
}
})
},
/**
* 获取任务列表
*/
getTaskdata() {
let data = {
page: this.page,
limit: this.limit
@@ -101,14 +129,18 @@
this.$Request.getT('app/taskCenter/selectTaskCenter', data).then(res => {
if (res.code == 0 ) {
this.cellList = res.data.records
} else {
}
uni.stopPullDownRefresh();
})
},
/**
* 下拉加载
*/
onPullDownRefresh: function() {
console.log(2)
this.getTaskdata();
},
}
}