feat(custom): 新增后结订单
This commit is contained in:
1
components.d.ts
vendored
1
components.d.ts
vendored
@@ -8,6 +8,7 @@ export {}
|
||||
declare module '@vue/runtime-core' {
|
||||
export interface GlobalComponents {
|
||||
Auth: typeof import('./src/components/Auth.vue')['default']
|
||||
Back: typeof import('./src/components/Back.vue')['default']
|
||||
Cart: typeof import('./src/components/Cart.vue')['default']
|
||||
MerList: typeof import('./src/components/MerList.vue')['default']
|
||||
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
|
||||
|
||||
42
package.json
42
package.json
@@ -61,22 +61,22 @@
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.23.5",
|
||||
"@nutui/icons-vue-taro": "^0.0.9",
|
||||
"@nutui/nutui-taro": "^4.2.4",
|
||||
"@nutui/nutui-taro": "^4.3.0",
|
||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||
"@tarojs/components": "3.6.20",
|
||||
"@tarojs/helper": "3.6.20",
|
||||
"@tarojs/plugin-framework-vue3": "3.6.20",
|
||||
"@tarojs/plugin-html": "3.6.20",
|
||||
"@tarojs/plugin-platform-alipay": "3.6.20",
|
||||
"@tarojs/plugin-platform-h5": "3.6.20",
|
||||
"@tarojs/plugin-platform-jd": "3.6.20",
|
||||
"@tarojs/plugin-platform-qq": "3.6.20",
|
||||
"@tarojs/plugin-platform-swan": "3.6.20",
|
||||
"@tarojs/plugin-platform-tt": "3.6.20",
|
||||
"@tarojs/plugin-platform-weapp": "3.6.20",
|
||||
"@tarojs/runtime": "3.6.20",
|
||||
"@tarojs/shared": "3.6.20",
|
||||
"@tarojs/taro": "3.6.20",
|
||||
"@tarojs/components": "3.6.23",
|
||||
"@tarojs/helper": "3.6.23",
|
||||
"@tarojs/plugin-framework-vue3": "3.6.23",
|
||||
"@tarojs/plugin-html": "3.6.23",
|
||||
"@tarojs/plugin-platform-alipay": "3.6.23",
|
||||
"@tarojs/plugin-platform-h5": "3.6.23",
|
||||
"@tarojs/plugin-platform-jd": "3.6.23",
|
||||
"@tarojs/plugin-platform-qq": "3.6.23",
|
||||
"@tarojs/plugin-platform-swan": "3.6.23",
|
||||
"@tarojs/plugin-platform-tt": "3.6.23",
|
||||
"@tarojs/plugin-platform-weapp": "3.6.23",
|
||||
"@tarojs/runtime": "3.6.23",
|
||||
"@tarojs/shared": "3.6.23",
|
||||
"@tarojs/taro": "3.6.23",
|
||||
"dayjs": "^1.11.10",
|
||||
"pinia": "^2.1.7",
|
||||
"vue": "^3.3.9"
|
||||
@@ -85,22 +85,22 @@
|
||||
"@babel/core": "^7.23.5",
|
||||
"@commitlint/cli": "^18.4.3",
|
||||
"@commitlint/config-conventional": "^18.4.3",
|
||||
"@tarojs/cli": "3.6.20",
|
||||
"@tarojs/plugin-mini-ci": "3.6.20",
|
||||
"@tarojs/taro-loader": "3.6.20",
|
||||
"@tarojs/webpack5-runner": "3.6.20",
|
||||
"@tarojs/cli": "3.6.23",
|
||||
"@tarojs/plugin-mini-ci": "3.6.23",
|
||||
"@tarojs/taro-loader": "3.6.23",
|
||||
"@tarojs/webpack5-runner": "3.6.23",
|
||||
"@types/node": "^18.19.1",
|
||||
"@types/webpack-env": "^1.18.4",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
||||
"@typescript-eslint/parser": "^6.13.1",
|
||||
"@vue/babel-plugin-jsx": "^1.1.5",
|
||||
"@vue/compiler-sfc": "^3.3.9",
|
||||
"babel-preset-taro": "3.6.20",
|
||||
"babel-preset-taro": "3.6.23",
|
||||
"commitizen": "^4.3.0",
|
||||
"css-loader": "3.4.2",
|
||||
"cz-customizable": "^7.0.0",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-config-taro": "3.6.20",
|
||||
"eslint-config-taro": "3.6.23",
|
||||
"eslint-plugin-vue": "^9.19.2",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.1.0",
|
||||
|
||||
18096
pnpm-lock.yaml
generated
18096
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -39,3 +39,31 @@ export const getWithdrawList = (data: object) =>
|
||||
// 获取提现列表
|
||||
export const addWithdraw = (data: object) =>
|
||||
request("/store/withdraw/set", data, "POST");
|
||||
|
||||
/**
|
||||
* 后结api
|
||||
*/
|
||||
|
||||
// 创建后结订单
|
||||
export const createAfterOrder = (data: object) =>
|
||||
request("/later/order/place", data, "POST");
|
||||
|
||||
// 获取商家后结订单列表
|
||||
export const getAfterOrderList = (data: object) =>
|
||||
request("/later/store/user/order", data, "POST");
|
||||
|
||||
// 获取单个后结订单
|
||||
export const getAfterOrder = (data: object) =>
|
||||
request("/later/order/details", data, "POST");
|
||||
|
||||
// 确定挂帐
|
||||
export const confirmAfterOrder = (data: object) =>
|
||||
request("/later/order/onAccount", data, "POST");
|
||||
|
||||
// 修改台号/备注
|
||||
export const editAfterOrder = (data: object) =>
|
||||
request("/later/order/edit", data, "POST");
|
||||
|
||||
// 生成付款二维码
|
||||
export const createPayQr = (data: object) =>
|
||||
request("/later/order/pay", data, "POST");
|
||||
@@ -73,3 +73,15 @@ export const getSignRecord = () => request("/sign/pulse/count", {}, "POST");
|
||||
// 获取赠送总记录
|
||||
export const getGiftRecord = (data: object) =>
|
||||
request("/user/giftPulseRecord", data, "POST");
|
||||
|
||||
/**
|
||||
* 用户后结订单
|
||||
*/
|
||||
|
||||
// 获取用户后结订单列表
|
||||
export const getUserAfterOrderList = (data: object) =>
|
||||
request("/later/user/order", data, "POST");
|
||||
|
||||
// 获取用户后结订单详情
|
||||
export const getUserAfterOrderDetail = (data: object) =>
|
||||
request("/later/order/details", data, "POST");
|
||||
@@ -21,6 +21,8 @@ export default defineAppConfig({
|
||||
"distribution/userlist/index",
|
||||
"login/index",
|
||||
"bindPhone/index",
|
||||
"pending_order/index",
|
||||
"pending_order/pending_order_detail/index"
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -37,6 +39,13 @@ export default defineAppConfig({
|
||||
"verify/verify_list/index",
|
||||
"statistics/index",
|
||||
"withdrawal/index",
|
||||
"add_order/index",
|
||||
"add_order/add_table/index",
|
||||
"add_order/add_menu/index",
|
||||
"add_order/pending_order/index",
|
||||
"add_order/pending_order/pending_order_detail/index",
|
||||
"add_order/pending_order/pay/index",
|
||||
"add_order/pending_order/wx_pay_code/index",
|
||||
],
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
@import "static/iconfont/iconfont.css";
|
||||
@import "./static/iconfont/iconfont.css";
|
||||
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
// IOS安全区域
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
view {
|
||||
|
||||
74
src/components/Back.vue
Normal file
74
src/components/Back.vue
Normal file
@@ -0,0 +1,74 @@
|
||||
<template>
|
||||
<view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
|
||||
<view class="head-menu">
|
||||
<Left class="iconfont" @click="returns" />
|
||||
<view class="line"></view>
|
||||
<Home class="iconfont" @click="goHome" />
|
||||
</view>
|
||||
<text class="title">{{ props.title }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import { computed } from "vue";
|
||||
import { Home, Left } from "@nutui/icons-vue-taro";
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight as number;
|
||||
const BarHeight = computed(() => statusBarHeight - 7);
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
|
||||
const returns = () => {
|
||||
Taro.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
};
|
||||
|
||||
const goHome = () => {
|
||||
Taro.switchTab({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.head-wrapper {
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
left: 30px;
|
||||
height: 114px;
|
||||
}
|
||||
|
||||
.head-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 54px;
|
||||
width: 140px;
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border-radius: 27px;
|
||||
.line {
|
||||
width: 1px;
|
||||
height: 25px;
|
||||
background: #fff;
|
||||
}
|
||||
.iconfont {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 410px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -4,6 +4,7 @@ import Taro from "@tarojs/taro";
|
||||
import { addCart, getCart, clearCart } from "@/api/cart";
|
||||
import { Del2 } from "@nutui/icons-vue-taro";
|
||||
import { createActiveOrder } from "@/api/goods";
|
||||
import { createAfterOrder } from "@/api/admin";
|
||||
import Pay from "@/components/Pay.vue";
|
||||
|
||||
interface CardList {
|
||||
@@ -23,6 +24,11 @@ const props = defineProps({
|
||||
required: true,
|
||||
type: Object,
|
||||
},
|
||||
IsPendingOrder: {
|
||||
required: true,
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["updateCart"]);
|
||||
@@ -75,6 +81,7 @@ const get_cart_list = async () => {
|
||||
const res = await getCart({
|
||||
Bid: props.merInfo.bid,
|
||||
});
|
||||
|
||||
card_list.value = res.data.data || [];
|
||||
cartInfo.value = {
|
||||
count: 0,
|
||||
@@ -124,20 +131,36 @@ const closePay = (val: boolean) => {
|
||||
|
||||
const create_order = async () => {
|
||||
try {
|
||||
const { data: res } = await createActiveOrder({
|
||||
show.value = false;
|
||||
let res;
|
||||
if (props.IsPendingOrder) {
|
||||
const data = props.merInfo;
|
||||
delete data.$taroTimestamp;
|
||||
delete data.type;
|
||||
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}`,
|
||||
});
|
||||
} else {
|
||||
res = await createActiveOrder({
|
||||
Bid: [props.merInfo.bid],
|
||||
});
|
||||
if (res.oid) {
|
||||
if (res.data.oid) {
|
||||
orderData.value = res.oid;
|
||||
isShowPay.value = true;
|
||||
}
|
||||
}
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
// await get_cart_list();
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
|
||||
@@ -40,6 +40,19 @@
|
||||
/>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<!-- <nut-cell
|
||||
title="挂帐后结"
|
||||
desc="先消费后结账"
|
||||
is-link
|
||||
@click="goPay(3)"
|
||||
>
|
||||
<template v-slot:icon>
|
||||
<IconFont
|
||||
size="30"
|
||||
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
|
||||
/>
|
||||
</template>
|
||||
</nut-cell> -->
|
||||
</nut-cell-group>
|
||||
</view>
|
||||
</nut-popup>
|
||||
@@ -106,12 +119,13 @@ const goPay = async (type: number) => {
|
||||
icon: "none",
|
||||
});
|
||||
try {
|
||||
// 1微信支付 2积分支付 3挂帐
|
||||
if (type === 1 || type === 2) {
|
||||
const { data } = await payOrder({
|
||||
oid: prop.jfInfo,
|
||||
OrderType: prop.OrderType,
|
||||
PayType: type,
|
||||
});
|
||||
// 1微信支付 2积分支付
|
||||
if (type === 1) {
|
||||
if (data.data) {
|
||||
Taro.requestPayment({
|
||||
@@ -144,7 +158,7 @@ const goPay = async (type: number) => {
|
||||
});
|
||||
emit("closePay", false);
|
||||
}
|
||||
} else {
|
||||
} else if (type === 2) {
|
||||
Taro.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success",
|
||||
@@ -152,6 +166,12 @@ const goPay = async (type: number) => {
|
||||
});
|
||||
emit("successPay", false);
|
||||
}
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: "挂帐后结账",
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
|
||||
3
src/pages/admin/add_order/add_menu/index.config.ts
Normal file
3
src/pages/admin/add_order/add_menu/index.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "菜单",
|
||||
});
|
||||
67
src/pages/admin/add_order/add_menu/index.scss
Normal file
67
src/pages/admin/add_order/add_menu/index.scss
Normal file
@@ -0,0 +1,67 @@
|
||||
page {
|
||||
// IOS安全区域
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.good-class {
|
||||
margin-top: 10px;
|
||||
|
||||
.nut-tabs {
|
||||
height: 100vh;
|
||||
border-top: #fff 10px solid;
|
||||
}
|
||||
}
|
||||
|
||||
.list {
|
||||
.item {
|
||||
display: flex;
|
||||
margin-bottom: 10px;
|
||||
|
||||
image {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.right {
|
||||
flex: 1;
|
||||
margin-left: 5px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
// text-align: right;
|
||||
|
||||
.stock {
|
||||
margin-top: 10px;
|
||||
color: #8f8f8f;
|
||||
}
|
||||
|
||||
.name {
|
||||
// height: 20px;
|
||||
font-size: 28px;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.bom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-end;
|
||||
//margin-top: 10px;
|
||||
|
||||
.price {
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
173
src/pages/admin/add_order/add_menu/index.vue
Normal file
173
src/pages/admin/add_order/add_menu/index.vue
Normal file
@@ -0,0 +1,173 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 商品列表 -->
|
||||
<view class="good-class" v-if="class_list.length > 0">
|
||||
<nut-tabs
|
||||
v-model="value"
|
||||
title-scroll
|
||||
size="large"
|
||||
direction="vertical"
|
||||
title-gutter="5"
|
||||
animated-time="0"
|
||||
name="tabName"
|
||||
>
|
||||
<nut-tab-pane
|
||||
v-for="(itm, index) in good_list"
|
||||
:key="index"
|
||||
:title="itm.name"
|
||||
:pane-key="index"
|
||||
>
|
||||
<view v-if="itm.Goods.length > 0">
|
||||
<view class="list" v-for="(item, index) in itm.Goods" :key="index">
|
||||
<view class="item" @click.stop="toGoodDetails(item.gid, 1)">
|
||||
<image :src="item.cover" lazy-load />
|
||||
<view class="right">
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view class="stock">剩余:{{ item.stock }}</view>
|
||||
<view class="bom">
|
||||
<view>
|
||||
<view class="price">
|
||||
<text style="font-size: 15px">{{ item.number }}元</text>
|
||||
</view>
|
||||
<view class="price">
|
||||
<text style="font-size: 15px"
|
||||
>{{ item.exchange }}积分</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<nut-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click.stop="add_cart(item)"
|
||||
>
|
||||
<template #icon>
|
||||
<Cart2 />
|
||||
</template>
|
||||
</nut-button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty v-else description="该分类暂无商品"></nut-empty>
|
||||
<view style="height: 180rpx"></view>
|
||||
</nut-tab-pane>
|
||||
</nut-tabs>
|
||||
</view>
|
||||
<nut-empty v-else description="该商家暂无商品"></nut-empty>
|
||||
<!-- 购物车 -->
|
||||
<cart ref="cartRef" :mer-info="mer_info" @update-cart="updateCartNum" :IsPendingOrder="true" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Ref, ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import Cart from "../../../../components/Cart.vue";
|
||||
import { Cart2 } from "@nutui/icons-vue-taro";
|
||||
import { getGoodList, getMerCategory } from "../../../../api/goods";
|
||||
|
||||
interface goodList {
|
||||
ID: number;
|
||||
name: string;
|
||||
bid: string;
|
||||
Goods: GoodsType[];
|
||||
}
|
||||
|
||||
interface GoodsType {
|
||||
gid: string;
|
||||
cover: string;
|
||||
name: string;
|
||||
number: number;
|
||||
stock: number;
|
||||
cartNum: number;
|
||||
exchange: number;
|
||||
}
|
||||
|
||||
interface CartItems {
|
||||
bid: string;
|
||||
gid: string;
|
||||
number: number;
|
||||
price: number;
|
||||
cover: string;
|
||||
name: string;
|
||||
exchange: number;
|
||||
}
|
||||
|
||||
const value = ref("0");
|
||||
const good_list = ref<goodList[]>([]);
|
||||
const class_list = ref<
|
||||
Array<{
|
||||
ID?: number;
|
||||
name?: string;
|
||||
}>
|
||||
>([]);
|
||||
|
||||
Taro.useLoad(async (e) => {
|
||||
mer_info.value = e
|
||||
await get_class_list(e.bid);
|
||||
await cartRef.value.get_cart_list();
|
||||
});
|
||||
|
||||
const get_class_list = async (bid: string) => {
|
||||
const res = await getMerCategory({
|
||||
Bid: bid,
|
||||
});
|
||||
class_list.value = res.data.data || [];
|
||||
await get_good_list(class_list.value[0].ID as number, bid);
|
||||
};
|
||||
|
||||
const get_good_list = async (id: number, bid: string) => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
mask: true,
|
||||
});
|
||||
const res = await getGoodList({
|
||||
bid: bid,
|
||||
goods_class_id: id,
|
||||
status: 1,
|
||||
state: 1,
|
||||
});
|
||||
good_list.value = res.data.data || [];
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const toGoodDetails = (id: string, type: number) => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}`,
|
||||
});
|
||||
};
|
||||
|
||||
const cartRef = ref(null) as Ref;
|
||||
|
||||
const mer_info = ref<any>({});
|
||||
|
||||
const add_cart = (item: GoodsType) => {
|
||||
const num = item.cartNum ? Number(item.cartNum) + 1 : 1;
|
||||
cartRef.value.add_cart(item, num);
|
||||
};
|
||||
|
||||
const updateCartNum = (cartItems: CartItems[]) => {
|
||||
if (cartItems.length > 0) {
|
||||
good_list.value.forEach((category: goodList) => {
|
||||
category.Goods.forEach((good: GoodsType) => {
|
||||
cartItems.forEach((cartItem: CartItems) => {
|
||||
if (good.gid === cartItem.gid) {
|
||||
good.cartNum = cartItem.number;
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
} else {
|
||||
good_list.value.forEach((category: goodList) => {
|
||||
category.Goods.forEach((good: GoodsType) => {
|
||||
Reflect.deleteProperty(good, "cartNum");
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
4
src/pages/admin/add_order/add_table/index.config.ts
Normal file
4
src/pages/admin/add_order/add_table/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "填写信息",
|
||||
navigationStyle: "custom",
|
||||
});
|
||||
35
src/pages/admin/add_order/add_table/index.scss
Normal file
35
src/pages/admin/add_order/add_table/index.scss
Normal file
@@ -0,0 +1,35 @@
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
height: 100vh;
|
||||
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png");
|
||||
background-size: auto 40%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.form {
|
||||
margin-top: 250px;
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 15px;
|
||||
.label {
|
||||
width: 150px;
|
||||
height: 91px;
|
||||
line-height: 91px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 482px;
|
||||
height: 80px;
|
||||
background: #f5f5f5;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #ef5923;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
81
src/pages/admin/add_order/add_table/index.vue
Normal file
81
src/pages/admin/add_order/add_table/index.vue
Normal file
@@ -0,0 +1,81 @@
|
||||
<template>
|
||||
<view>
|
||||
<back-component title="填写信息" />
|
||||
<view class="container">
|
||||
<form class="form" @submit="formSubmit">
|
||||
<view class="form-item">
|
||||
<text class="label">台号:</text>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入台号,比如:包厢A01"
|
||||
name="seat"
|
||||
v-model="formVal.seat"
|
||||
required
|
||||
/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">手机号:</text>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入客人手机号码"
|
||||
name="phone"
|
||||
v-model="formVal.phone"
|
||||
required
|
||||
/>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">备注:</text>
|
||||
<input
|
||||
type="textarea"
|
||||
placeholder="备注"
|
||||
name="notes"
|
||||
v-model="formVal.notes"
|
||||
/>
|
||||
</view>
|
||||
<nut-button
|
||||
style="border-radius: 7px"
|
||||
type="primary"
|
||||
block
|
||||
shape="square"
|
||||
form-type="submit"
|
||||
>下一步</nut-button
|
||||
>
|
||||
</form>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import BackComponent from "../../../../components/Back.vue";
|
||||
|
||||
const formVal = ref({
|
||||
seat: "",
|
||||
phone: "",
|
||||
notes: "",
|
||||
});
|
||||
|
||||
const formSubmit = async ({ detail }: any) => {
|
||||
if (!detail.value.seat || !detail.value.phone)
|
||||
return Taro.showToast({
|
||||
title: "请填写完整信息",
|
||||
icon: "none",
|
||||
});
|
||||
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}¬es=${formVal.value.notes}`,
|
||||
success: () => {
|
||||
formVal.value = {
|
||||
seat: "",
|
||||
phone: "",
|
||||
notes: "",
|
||||
};
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
4
src/pages/admin/add_order/index.config.ts
Normal file
4
src/pages/admin/add_order/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "点单",
|
||||
navigationStyle: "custom",
|
||||
});
|
||||
45
src/pages/admin/add_order/index.scss
Normal file
45
src/pages/admin/add_order/index.scss
Normal file
@@ -0,0 +1,45 @@
|
||||
.container {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
height: 100vh;
|
||||
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png");
|
||||
background-size: auto 40%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
.card {
|
||||
margin-top: 240px;
|
||||
width: 703px;
|
||||
height: 301px;
|
||||
background: #ffffff;
|
||||
border-radius: 20px;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
|
||||
view image {
|
||||
width: 75px;
|
||||
height: 87px;
|
||||
margin: 20px auto;
|
||||
}
|
||||
.comm {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.title {
|
||||
font-size: 40px;
|
||||
}
|
||||
.sub {
|
||||
color: #626262;
|
||||
font-size: 25px;
|
||||
}
|
||||
}
|
||||
.line {
|
||||
width: 1px;
|
||||
height: 188px;
|
||||
background: #C8C8C8;
|
||||
}
|
||||
}
|
||||
}
|
||||
35
src/pages/admin/add_order/index.vue
Normal file
35
src/pages/admin/add_order/index.vue
Normal file
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<view>
|
||||
<back-component title="点单" />
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<view class="comm" @click="navTo('/pages/admin/add_order/add_table/index')">
|
||||
<text class="title">开始点单</text>
|
||||
<image src="./static/dc.png"></image>
|
||||
<text class="sub">线上点单后结系统</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="comm" @click="navTo('/pages/admin/add_order/pending_order/index')">
|
||||
<text class="title">我的订单</text>
|
||||
<image src="./static/ddan.png"></image>
|
||||
<text class="sub">查看我点餐的订单</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import BackComponent from "../../../components/Back.vue";
|
||||
|
||||
const navTo = (path: string) => {
|
||||
Taro.navigateTo({
|
||||
url: path,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
174
src/pages/admin/add_order/pending_order/components/Footer.vue
Normal file
174
src/pages/admin/add_order/pending_order/components/Footer.vue
Normal file
@@ -0,0 +1,174 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="footer" v-if="info.status !== 1">
|
||||
<view
|
||||
v-if="info.status !== 2"
|
||||
class="btn"
|
||||
style="border: 1px #7f7f7f solid; color: #666666"
|
||||
@click="visible = true"
|
||||
>挂帐</view
|
||||
>
|
||||
<view
|
||||
v-if="info.status !== 2"
|
||||
class="btn"
|
||||
style="background-color: #009ee0"
|
||||
@click="to_menu_page"
|
||||
>继续点单</view
|
||||
>
|
||||
<view
|
||||
v-if="info.status !== 2"
|
||||
class="btn"
|
||||
style="background-color: #ffa938"
|
||||
@click="visible1 = true"
|
||||
>修改</view
|
||||
>
|
||||
<view class="btn" style="background-color: #fd0100" @click="to_pay_page"
|
||||
>收款码</view
|
||||
>
|
||||
</view>
|
||||
<nut-dialog v-model:visible="visible" @ok="onOk">
|
||||
<template #header>挂帐</template>
|
||||
<template #default
|
||||
>确定要把
|
||||
<text style="color: #fd0100">{{ info.seat }}</text>
|
||||
进行挂帐吗?</template
|
||||
>
|
||||
</nut-dialog>
|
||||
<nut-dialog v-model:visible="visible1" @cancel="onCancel" @ok="onOk1">
|
||||
<template #header>修改台号/备注</template>
|
||||
<template #default>
|
||||
<view class="mb">
|
||||
<view>当前台号:{{ info.seat }}</view>
|
||||
<view class="flex">
|
||||
<text>新台号:</text>
|
||||
<nut-input v-model="formVal.seat" placeholder="请输入新台号" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="mb">
|
||||
<view>当前备注:{{ info.notes }}</view>
|
||||
<view class="flex">
|
||||
<text>新备注:</text>
|
||||
<nut-input v-model="formVal.notes" placeholder="请输入新备注" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</nut-dialog>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { confirmAfterOrder, editAfterOrder } from "../../../../../api/admin";
|
||||
import Taro from "@tarojs/taro";
|
||||
|
||||
const props = defineProps({
|
||||
info: {
|
||||
required: true,
|
||||
type: Object,
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(["ok"]);
|
||||
|
||||
const visible = ref(false);
|
||||
const visible1 = ref(false);
|
||||
|
||||
const formVal = ref({
|
||||
seat: "",
|
||||
notes: "",
|
||||
});
|
||||
|
||||
const onCancel = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
|
||||
const onOk = async () => {
|
||||
visible.value = false;
|
||||
const res = await confirmAfterOrder({
|
||||
bid: props.info.bid,
|
||||
oid: props.info.oid,
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
emits("ok");
|
||||
};
|
||||
|
||||
const onOk1 = async () => {
|
||||
visible.value = false;
|
||||
|
||||
const res = await editAfterOrder({
|
||||
bid: props.info.bid,
|
||||
oid: props.info.oid,
|
||||
seat: formVal.value.seat,
|
||||
notes: formVal.value.notes,
|
||||
});
|
||||
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
|
||||
formVal.value = {
|
||||
seat: "",
|
||||
notes: "",
|
||||
};
|
||||
|
||||
emits("ok");
|
||||
};
|
||||
|
||||
const to_pay_page = () => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/pending_order/pay/index?oid=${props.info.oid}&bid=${props.info.bid}`,
|
||||
});
|
||||
};
|
||||
|
||||
const to_menu_page = () => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${props.info.bid}&oid=${props.info.oid}&seat=${props.info.seat}&phone=${props.info.phone}¬es=${props.info.notes}`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 20px;
|
||||
.btn {
|
||||
width: 143px;
|
||||
height: 56px;
|
||||
border-radius: 28px;
|
||||
text-align: center;
|
||||
line-height: 56px;
|
||||
color: #fff;
|
||||
font-size: 26px;
|
||||
margin-left: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.nut-dialog__header {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
font-size: 36px;
|
||||
height: auto;
|
||||
}
|
||||
.nut-dialog__content {
|
||||
text-align: left !important;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.mb {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.flex {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
width: 150px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
3
src/pages/admin/add_order/pending_order/index.config.ts
Normal file
3
src/pages/admin/add_order/pending_order/index.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "挂帐订单",
|
||||
});
|
||||
87
src/pages/admin/add_order/pending_order/index.scss
Normal file
87
src/pages/admin/add_order/pending_order/index.scss
Normal file
@@ -0,0 +1,87 @@
|
||||
page {
|
||||
// IOS安全区域
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 20px 30px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
font-size: 32px;
|
||||
|
||||
.active {
|
||||
margin-top: 5px;
|
||||
width: 62px;
|
||||
height: 10px;
|
||||
background: #fa2d1c;
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 710px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
margin: 20px auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
text {
|
||||
margin-right: 10px;
|
||||
color: #333333;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: inherit;
|
||||
height: 1px;
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
display: flex;
|
||||
margin: 20px;
|
||||
|
||||
image {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
color: #666666;
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 10px 20px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
149
src/pages/admin/add_order/pending_order/index.vue
Normal file
149
src/pages/admin/add_order/pending_order/index.vue
Normal file
@@ -0,0 +1,149 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="tabs">
|
||||
<view
|
||||
class="item"
|
||||
v-for="item in tabs"
|
||||
:key="item.value"
|
||||
@click="changeTabs(item.value)"
|
||||
>
|
||||
<text>{{ item.text }}</text>
|
||||
<view
|
||||
class="line"
|
||||
:class="tabsIndex == item.value ? 'active' : ''"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="listData.length > 0">
|
||||
<view
|
||||
class="card"
|
||||
v-for="(item, index) in (listData as any[])"
|
||||
:key="index"
|
||||
>
|
||||
<view class="header">
|
||||
<view>
|
||||
<text>台号: {{ item.seat }}</text>
|
||||
<text>点单人: {{ item.PlaceUser?.nickName }}</text>
|
||||
</view>
|
||||
<view
|
||||
:style="{
|
||||
color: get_color(item.status),
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
>{{ get_status_text(item.status) }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view @click="to_page(item)">
|
||||
<view
|
||||
class="goods-list"
|
||||
v-for="(itm, idx) in item.OrderGoods"
|
||||
:key="idx"
|
||||
>
|
||||
<image :src="itm.Goods.cover"></image>
|
||||
<view class="center">
|
||||
<nut-ellipsis direction="end" :content="itm.Goods.name"></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
</view>
|
||||
<view class="num">
|
||||
<view>x{{ itm.pay_price }}</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>订单时间: {{ item.add_time }}</view>
|
||||
<view>备注: {{ item.notes }}</view>
|
||||
</view>
|
||||
|
||||
<view class="line"></view>
|
||||
<Footer :info="item" @ok="get_list" />
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getAfterOrderList } from "../../../../api/admin";
|
||||
import Footer from "./components/Footer.vue";
|
||||
|
||||
const tabsIndex = ref(0);
|
||||
|
||||
const listData = ref([]);
|
||||
|
||||
const tabs = ref([
|
||||
{
|
||||
text: "全部",
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
text: "未付款",
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
text: "挂帐中",
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
text: "已收款",
|
||||
value: 2,
|
||||
},
|
||||
]);
|
||||
|
||||
Taro.useDidShow(() => {
|
||||
get_list();
|
||||
});
|
||||
|
||||
const changeTabs = (index: number) => {
|
||||
tabsIndex.value = index;
|
||||
get_list();
|
||||
};
|
||||
|
||||
const get_list = async () => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
const user_info = await Taro.getStorageSync("userInfo");
|
||||
const { data: res } = await getAfterOrderList({
|
||||
bid: user_info.data.bid,
|
||||
status: tabsIndex.value,
|
||||
});
|
||||
listData.value = res.data || [];
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
case 1:
|
||||
return "#03A113";
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
case 1:
|
||||
return "已付款";
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
}
|
||||
};
|
||||
|
||||
const to_page = (item) => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?bid=${item.bid}&oid=${item.oid}`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "收款",
|
||||
});
|
||||
111
src/pages/admin/add_order/pending_order/pay/index.scss
Normal file
111
src/pages/admin/add_order/pending_order/pay/index.scss
Normal file
@@ -0,0 +1,111 @@
|
||||
.container {
|
||||
margin: 30px;
|
||||
|
||||
.name {
|
||||
font-size: 55px;
|
||||
font-weight: bold;
|
||||
margin: 45px 0;
|
||||
}
|
||||
|
||||
.input {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 50px;
|
||||
position: relative;
|
||||
input {
|
||||
height: 100px;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: "¥";
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
bottom: -1px;
|
||||
width: 700px;
|
||||
height: 1px;
|
||||
background-color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 710px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
margin: 20px auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
text {
|
||||
margin-right: 10px;
|
||||
color: #333333;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: inherit;
|
||||
height: 1px;
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
display: flex;
|
||||
margin: 20px;
|
||||
|
||||
image {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
color: #666666;
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 10px 20px;
|
||||
color: #666666;
|
||||
display: flex;
|
||||
font-size: 38px;
|
||||
|
||||
view {
|
||||
margin-right: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 709px;
|
||||
height: 92px;
|
||||
background: #FD0100;
|
||||
color: #ffffff;
|
||||
font-size: 32px;
|
||||
text-align: center;
|
||||
line-height: 92px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
118
src/pages/admin/add_order/pending_order/pay/index.vue
Normal file
118
src/pages/admin/add_order/pending_order/pay/index.vue
Normal file
@@ -0,0 +1,118 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="name">立即收款</view>
|
||||
<view class="input">
|
||||
<input v-model="val" placeholder="请输入收款金额" />
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
|
||||
<view class="card">
|
||||
<view class="header">
|
||||
<view>
|
||||
<text>台号: {{ data.seat }}</text>
|
||||
<text>点单人: {{ data.PlaceUser?.nickName }}</text>
|
||||
</view>
|
||||
<view
|
||||
:style="{
|
||||
color: get_color(data.status),
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
>{{ get_status_text(data.status) }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="goods-list" v-for="(itm, idx) in data.OrderGoods" :key="idx">
|
||||
<image :src="itm.Goods.cover"></image>
|
||||
<view class="center">
|
||||
<nut-ellipsis
|
||||
direction="end"
|
||||
:content="itm.Goods.name"
|
||||
></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
</view>
|
||||
<view class="num">
|
||||
<view>x{{ itm.pay_price }}</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view>
|
||||
<view class="desc">
|
||||
<view>总计: {{ data.count }}份</view>
|
||||
<view
|
||||
>应付款: <text style="color: red">¥{{ data.payments }}</text></view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn" @click="ok">立即收款</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getAfterOrder, createPayQr } from "../../../../../api/admin";
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
const val = ref("");
|
||||
|
||||
Taro.useLoad((e: any) => {
|
||||
get_data(e);
|
||||
});
|
||||
|
||||
const get_data = async ({ bid, oid }) => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
const res = await getAfterOrder({ bid, oid });
|
||||
data.value = res.data.data;
|
||||
console.log(res);
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
case 1:
|
||||
return "#03A113";
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
case 1:
|
||||
return "已付款";
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
}
|
||||
};
|
||||
|
||||
const ok = async () => {
|
||||
if (!val.value)
|
||||
return Taro.showToast({
|
||||
title: "请输入收款金额",
|
||||
icon: "none",
|
||||
});
|
||||
const res = await createPayQr({
|
||||
oid: data.value.oid,
|
||||
bid: data.value.bid,
|
||||
price: Number(val.value),
|
||||
});
|
||||
Taro.setStorageSync("pay_code", res.data.data.code_url);
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/pending_order/wx_pay_code/index`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单详情",
|
||||
});
|
||||
@@ -0,0 +1,77 @@
|
||||
.card {
|
||||
width: 710px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
margin: 20px auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
text {
|
||||
margin-right: 10px;
|
||||
color: #333333;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: inherit;
|
||||
height: 1px;
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
display: flex;
|
||||
margin: 20px;
|
||||
|
||||
image {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
color: #666666;
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 10px 20px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.nut-cell-group {
|
||||
margin: 20px;
|
||||
font-size: 26px;
|
||||
|
||||
.nut-cell__title {
|
||||
color: #181818;
|
||||
}
|
||||
|
||||
.nut-cell__value {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.nut-cell__title:nth-last-child(1) {
|
||||
color: #333333;
|
||||
font-size: 32px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="card">
|
||||
<view class="header">
|
||||
<view>
|
||||
<text>台号: {{ data.seat }}</text>
|
||||
<text>点单人: {{ data.PlaceUser?.nickName }}</text>
|
||||
</view>
|
||||
<view
|
||||
:style="{
|
||||
color: get_color(data.status),
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
>{{ get_status_text(data.status) }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="goods-list" v-for="(itm, idx) in data.OrderGoods" :key="idx">
|
||||
<image :src="itm.Goods.cover"></image>
|
||||
<view class="center">
|
||||
<nut-ellipsis
|
||||
direction="end"
|
||||
:content="itm.Goods.name"
|
||||
></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
</view>
|
||||
<view class="num">
|
||||
<view>x{{ itm.pay_price }}</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<Footer :info="data" @ok="get_data" />
|
||||
</view>
|
||||
<nut-cell-group>
|
||||
<nut-cell>
|
||||
<template #title>
|
||||
<text>订单信息</text>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<nut-cell title="台号" :desc="data.seat"></nut-cell>
|
||||
<nut-cell title="客人手机号" :desc="data.phone"></nut-cell>
|
||||
<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
|
||||
title="订单状态"
|
||||
:desc="get_status_text(data.status)"
|
||||
></nut-cell>
|
||||
<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 title="备注" :desc="data.notes"></nut-cell>
|
||||
</nut-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import Footer from "../components/Footer.vue";
|
||||
import { getAfterOrder } from "@/api/admin";
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
const params = ref<any>({});
|
||||
|
||||
Taro.useLoad((e: any) => {
|
||||
params.value = e;
|
||||
get_data();
|
||||
});
|
||||
|
||||
const get_data = async () => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
const res = await getAfterOrder({
|
||||
bid: params.value.bid,
|
||||
oid: params.value.oid,
|
||||
});
|
||||
data.value = res.data.data;
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
case 1:
|
||||
return "#03A113";
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
case 1:
|
||||
return "已付款";
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "收款码",
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
page {
|
||||
background-color: #85b1ee;
|
||||
}
|
||||
.container {
|
||||
.tips {
|
||||
position: relative;
|
||||
color: #fff;
|
||||
font-family: MF JianHei (Noncommercial);
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
margin: 100px 0;
|
||||
|
||||
.name {
|
||||
font-size: 115px;
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: 52px;
|
||||
}
|
||||
}
|
||||
|
||||
.box {
|
||||
margin: auto;
|
||||
background-image: url("../../static/ewm.png");
|
||||
background-size: 100% 100%;
|
||||
width: 608px;
|
||||
height: 457px;
|
||||
position: relative;
|
||||
image {
|
||||
position: absolute;
|
||||
width: 280px;
|
||||
height: 280px;
|
||||
top: 45%;
|
||||
left: 68%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="tips">
|
||||
<view class="name">谢谢老板</view>
|
||||
<view class="desc">请在这里扫码</view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<image :src="`https://api.pwmqr.com/qrcode/create?url=${code}`"></image>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
|
||||
const code = ref("");
|
||||
|
||||
Taro.useLoad(() => {
|
||||
code.value = Taro.getStorageSync("pay_code");
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
BIN
src/pages/admin/add_order/static/dc.png
Normal file
BIN
src/pages/admin/add_order/static/dc.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.6 KiB |
BIN
src/pages/admin/add_order/static/ddan.png
Normal file
BIN
src/pages/admin/add_order/static/ddan.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
src/pages/admin/add_order/static/ewm.png
Normal file
BIN
src/pages/admin/add_order/static/ewm.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 149 KiB |
@@ -106,12 +106,11 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import { Find, Locationg3 } from "@nutui/icons-vue-taro";
|
||||
import { Find, Locationg3, Cart2 } from "@nutui/icons-vue-taro";
|
||||
import { Ref, ref } from "vue";
|
||||
import { calculateDistance } from "@/utils";
|
||||
import { getGoodList, getMerCategory } from "@/api/goods";
|
||||
import Cart from "@/components/Cart.vue";
|
||||
import { Cart2 } from "@nutui/icons-vue-taro";
|
||||
|
||||
const swiperList = ref([]);
|
||||
|
||||
|
||||
@@ -125,41 +125,13 @@
|
||||
<nut-grid :gutter="10" :border="false">
|
||||
<nut-grid-item
|
||||
:border="false"
|
||||
text="订单核销"
|
||||
@click="toPage('/pages/admin/verify/index')"
|
||||
v-for="(item, index) in store_menu_list"
|
||||
:key="index"
|
||||
:text="item.text"
|
||||
@click="toPage(item.path)"
|
||||
>
|
||||
<IconFont
|
||||
size="50"
|
||||
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
|
||||
></IconFont>
|
||||
<IconFont size="50" :name="item.icon"></IconFont>
|
||||
</nut-grid-item>
|
||||
<nut-grid-item
|
||||
text="订单统计"
|
||||
@click="toPage('/pages/admin/order_manage/index')"
|
||||
>
|
||||
<IconFont
|
||||
size="50"
|
||||
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
|
||||
></IconFont>
|
||||
</nut-grid-item>
|
||||
<nut-grid-item
|
||||
text="收益提现"
|
||||
@click="toPage('/pages/admin/withdrawal/index')"
|
||||
>
|
||||
<IconFont
|
||||
size="50"
|
||||
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
|
||||
></IconFont>
|
||||
</nut-grid-item>
|
||||
<!-- <nut-grid-item-->
|
||||
<!-- text="商品管理"-->
|
||||
<!-- @click="toPage('/pages/product/list/index')"-->
|
||||
<!-- >-->
|
||||
<!-- <IconFont-->
|
||||
<!-- size="50"-->
|
||||
<!-- name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"-->
|
||||
<!-- ></IconFont>-->
|
||||
<!-- </nut-grid-item>-->
|
||||
</nut-grid>
|
||||
</view>
|
||||
|
||||
@@ -244,6 +216,12 @@ const toOrderList = (e: number) => {
|
||||
};
|
||||
|
||||
const userMenuList = ref([
|
||||
{
|
||||
id: 0,
|
||||
label: "挂帐订单",
|
||||
url: "/pages/users/pending_order/index",
|
||||
icon: "http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
label: "我的账户",
|
||||
@@ -262,12 +240,12 @@ const userMenuList = ref([
|
||||
url: "/pages/users/distribution/index",
|
||||
icon: "http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: "关注商家",
|
||||
url: "",
|
||||
icon: "http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png",
|
||||
},
|
||||
// {
|
||||
// id: 4,
|
||||
// label: "关注商家",
|
||||
// url: "",
|
||||
// icon: "http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png",
|
||||
// },
|
||||
// {
|
||||
// id: 5,
|
||||
// label: '联系客服',
|
||||
@@ -276,6 +254,34 @@ 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",
|
||||
@@ -419,6 +425,7 @@ const scanCode = () => {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
justify-content: flex-start;
|
||||
|
||||
.box-mini {
|
||||
display: flex;
|
||||
|
||||
3
src/pages/users/pending_order/index.config.ts
Normal file
3
src/pages/users/pending_order/index.config.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "后结订单",
|
||||
});
|
||||
87
src/pages/users/pending_order/index.scss
Normal file
87
src/pages/users/pending_order/index.scss
Normal file
@@ -0,0 +1,87 @@
|
||||
page {
|
||||
// IOS安全区域
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 20px 30px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
text-align: center;
|
||||
align-items: center;
|
||||
font-size: 32px;
|
||||
|
||||
.active {
|
||||
margin-top: 5px;
|
||||
width: 62px;
|
||||
height: 10px;
|
||||
background: #fa2d1c;
|
||||
border-radius: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 710px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
margin: 20px auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
text {
|
||||
margin-right: 10px;
|
||||
color: #333333;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: inherit;
|
||||
height: 1px;
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
display: flex;
|
||||
margin: 20px;
|
||||
|
||||
image {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
color: #666666;
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 10px 20px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
147
src/pages/users/pending_order/index.vue
Normal file
147
src/pages/users/pending_order/index.vue
Normal file
@@ -0,0 +1,147 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="tabs">
|
||||
<view
|
||||
class="item"
|
||||
v-for="item in tabs"
|
||||
:key="item.value"
|
||||
@click="changeTabs(item.value)"
|
||||
>
|
||||
<text>{{ item.text }}</text>
|
||||
<view
|
||||
class="line"
|
||||
:class="tabsIndex == item.value ? 'active' : ''"
|
||||
></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="listData.length > 0">
|
||||
<view
|
||||
class="card"
|
||||
v-for="(item, index) in (listData as any[])"
|
||||
:key="index"
|
||||
>
|
||||
<view class="header">
|
||||
<view>
|
||||
<text>台号: {{ item.seat }}</text>
|
||||
<text>点单人: {{ item.PlaceUser?.nickName }}</text>
|
||||
</view>
|
||||
<view
|
||||
:style="{
|
||||
color: get_color(item.status),
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
>{{ get_status_text(item.status) }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view @click="to_page(item)">
|
||||
<view
|
||||
class="goods-list"
|
||||
v-for="(itm, idx) in item.OrderGoods"
|
||||
:key="idx"
|
||||
>
|
||||
<image :src="itm.Goods.cover"></image>
|
||||
<view class="center">
|
||||
<nut-ellipsis direction="end" :content="itm.Goods.name"></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
</view>
|
||||
<view class="num">
|
||||
<view>x{{ itm.pay_price }}</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>订单时间: {{ item.add_time }}</view>
|
||||
<view>备注: {{ item.notes }}</view>
|
||||
</view>
|
||||
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getUserAfterOrderList } from "../../../api/user";
|
||||
|
||||
const tabsIndex = ref(0);
|
||||
|
||||
const listData = ref([]);
|
||||
|
||||
const tabs = ref([
|
||||
{
|
||||
text: "全部",
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
text: "未付款",
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
text: "挂帐中",
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
text: "已收款",
|
||||
value: 2,
|
||||
},
|
||||
]);
|
||||
|
||||
Taro.useDidShow(() => {
|
||||
get_list();
|
||||
});
|
||||
|
||||
const changeTabs = (index: number) => {
|
||||
tabsIndex.value = index;
|
||||
get_list();
|
||||
};
|
||||
|
||||
const get_list = async () => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
const user_info = await Taro.getStorageSync("userInfo");
|
||||
const { data: res } = await getUserAfterOrderList({
|
||||
phone: user_info.data.phone,
|
||||
status: tabsIndex.value,
|
||||
});
|
||||
listData.value = res.data || [];
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
case 1:
|
||||
return "#03A113";
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
case 1:
|
||||
return "已付款";
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
}
|
||||
};
|
||||
|
||||
const to_page = (item) => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/users/pending_order/pending_order_detail/index?bid=${item.bid}&oid=${item.oid}`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
@@ -0,0 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单详情",
|
||||
});
|
||||
@@ -0,0 +1,77 @@
|
||||
.card {
|
||||
width: 710px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
margin: 20px auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
text {
|
||||
margin-right: 10px;
|
||||
color: #333333;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
.line {
|
||||
width: inherit;
|
||||
height: 1px;
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
.goods-list {
|
||||
display: flex;
|
||||
margin: 20px;
|
||||
|
||||
image {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
color: #666666;
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 10px 20px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.nut-cell-group {
|
||||
margin: 20px;
|
||||
font-size: 26px;
|
||||
|
||||
.nut-cell__title {
|
||||
color: #181818;
|
||||
}
|
||||
|
||||
.nut-cell__value {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.nut-cell__title:nth-last-child(1) {
|
||||
color: #333333;
|
||||
font-size: 32px;
|
||||
}
|
||||
}
|
||||
113
src/pages/users/pending_order/pending_order_detail/index.vue
Normal file
113
src/pages/users/pending_order/pending_order_detail/index.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="card">
|
||||
<view class="header">
|
||||
<view>
|
||||
<text>台号: {{ data.seat }}</text>
|
||||
<text>点单人: {{ data.PlaceUser?.nickName }}</text>
|
||||
</view>
|
||||
<view
|
||||
:style="{
|
||||
color: get_color(data.status),
|
||||
fontWeight: 'bold',
|
||||
}"
|
||||
>{{ get_status_text(data.status) }}</view
|
||||
>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="goods-list" v-for="(itm, idx) in data.OrderGoods" :key="idx">
|
||||
<image :src="itm.Goods.cover"></image>
|
||||
<view class="center">
|
||||
<nut-ellipsis
|
||||
direction="end"
|
||||
:content="itm.Goods.name"
|
||||
></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
</view>
|
||||
<view class="num">
|
||||
<view>x{{ itm.pay_price }}</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<nut-cell-group>
|
||||
<nut-cell>
|
||||
<template #title>
|
||||
<text>订单信息</text>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<nut-cell title="台号" :desc="data.seat"></nut-cell>
|
||||
<nut-cell title="客人手机号" :desc="data.phone"></nut-cell>
|
||||
<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
|
||||
title="订单状态"
|
||||
:desc="get_status_text(data.status)"
|
||||
></nut-cell>
|
||||
<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 title="备注" :desc="data.notes"></nut-cell>
|
||||
</nut-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getUserAfterOrderDetail } from "../../../../api/user";
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
const params = ref<any>({});
|
||||
|
||||
Taro.useLoad((e: any) => {
|
||||
params.value = e;
|
||||
get_data();
|
||||
});
|
||||
|
||||
const get_data = async () => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
});
|
||||
const res = await getUserAfterOrderDetail({
|
||||
bid: params.value.bid,
|
||||
oid: params.value.oid,
|
||||
});
|
||||
data.value = res.data.data;
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
case 1:
|
||||
return "#03A113";
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
case 1:
|
||||
return "已付款";
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
</style>
|
||||
Reference in New Issue
Block a user