任务修改,会员权益修改

This commit is contained in:
GaoHao
2024-12-25 17:10:05 +08:00
parent 3960ff7586
commit 28bab311d3
12 changed files with 255 additions and 69 deletions

View File

@@ -1,10 +1,10 @@
const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; // // const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; //
const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名 // const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名
const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名 // const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; //
// const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名
// const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; // // const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; //
// const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名 // const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名

View File

@@ -477,12 +477,16 @@
if (name.type ==1) { if (name.type ==1) {
tipContent = '很遗憾,没有中奖,请再接再厉!' tipContent = '很遗憾,没有中奖,请再接再厉!'
uni.showToast({
title: tipContent,
icon: "none"
})
} else { } else {
tipContent = `恭喜您,获得 ${name}${this.result.type==2?(this.result.number+'元'):''} ` tipContent = `恭喜您,获得 ${name}${this.result.type==2?(this.result.number+'元'):''} `
this.showLingPop({...this.result})
} }
const _this=this; const _this=this;
console.log(this.result); console.log(this.result);
this.showLingPop({...this.result})
this.result='' this.result=''
this.prizeing = false this.prizeing = false
return return

View File

@@ -34,7 +34,8 @@
data() { data() {
return { return {
query: { query: {
discSpinningRecordId: null, foreignId: null,
foreignType: 'spinning',
phone: "", phone: "",
address: "", address: "",
remark: "", remark: "",
@@ -44,9 +45,11 @@
onLoad(options) { onLoad(options) {
console.log(options) console.log(options)
if ( options.id ) { if ( options.id ) {
this.query.discSpinningRecordId = options.id this.query.foreignId = options.id
}
if ( options.foreignType ) {
this.query.foreignType = options.foreignType
} }
}, },
methods: { methods: {

View File

@@ -184,7 +184,6 @@ export default {
getMoneyDetail() { getMoneyDetail() {
let that = this; let that = this;
let token = uni.getStorageSync('token') let token = uni.getStorageSync('token')
console.log(1);
if (token) { if (token) {
//可以提现金额查询预估收入查询 //可以提现金额查询预估收入查询
let data = { let data = {

View File

@@ -41,11 +41,10 @@
} }
}, },
onLoad: function(e) { onLoad: function(e) {
console.log(e)
if (e.moneyType) { if (e.moneyType) {
this.moneyType = e.moneyType this.moneyType = e.moneyType
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: e.moneyType === 1 ? '红包明细' : '金币明细' title: e.moneyType == 1 ? '红包明细' : '金币明细'
}); });
} }
if (e.viewType) { if (e.viewType) {

View File

@@ -579,7 +579,6 @@
} }
}, },
goNav(e,type) { goNav(e,type) {
console.log(e)
let token = uni.getStorageSync('token') let token = uni.getStorageSync('token')
if (token) { if (token) {
if (type === 'tabbar') { if (type === 'tabbar') {

View File

@@ -17,14 +17,22 @@
<view class="icon_title u-font-32 text-bold u-relative">新人好礼送不停</view> <view class="icon_title u-font-32 text-bold u-relative">新人好礼送不停</view>
<image class="task_icon2 u-relative" src="../../static/images/me/task_icon2.png"></image> <image class="task_icon2 u-relative" src="../../static/images/me/task_icon2.png"></image>
</view> </view>
<view v-if="enable!=0&&signInList.length>0" class="content signIn margin-lr padding bg-white u-relative" style="margin-bottom: 32rpx;">
<view class="content signIn margin-lr padding bg-white u-relative" style="margin-bottom: 32rpx;">
<view class="title flex justify-between"> <view class="title flex justify-between">
<view>已连续签到 <text class="num">{{signDays}}</text> </view> <view>已连续签到 <text class="num">{{signDays}}</text> </view>
<!-- <view class="dk flex"> <!-- <view class="dk flex">
<text style="margin-right: 20rpx;">打卡提醒</text> <text style="margin-right: 20rpx;">打卡提醒</text>
<u-switch v-model="checked" size="35" active-color="#EA9EA8 "></u-switch> <u-switch v-model="checked" size="35" active-color="#EA9EA8 "></u-switch>
</view> --> </view> -->
<view class="tooltip-trigger" @click="showTooltip">
<u-icon name="question-circle" :size="40"></u-icon>
<view class="tooltip" v-if="isTooltipVisible">
签到中断后需重新签到
<view class="triangle"></view>
<view class="trianglef"></view>
</view>
</view>
</view> </view>
<view class="signInList flex justify-between"> <view class="signInList flex justify-between">
<text class="line"></text> <text class="line"></text>
@@ -39,6 +47,7 @@
src="../../static/images/signIn_icon1.png" mode="" /> src="../../static/images/signIn_icon1.png" mode="" />
<view class="radius"></view> <view class="radius"></view>
<view class="_label">{{item.showText}}</view> <view class="_label">{{item.showText}}</view>
<view class="_label" style="font-size: 18rpx;color: #999;margin-top: 2rpx;">{{item.signDay.slice(6,10)}}</view>
</view> </view>
</view> </view>
@@ -50,11 +59,10 @@
</view> --> </view> -->
</view> </view>
<view class="content margin-lr padding bg-white u-relative" v-if="list.length"> <view class="content margin-lr padding bg-white u-relative" v-if="list.length">
<view class="cell flex justify-between" v-for="(item,index) in list" :key="index" <view class="cell flex justify-between" v-for="(item,index) in list" :key="index"
v-if="((item.buttonUrl=='/me/invite/index'&&isShowMoneyPay))||((item.buttonUrl!='/me/invite/index'))"> v-if="item.show">
<view class="cell_left flex"> <view class="cell_left flex">
<view class="cell_title flex"> <view class="cell_title flex">
<view class="u-font-28 text-bold title" <view class="u-font-28 text-bold title"
@@ -75,7 +83,7 @@
</view> </view>
<!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> --> <!-- <view v-else class="btn u-font-24 text-bold" @click="goNav(item)">{{ item.buttonTitle }}</view> -->
<view v-if=" item.buttonUnderContent && item.buttonUnderUrl " class="u-font-22 tip" <view v-if=" item.buttonUnderContent && item.buttonUnderUrl " class="u-font-22 tip"
@click="goNav({buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title})"> @click="goNav({id: item.id,buttonUrl: item.buttonUnderUrl, jumpType: 1,title: item.title, disabled: item.disabled, discNumber: item.discNumber})">
{{ item.buttonUnderContent}} {{ item.buttonUnderContent}}
</view> </view>
</view> </view>
@@ -101,27 +109,9 @@
list: [], list: [],
checked: false, checked: false,
signDays: 0, signDays: 0,
signInList: [{ enable: 0,
name: '第一天' signInList: [],
}, recordList: [
{
name: '第二天'
},
{
name: '第三天'
},
{
name: '第四天'
},
{
name: '第五天'
},
{
name: '第六天'
},
{
name: '第七天'
},
], ],
signInBtn: '点击签到', signInBtn: '点击签到',
isShowMoneyPay: true, isShowMoneyPay: true,
@@ -129,9 +119,12 @@
isAndroid: false, isAndroid: false,
adRewardedVideo: true, adRewardedVideo: true,
urlCallback: null, urlCallback: null,
isTooltipVisible: false,
tooltipTimeout: null,
} }
}, },
onShow() { onShow() {
this.signInList = []
this.adRewardedVideo = true; this.adRewardedVideo = true;
this.getTaskdata() this.getTaskdata()
this.getsignIn() this.getsignIn()
@@ -141,9 +134,7 @@
let isIos = sysInfo.platform == 'ios' let isIos = sysInfo.platform == 'ios'
this.isIos = /iOS/.test(sysInfo.platform); this.isIos = /iOS/.test(sysInfo.platform);
// 判断是否是安卓设备 // 判断是否是安卓设备
// #ifdef APP-PLUS
this.isAndroid = sysInfo.platform === 'android'
// #endif
this.isShowMoneyPay = !(res.data.value == '1' && isIos) this.isShowMoneyPay = !(res.data.value == '1' && isIos)
} }
@@ -153,9 +144,28 @@
}, },
methods: { methods: {
/**
* 签到提示出发
*/
showTooltip() {
clearTimeout(this.tooltipTimeout);
this.isTooltipVisible = !this.isTooltipVisible;
this.tooltipTimeout = setTimeout(() => {
this.isTooltipVisible = false;
}, 1000); // 1000毫秒后隐藏tooltip
},
/**
* 广告数据加载成功回调
* @param {Object} e
*/
onadload(e) { onadload(e) {
console.log('广告数据加载成功'); console.log('广告数据加载成功');
}, },
/**
* 广告播放成功回调
* @param {Object} e
*/
async onadclose(e) { async onadclose(e) {
const detail = e.detail const detail = e.detail
if (detail && detail.isEnded) { if (detail && detail.isEnded) {
@@ -177,6 +187,10 @@
// 播放中途退出 // 播放中途退出
} }
}, },
/**
* 广告加载失败回调
* @param {Object} e
*/
onaderror(e) { // 广告加载失败 onaderror(e) { // 广告加载失败
this.adRewardedVideo = false; this.adRewardedVideo = false;
console.log("广告加载失败") console.log("广告加载失败")
@@ -189,6 +203,7 @@
if (res.code == 0) { if (res.code == 0) {
this.signInList = res.data.recordList this.signInList = res.data.recordList
this.signDays = res.data.signDays this.signDays = res.data.signDays
this.enable = res.data.enable
this.signInList.map((item, index) => { this.signInList.map((item, index) => {
if (item.showText == '待签到' && index > 0) { if (item.showText == '待签到' && index > 0) {
this.signInBtn = this.signInList[index - 1].status == 0 ? '重新签到' : '点击签到' this.signInBtn = this.signInList[index - 1].status == 0 ? '重新签到' : '点击签到'
@@ -247,14 +262,17 @@
} else if (item.jumpType == 1) { } else if (item.jumpType == 1) {
let source, buttonUrl; let source, buttonUrl;
buttonUrl = item.buttonUrl buttonUrl = item.buttonUrl
if (item.title && item.title.indexOf('每周') != -1) { if (item.title && item.title.indexOf('每周打卡奖励') != -1) {
source = 2 source = 2
buttonUrl = item.buttonUrl + '?source=' + source buttonUrl = item.buttonUrl + '?source=' + source
} }
if (item.title && item.title.indexOf('每月') != -1) { if (item.title && item.title.indexOf('每月打卡奖励1') != -1) {
source = 3 source = 3
buttonUrl = item.buttonUrl + '?source=' + source buttonUrl = item.buttonUrl + '?source=' + source
} }
if (item.title && item.title.indexOf('每月打卡奖励2') != -1) {
buttonUrl = `${item.buttonUrl}?standard=${item.discNumber==null?true:false}&taskId=${item.id}`
}
console.log(buttonUrl) console.log(buttonUrl)
uni.navigateTo({ uni.navigateTo({
url: buttonUrl url: buttonUrl
@@ -298,10 +316,21 @@
* 获取任务列表 * 获取任务列表
*/ */
getTaskdata() { getTaskdata() {
this.list= [];
this.$Request.getT('app/taskCenter/selectTaskCenter', {}).then(res => { this.$Request.getT('app/taskCenter/selectTaskCenter', {}).then(res => {
if (res.code == 0) { if (res.code == 0) {
this.list = res.data this.list = res.data
this.list.map(item=>{
item.show = true
})
// #ifdef H5
this.list.map(item=>{
if(item.title.indexOf("观看视频") != -1) {
item.show = false
}
})
// #endif
} }
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}) })
@@ -320,10 +349,59 @@
</script> </script>
<style lang="scss"> <style lang="scss">
.container { page{
// width: 100%;
// min-height: 100vh;
background-color: #F3F4F8; background-color: #F3F4F8;
}
.tooltip-trigger {
// background-color: #f0f0f0;
// border: 1px solid #ddd;
text-align: center;
}
.tooltip {
padding: 10px;
background-color: #fff;
color: #999;
box-shadow: 0rpx 4rpx 10rpx 4rpx rgba(140,140,140,0.35);
border-radius: 10rpx 10rpx 10rpx 10rpx;
position: absolute;
top: 80rpx;
right: 30rpx;
z-index: 10;
font-weight: 400;
font-size: 20rpx;
color: #999999;
}
.triangle,.trianglef {
position: absolute;
z-index: 99;
right: 15rpx;
top: -16rpx;
width: 0;
height: 0;
border-left: 17rpx solid transparent;
/* 左边的边框为透明 */
border-right: 17rpx solid transparent;
/* 右边的边框为透明 */
border-bottom: 17rpx solid rgba(140,140,140,0.15);
opacity: .9;
z-index: 8;
}
.trianglef{
top: -15rpx;
right: 17rpx;
border-left: 15rpx solid transparent;
/* 左边的边框为透明 */
border-right: 15rpx solid transparent;
border-bottom: 15rpx solid #fff;
z-index: 11;
}
.container {
width: 100%;
// height: 100vh;
background-color: #F3F4F8;
// padding-bottom: 132rpx;
.task_bg { .task_bg {
width: 100% !important; width: 100% !important;
height: 494rpx !important; height: 494rpx !important;
@@ -486,7 +564,7 @@
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
bottom: 57rpx; bottom: 82rpx;
margin: auto; margin: auto;
} }

View File

@@ -2,9 +2,9 @@
<template> <template>
<view class="container"> <view class="container">
<u-navbar :background="background" :is-back="true" :title="title" :border-bottom="false"></u-navbar> <u-navbar :background="background" :is-back="true" :title="title" :border-bottom="false"></u-navbar>
<view class="task_bg u-relative"></view> <view style="width: 100%;position: absolute;">
<image class="task_bg" src="../../static/images/task/prize_bg.png" mode="widthFix"></image>
</view>
<view class="content u-relative" v-if="list.length"> <view class="content u-relative" v-if="list.length">
<view class="cell flex justify-between" v-for="(item,index) in list" :key="index" > <view class="cell flex justify-between" v-for="(item,index) in list" :key="index" >
@@ -24,7 +24,7 @@
return { return {
title: '', title: '',
background: { background: {
backgroundImage: 'transparent' backgroundImage: 'linear-gradient(to right, #F0987B 0%, #F0987B 49%, #F0987B 100%)'
}, },
list: [], list: [],
source: null source: null
@@ -55,23 +55,26 @@
</script> </script>
<style lang="scss"> <style lang="scss">
page{
background-color: #FAF8F3;
}
.container{ .container{
width: 100%; width: 100%;
height: 100vh; min-height: 100vh;
// display: flex; // display: flex;
// flex-direction: column; // flex-direction: column;
.task_bg{ .task_bg{
width: 100%; width: 100%;
height: 100%; // height: 100%;
position: absolute; // position: absolute;
top: 0; // top: 88rpx;
background: url('../../static/images/task/prize_bg.png') no-repeat top center / cover; // background: url('../../static/images/task/prize_bg.png') no-repeat top center / cover;
} }
.content{ .content{
z-index: 9; z-index: 9;
padding: 370rpx 28rpx 0 28rpx; padding: 282rpx 28rpx 0 28rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;

View File

@@ -1,7 +1,7 @@
<!-- 任务中心 --> <!-- 任务中心 -->
<template> <template>
<view class="container"> <view class="container">
<u-navbar :background="background" :is-back="true" :title="title" :border-bottom="false"></u-navbar> <u-navbar :background="background" :is-back="true" :title="title" :border-bottom="false" style="position: absolute;"></u-navbar>
<view class="task_bg u-relative"> <view class="task_bg u-relative">
<u-image class="task_bg" src="../../static/images/task/member_bg.png" ></u-image> <u-image class="task_bg" src="../../static/images/task/member_bg.png" ></u-image>
<view class="title ">每月打卡免费领</view> <view class="title ">每月打卡免费领</view>
@@ -15,12 +15,32 @@
</view> </view>
<view class="cell flex justify-between" v-for="(item,index) in list" :key="index" > <view class="cell flex justify-between" v-for="(item,index) in list" :key="index" >
<view class="cell_left flex"> <view class="cell_left flex">
<image class="cell_icon" :src="item.url"></image> <image class="cell_icon" :src="item.img"></image>
<view class="cell_title flex"> <view class="cell_title flex">
<view class="u-font-28 text-bold title">{{ item.name}}</view> <view class="u-font-28 text-bold title">{{ item.name}}</view>
<!-- <view class="u-font-24 tip">{{ item.rewardDetail }}</view> --> <view class="u-font-24 tip">{{ item.rewardDetail }}</view>
</view> </view>
</view> </view>
<view class="cell_right" v-if="standard=='true'">
<viwe v-if="!receive">
<view class="btn" @click="taskReceive(item)">领取</view>
</viwe>
<view v-else>
<view v-if="item.disabled" >
<view class="btn disabled" >领取</view>
</view>
<view v-else>
<view v-if="!item.targetId" class="btn" @click="toDuiHuan(item)">去兑换</view>
<view v-else class="btn receive" >已兑换</view>
<u-image v-if="!item.targetId" class="icon" src="../../static/images/task/receive2.png"></u-image>
</view>
</view>
</view>
<view class="standard" v-else>
<u-image class="icon" src="../../static/images/task/receive1.png"></u-image>
</view>
</view> </view>
</view> </view>
@@ -37,7 +57,14 @@
background: { background: {
backgroundImage: 'transparent', backgroundImage: 'transparent',
}, },
query: {
taskId: null,
},
list: [], list: [],
standard: true,
receive: null,
record: null,
source: null, source: null,
} }
}, },
@@ -46,21 +73,75 @@
if ( options.source ) { if ( options.source ) {
this.source = options.source this.source = options.source
} }
this.getList() if ( options.standard ) {
this.standard = options.standard
}
if ( options.taskId ) {
this.query.taskId = options.taskId
}
},
onShow() {
this.getList()
}, },
methods: { methods: {
/**
* 去兑换
* @param {Object} item
*/
toDuiHuan(item){
uni.navigateTo({
url:`/me/gift/duihuan?id=${this.record}&foreignType=task`
})
},
/** /**
* 获取列表 * 获取列表
*/ */
getList() { getList() {
this.$Request.getT('app/discSpinning/selectDiscSpinning', {source:this.source}).then(res => { this.$Request.getT('app/taskCenterReward/selectTaskCenterUserReward', this.query).then(res => {
if (res.code == 0 ) { if (res.code == 0 ) {
this.list = res.data.records this.list = res.data
this.list.map(item=>{
item.disabled = true
})
this.receive = res.receive
this.record = res.record
if ( this.receive ) {
this.list.map(item=>{
if ( item.id == this.receive ) {
item.disabled = false
}
})
}
console.log(this.list)
} }
}) })
}, },
/**
* 领取
*/
taskReceive(item) {
let data = {
taskId: this.query.taskId,
sourceId: item.id
}
this.$Request.postT('app/taskCenter/receiveGoods', data).then(res => {
if (res.code == 0) {
uni.showToast({
title: '领取成功',
icon: 'none'
})
this.getList()
} else {
uni.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
} }
} }
</script> </script>
@@ -120,6 +201,17 @@
border-radius: 8rpx 8rpx 8rpx 8rpx; border-radius: 8rpx 8rpx 8rpx 8rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
padding: 32rpx 28rpx; padding: 32rpx 28rpx;
position: relative;
.standard{
width: 100%;
height: 100%;
background: rgba(43,43,43,0.19);
border-radius: 8rpx 8rpx 8rpx 8rpx;
position: absolute;
right: 0;
bottom: 0;
}
.cell_left{ .cell_left{
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
@@ -147,7 +239,7 @@
} }
} }
.cell_right{ .cell_right{
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
flex-shrink: 0; flex-shrink: 0;
@@ -163,6 +255,8 @@
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #FFFFFF;
border: 2rpx solid transparent; border: 2rpx solid transparent;
position: relative;
z-index: 99;
} }
.opt{ .opt{
@@ -179,6 +273,13 @@
color: #6DA9F7; color: #6DA9F7;
} }
} }
.icon{
width: 132rpx!important;
height: 136rpx!important;
position: absolute;
right: 0;
bottom: 0;
}
} }
.cell:last-child{ .cell:last-child{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB