Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-03-15 16:07:06 +08:00
69 changed files with 8380 additions and 12917 deletions

64
.drone.yml Normal file
View File

@@ -0,0 +1,64 @@
kind: pipeline
type: docker
name: default
platform:
os: linux
arch: amd64
steps:
- name: 测试服-依赖安装&&编译打包&&上传微信小程序平台
pull: if-not-exists
image: node:20-alpine
when:
branch:
- test
commands:
- npm config set registry https://registry.npmmirror.com/
- npm install -g pnpm
- pnpm install
- pnpm build:weapp:test:upload
- rm -rf dist.tar
- rm -rf node_modules
- name: 正式服-依赖安装&&编译打包&&上传微信小程序平台
pull: if-not-exists
image: node:20-alpine
when:
branch:
- master
commands:
- npm config set registry https://registry.npmmirror.com/
- npm install -g pnpm
- pnpm install
- pnpm build:weapp:prod:upload
- rm -rf dist.tar
- rm -rf node_modules
- name: 企业微信通知
pull: if-not-exists
image: plugins/webhook
when:
branch:
- test
- master
status:
- success
- failure
settings:
urls: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=a2065e21-4f92-4f5b-a432-2c0cd1d965b5
content_type: application/json
template: |
{
"msgtype": "markdown",
"markdown": {
"content": "{{#success build.status}}✅{{else}}❌{{/success}}**{{ repo.owner }}/{{ repo.name }}** (Build #{{build.number}})\n
>**构建结果**: {{ build.status }}
>**构建详情**: [点击查看]({{ build.link }})
>**代码分支**: {{ build.branch }}
>**提交标识**: {{ build.commit }}
>**提交发起**: {{ build.author }}
>**提交信息**: {{ build.message }}
"
}
}

5
.idea/.gitignore generated vendored
View File

@@ -1,5 +0,0 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/

View File

@@ -1,5 +0,0 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
</state>
</component>

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GitToolBoxProjectSettings">
<option name="commitMessageIssueKeyValidationOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
<option name="commitMessageValidationEnabledOverride">
<BoolValueOverride>
<option name="enabled" value="true" />
</BoolValueOverride>
</option>
</component>
</project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="Node.js Core" />
</component>
</project>

View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EslintConfiguration">
<custom-configuration-file used="true" path="$PROJECT_DIR$/.eslintrc.js" />
</component>
</project>

8
.idea/modules.xml generated
View File

@@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/taroApp.iml" filepath="$PROJECT_DIR$/.idea/taroApp.iml" />
</modules>
</component>
</project>

12
.idea/taroApp.iml generated
View File

@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

6
.idea/vcs.xml generated
View File

@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

View File

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectTasksOptions" suppressed-tasks="SCSS" />
</project>

1
components.d.ts vendored
View File

@@ -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']

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

