2025 02 19 工作代码提交

榴莲果树兑换和样式 卷轴兑换流程
This commit is contained in:
sx 2025-02-19 16:54:49 +08:00
parent 0084fe8aa1
commit 0ee1576f8b
11 changed files with 382 additions and 294 deletions

View File

@ -34,6 +34,7 @@ export const durian = {
url: `/coreplay/duriantreeinfo/boughtListByUser`, url: `/coreplay/duriantreeinfo/boughtListByUser`,
method: 'GET', method: 'GET',
query: param.query, query: param.query,
load: true,
}) })
}, },
/** /**

View File

@ -99,6 +99,7 @@ const intergral = {
method: 'POST', method: 'POST',
query: param.query, query: param.query,
data: param.data, data: param.data,
load: true,
}) })
}, },

View File

@ -47,7 +47,7 @@
<view class="task pr mtb30 ptb20 plr40 f28 bFFFBF3 br20"> <view class="task pr mtb30 ptb20 plr40 f28 bFFFBF3 br20">
<view class="title c333 f36" v-if="task.taskType === 0">任务读秒</view> <view class="title c333 f36" v-if="task.taskType === 0">任务读秒</view>
<view class="title c333 f36" v-else>有效读秒</view> <view class="title c333 f36" v-else>有效读秒</view>
<view>{{task.viewingDuration}}</view> <!-- <view>{{task.viewingDuration}}</view> -->
<view class="progressBox oh bar mt60"> <view class="progressBox oh bar mt60">
<view class="progress bar" :style="{width: progress + '%'}"></view> <view class="progress bar" :style="{width: progress + '%'}"></view>

View File

@ -240,7 +240,7 @@
{ {
"path": "pages/index/durainActivation", "path": "pages/index/durainActivation",
"style": { "style": {
"navigationBarTitleText": "已激活", "navigationBarTitleText": "我的榴莲果树",
"navigationBarBackgroundColor": "#fff" "navigationBarBackgroundColor": "#fff"
} }
}, },

View File

@ -34,7 +34,23 @@
function buyDurianList() { function buyDurianList() {
api.durian.buyDurianList({}).then(rs => { api.durian.buyDurianList({}).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
//
treeData.value = rs.data.dataList.map(item => { treeData.value = rs.data.dataList.map(item => {
// orderType 0 1
item.style = {
'0': {
1: 'scroll1',
2: 'scroll2',
3: 'scroll3',
4: 'scroll4',
} [item.durianConfigId],
'1': {
1: 'buy1',
2: 'buy2',
3: 'buy3',
4: 'buy4',
} [item.durianConfigId],
} [item.orderType]
item.formatHash = formatStr(item.treeHash) item.formatHash = formatStr(item.treeHash)
return item return item
}) })
@ -83,20 +99,21 @@
<view class="appbw"> <view class="appbw">
<!-- --> <!-- -->
<view class="list mlr40"> <view class="list mlr40">
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index" <view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index" @click="handleDetail(item)"
@click="handleDetail(item)"> :class="item.style">
<image class="wh180 fs0" src="/static/tree.png" mode="aspectFit" /> <image class="wh180 fs0" src="/static/tree.png" mode="aspectFit" />
<view class="col f1 ml30 mtb30 c333 f26"> <view class="col f1 ml30 mtb30 c333 f26">
<view class="txt mtb10">每日可释放{{item.release}}</view> <view class="txt mtb10">每日可释放{{item.releasableDaily}}</view>
<view class="txt mtb10">剩余可释放{{item.remainFruitCount}}</view> <view class="txt mtb10">剩余可释放{{item.remainFruitCount}}</view>
<view class="txt mtb10">当前级别{{item.treeName}}</view> <view class="txt mtb10">当前级别{{item.treeName}}</view>
<view class="txt mtb10" @click.stop="util.copyText(item.treeHash)"> <view class="txt mtb10" @click.stop="util.copyText(item.treeHash)">
<text>哈希值 {{item.formatHash}}</text> <text>哈希值 {{item.formatHash}}</text>
<image class="wh20 ml10" src="/static/copy.png" mode="aspectFit" /> <image class="wh20 ml10" src="/static/copy.png" mode="aspectFit" />
</view> </view>
</view> </view>
</view> </view>
<view class="tac c999 f40 mt80" v-if="!treeData[0]">当前暂无榴莲果树~</view>
</view> </view>
<!-- 填充 --> <!-- 填充 -->
@ -107,20 +124,44 @@
<style lang="scss"> <style lang="scss">
// //
.list { .list {
//
.item { .item {
background-color: #F4F4F4; background-color: #F4F4F4;
} }
.item+.item:nth-child(3n+1) { //
background-color: #F4CAFF; .scroll1 {
background-color: #F4F4F4;
} }
.item+.item:nth-child(3n+2) { .scroll2 {
background-color: #E4FBFF; background-color: #E4FBFF;
} }
.item+.item:nth-child(3n+3) { .scroll3 {
background-color: #CACDFF; background-color: #CACDFF;
} }
.scroll4 {
background-color: #F4CAFF;
}
//
.buy1 {
background-color: rgb(225, 253, 204);
}
.buy2 {
background-color: #FFF0B1;
}
.buy3 {
background-color: #CAF0F3;
}
.buy4 {
background-color: #FBC5C5;
}
} }
</style> </style>

View File

@ -1,229 +1,237 @@
<script setup> <script setup>
/** /**
* 榴莲首页 * 榴莲首页
*/ */
import { import {
useStore, useStore,
} from 'vuex' } from 'vuex'
import { import {
onMounted, onMounted,
ref, ref,
reactive, reactive,
computed, computed,
getCurrentInstance, getCurrentInstance,
watch, watch,
defineExpose, defineExpose,
} from 'vue'; } from 'vue';
import { import {
onLoad, onLoad,
onReady, onReady,
onHide, onHide,
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
// //
import noLogin from '@/components/login/noLogin.vue' import noLogin from '@/components/login/noLogin.vue'
// //
import util from '@/common/js/util.js' import util from '@/common/js/util.js'
// //
import task from '@/components/index/task' import task from '@/components/index/task'
// //
import api from '@/api/index.js' import api from '@/api/index.js'
// //
import payPwd from '@/components/mine/payPwd.vue' import payPwd from '@/components/mine/payPwd.vue'
const { const {
proxy proxy
} = getCurrentInstance() } = getCurrentInstance()
// //
const store = useStore() const store = useStore()
// //
const form = reactive({ const form = reactive({
// ID // ID
targetUserId: '', targetUserId: '',
// //
account: '', account: '',
// //
fruitAmount: '', fruitAmount: '',
// //
first: '', first: '',
// //
name: '', name: '',
// //
secondPassword: '', secondPassword: '',
})
//
const viewData = ref({
seconds: 0
})
//
const userinfo = computed(() => {
return store.state.userinfo
})
//
const progress = computed(() => {
let result = viewData.value.seconds
result = Math.min(Number(result), 100)
return result
})
//
const purse = computed(() => {
return store.state.purse || {}
})
//
const configData = reactive({
minConsumption: '',
platformPercentage: ''
})
onReady(() => {
// proxy.$refs.dealRef.open()
// proxy.$refs.payPwdRef.open()
})
onLoad(() => {
//
util.getPurse()
getConfig()
})
//
function handleSubmit() {
//
if (!form.account) {
util.alert('请输入账号')
return
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
// id
api.mine.getUserDataByAccount({
query: {
account: form.account,
},
}).then(rs => {
if (rs.code === 200) {
const result = rs.data
// id
form.targetUserId = result.userName
form.name = result.userRealName.slice(1, result.userRealName.length)
//
proxy.$refs.payee.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}) })
} //
const viewData = ref({
// seconds: 0
function handlePayeeConfirm() { })
// //
if (!form.first) { const userinfo = computed(() => {
util.alert('请输入对方姓名首字母') return store.state.userinfo
return })
} //
const progress = computed(() => {
api.durian.nameComparison({ let result = viewData.value.seconds
query: { result = Math.min(Number(result), 100)
// return result
account: form.account, })
// //
name: `${form.first}${form.name}`, const purse = computed(() => {
} return store.state.purse || {}
}).then(rs => {
if (rs.code == 200) {
if (rs.data) proxy.$refs.payPwdRef.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}) })
}
/** //
* 交易 const configData = reactive({
* @param {Object} ev 二级密码 minConsumption: '',
*/ platformPercentage: ''
function handlePwdConfirm(ev) { })
//
if (!form.first) { onReady(() => {
util.alert('请输入对方姓名首字母') // proxy.$refs.dealRef.open()
return // proxy.$refs.payPwdRef.open()
} })
if (!form.first) {
util.alert('请输入对方姓名首字母') onLoad(() => {
return //
} util.getPurse()
if (!form.account) {
util.alert('请输入账号') getConfig()
return })
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
// //
api.durian.consume({ function handleSubmit() {
data: { //
// if (!form.account) {
userId: userinfo.value.id, util.alert('请输入账号')
// id
targetUserId: form.targetUserId,
//
transactionType: 10,
//
fruitAmount: form.fruitAmount,
//
name: `${form.first}${form.name}`,
//
account: form.account,
//
secondPassword: ev
}
}).then(rs => {
if (rs.code === 200) {
//
util.getPurse()
return return
} }
util.alert({ if (!form.fruitAmount) {
content: rs.msg, util.alert('请输入榴莲果转账数量')
showCancel: false, return
})
})
}
//
function navigateToPage(path) {
uni.navigateTo({
url: path
})
}
//
function getConfig() {
api.durian.durianFruitConfig().then(rs => {
if (rs.code == 200) {
configData.minConsumption = rs.data.minConsumption
configData.platformPercentage = +rs.data.platformPercentage * 100
return;
} }
util.alert({
content: rs.msg, //
showCancel: false, const min = parseFloat(configData.minConsumption)
const price = parseFloat(form.fruitAmount)
if (price < min) {
util.alert(`榴莲果最低${min}起转`)
return
}
// id
api.mine.getUserDataByAccount({
query: {
account: form.account,
},
}).then(rs => {
if (rs.code === 200) {
const result = rs.data
// id
form.targetUserId = result.userName
form.name = result.userRealName.slice(1, result.userRealName.length)
//
proxy.$refs.payee.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
}) })
}) }
}
//
function handlePayeeConfirm() {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
api.durian.nameComparison({
query: {
//
account: form.account,
//
name: `${form.first}${form.name}`,
}
}).then(rs => {
if (rs.code == 200) {
if (rs.data) proxy.$refs.payPwdRef.open()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
/**
* 交易
* @param {Object} ev 二级密码
*/
function handlePwdConfirm(ev) {
//
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
if (!form.first) {
util.alert('请输入对方姓名首字母')
return
}
if (!form.account) {
util.alert('请输入账号')
return
}
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
return
}
//
api.durian.consume({
data: {
//
userId: userinfo.value.id,
// id
targetUserId: form.targetUserId,
//
transactionType: 10,
//
fruitAmount: form.fruitAmount,
//
name: `${form.first}${form.name}`,
//
account: form.account,
//
secondPassword: ev
}
}).then(rs => {
if (rs.code === 200) {
//
util.getPurse()
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
//
function navigateToPage(path) {
uni.navigateTo({
url: path
})
}
//
function getConfig() {
api.durian.durianFruitConfig().then(rs => {
if (rs.code == 200) {
configData.minConsumption = rs.data.minConsumption
configData.platformPercentage = +rs.data.platformPercentage * 100
return
}
util.alert({
content: rs.msg,
showCancel: false,
})
})
}
</script> </script>
<template> <template>
@ -304,8 +312,8 @@ function getConfig() {
<!-- 互转 --> <!-- 互转 -->
<uni-popup ref="dealRef" type="center"> <uni-popup ref="dealRef" type="center">
<view class="dealAlt popMid ptb40 plr60 bfff br30"> <view class="dealAlt popMid ptb40 plr60 bfff br30">
<view class="title tac c333 f28">榴莲果互转</view> <view class="title thd tac c333 f32"> 当前可用榴莲果 {{purse.fruit}}</view>
<view class="content rows mtb10"> <view class="content rows mtb30">
<image class="wh140" src="/static/fruit.png" mode="aspectFit" /> <image class="wh140" src="/static/fruit.png" mode="aspectFit" />
<image class="wh70" src="/static/dealMid.png" mode="aspectFit" /> <image class="wh70" src="/static/dealMid.png" mode="aspectFit" />
<image class="wh140" src="/static/dealUser.png" mode="aspectFit" /> <image class="wh140" src="/static/dealUser.png" mode="aspectFit" />
@ -335,10 +343,12 @@ function getConfig() {
<view class="mtb20 f28">请补全对方姓名首字以防转错</view> <view class="mtb20 f28">请补全对方姓名首字以防转错</view>
<view class="inputBox rows mauto mtb20 plr30"> <view class="inputEdit rows mauto mtb20 plr30">
<input class="first" v-model.trim="form.first" type="text" placeholder="" /> <input class="first side" v-model.trim="form.first" type="text" placeholder="" />
<view class="">*</view> <view class="mlr20">*</view>
<view class="f1 tar">{{ form.name }}</view> <view class="side tar">
<text v-if="0">{{ form.name }}</text>
</view>
</view> </view>
<view class="rows mt50"> <view class="rows mt50">
@ -354,64 +364,67 @@ function getConfig() {
</template> </template>
<style lang="scss"> <style lang="scss">
// //
.board { .board {
background-image: linear-gradient(103deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%); background-image: linear-gradient(103deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
//
.bgColor {
background-color: #FFFBF3;
border-radius: 20rpx;
}
.explain {
.button {
width: 250rpx;
margin-left: 0;
} }
}
// //
.sapling { .bgColor {
.button { background-color: #FFFBF3;
width: 300rpx; border-radius: 20rpx;
} }
}
// .explain {
.durianSection { .button {
width: 250rpx;
// margin-left: 0;
.notice {
.key {
width: 140rpx;
height: 70rpx;
color: #fff;
background: linear-gradient(99deg, #27efe2 0%, #a45eff 43%, #ff004f 100%), linear-gradient(108deg, #d7f550 -2%, #afef4d 98%);
border-radius: 100rpx;
} }
} }
}
// //
.dealAlt { .sapling {
.hint { .button {
color: #3d3d3d; width: 300rpx;
opacity: .7; }
}
}
//
.payee {
.inputBox {
width: 120rpx;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .2);
} }
.first { //
width: 50rpx; .durianSection {
//
.notice {
.key {
width: 140rpx;
height: 70rpx;
color: #fff;
background: linear-gradient(99deg, #27efe2 0%, #a45eff 43%, #ff004f 100%), linear-gradient(108deg, #d7f550 -2%, #afef4d 98%);
border-radius: 100rpx;
}
}
}
//
.dealAlt {
.hint {
color: #3d3d3d;
opacity: .7;
}
}
//
.payee {
//
.side {
width: 80rpx;
}
//
.first {
padding: 20rpx;
background-color: #f4f4f4;
border-radius: 20rpx;
}
} }
}
</style> </style>

View File

@ -58,6 +58,12 @@
// //
dataList.value = result.dataList.map(item => { dataList.value = result.dataList.map(item => {
item.formatHash = item.scrollHash.replace(/(\d{4})\d*(\d{4})/, "$1****$2") item.formatHash = item.scrollHash.replace(/(\d{4})\d*(\d{4})/, "$1****$2")
// item.style = {
// '1': 'scroll1',
// '2': 'scroll2',
// '3': 'scroll3',
// '4': 'scroll4',
// } [item.scrollName]
return item return item
}) })
return return
@ -117,7 +123,6 @@
* @param {Object} item 当前对象 * @param {Object} item 当前对象
*/ */
function handleCopy(item) { function handleCopy(item) {
// scrollHash
util.copyText(item.scrollHash) util.copyText(item.scrollHash)
} }
</script> </script>
@ -129,8 +134,9 @@
<view class="value mt5 ptb5 plr20 tac br10">{{total}}</view> <view class="value mt5 ptb5 plr20 tac br10">{{total}}</view>
</view> </view>
<view v-for="(item, index) in dataList" :key="item.id" @click="handleDetail(item)"> <view class="listBox">
<view class="board pr oh mtb30 mlr30 ptb20 plr20 cfff f30 br20"> <view class="board pr oh mtb30 mlr30 ptb20 plr20 cfff f30 br20" v-for="(item, index) in dataList"
:key="item.id" @click="handleDetail(item)">
<view class=" df"> <view class=" df">
<view class="left f1 mr40"> <view class="left f1 mr40">
<view class="key mt20 f32">卷轴可释放</view> <view class="key mt20 f32">卷轴可释放</view>
@ -183,6 +189,25 @@
background-color: #333; background-color: #333;
} }
//
// .listBox {
// .scroll1 {
// background-color: #F4F4F4;
// }
// .scroll2 {
// background-color: #E4FBFF;
// }
// .scroll3 {
// background-color: #CACDFF;
// }
// .scroll4 {
// background-color: #F4CAFF;
// }
// }
// //
.board { .board {
background-image: linear-gradient(121deg, #27EFE2 0%, #A45EFF 43%, #FF004F 99%); background-image: linear-gradient(121deg, #27EFE2 0%, #A45EFF 43%, #FF004F 99%);

View File

@ -157,7 +157,8 @@
<!-- 一级 --> <!-- 一级 -->
<view class="li mtb30" v-for="(item,index) in team.sonUser" :key="item.id"> <view class="li mtb30" v-for="(item,index) in team.sonUser" :key="item.id">
<view class="menber df aic"> <view class="menber df aic">
<view class="c333 f32">{{item.userNickname}}</view> <view class="count mr20 plr10 cfff br10" v-if="item.isShop == 1"></view>
<view class="c333 f32">{{item.userNickname}}{{item.isShop}}</view>
<template v-if="item.sonList[0]"> <template v-if="item.sonList[0]">
<uni-icons @click="lowTeam(item)" type="up" color="#A45EFF" size="28rpx" <uni-icons @click="lowTeam(item)" type="up" color="#A45EFF" size="28rpx"
v-if="item.showSecond" /> v-if="item.showSecond" />
@ -178,7 +179,7 @@
<view class="content df aic f1 ptb10"> <view class="content df aic f1 ptb10">
<view class="line"></view> <view class="line"></view>
<view class="ml10 df aic c999 f28"> <view class="ml10 df aic c999 f28">
<view class="count mr20 plr10 cfff br10" v-if="secItem.isShop"></view> <view class="count mr20 plr10 cfff br10" v-if="secItem.isShop == 1"></view>
<view class="name">{{secItem.userNickname}}</view> <view class="name">{{secItem.userNickname}}</view>
<view class="label ml10">{{secItem.count}}</view> <view class="label ml10">{{secItem.count}}</view>
</view> </view>
@ -221,6 +222,12 @@
.team { .team {
background-color: #FFFBF3; background-color: #FFFBF3;
//
.count {
font-size: 28rpx;
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
// //
.list { .list {
padding-left: .5em; padding-left: .5em;
@ -259,11 +266,6 @@
// background-clip: text; // background-clip: text;
// text-fill-color: transparent; // text-fill-color: transparent;
// } // }
//
.count {
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
} }
} }
} }

View File

@ -25,6 +25,7 @@
import { import {
useStore, useStore,
} from 'vuex' } from 'vuex'
// api
import durianlApi from '@/api/durian.js'; import durianlApi from '@/api/durian.js';
const { const {
proxy proxy
@ -50,6 +51,8 @@
buyDurianList() buyDurianList()
// //
util.getPurse() util.getPurse()
//
getArticle()
}) })
onReady(() => { onReady(() => {
@ -117,7 +120,7 @@
function getArticle() { function getArticle() {
api.getArticle({ api.getArticle({
query: { query: {
id: 2, agreementId: 5,
} }
}).then(rs => { }).then(rs => {
if (rs.code == 200) { if (rs.code == 200) {
@ -201,7 +204,7 @@
<view class="content mtb20 mlr25"> <view class="content mtb20 mlr25">
<scroll-view scroll-y="true" class="scroll"> <scroll-view scroll-y="true" class="scroll">
<rich-text :nodes="rule.context"></rich-text> <rich-text :nodes="rule.content"></rich-text>
</scroll-view> </scroll-view>
</view> </view>
</view> </view>

View File

@ -107,7 +107,7 @@
}) })
onReady(() => { onReady(() => {
proxy.$refs.orderDetail.open() // proxy.$refs.orderDetail.open()
}) })
onPullDownRefresh(() => { onPullDownRefresh(() => {

View File

@ -20,6 +20,8 @@
} from 'vuex' } from 'vuex'
// //
import util from '@/common/js/util'; import util from '@/common/js/util';
// api
import api from '@/api/index.js'
// //
const { const {
proxy proxy