任务修改

This commit is contained in:
GaoHao
2024-12-21 18:26:35 +08:00
parent cfde959d35
commit 4c8c89a844
4 changed files with 47 additions and 145 deletions

View File

@@ -8,8 +8,8 @@
<view class="content u-relative" v-if="list.length">
<view class="cell flex justify-between" v-for="(item,index) in list" :key="index" >
<image class="cell_icon" :src="'../../static/images/task/member_bg.png'"></image>
<view class="name u-font-24 text-bold ">已领取</view>
<image class="cell_icon" :src="item.url"></image>
<view class="name u-font-24 text-bold ">{{item.name}}</view>
</view>
</view>
@@ -27,83 +27,29 @@
backgroundImage: 'linear-gradient(to right, #DDEAFC 0%, #C8DBFA 49%, #AFC9F6 100%)'
},
list: [],
isShowMoneyPay: true,
source: null
}
},
onShow() {
this.getTaskdata()
this.$Request.getT("app/common/type/919", {}).then(res => {
if (res.code == 0) {
const sysInfo = uni.getSystemInfoSync();
let isIos = sysInfo.platform == 'ios'
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
}
});
onLoad(options) {
console.log(options)
if ( options.source ) {
this.source = options.source
}
this.getList()
},
methods: {
/**
* 跳转
* @param {Object} item
*/
goNav( item ) {
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
// buttonUrl
if ( item.jumpType == 0) {
this.taskReceive(item.id)
} else if ( item.jumpType == 1) {
uni.navigateTo({
url: item.buttonUrl
})
} else if( item.jumpType == 3) {
uni.switchTab({
url: item.buttonUrl
})
} else if( item.jumpType == 2) {
plus.runtime.openURL(item.buttonUrl)
}
},
/**
* 领取
* 获取列表
*/
taskReceive(id) {
let data = {
id: id
}
this.$Request.getT('app/taskCenter/taskReceive', data).then(res => {
getList() {
this.$Request.getT('app/discSpinning/selectDiscSpinning', {source:this.source}).then(res => {
if (res.code == 0 ) {
uni.showToast({
title: id==15?'签到成功':'领取成功',
icon: 'none'
})
setTimeout(()=>{
this.getTaskdata()
this.getsignIn()
},1000)
} else {
uni.switchTab({
url: "/pages/index/index"
})
this.list = res.data.records
}
})
},
/**
* 获取任务列表
*/
getTaskdata() {
this.$Request.getT('app/discSpinning/selectDiscSpinning', {}).then(res => {
if (res.code == 0 ) {
this.list = res.data
}
uni.stopPullDownRefresh();
})
},
}
}
</script>