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`,
method: 'GET',
query: param.query,
load: true,
})
},
/**

View File

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

View File

@ -47,7 +47,7 @@
<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-else>有效读秒</view>
<view>{{task.viewingDuration}}</view>
<!-- <view>{{task.viewingDuration}}</view> -->
<view class="progressBox oh bar mt60">
<view class="progress bar" :style="{width: progress + '%'}"></view>

View File

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

View File

@ -34,7 +34,23 @@
function buyDurianList() {
api.durian.buyDurianList({}).then(rs => {
if (rs.code == 200) {
//
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)
return item
})
@ -83,20 +99,21 @@
<view class="appbw">
<!-- -->
<view class="list mlr40">
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index"
@click="handleDetail(item)">
<view class="item rows mtb25 br15" v-for="(item,index) in treeData" :key="index" @click="handleDetail(item)"
:class="item.style">
<image class="wh180 fs0" src="/static/tree.png" mode="aspectFit" />
<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.treeName}}</view>
<view class="txt mtb10" @click.stop="util.copyText(item.treeHash)">
<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 class="tac c999 f40 mt80" v-if="!treeData[0]">当前暂无榴莲果树~</view>
</view>
<!-- 填充 -->
@ -107,20 +124,44 @@
<style lang="scss">
//
.list {
//
.item {
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;
}
.item+.item:nth-child(3n+3) {
.scroll3 {
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>

View File

@ -1,229 +1,237 @@
<script setup>
/**
* 榴莲首页
*/
import {
useStore,
} from 'vuex'
import {
onMounted,
ref,
reactive,
computed,
getCurrentInstance,
watch,
defineExpose,
} from 'vue';
/**
* 榴莲首页
*/
import {
useStore,
} from 'vuex'
import {
onMounted,
ref,
reactive,
computed,
getCurrentInstance,
watch,
defineExpose,
} from 'vue';
import {
onLoad,
onReady,
onHide,
} from '@dcloudio/uni-app'
//
import noLogin from '@/components/login/noLogin.vue'
//
import util from '@/common/js/util.js'
//
import task from '@/components/index/task'
//
import api from '@/api/index.js'
//
import payPwd from '@/components/mine/payPwd.vue'
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const form = reactive({
// ID
targetUserId: '',
//
account: '',
//
fruitAmount: '',
//
first: '',
//
name: '',
//
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,
})
import {
onLoad,
onReady,
onHide,
} from '@dcloudio/uni-app'
//
import noLogin from '@/components/login/noLogin.vue'
//
import util from '@/common/js/util.js'
//
import task from '@/components/index/task'
//
import api from '@/api/index.js'
//
import payPwd from '@/components/mine/payPwd.vue'
const {
proxy
} = getCurrentInstance()
//
const store = useStore()
//
const form = reactive({
// ID
targetUserId: '',
//
account: '',
//
fruitAmount: '',
//
first: '',
//
name: '',
//
secondPassword: '',
})
}
//
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,
})
//
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 || {}
})
}
/**
* 交易
* @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
}
//
const configData = reactive({
minConsumption: '',
platformPercentage: ''
})
onReady(() => {
// proxy.$refs.dealRef.open()
// proxy.$refs.payPwdRef.open()
})
onLoad(() => {
//
util.getPurse()
getConfig()
})
//
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()
function handleSubmit() {
//
if (!form.account) {
util.alert('请输入账号')
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;
if (!form.fruitAmount) {
util.alert('请输入榴莲果转账数量')
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>
<template>
@ -304,8 +312,8 @@ function getConfig() {
<!-- 互转 -->
<uni-popup ref="dealRef" type="center">
<view class="dealAlt popMid ptb40 plr60 bfff br30">
<view class="title tac c333 f28">榴莲果互转</view>
<view class="content rows mtb10">
<view class="title thd tac c333 f32"> 当前可用榴莲果 {{purse.fruit}}</view>
<view class="content rows mtb30">
<image class="wh140" src="/static/fruit.png" mode="aspectFit" />
<image class="wh70" src="/static/dealMid.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="inputBox rows mauto mtb20 plr30">
<input class="first" v-model.trim="form.first" type="text" placeholder="" />
<view class="">*</view>
<view class="f1 tar">{{ form.name }}</view>
<view class="inputEdit rows mauto mtb20 plr30">
<input class="first side" v-model.trim="form.first" type="text" placeholder="" />
<view class="mlr20">*</view>
<view class="side tar">
<text v-if="0">{{ form.name }}</text>
</view>
</view>
<view class="rows mt50">
@ -354,64 +364,67 @@ function getConfig() {
</template>
<style lang="scss">
//
.board {
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;
//
.board {
background-image: linear-gradient(103deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
}
//
.sapling {
.button {
width: 300rpx;
//
.bgColor {
background-color: #FFFBF3;
border-radius: 20rpx;
}
}
//
.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;
.explain {
.button {
width: 250rpx;
margin-left: 0;
}
}
}
//
.dealAlt {
.hint {
color: #3d3d3d;
opacity: .7;
}
}
//
.payee {
.inputBox {
width: 120rpx;
box-shadow: 0 0 20rpx rgba(0, 0, 0, .2);
//
.sapling {
.button {
width: 300rpx;
}
}
.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>

View File

@ -58,6 +58,12 @@
//
dataList.value = result.dataList.map(item => {
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
@ -117,7 +123,6 @@
* @param {Object} item 当前对象
*/
function handleCopy(item) {
// scrollHash
util.copyText(item.scrollHash)
}
</script>
@ -129,8 +134,9 @@
<view class="value mt5 ptb5 plr20 tac br10">{{total}}</view>
</view>
<view v-for="(item, index) in dataList" :key="item.id" @click="handleDetail(item)">
<view class="board pr oh mtb30 mlr30 ptb20 plr20 cfff f30 br20">
<view class="listBox">
<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="left f1 mr40">
<view class="key mt20 f32">卷轴可释放</view>
@ -183,6 +189,25 @@
background-color: #333;
}
//
// .listBox {
// .scroll1 {
// background-color: #F4F4F4;
// }
// .scroll2 {
// background-color: #E4FBFF;
// }
// .scroll3 {
// background-color: #CACDFF;
// }
// .scroll4 {
// background-color: #F4CAFF;
// }
// }
//
.board {
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="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]">
<uni-icons @click="lowTeam(item)" type="up" color="#A45EFF" size="28rpx"
v-if="item.showSecond" />
@ -178,7 +179,7 @@
<view class="content df aic f1 ptb10">
<view class="line"></view>
<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="label ml10">{{secItem.count}}</view>
</view>
@ -221,6 +222,12 @@
.team {
background-color: #FFFBF3;
//
.count {
font-size: 28rpx;
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
//
.list {
padding-left: .5em;
@ -259,11 +266,6 @@
// background-clip: text;
// text-fill-color: transparent;
// }
//
.count {
background-image: linear-gradient(114deg, #27EFE2 0%, #A45EFF 43%, #FF004F 100%);
}
}
}
}

View File

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

View File

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

View File

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