@@ -1,115 +1,115 @@
{
"name": "jdt-user",
"version": "3.0.11",
"private": true,
"description": "",
"templateInfo": {
"name": "jdt-user",
"typescript": true,
"css": "sass"
},
"taroConfig": {
"version": "3.0.11"
},
"scripts": {
"build:weapp": "taro build --type weapp",
"build:test": "taro build --type weapp --mode test",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"dev:weapp": "taro build --type weapp --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch",
"lint": "eslint --ext .ts,.vue .",
"lint:fix": "eslint --fix --ext .ts,.vue .",
"lint:staged": "lint-staged",
"prepare": "husky install",
"preview": "vite preview",
"cz": "cz",
"lf": "npx prettier --write --end-of-line lf .",
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8"
],
"author": "",
"lint-staged": {
"*.{ts,vue}": [
"eslint --ext .ts,.vue .",
"npx prettier --write --end-of-line lf ."
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
},
"dependencies": {
"@babel/runtime": "^7.23.5",
"@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.2.4",
"@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",
"dayjs": "^1.11.10",
"pinia": "^2.1.7",
"vue": "^3.3.9"
},
"devDependencies": {
"@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",
"@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",
"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-plugin-vue": "^9.19.2",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"style-loader": "1.3.0",
"stylelint": "9.3.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"unplugin-vue-components": "^0.23.0",
"vue-loader": "^17.3.1",
"webpack": "^5.89.0"
}
"name": "jdt-user",
"version": "3.0.12",
"private": true,
"description": "",
"templateInfo": {
"name": "jdt-user",
"typescript": true,
"css": "sass"
},
"taroConfig": {
"version": "3.0.12"
},
"scripts": {
"build:weapp": "taro build --type weapp",
"build:test": "taro build --type weapp --mode test",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"dev:weapp": "taro build --type weapp --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch",
"lint": "eslint --ext .ts,.vue .",
"lint:fix": "eslint --fix --ext .ts,.vue .",
"lint:staged": "lint-staged",
"prepare": "husky install",
"preview": "vite preview",
"cz": "cz",
"lf": "npx prettier --write --end-of-line lf .",
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8"
],
"author": "",
"lint-staged": {
"*.{ts,vue}": [
"eslint --ext .ts,.vue .",
"npx prettier --write --end-of-line lf ."
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
},
"dependencies": {
"@babel/runtime": "^7.23.5",
"@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.3.1",
"@qiun/vue-ucharts": "2.5.0-20230101",
"@tarojs/components": "3.6.24",
"@tarojs/helper": "3.6.24",
"@tarojs/plugin-framework-vue3": "3.6.24",
"@tarojs/plugin-html": "3.6.24",
"@tarojs/plugin-platform-alipay": "3.6.24",
"@tarojs/plugin-platform-h5": "3.6.24",
"@tarojs/plugin-platform-jd": "3.6.24",
"@tarojs/plugin-platform-qq": "3.6.24",
"@tarojs/plugin-platform-swan": "3.6.24",
"@tarojs/plugin-platform-tt": "3.6.24",
"@tarojs/plugin-platform-weapp": "3.6.24",
"@tarojs/runtime": "3.6.24",
"@tarojs/shared": "3.6.24",
"@tarojs/taro": "3.6.24",
"dayjs": "^1.11.10",
"pinia": "^2.1.7",
"vue": "^3.3.9"
},
"devDependencies": {
"@babel/core": "^7.23.5",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@tarojs/cli": "3.6.24",
"@tarojs/plugin-mini-ci": "3.6.24",
"@tarojs/taro-loader": "3.6.24",
"@tarojs/webpack5-runner": "3.6.24",
"@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.24",
"commitizen": "^4.3.0",
"css-loader": "3.4.2",
"cz-customizable": "^7.0.0",
"eslint": "^8.55.0",
"eslint-config-taro": "3.6.24",
"eslint-plugin-vue": "^9.19.2",
"husky": "^8.0.3",
"lint-staged": "^15.1.0",
"style-loader": "1.3.0",
"stylelint": "9.3.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"unplugin-vue-components": "^0.23.0",
"vue-loader": "^17.3.1",
"webpack": "^5.89.0"
}
}

18135
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -39,3 +39,35 @@ 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");
// 检查手机号码是否存在
export const checkPhone = (data: object) =>
request("/user/find/phone", data, "POST");

View File

@@ -1,5 +1,8 @@
import request from "@/utils/request";
// 获取用户协议
export const getAgreement = () => request("/user/agreement", {}, "POST");
// 登录
export const login = (data: object) => request("/login", data, "POST");
export const phoneLogin = (data: object) =>
@@ -73,3 +76,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");

View File

@@ -10,6 +10,7 @@ export default defineAppConfig({
{
root: "pages/users",
pages: [
"user_agreement/index",
"order_list/index",
"setting/index",
"user_setting/index",
@@ -21,6 +22,8 @@ export default defineAppConfig({
"distribution/userlist/index",
"login/index",
"bindPhone/index",
"pending_order/index",
"pending_order/pending_order_detail/index"
],
},
{
@@ -37,6 +40,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",
],
},
{

View File

@@ -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 {

69
src/components/Back.vue Normal file
View File

@@ -0,0 +1,69 @@
<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 style="width: 2000px;text-align: center;">{{ 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;
}
}
</style>

View File

@@ -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,10 @@ const props = defineProps({
required: true,
type: Object,
},
IsPendingOrder: {
type: Boolean,
default: false,
},
});
const emit = defineEmits(["updateCart"]);
@@ -75,6 +80,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 +130,36 @@ const closePay = (val: boolean) => {
const create_order = async () => {
try {
const { data: res } = await createActiveOrder({
Bid: [props.merInfo.bid],
});
if (res.oid) {
orderData.value = res.oid;
isShowPay.value = true;
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=${res.data.oid}&bid=${props.merInfo.bid}`,
});
} else {
res = await createActiveOrder({
Bid: [props.merInfo.bid],
});
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({
@@ -152,13 +174,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

@@ -14,11 +14,37 @@
<nut-cell-group
:style="{ margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0' }"
>
<nut-cell
title="微信支付"
desc="使用微信快捷支付"
<nut-cell
title="微信支付"
desc="使用微信快捷支付"
is-link
@click="goPay(1)"
>
<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
title="积分支付"
:desc="`剩余积分:${info.integral || 0}`"
is-link
@click="goPay(2)"
>
<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
title="挂帐后结"
desc="先消费后结账"
is-link
@click="goPay(1)"
@click="goPay(3)"
>
<template v-slot:icon>
<IconFont
@@ -26,20 +52,7 @@
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
/>
</template>
</nut-cell>
<nut-cell
title="积分支付"
:desc="`剩余积分:${info.integral || 0}`"
is-link
@click="goPay(2)"
>
<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> -->
</nut-cell-group>
</view>
</nut-popup>
@@ -106,51 +119,58 @@ const goPay = async (type: number) => {
icon: "none",
});
try {
const { data } = await payOrder({
oid: prop.jfInfo,
OrderType: prop.OrderType,
PayType: type,
});
// 1微信支付 2积分支付
if (type === 1) {
if (data.data) {
Taro.requestPayment({
timeStamp: data.data.timeStamp,
nonceStr: data.data.nonceStr,
package: data.data.package,
signType: data.data.signType,
paySign: data.data.paySign,
success: function () {
Taro.showToast({
title: "支付成功",
icon: "success",
duration: 2000,
});
emit("successPay", false);
},
fail: function () {
Taro.showToast({
title: "支付失败",
icon: "none",
duration: 2000,
});
emit("closePay", false);
},
});
} else {
// 1微信支付 2积分支付 3挂帐
if (type === 1 || type === 2) {
const { data } = await payOrder({
oid: prop.jfInfo,
OrderType: prop.OrderType,
PayType: type,
});
if (type === 1) {
if (data.data) {
Taro.requestPayment({
timeStamp: data.data.timeStamp,
nonceStr: data.data.nonceStr,
package: data.data.package,
signType: data.data.signType,
paySign: data.data.paySign,
success: function () {
Taro.showToast({
title: "支付成功",
icon: "success",
duration: 2000,
});
emit("successPay", false);
},
fail: function () {
Taro.showToast({
title: "支付失败",
icon: "none",
duration: 2000,
});
emit("closePay", false);
},
});
} else {
Taro.showToast({
title: "未知异常",
icon: "none",
});
emit("closePay", false);
}
} else if (type === 2) {
Taro.showToast({
title: "未知异常",
icon: "none",
title: "支付成功",
icon: "success",
duration: 2000,
});
emit("closePay", false);
emit("successPay", false);
}
} else {
Taro.showToast({
title: "支付成功",
icon: "success",
duration: 2000,
title: "挂帐后结账",
icon: "none",
});
emit("successPay", false);
}
} catch (e) {
Taro.showToast({

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "菜单",
});

View 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;
}
}
}
}
}

View 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>

View File

@@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "填写信息",
navigationStyle: "custom",
});

View File

@@ -0,0 +1,46 @@
.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;
}
}
}
}
.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

@@ -0,0 +1,109 @@
<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>
<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>
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import BackComponent from "../../../../components/Back.vue";
import { checkPhone } from "../../../../api/admin";
const formVal = ref({
seat: "",
phone: "",
notes: "",
});
const visible = ref(false);
const formSubmit = async ({ detail }: any) => {
if (!detail.value.seat)
return Taro.showToast({
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}`,
success: () => {
formVal.value = {
seat: "",
phone: "",
notes: "",
};
},
});
} catch (error) {
console.log(error);
visible.value = true;
}
};
</script>
<style lang="scss">
@import "./index.scss";
</style>

View File

@@ -0,0 +1,4 @@
export default definePageConfig({
navigationBarTitleText: "点单",
navigationStyle: "custom",
});

View File

@@ -0,0 +1,45 @@
.container {
display: flex;
justify-content: center;
box-sizing: border-box;
height: 100vh;
background-image: url("./static/WechatIMG10.jpg");
background-size: 100% 35%;
background-repeat: no-repeat;
.card {
margin-top: 450px;
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;
}
}
}

View File

@@ -0,0 +1,41 @@
<template>
<view>
<back-component />
<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>

View 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}&notes=${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>

View File

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

View File

@@ -0,0 +1,88 @@
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;
min-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;
}
}

View File

@@ -0,0 +1,155 @@
<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"
rows="3"
expand-text="展开"
collapse-text="收起"
></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(1);
const listData = ref([]);
const tabs = ref([
{
text: "未收款",
value: 1,
},
{
text: "挂帐中",
value: 3,
},
{
text: "已收款",
value: 2,
},
{
text: "全部",
value: 0,
},
]);
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>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "收款",
});

View 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;
}
}

View 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?oid=${data.value.oid}&bid=${data.value.bid}`,
});
};
</script>
<style lang="scss">
@import "./index.scss";
</style>

View File

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

View File

@@ -0,0 +1,78 @@
.card {
width: 710px;
background: #ffffff;
border-radius: 12px;
margin: 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;
min-width: 195px;
}
.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;
}
}

View File

@@ -0,0 +1,141 @@
<template>
<view>
<!-- <back-component title="订单详情" /> -->
<view class="card" style="margin-top: 15px">
<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"
rows="3"
expand-text="展开"
collapse-text="收起"
></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
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)"
></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.gift_pulse)"></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>
</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";
// import BackComponent from "../../../../../components/Back.vue";
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>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "收款码",
});

View File

@@ -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%);
}
}
}

View File

@@ -0,0 +1,60 @@
<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 { onUnmounted, ref } from "vue";
import Taro from "@tarojs/taro";
import { getAfterOrder } from "@/api/admin";
const code = ref("");
const time_id = ref();
const info = ref<any>({});
Taro.useLoad((e) => {
info.value = e;
console.log(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 && data.data.status !== 2) {
clearInterval(time_id.value);
Taro.showToast({
title: "支付成功",
icon: "success",
});
setTimeout(() => {
Taro.removeStorageSync("pay_code");
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);
});
onUnmounted(() => {
clearInterval(time_id.value);
});
</script>
<style lang="scss">
@import "./index.scss";
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

View File

@@ -4,30 +4,43 @@
<view>订单号:{{ info.oid }}</view>
<view>{{ info.add_time }}</view>
</view>
<view class="good-info">
<view class="top">
<image :src="info.BindGoods?.cover" />
<view class="title">{{ info.BindGoods?.name }}</view>
<view class="card">
<view class="center" v-for="(itm, idx) in info.OrderGoods" :key="idx">
<view class="top">
<image :src="itm.Goods.cover" />
<view class="title">{{ itm.Goods.name }} </view>
<view class="right">
<view v-if="info.pay_type === 1">{{ itm.pay_price }}</view>
<view v-else>{{ itm.pay_integral }}积分</view>
<view>x{{ itm.number }}</view>
</view>
</view>
</view>
<view class="public-total">
{{ info.count }}件商品支付
<text class="money">{{ info.number }}</text>
<view class="line"></view>
<view class="bom" style="text-align: right">
{{ info.count }}件商品,支付方式:{{
info.pay_type === 1 ? "微信" : "积分"
}},实付:
<text style="color: red">{{
info.pay_type === 1 ? `${info.price}` : `${info.exchange}积分`
}}</text>
</view>
</view>
<nut-cell-group>
<nut-cell title="订单状态:" :desc="orderStatus"></nut-cell>
<nut-cell title="下单用户:" :desc="info.BindUser?.nickName"></nut-cell>
<nut-cell title="用户手机号:" :desc="info.BindUser?.phone"></nut-cell>
<nut-cell title="下单用户:" :desc="info.User?.nickName"></nut-cell>
<nut-cell title="用户手机号:" :desc="info.User?.phone"></nut-cell>
<nut-cell title="核销时间:" :desc="info.User?.phone"></nut-cell>
<nut-cell
v-if="info.status === 2"
title="核销人员:"
:desc="info.BindCancelUser?.nickName"
:desc="info.CancelUser?.nickName"
></nut-cell>
<nut-cell
v-if="info.status === 2"
title="核销人手机号:"
:desc="info.BindCancelUser?.phone"
:desc="info.CancelUser?.phone"
></nut-cell>
</nut-cell-group>
</view>
@@ -35,15 +48,16 @@
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { computed, ref } from "vue";
const info = ref<any>({});
Taro.useLoad(() => {
info.value = Taro.getStorageSync("ver_order_info");
console.log(info.value);
});
const orderStatus = () => {
const orderStatus = computed(() => {
switch (info.value.status) {
case 1:
return "待核销";
@@ -52,7 +66,7 @@ const orderStatus = () => {
case 3:
return "已失效";
}
};
});
</script>
<style lang="scss">
@@ -60,6 +74,13 @@ page {
--nut-cell-desc-color: #000;
}
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px;
}
.header {
background: linear-gradient(90deg, #2291f8 0, #1cd1dc);
padding: 30px;
@@ -86,6 +107,7 @@ page {
image {
width: 200px;
height: 200px;
border-radius: 10px;
}
.title {
@@ -113,4 +135,41 @@ page {
color: #ff4c3c;
}
}
.card {
box-sizing: border-box;
margin: 15px auto;
background-color: #fff;
padding: 20px;
}
.center {
.top {
display: flex;
justify-content: space-between;
// align-items: flex-start;
image {
width: 150px;
height: 150px;
border-radius: 10px;
}
.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;
}
}
}
</style>

View File

@@ -0,0 +1,65 @@
.Card {
width: 90%;
background-color: #fff;
border-radius: 10px;
margin: 10px auto;
padding: 25px;
.top {
display: flex;
align-items: center;
text {
margin-right: 5px;
}
}
}
.icon {
color: red;
}
.gridBox {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: repeat(3, 33.33%);
grid-template-rows: repeat(3, 33.33%);
grid-gap: 10px;
justify-content: center;
text-align: center;
.item {
margin-top: 50px;
.title {
font-size: 50px;
}
.sub {
font-size: 25px;
color: #999;
}
}
}
.table {
margin-top: 10px;
}
.orderinfo {
display: flex;
justify-content: space-between;
margin-top: 20px;
align-items: center;
.info {
text-align: center;
.num {
font-size: 40px;
color: red;
}
.sub {
font-size: 25px;
color: #999;
}
}
}

View File

@@ -157,69 +157,5 @@ const toListPage = (index: number) => {
</script>
<style lang="scss">
.Card {
width: 90%;
background-color: #fff;
border-radius: 10px;
margin: 10px auto;
padding: 25px;
.top {
display: flex;
align-items: center;
text {
margin-right: 5px;
}
}
}
.icon {
color: red;
}
.gridBox {
width: 100%;
height: 100%;
display: grid;
grid-template-columns: repeat(3, 33.33%);
grid-template-rows: repeat(3, 33.33%);
grid-gap: 10px;
justify-content: center;
text-align: center;
.item {
margin-top: 50px;
.title {
font-size: 50px;
}
.sub {
font-size: 25px;
color: #999;
}
}
}
.table {
margin-top: 10px;
}
.orderinfo {
display: flex;
justify-content: space-between;
margin-top: 20px;
align-items: center;
.info {
text-align: center;
.num {
font-size: 40px;
color: red;
}
.sub {
font-size: 25px;
color: #999;
}
}
}
@import './index.scss';
</style>

View File

@@ -0,0 +1,86 @@
.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;
border-radius: 10px;
}
.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="{
@@ -26,7 +26,7 @@
<view class="top">
<view class="name">订单号:{{ item.oid }}</view>
<!-- <view class="sub">下单时间{{ item.add_time }}</view> -->
<view class="sub">核销时间{{ item.cancel_time || "待核销" }}</view>
<view class="sub" v-if="item.status !== 3">核销时间:{{ item.cancel_time || "待核销" }}</view>
<!-- <view style="color: red">{{
item.status === 0
? "待付款"
@@ -43,8 +43,8 @@
<image :src="itm.Goods.cover" />
<view class="title">{{ itm.Goods.name }} </view>
<view class="right">
<view>{{ itm.pay_price }}</view>
<view>{{ itm.pay_integral }}积分</view>
<view v-if="item.pay_type === 1">{{ itm.pay_price }}</view>
<view v-else>{{ itm.pay_integral }}积分</view>
<view>x{{ itm.number }}</view>
</view>
</view>
@@ -55,7 +55,7 @@
item.pay_type === 1 ? "微信" : "积分"
}},实付:
<text style="color: red">{{
item.pay_type === 1 ? item.price : item.exchange
item.pay_type === 1 ? `${item.price}` : `${item.exchange}积分`
}}</text>
</view>
</view>
@@ -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

@@ -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([]);

View File

@@ -125,41 +125,48 @@
<nut-grid :gutter="10" :border="false">
<nut-grid-item
:border="false"
v-if="userInfo.data.permission.dd"
text="点单"
@click="toPage('/pages/admin/add_order/index')"
>
<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="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
: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="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
: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="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
:name="require('../../static/user/1-4.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>
@@ -194,6 +201,7 @@ interface UserInfo {
bid?: string;
phone?: string;
uid?: string;
permission?: any;
};
store_status?: number;
store_name?: string;
@@ -217,8 +225,17 @@ 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:
res.data.data.permission
? JSON.parse(res.data.data.permission)
: {},
},
};
Taro.setStorageSync("userInfo", userInfo.value);
isLogin.value = true;
cancelLogin();
Taro.hideLoading();
@@ -244,6 +261,12 @@ const toOrderList = (e: number) => {
};
const userMenuList = ref([
{
id: 0,
label: "后结订单",
url: "/pages/users/pending_order/index",
icon: require("../../static/user/dd.png"),
},
{
id: 1,
label: "我的账户",
@@ -262,12 +285,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: '联系客服',
@@ -419,6 +442,7 @@ const scanCode = () => {
display: flex;
flex-wrap: wrap;
box-sizing: border-box;
justify-content: flex-start;
.box-mini {
display: flex;

View File

@@ -6,7 +6,14 @@ import logoImg from "../../../static/logo.jpg";
const isShow = ref(false);
const val = ref(false);
const getCode = () => {
if (!val.value)
return Taro.showToast({
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
icon: "none",
});
Taro.showLoading({
title: "授权中...",
mask: true,
@@ -24,10 +31,22 @@ const getCode = () => {
};
const toPage = () => {
if (!val.value)
return Taro.showToast({
title: "请先阅读并同意用户协议&隐私政策&积分使用规则",
icon: "none",
});
Taro.navigateTo({
url: "/pages/users/bindPhone/index?type=1",
});
};
const clickText = (type: number, text: string) => {
console.log("点击了协议", type);
Taro.navigateTo({
url: `/pages/users/user_agreement/index?type=${type}&name=${text}`,
});
};
</script>
<template>
@@ -38,11 +57,28 @@ const toPage = () => {
<view>捷兑通</view>
</view>
<view class="center">
<nut-button type="success" @click="getCode">微信登录</nut-button>
<nut-button type="primary" @click="getCode">一键微信授权登录</nut-button>
<nut-button style="margin-top: 15px" @click="toPage"
>手机号登录</nut-button
>
</view>
<view class="checkbox"
><nut-checkbox v-model="val"></nut-checkbox>
<view class="text">
阅读并同意
<view style="color: #fa2c1a" @click.stop="clickText(1, '用户协议')">
用户协议
</view>
&<view style="color: #fa2c1a" @click.stop="clickText(2, '隐私政策')">
隐私政策 </view
>&<view
style="color: #fa2c1a"
@click.stop="clickText(3, '积分使用规则')"
>
积分使用规则
</view>
</view>
</view>
<UserModal v-model:isShow="isShow" @closeEdit="isShow = false" />
</view>
</template>
@@ -86,4 +122,22 @@ page {
padding: 10px 100px;
}
}
.checkbox {
position: absolute;
bottom: -15%;
width: 100%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
justify-content: center;
.nut-checkbox__label {
margin-left: -60px;
}
.text {
display: flex;
}
}
</style>

View File

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

View File

@@ -0,0 +1,101 @@
page {
// IOS安全区域
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;
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;
}
}

View File

@@ -0,0 +1,159 @@
<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"
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>

View File

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

View File

@@ -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;
}
}

View 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>

View File

@@ -0,0 +1 @@
export default definePageConfig({});

View File

@@ -0,0 +1,37 @@
<template>
<view><rich-text :nodes="nodes"></rich-text> </view>
</template>
<script setup lang="ts">
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getAgreement } from "../../../api/user";
const nodes = ref(``);
Taro.useLoad((e) => {
Taro.setNavigationBarTitle({
title: e.name,
});
get_data(e.type);
});
const get_data = async (type: string) => {
const res = await getAgreement();
switch (type) {
case "1":
nodes.value = res.data.data.user;
break;
case "2":
nodes.value = res.data.data.policy;
break;
case "3":
nodes.value = res.data.data.integral;
break;
}
};
</script>
<style lang="scss">
@import "./index.scss";
</style>

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