# Conflicts:
#	.env
This commit is contained in:
zjf committed 2025-01-16 12:00:30 +08:00
commit 20926568d7
20 files changed
+751 -695

No files matched your search

+1 -1
View File
@@ -87,4 +87,4 @@
"vite": "5.2.8",
"vue-tsc": "^1.0.24"
}
}
}
+74 -82
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { ref, reactive, withDefaults, defineProps, defineEmits } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { ref, reactive, withDefaults, defineProps, defineEmits } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { hooks, router } from "@@/index"
import { merchantApi } from "@@/api"
@@ -8,101 +8,93 @@ import { merchantApi } from "@@/api"
const emit = defineEmits(["update:modelValue", "add", "remove"])
export type Props = {
mode: "default" | "car",
productId: number | null,
modelValue: number,
pic: string,
name: string,
price: any,
marketPrice: number,
salesCount: number,
stock: number,
count: number,
mode: "default" | "car"
productId: number | null
modelValue: number
pic: string
name: string
price: any
marketPrice: number
salesCount: number
stock: number
count: number
}
const props = withDefaults(defineProps<Props>(), {
mode: "default",
productId: null,
modelValue: 0,
pic: '',
name: '',
price: 0,
marketPrice: 0,
salesCount: 0,
stock: 0,
count: 0,
});
const state = reactive<any>({
mode: "default",
productId: null,
modelValue: 0,
pic: "",
name: "",
price: 0,
marketPrice: 0,
salesCount: 0,
stock: 0,
count: 0,
})
const state = reactive<any>({})
onLoad(() => {
});
onShow(() => {
})
onLoad(() => {})
onShow(() => {})
const add = () => {
if (props.modelValue >= 99) {
emit('update:modelValue', 99);
return
}
emit('update:modelValue', props.modelValue + 1)
emit('add')
if (props.modelValue >= 99) {
emit("update:modelValue", 99)
return
}
// emit("update:modelValue", props.modelValue + 1)
emit("add")
}
const remove = () => {
if (props.modelValue < 0) {
emit('update:modelValue', 0);
return
}
emit('update:modelValue', props.modelValue - 1)
emit('remove')
if (props.modelValue < 0) {
emit("update:modelValue", 0)
return
}
// emit("update:modelValue", props.modelValue - 1)
emit("remove")
}
</script>
<template>
<view :class="[props.mode == 'car' ? 'car_border' : '']"
class="flex-row items-start card p-x-15rpx p-y-25rpx m-b-20rpx"
@tap="props.productId && router.jump('/pages/merchant/product-detail', { id: props.productId })">
<image v-if="props.mode == 'default'" class=" size-180rpx rounded-12rpx" :src="props.pic" mode="aspectFill" />
<image v-if="props.mode == 'car'" class=" size-120rpx rounded-12rpx" :src="props.pic" mode="aspectFill" />
<view class="flex-1 m-l-20rpx">
<view class="sub-text-28 show-line">{{ props.name }}</view>
<view class="m-t-10rpx flex-row items-center">
<view class="second-text-32 color-red!">
¥{{ hooks.useMoney(props.price) }}
</view>
<view v-if="props.mode == 'default'" class="m-l-20rpx second-text-24 line-through">
¥{{ hooks.useMoney(props.marketPrice) }}
</view>
</view>
<view v-if="props.mode == 'car'" class="m-t-10rpx second-text-28">
x{{ props.count }}
</view>
<view v-if="props.mode == 'default'" class="flex-row items-center MT 10rpx">
<view class="second-text-24">{{ hooks.useFormatNum("库存", "", props.stock) }}</view>
<view class="w-1px h-20rpx m-x-5rpx bg-#999" />
<view class="second-text-24">{{ hooks.useFormatNum("销量", "", props.salesCount) }}</view>
</view>
<view class="flex-row items-center justify-end m-t-20rpx">
<view class="flex-row-center size-40rpx rounded-full border-1px border-solid border-color-#0094ff"
@tap.stop="remove">
<view class="iconfont icon-a--" />
</view>
<view class="sub-text-28 m-x-20rpx">{{ props.modelValue }}</view>
<view class="flex-row-center size-40rpx rounded-full bg-#0094ff" @tap.stop="add">
<view class="font-size-40rpx color-white iconfont icon-a-" />
</view>
</view>
</view>
</view>
<view
:class="[props.mode == 'car' ? 'car_border' : '']"
class="flex-row items-start card p-x-15rpx p-y-25rpx m-b-20rpx"
@tap="props.productId && router.jump('/pages/merchant/product-detail', { id: props.productId })"
>
<image v-if="props.mode == 'default'" class="size-180rpx rounded-12rpx" :src="props.pic" mode="aspectFill" />
<image v-if="props.mode == 'car'" class="size-120rpx rounded-12rpx" :src="props.pic" mode="aspectFill" />
<view class="flex-1 m-l-20rpx">
<view class="sub-text-28 show-line">{{ props.name }}</view>
<view class="m-t-10rpx flex-row items-center">
<view class="second-text-32 color-red!"> ¥{{ hooks.useMoney(props.price) }} </view>
<view v-if="props.mode == 'default'" class="m-l-20rpx second-text-24 line-through">
¥{{ hooks.useMoney(props.marketPrice) }}
</view>
</view>
<view v-if="props.mode == 'car'" class="m-t-10rpx second-text-28"> x{{ props.count }} </view>
<view v-if="props.mode == 'default'" class="flex-row items-center MT 10rpx">
<view class="second-text-24">{{ hooks.useFormatNum("库存", "", props.stock) }}</view>
<view class="w-1px h-20rpx m-x-5rpx bg-#999" />
<view class="second-text-24">{{ hooks.useFormatNum("销量", "", props.salesCount) }}</view>
</view>
<view class="flex-row items-center justify-end m-t-20rpx">
<view
class="flex-row-center size-40rpx rounded-full border-1px border-solid border-color-#0094ff"
@tap.stop="remove"
>
<view class="iconfont icon-a--" />
</view>
<view class="sub-text-28 m-x-20rpx">{{ props.modelValue }}</view>
<view class="flex-row-center size-40rpx rounded-full bg-#0094ff" @tap.stop="add">
<view class="font-size-40rpx color-white iconfont icon-a-" />
</view>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.car_border {
border: 1px solid #f2f2f2;
border: 1px solid #f2f2f2;
}
</style>
</style>
+34 -11
View File
@@ -50,7 +50,13 @@ const getShopCar = async () => {
const _pa = { merchantId: state.detailId, hardType: "CANTEEN" }
const { data } = await foodApi.getShopCar(_pa)
state.carList = data ?? []
asyncCarCount(state.shopList)
if (isEmpty(state.carList)) {
state.shopList.forEach((v: any) => {
v.productCount = 0
})
} else {
asyncCarCount(state.shopList)
}
state.totPrice = state.carList.map((v) => Number(v.totalPrice)).reduce((pre, next) => pre + next, 0)
state.totCount = state.carList.map((v) => v.productCount).reduce((pre, next) => pre + next, 0)
}
@@ -110,22 +116,39 @@ const asyncCarCount = (shopList) => {
}
const doAdd = async (item: any) => {
chentProductCount(item)
chentProductCount(item, "add")
}
const remove = async (item: any) => {
chentProductCount(item)
chentProductCount(item, "remove")
}
const chentProductCount = async (item: any) => {
const target = state.carList.find((v) => v.productId == item.productId)
const targetIndex = state.carList.findIndex((v) => v.productId == item.productId)
if (target) {
state.carList[targetIndex].productCount = item.productCount
} else {
state.carList.push({ ...item, productId: item.id })
const chentProductCount = async (item: any, type: "add" | "remove") => {
try {
uni.showLoading({ title: "加载中", mask: true })
let count = item.productCount
if (type === "add") {
count += 1
const { code }: any = await foodApi.checkSpuStock({ spuId: item.productId, incrCount: count })
if (code != 0) throw new Error()
} else if (type === "remove") {
count -= 1
}
const target = state.carList.find((v) => v.productId == item.productId)
const targetIndex = state.carList.findIndex((v) => v.productId == item.productId)
if (target) {
state.carList[targetIndex].productCount = count
} else {
state.carList.push({ ...item, productId: item.id, productCount: count })
}
nextTick(async () => {
await updateShopCar()
})
} catch (e) {
console.error(e)
} finally {
uni.hideLoading()
}
nextTick(() => updateShopCar())
}
const doClassify = (i: any) => {
+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>
+5 -1
View File
@@ -13,11 +13,14 @@
v-for="v in carList"
:key="v.id"
:productId="v.productId"
:spuId="v.spuId"
:merchantId="v.merchantId"
:picUrl="v.productPic"
:picUrl="filePath(v.productPic)"
:productName="v.productName"
:productCount="v.productCount"
:productPrice="v.productPrice"
:spec="v.spec"
:unit="v.unit"
@add="(v) => emit('add', v)"
@remove="(v) => emit('remove', v)"
/>
@@ -31,6 +34,7 @@
</template>
<script setup lang="ts">
import { filePath } from "@/sheep/utils/file"
import ProductRow from "./product-row.vue"
import ProductTotal from "./product-total.vue"
+11 -2
View File
@@ -9,6 +9,7 @@
<image class="size-140rpx rounded-12rpx" :src="props.picUrl" mode="aspectFill" />
<view class="flex-1 m-l-20rpx">
<view class="sub-text-28 show-line">{{ props.productName }}</view>
<view class="sub-text-24 show-line">规格:{{ "" + props.spec + props.unit }}</view>
<view class="m-t-10rpx flex-row items-center">
<!-- <view class="second-text-32 color-red!"> ¥{{ hooks.useMoney(props.price) }} </view> -->
<!-- <view class="m-l-20rpx second-text-24 line-through"> ¥{{ hooks.useMoney(props.marketPrice) }} </view> -->
@@ -54,6 +55,7 @@ const emit = defineEmits(["onClickAddToCar", "add", "remove"])
export type Props = {
mode?: "default" | "car"
productId: string
spuId?: string
merchantId: string
picUrl: string
productName: string
@@ -61,11 +63,14 @@ export type Props = {
productPrice?: number
salesCount?: number
stock?: number
spec?: string
unit?: string
onClickAddToCar?: () => void
}
const props = withDefaults(defineProps<Props>(), {
mode: "default",
productId: "",
spuId: "",
merchantId: "",
picUrl: "",
productName: "",
@@ -73,6 +78,8 @@ const props = withDefaults(defineProps<Props>(), {
productPrice: 0,
salesCount: 0,
stock: 0,
spec: "",
unit: "",
})
const handleClickAddToCar = () => {
@@ -85,14 +92,16 @@ const add = () => {
if (props.productCount + 1 >= 99) {
return
}
emit("add", { productId: props.productId, productCount: props.productCount + 1 })
// emit("add", { productId: props.productId, productCount: props.productCount + 1 })
emit("add", { productId: props.productId, productCount: props.productCount, spuId: props.spuId })
}
const remove = () => {
if (props.productCount - 1 < 0) {
return
}
emit("remove", { productId: props.productId, productCount: props.productCount - 1 })
// emit("remove", { productId: props.productId, productCount: props.productCount - 1 })
emit("remove", { productId: props.productId, productCount: props.productCount, spuId: props.spuId })
}
</script>
+31 -5
View File
@@ -110,6 +110,9 @@ watch(
// 获取商品详情
const { data } = await shopApi.getSupermarketSpuDetail({ id: props.productData.productId })
state.goodsDetail = data
if (data.skuList.length > 0) {
state.selectedSku = state.goodsDetail.skuList[0]
}
}
},
)
@@ -191,12 +194,14 @@ function onSelectSku(skuItem: any) {
// changeDisabled(isChecked, propertyId, valueId);
}
// 加数量
const handleNumAdd = () => {
if (state.goodsCount >= state.goodsDetail.stock) {
return
}
state.goodsCount += 1
}
// 减数量
const handleNumRemove = () => {
if (state.goodsCount <= 1) {
return
@@ -205,18 +210,39 @@ const handleNumRemove = () => {
}
// 点击加入购物车
const handleClickAddToCar = () => {
if (state.goodsDetail.stock === 0) {
const handleClickAddToCar = async () => {
// 检查规格选择
if (!state.selectedSku.id) {
uni.showToast({
title: "库存不足",
title: "请选择规格",
icon: "none",
duration: 1000,
})
return
}
if (!state.selectedSku.id) {
// 检查库存
try {
uni.showLoading({ title: "加载中", mask: true })
const { code }: any = await shopApi.checkSpuStock({
spuId: state.goodsDetail.id,
incrCount: state.goodsCount,
})
if (code != 0) {
return uni.showToast({
title: "库存不足",
icon: "none",
duration: 1000,
})
}
} catch (e) {
console.error(e)
} finally {
uni.hideLoading()
}
// 检查库存
if (state.goodsDetail.stock === 0) {
uni.showToast({
title: "请选择规格",
title: "库存不足",
icon: "none",
duration: 1000,
})
+42 -21
View File
@@ -3,8 +3,8 @@
<tm-sticky>
<!-- start 轮播 start -->
<z-swiper>
<z-swiper-item v-for="(v, i) in state.detail.picUrl?.split(',')" :key="i">
<image class="w-100vw h-400rpx" :src="filePath(state.detail?.swiperPic)" mode="aspectFill" />
<z-swiper-item v-for="(v, i) in state.detail.swiperPic?.split(',')" :key="i">
<image class="w-100vw h-400rpx" :src="filePath(v)" mode="aspectFill" />
</z-swiper-item>
</z-swiper>
<!-- end 轮播 end -->
@@ -14,7 +14,7 @@
<view class="h-15rpx" />
<!-- start 简介 start -->
<view flex-row card p-20rpx>
<image class="w-160rpx h-160rpx rounded-12rpx" :src="filePath(state.detail.logoPic)" mode="aspectFill" />
<image class="w-120rpx h-120rpx rounded-12rpx" :src="filePath(state.detail.logoPic)" mode="aspectFill" />
<view class="flex-1 flex-col m-l-20rpx">
<view class="flex-row items-center justify-between">
<view class="flex-row-center sub-text-36">
@@ -24,6 +24,7 @@
<tm-tag size="s">{{ state.detail.deptName }}</tm-tag>
</view>
</view>
<view class="second-text-28">{{ state.detail.phone }}</view>
<view class="m-t-10rpx second-text-28">
<text>营业时间</text>
<text class="m-l-10rpx">
@@ -32,18 +33,17 @@
{{ state.detail.jobEndTime }}
</text>
</view>
<view class="m-t-10rpx second-text-28">
<text>超市地址</text>
<view v-if="state.detail.addressDes" class="m-t-10rpx second-text-28">
<text>地址</text>
<text class="m-l-10rpx">{{ state.detail.addressDes }}</text>
</view>
</view>
</view>
<!-- end 简介 end -->
<view class="h-15rpx" />
</view>
</tm-sticky-header>
<view class="h-15rpx" />
<view class="h-30rpx" />
<!-- start 商品 start -->
<view class="flex-row">
@@ -185,6 +185,8 @@ const getPorduct = async () => {
// productName: target.name,
merchantId: state.merchantId,
categoryId: target.id,
current: 1,
size: 9999,
})
state.goodsList = data.records
// state.goodsList.forEach((i) => {
@@ -235,19 +237,38 @@ const onAddToCar = (cartGoodsInfo: any) => {
showSkuDialog.value = false
}
// 同步购物车中的数据
const chentProductCount = async (item: any) => {
const target = state.carList.find((v) => v.productId == item.productId)
const targetIndex = state.carList.findIndex((v) => v.productId == item.productId)
if (target) {
state.carList[targetIndex].productCount = item.productCount
state.carList[targetIndex].productId = item.productId
console.log("1", state.carList[targetIndex])
} else {
state.carList.push(item)
console.log("2", item)
}
const chentProductCount = async (item: any, type?: "add" | "remove") => {
try {
console.log("ccccccc", item)
nextTick(() => updateShopCar()) // 保存购物车数据
uni.showLoading({ title: "加载中", mask: true })
let count = item.productCount
if (type === "add") {
count += 1
const { code }: any = await shopApi.checkSpuStock({ spuId: item.spuId, incrCount: count })
if (code != 0) throw new Error()
} else if (type === "remove") {
count -= 1
}
const target = state.carList.find((v) => v.productId == item.productId)
const targetIndex = state.carList.findIndex((v) => v.productId == item.productId)
if (target) {
state.carList[targetIndex].productCount = count
state.carList[targetIndex].productId = item.productId
state.carList[targetIndex].spuId = item.spuId
console.log("1", state.carList[targetIndex])
} else {
state.carList.push(item)
console.log("2", item)
}
nextTick(async () => await updateShopCar()) // 保存购物车数据
} catch (e) {
console.error(e)
} finally {
uni.hideLoading()
}
}
// 保存购物车数据
const updateShopCar = async () => {
@@ -277,10 +298,10 @@ const doVisibleCar = async () => {
}
const doAdd = async (item: any) => {
chentProductCount(item)
chentProductCount(item, "add")
}
const doRemove = async (item: any) => {
chentProductCount(item)
chentProductCount(item, "remove")
}
// 点击提交订单
+156 -143
View File
@@ -1,171 +1,184 @@
<script setup lang="ts">
import { ref, reactive } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";
import { isEmpty } from "radash";
import { ref, reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
import { hooks, router, constant } from "@@/index";
import { merchantApi, userApi, walletApi } from "@@/api";
import { hooks, router, constant } from "@@/index"
import { merchantApi, userApi, walletApi } from "@@/api"
const data = {
serviceList: [
{ text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" },
{ text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" },
{ text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" },
{ text: "跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" },
{ text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/human-face/list" },
{ text: "测试登录", icon: "/static/icon/login.png", router: "/pages/test/login" },
],
};
serviceList: [
{ text: "钱包管理", icon: "/static/icon/service_3.png", router: "/pages/wallet/list" },
{ text: "包厢预定", icon: "/static/icon/service_4.png", router: "/pages/boxes/apply-list" },
{ text: "外来人员就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/foreign-list" },
{ text: "跨单位就餐", icon: "/static/icon/service_1.png", router: "/pages/apply/stride-list" },
{ text: "人脸管理", icon: "/static/icon/service_5.png", router: "/pages/human-face/list" },
{ text: "测试登录", icon: "/static/icon/login.png", router: "/pages/test/login" },
],
}
const state = reactive<any>({
wallet: [],
userInfo: {},
});
wallet: [],
userInfo: {},
})
onLoad((options) => {
(window as any).CP2.getAppInfo().then((res) => {
console.log(res);
if (res.code == 1) {
//诗画
console.log("诗画环境");
(window as any).CP2.getUserInfo().then((res) => {
let accountId = res.data.accountId;
let sessionId = res.sessionId;
doLogin(1, null, accountId, sessionId);
});
} else {
//浙政钉或者h5
const url = window.location.href;
const params = new URL(url).searchParams;
const token = params.get("uabaseToken"); // 获取 uabaseToken 参数值
console.log("Token:", token);
if (null != token) {
//浙政钉
doLogin(2, token, null, null);
}
}
});
});
;(window as any).CP2.getAppInfo().then((res) => {
console.log(res)
if (res.code == 1) {
//诗画
console.log("诗画环境")
;(window as any).CP2.getUserInfo().then((res) => {
let accountId = res.data.accountId
let sessionId = res.sessionId
doLogin(1, null, accountId, sessionId)
})
} else {
//浙政钉或者h5
const url = window.location.href
const params = new URL(url).searchParams
const token = params.get("uabaseToken") // 获取 uabaseToken 参数值
console.log("Token:", token)
if (null != token) {
//浙政钉
doLogin(2, token, null, null)
}
}
})
})
onShow(() => {
getUserInfo();
});
getUserInfo()
})
const getUserInfo = () => {
const userInfoKey = constant.storageConstant.USERINFO;
const userStorage = uni.getStorageSync(userInfoKey);
if (!isEmpty(userStorage)) {
state.userInfo = userStorage;
console.log(state.userInfo,"state.userInfo");
}
};
const userInfoKey = constant.storageConstant.USERINFO
const userStorage = uni.getStorageSync(userInfoKey)
if (!isEmpty(userStorage)) {
state.userInfo = userStorage
console.log(state.userInfo, "state.userInfo")
}
}
const doLogin = async (loginType, token, accountId, sessionId) => {
const tokenKey = constant.storageConstant.TOKEN;
const userInfoKey = constant.storageConstant.USERINFO;
const tokenStorage = uni.getStorageSync(tokenKey);
const userStorage = uni.getStorageSync(userInfoKey);
if (isEmpty(tokenStorage) || isEmpty(userStorage)) {
uni.showLoading({
title: "登录中...",
mask: true,
});
let authData;
if (loginType == 1) {
// 诗画
const params = {
accountId: accountId,
sessionId: sessionId,
};
const response = await userApi.authsh(params);
authData = response.data;
} else if (loginType == 2) {
//浙政钉
const response = await userApi.auth(token);
authData = response.data;
} else {
//后期手机号+验证码登录
router.jump("/pages/test/login");
uni.hideLoading();
return;
}
// const {data: authData} = await userApi.auth(token);
uni.setStorageSync(tokenKey, authData);
const { data: userData } = await userApi.userInfo();
uni.setStorageSync(userInfoKey, userData);
getUserInfo();
uni.hideLoading();
uni.showToast({ title: "登录成功", icon: "none" });
}
};
const tokenKey = constant.storageConstant.TOKEN
const userInfoKey = constant.storageConstant.USERINFO
const tokenStorage = uni.getStorageSync(tokenKey)
const userStorage = uni.getStorageSync(userInfoKey)
if (isEmpty(tokenStorage) || isEmpty(userStorage)) {
uni.showLoading({
title: "登录中...",
mask: true,
})
let authData
if (loginType == 1) {
// 诗画
const params = {
accountId: accountId,
sessionId: sessionId,
}
const response = await userApi.authsh(params)
authData = response.data
} else if (loginType == 2) {
//浙政钉
const response = await userApi.auth(token)
authData = response.data
} else {
//后期手机号+验证码登录
router.jump("/pages/test/login")
uni.hideLoading()
return
}
// const {data: authData} = await userApi.auth(token);
uni.setStorageSync(tokenKey, authData)
const { data: userData } = await userApi.userInfo()
uni.setStorageSync(userInfoKey, userData)
getUserInfo()
uni.hideLoading()
uni.showToast({ title: "登录成功", icon: "none" })
}
}
const toService = async (v:any)=>{
const isLogin = await hooks.useCheckLogin();
if(isLogin){
router.jump(v.router)
}
const toService = async (v: any, i: number) => {
if (i == data.serviceList.length - 1) {
router.jump(v.router)
return
}
const isLogin = await hooks.useCheckLogin()
if (isLogin) {
router.jump(v.router)
}
}
const doLogout = async () => {
const isLogin = await hooks.useCheckLogin();
if(!isLogin) return
uni.showLoading({
title: "退出登录中...",
mask: true,
});
const tokenKey = constant.storageConstant.TOKEN;
const userInfoKey = constant.storageConstant.USERINFO;
uni.removeStorageSync(tokenKey);
uni.removeStorageSync(userInfoKey);
state.userInfo = {};
uni.hideLoading();
uni.showToast({ title: "退出登录成功", icon: "none" });
};
const isLogin = await hooks.useCheckLogin()
if (!isLogin) return
uni.showLoading({
title: "退出登录中...",
mask: true,
})
const tokenKey = constant.storageConstant.TOKEN
const userInfoKey = constant.storageConstant.USERINFO
uni.removeStorageSync(tokenKey)
uni.removeStorageSync(userInfoKey)
state.userInfo = {}
uni.hideLoading()
uni.showToast({ title: "退出登录成功", icon: "none" })
}
</script>
<template>
<crud-layout title="我的" bg="/static/page/blue-bg.png">
<view class="flex-row items-center">
<image class="w-100rpx h-100rpx rounded-full" v-if="state.userInfo?.sysUser?.avatar" :src="state.userInfo.sysUser.avatar"
mode="aspectFill" />
<image class="w-100rpx h-100rpx rounded-full" v-else src="/static/icon/default-avatar.png" mode="aspectFill" />
<view class="m-l-30rpx" v-if="state.userInfo?.sysUser?.userId">
<view class="flex-row items-center">
<text class="sub-text-30">{{ state.userInfo?.sysUser?.name }}</text>
<text class="iconfont icon-youjiantou color-#666666 m-l-20rpx"></text>
</view>
<text class="sub-text-26">ID {{ state.userInfo?.sysUser?.userId }}</text>
</view>
<view v-else class="flex-row items-center m-l-30rpx" @tap="doLogin">
<text class="sub-text-32">请先登录</text>
<text class="iconfont icon-youjiantou"></text>
</view>
</view>
<crud-layout title="我的" bg="/static/page/blue-bg.png">
<view class="flex-row items-center">
<image
class="w-100rpx h-100rpx rounded-full"
v-if="state.userInfo?.sysUser?.avatar"
:src="state.userInfo.sysUser.avatar"
mode="aspectFill"
/>
<image class="w-100rpx h-100rpx rounded-full" v-else src="/static/icon/default-avatar.png" mode="aspectFill" />
<view class="m-l-30rpx" v-if="state.userInfo?.sysUser?.userId">
<view class="flex-row items-center">
<text class="sub-text-30">{{ state.userInfo?.sysUser?.name }}</text>
<text class="iconfont icon-youjiantou color-#666666 m-l-20rpx"></text>
</view>
<text class="sub-text-26">ID {{ state.userInfo?.sysUser?.userId }}</text>
</view>
<view v-else class="flex-row items-center m-l-30rpx" @tap="doLogin">
<text class="sub-text-32">请先登录</text>
<text class="iconfont icon-youjiantou"></text>
</view>
</view>
<view class="m-t-40rpx rounded-20rpx shadow-main p-30rpx p-b-40rpx bg-white!">
<view class="service_item flex-row items-center justify-between" v-for="(v, i) in data.serviceList" :key="i"
@tap="toService(v)">
<view class="flex-row-center">
<image class="w-40rpx h-40rpx" :src="v.icon" mode="aspectFill" />
<text class="sub-text-28 m-l-20rpx">{{ v.text }}</text>
</view>
<view class="iconfont icon-youjiantou"></view>
</view>
</view>
<view class="m-t-40rpx rounded-20rpx shadow-main p-30rpx p-b-40rpx bg-white!">
<view
class="service_item flex-row items-center justify-between"
v-for="(v, i) in data.serviceList"
:key="i"
@tap="toService(v, i)"
>
<view class="flex-row-center">
<image class="w-40rpx h-40rpx" :src="v.icon" mode="aspectFill" />
<text class="sub-text-28 m-l-20rpx">{{ v.text }}</text>
</view>
<view class="iconfont icon-youjiantou"></view>
</view>
</view>
<view class="flex-col-center m-t-40rpx m-x-30rpx">
<view class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff"
@tap="doLogout">
退出登录
</view>
</view>
</crud-layout>
<view class="flex-col-center m-t-40rpx m-x-30rpx">
<view
class="w-full text-center sub-text-28 p-y-20rpx rounded-40rpx border-solid border border-#0094ff"
@tap="doLogout"
>
退出登录
</view>
</view>
</crud-layout>
</template>
<style lang="scss" scoped>
.service_item:not(:last-child) {
padding-bottom: 40rpx;
border-bottom: 1px solid #fafafa;
margin-bottom: 40rpx;
padding-bottom: 40rpx;
border-bottom: 1px solid #fafafa;
margin-bottom: 40rpx;
}
</style>
+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">
+69 -80
View File
@@ -1,94 +1,83 @@
<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, router } from "@@/index";
import { merchantApi } from "@@/api";
import { filePath } from "@@/utils/file";
import { hooks, router } from "@@/index"
import { merchantApi } from "@@/api"
import { filePath } from "@@/utils/file"
const state = reactive<any>({
pa: {
pagesize: 10,
type: "2",
},
});
pa: {
pagesize: 10,
type: "2",
},
})
onLoad(() => {});
onLoad(() => {})
onShow(() => {
if (pageRef.value) {
pageRef.value.reload(false);
}
});
if (pageRef.value) {
pageRef.value.reload(false)
}
})
const pageRef = ref<any>(null);
const pageHook = hooks.usePage(pageRef, merchantApi.page, null, "data.records");
const pageRef = ref<any>(null)
const pageHook = hooks.usePage(pageRef, merchantApi.page, null, "data.records")
const query = (page: number, pagesize: number) => {
pageHook.startPage(page, pagesize, false, state.pa);
};
pageHook.startPage(page, pagesize, false, state.pa)
}
const toDetail = async (v: any) => {
const isLogin = await hooks.useCheckLogin();
if (isLogin) {
router.jump("/pages/shop/detail", { id: v.id });
}
};
const isLogin = await hooks.useCheckLogin()
if (isLogin) {
router.jump("/pages/shop/detail", { id: v.id })
}
}
</script>
<template>
<crud-layout bg="/static/page/blue-bg.png">
<z-paging
ref="pageRef"
height="100%"
:fixed="false"
v-model="pageHook.list"
:default-page-size="10"
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="flex-col card p-20rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i" @tap="toDetail(v)">
<view class="flex-row-center">
<image class="w-120rpx h-120rpx rounded-12rpx" :src="filePath(v.logoPic)" mode="aspectFill" />
<view class="flex-1 flex-col m-l-20rpx">
<view class="flex-row items-center justify-between">
<view class="flex-row-center sub-text-34">
<text> {{ v.name }}</text>
</view>
<view>
<tm-tag size="s">{{ v.deptName }}</tm-tag>
</view>
</view>
<view class="flex items-center">
<tm-rate :half="true" :model-value="2.5" :size="24" :space="2" />
<text class="c-blue ml-1">2.5</text>
</view>
<view class="m-t-10rpx second-text-28">
<text>营业时间</text>
<text class="m-l-10rpx">
{{ v.jobStartTime }}
~
{{ v.jobEndTime }}
</text>
<text class="float-right">22km</text>
</view>
<view v-if="v.addressDes" class="m-t-10rpx second-text-28">
<text>地址</text>
<text class="m-l-10rpx">{{ v.addressDes }}</text>
</view>
</view>
</view>
<view class="bg-#d2d2d277 m-1 p-1 border-rd-1 flex-row items-center">
<text class="sub-text-28 ws-nowrap">推荐理由:</text>
<text class="sub-text-24 ws-nowrap text-ellipsis overflow-hidden">
实力评分,资历好,规模大。实力评分,资历好,规模大。实力评分,资历好,规模大。
</text>
</view>
</view>
</z-paging>
</crud-layout>
<crud-layout bg="/static/page/blue-bg.png">
<z-paging
ref="pageRef"
height="100%"
:fixed="false"
v-model="pageHook.list"
:default-page-size="10"
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="flex-col card p-20rpx m-b-20rpx" v-for="(v, i) in pageHook.list" :key="i" @tap="toDetail(v)">
<view class="flex-row-center">
<image class="w-120rpx h-120rpx rounded-12rpx" :src="filePath(v.logoPic)" mode="aspectFill" />
<view class="flex-1 flex-col m-l-20rpx">
<view class="flex-row items-center justify-between">
<view class="flex-row-center sub-text-34">
<text> {{ v.name }}</text>
</view>
<view>
<tm-tag size="s">{{ v.deptName }}</tm-tag>
</view>
</view>
<view class="second-text-28">{{ v.phone }}</view>
<view class="m-t-10rpx second-text-28">
<text>营业时间</text>
<text class="m-l-10rpx">
{{ v.jobStartTime }}
~
{{ v.jobEndTime }}
</text>
</view>
<view v-if="v.addressDes" class="m-t-10rpx second-text-28">
<text>地址</text>
<text class="m-l-10rpx">{{ v.addressDes }}</text>
</view>
</view>
</view>
</view>
</z-paging>
</crud-layout>
</template>
+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>
+61 -51
View File
@@ -1,53 +1,63 @@
import request from "@/sheep/utils/request";
import request from "@/sheep/utils/request"
export default {
page: (data: any) =>
request({
url: `/canteen/canteenDailyMenu/app/page`,
method: "POST",
data,
params:{
pageNo: data.pageNo,
pagesize: data.pagesize
},
custom: {
showLoading: false,
},
}),
classify: (params: any) =>
request({
url: `/canteen/canteenOnlineCategory/app/getAllSimple`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
product: (params: any) =>
request({
url: `/canteen/canteenOnlineSpu/app/getCanteenSpuList`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
getShopCar: (params: any) =>
request({
url: `/hard/hard-car/app/mch-detail`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
updateShopCar: (data: any) =>
request({
url: `/hard/hard-car/app/save-or-upload`,
method: "POST",
data,
custom: {
showLoading: false,
},
}),
};
page: (data: any) =>
request({
url: `/canteen/canteenDailyMenu/app/page`,
method: "POST",
data,
params: {
pageNo: data.pageNo,
pagesize: data.pagesize,
},
custom: {
showLoading: false,
},
}),
classify: (params: any) =>
request({
url: `/canteen/canteenOnlineCategory/app/getAllSimple`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
product: (params: any) =>
request({
url: `/canteen/canteenOnlineSpu/app/getCanteenSpuList`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
getShopCar: (params: any) =>
request({
url: `/hard/hard-car/app/mch-detail`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
updateShopCar: (data: any) =>
request({
url: `/hard/hard-car/app/save-or-upload`,
method: "POST",
data,
custom: {
showLoading: false,
},
}),
checkSpuStock: (params) => {
return request({
url: "/canteen/canteenOnlineSpu/app/checkSpuStock",
method: "GET",
params,
custom: {
showLoading: false,
},
})
},
}
+9 -9
View File
@@ -1,11 +1,11 @@
import request from "@/sheep/utils/request";
import request from "@/sheep/utils/request"
export default {
get: (params) => {
return request({
url: "/canteen/canteenOnlineSpu/app/getCanteenSpuDetails",
method: "GET",
params,
});
},
};
get: (params) => {
return request({
url: "/canteen/canteenOnlineSpu/app/getCanteenSpuDetails",
method: "GET",
params,
})
},
}
+39 -66
View File
@@ -1,68 +1,41 @@
import request from "@/sheep/utils/request";
import request from "@/sheep/utils/request"
export default {
getSupermarketSpuCategory: (params: any) =>
request({
url: `/supermarket/supermarketCategory/app/simpleAll`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
getSupermarketSpuList: (data: any) =>
request({
url: `/supermarket/supermarketSpu/app/selectListAll`,
method: "POST",
data,
custom: {
showLoading: false,
},
}),
getSupermarketSpuDetail: (params: any) =>
request({
url: `/supermarket/supermarketSpu/app/SpuDetails`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
// del: (params: any) =>
// request({
// url: `/sys/user/face-delete`,
// method: "DELETE",
// params,
// custom: {
// showLoading: false,
// },
// }),
// create: (data: any) =>
// request({
// url: `/sys/user/face-create`,
// method: "POST",
// data,
// custom: {
// showLoading: false,
// },
// }),
// get: (params: any) =>
// request({
// url: `/sys/user/face-get`,
// method: "GET",
// params,
// custom: {
// showLoading: false,
// },
// }),
// put: (data: any) =>
// request({
// url: `/sys/user/face-update`,
// method: "PUT",
// data,
// custom: {
// showLoading: false,
// },
// }),
};
getSupermarketSpuCategory: (params: any) =>
request({
url: `/supermarket/supermarketCategory/app/simpleAll`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
getSupermarketSpuList: (data: any) =>
request({
url: `/supermarket/supermarketSpu/app/selectListAll`,
method: "POST",
data,
custom: {
showLoading: false,
},
}),
getSupermarketSpuDetail: (params: any) =>
request({
url: `/supermarket/supermarketSpu/app/SpuDetails`,
method: "GET",
params,
custom: {
showLoading: false,
},
}),
checkSpuStock: (params) => {
return request({
url: "/supermarket/supermarketSpu/app/checkSpuStock",
method: "GET",
params,
custom: {
showLoading: false,
},
})
},
}
+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: {
+6
View File
@@ -120,6 +120,12 @@ http.interceptors.response.use(
icon: "none",
})
}
if (response.data.code === 1) {
const tokenKey = constant.storageConstant.TOKEN
uni.removeStorageSync(tokenKey)
uni.showToast({ title: "登录已过期,请重新登录", icon: "none" })
router.jump("/pages/test/login")
}
const tokenKey = constant.storageConstant.TOKEN
const tokenStorage = uni.getStorageSync(tokenKey)
if (!isEmpty(tokenStorage) && response.config.url != "/sys/auth/refresh-token") {