diff --git a/src/App.vue b/src/App.vue
index dde7a33..01059e3 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,120 +1,183 @@
-
-
-
-
-
-
-
-
-
- 未使用
- 已使用
-
-
- {{ v.username }}
- {{ v.userMobile }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 未使用
+ 已使用
+
+
+ {{ v.username }}
+ {{ v.userMobile }}
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/src/pages/apply/foreign-list.vue b/src/pages/apply/foreign-list.vue
index a35d7f8..55559f0 100644
--- a/src/pages/apply/foreign-list.vue
+++ b/src/pages/apply/foreign-list.vue
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 电子餐券
-
- {{ hooks.useTime(v.createTime, "") }}
-
- 待审核
- 已通过
- 已拒绝
-
-
-
-
-
-
- 数量
- {{ v.count }}
-
-
- 已使用
- {{ v.useCount }}
-
-
-
-
- 有效期
-
- {{ hooks.useTime(v.applyStartTime, " {y}-{m}-{d}") }}
- ~
- {{ hooks.useTime(v.applyEndTime, "{y}-{m}-{d}") }}
-
-
-
-
-
-
- 审核人
- {{ v.checkUserName }}
-
-
- 审核时间
- {{ hooks.useTime(v.checkTime, "") }}
-
-
-
-
- 使用
- 查看
-
-
-
-
- 申请
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 电子餐券
+
+ {{ hooks.useTime(v.createTime, "") }}
+
+ 待审核
+ 已通过
+ 已拒绝
+
+
+
+
+
+
+ 数量
+ {{ v.count }}
+
+
+ 已使用
+ {{ v.useCount }}
+
+
+
+
+ 有效期
+
+ {{ hooks.useTime(v.applyStartTime, " {y}-{m}-{d}") }}
+ ~
+ {{ hooks.useTime(v.applyEndTime, "{y}-{m}-{d}") }}
+
+
+
+
+
+
+ 审核人
+ {{ v.checkUserName }}
+
+
+ 审核时间
+ {{ hooks.useTime(v.checkTime, "") }}
+
+
+
+
+ 使用
+ 查看
+
+
+
+
+ 申请
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/src/pages/apply/stride-items.vue b/src/pages/apply/stride-items.vue
index 98f2dcc..1949161 100644
--- a/src/pages/apply/stride-items.vue
+++ b/src/pages/apply/stride-items.vue
@@ -1,60 +1,71 @@
-
-
-
-
-
-
-
-
-
- 未使用
- 已使用
-
-
- {{ v.username }}
- {{ v.userMobile }}
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 未使用
+ 已使用
+
+
+ {{ v.username }}
+ {{ v.userMobile }}
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/src/pages/apply/stride-list.vue b/src/pages/apply/stride-list.vue
index 1422acc..4039bc9 100644
--- a/src/pages/apply/stride-list.vue
+++ b/src/pages/apply/stride-list.vue
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
- 跨单位就餐
-
- {{ hooks.useTime(v.createTime, "") }}
-
- 待审核
- 已通过
- 已拒绝
-
-
-
-
-
-
- 数量
- {{ v.count }}
-
-
- 已使用
- {{ v.useCount }}
-
-
-
-
-
-
- 审核人
- {{ v.checkUserName }}
-
-
- 审核时间
- {{ hooks.useTime(v.checkTime, "") }}
-
-
-
-
- 使用
- 查看
-
-
-
-
- 申请
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ 跨单位就餐
+
+ {{ hooks.useTime(v.createTime, "") }}
+
+ 待审核
+ 已通过
+ 已拒绝
+
+
+
+
+
+
+ 数量
+ {{ v.count }}
+
+
+ 已使用
+ {{ v.useCount }}
+
+
+
+
+
+
+ 审核人
+ {{ v.checkUserName }}
+
+
+ 审核时间
+ {{ hooks.useTime(v.checkTime, "") }}
+
+
+
+
+ 使用
+ 查看
+
+
+
+
+ 申请
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/src/pages/boxes/apply-list.vue b/src/pages/boxes/apply-list.vue
index 4747812..157f7f7 100644
--- a/src/pages/boxes/apply-list.vue
+++ b/src/pages/boxes/apply-list.vue
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ v.boxesName }}
-
- 预约成功
- 预约失败
- 取消预约
-
-
-
- 预约时间
-
- {{ v.bookingDate }} {{ hooks.useTime(v.startTime, "{h}:{i}") }} ~ {{
- hooks.useTime(v.endTime, "{h}:{i}")
- }}
-
-
-
- 提交时间
-
- {{ hooks.useTime(v.createTime, "") }}
-
-
-
- 审批状态:
- 审批中
- 审批通过
- 审批不通过
- 已取消
-
-
-
- 取消预约
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ {{ v.boxesName }}
+
+ 预约成功
+ 预约失败
+ 取消预约
+
+
+
+ 预约时间
+
+ {{ v.bookingDate }} {{ hooks.useTime(v.startTime, "{h}:{i}") }} ~ {{ hooks.useTime(v.endTime, "{h}:{i}") }}
+
+
+
+ 提交时间
+
+ {{ hooks.useTime(v.createTime, "") }}
+
+
+
+ 审批状态:
+ 审批中
+ 审批通过
+ 审批不通过
+ 已取消
+
+
+
+ 取消预约
+
+
+
+
diff --git a/src/pages/boxes/detail.vue b/src/pages/boxes/detail.vue
index fa80b22..071d15b 100644
--- a/src/pages/boxes/detail.vue
+++ b/src/pages/boxes/detail.vue
@@ -6,8 +6,6 @@ import { isEmpty } from "radash"
import { router } from "@@/index"
import { boxesApi } from "@@/api"
-import zSwiper from "@zebra-ui/swiper/components/z-swiper/z-swiper.vue"
-import zSwiperItem from "@zebra-ui/swiper/components/z-swiper-item/z-swiper-item.vue"
import { filePath } from "@/sheep/utils/file"
const state = reactive({
@@ -38,12 +36,20 @@ const doSubmit = () => {
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/pages/merchant/detail.vue b/src/pages/merchant/detail.vue
index 9523232..f51ca1b 100644
--- a/src/pages/merchant/detail.vue
+++ b/src/pages/merchant/detail.vue
@@ -2,27 +2,23 @@
import { reactive, nextTick } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
-
import { hooks, router } from "@@/index"
import { merchantApi, foodApi, payApi } from "@@/api"
-
import { filePath } from "@@/utils/file"
-import zSwiper from "@zebra-ui/swiper/components/z-swiper/z-swiper.vue"
-import zSwiperItem from "@zebra-ui/swiper/components/z-swiper-item/z-swiper-item.vue"
-
import ProductRow from "./components/product-row.vue"
import ProductCar from "./components/product-car.vue"
import ProductTotal from "./components/product-total.vue"
const state = reactive({
detailId: null,
+ canteenDetail: {},
+
totPrice: 0,
totCount: 0,
currentClassifyIndex: 0,
showCarDialog: false,
- detail: {},
carList: [],
classifyList: [],
shopList: [],
@@ -39,20 +35,16 @@ onShow(() => {
getClassify()
})
+// 获取食堂详情信息
const getDetail = async () => {
- uni.showLoading({
- title: "加载中...",
- mask: true,
- })
- const _pa = { id: state.detailId }
- const { data } = await merchantApi.detail(_pa)
- state.detail = data
+ uni.showLoading({ title: "加载中...", mask: true })
+ const { code, data } = await merchantApi.detail({ id: state.detailId })
+ if (code == 0) state.canteenDetail = data
uni.hideLoading()
}
const getShopCar = async () => {
- const _pa = { merchantId: state.detailId, hardType: "CANTEEN" }
- const { data } = await foodApi.getShopCar(_pa)
+ const { data } = await foodApi.getShopCar({ merchantId: state.detailId, hardType: "CANTEEN" })
state.carList = data ?? []
if (isEmpty(state.carList)) {
state.shopList.forEach((v: any) => {
@@ -204,11 +196,11 @@ const getHeight = () => {
}
const doPhone = () => {
- if (isEmpty(state.detail.phone)) {
+ if (isEmpty(state.canteenDetail.phone)) {
uni.showToast({ title: "该商户没有预留电话", icon: "none" })
return
}
- hooks.useMakePhoneCall(state.detail.phone)
+ hooks.useMakePhoneCall(state.canteenDetail.phone)
}
const doFood = () => {
router.jump("/pages/merchant/food", { merchantId: state.detailId })
@@ -218,43 +210,49 @@ const doFood = () => {
-
-
-
-
-
-
-
+
+
+
+
+
+
-
+
- {{ state.detail.name }}
+ {{ state.canteenDetail.name }}
- {{ state.detail.deptName }}
+ {{ state.canteenDetail.deptName }}
营业时间:
- {{ state.detail.jobTime?.split(",")[0] ? "早:" + state.detail.jobTime?.split(",")[0] : "" }}
+ {{ state.canteenDetail.jobTime?.split(",")[0] ? "早:" + state.canteenDetail.jobTime?.split(",")[0] : "" }}
- {{ state.detail.jobTime?.split(",")[1] ? "中:" + state.detail.jobTime?.split(",")[1] : "" }}
+ {{ state.canteenDetail.jobTime?.split(",")[1] ? "中:" + state.canteenDetail.jobTime?.split(",")[1] : "" }}
- {{ state.detail.jobTime?.split(",")[2] ? "晚:" + state.detail.jobTime?.split(",")[2] : "" }}
+ {{ state.canteenDetail.jobTime?.split(",")[2] ? "晚:" + state.canteenDetail.jobTime?.split(",")[2] : "" }}
-
+
食堂地址:
- {{ state.detail.addressDes }}
+ {{ state.canteenDetail.addressDes }}
@@ -287,8 +285,9 @@ const doFood = () => {
-
+
+
{
:list="foodList"
:gutter="10"
:breakpoints="{
- 1200: { rowPerView: 4 },
- 800: { rowPerView: 3 },
- 375: { rowPerView: 2 },
+ 1800: { rowPerView: 4 },
+ 1400: { rowPerView: 3 },
+ 975: { rowPerView: 2 },
}"
:hasAroundGutter="false"
backgroundColor="#ffffff00"
diff --git a/src/pages/merchant/index.vue b/src/pages/merchant/index.vue
deleted file mode 100644
index 57a4924..0000000
--- a/src/pages/merchant/index.vue
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/pages/merchant/product-detail.vue b/src/pages/merchant/product-detail.vue
index 83b3844..5df0695 100644
--- a/src/pages/merchant/product-detail.vue
+++ b/src/pages/merchant/product-detail.vue
@@ -2,11 +2,8 @@
import { reactive } from "vue"
import { onLoad, onShow } from "@dcloudio/uni-app"
import { isEmpty } from "radash"
-import { hooks } from "@@/index"
import { productApi } from "@@/api"
import { filePath } from "@@/utils/file"
-import zSwiper from "@zebra-ui/swiper/components/z-swiper/z-swiper.vue"
-import zSwiperItem from "@zebra-ui/swiper/components/z-swiper-item/z-swiper-item.vue"
const state = reactive({
detailId: null,
diff --git a/src/pages/order/detail.vue b/src/pages/order/detail.vue
index c39dcdb..fbf3350 100644
--- a/src/pages/order/detail.vue
+++ b/src/pages/order/detail.vue
@@ -1,14 +1,13 @@
diff --git a/src/pages/pay/scanPay.vue b/src/pages/pay/scanPay.vue
index 19ee234..5ab4651 100644
--- a/src/pages/pay/scanPay.vue
+++ b/src/pages/pay/scanPay.vue
@@ -1,71 +1,36 @@
- {{ scanData.name }}
+ {{ scanData.name }}
¥
{{ displayAmount }}
- 支付
-
-
-
- {{ key }}
+
+ 选择支付钱包:
+
+
+
+ {{ v.walletTypeName }}
+
+
+ 余额:{{ hooks.useMoney(v.balance) }}
+ 元
-
-
- .
-
-
- 0
-
-
-
-
-
-
+
+
+ 支付
+
+
@@ -77,24 +42,38 @@ import { usePayStore } from "@/sheep/stores/pay"
import payApi from "@@/api/pay"
import { storePrice } from "@/sheep/utils/formatMoney"
import { router } from "@/sheep"
+import { merchantApi, walletApi } from "@/sheep/api"
+import numberKeyboard from "@/sheep/components/numberKeyboard.vue"
+import { filePath } from "@/sheep/utils/file"
+import { hooks } from "@@/index"
const amount = ref("")
-const keyboardLayout = ref([
- ["1", "2", "3"],
- ["4", "5", "6"],
- ["7", "8", "9"],
-])
const scanData = ref<{ id?: string; name?: string }>({})
const disabled = ref(false)
+const walletList = ref([])
+const curWalletId = ref("")
-onShow(() => {
- scanData.value = usePayStore().payData
- if (scanData.value.id && scanData.value.name) {
+onShow(async () => {
+ uni.showLoading({ title: "加载中...", mask: true })
+ scanData.value.id = usePayStore().payData.id
+ if (scanData.value.id) {
+ const { data } = await merchantApi.detail({ id: scanData.value.id })
+ scanData.value.name = data.name
+ usePayStore().setPayData(scanData.value)
disabled.value = false
} else {
uni.showToast({ title: "扫码信息不存在", icon: "none" })
disabled.value = true
}
+
+ const res = await walletApi.all()
+ if (res.code == 0) {
+ walletList.value = res.data.records
+ if (walletList.value.length > 0) {
+ curWalletId.value = walletList.value.find((v: any) => v.walletTypeUniqueCode == "1").id
+ }
+ }
+ uni.hideLoading()
})
const displayAmount = computed(() => {
@@ -107,27 +86,6 @@ const displayAmount = computed(() => {
)
})
-// 按下键盘
-const handleKeyPress = (key) => {
- if (key === "." && amount.value.includes(".")) return
- if (key === "." && !amount.value) {
- amount.value = "0."
- return
- }
-
- if (amount.value.includes(".")) {
- const decimalPlaces = amount.value.split(".")[1]
- if (decimalPlaces && decimalPlaces.length >= 2) return
- }
-
- amount.value += key
-}
-
-// 点击删除
-const handleDelete = () => {
- amount.value = amount.value.slice(0, -1)
-}
-
// 点击支付
const handlePay = () => {
if (!scanData.value.id || !scanData.value.name) return uni.showToast({ title: "扫码信息不存在", icon: "none" })
@@ -156,19 +114,17 @@ const pay = async () => {
const res = await payApi.createQrCodeOrder({
merchantId: scanData.value.id,
customPrice: storePrice(Number(amount.value)),
+ walletId: curWalletId.value,
})
if (res.code != 0) {
- throw new Error()
- }
-
- uni.showToast({ title: "支付成功", icon: "success" })
- usePayStore().payData = {}
- setTimeout(() => {
- router.back()
+ uni.showToast({ title: res.msg || "支付失败", icon: "error" })
+ } else {
uni.hideLoading()
- }, 1000)
+ usePayStore().setPayData({ ...scanData.value, customPrice: Number(amount.value).toFixed(2) })
+ router.jump("/pages/pay/payComplete", {}, 2)
+ }
} catch (error: any) {
- // uni.showToast({ title: "错误", icon: "error" })
+ uni.showToast({ title: "错误", icon: "error" })
uni.hideLoading()
}
}
diff --git a/src/pages/pay/transferMoney.vue b/src/pages/pay/transferMoney.vue
new file mode 100644
index 0000000..80bbb7d
--- /dev/null
+++ b/src/pages/pay/transferMoney.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+ {{ transferMoney.sourceWalletType.walletTypeName }}
+
+
+ 余额:
+ {{ hooks.useMoney(transferMoney.sourceWalletType.balance) + "元" }}
+
+
+
+
+
+
+ 转入到
+
+
+ {{ state.targetWalletTypeName }}
+
+
+
+
+
+ 转账金额
+
+ ¥
+ 转账金额
+ {{ formattedAmount }}
+
+
+
+
+
+ 注:转账金额不能超过钱包余额
+
+
+
+
+ 确定转账
+
+
+
+
+
+
+
+
+
+
+
+ {{ v.walletTypeName }}
+ {{ v.cardNumber }}
+
+
+ 余额:{{ hooks.useMoney(v.balance) + "元" }}
+
+
+
+
+
+ 确 定
+
+
+
+
+
+
+
diff --git a/src/pages/refund/apply.vue b/src/pages/refund/apply.vue
index b75392f..848c33e 100644
--- a/src/pages/refund/apply.vue
+++ b/src/pages/refund/apply.vue
@@ -119,34 +119,34 @@ const doSubmit = async () => {
-
-
-
-
-
- {{ v.productName }}
- ¥ {{ hooks.useMoney(v.productPrice) }}
- x {{ v.productCount }}
-
-
-
- ¥ {{ hooks.useMoney(v.totalPrice) }}
+
+
+
+
+
+ {{ v.productName }}
+ ¥ {{ hooks.useMoney(v.productPrice) }}
+ x {{ v.productCount }}
-
-
- 实付款
-
- ¥
- {{ hooks.useMoney(state.detail.payPrice) }}
-
+
+ ¥ {{ hooks.useMoney(v.totalPrice) }}
+
+
+ 实付款
+
+ ¥
+ {{ hooks.useMoney(state.detail.payPrice) }}
+
+
+
售后类型
@@ -208,5 +208,3 @@ const doSubmit = async () => {
-
-
diff --git a/src/pages/shop/brandDetail.vue b/src/pages/shop/brandDetail.vue
new file mode 100644
index 0000000..422a3c0
--- /dev/null
+++ b/src/pages/shop/brandDetail.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ v.name.length > 7 ? v.name.substring(0, 7) + "..." : v.name }}
+ {{ v.deptName.length > 5 ? v.deptName.substring(0, 5) + "..." : v.deptName }}
+
+
+
+
+ {{ v.phone }}
+
+
+ 营业时间:
+ {{ v.jobTime?.split(",")[0] ? "早:" + v.jobTime?.split(",")[0] : "" }}
+ {{ v.jobTime?.split(",")[1] ? "中:" + v.jobTime?.split(",")[1] : "" }}
+ {{ v.jobTime?.split(",")[2] ? "晚:" + v.jobTime?.split(",")[2] : "" }}
+
+
+
+ 地址:
+ {{ v.addressDes }}
+
+
+
+
+
+
+
+
diff --git a/src/pages/shop/detail.vue b/src/pages/shop/detail.vue
index 7ccdddc..43ead01 100644
--- a/src/pages/shop/detail.vue
+++ b/src/pages/shop/detail.vue
@@ -1,47 +1,114 @@
-
-
-
-
-
-
-
+
+
+
+
+
-
+
- {{ state.detail.name }}
- {{ state.detail.deptName }}
+
+ {{ state.detail.name?.length > 7 ? state.detail.name.substring(0, 7) + "..." : state.detail.name }}
+
+
+ {{ state.detail.deptName?.length > 5 ? state.detail.deptName.substring(0, 5) + "..." : state.detail.deptName }}
+
- {{ state.detail.phone }}
-
- 营业时间:
- {{ state.detail.jobTime?.split(",")[0] ? "早:" + state.detail.jobTime?.split(",")[0] : "" }}
- {{ state.detail.jobTime?.split(",")[1] ? "中:" + state.detail.jobTime?.split(",")[1] : "" }}
- {{ state.detail.jobTime?.split(",")[2] ? "晚:" + state.detail.jobTime?.split(",")[2] : "" }}
-
-
- 地址
- {{ state.detail.addressDes }}
+
+
+
+ {{ state.detail.phone }}
+
+ 联系商家
+
+
+
+ {{ state.detail.jobTime == ",," ? "" : "营业时间:" }}
+ {{ state.detail.jobTime?.split(",")[0] ? "早:" + state.detail.jobTime?.split(",")[0] : "" }}
+ {{ state.detail.jobTime?.split(",")[1] ? "中:" + state.detail.jobTime?.split(",")[1] : "" }}
+ {{ state.detail.jobTime?.split(",")[2] ? "晚:" + state.detail.jobTime?.split(",")[2] : "" }}
+
+
+
+ 地址:
+ {{ state.detail.addressDes }}
+
-
-
+
+
+
+
-
\ No newline at end of file
+
diff --git a/vite.config.ts b/vite.config.ts
index 6c8ef9b..4582207 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,48 +1,48 @@
-import path from "path";
+import path from "path"
-import { defineConfig, loadEnv } from "vite";
-import uni from "@dcloudio/vite-plugin-uni";
-import Unocss from "unocss/vite";
+import { defineConfig, loadEnv } from "vite"
+import uni from "@dcloudio/vite-plugin-uni"
+import Unocss from "unocss/vite"
-import { useRouter } from "./src/sheep";
+import { useRouter } from "./src/sheep"
export default defineConfig(({ mode }) => {
- const { NODE_ENV, VITE_APP_DEV_SERVICE, VITE_APP_PROD_SERVICE, VITE_IMAGE_BASE_PATH } = loadEnv(mode, process.cwd(), "");
- const baseUrl = NODE_ENV == "development" ? VITE_APP_DEV_SERVICE : VITE_APP_PROD_SERVICE;
- return {
- build: {
- target: "es6",
- },
- plugins: [
- uni(),
- Unocss(),
- {
- ...useRouter({
- pagesJsonDir: path.resolve(__dirname, "./src/pages.json"),
- includes: ["meta"],
- }),
- enforce: "post",
- },
- ],
- resolve: {
- alias: {
- "@": path.resolve(__dirname, "./src"),
- "@@": path.resolve(__dirname, "./src/sheep"),
- },
- },
- server: {
- host: "0.0.0.0",
- port: 8888,
- hmr: true,
- proxy: {
- "/api": {
- target: baseUrl,
- ws: true,
- changeOrigin: true,
- rewrite: (path) => path.replace(/^\/api/, ""),
- },
- },
- },
- define: {},
- };
-});
+ const { NODE_ENV, VITE_APP_DEV_SERVICE, VITE_APP_PROD_SERVICE, VITE_IMAGE_DEV_PATH } = loadEnv(mode, process.cwd(), "")
+ const baseUrl = NODE_ENV == "development" ? VITE_APP_DEV_SERVICE : VITE_APP_PROD_SERVICE
+ return {
+ build: {
+ target: "es6",
+ },
+ plugins: [
+ uni(),
+ Unocss(),
+ {
+ ...useRouter({
+ pagesJsonDir: path.resolve(__dirname, "./src/pages.json"),
+ includes: ["meta"],
+ }),
+ enforce: "post",
+ },
+ ],
+ resolve: {
+ alias: {
+ "@": path.resolve(__dirname, "./src"),
+ "@@": path.resolve(__dirname, "./src/sheep"),
+ },
+ },
+ server: {
+ host: "0.0.0.0",
+ port: 8888,
+ hmr: true,
+ proxy: {
+ "/api": {
+ target: baseUrl,
+ ws: true,
+ changeOrigin: true,
+ rewrite: (path) => path.replace(/^\/api/, ""),
+ },
+ },
+ },
+ define: {},
+ }
+})