This commit is contained in:
ctw committed 2025-01-19 13:57:14 +08:00
commit 1a0396dfd9
7 files changed
+211 -210

No files matched your search

+8 -7
View File
@@ -17,21 +17,22 @@ VITE_PWD_ENC_KEY='pigxpigxpigxpigx'
VITE_OAUTH2_APP_CLIENT='mini:mini'
# 图片访问基础地址
# VITE_IMAGE_BASE_PATH = http://localhost:9999
VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地
#VITE_IMAGE_BASE_PATH = http://localhost:9999
#VITE_IMAGE_BASE_PATH = http://192.168.101.29:9999 # 邓-本地
# VITE_IMAGE_BASE_PATH = http://pjcloud.center.takin.cc # 张
# VITE_IMAGE_BASE_PATH = http://123.156.230.15:8089/api # 线上
VITE_IMAGE_BASE_PATH = http://59.202.170.152:81/api # 信创线上
# ******************** start 开发环境 start ********************
# VITE_APP_DEV_SERVICE =http://123.156.228.134:48080/app-api
# VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/app-api
VITE_APP_DEV_SERVICE = http://192.168.101.29:9999 # 邓-本地
#VITE_APP_DEV_SERVICE = http://pjcloud.center.takin.cc # 张
# VITE_APP_DEV_SERVICE = http://123.156.230.15:8089/api # 线上
#VITE_APP_DEV_SERVICE = http://192.168.101.29:9999 # 邓-本地
VITE_APP_DEV_SERVICE = http://127.0.0.1:9999
# VITE_APP_DEV_SERVICE = http://123.156.230.15:8089/api
# VITE_APP_DEV_SERVICE = http://localhost:9999
# ******************** end 开发环境 end ********************
# ******************** start 生产环境 start ********************
#VITE_APP_PROD_SERVICE = http://123.156.228.134:48080/app-api
VITE_APP_PROD_SERVICE = http://123.156.230.15:8089/api
#VITE_APP_PROD_SERVICE = http://123.156.230.15:8089/api
VITE_APP_PROD_SERVICE = http://59.202.170.152:81/api
# ******************** end 生产环境 end ********************
+3 -3
View File
@@ -15,7 +15,7 @@ const data = {
{ id: 1, name: "未支付", disabled: false },
{ id: 5, name: "待核销", disabled: false },
{ id: 10, name: "售后", disabled: false },
{ id: 15, name: "已核销", disabled: false },
{ id: 20, name: "已核销", disabled: false },
],
}
const state = reactive<any>({
@@ -98,8 +98,8 @@ const doRefund = (v: any) => {
</view>
<tm-tag v-if="v.orderStatus == 1" color="info" size="xs">未支付</tm-tag>
<tm-tag v-if="v.orderStatus == 5" color="success" size="xs">待核销</tm-tag>
<tm-tag v-if="v.orderStatus == 10" color="error" size="xs">售后中</tm-tag>
<tm-tag v-if="v.orderStatus == 15" size="xs">已核销</tm-tag>
<tm-tag v-if="v.orderStatus == 10" color="error" size="xs">售后</tm-tag>
<tm-tag v-if="v.orderStatus == 20" size="xs">已核销</tm-tag>
</view>
<view class="flex-row items-center justify-between m-t-5rpx">
<view class="second-text-20">
+10 -20
View File
@@ -1,33 +1,23 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { hooks } from "@@/index"
import { foodApi } from "@@/api"
const data = {
}
const data = {}
const state = reactive<any>({
pa: {
status: 1,
},
})
onLoad(() => {
});
onShow(() => {
pa: {
status: 1,
},
})
onLoad(() => {})
onShow(() => {})
</script>
<template>
<crud-layout title="订单详情" bg="/static/page/blue-bg.png">
</crud-layout>
<crud-layout title="订单详情" bg="/static/page/blue-bg.png"> </crud-layout>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped></style>
+64 -53
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { hooks } from "@@/index"
@@ -9,72 +9,83 @@ import { walletApi } from "@@/api"
import zTabs from "@@/components/other/z-tabs/z-tabs.vue"
const data = {
tabs: ['全部', '收入', '支出'],
tabs: ["全部", "收入", "支出"],
}
const state = reactive<any>({
walletId: null,
pa: {
createTime: null,
type: 0,
walletId: null
},
walletId: null,
pa: {
createTime: null,
type: 0,
walletId: null,
},
})
onLoad((options: any) => {
if (!isEmpty(options.id)) {
state.walletId = options.id
state.pa.walletId = options.id
}
});
onShow(() => {
if (!isEmpty(options.id)) {
state.walletId = options.id
state.pa.walletId = options.id
}
})
onShow(() => {})
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, walletApi.transaction, null, 'data.records')
const pageHook = hooks.usePage(pageRef, walletApi.transaction, null, "data.records")
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa);
pageHook.startPage(page, pagesize, false, state.pa)
}
const doTab = (e: any) => {
if (state.pa.type != e) {
state.pa.type = e
pageRef.value.reload(true)
}
if (state.pa.type != e) {
state.pa.type = e
pageRef.value.reload(true)
}
}
</script>
<template>
<crud-layout title="饭卡" bg="/static/page/blue-bg.png">
<z-paging ref="pageRef" height="100%" :fixed="false" v-model="pageHook.list" :default-page-size="5"
safe-area-inset-bottom :loading-more-enabled="true" :show-scrollbar="false" @query="query"
:auto-clean-list-when-reload="false" :auto-scroll-to-top-when-reload="false" @scroll="pageHook.scroll">
<view class="h-30rpx" />
<view class="bg-white rounded-16rpx px-20rpx">
<z-tabs :list="data.tabs" @change="doTab" />
</view>
<view class="h-20rpx" />
<view class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-20rpx"
v-for="(v, i) in pageHook.list" :key="i">
<view class="flex">
<view class="w-150rpx flex justify-left p-r-25rpx">
<tm-tag v-if="v.title == '充值'" size="m">{{ v.title }}</tm-tag>
<tm-tag v-if="v.title == '支付'" color="error" size="m">支付交易</tm-tag>
<tm-tag v-if="v.title == '支付退款'" color="info" size="m">{{ v.title }}</tm-tag>
</view>
<view class="flex-row-center">
<text class="sub-text-30">{{ hooks.useMoney(v.price) }}元</text>
</view>
</view>
<view class="sub-text-24 text-right">
{{ hooks.useTime(v.createTime, "") }}
</view>
</view>
</z-paging>
</crud-layout>
<crud-layout title="饭卡" bg="/static/page/blue-bg.png">
<z-paging
ref="pageRef"
height="100%"
:fixed="false"
v-model="pageHook.list"
:default-page-size="5"
safe-area-inset-bottom
:loading-more-enabled="true"
:show-scrollbar="false"
@query="query"
:auto-clean-list-when-reload="false"
:auto-scroll-to-top-when-reload="false"
@scroll="pageHook.scroll"
>
<view class="h-30rpx" />
<view class="bg-white rounded-16rpx px-20rpx">
<z-tabs :list="data.tabs" @change="doTab" />
</view>
<view class="h-20rpx" />
<view
class="flex-row items-center justify-between card p-x-20rpx p-y-30rpx m-b-20rpx"
v-for="(v, i) in pageHook.list"
:key="i"
>
<view class="flex">
<view class="w-200rpx flex justify-left p-r-25rpx">
<tm-tag v-if="v.title == '更新余额'" size="m">{{ v.title }}</tm-tag>
<tm-tag v-if="v.title == '批量更新余额'" size="m">{{ v.title }}</tm-tag>
<tm-tag v-if="v.title == '充值'" size="m">{{ v.title }}</tm-tag>
<tm-tag v-if="v.title == '支付'" color="error" size="m">{{ v.title }}</tm-tag>
<tm-tag v-if="v.title == '退款'" color="info" size="m">{{ v.title }}</tm-tag>
</view>
<view class="flex-row-center">
<text class="sub-text-30">{{ hooks.useMoney(v.price) }}元</text>
</view>
</view>
<view class="sub-text-24 text-right">
{{ hooks.useTime(v.createTime, "") }}
</view>
</view>
</z-paging>
</crud-layout>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped></style>
+5 -8
View File
@@ -158,28 +158,25 @@ const doFreeze = async () => {
</view>
<view class="flex-row items-center justify-between m-t-10rpx">
<view class="flex-row items-center">
<image class="size-50rpx rounded-full" :src="filePath(v.walletIcon)" mode="aspectFill" />
<image class="size-50rpx rounded-full" :src="filePath(v.walletTypeIcon)" mode="aspectFill" />
<text class="m-l-25rpx sub-text-28">
{{ v.walletTypeName }}
</text>
</view>
<view v-if="v.cardNumber">
<tm-tag v-if="v.isFreeze" size="s" color="info">冻结审核中</tm-tag>
<slot v-else>
<tm-tag v-if="!v.isFreeze" size="s" color="success">正常</tm-tag>
<tm-tag v-else size="s" color="error">已冻结</tm-tag>
</slot>
<tm-tag v-if="v.isFreeze == 0" size="s" color="success">正常</tm-tag>
<tm-tag v-if="v.isFreeze == 1" size="s" color="error">已冻结</tm-tag>
</view>
</view>
<view class="flex-row items-center justify-between m-t-10rpx">
<text class="sub-text-40 color-red!"> ¥{{ hooks.useMoney(v.balance) }} </text>
</view>
<view class="flex-row items-center justify-end space-x-20rpx m-t-10rpx">
<view v-if="v.walletTypeCode == 1 && !v.cardNumber" class="botder_btn" @tap.stop="openBindDialog(v)">
<view v-if="v.walletTypeUniqueCode == 1 && !v.cardNumber" class="botder_btn" @tap.stop="openBindDialog(v)">
绑定
</view>
<view
v-if="v.walletTypeCode == 1 && v.cardNumber && v.checkFreezeStatus != 1"
v-if="v.walletTypeUniqueCode == 1 && v.cardNumber && v.isFreeze != 1"
class="botder_btn"
@tap.stop="openFreezeDialog(v)"
>
+119 -117
View File
@@ -1,156 +1,158 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { hooks, constant } from "@@/index"
import { walletApi, payApi } from "@@/api"
const data = {
payType: [
{ text: "模拟支付", disabled: false, type: "0", value: "mock" },
{ text: "微信支付", disabled: true, type: "1", value: "wx_pub" },
{ text: "支付宝支付", disabled: true, type: "2", value: "alipay_wap" },
]
payType: [
{ text: "模拟支付", disabled: false, type: "0", value: "mock" },
{ text: "微信支付", disabled: true, type: "1", value: "wx_pub" },
{ text: "支付宝支付", disabled: true, type: "2", value: "alipay_wap" },
],
}
const state = reactive<any>({
walletId: null,
currentPayType: "0",
currentRecharge: 0,
userInfo: {},
detail: {},
rechargeList: []
walletId: null,
currentPayType: "0",
currentRecharge: 0,
userInfo: {},
detail: {},
rechargeList: [],
})
onLoad((options: any) => {
if (!isEmpty(options.id)) {
state.walletId = options.id
}
});
if (!isEmpty(options.id)) {
state.walletId = options.id
}
})
onShow(() => {
getUserInfo()
getDetail()
getRechargeList()
getUserInfo()
getDetail()
getRechargeList()
})
const getDetail = async () => {
const _pa = { walletId: state.walletId }
const { data } = await walletApi.detail(_pa)
state.detail = data
const _pa = { walletId: state.walletId }
const { data } = await walletApi.detail(_pa)
state.detail = data
}
const getUserInfo = () => {
const userInfoKey = constant.storageConstant.USERINFO
const userStorage = uni.getStorageSync(userInfoKey)
if (!isEmpty(userStorage)) {
state.userInfo = userStorage
}
const userInfoKey = constant.storageConstant.USERINFO
const userStorage = uni.getStorageSync(userInfoKey)
if (!isEmpty(userStorage)) {
state.userInfo = userStorage
}
}
const getRechargeList = async () => {
const _pa = {}
const { data } = await walletApi.rechargeList(_pa)
state.rechargeList = data
const _pa = {}
const { data } = await walletApi.rechargeList(_pa)
state.rechargeList = data
}
const doPay = async () => {
if (state.currentRecharge == -1) {
uni.showToast({ title: '请选择充值金额', icon: "none" });
return
}
try {
uni.showLoading({ title: '充值中...', mask: true });
const targetRecharge = state.rechargeList[state.currentRecharge]
const targetPayType = data.payType[state.currentPayType]
if (isEmpty(targetRecharge)) throw new Error()
const _pa = {
payPrice: targetRecharge.payPrice,
walletId: state.walletId,
packageId: targetRecharge.id,
}
const { data: createData, code: createCode }: any = await walletApi.recharge(_pa)
console.log(createCode, "createCode");
if (state.currentRecharge == -1) {
uni.showToast({ title: "请选择充值金额", icon: "none" })
return
}
try {
uni.showLoading({ title: "充值中...", mask: true })
const targetRecharge = state.rechargeList[state.currentRecharge]
const targetPayType = data.payType[state.currentPayType]
if (isEmpty(targetRecharge)) throw new Error()
const _pa = {
payPrice: targetRecharge.payPrice,
walletId: state.walletId,
packageId: targetRecharge.id,
}
const { data: createData, code: createCode }: any = await walletApi.recharge(_pa)
console.log(createCode, "createCode")
if (createCode != 0) throw new Error()
const _payPa = {
id: createData.payOrderId,
walletId: state.walletId,
channelCode: targetPayType.value,
channelExtras: {},
}
getDetail()
uni.hideLoading()
uni.showToast({ title: '充值成功', icon: "none" });
} catch (error) {
console.error(error);
uni.hideLoading()
uni.showToast({ title: '充值失败', icon: "none" });
}
if (createCode != 0) throw new Error()
const _payPa = {
id: createData.payOrderId,
walletId: state.walletId,
channelCode: targetPayType.value,
channelExtras: {},
}
getDetail()
uni.hideLoading()
uni.showToast({ title: "充值成功", icon: "none" })
} catch (error) {
console.error(error)
uni.hideLoading()
uni.showToast({ title: "充值失败", icon: "none" })
}
}
</script>
<template>
<crud-layout title="充值" bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<view class="flex-row items-center justify-between h-120rpx p-x-30rpx bg-#222222 rounded-20rpx">
<view class="flex-row items-center">
<view class="flex-row-center size-60rpx bg-white rounded-full">
<image class="size-50rpx rounded-full" :src="state.detail.walletIcon" mode="aspectFill" />
</view>
<view class="flex-row-center">
<view class="m-l-25rpx main-text-32 color-#fbddb0!">
{{ state.detail.walletTypeName }}
</view>
</view>
</view>
<view class="main-text-30 color-#fbddb0!">
¥{{ hooks.useMoney(state.detail.balance) }}
</view>
</view>
<crud-layout title="充值" bg="/static/page/blue-bg.png">
<view class="h-30rpx" />
<view class="flex-row items-center justify-between h-120rpx p-x-30rpx bg-#222222 rounded-20rpx">
<view class="flex-row items-center">
<view class="flex-row-center size-60rpx bg-white rounded-full">
<image class="size-50rpx rounded-full" :src="state.detail.walletIcon" mode="aspectFill" />
</view>
<view class="flex-row-center">
<view class="m-l-25rpx main-text-32 color-#fbddb0!">
{{ state.detail.walletTypeName }}
</view>
</view>
</view>
<view class="main-text-30 color-#fbddb0!"> ¥{{ hooks.useMoney(state.detail.balance) }} </view>
</view>
<view class="prefix_title m-t-35rpx">充值</view>
<view class="recharge p-30rpx bg-white rounded-20rpx m-t-20rpx shadow-main">
<view :class="[state.currentRecharge == i ? 'recharge_item_active' : '']" class="recharge_item"
v-for="(v, i) in state.rechargeList" :key="i" @tap="state.currentRecharge = i">
<text class="sub-text-30 text-center">¥{{ hooks.useMoney(v.payPrice) }}</text>
</view>
</view>
<view class="prefix_title m-t-35rpx">支付</view>
<view class="p-30rpx p-b-40rpx bg-white rounded-20rpx m-t-20rpx shadow-main">
<tm-radio-group direction="column" gap="40" v-model="state.currentPayType">
<tm-radio :disabled="v.disabled" v-for="(v, i) in data.payType" :key="i" :value="v.type"
:label="v.text" />
</tm-radio-group>
</view>
<view class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
@tap="doPay">
确认充值
</view>
</crud-layout>
<view class="prefix_title m-t-35rpx">充值</view>
<view class="recharge p-30rpx bg-white rounded-20rpx m-t-20rpx shadow-main">
<view
:class="[state.currentRecharge == i ? 'recharge_item_active' : '']"
class="recharge_item"
v-for="(v, i) in state.rechargeList"
:key="i"
@tap="state.currentRecharge = i"
>
<text class="sub-text-30 text-center">¥{{ hooks.useMoney(v.payPrice) }}</text>
</view>
</view>
<view class="prefix_title m-t-35rpx">支付</view>
<view class="p-30rpx p-b-40rpx bg-white rounded-20rpx m-t-20rpx shadow-main">
<tm-radio-group direction="column" gap="40" v-model="state.currentPayType">
<tm-radio :disabled="v.disabled" v-for="(v, i) in data.payType" :key="i" :value="v.type" :label="v.text" />
</tm-radio-group>
</view>
<view
class="bg-#0094ff p-y-20rpx text-center rounded-40rpx m-x-30rpx m-t-60rpx sub-text-30 color-white!"
@tap="doPay"
>
确认充值
</view>
</crud-layout>
</template>
<style lang="scss" scoped>
.recharge_item_active {
background: #e9f5fe;
border: 1px solid #e9f5fe !important;
background: #e9f5fe;
border: 1px solid #e9f5fe !important;
&>text {
color: #0094ff !important;
}
& > text {
color: #0094ff !important;
}
}
.recharge {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20rpx;
border-bottom: 1px solid #f9f9f9;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 20rpx;
border-bottom: 1px solid #f9f9f9;
&_item {
display: flex;
flex-direction: column;
border: 1px solid #cccccc;
border-radius: 16rpx;
padding: 20rpx 0;
}
&_item {
display: flex;
flex-direction: column;
border: 1px solid #cccccc;
border-radius: 16rpx;
padding: 20rpx 0;
}
}
</style>
</style>
+2 -2
View File
@@ -29,7 +29,7 @@ export default {
}),
bind: (data: any) =>
request({
url: "pay/wallet/bind-card",
url: "wallet/wallet-active/app/bind-card",
method: "POST",
data,
custom: {
@@ -38,7 +38,7 @@ export default {
}),
freeze: (data: any) =>
request({
url: "pay/wallet/apply-freeze",
url: "wallet/wallet-freeze/app/apply-freeze",
method: "POST",
data,
custom: {