会员,充值,明细,下单问题修复

This commit is contained in:
2025-09-28 17:41:19 +08:00
parent a8c2096096
commit 4245c2be0d
13 changed files with 508 additions and 151 deletions

View File

@@ -25,41 +25,44 @@
</view>
<view class="listStyle " v-for="(item,i) in formData.list" :key="i">
<view class="flex-start">
<view class="color-333 font-16 font-700 u-m-b-16">
<view v-if="formData.active == 1">
<text v-if="item.bizCode == 'cashIn'">
现金充值
</text>
<text v-if="item.bizCode == 'wechatIn'">
微信小程序充值
</text>
<text v-if="item.bizCode == 'alipayIn'">
支付宝小程序充值
</text>
<text v-if="item.bizCode == 'awardIn'">
充值奖励
</text>
<text v-if="item.bizCode == 'rechargeRefund'">
充值退款
</text>
<text v-if="item.bizCode == 'orderPay'">
订单消费
</text>
<text v-if="item.bizCode == 'orderRefund'">
订单退款
</text>
<text v-if="item.bizCode == 'adminIn'">
管理员充值
</text>
<text v-if="item.bizCode == 'adminOut'">
管理员消费
</text>
</view>
<view v-else>
{{item.content}}
</view>
</view>
<view class="listStyle_left">
<view class="listrigth">
<view v-if="formData.active == 1">
<text v-if="item.bizCode == 'cashIn'">
现金充值
</text>
<text v-if="item.bizCode == 'wechatIn'">
微信小程序充值
</text>
<text v-if="item.bizCode == 'alipayIn'">
支付宝小程序充值
</text>
<text v-if="item.bizCode == 'awardIn'">
充值奖励
</text>
<text v-if="item.bizCode == 'rechargeRefund'">
充值退款
</text>
<text v-if="item.bizCode == 'orderPay'">
订单消费
</text>
<text v-if="item.bizCode == 'orderRefund'">
订单退款
</text>
<text v-if="item.bizCode == 'adminIn'">
管理员充值
</text>
<text v-if="item.bizCode == 'adminOut'">
管理员消费
</text>
</view>
<view v-else>
{{item.content}}
</view>
<view class="listrigth color-333 font-14">
<view>{{item.shopName||'门店名称'}}</view>
<view v-if="formData.active == 1" :class="{colorStyle: (item.bizCode == 'cashIn' || item.bizCode == 'wechatIn' ||
item.bizCode == 'alipayIn'|| item.bizCode == 'awardIn'|| item.bizCode == 'rechargeRefund')}">
{{ item.amount }}
@@ -285,11 +288,6 @@
color: #FF7127;
}
>view {
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
}
.listStyle_left {
@@ -304,7 +302,7 @@
}
.listrigth2 {
margin-top: 16rpx;
margin-top: 4rpx;
>view {
font-weight: 500;

View File

@@ -14,7 +14,7 @@
<view class="balance-wrap">
<view class="left">
<text class="i t">余额</text>
<text class="n t">{{shopUserInfo.amount}}</text>
<text class="n t">{{shopUserInfo.amount||0}}</text>
</view>
<view class="right">
<text class="t" @click="toDetail">明细</text>
@@ -43,7 +43,7 @@
:class="{active:sel==index}">
<view class="">
<text></text>
<text class="font-700" style="font-size: 48rpx;"
<text class="font-700" style="font-size: 48 u-flex-1rpx;"
:class="{color2:sel==index}">{{item.amount}}</text>
</view>
<view class="font-12" v-if="item.rewardAmount" :class="{color2:sel==index}">
@@ -51,16 +51,16 @@
<text></text>
<text class="font-14">{{item.rewardAmount}}</text>
</view>
<view class="font-12" v-if="item.rewardPoints">
<view class="font-12" v-if="item.rewardPoints" style="color: #5F2E0F;">
<text></text>
<text></text>
<text class="font-14">{{item.rewardPoints}}</text>
<text class="">积分</text>
</view>
<view class="font-12 color-666" v-if="item.couponInfoList.length">
<text></text>
<text>{{item.couponInfoList.length}}</text>
<text>{{couponNum(item.couponInfoList) }}</text>
<text>张券</text>
<text class="color2 u-m-l-8" v-if="sel==index">查看</text>
<text class="color2 u-m-l-8" v-if="sel==index" @click="lookCoupon(item)">查看</text>
</view>
<view class="sel u-flex" v-if="sel==index">
@@ -68,12 +68,15 @@
</view>
</view>
</view>
<view class="u-flex other flex-center">
<text class="font-14 color-333 font-700 u-m-r-28">其他金额</text>
<up-input v-model="money" type="number" placeholder="请输入充值金额" border="none"
placeholder-style="font-size:14px;"></up-input>
</view>
<view class="color-999 font-12 u-m-t-4">自定义金额充值时不享受任何优惠赠送</view>
<template v-if="state.isCustom">
<view class="u-flex other flex-center">
<text class="font-14 color-333 font-700 u-m-r-28">其他金额</text>
<up-input v-model="money" type="number" placeholder="请输入充值金额" border="none"
placeholder-style="font-size:14px;"></up-input>
</view>
<view class="color-999 font-12 u-m-t-4">自定义金额充值时不享受任何优惠赠送</view>
</template>
<button class="buy-btn" @click="buy">
<text class="font-16 ">{{charge_money}}</text>
<text class="font-14 u-m-l-24">立即充值</text>
@@ -98,14 +101,14 @@
</view>
<view class="u-m-t-16 u-flex u-flex-y-center">
<text class="no-wrap">充值说明</text>
<view class="u-m-l-28">
<text class="u-m-l-28" style="word-break: break-all;">
{{state.remark||''}}
</view>
</text>
</view>
</view>
</view>
<CouponList v-model="couponModel.show" :list="couponModel.couponInfoList"></CouponList>
</view>
</template>
@@ -114,6 +117,7 @@
APIusershopInfodetail,
APIshopUserInfo
} from '@/common/api/member.js'
import CouponList from '@/components/coupon/list.vue'
import * as rechargeApi from '@/common/api/market/recharge.js'
import {
recharge
@@ -134,6 +138,21 @@
import {
pay
} from '@/utils/pay.js'
function couponNum(list) {
return list.reduce((prve, cur) => {
return prve + cur.num
}, 0)
}
const couponModel = reactive({
show: false,
couponInfoList: []
})
function lookCoupon(item) {
couponModel.show = true
couponModel.couponInfoList = item.couponInfoList
}
async function buy() {
if (!charge_money.value) {
return uni.showToast({
@@ -146,7 +165,7 @@
shopUserId: shopUserInfo.id,
}
if (sel.value < 0) {
json.amount = `${money.value}`.trim()*1
json.amount = `${money.value}`.trim() * 1
} else {
json.rechargeDetailId = list.value[sel.value].id
json.amount = list.value[sel.value].amount