Compare commits
134 Commits
aed8e6f73f
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c0036acfd | |||
| 2c38893c43 | |||
| a30d3572a5 | |||
| b6b6649a9b | |||
| 985c8fa766 | |||
| ef380ff569 | |||
| 63b61bbc98 | |||
| d831ee932b | |||
| 8b55419643 | |||
| f567cf7c94 | |||
| e1c00d6bb1 | |||
| 9edcf67620 | |||
| 8ca7001e3f | |||
| 6f5d722e6e | |||
| 6ca3669950 | |||
| 54b1d4b07c | |||
| 896acaef9e | |||
| 92d7bf1933 | |||
| 9af020af37 | |||
| e7fc232ba7 | |||
| 2b2e8ae481 | |||
| 8ece6b24e8 | |||
| b475228705 | |||
| 05caf08c47 | |||
| 7096e38967 | |||
| 3926922925 | |||
| 90f1764e7b | |||
| 52e49cca6c | |||
| 72705cb101 | |||
| 7eed620962 | |||
| a0e7966ee4 | |||
| 3489cabed1 | |||
| b9a5993e27 | |||
| b2ac7f33f3 | |||
| 4651318619 | |||
| 8e119162f1 | |||
| 097029128c | |||
| b5361277ca | |||
| af34993f69 | |||
| 94822f693a | |||
| 2f31aa7b70 | |||
| 94b6a9da10 | |||
| 962d7a2b19 | |||
| 20d112246e | |||
| d57f9cc53e | |||
| 230cd88f4d | |||
| b95fb364df | |||
| 1e7f5c3d71 | |||
| 1d8532eccf | |||
| e5041c3382 | |||
| f199320de0 | |||
| 9a57e2cc25 | |||
| f5dd812787 | |||
| 6318b525a9 | |||
| 749cd1a17e | |||
| 5db8a03723 | |||
| a5703e5494 | |||
| 6acb85d242 | |||
| d52bf0d1a5 | |||
| 004a6e188a | |||
| 1e1af4e7da | |||
| 621dc85f1f | |||
| ffa1c94bf7 | |||
| c1d1b949e4 | |||
| 9ea8f419f4 | |||
| 18c6446e5e | |||
| e55cc6c9e0 | |||
| b20930f516 | |||
| 5f8ed08d45 | |||
| f443caa511 | |||
| 728719f949 | |||
| c4645fdc17 | |||
| d1e5e92955 | |||
| d3bb76a858 | |||
| 243b414675 | |||
| fbc5e694e2 | |||
| 8bc22dcc97 | |||
| 1566eae251 | |||
| 45ad285ae9 | |||
| 5c45854e2c | |||
| cf805f24ce | |||
| f2af8198a9 | |||
| 8f310cad8f | |||
| a4451110dd | |||
| d163995765 | |||
| 1bbaeb821d | |||
| e6173319d9 | |||
| 0816707bdd | |||
| f67dc80a49 | |||
| e796bdbc8a | |||
| 09840d72ed | |||
| 4a186717d4 | |||
| 4245ae6c80 | |||
| 94a4b5e1df | |||
| 43ca8bd41a | |||
| 2db33b1889 | |||
| 1b1b724110 | |||
| 2392a34d9a | |||
| eb4dfc0887 | |||
| cd6078156e | |||
| 4c33c1c648 | |||
| 55de33461b | |||
| 6bd7e2f62c | |||
| 4f745c42f0 | |||
| bf64d6f9ef | |||
| ff84bde907 | |||
| 036819a0a7 | |||
| 8f3b158032 | |||
| e6f68c5ee8 | |||
| 33eccf0a24 | |||
| 97c758e598 | |||
| c13705d96a | |||
| b09c1d9537 | |||
| cee33dddd1 | |||
| 434ce9e4b5 | |||
| 4ed38eeca7 | |||
| e30a3ca698 | |||
| c5dbcba1b1 | |||
| 2819372cb9 | |||
| dcbd0eaae5 | |||
| a02257408d | |||
| ab9aff44da | |||
| 7ed844cd86 | |||
| f3c359e4eb | |||
| b85e360a17 | |||
| 863660c8f4 | |||
| edf1e49cce | |||
| 74ca20ca01 | |||
| 65d6737902 | |||
| 294a889199 | |||
| 0ad2cf3505 | |||
| 63733d0109 | |||
| d9735b60f0 | |||
| 2646d025f4 |
8
.cursorignore
Normal file
8
.cursorignore
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
|
||||||
|
|
||||||
|
/dist
|
||||||
|
/node_modules
|
||||||
|
/pnpm-store
|
||||||
|
/dist.tar
|
||||||
|
/dist.tar.gz
|
||||||
|
/dist.tar.gz.part
|
||||||
@@ -1,40 +1,40 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
types: [
|
types: [
|
||||||
{ value: "feat", name: "feat: 新增功能" },
|
{ value: 'feat', name: 'feat: 新增功能' },
|
||||||
{ value: "fix", name: "fix: 修复bug" },
|
{ value: 'fix', name: 'fix: 修复bug' },
|
||||||
{ value: "docs", name: "docs: 文档变更" },
|
{ value: 'docs', name: 'docs: 文档变更' },
|
||||||
{
|
{
|
||||||
value: "style",
|
value: 'style',
|
||||||
name: "style: 代码格式(不影响功能,例如空格、分号等格式修正)",
|
name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "refactor",
|
value: 'refactor',
|
||||||
name: "refactor: 代码重构(不包括 bug 修复、功能新增)",
|
name: 'refactor: 代码重构(不包括 bug 修复、功能新增)',
|
||||||
},
|
},
|
||||||
{ value: "perf", name: "perf: 性能优化" },
|
{ value: 'perf', name: 'perf: 性能优化' },
|
||||||
{ value: "test", name: "test: 添加、修改测试用例" },
|
{ value: 'test', name: 'test: 添加、修改测试用例' },
|
||||||
{
|
{
|
||||||
value: "build",
|
value: 'build',
|
||||||
name: "build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)",
|
name: 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)',
|
||||||
},
|
},
|
||||||
{ value: "ci", name: "ci: 修改 CI 配置、脚本" },
|
{ value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
|
||||||
{
|
{
|
||||||
value: "chore",
|
value: 'chore',
|
||||||
name: "chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)",
|
name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)',
|
||||||
},
|
},
|
||||||
{ value: "revert", name: "revert: 回滚 commit" },
|
{ value: 'revert', name: 'revert: 回滚 commit' },
|
||||||
{ value: "wip", name: "wip: 开发中" },
|
{ value: 'wip', name: 'wip: 开发中' },
|
||||||
{ value: "mod", name: "mod: 不确定分类的修改" },
|
{ value: 'mod', name: 'mod: 不确定分类的修改' },
|
||||||
{ value: "release", name: "release: 发布" },
|
{ value: 'release', name: 'release: 发布' },
|
||||||
],
|
],
|
||||||
scopes: [
|
scopes: [
|
||||||
["custom", "自定义"],
|
['custom', '自定义'],
|
||||||
["projects", "项目搭建"],
|
['projects', '项目搭建'],
|
||||||
["components", "组件相关"],
|
['components', '组件相关'],
|
||||||
["utils", "utils 相关"],
|
['utils', 'utils 相关'],
|
||||||
["styles", "样式相关"],
|
['styles', '样式相关'],
|
||||||
["deps", "项目依赖"],
|
['deps', '项目依赖'],
|
||||||
["other", "其他修改"],
|
['other', '其他修改'],
|
||||||
].map(([value, description]) => {
|
].map(([value, description]) => {
|
||||||
return {
|
return {
|
||||||
value,
|
value,
|
||||||
@@ -42,16 +42,16 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
messages: {
|
messages: {
|
||||||
type: "确保本次提交遵循 Angular 规范!选择你要提交的类型:\n",
|
type: '确保本次提交遵循 Angular 规范!选择你要提交的类型:\n',
|
||||||
scope: "选择一个 scope(可选):",
|
scope: '选择一个 scope(可选):',
|
||||||
customScope: "请输入自定义的 scope:",
|
customScope: '请输入自定义的 scope:',
|
||||||
subject: "填写简短精炼的变更描述:",
|
subject: '填写简短精炼的变更描述:',
|
||||||
body: '填写更加详细的变更描述(可选)。使用 "|" 换行:',
|
body: '填写更加详细的变更描述(可选)。使用 "|" 换行:',
|
||||||
breaking: "列举非兼容性重大的变更(可选):",
|
breaking: '列举非兼容性重大的变更(可选):',
|
||||||
footer: "列举出所有变更的 Issues Closed(可选)。 例如: #31, #34:",
|
footer: '列举出所有变更的 Issues Closed(可选)。 例如: #31, #34:',
|
||||||
confirmCommit: "确认提交?",
|
confirmCommit: '确认提交?',
|
||||||
},
|
},
|
||||||
allowBreakingChanges: ["feat", "fix"],
|
allowBreakingChanges: ['feat', 'fix'],
|
||||||
subjectLimit: 100,
|
subjectLimit: 100,
|
||||||
breaklineChar: "|",
|
breaklineChar: '|',
|
||||||
};
|
};
|
||||||
|
|||||||
64
.drone.yml
64
.drone.yml
@@ -1,64 +0,0 @@
|
|||||||
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 }}
|
|
||||||
"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,10 +2,17 @@
|
|||||||
TARO_APP_ID='wx7b3322daa2cf9c88'
|
TARO_APP_ID='wx7b3322daa2cf9c88'
|
||||||
|
|
||||||
# 开发版appkey
|
# 开发版appkey
|
||||||
TARO_APP_KEY='1234567890'
|
TARO_APP_KEY=''
|
||||||
|
|
||||||
# API接口
|
# API接口
|
||||||
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
|
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
|
||||||
|
|
||||||
# 游戏链接
|
|
||||||
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
# 版权文字
|
||||||
|
TARO_APP_NAME='捷兑通'
|
||||||
|
TARO_APP_COP='玩赚商城版权所有'
|
||||||
|
|
||||||
|
TARO_APP_TITLE_IMG='../../../static/index/1.png'
|
||||||
|
TARO_APP_LOGO_IMG='../../../static/logo.jpg'
|
||||||
|
|
||||||
|
TARO_APP_SHOW_NEW_HOME='no'
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
# 正式版版appid
|
# 正式版appid
|
||||||
TARO_APP_ID='wxdd00d46fa6f07974'
|
TARO_APP_ID='wxdd00d46fa6f07974'
|
||||||
|
|
||||||
# 开发版appkey
|
# 正式版appkey
|
||||||
TARO_APP_KEY='private.wxdd00d46fa6f07974.key'
|
TARO_APP_KEY='private.wxdd00d46fa6f07974.key'
|
||||||
|
|
||||||
# API接口
|
# API接口
|
||||||
TARO_APP_API='https://www.wanzhuanyongcheng.cn/app'
|
TARO_APP_API='https://www.wanzhuanyongcheng.cn/app'
|
||||||
|
|
||||||
TARO_APP_GAME='https://jdt-prod-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
|
||||||
|
# 版权文字
|
||||||
|
TARO_APP_NAME='捷兑通'
|
||||||
|
TARO_APP_COP='鑫瓴科技版权所有'
|
||||||
|
|
||||||
|
TARO_APP_TITLE_IMG='../../../static/index/1.png'
|
||||||
|
TARO_APP_LOGO_IMG='../../../static/logo.jpg'
|
||||||
|
|
||||||
|
|
||||||
|
TARO_APP_SHOW_NEW_HOME='no'
|
||||||
18
.env.reserve
Normal file
18
.env.reserve
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# 备用版appid
|
||||||
|
TARO_APP_ID='wx4a9380d8bb16d9de'
|
||||||
|
|
||||||
|
# 备用版appkey
|
||||||
|
TARO_APP_KEY='private.wx4a9380d8bb16d9de.key'
|
||||||
|
|
||||||
|
# API接口
|
||||||
|
TARO_APP_API='https://api.gxwzwh.com/app'
|
||||||
|
|
||||||
|
# 版权文字
|
||||||
|
TARO_APP_NAME='玩赚商城'
|
||||||
|
|
||||||
|
TARO_APP_COP='玩赚商城版权所有'
|
||||||
|
|
||||||
|
TARO_APP_TITLE_IMG='../../../static/index/title.png'
|
||||||
|
TARO_APP_LOGO_IMG='../../../static/logo-1.jpg'
|
||||||
|
|
||||||
|
TARO_APP_SHOW_NEW_HOME='yes'
|
||||||
11
.env.test
11
.env.test
@@ -7,5 +7,12 @@ TARO_APP_KEY='private.wx7b3322daa2cf9c88.key'
|
|||||||
# API接口
|
# API接口
|
||||||
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
|
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
|
||||||
|
|
||||||
# 游戏链接
|
|
||||||
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
# 版权文字
|
||||||
|
TARO_APP_NAME='捷兑通'
|
||||||
|
TARO_APP_COP='鑫瓴科技版权所有'
|
||||||
|
|
||||||
|
TARO_APP_TITLE_IMG='../../static/index/1.png'
|
||||||
|
TARO_APP_LOGO_IMG='../../../static/logo.jpg'
|
||||||
|
|
||||||
|
TARO_APP_SHOW_NEW_HOME='no'
|
||||||
4
.eslintignore
Normal file
4
.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
/node_modules/**
|
||||||
|
/dist/*
|
||||||
|
/public/*
|
||||||
|
/src/static/*
|
||||||
126
.gitea/workflows/ci.yaml
Normal file
126
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
name: CI Build & Upload (WeApp)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- test
|
||||||
|
- master
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-upload-dev:
|
||||||
|
if: ${{ gitea.ref == 'refs/heads/test' }}
|
||||||
|
runs-on: gitea_act_runner
|
||||||
|
container:
|
||||||
|
image: node:24-alpine
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
npm install -g pnpm
|
||||||
|
pnpm config set registry https://registry.npmmirror.com/
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
- name: Build & Upload (test)
|
||||||
|
run: |
|
||||||
|
pnpm build:weapp:test:upload
|
||||||
|
rm -rf dist.tar || true
|
||||||
|
|
||||||
|
- name: Notify WeCom (Dev)
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||||
|
STATUS: ${{ job.status }}
|
||||||
|
REPO: ${{ gitea.repository }}
|
||||||
|
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||||
|
BRANCH: ${{ gitea.ref_name }}
|
||||||
|
COMMIT: ${{ gitea.sha }}
|
||||||
|
ACTOR: ${{ gitea.actor }}
|
||||||
|
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
||||||
|
run: |
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --no-cache curl jq
|
||||||
|
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
||||||
|
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
||||||
|
"$EMOJI" "$REPO" "${{ gitea.run_number }}" "$BRANCH" "$COMMIT" "$ACTOR" "$(echo "$COMMIT_MSG" | tr '\n' ' ' | tr -s ' ')" "$RUN_URL")"
|
||||||
|
JSON=$(jq -n --arg content "$MSG" '{msgtype:"markdown", markdown:{content:$content}}')
|
||||||
|
curl -sS -H 'Content-Type: application/json' -d "$JSON" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||||
|
|
||||||
|
build-upload-prod:
|
||||||
|
if: ${{ gitea.ref == 'refs/heads/master' }}
|
||||||
|
runs-on: gitea_act_runner
|
||||||
|
container:
|
||||||
|
image: node:24-alpine
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
npm install -g pnpm
|
||||||
|
pnpm config set registry https://registry.npmmirror.com/
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
- name: Build & Upload (prod)
|
||||||
|
run: |
|
||||||
|
pnpm build:weapp:prod:upload
|
||||||
|
rm -rf dist.tar || true
|
||||||
|
|
||||||
|
- name: Notify WeCom (Prod)
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||||
|
STATUS: ${{ job.status }}
|
||||||
|
REPO: ${{ gitea.repository }}
|
||||||
|
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||||
|
BRANCH: ${{ gitea.ref_name }}
|
||||||
|
COMMIT: ${{ gitea.sha }}
|
||||||
|
ACTOR: ${{ gitea.actor }}
|
||||||
|
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
||||||
|
run: |
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --no-cache curl jq
|
||||||
|
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
||||||
|
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
||||||
|
"$EMOJI" "$REPO" "${{ gitea.run_number }}" "$BRANCH" "$COMMIT" "$ACTOR" "$(echo "$COMMIT_MSG" | tr '\n' ' ' | tr -s ' ')" "$RUN_URL")"
|
||||||
|
JSON=$(jq -n --arg content "$MSG" '{msgtype:"markdown", markdown:{content:$content}}')
|
||||||
|
curl -sS -H 'Content-Type: application/json' -d "$JSON" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||||
|
|
||||||
|
build-upload-reserve:
|
||||||
|
if: ${{ gitea.ref == 'refs/heads/master' }}
|
||||||
|
runs-on: gitea_act_runner
|
||||||
|
container:
|
||||||
|
image: node:24-alpine
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
npm install -g pnpm
|
||||||
|
pnpm config set registry https://registry.npmmirror.com/
|
||||||
|
pnpm install
|
||||||
|
|
||||||
|
- name: Build & Upload (reserve)
|
||||||
|
run: |
|
||||||
|
pnpm build:weapp:reserve:upload
|
||||||
|
rm -rf dist.tar || true
|
||||||
|
|
||||||
|
- name: Notify WeCom (Reserve)
|
||||||
|
if: always()
|
||||||
|
env:
|
||||||
|
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||||
|
STATUS: ${{ job.status }}
|
||||||
|
REPO: ${{ gitea.repository }}
|
||||||
|
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||||
|
BRANCH: ${{ gitea.ref_name }}
|
||||||
|
COMMIT: ${{ gitea.sha }}
|
||||||
|
ACTOR: ${{ gitea.actor }}
|
||||||
|
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
||||||
|
run: |
|
||||||
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories || true
|
||||||
|
apk add --no-cache curl jq
|
||||||
|
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
||||||
|
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
||||||
|
"$EMOJI" "$REPO" "${{ gitea.run_number }}" "$BRANCH" "$COMMIT" "$ACTOR" "$(echo "$COMMIT_MSG" | tr '\n' ' ' | tr -s ' ')" "$RUN_URL")"
|
||||||
|
JSON=$(jq -n --arg content "$MSG" '{msgtype:"markdown", markdown:{content:$content}}')
|
||||||
|
curl -sS -H 'Content-Type: application/json' -d "$JSON" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -5,3 +5,4 @@ deploy_versions/
|
|||||||
node_modules/
|
node_modules/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
.swc
|
.swc
|
||||||
|
pnpm-lock.yaml
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
/node_modules/**
|
/node_modules/**
|
||||||
/dist/*
|
/dist/*
|
||||||
/public/*
|
/public/*
|
||||||
|
/src/static/*
|
||||||
8
.prettierrc.json
Normal file
8
.prettierrc.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"bracketSameLine": true,
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "all",
|
||||||
|
"endOfLine": "lf"
|
||||||
|
}
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
// babel-preset-taro 更多选项和默认值:
|
|
||||||
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
"taro",
|
'taro',
|
||||||
{
|
{
|
||||||
framework: "vue3",
|
framework: 'vue3',
|
||||||
ts: true,
|
ts: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
ignores: [(commit) => commit.includes("init")],
|
ignores: [commit => commit.includes('init')],
|
||||||
extends: ["@commitlint/config-conventional"],
|
extends: ['@commitlint/config-conventional'],
|
||||||
rules: {
|
rules: {
|
||||||
"type-enum": [
|
'type-enum': [
|
||||||
2,
|
2,
|
||||||
"always",
|
'always',
|
||||||
[
|
[
|
||||||
"feat",
|
'feat',
|
||||||
"fix",
|
'fix',
|
||||||
"docs",
|
'docs',
|
||||||
"style",
|
'style',
|
||||||
"refactor",
|
'refactor',
|
||||||
"perf",
|
'perf',
|
||||||
"test",
|
'test',
|
||||||
"build",
|
'build',
|
||||||
"ci",
|
'ci',
|
||||||
"chore",
|
'chore',
|
||||||
"revert",
|
'revert',
|
||||||
"wip",
|
'wip',
|
||||||
"mod",
|
'mod',
|
||||||
"release",
|
'release',
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|||||||
17
components.d.ts
vendored
17
components.d.ts
vendored
@@ -1,11 +1,12 @@
|
|||||||
// generated by unplugin-vue-components
|
/* eslint-disable */
|
||||||
// We suggest you to commit this file into source control
|
// @ts-nocheck
|
||||||
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
import '@vue/runtime-core'
|
// biome-ignore lint: disable
|
||||||
|
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
declare module '@vue/runtime-core' {
|
/* prettier-ignore */
|
||||||
|
declare module 'vue' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
Auth: typeof import('./src/components/Auth.vue')['default']
|
Auth: typeof import('./src/components/Auth.vue')['default']
|
||||||
Back: typeof import('./src/components/Back.vue')['default']
|
Back: typeof import('./src/components/Back.vue')['default']
|
||||||
@@ -32,9 +33,12 @@ declare module '@vue/runtime-core' {
|
|||||||
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
|
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
|
||||||
NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
|
NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
|
||||||
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
|
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
|
||||||
|
NutPopover: typeof import('@nutui/nutui-taro')['Popover']
|
||||||
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
|
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
|
||||||
NutPrice: typeof import('@nutui/nutui-taro')['Price']
|
NutPrice: typeof import('@nutui/nutui-taro')['Price']
|
||||||
NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar']
|
NutRadio: typeof import('@nutui/nutui-taro')['Radio']
|
||||||
|
NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup']
|
||||||
|
NutRate: typeof import('@nutui/nutui-taro')['Rate']
|
||||||
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
|
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
|
||||||
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
|
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
|
||||||
NutSwitch: typeof import('@nutui/nutui-taro')['Switch']
|
NutSwitch: typeof import('@nutui/nutui-taro')['Switch']
|
||||||
@@ -46,6 +50,7 @@ declare module '@vue/runtime-core' {
|
|||||||
Pay: typeof import('./src/components/Pay.vue')['default']
|
Pay: typeof import('./src/components/Pay.vue')['default']
|
||||||
Popup: typeof import('./src/components/Popup.vue')['default']
|
Popup: typeof import('./src/components/Popup.vue')['default']
|
||||||
RichEditor: typeof import('./src/components/RichEditor.vue')['default']
|
RichEditor: typeof import('./src/components/RichEditor.vue')['default']
|
||||||
|
StoreList: typeof import('./src/components/StoreList.vue')['default']
|
||||||
Ucharts: typeof import('./src/components/Ucharts.vue')['default']
|
Ucharts: typeof import('./src/components/Ucharts.vue')['default']
|
||||||
Upload: typeof import('./src/components/Upload.vue')['default']
|
Upload: typeof import('./src/components/Upload.vue')['default']
|
||||||
UserModal: typeof import('./src/components/UserModal.vue')['default']
|
UserModal: typeof import('./src/components/UserModal.vue')['default']
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"development"',
|
NODE_ENV: '"development"',
|
||||||
},
|
},
|
||||||
defineConstants: {},
|
|
||||||
mini: {},
|
mini: {},
|
||||||
h5: {},
|
h5: {},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,31 +1,32 @@
|
|||||||
// @ts-nocheck
|
import Components from 'unplugin-vue-components/webpack';
|
||||||
import Components from "unplugin-vue-components/webpack";
|
import NutUIResolver from '@nutui/nutui-taro/dist/resolver';
|
||||||
import NutUIResolver from "@nutui/nutui-taro/dist/resolver";
|
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack';
|
||||||
import { join } from "node:path";
|
import { join } from 'node:path';
|
||||||
import { argv } from "yargs";
|
import { argv } from 'yargs';
|
||||||
|
|
||||||
const { robot = 1, desc } = argv;
|
|
||||||
|
|
||||||
const CIPluginOptFn = async () => {
|
const CIPluginOptFn = async () => {
|
||||||
/**
|
/**
|
||||||
* @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
|
* @typedef { import('@tarojs/plugin-mini-ci').CIOptions } CIOptions
|
||||||
* @type {CIOptions}
|
* @type {CIOptions}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const parsedArgs = await argv;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
weapp: {
|
weapp: {
|
||||||
appid: process.env.TARO_APP_ID,
|
appid: process.env.TARO_APP_ID,
|
||||||
privateKeyPath: process.env.TARO_APP_KEY,
|
privateKeyPath: process.env.TARO_APP_KEY,
|
||||||
robot,
|
robot: parsedArgs.robot || 1,
|
||||||
},
|
},
|
||||||
desc,
|
desc: parsedArgs.desc,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
projectName: "taroApp",
|
projectName: 'taroApp',
|
||||||
date: "2023-8-13",
|
date: '2023-8-13',
|
||||||
designWidth(input: { file: string }) {
|
designWidth(input: { file: string }) {
|
||||||
if (input?.file?.replace(/\\+/g, "/").indexOf("@nutui") > -1) {
|
if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) {
|
||||||
return 375;
|
return 375;
|
||||||
}
|
}
|
||||||
return 750;
|
return 750;
|
||||||
@@ -36,34 +37,47 @@ const config = {
|
|||||||
828: 1.81 / 2,
|
828: 1.81 / 2,
|
||||||
375: 2,
|
375: 2,
|
||||||
},
|
},
|
||||||
sourceRoot: "src",
|
sourceRoot: 'src',
|
||||||
outputRoot: "dist",
|
outputRoot: `dist/${process.env.TARO_ENV}`,
|
||||||
plugins: ["@tarojs/plugin-html", ["@tarojs/plugin-mini-ci", CIPluginOptFn]],
|
plugins: ['@tarojs/plugin-html', ['@tarojs/plugin-mini-ci', CIPluginOptFn]],
|
||||||
defineConstants: {},
|
defineConstants: {},
|
||||||
copy: {
|
copy: {
|
||||||
patterns: [],
|
patterns: [],
|
||||||
options: {},
|
options: {},
|
||||||
},
|
},
|
||||||
framework: "vue3",
|
framework: 'vue3',
|
||||||
compiler: {
|
compiler: {
|
||||||
type: "webpack5",
|
type: 'webpack5',
|
||||||
prebundle: { enable: false },
|
prebundle: { enable: process.env.TARO_ENV === 'h5' },
|
||||||
},
|
},
|
||||||
cache: {
|
cache: {
|
||||||
enable: true, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
enable: false, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
||||||
},
|
},
|
||||||
sass: {
|
sass: {
|
||||||
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`,
|
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`,
|
||||||
|
silenceDeprecations: ['import'],
|
||||||
},
|
},
|
||||||
alias: {
|
alias: {
|
||||||
"@": join(__dirname, "..", "src"),
|
'@': join(__dirname, '..', 'src'),
|
||||||
},
|
},
|
||||||
mini: {
|
mini: {
|
||||||
webpackChain(chain) {
|
webpackChain(chain) {
|
||||||
chain.plugin("unplugin-vue-components").use(
|
chain.merge({
|
||||||
|
plugin: {
|
||||||
|
install: {
|
||||||
|
plugin: UnifiedWebpackPluginV5,
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
appType: 'taro',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
chain.plugin('unplugin-vue-components').use(
|
||||||
Components({
|
Components({
|
||||||
resolvers: [NutUIResolver({ taro: true })],
|
resolvers: [NutUIResolver({ taro: true })],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
miniCssExtractPluginOption: {
|
miniCssExtractPluginOption: {
|
||||||
@@ -75,6 +89,7 @@ const config = {
|
|||||||
enable: true,
|
enable: true,
|
||||||
config: {
|
config: {
|
||||||
// selectorBlackList: ['nut-']
|
// selectorBlackList: ['nut-']
|
||||||
|
removeCursorStyle: false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
url: {
|
url: {
|
||||||
@@ -86,23 +101,23 @@ const config = {
|
|||||||
cssModules: {
|
cssModules: {
|
||||||
enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
|
enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||||
config: {
|
config: {
|
||||||
namingPattern: "module", // 转换模式,取值为 global/module
|
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||||
generateScopedName: "[name]__[local]___[hash:base64:5]",
|
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
h5: {
|
h5: {
|
||||||
webpackChain(chain) {
|
webpackChain(chain) {
|
||||||
chain.plugin("unplugin-vue-components").use(
|
chain.plugin('unplugin-vue-components').use(
|
||||||
Components({
|
Components({
|
||||||
resolvers: [NutUIResolver({ taro: true })],
|
resolvers: [NutUIResolver({ taro: true })],
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
publicPath: "/",
|
publicPath: '/',
|
||||||
staticDirectory: "static",
|
staticDirectory: 'static',
|
||||||
esnextModules: ["nutui-taro", "icons-vue-taro"],
|
esnextModules: ['nutui-taro', 'icons-vue-taro'],
|
||||||
postcss: {
|
postcss: {
|
||||||
autoprefixer: {
|
autoprefixer: {
|
||||||
enable: true,
|
enable: true,
|
||||||
@@ -111,8 +126,8 @@ const config = {
|
|||||||
cssModules: {
|
cssModules: {
|
||||||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||||
config: {
|
config: {
|
||||||
namingPattern: "module", // 转换模式,取值为 global/module
|
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||||
generateScopedName: "[name]__[local]___[hash:base64:5]",
|
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -120,8 +135,8 @@ const config = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
module.exports = function (merge) {
|
module.exports = function (merge) {
|
||||||
if (process.env.NODE_ENV === "development") {
|
if (process.env.NODE_ENV === 'development') {
|
||||||
return merge({}, config, require("./dev"));
|
return merge({}, config, require('./dev'));
|
||||||
}
|
}
|
||||||
return merge({}, config, require("./prod"));
|
return merge({}, config, require('./prod'));
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ module.exports = {
|
|||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"production"',
|
NODE_ENV: '"production"',
|
||||||
},
|
},
|
||||||
defineConstants: {},
|
|
||||||
mini: {},
|
mini: {},
|
||||||
h5: {
|
h5: {
|
||||||
/**
|
/**
|
||||||
|
|||||||
230
package.json
230
package.json
@@ -1,115 +1,119 @@
|
|||||||
{
|
{
|
||||||
"name": "jdt-user",
|
"name": "jdt-user",
|
||||||
"version": "3.0.12",
|
"version": "4.0.18",
|
||||||
"private": true,
|
"taroConfig": {
|
||||||
"description": "",
|
"version": "4.0.18"
|
||||||
"templateInfo": {
|
},
|
||||||
"name": "jdt-user",
|
"scripts": {
|
||||||
"typescript": true,
|
"build:weapp": "taro build --type weapp",
|
||||||
"css": "sass"
|
"build:test": "taro build --type weapp --mode reserve",
|
||||||
},
|
"build:swan": "taro build --type swan",
|
||||||
"taroConfig": {
|
"build:alipay": "taro build --type alipay",
|
||||||
"version": "3.0.12"
|
"build:tt": "taro build --type tt",
|
||||||
},
|
"build:h5": "taro build --type h5",
|
||||||
"scripts": {
|
"build:rn": "taro build --type rn",
|
||||||
"build:weapp": "taro build --type weapp",
|
"build:qq": "taro build --type qq",
|
||||||
"build:test": "taro build --type weapp --mode test",
|
"build:jd": "taro build --type jd",
|
||||||
"build:swan": "taro build --type swan",
|
"build:quickapp": "taro build --type quickapp",
|
||||||
"build:alipay": "taro build --type alipay",
|
"dev:weapp": "taro build --type weapp --watch",
|
||||||
"build:tt": "taro build --type tt",
|
"dev:weapp:prview": "taro build --type weapp --watch --mode reserve",
|
||||||
"build:h5": "taro build --type h5",
|
"dev:swan": "npm run build:swan -- --watch",
|
||||||
"build:rn": "taro build --type rn",
|
"dev:alipay": "npm run build:alipay -- --watch",
|
||||||
"build:qq": "taro build --type qq",
|
"dev:tt": "npm run build:tt -- --watch",
|
||||||
"build:jd": "taro build --type jd",
|
"dev:h5": "npm run build:h5 -- --watch",
|
||||||
"build:quickapp": "taro build --type quickapp",
|
"dev:rn": "npm run build:rn -- --watch",
|
||||||
"dev:weapp": "taro build --type weapp --watch",
|
"dev:qq": "npm run build:qq -- --watch",
|
||||||
"dev:swan": "npm run build:swan -- --watch",
|
"dev:jd": "npm run build:jd -- --watch",
|
||||||
"dev:alipay": "npm run build:alipay -- --watch",
|
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||||
"dev:tt": "npm run build:tt -- --watch",
|
"lint": "eslint --ext .ts,.vue .",
|
||||||
"dev:h5": "npm run build:h5 -- --watch",
|
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
||||||
"dev:rn": "npm run build:rn -- --watch",
|
"lint:staged": "lint-staged",
|
||||||
"dev:qq": "npm run build:qq -- --watch",
|
"prepare": "husky install",
|
||||||
"dev:jd": "npm run build:jd -- --watch",
|
"cz": "cz",
|
||||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
"postinstall": "weapp-tw patch",
|
||||||
"lint": "eslint --ext .ts,.vue .",
|
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
||||||
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
"build:weapp:reserve:upload": "taro build --type weapp --upload --robot=3 --desc='备用环境' --mode reserve",
|
||||||
"lint:staged": "lint-staged",
|
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
||||||
"prepare": "husky install",
|
},
|
||||||
"preview": "vite preview",
|
"browserslist": [
|
||||||
"cz": "cz",
|
"last 3 versions",
|
||||||
"lf": "npx prettier --write --end-of-line lf .",
|
"Android >= 4.1",
|
||||||
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
"ios >= 8"
|
||||||
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
],
|
||||||
},
|
"author": "JDT",
|
||||||
"browserslist": [
|
"lint-staged": {
|
||||||
"last 3 versions",
|
"*.{ts,vue}": [
|
||||||
"Android >= 4.1",
|
"eslint --ext .ts,.vue ."
|
||||||
"ios >= 8"
|
]
|
||||||
],
|
},
|
||||||
"author": "",
|
"config": {
|
||||||
"lint-staged": {
|
"commitizen": {
|
||||||
"*.{ts,vue}": [
|
"path": "node_modules/cz-customizable"
|
||||||
"eslint --ext .ts,.vue .",
|
}
|
||||||
"npx prettier --write --end-of-line lf ."
|
},
|
||||||
]
|
"dependencies": {
|
||||||
},
|
"@babel/runtime": "^7.28.4",
|
||||||
"config": {
|
"@nutui/icons-vue-taro": "^0.0.9",
|
||||||
"commitizen": {
|
"@nutui/nutui-taro": "^4.3.14",
|
||||||
"path": "node_modules/cz-customizable"
|
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||||
}
|
"@tarojs/components": "4.1.6",
|
||||||
},
|
"@tarojs/helper": "4.1.6",
|
||||||
"dependencies": {
|
"@tarojs/plugin-framework-vue3": "4.1.6",
|
||||||
"@babel/runtime": "^7.23.5",
|
"@tarojs/plugin-html": "4.1.6",
|
||||||
"@nutui/icons-vue-taro": "^0.0.9",
|
"@tarojs/plugin-platform-alipay": "4.1.6",
|
||||||
"@nutui/nutui-taro": "^4.3.1",
|
"@tarojs/plugin-platform-h5": "4.1.6",
|
||||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
"@tarojs/plugin-platform-jd": "4.1.6",
|
||||||
"@tarojs/components": "3.6.24",
|
"@tarojs/plugin-platform-qq": "4.1.6",
|
||||||
"@tarojs/helper": "3.6.24",
|
"@tarojs/plugin-platform-swan": "4.1.6",
|
||||||
"@tarojs/plugin-framework-vue3": "3.6.24",
|
"@tarojs/plugin-platform-tt": "4.1.6",
|
||||||
"@tarojs/plugin-html": "3.6.24",
|
"@tarojs/plugin-platform-weapp": "4.1.6",
|
||||||
"@tarojs/plugin-platform-alipay": "3.6.24",
|
"@tarojs/runtime": "4.1.6",
|
||||||
"@tarojs/plugin-platform-h5": "3.6.24",
|
"@tarojs/shared": "4.1.6",
|
||||||
"@tarojs/plugin-platform-jd": "3.6.24",
|
"@tarojs/taro": "4.1.6",
|
||||||
"@tarojs/plugin-platform-qq": "3.6.24",
|
"dayjs": "^1.11.18",
|
||||||
"@tarojs/plugin-platform-swan": "3.6.24",
|
"pinia": "^2.3.1",
|
||||||
"@tarojs/plugin-platform-tt": "3.6.24",
|
"uqrcodejs": "^4.0.7",
|
||||||
"@tarojs/plugin-platform-weapp": "3.6.24",
|
"vue": "^3.5.21"
|
||||||
"@tarojs/runtime": "3.6.24",
|
},
|
||||||
"@tarojs/shared": "3.6.24",
|
"devDependencies": {
|
||||||
"@tarojs/taro": "3.6.24",
|
"@babel/core": "^7.28.4",
|
||||||
"dayjs": "^1.11.10",
|
"@commitlint/cli": "^18.6.1",
|
||||||
"pinia": "^2.1.7",
|
"@commitlint/config-conventional": "^18.6.3",
|
||||||
"vue": "^3.3.9"
|
"@tarojs/cli": "4.1.6",
|
||||||
},
|
"@tarojs/plugin-mini-ci": "4.1.6",
|
||||||
"devDependencies": {
|
"@tarojs/taro-loader": "4.1.6",
|
||||||
"@babel/core": "^7.23.5",
|
"@tarojs/webpack5-runner": "4.1.6",
|
||||||
"@commitlint/cli": "^18.4.3",
|
"@types/node": "^18.19.124",
|
||||||
"@commitlint/config-conventional": "^18.4.3",
|
"@types/webpack-env": "^1.18.8",
|
||||||
"@tarojs/cli": "3.6.24",
|
"@types/yargs": "^17.0.33",
|
||||||
"@tarojs/plugin-mini-ci": "3.6.24",
|
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||||
"@tarojs/taro-loader": "3.6.24",
|
"@typescript-eslint/parser": "^6.21.0",
|
||||||
"@tarojs/webpack5-runner": "3.6.24",
|
"@unocss/webpack": "^0.60.4",
|
||||||
"@types/node": "^18.19.1",
|
"@vue/babel-plugin-jsx": "^1.5.0",
|
||||||
"@types/webpack-env": "^1.18.4",
|
"@vue/compiler-sfc": "^3.5.21",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
"autoprefixer": "^10.4.21",
|
||||||
"@typescript-eslint/parser": "^6.13.1",
|
"babel-preset-taro": "4.1.6",
|
||||||
"@vue/babel-plugin-jsx": "^1.1.5",
|
"commitizen": "^4.3.1",
|
||||||
"@vue/compiler-sfc": "^3.3.9",
|
"css-loader": "3.4.2",
|
||||||
"babel-preset-taro": "3.6.24",
|
"cz-customizable": "^7.5.1",
|
||||||
"commitizen": "^4.3.0",
|
"eslint": "^8.57.1",
|
||||||
"css-loader": "3.4.2",
|
"eslint-config-taro": "4.1.6",
|
||||||
"cz-customizable": "^7.0.0",
|
"eslint-plugin-vue": "^9.33.0",
|
||||||
"eslint": "^8.55.0",
|
"husky": "^8.0.3",
|
||||||
"eslint-config-taro": "3.6.24",
|
"lint-staged": "^15.5.2",
|
||||||
"eslint-plugin-vue": "^9.19.2",
|
"miniprogram-ci": "^2.1.26",
|
||||||
"husky": "^8.0.3",
|
"postcss": "8.4.29",
|
||||||
"lint-staged": "^15.1.0",
|
"postcss-rem-to-responsive-pixel": "^6.1.0",
|
||||||
"style-loader": "1.3.0",
|
"prettier": "^3.6.2",
|
||||||
"stylelint": "9.3.0",
|
"style-loader": "1.3.0",
|
||||||
"ts-node": "^10.9.1",
|
"stylelint": "9.3.0",
|
||||||
"typescript": "^4.9.5",
|
"tailwindcss": "^3.4.17",
|
||||||
"unplugin-vue-components": "^0.23.0",
|
"ts-node": "^10.9.2",
|
||||||
"vue-loader": "^17.3.1",
|
"typescript": "^5.9.2",
|
||||||
"webpack": "^5.89.0"
|
"unplugin-vue-components": "^28.8.0",
|
||||||
}
|
"vue-loader": "^17.4.2",
|
||||||
|
"weapp-tailwindcss": "^3.7.0",
|
||||||
|
"webpack": "^5.101.3",
|
||||||
|
"yargs": "^17.7.2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
17960
pnpm-lock.yaml
generated
17960
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
13
pnpm-workspace.yaml
Normal file
13
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
onlyBuiltDependencies:
|
||||||
|
- '@parcel/watcher'
|
||||||
|
- '@swc/core'
|
||||||
|
- '@tarojs/binding'
|
||||||
|
- '@tarojs/cli'
|
||||||
|
- core-js
|
||||||
|
- core-js-pure
|
||||||
|
- esbuild
|
||||||
|
- less
|
||||||
|
- protobufjs
|
||||||
|
- swiper
|
||||||
|
- vue-demi
|
||||||
|
- weapp-tailwindcss
|
||||||
14
postcss.config.js
Normal file
14
postcss.config.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
module.exports = {
|
||||||
|
plugins: {
|
||||||
|
tailwindcss: {},
|
||||||
|
autoprefixer: {},
|
||||||
|
'postcss-rem-to-responsive-pixel': {
|
||||||
|
// 32 意味着 1rem = 32rpx
|
||||||
|
rootValue: 32,
|
||||||
|
// 默认所有属性都转化
|
||||||
|
propList: ['*'],
|
||||||
|
// 转化的单位,可以变成 px / rpx
|
||||||
|
transformUnit: 'rpx',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
27
private.wx4a9380d8bb16d9de.key
Normal file
27
private.wx4a9380d8bb16d9de.key
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
MIIEogIBAAKCAQEAmHk5BywZ6y2rji/dL2HooKGiTuHrcSeGFODvDK6PPUjnieWB
|
||||||
|
ev7C6N9kBWNbtYiwyLVpW5iKCxCb/GaBa5EIE0nXnKiOhThP3a8OYDW0oA9Xyp03
|
||||||
|
1W56U3tnHA/GziyABIIMxqA45WYh3e9ar/sdhDvDyre0yl+8cWcPdNOVOW7as88W
|
||||||
|
yXDsCQbQedPIAy3sRANZ6K2QTNe5Aht3Y7F1uMKRlJwLodutUopPd32rxJz7WNhB
|
||||||
|
j9CrjzgnfLJa7siURM2r6om2osNFqHP4bmy5yO68TPI8JQgJTUqoNswgFDa2ng9Y
|
||||||
|
lOhks6kMR8ldL89+fYqILGDVG7124LKIo1awTQIDAQABAoIBACS+Kaj5zrEmy02z
|
||||||
|
aRjO/lEfQk7CEIuvG5eScOjcc/YvyGQpo18xX2Tg2GiX/fSsIPXtCZuiEboC4aQc
|
||||||
|
S5nRVGHZjJTa5aVi4ZQpaEx1BLcBm4VfB6JuQho2Ba30e1MZ1CvB7zQ6Thux1f12
|
||||||
|
faMk34MLJ+6FAJM4KOAnFslvZ2l0VxIlBq5pbF71dO/MsIrpBWVFNGqu6jtXRUJw
|
||||||
|
J92PbaFMi/smsgdXixsokzPmE5em3zLdp5cfHQCRBjNBclMjlnHhwQVK8wU7D609
|
||||||
|
CPcvPS8J3PMceMeGXC1QXFANllVecmn7jECVBU5H4Ed0pb89T9Q7yWVnVBo31ZB7
|
||||||
|
r4GuL+ECgYEAyLcE4cuPsp31oaKATSZrBmypQuGFsarddyereN8ATZ9DjbFL9Y2/
|
||||||
|
NazLmG1KjeD1yN1q9/ek+nctKTNzuY14cVeahDoiv0ALNUOuS7IFzoHWf5SnNKEx
|
||||||
|
oEgGJV9D6olk9YnPF5iwn/lRL84af3dxSnKr75hh8Yv5hWrPnJ95xJkCgYEAwniQ
|
||||||
|
z6yFg2SmnzwwYV72/aoukmsI3KKBHMEDkAFOummy7iv8eT+9DLumQ9BC+mT3eFmq
|
||||||
|
GVNVM+199NTQ5b5CzXYalSsw93rewhRkk0RVV31AJUwaRbYy6F6O502SpFYb4n8f
|
||||||
|
S7KfDv70utGOnycMBNjeaFGWxAZbUCLjfUv8JdUCgYBb1fGz5lHPZhrXY+TUZ/mc
|
||||||
|
LOedJFbpncZLGKmKWm5nFbHxCOg6aCrOwks9aPQtynpq93RUFMk1mIXfTh1rDuHG
|
||||||
|
6lBWo8r2OrVmH5uGIuQpQpsEMN34ZLCyJ4I4Y0hN7aN1/SH2J/TYnViaSPEy1VHO
|
||||||
|
wH0O2Wgm/uaiNubbQNSUMQKBgCXT5fc/i8j/LxoSTybhnhHBpMV+ZH7mbU72jIba
|
||||||
|
ekHwhYmmrLm5GED9z12piR3Dvg9/AYNjnlM3gyS4sNm/pKbqrkkN2byJ/gKqjNXI
|
||||||
|
mQEnr+6RWxrsUgK5QfrkL/4fcdUg/SlwWVhFZ71fPerfYYsf1ENee4Et610vLCkX
|
||||||
|
OrjxAoGATIlZgaPuDA/Sh/YTxxSEjNZGCWx4YvWZfL+PW2ItuadMeD2lLai6lOOi
|
||||||
|
9ew2xXZkvaeA9PGOA5YK2121M5brwkB0Kc3zNvEmrkpQDJYqeoRvLEuFGDmZ/MX1
|
||||||
|
p0bzKs1vvh5dyFjWQ5IN9FckZ3Fpk6A1zMEuyQdk35TwX+w5EdE=
|
||||||
|
-----END RSA PRIVATE KEY-----
|
||||||
@@ -1,14 +1,31 @@
|
|||||||
{
|
{
|
||||||
"miniprogramRoot": "./dist",
|
"miniprogramRoot": "dist/",
|
||||||
"projectname": "taroApp",
|
"projectname": "捷兑通",
|
||||||
"description": "",
|
"description": "",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": true,
|
"urlCheck": true,
|
||||||
"es6": false,
|
"es6": true,
|
||||||
"enhance": false,
|
"enhance": true,
|
||||||
"compileHotReLoad": false,
|
"compileHotReLoad": false,
|
||||||
"postcss": false,
|
"postcss": true,
|
||||||
"minified": false
|
"minified": true,
|
||||||
|
"babelSetting": {
|
||||||
|
"ignore": [],
|
||||||
|
"disablePlugins": [],
|
||||||
|
"outputPath": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"compileType": "miniprogram"
|
"compileType": "miniprogram",
|
||||||
|
"appid": "wx7b3322daa2cf9c88",
|
||||||
|
"libVersion": "3.7.11",
|
||||||
|
"srcMiniprogramRoot": "dist/",
|
||||||
|
"packOptions": {
|
||||||
|
"ignore": [],
|
||||||
|
"include": []
|
||||||
|
},
|
||||||
|
"condition": {},
|
||||||
|
"editorSetting": {
|
||||||
|
"tabIndent": "insertSpaces",
|
||||||
|
"tabSize": 2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
project.private.config.json
Normal file
7
project.private.config.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||||
|
"projectname": "%E6%8D%B7%E5%85%91%E9%80%9A",
|
||||||
|
"setting": {
|
||||||
|
"compileHotReLoad": false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,44 +1,44 @@
|
|||||||
import request from "../utils/request";
|
import request from '../utils/request';
|
||||||
|
|
||||||
// 订单核销
|
// 订单核销
|
||||||
export const orderVerify = (data: object) =>
|
export const orderVerify = (data: object) =>
|
||||||
request("/user/cancelPointOrder", data, "POST");
|
request('/user/cancelPointOrder', data, 'POST');
|
||||||
|
|
||||||
// 活动订单核销
|
// 活动订单核销
|
||||||
export const activeOrderVerify = (data: object) =>
|
export const activeOrderVerify = (data: object) =>
|
||||||
request("/user/cancelOrder", data, "POST");
|
request('/user/cancelOrder', data, 'POST');
|
||||||
|
|
||||||
// 获取订单统计
|
// 获取订单统计
|
||||||
export const orderStatistics = (data: object) =>
|
export const orderStatistics = (data: object) =>
|
||||||
request("/store/order/count", data, "POST");
|
request('/store/order/count', data, 'POST');
|
||||||
|
|
||||||
// 获取商家积分订单列表
|
// 获取商家积分订单列表
|
||||||
export const getJfOrderList = (data: object) =>
|
export const getJfOrderList = (data: object) =>
|
||||||
request("/store/point/order", data, "POST");
|
request('/store/point/order', data, 'POST');
|
||||||
|
|
||||||
// 获取商家活动订单列表
|
// 获取商家活动订单列表
|
||||||
export const getActiveOrderList = (data: object) =>
|
export const getActiveOrderList = (data: object) =>
|
||||||
request("/store/order", data, "POST");
|
request('/store/order', data, 'POST');
|
||||||
|
|
||||||
// 获取积分核销列表
|
// 获取积分核销列表
|
||||||
export const getJfVerifyList = (data: object) =>
|
export const getJfVerifyList = (data: object) =>
|
||||||
request("/point/order/details", data, "POST");
|
request('/point/order/details', data, 'POST');
|
||||||
|
|
||||||
// 获取活动核销列表
|
// 获取活动核销列表
|
||||||
export const getActiveVerifyList = (data: object) =>
|
export const getActiveVerifyList = (data: object) =>
|
||||||
request("/order/details", data, "POST");
|
request('/order/details', data, 'POST');
|
||||||
|
|
||||||
// 增长率统计
|
// 增长率统计
|
||||||
export const growthRate = (data: object) =>
|
export const growthRate = (data: object) =>
|
||||||
request("/store/date/count", data, "POST");
|
request('/store/date/count', data, 'POST');
|
||||||
|
|
||||||
// 获取提现列表
|
// 获取提现列表
|
||||||
export const getWithdrawList = (data: object) =>
|
export const getWithdrawList = (data: object) =>
|
||||||
request("/store/withdraw", data, "POST");
|
request('/store/withdraw', data, 'POST');
|
||||||
|
|
||||||
// 获取提现列表
|
// 获取提现列表
|
||||||
export const addWithdraw = (data: object) =>
|
export const addWithdraw = (data: object) =>
|
||||||
request("/store/withdraw/set", data, "POST");
|
request('/store/withdraw/set', data, 'POST');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 后结api
|
* 后结api
|
||||||
@@ -46,28 +46,36 @@ export const addWithdraw = (data: object) =>
|
|||||||
|
|
||||||
// 创建后结订单
|
// 创建后结订单
|
||||||
export const createAfterOrder = (data: object) =>
|
export const createAfterOrder = (data: object) =>
|
||||||
request("/later/order/place", data, "POST");
|
request('/later/order/place', data, 'POST');
|
||||||
|
|
||||||
// 获取商家后结订单列表
|
// 获取商家后结订单列表
|
||||||
export const getAfterOrderList = (data: object) =>
|
export const getAfterOrderList = (data: object) =>
|
||||||
request("/later/store/user/order", data, "POST");
|
request('/later/store/user/order', data, 'POST');
|
||||||
|
|
||||||
// 获取单个后结订单
|
// 获取单个后结订单
|
||||||
export const getAfterOrder = (data: object) =>
|
export const getAfterOrder = (data: object) =>
|
||||||
request("/later/order/details", data, "POST");
|
request('/later/order/details', data, 'POST');
|
||||||
|
|
||||||
// 确定挂帐
|
// 确定挂帐
|
||||||
export const confirmAfterOrder = (data: object) =>
|
export const confirmAfterOrder = (data: object) =>
|
||||||
request("/later/order/onAccount", data, "POST");
|
request('/later/order/onAccount', data, 'POST');
|
||||||
|
|
||||||
// 修改台号/备注
|
// 修改台号/备注
|
||||||
export const editAfterOrder = (data: object) =>
|
export const editAfterOrder = (data: object) =>
|
||||||
request("/later/order/edit", data, "POST");
|
request('/later/order/edit', data, 'POST');
|
||||||
|
|
||||||
// 生成付款二维码
|
// 生成付款二维码
|
||||||
export const createPayQr = (data: object) =>
|
export const createPayQr = (data: object) =>
|
||||||
request("/later/order/pay", data, "POST");
|
request('/later/order/pay', data, 'POST');
|
||||||
|
|
||||||
// 检查手机号码是否存在
|
// 检查手机号码是否存在
|
||||||
export const checkPhone = (data: object) =>
|
export const checkPhone = (data: object) =>
|
||||||
request("/user/find/phone", data, "POST");
|
request('/user/find/phone', data, 'POST');
|
||||||
|
|
||||||
|
// 获取商家特定用户会员积分2024-3-19
|
||||||
|
export const getUserPoint = (data: object) =>
|
||||||
|
request('/store/get/user/integral', data, 'POST');
|
||||||
|
|
||||||
|
// 取消后结订单
|
||||||
|
export const cancelAfterOrder = (data: object) =>
|
||||||
|
request('/user/later/order/remove', data, 'POST');
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import request from "../utils/request";
|
import request from '../utils/request';
|
||||||
|
|
||||||
// 添加购物车
|
// 添加购物车
|
||||||
export const addCart = (data: object) =>
|
export const addCart = (data: object) =>
|
||||||
request("/goods/cart/add", data, "POST");
|
request('/goods/cart/add', data, 'POST');
|
||||||
|
|
||||||
// 获取购物车
|
// 获取购物车
|
||||||
export const getCart = (data: object) => request("/goods/cart", data, "POST");
|
export const getCart = (data: object) => request('/goods/cart', data, 'POST');
|
||||||
|
|
||||||
// 清空购物车
|
// 清空购物车
|
||||||
export const clearCart = (data: object) =>
|
export const clearCart = (data: object) =>
|
||||||
request("/goods/cart/removeAll", data, "POST");
|
request('/goods/cart/removeAll', data, 'POST');
|
||||||
|
|
||||||
// 获取全部购物车
|
// 获取全部购物车
|
||||||
export const getAllCart = () => request("/goods/all/cart", {}, "POST");
|
export const getAllCart = () => request('/goods/all/cart', {}, 'POST');
|
||||||
|
|||||||
8
src/api/code.ts
Normal file
8
src/api/code.ts
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import request from '../utils/request';
|
||||||
|
|
||||||
|
// 获取二维码信息
|
||||||
|
export const getQrCode = (data: object) => request('/qrcode/get', data, 'POST');
|
||||||
|
|
||||||
|
// 绑定二维码
|
||||||
|
export const bindQrCode = (data: object) =>
|
||||||
|
request('/qrcode/bind', data, 'POST');
|
||||||
4
src/api/game.ts
Normal file
4
src/api/game.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import request from '../utils/request';
|
||||||
|
|
||||||
|
// 获取游戏列表
|
||||||
|
export const getGameList = () => request('/game', {}, 'POST');
|
||||||
@@ -1,67 +1,67 @@
|
|||||||
import request from "@/utils/request";
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 获取商品列表
|
// 获取商品列表
|
||||||
export const getGoodsList = () => request("/point/goods", {}, "POST");
|
export const getGoodsList = () => request('/point/goods', {}, 'POST');
|
||||||
|
|
||||||
// 添加购物车
|
// 添加购物车
|
||||||
export const addCart = (data: object) => request("/user/addCart", data, "POST");
|
export const addCart = (data: object) => request('/user/addCart', data, 'POST');
|
||||||
|
|
||||||
// 获取购物车列表
|
// 获取购物车列表
|
||||||
export const getCartList = () => request("/user/cart", {}, "POST");
|
export const getCartList = () => request('/user/cart', {}, 'POST');
|
||||||
|
|
||||||
// 获取积分商品详情
|
// 获取积分商品详情
|
||||||
export const getGoodsDetail = (data: object) =>
|
export const getGoodsDetail = (data: object) =>
|
||||||
request("/point/details", data, "POST");
|
request('/point/details', data, 'POST');
|
||||||
|
|
||||||
// 积分商品下单
|
// 积分商品下单
|
||||||
export const createOrder = (data: object) =>
|
export const createOrder = (data: object) =>
|
||||||
request("/point/place", data, "POST");
|
request('/point/place', data, 'POST');
|
||||||
|
|
||||||
// 确认付款
|
// 确认付款
|
||||||
export const payJfOrder = (data: object) =>
|
export const payJfOrder = (data: object) =>
|
||||||
request("/point/confirmOrder", data, "POST");
|
request('/point/confirmOrder', data, 'POST');
|
||||||
|
|
||||||
// 获取活动商品
|
// 获取活动商品
|
||||||
export const getActiveGoods = () => request("/goods", {}, "POST");
|
export const getActiveGoods = () => request('/goods', {}, 'POST');
|
||||||
|
|
||||||
// 获取活动商品详情
|
// 获取活动商品详情
|
||||||
export const getActiveGoodsDetail = (data: object) =>
|
export const getActiveGoodsDetail = (data: object) =>
|
||||||
request("/goods/details", data, "POST");
|
request('/goods/details', data, 'POST');
|
||||||
|
|
||||||
// 创建订单
|
// 创建订单
|
||||||
export const createActiveOrder = (data: object) =>
|
export const createActiveOrder = (data: object) =>
|
||||||
request("/order/place", data, "POST");
|
request('/order/place', data, 'POST');
|
||||||
|
|
||||||
// 活动订单列表
|
// 活动订单列表
|
||||||
export const getActiveOrderList = (data: object) =>
|
export const getActiveOrderList = (data: object) =>
|
||||||
request("/user/order", data, "POST");
|
request('/user/order', data, 'POST');
|
||||||
|
|
||||||
// 获取分类列表
|
// 获取分类列表
|
||||||
export const getCategoryList = () => request("/goods/class", {}, "POST");
|
export const getCategoryList = () => request('/goods/class', {}, 'POST');
|
||||||
|
|
||||||
// 活动订单删除
|
// 活动订单删除
|
||||||
export const deleteActiveOrder = (data: object) =>
|
export const deleteActiveOrder = (data: object) =>
|
||||||
request("/user/order/remove", data, "POST");
|
request('/user/order/remove', data, 'POST');
|
||||||
|
|
||||||
// 积分订单删除
|
// 积分订单删除
|
||||||
export const deleteJfOrder = (data: object) =>
|
export const deleteJfOrder = (data: object) =>
|
||||||
request("/user/point/remove", data, "POST");
|
request('/user/point/remove', data, 'POST');
|
||||||
|
|
||||||
// 获取分类商品
|
// 获取分类商品
|
||||||
export const getCategoryGoods = (data: object) =>
|
export const getCategoryGoods = (data: object) =>
|
||||||
request("/class/goods/list", data, "POST");
|
request('/class/goods/list', data, 'POST');
|
||||||
|
|
||||||
// 获取商家列表
|
// 获取商家列表
|
||||||
export const getMerList = (data: object) =>
|
export const getMerList = (data: object) =>
|
||||||
request("/store/list", data, "POST");
|
request('/store/list', data, 'POST');
|
||||||
|
|
||||||
// 获取商家商品分类
|
// 获取商家商品分类
|
||||||
export const getMerCategory = (data: object) =>
|
export const getMerCategory = (data: object) =>
|
||||||
request("/store/classify", data, "POST");
|
request('/store/classify', data, 'POST');
|
||||||
|
|
||||||
// 获取商家商品
|
// 获取商家商品
|
||||||
export const getGoodList = (data: object) =>
|
export const getGoodList = (data: object) =>
|
||||||
request("/store/goods", data, "POST");
|
request('/store/goods', data, 'POST');
|
||||||
|
|
||||||
// // 获取活动商家列表
|
// // 获取活动商家列表
|
||||||
// export const getHotMerList = (data: object) =>
|
// export const getHotMerList = (data: object) =>
|
||||||
@@ -77,4 +77,23 @@ export const getGoodList = (data: object) =>
|
|||||||
|
|
||||||
// 获取全部商家类目
|
// 获取全部商家类目
|
||||||
export const getAllMerCategory = () =>
|
export const getAllMerCategory = () =>
|
||||||
request("/home/all/classify", {}, "POST");
|
request('/home/all/classify', {}, 'POST');
|
||||||
|
|
||||||
|
// 获取活动订单详情
|
||||||
|
export const getActiveOrderDetail = (data: object) =>
|
||||||
|
request('/user/order/details', data, 'POST');
|
||||||
|
|
||||||
|
// 校验交易密码
|
||||||
|
export const checkTradePwd = (data: object) =>
|
||||||
|
request('/user/check/payPassword', data, 'POST');
|
||||||
|
|
||||||
|
// 获取活动商品或者活动积分商品
|
||||||
|
export const getHdOrJfGoods = (data: object) =>
|
||||||
|
request('/activity/goods', data, 'POST');
|
||||||
|
|
||||||
|
// 获取支付列表
|
||||||
|
export const getPayList = (data: object) => request('/payType', data, 'POST');
|
||||||
|
|
||||||
|
// 获取商家详情
|
||||||
|
export const getMerDetail = (data: object) =>
|
||||||
|
request('/store/details', data, 'POST');
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import request from "../utils/request";
|
import request from '../utils/request';
|
||||||
|
|
||||||
// 获取商户分类
|
// 获取商户分类
|
||||||
export const getHomeList = () => request("/home/classify", {}, "POST");
|
export const getHomeList = () => request('/home/classify', {}, 'POST');
|
||||||
|
|
||||||
// 获取商户子列表
|
// 获取商户子列表
|
||||||
export const getHomeSubList = () => request("/home/all/classify", {}, "POST");
|
export const getHomeSubList = () => request('/home/all/classify', {}, 'POST');
|
||||||
|
|
||||||
|
// 查找商家
|
||||||
|
export const getStoreList = data => request('/find/store', data, 'POST');
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import request from "@/utils/request";
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 订单支付
|
// 订单支付
|
||||||
export const payOrder = (data: object) =>
|
export const payOrder = (data: object) =>
|
||||||
request("/order/confirmOrder", data, "POST");
|
request('/order/confirmOrder', data, 'POST');
|
||||||
|
|
||||||
// 获取订单统计
|
// 获取订单统计
|
||||||
export const getOrderStatistics = (data: object) =>
|
export const getOrderStatistics = (data: object) =>
|
||||||
request("/user/order/count", data, "POST");
|
request('/user/order/count', data, 'POST');
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import request from "@/utils/request";
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 商品列表
|
// 商品列表
|
||||||
export const productList = (data: object) =>
|
export const productList = (data: object) =>
|
||||||
request("/store/goods", data, "POST");
|
request('/store/goods', data, 'POST');
|
||||||
|
|
||||||
// 商品添加
|
// 商品添加
|
||||||
export const addGood = (data: object) =>
|
export const addGood = (data: object) =>
|
||||||
request("/store/goods/edit", data, "POST");
|
request('/store/goods/edit', data, 'POST');
|
||||||
|
|||||||
@@ -1,81 +1,89 @@
|
|||||||
import request from "@/utils/request";
|
import request from '@/utils/request';
|
||||||
|
|
||||||
// 获取用户协议
|
// 获取用户协议
|
||||||
export const getAgreement = () => request("/user/agreement", {}, "POST");
|
export const getAgreement = () => request('/user/agreement', {}, 'POST');
|
||||||
|
|
||||||
// 登录
|
// 登录
|
||||||
export const login = (data: object) => request("/login", data, "POST");
|
export const login = (data: object) => request('/login', data, 'POST');
|
||||||
export const phoneLogin = (data: object) =>
|
export const phoneLogin = (data: object) =>
|
||||||
request("/phone/login", data, "POST");
|
request('/phone/login', data, 'POST');
|
||||||
|
|
||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
// export const getUserInfo = () => request("/user/detail", {}, "GET");
|
// export const getUserInfo = () => request("/user/detail", {}, "GET");
|
||||||
|
|
||||||
// 获取短信验证码
|
// 获取短信验证码
|
||||||
export const getVerifyCode = (data: object) =>
|
export const getVerifyCode = (data: object) =>
|
||||||
request("/getSmsCode", data, "POST");
|
request('/getSmsCode', data, 'POST');
|
||||||
|
|
||||||
// 商家入驻申请
|
// 商家入驻申请
|
||||||
export const applyMer = (data: object) =>
|
export const applyMer = (data: object) =>
|
||||||
request("/store/settle", data, "POST");
|
request('/store/settle', data, 'POST');
|
||||||
|
|
||||||
// 获取商家类型列表
|
// 获取商家类型列表
|
||||||
export const getMerTypeList = () => request("/store/getOther", {}, "POST");
|
export const getMerTypeList = () => request('/store/getOther', {}, 'POST');
|
||||||
|
|
||||||
// 获取个人信息
|
// 获取个人信息
|
||||||
export const getPersonalInfo = () => request("/user/info", {}, "POST");
|
export const getPersonalInfo = () => request('/user/info', {}, 'POST');
|
||||||
|
|
||||||
// 获取轮播图
|
// 获取轮播图
|
||||||
export const getBanner = () => request("/rotation", {}, "POST");
|
export const getBanner = () => request('/rotation', {}, 'POST');
|
||||||
|
|
||||||
// 获取积分订单列表
|
// 获取积分订单列表
|
||||||
export const getIntegralOrderList = (data: object) =>
|
export const getIntegralOrderList = (data: object) =>
|
||||||
request("/user/pointOrder", data, "POST");
|
request('/user/pointOrder', data, 'POST');
|
||||||
|
|
||||||
// 修改个人信息
|
// 修改个人信息
|
||||||
export const editPersonalInfo = (data: object) =>
|
export const editPersonalInfo = (data: object) =>
|
||||||
request("/user/editInfo", data, "POST");
|
request('/user/editInfo', data, 'POST');
|
||||||
|
|
||||||
// 积分明细
|
// 积分明细
|
||||||
export const getIntegralDetail = (data: object) =>
|
export const getIntegralDetail = (data: object) =>
|
||||||
request("/user/pulseRecord", data, "POST");
|
request('/user/pulseRecord', data, 'POST');
|
||||||
|
|
||||||
// 豆子明细
|
// 豆子明细
|
||||||
export const getBeanDetail = (data: object) =>
|
export const getBeanDetail = (data: object) =>
|
||||||
request("/user/pointRecord", data, "POST");
|
request('/user/pointRecord', data, 'POST');
|
||||||
|
|
||||||
// 授权手机号
|
// 授权手机号
|
||||||
export const getPhone = (data: object) =>
|
export const getPhone = (data: object) =>
|
||||||
request("/user/getPhone", data, "POST");
|
request('/user/getPhone', data, 'POST');
|
||||||
|
|
||||||
// 获取推广积分明细
|
// 获取推广积分明细
|
||||||
export const getTGIntegralDetail = (data: object) =>
|
export const getTGIntegralDetail = (data: object) =>
|
||||||
request("/user/referee/point", data, "POST");
|
request('/user/referee/point', data, 'POST');
|
||||||
|
|
||||||
// 获取推广用户列表
|
// 获取推广用户列表
|
||||||
export const getTGUserList = (data: object) =>
|
export const getTGUserList = (data: object) =>
|
||||||
request("/user/referee/list", data, "POST");
|
request('/user/referee/list', data, 'POST');
|
||||||
|
|
||||||
// 绑定上级
|
// 绑定上级
|
||||||
export const bindParent = (data: object) =>
|
export const bindParent = (data: object) =>
|
||||||
request("/user/bindCode", data, "POST");
|
request('/user/bindCode', data, 'POST');
|
||||||
|
|
||||||
// 获取推广码
|
// 获取推广码
|
||||||
export const getRefereeCode = () => request("/user/promotion", {}, "POST");
|
export const getRefereeCode = () => request('/user/promotion', {}, 'POST');
|
||||||
|
|
||||||
// 取消订单返回积分
|
// 取消订单返回积分
|
||||||
export const qxOrder = (data: object) =>
|
export const qxOrder = (data: object) =>
|
||||||
request("/user/point/off", data, "POST");
|
request('/user/point/off', data, 'POST');
|
||||||
|
|
||||||
// 用户签到
|
// 用户签到
|
||||||
export const userSign = () => request("/sign/user", {}, "POST");
|
export const userSign = () => request('/sign/user', {}, 'POST');
|
||||||
|
|
||||||
// 获取签到记录
|
// 获取签到记录
|
||||||
export const getSignRecord = () => request("/sign/pulse/count", {}, "POST");
|
export const getSignRecord = () => request('/sign/pulse/count', {}, 'POST');
|
||||||
|
|
||||||
// 获取赠送总记录
|
// 获取赠送总记录
|
||||||
export const getGiftRecord = (data: object) =>
|
export const getGiftRecord = (data: object) =>
|
||||||
request("/user/giftPulseRecord", data, "POST");
|
request('/user/giftPulseRecord', data, 'POST');
|
||||||
|
|
||||||
|
// 修改交易密码
|
||||||
|
export const editTradePwd = (data: object) =>
|
||||||
|
request('/user/edit/payPassword', data, 'POST');
|
||||||
|
|
||||||
|
// 检查是否有交易密码
|
||||||
|
export const isCheckTradePwd = () =>
|
||||||
|
request('/user/find/payPassword', {}, 'POST');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户后结订单
|
* 用户后结订单
|
||||||
@@ -83,8 +91,8 @@ export const getGiftRecord = (data: object) =>
|
|||||||
|
|
||||||
// 获取用户后结订单列表
|
// 获取用户后结订单列表
|
||||||
export const getUserAfterOrderList = (data: object) =>
|
export const getUserAfterOrderList = (data: object) =>
|
||||||
request("/later/user/order", data, "POST");
|
request('/later/user/order', data, 'POST');
|
||||||
|
|
||||||
// 获取用户后结订单详情
|
// 获取用户后结订单详情
|
||||||
export const getUserAfterOrderDetail = (data: object) =>
|
export const getUserAfterOrderDetail = (data: object) =>
|
||||||
request("/later/order/details", data, "POST");
|
request('/later/order/details', data, 'POST');
|
||||||
|
|||||||
@@ -1,124 +1,129 @@
|
|||||||
export default defineAppConfig({
|
export default defineAppConfig({
|
||||||
pages: [
|
pages: [
|
||||||
"pages/index/index",
|
'pages/index/index',
|
||||||
"pages/category/index",
|
'pages/game/gamehome/index',
|
||||||
"pages/cart/index",
|
'pages/cart/index',
|
||||||
"pages/user/index",
|
'pages/user/index',
|
||||||
"pages/allClassList/index",
|
'pages/allClassList/index',
|
||||||
|
'pages/game/gamedetail/index',
|
||||||
|
'pages/game/view/index',
|
||||||
|
'pages/fastBuy/index',
|
||||||
],
|
],
|
||||||
subPackages: [
|
subPackages: [
|
||||||
{
|
{
|
||||||
root: "pages/users",
|
root: 'pages/users',
|
||||||
pages: [
|
pages: [
|
||||||
"user_agreement/index",
|
'user_agreement/index',
|
||||||
"order_list/index",
|
'order_list/index',
|
||||||
"setting/index",
|
'setting/index',
|
||||||
"user_setting/index",
|
'user_setting/index',
|
||||||
"settled_mer/index",
|
'settled_mer/index',
|
||||||
"order_list_detail/index",
|
'order_list_detail/index',
|
||||||
"account/index",
|
'account/index',
|
||||||
"distribution/index",
|
'distribution/index',
|
||||||
"distribution/integral/index",
|
'distribution/integral/index',
|
||||||
"distribution/userlist/index",
|
'distribution/userlist/index',
|
||||||
"login/index",
|
'login/index',
|
||||||
"bindPhone/index",
|
'bindPhone/index',
|
||||||
"pending_order/index",
|
'pending_order/index',
|
||||||
"pending_order/pending_order_detail/index"
|
'pending_order/pending_order_detail/index',
|
||||||
|
'pwd/index',
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/goods",
|
root: 'pages/goods',
|
||||||
pages: ["goods_detail/index", "order_create/index", "order_status/index"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
root: "pages/admin",
|
|
||||||
pages: [
|
pages: [
|
||||||
"verify/index",
|
'goods_detail/index',
|
||||||
"order_manage/index",
|
'order_create/index',
|
||||||
"order_manage/list/index",
|
'order_status/index',
|
||||||
"order_manage/detail/index",
|
'pay/index',
|
||||||
"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",
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/product",
|
root: 'pages/admin',
|
||||||
pages: ["list/index", "addGoods/index"],
|
pages: [
|
||||||
|
'verify/index',
|
||||||
|
'order_manage/index',
|
||||||
|
'order_manage/list/index',
|
||||||
|
'order_manage/detail/index',
|
||||||
|
'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',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/game",
|
root: 'pages/product',
|
||||||
pages: ["gamehome/index", "gamedetail/index", "gameview/index"],
|
pages: ['list/index', 'addGoods/index'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/hotGoods",
|
root: 'pages/hotGoods',
|
||||||
pages: ["index/index", "hot_list/index"],
|
pages: ['index/index', 'hot_list/index'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/mer",
|
root: 'pages/mer',
|
||||||
pages: ["mer_detail/index"],
|
pages: ['mer_detail/index'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/marketing",
|
root: 'pages/marketing',
|
||||||
pages: ["sign/index"],
|
pages: ['sign/index', 'yq/index', 'scratch/index'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/search",
|
root: 'pages/search',
|
||||||
pages: ["index"],
|
pages: ['index'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
backgroundTextStyle: "light",
|
backgroundTextStyle: 'light',
|
||||||
navigationBarBackgroundColor: "#fff",
|
navigationBarBackgroundColor: '#fff',
|
||||||
navigationBarTitleText: "WeChat",
|
navigationBarTitleText: 'WeChat',
|
||||||
navigationBarTextStyle: "black",
|
navigationBarTextStyle: 'black',
|
||||||
},
|
},
|
||||||
tabBar: {
|
tabBar: {
|
||||||
color: "#666666",
|
color: '#666666',
|
||||||
selectedColor: "#ff0000",
|
selectedColor: '#ff0000',
|
||||||
backgroundColor: "#ffffff",
|
backgroundColor: '#ffffff',
|
||||||
borderStyle: "white",
|
borderStyle: 'white',
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
pagePath: "pages/index/index",
|
pagePath: 'pages/index/index',
|
||||||
iconPath: "static/tabbar/1-001.png",
|
iconPath: 'static/tabbar/1-0.png',
|
||||||
selectedIconPath: "static/tabbar/1-002.png",
|
selectedIconPath: 'static/tabbar/1-1.png',
|
||||||
text: "首页",
|
text: '首页',
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// pagePath: "pages/category/index",
|
// pagePath: 'pages/game/gamehome/index',
|
||||||
// iconPath: "static/tabbar/2-001.png",
|
// iconPath: 'static/tabbar/2-0.png',
|
||||||
// selectedIconPath: "static/tabbar/2-002.png",
|
// selectedIconPath: 'static/tabbar/2-1.png',
|
||||||
// text: "分类",
|
// text: '游戏',
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
pagePath: "pages/cart/index",
|
pagePath: 'pages/cart/index',
|
||||||
iconPath: "static/tabbar/3-001.png",
|
iconPath: 'static/tabbar/3-0.png',
|
||||||
selectedIconPath: "static/tabbar/3-002.png",
|
selectedIconPath: 'static/tabbar/3-1.png',
|
||||||
text: "购物车",
|
text: '购物车',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: "pages/user/index",
|
pagePath: 'pages/user/index',
|
||||||
iconPath: "static/tabbar/4-001.png",
|
iconPath: 'static/tabbar/4-0.png',
|
||||||
selectedIconPath: "static/tabbar/4-002.png",
|
selectedIconPath: 'static/tabbar/4-1.png',
|
||||||
text: "我的",
|
text: '我的',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
permission: {
|
permission: {
|
||||||
"scope.userLocation": {
|
'scope.userLocation': {
|
||||||
desc: "你的位置信息将用于小程序位置接口的效果展示",
|
desc: '你的位置信息将用于小程序位置接口的效果展示',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
requiredBackgroundModes: ["audio", "location"],
|
requiredBackgroundModes: ['audio', 'location'],
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
requiredPrivateInfos: ["getLocation"],
|
requiredPrivateInfos: ['getLocation'],
|
||||||
lazyCodeLoading: "requiredComponents",
|
lazyCodeLoading: 'requiredComponents',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
@import "./static/iconfont/iconfont.css";
|
@import './static/iconfont/iconfont.css';
|
||||||
|
@import 'tailwindcss/base';
|
||||||
|
@import 'tailwindcss/components';
|
||||||
|
@import 'tailwindcss/utilities';
|
||||||
|
|
||||||
page {
|
page {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
font-size: 30rpx;
|
|
||||||
// IOS安全区域
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
padding-bottom: constant(safe-area-inset-bottom);
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
}
|
}
|
||||||
|
|||||||
31
src/app.ts
31
src/app.ts
@@ -1,15 +1,10 @@
|
|||||||
import { createApp } from "vue";
|
import { createApp } from 'vue';
|
||||||
import "./app.scss";
|
import Taro from '@tarojs/taro';
|
||||||
import Taro from "@tarojs/taro";
|
import './app.scss';
|
||||||
// import * as Sentry from "sentry-miniapp";
|
|
||||||
|
|
||||||
// 小程序场景值
|
// 小程序场景值
|
||||||
const scenes = [1007, 1008, 1011, 1012, 1013, 1047, 1048, 1049];
|
const scenes = [1007, 1008, 1011, 1012, 1013, 1047, 1048, 1049];
|
||||||
|
|
||||||
// Sentry.init({
|
|
||||||
// dsn: "https://47703e01ba4344b8b252c15e8fd980fd@sentry.io/1528228",
|
|
||||||
// });
|
|
||||||
|
|
||||||
const App = createApp({
|
const App = createApp({
|
||||||
onLaunch(options: {
|
onLaunch(options: {
|
||||||
path: string;
|
path: string;
|
||||||
@@ -19,20 +14,20 @@ const App = createApp({
|
|||||||
referrerInfo: object | any;
|
referrerInfo: object | any;
|
||||||
}) {
|
}) {
|
||||||
// 检测更新
|
// 检测更新
|
||||||
if (Taro.canIUse("getUpdateManager") && options.scene !== 1154) {
|
if (Taro.canIUse('getUpdateManager') && options.scene !== 1154) {
|
||||||
const updateManager = Taro.getUpdateManager();
|
const updateManager = Taro.getUpdateManager();
|
||||||
updateManager.onCheckForUpdate(function (res) {
|
updateManager.onCheckForUpdate(function (res) {
|
||||||
if (res.hasUpdate) {
|
if (res.hasUpdate) {
|
||||||
updateManager.onUpdateFailed(function () {
|
updateManager.onUpdateFailed(function () {
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "新版本下载失败",
|
title: '新版本下载失败',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
updateManager.onUpdateReady(function () {
|
updateManager.onUpdateReady(function () {
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
title: "更新提示",
|
title: '更新提示',
|
||||||
content: "新版本已经下载好,是否重启当前应用?",
|
content: '新版本已经下载好,是否重启当前应用?',
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
updateManager.applyUpdate();
|
updateManager.applyUpdate();
|
||||||
@@ -42,8 +37,8 @@ const App = createApp({
|
|||||||
});
|
});
|
||||||
updateManager.onUpdateFailed(function () {
|
updateManager.onUpdateFailed(function () {
|
||||||
Taro.showModal({
|
Taro.showModal({
|
||||||
title: "发现新版本",
|
title: '发现新版本',
|
||||||
content: "请删除当前小程序,重启搜索打开...",
|
content: '请删除当前小程序,重启搜索打开...',
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -55,10 +50,10 @@ const App = createApp({
|
|||||||
if (scenes.includes(options.scene)) {
|
if (scenes.includes(options.scene)) {
|
||||||
if (options.query.scene) {
|
if (options.query.scene) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "已检测到推荐人",
|
title: '已检测到推荐人',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
Taro.setStorageSync("bind_id", options.query.scene);
|
Taro.setStorageSync('bind_id', options.query.scene);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// import { computed, ref } from "vue";
|
// import { computed, ref } from "vue";
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { login } from "@/api/user";
|
import { login } from '@/api/user';
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
@@ -25,20 +25,20 @@ defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["update:visible", "ok"]);
|
const emit = defineEmits(['update:visible', 'ok']);
|
||||||
|
|
||||||
const onCancel = () => {
|
const onCancel = () => {
|
||||||
emit("update:visible", false);
|
emit('update:visible', false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOk = () => {
|
const onOk = () => {
|
||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: "正在授权中",
|
title: '正在授权中',
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
Taro.getUserProfile({
|
Taro.getUserProfile({
|
||||||
desc: "完善用户资料",
|
desc: '完善用户资料',
|
||||||
success: async (user) => {
|
success: async user => {
|
||||||
Taro.login({
|
Taro.login({
|
||||||
success: async ({ code }) => {
|
success: async ({ code }) => {
|
||||||
try {
|
try {
|
||||||
@@ -47,16 +47,16 @@ const onOk = () => {
|
|||||||
nickName: user.userInfo.nickName,
|
nickName: user.userInfo.nickName,
|
||||||
avatarUrl: user.userInfo.avatarUrl,
|
avatarUrl: user.userInfo.avatarUrl,
|
||||||
});
|
});
|
||||||
Taro.setStorageSync("token", data.token);
|
Taro.setStorageSync('token', data.token);
|
||||||
emit("ok", false);
|
emit('ok', false);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: error.message,
|
title: error.message,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
@@ -64,7 +64,7 @@ const onOk = () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
},
|
},
|
||||||
complete: () => {
|
complete: () => {
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<Home class="iconfont" @click="goHome" />
|
<Home class="iconfont" @click="goHome" />
|
||||||
</view>
|
</view>
|
||||||
<text style="width: 2000px;text-align: center;">{{ props.title }}</text>
|
<text style="width: 2000px; text-align: center">{{ props.title }}</text>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { computed } from "vue";
|
import { computed } from 'vue';
|
||||||
import { Home, Left } from "@nutui/icons-vue-taro";
|
import { Home, Left } from '@nutui/icons-vue-taro';
|
||||||
|
|
||||||
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight as number;
|
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight as number;
|
||||||
const BarHeight = computed(() => statusBarHeight - 7);
|
const BarHeight = computed(() => statusBarHeight - 7);
|
||||||
@@ -20,7 +20,7 @@ const BarHeight = computed(() => statusBarHeight - 7);
|
|||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: '',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ const returns = () => {
|
|||||||
|
|
||||||
const goHome = () => {
|
const goHome = () => {
|
||||||
Taro.switchTab({
|
Taro.switchTab({
|
||||||
url: "/pages/index/index",
|
url: '/pages/index/index',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { addCart, getCart, clearCart } from "@/api/cart";
|
import { addCart, getCart, clearCart } from '@/api/cart';
|
||||||
import { Del2 } from "@nutui/icons-vue-taro";
|
import { Plus, Minus } from '@nutui/icons-vue-taro';
|
||||||
import { createActiveOrder } from "@/api/goods";
|
import { createActiveOrder } from '@/api/goods';
|
||||||
import { createAfterOrder } from "@/api/admin";
|
import { createAfterOrder, getUserPoint } from '@/api/admin';
|
||||||
import Pay from "@/components/Pay.vue";
|
import Pay from '@/components/Pay.vue';
|
||||||
|
|
||||||
interface CardList {
|
interface CardList {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -13,8 +13,10 @@ interface CardList {
|
|||||||
bid: string;
|
bid: string;
|
||||||
gid: string;
|
gid: string;
|
||||||
number: string;
|
number: string;
|
||||||
|
discount_price: string;
|
||||||
price: number;
|
price: number;
|
||||||
exchange: number;
|
exchange: number;
|
||||||
|
discount_integral: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
@@ -30,7 +32,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["updateCart"]);
|
const emit = defineEmits(['updateCart']);
|
||||||
|
|
||||||
const openModal = async () => {
|
const openModal = async () => {
|
||||||
await get_cart_list();
|
await get_cart_list();
|
||||||
@@ -38,7 +40,11 @@ const openModal = async () => {
|
|||||||
show.value = !show.value;
|
show.value = !show.value;
|
||||||
};
|
};
|
||||||
|
|
||||||
const add_cart = async (item: CardList, num: number = 1) => {
|
const add_cart = async (
|
||||||
|
item: CardList,
|
||||||
|
num: number = 1,
|
||||||
|
bid: string = props.merInfo.bid,
|
||||||
|
) => {
|
||||||
try {
|
try {
|
||||||
const res = await addCart({
|
const res = await addCart({
|
||||||
Bid: item.bid,
|
Bid: item.bid,
|
||||||
@@ -47,13 +53,13 @@ const add_cart = async (item: CardList, num: number = 1) => {
|
|||||||
});
|
});
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
await get_cart_list();
|
await get_cart_list(bid);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: e.msg,
|
title: e.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -72,31 +78,35 @@ const card_list = ref<CardList[]>([]);
|
|||||||
const cartInfo = ref({
|
const cartInfo = ref({
|
||||||
count: 0,
|
count: 0,
|
||||||
price: 0,
|
price: 0,
|
||||||
|
discount_price: 0,
|
||||||
exchange: 0,
|
exchange: 0,
|
||||||
|
discount_integral: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
const get_cart_list = async () => {
|
const get_cart_list = async (bid: string = props.merInfo.bid) => {
|
||||||
try {
|
try {
|
||||||
const res = await getCart({
|
const res = await getCart({
|
||||||
Bid: props.merInfo.bid,
|
Bid: bid,
|
||||||
});
|
});
|
||||||
|
|
||||||
card_list.value = res.data.data || [];
|
card_list.value = res.data.data || [];
|
||||||
cartInfo.value = {
|
cartInfo.value = {
|
||||||
count: 0,
|
count: 0,
|
||||||
price: 0,
|
price: 0,
|
||||||
|
discount_price: 0,
|
||||||
exchange: 0,
|
exchange: 0,
|
||||||
|
discount_integral: 0,
|
||||||
};
|
};
|
||||||
card_list.value.forEach((item: CardList) => {
|
card_list.value.forEach((item: CardList) => {
|
||||||
cartInfo.value.count += Number(item.number);
|
cartInfo.value.count += Number(item.number);
|
||||||
cartInfo.value.price += Number(item.price);
|
cartInfo.value.discount_price += Number(item.price);
|
||||||
cartInfo.value.exchange += Number(item.exchange);
|
cartInfo.value.exchange += Number(item.exchange);
|
||||||
|
cartInfo.value.discount_integral += Number(item.discount_integral);
|
||||||
});
|
});
|
||||||
emit("updateCart", res.data.data || []);
|
emit('updateCart', res.data.data || []);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: e.msg,
|
title: e.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -110,7 +120,7 @@ const clear_cart = async () => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: e.msg,
|
title: e.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
show.value = false;
|
show.value = false;
|
||||||
@@ -124,7 +134,7 @@ const closePay = (val: boolean) => {
|
|||||||
isShowPay.value = val;
|
isShowPay.value = val;
|
||||||
orderData.value = [];
|
orderData.value = [];
|
||||||
Taro.redirectTo({
|
Taro.redirectTo({
|
||||||
url: "/pages/users/order_list/index?type=0",
|
url: '/pages/users/order_list/index?type=0',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -142,22 +152,39 @@ const create_order = async () => {
|
|||||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
|
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
const user_info = Taro.getStorageSync('userInfo');
|
||||||
|
const data = await getUserPoint({
|
||||||
|
phone: user_info.data.phone,
|
||||||
|
bid: props.merInfo.bid,
|
||||||
|
});
|
||||||
res = await createActiveOrder({
|
res = await createActiveOrder({
|
||||||
Bid: [props.merInfo.bid],
|
Bid: [props.merInfo.bid],
|
||||||
|
custID: data.data.store_user_id,
|
||||||
});
|
});
|
||||||
if (res.data.oid) {
|
if (res.data.oid) {
|
||||||
orderData.value = res.oid;
|
orderData.value = {
|
||||||
isShowPay.value = true;
|
jh_info: data.data,
|
||||||
|
oid: res.data.oid,
|
||||||
|
};
|
||||||
|
// isShowPay.value = true;
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${props.merInfo.bid}&OrderType=1`,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
if (e.msg === '请先设置交易密码') {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/users/pwd/index',
|
||||||
|
});
|
||||||
|
}
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: e.msg,
|
title: e.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -171,32 +198,43 @@ defineExpose({
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="cart" @click.stop="openModal">
|
<view class="cart" @click.stop="openModal">
|
||||||
<view class="container">
|
<view class="container flex items-center">
|
||||||
<view>购物车数量: {{ cartInfo.count }}</view>
|
<!-- <view>购物车数量: {{ cartInfo.count }}</view> -->
|
||||||
<view v-if="cartInfo.count > 0">
|
<view class="cardImg">
|
||||||
<text>总金额: {{ cartInfo.price.toFixed(2) }}元</text
|
<image
|
||||||
>
|
src="https://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png">
|
||||||
<text v-if="!IsPendingOrder">,总积分: {{ cartInfo.exchange.toFixed(2) }}</text>
|
</image>
|
||||||
|
<view class="count-text" v-if="cartInfo.count > 0">
|
||||||
|
<text>{{ cartInfo.count }}</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="ml-1 text-[28px]">
|
||||||
|
<text>总金额: {{ cartInfo.discount_price.toFixed(2) }}元</text>
|
||||||
|
<text v-if="!IsPendingOrder"
|
||||||
|
>,积分抵扣: {{ cartInfo.discount_integral.toFixed(2) }}
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
|
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
|
||||||
>立即下单</view
|
>去结算
|
||||||
>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 购物车弹窗 -->
|
<!-- 购物车弹窗 -->
|
||||||
<nut-popup
|
<nut-popup
|
||||||
:style="{ padding: '20rpx' }"
|
:style="{ padding: '15px' }"
|
||||||
round
|
round
|
||||||
position="bottom"
|
position="bottom"
|
||||||
z-index="1"
|
z-index="1"
|
||||||
:catch-move="true"
|
:catch-move="true"
|
||||||
:safe-area-inset-bottom="true"
|
:safe-area-inset-bottom="true"
|
||||||
v-model:visible="show"
|
v-model:visible="show">
|
||||||
>
|
|
||||||
<view class="list-header">
|
<view class="list-header">
|
||||||
<view class="left" @click.stop="clear_cart">
|
<view class="left" @click.stop="clear_cart">
|
||||||
<Del2 color="#666666" />
|
<!-- <Del2 color="#666666" /> -->
|
||||||
<text style="color: #666666">清空购物车</text>
|
<image
|
||||||
|
class="w-[20px] h-[20px]"
|
||||||
|
src="https://p0.meituan.net/csc/db4d11fd744b69435c6ffdc6bfc868c5684.png" />
|
||||||
|
<text class="text-[20px]" style="color: #666666">清空购物车</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view :scroll-y="true" class="cart-list">
|
<scroll-view :scroll-y="true" class="cart-list">
|
||||||
@@ -205,9 +243,12 @@ defineExpose({
|
|||||||
<image :src="item.cover" />
|
<image :src="item.cover" />
|
||||||
<view class="center">
|
<view class="center">
|
||||||
<view class="name">{{ item.name }}</view>
|
<view class="name">{{ item.name }}</view>
|
||||||
<view class="price">
|
|
||||||
|
<view class="price flex">
|
||||||
<view>现金:{{ item.price }}</view>
|
<view>现金:{{ item.price }}</view>
|
||||||
<view>积分:{{ item.exchange }}</view>
|
<view v-if="item.discount_integral > 0" class="ml-2"
|
||||||
|
>积分:{{ item.discount_integral }}</view
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -216,57 +257,93 @@ defineExpose({
|
|||||||
readonly
|
readonly
|
||||||
:min="-1"
|
:min="-1"
|
||||||
@add="() => onAdd(item)"
|
@add="() => onAdd(item)"
|
||||||
@reduce="() => onReduce(item)"
|
@reduce="() => onReduce(item)">
|
||||||
/>
|
<template #left-icon>
|
||||||
|
<view class="btn" @click.stop="onReduce(item)">
|
||||||
|
<Minus />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
<template #right-icon>
|
||||||
|
<view class="btn" @click.stop="onAdd(item)">
|
||||||
|
<Plus />
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</nut-input-number>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
<view style="height: 140rpx"></view>
|
<view style="height: 140px"></view>
|
||||||
</nut-popup>
|
</nut-popup>
|
||||||
<!-- 支付 -->
|
<!-- 支付 -->
|
||||||
<Pay
|
<Pay
|
||||||
:is-show-pay="isShowPay"
|
:is-show-pay="isShowPay"
|
||||||
v-model:jfInfo="orderData"
|
v-model:jfInfo="orderData"
|
||||||
@closePay="closePay"
|
@closePay="closePay"
|
||||||
@successPay="closePay"
|
@successPay="closePay" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
$h-border-radius: 50rpx;
|
$h-border-radius: 50px;
|
||||||
|
|
||||||
.cart {
|
.cart {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 50rpx;
|
bottom: 50px;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
width: 95%;
|
width: 95%;
|
||||||
background-color: red;
|
background-color: #262323;
|
||||||
border-radius: $h-border-radius;
|
border-radius: $h-border-radius;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
height: 100rpx;
|
height: 100px;
|
||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
margin-left: 30rpx;
|
margin-left: 30px;
|
||||||
|
|
||||||
|
.cardImg {
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.count-text {
|
||||||
|
position: absolute;
|
||||||
|
top: -10px;
|
||||||
|
right: -10px;
|
||||||
|
background-image: url('https://p0.meituan.net/csc/80b0e11d4270d09324df0b802d4c479b986.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
// padding: 0 8px;
|
||||||
|
width: 35px;
|
||||||
|
height: 35px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 35px;
|
||||||
|
|
||||||
|
text {
|
||||||
|
margin: auto;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.payBtn {
|
.payBtn {
|
||||||
width: 180rpx;
|
width: 200px;
|
||||||
height: 100rpx;
|
height: 100px;
|
||||||
line-height: 100rpx;
|
line-height: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #000;
|
background-color: #f83d3d;
|
||||||
border-radius: 0 $h-border-radius $h-border-radius 0;
|
border-radius: 0 $h-border-radius $h-border-radius 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.list-header {
|
.list-header {
|
||||||
margin: 15rpx 0;
|
margin: 15px 0;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -275,37 +352,47 @@ $h-border-radius: 50rpx;
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cart-list {
|
.cart-list {
|
||||||
height: 290rpx;
|
height: 290px;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
margin-bottom: 10rpx;
|
margin-bottom: 10px;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 130rpx;
|
width: 130px;
|
||||||
height: 130rpx;
|
height: 130px;
|
||||||
border-radius: 10rpx;
|
border-radius: 15px;
|
||||||
margin-right: 10rpx;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
height: 100%;
|
height: 130px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
color: red;
|
color: red;
|
||||||
margin-top: 20rpx;
|
// margin-bottom: 0px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
background-color: #ff0000;
|
||||||
|
color: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 65px;
|
||||||
|
width: 45px;
|
||||||
|
height: 45px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,60 +1,125 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="goodBox">
|
<view class="list-box">
|
||||||
<view
|
<view class="list">
|
||||||
class="good"
|
<swiper
|
||||||
v-for="item in merdata"
|
v-if="bannerList.length !== 0"
|
||||||
:key="item.ID"
|
class="item"
|
||||||
@click.stop="toMerDetails(item)"
|
:style="{
|
||||||
>
|
height: '250px',
|
||||||
<image :src="item.head_photo" />
|
}"
|
||||||
<view class="good-text-box">
|
indicator-color="#EDEDED"
|
||||||
<text class="good-text">{{ item.name }}</text>
|
indicator-active-color="#F83D3D"
|
||||||
<text style="color: #999"
|
:circular="true"
|
||||||
>距离我{{
|
:indicator-dots="true"
|
||||||
calculateDistance(
|
:autoplay="true">
|
||||||
userLocalNum.t,
|
<swiper-item v-for="(item, index) in bannerList" :key="index">
|
||||||
userLocalNum.l,
|
<image
|
||||||
Number(item.lat),
|
:style="{
|
||||||
Number(item.lon)
|
width: '100%',
|
||||||
)
|
height: '100%',
|
||||||
}}
|
}"
|
||||||
</text>
|
:src="item.url"
|
||||||
|
@tap="toPage(item.jump)" />
|
||||||
|
</swiper-item>
|
||||||
|
</swiper>
|
||||||
|
<view
|
||||||
|
class="item"
|
||||||
|
v-for="(item, index) in list1"
|
||||||
|
:key="index"
|
||||||
|
@click="toMerDetails(item)">
|
||||||
|
<image
|
||||||
|
:style="{
|
||||||
|
height: '200px',
|
||||||
|
}"
|
||||||
|
:src="item.head_photo" />
|
||||||
|
<view class="text">
|
||||||
|
<view class="title">{{ item.name }}</view>
|
||||||
|
<view class="list_local">
|
||||||
|
<view class="icon iconfont icon-dizhi"></view>
|
||||||
|
<view class="desc"
|
||||||
|
>距离我{{
|
||||||
|
calculateDistance(
|
||||||
|
userLocalNum.t,
|
||||||
|
userLocalNum.l,
|
||||||
|
Number(item.lat),
|
||||||
|
Number(item.lon),
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="list">
|
||||||
|
<view
|
||||||
|
class="item"
|
||||||
|
v-for="(item, index) in list2"
|
||||||
|
:key="index"
|
||||||
|
@click.stop="toMerDetails(item)">
|
||||||
|
<image
|
||||||
|
:style="{
|
||||||
|
height: '200px',
|
||||||
|
}"
|
||||||
|
:src="item.head_photo" />
|
||||||
|
<view class="text">
|
||||||
|
<view class="title">{{ item.name }}</view>
|
||||||
|
<view class="list_local">
|
||||||
|
<view class="icon iconfont icon-dizhi"></view>
|
||||||
|
<view class="desc"
|
||||||
|
>距离我{{
|
||||||
|
calculateDistance(
|
||||||
|
userLocalNum.t,
|
||||||
|
userLocalNum.l,
|
||||||
|
Number(item.lat),
|
||||||
|
Number(item.lon),
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { calculateDistance } from "@/utils";
|
import { calculateDistance, parseQueryString } from '@/utils';
|
||||||
import { bindParent } from "@/api/user";
|
import { bindParent, getBanner } from '@/api/user';
|
||||||
import { getMerList } from "@/api/goods";
|
import { getMerList } from '@/api/goods';
|
||||||
|
|
||||||
const props = defineProps({
|
const classId = defineModel({ default: 0 });
|
||||||
classId: {
|
|
||||||
type: Number,
|
const list1 = ref<Array<MerData>>([]);
|
||||||
default: 0,
|
const list2 = ref<Array<MerData>>([]);
|
||||||
},
|
|
||||||
|
Taro.useLoad(() => {
|
||||||
|
init();
|
||||||
});
|
});
|
||||||
|
|
||||||
Taro.useDidShow(async () => {
|
const init = async () => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
});
|
||||||
await get_mer_list();
|
await get_mer_list();
|
||||||
if (Taro.getStorageSync("token") && Taro.getStorageSync("bind_id")) {
|
await get_banner_list();
|
||||||
|
if (Taro.getStorageSync('token') && Taro.getStorageSync('bind_id')) {
|
||||||
try {
|
try {
|
||||||
const res = await bindParent({
|
const res = await bindParent({
|
||||||
uid: Taro.getStorageSync("bind_id"),
|
uid: Taro.getStorageSync('bind_id'),
|
||||||
});
|
});
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
});
|
});
|
||||||
Taro.removeStorageSync("bind_id");
|
Taro.removeStorageSync('bind_id');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.removeStorageSync("bind_id");
|
Taro.removeStorageSync('bind_id');
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
Taro.hideLoading();
|
||||||
|
};
|
||||||
|
|
||||||
interface MerData {
|
interface MerData {
|
||||||
ID: number;
|
ID: number;
|
||||||
@@ -71,79 +136,132 @@ const userLocalNum = ref({
|
|||||||
t: 0,
|
t: 0,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pageVal = ref({
|
||||||
|
page: 1,
|
||||||
|
total: 0,
|
||||||
|
});
|
||||||
|
|
||||||
const get_mer_list = async () => {
|
const get_mer_list = async () => {
|
||||||
Taro.getLocation({
|
Taro.getLocation({
|
||||||
type: "wgs84",
|
type: 'wgs84',
|
||||||
success: (res) => {
|
success: res => {
|
||||||
userLocalNum.value.l = res.longitude;
|
userLocalNum.value.l = res.longitude;
|
||||||
userLocalNum.value.t = res.latitude;
|
userLocalNum.value.t = res.latitude;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const res = await getMerList({
|
const res = await getMerList({
|
||||||
PageNum: 1,
|
PageNum: pageVal.value.page,
|
||||||
PageSize: 10,
|
PageSize: 10,
|
||||||
class_id: props.classId,
|
class_id: classId.value,
|
||||||
});
|
});
|
||||||
|
pageVal.value.total = res.data.total;
|
||||||
|
|
||||||
merdata.value = res.data.data;
|
merdata.value = res.data.data;
|
||||||
|
const middleIndex = Math.floor(merdata.value.length / 2);
|
||||||
|
const arr1 = merdata.value.slice(0, middleIndex);
|
||||||
|
const arr2 = merdata.value.slice(middleIndex);
|
||||||
|
list1.value.push(...arr1);
|
||||||
|
list2.value.push(...arr2);
|
||||||
|
merdata.value = [];
|
||||||
|
};
|
||||||
|
const bannerList = ref<any[]>([]);
|
||||||
|
|
||||||
|
const get_banner_list = async () => {
|
||||||
|
const { data }: any = await getBanner();
|
||||||
|
bannerList.value = data.data || [];
|
||||||
};
|
};
|
||||||
|
|
||||||
const toMerDetails = (item: any) => {
|
const toPage = async (url: string) => {
|
||||||
Taro.setStorageSync("mer_info", item);
|
console.log(url);
|
||||||
|
// url转对象
|
||||||
|
const obj = parseQueryString(url);
|
||||||
|
if (obj.type === '1') {
|
||||||
|
const { data: res } = await getMerList({});
|
||||||
|
const mer = res.data.filter(item => item.bid === obj.bid)[0];
|
||||||
|
Taro.setStorageSync('mer_info', mer);
|
||||||
|
}
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/mer/mer_detail/index`,
|
url,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const toMerDetails = item => {
|
||||||
|
Taro.requestSubscribeMessage({
|
||||||
|
tmplIds: ['ewjjRxDJAQ_RbKU8CIjMNwfJXazyGQ95XbpKW16vMZs'],
|
||||||
|
entityIds: [],
|
||||||
|
complete: () => {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: `/pages/mer/mer_detail/index?bid=${item.bid}`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
Taro.useReachBottom(() => {
|
||||||
|
const currTotal = list1.value.length + list2.value.length;
|
||||||
|
if (currTotal === pageVal.value.total) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '没有更多了',
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
pageVal.value.page += 1;
|
||||||
|
get_mer_list();
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.goodBox {
|
.list-box {
|
||||||
|
margin: 20px;
|
||||||
|
padding: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 20px;
|
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
.good {
|
.list {
|
||||||
width: 340px;
|
overflow: scroll;
|
||||||
background-color: #fff;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
border-radius: 10px;
|
|
||||||
|
|
||||||
image {
|
.item {
|
||||||
width: 100%;
|
width: 340px;
|
||||||
height: 250px;
|
margin-bottom: 18px;
|
||||||
border-top-right-radius: 10px;
|
border-radius: 20px;
|
||||||
border-top-left-radius: 10px;
|
background-color: #fff;
|
||||||
}
|
|
||||||
|
|
||||||
.good-text-box {
|
image {
|
||||||
padding: 10px;
|
width: 100%;
|
||||||
|
border-radius: 15px;
|
||||||
.good-text {
|
|
||||||
flex-shrink: 0;
|
|
||||||
font-size: 28px;
|
|
||||||
color: #333;
|
|
||||||
font-weight: 400;
|
|
||||||
display: -webkit-box;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 1;
|
|
||||||
overflow: hidden;
|
|
||||||
word-break: break-word;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.good-price-box {
|
.text {
|
||||||
display: flex;
|
padding: 15px;
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 10px;
|
|
||||||
|
|
||||||
.good-text-price {
|
.title {
|
||||||
font-size: 28px;
|
color: #333333;
|
||||||
font-weight: bold;
|
font-size: 30px;
|
||||||
color: #ff0000;
|
|
||||||
-webkit-box-orient: vertical;
|
|
||||||
-webkit-line-clamp: 1;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
// white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.list_local {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: flex-start;
|
||||||
|
color: #808080;
|
||||||
|
margin-top: 8px;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 30px;
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc {
|
||||||
|
font-size: 28px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,63 +7,49 @@
|
|||||||
:close-on-click-overlay="false"
|
:close-on-click-overlay="false"
|
||||||
:style="{ height: 'auto' }"
|
:style="{ height: 'auto' }"
|
||||||
:visible="isShowPay"
|
:visible="isShowPay"
|
||||||
@click-close-icon="closePay"
|
@click-close-icon="closePay">
|
||||||
>
|
|
||||||
<view class="div">
|
<view class="div">
|
||||||
<view style="text-align: center">支付方式</view>
|
<view style="text-align: center">支付方式</view>
|
||||||
<nut-cell-group
|
<nut-cell-group
|
||||||
:style="{ margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0' }"
|
:style="{ margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0' }">
|
||||||
>
|
<nut-cell
|
||||||
<nut-cell
|
title="微信支付"
|
||||||
title="微信支付"
|
desc="使用微信快捷支付"
|
||||||
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
|
is-link
|
||||||
@click="goPay(3)"
|
@click="goPay(1)">
|
||||||
>
|
|
||||||
<template v-slot:icon>
|
<template v-slot:icon>
|
||||||
<IconFont
|
<IconFont size="30" :name="require('../static/wx.png')" />
|
||||||
size="30"
|
|
||||||
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</nut-cell> -->
|
</nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="平台积分支付"
|
||||||
|
:desc="`剩余积分:${info.integral || 0}`"
|
||||||
|
is-link
|
||||||
|
@click="goPay(2)">
|
||||||
|
<template v-slot:icon>
|
||||||
|
<IconFont size="30" :name="require('../static/pt.png')" />
|
||||||
|
</template>
|
||||||
|
</nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="智多鑫积分支付"
|
||||||
|
:desc="`剩余积分:${jfInfo.jh_info?.integral || 0}`"
|
||||||
|
is-link
|
||||||
|
@click="goPay(3)">
|
||||||
|
<template v-slot:icon>
|
||||||
|
<IconFont size="30" :name="require('../static/jh.png')" />
|
||||||
|
</template>
|
||||||
|
</nut-cell>
|
||||||
</nut-cell-group>
|
</nut-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</nut-popup>
|
</nut-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, watch } from "vue";
|
import { ref, watch } from 'vue';
|
||||||
import { IconFont } from "@nutui/icons-vue-taro";
|
import { IconFont } from '@nutui/icons-vue-taro';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { payOrder } from "@/api/order";
|
import { payOrder } from '@/api/order';
|
||||||
import { getPersonalInfo } from "@/api/user";
|
import { getPersonalInfo } from '@/api/user';
|
||||||
|
|
||||||
const prop = defineProps({
|
const prop = defineProps({
|
||||||
interval: {
|
interval: {
|
||||||
@@ -87,7 +73,7 @@ const prop = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(["closePay", "successPay"]);
|
const emit = defineEmits(['closePay', 'successPay']);
|
||||||
|
|
||||||
const info = ref<{ integral?: any }>({});
|
const info = ref<{ integral?: any }>({});
|
||||||
|
|
||||||
@@ -95,7 +81,7 @@ watch(
|
|||||||
() => prop.isShowPay,
|
() => prop.isShowPay,
|
||||||
() => {
|
() => {
|
||||||
getInfo();
|
getInfo();
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
const getInfo = async () => {
|
const getInfo = async () => {
|
||||||
@@ -105,28 +91,29 @@ const getInfo = async () => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const goPay = async (type: number) => {
|
const goPay = async (type: number) => {
|
||||||
console.log(prop);
|
|
||||||
if (!prop.jfInfo)
|
if (!prop.jfInfo)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "未获取到订单信息",
|
title: '未获取到订单信息~',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
// 1微信支付 2积分支付 3挂帐
|
console.log(prop.jfInfo);
|
||||||
if (type === 1 || type === 2) {
|
// 1微信支付 2积分支付 3专属积分兑换
|
||||||
const { data } = await payOrder({
|
const { data } = await payOrder({
|
||||||
oid: prop.jfInfo,
|
oid: prop.jfInfo.oid,
|
||||||
OrderType: prop.OrderType,
|
OrderType: prop.OrderType,
|
||||||
PayType: type,
|
PayType: type,
|
||||||
});
|
});
|
||||||
if (type === 1) {
|
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
if (data.data) {
|
if (data.data) {
|
||||||
Taro.requestPayment({
|
Taro.requestPayment({
|
||||||
timeStamp: data.data.timeStamp,
|
timeStamp: data.data.timeStamp,
|
||||||
@@ -136,58 +123,53 @@ const goPay = async (type: number) => {
|
|||||||
paySign: data.data.paySign,
|
paySign: data.data.paySign,
|
||||||
success: function () {
|
success: function () {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "支付成功",
|
title: '支付成功',
|
||||||
icon: "success",
|
icon: 'success',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
emit("successPay", false);
|
emit('successPay', false);
|
||||||
},
|
},
|
||||||
fail: function () {
|
fail: function () {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "支付失败",
|
title: '支付失败',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
emit("closePay", false);
|
emit('closePay', false);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "未知异常",
|
title: '支付失败,请稍后再试~',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
emit("closePay", false);
|
emit('closePay', false);
|
||||||
}
|
}
|
||||||
} else if (type === 2) {
|
break;
|
||||||
|
default:
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "支付成功",
|
title: '支付成功',
|
||||||
icon: "success",
|
icon: 'none',
|
||||||
duration: 2000,
|
|
||||||
});
|
});
|
||||||
emit("successPay", false);
|
emit('successPay', false);
|
||||||
}
|
break;
|
||||||
} else {
|
|
||||||
Taro.showToast({
|
|
||||||
title: "挂帐后结账",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: e.msg,
|
title: e.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
emit("closePay", false);
|
emit('closePay', false);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const closePay = () => {
|
const closePay = () => {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "取消支付",
|
title: '取消支付',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
emit("closePay", false);
|
emit('closePay', false);
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,41 +1,60 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { userSign } from "@/api/user";
|
|
||||||
|
|
||||||
const show = ref(false);
|
const isShow = ref(false);
|
||||||
|
|
||||||
Taro.useLoad(async () => {
|
defineExpose({
|
||||||
if (Taro.getStorageSync("token")) show.value = true;
|
isShow,
|
||||||
// const res = await getSignRecord()
|
|
||||||
// console.log(res)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const toSign = async () => {
|
const props = defineProps({
|
||||||
try {
|
imgArr: {
|
||||||
await userSign();
|
required: true,
|
||||||
Taro.showToast({
|
type: Array,
|
||||||
title: "签到成功",
|
default: () => [],
|
||||||
icon: "none",
|
},
|
||||||
});
|
type: Number,
|
||||||
} catch (e) {
|
cb: {
|
||||||
console.log(e);
|
type: Function || null,
|
||||||
}
|
default: null,
|
||||||
show.value = false;
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const imgs = ref(props.imgArr);
|
||||||
|
|
||||||
|
const clickFn = type => {
|
||||||
|
if (props.cb) props.cb(type);
|
||||||
|
else isShow.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const closeFn = () => {
|
||||||
|
isShow.value = false;
|
||||||
|
imgs.value.shift(0);
|
||||||
|
if (imgs.value.length !== 0) isShow.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
Taro.useLoad(() => {
|
||||||
|
isShow.value = true;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<nut-overlay
|
<nut-overlay
|
||||||
v-model:visible="show"
|
v-model:visible="isShow"
|
||||||
:lock-scroll="true"
|
:lock-scroll="true"
|
||||||
:close-on-click-overlay="false"
|
:close-on-click-overlay="false">
|
||||||
>
|
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view @click.stop="toSign">
|
<view @click.stop="clickFn(type)">
|
||||||
<image class="image" src="../static/index/poppBg.png" />
|
<image
|
||||||
|
:style="{
|
||||||
|
width: imgs[0]?.naturalWidth,
|
||||||
|
height:
|
||||||
|
imgs[0]?.naturalHeight < 600 ? imgs[0]?.naturalHeight : '480px',
|
||||||
|
}"
|
||||||
|
:src="imgs[0]" />
|
||||||
</view>
|
</view>
|
||||||
<view @click.stop="show = false">
|
<view @click.stop="closeFn">
|
||||||
<image class="icon" src="../static/index/close.png" />
|
<image class="icon" src="../static/index/close.png" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -5,80 +5,68 @@
|
|||||||
<view
|
<view
|
||||||
class="toolbar"
|
class="toolbar"
|
||||||
@click="format"
|
@click="format"
|
||||||
style="max-height: 240px; overflow-y: auto"
|
style="max-height: 240px; overflow-y: auto">
|
||||||
>
|
|
||||||
<!-- 加粗 -->
|
<!-- 加粗 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.bold ? 'ql-active' : ''"
|
:class="data.formats.bold ? 'ql-active' : ''"
|
||||||
class="iconfont icon-zitijiacu"
|
class="iconfont icon-zitijiacu"
|
||||||
data-name="bold"
|
data-name="bold"></view>
|
||||||
></view>
|
|
||||||
<!-- 斜体 -->
|
<!-- 斜体 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.italic ? 'ql-active' : ''"
|
:class="data.formats.italic ? 'ql-active' : ''"
|
||||||
class="iconfont icon-zitixieti"
|
class="iconfont icon-zitixieti"
|
||||||
data-name="italic"
|
data-name="italic"></view>
|
||||||
></view>
|
|
||||||
<!-- 下划线 -->
|
<!-- 下划线 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.underline ? 'ql-active' : ''"
|
:class="data.formats.underline ? 'ql-active' : ''"
|
||||||
class="iconfont icon-zitixiahuaxian"
|
class="iconfont icon-zitixiahuaxian"
|
||||||
data-name="underline"
|
data-name="underline"></view>
|
||||||
></view>
|
|
||||||
<!-- 对齐方式:左 -->
|
<!-- 对齐方式:左 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.align === 'left' ? 'ql-active' : ''"
|
:class="data.formats.align === 'left' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-zuoduiqi"
|
class="iconfont icon-zuoduiqi"
|
||||||
data-name="align"
|
data-name="align"
|
||||||
data-value="left"
|
data-value="left"></view>
|
||||||
></view>
|
|
||||||
<!-- 对齐方式:居中 -->
|
<!-- 对齐方式:居中 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.align === 'center' ? 'ql-active' : ''"
|
:class="data.formats.align === 'center' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-juzhongduiqi"
|
class="iconfont icon-juzhongduiqi"
|
||||||
data-name="align"
|
data-name="align"
|
||||||
data-value="center"
|
data-value="center"></view>
|
||||||
></view>
|
|
||||||
<!-- 对齐方式:右 -->
|
<!-- 对齐方式:右 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.align === 'right' ? 'ql-active' : ''"
|
:class="data.formats.align === 'right' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-youduiqi"
|
class="iconfont icon-youduiqi"
|
||||||
data-name="align"
|
data-name="align"
|
||||||
data-value="right"
|
data-value="right"></view>
|
||||||
></view>
|
|
||||||
<!-- 对齐方式:两侧 -->
|
<!-- 对齐方式:两侧 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.align === 'justify' ? 'ql-active' : ''"
|
:class="data.formats.align === 'justify' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-zuoyouduiqi"
|
class="iconfont icon-zuoyouduiqi"
|
||||||
data-name="align"
|
data-name="align"
|
||||||
data-value="justify"
|
data-value="justify"></view>
|
||||||
></view>
|
|
||||||
<!-- 有序排列 -->
|
<!-- 有序排列 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.list === 'ordered' ? 'ql-active' : ''"
|
:class="data.formats.list === 'ordered' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-youxupailie"
|
class="iconfont icon-youxupailie"
|
||||||
data-name="list"
|
data-name="list"
|
||||||
data-value="ordered"
|
data-value="ordered"></view>
|
||||||
></view>
|
|
||||||
<!-- 无序排列 -->
|
<!-- 无序排列 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.list === 'bullet' ? 'ql-active' : ''"
|
:class="data.formats.list === 'bullet' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-wuxupailie"
|
class="iconfont icon-wuxupailie"
|
||||||
data-name="list"
|
data-name="list"
|
||||||
data-value="bullet"
|
data-value="bullet"></view>
|
||||||
></view>
|
|
||||||
<!-- 取消缩进 -->
|
<!-- 取消缩进 -->
|
||||||
<view
|
<view
|
||||||
class="iconfont icon-outdent"
|
class="iconfont icon-outdent"
|
||||||
data-name="indent"
|
data-name="indent"
|
||||||
data-value="-1"
|
data-value="-1"></view>
|
||||||
></view>
|
|
||||||
<!-- 缩进 -->
|
<!-- 缩进 -->
|
||||||
<view
|
<view
|
||||||
class="iconfont icon-indent"
|
class="iconfont icon-indent"
|
||||||
data-name="indent"
|
data-name="indent"
|
||||||
data-value="+1"
|
data-value="+1"></view>
|
||||||
></view>
|
|
||||||
<!-- 添加分割线 -->
|
<!-- 添加分割线 -->
|
||||||
<view class="iconfont icon-fengexian" @click="insertDivider"></view>
|
<view class="iconfont icon-fengexian" @click="insertDivider"></view>
|
||||||
<!-- 插入图片 -->
|
<!-- 插入图片 -->
|
||||||
@@ -88,22 +76,19 @@
|
|||||||
:class="data.formats.header === 3 ? 'ql-active' : ''"
|
:class="data.formats.header === 3 ? 'ql-active' : ''"
|
||||||
class="iconfont icon-H"
|
class="iconfont icon-H"
|
||||||
data-name="header"
|
data-name="header"
|
||||||
:data-value="3"
|
:data-value="3"></view>
|
||||||
></view>
|
|
||||||
<!-- 下标 -->
|
<!-- 下标 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.script === 'sub' ? 'ql-active' : ''"
|
:class="data.formats.script === 'sub' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-zitixiabiao"
|
class="iconfont icon-zitixiabiao"
|
||||||
data-name="script"
|
data-name="script"
|
||||||
data-value="sub"
|
data-value="sub"></view>
|
||||||
></view>
|
|
||||||
<!-- 上标 -->
|
<!-- 上标 -->
|
||||||
<view
|
<view
|
||||||
:class="data.formats.script === 'super' ? 'ql-active' : ''"
|
:class="data.formats.script === 'super' ? 'ql-active' : ''"
|
||||||
class="iconfont icon-zitishangbiao"
|
class="iconfont icon-zitishangbiao"
|
||||||
data-name="script"
|
data-name="script"
|
||||||
data-value="super"
|
data-value="super"></view>
|
||||||
></view>
|
|
||||||
<view class="iconfont icon-undo" @click="undo"></view>
|
<view class="iconfont icon-undo" @click="undo"></view>
|
||||||
<view class="iconfont icon-redo" @click="redo"></view>
|
<view class="iconfont icon-redo" @click="redo"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -115,8 +100,7 @@
|
|||||||
@statuschange="onStatusChange"
|
@statuschange="onStatusChange"
|
||||||
:show-img-resize="true"
|
:show-img-resize="true"
|
||||||
@ready="onEditorReady"
|
@ready="onEditorReady"
|
||||||
@input="getCtx"
|
@input="getCtx" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -124,29 +108,29 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { reactive } from "vue";
|
import { reactive } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { BASE_URL } from "@/utils/request";
|
import { BASE_URL } from '@/utils/request';
|
||||||
|
|
||||||
const { content } = defineProps<{
|
const { content } = defineProps<{
|
||||||
content: string;
|
content: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
let emits = defineEmits(["input"]);
|
let emits = defineEmits(['input']);
|
||||||
|
|
||||||
const data = reactive<any>({
|
const data = reactive<any>({
|
||||||
editorCtx: "",
|
editorCtx: '',
|
||||||
readOnly: false,
|
readOnly: false,
|
||||||
placeholder: "请输入商品详情...",
|
placeholder: '请输入商品详情...',
|
||||||
richText: "",
|
richText: '',
|
||||||
formats: {},
|
formats: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
function onEditorReady() {
|
function onEditorReady() {
|
||||||
// 富文本节点渲染完成
|
// 富文本节点渲染完成
|
||||||
Taro.createSelectorQuery()
|
Taro.createSelectorQuery()
|
||||||
.select("#editor")
|
.select('#editor')
|
||||||
.context((res) => {
|
.context(res => {
|
||||||
data.editorCtx = res.context;
|
data.editorCtx = res.context;
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
if (content) {
|
if (content) {
|
||||||
@@ -161,7 +145,7 @@ function onEditorReady() {
|
|||||||
// 失去焦点时,获取富文本的内容
|
// 失去焦点时,获取富文本的内容
|
||||||
function getCtx(e: { detail: { html: any } }) {
|
function getCtx(e: { detail: { html: any } }) {
|
||||||
data.richText = e.detail.html;
|
data.richText = e.detail.html;
|
||||||
emits("input", e.detail.html);
|
emits('input', e.detail.html);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 撤销操作
|
// 撤销操作
|
||||||
@@ -196,16 +180,16 @@ function insertDivider() {
|
|||||||
function insertImage() {
|
function insertImage() {
|
||||||
Taro.chooseImage({
|
Taro.chooseImage({
|
||||||
count: 1,
|
count: 1,
|
||||||
sizeType: ["original", "compressed"],
|
sizeType: ['original', 'compressed'],
|
||||||
sourceType: ["album", "camera"],
|
sourceType: ['album', 'camera'],
|
||||||
success: (res) => {
|
success: res => {
|
||||||
// 上传图片的逻辑各有不同,自行调整即可
|
// 上传图片的逻辑各有不同,自行调整即可
|
||||||
Taro.uploadFile({
|
Taro.uploadFile({
|
||||||
url: `${BASE_URL}/upload`,
|
url: `${BASE_URL}/upload`,
|
||||||
name: "file",
|
name: 'file',
|
||||||
header: { token: Taro.getStorageSync("token") },
|
header: { token: Taro.getStorageSync('token') },
|
||||||
filePath: res.tempFilePaths[0],
|
filePath: res.tempFilePaths[0],
|
||||||
success: (res) => {
|
success: res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
const imgData = JSON.parse(res.data) as {
|
const imgData = JSON.parse(res.data) as {
|
||||||
code: number;
|
code: number;
|
||||||
@@ -215,19 +199,19 @@ function insertImage() {
|
|||||||
if (imgData.code === 200) {
|
if (imgData.code === 200) {
|
||||||
// 将图片展示在编辑器中
|
// 将图片展示在编辑器中
|
||||||
data.editorCtx.insertImage({
|
data.editorCtx.insertImage({
|
||||||
width: "100%",
|
width: '100%',
|
||||||
height: "auto",
|
height: 'auto',
|
||||||
src: imgData.data.data,
|
src: imgData.data.data,
|
||||||
alt: "图像",
|
alt: '图像',
|
||||||
success: function () {
|
success: function () {
|
||||||
console.log("insert image success");
|
console.log('insert image success');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("上传失败");
|
console.log('上传失败');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -237,7 +221,7 @@ function insertImage() {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "../static/font_4211210_2x20brbrv94.css";
|
@import '../static/font_4211210_2x20brbrv94.css';
|
||||||
|
|
||||||
.wrapper {
|
.wrapper {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -266,7 +250,7 @@ function insertImage() {
|
|||||||
.toolbar {
|
.toolbar {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
|
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ql-container {
|
.ql-container {
|
||||||
|
|||||||
63
src/components/StoreList.vue
Normal file
63
src/components/StoreList.vue
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view v-if="storeList.length > 0">
|
||||||
|
<view
|
||||||
|
class="bg-white rounded-[15px] mt-3 p-2 w-[95%] flex items-center"
|
||||||
|
v-for="(item, index) in storeList"
|
||||||
|
:key="index"
|
||||||
|
@click="goDetail(item)">
|
||||||
|
<image
|
||||||
|
class="w-[200px] h-[200px] rounded-[15px] mr-2"
|
||||||
|
:src="item.head_photo" />
|
||||||
|
<view class="flex-1">
|
||||||
|
<view class="text-[#333333] text-[30px] font-bold">{{
|
||||||
|
item.name
|
||||||
|
}}</view>
|
||||||
|
<nut-rate
|
||||||
|
spacing="1"
|
||||||
|
disabled
|
||||||
|
active-color="rgba(252, 207, 10, 1)"
|
||||||
|
v-model="item.rate" />
|
||||||
|
<view class="text-[#9E9E9E] text-[25px]">销量:10000</view>
|
||||||
|
<view class="text-[#9E9E9E] text-[25px]"
|
||||||
|
>营业时间:{{ item.week_start }}-{{ item.week_end }}</view
|
||||||
|
>
|
||||||
|
<view class="text-[#999999] text-[23px]">{{ item.address }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<nut-empty v-else description="暂无数据"></nut-empty>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { getStoreList } from '@/api/home';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
const name = defineModel({
|
||||||
|
default: '',
|
||||||
|
});
|
||||||
|
|
||||||
|
const storeList = ref<any>([]);
|
||||||
|
|
||||||
|
Taro.useLoad(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
const res = await getStoreList({
|
||||||
|
name: name.value,
|
||||||
|
});
|
||||||
|
storeList.value = res.data.data;
|
||||||
|
};
|
||||||
|
|
||||||
|
const goDetail = item => {
|
||||||
|
console.log(item);
|
||||||
|
Taro.setStorageSync('mer_info', item);
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: `/pages/mer/mer_detail/index?bid=${item.bid}`,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss"></style>
|
||||||
@@ -14,14 +14,13 @@
|
|||||||
@touchstart="touchStart"
|
@touchstart="touchStart"
|
||||||
@touchmove="touchMove"
|
@touchmove="touchMove"
|
||||||
@touchend="touchEnd"
|
@touchend="touchEnd"
|
||||||
@error="error"
|
@error="error">
|
||||||
>
|
|
||||||
</canvas>
|
</canvas>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name="ucharts">
|
<script setup lang="ts" name="ucharts">
|
||||||
import uCharts from "../utils/js_sdk/u-charts.min.js";
|
import uCharts from '../utils/js_sdk/u-charts.min.js';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
const canvases = {};
|
const canvases = {};
|
||||||
|
|
||||||
@@ -29,7 +28,7 @@ const props = defineProps({
|
|||||||
chartType: {
|
chartType: {
|
||||||
required: true,
|
required: true,
|
||||||
type: String,
|
type: String,
|
||||||
default: "column",
|
default: 'column',
|
||||||
},
|
},
|
||||||
opts: {
|
opts: {
|
||||||
required: true,
|
required: true,
|
||||||
@@ -40,7 +39,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
canvasId: {
|
canvasId: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "u-canvas",
|
default: 'u-canvas',
|
||||||
},
|
},
|
||||||
cWidth: {
|
cWidth: {
|
||||||
default: 350,
|
default: 350,
|
||||||
@@ -60,10 +59,10 @@ Taro.useLoad(() => {
|
|||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
switch (props.chartType) {
|
switch (props.chartType) {
|
||||||
case "column":
|
case 'column':
|
||||||
initColumnChart();
|
initColumnChart();
|
||||||
break;
|
break;
|
||||||
case "line":
|
case 'line':
|
||||||
initLineChart();
|
initLineChart();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -75,9 +74,9 @@ const initColumnChart = () => {
|
|||||||
const ctx = Taro.createCanvasContext(props.canvasId);
|
const ctx = Taro.createCanvasContext(props.canvasId);
|
||||||
canvases[props.canvasId] = new uCharts({
|
canvases[props.canvasId] = new uCharts({
|
||||||
context: ctx,
|
context: ctx,
|
||||||
type: "column",
|
type: 'column',
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
background: "#FFFFFF",
|
background: '#FFFFFF',
|
||||||
pixelRatio: props.pixelRatio,
|
pixelRatio: props.pixelRatio,
|
||||||
animation: true,
|
animation: true,
|
||||||
categories: props.opts.categories,
|
categories: props.opts.categories,
|
||||||
@@ -99,9 +98,9 @@ const initColumnChart = () => {
|
|||||||
},
|
},
|
||||||
extra: {
|
extra: {
|
||||||
column: {
|
column: {
|
||||||
type: "group",
|
type: 'group',
|
||||||
width: 30,
|
width: 30,
|
||||||
activeBgColor: "#000000",
|
activeBgColor: '#000000',
|
||||||
activeBgOpacity: 0.08,
|
activeBgOpacity: 0.08,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -112,12 +111,12 @@ const initLineChart = () => {
|
|||||||
const ctx = Taro.createCanvasContext(props.canvasId);
|
const ctx = Taro.createCanvasContext(props.canvasId);
|
||||||
canvases[props.canvasId] = new uCharts({
|
canvases[props.canvasId] = new uCharts({
|
||||||
context: ctx,
|
context: ctx,
|
||||||
type: "line",
|
type: 'line',
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
legend: true,
|
legend: true,
|
||||||
dataLabel: false,
|
dataLabel: false,
|
||||||
dataPointShape: true,
|
dataPointShape: true,
|
||||||
background: "#FFFFFF",
|
background: '#FFFFFF',
|
||||||
pixelRatio: props.pixelRatio,
|
pixelRatio: props.pixelRatio,
|
||||||
categories: props.opts.categories,
|
categories: props.opts.categories,
|
||||||
series: props.opts.series,
|
series: props.opts.series,
|
||||||
@@ -133,21 +132,21 @@ const initLineChart = () => {
|
|||||||
disableGrid: true,
|
disableGrid: true,
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
gridType: "dash",
|
gridType: 'dash',
|
||||||
gridColor: "#CCCCCC",
|
gridColor: '#CCCCCC',
|
||||||
dashLength: 8,
|
dashLength: 8,
|
||||||
splitNumber: 5,
|
splitNumber: 5,
|
||||||
min: 10,
|
min: 10,
|
||||||
max: 180,
|
max: 180,
|
||||||
format: (val) => {
|
format: val => {
|
||||||
return val.toFixed(0) + "元";
|
return val.toFixed(0) + '元';
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
width: props.cWidth * props.pixelRatio,
|
width: props.cWidth * props.pixelRatio,
|
||||||
height: props.cHeight * props.pixelRatio,
|
height: props.cHeight * props.pixelRatio,
|
||||||
extra: {
|
extra: {
|
||||||
line: {
|
line: {
|
||||||
type: "straight",
|
type: 'straight',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -156,7 +155,7 @@ const initLineChart = () => {
|
|||||||
const touchStart = (e: any) => {
|
const touchStart = (e: any) => {
|
||||||
canvases[props.canvasId].showToolTip(e, {
|
canvases[props.canvasId].showToolTip(e, {
|
||||||
format: function (item: any, category: any) {
|
format: function (item: any, category: any) {
|
||||||
return category + " " + item.name + ":" + item.data;
|
return category + ' ' + item.name + ':' + item.data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
canvases[props.canvasId].scrollStart(e);
|
canvases[props.canvasId].scrollStart(e);
|
||||||
|
|||||||
@@ -6,15 +6,14 @@
|
|||||||
:headers="config.headers"
|
:headers="config.headers"
|
||||||
@success="success"
|
@success="success"
|
||||||
@failure="failure"
|
@failure="failure"
|
||||||
:multiple="multiple"
|
:multiple="multiple">
|
||||||
>
|
|
||||||
</nut-uploader>
|
</nut-uploader>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { BASE_URL } from "@/utils/request";
|
import { BASE_URL } from '@/utils/request';
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: {
|
list: {
|
||||||
@@ -31,17 +30,17 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(["update:list"]);
|
const emits = defineEmits(['update:list']);
|
||||||
|
|
||||||
const fileList = computed({
|
const fileList = computed({
|
||||||
get: () => props.list,
|
get: () => props.list,
|
||||||
set: (val) => emits("update:list", val),
|
set: val => emits('update:list', val),
|
||||||
});
|
});
|
||||||
|
|
||||||
const config = ref({
|
const config = ref({
|
||||||
url: `${BASE_URL}/upload`,
|
url: `${BASE_URL}/upload`,
|
||||||
headers: {
|
headers: {
|
||||||
token: Taro.getStorageSync("token"),
|
token: Taro.getStorageSync('token'),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -49,15 +48,15 @@ const success = (res: any) => {
|
|||||||
const data = JSON.parse(res.responseText.data);
|
const data = JSON.parse(res.responseText.data);
|
||||||
res.fileItem.url = data.data.data;
|
res.fileItem.url = data.data.data;
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "上传成功",
|
title: '上传成功',
|
||||||
icon: "success",
|
icon: 'success',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const failure = () => {
|
const failure = () => {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "上传失败",
|
title: '上传失败',
|
||||||
icon: "error",
|
icon: 'error',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref } from "vue";
|
import { computed, ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import headImg from "../static/def_avatar.png";
|
import headImg from '../static/def_avatar.png';
|
||||||
import logoImg from "../static/logo.jpg";
|
import logoImg from '../static/logo.jpg';
|
||||||
import { BASE_URL } from "@/utils/request";
|
import { BASE_URL } from '@/utils/request';
|
||||||
import { getPhone, login } from "@/api/user";
|
import { getPhone, login } from '@/api/user';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
isShow: {
|
isShow: {
|
||||||
@@ -12,18 +12,18 @@ const props = defineProps({
|
|||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const emits = defineEmits(["closeEdit", "update:isShow"]);
|
const emits = defineEmits(['closeEdit', 'update:isShow']);
|
||||||
|
|
||||||
const userInfo = ref({
|
const userInfo = ref({
|
||||||
nickname: "",
|
nickname: '',
|
||||||
avatar: "",
|
avatar: '',
|
||||||
phone: "",
|
phone: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const show = computed({
|
const show = computed({
|
||||||
get: (): boolean => props.isShow,
|
get: (): boolean => props.isShow,
|
||||||
set: (val) => {
|
set: val => {
|
||||||
emits("update:isShow", val);
|
emits('update:isShow', val);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -32,15 +32,15 @@ const mp_is_new = ref(true);
|
|||||||
const canvasStatus = ref(false);
|
const canvasStatus = ref(false);
|
||||||
|
|
||||||
const closeAttr = () => {
|
const closeAttr = () => {
|
||||||
emits("closeEdit");
|
emits('closeEdit');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onChooseAvatar = (e) => {
|
const onChooseAvatar = e => {
|
||||||
const { avatarUrl } = e.detail;
|
const { avatarUrl } = e.detail;
|
||||||
Taro.uploadFile({
|
Taro.uploadFile({
|
||||||
url: `${BASE_URL}/upload`,
|
url: `${BASE_URL}/upload`,
|
||||||
filePath: avatarUrl,
|
filePath: avatarUrl,
|
||||||
name: "file",
|
name: 'file',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
const data = JSON.parse(res.data);
|
const data = JSON.parse(res.data);
|
||||||
userInfo.value.avatar = data.data.data;
|
userInfo.value.avatar = data.data.data;
|
||||||
@@ -54,7 +54,7 @@ const uploadPic = () => {
|
|||||||
|
|
||||||
const getPhoneNumber = async (e: any) => {
|
const getPhoneNumber = async (e: any) => {
|
||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: "授权手机号中",
|
title: '授权手机号中',
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
const { code } = e.detail;
|
const { code } = e.detail;
|
||||||
@@ -68,39 +68,39 @@ const getPhoneNumber = async (e: any) => {
|
|||||||
const formSubmit = async (e: any) => {
|
const formSubmit = async (e: any) => {
|
||||||
if (!userInfo.value.avatar)
|
if (!userInfo.value.avatar)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "请上传头像",
|
title: '请上传头像',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
userInfo.value.nickname = e.detail.value.nickname;
|
userInfo.value.nickname = e.detail.value.nickname;
|
||||||
if (!userInfo.value.nickname)
|
if (!userInfo.value.nickname)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "请输入昵称",
|
title: '请输入昵称',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
if (!userInfo.value.phone)
|
if (!userInfo.value.phone)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "请授权手机号码",
|
title: '请授权手机号码',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
const res = await login({
|
const res = await login({
|
||||||
Code: Taro.getStorageSync("wx_code"),
|
Code: Taro.getStorageSync('wx_code'),
|
||||||
NickName: userInfo.value.nickname,
|
NickName: userInfo.value.nickname,
|
||||||
AvatarUrl: userInfo.value.avatar,
|
AvatarUrl: userInfo.value.avatar,
|
||||||
Phone: userInfo.value.phone,
|
Phone: userInfo.value.phone,
|
||||||
Referee: Taro.getStorageSync("bind_id") || "",
|
Referee: Taro.getStorageSync('bind_id') || '',
|
||||||
});
|
});
|
||||||
emits("closeEdit");
|
emits('closeEdit');
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "success",
|
icon: 'success',
|
||||||
duration: 2000,
|
duration: 2000,
|
||||||
});
|
});
|
||||||
Taro.setStorageSync("token", res.data.token);
|
Taro.setStorageSync('token', res.data.token);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.removeStorageSync("wx_code");
|
Taro.removeStorageSync('wx_code');
|
||||||
Taro.removeStorageSync("bind_id");
|
Taro.removeStorageSync('bind_id');
|
||||||
Taro.switchTab({
|
Taro.switchTab({
|
||||||
url: "/pages/user/index",
|
url: '/pages/user/index',
|
||||||
});
|
});
|
||||||
}, 2000);
|
}, 2000);
|
||||||
};
|
};
|
||||||
@@ -115,16 +115,15 @@ const formSubmit = async (e: any) => {
|
|||||||
:style="{ padding: '20px 10px' }"
|
:style="{ padding: '20px 10px' }"
|
||||||
v-model:visible="show"
|
v-model:visible="show"
|
||||||
@close="closeAttr"
|
@close="closeAttr"
|
||||||
:close-on-click-overlay="false"
|
:close-on-click-overlay="false">
|
||||||
>
|
|
||||||
<view class="mp-data">
|
<view class="mp-data">
|
||||||
<image class="image" :src="logoImg"></image>
|
<image class="image" :src="logoImg"></image>
|
||||||
<text class="mp-name">捷兑通 申请</text>
|
<text class="mp-name">捷兑通 申请</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="trip-msg">
|
<!-- <view class="trip-msg">
|
||||||
<view class="title"> 获取您的昵称、头像 </view>
|
<view class="title"> 获取您的昵称、头像 </view>
|
||||||
<view class="trip"> 提供具有辨识度的用户中心界面 </view>
|
<view class="trip"> 提供具有辨识度的用户中心界面 </view>
|
||||||
</view>
|
</view> -->
|
||||||
<form @submit="formSubmit">
|
<form @submit="formSubmit">
|
||||||
<view class="edit">
|
<view class="edit">
|
||||||
<view class="avatar edit-box">
|
<view class="avatar edit-box">
|
||||||
@@ -133,23 +132,19 @@ const formSubmit = async (e: any) => {
|
|||||||
<view
|
<view
|
||||||
class="avatar-box"
|
class="avatar-box"
|
||||||
v-if="!mp_is_new"
|
v-if="!mp_is_new"
|
||||||
@click.stop="uploadPic"
|
@click.stop="uploadPic">
|
||||||
>
|
|
||||||
<image
|
<image
|
||||||
:src="userInfo.avatar || headImg"
|
:src="userInfo.avatar || headImg"
|
||||||
mode="aspectFill"
|
mode="aspectFill"></image>
|
||||||
></image>
|
|
||||||
</view>
|
</view>
|
||||||
<button
|
<button
|
||||||
v-else
|
v-else
|
||||||
class="avatar-box"
|
class="avatar-box"
|
||||||
open-type="chooseAvatar"
|
open-type="chooseAvatar"
|
||||||
@chooseavatar="onChooseAvatar"
|
@chooseavatar="onChooseAvatar">
|
||||||
>
|
|
||||||
<image
|
<image
|
||||||
:src="userInfo.avatar || headImg"
|
:src="userInfo.avatar || headImg"
|
||||||
mode="aspectFill"
|
mode="aspectFill"></image>
|
||||||
></image>
|
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -163,8 +158,7 @@ const formSubmit = async (e: any) => {
|
|||||||
placeholder="请输入昵称"
|
placeholder="请输入昵称"
|
||||||
name="nickname"
|
name="nickname"
|
||||||
:maxlength="16"
|
:maxlength="16"
|
||||||
:value="userInfo.nickname"
|
:value="userInfo.nickname" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -174,9 +168,8 @@ const formSubmit = async (e: any) => {
|
|||||||
<view class="input">
|
<view class="input">
|
||||||
<button
|
<button
|
||||||
open-type="getPhoneNumber"
|
open-type="getPhoneNumber"
|
||||||
@getphonenumber="getPhoneNumber"
|
@getphonenumber="getPhoneNumber">
|
||||||
>
|
{{ !userInfo.phone ? '请授权手机号' : '授权成功' }}
|
||||||
{{ !userInfo.phone ? "请授权手机号" : "授权成功" }}
|
|
||||||
</button>
|
</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<!DOCTYPE html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
||||||
<meta
|
<meta
|
||||||
content="width=device-width,initial-scale=1,user-scalable=no"
|
content="width=device-width,initial-scale=1,user-scalable=no"
|
||||||
name="viewport"
|
name="viewport" />
|
||||||
/>
|
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
<meta name="apple-touch-fullscreen" content="yes" />
|
<meta name="apple-touch-fullscreen" content="yes" />
|
||||||
<meta name="format-detection" content="telephone=no,address=no" />
|
<meta name="format-detection" content="telephone=no,address=no" />
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "菜单",
|
navigationBarTitleText: '菜单',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -64,4 +64,4 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,14 +9,12 @@
|
|||||||
direction="vertical"
|
direction="vertical"
|
||||||
title-gutter="5"
|
title-gutter="5"
|
||||||
animated-time="0"
|
animated-time="0"
|
||||||
name="tabName"
|
name="tabName">
|
||||||
>
|
|
||||||
<nut-tab-pane
|
<nut-tab-pane
|
||||||
v-for="(itm, index) in good_list"
|
v-for="(itm, index) in good_list"
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="itm.name"
|
:title="itm.name"
|
||||||
:pane-key="index"
|
:pane-key="index">
|
||||||
>
|
|
||||||
<view v-if="itm.Goods.length > 0">
|
<view v-if="itm.Goods.length > 0">
|
||||||
<view class="list" v-for="(item, index) in itm.Goods" :key="index">
|
<view class="list" v-for="(item, index) in itm.Goods" :key="index">
|
||||||
<view class="item" @click.stop="toGoodDetails(item.gid, 1)">
|
<view class="item" @click.stop="toGoodDetails(item.gid, 1)">
|
||||||
@@ -29,17 +27,16 @@
|
|||||||
<view class="price">
|
<view class="price">
|
||||||
<text style="font-size: 15px">{{ item.number }}元</text>
|
<text style="font-size: 15px">{{ item.number }}元</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="price">
|
<!-- <view class="price">
|
||||||
<text style="font-size: 15px"
|
<text style="font-size: 15px"
|
||||||
>{{ item.exchange }}积分</text
|
>{{ item.exchange }}积分</text
|
||||||
>
|
>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<nut-button
|
<nut-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click.stop="add_cart(item)"
|
@click.stop="add_cart(item)">
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<Cart2 />
|
<Cart2 />
|
||||||
</template>
|
</template>
|
||||||
@@ -56,16 +53,20 @@
|
|||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="该商家暂无商品"></nut-empty>
|
<nut-empty v-else description="该商家暂无商品"></nut-empty>
|
||||||
<!-- 购物车 -->
|
<!-- 购物车 -->
|
||||||
<cart ref="cartRef" :mer-info="mer_info" @update-cart="updateCartNum" :IsPendingOrder="true" />
|
<cart
|
||||||
|
ref="cartRef"
|
||||||
|
:mer-info="mer_info"
|
||||||
|
@update-cart="updateCartNum"
|
||||||
|
:IsPendingOrder="true" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Ref, ref } from "vue";
|
import { Ref, ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import Cart from "../../../../components/Cart.vue";
|
import Cart from '../../../../components/Cart.vue';
|
||||||
import { Cart2 } from "@nutui/icons-vue-taro";
|
import { Cart2 } from '@nutui/icons-vue-taro';
|
||||||
import { getGoodList, getMerCategory } from "../../../../api/goods";
|
import { getGoodList, getMerCategory } from '../../../../api/goods';
|
||||||
|
|
||||||
interface goodList {
|
interface goodList {
|
||||||
ID: number;
|
ID: number;
|
||||||
@@ -94,7 +95,7 @@ interface CartItems {
|
|||||||
exchange: number;
|
exchange: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
const value = ref("0");
|
const value = ref('0');
|
||||||
const good_list = ref<goodList[]>([]);
|
const good_list = ref<goodList[]>([]);
|
||||||
const class_list = ref<
|
const class_list = ref<
|
||||||
Array<{
|
Array<{
|
||||||
@@ -103,8 +104,8 @@ const class_list = ref<
|
|||||||
}>
|
}>
|
||||||
>([]);
|
>([]);
|
||||||
|
|
||||||
Taro.useLoad(async (e) => {
|
Taro.useLoad(async e => {
|
||||||
mer_info.value = e
|
mer_info.value = e;
|
||||||
await get_class_list(e.bid);
|
await get_class_list(e.bid);
|
||||||
await cartRef.value.get_cart_list();
|
await cartRef.value.get_cart_list();
|
||||||
});
|
});
|
||||||
@@ -119,7 +120,7 @@ const get_class_list = async (bid: string) => {
|
|||||||
|
|
||||||
const get_good_list = async (id: number, bid: string) => {
|
const get_good_list = async (id: number, bid: string) => {
|
||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: "加载中",
|
title: '加载中',
|
||||||
mask: true,
|
mask: true,
|
||||||
});
|
});
|
||||||
const res = await getGoodList({
|
const res = await getGoodList({
|
||||||
@@ -161,7 +162,7 @@ const updateCartNum = (cartItems: CartItems[]) => {
|
|||||||
} else {
|
} else {
|
||||||
good_list.value.forEach((category: goodList) => {
|
good_list.value.forEach((category: goodList) => {
|
||||||
category.Goods.forEach((good: GoodsType) => {
|
category.Goods.forEach((good: GoodsType) => {
|
||||||
Reflect.deleteProperty(good, "cartNum");
|
Reflect.deleteProperty(good, 'cartNum');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -169,5 +170,5 @@ const updateCartNum = (cartItems: CartItems[]) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "填写信息",
|
navigationBarTitleText: '填写信息',
|
||||||
navigationStyle: "custom",
|
navigationStyle: 'custom',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png");
|
background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png');
|
||||||
background-size: auto 40%;
|
background-size: auto 40%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
@@ -43,4 +43,4 @@
|
|||||||
.nut-dialog__content {
|
.nut-dialog__content {
|
||||||
text-align: left !important;
|
text-align: left !important;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
placeholder="请输入台号,比如:包厢A01"
|
placeholder="请输入台号,比如:包厢A01"
|
||||||
name="seat"
|
name="seat"
|
||||||
v-model="formVal.seat"
|
v-model="formVal.seat"
|
||||||
required
|
required />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">手机号:</text>
|
<text class="label">手机号:</text>
|
||||||
@@ -20,8 +19,7 @@
|
|||||||
placeholder="请输入客人手机号码"
|
placeholder="请输入客人手机号码"
|
||||||
name="phone"
|
name="phone"
|
||||||
v-model="formVal.phone"
|
v-model="formVal.phone"
|
||||||
required
|
required />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="form-item">
|
<view class="form-item">
|
||||||
<text class="label">备注:</text>
|
<text class="label">备注:</text>
|
||||||
@@ -29,8 +27,7 @@
|
|||||||
type="textarea"
|
type="textarea"
|
||||||
placeholder="备注"
|
placeholder="备注"
|
||||||
name="notes"
|
name="notes"
|
||||||
v-model="formVal.notes"
|
v-model="formVal.notes" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<nut-button
|
<nut-button
|
||||||
style="border-radius: 7px"
|
style="border-radius: 7px"
|
||||||
@@ -47,23 +44,22 @@
|
|||||||
<template #default
|
<template #default
|
||||||
>客户手机号:
|
>客户手机号:
|
||||||
<text style="color: #fd0100">{{ formVal.phone }}</text>
|
<text style="color: #fd0100">{{ formVal.phone }}</text>
|
||||||
没有注册捷兑
|
没有注册捷兑 通,请通知他登录捷兑通小程序注册。</template
|
||||||
通,请通知他登录捷兑通小程序注册。</template
|
|
||||||
>
|
>
|
||||||
</nut-dialog>
|
</nut-dialog>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import BackComponent from "../../../../components/Back.vue";
|
import BackComponent from '../../../../components/Back.vue';
|
||||||
import { checkPhone } from "../../../../api/admin";
|
import { checkPhone } from '../../../../api/admin';
|
||||||
|
|
||||||
const formVal = ref({
|
const formVal = ref({
|
||||||
seat: "",
|
seat: '',
|
||||||
phone: "",
|
phone: '',
|
||||||
notes: "",
|
notes: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
@@ -71,29 +67,28 @@ const visible = ref(false);
|
|||||||
const formSubmit = async ({ detail }: any) => {
|
const formSubmit = async ({ detail }: any) => {
|
||||||
if (!detail.value.seat)
|
if (!detail.value.seat)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "请填写台号",
|
title: '请填写台号',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
if (
|
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(
|
!/^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
|
detail.value.phone,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "请输入正确的手机号码",
|
title: '请输入正确的手机号码',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
const res = await checkPhone({ phone: detail.value.phone });
|
await checkPhone({ phone: detail.value.phone });
|
||||||
console.log(res);
|
const user_info = await Taro.getStorageSync('userInfo');
|
||||||
const user_info = await Taro.getStorageSync("userInfo");
|
|
||||||
Taro.navigateTo({
|
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}`,
|
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: () => {
|
success: () => {
|
||||||
formVal.value = {
|
formVal.value = {
|
||||||
seat: "",
|
seat: '',
|
||||||
phone: "",
|
phone: '',
|
||||||
notes: "",
|
notes: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -105,5 +100,5 @@ const formSubmit = async ({ detail }: any) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "点单",
|
navigationBarTitleText: '点单',
|
||||||
navigationStyle: "custom",
|
navigationStyle: 'custom',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
background-image: url("./static/WechatIMG10.jpg");
|
// background-image: url('./static/WechatIMG10.jpg');
|
||||||
|
background-image: url('https://m.360buyimg.com/i/jfs/t1/288333/5/8622/43050/682e2e18Ff3a6e2af/bbc66c081c18a467.png');
|
||||||
background-size: 100% 35%;
|
background-size: 100% 35%;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@
|
|||||||
.line {
|
.line {
|
||||||
width: 1px;
|
width: 1px;
|
||||||
height: 188px;
|
height: 188px;
|
||||||
background: #C8C8C8;
|
background: #c8c8c8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,8 +5,7 @@
|
|||||||
<view class="card">
|
<view class="card">
|
||||||
<view
|
<view
|
||||||
class="comm"
|
class="comm"
|
||||||
@click="navTo('/pages/admin/add_order/add_table/index')"
|
@click="navTo('/pages/admin/add_order/add_table/index')">
|
||||||
>
|
|
||||||
<text class="title">开始点单</text>
|
<text class="title">开始点单</text>
|
||||||
<image src="./static/dc.png"></image>
|
<image src="./static/dc.png"></image>
|
||||||
<text class="sub">线上点单后结系统</text>
|
<text class="sub">线上点单后结系统</text>
|
||||||
@@ -14,8 +13,7 @@
|
|||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view
|
<view
|
||||||
class="comm"
|
class="comm"
|
||||||
@click="navTo('/pages/admin/add_order/pending_order/index')"
|
@click="navTo('/pages/admin/add_order/pending_order/index')">
|
||||||
>
|
|
||||||
<text class="title">我的订单</text>
|
<text class="title">我的订单</text>
|
||||||
<image src="./static/ddan.png"></image>
|
<image src="./static/ddan.png"></image>
|
||||||
<text class="sub">查看我点餐的订单</text>
|
<text class="sub">查看我点餐的订单</text>
|
||||||
@@ -26,8 +24,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import BackComponent from "../../../components/Back.vue";
|
import BackComponent from '../../../components/Back.vue';
|
||||||
|
|
||||||
const navTo = (path: string) => {
|
const navTo = (path: string) => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
@@ -37,5 +35,5 @@ const navTo = (path: string) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,30 +1,51 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="footer" v-if="info.status !== 1">
|
<view class="footer" v-if="info.status !== 1">
|
||||||
<view
|
<nut-popover
|
||||||
|
v-if="info.status !== 2"
|
||||||
|
v-model:visible="popoverShow"
|
||||||
|
:list="popoverList"
|
||||||
|
:duration="0"
|
||||||
|
location="bottom-start"
|
||||||
|
@choose="popoverChoose">
|
||||||
|
<template #reference>
|
||||||
|
<view class="text-[#9C9C9C] text-[30px]">更多</view>
|
||||||
|
</template>
|
||||||
|
</nut-popover>
|
||||||
|
<view v-else></view>
|
||||||
|
<view class="flex">
|
||||||
|
<!-- <view
|
||||||
v-if="info.status !== 2"
|
v-if="info.status !== 2"
|
||||||
class="btn"
|
class="btn"
|
||||||
style="border: 1px #7f7f7f solid; color: #666666"
|
style="border: 1px #7f7f7f solid; color: #666666"
|
||||||
@click="visible = true"
|
@click="visible = true"
|
||||||
>挂帐</view
|
>挂帐</view
|
||||||
>
|
> -->
|
||||||
<view
|
<view
|
||||||
v-if="info.status !== 2"
|
v-if="info.status !== 2"
|
||||||
class="btn"
|
class="btn"
|
||||||
style="background-color: #009ee0"
|
style="background-color: #009ee0"
|
||||||
@click="to_menu_page"
|
@click="to_menu_page"
|
||||||
>继续点单</view
|
>继续点单</view
|
||||||
>
|
>
|
||||||
<view
|
<view
|
||||||
|
v-if="info.status !== 2"
|
||||||
|
class="btn"
|
||||||
|
style="background-color: none; color: black; border: 1px solid #000"
|
||||||
|
@click="cancelOrder"
|
||||||
|
>取消订单</view
|
||||||
|
>
|
||||||
|
<!-- <view
|
||||||
v-if="info.status !== 2"
|
v-if="info.status !== 2"
|
||||||
class="btn"
|
class="btn"
|
||||||
style="background-color: #ffa938"
|
style="background-color: #ffa938"
|
||||||
@click="visible1 = true"
|
@click="visible1 = true"
|
||||||
>修改</view
|
>修改</view
|
||||||
>
|
> -->
|
||||||
<view class="btn" style="background-color: #fd0100" @click="to_pay_page"
|
<view class="btn" style="background-color: #fd0100" @click="to_pay_page"
|
||||||
>收款码</view
|
>收款码</view
|
||||||
>
|
>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<nut-dialog v-model:visible="visible" @ok="onOk">
|
<nut-dialog v-model:visible="visible" @ok="onOk">
|
||||||
<template #header>挂帐</template>
|
<template #header>挂帐</template>
|
||||||
@@ -57,9 +78,13 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { onMounted, ref } from 'vue';
|
||||||
import { confirmAfterOrder, editAfterOrder } from "../../../../../api/admin";
|
import {
|
||||||
import Taro from "@tarojs/taro";
|
cancelAfterOrder,
|
||||||
|
confirmAfterOrder,
|
||||||
|
editAfterOrder,
|
||||||
|
} from '@/api/admin';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
info: {
|
info: {
|
||||||
@@ -68,14 +93,34 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(["ok"]);
|
onMounted(() => {
|
||||||
|
// console.log(props.info);
|
||||||
|
popoverList.value = [
|
||||||
|
{
|
||||||
|
name: '修改',
|
||||||
|
value: 1,
|
||||||
|
disabled: props.info.status === 2,
|
||||||
|
className: 'text-[35px] p-[10px]',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: '挂帐',
|
||||||
|
value: 2,
|
||||||
|
disabled: props.info.status === 2,
|
||||||
|
className: 'text-[35px] p-[10px]',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
console.log(popoverList.value);
|
||||||
|
});
|
||||||
|
|
||||||
|
const emits = defineEmits(['ok', 'cancelOrderOk']);
|
||||||
|
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
const visible1 = ref(false);
|
const visible1 = ref(false);
|
||||||
|
|
||||||
const formVal = ref({
|
const formVal = ref({
|
||||||
seat: "",
|
seat: '',
|
||||||
notes: "",
|
notes: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const onCancel = () => {
|
const onCancel = () => {
|
||||||
@@ -90,9 +135,9 @@ const onOk = async () => {
|
|||||||
});
|
});
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
emits("ok");
|
emits('ok');
|
||||||
};
|
};
|
||||||
|
|
||||||
const onOk1 = async () => {
|
const onOk1 = async () => {
|
||||||
@@ -107,15 +152,15 @@ const onOk1 = async () => {
|
|||||||
|
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
|
|
||||||
formVal.value = {
|
formVal.value = {
|
||||||
seat: "",
|
seat: '',
|
||||||
notes: "",
|
notes: '',
|
||||||
};
|
};
|
||||||
|
|
||||||
emits("ok");
|
emits('ok');
|
||||||
};
|
};
|
||||||
|
|
||||||
const to_pay_page = () => {
|
const to_pay_page = () => {
|
||||||
@@ -129,13 +174,39 @@ const to_menu_page = () => {
|
|||||||
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}`,
|
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}`,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const popoverShow = ref(false);
|
||||||
|
const popoverList = ref<any>([]);
|
||||||
|
const popoverChoose = e => {
|
||||||
|
console.log(e);
|
||||||
|
switch (e.value) {
|
||||||
|
case 1:
|
||||||
|
visible1.value = true;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
visible.value = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const cancelOrder = async () => {
|
||||||
|
const res = await cancelAfterOrder({
|
||||||
|
oid: props.info.oid,
|
||||||
|
});
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
emits('cancelOrderOk');
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.footer {
|
.footer {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: space-between;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
align-items: center;
|
||||||
.btn {
|
.btn {
|
||||||
width: 143px;
|
width: 143px;
|
||||||
height: 56px;
|
height: 56px;
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "后结订单",
|
navigationBarTitleText: '后结订单',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ page {
|
|||||||
.tabs {
|
.tabs {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin: 20px 30px;
|
padding: 20px 30px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -61,11 +62,13 @@ page {
|
|||||||
min-width: 195px;
|
min-width: 195px;
|
||||||
height: 195px;
|
height: 195px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
margin-left: 20px;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
.title {
|
.title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
|||||||
@@ -5,25 +5,24 @@
|
|||||||
class="item"
|
class="item"
|
||||||
v-for="item in tabs"
|
v-for="item in tabs"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@click="changeTabs(item.value)"
|
@click="changeTabs(item.value)">
|
||||||
>
|
|
||||||
<text>{{ item.text }}</text>
|
<text>{{ item.text }}</text>
|
||||||
<view
|
<view
|
||||||
class="line"
|
class="line"
|
||||||
:class="tabsIndex == item.value ? 'active' : ''"
|
:class="tabsIndex == item.value ? 'active' : ''"></view>
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="listData.length > 0">
|
<view v-if="listData.length > 0">
|
||||||
<view
|
<view
|
||||||
class="card"
|
class="card"
|
||||||
v-for="(item, index) in (listData as any[])"
|
v-for="(item, index) in listData as any[]"
|
||||||
:key="index"
|
:key="index">
|
||||||
>
|
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view>
|
<view>
|
||||||
<text>台号: {{ item.seat }}</text>
|
<text class="text-[#9C9C9C] text-[28px]"
|
||||||
<text>点单人: {{ item.PlaceUser?.nickName }}</text>
|
>台号: {{ item.seat }}</text
|
||||||
|
>
|
||||||
|
<!-- <text>点单人: {{ item.PlaceUser?.nickName }}</text> -->
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:style="{
|
:style="{
|
||||||
@@ -38,8 +37,7 @@
|
|||||||
<view
|
<view
|
||||||
class="goods-list"
|
class="goods-list"
|
||||||
v-for="(itm, idx) in item.OrderGoods"
|
v-for="(itm, idx) in item.OrderGoods"
|
||||||
:key="idx"
|
:key="idx">
|
||||||
>
|
|
||||||
<image :src="itm.Goods.cover"></image>
|
<image :src="itm.Goods.cover"></image>
|
||||||
<view class="center">
|
<view class="center">
|
||||||
<nut-ellipsis
|
<nut-ellipsis
|
||||||
@@ -47,23 +45,20 @@
|
|||||||
:content="itm.Goods.name"
|
:content="itm.Goods.name"
|
||||||
rows="3"
|
rows="3"
|
||||||
expand-text="展开"
|
expand-text="展开"
|
||||||
collapse-text="收起"
|
collapse-text="收起"></nut-ellipsis>
|
||||||
></nut-ellipsis>
|
<view class="text-[#9C9C9C]">
|
||||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
<view>订单时间: {{ item.add_time.slice(0, 10) }}</view>
|
||||||
|
<view>备注: {{ item.notes }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
<view>x{{ itm.pay_price }}</view>
|
<view>¥{{ itm.pay_price }}</view>
|
||||||
<view>x{{ itm.number }}</view>
|
<view>x{{ itm.number }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="desc">
|
<!-- <view class="line"></view> -->
|
||||||
<view>订单时间: {{ item.add_time }}</view>
|
<Footer :info="item" @ok="get_list" @cancelOrderOk="get_list" />
|
||||||
<view>备注: {{ item.notes }}</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view class="line"></view>
|
|
||||||
<Footer :info="item" @ok="get_list" />
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="暂无订单"></nut-empty>
|
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||||
@@ -71,32 +66,32 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { getAfterOrderList } from "../../../../api/admin";
|
import Footer from './components/Footer.vue';
|
||||||
import Footer from "./components/Footer.vue";
|
import { getAfterOrderList } from '@/api/admin';
|
||||||
|
|
||||||
const tabsIndex = ref(1);
|
const tabsIndex = ref(0);
|
||||||
|
|
||||||
const listData = ref([]);
|
const listData = ref([]);
|
||||||
|
|
||||||
const tabs = ref([
|
const tabs = ref([
|
||||||
{
|
{
|
||||||
text: "未收款",
|
text: '全部',
|
||||||
|
value: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '未收款',
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "挂帐中",
|
text: '挂帐中',
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "已收款",
|
text: '已收款',
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
text: "全部",
|
|
||||||
value: 0,
|
|
||||||
},
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Taro.useDidShow(() => {
|
Taro.useDidShow(() => {
|
||||||
@@ -110,9 +105,9 @@ const changeTabs = (index: number) => {
|
|||||||
|
|
||||||
const get_list = async () => {
|
const get_list = async () => {
|
||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: "加载中",
|
title: '加载中',
|
||||||
});
|
});
|
||||||
const user_info = await Taro.getStorageSync("userInfo");
|
const user_info = await Taro.getStorageSync('userInfo');
|
||||||
const { data: res } = await getAfterOrderList({
|
const { data: res } = await getAfterOrderList({
|
||||||
bid: user_info.data.bid,
|
bid: user_info.data.bid,
|
||||||
status: tabsIndex.value,
|
status: tabsIndex.value,
|
||||||
@@ -124,26 +119,26 @@ const get_list = async () => {
|
|||||||
const get_color = (status: number) => {
|
const get_color = (status: number) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return "#FD0100";
|
return '#FD0100';
|
||||||
case 1:
|
case 1:
|
||||||
return "#03A113";
|
return '#03A113';
|
||||||
case 2:
|
case 2:
|
||||||
return "#FFA938";
|
return '#FFA938';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const get_status_text = (status: number) => {
|
const get_status_text = (status: number) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return "未付款";
|
return '未付款';
|
||||||
case 1:
|
case 1:
|
||||||
return "已付款";
|
return '已付款';
|
||||||
case 2:
|
case 2:
|
||||||
return "挂帐中";
|
return '挂帐中';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const to_page = (item) => {
|
const to_page = item => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?bid=${item.bid}&oid=${item.oid}`,
|
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?bid=${item.bid}&oid=${item.oid}`,
|
||||||
});
|
});
|
||||||
@@ -151,5 +146,5 @@ const to_page = (item) => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "收款",
|
navigationBarTitleText: '收款',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
.container {
|
.container {
|
||||||
margin: 30px;
|
padding: 20px;
|
||||||
|
|
||||||
.name {
|
.name {
|
||||||
font-size: 55px;
|
font-size: 55px;
|
||||||
@@ -18,12 +18,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: "¥";
|
content: '¥';
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: "";
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -1px;
|
bottom: -1px;
|
||||||
width: 700px;
|
width: 700px;
|
||||||
@@ -38,46 +38,46 @@
|
|||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
margin: 20px auto;
|
margin: 20px auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.line {
|
.line {
|
||||||
width: inherit;
|
width: inherit;
|
||||||
height: 1px;
|
height: 1px;
|
||||||
background-color: #e9e9e9;
|
background-color: #e9e9e9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-list {
|
.goods-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 195px;
|
width: 195px;
|
||||||
height: 195px;
|
height: 195px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.num {
|
.num {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
@@ -85,7 +85,7 @@
|
|||||||
font-size: 26px;
|
font-size: 26px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.desc {
|
.desc {
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
@@ -101,7 +101,7 @@
|
|||||||
.btn {
|
.btn {
|
||||||
width: 709px;
|
width: 709px;
|
||||||
height: 92px;
|
height: 92px;
|
||||||
background: #FD0100;
|
background: #fd0100;
|
||||||
color: #ffffff;
|
color: #ffffff;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="name">立即收款</view>
|
<view class="name">立即收款</view>
|
||||||
<view class="input">
|
<view class="input">
|
||||||
<input v-model="val" placeholder="请输入收款金额" />
|
<input v-model="val" type="digit" placeholder="请输入收款金额" />
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -26,8 +26,7 @@
|
|||||||
<view class="center">
|
<view class="center">
|
||||||
<nut-ellipsis
|
<nut-ellipsis
|
||||||
direction="end"
|
direction="end"
|
||||||
:content="itm.Goods.name"
|
:content="itm.Goods.name"></nut-ellipsis>
|
||||||
></nut-ellipsis>
|
|
||||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
@@ -45,19 +44,28 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<nut-button
|
||||||
<view class="btn" @click="ok">立即收款</view>
|
style="border-radius: 10px"
|
||||||
|
shape="square"
|
||||||
|
block
|
||||||
|
:loading="isLoading"
|
||||||
|
type="primary"
|
||||||
|
@click="ok"
|
||||||
|
>立即收款</nut-button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { getAfterOrder, createPayQr } from "../../../../../api/admin";
|
import { getAfterOrder, createPayQr } from '@/api/admin';
|
||||||
|
|
||||||
const data = ref<any>({});
|
const data = ref<any>({});
|
||||||
|
|
||||||
const val = ref("");
|
const val = ref('');
|
||||||
|
|
||||||
|
const isLoading = ref(false);
|
||||||
|
|
||||||
Taro.useLoad((e: any) => {
|
Taro.useLoad((e: any) => {
|
||||||
get_data(e);
|
get_data(e);
|
||||||
@@ -65,54 +73,57 @@ Taro.useLoad((e: any) => {
|
|||||||
|
|
||||||
const get_data = async ({ bid, oid }) => {
|
const get_data = async ({ bid, oid }) => {
|
||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: "加载中",
|
title: '加载中',
|
||||||
});
|
});
|
||||||
const res = await getAfterOrder({ bid, oid });
|
const res = await getAfterOrder({ bid, oid });
|
||||||
data.value = res.data.data;
|
data.value = res.data.data;
|
||||||
console.log(res);
|
|
||||||
Taro.hideLoading();
|
Taro.hideLoading();
|
||||||
};
|
};
|
||||||
|
|
||||||
const get_color = (status: number) => {
|
const get_color = (status: number) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return "#FD0100";
|
return '#FD0100';
|
||||||
case 1:
|
case 1:
|
||||||
return "#03A113";
|
return '#03A113';
|
||||||
case 2:
|
case 2:
|
||||||
return "#FFA938";
|
return '#FFA938';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const get_status_text = (status: number) => {
|
const get_status_text = (status: number) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return "未付款";
|
return '未付款';
|
||||||
case 1:
|
case 1:
|
||||||
return "已付款";
|
return '已付款';
|
||||||
case 2:
|
case 2:
|
||||||
return "挂帐中";
|
return '挂帐中';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const ok = async () => {
|
const ok = async () => {
|
||||||
if (!val.value)
|
if (!val.value)
|
||||||
return Taro.showToast({
|
return Taro.showToast({
|
||||||
title: "请输入收款金额",
|
title: '请输入收款金额',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
|
isLoading.value = true;
|
||||||
const res = await createPayQr({
|
const res = await createPayQr({
|
||||||
oid: data.value.oid,
|
oid: data.value.oid,
|
||||||
bid: data.value.bid,
|
bid: data.value.bid,
|
||||||
price: Number(val.value),
|
price: Number(val.value),
|
||||||
});
|
});
|
||||||
Taro.setStorageSync("pay_code", res.data.data.code_url);
|
Taro.setStorageSync('pay_code', res.data.data.code_url);
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/admin/add_order/pending_order/wx_pay_code/index?oid=${data.value.oid}&bid=${data.value.bid}`,
|
url: `/pages/admin/add_order/pending_order/wx_pay_code/index?oid=${data.value.oid}&bid=${data.value.bid}`,
|
||||||
|
success: () => {
|
||||||
|
isLoading.value = false;
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "订单详情",
|
navigationBarTitleText: '订单详情',
|
||||||
// navigationStyle: "custom",
|
// navigationStyle: "custom",
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -33,11 +33,13 @@
|
|||||||
height: 195px;
|
height: 195px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
min-width: 195px;
|
min-width: 195px;
|
||||||
|
margin-right: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
margin-left: 20px;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
.title {
|
.title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -54,7 +56,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.desc {
|
.desc {
|
||||||
padding: 10px 20px;
|
// padding: 10px 0px;
|
||||||
color: #666666;
|
color: #666666;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,4 +77,4 @@
|
|||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<view class="card" style="margin-top: 15px">
|
<view class="card" style="margin-top: 15px">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<view>
|
<view>
|
||||||
<text>台号: {{ data.seat }}</text>
|
<text class="text-[#9C9C9C]">台号: {{ data.seat }}</text>
|
||||||
<text>点单人: {{ data.PlaceUser?.nickName }}</text>
|
<!-- <text>点单人: {{ data.PlaceUser?.nickName }}</text> -->
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
:style="{
|
:style="{
|
||||||
@@ -24,17 +24,16 @@
|
|||||||
:content="itm.Goods.name"
|
:content="itm.Goods.name"
|
||||||
rows="3"
|
rows="3"
|
||||||
expand-text="展开"
|
expand-text="展开"
|
||||||
collapse-text="收起"
|
collapse-text="收起"></nut-ellipsis>
|
||||||
></nut-ellipsis>
|
|
||||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||||
</view>
|
</view>
|
||||||
<view class="num">
|
<view class="num">
|
||||||
<view>x{{ itm.pay_price }}</view>
|
<view>¥{{ itm.pay_price }}</view>
|
||||||
<view>x{{ itm.number }}</view>
|
<view>x{{ itm.number }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<!-- <view class="line"></view> -->
|
||||||
<Footer :info="data" @ok="get_data" />
|
<Footer :info="data" @ok="get_data" @cancelOrderOk="back" />
|
||||||
</view>
|
</view>
|
||||||
<nut-cell-group>
|
<nut-cell-group>
|
||||||
<nut-cell>
|
<nut-cell>
|
||||||
@@ -50,17 +49,14 @@
|
|||||||
<nut-cell
|
<nut-cell
|
||||||
v-if="data.status !== 0"
|
v-if="data.status !== 0"
|
||||||
title="收款时间"
|
title="收款时间"
|
||||||
:desc="data.payment_time"
|
:desc="data.payment_time"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
<nut-cell
|
<nut-cell
|
||||||
v-if="data.status !== 0 && data.status !== 1"
|
v-if="data.status !== 0 && data.status !== 1"
|
||||||
title="挂帐时间"
|
title="挂帐时间"
|
||||||
:desc="data.payment_time"
|
:desc="data.payment_time"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
<nut-cell
|
<nut-cell
|
||||||
title="订单状态"
|
title="订单状态"
|
||||||
:desc="get_status_text(data.status)"
|
:desc="get_status_text(data.status)"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
<nut-cell title="下单数量" :desc="String(data.count)"></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.payments)"></nut-cell>
|
<nut-cell title="应收金额" :desc="String(data.payments)"></nut-cell>
|
||||||
@@ -68,28 +64,25 @@
|
|||||||
<nut-cell
|
<nut-cell
|
||||||
v-if="data.status !== 0"
|
v-if="data.status !== 0"
|
||||||
title="实收金额"
|
title="实收金额"
|
||||||
:desc="String(data.pay_amount)"
|
:desc="String(data.pay_amount)"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
<nut-cell
|
<nut-cell
|
||||||
v-if="data.status !== 0"
|
v-if="data.status !== 0"
|
||||||
title="抹零"
|
title="抹零"
|
||||||
:desc="String(data.zero)"
|
:desc="String(data.zero)"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
<nut-cell
|
<nut-cell
|
||||||
v-if="data.status !== 0"
|
v-if="data.status !== 0"
|
||||||
title="收款方式"
|
title="收款方式"
|
||||||
desc="微信"
|
desc="微信"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
<nut-cell title="备注" :desc="data.notes"></nut-cell>
|
<nut-cell title="备注" :desc="data.notes"></nut-cell>
|
||||||
</nut-cell-group>
|
</nut-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import Footer from "../components/Footer.vue";
|
import Footer from '../components/Footer.vue';
|
||||||
import { getAfterOrder } from "@/api/admin";
|
import { getAfterOrder } from '@/api/admin';
|
||||||
// import BackComponent from "../../../../../components/Back.vue";
|
// import BackComponent from "../../../../../components/Back.vue";
|
||||||
|
|
||||||
const data = ref<any>({});
|
const data = ref<any>({});
|
||||||
@@ -103,7 +96,7 @@ Taro.useLoad((e: any) => {
|
|||||||
|
|
||||||
const get_data = async () => {
|
const get_data = async () => {
|
||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: "加载中",
|
title: '加载中',
|
||||||
});
|
});
|
||||||
const res = await getAfterOrder({
|
const res = await getAfterOrder({
|
||||||
bid: params.value.bid,
|
bid: params.value.bid,
|
||||||
@@ -116,26 +109,32 @@ const get_data = async () => {
|
|||||||
const get_color = (status: number) => {
|
const get_color = (status: number) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return "#FD0100";
|
return '#FD0100';
|
||||||
case 1:
|
case 1:
|
||||||
return "#03A113";
|
return '#03A113';
|
||||||
case 2:
|
case 2:
|
||||||
return "#FFA938";
|
return '#FFA938';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const get_status_text = (status: number) => {
|
const get_status_text = (status: number) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
return "未付款";
|
return '未付款';
|
||||||
case 1:
|
case 1:
|
||||||
return "已付款";
|
return '已付款';
|
||||||
case 2:
|
case 2:
|
||||||
return "挂帐中";
|
return '挂帐中';
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const back = () => {
|
||||||
|
Taro.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "收款码",
|
navigationBarTitleText: '收款码',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -21,18 +21,18 @@ page {
|
|||||||
|
|
||||||
.box {
|
.box {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background-image: url("../../static/ewm.png");
|
background-image: url('../../static/ewm.png');
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
width: 608px;
|
width: 608px;
|
||||||
height: 457px;
|
height: 457px;
|
||||||
position: relative;
|
position: relative;
|
||||||
image {
|
|
||||||
|
.img {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
height: 280px;
|
height: 280px;
|
||||||
top: 45%;
|
top: 66px;
|
||||||
left: 68%;
|
right: 55px;
|
||||||
transform: translate(-50%, -50%);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,39 +5,37 @@
|
|||||||
<view class="desc">请在这里扫码</view>
|
<view class="desc">请在这里扫码</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<image :src="`https://api.pwmqr.com/qrcode/create?url=${code}`"></image>
|
<image class="img" :src="dataUrl" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onUnmounted, ref } from "vue";
|
import { onUnmounted, ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { getAfterOrder } from "@/api/admin";
|
import { getAfterOrder } from '@/api/admin';
|
||||||
|
|
||||||
const code = ref("");
|
|
||||||
|
|
||||||
const time_id = ref();
|
const time_id = ref();
|
||||||
|
|
||||||
|
const dataUrl = ref('');
|
||||||
|
|
||||||
const info = ref<any>({});
|
const info = ref<any>({});
|
||||||
|
|
||||||
Taro.useLoad((e) => {
|
Taro.useLoad(e => {
|
||||||
info.value = e;
|
info.value = e;
|
||||||
console.log(e);
|
dataUrl.value = Taro.getStorageSync('pay_code');
|
||||||
code.value = Taro.getStorageSync("pay_code");
|
|
||||||
time_id.value = setInterval(async () => {
|
time_id.value = setInterval(async () => {
|
||||||
const { data } = await getAfterOrder({
|
const { data } = await getAfterOrder({
|
||||||
bid: info.value.bid,
|
bid: info.value.bid,
|
||||||
oid: info.value.oid,
|
oid: info.value.oid,
|
||||||
});
|
});
|
||||||
if (data.data.status !== 0 && data.data.status !== 2) {
|
if (data.data.status !== 0 && data.data.status !== 2) {
|
||||||
clearInterval(time_id.value);
|
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "支付成功",
|
title: '支付成功',
|
||||||
icon: "success",
|
icon: 'success',
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.removeStorageSync("pay_code");
|
Taro.removeStorageSync('pay_code');
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${info.value.oid}&bid=${info.value.bid}`,
|
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${info.value.oid}&bid=${info.value.bid}`,
|
||||||
});
|
});
|
||||||
@@ -48,13 +46,15 @@ Taro.useLoad((e) => {
|
|||||||
|
|
||||||
Taro.useDidHide(() => {
|
Taro.useDidHide(() => {
|
||||||
clearInterval(time_id.value);
|
clearInterval(time_id.value);
|
||||||
|
Taro.removeStorageSync('pay_code');
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(time_id.value);
|
clearInterval(time_id.value);
|
||||||
|
Taro.removeStorageSync('pay_code');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "订单详情",
|
navigationBarTitleText: '订单详情',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,71 +1,86 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="header">
|
<!-- 订单信息 -->
|
||||||
<view>订单号:{{ info.oid }}</view>
|
|
||||||
<view>{{ info.add_time }}</view>
|
|
||||||
</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="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-group>
|
||||||
<nut-cell title="订单状态:" :desc="orderStatus"></nut-cell>
|
<nut-cell>
|
||||||
|
<template #default>
|
||||||
|
<view class="center-box">
|
||||||
|
<view
|
||||||
|
class="top"
|
||||||
|
v-for="(item, index) in info.OrderGoods"
|
||||||
|
:key="index">
|
||||||
|
<image class="mr-10" :src="item.Goods?.cover" />
|
||||||
|
<view class="flex-1">
|
||||||
|
<view class="title">{{ item.Goods?.name }}</view>
|
||||||
|
<view class="text-[#F83D3D] mt-5">
|
||||||
|
<view
|
||||||
|
>{{ item.pay_price }}元
|
||||||
|
<text v-if="item.pay_integral > 0"
|
||||||
|
>+{{ item.pay_integral }}积分</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view>x{{ item.number }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="flex justify-between items-center mt-2 mb-2 text-[25px]">
|
||||||
|
<view class="text-[#9C9C9C]">{{ `共${info.count}件商品` }}</view>
|
||||||
|
<text class="text-[26px] flex-1 text-right"
|
||||||
|
>{{ info.status !== 0 ? '实' : '应' }}付款:
|
||||||
|
{{ info.discount_price }} (元)
|
||||||
|
<text v-if="info.exchange > 0"
|
||||||
|
>积分抵扣: {{ info.exchange }}</text
|
||||||
|
>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</nut-cell>
|
||||||
|
</nut-cell-group>
|
||||||
|
<nut-cell-group>
|
||||||
|
<nut-cell title="订单号:" :desc="info.oid"></nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="订单状态:"
|
||||||
|
:desc="
|
||||||
|
info.status === 0
|
||||||
|
? '待付款'
|
||||||
|
: info.status === 1
|
||||||
|
? '待使用'
|
||||||
|
: info.status === 2
|
||||||
|
? '已使用'
|
||||||
|
: '已失效'
|
||||||
|
">
|
||||||
|
</nut-cell>
|
||||||
<nut-cell title="下单用户:" :desc="info.User?.nickName"></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 title="核销时间:" :desc="info.User?.phone"></nut-cell>
|
<nut-cell title="下单时间:" :desc="info.add_time"></nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
v-if="info.status === 2"
|
||||||
|
title="核销时间:"
|
||||||
|
:desc="info.cancel_time"></nut-cell>
|
||||||
<nut-cell
|
<nut-cell
|
||||||
v-if="info.status === 2"
|
v-if="info.status === 2"
|
||||||
title="核销人员:"
|
title="核销人员:"
|
||||||
:desc="info.CancelUser?.nickName"
|
:desc="info.CancelUser?.nickName"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
<nut-cell
|
<nut-cell
|
||||||
v-if="info.status === 2"
|
v-if="info.status === 2"
|
||||||
title="核销人手机号:"
|
title="核销人手机号:"
|
||||||
:desc="info.CancelUser?.phone"
|
:desc="info.CancelUser?.phone"></nut-cell>
|
||||||
></nut-cell>
|
|
||||||
</nut-cell-group>
|
</nut-cell-group>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { computed, ref } from "vue";
|
import { ref } from 'vue';
|
||||||
|
|
||||||
const info = ref<any>({});
|
const info = ref<any>({});
|
||||||
|
|
||||||
Taro.useLoad(() => {
|
Taro.useLoad(() => {
|
||||||
info.value = Taro.getStorageSync("ver_order_info");
|
info.value = Taro.getStorageSync('ver_order_info');
|
||||||
console.log(info.value);
|
|
||||||
});
|
|
||||||
|
|
||||||
const orderStatus = computed(() => {
|
|
||||||
switch (info.value.status) {
|
|
||||||
case 1:
|
|
||||||
return "待核销";
|
|
||||||
case 2:
|
|
||||||
return "已核销";
|
|
||||||
case 3:
|
|
||||||
return "已失效";
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -148,6 +163,7 @@ page {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
// align-items: flex-start;
|
// align-items: flex-start;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
@@ -172,4 +188,41 @@ page {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.center-box {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
.top {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10rpx;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
border-radius: 10rpx;
|
||||||
|
margin-right: 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>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "订单管理",
|
navigationBarTitleText: '订单管理',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -62,4 +62,45 @@
|
|||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.pull-down {
|
||||||
|
margin: 20px auto;
|
||||||
|
.TriangleDownBox {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
transition: all 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.TriangleUpBox {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
transition: all 0.5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu {
|
||||||
|
.active {
|
||||||
|
border-radius: 10px;
|
||||||
|
background-color: #de1414;
|
||||||
|
padding: 10px 20px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.noActive {
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 10px 20px;
|
||||||
|
color: #000;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.MenuDownBox {
|
||||||
|
margin-top: 5px;
|
||||||
|
height: 0px;
|
||||||
|
transition: height 0.5s ease;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.MenuUpBox {
|
||||||
|
margin-top: 5px;
|
||||||
|
height: 80px;
|
||||||
|
transition: height 0.5s ease;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -25,6 +25,27 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="pull-down Card" style="background: none; padding: 0">
|
||||||
|
<view
|
||||||
|
class="mr-[5px] flex items-center justify-left"
|
||||||
|
@click="IsTriangleDown = !IsTriangleDown"
|
||||||
|
><text>数据筛选</text>
|
||||||
|
<TriangleDown
|
||||||
|
style="width: auto"
|
||||||
|
:class="[!IsTriangleDown ? 'TriangleDownBox' : 'TriangleUpBox']" />
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="flex menu justify-between text-[28px]"
|
||||||
|
:class="[!IsTriangleDown ? 'MenuDownBox' : 'MenuUpBox']">
|
||||||
|
<view
|
||||||
|
v-for="(item, index) in menus"
|
||||||
|
:key="index"
|
||||||
|
:class="[menuIndex === index ? 'active' : 'noActive']"
|
||||||
|
@click="tabChange(index)"
|
||||||
|
>{{ item.text }}</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="Card">
|
<view class="Card">
|
||||||
<view class="top"
|
<view class="top"
|
||||||
><text class="iconfont icon-shujutongji icon"></text
|
><text class="iconfont icon-shujutongji icon"></text
|
||||||
@@ -34,16 +55,14 @@
|
|||||||
<navigator
|
<navigator
|
||||||
class="item"
|
class="item"
|
||||||
hover-class="none"
|
hover-class="none"
|
||||||
:url="`/pages/admin/statistics/index?type=price&time=today`"
|
:url="`/pages/admin/statistics/index?type=price&time=today`">
|
||||||
>
|
|
||||||
<view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view>
|
<view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view>
|
||||||
<view class="sub">今日成交额</view>
|
<view class="sub">今日成交额</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator
|
<navigator
|
||||||
class="item"
|
class="item"
|
||||||
hover-class="none"
|
hover-class="none"
|
||||||
:url="`/pages/admin/statistics/index?type=price&time=yesterday`"
|
:url="`/pages/admin/statistics/index?type=price&time=yesterday`">
|
||||||
>
|
|
||||||
<view class="title">{{
|
<view class="title">{{
|
||||||
orderInfo?.total?.YesterdayNumber || 0
|
orderInfo?.total?.YesterdayNumber || 0
|
||||||
}}</view>
|
}}</view>
|
||||||
@@ -52,32 +71,28 @@
|
|||||||
<navigator
|
<navigator
|
||||||
class="item"
|
class="item"
|
||||||
hover-class="none"
|
hover-class="none"
|
||||||
:url="`/pages/admin/statistics/index?type=price&time=month`"
|
:url="`/pages/admin/statistics/index?type=price&time=month`">
|
||||||
>
|
|
||||||
<view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view>
|
<view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view>
|
||||||
<view class="sub">本月成交额</view>
|
<view class="sub">本月成交额</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator
|
<navigator
|
||||||
class="item"
|
class="item"
|
||||||
hover-class="none"
|
hover-class="none"
|
||||||
:url="`/pages/admin/statistics/index?type=order&time=today`"
|
:url="`/pages/admin/statistics/index?type=order&time=today`">
|
||||||
>
|
|
||||||
<view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view>
|
<view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view>
|
||||||
<view class="sub">今日订单数</view>
|
<view class="sub">今日订单数</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator
|
<navigator
|
||||||
class="item"
|
class="item"
|
||||||
hover-class="none"
|
hover-class="none"
|
||||||
:url="`/pages/admin/statistics/index?type=order&time=yesterday`"
|
:url="`/pages/admin/statistics/index?type=order&time=yesterday`">
|
||||||
>
|
|
||||||
<view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view>
|
<view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view>
|
||||||
<view class="sub">昨日订单数</view>
|
<view class="sub">昨日订单数</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
<navigator
|
<navigator
|
||||||
class="item"
|
class="item"
|
||||||
hover-class="none"
|
hover-class="none"
|
||||||
:url="`/pages/admin/statistics/index?type=order&time=month`"
|
:url="`/pages/admin/statistics/index?type=order&time=month`">
|
||||||
>
|
|
||||||
<view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view>
|
<view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view>
|
||||||
<view class="sub">本月订单数</view>
|
<view class="sub">本月订单数</view>
|
||||||
</navigator>
|
</navigator>
|
||||||
@@ -93,8 +108,7 @@
|
|||||||
:bordered="true"
|
:bordered="true"
|
||||||
class="table"
|
class="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="orderInfo?.list"
|
:data="orderInfo?.list"></nut-table>
|
||||||
></nut-table>
|
|
||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="暂无订单数据"></nut-empty>
|
<nut-empty v-else description="暂无订单数据"></nut-empty>
|
||||||
</view>
|
</view>
|
||||||
@@ -102,9 +116,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { h, ref } from "vue";
|
import { h, ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { orderStatistics } from "../../../api/admin";
|
import { TriangleDown } from '@nutui/icons-vue-taro';
|
||||||
|
import { orderStatistics } from '../../../api/admin';
|
||||||
|
|
||||||
Taro.useLoad(() => {
|
Taro.useLoad(() => {
|
||||||
getData();
|
getData();
|
||||||
@@ -112,39 +127,64 @@ Taro.useLoad(() => {
|
|||||||
|
|
||||||
const orderInfo = ref<any>({});
|
const orderInfo = ref<any>({});
|
||||||
|
|
||||||
|
const IsTriangleDown = ref(false);
|
||||||
|
|
||||||
|
const menuIndex = ref(0);
|
||||||
|
|
||||||
|
const menus = ref([
|
||||||
|
{
|
||||||
|
text: '微信支付',
|
||||||
|
value: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '平台积分',
|
||||||
|
value: 2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: '小猪积分',
|
||||||
|
value: 3,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
const tabChange = (value: number) => {
|
||||||
|
menuIndex.value = value;
|
||||||
|
getData();
|
||||||
|
};
|
||||||
|
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
title: "日期",
|
title: '日期',
|
||||||
key: "Date",
|
key: 'Date',
|
||||||
align: "center",
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "订单数",
|
title: '订单数',
|
||||||
key: "TotalCount",
|
key: 'TotalCount',
|
||||||
align: "center",
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "交易额",
|
title: '交易额',
|
||||||
key: "NumberSum",
|
key: 'NumberSum',
|
||||||
align: "center",
|
align: 'center',
|
||||||
render: (row) => {
|
render: row => {
|
||||||
return h(
|
return h(
|
||||||
"view",
|
'view',
|
||||||
{
|
{
|
||||||
style: {
|
style: {
|
||||||
color: "red",
|
color: 'red',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
row.NumberSum
|
row.NumberSum,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
const user_info = Taro.getStorageSync("userInfo");
|
const user_info = Taro.getStorageSync('userInfo');
|
||||||
const res = await orderStatistics({
|
const res = await orderStatistics({
|
||||||
bid: user_info.data.bid,
|
bid: user_info.data.bid,
|
||||||
|
pay_type: menus.value[menuIndex.value].value,
|
||||||
});
|
});
|
||||||
orderInfo.value = res.data;
|
orderInfo.value = res.data;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "订单列表",
|
navigationBarTitleText: '订单列表',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,29 +1,94 @@
|
|||||||
.tabs-1 {
|
.tabs-1 {
|
||||||
display: flex;
|
display: flex;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
justify-content: space-between;
|
justify-content: space-evenly;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
padding: 10px;
|
// padding: 10px;
|
||||||
overflow-x: scroll;
|
|
||||||
.item {
|
.item {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
.line {
|
.line {
|
||||||
margin-top: 10px auto;
|
margin: 10px auto;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 5px;
|
height: 8px;
|
||||||
|
border-radius: 15px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// .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;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
.order-card {
|
.order-card {
|
||||||
width: 95%;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin: 15px auto;
|
margin: 15px auto;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 10px;
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
|
|
||||||
.line {
|
.line {
|
||||||
@@ -34,18 +99,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.top {
|
.top {
|
||||||
// display: flex;
|
display: flex;
|
||||||
// justify-content: space-between;
|
justify-content: space-between;
|
||||||
// align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.name {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sub {
|
|
||||||
color: #999;
|
|
||||||
font-size: 30px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
@@ -55,19 +111,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
|
// margin-bottom: 10px;
|
||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
// justify-content: space-between;
|
||||||
// align-items: flex-start;
|
align-items: flex-start;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
height: 150px;
|
height: 150px;
|
||||||
border-radius: 10px;
|
border-radius: 15px;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
margin-left: 10px;
|
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
@@ -80,7 +137,8 @@
|
|||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
|
color: #9c9c9c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,15 +5,18 @@
|
|||||||
class="item"
|
class="item"
|
||||||
v-for="(item, index) in opt"
|
v-for="(item, index) in opt"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="tabChange(item.value)"
|
@click="tabChange(item.value)">
|
||||||
>
|
<view
|
||||||
<view>{{ item.text }}</view>
|
:style="{
|
||||||
|
color: item.value === tabVal ? '#333333' : '#9C9C9C',
|
||||||
|
}"
|
||||||
|
>{{ item.text }}</view
|
||||||
|
>
|
||||||
<view
|
<view
|
||||||
class="line"
|
class="line"
|
||||||
:style="{
|
:style="{
|
||||||
backgroundColor: item.value === tabVal ? 'red' : '',
|
backgroundColor: item.value === tabVal ? '#FFD940' : '',
|
||||||
}"
|
}"></view>
|
||||||
></view>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="dataList.length > 0">
|
<view v-if="dataList.length > 0">
|
||||||
@@ -21,73 +24,91 @@
|
|||||||
class="order-card"
|
class="order-card"
|
||||||
v-for="(item, index) in dataList"
|
v-for="(item, index) in dataList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="toDetailPage(item)"
|
@click="toDetailPage(item)">
|
||||||
>
|
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view class="name">订单号:{{ item.oid }}</view>
|
<view class="text-[#9C9C9C] text-[25px]">订单号:{{ item.oid }}</view>
|
||||||
<!-- <view class="sub">下单时间:{{ item.add_time }}</view> -->
|
<view
|
||||||
<view class="sub" v-if="item.status !== 3">核销时间:{{ item.cancel_time || "待核销" }}</view>
|
:style="{
|
||||||
<!-- <view style="color: red">{{
|
color:
|
||||||
item.status === 0
|
item.status === 0
|
||||||
? "待付款"
|
? '#FF850A'
|
||||||
: item.status === 1
|
: item.status === 1
|
||||||
? "待使用"
|
? '#F83D3D'
|
||||||
: item.status === 2
|
: item.status === 2
|
||||||
? "已使用"
|
? '#333333'
|
||||||
: "已失效"
|
: '#9C9C9C',
|
||||||
}}</view> -->
|
}"
|
||||||
|
>{{
|
||||||
|
item.status === 0
|
||||||
|
? '待付款'
|
||||||
|
: item.status === 1
|
||||||
|
? '待使用'
|
||||||
|
: item.status === 2
|
||||||
|
? '已使用'
|
||||||
|
: '已失效'
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="center" v-for="(itm, idx) in item.OrderGoods" :key="idx">
|
<view class="center" v-for="(itm, idx) in item.OrderGoods" :key="idx">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<image :src="itm.Goods.cover" />
|
<image class="mr-10" :src="itm.Goods.cover" />
|
||||||
<view class="title">{{ itm.Goods.name }} </view>
|
<view class="flex-1">
|
||||||
|
<view class="title">{{ itm.Goods?.name }}</view>
|
||||||
|
<view class="text-[#F83D3D] mt-5">
|
||||||
|
<view
|
||||||
|
>{{ itm.pay_price }}元
|
||||||
|
<text v-if="itm.pay_integral > 0"
|
||||||
|
>+{{ itm.pay_integral }}积分</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view v-if="item.pay_type === 1">{{ itm.pay_price }}元</view>
|
|
||||||
<view v-else>{{ itm.pay_integral }}积分</view>
|
|
||||||
<view>x{{ itm.number }}</view>
|
<view>x{{ itm.number }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view
|
||||||
<view class="bom" style="text-align: right">
|
class="flex justify-between items-center mt-2 mb-2 text-[25px]"
|
||||||
共{{ item.count }}件商品,支付方式:{{
|
v-if="item.status !== 0">
|
||||||
item.pay_type === 1 ? "微信" : "积分"
|
<text class="text-[#9C9C9C]">共{{ item.count }}件商品</text>
|
||||||
}},实付:
|
<text class="text-[26px] flex-1 text-right"
|
||||||
<text style="color: red">{{
|
>{{ item.status !== 0 ? '实' : '应' }}付款:
|
||||||
item.pay_type === 1 ? `${item.price}元` : `${item.exchange}积分`
|
{{ item.discount_price }} (元)
|
||||||
}}</text>
|
<text v-if="item.exchange > 0">积分抵扣: {{ item.exchange }}</text>
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="暂无订单数据"></nut-empty>
|
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { getActiveOrderList } from "../../../../api/admin";
|
import { getActiveOrderList } from '../../../../api/admin';
|
||||||
|
|
||||||
const opt = ref([
|
const opt = ref([
|
||||||
{
|
{
|
||||||
text: "全部",
|
text: '全部',
|
||||||
value: 0,
|
value: 0,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "待付款",
|
text: '待付款',
|
||||||
value: 1,
|
value: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "待核销",
|
text: '待核销',
|
||||||
value: 2,
|
value: 2,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "已核销",
|
text: '已核销',
|
||||||
value: 3,
|
value: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "已失效",
|
text: '已失效',
|
||||||
value: 4,
|
value: 4,
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
@@ -96,42 +117,64 @@ const tabVal = ref(0);
|
|||||||
|
|
||||||
const dataList = ref<any>([]);
|
const dataList = ref<any>([]);
|
||||||
|
|
||||||
Taro.useLoad((options) => {
|
const pageOpt = ref({
|
||||||
|
page: 1,
|
||||||
|
total: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
Taro.useLoad(options => {
|
||||||
tabVal.value = Number(options.type);
|
tabVal.value = Number(options.type);
|
||||||
getData();
|
getData();
|
||||||
});
|
});
|
||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
});
|
||||||
try {
|
try {
|
||||||
const user_info = Taro.getStorageSync("userInfo");
|
const user_info = Taro.getStorageSync('userInfo');
|
||||||
const data = {
|
const data = {
|
||||||
bid: user_info.data.bid,
|
bid: user_info.data.bid,
|
||||||
status: tabVal.value,
|
status: tabVal.value,
|
||||||
|
PageNum: pageOpt.value.page,
|
||||||
|
PageSize: 10,
|
||||||
};
|
};
|
||||||
const res = await getActiveOrderList(data);
|
const res = await getActiveOrderList(data);
|
||||||
dataList.value = res.data.data;
|
dataList.value.push(...res.data.data);
|
||||||
|
pageOpt.value.total = res.data.total || 0;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Taro.hideLoading();
|
||||||
};
|
};
|
||||||
|
|
||||||
const tabChange = (e: number) => {
|
const tabChange = (e: number) => {
|
||||||
console.log(e);
|
|
||||||
tabVal.value = e;
|
tabVal.value = e;
|
||||||
|
dataList.value = [];
|
||||||
getData();
|
getData();
|
||||||
};
|
};
|
||||||
|
|
||||||
const toDetailPage = (item: any) => {
|
const toDetailPage = (item: any) => {
|
||||||
Taro.setStorageSync("ver_order_info", item);
|
Taro.setStorageSync('ver_order_info', item);
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/pages/admin/order_manage/detail/index",
|
url: '/pages/admin/order_manage/detail/index',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Taro.useReachBottom(() => {
|
||||||
|
if (pageOpt.value.total >= dataList.value.length)
|
||||||
|
return Taro.showToast({
|
||||||
|
title: '没有更多数据了',
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
pageOpt.value.page++;
|
||||||
|
getData();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "./index.scss";
|
@import './index.scss';
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "订单数据统计",
|
navigationBarTitleText: '订单数据统计',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,62 +5,66 @@
|
|||||||
<view
|
<view
|
||||||
class="item"
|
class="item"
|
||||||
:class="time == 'today' ? 'on' : ''"
|
:class="time == 'today' ? 'on' : ''"
|
||||||
@click="setTime('today')"
|
@click="setTime('today')">
|
||||||
>
|
|
||||||
今天
|
今天
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="item"
|
class="item"
|
||||||
:class="time == 'yesterday' ? 'on' : ''"
|
:class="time == 'yesterday' ? 'on' : ''"
|
||||||
@click="setTime('yesterday')"
|
@click="setTime('yesterday')">
|
||||||
>
|
|
||||||
昨天
|
昨天
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="item"
|
class="item"
|
||||||
:class="time == 'seven' ? 'on' : ''"
|
:class="time == 'seven' ? 'on' : ''"
|
||||||
@click="setTime('seven')"
|
@click="setTime('seven')">
|
||||||
>
|
|
||||||
最近7天
|
最近7天
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="item"
|
class="item"
|
||||||
:class="time == 'month' ? 'on' : ''"
|
:class="time == 'month' ? 'on' : ''"
|
||||||
@click="setTime('month')"
|
@click="setTime('month')">
|
||||||
>
|
|
||||||
本月
|
本月
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="item"
|
class="item"
|
||||||
:class="time == 'date' ? 'on' : ''"
|
:class="time == 'date' ? 'on' : ''"
|
||||||
@click="dateTitle"
|
@click="dateTitle">
|
||||||
>
|
|
||||||
自定义
|
自定义
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="wrapper">
|
<view class="wrapper">
|
||||||
<view class="title">
|
<view class="flex justify-between">
|
||||||
{{ title }}{{ where.type == 1 ? "营业额" : "订单量" }}
|
<view>
|
||||||
|
<view class="title">
|
||||||
|
{{ title }}{{ where.type == 1 ? '营业额' : '订单量' }}
|
||||||
|
</view>
|
||||||
|
<view v-if="where.type == 1" class="money">{{
|
||||||
|
dataObj.all || 0
|
||||||
|
}}</view>
|
||||||
|
<view v-else class="money">{{ dataObj.all || 0 }}</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="title"> {{ title }}现金部分 </view>
|
||||||
|
<view class="money">{{ dataObj.all_discount }}</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="where.type == 1" class="money">{{ dataObj.all || 0 }}</view>
|
|
||||||
<view v-else class="money">{{ dataObj.all || 0 }}</view>
|
|
||||||
<view class="increase">
|
<view class="increase">
|
||||||
<view>
|
<view>
|
||||||
{{ time === "date" ? "" : title }}增长率:<text
|
{{ time === 'date' ? '' : title }}增长率:<text
|
||||||
:class="dataObj.growthRate >= 0 ? 'red' : 'green'"
|
:class="dataObj.growthRate >= 0 ? 'red' : 'green'">
|
||||||
>
|
|
||||||
{{ dataObj.growthRate }}%
|
{{ dataObj.growthRate }}%
|
||||||
<text
|
<text
|
||||||
class="iconfont"
|
class="iconfont"
|
||||||
:class="
|
:class="
|
||||||
dataObj.growthRate >= 0 ? 'icon-xiangshang1' : 'icon-xiangxia2'
|
dataObj.growthRate >= 0 ? 'icon-xiangshang1' : 'icon-xiangxia2'
|
||||||
"
|
"></text
|
||||||
></text
|
|
||||||
></text>
|
></text>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view>
|
||||||
{{ time === "date" ? "" : title }}增长:<text
|
{{ time === 'date' ? '' : title }}增长:<text
|
||||||
:class="dataObj.growthNumber >= 0 ? 'red' : 'green'"
|
:class="dataObj.growthNumber >= 0 ? 'red' : 'green'"
|
||||||
>{{ dataObj.growthNumber }}
|
>{{ dataObj.growthNumber }}
|
||||||
<text
|
<text
|
||||||
@@ -69,8 +73,7 @@
|
|||||||
dataObj.growthNumber >= 0
|
dataObj.growthNumber >= 0
|
||||||
? 'icon-xiangshang1'
|
? 'icon-xiangshang1'
|
||||||
: 'icon-xiangxia2'
|
: 'icon-xiangxia2'
|
||||||
"
|
"></text
|
||||||
></text
|
|
||||||
></text>
|
></text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -82,8 +85,7 @@
|
|||||||
:ontouch="true"
|
:ontouch="true"
|
||||||
@touchstart="touchStart"
|
@touchstart="touchStart"
|
||||||
@touchmove="touchMove"
|
@touchmove="touchMove"
|
||||||
@touchend="touchEnd"
|
@touchend="touchEnd" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="Card">
|
<view class="Card">
|
||||||
@@ -96,8 +98,7 @@
|
|||||||
:bordered="true"
|
:bordered="true"
|
||||||
class="table"
|
class="table"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="dataObj?.list"
|
:data="dataObj?.list"></nut-table>
|
||||||
></nut-table>
|
|
||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="暂无订单数据"></nut-empty>
|
<nut-empty v-else description="暂无订单数据"></nut-empty>
|
||||||
</view>
|
</view>
|
||||||
@@ -106,22 +107,22 @@
|
|||||||
<nut-calendar
|
<nut-calendar
|
||||||
v-model:visible="isVisible"
|
v-model:visible="isVisible"
|
||||||
type="range"
|
type="range"
|
||||||
|
:default-value="pickerVal"
|
||||||
:start-date="date_start"
|
:start-date="date_start"
|
||||||
@close="isVisible = false"
|
@close="isVisible = false"
|
||||||
@choose="setChooseValue"
|
@choose="setChooseValue">
|
||||||
>
|
|
||||||
</nut-calendar>
|
</nut-calendar>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed, h } from "vue";
|
import { ref, computed, h } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { growthRate } from "../../../api/admin";
|
import { growthRate } from '../../../api/admin';
|
||||||
import dayjs from "dayjs";
|
import dayjs from 'dayjs';
|
||||||
import uCharts from "../../../utils/js_sdk/u-charts.min.js";
|
import uCharts from '../../../utils/js_sdk/u-charts.min.js';
|
||||||
|
|
||||||
const time = ref("");
|
const time = ref('');
|
||||||
|
|
||||||
const isVisible = ref(false);
|
const isVisible = ref(false);
|
||||||
|
|
||||||
@@ -137,44 +138,44 @@ const chartWH = ref({
|
|||||||
|
|
||||||
const columns = ref([
|
const columns = ref([
|
||||||
{
|
{
|
||||||
title: "日期",
|
title: '日期',
|
||||||
key: "Date",
|
key: 'Date',
|
||||||
align: "center",
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "订单数",
|
title: '订单数',
|
||||||
key: "TotalCount",
|
key: 'TotalCount',
|
||||||
align: "center",
|
align: 'center',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "交易额",
|
title: '交易额',
|
||||||
key: "NumberSum",
|
key: 'NumberSum',
|
||||||
align: "center",
|
align: 'center',
|
||||||
render: (row) => {
|
render: row => {
|
||||||
return h(
|
return h(
|
||||||
"view",
|
'view',
|
||||||
{
|
{
|
||||||
style: {
|
style: {
|
||||||
color: "red",
|
color: 'red',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
row.NumberSum
|
row.NumberSum,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const date_start = computed(() => {
|
const date_start = computed(() => {
|
||||||
return dayjs().startOf("year").format("YYYY-MM-DD");
|
return dayjs().startOf('year').format('YYYY-MM-DD');
|
||||||
});
|
});
|
||||||
|
|
||||||
const title = ref("");
|
const title = ref('');
|
||||||
|
|
||||||
const where = ref({
|
const where = ref({
|
||||||
type: 1,
|
type: 1,
|
||||||
status: 2,
|
status: 2,
|
||||||
start: "",
|
start: '',
|
||||||
end: "",
|
end: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const dataObj = ref<any>({});
|
const dataObj = ref<any>({});
|
||||||
@@ -183,49 +184,55 @@ const opts = ref<any>({
|
|||||||
categories: [],
|
categories: [],
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: "营业额",
|
name: '营业额',
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "订单量",
|
name: '订单量',
|
||||||
data: [],
|
data: [],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
Taro.useLoad((options) => {
|
const pickerVal = ref<any>([]);
|
||||||
where.value.type = options.type === "price" ? 1 : 2;
|
|
||||||
|
Taro.useLoad(options => {
|
||||||
|
where.value.type = options.type === 'price' ? 1 : 2;
|
||||||
time.value = options.time;
|
time.value = options.time;
|
||||||
setTime(options.time);
|
setTime(options.time);
|
||||||
// getData();
|
// getData();
|
||||||
|
pickerVal.value = [
|
||||||
|
dayjs().format('YYYY-MM-DD'),
|
||||||
|
dayjs().format('YYYY-MM-DD'),
|
||||||
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
const setTime = (type: string) => {
|
const setTime = (type: string) => {
|
||||||
time.value = type;
|
time.value = type;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "today":
|
case 'today':
|
||||||
title.value = "今日";
|
title.value = '今日';
|
||||||
where.value.status = 2;
|
where.value.status = 2;
|
||||||
where.value.start = dayjs().format("YYYY-MM-DD");
|
where.value.start = dayjs().format('YYYY-MM-DD');
|
||||||
where.value.end = dayjs().format("YYYY-MM-DD");
|
where.value.end = dayjs().format('YYYY-MM-DD');
|
||||||
break;
|
break;
|
||||||
case "yesterday":
|
case 'yesterday':
|
||||||
title.value = "昨日";
|
title.value = '昨日';
|
||||||
where.value.status = 2;
|
where.value.status = 2;
|
||||||
where.value.start = dayjs().add(-1, "day").format("YYYY-MM-DD");
|
where.value.start = dayjs().add(-1, 'day').format('YYYY-MM-DD');
|
||||||
where.value.end = dayjs().add(-1, "day").format("YYYY-MM-DD");
|
where.value.end = dayjs().add(-1, 'day').format('YYYY-MM-DD');
|
||||||
break;
|
break;
|
||||||
case "seven":
|
case 'seven':
|
||||||
title.value = "7天";
|
title.value = '7天';
|
||||||
where.value.status = 2;
|
where.value.status = 2;
|
||||||
where.value.start = dayjs().add(-6, "day").format("YYYY-MM-DD");
|
where.value.start = dayjs().add(-6, 'day').format('YYYY-MM-DD');
|
||||||
where.value.end = dayjs().format("YYYY-MM-DD");
|
where.value.end = dayjs().format('YYYY-MM-DD');
|
||||||
break;
|
break;
|
||||||
case "month":
|
case 'month':
|
||||||
title.value = "本月";
|
title.value = '本月';
|
||||||
where.value.status = 1;
|
where.value.status = 1;
|
||||||
where.value.start = dayjs().startOf("month").format("YYYY-MM-DD");
|
where.value.start = dayjs().startOf('month').format('YYYY-MM-DD');
|
||||||
where.value.end = dayjs().format("YYYY-MM-DD");
|
where.value.end = dayjs().format('YYYY-MM-DD');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
getData();
|
getData();
|
||||||
@@ -233,7 +240,7 @@ const setTime = (type: string) => {
|
|||||||
|
|
||||||
const dateTitle = () => {
|
const dateTitle = () => {
|
||||||
where.value.status = 1;
|
where.value.status = 1;
|
||||||
time.value = "date";
|
time.value = 'date';
|
||||||
isVisible.value = true;
|
isVisible.value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -246,7 +253,7 @@ const setChooseValue = (ref: any) => {
|
|||||||
|
|
||||||
const getData = async () => {
|
const getData = async () => {
|
||||||
try {
|
try {
|
||||||
const user_info = Taro.getStorageSync("userInfo");
|
const user_info = Taro.getStorageSync('userInfo');
|
||||||
const res = await growthRate({
|
const res = await growthRate({
|
||||||
bid: user_info.data.bid,
|
bid: user_info.data.bid,
|
||||||
status: where.value.status,
|
status: where.value.status,
|
||||||
@@ -266,16 +273,16 @@ const getData = async () => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const create_canvas = () => {
|
const create_canvas = () => {
|
||||||
const ctx = Taro.createCanvasContext("myChart");
|
const ctx = Taro.createCanvasContext('myChart');
|
||||||
canvas_obj = new uCharts({
|
canvas_obj = new uCharts({
|
||||||
type: "column",
|
type: 'column',
|
||||||
context: ctx,
|
context: ctx,
|
||||||
width: chartWH.value.width,
|
width: chartWH.value.width,
|
||||||
height: chartWH.value.height,
|
height: chartWH.value.height,
|
||||||
@@ -283,17 +290,17 @@ const create_canvas = () => {
|
|||||||
series: opts.value.series,
|
series: opts.value.series,
|
||||||
pixelRatio: chartWH.value.pixelRatio,
|
pixelRatio: chartWH.value.pixelRatio,
|
||||||
animation: true,
|
animation: true,
|
||||||
background: "#FFFFFF",
|
background: '#FFFFFF',
|
||||||
color: [
|
color: [
|
||||||
"#1890FF",
|
'#1890FF',
|
||||||
"#91CB74",
|
'#91CB74',
|
||||||
"#FAC858",
|
'#FAC858',
|
||||||
"#EE6666",
|
'#EE6666',
|
||||||
"#73C0DE",
|
'#73C0DE',
|
||||||
"#3CA272",
|
'#3CA272',
|
||||||
"#FC8452",
|
'#FC8452',
|
||||||
"#9A60B4",
|
'#9A60B4',
|
||||||
"#ea7ccc",
|
'#ea7ccc',
|
||||||
],
|
],
|
||||||
padding: [15, 15, 0, 15],
|
padding: [15, 15, 0, 15],
|
||||||
enableScroll: true,
|
enableScroll: true,
|
||||||
@@ -312,9 +319,9 @@ const create_canvas = () => {
|
|||||||
},
|
},
|
||||||
extra: {
|
extra: {
|
||||||
column: {
|
column: {
|
||||||
type: "group",
|
type: 'group',
|
||||||
width: 20,
|
width: 20,
|
||||||
activeBgColor: "#000000",
|
activeBgColor: '#000000',
|
||||||
activeBgOpacity: 0.08,
|
activeBgOpacity: 0.08,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -324,7 +331,7 @@ const create_canvas = () => {
|
|||||||
const touchStart = (e: any) => {
|
const touchStart = (e: any) => {
|
||||||
canvas_obj.showToolTip(e, {
|
canvas_obj.showToolTip(e, {
|
||||||
format: function (item: any, category: any) {
|
format: function (item: any, category: any) {
|
||||||
return category + " " + item.name + ":" + item.data;
|
return category + ' ' + item.name + ':' + item.data;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
canvas_obj.scrollStart(e);
|
canvas_obj.scrollStart(e);
|
||||||
@@ -399,6 +406,7 @@ const touchEnd = (e: any) => {
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.red {
|
.red {
|
||||||
color: #ff6969;
|
color: #ff6969;
|
||||||
}
|
}
|
||||||
@@ -406,6 +414,7 @@ const touchEnd = (e: any) => {
|
|||||||
.green {
|
.green {
|
||||||
color: #1abb1d;
|
color: #1abb1d;
|
||||||
}
|
}
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
font-size: 23px;
|
font-size: 23px;
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
@@ -432,6 +441,7 @@ const touchEnd = (e: any) => {
|
|||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
text {
|
text {
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
@@ -440,6 +450,7 @@ const touchEnd = (e: any) => {
|
|||||||
color: #fa2c19;
|
color: #fa2c19;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "订单核销",
|
navigationBarTitleText: '订单核销',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,13 +1,89 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<nut-button block type="primary" @click="scanCode">扫码核销</nut-button>
|
<image
|
||||||
|
class="image"
|
||||||
|
@tap="scanCode"
|
||||||
|
src="https://p1.meituan.net/csc/696924dda634f05689dabdfbb18e88cc13551.png" />
|
||||||
|
<view class="mt-2 text-[#7A7A7A]">扫描二维码核销</view>
|
||||||
|
</view>
|
||||||
|
<view class="bg-white p-2">
|
||||||
|
<view class="mt-2 text-center text-[#7A7A7A]">最近核销记录</view>
|
||||||
|
<view v-if="list.length > 0">
|
||||||
|
<view
|
||||||
|
class="order-card"
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
@click="toDetailPage(item)">
|
||||||
|
<view class="top">
|
||||||
|
<view class="text-[#9C9C9C] text-[25px]"
|
||||||
|
>订单号:{{ item.oid }}</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
:style="{
|
||||||
|
color:
|
||||||
|
item.status === 0
|
||||||
|
? '#FF850A'
|
||||||
|
: item.status === 1
|
||||||
|
? '#F83D3D'
|
||||||
|
: item.status === 2
|
||||||
|
? '#333333'
|
||||||
|
: '#9C9C9C',
|
||||||
|
}"
|
||||||
|
>{{
|
||||||
|
item.status === 0
|
||||||
|
? '待付款'
|
||||||
|
: item.status === 1
|
||||||
|
? '待使用'
|
||||||
|
: item.status === 2
|
||||||
|
? '已使用'
|
||||||
|
: '已失效'
|
||||||
|
}}
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="line"></view>
|
||||||
|
<view class="center" v-for="(itm, idx) in item.OrderGoods" :key="idx">
|
||||||
|
<view class="top">
|
||||||
|
<image class="mr-10" :src="itm.Goods.cover" />
|
||||||
|
<view class="flex-1">
|
||||||
|
<view class="title">{{ itm.Goods?.name }}</view>
|
||||||
|
<view class="text-[#F83D3D] mt-5">
|
||||||
|
<view
|
||||||
|
>{{ itm.pay_price }}元
|
||||||
|
<text v-if="itm.pay_integral > 0"
|
||||||
|
>+{{ itm.pay_integral }}积分</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view>x{{ itm.number }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view
|
||||||
|
class="flex justify-between items-center mt-2 mb-2 text-[25px]"
|
||||||
|
v-if="item.status !== 0">
|
||||||
|
<text class="text-[#9C9C9C]">共{{ item.count }}件商品</text>
|
||||||
|
<text class="text-[26px] flex-1 text-right"
|
||||||
|
>{{ item.status !== 0 ? '实' : '应' }}付款:
|
||||||
|
{{ item.discount_price }} (元)
|
||||||
|
<text v-if="item.exchange > 0"
|
||||||
|
>积分抵扣: {{ item.exchange }}</text
|
||||||
|
>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<nut-empty v-else description="暂无数据"></nut-empty>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
|
import { getActiveOrderList } from '@/api/admin';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
// url参数转对象
|
// url参数转对象
|
||||||
// const urlParse = (url: string) => {
|
// const urlParse = (url: string) => {
|
||||||
@@ -28,8 +104,8 @@ import Taro from "@tarojs/taro";
|
|||||||
const scanCode = () => {
|
const scanCode = () => {
|
||||||
Taro.scanCode({
|
Taro.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ["qrCode"],
|
scanType: ['qrCode'],
|
||||||
success: async (res) => {
|
success: async res => {
|
||||||
try {
|
try {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/admin/verify/verify_list/index?oid=${res.result}`,
|
url: `/pages/admin/verify/verify_list/index?oid=${res.result}`,
|
||||||
@@ -37,32 +113,126 @@ const scanCode = () => {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Taro.useLoad(() => {
|
||||||
|
getListOne();
|
||||||
|
});
|
||||||
|
|
||||||
|
const list = ref<any[]>([]);
|
||||||
|
|
||||||
|
const getListOne = async () => {
|
||||||
|
try {
|
||||||
|
const { data } = Taro.getStorageSync('userInfo');
|
||||||
|
const res = await getActiveOrderList({
|
||||||
|
PageNum: 1,
|
||||||
|
PageSize: 1,
|
||||||
|
bid: data.bid,
|
||||||
|
status: 0,
|
||||||
|
});
|
||||||
|
list.value = [res.data.data[0]];
|
||||||
|
|
||||||
|
console.log(list.value);
|
||||||
|
} catch (error) {
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const toDetailPage = (item: any) => {
|
||||||
|
Taro.setStorageSync('ver_order_info', item);
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/admin/order_manage/detail/index',
|
||||||
|
});
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
background-image: url("~@/static/admin/cancellation-header.png");
|
background-image: url('https://p0.meituan.net/csc/e6ff5582788af2023f49241afe22fc89391851.png');
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% 30%;
|
background-size: 100% 25%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
width: 80%;
|
width: 690px;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin: 300px auto;
|
margin: 300px auto 50px auto;
|
||||||
border-radius: 10px;
|
border-radius: 33px;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
padding: 0 100px;
|
padding: 0 100px;
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.order-card {
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 15px auto;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
// margin-bottom: 10px;
|
||||||
|
.top {
|
||||||
|
display: flex;
|
||||||
|
// justify-content: space-between;
|
||||||
|
align-items: flex-start;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
border-radius: 15px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
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;
|
||||||
|
color: #9c9c9c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "核销列表",
|
navigationBarTitleText: '核销列表',
|
||||||
});
|
});
|
||||||
|
|||||||
38
src/pages/admin/verify/verify_list/index.scss
Normal file
38
src/pages/admin/verify/verify_list/index.scss
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
.card {
|
||||||
|
padding: 20rpx;
|
||||||
|
background-color: #fff;
|
||||||
|
margin: 20px auto;
|
||||||
|
|
||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
border-radius: 15px;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.nut-button {
|
||||||
|
border-radius: 20px;
|
||||||
|
}
|
||||||
@@ -1,49 +1,70 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<view class="card">
|
<view class="card">
|
||||||
<view>订单号:{{ goodInfo.oid }}</view>
|
<view class="text-[#7A7A7A]">订单号:{{ goodInfo.oid }}</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view
|
<view
|
||||||
class="container"
|
class="container"
|
||||||
v-for="(item, index) in goodInfo.OrderGoods"
|
v-for="(item, index) in goodInfo.OrderGoods"
|
||||||
:key="index"
|
:key="index">
|
||||||
>
|
<image class="image" :src="item.Goods.cover"></image>
|
||||||
<image class="image" :src="item.Goods.cover" mode="widthFix"></image>
|
|
||||||
<view class="info">
|
<view class="info">
|
||||||
<view class="title">商品名称:{{ item.Goods.name }}</view>
|
<view class="title">{{ item.Goods.name }}</view>
|
||||||
<view class="title">描述:{{ item.Goods.profile }}</view>
|
<view class="text-[#7A7A7A] text-[22px]">{{
|
||||||
<view class="num"
|
item.Goods.profile || '此商品暂无描述'
|
||||||
>数量: <text style="color: red">{{ item.number }}</text></view
|
}}</view>
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<view></view>
|
<view class="text-[#9C9C9C]">x{{ item.number }}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<text>支付方式:{{ goodInfo.pay_type === 1 ? "微信" : "积分" }}</text
|
<view
|
||||||
>,
|
class="flex justify-between items-center mt-3 mb-2 text-[25px]"
|
||||||
<text
|
style="text-align: right">
|
||||||
>总计:{{
|
<text class="text-[#9C9C9C] text-left"
|
||||||
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
|
>共{{ goodInfo.count }}件商品</text
|
||||||
}}</text
|
>
|
||||||
>
|
<text class="text-[26px] flex-1"
|
||||||
<view class="line"></view>
|
>实付款: {{ goodInfo.discount_price }} (元)
|
||||||
<view class="cz">
|
<text v-if="goodInfo.exchange > 0"
|
||||||
|
>积分抵扣: {{ goodInfo.exchange }}</text
|
||||||
|
>
|
||||||
|
</text>
|
||||||
|
</view>
|
||||||
|
<!-- <view class="line"></view> -->
|
||||||
|
<!-- <view class="cz">
|
||||||
<nut-button size="small" type="primary" @click="subVerify"
|
<nut-button size="small" type="primary" @click="subVerify"
|
||||||
>确定核销</nut-button
|
>确定核销</nut-button
|
||||||
>
|
>
|
||||||
</view>
|
</view> -->
|
||||||
|
</view>
|
||||||
|
<nut-cell-group>
|
||||||
|
<nut-cell title="订单信息"></nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="下单时间:"
|
||||||
|
:desc="goodInfo.add_time?.slice(0, 19)"></nut-cell>
|
||||||
|
<nut-cell title="下单号码:" :desc="goodInfo.User?.phone"></nut-cell>
|
||||||
|
<nut-cell title="下单用户:" :desc="goodInfo.User?.nickName"></nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="付款方式:"
|
||||||
|
:desc="getPayType(goodInfo.pay_type)"></nut-cell>
|
||||||
|
</nut-cell-group>
|
||||||
|
|
||||||
|
<view class="w-[90%] mt-[40px] m-auto">
|
||||||
|
<nut-button type="primary" shape="square" block @click="subVerify"
|
||||||
|
>确定核销</nut-button
|
||||||
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { getActiveVerifyList, activeOrderVerify } from "@/api/admin";
|
import { getActiveVerifyList, activeOrderVerify } from '@/api/admin';
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
|
|
||||||
const opt = ref<any>({});
|
const opt = ref<any>({});
|
||||||
|
|
||||||
Taro.useLoad((options) => {
|
Taro.useLoad(options => {
|
||||||
opt.value = options;
|
opt.value = options;
|
||||||
getData(options);
|
getData(options);
|
||||||
});
|
});
|
||||||
@@ -51,15 +72,15 @@ Taro.useLoad((options) => {
|
|||||||
const goodInfo = ref<any>({});
|
const goodInfo = ref<any>({});
|
||||||
|
|
||||||
const getData = async (options: any) => {
|
const getData = async (options: any) => {
|
||||||
const merInfo = Taro.getStorageSync("mer_info");
|
const merInfo = Taro.getStorageSync('userInfo');
|
||||||
const res = await getActiveVerifyList({
|
const res = await getActiveVerifyList({
|
||||||
oid: options.oid,
|
oid: options.oid,
|
||||||
bid: merInfo.bid,
|
bid: merInfo.data.bid,
|
||||||
});
|
});
|
||||||
if (!res.data.data.oid) {
|
if (!res.data.data.oid) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "没有此订单",
|
title: '没有此订单',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.navigateBack({
|
Taro.navigateBack({
|
||||||
@@ -74,62 +95,48 @@ const subVerify = async () => {
|
|||||||
try {
|
try {
|
||||||
const res = await activeOrderVerify({
|
const res = await activeOrderVerify({
|
||||||
oid: goodInfo.value.oid,
|
oid: goodInfo.value.oid,
|
||||||
|
bid: goodInfo.value.bid,
|
||||||
});
|
});
|
||||||
Taro.showToast({
|
//Taro.showToast({
|
||||||
title: res.msg,
|
// title: res.msg,
|
||||||
icon: "none",
|
// icon: 'none',
|
||||||
|
//});
|
||||||
|
Taro.showModal({
|
||||||
|
title: '核销成功',
|
||||||
|
content: res.msg,
|
||||||
|
success: () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.navigateBack({
|
||||||
|
delta: 1,
|
||||||
|
});
|
||||||
|
}, 3000);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
|
||||||
Taro.navigateBack({
|
|
||||||
delta: 1,
|
|
||||||
});
|
|
||||||
}, 3000);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: error.msg,
|
title: error.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const getPayType = (type: number) => {
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
|
return '微信线上支付';
|
||||||
|
case 2:
|
||||||
|
return '平台积分支付';
|
||||||
|
case 3:
|
||||||
|
return '智多鑫积分支付';
|
||||||
|
case 3:
|
||||||
|
return '渔乐潮玩支付';
|
||||||
|
default:
|
||||||
|
return '未知';
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.card {
|
@import './index.scss';
|
||||||
padding: 20rpx;
|
|
||||||
background-color: #fff;
|
|
||||||
margin: 10px auto;
|
|
||||||
width: 90%;
|
|
||||||
border-radius: 7px;
|
|
||||||
|
|
||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
|
|
||||||
image {
|
|
||||||
width: 150rpx;
|
|
||||||
height: 150rpx;
|
|
||||||
border-radius: 7px;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.info {
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.line {
|
|
||||||
width: 100%;
|
|
||||||
height: 1px;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
margin: 10px 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.cz {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "收益提现",
|
navigationBarTitleText: '余额提现',
|
||||||
|
enablePullDownRefresh: true,
|
||||||
});
|
});
|
||||||
|
|||||||
125
src/pages/admin/withdrawal/index.scss
Normal file
125
src/pages/admin/withdrawal/index.scss
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
.text-red {
|
||||||
|
color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 10px;
|
||||||
|
|
||||||
|
.pagination {
|
||||||
|
margin: 10px auto;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
width: 100%;
|
||||||
|
padding: 5px 8px;
|
||||||
|
color: white;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.success {
|
||||||
|
color: #4fc08d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.danger {
|
||||||
|
color: #df3526;
|
||||||
|
}
|
||||||
|
|
||||||
|
.warning {
|
||||||
|
color: #f3812e;
|
||||||
|
}
|
||||||
|
|
||||||
|
.image {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
margin: 20px auto;
|
||||||
|
background-image: url('https://p0.meituan.net/csc/902ecf4ba9765a8200817d58a3a5a655172781.png');
|
||||||
|
background-size: 100% 100%;
|
||||||
|
width: 95%;
|
||||||
|
height: 250px;
|
||||||
|
border-radius: 15px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.container {
|
||||||
|
color: #fff;
|
||||||
|
padding: 45px 100px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 1px;
|
||||||
|
height: 50px;
|
||||||
|
background-color: #ff9c9c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
color: #8a1717;
|
||||||
|
border-bottom-left-radius: 15px;
|
||||||
|
border-bottom-right-radius: 15px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.2);
|
||||||
|
padding: 10px 30px;
|
||||||
|
height: 150px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.formCard {
|
||||||
|
width: 95%;
|
||||||
|
margin: auto;
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
|
--nut-cell-box-shadow: none;
|
||||||
|
--nut-cell-padding: 10px 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nut-button {
|
||||||
|
border-radius: 20px;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin: 20px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.title-line {
|
||||||
|
width: 8px;
|
||||||
|
height: 35px;
|
||||||
|
background-color: #df3526;
|
||||||
|
border-radius: 20px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.list {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
color: #333333;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 95%;
|
||||||
|
background-color: #fff;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 25px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,100 +1,41 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, h } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { getWithdrawList, addWithdraw } from "@/api/admin";
|
import { getWithdrawList, addWithdraw } from '@/api/admin';
|
||||||
|
|
||||||
const user_info = Taro.getStorageSync("userInfo");
|
const user_info = ref<any>({});
|
||||||
|
|
||||||
|
const mer_info = ref<any>({});
|
||||||
|
|
||||||
const row = ref(0);
|
const row = ref(0);
|
||||||
|
const str = ref(0);
|
||||||
|
|
||||||
|
const formRef = ref();
|
||||||
|
|
||||||
const basicData = ref({
|
const basicData = ref({
|
||||||
num: "",
|
num: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
const showPreview = ref(false);
|
const showPreview = ref(false);
|
||||||
|
|
||||||
|
const visible1 = ref(false);
|
||||||
|
|
||||||
const imgData = ref([
|
const imgData = ref([
|
||||||
{
|
{
|
||||||
src: "",
|
src: '',
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const columns = ref([
|
const data = ref<any>([]);
|
||||||
{
|
|
||||||
title: "时间",
|
|
||||||
key: "add_time",
|
|
||||||
align: "center",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "提现金额",
|
|
||||||
key: "integral",
|
|
||||||
align: "center",
|
|
||||||
render: (row: { integral: number }) => {
|
|
||||||
return h("view", {}, row.integral);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "审核状态",
|
|
||||||
key: "status",
|
|
||||||
align: "center",
|
|
||||||
render: (row: { status: number }) => {
|
|
||||||
return h(
|
|
||||||
"view",
|
|
||||||
{
|
|
||||||
class: `tag ${
|
|
||||||
row.status === 1
|
|
||||||
? "success"
|
|
||||||
: row.status === 2
|
|
||||||
? "danger"
|
|
||||||
: "warning"
|
|
||||||
}`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
default: () =>
|
|
||||||
row.status === 1
|
|
||||||
? "已打款"
|
|
||||||
: row.status === 2
|
|
||||||
? "已拒绝"
|
|
||||||
: "待审核",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "备注",
|
|
||||||
key: "img",
|
|
||||||
align: "center",
|
|
||||||
render: (row: { status_img: string }) => {
|
|
||||||
return h("img", {
|
|
||||||
class: "image",
|
|
||||||
onClick: () => {
|
|
||||||
imgData.value[0].src = row.status_img;
|
|
||||||
showPreview.value = true;
|
|
||||||
},
|
|
||||||
src: row.status_img,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
|
|
||||||
const data = ref([]);
|
|
||||||
|
|
||||||
const pagination = ref({
|
const pagination = ref({
|
||||||
page: 1,
|
page: 1,
|
||||||
itemsPerPage: 5,
|
total: 0,
|
||||||
showPageSize: 5,
|
|
||||||
totalItems: 0,
|
|
||||||
change: (page: number) => {
|
|
||||||
pagination.value.page = page;
|
|
||||||
getData();
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const hideFn = () => {
|
|
||||||
showPreview.value = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
Taro.useLoad(() => {
|
Taro.useLoad(() => {
|
||||||
|
user_info.value = Taro.getStorageSync('userInfo');
|
||||||
|
mer_info.value = Taro.getStorageSync('mer_info');
|
||||||
getData();
|
getData();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -102,12 +43,13 @@ const getData = async () => {
|
|||||||
try {
|
try {
|
||||||
const res = await getWithdrawList({
|
const res = await getWithdrawList({
|
||||||
PageNum: pagination.value.page,
|
PageNum: pagination.value.page,
|
||||||
PageSize: pagination.value.showPageSize,
|
PageSize: 10,
|
||||||
Bid: user_info.data.bid,
|
Bid: user_info.value.data.bid,
|
||||||
});
|
});
|
||||||
data.value = res.data.data || [];
|
data.value.push(...res.data.data);
|
||||||
pagination.value.totalItems = res.data.total;
|
pagination.value.total = res.data.total;
|
||||||
row.value = res.data.integral || 0;
|
row.value = res.data.integral || 0;
|
||||||
|
str.value = res.data.number || 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
@@ -115,111 +57,205 @@ const getData = async () => {
|
|||||||
|
|
||||||
const add = async () => {
|
const add = async () => {
|
||||||
try {
|
try {
|
||||||
if (Number(basicData.value.num) === 0)
|
formRef.value?.validate().then(async ({ valid }) => {
|
||||||
return Taro.showToast({
|
if (valid) {
|
||||||
title: "提现积分需大于0",
|
const res = await addWithdraw({
|
||||||
icon: "none",
|
Bid: user_info.value.data.bid,
|
||||||
});
|
Number: Number(basicData.value.num),
|
||||||
const res = await addWithdraw({
|
});
|
||||||
Bid: user_info.data.bid,
|
Taro.showToast({
|
||||||
Number: Number(basicData.value.num),
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
basicData.value.num = '';
|
||||||
|
await getData();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
Taro.showToast({
|
|
||||||
title: res.msg,
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
await getData();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const rules = ref({
|
||||||
|
num: [
|
||||||
|
{
|
||||||
|
message: '请填写提现余额',
|
||||||
|
validator: (value, _) => {
|
||||||
|
return value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
message: '提现余额最低为1元',
|
||||||
|
validator: (value, _) => {
|
||||||
|
return Number(value) >= 1;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
message: '提现余额不能大于可提现余额',
|
||||||
|
validator: (value, _) => {
|
||||||
|
return Number(value) <= row.value;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
const openPreview = item => {
|
||||||
|
imgData.value[0].src = item.status_img;
|
||||||
|
showPreview.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closePreview = () => {
|
||||||
|
showPreview.value = false;
|
||||||
|
imgData.value[0].src = '';
|
||||||
|
};
|
||||||
|
|
||||||
|
Taro.usePullDownRefresh(() => {
|
||||||
|
pagination.value.page = 1;
|
||||||
|
getData();
|
||||||
|
Taro.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
|
||||||
|
Taro.useReachBottom(() => {
|
||||||
|
if (pagination.value.total === data.value.length)
|
||||||
|
return Taro.showToast({
|
||||||
|
title: '没有更多数据了',
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
pagination.value.page++;
|
||||||
|
getData();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<nut-form>
|
<view class="card">
|
||||||
<nut-form-item label="提现积分:">
|
<view class="container">
|
||||||
<nut-input
|
|
||||||
v-model="basicData.num"
|
|
||||||
class="nut-input-text"
|
|
||||||
placeholder="请输入提现积分"
|
|
||||||
type="text"
|
|
||||||
/>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item>
|
|
||||||
<view>
|
<view>
|
||||||
当前可提现积分:
|
<view class="font-bold text-[35px]">{{ row }}</view>
|
||||||
<text class="text-red">{{ row }}</text>
|
<view class="text-[25px] mt-2">可提现余额</view>
|
||||||
</view>
|
</view>
|
||||||
<view style="margin-top: 10px">
|
<!-- <view class="line"></view>
|
||||||
实际到账:
|
<view class="">
|
||||||
<text class="text-red">{{ (row / 100).toFixed(2) }}</text>
|
<view class="font-bold text-[35px]">{{ str }}</view>
|
||||||
元
|
<view class="text-[25px] mt-2">实际到账</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
<view class="footer">
|
||||||
|
<text>到账方式</text>
|
||||||
|
<!-- <text>{{
|
||||||
|
`${mer_info.bank}(${mer_info.bank_card?.substring(
|
||||||
|
mer_info.bank_card.length - 4,
|
||||||
|
)})`
|
||||||
|
}}</text> -->
|
||||||
|
<text>银行卡汇款</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="formCard">
|
||||||
|
<view class="flex justify-between mb-[25px]">
|
||||||
|
<text>余额提现</text>
|
||||||
|
<!-- <view class="flex items-center" @click="visible1 = true">
|
||||||
|
<image
|
||||||
|
class="w-[26px] h-[26px]"
|
||||||
|
src="https://p1.meituan.net/csc/5437a800f4ed4a49f14984494c1c3077994.png"></image>
|
||||||
|
<view class="text-[#EC4443] text-[26px] ml-1">提现疑问</view>
|
||||||
|
</view> -->
|
||||||
|
</view>
|
||||||
|
<nut-form ref="formRef" :model-value="basicData" :rules="rules">
|
||||||
|
<nut-form-item prop="num">
|
||||||
|
<nut-input
|
||||||
|
v-model="basicData.num"
|
||||||
|
class="nut-input-text"
|
||||||
|
placeholder="请输入提现余额"
|
||||||
|
type="text">
|
||||||
|
<template #right>
|
||||||
|
<text
|
||||||
|
class="text-[#EC4443] text-[26px]"
|
||||||
|
@tap="basicData.num = row.toString()"
|
||||||
|
>全部</text
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</nut-input>
|
||||||
|
</nut-form-item>
|
||||||
|
</nut-form>
|
||||||
|
<nut-button block type="primary" @click="add">立即提现</nut-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="title">
|
||||||
|
<view class="title-line"></view>
|
||||||
|
<view class="title-text">提现记录</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<view class="list" v-if="data.length > 0">
|
||||||
|
<view class="item" v-for="(item, index) in data" :key="index">
|
||||||
|
<view class="flex justify-between items-center">
|
||||||
|
<view class="text-[25px] text-[#9C9C9C]">到账金额</view>
|
||||||
|
<view
|
||||||
|
class="text-[27px]"
|
||||||
|
:class="
|
||||||
|
item.status === 1
|
||||||
|
? 'success'
|
||||||
|
: item.status === 1
|
||||||
|
? 'danger'
|
||||||
|
: 'warning'
|
||||||
|
"
|
||||||
|
>{{
|
||||||
|
item.status === 1
|
||||||
|
? '已打款'
|
||||||
|
: item.status === 2
|
||||||
|
? '已拒绝'
|
||||||
|
: '待审核'
|
||||||
|
}}</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="mt-3 mb-3 text-[35px]">¥{{ item.number }}</view>
|
||||||
|
<view class="text-[25px] mb-1">提现金额:{{ item.integral }}</view>
|
||||||
|
<view class="text-[25px] mb-1"
|
||||||
|
>信息服务费:{{ item.commission }}</view
|
||||||
|
>
|
||||||
|
<view class="text-[25px] mb-1"
|
||||||
|
>手续费:{{ item.commission_number }}%</view
|
||||||
|
>
|
||||||
|
<view class="text-[25px] mb-1">时间:{{ item.add_time }}</view>
|
||||||
|
<view v-if="item.status === 2" class="text-[25px] text-[#9C9C9C]"
|
||||||
|
>备注:</view
|
||||||
|
>
|
||||||
|
<view
|
||||||
|
v-if="item.status === 1"
|
||||||
|
class="text-[23px] mt-2 text-[#df3526]"
|
||||||
|
@click="openPreview(item)"
|
||||||
|
>点我查看回执单
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item>
|
|
||||||
<nut-button block type="primary" @click="add">立即提现</nut-button>
|
|
||||||
</nut-form-item>
|
|
||||||
</nut-form>
|
|
||||||
<view v-if="data.length > 0">
|
|
||||||
<view class="data">
|
|
||||||
<nut-table :columns="columns" :data="data"></nut-table>
|
|
||||||
<nut-pagination
|
|
||||||
class="pagination"
|
|
||||||
v-model="pagination.page"
|
|
||||||
:total-items="pagination.totalItems"
|
|
||||||
:items-per-page="pagination.itemsPerPage"
|
|
||||||
:show-page-size="pagination.showPageSize"
|
|
||||||
@change="pagination.change"
|
|
||||||
:bordered="false"
|
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="暂无提现记录"></nut-empty>
|
<nut-empty v-else description="暂无提现记录"></nut-empty>
|
||||||
<!-- 图片预览 -->
|
<!-- 图片预览 -->
|
||||||
<nut-image-preview :show="showPreview" :images="imgData" @close="hideFn" />
|
<nut-image-preview
|
||||||
|
:show="showPreview"
|
||||||
|
:images="imgData"
|
||||||
|
@close="closePreview" />
|
||||||
|
|
||||||
|
<nut-dialog
|
||||||
|
title="提现疑问?"
|
||||||
|
content="这是基础弹框。"
|
||||||
|
ok-text="我已知晓"
|
||||||
|
:no-cancel-btn="true"
|
||||||
|
v-model:visible="visible1">
|
||||||
|
<template #default>
|
||||||
|
<text>
|
||||||
|
积分和人民币兑换比例为
|
||||||
|
<text class="text-[#F83D3D]">100:1</text>
|
||||||
|
平台收取<text class="text-[#F83D3D]">10%服务费</text>和<text
|
||||||
|
class="text-[#F83D3D]"
|
||||||
|
>0.038%手续费</text
|
||||||
|
>
|
||||||
|
</text>
|
||||||
|
</template>
|
||||||
|
</nut-dialog>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.text-red {
|
@import './index.scss';
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.data {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: #fff;
|
|
||||||
padding: 10px;
|
|
||||||
|
|
||||||
.pagination {
|
|
||||||
margin: 10px auto;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.tag {
|
|
||||||
width: 100%;
|
|
||||||
padding: 5px 8px;
|
|
||||||
color: white;
|
|
||||||
border-radius: 8px;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.success {
|
|
||||||
background-color: #4fc08d;
|
|
||||||
}
|
|
||||||
|
|
||||||
.danger {
|
|
||||||
background-color: #df3526;
|
|
||||||
}
|
|
||||||
|
|
||||||
.warning {
|
|
||||||
background-color: #f3812e;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image {
|
|
||||||
width: 50px;
|
|
||||||
height: 50px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "全部服务",
|
navigationBarTitleText: '全部服务',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,8 +8,7 @@
|
|||||||
v-for="itm in item.Classify"
|
v-for="itm in item.Classify"
|
||||||
:key="itm.ID"
|
:key="itm.ID"
|
||||||
:text="itm.name"
|
:text="itm.name"
|
||||||
@click="toDetails(itm)"
|
@click="toDetails(itm)">
|
||||||
>
|
|
||||||
<image :src="itm.icon" />
|
<image :src="itm.icon" />
|
||||||
</nut-grid-item>
|
</nut-grid-item>
|
||||||
</nut-grid>
|
</nut-grid>
|
||||||
@@ -20,9 +19,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { getAllMerCategory } from "@/api/goods";
|
import { getAllMerCategory } from '@/api/goods';
|
||||||
|
|
||||||
const list = ref<
|
const list = ref<
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "购物车",
|
navigationBarTitleText: '购物车',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -6,25 +6,28 @@
|
|||||||
<nut-checkbox
|
<nut-checkbox
|
||||||
v-model="itm.state.checkbox"
|
v-model="itm.state.checkbox"
|
||||||
:indeterminate="itm.state.indeterminate"
|
:indeterminate="itm.state.indeterminate"
|
||||||
@change="(val: boolean) => changeBoxAll(val,idx)"
|
@change="(val: boolean) => changeBoxAll(val, idx)"
|
||||||
>{{ itm.StoreName }}
|
>{{ itm.StoreName }}
|
||||||
</nut-checkbox>
|
</nut-checkbox>
|
||||||
</nut-cell>
|
</nut-cell>
|
||||||
<nut-checkbox-group
|
<nut-checkbox-group
|
||||||
v-model="itm.state.checkboxgroup"
|
v-model="itm.state.checkboxgroup"
|
||||||
:ref="(el) => getGroup(el, idx)"
|
:ref="el => getGroup(el, idx)"
|
||||||
@change="(label) => changeBox(label, itm)"
|
@change="label => changeBox(label, itm)">
|
||||||
>
|
|
||||||
<nut-cell v-for="(item, idx1) in itm.Goods" :key="idx1">
|
<nut-cell v-for="(item, idx1) in itm.Goods" :key="idx1">
|
||||||
<nut-checkbox :label="item.gid" style="width: 10%"></nut-checkbox>
|
<nut-checkbox :label="item.gid" style="width: 10%"></nut-checkbox>
|
||||||
<view class="box">
|
<view class="box">
|
||||||
<view class="box-left">
|
<view class="box-left">
|
||||||
<img class="cover" :src="item.cover" alt="" />
|
<img class="cover" :src="item.cover" alt="" />
|
||||||
<view class="center">
|
<view class="center">
|
||||||
<view>{{ item.name }}</view>
|
<view class="line-clamp-2 text-[25px]">{{ item.name }}</view>
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<view>{{ item.price }} 元</view>
|
<view
|
||||||
<view>{{ item.exchange }} 积分</view>
|
>{{ item.price }}元
|
||||||
|
<text v-if="item.discount_integral > 0"
|
||||||
|
>+{{ item.discount_integral }}积分</text
|
||||||
|
>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -33,8 +36,7 @@
|
|||||||
readonly
|
readonly
|
||||||
:min="-1"
|
:min="-1"
|
||||||
@add.stop="() => onAdd(item)"
|
@add.stop="() => onAdd(item)"
|
||||||
@reduce.stop="() => onReduce(item)"
|
@reduce.stop="() => onReduce(item)" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</nut-cell>
|
</nut-cell>
|
||||||
</nut-checkbox-group>
|
</nut-checkbox-group>
|
||||||
@@ -42,9 +44,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="购物车暂无数据"></nut-empty>
|
<nut-empty v-else description="购物车暂无数据"></nut-empty>
|
||||||
<view>
|
<view>
|
||||||
<view style="height: 100rpx"></view>
|
<view style="height: 100px"></view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottom-box">
|
<view class="bottom-box" v-if="list.length > 0">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<!-- <nut-checkbox v-model="selectAllVal" @change="selectAll"
|
<!-- <nut-checkbox v-model="selectAllVal" @change="selectAll"
|
||||||
>全选
|
>全选
|
||||||
@@ -55,16 +57,14 @@
|
|||||||
<nut-price
|
<nut-price
|
||||||
v-model:price="localCount.price"
|
v-model:price="localCount.price"
|
||||||
size="normal"
|
size="normal"
|
||||||
:need-symbol="false"
|
:need-symbol="false" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="text-box">
|
<view class="text-box">
|
||||||
总积分:
|
总积分:
|
||||||
<nut-price
|
<nut-price
|
||||||
v-model:price="localCount.exchange"
|
v-model:price="localCount.exchange"
|
||||||
size="normal"
|
size="normal"
|
||||||
:need-symbol="false"
|
:need-symbol="false" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -75,17 +75,16 @@
|
|||||||
:is-show-pay="isShowPay"
|
:is-show-pay="isShowPay"
|
||||||
:interval="true"
|
:interval="true"
|
||||||
v-model:jfInfo="orderData"
|
v-model:jfInfo="orderData"
|
||||||
@closePay="closePay"
|
@closePay="closePay" />
|
||||||
/>
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { nextTick, ref } from "vue";
|
import { nextTick, ref } from 'vue';
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { addCart, getAllCart } from "@/api/cart";
|
import { addCart, getAllCart } from '@/api/cart';
|
||||||
import { createActiveOrder } from "@/api/goods";
|
import { createActiveOrder } from '@/api/goods';
|
||||||
import Pay from "@/components/Pay.vue";
|
import Pay from '@/components/Pay.vue';
|
||||||
|
|
||||||
interface CardList {
|
interface CardList {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -95,6 +94,8 @@ interface CardList {
|
|||||||
number: string;
|
number: string;
|
||||||
price: number;
|
price: number;
|
||||||
exchange: number;
|
exchange: number;
|
||||||
|
pay_price: number;
|
||||||
|
discount_integral: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// const selectAllVal = ref(false);
|
// const selectAllVal = ref(false);
|
||||||
@@ -134,7 +135,7 @@ const changeBox = (label: string[], item: any) => {
|
|||||||
exchange: 0,
|
exchange: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
item["Count"] = {
|
item['Count'] = {
|
||||||
priceCount: 0,
|
priceCount: 0,
|
||||||
exchangeCount: 0,
|
exchangeCount: 0,
|
||||||
};
|
};
|
||||||
@@ -143,8 +144,8 @@ const changeBox = (label: string[], item: any) => {
|
|||||||
label.forEach((id: string) => {
|
label.forEach((id: string) => {
|
||||||
item.Goods.forEach((itm: any) => {
|
item.Goods.forEach((itm: any) => {
|
||||||
if (itm.gid === id) {
|
if (itm.gid === id) {
|
||||||
item["Count"].priceCount += itm.price;
|
item['Count'].priceCount += itm.price;
|
||||||
item["Count"].exchangeCount += itm.exchange;
|
item['Count'].exchangeCount += itm.discount_integral;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -192,29 +193,34 @@ const isShowPay = ref(false);
|
|||||||
const orderData = ref<any>([]);
|
const orderData = ref<any>([]);
|
||||||
|
|
||||||
const sub = async () => {
|
const sub = async () => {
|
||||||
const arr: any = list.value.filter(
|
|
||||||
(item: any) => item.state.checkboxgroup.length > 0
|
|
||||||
);
|
|
||||||
if (arr.length === 0) {
|
|
||||||
Taro.showToast({
|
|
||||||
title: "请选择商品",
|
|
||||||
icon: "none",
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
console.log('sub');
|
||||||
|
const arr: any = list.value.filter(
|
||||||
|
(item: any) => item.state.checkboxgroup.length > 0,
|
||||||
|
);
|
||||||
|
console.log(arr);
|
||||||
|
if (arr.length === 0) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请选择商品',
|
||||||
|
icon: 'none',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { data: res } = await createActiveOrder({
|
const { data: res } = await createActiveOrder({
|
||||||
Bid: arr.map((item: any) => item.StoreBid),
|
Bid: arr.map((item: any) => item.StoreBid),
|
||||||
});
|
});
|
||||||
if (res.oid) {
|
if (res.oid) {
|
||||||
orderData.value = res?.oid;
|
// orderData.value = res?.oid;
|
||||||
isShowPay.value = true;
|
// isShowPay.value = true;
|
||||||
|
// console.log(arr)
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: `/pages/goods/pay/index?oid=${res.oid}&bid=${arr[0].StoreBid}&OrderType=1`,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: e.msg,
|
title: e.msg || '订单创建失败',
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -224,7 +230,7 @@ const closePay = async (val: boolean) => {
|
|||||||
orderData.value = [];
|
orderData.value = [];
|
||||||
await getList();
|
await getList();
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/pages/users/order_list/index?type=0",
|
url: '/pages/users/order_list/index?type=0',
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -239,7 +245,7 @@ const getList = async () => {
|
|||||||
list.value = list.value.map((item: any) => ({
|
list.value = list.value.map((item: any) => ({
|
||||||
...item,
|
...item,
|
||||||
Goods: item.Goods.sort(
|
Goods: item.Goods.sort(
|
||||||
(a: CardList, b: CardList) => Number(a.gid) - Number(b.gid)
|
(a: CardList, b: CardList) => Number(a.gid) - Number(b.gid),
|
||||||
),
|
),
|
||||||
state: {
|
state: {
|
||||||
indeterminate: false,
|
indeterminate: false,
|
||||||
@@ -277,13 +283,13 @@ const add_cart = async (item: CardList, num: number = 1) => {
|
|||||||
});
|
});
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
await getList();
|
await getList();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: e.msg,
|
title: e.msg,
|
||||||
icon: "none",
|
icon: 'none',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -291,7 +297,7 @@ const add_cart = async (item: CardList, num: number = 1) => {
|
|||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.index {
|
.index {
|
||||||
font-family: "Avenir", Helvetica, Arial, sans-serif;
|
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -309,16 +315,18 @@ const add_cart = async (item: CardList, num: number = 1) => {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.cover {
|
.cover {
|
||||||
width: 130rpx;
|
width: 130px;
|
||||||
height: 130rpx;
|
height: 130px;
|
||||||
margin-right: 15rpx;
|
min-width: 130px;
|
||||||
border-radius: 20rpx;
|
min-height: 130px;
|
||||||
|
margin-right: 15px;
|
||||||
|
border-radius: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.center {
|
.center {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: space-around;
|
justify-content: space-between;
|
||||||
|
|
||||||
.price {
|
.price {
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -336,21 +344,21 @@ const add_cart = async (item: CardList, num: number = 1) => {
|
|||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100rpx;
|
height: 100px;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 20rpx;
|
padding: 0 20px;
|
||||||
box-shadow: 100rpx 104rpx 288rpx rgba(0, 0, 0, 0.01);
|
box-shadow: 100px 104px 288px rgba(0, 0, 0, 0.01);
|
||||||
border-top: 1rpx solid #f5f5f5;
|
border-top: 1px solid #f5f5f5;
|
||||||
|
|
||||||
.left {
|
.left {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
.text-box {
|
.text-box {
|
||||||
margin-left: 10rpx;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "分类",
|
navigationBarTitleText: '分类',
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,19 +7,16 @@
|
|||||||
:animated-time="10"
|
:animated-time="10"
|
||||||
name="tabs"
|
name="tabs"
|
||||||
direction="vertical"
|
direction="vertical"
|
||||||
@change="tabChange"
|
@change="tabChange">
|
||||||
>
|
|
||||||
<nut-tab-pane
|
<nut-tab-pane
|
||||||
v-for="item in list"
|
v-for="item in list"
|
||||||
:title="(item.name as string)"
|
:title="item.name as string"
|
||||||
:key="item.ID"
|
:key="item.ID">
|
||||||
>
|
|
||||||
<view v-if="goodList.length > 0">
|
<view v-if="goodList.length > 0">
|
||||||
<view
|
<view
|
||||||
class="list"
|
class="list"
|
||||||
v-for="(item, index) in (goodList as any)"
|
v-for="(item, index) in goodList as any"
|
||||||
:key="index"
|
:key="index">
|
||||||
>
|
|
||||||
<view class="item">
|
<view class="item">
|
||||||
<img :src="item.cover" />
|
<img :src="item.cover" />
|
||||||
<view class="right">
|
<view class="right">
|
||||||
@@ -46,9 +43,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro';
|
||||||
import { ref } from "vue";
|
import { ref } from 'vue';
|
||||||
import { getCategoryList, getCategoryGoods } from "@/api/goods";
|
import { getCategoryList, getCategoryGoods } from '@/api/goods';
|
||||||
|
|
||||||
const val = ref(0);
|
const val = ref(0);
|
||||||
|
|
||||||
|
|||||||
4
src/pages/fastBuy/index.config.ts
Normal file
4
src/pages/fastBuy/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '',
|
||||||
|
navigationStyle: 'custom',
|
||||||
|
});
|
||||||
6
src/pages/fastBuy/index.scss
Normal file
6
src/pages/fastBuy/index.scss
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
page {
|
||||||
|
background-image: url('https://p1.meituan.net/csc/75a139bcec06745d385ec211aa313a98196174.png');
|
||||||
|
background-size: 100% 40%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-color: #f9f8f6;
|
||||||
|
}
|
||||||
141
src/pages/fastBuy/index.vue
Normal file
141
src/pages/fastBuy/index.vue
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
<template>
|
||||||
|
<view class="flex flex-col items-center pt-[208px]">
|
||||||
|
<back />
|
||||||
|
<image class="h-[152px]" :src="par.header" />
|
||||||
|
<view class="list mt-[30px]" v-if="data.length > 0">
|
||||||
|
<view
|
||||||
|
class="bg-white p-[20px] w-[700px] rounded-[20px] mb-[20px] flex"
|
||||||
|
v-for="(item, index) in data"
|
||||||
|
:key="index">
|
||||||
|
<image
|
||||||
|
class="w-[200px] h-[200px] rounded-[10px] mr-[10px]"
|
||||||
|
:src="item.cover"></image>
|
||||||
|
<view class="flex-1 flex flex-col justify-between">
|
||||||
|
<nut-ellipsis
|
||||||
|
style="font-size: 20px"
|
||||||
|
direction="end"
|
||||||
|
:rows="2"
|
||||||
|
:content="item.name"></nut-ellipsis>
|
||||||
|
<view>
|
||||||
|
<view class="text-[#9E9E9E] text-[26px]"
|
||||||
|
>剩余: {{ item.stock }}</view
|
||||||
|
>
|
||||||
|
<view class="flex justify-between items-end">
|
||||||
|
<view>
|
||||||
|
<view class="text-[#F83D3D] text-[30px] font-bold"
|
||||||
|
>{{ item.number }}元</view
|
||||||
|
>
|
||||||
|
<view class="text-[#F83D3D] text-[30px] font-bold"
|
||||||
|
>{{ item.exchange }}积分</view
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
<nut-button type="primary" size="mini" @click="toPay(item)"
|
||||||
|
>购买</nut-button
|
||||||
|
>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<nut-empty
|
||||||
|
class="mt-[130px]"
|
||||||
|
v-else
|
||||||
|
image="empty"
|
||||||
|
description="暂时没有商品"></nut-empty>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import Taro from '@tarojs/taro';
|
||||||
|
import { getHdOrJfGoods, createActiveOrder } from '@/api/goods';
|
||||||
|
import { getUserPoint } from '@/api/admin';
|
||||||
|
import { addCart } from '@/api/cart';
|
||||||
|
import Back from '@/components/Back.vue';
|
||||||
|
|
||||||
|
const par = ref<any>({});
|
||||||
|
|
||||||
|
Taro.useLoad(e => {
|
||||||
|
switch (e.type) {
|
||||||
|
case '1':
|
||||||
|
par.value = {
|
||||||
|
header:
|
||||||
|
'https://p0.meituan.net/csc/6229068017d3b199aafd9eed47bfd50513859.png',
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
par.value = {
|
||||||
|
header:
|
||||||
|
'https://p0.meituan.net/csc/ccfb8d3119200f81e2d6a5241081eb4b13797.png',
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
par.value = {
|
||||||
|
...par.value,
|
||||||
|
type: e.type,
|
||||||
|
};
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
const data = ref<any[]>([]);
|
||||||
|
|
||||||
|
const page = ref({
|
||||||
|
page: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
itemCount: 0,
|
||||||
|
});
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
});
|
||||||
|
const res = await getHdOrJfGoods({
|
||||||
|
PageNum: page.value.page,
|
||||||
|
PageSize: page.value.pageSize,
|
||||||
|
type: Number(par.value.type),
|
||||||
|
});
|
||||||
|
data.value.push(...res.data.data);
|
||||||
|
page.value.itemCount = res.data.total;
|
||||||
|
Taro.hideLoading();
|
||||||
|
};
|
||||||
|
|
||||||
|
Taro.useReachBottom(() => {
|
||||||
|
if (page.value.page < Math.ceil(page.value.itemCount / page.value.pageSize)) {
|
||||||
|
page.value.page++;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const toPay = async item => {
|
||||||
|
const tk = Taro.getStorageSync('token');
|
||||||
|
if (!tk) {
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/users/login/index',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await addCart({
|
||||||
|
Bid: item.Store.bid,
|
||||||
|
Gid: item.gid,
|
||||||
|
Number: 1,
|
||||||
|
});
|
||||||
|
const user_info = Taro.getStorageSync('userInfo');
|
||||||
|
const data = await getUserPoint({
|
||||||
|
phone: user_info.data.phone,
|
||||||
|
bid: item.Store.bid,
|
||||||
|
});
|
||||||
|
|
||||||
|
const res = await createActiveOrder({
|
||||||
|
Bid: [item.Store.bid],
|
||||||
|
custID: data.data.store_user_id,
|
||||||
|
});
|
||||||
|
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${item.Store.bid}&OrderType=1`,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
@import './index.scss';
|
||||||
|
</style>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: "游戏详情",
|
navigationBarTitleText: '游戏详情',
|
||||||
navigationStyle: "custom",
|
// navigationStyle: 'custom',
|
||||||
});
|
});
|
||||||
|
|||||||
43
src/pages/game/gamedetail/index.scss
Normal file
43
src/pages/game/gamedetail/index.scss
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// page {
|
||||||
|
// font-size: 10px;
|
||||||
|
// }
|
||||||
|
|
||||||
|
.index {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
|
||||||
|
.swiper {
|
||||||
|
background-color: white;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
z-index: 1;
|
||||||
|
position: absolute;
|
||||||
|
top: 260px;
|
||||||
|
background-color: white;
|
||||||
|
box-sizing: border-box;
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
text-align: center;
|
||||||
|
border-top-left-radius: 20px;
|
||||||
|
border-top-right-radius: 20px;
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin: 20px auto;
|
||||||
|
padding: 10px;
|
||||||
|
border-radius: 50px;
|
||||||
|
background-color: #7950f2;
|
||||||
|
color: #fff;
|
||||||
|
width: 300px;
|
||||||
|
text-align: center;
|
||||||
|
border: 1px solid #f5f5f5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.text {
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 30px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user