调整个人中心页面,会议中心页面,充值页面

This commit is contained in:
2025-09-26 17:57:14 +08:00
parent a39c9f4d72
commit 905d5404f6
20 changed files with 1397 additions and 230 deletions

View File

@@ -7,18 +7,18 @@
<view class="select-shop">
<view class="select-btn">
<up-icon name="map" color="#333"></up-icon>
<text class="t">双屿Pisces</text>
<text class="t">{{shopInfo.shopName}}</text>
<up-icon name="arrow-right" color="#333"></up-icon>
</view>
</view>
<view class="balance-wrap">
<view class="left">
<text class="i t">余额</text>
<text class="n t">12223.53</text>
<text class="n t">{{shopUserInfo.amount}}</text>
</view>
<view class="right">
<text class="t">明细</text>
<text class="t">密码设置</text>
<text class="t" @click="toDetail">明细</text>
<text class="t" @click="toPwd">密码设置</text>
</view>
</view>
<view class="btm-wrap">
@@ -82,7 +82,7 @@
<view>充值说明</view>
<view class="u-m-t-16">
<text>适用门店</text>
<text class="color2 u-m-l-28">全国门店通用 > </text>
<text class="color2 u-m-l-28">全国门店通用 {{'>'}} </text>
</view>
<view class="u-m-t-16">
<text>有效期限</text>
@@ -92,16 +92,16 @@
<text class="no-wrap">注意事项</text>
<view class="u-m-l-28">
<view>1.储值完成后不支持自助退款可联系商家处理</view>
<view> 2.余额不支持转赠不可提现长期有效</view>
<view> 2.余额不支持转赠不可提现长期有效</view>
</view>
</view>
<view class="u-m-t-16 u-flex u-flex-y-center">
<text class="no-wrap">充值说明</text>
<view class="u-m-l-28">
此处显示内容:管理端配置读取智慧充值中充值说明字段内容
{{state.remark||''}}
</view>
</view>
</view>
</view>
@@ -110,35 +110,134 @@
</template>
<script setup>
import * as vipApi from '@/common/api/market/recharge.js'
import {joinMember} from '@/common/api/order/index.js'
import {
ref,onMounted,computed
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
import * as rechargeApi from '@/common/api/market/recharge.js'
import {
recharge
} from '@/common/api/order/index.js'
import {
joinMember
} from '@/common/api/order/index.js'
import {
ref,
onMounted,
computed,
reactive,
watch
} from 'vue'
async function buy(){
const res=await joinMember()
import {
onLoad
} from '@dcloudio/uni-app'
import {
pay
} from '@/utils/pay.js'
async function buy() {
if (!charge_money.value) {
return uni.showToast({
title: '请选择或者输入充值金额',
icon: 'none'
})
}
const json = {
shopId: option.shopId,
shopUserId: shopUserInfo.id,
}
if (sel.value < 0) {
json.amount = `${money.value}`.trim()*1
} else {
json.rechargeDetailId = list.value[sel.value].id
json.amount = list.value[sel.value].amount
}
const res = await recharge(json)
if (!res) {
return uni.showToast({
title: '充值失败',
icon: 'error'
})
}
const payRes = await pay(res)
console.log(payRes);
if (payRes) {
uni.showToast({
title: '充值成功',
icon: 'none'
})
init()
}
}
function toDetail() {
uni.navigateTo({
url: '/pages/user/member/billDetails?type=1&shopId=' + option.shopId
})
}
function toPwd() {
uni.navigateTo({
url: '/pages/user/member/setPassword?type=1&shopId=' + option.shopId
})
}
function back() {
uni.navigateBack();
}
const list = ref([])
const sel = ref(0)
const money = ref(null);
async function init(){
const res=await vipApi.config()
if(res){
list.value=res.rechargeDetailList
const option = reactive({
shopId: ''
})
const shopInfo = reactive({})
const shopUserInfo = reactive({})
const state = reactive({})
async function init() {
const shopInfoRes = await APIusershopInfodetail({
shopId: option.shopId
})
if (shopInfoRes) {
Object.assign(shopInfo, shopInfoRes.shopInfo)
}
const shopUserInfoRes = await APIshopUserInfo({
shopId: option.shopId
})
if (shopUserInfoRes) {
Object.assign(shopUserInfo, shopUserInfoRes)
}
const res = await rechargeApi.config({
shopId: option.shopId
})
if (res) {
Object.assign(state, res)
list.value = res.rechargeDetailList
}
}
const charge_money=computed(()=>{
const item= list.value[sel.value]
if(item){
const charge_money = computed(() => {
if (sel.value < 0) {
if (money.value > 0) {
return money.value
}
return ''
}
const item = list.value[sel.value]
if (item) {
return item.amount
}
return ''
})
onMounted(init)
onLoad((opt) => {
Object.assign(option, opt)
init()
})
watch(() => money.value, (newval) => {
if (newval && newval > 0) {
sel.value = -1
}
})
</script>
<style scoped lang="scss">
@@ -172,7 +271,7 @@
width: 100%;
height: 530rpx;
box-sizing: border-box;
padding: calc(var(--status-bar-height) + 180upx) 28upx 28upx;
padding: calc(var(--status-bar-height) + 140rpx) 28rpx 28rpx;
position: relative;
.bg {