This commit is contained in:
YeMingfei666 2025-01-17 17:56:57 +08:00
commit 35909ae42c
8 changed files with 313 additions and 169 deletions

View File

@ -56,6 +56,7 @@ export const discSpinningdraw = (data) => {
}) })
} }
export const selectUserMoney = (data) => { export const selectUserMoney = (data) => {
return http.request({ return http.request({
url: '/moneyDetails/selectUserMoney', url: '/moneyDetails/selectUserMoney',

View File

@ -7,6 +7,14 @@ export const selectTaskCenter = (data) => {
data data
}) })
} }
// 兑换列表
export const selectTaskCenterUserReward = (data) => {
return http.request({
url: '/taskCenterReward/selectTaskCenterUserReward',
data,
isreturm:true
})
}
// 获取签到 // 获取签到
export const getUserSignData = (data) => { export const getUserSignData = (data) => {
return http.request({ return http.request({
@ -14,6 +22,12 @@ export const getUserSignData = (data) => {
data data
}) })
} }
export const receiveGoods = (data) => {
return http.request({
url: 'taskCenter/receiveGoods',
data
})
}
// 任务-签到 // 任务-签到
export const taskReceive = (data) => { export const taskReceive = (data) => {
return http.request({ return http.request({

View File

@ -58,7 +58,7 @@ function commonsProcess(showLoading, httpReqCallback, isreturm) {
// 避免混淆重新命名 // 避免混淆重新命名
let bodyData = data; let bodyData = data;
if (isreturm) { if (isreturm) {
return Promise.resolve(bodyData.data || bodyData.page || bodyData); return Promise.resolve(bodyData);
} }
if (statusCode == 500) { if (statusCode == 500) {
isShowErrorToast = true; isShowErrorToast = true;

View File

@ -9,14 +9,12 @@
<image class="img" src="/static/logo.png" mode="widthFix"></image> <image class="img" src="/static/logo.png" mode="widthFix"></image>
</view> </view>
<view class="quick-menu"> <view class="quick-menu">
<image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit" @click="linkTo('/pages/share/index')"></image> <image class="icon" src="/static/me/logo_btn1.png" mode="aspectFit" @click="linkTo('/pages/share/index', true)"></image>
<image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit" @click="linkTo('/pages/me/message', true)"></image> <image class="icon" src="/static/me/logo_btn2.png" mode="aspectFit" @click="linkTo('/pages/me/message', true)"></image>
<navigator hover-class="none" url="/pages/me/contact"> <image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit" @click="linkTo('/pages/me/contact', true)"></image>
<image class="icon" src="/static/me/logo_btn3.png" mode="aspectFit"></image>
</navigator>
</view> </view>
</view> </view>
<view class="top" @click="linkTo('/pages/me/userInfo')"> <view class="top" @click="linkTo(userInfo.phone?'/pages/me/userInfo':'/pages/login/login')">
<image class="avatar" :src="userInfo.avatar || '/static/default_avatar.png'" mode="aspectFill"></image> <image class="avatar" :src="userInfo.avatar || '/static/default_avatar.png'" mode="aspectFill"></image>
<view class="info-wrap"> <view class="info-wrap">
<view class="name">{{ userInfo.phone || '请登录' }}</view> <view class="name">{{ userInfo.phone || '请登录' }}</view>
@ -31,7 +29,7 @@
<view class="title">我的追剧</view> <view class="title">我的追剧</view>
<view class="num">{{ likeData.collectCount }}</view> <view class="num">{{ likeData.collectCount }}</view>
</navigator> </navigator>
<view class="item" v-if="$common.isIosExamine()" @click="linkTo('/pages/me/withdraw/index')"> <view class="item" v-if="$common.isIosExamine()" @click="linkTo('/pages/me/withdraw/index', true)">
<view class="title">我的红包</view> <view class="title">我的红包</view>
<view class="num">{{ amount || 0 }}</view> <view class="num">{{ amount || 0 }}</view>
</view> </view>
@ -43,16 +41,18 @@
<image class="icon" src="/static/me/gold_icon.png" mode="aspectFit"></image> <image class="icon" src="/static/me/gold_icon.png" mode="aspectFit"></image>
<view class="num">{{ gold }}</view> <view class="num">{{ gold }}</view>
</view> </view>
<navigator hover-class="none" url="/pages/me/gold_record"> <div @click="linkTo('/pages/me/gold_record', true)">
<view class="btn">金币明细</view> <view class="btn">金币明细</view>
</navigator> </div>
</view> </view>
<navigator class="title-wrap" hover-class="none" url="/pages/watching_history/watching_history?type=3"> <div class="title-wrap" @click="linkTo('/pages/watching_history/watching_history?type=3', true)">
<view class="a"> <view class="a">
<view class="t">观看历史</view> <view class="t">观看历史</view>
<up-icon name="arrow-right"></up-icon> <up-icon name="arrow-right"></up-icon>
</view> </view>
</navigator> </div>
<view class="history-list"> <view class="history-list">
<view <view
class="item" class="item"
@ -111,19 +111,21 @@
<script setup> <script setup>
import { ref, reactive } from 'vue'; import { ref, reactive } from 'vue';
import { onLoad, onShow, onPullDownRefresh } from '@dcloudio/uni-app'; import { onLoad,onShow, onPullDownRefresh } from '@dcloudio/uni-app';
import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js'; import { selectByUserId, collectVideoSummary, selectUserMoney } from '@/api/me/me.js';
import { linkTo } from '@/utils/app.js'; import { linkTo } from '@/utils/app.js';
import { useCommonStore } from '@/store/common.js'; import {
const $common = useCommonStore(); useCommonStore
} from '@/store/common.js'
const $common = useCommonStore()
const userInfo = ref({}); const userInfo = ref({});
// //
const recordThree = ref([]); const recordThree = ref([]);
onShow(() => { onShow(()=>{
// ios // ios
$common.init(); $common.init()
}); })
async function selectByUserIdAjax() { async function selectByUserIdAjax() {
try { try {
const res = await selectByUserId({ page: 1, limit: 3, classify: 3 }); const res = await selectByUserId({ page: 1, limit: 3, classify: 3 });
@ -177,11 +179,14 @@ onPullDownRefresh(async () => {
}, 500); }, 500);
}); });
onShow(() => { onLoad(() => {
selectByUserIdAjax(); if(uni.getStorageSync('token')){
collectVideoSummaryAjax(); selectByUserIdAjax();
selectUserMoneyAjax(); collectVideoSummaryAjax();
userInfo.value = uni.getStorageSync('userInfo'); selectUserMoneyAjax();
userInfo.value = uni.getStorageSync('userInfo');
}
}); });
</script> </script>

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="container"> <view class="container">
<view class="list"> <view class="list">
<view class="item" @click="linkTo('/pages/login/bind')"> <view class="item" @click="linkTo('/pages/login/bind',true)">
<view class="title">修改手机号</view> <view class="title">修改手机号</view>
<up-icon name="arrow-right" /> <up-icon name="arrow-right" />
</view> </view>
@ -9,7 +9,7 @@
<view class="title">帮助中心</view> <view class="title">帮助中心</view>
<up-icon name="arrow-right" /> <up-icon name="arrow-right" />
</view> </view>
<view class="item" @click="linkTo('/pages/me/feedback')"> <view class="item" @click="linkTo('/pages/me/feedback',true)">
<view class="title">意见反馈</view> <view class="title">意见反馈</view>
<up-icon name="arrow-right" /> <up-icon name="arrow-right" />
</view> </view>
@ -21,7 +21,7 @@
<view class="title">隐私协议</view> <view class="title">隐私协议</view>
<up-icon name="arrow-right" /> <up-icon name="arrow-right" />
</view> </view>
<view class="item" @click="logout"> <view class="item" @click="logout" v-if="token">
<view class="title">退出登录</view> <view class="title">退出登录</view>
<up-icon name="arrow-right" /> <up-icon name="arrow-right" />
</view> </view>
@ -36,6 +36,7 @@ import { linkTo } from '@/utils/app.js';
import { onLoad } from '@dcloudio/uni-app'; import { onLoad } from '@dcloudio/uni-app';
const version = ref(''); const version = ref('');
const token = ref('');
// 退 // 退
function logout() { function logout() {
@ -54,6 +55,7 @@ function logout() {
} }
onLoad(() => { onLoad(() => {
token.value = uni.getStorageSync('token');
const systemInfo = uni.getSystemInfoSync(); const systemInfo = uni.getSystemInfoSync();
//#ifdef APP-PLUS //#ifdef APP-PLUS
version.value = systemInfo.appWgtVersion; version.value = systemInfo.appWgtVersion;

View File

@ -12,11 +12,35 @@
</view> </view>
<view class="cell " v-for="(item, index) in datas.list" :key="index"> <view class="cell " v-for="(item, index) in datas.list" :key="index">
<view class="cell_left "> <view class="cell_left ">
<image class="cell_icon" :src="item.url"></image> <image class="cell_icon" :src="item.img"></image>
<view class="cell_title "> <view class="cell_title ">
<view class=" title">{{ item.name }}</view> <view class=" title">{{ item.name }}</view>
</view> </view>
</view> </view>
<view class="cell_right" v-if="datas.standard=='true'">
<viwe v-if="!datas.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"
style=" width: 32rpx!important;height: 36rpx!important;position: absolute; right: 0;bottom: 0;"
src="@/static/task/receive2.png"></u-image>
</view>
</view>
</view>
<image v-else src="@/static/task/receive1.png"
style="width: 130rpx!important;height: 130rpx!important;position: absolute; right: 0;bottom: 0;"
mode=""></image>
</view> </view>
</view> </view>
@ -25,169 +49,267 @@
</template> </template>
<script setup> <script setup>
import { reactive, ref, onMounted, onUnmounted, getCurrentInstance } from 'vue' import {
import { reactive,
onLoad ref,
} from '@dcloudio/uni-app' onMounted,
import { selectDiscSpinning } from '@/api/task/index.js' onUnmounted,
let datas = reactive({ getCurrentInstance
list: [], } from 'vue'
source: null import {
onLoad
} from '@dcloudio/uni-app'
import {
selectTaskCenterUserReward
} from '@/api/task/index.js'
let datas = reactive({
list: [],
source: null,
standard: true,
receive: null,
record: null,
taskId: "",
}) })
onLoad(options => { onLoad(options => {
datas.source = options.source console.log(options, '调试1')
getList() if (options.source) {
}) datas.source = options.source
}
if (options.standard) {
datas.standard = options.standard
}
if (options.taskId) {
datas.taskId = options.taskId
}
getList()
})
//
function toDuiHuan(item) {
uni.navigateTo({
url: `/pages/index/prizeDraw/duihuan?id=${datas.record}&foreignType=task`
})
}
/**
* 领取
*/
async function taskReceive(item) {
let res = await receiveGoods({
taskId: datas.taskId,
sourceId: item.id
})
uni.showToast({
title: '领取成功',
icon: 'none'
})
getList()
}
async function getList() {
let res = await selectTaskCenterUserReward({
taskId: datas.taskId
})
if (res.code == 0) {
datas.list = res.data
datas.list.map(item => {
item.disabled = true
})
datas.receive = res.receive
datas.record = res.record
if (datas.receive) {
datas.list.map(item => {
if (item.id == datas.receive) {
item.disabled = false
}
})
}
async function getList() { }
let res = await selectDiscSpinning({ source: datas.source }) }
datas.list = res.records
}
</script> </script>
<style lang="scss"> <style lang="scss">
.container { .container {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
// display: flex;
// flex-direction: column;
.task_bg {
width: 100% !important;
height: 470rpx !important;
position: relative; position: relative;
.title { // display: flex;
width: 314rpx; // flex-direction: column;
height: 72rpx; .task_bg {
line-height: 72rpx; width: 100% !important;
text-align: center; height: 470rpx !important;
border-radius: 108rpx 108rpx 108rpx 108rpx; position: relative;
border: 6rpx solid #3D6DC6;
font-weight: bold;
font-size: 34rpx;
color: #3D6DC6;
position: absolute;
top: 210rpx;
left: 26rpx;
}
}
.content { .title {
color: #666666; width: 314rpx;
height: calc(100% - 410rpx); height: 72rpx;
border-radius: 16rpx; line-height: 72rpx;
top: -60rpx; text-align: center;
z-index: 9; border-radius: 108rpx 108rpx 108rpx 108rpx;
padding: 64rpx 28rpx; border: 6rpx solid #3D6DC6;
background: linear-gradient(-45deg, #DDEAFC 0%, #FFFFFF 100%); font-weight: bold;
border-radius: 32rpx 32rpx 0rpx 0rpx; font-size: 34rpx;
overflow-y: auto; color: #3D6DC6;
position: relative; position: absolute;
top: 210rpx;
>.title { left: 26rpx;
display: flex;
align-items: center;
font-weight: bold;
font-size: 32rpx;
color: #333333;
margin-bottom: 22rpx;
.tip {
font-weight: 400;
font-size: 24rpx;
color: #666666;
margin-left: 10rpx;
} }
} }
.cell { .content {
display: flex; color: #666666;
align-items: center; height: calc(100% - 410rpx);
justify-content: space-between; border-radius: 16rpx;
background: linear-gradient(90deg, #FFF4E0 0%, #FFFBF5 100%); top: -60rpx;
border-radius: 8rpx 8rpx 8rpx 8rpx; z-index: 9;
margin-bottom: 32rpx; padding: 64rpx 28rpx;
padding: 32rpx 28rpx; background: linear-gradient(-45deg, #DDEAFC 0%, #FFFFFF 100%);
border-radius: 32rpx 32rpx 0rpx 0rpx;
overflow-y: auto;
position: relative;
.cell_left { >.title {
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
font-weight: bold;
font-size: 32rpx;
color: #333333;
margin-bottom: 22rpx;
.cell_icon { .tip {
width: 84rpx !important; font-weight: 400;
height: 84rpx !important;
margin-right: 30rpx;
border-radius: 4rpx !important;
}
.cell_title {
display: flex;
align-items: center;
color: #333;
.title {
font-weight: bold;
font-size: 28rpx;
color: #333333;
}
.tip {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
}
}
.cell_right {
flex-direction: column;
align-items: center;
flex-shrink: 0;
margin-left: 20rpx;
.btn {
width: 148rpx;
height: 56rpx;
line-height: 56rpx;
text-align: center;
background: #6DA9F7;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500;
font-size: 24rpx; font-size: 24rpx;
color: #FFFFFF; color: #666666;
border: 2rpx solid transparent; margin-left: 10rpx;
}
.opt {
color: #D39B7E;
background-color: #FBF3EB;
}
.disabled {
color: #999999;
background-color: #E2E2E2;
}
.receive {
background: rgba(178, 223, 255, 0.62);
border: 2rpx solid #6DA9F7;
color: #6DA9F7;
} }
} }
.cell {
display: flex;
align-items: center;
justify-content: space-between;
background: linear-gradient(90deg, #FFF4E0 0%, #FFFBF5 100%);
border-radius: 8rpx 8rpx 8rpx 8rpx;
margin-bottom: 32rpx;
padding: 32rpx 28rpx;
position: relative;
.cell_left {
display: flex;
flex-direction: row;
align-items: center;
.cell_icon {
width: 84rpx !important;
height: 84rpx !important;
margin-right: 30rpx;
border-radius: 4rpx !important;
}
.cell_title {
display: flex;
align-items: center;
color: #333;
.title {
font-weight: bold;
font-size: 28rpx;
color: #333333;
}
.tip {
font-weight: 400;
font-size: 24rpx;
color: #999999;
}
}
}
.cell_right {
flex-direction: column;
align-items: center;
flex-shrink: 0;
margin-left: 20rpx;
.btn {
width: 148rpx;
height: 56rpx;
line-height: 56rpx;
text-align: center;
background: #6DA9F7;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
border: 2rpx solid transparent;
}
.opt {
color: #D39B7E;
background-color: #FBF3EB;
}
.disabled {
color: #999999;
background-color: #E2E2E2;
}
.receive {
background: rgba(178, 223, 255, 0.62);
border: 2rpx solid #6DA9F7;
color: #6DA9F7;
}
}
}
.cell:last-child {
border-bottom: none;
}
} }
.cell:last-child {
border-bottom: none; .cell_right {
flex-direction: column;
align-items: center;
flex-shrink: 0;
margin-left: 20rpx;
.btn {
width: 148rpx;
height: 56rpx;
line-height: 56rpx;
text-align: center;
background: #6DA9F7;
border-radius: 12rpx 12rpx 12rpx 12rpx;
font-weight: 500;
font-size: 24rpx;
color: #FFFFFF;
border: 2rpx solid transparent;
position: relative;
z-index: 99;
}
.opt {
color: #D39B7E;
background-color: #FBF3EB;
}
.disabled {
color: #999999;
background-color: #E2E2E2;
}
.receive {
background: rgba(178, 223, 255, 0.62);
border: 2rpx solid #6DA9F7;
color: #6DA9F7;
}
} }
} }
}
</style> </style>

BIN
static/task/receive1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
static/task/receive2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB