fix(custom): 修复若干问题

This commit is contained in:
2024-03-07 18:55:38 +08:00
parent fbbdecf2e0
commit 714b980b28
21 changed files with 292 additions and 155 deletions

View File

@@ -50,7 +50,7 @@ const config = {
prebundle: { enable: false },
},
cache: {
enable: false, // Webpack 持久化缓存配置建议开启。默认配置请参考https://docs.taro.zone/docs/config-detail#cache
enable: true, // Webpack 持久化缓存配置建议开启。默认配置请参考https://docs.taro.zone/docs/config-detail#cache
},
sass: {
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`,

View File

@@ -67,3 +67,7 @@ export const editAfterOrder = (data: object) =>
// 生成付款二维码
export const createPayQr = (data: object) =>
request("/later/order/pay", data, "POST");
// 检查手机号码是否存在
export const checkPhone = (data: object) =>
request("/user/find/phone", data, "POST");

View File

@@ -140,7 +140,7 @@ const create_order = async () => {
res = await createAfterOrder(data);
await get_cart_list();
Taro.navigateTo({
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${props.merInfo.oid}&bid=${props.merInfo.bid}`,
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
});
} else {
res = await createActiveOrder({
@@ -175,13 +175,13 @@ defineExpose({
<view class="container">
<view>购物车数量: {{ cartInfo.count }}</view>
<view v-if="cartInfo.count > 0">
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text
>,
<text>总积分: {{ cartInfo.exchange.toFixed(2) }}</text>
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text
>
<text v-if="!IsPendingOrder">总积分: {{ cartInfo.exchange.toFixed(2) }}</text>
</view>
</view>
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
>立即结算</view
>立即下单</view
>
</view>
<!-- 购物车弹窗 -->

View File

@@ -33,3 +33,14 @@
}
}
}
.nut-dialog__header {
text-align: left;
font-weight: bold;
font-size: 36px;
height: auto;
}
.nut-dialog__content {
text-align: left !important;
font-size: 28px;
}

View File

@@ -42,6 +42,15 @@
>
</form>
</view>
<nut-dialog v-model:visible="visible" no-cancel-btn>
<template #header>提示</template>
<template #default
>客户手机号:
<text style="color: #fd0100">{{ formVal.phone }}</text>
没有注册捷兑
请通知他登录捷兑通小程序注册</template
>
</nut-dialog>
</view>
</template>
@@ -49,6 +58,7 @@
import { ref } from "vue";
import Taro from "@tarojs/taro";
import BackComponent from "../../../../components/Back.vue";
import { checkPhone } from "../../../../api/admin";
const formVal = ref({
seat: "",
@@ -56,12 +66,26 @@ const formVal = ref({
notes: "",
});
const visible = ref(false);
const formSubmit = async ({ detail }: any) => {
if (!detail.value.seat || !detail.value.phone)
if (!detail.value.seat)
return Taro.showToast({
title: "请填写完整信息",
title: "请填写台号",
icon: "none",
});
if (
!/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(
detail.value.phone
)
)
return Taro.showToast({
title: "请输入正确的手机号码",
icon: "none",
});
try {
const res = await checkPhone({ phone: detail.value.phone });
console.log(res);
const user_info = await Taro.getStorageSync("userInfo");
Taro.navigateTo({
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}&notes=${formVal.value.notes}`,
@@ -73,6 +97,10 @@ const formSubmit = async ({ detail }: any) => {
};
},
});
} catch (error) {
console.log(error);
visible.value = true;
}
};
</script>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "挂帐订单",
navigationBarTitleText: "后结订单",
});

View File

@@ -108,7 +108,7 @@ const ok = async () => {
});
Taro.setStorageSync("pay_code", res.data.data.code_url);
Taro.navigateTo({
url: `/pages/admin/add_order/pending_order/wx_pay_code/index`,
url: `/pages/admin/add_order/pending_order/wx_pay_code/index?oid=${data.value.oid}&bid=${data.value.bid}`,
});
};
</script>

View File

@@ -1,3 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "订单详情",
navigationStyle: "custom",
});

View File

@@ -2,7 +2,7 @@
width: 710px;
background: #ffffff;
border-radius: 12px;
margin: 20px auto;
margin: auto;
box-sizing: border-box;
.header {

View File

@@ -1,6 +1,7 @@
<template>
<view>
<view class="card">
<back-component title="订单详情" />
<view class="card" style="margin-top: 115px">
<view class="header">
<view>
<text>台号: {{ data.seat }}</text>
@@ -43,8 +44,16 @@
<nut-cell title="订单号" :desc="data.oid"></nut-cell>
<nut-cell title="点单人" :desc="data.PlaceUser?.nickName"></nut-cell>
<nut-cell title="下单时间" :desc="data.add_time"></nut-cell>
<nut-cell title="收款时间" :desc="data.payment_time"></nut-cell>
<nut-cell title="挂帐时间" :desc="data.payment_time"></nut-cell>
<nut-cell
v-if="data.status !== 0"
title="收款时间"
:desc="data.payment_time"
></nut-cell>
<nut-cell
v-if="data.status !== 0 && data.status !== 1"
title="挂帐时间"
:desc="data.payment_time"
></nut-cell>
<nut-cell
title="订单状态"
:desc="get_status_text(data.status)"
@@ -52,9 +61,21 @@
<nut-cell title="下单数量" :desc="String(data.count)"></nut-cell>
<nut-cell title="订单金额" :desc="String(data.payments)"></nut-cell>
<nut-cell title="应收金额" :desc="String(data.payments)"></nut-cell>
<nut-cell title="实收金额" :desc="String(data.pay_amount)"></nut-cell>
<nut-cell title="抹零" :desc="String(data.zero)"></nut-cell>
<nut-cell title="收款方式" desc="微信"></nut-cell>
<nut-cell
v-if="data.status !== 0"
title="实收金额"
:desc="String(data.pay_amount)"
></nut-cell>
<nut-cell
v-if="data.status !== 0"
title="抹零"
:desc="String(data.zero)"
></nut-cell>
<nut-cell
v-if="data.status !== 0"
title="收款方式"
desc="微信"
></nut-cell>
<nut-cell title="备注" :desc="data.notes"></nut-cell>
</nut-cell-group>
</view>
@@ -65,6 +86,7 @@ import { ref } from "vue";
import Taro from "@tarojs/taro";
import Footer from "../components/Footer.vue";
import { getAfterOrder } from "@/api/admin";
import BackComponent from "../../../../../components/Back.vue";
const data = ref<any>({});

View File

@@ -13,11 +13,39 @@
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { getAfterOrder } from "@/api/admin";
const code = ref("");
Taro.useLoad(() => {
const time_id = ref();
const info = ref<any>({});
Taro.useLoad((e) => {
info.value = e;
code.value = Taro.getStorageSync("pay_code");
time_id.value = setInterval(async () => {
const { data } = await getAfterOrder({
bid: info.value.bid,
oid: info.value.oid,
});
if (data.data.status !== 0) {
clearInterval(time_id.value);
Taro.showToast({
title: "支付成功",
icon: "success",
});
setTimeout(() => {
Taro.navigateTo({
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${info.value.oid}&bid=${info.value.bid}`
});
}, 3000);
}
}, 1000);
});
Taro.useDidHide(() => {
clearInterval(time_id.value);
});
</script>

View File

@@ -0,0 +1,85 @@
.tabs-1 {
display: flex;
box-sizing: border-box;
justify-content: space-between;
align-items: center;
background-color: #fff;
padding: 10px;
overflow-x: scroll;
.item {
display: flex;
flex-direction: column;
align-items: center;
.line {
margin-top: 10px auto;
width: 50px;
height: 5px;
}
}
}
.order-card {
width: 95%;
box-sizing: border-box;
margin: 15px auto;
background-color: #fff;
border-radius: 10px;
padding: 20px;
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px;
}
.top {
// display: flex;
// justify-content: space-between;
// align-items: center;
.name {
font-weight: bold;
}
.sub {
color: #999;
font-size: 30px;
}
}
.btn {
display: flex;
justify-content: flex-end;
align-items: center;
}
.center {
.top {
display: flex;
justify-content: space-between;
// align-items: flex-start;
image {
width: 150px;
height: 150px;
}
.title {
margin-left: 10px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
width: 350px;
}
.right {
margin-left: 10px;
font-size: 28px;
text-align: right;
}
}
}
}

View File

@@ -1,13 +1,13 @@
<template>
<view>
<view class="tabs">
<view class="tabs-1">
<view
class="item"
v-for="item in opt"
:key="item.value"
v-for="(item, index) in opt"
:key="index"
@click="tabChange(item.value)"
>
<view class="title">{{ item.text }}</view>
<view>{{ item.text }}</view>
<view
class="line"
:style="{
@@ -119,6 +119,7 @@ const getData = async () => {
};
const tabChange = (e: number) => {
console.log(e);
tabVal.value = e;
getData();
};
@@ -132,88 +133,5 @@ const toDetailPage = (item: any) => {
</script>
<style lang="scss">
.tabs {
display: flex;
justify-content: space-evenly;
align-items: center;
background-color: #fff;
padding: 10px;
.item {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
.line {
margin-top: 10px;
width: 50px;
height: 5px;
}
}
}
.order-card {
width: 95%;
box-sizing: border-box;
margin: 15px auto;
background-color: #fff;
border-radius: 10px;
padding: 20px;
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px;
}
.top {
// display: flex;
// justify-content: space-between;
// align-items: center;
.name {
font-weight: bold;
}
.sub {
color: #999;
font-size: 30px;
}
}
.btn {
display: flex;
justify-content: flex-end;
align-items: center;
}
.center {
.top {
display: flex;
justify-content: space-between;
// align-items: flex-start;
image {
width: 150px;
height: 150px;
}
.title {
margin-left: 10px;
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
width: 350px;
}
.right {
margin-left: 10px;
font-size: 28px;
text-align: right;
}
}
}
}
@import "./index.scss";
</style>

