Compare commits
160 Commits
fbbdecf2e0
...
test
| 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 | |||
| aed8e6f73f | |||
| aef52631e7 | |||
| 5844762b25 | |||
| c84f2e63f5 | |||
| 1f969e59c7 | |||
| 2174c91c4b | |||
| 6b0c7d9887 | |||
| 5dcb7a5259 | |||
| 46de69b98b | |||
| 714b980b28 | |||
| 74ca4123eb | |||
| 45648d78ba | |||
| 7e86c01913 | |||
| 52ad54f6a9 | |||
| 52c0bb70e7 | |||
| eb696252f2 | |||
| b8b7f1faa8 | |||
| 7fdad4ed26 | |||
| d3caef5172 | |||
| b94c4110ea | |||
| 659d2fd972 | |||
| b8ab7699e1 | |||
| 62f1f3454c | |||
| 878cc05673 | |||
| 6c25beff1d | |||
| b01f4ff3a9 |
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 = {
|
||||
types: [
|
||||
{ value: "feat", name: "feat: 新增功能" },
|
||||
{ value: "fix", name: "fix: 修复bug" },
|
||||
{ value: "docs", name: "docs: 文档变更" },
|
||||
{ value: 'feat', name: 'feat: 新增功能' },
|
||||
{ value: 'fix', name: 'fix: 修复bug' },
|
||||
{ value: 'docs', name: 'docs: 文档变更' },
|
||||
{
|
||||
value: "style",
|
||||
name: "style: 代码格式(不影响功能,例如空格、分号等格式修正)",
|
||||
value: 'style',
|
||||
name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)',
|
||||
},
|
||||
{
|
||||
value: "refactor",
|
||||
name: "refactor: 代码重构(不包括 bug 修复、功能新增)",
|
||||
value: 'refactor',
|
||||
name: 'refactor: 代码重构(不包括 bug 修复、功能新增)',
|
||||
},
|
||||
{ value: "perf", name: "perf: 性能优化" },
|
||||
{ value: "test", name: "test: 添加、修改测试用例" },
|
||||
{ value: 'perf', name: 'perf: 性能优化' },
|
||||
{ value: 'test', name: 'test: 添加、修改测试用例' },
|
||||
{
|
||||
value: "build",
|
||||
name: "build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)",
|
||||
value: 'build',
|
||||
name: 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)',
|
||||
},
|
||||
{ value: "ci", name: "ci: 修改 CI 配置、脚本" },
|
||||
{ value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
|
||||
{
|
||||
value: "chore",
|
||||
name: "chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)",
|
||||
value: 'chore',
|
||||
name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)',
|
||||
},
|
||||
{ value: "revert", name: "revert: 回滚 commit" },
|
||||
{ value: "wip", name: "wip: 开发中" },
|
||||
{ value: "mod", name: "mod: 不确定分类的修改" },
|
||||
{ value: "release", name: "release: 发布" },
|
||||
{ value: 'revert', name: 'revert: 回滚 commit' },
|
||||
{ value: 'wip', name: 'wip: 开发中' },
|
||||
{ value: 'mod', name: 'mod: 不确定分类的修改' },
|
||||
{ value: 'release', name: 'release: 发布' },
|
||||
],
|
||||
scopes: [
|
||||
["custom", "自定义"],
|
||||
["projects", "项目搭建"],
|
||||
["components", "组件相关"],
|
||||
["utils", "utils 相关"],
|
||||
["styles", "样式相关"],
|
||||
["deps", "项目依赖"],
|
||||
["other", "其他修改"],
|
||||
['custom', '自定义'],
|
||||
['projects', '项目搭建'],
|
||||
['components', '组件相关'],
|
||||
['utils', 'utils 相关'],
|
||||
['styles', '样式相关'],
|
||||
['deps', '项目依赖'],
|
||||
['other', '其他修改'],
|
||||
].map(([value, description]) => {
|
||||
return {
|
||||
value,
|
||||
@@ -42,16 +42,16 @@ module.exports = {
|
||||
};
|
||||
}),
|
||||
messages: {
|
||||
type: "确保本次提交遵循 Angular 规范!选择你要提交的类型:\n",
|
||||
scope: "选择一个 scope(可选):",
|
||||
customScope: "请输入自定义的 scope:",
|
||||
subject: "填写简短精炼的变更描述:",
|
||||
type: '确保本次提交遵循 Angular 规范!选择你要提交的类型:\n',
|
||||
scope: '选择一个 scope(可选):',
|
||||
customScope: '请输入自定义的 scope:',
|
||||
subject: '填写简短精炼的变更描述:',
|
||||
body: '填写更加详细的变更描述(可选)。使用 "|" 换行:',
|
||||
breaking: "列举非兼容性重大的变更(可选):",
|
||||
footer: "列举出所有变更的 Issues Closed(可选)。 例如: #31, #34:",
|
||||
confirmCommit: "确认提交?",
|
||||
breaking: '列举非兼容性重大的变更(可选):',
|
||||
footer: '列举出所有变更的 Issues Closed(可选)。 例如: #31, #34:',
|
||||
confirmCommit: '确认提交?',
|
||||
},
|
||||
allowBreakingChanges: ["feat", "fix"],
|
||||
allowBreakingChanges: ['feat', 'fix'],
|
||||
subjectLimit: 100,
|
||||
breaklineChar: "|",
|
||||
breaklineChar: '|',
|
||||
};
|
||||
|
||||
@@ -2,10 +2,17 @@
|
||||
TARO_APP_ID='wx7b3322daa2cf9c88'
|
||||
|
||||
# 开发版appkey
|
||||
TARO_APP_KEY='1234567890'
|
||||
TARO_APP_KEY=''
|
||||
|
||||
# API接口
|
||||
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'
|
||||
|
||||
# 开发版appkey
|
||||
# 正式版appkey
|
||||
TARO_APP_KEY='private.wxdd00d46fa6f07974.key'
|
||||
|
||||
# API接口
|
||||
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接口
|
||||
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/
|
||||
.DS_Store
|
||||
.swc
|
||||
pnpm-lock.yaml
|
||||
5
.idea/.gitignore
generated
vendored
5
.idea/.gitignore
generated
vendored
@@ -1,5 +0,0 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
5
.idea/codeStyles/codeStyleConfig.xml
generated
5
.idea/codeStyles/codeStyleConfig.xml
generated
@@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
||||
15
.idea/git_toolbox_prj.xml
generated
15
.idea/git_toolbox_prj.xml
generated
@@ -1,15 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/jsLibraryMappings.xml
generated
6
.idea/jsLibraryMappings.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<includedPredefinedLibrary name="Node.js Core" />
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/jsLinters/eslint.xml
generated
6
.idea/jsLinters/eslint.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="EslintConfiguration">
|
||||
<custom-configuration-file used="true" path="$PROJECT_DIR$/.eslintrc.js" />
|
||||
</component>
|
||||
</project>
|
||||
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/taroApp.iml" filepath="$PROJECT_DIR$/.idea/taroApp.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
12
.idea/taroApp.iml
generated
12
.idea/taroApp.iml
generated
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
4
.idea/watcherTasks.xml
generated
4
.idea/watcherTasks.xml
generated
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectTasksOptions" suppressed-tasks="SCSS" />
|
||||
</project>
|
||||
@@ -1,3 +1,4 @@
|
||||
/node_modules/**
|
||||
/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 = {
|
||||
presets: [
|
||||
[
|
||||
"taro",
|
||||
'taro',
|
||||
{
|
||||
framework: "vue3",
|
||||
framework: 'vue3',
|
||||
ts: true,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
module.exports = {
|
||||
ignores: [(commit) => commit.includes("init")],
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
ignores: [commit => commit.includes('init')],
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
rules: {
|
||||
"type-enum": [
|
||||
'type-enum': [
|
||||
2,
|
||||
"always",
|
||||
'always',
|
||||
[
|
||||
"feat",
|
||||
"fix",
|
||||
"docs",
|
||||
"style",
|
||||
"refactor",
|
||||
"perf",
|
||||
"test",
|
||||
"build",
|
||||
"ci",
|
||||
"chore",
|
||||
"revert",
|
||||
"wip",
|
||||
"mod",
|
||||
"release",
|
||||
'feat',
|
||||
'fix',
|
||||
'docs',
|
||||
'style',
|
||||
'refactor',
|
||||
'perf',
|
||||
'test',
|
||||
'build',
|
||||
'ci',
|
||||
'chore',
|
||||
'revert',
|
||||
'wip',
|
||||
'mod',
|
||||
'release',
|
||||
],
|
||||
],
|
||||
},
|
||||
|
||||
17
components.d.ts
vendored
17
components.d.ts
vendored
@@ -1,11 +1,12 @@
|
||||
// generated by unplugin-vue-components
|
||||
// We suggest you to commit this file into source control
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
import '@vue/runtime-core'
|
||||
|
||||
// biome-ignore lint: disable
|
||||
export {}
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
Auth: typeof import('./src/components/Auth.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']
|
||||
NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
|
||||
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
|
||||
NutPopover: typeof import('@nutui/nutui-taro')['Popover']
|
||||
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
|
||||
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']
|
||||
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
|
||||
NutSwitch: typeof import('@nutui/nutui-taro')['Switch']
|
||||
@@ -46,6 +50,7 @@ declare module '@vue/runtime-core' {
|
||||
Pay: typeof import('./src/components/Pay.vue')['default']
|
||||
Popup: typeof import('./src/components/Popup.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']
|
||||
Upload: typeof import('./src/components/Upload.vue')['default']
|
||||
UserModal: typeof import('./src/components/UserModal.vue')['default']
|
||||
|
||||
@@ -4,7 +4,6 @@ module.exports = {
|
||||
env: {
|
||||
NODE_ENV: '"development"',
|
||||
},
|
||||
defineConstants: {},
|
||||
mini: {},
|
||||
h5: {},
|
||||
};
|
||||
|
||||
@@ -1,31 +1,32 @@
|
||||
// @ts-nocheck
|
||||
import Components from "unplugin-vue-components/webpack";
|
||||
import NutUIResolver from "@nutui/nutui-taro/dist/resolver";
|
||||
import { join } from "node:path";
|
||||
import { argv } from "yargs";
|
||||
|
||||
const { robot = 1, desc } = argv;
|
||||
import Components from 'unplugin-vue-components/webpack';
|
||||
import NutUIResolver from '@nutui/nutui-taro/dist/resolver';
|
||||
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack';
|
||||
import { join } from 'node:path';
|
||||
import { argv } from 'yargs';
|
||||
|
||||
const CIPluginOptFn = async () => {
|
||||
/**
|
||||
* @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions
|
||||
* @typedef { import('@tarojs/plugin-mini-ci').CIOptions } CIOptions
|
||||
* @type {CIOptions}
|
||||
*/
|
||||
|
||||
const parsedArgs = await argv;
|
||||
|
||||
return {
|
||||
weapp: {
|
||||
appid: process.env.TARO_APP_ID,
|
||||
privateKeyPath: process.env.TARO_APP_KEY,
|
||||
robot,
|
||||
robot: parsedArgs.robot || 1,
|
||||
},
|
||||
desc,
|
||||
desc: parsedArgs.desc,
|
||||
};
|
||||
};
|
||||
|
||||
const config = {
|
||||
projectName: "taroApp",
|
||||
date: "2023-8-13",
|
||||
projectName: 'taroApp',
|
||||
date: '2023-8-13',
|
||||
designWidth(input: { file: string }) {
|
||||
if (input?.file?.replace(/\\+/g, "/").indexOf("@nutui") > -1) {
|
||||
if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) {
|
||||
return 375;
|
||||
}
|
||||
return 750;
|
||||
@@ -36,34 +37,47 @@ const config = {
|
||||
828: 1.81 / 2,
|
||||
375: 2,
|
||||
},
|
||||
sourceRoot: "src",
|
||||
outputRoot: "dist",
|
||||
plugins: ["@tarojs/plugin-html", ["@tarojs/plugin-mini-ci", CIPluginOptFn]],
|
||||
sourceRoot: 'src',
|
||||
outputRoot: `dist/${process.env.TARO_ENV}`,
|
||||
plugins: ['@tarojs/plugin-html', ['@tarojs/plugin-mini-ci', CIPluginOptFn]],
|
||||
defineConstants: {},
|
||||
copy: {
|
||||
patterns: [],
|
||||
options: {},
|
||||
},
|
||||
framework: "vue3",
|
||||
framework: 'vue3',
|
||||
compiler: {
|
||||
type: "webpack5",
|
||||
prebundle: { enable: false },
|
||||
type: 'webpack5',
|
||||
prebundle: { enable: process.env.TARO_ENV === 'h5' },
|
||||
},
|
||||
cache: {
|
||||
enable: false, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
||||
},
|
||||
sass: {
|
||||
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`,
|
||||
silenceDeprecations: ['import'],
|
||||
},
|
||||
alias: {
|
||||
"@": join(__dirname, "..", "src"),
|
||||
'@': join(__dirname, '..', 'src'),
|
||||
},
|
||||
mini: {
|
||||
webpackChain(chain) {
|
||||
chain.plugin("unplugin-vue-components").use(
|
||||
chain.merge({
|
||||
plugin: {
|
||||
install: {
|
||||
plugin: UnifiedWebpackPluginV5,
|
||||
args: [
|
||||
{
|
||||
appType: 'taro',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
chain.plugin('unplugin-vue-components').use(
|
||||
Components({
|
||||
resolvers: [NutUIResolver({ taro: true })],
|
||||
})
|
||||
}),
|
||||
);
|
||||
},
|
||||
miniCssExtractPluginOption: {
|
||||
@@ -75,6 +89,7 @@ const config = {
|
||||
enable: true,
|
||||
config: {
|
||||
// selectorBlackList: ['nut-']
|
||||
removeCursorStyle: false,
|
||||
},
|
||||
},
|
||||
url: {
|
||||
@@ -86,23 +101,23 @@ const config = {
|
||||
cssModules: {
|
||||
enable: true, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||
config: {
|
||||
namingPattern: "module", // 转换模式,取值为 global/module
|
||||
generateScopedName: "[name]__[local]___[hash:base64:5]",
|
||||
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
h5: {
|
||||
webpackChain(chain) {
|
||||
chain.plugin("unplugin-vue-components").use(
|
||||
chain.plugin('unplugin-vue-components').use(
|
||||
Components({
|
||||
resolvers: [NutUIResolver({ taro: true })],
|
||||
})
|
||||
}),
|
||||
);
|
||||
},
|
||||
publicPath: "/",
|
||||
staticDirectory: "static",
|
||||
esnextModules: ["nutui-taro", "icons-vue-taro"],
|
||||
publicPath: '/',
|
||||
staticDirectory: 'static',
|
||||
esnextModules: ['nutui-taro', 'icons-vue-taro'],
|
||||
postcss: {
|
||||
autoprefixer: {
|
||||
enable: true,
|
||||
@@ -111,8 +126,8 @@ const config = {
|
||||
cssModules: {
|
||||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||
config: {
|
||||
namingPattern: "module", // 转换模式,取值为 global/module
|
||||
generateScopedName: "[name]__[local]___[hash:base64:5]",
|
||||
namingPattern: 'module', // 转换模式,取值为 global/module
|
||||
generateScopedName: '[name]__[local]___[hash:base64:5]',
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -120,8 +135,8 @@ const config = {
|
||||
};
|
||||
|
||||
module.exports = function (merge) {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return merge({}, config, require("./dev"));
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
return merge({}, config, require('./dev'));
|
||||
}
|
||||
return merge({}, config, require("./prod"));
|
||||
return merge({}, config, require('./prod'));
|
||||
};
|
||||
|
||||
@@ -4,7 +4,6 @@ module.exports = {
|
||||
env: {
|
||||
NODE_ENV: '"production"',
|
||||
},
|
||||
defineConstants: {},
|
||||
mini: {},
|
||||
h5: {
|
||||
/**
|
||||
|
||||
230
package.json
230
package.json
@@ -1,115 +1,119 @@
|
||||
{
|
||||
"name": "jdt-user",
|
||||
"version": "3.0.11",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"templateInfo": {
|
||||
"name": "jdt-user",
|
||||
"typescript": true,
|
||||
"css": "sass"
|
||||
},
|
||||
"taroConfig": {
|
||||
"version": "3.0.11"
|
||||
},
|
||||
"scripts": {
|
||||
"build:weapp": "taro build --type weapp",
|
||||
"build:test": "taro build --type weapp --mode test",
|
||||
"build:swan": "taro build --type swan",
|
||||
"build:alipay": "taro build --type alipay",
|
||||
"build:tt": "taro build --type tt",
|
||||
"build:h5": "taro build --type h5",
|
||||
"build:rn": "taro build --type rn",
|
||||
"build:qq": "taro build --type qq",
|
||||
"build:jd": "taro build --type jd",
|
||||
"build:quickapp": "taro build --type quickapp",
|
||||
"dev:weapp": "taro build --type weapp --watch",
|
||||
"dev:swan": "npm run build:swan -- --watch",
|
||||
"dev:alipay": "npm run build:alipay -- --watch",
|
||||
"dev:tt": "npm run build:tt -- --watch",
|
||||
"dev:h5": "npm run build:h5 -- --watch",
|
||||
"dev:rn": "npm run build:rn -- --watch",
|
||||
"dev:qq": "npm run build:qq -- --watch",
|
||||
"dev:jd": "npm run build:jd -- --watch",
|
||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||
"lint": "eslint --ext .ts,.vue .",
|
||||
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
||||
"lint:staged": "lint-staged",
|
||||
"prepare": "husky install",
|
||||
"preview": "vite preview",
|
||||
"cz": "cz",
|
||||
"lf": "npx prettier --write --end-of-line lf .",
|
||||
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
||||
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 3 versions",
|
||||
"Android >= 4.1",
|
||||
"ios >= 8"
|
||||
],
|
||||
"author": "",
|
||||
"lint-staged": {
|
||||
"*.{ts,vue}": [
|
||||
"eslint --ext .ts,.vue .",
|
||||
"npx prettier --write --end-of-line lf ."
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "node_modules/cz-customizable"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.23.5",
|
||||
"@nutui/icons-vue-taro": "^0.0.9",
|
||||
"@nutui/nutui-taro": "^4.3.0",
|
||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||
"@tarojs/components": "3.6.23",
|
||||
"@tarojs/helper": "3.6.23",
|
||||
"@tarojs/plugin-framework-vue3": "3.6.23",
|
||||
"@tarojs/plugin-html": "3.6.23",
|
||||
"@tarojs/plugin-platform-alipay": "3.6.23",
|
||||
"@tarojs/plugin-platform-h5": "3.6.23",
|
||||
"@tarojs/plugin-platform-jd": "3.6.23",
|
||||
"@tarojs/plugin-platform-qq": "3.6.23",
|
||||
"@tarojs/plugin-platform-swan": "3.6.23",
|
||||
"@tarojs/plugin-platform-tt": "3.6.23",
|
||||
"@tarojs/plugin-platform-weapp": "3.6.23",
|
||||
"@tarojs/runtime": "3.6.23",
|
||||
"@tarojs/shared": "3.6.23",
|
||||
"@tarojs/taro": "3.6.23",
|
||||
"dayjs": "^1.11.10",
|
||||
"pinia": "^2.1.7",
|
||||
"vue": "^3.3.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
"@commitlint/cli": "^18.4.3",
|
||||
"@commitlint/config-conventional": "^18.4.3",
|
||||
"@tarojs/cli": "3.6.23",
|
||||
"@tarojs/plugin-mini-ci": "3.6.23",
|
||||
"@tarojs/taro-loader": "3.6.23",
|
||||
"@tarojs/webpack5-runner": "3.6.23",
|
||||
"@types/node": "^18.19.1",
|
||||
"@types/webpack-env": "^1.18.4",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.1",
|
||||
"@typescript-eslint/parser": "^6.13.1",
|
||||
"@vue/babel-plugin-jsx": "^1.1.5",
|
||||
"@vue/compiler-sfc": "^3.3.9",
|
||||
"babel-preset-taro": "3.6.23",
|
||||
"commitizen": "^4.3.0",
|
||||
"css-loader": "3.4.2",
|
||||
"cz-customizable": "^7.0.0",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-config-taro": "3.6.23",
|
||||
"eslint-plugin-vue": "^9.19.2",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.1.0",
|
||||
"style-loader": "1.3.0",
|
||||
"stylelint": "9.3.0",
|
||||
"ts-node": "^10.9.1",
|
||||
"typescript": "^4.9.5",
|
||||
"unplugin-vue-components": "^0.23.0",
|
||||
"vue-loader": "^17.3.1",
|
||||
"webpack": "^5.89.0"
|
||||
}
|
||||
"name": "jdt-user",
|
||||
"version": "4.0.18",
|
||||
"taroConfig": {
|
||||
"version": "4.0.18"
|
||||
},
|
||||
"scripts": {
|
||||
"build:weapp": "taro build --type weapp",
|
||||
"build:test": "taro build --type weapp --mode reserve",
|
||||
"build:swan": "taro build --type swan",
|
||||
"build:alipay": "taro build --type alipay",
|
||||
"build:tt": "taro build --type tt",
|
||||
"build:h5": "taro build --type h5",
|
||||
"build:rn": "taro build --type rn",
|
||||
"build:qq": "taro build --type qq",
|
||||
"build:jd": "taro build --type jd",
|
||||
"build:quickapp": "taro build --type quickapp",
|
||||
"dev:weapp": "taro build --type weapp --watch",
|
||||
"dev:weapp:prview": "taro build --type weapp --watch --mode reserve",
|
||||
"dev:swan": "npm run build:swan -- --watch",
|
||||
"dev:alipay": "npm run build:alipay -- --watch",
|
||||
"dev:tt": "npm run build:tt -- --watch",
|
||||
"dev:h5": "npm run build:h5 -- --watch",
|
||||
"dev:rn": "npm run build:rn -- --watch",
|
||||
"dev:qq": "npm run build:qq -- --watch",
|
||||
"dev:jd": "npm run build:jd -- --watch",
|
||||
"dev:quickapp": "npm run build:quickapp -- --watch",
|
||||
"lint": "eslint --ext .ts,.vue .",
|
||||
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
||||
"lint:staged": "lint-staged",
|
||||
"prepare": "husky install",
|
||||
"cz": "cz",
|
||||
"postinstall": "weapp-tw patch",
|
||||
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
||||
"build:weapp:reserve:upload": "taro build --type weapp --upload --robot=3 --desc='备用环境' --mode reserve",
|
||||
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
||||
},
|
||||
"browserslist": [
|
||||
"last 3 versions",
|
||||
"Android >= 4.1",
|
||||
"ios >= 8"
|
||||
],
|
||||
"author": "JDT",
|
||||
"lint-staged": {
|
||||
"*.{ts,vue}": [
|
||||
"eslint --ext .ts,.vue ."
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"commitizen": {
|
||||
"path": "node_modules/cz-customizable"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.28.4",
|
||||
"@nutui/icons-vue-taro": "^0.0.9",
|
||||
"@nutui/nutui-taro": "^4.3.14",
|
||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||
"@tarojs/components": "4.1.6",
|
||||
"@tarojs/helper": "4.1.6",
|
||||
"@tarojs/plugin-framework-vue3": "4.1.6",
|
||||
"@tarojs/plugin-html": "4.1.6",
|
||||
"@tarojs/plugin-platform-alipay": "4.1.6",
|
||||
"@tarojs/plugin-platform-h5": "4.1.6",
|
||||
"@tarojs/plugin-platform-jd": "4.1.6",
|
||||
"@tarojs/plugin-platform-qq": "4.1.6",
|
||||
"@tarojs/plugin-platform-swan": "4.1.6",
|
||||
"@tarojs/plugin-platform-tt": "4.1.6",
|
||||
"@tarojs/plugin-platform-weapp": "4.1.6",
|
||||
"@tarojs/runtime": "4.1.6",
|
||||
"@tarojs/shared": "4.1.6",
|
||||
"@tarojs/taro": "4.1.6",
|
||||
"dayjs": "^1.11.18",
|
||||
"pinia": "^2.3.1",
|
||||
"uqrcodejs": "^4.0.7",
|
||||
"vue": "^3.5.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.4",
|
||||
"@commitlint/cli": "^18.6.1",
|
||||
"@commitlint/config-conventional": "^18.6.3",
|
||||
"@tarojs/cli": "4.1.6",
|
||||
"@tarojs/plugin-mini-ci": "4.1.6",
|
||||
"@tarojs/taro-loader": "4.1.6",
|
||||
"@tarojs/webpack5-runner": "4.1.6",
|
||||
"@types/node": "^18.19.124",
|
||||
"@types/webpack-env": "^1.18.8",
|
||||
"@types/yargs": "^17.0.33",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@unocss/webpack": "^0.60.4",
|
||||
"@vue/babel-plugin-jsx": "^1.5.0",
|
||||
"@vue/compiler-sfc": "^3.5.21",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"babel-preset-taro": "4.1.6",
|
||||
"commitizen": "^4.3.1",
|
||||
"css-loader": "3.4.2",
|
||||
"cz-customizable": "^7.5.1",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-taro": "4.1.6",
|
||||
"eslint-plugin-vue": "^9.33.0",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.5.2",
|
||||
"miniprogram-ci": "^2.1.26",
|
||||
"postcss": "8.4.29",
|
||||
"postcss-rem-to-responsive-pixel": "^6.1.0",
|
||||
"prettier": "^3.6.2",
|
||||
"style-loader": "1.3.0",
|
||||
"stylelint": "9.3.0",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.9.2",
|
||||
"unplugin-vue-components": "^28.8.0",
|
||||
"vue-loader": "^17.4.2",
|
||||
"weapp-tailwindcss": "^3.7.0",
|
||||
"webpack": "^5.101.3",
|
||||
"yargs": "^17.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
18023
pnpm-lock.yaml
generated
18023
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",
|
||||
"projectname": "taroApp",
|
||||
"miniprogramRoot": "dist/",
|
||||
"projectname": "捷兑通",
|
||||
"description": "",
|
||||
"setting": {
|
||||
"urlCheck": true,
|
||||
"es6": false,
|
||||
"enhance": false,
|
||||
"es6": true,
|
||||
"enhance": true,
|
||||
"compileHotReLoad": false,
|
||||
"postcss": false,
|
||||
"minified": false
|
||||
"postcss": true,
|
||||
"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) =>
|
||||
request("/user/cancelPointOrder", data, "POST");
|
||||
request('/user/cancelPointOrder', data, 'POST');
|
||||
|
||||
// 活动订单核销
|
||||
export const activeOrderVerify = (data: object) =>
|
||||
request("/user/cancelOrder", data, "POST");
|
||||
request('/user/cancelOrder', data, 'POST');
|
||||
|
||||
// 获取订单统计
|
||||
export const orderStatistics = (data: object) =>
|
||||
request("/store/order/count", data, "POST");
|
||||
request('/store/order/count', data, 'POST');
|
||||
|
||||
// 获取商家积分订单列表
|
||||
export const getJfOrderList = (data: object) =>
|
||||
request("/store/point/order", data, "POST");
|
||||
request('/store/point/order', data, 'POST');
|
||||
|
||||
// 获取商家活动订单列表
|
||||
export const getActiveOrderList = (data: object) =>
|
||||
request("/store/order", data, "POST");
|
||||
request('/store/order', data, 'POST');
|
||||
|
||||
// 获取积分核销列表
|
||||
export const getJfVerifyList = (data: object) =>
|
||||
request("/point/order/details", data, "POST");
|
||||
request('/point/order/details', data, 'POST');
|
||||
|
||||
// 获取活动核销列表
|
||||
export const getActiveVerifyList = (data: object) =>
|
||||
request("/order/details", data, "POST");
|
||||
request('/order/details', data, 'POST');
|
||||
|
||||
// 增长率统计
|
||||
export const growthRate = (data: object) =>
|
||||
request("/store/date/count", data, "POST");
|
||||
request('/store/date/count', data, 'POST');
|
||||
|
||||
// 获取提现列表
|
||||
export const getWithdrawList = (data: object) =>
|
||||
request("/store/withdraw", data, "POST");
|
||||
request('/store/withdraw', data, 'POST');
|
||||
|
||||
// 获取提现列表
|
||||
export const addWithdraw = (data: object) =>
|
||||
request("/store/withdraw/set", data, "POST");
|
||||
request('/store/withdraw/set', data, 'POST');
|
||||
|
||||
/**
|
||||
* 后结api
|
||||
@@ -46,24 +46,36 @@ export const addWithdraw = (data: object) =>
|
||||
|
||||
// 创建后结订单
|
||||
export const createAfterOrder = (data: object) =>
|
||||
request("/later/order/place", data, "POST");
|
||||
request('/later/order/place', data, 'POST');
|
||||
|
||||
// 获取商家后结订单列表
|
||||
export const getAfterOrderList = (data: object) =>
|
||||
request("/later/store/user/order", data, "POST");
|
||||
request('/later/store/user/order', data, 'POST');
|
||||
|
||||
// 获取单个后结订单
|
||||
export const getAfterOrder = (data: object) =>
|
||||
request("/later/order/details", data, "POST");
|
||||
request('/later/order/details', data, 'POST');
|
||||
|
||||
// 确定挂帐
|
||||
export const confirmAfterOrder = (data: object) =>
|
||||
request("/later/order/onAccount", data, "POST");
|
||||
request('/later/order/onAccount', data, 'POST');
|
||||
|
||||
// 修改台号/备注
|
||||
export const editAfterOrder = (data: object) =>
|
||||
request("/later/order/edit", data, "POST");
|
||||
request('/later/order/edit', data, 'POST');
|
||||
|
||||
// 生成付款二维码
|
||||
export const createPayQr = (data: object) =>
|
||||
request("/later/order/pay", data, "POST");
|
||||
request('/later/order/pay', data, 'POST');
|
||||
|
||||
// 检查手机号码是否存在
|
||||
export const checkPhone = (data: object) =>
|
||||
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) =>
|
||||
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) =>
|
||||
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) =>
|
||||
request("/point/details", data, "POST");
|
||||
request('/point/details', data, 'POST');
|
||||
|
||||
// 积分商品下单
|
||||
export const createOrder = (data: object) =>
|
||||
request("/point/place", data, "POST");
|
||||
request('/point/place', data, 'POST');
|
||||
|
||||
// 确认付款
|
||||
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) =>
|
||||
request("/goods/details", data, "POST");
|
||||
request('/goods/details', data, 'POST');
|
||||
|
||||
// 创建订单
|
||||
export const createActiveOrder = (data: object) =>
|
||||
request("/order/place", data, "POST");
|
||||
request('/order/place', data, 'POST');
|
||||
|
||||
// 活动订单列表
|
||||
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) =>
|
||||
request("/user/order/remove", data, "POST");
|
||||
request('/user/order/remove', data, 'POST');
|
||||
|
||||
// 积分订单删除
|
||||
export const deleteJfOrder = (data: object) =>
|
||||
request("/user/point/remove", data, "POST");
|
||||
request('/user/point/remove', data, 'POST');
|
||||
|
||||
// 获取分类商品
|
||||
export const getCategoryGoods = (data: object) =>
|
||||
request("/class/goods/list", data, "POST");
|
||||
request('/class/goods/list', data, 'POST');
|
||||
|
||||
// 获取商家列表
|
||||
export const getMerList = (data: object) =>
|
||||
request("/store/list", data, "POST");
|
||||
request('/store/list', data, 'POST');
|
||||
|
||||
// 获取商家商品分类
|
||||
export const getMerCategory = (data: object) =>
|
||||
request("/store/classify", data, "POST");
|
||||
request('/store/classify', data, 'POST');
|
||||
|
||||
// 获取商家商品
|
||||
export const getGoodList = (data: object) =>
|
||||
request("/store/goods", data, "POST");
|
||||
request('/store/goods', data, 'POST');
|
||||
|
||||
// // 获取活动商家列表
|
||||
// export const getHotMerList = (data: object) =>
|
||||
@@ -77,4 +77,23 @@ export const getGoodList = (data: object) =>
|
||||
|
||||
// 获取全部商家类目
|
||||
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) =>
|
||||
request("/order/confirmOrder", data, "POST");
|
||||
request('/order/confirmOrder', data, 'POST');
|
||||
|
||||
// 获取订单统计
|
||||
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) =>
|
||||
request("/store/goods", data, "POST");
|
||||
request('/store/goods', data, 'POST');
|
||||
|
||||
// 商品添加
|
||||
export const addGood = (data: object) =>
|
||||
request("/store/goods/edit", data, "POST");
|
||||
request('/store/goods/edit', data, 'POST');
|
||||
|
||||
@@ -1,78 +1,89 @@
|
||||
import request from "@/utils/request";
|
||||
import request from '@/utils/request';
|
||||
|
||||
// 获取用户协议
|
||||
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) =>
|
||||
request("/phone/login", data, "POST");
|
||||
request('/phone/login', data, 'POST');
|
||||
|
||||
// 获取用户信息
|
||||
// export const getUserInfo = () => request("/user/detail", {}, "GET");
|
||||
|
||||
// 获取短信验证码
|
||||
export const getVerifyCode = (data: object) =>
|
||||
request("/getSmsCode", data, "POST");
|
||||
request('/getSmsCode', data, 'POST');
|
||||
|
||||
// 商家入驻申请
|
||||
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) =>
|
||||
request("/user/pointOrder", data, "POST");
|
||||
request('/user/pointOrder', data, 'POST');
|
||||
|
||||
// 修改个人信息
|
||||
export const editPersonalInfo = (data: object) =>
|
||||
request("/user/editInfo", data, "POST");
|
||||
request('/user/editInfo', data, 'POST');
|
||||
|
||||
// 积分明细
|
||||
export const getIntegralDetail = (data: object) =>
|
||||
request("/user/pulseRecord", data, "POST");
|
||||
request('/user/pulseRecord', data, 'POST');
|
||||
|
||||
// 豆子明细
|
||||
export const getBeanDetail = (data: object) =>
|
||||
request("/user/pointRecord", data, "POST");
|
||||
request('/user/pointRecord', data, 'POST');
|
||||
|
||||
// 授权手机号
|
||||
export const getPhone = (data: object) =>
|
||||
request("/user/getPhone", data, "POST");
|
||||
request('/user/getPhone', data, 'POST');
|
||||
|
||||
// 获取推广积分明细
|
||||
export const getTGIntegralDetail = (data: object) =>
|
||||
request("/user/referee/point", data, "POST");
|
||||
request('/user/referee/point', data, 'POST');
|
||||
|
||||
// 获取推广用户列表
|
||||
export const getTGUserList = (data: object) =>
|
||||
request("/user/referee/list", data, "POST");
|
||||
request('/user/referee/list', data, 'POST');
|
||||
|
||||
// 绑定上级
|
||||
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) =>
|
||||
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) =>
|
||||
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');
|
||||
|
||||
/**
|
||||
* 用户后结订单
|
||||
@@ -80,8 +91,8 @@ export const getGiftRecord = (data: object) =>
|
||||
|
||||
// 获取用户后结订单列表
|
||||
export const getUserAfterOrderList = (data: object) =>
|
||||
request("/later/user/order", data, "POST");
|
||||
request('/later/user/order', data, 'POST');
|
||||
|
||||
// 获取用户后结订单详情
|
||||
export const getUserAfterOrderDetail = (data: object) =>
|
||||
request("/later/order/details", data, "POST");
|
||||
request('/later/order/details', data, 'POST');
|
||||
|
||||
@@ -1,123 +1,129 @@
|
||||
export default defineAppConfig({
|
||||
pages: [
|
||||
"pages/index/index",
|
||||
"pages/category/index",
|
||||
"pages/cart/index",
|
||||
"pages/user/index",
|
||||
"pages/allClassList/index",
|
||||
'pages/index/index',
|
||||
'pages/game/gamehome/index',
|
||||
'pages/cart/index',
|
||||
'pages/user/index',
|
||||
'pages/allClassList/index',
|
||||
'pages/game/gamedetail/index',
|
||||
'pages/game/view/index',
|
||||
'pages/fastBuy/index',
|
||||
],
|
||||
subPackages: [
|
||||
{
|
||||
root: "pages/users",
|
||||
root: 'pages/users',
|
||||
pages: [
|
||||
"order_list/index",
|
||||
"setting/index",
|
||||
"user_setting/index",
|
||||
"settled_mer/index",
|
||||
"order_list_detail/index",
|
||||
"account/index",
|
||||
"distribution/index",
|
||||
"distribution/integral/index",
|
||||
"distribution/userlist/index",
|
||||
"login/index",
|
||||
"bindPhone/index",
|
||||
"pending_order/index",
|
||||
"pending_order/pending_order_detail/index"
|
||||
'user_agreement/index',
|
||||
'order_list/index',
|
||||
'setting/index',
|
||||
'user_setting/index',
|
||||
'settled_mer/index',
|
||||
'order_list_detail/index',
|
||||
'account/index',
|
||||
'distribution/index',
|
||||
'distribution/integral/index',
|
||||
'distribution/userlist/index',
|
||||
'login/index',
|
||||
'bindPhone/index',
|
||||
'pending_order/index',
|
||||
'pending_order/pending_order_detail/index',
|
||||
'pwd/index',
|
||||
],
|
||||
},
|
||||
{
|
||||
root: "pages/goods",
|
||||
pages: ["goods_detail/index", "order_create/index", "order_status/index"],
|
||||
},
|
||||
{
|
||||
root: "pages/admin",
|
||||
root: 'pages/goods',
|
||||
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",
|
||||
'goods_detail/index',
|
||||
'order_create/index',
|
||||
'order_status/index',
|
||||
'pay/index',
|
||||
],
|
||||
},
|
||||
{
|
||||
root: "pages/product",
|
||||
pages: ["list/index", "addGoods/index"],
|
||||
root: 'pages/admin',
|
||||
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",
|
||||
pages: ["gamehome/index", "gamedetail/index", "gameview/index"],
|
||||
root: 'pages/product',
|
||||
pages: ['list/index', 'addGoods/index'],
|
||||
},
|
||||
{
|
||||
root: "pages/hotGoods",
|
||||
pages: ["index/index", "hot_list/index"],
|
||||
root: 'pages/hotGoods',
|
||||
pages: ['index/index', 'hot_list/index'],
|
||||
},
|
||||
{
|
||||
root: "pages/mer",
|
||||
pages: ["mer_detail/index"],
|
||||
root: 'pages/mer',
|
||||
pages: ['mer_detail/index'],
|
||||
},
|
||||
{
|
||||
root: "pages/marketing",
|
||||
pages: ["sign/index"],
|
||||
root: 'pages/marketing',
|
||||
pages: ['sign/index', 'yq/index', 'scratch/index'],
|
||||
},
|
||||
{
|
||||
root: "pages/search",
|
||||
pages: ["index"],
|
||||
root: 'pages/search',
|
||||
pages: ['index'],
|
||||
},
|
||||
],
|
||||
window: {
|
||||
backgroundTextStyle: "light",
|
||||
navigationBarBackgroundColor: "#fff",
|
||||
navigationBarTitleText: "WeChat",
|
||||
navigationBarTextStyle: "black",
|
||||
backgroundTextStyle: 'light',
|
||||
navigationBarBackgroundColor: '#fff',
|
||||
navigationBarTitleText: 'WeChat',
|
||||
navigationBarTextStyle: 'black',
|
||||
},
|
||||
tabBar: {
|
||||
color: "#666666",
|
||||
selectedColor: "#ff0000",
|
||||
backgroundColor: "#ffffff",
|
||||
borderStyle: "white",
|
||||
color: '#666666',
|
||||
selectedColor: '#ff0000',
|
||||
backgroundColor: '#ffffff',
|
||||
borderStyle: 'white',
|
||||
list: [
|
||||
{
|
||||
pagePath: "pages/index/index",
|
||||
iconPath: "static/tabbar/1-001.png",
|
||||
selectedIconPath: "static/tabbar/1-002.png",
|
||||
text: "首页",
|
||||
pagePath: 'pages/index/index',
|
||||
iconPath: 'static/tabbar/1-0.png',
|
||||
selectedIconPath: 'static/tabbar/1-1.png',
|
||||
text: '首页',
|
||||
},
|
||||
// {
|
||||
// pagePath: "pages/category/index",
|
||||
// iconPath: "static/tabbar/2-001.png",
|
||||
// selectedIconPath: "static/tabbar/2-002.png",
|
||||
// text: "分类",
|
||||
// pagePath: 'pages/game/gamehome/index',
|
||||
// iconPath: 'static/tabbar/2-0.png',
|
||||
// selectedIconPath: 'static/tabbar/2-1.png',
|
||||
// text: '游戏',
|
||||
// },
|
||||
{
|
||||
pagePath: "pages/cart/index",
|
||||
iconPath: "static/tabbar/3-001.png",
|
||||
selectedIconPath: "static/tabbar/3-002.png",
|
||||
text: "购物车",
|
||||
pagePath: 'pages/cart/index',
|
||||
iconPath: 'static/tabbar/3-0.png',
|
||||
selectedIconPath: 'static/tabbar/3-1.png',
|
||||
text: '购物车',
|
||||
},
|
||||
{
|
||||
pagePath: "pages/user/index",
|
||||
iconPath: "static/tabbar/4-001.png",
|
||||
selectedIconPath: "static/tabbar/4-002.png",
|
||||
text: "我的",
|
||||
pagePath: 'pages/user/index',
|
||||
iconPath: 'static/tabbar/4-0.png',
|
||||
selectedIconPath: 'static/tabbar/4-1.png',
|
||||
text: '我的',
|
||||
},
|
||||
],
|
||||
},
|
||||
permission: {
|
||||
"scope.userLocation": {
|
||||
desc: "你的位置信息将用于小程序位置接口的效果展示",
|
||||
'scope.userLocation': {
|
||||
desc: '你的位置信息将用于小程序位置接口的效果展示',
|
||||
},
|
||||
},
|
||||
requiredBackgroundModes: ["audio", "location"],
|
||||
requiredBackgroundModes: ['audio', 'location'],
|
||||
// @ts-ignore
|
||||
requiredPrivateInfos: ["getLocation"],
|
||||
lazyCodeLoading: "requiredComponents",
|
||||
requiredPrivateInfos: ['getLocation'],
|
||||
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 {
|
||||
background-color: #f5f5f5;
|
||||
font-size: 30rpx;
|
||||
// IOS安全区域
|
||||
padding-bottom: constant(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 "./app.scss";
|
||||
import Taro from "@tarojs/taro";
|
||||
// import * as Sentry from "sentry-miniapp";
|
||||
import { createApp } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import './app.scss';
|
||||
|
||||
// 小程序场景值
|
||||
const scenes = [1007, 1008, 1011, 1012, 1013, 1047, 1048, 1049];
|
||||
|
||||
// Sentry.init({
|
||||
// dsn: "https://47703e01ba4344b8b252c15e8fd980fd@sentry.io/1528228",
|
||||
// });
|
||||
|
||||
const App = createApp({
|
||||
onLaunch(options: {
|
||||
path: string;
|
||||
@@ -19,20 +14,20 @@ const App = createApp({
|
||||
referrerInfo: object | any;
|
||||
}) {
|
||||
// 检测更新
|
||||
if (Taro.canIUse("getUpdateManager") && options.scene !== 1154) {
|
||||
if (Taro.canIUse('getUpdateManager') && options.scene !== 1154) {
|
||||
const updateManager = Taro.getUpdateManager();
|
||||
updateManager.onCheckForUpdate(function (res) {
|
||||
if (res.hasUpdate) {
|
||||
updateManager.onUpdateFailed(function () {
|
||||
return Taro.showToast({
|
||||
title: "新版本下载失败",
|
||||
icon: "none",
|
||||
title: '新版本下载失败',
|
||||
icon: 'none',
|
||||
});
|
||||
});
|
||||
updateManager.onUpdateReady(function () {
|
||||
Taro.showModal({
|
||||
title: "更新提示",
|
||||
content: "新版本已经下载好,是否重启当前应用?",
|
||||
title: '更新提示',
|
||||
content: '新版本已经下载好,是否重启当前应用?',
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
updateManager.applyUpdate();
|
||||
@@ -42,8 +37,8 @@ const App = createApp({
|
||||
});
|
||||
updateManager.onUpdateFailed(function () {
|
||||
Taro.showModal({
|
||||
title: "发现新版本",
|
||||
content: "请删除当前小程序,重启搜索打开...",
|
||||
title: '发现新版本',
|
||||
content: '请删除当前小程序,重启搜索打开...',
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -55,10 +50,10 @@ const App = createApp({
|
||||
if (scenes.includes(options.scene)) {
|
||||
if (options.query.scene) {
|
||||
Taro.showToast({
|
||||
title: "已检测到推荐人",
|
||||
icon: "none",
|
||||
title: '已检测到推荐人',
|
||||
icon: 'none',
|
||||
});
|
||||
Taro.setStorageSync("bind_id", options.query.scene);
|
||||
Taro.setStorageSync('bind_id', options.query.scene);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
// import { computed, ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { login } from "@/api/user";
|
||||
import Taro from '@tarojs/taro';
|
||||
import { login } from '@/api/user';
|
||||
|
||||
defineProps({
|
||||
visible: {
|
||||
@@ -25,20 +25,20 @@ defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["update:visible", "ok"]);
|
||||
const emit = defineEmits(['update:visible', 'ok']);
|
||||
|
||||
const onCancel = () => {
|
||||
emit("update:visible", false);
|
||||
emit('update:visible', false);
|
||||
};
|
||||
|
||||
const onOk = () => {
|
||||
Taro.showLoading({
|
||||
title: "正在授权中",
|
||||
title: '正在授权中',
|
||||
mask: true,
|
||||
});
|
||||
Taro.getUserProfile({
|
||||
desc: "完善用户资料",
|
||||
success: async (user) => {
|
||||
desc: '完善用户资料',
|
||||
success: async user => {
|
||||
Taro.login({
|
||||
success: async ({ code }) => {
|
||||
try {
|
||||
@@ -47,16 +47,16 @@ const onOk = () => {
|
||||
nickName: user.userInfo.nickName,
|
||||
avatarUrl: user.userInfo.avatarUrl,
|
||||
});
|
||||
Taro.setStorageSync("token", data.token);
|
||||
emit("ok", false);
|
||||
Taro.setStorageSync('token', data.token);
|
||||
emit('ok', false);
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.message,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
fail: err => {
|
||||
console.log(err);
|
||||
},
|
||||
complete: () => {
|
||||
@@ -64,7 +64,7 @@ const onOk = () => {
|
||||
},
|
||||
});
|
||||
},
|
||||
fail: (err) => {
|
||||
fail: err => {
|
||||
console.log(err);
|
||||
},
|
||||
complete: () => {
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
<view class="line"></view>
|
||||
<Home class="iconfont" @click="goHome" />
|
||||
</view>
|
||||
<text class="title">{{ props.title }}</text>
|
||||
<text style="width: 2000px; text-align: center">{{ props.title }}</text>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import { computed } from "vue";
|
||||
import { Home, Left } from "@nutui/icons-vue-taro";
|
||||
import Taro from '@tarojs/taro';
|
||||
import { computed } from 'vue';
|
||||
import { Home, Left } from '@nutui/icons-vue-taro';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight as number;
|
||||
const BarHeight = computed(() => statusBarHeight - 7);
|
||||
@@ -20,7 +20,7 @@ const BarHeight = computed(() => statusBarHeight - 7);
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: '',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ const returns = () => {
|
||||
|
||||
const goHome = () => {
|
||||
Taro.switchTab({
|
||||
url: "/pages/index/index",
|
||||
url: '/pages/index/index',
|
||||
});
|
||||
};
|
||||
</script>
|
||||
@@ -66,9 +66,4 @@ const goHome = () => {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 410px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { addCart, getCart, clearCart } from "@/api/cart";
|
||||
import { Del2 } from "@nutui/icons-vue-taro";
|
||||
import { createActiveOrder } from "@/api/goods";
|
||||
import { createAfterOrder } from "@/api/admin";
|
||||
import Pay from "@/components/Pay.vue";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { addCart, getCart, clearCart } from '@/api/cart';
|
||||
import { Plus, Minus } from '@nutui/icons-vue-taro';
|
||||
import { createActiveOrder } from '@/api/goods';
|
||||
import { createAfterOrder, getUserPoint } from '@/api/admin';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
|
||||
interface CardList {
|
||||
name: string;
|
||||
@@ -13,8 +13,10 @@ interface CardList {
|
||||
bid: string;
|
||||
gid: string;
|
||||
number: string;
|
||||
discount_price: string;
|
||||
price: number;
|
||||
exchange: number;
|
||||
discount_integral: number;
|
||||
}
|
||||
|
||||
const show = ref(false);
|
||||
@@ -25,13 +27,12 @@ const props = defineProps({
|
||||
type: Object,
|
||||
},
|
||||
IsPendingOrder: {
|
||||
required: true,
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["updateCart"]);
|
||||
const emit = defineEmits(['updateCart']);
|
||||
|
||||
const openModal = async () => {
|
||||
await get_cart_list();
|
||||
@@ -39,7 +40,11 @@ const openModal = async () => {
|
||||
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 {
|
||||
const res = await addCart({
|
||||
Bid: item.bid,
|
||||
@@ -48,13 +53,13 @@ const add_cart = async (item: CardList, num: number = 1) => {
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
await get_cart_list();
|
||||
await get_cart_list(bid);
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -73,31 +78,35 @@ const card_list = ref<CardList[]>([]);
|
||||
const cartInfo = ref({
|
||||
count: 0,
|
||||
price: 0,
|
||||
discount_price: 0,
|
||||
exchange: 0,
|
||||
discount_integral: 0,
|
||||
});
|
||||
|
||||
const get_cart_list = async () => {
|
||||
const get_cart_list = async (bid: string = props.merInfo.bid) => {
|
||||
try {
|
||||
const res = await getCart({
|
||||
Bid: props.merInfo.bid,
|
||||
Bid: bid,
|
||||
});
|
||||
|
||||
card_list.value = res.data.data || [];
|
||||
cartInfo.value = {
|
||||
count: 0,
|
||||
price: 0,
|
||||
discount_price: 0,
|
||||
exchange: 0,
|
||||
discount_integral: 0,
|
||||
};
|
||||
card_list.value.forEach((item: CardList) => {
|
||||
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.discount_integral += Number(item.discount_integral);
|
||||
});
|
||||
emit("updateCart", res.data.data || []);
|
||||
emit('updateCart', res.data.data || []);
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -111,7 +120,7 @@ const clear_cart = async () => {
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
show.value = false;
|
||||
@@ -125,7 +134,7 @@ const closePay = (val: boolean) => {
|
||||
isShowPay.value = val;
|
||||
orderData.value = [];
|
||||
Taro.redirectTo({
|
||||
url: "/pages/users/order_list/index?type=0",
|
||||
url: '/pages/users/order_list/index?type=0',
|
||||
});
|
||||
};
|
||||
|
||||
@@ -140,25 +149,42 @@ const create_order = async () => {
|
||||
res = await createAfterOrder(data);
|
||||
await get_cart_list();
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${props.merInfo.oid}&bid=${props.merInfo.bid}`,
|
||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
|
||||
});
|
||||
} else {
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const data = await getUserPoint({
|
||||
phone: user_info.data.phone,
|
||||
bid: props.merInfo.bid,
|
||||
});
|
||||
res = await createActiveOrder({
|
||||
Bid: [props.merInfo.bid],
|
||||
custID: data.data.store_user_id,
|
||||
});
|
||||
if (res.data.oid) {
|
||||
orderData.value = res.oid;
|
||||
isShowPay.value = true;
|
||||
orderData.value = {
|
||||
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({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
} catch (e) {
|
||||
if (e.msg === '请先设置交易密码') {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/users/pwd/index',
|
||||
});
|
||||
}
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -172,32 +198,43 @@ defineExpose({
|
||||
<template>
|
||||
<view>
|
||||
<view class="cart" @click.stop="openModal">
|
||||
<view class="container">
|
||||
<view>购物车数量: {{ cartInfo.count }}</view>
|
||||
<view v-if="cartInfo.count > 0">
|
||||
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text
|
||||
>,
|
||||
<text>总积分: {{ cartInfo.exchange.toFixed(2) }}</text>
|
||||
<view class="container flex items-center">
|
||||
<!-- <view>购物车数量: {{ cartInfo.count }}</view> -->
|
||||
<view class="cardImg">
|
||||
<image
|
||||
src="https://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png">
|
||||
</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 v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
|
||||
>立即结算</view
|
||||
>
|
||||
>去结算
|
||||
</view>
|
||||
</view>
|
||||
<!-- 购物车弹窗 -->
|
||||
<nut-popup
|
||||
:style="{ padding: '20rpx' }"
|
||||
:style="{ padding: '15px' }"
|
||||
round
|
||||
position="bottom"
|
||||
z-index="1"
|
||||
:catch-move="true"
|
||||
:safe-area-inset-bottom="true"
|
||||
v-model:visible="show"
|
||||
>
|
||||
v-model:visible="show">
|
||||
<view class="list-header">
|
||||
<view class="left" @click.stop="clear_cart">
|
||||
<Del2 color="#666666" />
|
||||
<text style="color: #666666">清空购物车</text>
|
||||
<!-- <Del2 color="#666666" /> -->
|
||||
<image
|
||||
class="w-[20px] h-[20px]"
|
||||
src="https://p0.meituan.net/csc/db4d11fd744b69435c6ffdc6bfc868c5684.png" />
|
||||
<text class="text-[20px]" style="color: #666666">清空购物车</text>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view :scroll-y="true" class="cart-list">
|
||||
@@ -206,9 +243,12 @@ defineExpose({
|
||||
<image :src="item.cover" />
|
||||
<view class="center">
|
||||
<view class="name">{{ item.name }}</view>
|
||||
<view class="price">
|
||||
|
||||
<view class="price flex">
|
||||
<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>
|
||||
@@ -217,57 +257,93 @@ defineExpose({
|
||||
readonly
|
||||
:min="-1"
|
||||
@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>
|
||||
</scroll-view>
|
||||
<view style="height: 140rpx"></view>
|
||||
<view style="height: 140px"></view>
|
||||
</nut-popup>
|
||||
<!-- 支付 -->
|
||||
<Pay
|
||||
:is-show-pay="isShowPay"
|
||||
v-model:jfInfo="orderData"
|
||||
@closePay="closePay"
|
||||
@successPay="closePay"
|
||||
/>
|
||||
@successPay="closePay" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
$h-border-radius: 50rpx;
|
||||
$h-border-radius: 50px;
|
||||
|
||||
.cart {
|
||||
position: fixed;
|
||||
bottom: 50rpx;
|
||||
bottom: 50px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
z-index: 9999;
|
||||
width: 95%;
|
||||
background-color: red;
|
||||
background-color: #262323;
|
||||
border-radius: $h-border-radius;
|
||||
color: #fff;
|
||||
height: 100rpx;
|
||||
height: 100px;
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.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 {
|
||||
width: 180rpx;
|
||||
height: 100rpx;
|
||||
line-height: 100rpx;
|
||||
width: 200px;
|
||||
height: 100px;
|
||||
line-height: 100px;
|
||||
text-align: center;
|
||||
background-color: #000;
|
||||
background-color: #f83d3d;
|
||||
border-radius: 0 $h-border-radius $h-border-radius 0;
|
||||
}
|
||||
}
|
||||
|
||||
.list-header {
|
||||
margin: 15rpx 0;
|
||||
margin: 15px 0;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
@@ -276,37 +352,47 @@ $h-border-radius: 50rpx;
|
||||
}
|
||||
|
||||
.cart-list {
|
||||
height: 290rpx;
|
||||
height: 290px;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
margin-bottom: 10rpx;
|
||||
margin-bottom: 10px;
|
||||
justify-content: space-between;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
image {
|
||||
width: 130rpx;
|
||||
height: 130rpx;
|
||||
border-radius: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
width: 130px;
|
||||
height: 130px;
|
||||
border-radius: 15px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.center {
|
||||
height: 100%;
|
||||
height: 130px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
justify-content: space-between;
|
||||
|
||||
.price {
|
||||
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>
|
||||
|
||||
@@ -1,60 +1,125 @@
|
||||
<template>
|
||||
<view class="goodBox">
|
||||
<view
|
||||
class="good"
|
||||
v-for="item in merdata"
|
||||
:key="item.ID"
|
||||
@click.stop="toMerDetails(item)"
|
||||
>
|
||||
<image :src="item.head_photo" />
|
||||
<view class="good-text-box">
|
||||
<text class="good-text">{{ item.name }}</text>
|
||||
<text style="color: #999"
|
||||
>距离我{{
|
||||
calculateDistance(
|
||||
userLocalNum.t,
|
||||
userLocalNum.l,
|
||||
Number(item.lat),
|
||||
Number(item.lon)
|
||||
)
|
||||
}}
|
||||
</text>
|
||||
<view class="list-box">
|
||||
<view class="list">
|
||||
<swiper
|
||||
v-if="bannerList.length !== 0"
|
||||
class="item"
|
||||
:style="{
|
||||
height: '250px',
|
||||
}"
|
||||
indicator-color="#EDEDED"
|
||||
indicator-active-color="#F83D3D"
|
||||
:circular="true"
|
||||
:indicator-dots="true"
|
||||
:autoplay="true">
|
||||
<swiper-item v-for="(item, index) in bannerList" :key="index">
|
||||
<image
|
||||
:style="{
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
}"
|
||||
: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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { calculateDistance } from "@/utils";
|
||||
import { bindParent } from "@/api/user";
|
||||
import { getMerList } from "@/api/goods";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { calculateDistance, parseQueryString } from '@/utils';
|
||||
import { bindParent, getBanner } from '@/api/user';
|
||||
import { getMerList } from '@/api/goods';
|
||||
|
||||
const props = defineProps({
|
||||
classId: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
const classId = defineModel({ default: 0 });
|
||||
|
||||
const list1 = ref<Array<MerData>>([]);
|
||||
const list2 = ref<Array<MerData>>([]);
|
||||
|
||||
Taro.useLoad(() => {
|
||||
init();
|
||||
});
|
||||
|
||||
Taro.useDidShow(async () => {
|
||||
const init = async () => {
|
||||
Taro.showLoading({
|
||||
title: '加载中',
|
||||
});
|
||||
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 {
|
||||
const res = await bindParent({
|
||||
uid: Taro.getStorageSync("bind_id"),
|
||||
uid: Taro.getStorageSync('bind_id'),
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
});
|
||||
Taro.removeStorageSync("bind_id");
|
||||
Taro.removeStorageSync('bind_id');
|
||||
} catch (error) {
|
||||
Taro.removeStorageSync("bind_id");
|
||||
Taro.removeStorageSync('bind_id');
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
});
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
interface MerData {
|
||||
ID: number;
|
||||
@@ -71,79 +136,132 @@ const userLocalNum = ref({
|
||||
t: 0,
|
||||
});
|
||||
|
||||
const pageVal = ref({
|
||||
page: 1,
|
||||
total: 0,
|
||||
});
|
||||
|
||||
const get_mer_list = async () => {
|
||||
Taro.getLocation({
|
||||
type: "wgs84",
|
||||
success: (res) => {
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
userLocalNum.value.l = res.longitude;
|
||||
userLocalNum.value.t = res.latitude;
|
||||
},
|
||||
});
|
||||
|
||||
const res = await getMerList({
|
||||
PageNum: 1,
|
||||
PageNum: pageVal.value.page,
|
||||
PageSize: 10,
|
||||
class_id: props.classId,
|
||||
class_id: classId.value,
|
||||
});
|
||||
pageVal.value.total = res.data.total;
|
||||
|
||||
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) => {
|
||||
Taro.setStorageSync("mer_info", item);
|
||||
const toPage = async (url: string) => {
|
||||
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({
|
||||
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>
|
||||
|
||||
<style lang="scss">
|
||||
.goodBox {
|
||||
.list-box {
|
||||
margin: 20px;
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
padding: 20px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.good {
|
||||
width: 340px;
|
||||
background-color: #fff;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 10px;
|
||||
.list {
|
||||
overflow: scroll;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 250px;
|
||||
border-top-right-radius: 10px;
|
||||
border-top-left-radius: 10px;
|
||||
}
|
||||
.item {
|
||||
width: 340px;
|
||||
margin-bottom: 18px;
|
||||
border-radius: 20px;
|
||||
background-color: #fff;
|
||||
|
||||
.good-text-box {
|
||||
padding: 10px;
|
||||
|
||||
.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;
|
||||
image {
|
||||
width: 100%;
|
||||
border-radius: 15px;
|
||||
}
|
||||
|
||||
.good-price-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-top: 10px;
|
||||
.text {
|
||||
padding: 15px;
|
||||
|
||||
.good-text-price {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
color: #ff0000;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
.title {
|
||||
color: #333333;
|
||||
font-size: 30px;
|
||||
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"
|
||||
:style="{ height: 'auto' }"
|
||||
:visible="isShowPay"
|
||||
@click-close-icon="closePay"
|
||||
>
|
||||
@click-close-icon="closePay">
|
||||
<view class="div">
|
||||
<view style="text-align: center">支付方式</view>
|
||||
<nut-cell-group
|
||||
:style="{ margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0' }"
|
||||
>
|
||||
<nut-cell
|
||||
title="微信支付"
|
||||
desc="使用微信快捷支付"
|
||||
is-link
|
||||
@click="goPay(1)"
|
||||
>
|
||||
<template v-slot:icon>
|
||||
<IconFont
|
||||
size="30"
|
||||
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
|
||||
/>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<nut-cell
|
||||
title="积分支付"
|
||||
:desc="`剩余积分:${info.integral || 0}`"
|
||||
is-link
|
||||
@click="goPay(2)"
|
||||
>
|
||||
<template v-slot:icon>
|
||||
<IconFont
|
||||
size="30"
|
||||
name="https://img11.360buyimg.com/imagetools/jfs/t1/137646/13/7132/1648/5f4c748bE43da8ddd/a3f06d51dcae7b60.png"
|
||||
/>
|
||||
</template>
|
||||
</nut-cell>
|
||||
<!-- <nut-cell
|
||||
title="挂帐后结"
|
||||
desc="先消费后结账"
|
||||
:style="{ margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0' }">
|
||||
<nut-cell
|
||||
title="微信支付"
|
||||
desc="使用微信快捷支付"
|
||||
is-link
|
||||
@click="goPay(3)"
|
||||
>
|
||||
@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"
|
||||
/>
|
||||
<IconFont size="30" :name="require('../static/wx.png')" />
|
||||
</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>
|
||||
</view>
|
||||
</nut-popup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from "vue";
|
||||
import { IconFont } from "@nutui/icons-vue-taro";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { payOrder } from "@/api/order";
|
||||
import { getPersonalInfo } from "@/api/user";
|
||||
import { ref, watch } from 'vue';
|
||||
import { IconFont } from '@nutui/icons-vue-taro';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { payOrder } from '@/api/order';
|
||||
import { getPersonalInfo } from '@/api/user';
|
||||
|
||||
const prop = defineProps({
|
||||
interval: {
|
||||
@@ -87,7 +73,7 @@ const prop = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(["closePay", "successPay"]);
|
||||
const emit = defineEmits(['closePay', 'successPay']);
|
||||
|
||||
const info = ref<{ integral?: any }>({});
|
||||
|
||||
@@ -95,7 +81,7 @@ watch(
|
||||
() => prop.isShowPay,
|
||||
() => {
|
||||
getInfo();
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const getInfo = async () => {
|
||||
@@ -105,28 +91,29 @@ const getInfo = async () => {
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const goPay = async (type: number) => {
|
||||
console.log(prop);
|
||||
if (!prop.jfInfo)
|
||||
return Taro.showToast({
|
||||
title: "未获取到订单信息",
|
||||
icon: "none",
|
||||
title: '未获取到订单信息~',
|
||||
icon: 'none',
|
||||
});
|
||||
try {
|
||||
// 1微信支付 2积分支付 3挂帐
|
||||
if (type === 1 || type === 2) {
|
||||
const { data } = await payOrder({
|
||||
oid: prop.jfInfo,
|
||||
OrderType: prop.OrderType,
|
||||
PayType: type,
|
||||
});
|
||||
if (type === 1) {
|
||||
console.log(prop.jfInfo);
|
||||
// 1微信支付 2积分支付 3专属积分兑换
|
||||
const { data } = await payOrder({
|
||||
oid: prop.jfInfo.oid,
|
||||
OrderType: prop.OrderType,
|
||||
PayType: type,
|
||||
});
|
||||
|
||||
switch (type) {
|
||||
case 1:
|
||||
if (data.data) {
|
||||
Taro.requestPayment({
|
||||
timeStamp: data.data.timeStamp,
|
||||
@@ -136,58 +123,53 @@ const goPay = async (type: number) => {
|
||||
paySign: data.data.paySign,
|
||||
success: function () {
|
||||
Taro.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success",
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
});
|
||||
emit("successPay", false);
|
||||
emit('successPay', false);
|
||||
},
|
||||
fail: function () {
|
||||
Taro.showToast({
|
||||
title: "支付失败",
|
||||
icon: "none",
|
||||
title: '支付失败',
|
||||
icon: 'none',
|
||||
duration: 2000,
|
||||
});
|
||||
emit("closePay", false);
|
||||
emit('closePay', false);
|
||||
},
|
||||
});
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: "未知异常",
|
||||
icon: "none",
|
||||
title: '支付失败,请稍后再试~',
|
||||
icon: 'none',
|
||||
});
|
||||
emit("closePay", false);
|
||||
emit('closePay', false);
|
||||
}
|
||||
} else if (type === 2) {
|
||||
break;
|
||||
default:
|
||||
Taro.showToast({
|
||||
title: "支付成功",
|
||||
icon: "success",
|
||||
duration: 2000,
|
||||
title: '支付成功',
|
||||
icon: 'none',
|
||||
});
|
||||
emit("successPay", false);
|
||||
}
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: "挂帐后结账",
|
||||
icon: "none",
|
||||
});
|
||||
emit('successPay', false);
|
||||
break;
|
||||
}
|
||||
} catch (e) {
|
||||
Taro.showToast({
|
||||
title: e.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
emit("closePay", false);
|
||||
emit('closePay', false);
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
const closePay = () => {
|
||||
Taro.showToast({
|
||||
title: "取消支付",
|
||||
icon: "none",
|
||||
title: '取消支付',
|
||||
icon: 'none',
|
||||
});
|
||||
emit("closePay", false);
|
||||
emit('closePay', false);
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,41 +1,60 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { userSign } from "@/api/user";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const show = ref(false);
|
||||
const isShow = ref(false);
|
||||
|
||||
Taro.useLoad(async () => {
|
||||
if (Taro.getStorageSync("token")) show.value = true;
|
||||
// const res = await getSignRecord()
|
||||
// console.log(res)
|
||||
defineExpose({
|
||||
isShow,
|
||||
});
|
||||
|
||||
const toSign = async () => {
|
||||
try {
|
||||
await userSign();
|
||||
Taro.showToast({
|
||||
title: "签到成功",
|
||||
icon: "none",
|
||||
});
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
show.value = false;
|
||||
const props = defineProps({
|
||||
imgArr: {
|
||||
required: true,
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
type: Number,
|
||||
cb: {
|
||||
type: Function || null,
|
||||
default: null,
|
||||
},
|
||||
});
|
||||
|
||||
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>
|
||||
|
||||
<template>
|
||||
<nut-overlay
|
||||
v-model:visible="show"
|
||||
v-model:visible="isShow"
|
||||
:lock-scroll="true"
|
||||
:close-on-click-overlay="false"
|
||||
>
|
||||
:close-on-click-overlay="false">
|
||||
<view class="wrapper">
|
||||
<view @click.stop="toSign">
|
||||
<image class="image" src="../static/index/poppBg.png" />
|
||||
<view @click.stop="clickFn(type)">
|
||||
<image
|
||||
:style="{
|
||||
width: imgs[0]?.naturalWidth,
|
||||
height:
|
||||
imgs[0]?.naturalHeight < 600 ? imgs[0]?.naturalHeight : '480px',
|
||||
}"
|
||||
:src="imgs[0]" />
|
||||
</view>
|
||||
<view @click.stop="show = false">
|
||||
<view @click.stop="closeFn">
|
||||
<image class="icon" src="../static/index/close.png" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -5,80 +5,68 @@
|
||||
<view
|
||||
class="toolbar"
|
||||
@click="format"
|
||||
style="max-height: 240px; overflow-y: auto"
|
||||
>
|
||||
style="max-height: 240px; overflow-y: auto">
|
||||
<!-- 加粗 -->
|
||||
<view
|
||||
:class="data.formats.bold ? 'ql-active' : ''"
|
||||
class="iconfont icon-zitijiacu"
|
||||
data-name="bold"
|
||||
></view>
|
||||
data-name="bold"></view>
|
||||
<!-- 斜体 -->
|
||||
<view
|
||||
:class="data.formats.italic ? 'ql-active' : ''"
|
||||
class="iconfont icon-zitixieti"
|
||||
data-name="italic"
|
||||
></view>
|
||||
data-name="italic"></view>
|
||||
<!-- 下划线 -->
|
||||
<view
|
||||
:class="data.formats.underline ? 'ql-active' : ''"
|
||||
class="iconfont icon-zitixiahuaxian"
|
||||
data-name="underline"
|
||||
></view>
|
||||
data-name="underline"></view>
|
||||
<!-- 对齐方式:左 -->
|
||||
<view
|
||||
:class="data.formats.align === 'left' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zuoduiqi"
|
||||
data-name="align"
|
||||
data-value="left"
|
||||
></view>
|
||||
data-value="left"></view>
|
||||
<!-- 对齐方式:居中 -->
|
||||
<view
|
||||
:class="data.formats.align === 'center' ? 'ql-active' : ''"
|
||||
class="iconfont icon-juzhongduiqi"
|
||||
data-name="align"
|
||||
data-value="center"
|
||||
></view>
|
||||
data-value="center"></view>
|
||||
<!-- 对齐方式:右 -->
|
||||
<view
|
||||
:class="data.formats.align === 'right' ? 'ql-active' : ''"
|
||||
class="iconfont icon-youduiqi"
|
||||
data-name="align"
|
||||
data-value="right"
|
||||
></view>
|
||||
data-value="right"></view>
|
||||
<!-- 对齐方式:两侧 -->
|
||||
<view
|
||||
:class="data.formats.align === 'justify' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zuoyouduiqi"
|
||||
data-name="align"
|
||||
data-value="justify"
|
||||
></view>
|
||||
data-value="justify"></view>
|
||||
<!-- 有序排列 -->
|
||||
<view
|
||||
:class="data.formats.list === 'ordered' ? 'ql-active' : ''"
|
||||
class="iconfont icon-youxupailie"
|
||||
data-name="list"
|
||||
data-value="ordered"
|
||||
></view>
|
||||
data-value="ordered"></view>
|
||||
<!-- 无序排列 -->
|
||||
<view
|
||||
:class="data.formats.list === 'bullet' ? 'ql-active' : ''"
|
||||
class="iconfont icon-wuxupailie"
|
||||
data-name="list"
|
||||
data-value="bullet"
|
||||
></view>
|
||||
data-value="bullet"></view>
|
||||
<!-- 取消缩进 -->
|
||||
<view
|
||||
class="iconfont icon-outdent"
|
||||
data-name="indent"
|
||||
data-value="-1"
|
||||
></view>
|
||||
data-value="-1"></view>
|
||||
<!-- 缩进 -->
|
||||
<view
|
||||
class="iconfont icon-indent"
|
||||
data-name="indent"
|
||||
data-value="+1"
|
||||
></view>
|
||||
data-value="+1"></view>
|
||||
<!-- 添加分割线 -->
|
||||
<view class="iconfont icon-fengexian" @click="insertDivider"></view>
|
||||
<!-- 插入图片 -->
|
||||
@@ -88,22 +76,19 @@
|
||||
:class="data.formats.header === 3 ? 'ql-active' : ''"
|
||||
class="iconfont icon-H"
|
||||
data-name="header"
|
||||
:data-value="3"
|
||||
></view>
|
||||
:data-value="3"></view>
|
||||
<!-- 下标 -->
|
||||
<view
|
||||
:class="data.formats.script === 'sub' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zitixiabiao"
|
||||
data-name="script"
|
||||
data-value="sub"
|
||||
></view>
|
||||
data-value="sub"></view>
|
||||
<!-- 上标 -->
|
||||
<view
|
||||
:class="data.formats.script === 'super' ? 'ql-active' : ''"
|
||||
class="iconfont icon-zitishangbiao"
|
||||
data-name="script"
|
||||
data-value="super"
|
||||
></view>
|
||||
data-value="super"></view>
|
||||
<view class="iconfont icon-undo" @click="undo"></view>
|
||||
<view class="iconfont icon-redo" @click="redo"></view>
|
||||
</view>
|
||||
@@ -115,8 +100,7 @@
|
||||
@statuschange="onStatusChange"
|
||||
:show-img-resize="true"
|
||||
@ready="onEditorReady"
|
||||
@input="getCtx"
|
||||
/>
|
||||
@input="getCtx" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -124,29 +108,29 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { BASE_URL } from "@/utils/request";
|
||||
import { reactive } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { BASE_URL } from '@/utils/request';
|
||||
|
||||
const { content } = defineProps<{
|
||||
content: string;
|
||||
}>();
|
||||
|
||||
let emits = defineEmits(["input"]);
|
||||
let emits = defineEmits(['input']);
|
||||
|
||||
const data = reactive<any>({
|
||||
editorCtx: "",
|
||||
editorCtx: '',
|
||||
readOnly: false,
|
||||
placeholder: "请输入商品详情...",
|
||||
richText: "",
|
||||
placeholder: '请输入商品详情...',
|
||||
richText: '',
|
||||
formats: {},
|
||||
});
|
||||
|
||||
function onEditorReady() {
|
||||
// 富文本节点渲染完成
|
||||
Taro.createSelectorQuery()
|
||||
.select("#editor")
|
||||
.context((res) => {
|
||||
.select('#editor')
|
||||
.context(res => {
|
||||
data.editorCtx = res.context;
|
||||
// 初始化数据
|
||||
if (content) {
|
||||
@@ -161,7 +145,7 @@ function onEditorReady() {
|
||||
// 失去焦点时,获取富文本的内容
|
||||
function getCtx(e: { detail: { html: any } }) {
|
||||
data.richText = e.detail.html;
|
||||
emits("input", e.detail.html);
|
||||
emits('input', e.detail.html);
|
||||
}
|
||||
|
||||
// 撤销操作
|
||||
@@ -196,16 +180,16 @@ function insertDivider() {
|
||||
function insertImage() {
|
||||
Taro.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["original", "compressed"],
|
||||
sourceType: ["album", "camera"],
|
||||
success: (res) => {
|
||||
sizeType: ['original', 'compressed'],
|
||||
sourceType: ['album', 'camera'],
|
||||
success: res => {
|
||||
// 上传图片的逻辑各有不同,自行调整即可
|
||||
Taro.uploadFile({
|
||||
url: `${BASE_URL}/upload`,
|
||||
name: "file",
|
||||
header: { token: Taro.getStorageSync("token") },
|
||||
name: 'file',
|
||||
header: { token: Taro.getStorageSync('token') },
|
||||
filePath: res.tempFilePaths[0],
|
||||
success: (res) => {
|
||||
success: res => {
|
||||
console.log(res);
|
||||
const imgData = JSON.parse(res.data) as {
|
||||
code: number;
|
||||
@@ -215,19 +199,19 @@ function insertImage() {
|
||||
if (imgData.code === 200) {
|
||||
// 将图片展示在编辑器中
|
||||
data.editorCtx.insertImage({
|
||||
width: "100%",
|
||||
height: "auto",
|
||||
width: '100%',
|
||||
height: 'auto',
|
||||
src: imgData.data.data,
|
||||
alt: "图像",
|
||||
alt: '图像',
|
||||
success: function () {
|
||||
console.log("insert image success");
|
||||
console.log('insert image success');
|
||||
},
|
||||
});
|
||||
} else {
|
||||
console.log("上传失败");
|
||||
console.log('上传失败');
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
fail: err => {
|
||||
console.log(err);
|
||||
},
|
||||
});
|
||||
@@ -237,7 +221,7 @@ function insertImage() {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../static/font_4211210_2x20brbrv94.css";
|
||||
@import '../static/font_4211210_2x20brbrv94.css';
|
||||
|
||||
.wrapper {
|
||||
height: 100%;
|
||||
@@ -266,7 +250,7 @@ function insertImage() {
|
||||
.toolbar {
|
||||
box-sizing: border-box;
|
||||
border-bottom: 0;
|
||||
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
|
||||
font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
|
||||
}
|
||||
|
||||
.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"
|
||||
@touchmove="touchMove"
|
||||
@touchend="touchEnd"
|
||||
@error="error"
|
||||
>
|
||||
@error="error">
|
||||
</canvas>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="ucharts">
|
||||
import uCharts from "../utils/js_sdk/u-charts.min.js";
|
||||
import Taro from "@tarojs/taro";
|
||||
import uCharts from '../utils/js_sdk/u-charts.min.js';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const canvases = {};
|
||||
|
||||
@@ -29,7 +28,7 @@ const props = defineProps({
|
||||
chartType: {
|
||||
required: true,
|
||||
type: String,
|
||||
default: "column",
|
||||
default: 'column',
|
||||
},
|
||||
opts: {
|
||||
required: true,
|
||||
@@ -40,7 +39,7 @@ const props = defineProps({
|
||||
},
|
||||
canvasId: {
|
||||
type: String,
|
||||
default: "u-canvas",
|
||||
default: 'u-canvas',
|
||||
},
|
||||
cWidth: {
|
||||
default: 350,
|
||||
@@ -60,10 +59,10 @@ Taro.useLoad(() => {
|
||||
|
||||
const init = () => {
|
||||
switch (props.chartType) {
|
||||
case "column":
|
||||
case 'column':
|
||||
initColumnChart();
|
||||
break;
|
||||
case "line":
|
||||
case 'line':
|
||||
initLineChart();
|
||||
break;
|
||||
default:
|
||||
@@ -75,9 +74,9 @@ const initColumnChart = () => {
|
||||
const ctx = Taro.createCanvasContext(props.canvasId);
|
||||
canvases[props.canvasId] = new uCharts({
|
||||
context: ctx,
|
||||
type: "column",
|
||||
type: 'column',
|
||||
fontSize: 11,
|
||||
background: "#FFFFFF",
|
||||
background: '#FFFFFF',
|
||||
pixelRatio: props.pixelRatio,
|
||||
animation: true,
|
||||
categories: props.opts.categories,
|
||||
@@ -99,9 +98,9 @@ const initColumnChart = () => {
|
||||
},
|
||||
extra: {
|
||||
column: {
|
||||
type: "group",
|
||||
type: 'group',
|
||||
width: 30,
|
||||
activeBgColor: "#000000",
|
||||
activeBgColor: '#000000',
|
||||
activeBgOpacity: 0.08,
|
||||
},
|
||||
},
|
||||
@@ -112,12 +111,12 @@ const initLineChart = () => {
|
||||
const ctx = Taro.createCanvasContext(props.canvasId);
|
||||
canvases[props.canvasId] = new uCharts({
|
||||
context: ctx,
|
||||
type: "line",
|
||||
type: 'line',
|
||||
fontSize: 11,
|
||||
legend: true,
|
||||
dataLabel: false,
|
||||
dataPointShape: true,
|
||||
background: "#FFFFFF",
|
||||
background: '#FFFFFF',
|
||||
pixelRatio: props.pixelRatio,
|
||||
categories: props.opts.categories,
|
||||
series: props.opts.series,
|
||||
@@ -133,21 +132,21 @@ const initLineChart = () => {
|
||||
disableGrid: true,
|
||||
},
|
||||
yAxis: {
|
||||
gridType: "dash",
|
||||
gridColor: "#CCCCCC",
|
||||
gridType: 'dash',
|
||||
gridColor: '#CCCCCC',
|
||||
dashLength: 8,
|
||||
splitNumber: 5,
|
||||
min: 10,
|
||||
max: 180,
|
||||
format: (val) => {
|
||||
return val.toFixed(0) + "元";
|
||||
format: val => {
|
||||
return val.toFixed(0) + '元';
|
||||
},
|
||||
},
|
||||
width: props.cWidth * props.pixelRatio,
|
||||
height: props.cHeight * props.pixelRatio,
|
||||
extra: {
|
||||
line: {
|
||||
type: "straight",
|
||||
type: 'straight',
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -156,7 +155,7 @@ const initLineChart = () => {
|
||||
const touchStart = (e: any) => {
|
||||
canvases[props.canvasId].showToolTip(e, {
|
||||
format: function (item: any, category: any) {
|
||||
return category + " " + item.name + ":" + item.data;
|
||||
return category + ' ' + item.name + ':' + item.data;
|
||||
},
|
||||
});
|
||||
canvases[props.canvasId].scrollStart(e);
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
:headers="config.headers"
|
||||
@success="success"
|
||||
@failure="failure"
|
||||
:multiple="multiple"
|
||||
>
|
||||
:multiple="multiple">
|
||||
</nut-uploader>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { BASE_URL } from "@/utils/request";
|
||||
import { computed, ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { BASE_URL } from '@/utils/request';
|
||||
import { computed, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const props = defineProps({
|
||||
list: {
|
||||
@@ -31,17 +30,17 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(["update:list"]);
|
||||
const emits = defineEmits(['update:list']);
|
||||
|
||||
const fileList = computed({
|
||||
get: () => props.list,
|
||||
set: (val) => emits("update:list", val),
|
||||
set: val => emits('update:list', val),
|
||||
});
|
||||
|
||||
const config = ref({
|
||||
url: `${BASE_URL}/upload`,
|
||||
headers: {
|
||||
token: Taro.getStorageSync("token"),
|
||||
token: Taro.getStorageSync('token'),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -49,15 +48,15 @@ const success = (res: any) => {
|
||||
const data = JSON.parse(res.responseText.data);
|
||||
res.fileItem.url = data.data.data;
|
||||
Taro.showToast({
|
||||
title: "上传成功",
|
||||
icon: "success",
|
||||
title: '上传成功',
|
||||
icon: 'success',
|
||||
});
|
||||
};
|
||||
|
||||
const failure = () => {
|
||||
Taro.showToast({
|
||||
title: "上传失败",
|
||||
icon: "error",
|
||||
title: '上传失败',
|
||||
icon: 'error',
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import headImg from "../static/def_avatar.png";
|
||||
import logoImg from "../static/logo.jpg";
|
||||
import { BASE_URL } from "@/utils/request";
|
||||
import { getPhone, login } from "@/api/user";
|
||||
import { computed, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import headImg from '../static/def_avatar.png';
|
||||
import logoImg from '../static/logo.jpg';
|
||||
import { BASE_URL } from '@/utils/request';
|
||||
import { getPhone, login } from '@/api/user';
|
||||
|
||||
const props = defineProps({
|
||||
isShow: {
|
||||
@@ -12,18 +12,18 @@ const props = defineProps({
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["closeEdit", "update:isShow"]);
|
||||
const emits = defineEmits(['closeEdit', 'update:isShow']);
|
||||
|
||||
const userInfo = ref({
|
||||
nickname: "",
|
||||
avatar: "",
|
||||
phone: "",
|
||||
nickname: '',
|
||||
avatar: '',
|
||||
phone: '',
|
||||
});
|
||||
|
||||
const show = computed({
|
||||
get: (): boolean => props.isShow,
|
||||
set: (val) => {
|
||||
emits("update:isShow", val);
|
||||
set: val => {
|
||||
emits('update:isShow', val);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -32,15 +32,15 @@ const mp_is_new = ref(true);
|
||||
const canvasStatus = ref(false);
|
||||
|
||||
const closeAttr = () => {
|
||||
emits("closeEdit");
|
||||
emits('closeEdit');
|
||||
};
|
||||
|
||||
const onChooseAvatar = (e) => {
|
||||
const onChooseAvatar = e => {
|
||||
const { avatarUrl } = e.detail;
|
||||
Taro.uploadFile({
|
||||
url: `${BASE_URL}/upload`,
|
||||
filePath: avatarUrl,
|
||||
name: "file",
|
||||
name: 'file',
|
||||
success: function (res) {
|
||||
const data = JSON.parse(res.data);
|
||||
userInfo.value.avatar = data.data.data;
|
||||
@@ -54,7 +54,7 @@ const uploadPic = () => {
|
||||
|
||||
const getPhoneNumber = async (e: any) => {
|
||||
Taro.showLoading({
|
||||
title: "授权手机号中",
|
||||
title: '授权手机号中',
|
||||
mask: true,
|
||||
});
|
||||
const { code } = e.detail;
|
||||
@@ -68,39 +68,39 @@ const getPhoneNumber = async (e: any) => {
|
||||
const formSubmit = async (e: any) => {
|
||||
if (!userInfo.value.avatar)
|
||||
return Taro.showToast({
|
||||
title: "请上传头像",
|
||||
icon: "none",
|
||||
title: '请上传头像',
|
||||
icon: 'none',
|
||||
});
|
||||
userInfo.value.nickname = e.detail.value.nickname;
|
||||
if (!userInfo.value.nickname)
|
||||
return Taro.showToast({
|
||||
title: "请输入昵称",
|
||||
icon: "none",
|
||||
title: '请输入昵称',
|
||||
icon: 'none',
|
||||
});
|
||||
if (!userInfo.value.phone)
|
||||
return Taro.showToast({
|
||||
title: "请授权手机号码",
|
||||
icon: "none",
|
||||
title: '请授权手机号码',
|
||||
icon: 'none',
|
||||
});
|
||||
const res = await login({
|
||||
Code: Taro.getStorageSync("wx_code"),
|
||||
Code: Taro.getStorageSync('wx_code'),
|
||||
NickName: userInfo.value.nickname,
|
||||
AvatarUrl: userInfo.value.avatar,
|
||||
Phone: userInfo.value.phone,
|
||||
Referee: Taro.getStorageSync("bind_id") || "",
|
||||
Referee: Taro.getStorageSync('bind_id') || '',
|
||||
});
|
||||
emits("closeEdit");
|
||||
emits('closeEdit');
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "success",
|
||||
icon: 'success',
|
||||
duration: 2000,
|
||||
});
|
||||
Taro.setStorageSync("token", res.data.token);
|
||||
Taro.setStorageSync('token', res.data.token);
|
||||
setTimeout(() => {
|
||||
Taro.removeStorageSync("wx_code");
|
||||
Taro.removeStorageSync("bind_id");
|
||||
Taro.removeStorageSync('wx_code');
|
||||
Taro.removeStorageSync('bind_id');
|
||||
Taro.switchTab({
|
||||
url: "/pages/user/index",
|
||||
url: '/pages/user/index',
|
||||
});
|
||||
}, 2000);
|
||||
};
|
||||
@@ -115,16 +115,15 @@ const formSubmit = async (e: any) => {
|
||||
:style="{ padding: '20px 10px' }"
|
||||
v-model:visible="show"
|
||||
@close="closeAttr"
|
||||
:close-on-click-overlay="false"
|
||||
>
|
||||
:close-on-click-overlay="false">
|
||||
<view class="mp-data">
|
||||
<image class="image" :src="logoImg"></image>
|
||||
<text class="mp-name">捷兑通 申请</text>
|
||||
</view>
|
||||
<view class="trip-msg">
|
||||
<!-- <view class="trip-msg">
|
||||
<view class="title"> 获取您的昵称、头像 </view>
|
||||
<view class="trip"> 提供具有辨识度的用户中心界面 </view>
|
||||
</view>
|
||||
</view> -->
|
||||
<form @submit="formSubmit">
|
||||
<view class="edit">
|
||||
<view class="avatar edit-box">
|
||||
@@ -133,23 +132,19 @@ const formSubmit = async (e: any) => {
|
||||
<view
|
||||
class="avatar-box"
|
||||
v-if="!mp_is_new"
|
||||
@click.stop="uploadPic"
|
||||
>
|
||||
@click.stop="uploadPic">
|
||||
<image
|
||||
:src="userInfo.avatar || headImg"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
mode="aspectFill"></image>
|
||||
</view>
|
||||
<button
|
||||
v-else
|
||||
class="avatar-box"
|
||||
open-type="chooseAvatar"
|
||||
@chooseavatar="onChooseAvatar"
|
||||
>
|
||||
@chooseavatar="onChooseAvatar">
|
||||
<image
|
||||
:src="userInfo.avatar || headImg"
|
||||
mode="aspectFill"
|
||||
></image>
|
||||
mode="aspectFill"></image>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -163,8 +158,7 @@ const formSubmit = async (e: any) => {
|
||||
placeholder="请输入昵称"
|
||||
name="nickname"
|
||||
:maxlength="16"
|
||||
:value="userInfo.nickname"
|
||||
/>
|
||||
:value="userInfo.nickname" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -174,9 +168,8 @@ const formSubmit = async (e: any) => {
|
||||
<view class="input">
|
||||
<button
|
||||
open-type="getPhoneNumber"
|
||||
@getphonenumber="getPhoneNumber"
|
||||
>
|
||||
{{ !userInfo.phone ? "请授权手机号" : "授权成功" }}
|
||||
@getphonenumber="getPhoneNumber">
|
||||
{{ !userInfo.phone ? '请授权手机号' : '授权成功' }}
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
||||
<meta
|
||||
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-touch-fullscreen" content="yes" />
|
||||
<meta name="format-detection" content="telephone=no,address=no" />
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "菜单",
|
||||
navigationBarTitleText: '菜单',
|
||||
});
|
||||
|
||||
@@ -64,4 +64,4 @@ page {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,12 @@
|
||||
direction="vertical"
|
||||
title-gutter="5"
|
||||
animated-time="0"
|
||||
name="tabName"
|
||||
>
|
||||
name="tabName">
|
||||
<nut-tab-pane
|
||||
v-for="(itm, index) in good_list"
|
||||
:key="index"
|
||||
:title="itm.name"
|
||||
:pane-key="index"
|
||||
>
|
||||
:pane-key="index">
|
||||
<view v-if="itm.Goods.length > 0">
|
||||
<view class="list" v-for="(item, index) in itm.Goods" :key="index">
|
||||
<view class="item" @click.stop="toGoodDetails(item.gid, 1)">
|
||||
@@ -29,17 +27,16 @@
|
||||
<view class="price">
|
||||
<text style="font-size: 15px">{{ item.number }}元</text>
|
||||
</view>
|
||||
<view class="price">
|
||||
<!-- <view class="price">
|
||||
<text style="font-size: 15px"
|
||||
>{{ item.exchange }}积分</text
|
||||
>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<nut-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
@click.stop="add_cart(item)"
|
||||
>
|
||||
@click.stop="add_cart(item)">
|
||||
<template #icon>
|
||||
<Cart2 />
|
||||
</template>
|
||||
@@ -56,16 +53,20 @@
|
||||
</view>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Ref, ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import Cart from "../../../../components/Cart.vue";
|
||||
import { Cart2 } from "@nutui/icons-vue-taro";
|
||||
import { getGoodList, getMerCategory } from "../../../../api/goods";
|
||||
import { Ref, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Cart from '../../../../components/Cart.vue';
|
||||
import { Cart2 } from '@nutui/icons-vue-taro';
|
||||
import { getGoodList, getMerCategory } from '../../../../api/goods';
|
||||
|
||||
interface goodList {
|
||||
ID: number;
|
||||
@@ -94,7 +95,7 @@ interface CartItems {
|
||||
exchange: number;
|
||||
}
|
||||
|
||||
const value = ref("0");
|
||||
const value = ref('0');
|
||||
const good_list = ref<goodList[]>([]);
|
||||
const class_list = ref<
|
||||
Array<{
|
||||
@@ -103,8 +104,8 @@ const class_list = ref<
|
||||
}>
|
||||
>([]);
|
||||
|
||||
Taro.useLoad(async (e) => {
|
||||
mer_info.value = e
|
||||
Taro.useLoad(async e => {
|
||||
mer_info.value = e;
|
||||
await get_class_list(e.bid);
|
||||
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) => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
title: '加载中',
|
||||
mask: true,
|
||||
});
|
||||
const res = await getGoodList({
|
||||
@@ -161,7 +162,7 @@ const updateCartNum = (cartItems: CartItems[]) => {
|
||||
} else {
|
||||
good_list.value.forEach((category: goodList) => {
|
||||
category.Goods.forEach((good: GoodsType) => {
|
||||
Reflect.deleteProperty(good, "cartNum");
|
||||
Reflect.deleteProperty(good, 'cartNum');
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -169,5 +170,5 @@ const updateCartNum = (cartItems: CartItems[]) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "填写信息",
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: '填写信息',
|
||||
navigationStyle: 'custom',
|
||||
});
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
height: 100vh;
|
||||
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png");
|
||||
background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png');
|
||||
background-size: auto 40%;
|
||||
background-repeat: no-repeat;
|
||||
|
||||
@@ -33,3 +33,14 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nut-dialog__header {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
font-size: 36px;
|
||||
height: auto;
|
||||
}
|
||||
.nut-dialog__content {
|
||||
text-align: left !important;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
placeholder="请输入台号,比如:包厢A01"
|
||||
name="seat"
|
||||
v-model="formVal.seat"
|
||||
required
|
||||
/>
|
||||
required />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">手机号:</text>
|
||||
@@ -20,8 +19,7 @@
|
||||
placeholder="请输入客人手机号码"
|
||||
name="phone"
|
||||
v-model="formVal.phone"
|
||||
required
|
||||
/>
|
||||
required />
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<text class="label">备注:</text>
|
||||
@@ -29,8 +27,7 @@
|
||||
type="textarea"
|
||||
placeholder="备注"
|
||||
name="notes"
|
||||
v-model="formVal.notes"
|
||||
/>
|
||||
v-model="formVal.notes" />
|
||||
</view>
|
||||
<nut-button
|
||||
style="border-radius: 7px"
|
||||
@@ -42,40 +39,66 @@
|
||||
>
|
||||
</form>
|
||||
</view>
|
||||
<nut-dialog v-model:visible="visible" no-cancel-btn>
|
||||
<template #header>提示</template>
|
||||
<template #default
|
||||
>客户手机号:
|
||||
<text style="color: #fd0100">{{ formVal.phone }}</text>
|
||||
没有注册捷兑 通,请通知他登录捷兑通小程序注册。</template
|
||||
>
|
||||
</nut-dialog>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import BackComponent from "../../../../components/Back.vue";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import BackComponent from '../../../../components/Back.vue';
|
||||
import { checkPhone } from '../../../../api/admin';
|
||||
|
||||
const formVal = ref({
|
||||
seat: "",
|
||||
phone: "",
|
||||
notes: "",
|
||||
seat: '',
|
||||
phone: '',
|
||||
notes: '',
|
||||
});
|
||||
|
||||
const visible = ref(false);
|
||||
|
||||
const formSubmit = async ({ detail }: any) => {
|
||||
if (!detail.value.seat || !detail.value.phone)
|
||||
if (!detail.value.seat)
|
||||
return Taro.showToast({
|
||||
title: "请填写完整信息",
|
||||
icon: "none",
|
||||
title: '请填写台号',
|
||||
icon: 'none',
|
||||
});
|
||||
const user_info = await Taro.getStorageSync("userInfo");
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}¬es=${formVal.value.notes}`,
|
||||
success: () => {
|
||||
formVal.value = {
|
||||
seat: "",
|
||||
phone: "",
|
||||
notes: "",
|
||||
};
|
||||
},
|
||||
});
|
||||
if (
|
||||
!/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(
|
||||
detail.value.phone,
|
||||
)
|
||||
)
|
||||
return Taro.showToast({
|
||||
title: '请输入正确的手机号码',
|
||||
icon: 'none',
|
||||
});
|
||||
try {
|
||||
await checkPhone({ phone: detail.value.phone });
|
||||
const user_info = await Taro.getStorageSync('userInfo');
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}¬es=${formVal.value.notes}`,
|
||||
success: () => {
|
||||
formVal.value = {
|
||||
seat: '',
|
||||
phone: '',
|
||||
notes: '',
|
||||
};
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
visible.value = true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "点单",
|
||||
navigationStyle: "custom",
|
||||
navigationBarTitleText: '点单',
|
||||
navigationStyle: 'custom',
|
||||
});
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
height: 100vh;
|
||||
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png");
|
||||
background-size: auto 40%;
|
||||
// background-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-repeat: no-repeat;
|
||||
|
||||
.card {
|
||||
margin-top: 240px;
|
||||
margin-top: 450px;
|
||||
width: 703px;
|
||||
height: 301px;
|
||||
background: #ffffff;
|
||||
@@ -39,7 +40,7 @@
|
||||
.line {
|
||||
width: 1px;
|
||||
height: 188px;
|
||||
background: #C8C8C8;
|
||||
background: #c8c8c8;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
<template>
|
||||
<view>
|
||||
<back-component title="点单" />
|
||||
<back-component />
|
||||
<view class="container">
|
||||
<view class="card">
|
||||
<view class="comm" @click="navTo('/pages/admin/add_order/add_table/index')">
|
||||
<view
|
||||
class="comm"
|
||||
@click="navTo('/pages/admin/add_order/add_table/index')">
|
||||
<text class="title">开始点单</text>
|
||||
<image src="./static/dc.png"></image>
|
||||
<text class="sub">线上点单后结系统</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="comm" @click="navTo('/pages/admin/add_order/pending_order/index')">
|
||||
<view
|
||||
class="comm"
|
||||
@click="navTo('/pages/admin/add_order/pending_order/index')">
|
||||
<text class="title">我的订单</text>
|
||||
<image src="./static/ddan.png"></image>
|
||||
<text class="sub">查看我点餐的订单</text>
|
||||
@@ -20,8 +24,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import BackComponent from "../../../components/Back.vue";
|
||||
import Taro from '@tarojs/taro';
|
||||
import BackComponent from '../../../components/Back.vue';
|
||||
|
||||
const navTo = (path: string) => {
|
||||
Taro.navigateTo({
|
||||
@@ -31,5 +35,5 @@ const navTo = (path: string) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,30 +1,51 @@
|
||||
<template>
|
||||
<view>
|
||||
<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"
|
||||
class="btn"
|
||||
style="border: 1px #7f7f7f solid; color: #666666"
|
||||
@click="visible = true"
|
||||
>挂帐</view
|
||||
>
|
||||
<view
|
||||
v-if="info.status !== 2"
|
||||
class="btn"
|
||||
style="background-color: #009ee0"
|
||||
@click="to_menu_page"
|
||||
>继续点单</view
|
||||
>
|
||||
<view
|
||||
> -->
|
||||
<view
|
||||
v-if="info.status !== 2"
|
||||
class="btn"
|
||||
style="background-color: #009ee0"
|
||||
@click="to_menu_page"
|
||||
>继续点单</view
|
||||
>
|
||||
<view
|
||||
v-if="info.status !== 2"
|
||||
class="btn"
|
||||
style="background-color: none; color: black; border: 1px solid #000"
|
||||
@click="cancelOrder"
|
||||
>取消订单</view
|
||||
>
|
||||
<!-- <view
|
||||
v-if="info.status !== 2"
|
||||
class="btn"
|
||||
style="background-color: #ffa938"
|
||||
@click="visible1 = true"
|
||||
>修改</view
|
||||
>
|
||||
<view class="btn" style="background-color: #fd0100" @click="to_pay_page"
|
||||
>收款码</view
|
||||
>
|
||||
> -->
|
||||
<view class="btn" style="background-color: #fd0100" @click="to_pay_page"
|
||||
>收款码</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
<nut-dialog v-model:visible="visible" @ok="onOk">
|
||||
<template #header>挂帐</template>
|
||||
@@ -57,9 +78,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import { confirmAfterOrder, editAfterOrder } from "../../../../../api/admin";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { onMounted, ref } from 'vue';
|
||||
import {
|
||||
cancelAfterOrder,
|
||||
confirmAfterOrder,
|
||||
editAfterOrder,
|
||||
} from '@/api/admin';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const props = defineProps({
|
||||
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 visible1 = ref(false);
|
||||
|
||||
const formVal = ref({
|
||||
seat: "",
|
||||
notes: "",
|
||||
seat: '',
|
||||
notes: '',
|
||||
});
|
||||
|
||||
const onCancel = () => {
|
||||
@@ -90,9 +135,9 @@ const onOk = async () => {
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
emits("ok");
|
||||
emits('ok');
|
||||
};
|
||||
|
||||
const onOk1 = async () => {
|
||||
@@ -107,15 +152,15 @@ const onOk1 = async () => {
|
||||
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
|
||||
formVal.value = {
|
||||
seat: "",
|
||||
notes: "",
|
||||
seat: '',
|
||||
notes: '',
|
||||
};
|
||||
|
||||
emits("ok");
|
||||
emits('ok');
|
||||
};
|
||||
|
||||
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}`,
|
||||
});
|
||||
};
|
||||
|
||||
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>
|
||||
|
||||
<style lang="scss">
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
justify-content: space-between;
|
||||
padding: 20px;
|
||||
align-items: center;
|
||||
.btn {
|
||||
width: 143px;
|
||||
height: 56px;
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "挂帐订单",
|
||||
navigationBarTitleText: '后结订单',
|
||||
});
|
||||
|
||||
@@ -7,7 +7,8 @@ page {
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin: 20px 30px;
|
||||
padding: 20px 30px;
|
||||
background-color: #ffffff;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
@@ -58,13 +59,16 @@ page {
|
||||
|
||||
image {
|
||||
width: 195px;
|
||||
min-width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
|
||||
@@ -5,25 +5,24 @@
|
||||
class="item"
|
||||
v-for="item in tabs"
|
||||
:key="item.value"
|
||||
@click="changeTabs(item.value)"
|
||||
>
|
||||
@click="changeTabs(item.value)">
|
||||
<text>{{ item.text }}</text>
|
||||
<view
|
||||
class="line"
|
||||
:class="tabsIndex == item.value ? 'active' : ''"
|
||||
></view>
|
||||
:class="tabsIndex == item.value ? 'active' : ''"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="listData.length > 0">
|
||||
<view
|
||||
class="card"
|
||||
v-for="(item, index) in (listData as any[])"
|
||||
:key="index"
|
||||
>
|
||||
v-for="(item, index) in listData as any[]"
|
||||
:key="index">
|
||||
<view class="header">
|
||||
<view>
|
||||
<text>台号: {{ item.seat }}</text>
|
||||
<text>点单人: {{ item.PlaceUser?.nickName }}</text>
|
||||
<text class="text-[#9C9C9C] text-[28px]"
|
||||
>台号: {{ item.seat }}</text
|
||||
>
|
||||
<!-- <text>点单人: {{ item.PlaceUser?.nickName }}</text> -->
|
||||
</view>
|
||||
<view
|
||||
:style="{
|
||||
@@ -38,26 +37,28 @@
|
||||
<view
|
||||
class="goods-list"
|
||||
v-for="(itm, idx) in item.OrderGoods"
|
||||
:key="idx"
|
||||
>
|
||||
:key="idx">
|
||||
<image :src="itm.Goods.cover"></image>
|
||||
<view class="center">
|
||||
<nut-ellipsis direction="end" :content="itm.Goods.name"></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
<nut-ellipsis
|
||||
direction="end"
|
||||
:content="itm.Goods.name"
|
||||
rows="3"
|
||||
expand-text="展开"
|
||||
collapse-text="收起"></nut-ellipsis>
|
||||
<view class="text-[#9C9C9C]">
|
||||
<view>订单时间: {{ item.add_time.slice(0, 10) }}</view>
|
||||
<view>备注: {{ item.notes }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num">
|
||||
<view>x{{ itm.pay_price }}</view>
|
||||
<view>¥{{ itm.pay_price }}</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view>订单时间: {{ item.add_time }}</view>
|
||||
<view>备注: {{ item.notes }}</view>
|
||||
</view>
|
||||
|
||||
<view class="line"></view>
|
||||
<Footer :info="item" @ok="get_list" />
|
||||
<!-- <view class="line"></view> -->
|
||||
<Footer :info="item" @ok="get_list" @cancelOrderOk="get_list" />
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||
@@ -65,10 +66,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getAfterOrderList } from "../../../../api/admin";
|
||||
import Footer from "./components/Footer.vue";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Footer from './components/Footer.vue';
|
||||
import { getAfterOrderList } from '@/api/admin';
|
||||
|
||||
const tabsIndex = ref(0);
|
||||
|
||||
@@ -76,19 +77,19 @@ const listData = ref([]);
|
||||
|
||||
const tabs = ref([
|
||||
{
|
||||
text: "全部",
|
||||
text: '全部',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
text: "未付款",
|
||||
text: '未收款',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
text: "挂帐中",
|
||||
text: '挂帐中',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
text: "已收款",
|
||||
text: '已收款',
|
||||
value: 2,
|
||||
},
|
||||
]);
|
||||
@@ -104,9 +105,9 @@ const changeTabs = (index: number) => {
|
||||
|
||||
const get_list = async () => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
title: '加载中',
|
||||
});
|
||||
const user_info = await Taro.getStorageSync("userInfo");
|
||||
const user_info = await Taro.getStorageSync('userInfo');
|
||||
const { data: res } = await getAfterOrderList({
|
||||
bid: user_info.data.bid,
|
||||
status: tabsIndex.value,
|
||||
@@ -118,26 +119,26 @@ const get_list = async () => {
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
return '#FD0100';
|
||||
case 1:
|
||||
return "#03A113";
|
||||
return '#03A113';
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
return '#FFA938';
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
return '未付款';
|
||||
case 1:
|
||||
return "已付款";
|
||||
return '已付款';
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
return '挂帐中';
|
||||
}
|
||||
};
|
||||
|
||||
const to_page = (item) => {
|
||||
const to_page = item => {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?bid=${item.bid}&oid=${item.oid}`,
|
||||
});
|
||||
@@ -145,5 +146,5 @@ const to_page = (item) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "收款",
|
||||
navigationBarTitleText: '收款',
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.container {
|
||||
margin: 30px;
|
||||
padding: 20px;
|
||||
|
||||
.name {
|
||||
font-size: 55px;
|
||||
@@ -18,12 +18,12 @@
|
||||
}
|
||||
|
||||
&::before {
|
||||
content: "¥";
|
||||
content: '¥';
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
content: '';
|
||||
position: absolute;
|
||||
bottom: -1px;
|
||||
width: 700px;
|
||||
@@ -38,46 +38,46 @@
|
||||
border-radius: 12px;
|
||||
margin: 20px auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 20px;
|
||||
|
||||
|
||||
text {
|
||||
margin-right: 10px;
|
||||
color: #333333;
|
||||
font-size: 28px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.line {
|
||||
width: inherit;
|
||||
height: 1px;
|
||||
background-color: #e9e9e9;
|
||||
}
|
||||
|
||||
|
||||
.goods-list {
|
||||
display: flex;
|
||||
margin: 20px;
|
||||
|
||||
|
||||
image {
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
}
|
||||
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.num {
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
@@ -85,7 +85,7 @@
|
||||
font-size: 26px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.desc {
|
||||
padding: 10px 20px;
|
||||
color: #666666;
|
||||
@@ -101,7 +101,7 @@
|
||||
.btn {
|
||||
width: 709px;
|
||||
height: 92px;
|
||||
background: #FD0100;
|
||||
background: #fd0100;
|
||||
color: #ffffff;
|
||||
font-size: 32px;
|
||||
text-align: center;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="container">
|
||||
<view class="name">立即收款</view>
|
||||
<view class="input">
|
||||
<input v-model="val" placeholder="请输入收款金额" />
|
||||
<input v-model="val" type="digit" placeholder="请输入收款金额" />
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
<view class="center">
|
||||
<nut-ellipsis
|
||||
direction="end"
|
||||
:content="itm.Goods.name"
|
||||
></nut-ellipsis>
|
||||
:content="itm.Goods.name"></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
</view>
|
||||
<view class="num">
|
||||
@@ -45,19 +44,28 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn" @click="ok">立即收款</view>
|
||||
<nut-button
|
||||
style="border-radius: 10px"
|
||||
shape="square"
|
||||
block
|
||||
:loading="isLoading"
|
||||
type="primary"
|
||||
@click="ok"
|
||||
>立即收款</nut-button
|
||||
>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getAfterOrder, createPayQr } from "../../../../../api/admin";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { getAfterOrder, createPayQr } from '@/api/admin';
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
const val = ref("");
|
||||
const val = ref('');
|
||||
|
||||
const isLoading = ref(false);
|
||||
|
||||
Taro.useLoad((e: any) => {
|
||||
get_data(e);
|
||||
@@ -65,54 +73,57 @@ Taro.useLoad((e: any) => {
|
||||
|
||||
const get_data = async ({ bid, oid }) => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
title: '加载中',
|
||||
});
|
||||
const res = await getAfterOrder({ bid, oid });
|
||||
data.value = res.data.data;
|
||||
console.log(res);
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
return '#FD0100';
|
||||
case 1:
|
||||
return "#03A113";
|
||||
return '#03A113';
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
return '#FFA938';
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
return '未付款';
|
||||
case 1:
|
||||
return "已付款";
|
||||
return '已付款';
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
return '挂帐中';
|
||||
}
|
||||
};
|
||||
|
||||
const ok = async () => {
|
||||
if (!val.value)
|
||||
return Taro.showToast({
|
||||
title: "请输入收款金额",
|
||||
icon: "none",
|
||||
title: '请输入收款金额',
|
||||
icon: 'none',
|
||||
});
|
||||
isLoading.value = true;
|
||||
const res = await createPayQr({
|
||||
oid: data.value.oid,
|
||||
bid: data.value.bid,
|
||||
price: Number(val.value),
|
||||
});
|
||||
Taro.setStorageSync("pay_code", res.data.data.code_url);
|
||||
Taro.setStorageSync('pay_code', res.data.data.code_url);
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/pending_order/wx_pay_code/index`,
|
||||
url: `/pages/admin/add_order/pending_order/wx_pay_code/index?oid=${data.value.oid}&bid=${data.value.bid}`,
|
||||
success: () => {
|
||||
isLoading.value = false;
|
||||
},
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单详情",
|
||||
navigationBarTitleText: '订单详情',
|
||||
// navigationStyle: "custom",
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
width: 710px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
margin: 20px auto;
|
||||
margin: auto;
|
||||
box-sizing: border-box;
|
||||
|
||||
.header {
|
||||
@@ -32,11 +32,14 @@
|
||||
width: 195px;
|
||||
height: 195px;
|
||||
border-radius: 12px;
|
||||
min-width: 195px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.center {
|
||||
margin-left: 20px;
|
||||
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.title {
|
||||
font-weight: bold;
|
||||
text-align: left;
|
||||
@@ -53,7 +56,7 @@
|
||||
}
|
||||
|
||||
.desc {
|
||||
padding: 10px 20px;
|
||||
// padding: 10px 0px;
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
@@ -74,4 +77,4 @@
|
||||
color: #333333;
|
||||
font-size: 32px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="card">
|
||||
<!-- <back-component title="订单详情" /> -->
|
||||
<view class="card" style="margin-top: 15px">
|
||||
<view class="header">
|
||||
<view>
|
||||
<text>台号: {{ data.seat }}</text>
|
||||
<text>点单人: {{ data.PlaceUser?.nickName }}</text>
|
||||
<text class="text-[#9C9C9C]">台号: {{ data.seat }}</text>
|
||||
<!-- <text>点单人: {{ data.PlaceUser?.nickName }}</text> -->
|
||||
</view>
|
||||
<view
|
||||
:style="{
|
||||
@@ -21,16 +22,18 @@
|
||||
<nut-ellipsis
|
||||
direction="end"
|
||||
:content="itm.Goods.name"
|
||||
></nut-ellipsis>
|
||||
rows="3"
|
||||
expand-text="展开"
|
||||
collapse-text="收起"></nut-ellipsis>
|
||||
<!-- <view class="title">{{ itm.Goods.name }}</view> -->
|
||||
</view>
|
||||
<view class="num">
|
||||
<view>x{{ itm.pay_price }}</view>
|
||||
<view>¥{{ itm.pay_price }}</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<Footer :info="data" @ok="get_data" />
|
||||
<!-- <view class="line"></view> -->
|
||||
<Footer :info="data" @ok="get_data" @cancelOrderOk="back" />
|
||||
</view>
|
||||
<nut-cell-group>
|
||||
<nut-cell>
|
||||
@@ -43,28 +46,44 @@
|
||||
<nut-cell title="订单号" :desc="data.oid"></nut-cell>
|
||||
<nut-cell title="点单人" :desc="data.PlaceUser?.nickName"></nut-cell>
|
||||
<nut-cell title="下单时间" :desc="data.add_time"></nut-cell>
|
||||
<nut-cell title="收款时间" :desc="data.payment_time"></nut-cell>
|
||||
<nut-cell title="挂帐时间" :desc="data.payment_time"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="data.status !== 0"
|
||||
title="收款时间"
|
||||
:desc="data.payment_time"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="data.status !== 0 && data.status !== 1"
|
||||
title="挂帐时间"
|
||||
:desc="data.payment_time"></nut-cell>
|
||||
<nut-cell
|
||||
title="订单状态"
|
||||
:desc="get_status_text(data.status)"
|
||||
></nut-cell>
|
||||
:desc="get_status_text(data.status)"></nut-cell>
|
||||
<nut-cell title="下单数量" :desc="String(data.count)"></nut-cell>
|
||||
<nut-cell title="订单金额" :desc="String(data.payments)"></nut-cell>
|
||||
<nut-cell title="应收金额" :desc="String(data.payments)"></nut-cell>
|
||||
<nut-cell title="实收金额" :desc="String(data.pay_amount)"></nut-cell>
|
||||
<nut-cell title="抹零" :desc="String(data.zero)"></nut-cell>
|
||||
<nut-cell title="收款方式" desc="微信"></nut-cell>
|
||||
<nut-cell title="赠送游戏豆" :desc="String(data.gift_pulse)"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="data.status !== 0"
|
||||
title="实收金额"
|
||||
:desc="String(data.pay_amount)"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="data.status !== 0"
|
||||
title="抹零"
|
||||
:desc="String(data.zero)"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="data.status !== 0"
|
||||
title="收款方式"
|
||||
desc="微信"></nut-cell>
|
||||
<nut-cell title="备注" :desc="data.notes"></nut-cell>
|
||||
</nut-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import Footer from "../components/Footer.vue";
|
||||
import { getAfterOrder } from "@/api/admin";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Footer from '../components/Footer.vue';
|
||||
import { getAfterOrder } from '@/api/admin';
|
||||
// import BackComponent from "../../../../../components/Back.vue";
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
@@ -77,7 +96,7 @@ Taro.useLoad((e: any) => {
|
||||
|
||||
const get_data = async () => {
|
||||
Taro.showLoading({
|
||||
title: "加载中",
|
||||
title: '加载中',
|
||||
});
|
||||
const res = await getAfterOrder({
|
||||
bid: params.value.bid,
|
||||
@@ -90,26 +109,32 @@ const get_data = async () => {
|
||||
const get_color = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "#FD0100";
|
||||
return '#FD0100';
|
||||
case 1:
|
||||
return "#03A113";
|
||||
return '#03A113';
|
||||
case 2:
|
||||
return "#FFA938";
|
||||
return '#FFA938';
|
||||
}
|
||||
};
|
||||
|
||||
const get_status_text = (status: number) => {
|
||||
switch (status) {
|
||||
case 0:
|
||||
return "未付款";
|
||||
return '未付款';
|
||||
case 1:
|
||||
return "已付款";
|
||||
return '已付款';
|
||||
case 2:
|
||||
return "挂帐中";
|
||||
return '挂帐中';
|
||||
}
|
||||
};
|
||||
|
||||
const back = () => {
|
||||
Taro.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "收款码",
|
||||
navigationBarTitleText: '收款码',
|
||||
});
|
||||
|
||||
@@ -21,18 +21,18 @@ page {
|
||||
|
||||
.box {
|
||||
margin: auto;
|
||||
background-image: url("../../static/ewm.png");
|
||||
background-image: url('../../static/ewm.png');
|
||||
background-size: 100% 100%;
|
||||
width: 608px;
|
||||
height: 457px;
|
||||
position: relative;
|
||||
image {
|
||||
|
||||
.img {
|
||||
position: absolute;
|
||||
width: 280px;
|
||||
height: 280px;
|
||||
top: 45%;
|
||||
left: 68%;
|
||||
transform: translate(-50%, -50%);
|
||||
top: 66px;
|
||||
right: 55px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,22 +5,56 @@
|
||||
<view class="desc">请在这里扫码</view>
|
||||
</view>
|
||||
<view class="box">
|
||||
<image :src="`https://api.pwmqr.com/qrcode/create?url=${code}`"></image>
|
||||
<image class="img" :src="dataUrl" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { onUnmounted, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { getAfterOrder } from '@/api/admin';
|
||||
|
||||
const code = ref("");
|
||||
const time_id = ref();
|
||||
|
||||
Taro.useLoad(() => {
|
||||
code.value = Taro.getStorageSync("pay_code");
|
||||
const dataUrl = ref('');
|
||||
|
||||
const info = ref<any>({});
|
||||
|
||||
Taro.useLoad(e => {
|
||||
info.value = e;
|
||||
dataUrl.value = Taro.getStorageSync('pay_code');
|
||||
time_id.value = setInterval(async () => {
|
||||
const { data } = await getAfterOrder({
|
||||
bid: info.value.bid,
|
||||
oid: info.value.oid,
|
||||
});
|
||||
if (data.data.status !== 0 && data.data.status !== 2) {
|
||||
Taro.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
});
|
||||
setTimeout(() => {
|
||||
Taro.removeStorageSync('pay_code');
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${info.value.oid}&bid=${info.value.bid}`,
|
||||
});
|
||||
}, 3000);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
Taro.useDidHide(() => {
|
||||
clearInterval(time_id.value);
|
||||
Taro.removeStorageSync('pay_code');
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
clearInterval(time_id.value);
|
||||
Taro.removeStorageSync('pay_code');
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "./index.scss";
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
BIN
src/pages/admin/add_order/static/WechatIMG10.jpg
Normal file
BIN
src/pages/admin/add_order/static/WechatIMG10.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 306 KiB |
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单详情",
|
||||
navigationBarTitleText: '订单详情',
|
||||
});
|
||||
|
||||
@@ -1,58 +1,87 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="header">
|
||||
<view>订单号:{{ info.oid }}</view>
|
||||
<view>{{ info.add_time }}</view>
|
||||
</view>
|
||||
<view class="good-info">
|
||||
<view class="top">
|
||||
<image :src="info.BindGoods?.cover" />
|
||||
<view class="title">{{ info.BindGoods?.name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="public-total">
|
||||
共{{ info.count }}件商品,已支付
|
||||
<text class="money">{{ info.number }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 订单信息 -->
|
||||
<nut-cell-group>
|
||||
<nut-cell title="订单状态:" :desc="orderStatus"></nut-cell>
|
||||
<nut-cell title="下单用户:" :desc="info.BindUser?.nickName"></nut-cell>
|
||||
<nut-cell title="用户手机号:" :desc="info.BindUser?.phone"></nut-cell>
|
||||
<nut-cell>
|
||||
<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?.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
|
||||
v-if="info.status === 2"
|
||||
title="核销人员:"
|
||||
:desc="info.BindCancelUser?.nickName"
|
||||
></nut-cell>
|
||||
:desc="info.CancelUser?.nickName"></nut-cell>
|
||||
<nut-cell
|
||||
v-if="info.status === 2"
|
||||
title="核销人手机号:"
|
||||
:desc="info.BindCancelUser?.phone"
|
||||
></nut-cell>
|
||||
:desc="info.CancelUser?.phone"></nut-cell>
|
||||
</nut-cell-group>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import { ref } from "vue";
|
||||
import Taro from '@tarojs/taro';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const info = ref<any>({});
|
||||
|
||||
Taro.useLoad(() => {
|
||||
info.value = Taro.getStorageSync("ver_order_info");
|
||||
info.value = Taro.getStorageSync('ver_order_info');
|
||||
});
|
||||
|
||||
const orderStatus = () => {
|
||||
switch (info.value.status) {
|
||||
case 1:
|
||||
return "待核销";
|
||||
case 2:
|
||||
return "已核销";
|
||||
case 3:
|
||||
return "已失效";
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@@ -60,6 +89,13 @@ page {
|
||||
--nut-cell-desc-color: #000;
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #f5f5f5;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.header {
|
||||
background: linear-gradient(90deg, #2291f8 0, #1cd1dc);
|
||||
padding: 30px;
|
||||
@@ -86,6 +122,7 @@ page {
|
||||
image {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.title {
|
||||
@@ -113,4 +150,79 @@ page {
|
||||
color: #ff4c3c;
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
box-sizing: border-box;
|
||||
margin: 15px auto;
|
||||
background-color: #fff;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.center {
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// align-items: flex-start;
|
||||
margin-bottom: 10px;
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单管理",
|
||||
navigationBarTitleText: '订单管理',
|
||||
});
|
||||
|
||||
106
src/pages/admin/order_manage/index.scss
Normal file
106
src/pages/admin/order_manage/index.scss
Normal file
@@ -0,0 +1,106 @@
|
||||
.Card {
|
||||
width: 90%;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
margin: 10px auto;
|
||||
padding: 25px;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.gridBox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 33.33%);
|
||||
grid-template-rows: repeat(3, 33.33%);
|
||||
grid-gap: 10px;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
|
||||
.item {
|
||||
margin-top: 50px;
|
||||
.title {
|
||||
font-size: 50px;
|
||||
}
|
||||
.sub {
|
||||
font-size: 25px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.orderinfo {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 20px;
|
||||
align-items: center;
|
||||
.info {
|
||||
text-align: center;
|
||||
|
||||
.num {
|
||||
font-size: 40px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.sub {
|
||||
font-size: 25px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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 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="top"
|
||||
><text class="iconfont icon-shujutongji icon"></text
|
||||
@@ -34,16 +55,14 @@
|
||||
<navigator
|
||||
class="item"
|
||||
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="sub">今日成交额</view>
|
||||
</navigator>
|
||||
<navigator
|
||||
class="item"
|
||||
hover-class="none"
|
||||
:url="`/pages/admin/statistics/index?type=price&time=yesterday`"
|
||||
>
|
||||
:url="`/pages/admin/statistics/index?type=price&time=yesterday`">
|
||||
<view class="title">{{
|
||||
orderInfo?.total?.YesterdayNumber || 0
|
||||
}}</view>
|
||||
@@ -52,32 +71,28 @@
|
||||
<navigator
|
||||
class="item"
|
||||
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="sub">本月成交额</view>
|
||||
</navigator>
|
||||
<navigator
|
||||
class="item"
|
||||
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="sub">今日订单数</view>
|
||||
</navigator>
|
||||
<navigator
|
||||
class="item"
|
||||
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="sub">昨日订单数</view>
|
||||
</navigator>
|
||||
<navigator
|
||||
class="item"
|
||||
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="sub">本月订单数</view>
|
||||
</navigator>
|
||||
@@ -93,8 +108,7 @@
|
||||
:bordered="true"
|
||||
class="table"
|
||||
:columns="columns"
|
||||
:data="orderInfo?.list"
|
||||
></nut-table>
|
||||
:data="orderInfo?.list"></nut-table>
|
||||
</view>
|
||||
<nut-empty v-else description="暂无订单数据"></nut-empty>
|
||||
</view>
|
||||
@@ -102,9 +116,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h, ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { orderStatistics } from "../../../api/admin";
|
||||
import { h, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { TriangleDown } from '@nutui/icons-vue-taro';
|
||||
import { orderStatistics } from '../../../api/admin';
|
||||
|
||||
Taro.useLoad(() => {
|
||||
getData();
|
||||
@@ -112,39 +127,64 @@ Taro.useLoad(() => {
|
||||
|
||||
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([
|
||||
{
|
||||
title: "日期",
|
||||
key: "Date",
|
||||
align: "center",
|
||||
title: '日期',
|
||||
key: 'Date',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "订单数",
|
||||
key: "TotalCount",
|
||||
align: "center",
|
||||
title: '订单数',
|
||||
key: 'TotalCount',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "交易额",
|
||||
key: "NumberSum",
|
||||
align: "center",
|
||||
render: (row) => {
|
||||
title: '交易额',
|
||||
key: 'NumberSum',
|
||||
align: 'center',
|
||||
render: row => {
|
||||
return h(
|
||||
"view",
|
||||
'view',
|
||||
{
|
||||
style: {
|
||||
color: "red",
|
||||
color: 'red',
|
||||
},
|
||||
},
|
||||
row.NumberSum
|
||||
row.NumberSum,
|
||||
);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const getData = async () => {
|
||||
const user_info = Taro.getStorageSync("userInfo");
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const res = await orderStatistics({
|
||||
bid: user_info.data.bid,
|
||||
pay_type: menus.value[menuIndex.value].value,
|
||||
});
|
||||
orderInfo.value = res.data;
|
||||
};
|
||||
@@ -157,69 +197,5 @@ const toListPage = (index: number) => {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.Card {
|
||||
width: 90%;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
margin: 10px auto;
|
||||
padding: 25px;
|
||||
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
text {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.icon {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.gridBox {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 33.33%);
|
||||
grid-template-rows: repeat(3, 33.33%);
|
||||
grid-gap: 10px;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
|
||||
.item {
|
||||
margin-top: 50px;
|
||||
.title {
|
||||
font-size: 50px;
|
||||
}
|
||||
.sub {
|
||||
font-size: 25px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.orderinfo {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 20px;
|
||||
align-items: center;
|
||||
.info {
|
||||
text-align: center;
|
||||
|
||||
.num {
|
||||
font-size: 40px;
|
||||
color: red;
|
||||
}
|
||||
|
||||
.sub {
|
||||
font-size: 25px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单列表",
|
||||
navigationBarTitleText: '订单列表',
|
||||
});
|
||||
|
||||
144
src/pages/admin/order_manage/list/index.scss
Normal file
144
src/pages/admin/order_manage/list/index.scss
Normal file
@@ -0,0 +1,144 @@
|
||||
.tabs-1 {
|
||||
display: flex;
|
||||
box-sizing: border-box;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
// padding: 10px;
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.line {
|
||||
margin: 10px auto;
|
||||
width: 50px;
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,22 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="tabs">
|
||||
<view class="tabs-1">
|
||||
<view
|
||||
class="item"
|
||||
v-for="item in opt"
|
||||
:key="item.value"
|
||||
@click="tabChange(item.value)"
|
||||
>
|
||||
<view class="title">{{ item.text }}</view>
|
||||
v-for="(item, index) in opt"
|
||||
:key="index"
|
||||
@click="tabChange(item.value)">
|
||||
<view
|
||||
:style="{
|
||||
color: item.value === tabVal ? '#333333' : '#9C9C9C',
|
||||
}"
|
||||
>{{ item.text }}</view
|
||||
>
|
||||
<view
|
||||
class="line"
|
||||
:style="{
|
||||
backgroundColor: item.value === tabVal ? 'red' : '',
|
||||
}"
|
||||
></view>
|
||||
backgroundColor: item.value === tabVal ? '#FFD940' : '',
|
||||
}"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="dataList.length > 0">
|
||||
@@ -21,73 +24,91 @@
|
||||
class="order-card"
|
||||
v-for="(item, index) in dataList"
|
||||
:key="index"
|
||||
@click="toDetailPage(item)"
|
||||
>
|
||||
@click="toDetailPage(item)">
|
||||
<view class="top">
|
||||
<view class="name">订单号:{{ item.oid }}</view>
|
||||
<!-- <view class="sub">下单时间:{{ item.add_time }}</view> -->
|
||||
<view class="sub">核销时间:{{ item.cancel_time || "待核销" }}</view>
|
||||
<!-- <view style="color: red">{{
|
||||
item.status === 0
|
||||
? "待付款"
|
||||
: item.status === 1
|
||||
? "待使用"
|
||||
: item.status === 2
|
||||
? "已使用"
|
||||
: "已失效"
|
||||
}}</view> -->
|
||||
<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 :src="itm.Goods.cover" />
|
||||
<view class="title">{{ itm.Goods.name }} </view>
|
||||
<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>{{ itm.pay_price }}元</view>
|
||||
<view>{{ itm.pay_integral }}积分</view>
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="bom" style="text-align: right">
|
||||
共{{ item.count }}件商品,支付方式:{{
|
||||
item.pay_type === 1 ? "微信" : "积分"
|
||||
}},实付:
|
||||
<text style="color: red">{{
|
||||
item.pay_type === 1 ? item.price : item.exchange
|
||||
}}</text>
|
||||
<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>
|
||||
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getActiveOrderList } from "../../../../api/admin";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { getActiveOrderList } from '../../../../api/admin';
|
||||
|
||||
const opt = ref([
|
||||
{
|
||||
text: "全部",
|
||||
text: '全部',
|
||||
value: 0,
|
||||
},
|
||||
{
|
||||
text: "待付款",
|
||||
text: '待付款',
|
||||
value: 1,
|
||||
},
|
||||
{
|
||||
text: "待核销",
|
||||
text: '待核销',
|
||||
value: 2,
|
||||
},
|
||||
{
|
||||
text: "已核销",
|
||||
text: '已核销',
|
||||
value: 3,
|
||||
},
|
||||
{
|
||||
text: "已失效",
|
||||
text: '已失效',
|
||||
value: 4,
|
||||
},
|
||||
]);
|
||||
@@ -96,124 +117,64 @@ const tabVal = ref(0);
|
||||
|
||||
const dataList = ref<any>([]);
|
||||
|
||||
Taro.useLoad((options) => {
|
||||
const pageOpt = ref({
|
||||
page: 1,
|
||||
total: 0,
|
||||
});
|
||||
|
||||
Taro.useLoad(options => {
|
||||
tabVal.value = Number(options.type);
|
||||
getData();
|
||||
});
|
||||
|
||||
const getData = async () => {
|
||||
Taro.showLoading({
|
||||
title: '加载中',
|
||||
});
|
||||
try {
|
||||
const user_info = Taro.getStorageSync("userInfo");
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const data = {
|
||||
bid: user_info.data.bid,
|
||||
status: tabVal.value,
|
||||
PageNum: pageOpt.value.page,
|
||||
PageSize: 10,
|
||||
};
|
||||
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) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
const tabChange = (e: number) => {
|
||||
tabVal.value = e;
|
||||
dataList.value = [];
|
||||
getData();
|
||||
};
|
||||
|
||||
const toDetailPage = (item: any) => {
|
||||
Taro.setStorageSync("ver_order_info", item);
|
||||
Taro.setStorageSync('ver_order_info', item);
|
||||
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>
|
||||
|
||||
<style lang="scss">
|
||||
.tabs {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
.item {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.line {
|
||||
margin-top: 10px;
|
||||
width: 50px;
|
||||
height: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.order-card {
|
||||
width: 95%;
|
||||
box-sizing: border-box;
|
||||
margin: 15px auto;
|
||||
background-color: #fff;
|
||||
border-radius: 10px;
|
||||
padding: 20px;
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #f5f5f5;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.top {
|
||||
// display: flex;
|
||||
// justify-content: space-between;
|
||||
// align-items: center;
|
||||
|
||||
.name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sub {
|
||||
color: #999;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.center {
|
||||
.top {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// align-items: flex-start;
|
||||
|
||||
image {
|
||||
width: 150px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin-left: 10px;
|
||||
display: -webkit-box;
|
||||
overflow: hidden;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-overflow: ellipsis;
|
||||
width: 350px;
|
||||
}
|
||||
|
||||
.right {
|
||||
margin-left: 10px;
|
||||
font-size: 28px;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单数据统计",
|
||||
navigationBarTitleText: '订单数据统计',
|
||||
});
|
||||
|
||||
@@ -5,62 +5,66 @@
|
||||
<view
|
||||
class="item"
|
||||
:class="time == 'today' ? 'on' : ''"
|
||||
@click="setTime('today')"
|
||||
>
|
||||
@click="setTime('today')">
|
||||
今天
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="time == 'yesterday' ? 'on' : ''"
|
||||
@click="setTime('yesterday')"
|
||||
>
|
||||
@click="setTime('yesterday')">
|
||||
昨天
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="time == 'seven' ? 'on' : ''"
|
||||
@click="setTime('seven')"
|
||||
>
|
||||
@click="setTime('seven')">
|
||||
最近7天
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="time == 'month' ? 'on' : ''"
|
||||
@click="setTime('month')"
|
||||
>
|
||||
@click="setTime('month')">
|
||||
本月
|
||||
</view>
|
||||
<view
|
||||
class="item"
|
||||
:class="time == 'date' ? 'on' : ''"
|
||||
@click="dateTitle"
|
||||
>
|
||||
@click="dateTitle">
|
||||
自定义
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="wrapper">
|
||||
<view class="title">
|
||||
{{ title }}{{ where.type == 1 ? "营业额" : "订单量" }}
|
||||
<view class="flex justify-between">
|
||||
<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 v-if="where.type == 1" class="money">{{ dataObj.all || 0 }}</view>
|
||||
<view v-else class="money">{{ dataObj.all || 0 }}</view>
|
||||
|
||||
<view class="increase">
|
||||
<view>
|
||||
{{ time === "date" ? "" : title }}增长率:<text
|
||||
:class="dataObj.growthRate >= 0 ? 'red' : 'green'"
|
||||
>
|
||||
{{ time === 'date' ? '' : title }}增长率:<text
|
||||
:class="dataObj.growthRate >= 0 ? 'red' : 'green'">
|
||||
{{ dataObj.growthRate }}%
|
||||
<text
|
||||
class="iconfont"
|
||||
:class="
|
||||
dataObj.growthRate >= 0 ? 'icon-xiangshang1' : 'icon-xiangxia2'
|
||||
"
|
||||
></text
|
||||
"></text
|
||||
></text>
|
||||
</view>
|
||||
<view>
|
||||
{{ time === "date" ? "" : title }}增长:<text
|
||||
{{ time === 'date' ? '' : title }}增长:<text
|
||||
:class="dataObj.growthNumber >= 0 ? 'red' : 'green'"
|
||||
>{{ dataObj.growthNumber }}
|
||||
<text
|
||||
@@ -69,8 +73,7 @@
|
||||
dataObj.growthNumber >= 0
|
||||
? 'icon-xiangshang1'
|
||||
: 'icon-xiangxia2'
|
||||
"
|
||||
></text
|
||||
"></text
|
||||
></text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -82,8 +85,7 @@
|
||||
:ontouch="true"
|
||||
@touchstart="touchStart"
|
||||
@touchmove="touchMove"
|
||||
@touchend="touchEnd"
|
||||
/>
|
||||
@touchend="touchEnd" />
|
||||
</view>
|
||||
|
||||
<view class="Card">
|
||||
@@ -96,8 +98,7 @@
|
||||
:bordered="true"
|
||||
class="table"
|
||||
:columns="columns"
|
||||
:data="dataObj?.list"
|
||||
></nut-table>
|
||||
:data="dataObj?.list"></nut-table>
|
||||
</view>
|
||||
<nut-empty v-else description="暂无订单数据"></nut-empty>
|
||||
</view>
|
||||
@@ -106,22 +107,22 @@
|
||||
<nut-calendar
|
||||
v-model:visible="isVisible"
|
||||
type="range"
|
||||
:default-value="pickerVal"
|
||||
:start-date="date_start"
|
||||
@close="isVisible = false"
|
||||
@choose="setChooseValue"
|
||||
>
|
||||
@choose="setChooseValue">
|
||||
</nut-calendar>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, h } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { growthRate } from "../../../api/admin";
|
||||
import dayjs from "dayjs";
|
||||
import uCharts from "../../../utils/js_sdk/u-charts.min.js";
|
||||
import { ref, computed, h } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { growthRate } from '../../../api/admin';
|
||||
import dayjs from 'dayjs';
|
||||
import uCharts from '../../../utils/js_sdk/u-charts.min.js';
|
||||
|
||||
const time = ref("");
|
||||
const time = ref('');
|
||||
|
||||
const isVisible = ref(false);
|
||||
|
||||
@@ -137,44 +138,44 @@ const chartWH = ref({
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
title: "日期",
|
||||
key: "Date",
|
||||
align: "center",
|
||||
title: '日期',
|
||||
key: 'Date',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "订单数",
|
||||
key: "TotalCount",
|
||||
align: "center",
|
||||
title: '订单数',
|
||||
key: 'TotalCount',
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
title: "交易额",
|
||||
key: "NumberSum",
|
||||
align: "center",
|
||||
render: (row) => {
|
||||
title: '交易额',
|
||||
key: 'NumberSum',
|
||||
align: 'center',
|
||||
render: row => {
|
||||
return h(
|
||||
"view",
|
||||
'view',
|
||||
{
|
||||
style: {
|
||||
color: "red",
|
||||
color: 'red',
|
||||
},
|
||||
},
|
||||
row.NumberSum
|
||||
row.NumberSum,
|
||||
);
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
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({
|
||||
type: 1,
|
||||
status: 2,
|
||||
start: "",
|
||||
end: "",
|
||||
start: '',
|
||||
end: '',
|
||||
});
|
||||
|
||||
const dataObj = ref<any>({});
|
||||
@@ -183,49 +184,55 @@ const opts = ref<any>({
|
||||
categories: [],
|
||||
series: [
|
||||
{
|
||||
name: "营业额",
|
||||
name: '营业额',
|
||||
data: [],
|
||||
},
|
||||
{
|
||||
name: "订单量",
|
||||
name: '订单量',
|
||||
data: [],
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
Taro.useLoad((options) => {
|
||||
where.value.type = options.type === "price" ? 1 : 2;
|
||||
const pickerVal = ref<any>([]);
|
||||
|
||||
Taro.useLoad(options => {
|
||||
where.value.type = options.type === 'price' ? 1 : 2;
|
||||
time.value = options.time;
|
||||
setTime(options.time);
|
||||
// getData();
|
||||
pickerVal.value = [
|
||||
dayjs().format('YYYY-MM-DD'),
|
||||
dayjs().format('YYYY-MM-DD'),
|
||||
];
|
||||
});
|
||||
|
||||
const setTime = (type: string) => {
|
||||
time.value = type;
|
||||
switch (type) {
|
||||
case "today":
|
||||
title.value = "今日";
|
||||
case 'today':
|
||||
title.value = '今日';
|
||||
where.value.status = 2;
|
||||
where.value.start = dayjs().format("YYYY-MM-DD");
|
||||
where.value.end = dayjs().format("YYYY-MM-DD");
|
||||
where.value.start = dayjs().format('YYYY-MM-DD');
|
||||
where.value.end = dayjs().format('YYYY-MM-DD');
|
||||
break;
|
||||
case "yesterday":
|
||||
title.value = "昨日";
|
||||
case 'yesterday':
|
||||
title.value = '昨日';
|
||||
where.value.status = 2;
|
||||
where.value.start = dayjs().add(-1, "day").format("YYYY-MM-DD");
|
||||
where.value.end = 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');
|
||||
break;
|
||||
case "seven":
|
||||
title.value = "7天";
|
||||
case 'seven':
|
||||
title.value = '7天';
|
||||
where.value.status = 2;
|
||||
where.value.start = dayjs().add(-6, "day").format("YYYY-MM-DD");
|
||||
where.value.end = dayjs().format("YYYY-MM-DD");
|
||||
where.value.start = dayjs().add(-6, 'day').format('YYYY-MM-DD');
|
||||
where.value.end = dayjs().format('YYYY-MM-DD');
|
||||
break;
|
||||
case "month":
|
||||
title.value = "本月";
|
||||
case 'month':
|
||||
title.value = '本月';
|
||||
where.value.status = 1;
|
||||
where.value.start = dayjs().startOf("month").format("YYYY-MM-DD");
|
||||
where.value.end = dayjs().format("YYYY-MM-DD");
|
||||
where.value.start = dayjs().startOf('month').format('YYYY-MM-DD');
|
||||
where.value.end = dayjs().format('YYYY-MM-DD');
|
||||
break;
|
||||
}
|
||||
getData();
|
||||
@@ -233,7 +240,7 @@ const setTime = (type: string) => {
|
||||
|
||||
const dateTitle = () => {
|
||||
where.value.status = 1;
|
||||
time.value = "date";
|
||||
time.value = 'date';
|
||||
isVisible.value = true;
|
||||
};
|
||||
|
||||
@@ -246,7 +253,7 @@ const setChooseValue = (ref: any) => {
|
||||
|
||||
const getData = async () => {
|
||||
try {
|
||||
const user_info = Taro.getStorageSync("userInfo");
|
||||
const user_info = Taro.getStorageSync('userInfo');
|
||||
const res = await growthRate({
|
||||
bid: user_info.data.bid,
|
||||
status: where.value.status,
|
||||
@@ -266,16 +273,16 @@ const getData = async () => {
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const create_canvas = () => {
|
||||
const ctx = Taro.createCanvasContext("myChart");
|
||||
const ctx = Taro.createCanvasContext('myChart');
|
||||
canvas_obj = new uCharts({
|
||||
type: "column",
|
||||
type: 'column',
|
||||
context: ctx,
|
||||
width: chartWH.value.width,
|
||||
height: chartWH.value.height,
|
||||
@@ -283,17 +290,17 @@ const create_canvas = () => {
|
||||
series: opts.value.series,
|
||||
pixelRatio: chartWH.value.pixelRatio,
|
||||
animation: true,
|
||||
background: "#FFFFFF",
|
||||
background: '#FFFFFF',
|
||||
color: [
|
||||
"#1890FF",
|
||||
"#91CB74",
|
||||
"#FAC858",
|
||||
"#EE6666",
|
||||
"#73C0DE",
|
||||
"#3CA272",
|
||||
"#FC8452",
|
||||
"#9A60B4",
|
||||
"#ea7ccc",
|
||||
'#1890FF',
|
||||
'#91CB74',
|
||||
'#FAC858',
|
||||
'#EE6666',
|
||||
'#73C0DE',
|
||||
'#3CA272',
|
||||
'#FC8452',
|
||||
'#9A60B4',
|
||||
'#ea7ccc',
|
||||
],
|
||||
padding: [15, 15, 0, 15],
|
||||
enableScroll: true,
|
||||
@@ -312,9 +319,9 @@ const create_canvas = () => {
|
||||
},
|
||||
extra: {
|
||||
column: {
|
||||
type: "group",
|
||||
type: 'group',
|
||||
width: 20,
|
||||
activeBgColor: "#000000",
|
||||
activeBgColor: '#000000',
|
||||
activeBgOpacity: 0.08,
|
||||
},
|
||||
},
|
||||
@@ -324,7 +331,7 @@ const create_canvas = () => {
|
||||
const touchStart = (e: any) => {
|
||||
canvas_obj.showToolTip(e, {
|
||||
format: function (item: any, category: any) {
|
||||
return category + " " + item.name + ":" + item.data;
|
||||
return category + ' ' + item.name + ':' + item.data;
|
||||
},
|
||||
});
|
||||
canvas_obj.scrollStart(e);
|
||||
@@ -399,6 +406,7 @@ const touchEnd = (e: any) => {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.red {
|
||||
color: #ff6969;
|
||||
}
|
||||
@@ -406,6 +414,7 @@ const touchEnd = (e: any) => {
|
||||
.green {
|
||||
color: #1abb1d;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 23px;
|
||||
margin-left: 15px;
|
||||
@@ -432,6 +441,7 @@ const touchEnd = (e: any) => {
|
||||
.top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text {
|
||||
margin-right: 5px;
|
||||
}
|
||||
@@ -440,6 +450,7 @@ const touchEnd = (e: any) => {
|
||||
color: #fa2c19;
|
||||
}
|
||||
}
|
||||
|
||||
.table {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "订单核销",
|
||||
navigationBarTitleText: '订单核销',
|
||||
});
|
||||
|
||||
@@ -1,13 +1,89 @@
|
||||
<template>
|
||||
<view>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import Taro from '@tarojs/taro';
|
||||
import { getActiveOrderList } from '@/api/admin';
|
||||
import { ref } from 'vue';
|
||||
|
||||
// url参数转对象
|
||||
// const urlParse = (url: string) => {
|
||||
@@ -28,8 +104,8 @@ import Taro from "@tarojs/taro";
|
||||
const scanCode = () => {
|
||||
Taro.scanCode({
|
||||
onlyFromCamera: true,
|
||||
scanType: ["qrCode"],
|
||||
success: async (res) => {
|
||||
scanType: ['qrCode'],
|
||||
success: async res => {
|
||||
try {
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/verify/verify_list/index?oid=${res.result}`,
|
||||
@@ -37,32 +113,126 @@ const scanCode = () => {
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
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>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
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-size: 100% 30%;
|
||||
background-size: 100% 25%;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 80%;
|
||||
width: 690px;
|
||||
height: 300px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
margin: 300px auto;
|
||||
border-radius: 10px;
|
||||
margin: 300px auto 50px auto;
|
||||
border-radius: 33px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
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>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
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>
|
||||
<view>
|
||||
<view class="card">
|
||||
<view>订单号:{{ goodInfo.oid }}</view>
|
||||
<view class="text-[#7A7A7A]">订单号:{{ goodInfo.oid }}</view>
|
||||
<view class="line"></view>
|
||||
<view
|
||||
class="container"
|
||||
v-for="(item, index) in goodInfo.OrderGoods"
|
||||
:key="index"
|
||||
>
|
||||
<image class="image" :src="item.Goods.cover" mode="widthFix"></image>
|
||||
:key="index">
|
||||
<image class="image" :src="item.Goods.cover"></image>
|
||||
<view class="info">
|
||||
<view class="title">商品名称:{{ item.Goods.name }}</view>
|
||||
<view class="title">描述:{{ item.Goods.profile }}</view>
|
||||
<view class="num"
|
||||
>数量: <text style="color: red">{{ item.number }}</text></view
|
||||
>
|
||||
<view class="title">{{ item.Goods.name }}</view>
|
||||
<view class="text-[#7A7A7A] text-[22px]">{{
|
||||
item.Goods.profile || '此商品暂无描述'
|
||||
}}</view>
|
||||
</view>
|
||||
<view></view>
|
||||
<view class="text-[#9C9C9C]">x{{ item.number }}</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<text>支付方式:{{ goodInfo.pay_type === 1 ? "微信" : "积分" }}</text
|
||||
>,
|
||||
<text
|
||||
>总计:{{
|
||||
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
|
||||
}}</text
|
||||
>
|
||||
<view class="line"></view>
|
||||
<view class="cz">
|
||||
<view
|
||||
class="flex justify-between items-center mt-3 mb-2 text-[25px]"
|
||||
style="text-align: right">
|
||||
<text class="text-[#9C9C9C] text-left"
|
||||
>共{{ goodInfo.count }}件商品</text
|
||||
>
|
||||
<text class="text-[26px] flex-1"
|
||||
>实付款: {{ goodInfo.discount_price }} (元)
|
||||
<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
|
||||
>
|
||||
</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>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getActiveVerifyList, activeOrderVerify } from "@/api/admin";
|
||||
import { ref } from "vue";
|
||||
import Taro from '@tarojs/taro';
|
||||
import { getActiveVerifyList, activeOrderVerify } from '@/api/admin';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const opt = ref<any>({});
|
||||
|
||||
Taro.useLoad((options) => {
|
||||
Taro.useLoad(options => {
|
||||
opt.value = options;
|
||||
getData(options);
|
||||
});
|
||||
@@ -51,15 +72,15 @@ Taro.useLoad((options) => {
|
||||
const goodInfo = ref<any>({});
|
||||
|
||||
const getData = async (options: any) => {
|
||||
const merInfo = Taro.getStorageSync("mer_info");
|
||||
const merInfo = Taro.getStorageSync('userInfo');
|
||||
const res = await getActiveVerifyList({
|
||||
oid: options.oid,
|
||||
bid: merInfo.bid,
|
||||
bid: merInfo.data.bid,
|
||||
});
|
||||
if (!res.data.data.oid) {
|
||||
Taro.showToast({
|
||||
title: "没有此订单",
|
||||
icon: "none",
|
||||
title: '没有此订单',
|
||||
icon: 'none',
|
||||
});
|
||||
setTimeout(() => {
|
||||
Taro.navigateBack({
|
||||
@@ -74,62 +95,48 @@ const subVerify = async () => {
|
||||
try {
|
||||
const res = await activeOrderVerify({
|
||||
oid: goodInfo.value.oid,
|
||||
bid: goodInfo.value.bid,
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
//Taro.showToast({
|
||||
// title: res.msg,
|
||||
// icon: 'none',
|
||||
//});
|
||||
Taro.showModal({
|
||||
title: '核销成功',
|
||||
content: res.msg,
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
Taro.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}, 3000);
|
||||
},
|
||||
});
|
||||
setTimeout(() => {
|
||||
Taro.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
}, 3000);
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: "none",
|
||||
icon: 'none',
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
const getPayType = (type: number) => {
|
||||
switch (type) {
|
||||
case 1:
|
||||
return '微信线上支付';
|
||||
case 2:
|
||||
return '平台积分支付';
|
||||
case 3:
|
||||
return '智多鑫积分支付';
|
||||
case 3:
|
||||
return '渔乐潮玩支付';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.card {
|
||||
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;
|
||||
}
|
||||
}
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
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>
|
||||
import { ref, h } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getWithdrawList, addWithdraw } from "@/api/admin";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
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 str = ref(0);
|
||||
|
||||
const formRef = ref();
|
||||
|
||||
const basicData = ref({
|
||||
num: "",
|
||||
num: '',
|
||||
});
|
||||
|
||||
const showPreview = ref(false);
|
||||
|
||||
const visible1 = ref(false);
|
||||
|
||||
const imgData = ref([
|
||||
{
|
||||
src: "",
|
||||
src: '',
|
||||
},
|
||||
]);
|
||||
|
||||
const columns = ref([
|
||||
{
|
||||
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 data = ref<any>([]);
|
||||
|
||||
const pagination = ref({
|
||||
page: 1,
|
||||
itemsPerPage: 5,
|
||||
showPageSize: 5,
|
||||
totalItems: 0,
|
||||
change: (page: number) => {
|
||||
pagination.value.page = page;
|
||||
getData();
|
||||
},
|
||||
total: 0,
|
||||
});
|
||||
|
||||
const hideFn = () => {
|
||||
showPreview.value = false;
|
||||
};
|
||||
|
||||
Taro.useLoad(() => {
|
||||
user_info.value = Taro.getStorageSync('userInfo');
|
||||
mer_info.value = Taro.getStorageSync('mer_info');
|
||||
getData();
|
||||
});
|
||||
|
||||
@@ -102,12 +43,13 @@ const getData = async () => {
|
||||
try {
|
||||
const res = await getWithdrawList({
|
||||
PageNum: pagination.value.page,
|
||||
PageSize: pagination.value.showPageSize,
|
||||
Bid: user_info.data.bid,
|
||||
PageSize: 10,
|
||||
Bid: user_info.value.data.bid,
|
||||
});
|
||||
data.value = res.data.data || [];
|
||||
pagination.value.totalItems = res.data.total;
|
||||
data.value.push(...res.data.data);
|
||||
pagination.value.total = res.data.total;
|
||||
row.value = res.data.integral || 0;
|
||||
str.value = res.data.number || 0;
|
||||
} catch (e) {
|
||||
throw e;
|
||||
}
|
||||
@@ -115,111 +57,205 @@ const getData = async () => {
|
||||
|
||||
const add = async () => {
|
||||
try {
|
||||
if (Number(basicData.value.num) === 0)
|
||||
return Taro.showToast({
|
||||
title: "提现积分需大于0",
|
||||
icon: "none",
|
||||
});
|
||||
const res = await addWithdraw({
|
||||
Bid: user_info.data.bid,
|
||||
Number: Number(basicData.value.num),
|
||||
formRef.value?.validate().then(async ({ valid }) => {
|
||||
if (valid) {
|
||||
const res = await addWithdraw({
|
||||
Bid: user_info.value.data.bid,
|
||||
Number: Number(basicData.value.num),
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
basicData.value.num = '';
|
||||
await getData();
|
||||
}
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
icon: "none",
|
||||
});
|
||||
await getData();
|
||||
} catch (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>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<nut-form>
|
||||
<nut-form-item label="提现积分:">
|
||||
<nut-input
|
||||
v-model="basicData.num"
|
||||
class="nut-input-text"
|
||||
placeholder="请输入提现积分"
|
||||
type="text"
|
||||
/>
|
||||
</nut-form-item>
|
||||
<nut-form-item>
|
||||
<view class="card">
|
||||
<view class="container">
|
||||
<view>
|
||||
当前可提现积分:
|
||||
<text class="text-red">{{ row }}</text>
|
||||
<view class="font-bold text-[35px]">{{ row }}</view>
|
||||
<view class="text-[25px] mt-2">可提现余额</view>
|
||||
</view>
|
||||
<view style="margin-top: 10px">
|
||||
实际到账:
|
||||
<text class="text-red">{{ (row / 100).toFixed(2) }}</text>
|
||||
元
|
||||
<!-- <view class="line"></view>
|
||||
<view class="">
|
||||
<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>
|
||||
</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>
|
||||
<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>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
.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 {
|
||||
background-color: #4fc08d;
|
||||
}
|
||||
|
||||
.danger {
|
||||
background-color: #df3526;
|
||||
}
|
||||
|
||||
.warning {
|
||||
background-color: #f3812e;
|
||||
}
|
||||
|
||||
.image {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
}
|
||||
@import './index.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
export default definePageConfig({
|
||||
navigationBarTitleText: "全部服务",
|
||||
navigationBarTitleText: '全部服务',
|
||||
});
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
v-for="itm in item.Classify"
|
||||
:key="itm.ID"
|
||||
:text="itm.name"
|
||||
@click="toDetails(itm)"
|
||||
>
|
||||
@click="toDetails(itm)">
|
||||
<image :src="itm.icon" />
|
||||
</nut-grid-item>
|
||||
</nut-grid>
|
||||
@@ -20,9 +19,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import Taro from "@tarojs/taro";
|
||||
import { getAllMerCategory } from "@/api/goods";
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import { getAllMerCategory } from '@/api/goods';
|
||||
|
||||
const list = ref<
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user