任务中心更新
This commit is contained in:
@@ -22,10 +22,10 @@
|
|||||||
<view class="subhead u-font-24">{{ item.subhead }}</view>
|
<view class="subhead u-font-24">{{ item.subhead }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cell_right flex">
|
<view class="cell_right flex">
|
||||||
<view v-if=" item.type == 2 " class="btn u-font-24 text-bold opt">{{ item.btnText }}</view>
|
<view v-if=" item.type == 2 " class="btn u-font-24 text-bold opt" @click="goNav(item.url, item.type)">{{ item.btnText }}</view>
|
||||||
<view v-else-if=" item.type == 3 " class="btn u-font-24 text-bold disabled">{{ item.btnText }}</view>
|
<view v-else-if=" item.type == 3 " class="btn u-font-24 text-bold disabled">{{ item.btnText }}</view>
|
||||||
<view v-else class="btn u-font-24 text-bold">{{ item.btnText }}</view>
|
<view v-else class="btn u-font-24 text-bold" @click="goNav(item.url, item.type)">{{ item.btnText }}</view>
|
||||||
<view v-if=" item.type ==4 " class="u-font-20 tip">查看奖品列表</view>
|
<view v-if=" item.type ==4 " class="u-font-20 tip" @click="goNav('/me/gift/gift', item.type)">查看奖品列表</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -42,49 +42,44 @@
|
|||||||
return {
|
return {
|
||||||
cellList: [
|
cellList: [
|
||||||
{
|
{
|
||||||
title: '分享奖励', type: 1, icon: '../../static/images/me/task_icon3.png', tip: '会员免费领', subhead: '分享好友即可获得', btnText:'立即领取'
|
title: '分享奖励', type: 1, url: '/me/invite/index', icon: '../../static/images/me/task_icon3.png', tip: '奖励888金币', subhead: '分享好友即可获得', btnText:'立即分享'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '每日签到奖励', type: 2, icon: '../../static/images/me/task_icon3.png', tip: '奖励金币', subhead: '每日付款满3笔即可获得', btnText:'立即看剧'
|
title: '每日签到奖励', type: 2, url: '/pages/index/index', icon: '../../static/images/me/task_icon3.png', tip: '奖励8898金币', subhead: '每日付款满3笔即可获得', btnText:'立即看剧'
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '每周打卡奖励', type: 3, icon: '', tip: '', subhead: '签到满7天即可获得丰富好礼', btnText:'剩余23次'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '每月打卡奖励1', type: 4, icon: '', tip: '', subhead: '当月签到满21天获得丰富好礼', btnText:'剩余233次'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '每月打卡奖励2', type: 5, icon: '../../static/images/me/task_icon4.png', tip: '奖励金币', subhead: '当月签到满21天即可免费领取', btnText:'立即领取'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '观看视频奖励', type: 6, icon: '../../static/images/me/task_icon3.png', tip: '奖励金币', subhead: '观看完整视频即可获得奖励', btnText:'立即领取'
|
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// title: '每周打卡奖励', type: 3, url: '/me/invite/index', icon: '', tip: '', subhead: '签到满7天即可获得丰富好礼', btnText:'剩余23次'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '每月打卡奖励1', type: 4, url: '/me/invite/index', icon: '', tip: '', subhead: '当月签到满21天获得丰富好礼', btnText:'剩余233次'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '每月打卡奖励2', type: 5, url: '/me/invite/index', icon: '../../static/images/me/task_icon4.png', tip: '奖励金币', subhead: '当月签到满21天即可免费领取', btnText:'立即领取'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '观看视频奖励', type: 6, url: '/me/invite/index', icon: '../../static/images/me/task_icon3.png', tip: '奖励金币', subhead: '观看完整视频即可获得奖励', btnText:'观看视频'
|
||||||
|
// },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-KUAISHOU
|
|
||||||
this.osName = uni.getSystemInfoSync().osName;
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef APP
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
// #ifdef H5
|
|
||||||
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
|
|
||||||
this.userName = uni.getStorageSync('userName')
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
//
|
||||||
|
goNav(url,type) {
|
||||||
|
console.log(url)
|
||||||
|
if ( type == 2) {
|
||||||
|
uni.switchTab({
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: url
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
getvipdata() {
|
getvipdata() {
|
||||||
let data = {
|
let data = {
|
||||||
userId: uni.getStorageSync('userId')
|
userId: uni.getStorageSync('userId')
|
||||||
@@ -100,69 +95,8 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
callPay: function(response) {
|
|
||||||
if (typeof WeixinJSBridge === "undefined") {
|
|
||||||
if (document.addEventListener) {
|
|
||||||
document.addEventListener('WeixinJSBridgeReady', this.onBridgeReady(response), false);
|
|
||||||
} else if (document.attachEvent) {
|
|
||||||
document.attachEvent('WeixinJSBridgeReady', this.onBridgeReady(response));
|
|
||||||
document.attachEvent('onWeixinJSBridgeReady', this.onBridgeReady(response));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this.onBridgeReady(response);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onBridgeReady: function(response) {
|
|
||||||
let that = this;
|
|
||||||
if (!response.package) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
console.log("response)))):" + JSON.stringify(response))
|
|
||||||
WeixinJSBridge.invoke(
|
|
||||||
'getBrandWCPayRequest', {
|
|
||||||
"appId": response.appid, //公众号名称,由商户传入
|
|
||||||
"timeStamp": response.timestamp, //时间戳,自1970年以来的秒数
|
|
||||||
"nonceStr": response.noncestr, //随机串
|
|
||||||
"package": response.package,
|
|
||||||
"signType": response.signType, //微信签名方式:
|
|
||||||
"paySign": response.sign //微信签名
|
|
||||||
},
|
|
||||||
function(res) {
|
|
||||||
if (res.err_msg === "get_brand_wcpay_request:ok") {
|
|
||||||
// 使用以上方式判断前端返回,微信团队郑重提示:
|
|
||||||
//res.err_msg将在用户支付成功后返回ok,但并不保证它绝对可靠。
|
|
||||||
that.showPay = false
|
|
||||||
uni.showToast({
|
|
||||||
title: '支付成功',
|
|
||||||
icon: 'success'
|
|
||||||
})
|
|
||||||
|
|
||||||
let data = {
|
|
||||||
userId: uni.getStorageSync('userId')
|
|
||||||
}
|
|
||||||
that.$u.api.userVip(data).then(res => {
|
|
||||||
if (res.code == 0 && res.data && res.data
|
|
||||||
.isVip ==
|
|
||||||
2) {
|
|
||||||
uni.setStorageSync('isVIP', true)
|
|
||||||
} else {
|
|
||||||
uni.setStorageSync('isVIP', false)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
setTimeout(d => {
|
|
||||||
let data = {
|
|
||||||
flag: true
|
|
||||||
}
|
|
||||||
uni.$emit('back', data)
|
|
||||||
uni.navigateBack(1)
|
|
||||||
}, 1000);
|
|
||||||
} else {
|
|
||||||
uni.hideLoading();
|
|
||||||
}
|
|
||||||
WeixinJSBridge.log(response.err_msg);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user