View File

@@ -125,12 +125,47 @@
<nut-grid :gutter="10" :border="false">
<nut-grid-item
:border="false"
v-for="(item, index) in store_menu_list"
:key="index"
:text="item.text"
@click="toPage(item.path)"
v-if="userInfo.data.permission.dd"
text="点单"
@click="toPage('/pages/admin/add_order/index')"
>
<IconFont size="50" :name="item.icon"></IconFont>
<IconFont
size="50"
:name="require('../../static/user/1-1.png')"
></IconFont>
</nut-grid-item>
<nut-grid-item
:border="false"
v-if="userInfo.data.permission.hx"
text="订单核销"
@click="toPage('/pages/admin/verify/index')"
>
<IconFont
size="50"
:name="require('../../static/user/1-2.png')"
></IconFont>
</nut-grid-item>
<nut-grid-item
:border="false"
v-if="userInfo.data.permission.tj"
text="订单统计"
@click="toPage('/pages/admin/order_manage/index')"
>
<IconFont
size="50"
:name="require('../../static/user/1-3.png')"
></IconFont>
</nut-grid-item>
<nut-grid-item
:border="false"
v-if="userInfo.data.permission.tx"
text="收益提现"
@click="toPage('/pages/admin/withdrawal/index')"
>
<IconFont
size="50"
:name="require('../../static/user/1-4.png')"
></IconFont>
</nut-grid-item>
</nut-grid>
</view>
@@ -166,6 +201,7 @@ interface UserInfo {
bid?: string;
phone?: string;
uid?: string;
permission?: any;
};
store_status?: number;
store_name?: string;
@@ -189,8 +225,14 @@ const getUserInfo = async () => {
title: "加载中",
});
const res = await getPersonalInfo();
userInfo.value = res.data;
Taro.setStorageSync("userInfo", res.data);
userInfo.value = {
...res.data,
data: {
...res.data.data,
permission: JSON.parse(res.data.data.permission),
},
};
Taro.setStorageSync("userInfo", userInfo.value);
isLogin.value = true;
cancelLogin();
Taro.hideLoading();
@@ -218,9 +260,9 @@ const toOrderList = (e: number) => {
const userMenuList = ref([
{
id: 0,
label: "挂帐订单",
label: "后结订单",
url: "/pages/users/pending_order/index",
icon: "http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png",
icon: require("../../static/user/dd.png"),
},
{
id: 1,
@@ -254,34 +296,6 @@ const userMenuList = ref([
// }
]);
const store_menu_list = ref([
{
text: "点单",
path: "/pages/admin/add_order/index",
icon: "https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png",
},
{
text: "订单核销",
path: "/pages/admin/verify/index",
icon: "https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png",
},
{
text: "订单统计",
path: "/pages/admin/order_manage/index",
icon: "https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png",
},
{
text: "收益提现",
path: "/pages/admin/withdrawal/index",
icon: "https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png",
},
// {
// text: '商品管理',
// path: '/pages/product/list/index',
// icon: 'https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png'
// },
]);
const toSetting = () => {
Taro.navigateTo({
url: "/pages/users/setting/index",

View File

@@ -3,7 +3,21 @@ page {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.topTips {
box-sizing: border-box;
width: 100%;
background-color: #ff0000;
color: #ffffff;
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
image {
width: 150px;
height: 150px;
}
}
.tabs {
display: flex;
justify-content: space-between;

View File

@@ -1,5 +1,17 @@
<template>
<view>
<view class="topTips">
<view>
<view style="font-weight: bold">订单信息</view>
<view style="font-size: 15px"
>总赠送游戏豆{{ 0 }}
</view>
<view style="font-size: 15px"
>总计积分{{ 0 }}
</view>
</view>
<image src="../static/user/order_list_top.png" />
</view>
<view class="tabs">
<view
class="item"

BIN
src/static/user/1-1.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
src/static/user/1-2.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
src/static/user/1-3.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

BIN
src/static/user/1-4.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

BIN
src/static/user/dd.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB