任务修改
This commit is contained in:
parent
cfde959d35
commit
4c8c89a844
|
|
@ -520,7 +520,6 @@
|
|||
this.wHeight = sysInfo.screenHeight
|
||||
this.boxStyle.height = this.wHeight + 5;
|
||||
// 记录跳转过来的视频总id跟单集id
|
||||
console.log(e)
|
||||
if (e.id) {
|
||||
this.courseId = e.id;
|
||||
if (e.courseDetailsId && e.courseDetailsId != 'null') {
|
||||
|
|
@ -595,6 +594,7 @@
|
|||
|
||||
},
|
||||
appear(e, index) {
|
||||
this.courseDetailsId = e;
|
||||
// 清除已经设置的定时器
|
||||
clearTimeout(this.appearTimeout);
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@
|
|||
<view v-if=" item.disabled " class="btn u-font-24 text-bold" :style="{backgroundColor: item.buttonBgColor,color: item.buttonFontColor }" @click="goNav(item)">{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}</view>
|
||||
<view v-else class="btn u-font-24 text-bold disabled">{{ item.type == 1 ? item.buttonTitle : item.number ? `${item.discNumber}/${item.number}` : ( item.discNumber <= 0 ? item.buttonTitle : `剩余${item.discNumber}次`) }}</view>
|
||||
<!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> -->
|
||||
<view v-if=" item.type == 2 " class="u-font-20 tip" @click="goNav('/me/gift/gift', item.type)">查看奖品列表</view>
|
||||
<view v-if=" item.buttonUnderContent && item.buttonUnderUrl " class="u-font-20 tip" @click="goNav({buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title})">{{ item.buttonUnderContent}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -148,7 +148,7 @@
|
|||
// buttonUrl
|
||||
console.log(item)
|
||||
if ( item.jumpType == 0) {
|
||||
if ( item.buttonTitle == '去领取') {
|
||||
if ( item.buttonTitle.indexOf("领取") != -1) {
|
||||
this.taskReceive(item.id)
|
||||
} else {
|
||||
uni.switchTab({
|
||||
|
|
@ -156,8 +156,19 @@
|
|||
})
|
||||
}
|
||||
} else if ( item.jumpType == 1) {
|
||||
let source,buttonUrl;
|
||||
buttonUrl = item.buttonUrl
|
||||
if ( item.title && item.title.indexOf('每周') != -1 ) {
|
||||
source = 2
|
||||
buttonUrl = item.buttonUrl+'?source='+source
|
||||
}
|
||||
if ( item.title && item.title.indexOf('每月') != -1 ) {
|
||||
source = 3
|
||||
buttonUrl = item.buttonUrl+'?source='+source
|
||||
}
|
||||
console.log(buttonUrl)
|
||||
uni.navigateTo({
|
||||
url: item.buttonUrl
|
||||
url: buttonUrl
|
||||
})
|
||||
} else if( item.jumpType == 3) {
|
||||
uni.switchTab({
|
||||
|
|
@ -222,6 +233,7 @@
|
|||
<style lang="scss">
|
||||
.container{
|
||||
width: 100%;
|
||||
background-color: #F3F4F8;
|
||||
.task_bg{
|
||||
width: 100%!important;
|
||||
height: 494rpx!important;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -15,10 +15,10 @@
|
|||
</view>
|
||||
<view class="cell flex justify-between" v-for="(item,index) in list" :key="index" >
|
||||
<view class="cell_left flex">
|
||||
<image class="cell_icon" :src="'../../static/images/task/member_bg.png'"></image>
|
||||
<image class="cell_icon" :src="item.url"></image>
|
||||
<view class="cell_title flex">
|
||||
<view class="u-font-28 text-bold title">{{ item.title}}</view>
|
||||
<view class="u-font-24 tip">{{ item.rewardDetail }}</view>
|
||||
<view class="u-font-28 text-bold title">{{ item.name}}</view>
|
||||
<!-- <view class="u-font-24 tip">{{ item.rewardDetail }}</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -38,83 +38,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/taskCenter/selectTaskCenter', {}).then(res => {
|
||||
if (res.code == 0 ) {
|
||||
this.list = res.data
|
||||
}
|
||||
uni.stopPullDownRefresh();
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -154,7 +100,7 @@
|
|||
background: linear-gradient( -45deg, #DDEAFC 0%, #FFFFFF 100%);
|
||||
border-radius: 32rpx 32rpx 0rpx 0rpx;
|
||||
overflow-y: auto;
|
||||
.title{
|
||||
>.title{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
|
|
@ -176,6 +122,7 @@
|
|||
padding: 32rpx 28rpx;
|
||||
.cell_left{
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
.cell_icon{
|
||||
width: 84rpx!important;
|
||||
height: 84rpx!important;
|
||||
|
|
@ -184,15 +131,12 @@
|
|||
}
|
||||
.cell_title{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 12rpx;
|
||||
align-items: center;
|
||||
color: #333;
|
||||
.title{
|
||||
font-weight: bold;
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.tip{
|
||||
|
|
|
|||
Loading…
Reference in New Issue