Compare commits

...

80 Commits

Author SHA1 Message Date
5c0036acfd fix(other): bug修复
Some checks failed
CI Build & Upload (WeApp) / build-upload-dev (push) Failing after 2m31s
CI Build & Upload (WeApp) / build-upload-prod (push) Has been skipped
CI Build & Upload (WeApp) / build-upload-reserve (push) Has been skipped
2026-01-10 21:30:50 +08:00
2c38893c43 fix(components): 修复搜索页样式错乱
Some checks failed
CI Build & Upload (WeApp) / build-upload-dev (push) Failing after 3m58s
CI Build & Upload (WeApp) / build-upload-prod (push) Has been skipped
CI Build & Upload (WeApp) / build-upload-reserve (push) Has been skipped
2025-12-03 01:17:06 +08:00
a30d3572a5 feat(projects): 首页主备优化
All checks were successful
CI Build & Upload (WeApp) / build-upload-dev (push) Has been skipped
CI Build & Upload (WeApp) / build-upload-prod (push) Successful in 6m43s
CI Build & Upload (WeApp) / build-upload-reserve (push) Successful in 2m25s
2025-12-02 23:57:04 +08:00
b6b6649a9b ci(other): ci脚本换源
All checks were successful
CI Build & Upload (WeApp) / build-upload-dev (push) Has been skipped
CI Build & Upload (WeApp) / build-upload-prod (push) Successful in 4m55s
CI Build & Upload (WeApp) / build-upload-reserve (push) Successful in 2m34s
2025-11-05 11:56:16 +08:00
985c8fa766 release(other): 4.0.15
Some checks failed
CI Build & Upload (WeApp) / build-upload-prod (push) Has been cancelled
CI Build & Upload (WeApp) / build-upload-reserve (push) Has been cancelled
CI Build & Upload (WeApp) / build-upload-dev (push) Has been cancelled
2025-11-05 11:32:38 +08:00
ef380ff569 release(other): 4.0.14
Some checks failed
CI Build & Upload (WeApp) / build-upload-dev (push) Has been skipped
CI Build & Upload (WeApp) / build-upload-prod (push) Failing after 4m44s
CI Build & Upload (WeApp) / build-upload-reserve (push) Successful in 19m24s
2025-10-31 19:15:29 +08:00
63b61bbc98 ci(other): ci update 2025-10-31 19:13:49 +08:00
d831ee932b release: 临时紧急版本
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-29 12:39:01 +08:00
8b55419643 fix(依赖升级,bug 修复):
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-13 16:26:39 +08:00
f567cf7c94 build(deps): 依赖升级 2025-09-13 03:26:33 +08:00
e1c00d6bb1 style(custom): ok
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-20 07:52:00 +08:00
9edcf67620 style(custom): add eslint rules
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-18 21:46:34 +08:00
8ca7001e3f feat(custom): 商家详情整改增加未登录引导弹窗
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-18 21:43:16 +08:00
6f5d722e6e refactor(custom): 登录页面增加显式返回键
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-16 23:17:57 +08:00
6ca3669950 refactor(custom): 地图服务商更换
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-16 17:51:31 +08:00
54b1d4b07c refactor(custom): 地图Key变更
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-29 16:00:15 +08:00
896acaef9e feat(custom): 地图apiKey更换,订单核销详情新增支付方式
All checks were successful
continuous-integration/drone/push Build is passing
2025-05-29 15:45:16 +08:00
92d7bf1933 feat(custom): 订单核销新增最近核销
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-30 08:26:26 +08:00
9af020af37 ci(custom): update
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-18 16:17:30 +08:00
e7fc232ba7 ci(custom): update
Some checks failed
continuous-integration/drone/push Build is failing
2025-03-18 15:53:37 +08:00
2b2e8ae481 ci(custom): update
Some checks failed
continuous-integration/drone/push Build is failing
2025-03-18 15:52:08 +08:00
8ece6b24e8 refactor(custom): 核销弹窗更改
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2025-03-18 15:44:57 +08:00
b475228705 ci(custom): update
Some checks failed
continuous-integration/drone/push Build is failing
2025-02-13 16:42:06 +08:00
05caf08c47 build(deps): taro升级至4.0.9
Some checks reported errors
continuous-integration/drone/push Build was killed
2025-02-12 11:15:51 +08:00
7096e38967 release(custom): 4.0.7
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-06 17:07:17 +08:00
3926922925 mod(custom): 增加公告弹窗
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-30 19:59:00 +08:00
90f1764e7b refactor(custom): 暂时取消游戏进入限制
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-19 04:32:05 +08:00
52e49cca6c fix(projects): env
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-19 02:51:53 +08:00
72705cb101 feat(custom): 增加没有豆子不可进入游戏
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-18 22:56:23 +08:00
7eed620962 feat(custom): 游戏大厅合并
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-18 22:49:00 +08:00
a0e7966ee4 feat(custom): 新增商家订单管理筛选
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-21 17:32:26 +08:00
3489cabed1 Merge branch 'master' into dev
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-14 22:13:04 +08:00
b9a5993e27 feat(custom): 现金部分
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-14 22:12:14 +08:00
b2ac7f33f3 mod(custom): change
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-05 04:20:23 +08:00
4651318619 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-24 16:12:45 +08:00
8e119162f1 build(deps): update deps
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-24 16:02:44 +08:00
097029128c fix(custom): \!
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-23 20:43:11 +08:00
b5361277ca fix(custom): fix
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-14 01:34:36 +08:00
af34993f69 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-06 21:39:16 +08:00
94822f693a release(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-06 21:35:17 +08:00
2f31aa7b70 feat(custom): \!
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-05 20:17:16 +08:00
94b6a9da10 feat(custom): \!
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-05 16:41:26 +08:00
962d7a2b19 feat(custom): \!
All checks were successful
continuous-integration/drone/push Build is passing
2024-09-03 22:17:38 +08:00
20d112246e Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-30 18:35:05 +08:00
d57f9cc53e refactor(custom): \!
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-30 18:34:18 +08:00
230cd88f4d style(styles): lf
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-30 13:24:21 +08:00
b95fb364df feat(components): \!
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-30 13:22:42 +08:00
1e7f5c3d71 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-27 18:29:33 +08:00
1d8532eccf feat(custom): 新增消息订阅
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-27 17:06:59 +08:00
e5041c3382 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-21 18:11:41 +08:00
f199320de0 refactor(custom): 后结收款增加加载动画
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-12 19:14:01 +08:00
9a57e2cc25 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-05 10:29:47 +08:00
f5dd812787 build(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-05 10:29:24 +08:00
6318b525a9 Merge branch 'dev'
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-05 06:34:55 +08:00
749cd1a17e build(deps):
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-05 06:34:29 +08:00
5db8a03723 Merge branch 'test'
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-05 05:43:20 +08:00
a5703e5494 fix(custom): 修复登录成功不跳转的问题
Some checks failed
continuous-integration/drone/push Build is failing
2024-08-05 05:42:33 +08:00
6acb85d242 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-03 23:32:56 +08:00
d52bf0d1a5 fix(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-03 23:32:39 +08:00
004a6e188a Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-03 23:20:08 +08:00
1e1af4e7da fix(custom): 修复二维码失效
All checks were successful
continuous-integration/drone/push Build is passing
2024-08-03 23:19:37 +08:00
621dc85f1f Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-28 18:51:57 +08:00
ffa1c94bf7 fix(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-28 18:51:32 +08:00
c1d1b949e4 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-28 10:48:03 +08:00
9ea8f419f4 feat(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-27 11:05:25 +08:00
18c6446e5e Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-20 18:47:35 +08:00
e55cc6c9e0 refactor(custom): 完善活动页细节
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-20 18:31:34 +08:00
b20930f516 fix(custom): 修正账户明细时间显示不完整
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-20 17:38:36 +08:00
5f8ed08d45 fix(custom): 修复带有切换项页面分页数据错乱的bug
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-19 17:59:29 +08:00
f443caa511 fix(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-19 17:15:08 +08:00
728719f949 release(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-19 17:05:33 +08:00
c4645fdc17 feat(custom): 新增支付方式动态获取
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-18 19:18:21 +08:00
d1e5e92955 feat(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-18 17:05:51 +08:00
d3bb76a858 feat(custom): 新增若干营销功能
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-17 22:32:56 +08:00
243b414675 mod(custom):
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-15 16:15:14 +08:00
fbc5e694e2 build(deps): 依赖升级
All checks were successful
continuous-integration/drone/push Build is passing
2024-07-14 03:12:09 +08:00
8bc22dcc97 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-29 11:25:13 +08:00
1566eae251 fix(custom): 修复若干bug
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-29 11:24:40 +08:00
45ad285ae9 Merge branch 'test'
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-06 21:13:13 +08:00
5c45854e2c fix(custom): 修复若干bug
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-06 21:12:44 +08:00
174 changed files with 5800 additions and 3651 deletions

8
.cursorignore Normal file
View 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

View File

@@ -1,40 +1,40 @@
module.exports = { module.exports = {
types: [ types: [
{ value: "feat", name: "feat: 新增功能" }, { value: 'feat', name: 'feat: 新增功能' },
{ value: "fix", name: "fix: 修复bug" }, { value: 'fix', name: 'fix: 修复bug' },
{ value: "docs", name: "docs: 文档变更" }, { value: 'docs', name: 'docs: 文档变更' },
{ {
value: "style", value: 'style',
name: "style: 代码格式(不影响功能,例如空格、分号等格式修正)", name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)',
}, },
{ {
value: "refactor", value: 'refactor',
name: "refactor: 代码重构(不包括 bug 修复、功能新增)", name: 'refactor: 代码重构(不包括 bug 修复、功能新增)',
}, },
{ value: "perf", name: "perf: 性能优化" }, { value: 'perf', name: 'perf: 性能优化' },
{ value: "test", name: "test: 添加、修改测试用例" }, { value: 'test', name: 'test: 添加、修改测试用例' },
{ {
value: "build", value: 'build',
name: "build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)", name: 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)',
}, },
{ value: "ci", name: "ci: 修改 CI 配置、脚本" }, { value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
{ {
value: "chore", value: 'chore',
name: "chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)", name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)',
}, },
{ value: "revert", name: "revert: 回滚 commit" }, { value: 'revert', name: 'revert: 回滚 commit' },
{ value: "wip", name: "wip: 开发中" }, { value: 'wip', name: 'wip: 开发中' },
{ value: "mod", name: "mod: 不确定分类的修改" }, { value: 'mod', name: 'mod: 不确定分类的修改' },
{ value: "release", name: "release: 发布" }, { value: 'release', name: 'release: 发布' },
], ],
scopes: [ scopes: [
["custom", "自定义"], ['custom', '自定义'],
["projects", "项目搭建"], ['projects', '项目搭建'],
["components", "组件相关"], ['components', '组件相关'],
["utils", "utils 相关"], ['utils', 'utils 相关'],
["styles", "样式相关"], ['styles', '样式相关'],
["deps", "项目依赖"], ['deps', '项目依赖'],
["other", "其他修改"], ['other', '其他修改'],
].map(([value, description]) => { ].map(([value, description]) => {
return { return {
value, value,
@@ -42,16 +42,16 @@ module.exports = {
}; };
}), }),
messages: { messages: {
type: "确保本次提交遵循 Angular 规范!选择你要提交的类型:\n", type: '确保本次提交遵循 Angular 规范!选择你要提交的类型:\n',
scope: "选择一个 scope可选", scope: '选择一个 scope可选',
customScope: "请输入自定义的 scope", customScope: '请输入自定义的 scope',
subject: "填写简短精炼的变更描述:", subject: '填写简短精炼的变更描述:',
body: '填写更加详细的变更描述(可选)。使用 "|" 换行:', body: '填写更加详细的变更描述(可选)。使用 "|" 换行:',
breaking: "列举非兼容性重大的变更(可选):", breaking: '列举非兼容性重大的变更(可选):',
footer: "列举出所有变更的 Issues Closed可选。 例如: #31, #34", footer: '列举出所有变更的 Issues Closed可选。 例如: #31, #34',
confirmCommit: "确认提交?", confirmCommit: '确认提交?',
}, },
allowBreakingChanges: ["feat", "fix"], allowBreakingChanges: ['feat', 'fix'],
subjectLimit: 100, subjectLimit: 100,
breaklineChar: "|", breaklineChar: '|',
}; };

View File

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

View File

@@ -2,14 +2,17 @@
TARO_APP_ID='wx7b3322daa2cf9c88' TARO_APP_ID='wx7b3322daa2cf9c88'
# 开发版appkey # 开发版appkey
TARO_APP_KEY='1234567890' TARO_APP_KEY=''
# API接口 # API接口
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app' TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
# 骰子游戏链接
# TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
TARO_APP_GAME='http://192.168.31.225:10086?uid='
# 捕鱼游戏链接 # 版权文字
TARO_APP_FISH_GAME='https://jdt-test-fish.wanzhuanyongcheng.cn/?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'

View File

@@ -1,13 +1,19 @@
# 正式版appid # 正式版appid
TARO_APP_ID='wxdd00d46fa6f07974' TARO_APP_ID='wxdd00d46fa6f07974'
# 开发版appkey # 正式版appkey
TARO_APP_KEY='private.wxdd00d46fa6f07974.key' TARO_APP_KEY='private.wxdd00d46fa6f07974.key'
# API接口 # API接口
TARO_APP_API='https://www.wanzhuanyongcheng.cn/app' TARO_APP_API='https://www.wanzhuanyongcheng.cn/app'
TARO_APP_GAME='https://jdt-prod-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
# 捕鱼游戏链接 # 版权文字
TARO_APP_FISH_GAME='https://jdt-prod-fish.wanzhuanyongcheng.cn/?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
View 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'

View File

@@ -7,8 +7,12 @@ TARO_APP_KEY='private.wx7b3322daa2cf9c88.key'
# API接口 # API接口
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app' TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
# 游戏链接
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
# 捕鱼游戏链接 # 版权文字
TARO_APP_FISH_GAME='https://jdt-test-fish.wanzhuanyongcheng.cn/?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
View File

@@ -0,0 +1,4 @@
/node_modules/**
/dist/*
/public/*
/src/static/*

126
.gitea/workflows/ci.yaml Normal file
View 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}"

View File

@@ -1,3 +1,4 @@
/node_modules/** /node_modules/**
/dist/* /dist/*
/public/* /public/*
/src/static/*

View File

@@ -1,7 +1,8 @@
{ {
"arrowParens": "avoid", "arrowParens": "avoid",
"bracketSameLine": true, "bracketSameLine": true,
"bracketSpacing": false, "bracketSpacing": true,
"singleQuote": true, "singleQuote": true,
"trailingComma": "all" "trailingComma": "all",
"endOfLine": "lf"
} }

View File

@@ -1,5 +1,3 @@
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = { module.exports = {
presets: [ presets: [
[ [

View File

@@ -1,25 +1,25 @@
module.exports = { module.exports = {
ignores: [(commit) => commit.includes("init")], ignores: [commit => commit.includes('init')],
extends: ["@commitlint/config-conventional"], extends: ['@commitlint/config-conventional'],
rules: { rules: {
"type-enum": [ 'type-enum': [
2, 2,
"always", 'always',
[ [
"feat", 'feat',
"fix", 'fix',
"docs", 'docs',
"style", 'style',
"refactor", 'refactor',
"perf", 'perf',
"test", 'test',
"build", 'build',
"ci", 'ci',
"chore", 'chore',
"revert", 'revert',
"wip", 'wip',
"mod", 'mod',
"release", 'release',
], ],
], ],
}, },

13
components.d.ts vendored
View File

@@ -1,11 +1,12 @@
// generated by unplugin-vue-components /* eslint-disable */
// We suggest you to commit this file into source control // @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core' // biome-ignore lint: disable
export {} export {}
declare module '@vue/runtime-core' { /* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
Auth: typeof import('./src/components/Auth.vue')['default'] Auth: typeof import('./src/components/Auth.vue')['default']
Back: typeof import('./src/components/Back.vue')['default'] Back: typeof import('./src/components/Back.vue')['default']
@@ -29,7 +30,6 @@ declare module '@vue/runtime-core' {
NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview'] NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview']
NutInput: typeof import('@nutui/nutui-taro')['Input'] NutInput: typeof import('@nutui/nutui-taro')['Input']
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber'] NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
NutNumberKeyboard: typeof import('@nutui/nutui-taro')['NumberKeyboard']
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay'] NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
NutPagination: typeof import('@nutui/nutui-taro')['Pagination'] NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
NutPicker: typeof import('@nutui/nutui-taro')['Picker'] NutPicker: typeof import('@nutui/nutui-taro')['Picker']
@@ -39,7 +39,6 @@ declare module '@vue/runtime-core' {
NutRadio: typeof import('@nutui/nutui-taro')['Radio'] NutRadio: typeof import('@nutui/nutui-taro')['Radio']
NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup'] NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup']
NutRate: typeof import('@nutui/nutui-taro')['Rate'] NutRate: typeof import('@nutui/nutui-taro')['Rate']
NutShortPassword: typeof import('@nutui/nutui-taro')['ShortPassword']
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper'] NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem'] NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
NutSwitch: typeof import('@nutui/nutui-taro')['Switch'] NutSwitch: typeof import('@nutui/nutui-taro')['Switch']

View File

@@ -4,7 +4,6 @@ module.exports = {
env: { env: {
NODE_ENV: '"development"', NODE_ENV: '"development"',
}, },
defineConstants: {},
mini: {}, mini: {},
h5: {}, h5: {},
}; };

View File

@@ -1,24 +1,24 @@
// @ts-nocheck
import Components from 'unplugin-vue-components/webpack'; import Components from 'unplugin-vue-components/webpack';
import NutUIResolver from '@nutui/nutui-taro/dist/resolver'; import NutUIResolver from '@nutui/nutui-taro/dist/resolver';
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack'; import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack';
import { join } from 'node:path'; import { join } from 'node:path';
import { argv } from 'yargs'; import { argv } from 'yargs';
const {robot = 1, desc} = argv;
const CIPluginOptFn = async () => { const CIPluginOptFn = async () => {
/** /**
* @typedef { import("@tarojs/plugin-mini-ci").CIOptions } CIOptions * @typedef { import('@tarojs/plugin-mini-ci').CIOptions } CIOptions
* @type {CIOptions} * @type {CIOptions}
*/ */
const parsedArgs = await argv;
return { return {
weapp: { weapp: {
appid: process.env.TARO_APP_ID, appid: process.env.TARO_APP_ID,
privateKeyPath: process.env.TARO_APP_KEY, privateKeyPath: process.env.TARO_APP_KEY,
robot, robot: parsedArgs.robot || 1,
}, },
desc, desc: parsedArgs.desc,
}; };
}; };
@@ -38,7 +38,7 @@ const config = {
375: 2, 375: 2,
}, },
sourceRoot: 'src', sourceRoot: 'src',
outputRoot: 'dist', outputRoot: `dist/${process.env.TARO_ENV}`,
plugins: ['@tarojs/plugin-html', ['@tarojs/plugin-mini-ci', CIPluginOptFn]], plugins: ['@tarojs/plugin-html', ['@tarojs/plugin-mini-ci', CIPluginOptFn]],
defineConstants: {}, defineConstants: {},
copy: { copy: {
@@ -48,13 +48,14 @@ const config = {
framework: 'vue3', framework: 'vue3',
compiler: { compiler: {
type: 'webpack5', type: 'webpack5',
prebundle: {enable: false}, prebundle: { enable: process.env.TARO_ENV === 'h5' },
}, },
cache: { cache: {
enable: false, // Webpack 持久化缓存配置建议开启。默认配置请参考https://docs.taro.zone/docs/config-detail#cache enable: false, // Webpack 持久化缓存配置建议开启。默认配置请参考https://docs.taro.zone/docs/config-detail#cache
}, },
sass: { sass: {
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`, data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`,
silenceDeprecations: ['import'],
}, },
alias: { alias: {
'@': join(__dirname, '..', 'src'), '@': join(__dirname, '..', 'src'),

View File

@@ -4,7 +4,6 @@ module.exports = {
env: { env: {
NODE_ENV: '"production"', NODE_ENV: '"production"',
}, },
defineConstants: {},
mini: {}, mini: {},
h5: { h5: {
/** /**

View File

@@ -1,19 +1,12 @@
{ {
"name": "jdt-user", "name": "jdt-user",
"version": "4.0.0", "version": "4.0.18",
"private": true,
"description": "",
"templateInfo": {
"name": "jdt-user",
"typescript": true,
"css": "sass"
},
"taroConfig": { "taroConfig": {
"version": "4.0.0" "version": "4.0.18"
}, },
"scripts": { "scripts": {
"build:weapp": "taro build --type weapp", "build:weapp": "taro build --type weapp",
"build:test": "taro build --type weapp --mode test", "build:test": "taro build --type weapp --mode reserve",
"build:swan": "taro build --type swan", "build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay", "build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt", "build:tt": "taro build --type tt",
@@ -23,6 +16,7 @@
"build:jd": "taro build --type jd", "build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp", "build:quickapp": "taro build --type quickapp",
"dev:weapp": "taro build --type weapp --watch", "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:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch", "dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch", "dev:tt": "npm run build:tt -- --watch",
@@ -35,11 +29,10 @@
"lint:fix": "eslint --fix --ext .ts,.vue .", "lint:fix": "eslint --fix --ext .ts,.vue .",
"lint:staged": "lint-staged", "lint:staged": "lint-staged",
"prepare": "husky install", "prepare": "husky install",
"preview": "vite preview",
"cz": "cz", "cz": "cz",
"lf": "npx prettier --write --end-of-line lf .",
"postinstall": "weapp-tw patch", "postinstall": "weapp-tw patch",
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'", "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" "build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
}, },
"browserslist": [ "browserslist": [
@@ -47,11 +40,10 @@
"Android >= 4.1", "Android >= 4.1",
"ios >= 8" "ios >= 8"
], ],
"author": "", "author": "JDT",
"lint-staged": { "lint-staged": {
"*.{ts,vue}": [ "*.{ts,vue}": [
"eslint --ext .ts,.vue .", "eslint --ext .ts,.vue ."
"npx prettier --write --end-of-line lf ."
] ]
}, },
"config": { "config": {
@@ -60,63 +52,68 @@
} }
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.5", "@babel/runtime": "^7.28.4",
"@nutui/icons-vue-taro": "^0.0.9", "@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.3.6", "@nutui/nutui-taro": "^4.3.14",
"@qiun/vue-ucharts": "2.5.0-20230101", "@qiun/vue-ucharts": "2.5.0-20230101",
"@tarojs/components": "3.6.29", "@tarojs/components": "4.1.6",
"@tarojs/helper": "3.6.29", "@tarojs/helper": "4.1.6",
"@tarojs/plugin-framework-vue3": "3.6.29", "@tarojs/plugin-framework-vue3": "4.1.6",
"@tarojs/plugin-html": "3.6.29", "@tarojs/plugin-html": "4.1.6",
"@tarojs/plugin-platform-alipay": "3.6.29", "@tarojs/plugin-platform-alipay": "4.1.6",
"@tarojs/plugin-platform-h5": "3.6.29", "@tarojs/plugin-platform-h5": "4.1.6",
"@tarojs/plugin-platform-jd": "3.6.29", "@tarojs/plugin-platform-jd": "4.1.6",
"@tarojs/plugin-platform-qq": "3.6.29", "@tarojs/plugin-platform-qq": "4.1.6",
"@tarojs/plugin-platform-swan": "3.6.29", "@tarojs/plugin-platform-swan": "4.1.6",
"@tarojs/plugin-platform-tt": "3.6.29", "@tarojs/plugin-platform-tt": "4.1.6",
"@tarojs/plugin-platform-weapp": "3.6.29", "@tarojs/plugin-platform-weapp": "4.1.6",
"@tarojs/runtime": "3.6.29", "@tarojs/runtime": "4.1.6",
"@tarojs/shared": "3.6.29", "@tarojs/shared": "4.1.6",
"@tarojs/taro": "3.6.29", "@tarojs/taro": "4.1.6",
"dayjs": "^1.11.10", "dayjs": "^1.11.18",
"pinia": "^2.1.7", "pinia": "^2.3.1",
"vue": "^3.3.9" "uqrcodejs": "^4.0.7",
"vue": "^3.5.21"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.23.5", "@babel/core": "^7.28.4",
"@commitlint/cli": "^18.4.3", "@commitlint/cli": "^18.6.1",
"@commitlint/config-conventional": "^18.4.3", "@commitlint/config-conventional": "^18.6.3",
"@tarojs/cli": "3.6.29", "@tarojs/cli": "4.1.6",
"@tarojs/plugin-mini-ci": "3.6.29", "@tarojs/plugin-mini-ci": "4.1.6",
"@tarojs/taro-loader": "3.6.29", "@tarojs/taro-loader": "4.1.6",
"@tarojs/webpack5-runner": "3.6.29", "@tarojs/webpack5-runner": "4.1.6",
"@types/node": "^18.19.1", "@types/node": "^18.19.124",
"@types/webpack-env": "^1.18.4", "@types/webpack-env": "^1.18.8",
"@typescript-eslint/eslint-plugin": "^6.13.1", "@types/yargs": "^17.0.33",
"@typescript-eslint/parser": "^6.13.1", "@typescript-eslint/eslint-plugin": "^6.21.0",
"@unocss/webpack": "^0.60.0", "@typescript-eslint/parser": "^6.21.0",
"@vue/babel-plugin-jsx": "^1.1.5", "@unocss/webpack": "^0.60.4",
"@vue/compiler-sfc": "^3.3.9", "@vue/babel-plugin-jsx": "^1.5.0",
"autoprefixer": "^10.4.19", "@vue/compiler-sfc": "^3.5.21",
"babel-preset-taro": "3.6.29", "autoprefixer": "^10.4.21",
"commitizen": "^4.3.0", "babel-preset-taro": "4.1.6",
"commitizen": "^4.3.1",
"css-loader": "3.4.2", "css-loader": "3.4.2",
"cz-customizable": "^7.0.0", "cz-customizable": "^7.5.1",
"eslint": "^8.55.0", "eslint": "^8.57.1",
"eslint-config-taro": "3.6.29", "eslint-config-taro": "4.1.6",
"eslint-plugin-vue": "^9.19.2", "eslint-plugin-vue": "^9.33.0",
"husky": "^8.0.3", "husky": "^8.0.3",
"lint-staged": "^15.1.0", "lint-staged": "^15.5.2",
"miniprogram-ci": "^2.1.26",
"postcss": "8.4.29", "postcss": "8.4.29",
"postcss-rem-to-responsive-pixel": "^6.0.1", "postcss-rem-to-responsive-pixel": "^6.1.0",
"prettier": "^3.6.2",
"style-loader": "1.3.0", "style-loader": "1.3.0",
"stylelint": "9.3.0", "stylelint": "9.3.0",
"tailwindcss": "^3.4.3", "tailwindcss": "^3.4.17",
"ts-node": "^10.9.1", "ts-node": "^10.9.2",
"typescript": "^4.9.5", "typescript": "^5.9.2",
"unplugin-vue-components": "^0.23.0", "unplugin-vue-components": "^28.8.0",
"vue-loader": "^17.3.1", "vue-loader": "^17.4.2",
"weapp-tailwindcss": "^3.2.0", "weapp-tailwindcss": "^3.7.0",
"webpack": "^5.89.0" "webpack": "^5.101.3",
"yargs": "^17.7.2"
} }
} }

13
pnpm-workspace.yaml Normal file
View 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

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

View File

@@ -1,14 +1,31 @@
{ {
"miniprogramRoot": "./dist", "miniprogramRoot": "dist/",
"projectname": "taroApp", "projectname": "捷兑通",
"description": "", "description": "",
"setting": { "setting": {
"urlCheck": true, "urlCheck": true,
"es6": false, "es6": true,
"enhance": false, "enhance": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"postcss": false, "postcss": true,
"minified": false "minified": true,
}, "babelSetting": {
"compileType": "miniprogram" "ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"appid": "wx7b3322daa2cf9c88",
"libVersion": "3.7.11",
"srcMiniprogramRoot": "dist/",
"packOptions": {
"ignore": [],
"include": []
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
} }

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

View File

@@ -1,15 +1,15 @@
import request from "../utils/request"; import request from '../utils/request';
// 添加购物车 // 添加购物车
export const addCart = (data: object) => export const addCart = (data: object) =>
request("/goods/cart/add", data, "POST"); request('/goods/cart/add', data, 'POST');
// 获取购物车 // 获取购物车
export const getCart = (data: object) => request("/goods/cart", data, "POST"); export const getCart = (data: object) => request('/goods/cart', data, 'POST');
// 清空购物车 // 清空购物车
export const clearCart = (data: object) => export const clearCart = (data: object) =>
request("/goods/cart/removeAll", data, "POST"); request('/goods/cart/removeAll', data, 'POST');
// 获取全部购物车 // 获取全部购物车
export const getAllCart = () => request("/goods/all/cart", {}, "POST"); export const getAllCart = () => request('/goods/all/cart', {}, 'POST');

8
src/api/code.ts Normal file
View 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
View File

@@ -0,0 +1,4 @@
import request from '../utils/request';
// 获取游戏列表
export const getGameList = () => request('/game', {}, 'POST');

View File

@@ -86,3 +86,14 @@ export const getActiveOrderDetail = (data: object) =>
// 校验交易密码 // 校验交易密码
export const checkTradePwd = (data: object) => export const checkTradePwd = (data: object) =>
request('/user/check/payPassword', data, 'POST'); 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');

View File

@@ -1,10 +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"); export const getStoreList = data => request('/find/store', data, 'POST');

View File

@@ -1,9 +1,9 @@
import request from "@/utils/request"; import request from '@/utils/request';
// 订单支付 // 订单支付
export const payOrder = (data: object) => export const payOrder = (data: object) =>
request("/order/confirmOrder", data, "POST"); request('/order/confirmOrder', data, 'POST');
// 获取订单统计 // 获取订单统计
export const getOrderStatistics = (data: object) => export const getOrderStatistics = (data: object) =>
request("/user/order/count", data, "POST"); request('/user/order/count', data, 'POST');

View File

@@ -1,9 +1,9 @@
import request from "@/utils/request"; import request from '@/utils/request';
// 商品列表 // 商品列表
export const productList = (data: object) => export const productList = (data: object) =>
request("/store/goods", data, "POST"); request('/store/goods', data, 'POST');
// 商品添加 // 商品添加
export const addGood = (data: object) => export const addGood = (data: object) =>
request("/store/goods/edit", data, "POST"); request('/store/goods/edit', data, 'POST');

View File

@@ -6,8 +6,8 @@ export default defineAppConfig({
'pages/user/index', 'pages/user/index',
'pages/allClassList/index', 'pages/allClassList/index',
'pages/game/gamedetail/index', 'pages/game/gamedetail/index',
'pages/game/gameview/index',
'pages/game/view/index', 'pages/game/view/index',
'pages/fastBuy/index',
], ],
subPackages: [ subPackages: [
{ {
@@ -72,7 +72,7 @@ export default defineAppConfig({
}, },
{ {
root: 'pages/marketing', root: 'pages/marketing',
pages: ['sign/index'], pages: ['sign/index', 'yq/index', 'scratch/index'],
}, },
{ {
root: 'pages/search', root: 'pages/search',
@@ -97,12 +97,12 @@ export default defineAppConfig({
selectedIconPath: 'static/tabbar/1-1.png', selectedIconPath: 'static/tabbar/1-1.png',
text: '首页', text: '首页',
}, },
{ // {
pagePath: 'pages/game/gamehome/index', // pagePath: 'pages/game/gamehome/index',
iconPath: 'static/tabbar/2-0.png', // iconPath: 'static/tabbar/2-0.png',
selectedIconPath: 'static/tabbar/2-1.png', // selectedIconPath: 'static/tabbar/2-1.png',
text: '游戏', // text: '游戏',
}, // },
{ {
pagePath: 'pages/cart/index', pagePath: 'pages/cart/index',
iconPath: 'static/tabbar/3-0.png', iconPath: 'static/tabbar/3-0.png',

View File

@@ -1,12 +1,10 @@
@import "./static/iconfont/iconfont.css"; @import './static/iconfont/iconfont.css';
@import 'tailwindcss/base'; @import 'tailwindcss/base';
@import 'tailwindcss/components'; @import 'tailwindcss/components';
@import 'tailwindcss/utilities'; @import 'tailwindcss/utilities';
page { page {
background-color: #f5f5f5; background-color: #f5f5f5;
// font-size: 30rpx;
// IOS安全区域
padding-bottom: constant(safe-area-inset-bottom); padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);
} }

View File

@@ -15,8 +15,8 @@
<script setup lang="ts"> <script setup lang="ts">
// import { computed, ref } from "vue"; // import { computed, ref } from "vue";
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { login } from "@/api/user"; import { login } from '@/api/user';
defineProps({ defineProps({
visible: { visible: {
@@ -25,20 +25,20 @@ defineProps({
}, },
}); });
const emit = defineEmits(["update:visible", "ok"]); const emit = defineEmits(['update:visible', 'ok']);
const onCancel = () => { const onCancel = () => {
emit("update:visible", false); emit('update:visible', false);
}; };
const onOk = () => { const onOk = () => {
Taro.showLoading({ Taro.showLoading({
title: "正在授权中", title: '正在授权中',
mask: true, mask: true,
}); });
Taro.getUserProfile({ Taro.getUserProfile({
desc: "完善用户资料", desc: '完善用户资料',
success: async (user) => { success: async user => {
Taro.login({ Taro.login({
success: async ({ code }) => { success: async ({ code }) => {
try { try {
@@ -47,16 +47,16 @@ const onOk = () => {
nickName: user.userInfo.nickName, nickName: user.userInfo.nickName,
avatarUrl: user.userInfo.avatarUrl, avatarUrl: user.userInfo.avatarUrl,
}); });
Taro.setStorageSync("token", data.token); Taro.setStorageSync('token', data.token);
emit("ok", false); emit('ok', false);
} catch (error) { } catch (error) {
Taro.showToast({ Taro.showToast({
title: error.message, title: error.message,
icon: "none", icon: 'none',
}); });
} }
}, },
fail: (err) => { fail: err => {
console.log(err); console.log(err);
}, },
complete: () => { complete: () => {
@@ -64,7 +64,7 @@ const onOk = () => {
}, },
}); });
}, },
fail: (err) => { fail: err => {
console.log(err); console.log(err);
}, },
complete: () => { complete: () => {

View File

@@ -5,14 +5,14 @@
<view class="line"></view> <view class="line"></view>
<Home class="iconfont" @click="goHome" /> <Home class="iconfont" @click="goHome" />
</view> </view>
<text style="width: 2000px;text-align: center;">{{ props.title }}</text> <text style="width: 2000px; text-align: center">{{ props.title }}</text>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { computed } from "vue"; import { computed } from 'vue';
import { Home, Left } from "@nutui/icons-vue-taro"; import { Home, Left } from '@nutui/icons-vue-taro';
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight as number; const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight as number;
const BarHeight = computed(() => statusBarHeight - 7); const BarHeight = computed(() => statusBarHeight - 7);
@@ -20,7 +20,7 @@ const BarHeight = computed(() => statusBarHeight - 7);
const props = defineProps({ const props = defineProps({
title: { title: {
type: String, type: String,
default: "", default: '',
}, },
}); });
@@ -32,7 +32,7 @@ const returns = () => {
const goHome = () => { const goHome = () => {
Taro.switchTab({ Taro.switchTab({
url: "/pages/index/index", url: '/pages/index/index',
}); });
}; };
</script> </script>

View File

@@ -13,8 +13,10 @@ interface CardList {
bid: string; bid: string;
gid: string; gid: string;
number: string; number: string;
discount_price: string;
price: number; price: number;
exchange: number; exchange: number;
discount_integral: number;
} }
const show = ref(false); const show = ref(false);
@@ -38,7 +40,11 @@ const openModal = async () => {
show.value = !show.value; show.value = !show.value;
}; };
const add_cart = async (item: CardList, num: number = 1) => { const add_cart = async (
item: CardList,
num: number = 1,
bid: string = props.merInfo.bid,
) => {
try { try {
const res = await addCart({ const res = await addCart({
Bid: item.bid, Bid: item.bid,
@@ -49,7 +55,7 @@ const add_cart = async (item: CardList, num: number = 1) => {
title: res.msg, title: res.msg,
icon: 'none', icon: 'none',
}); });
await get_cart_list(); await get_cart_list(bid);
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
@@ -72,25 +78,29 @@ const card_list = ref<CardList[]>([]);
const cartInfo = ref({ const cartInfo = ref({
count: 0, count: 0,
price: 0, price: 0,
discount_price: 0,
exchange: 0, exchange: 0,
discount_integral: 0,
}); });
const get_cart_list = async () => { const get_cart_list = async (bid: string = props.merInfo.bid) => {
try { try {
const res = await getCart({ const res = await getCart({
Bid: props.merInfo.bid, Bid: bid,
}); });
card_list.value = res.data.data || []; card_list.value = res.data.data || [];
cartInfo.value = { cartInfo.value = {
count: 0, count: 0,
price: 0, price: 0,
discount_price: 0,
exchange: 0, exchange: 0,
discount_integral: 0,
}; };
card_list.value.forEach((item: CardList) => { card_list.value.forEach((item: CardList) => {
cartInfo.value.count += Number(item.number); cartInfo.value.count += Number(item.number);
cartInfo.value.price += Number(item.price); cartInfo.value.discount_price += Number(item.price);
cartInfo.value.exchange += Number(item.exchange); cartInfo.value.exchange += Number(item.exchange);
cartInfo.value.discount_integral += Number(item.discount_integral);
}); });
emit('updateCart', res.data.data || []); emit('updateCart', res.data.data || []);
} catch (e) { } catch (e) {
@@ -142,11 +152,10 @@ const create_order = async () => {
url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`, url: `/pages/admin/add_order/pending_order/pending_order_detail/index?oid=${res.data.oid}&bid=${props.merInfo.bid}`,
}); });
} else { } else {
const mer_info = Taro.getStorageSync('mer_info');
const user_info = Taro.getStorageSync('userInfo'); const user_info = Taro.getStorageSync('userInfo');
const data = await getUserPoint({ const data = await getUserPoint({
phone: user_info.data.phone, phone: user_info.data.phone,
bid: mer_info.bid, bid: props.merInfo.bid,
}); });
res = await createActiveOrder({ res = await createActiveOrder({
Bid: [props.merInfo.bid], Bid: [props.merInfo.bid],
@@ -159,7 +168,7 @@ const create_order = async () => {
}; };
// isShowPay.value = true; // isShowPay.value = true;
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${mer_info.bid}&OrderType=1`, url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${props.merInfo.bid}&OrderType=1`,
}); });
} }
} }
@@ -168,6 +177,11 @@ const create_order = async () => {
icon: 'none', icon: 'none',
}); });
} catch (e) { } catch (e) {
if (e.msg === '请先设置交易密码') {
Taro.navigateTo({
url: '/pages/users/pwd/index',
});
}
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
icon: 'none', icon: 'none',
@@ -188,22 +202,22 @@ defineExpose({
<!-- <view>购物车数量: {{ cartInfo.count }}</view> --> <!-- <view>购物车数量: {{ cartInfo.count }}</view> -->
<view class="cardImg"> <view class="cardImg">
<image <image
src="http://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png"> src="https://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png">
</image> </image>
<view class="count-text" v-if="cartInfo.count > 0"> <view class="count-text" v-if="cartInfo.count > 0">
<text>{{ cartInfo.count }}</text> <text>{{ cartInfo.count }}</text>
</view> </view>
</view> </view>
<view class="ml-1"> <view class="ml-1 text-[28px]">
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text> <text>总金额: {{ cartInfo.discount_price.toFixed(2) }}</text>
<text v-if="!IsPendingOrder" <text v-if="!IsPendingOrder"
>积分: {{ cartInfo.exchange.toFixed(2) }}</text >积分抵扣: {{ cartInfo.discount_integral.toFixed(2) }}
> </text>
</view> </view>
</view> </view>
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order" <view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
>去结算</view >去结算
> </view>
</view> </view>
<!-- 购物车弹窗 --> <!-- 购物车弹窗 -->
<nut-popup <nut-popup
@@ -219,7 +233,7 @@ defineExpose({
<!-- <Del2 color="#666666" /> --> <!-- <Del2 color="#666666" /> -->
<image <image
class="w-[20px] h-[20px]" class="w-[20px] h-[20px]"
src="http://p0.meituan.net/csc/db4d11fd744b69435c6ffdc6bfc868c5684.png" /> src="https://p0.meituan.net/csc/db4d11fd744b69435c6ffdc6bfc868c5684.png" />
<text class="text-[20px]" style="color: #666666">清空购物车</text> <text class="text-[20px]" style="color: #666666">清空购物车</text>
</view> </view>
</view> </view>
@@ -232,7 +246,9 @@ defineExpose({
<view class="price flex"> <view class="price flex">
<view>现金:{{ item.price }}</view> <view>现金:{{ item.price }}</view>
<view class="ml-2">积分:{{ item.exchange }}</view> <view v-if="item.discount_integral > 0" class="ml-2"
>积分:{{ item.discount_integral }}</view
>
</view> </view>
</view> </view>
</view> </view>
@@ -290,21 +306,24 @@ $h-border-radius: 50px;
.cardImg { .cardImg {
position: relative; position: relative;
image { image {
width: 60px; width: 60px;
height: 60px; height: 60px;
} }
.count-text { .count-text {
position: absolute; position: absolute;
top: -10px; top: -10px;
right: -10px; right: -10px;
background-image: url('http://p0.meituan.net/csc/80b0e11d4270d09324df0b802d4c479b986.png'); background-image: url('https://p0.meituan.net/csc/80b0e11d4270d09324df0b802d4c479b986.png');
background-size: 100% 100%; background-size: 100% 100%;
// padding: 0 8px; // padding: 0 8px;
width: 35px; width: 35px;
height: 35px; height: 35px;
text-align: center; text-align: center;
line-height: 35px; line-height: 35px;
text { text {
margin: auto; margin: auto;
font-size: 25px; font-size: 25px;

View File

@@ -2,6 +2,7 @@
<view class="list-box"> <view class="list-box">
<view class="list"> <view class="list">
<swiper <swiper
v-if="bannerList.length !== 0"
class="item" class="item"
:style="{ :style="{
height: '250px', height: '250px',
@@ -167,7 +168,7 @@ const bannerList = ref<any[]>([]);
const get_banner_list = async () => { const get_banner_list = async () => {
const { data }: any = await getBanner(); const { data }: any = await getBanner();
bannerList.value = data.data; bannerList.value = data.data || [];
}; };
const toPage = async (url: string) => { const toPage = async (url: string) => {
@@ -185,9 +186,14 @@ const toPage = async (url: string) => {
}; };
const toMerDetails = item => { const toMerDetails = item => {
Taro.setStorageSync('mer_info', item); Taro.requestSubscribeMessage({
tmplIds: ['ewjjRxDJAQ_RbKU8CIjMNwfJXazyGQ95XbpKW16vMZs'],
entityIds: [],
complete: () => {
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/mer/mer_detail/index`, url: `/pages/mer/mer_detail/index?bid=${item.bid}`,
});
},
}); });
}; };
@@ -248,6 +254,9 @@ Taro.useReachBottom(() => {
.icon { .icon {
display: inline-block; display: inline-block;
font-size: 30px; font-size: 30px;
width: 25px;
height: 25px;
margin-right: 10px;
} }
.desc { .desc {

View File

@@ -31,7 +31,7 @@
</template> </template>
</nut-cell> </nut-cell>
<nut-cell <nut-cell
title="天才小猪积分支付" title="智多鑫积分支付"
:desc="`剩余积分:${jfInfo.jh_info?.integral || 0}`" :desc="`剩余积分:${jfInfo.jh_info?.integral || 0}`"
is-link is-link
@click="goPay(3)"> @click="goPay(3)">

View File

@@ -1,47 +1,60 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
const show = ref(false); const isShow = ref(false);
const overlay = ref();
defineExpose({ defineExpose({
show, isShow,
}); });
defineProps({ const props = defineProps({
src: { imgArr: {
required: true, required: true,
type: String, type: Array,
default: "", default: () => [],
}, },
type: Number, type: Number,
cb: { cb: {
required: true, type: Function || null,
type: Function, default: null,
default: () => {},
}, },
}); });
Taro.useLoad(async () => { const imgs = ref(props.imgArr);
if (Taro.getStorageSync("token")) show.value = true;
// const res = await getSignRecord() const clickFn = type => {
// console.log(res) if (props.cb) props.cb(type);
else isShow.value = false;
};
const closeFn = () => {
isShow.value = false;
imgs.value.shift(0);
if (imgs.value.length !== 0) isShow.value = true;
};
Taro.useLoad(() => {
isShow.value = true;
}); });
</script> </script>
<template> <template>
<nut-overlay <nut-overlay
v-model:visible="show" v-model:visible="isShow"
:lock-scroll="true" :lock-scroll="true"
:close-on-click-overlay="false" :close-on-click-overlay="false">
>
<view class="wrapper"> <view class="wrapper">
<view @click.stop="cb(type)"> <view @click.stop="clickFn(type)">
<image class="image" :src="src" /> <image
:style="{
width: imgs[0]?.naturalWidth,
height:
imgs[0]?.naturalHeight < 600 ? imgs[0]?.naturalHeight : '480px',
}"
:src="imgs[0]" />
</view> </view>
<view @click.stop="show = false"> <view @click.stop="closeFn">
<image class="icon" src="../static/index/close.png" /> <image class="icon" src="../static/index/close.png" />
</view> </view>
</view> </view>

View File

@@ -5,80 +5,68 @@
<view <view
class="toolbar" class="toolbar"
@click="format" @click="format"
style="max-height: 240px; overflow-y: auto" style="max-height: 240px; overflow-y: auto">
>
<!-- 加粗 --> <!-- 加粗 -->
<view <view
:class="data.formats.bold ? 'ql-active' : ''" :class="data.formats.bold ? 'ql-active' : ''"
class="iconfont icon-zitijiacu" class="iconfont icon-zitijiacu"
data-name="bold" data-name="bold"></view>
></view>
<!-- 斜体 --> <!-- 斜体 -->
<view <view
:class="data.formats.italic ? 'ql-active' : ''" :class="data.formats.italic ? 'ql-active' : ''"
class="iconfont icon-zitixieti" class="iconfont icon-zitixieti"
data-name="italic" data-name="italic"></view>
></view>
<!-- 下划线 --> <!-- 下划线 -->
<view <view
:class="data.formats.underline ? 'ql-active' : ''" :class="data.formats.underline ? 'ql-active' : ''"
class="iconfont icon-zitixiahuaxian" class="iconfont icon-zitixiahuaxian"
data-name="underline" data-name="underline"></view>
></view>
<!-- 对齐方式 --> <!-- 对齐方式 -->
<view <view
:class="data.formats.align === 'left' ? 'ql-active' : ''" :class="data.formats.align === 'left' ? 'ql-active' : ''"
class="iconfont icon-zuoduiqi" class="iconfont icon-zuoduiqi"
data-name="align" data-name="align"
data-value="left" data-value="left"></view>
></view>
<!-- 对齐方式居中 --> <!-- 对齐方式居中 -->
<view <view
:class="data.formats.align === 'center' ? 'ql-active' : ''" :class="data.formats.align === 'center' ? 'ql-active' : ''"
class="iconfont icon-juzhongduiqi" class="iconfont icon-juzhongduiqi"
data-name="align" data-name="align"
data-value="center" data-value="center"></view>
></view>
<!-- 对齐方式 --> <!-- 对齐方式 -->
<view <view
:class="data.formats.align === 'right' ? 'ql-active' : ''" :class="data.formats.align === 'right' ? 'ql-active' : ''"
class="iconfont icon-youduiqi" class="iconfont icon-youduiqi"
data-name="align" data-name="align"
data-value="right" data-value="right"></view>
></view>
<!-- 对齐方式两侧 --> <!-- 对齐方式两侧 -->
<view <view
:class="data.formats.align === 'justify' ? 'ql-active' : ''" :class="data.formats.align === 'justify' ? 'ql-active' : ''"
class="iconfont icon-zuoyouduiqi" class="iconfont icon-zuoyouduiqi"
data-name="align" data-name="align"
data-value="justify" data-value="justify"></view>
></view>
<!-- 有序排列 --> <!-- 有序排列 -->
<view <view
:class="data.formats.list === 'ordered' ? 'ql-active' : ''" :class="data.formats.list === 'ordered' ? 'ql-active' : ''"
class="iconfont icon-youxupailie" class="iconfont icon-youxupailie"
data-name="list" data-name="list"
data-value="ordered" data-value="ordered"></view>
></view>
<!-- 无序排列 --> <!-- 无序排列 -->
<view <view
:class="data.formats.list === 'bullet' ? 'ql-active' : ''" :class="data.formats.list === 'bullet' ? 'ql-active' : ''"
class="iconfont icon-wuxupailie" class="iconfont icon-wuxupailie"
data-name="list" data-name="list"
data-value="bullet" data-value="bullet"></view>
></view>
<!-- 取消缩进 --> <!-- 取消缩进 -->
<view <view
class="iconfont icon-outdent" class="iconfont icon-outdent"
data-name="indent" data-name="indent"
data-value="-1" data-value="-1"></view>
></view>
<!-- 缩进 --> <!-- 缩进 -->
<view <view
class="iconfont icon-indent" class="iconfont icon-indent"
data-name="indent" data-name="indent"
data-value="+1" data-value="+1"></view>
></view>
<!-- 添加分割线 --> <!-- 添加分割线 -->
<view class="iconfont icon-fengexian" @click="insertDivider"></view> <view class="iconfont icon-fengexian" @click="insertDivider"></view>
<!-- 插入图片 --> <!-- 插入图片 -->
@@ -88,22 +76,19 @@
:class="data.formats.header === 3 ? 'ql-active' : ''" :class="data.formats.header === 3 ? 'ql-active' : ''"
class="iconfont icon-H" class="iconfont icon-H"
data-name="header" data-name="header"
:data-value="3" :data-value="3"></view>
></view>
<!-- 下标 --> <!-- 下标 -->
<view <view
:class="data.formats.script === 'sub' ? 'ql-active' : ''" :class="data.formats.script === 'sub' ? 'ql-active' : ''"
class="iconfont icon-zitixiabiao" class="iconfont icon-zitixiabiao"
data-name="script" data-name="script"
data-value="sub" data-value="sub"></view>
></view>
<!-- 上标 --> <!-- 上标 -->
<view <view
:class="data.formats.script === 'super' ? 'ql-active' : ''" :class="data.formats.script === 'super' ? 'ql-active' : ''"
class="iconfont icon-zitishangbiao" class="iconfont icon-zitishangbiao"
data-name="script" data-name="script"
data-value="super" data-value="super"></view>
></view>
<view class="iconfont icon-undo" @click="undo"></view> <view class="iconfont icon-undo" @click="undo"></view>
<view class="iconfont icon-redo" @click="redo"></view> <view class="iconfont icon-redo" @click="redo"></view>
</view> </view>
@@ -115,8 +100,7 @@
@statuschange="onStatusChange" @statuschange="onStatusChange"
:show-img-resize="true" :show-img-resize="true"
@ready="onEditorReady" @ready="onEditorReady"
@input="getCtx" @input="getCtx" />
/>
</view> </view>
</view> </view>
</view> </view>
@@ -124,29 +108,29 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { reactive } from "vue"; import { reactive } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { BASE_URL } from "@/utils/request"; import { BASE_URL } from '@/utils/request';
const { content } = defineProps<{ const { content } = defineProps<{
content: string; content: string;
}>(); }>();
let emits = defineEmits(["input"]); let emits = defineEmits(['input']);
const data = reactive<any>({ const data = reactive<any>({
editorCtx: "", editorCtx: '',
readOnly: false, readOnly: false,
placeholder: "请输入商品详情...", placeholder: '请输入商品详情...',
richText: "", richText: '',
formats: {}, formats: {},
}); });
function onEditorReady() { function onEditorReady() {
// 富文本节点渲染完成 // 富文本节点渲染完成
Taro.createSelectorQuery() Taro.createSelectorQuery()
.select("#editor") .select('#editor')
.context((res) => { .context(res => {
data.editorCtx = res.context; data.editorCtx = res.context;
// 初始化数据 // 初始化数据
if (content) { if (content) {
@@ -161,7 +145,7 @@ function onEditorReady() {
// 失去焦点时,获取富文本的内容 // 失去焦点时,获取富文本的内容
function getCtx(e: { detail: { html: any } }) { function getCtx(e: { detail: { html: any } }) {
data.richText = e.detail.html; data.richText = e.detail.html;
emits("input", e.detail.html); emits('input', e.detail.html);
} }
// 撤销操作 // 撤销操作
@@ -196,16 +180,16 @@ function insertDivider() {
function insertImage() { function insertImage() {
Taro.chooseImage({ Taro.chooseImage({
count: 1, count: 1,
sizeType: ["original", "compressed"], sizeType: ['original', 'compressed'],
sourceType: ["album", "camera"], sourceType: ['album', 'camera'],
success: (res) => { success: res => {
// 上传图片的逻辑各有不同,自行调整即可 // 上传图片的逻辑各有不同,自行调整即可
Taro.uploadFile({ Taro.uploadFile({
url: `${BASE_URL}/upload`, url: `${BASE_URL}/upload`,
name: "file", name: 'file',
header: { token: Taro.getStorageSync("token") }, header: { token: Taro.getStorageSync('token') },
filePath: res.tempFilePaths[0], filePath: res.tempFilePaths[0],
success: (res) => { success: res => {
console.log(res); console.log(res);
const imgData = JSON.parse(res.data) as { const imgData = JSON.parse(res.data) as {
code: number; code: number;
@@ -215,19 +199,19 @@ function insertImage() {
if (imgData.code === 200) { if (imgData.code === 200) {
// 将图片展示在编辑器中 // 将图片展示在编辑器中
data.editorCtx.insertImage({ data.editorCtx.insertImage({
width: "100%", width: '100%',
height: "auto", height: 'auto',
src: imgData.data.data, src: imgData.data.data,
alt: "图像", alt: '图像',
success: function () { success: function () {
console.log("insert image success"); console.log('insert image success');
}, },
}); });
} else { } else {
console.log("上传失败"); console.log('上传失败');
} }
}, },
fail: (err) => { fail: err => {
console.log(err); console.log(err);
}, },
}); });
@@ -237,7 +221,7 @@ function insertImage() {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "../static/font_4211210_2x20brbrv94.css"; @import '../static/font_4211210_2x20brbrv94.css';
.wrapper { .wrapper {
height: 100%; height: 100%;
@@ -266,7 +250,7 @@ function insertImage() {
.toolbar { .toolbar {
box-sizing: border-box; box-sizing: border-box;
border-bottom: 0; border-bottom: 0;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif; font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
} }
.ql-container { .ql-container {

View File

@@ -1,6 +1,6 @@
<template> <template>
<view> <view>
<view class="flex justify-center" v-if="storeList.length > 0"> <view v-if="storeList.length > 0">
<view <view
class="bg-white rounded-[15px] mt-3 p-2 w-[95%] flex items-center" class="bg-white rounded-[15px] mt-3 p-2 w-[95%] flex items-center"
v-for="(item, index) in storeList" v-for="(item, index) in storeList"
@@ -15,6 +15,7 @@
}}</view> }}</view>
<nut-rate <nut-rate
spacing="1" spacing="1"
disabled
active-color="rgba(252, 207, 10, 1)" active-color="rgba(252, 207, 10, 1)"
v-model="item.rate" /> v-model="item.rate" />
<view class="text-[#9E9E9E] text-[25px]">销量10000</view> <view class="text-[#9E9E9E] text-[25px]">销量10000</view>
@@ -51,9 +52,10 @@ const getList = async () => {
}; };
const goDetail = item => { const goDetail = item => {
console.log(item);
Taro.setStorageSync('mer_info', item); Taro.setStorageSync('mer_info', item);
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/mer/mer_detail/index`, url: `/pages/mer/mer_detail/index?bid=${item.bid}`,
}); });
}; };
</script> </script>

View File

@@ -14,14 +14,13 @@
@touchstart="touchStart" @touchstart="touchStart"
@touchmove="touchMove" @touchmove="touchMove"
@touchend="touchEnd" @touchend="touchEnd"
@error="error" @error="error">
>
</canvas> </canvas>
</template> </template>
<script setup lang="ts" name="ucharts"> <script setup lang="ts" name="ucharts">
import uCharts from "../utils/js_sdk/u-charts.min.js"; import uCharts from '../utils/js_sdk/u-charts.min.js';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
const canvases = {}; const canvases = {};
@@ -29,7 +28,7 @@ const props = defineProps({
chartType: { chartType: {
required: true, required: true,
type: String, type: String,
default: "column", default: 'column',
}, },
opts: { opts: {
required: true, required: true,
@@ -40,7 +39,7 @@ const props = defineProps({
}, },
canvasId: { canvasId: {
type: String, type: String,
default: "u-canvas", default: 'u-canvas',
}, },
cWidth: { cWidth: {
default: 350, default: 350,
@@ -60,10 +59,10 @@ Taro.useLoad(() => {
const init = () => { const init = () => {
switch (props.chartType) { switch (props.chartType) {
case "column": case 'column':
initColumnChart(); initColumnChart();
break; break;
case "line": case 'line':
initLineChart(); initLineChart();
break; break;
default: default:
@@ -75,9 +74,9 @@ const initColumnChart = () => {
const ctx = Taro.createCanvasContext(props.canvasId); const ctx = Taro.createCanvasContext(props.canvasId);
canvases[props.canvasId] = new uCharts({ canvases[props.canvasId] = new uCharts({
context: ctx, context: ctx,
type: "column", type: 'column',
fontSize: 11, fontSize: 11,
background: "#FFFFFF", background: '#FFFFFF',
pixelRatio: props.pixelRatio, pixelRatio: props.pixelRatio,
animation: true, animation: true,
categories: props.opts.categories, categories: props.opts.categories,
@@ -99,9 +98,9 @@ const initColumnChart = () => {
}, },
extra: { extra: {
column: { column: {
type: "group", type: 'group',
width: 30, width: 30,
activeBgColor: "#000000", activeBgColor: '#000000',
activeBgOpacity: 0.08, activeBgOpacity: 0.08,
}, },
}, },
@@ -112,12 +111,12 @@ const initLineChart = () => {
const ctx = Taro.createCanvasContext(props.canvasId); const ctx = Taro.createCanvasContext(props.canvasId);
canvases[props.canvasId] = new uCharts({ canvases[props.canvasId] = new uCharts({
context: ctx, context: ctx,
type: "line", type: 'line',
fontSize: 11, fontSize: 11,
legend: true, legend: true,
dataLabel: false, dataLabel: false,
dataPointShape: true, dataPointShape: true,
background: "#FFFFFF", background: '#FFFFFF',
pixelRatio: props.pixelRatio, pixelRatio: props.pixelRatio,
categories: props.opts.categories, categories: props.opts.categories,
series: props.opts.series, series: props.opts.series,
@@ -133,21 +132,21 @@ const initLineChart = () => {
disableGrid: true, disableGrid: true,
}, },
yAxis: { yAxis: {
gridType: "dash", gridType: 'dash',
gridColor: "#CCCCCC", gridColor: '#CCCCCC',
dashLength: 8, dashLength: 8,
splitNumber: 5, splitNumber: 5,
min: 10, min: 10,
max: 180, max: 180,
format: (val) => { format: val => {
return val.toFixed(0) + "元"; return val.toFixed(0) + '元';
}, },
}, },
width: props.cWidth * props.pixelRatio, width: props.cWidth * props.pixelRatio,
height: props.cHeight * props.pixelRatio, height: props.cHeight * props.pixelRatio,
extra: { extra: {
line: { line: {
type: "straight", type: 'straight',
}, },
}, },
}); });
@@ -156,7 +155,7 @@ const initLineChart = () => {
const touchStart = (e: any) => { const touchStart = (e: any) => {
canvases[props.canvasId].showToolTip(e, { canvases[props.canvasId].showToolTip(e, {
format: function (item: any, category: any) { format: function (item: any, category: any) {
return category + " " + item.name + ":" + item.data; return category + ' ' + item.name + ':' + item.data;
}, },
}); });
canvases[props.canvasId].scrollStart(e); canvases[props.canvasId].scrollStart(e);

View File

@@ -6,15 +6,14 @@
:headers="config.headers" :headers="config.headers"
@success="success" @success="success"
@failure="failure" @failure="failure"
:multiple="multiple" :multiple="multiple">
>
</nut-uploader> </nut-uploader>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { BASE_URL } from "@/utils/request"; import { BASE_URL } from '@/utils/request';
import { computed, ref } from "vue"; import { computed, ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
const props = defineProps({ const props = defineProps({
list: { list: {
@@ -31,17 +30,17 @@ const props = defineProps({
}, },
}); });
const emits = defineEmits(["update:list"]); const emits = defineEmits(['update:list']);
const fileList = computed({ const fileList = computed({
get: () => props.list, get: () => props.list,
set: (val) => emits("update:list", val), set: val => emits('update:list', val),
}); });
const config = ref({ const config = ref({
url: `${BASE_URL}/upload`, url: `${BASE_URL}/upload`,
headers: { headers: {
token: Taro.getStorageSync("token"), token: Taro.getStorageSync('token'),
}, },
}); });
@@ -49,15 +48,15 @@ const success = (res: any) => {
const data = JSON.parse(res.responseText.data); const data = JSON.parse(res.responseText.data);
res.fileItem.url = data.data.data; res.fileItem.url = data.data.data;
Taro.showToast({ Taro.showToast({
title: "上传成功", title: '上传成功',
icon: "success", icon: 'success',
}); });
}; };
const failure = () => { const failure = () => {
Taro.showToast({ Taro.showToast({
title: "上传失败", title: '上传失败',
icon: "error", icon: 'error',
}); });
}; };
</script> </script>

View File

@@ -1,10 +1,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import headImg from "../static/def_avatar.png"; import headImg from '../static/def_avatar.png';
import logoImg from "../static/logo.jpg"; import logoImg from '../static/logo.jpg';
import { BASE_URL } from "@/utils/request"; import { BASE_URL } from '@/utils/request';
import { getPhone, login } from "@/api/user"; import { getPhone, login } from '@/api/user';
const props = defineProps({ const props = defineProps({
isShow: { isShow: {
@@ -12,18 +12,18 @@ const props = defineProps({
default: false, default: false,
}, },
}); });
const emits = defineEmits(["closeEdit", "update:isShow"]); const emits = defineEmits(['closeEdit', 'update:isShow']);
const userInfo = ref({ const userInfo = ref({
nickname: "", nickname: '',
avatar: "", avatar: '',
phone: "", phone: '',
}); });
const show = computed({ const show = computed({
get: (): boolean => props.isShow, get: (): boolean => props.isShow,
set: (val) => { set: val => {
emits("update:isShow", val); emits('update:isShow', val);
}, },
}); });
@@ -32,15 +32,15 @@ const mp_is_new = ref(true);
const canvasStatus = ref(false); const canvasStatus = ref(false);
const closeAttr = () => { const closeAttr = () => {
emits("closeEdit"); emits('closeEdit');
}; };
const onChooseAvatar = (e) => { const onChooseAvatar = e => {
const { avatarUrl } = e.detail; const { avatarUrl } = e.detail;
Taro.uploadFile({ Taro.uploadFile({
url: `${BASE_URL}/upload`, url: `${BASE_URL}/upload`,
filePath: avatarUrl, filePath: avatarUrl,
name: "file", name: 'file',
success: function (res) { success: function (res) {
const data = JSON.parse(res.data); const data = JSON.parse(res.data);
userInfo.value.avatar = data.data.data; userInfo.value.avatar = data.data.data;
@@ -54,7 +54,7 @@ const uploadPic = () => {
const getPhoneNumber = async (e: any) => { const getPhoneNumber = async (e: any) => {
Taro.showLoading({ Taro.showLoading({
title: "授权手机号中", title: '授权手机号中',
mask: true, mask: true,
}); });
const { code } = e.detail; const { code } = e.detail;
@@ -68,39 +68,39 @@ const getPhoneNumber = async (e: any) => {
const formSubmit = async (e: any) => { const formSubmit = async (e: any) => {
if (!userInfo.value.avatar) if (!userInfo.value.avatar)
return Taro.showToast({ return Taro.showToast({
title: "请上传头像", title: '请上传头像',
icon: "none", icon: 'none',
}); });
userInfo.value.nickname = e.detail.value.nickname; userInfo.value.nickname = e.detail.value.nickname;
if (!userInfo.value.nickname) if (!userInfo.value.nickname)
return Taro.showToast({ return Taro.showToast({
title: "请输入昵称", title: '请输入昵称',
icon: "none", icon: 'none',
}); });
if (!userInfo.value.phone) if (!userInfo.value.phone)
return Taro.showToast({ return Taro.showToast({
title: "请授权手机号码", title: '请授权手机号码',
icon: "none", icon: 'none',
}); });
const res = await login({ const res = await login({
Code: Taro.getStorageSync("wx_code"), Code: Taro.getStorageSync('wx_code'),
NickName: userInfo.value.nickname, NickName: userInfo.value.nickname,
AvatarUrl: userInfo.value.avatar, AvatarUrl: userInfo.value.avatar,
Phone: userInfo.value.phone, Phone: userInfo.value.phone,
Referee: Taro.getStorageSync("bind_id") || "", Referee: Taro.getStorageSync('bind_id') || '',
}); });
emits("closeEdit"); emits('closeEdit');
Taro.showToast({ Taro.showToast({
title: res.msg, title: res.msg,
icon: "success", icon: 'success',
duration: 2000, duration: 2000,
}); });
Taro.setStorageSync("token", res.data.token); Taro.setStorageSync('token', res.data.token);
setTimeout(() => { setTimeout(() => {
Taro.removeStorageSync("wx_code"); Taro.removeStorageSync('wx_code');
Taro.removeStorageSync("bind_id"); Taro.removeStorageSync('bind_id');
Taro.switchTab({ Taro.switchTab({
url: "/pages/user/index", url: '/pages/user/index',
}); });
}, 2000); }, 2000);
}; };
@@ -115,8 +115,7 @@ const formSubmit = async (e: any) => {
:style="{ padding: '20px 10px' }" :style="{ padding: '20px 10px' }"
v-model:visible="show" v-model:visible="show"
@close="closeAttr" @close="closeAttr"
:close-on-click-overlay="false" :close-on-click-overlay="false">
>
<view class="mp-data"> <view class="mp-data">
<image class="image" :src="logoImg"></image> <image class="image" :src="logoImg"></image>
<text class="mp-name">捷兑通 申请</text> <text class="mp-name">捷兑通 申请</text>
@@ -133,23 +132,19 @@ const formSubmit = async (e: any) => {
<view <view
class="avatar-box" class="avatar-box"
v-if="!mp_is_new" v-if="!mp_is_new"
@click.stop="uploadPic" @click.stop="uploadPic">
>
<image <image
:src="userInfo.avatar || headImg" :src="userInfo.avatar || headImg"
mode="aspectFill" mode="aspectFill"></image>
></image>
</view> </view>
<button <button
v-else v-else
class="avatar-box" class="avatar-box"
open-type="chooseAvatar" open-type="chooseAvatar"
@chooseavatar="onChooseAvatar" @chooseavatar="onChooseAvatar">
>
<image <image
:src="userInfo.avatar || headImg" :src="userInfo.avatar || headImg"
mode="aspectFill" mode="aspectFill"></image>
></image>
</button> </button>
</view> </view>
</view> </view>
@@ -163,8 +158,7 @@ const formSubmit = async (e: any) => {
placeholder="请输入昵称" placeholder="请输入昵称"
name="nickname" name="nickname"
:maxlength="16" :maxlength="16"
:value="userInfo.nickname" :value="userInfo.nickname" />
/>
</view> </view>
</view> </view>
</view> </view>
@@ -174,9 +168,8 @@ const formSubmit = async (e: any) => {
<view class="input"> <view class="input">
<button <button
open-type="getPhoneNumber" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber" @getphonenumber="getPhoneNumber">
> {{ !userInfo.phone ? '请授权手机号' : '授权成功' }}
{{ !userInfo.phone ? "请授权手机号" : "授权成功" }}
</button> </button>
</view> </view>
</view> </view>

View File

@@ -1,11 +1,10 @@
<!DOCTYPE html> <!doctype html>
<html> <html>
<head> <head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta <meta
content="width=device-width,initial-scale=1,user-scalable=no" content="width=device-width,initial-scale=1,user-scalable=no"
name="viewport" name="viewport" />
/>
<meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" /> <meta name="apple-touch-fullscreen" content="yes" />
<meta name="format-detection" content="telephone=no,address=no" /> <meta name="format-detection" content="telephone=no,address=no" />

View File

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

View File

@@ -9,14 +9,12 @@
direction="vertical" direction="vertical"
title-gutter="5" title-gutter="5"
animated-time="0" animated-time="0"
name="tabName" name="tabName">
>
<nut-tab-pane <nut-tab-pane
v-for="(itm, index) in good_list" v-for="(itm, index) in good_list"
:key="index" :key="index"
:title="itm.name" :title="itm.name"
:pane-key="index" :pane-key="index">
>
<view v-if="itm.Goods.length > 0"> <view v-if="itm.Goods.length > 0">
<view class="list" v-for="(item, index) in itm.Goods" :key="index"> <view class="list" v-for="(item, index) in itm.Goods" :key="index">
<view class="item" @click.stop="toGoodDetails(item.gid, 1)"> <view class="item" @click.stop="toGoodDetails(item.gid, 1)">
@@ -29,17 +27,16 @@
<view class="price"> <view class="price">
<text style="font-size: 15px">{{ item.number }}</text> <text style="font-size: 15px">{{ item.number }}</text>
</view> </view>
<view class="price"> <!-- <view class="price">
<text style="font-size: 15px" <text style="font-size: 15px"
>{{ item.exchange }}积分</text >{{ item.exchange }}积分</text
> >
</view> </view> -->
</view> </view>
<nut-button <nut-button
size="mini" size="mini"
type="primary" type="primary"
@click.stop="add_cart(item)" @click.stop="add_cart(item)">
>
<template #icon> <template #icon>
<Cart2 /> <Cart2 />
</template> </template>
@@ -56,16 +53,20 @@
</view> </view>
<nut-empty v-else description="该商家暂无商品"></nut-empty> <nut-empty v-else description="该商家暂无商品"></nut-empty>
<!-- 购物车 --> <!-- 购物车 -->
<cart ref="cartRef" :mer-info="mer_info" @update-cart="updateCartNum" :IsPendingOrder="true" /> <cart
ref="cartRef"
:mer-info="mer_info"
@update-cart="updateCartNum"
:IsPendingOrder="true" />
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { Ref, ref } from "vue"; import { Ref, ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import Cart from "../../../../components/Cart.vue"; import Cart from '../../../../components/Cart.vue';
import { Cart2 } from "@nutui/icons-vue-taro"; import { Cart2 } from '@nutui/icons-vue-taro';
import { getGoodList, getMerCategory } from "../../../../api/goods"; import { getGoodList, getMerCategory } from '../../../../api/goods';
interface goodList { interface goodList {
ID: number; ID: number;
@@ -94,7 +95,7 @@ interface CartItems {
exchange: number; exchange: number;
} }
const value = ref("0"); const value = ref('0');
const good_list = ref<goodList[]>([]); const good_list = ref<goodList[]>([]);
const class_list = ref< const class_list = ref<
Array<{ Array<{
@@ -103,8 +104,8 @@ const class_list = ref<
}> }>
>([]); >([]);
Taro.useLoad(async (e) => { Taro.useLoad(async e => {
mer_info.value = e mer_info.value = e;
await get_class_list(e.bid); await get_class_list(e.bid);
await cartRef.value.get_cart_list(); await cartRef.value.get_cart_list();
}); });
@@ -119,7 +120,7 @@ const get_class_list = async (bid: string) => {
const get_good_list = async (id: number, bid: string) => { const get_good_list = async (id: number, bid: string) => {
Taro.showLoading({ Taro.showLoading({
title: "加载中", title: '加载中',
mask: true, mask: true,
}); });
const res = await getGoodList({ const res = await getGoodList({
@@ -161,7 +162,7 @@ const updateCartNum = (cartItems: CartItems[]) => {
} else { } else {
good_list.value.forEach((category: goodList) => { good_list.value.forEach((category: goodList) => {
category.Goods.forEach((good: GoodsType) => { category.Goods.forEach((good: GoodsType) => {
Reflect.deleteProperty(good, "cartNum"); Reflect.deleteProperty(good, 'cartNum');
}); });
}); });
} }
@@ -169,5 +170,5 @@ const updateCartNum = (cartItems: CartItems[]) => {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./index.scss"; @import './index.scss';
</style> </style>

View File

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

View File

@@ -3,7 +3,7 @@
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
height: 100vh; height: 100vh;
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png"); background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png');
background-size: auto 40%; background-size: auto 40%;
background-repeat: no-repeat; background-repeat: no-repeat;

View File

@@ -10,8 +10,7 @@
placeholder="请输入台号比如包厢A01" placeholder="请输入台号比如包厢A01"
name="seat" name="seat"
v-model="formVal.seat" v-model="formVal.seat"
required required />
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">手机号</text> <text class="label">手机号</text>
@@ -20,8 +19,7 @@
placeholder="请输入客人手机号码" placeholder="请输入客人手机号码"
name="phone" name="phone"
v-model="formVal.phone" v-model="formVal.phone"
required required />
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="label">备注</text> <text class="label">备注</text>
@@ -29,8 +27,7 @@
type="textarea" type="textarea"
placeholder="备注" placeholder="备注"
name="notes" name="notes"
v-model="formVal.notes" v-model="formVal.notes" />
/>
</view> </view>
<nut-button <nut-button
style="border-radius: 7px" style="border-radius: 7px"
@@ -47,23 +44,22 @@
<template #default <template #default
>客户手机号: >客户手机号:
<text style="color: #fd0100">{{ formVal.phone }}</text> <text style="color: #fd0100">{{ formVal.phone }}</text>
没有注册捷兑 没有注册捷兑 请通知他登录捷兑通小程序注册</template
请通知他登录捷兑通小程序注册</template
> >
</nut-dialog> </nut-dialog>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import BackComponent from "../../../../components/Back.vue"; import BackComponent from '../../../../components/Back.vue';
import { checkPhone } from "../../../../api/admin"; import { checkPhone } from '../../../../api/admin';
const formVal = ref({ const formVal = ref({
seat: "", seat: '',
phone: "", phone: '',
notes: "", notes: '',
}); });
const visible = ref(false); const visible = ref(false);
@@ -71,28 +67,28 @@ const visible = ref(false);
const formSubmit = async ({ detail }: any) => { const formSubmit = async ({ detail }: any) => {
if (!detail.value.seat) if (!detail.value.seat)
return Taro.showToast({ return Taro.showToast({
title: "请填写台号", title: '请填写台号',
icon: "none", icon: 'none',
}); });
if ( if (
!/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test( !/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/.test(
detail.value.phone detail.value.phone,
) )
) )
return Taro.showToast({ return Taro.showToast({
title: "请输入正确的手机号码", title: '请输入正确的手机号码',
icon: "none", icon: 'none',
}); });
try { try {
await checkPhone({ phone: detail.value.phone }); await checkPhone({ phone: detail.value.phone });
const user_info = await Taro.getStorageSync("userInfo"); const user_info = await Taro.getStorageSync('userInfo');
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}&notes=${formVal.value.notes}`, url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}&notes=${formVal.value.notes}`,
success: () => { success: () => {
formVal.value = { formVal.value = {
seat: "", seat: '',
phone: "", phone: '',
notes: "", notes: '',
}; };
}, },
}); });
@@ -104,5 +100,5 @@ const formSubmit = async ({ detail }: any) => {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./index.scss"; @import './index.scss';
</style> </style>

View File

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

View File

@@ -3,7 +3,8 @@
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
height: 100vh; height: 100vh;
background-image: url("./static/WechatIMG10.jpg"); // background-image: url('./static/WechatIMG10.jpg');
background-image: url('https://m.360buyimg.com/i/jfs/t1/288333/5/8622/43050/682e2e18Ff3a6e2af/bbc66c081c18a467.png');
background-size: 100% 35%; background-size: 100% 35%;
background-repeat: no-repeat; background-repeat: no-repeat;
@@ -39,7 +40,7 @@
.line { .line {
width: 1px; width: 1px;
height: 188px; height: 188px;
background: #C8C8C8; background: #c8c8c8;
} }
} }
} }

View File

@@ -5,8 +5,7 @@
<view class="card"> <view class="card">
<view <view
class="comm" class="comm"
@click="navTo('/pages/admin/add_order/add_table/index')" @click="navTo('/pages/admin/add_order/add_table/index')">
>
<text class="title">开始点单</text> <text class="title">开始点单</text>
<image src="./static/dc.png"></image> <image src="./static/dc.png"></image>
<text class="sub">线上点单后结系统</text> <text class="sub">线上点单后结系统</text>
@@ -14,8 +13,7 @@
<view class="line"></view> <view class="line"></view>
<view <view
class="comm" class="comm"
@click="navTo('/pages/admin/add_order/pending_order/index')" @click="navTo('/pages/admin/add_order/pending_order/index')">
>
<text class="title">我的订单</text> <text class="title">我的订单</text>
<image src="./static/ddan.png"></image> <image src="./static/ddan.png"></image>
<text class="sub">查看我点餐的订单</text> <text class="sub">查看我点餐的订单</text>
@@ -26,8 +24,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import BackComponent from "../../../components/Back.vue"; import BackComponent from '../../../components/Back.vue';
const navTo = (path: string) => { const navTo = (path: string) => {
Taro.navigateTo({ Taro.navigateTo({
@@ -37,5 +35,5 @@ const navTo = (path: string) => {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./index.scss"; @import './index.scss';
</style> </style>

View File

@@ -79,7 +79,11 @@
<script setup lang="ts"> <script setup lang="ts">
import { onMounted, ref } from 'vue'; import { onMounted, ref } from 'vue';
import {cancelAfterOrder, confirmAfterOrder, editAfterOrder} from '@/api/admin'; import {
cancelAfterOrder,
confirmAfterOrder,
editAfterOrder,
} from '@/api/admin';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
const props = defineProps({ const props = defineProps({

View File

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

View File

@@ -15,7 +15,7 @@
<view v-if="listData.length > 0"> <view v-if="listData.length > 0">
<view <view
class="card" class="card"
v-for="(item, index) in (listData as any[])" v-for="(item, index) in listData as any[]"
:key="index"> :key="index">
<view class="header"> <view class="header">
<view> <view>

View File

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

View File

@@ -18,12 +18,12 @@
} }
&::before { &::before {
content: "¥"; content: '¥';
color: #666666; color: #666666;
} }
&::after { &::after {
content: ""; content: '';
position: absolute; position: absolute;
bottom: -1px; bottom: -1px;
width: 700px; width: 700px;
@@ -101,7 +101,7 @@
.btn { .btn {
width: 709px; width: 709px;
height: 92px; height: 92px;
background: #FD0100; background: #fd0100;
color: #ffffff; color: #ffffff;
font-size: 32px; font-size: 32px;
text-align: center; text-align: center;

View File

@@ -26,8 +26,7 @@
<view class="center"> <view class="center">
<nut-ellipsis <nut-ellipsis
direction="end" direction="end"
:content="itm.Goods.name" :content="itm.Goods.name"></nut-ellipsis>
></nut-ellipsis>
<!-- <view class="title">{{ itm.Goods.name }}</view> --> <!-- <view class="title">{{ itm.Goods.name }}</view> -->
</view> </view>
<view class="num"> <view class="num">
@@ -45,18 +44,28 @@
</view> </view>
</view> </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> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { getAfterOrder, createPayQr } from "../../../../../api/admin"; import { getAfterOrder, createPayQr } from '@/api/admin';
const data = ref<any>({}); const data = ref<any>({});
const val = ref(""); const val = ref('');
const isLoading = ref(false);
Taro.useLoad((e: any) => { Taro.useLoad((e: any) => {
get_data(e); get_data(e);
@@ -64,7 +73,7 @@ Taro.useLoad((e: any) => {
const get_data = async ({ bid, oid }) => { const get_data = async ({ bid, oid }) => {
Taro.showLoading({ Taro.showLoading({
title: "加载中", title: '加载中',
}); });
const res = await getAfterOrder({ bid, oid }); const res = await getAfterOrder({ bid, oid });
data.value = res.data.data; data.value = res.data.data;
@@ -74,43 +83,47 @@ const get_data = async ({ bid, oid }) => {
const get_color = (status: number) => { const get_color = (status: number) => {
switch (status) { switch (status) {
case 0: case 0:
return "#FD0100"; return '#FD0100';
case 1: case 1:
return "#03A113"; return '#03A113';
case 2: case 2:
return "#FFA938"; return '#FFA938';
} }
}; };
const get_status_text = (status: number) => { const get_status_text = (status: number) => {
switch (status) { switch (status) {
case 0: case 0:
return "未付款"; return '未付款';
case 1: case 1:
return "已付款"; return '已付款';
case 2: case 2:
return "挂帐中"; return '挂帐中';
} }
}; };
const ok = async () => { const ok = async () => {
if (!val.value) if (!val.value)
return Taro.showToast({ return Taro.showToast({
title: "请输入收款金额", title: '请输入收款金额',
icon: "none", icon: 'none',
}); });
isLoading.value = true;
const res = await createPayQr({ const res = await createPayQr({
oid: data.value.oid, oid: data.value.oid,
bid: data.value.bid, bid: data.value.bid,
price: Number(val.value), price: Number(val.value),
}); });
Taro.setStorageSync("pay_code", res.data.data.code_url); Taro.setStorageSync('pay_code', res.data.data.code_url);
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/admin/add_order/pending_order/wx_pay_code/index?oid=${data.value.oid}&bid=${data.value.bid}`, url: `/pages/admin/add_order/pending_order/wx_pay_code/index?oid=${data.value.oid}&bid=${data.value.bid}`,
success: () => {
isLoading.value = false;
},
}); });
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./index.scss"; @import './index.scss';
</style> </style>

View File

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

View File

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

View File

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

View File

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

View File

@@ -13,8 +13,12 @@
<view class="flex-1"> <view class="flex-1">
<view class="title">{{ item.Goods?.name }}</view> <view class="title">{{ item.Goods?.name }}</view>
<view class="text-[#F83D3D] mt-5"> <view class="text-[#F83D3D] mt-5">
<view>{{ item.pay_price }}</view> <view
<view>{{ item.pay_integral }}积分</view> >{{ item.pay_price }}
<text v-if="item.pay_integral > 0"
>+{{ item.pay_integral }}积分</text
>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@@ -24,11 +28,13 @@
<view <view
class="flex justify-between items-center mt-2 mb-2 text-[25px]"> class="flex justify-between items-center mt-2 mb-2 text-[25px]">
<view class="text-[#9C9C9C]">{{ `${info.count}件商品` }}</view> <view class="text-[#9C9C9C]">{{ `${info.count}件商品` }}</view>
<view <text class="text-[26px] flex-1 text-right"
>{{ info.status !== 0 ? '实' : '应' }}付款{{ >{{ info.status !== 0 ? '实' : '应' }}付款:
info.pay_type === 1 ? '(元): ' : '(积分): ' {{ info.discount_price }} ()
}}{{ info.pay_type === 1 ? info.price : info.exchange }}</view <text v-if="info.exchange > 0"
>积分抵扣: {{ info.exchange }}</text
> >
</text>
</view> </view>
</view> </view>
</template> </template>
@@ -51,7 +57,10 @@
<nut-cell title="下单用户:" :desc="info.User?.nickName"></nut-cell> <nut-cell title="下单用户:" :desc="info.User?.nickName"></nut-cell>
<nut-cell title="用户手机号:" :desc="info.User?.phone"></nut-cell> <nut-cell title="用户手机号:" :desc="info.User?.phone"></nut-cell>
<nut-cell title="下单时间:" :desc="info.add_time"></nut-cell> <nut-cell title="下单时间:" :desc="info.add_time"></nut-cell>
<nut-cell title="核销时间:" :desc="info.User?.phone"></nut-cell> <nut-cell
v-if="info.status === 2"
title="核销时间:"
:desc="info.cancel_time"></nut-cell>
<nut-cell <nut-cell
v-if="info.status === 2" v-if="info.status === 2"
title="核销人员:" title="核销人员:"

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "订单管理", navigationBarTitleText: '订单管理',
}); });

View File

@@ -63,3 +63,44 @@
} }
} }
} }
.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;
}
}

View File

@@ -25,6 +25,27 @@
</view> </view>
</view> </view>
</view> </view>
<view class="pull-down Card" style="background: none; padding: 0">
<view
class="mr-[5px] flex items-center justify-left"
@click="IsTriangleDown = !IsTriangleDown"
><text>数据筛选</text>
<TriangleDown
style="width: auto"
:class="[!IsTriangleDown ? 'TriangleDownBox' : 'TriangleUpBox']" />
</view>
<view
class="flex menu justify-between text-[28px]"
:class="[!IsTriangleDown ? 'MenuDownBox' : 'MenuUpBox']">
<view
v-for="(item, index) in menus"
:key="index"
:class="[menuIndex === index ? 'active' : 'noActive']"
@click="tabChange(index)"
>{{ item.text }}</view
>
</view>
</view>
<view class="Card"> <view class="Card">
<view class="top" <view class="top"
><text class="iconfont icon-shujutongji icon"></text ><text class="iconfont icon-shujutongji icon"></text
@@ -34,16 +55,14 @@
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=today`" :url="`/pages/admin/statistics/index?type=price&time=today`">
>
<view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view> <view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view>
<view class="sub">今日成交额</view> <view class="sub">今日成交额</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=yesterday`" :url="`/pages/admin/statistics/index?type=price&time=yesterday`">
>
<view class="title">{{ <view class="title">{{
orderInfo?.total?.YesterdayNumber || 0 orderInfo?.total?.YesterdayNumber || 0
}}</view> }}</view>
@@ -52,32 +71,28 @@
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=month`" :url="`/pages/admin/statistics/index?type=price&time=month`">
>
<view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view> <view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view>
<view class="sub">本月成交额</view> <view class="sub">本月成交额</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=today`" :url="`/pages/admin/statistics/index?type=order&time=today`">
>
<view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view> <view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view>
<view class="sub">今日订单数</view> <view class="sub">今日订单数</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=yesterday`" :url="`/pages/admin/statistics/index?type=order&time=yesterday`">
>
<view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view> <view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view>
<view class="sub">昨日订单数</view> <view class="sub">昨日订单数</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=month`" :url="`/pages/admin/statistics/index?type=order&time=month`">
>
<view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view> <view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view>
<view class="sub">本月订单数</view> <view class="sub">本月订单数</view>
</navigator> </navigator>
@@ -93,8 +108,7 @@
:bordered="true" :bordered="true"
class="table" class="table"
:columns="columns" :columns="columns"
:data="orderInfo?.list" :data="orderInfo?.list"></nut-table>
></nut-table>
</view> </view>
<nut-empty v-else description="暂无订单数据"></nut-empty> <nut-empty v-else description="暂无订单数据"></nut-empty>
</view> </view>
@@ -102,9 +116,10 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { h, ref } from "vue"; import { h, ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { orderStatistics } from "../../../api/admin"; import { TriangleDown } from '@nutui/icons-vue-taro';
import { orderStatistics } from '../../../api/admin';
Taro.useLoad(() => { Taro.useLoad(() => {
getData(); getData();
@@ -112,39 +127,64 @@ Taro.useLoad(() => {
const orderInfo = ref<any>({}); const orderInfo = ref<any>({});
const IsTriangleDown = ref(false);
const menuIndex = ref(0);
const menus = ref([
{
text: '微信支付',
value: 1,
},
{
text: '平台积分',
value: 2,
},
{
text: '小猪积分',
value: 3,
},
]);
const tabChange = (value: number) => {
menuIndex.value = value;
getData();
};
const columns = ref([ const columns = ref([
{ {
title: "日期", title: '日期',
key: "Date", key: 'Date',
align: "center", align: 'center',
}, },
{ {
title: "订单数", title: '订单数',
key: "TotalCount", key: 'TotalCount',
align: "center", align: 'center',
}, },
{ {
title: "交易额", title: '交易额',
key: "NumberSum", key: 'NumberSum',
align: "center", align: 'center',
render: (row) => { render: row => {
return h( return h(
"view", 'view',
{ {
style: { style: {
color: "red", color: 'red',
}, },
}, },
row.NumberSum row.NumberSum,
); );
}, },
}, },
]); ]);
const getData = async () => { const getData = async () => {
const user_info = Taro.getStorageSync("userInfo"); const user_info = Taro.getStorageSync('userInfo');
const res = await orderStatistics({ const res = await orderStatistics({
bid: user_info.data.bid, bid: user_info.data.bid,
pay_type: menus.value[menuIndex.value].value,
}); });
orderInfo.value = res.data; orderInfo.value = res.data;
}; };

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "订单列表", navigationBarTitleText: '订单列表',
}); });

View File

@@ -56,8 +56,12 @@
<view class="flex-1"> <view class="flex-1">
<view class="title">{{ itm.Goods?.name }}</view> <view class="title">{{ itm.Goods?.name }}</view>
<view class="text-[#F83D3D] mt-5"> <view class="text-[#F83D3D] mt-5">
<view>{{ itm.pay_price }}</view> <view
<view>{{ itm.pay_integral }}积分</view> >{{ itm.pay_price }}
<text v-if="itm.pay_integral > 0"
>+{{ itm.pay_integral }}积分</text
>
</view>
</view> </view>
</view> </view>
<view class="right"> <view class="right">
@@ -69,11 +73,11 @@
class="flex justify-between items-center mt-2 mb-2 text-[25px]" class="flex justify-between items-center mt-2 mb-2 text-[25px]"
v-if="item.status !== 0"> v-if="item.status !== 0">
<text class="text-[#9C9C9C]">{{ item.count }}件商品</text> <text class="text-[#9C9C9C]">{{ item.count }}件商品</text>
<view <text class="text-[26px] flex-1 text-right"
>{{ item.status !== 0 ? '实' : '应' }}付款{{ >{{ item.status !== 0 ? '实' : '应' }}付款:
item.pay_type === 1 ? '(元): ' : '(积分): ' {{ item.discount_price }} ()
}}{{ item.pay_type === 1 ? item.price : item.exchange }}</view <text v-if="item.exchange > 0">积分抵扣: {{ item.exchange }}</text>
> </text>
</view> </view>
</view> </view>
</view> </view>
@@ -149,6 +153,7 @@ const getData = async () => {
const tabChange = (e: number) => { const tabChange = (e: number) => {
tabVal.value = e; tabVal.value = e;
dataList.value = [];
getData(); getData();
}; };
@@ -160,7 +165,7 @@ const toDetailPage = (item: any) => {
}; };
Taro.useReachBottom(() => { Taro.useReachBottom(() => {
if (pageOpt.value.total === dataList.value.length) if (pageOpt.value.total >= dataList.value.length)
return Taro.showToast({ return Taro.showToast({
title: '没有更多数据了', title: '没有更多数据了',
icon: 'none', icon: 'none',

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "订单数据统计", navigationBarTitleText: '订单数据统计',
}); });

View File

@@ -5,62 +5,66 @@
<view <view
class="item" class="item"
:class="time == 'today' ? 'on' : ''" :class="time == 'today' ? 'on' : ''"
@click="setTime('today')" @click="setTime('today')">
>
今天 今天
</view> </view>
<view <view
class="item" class="item"
:class="time == 'yesterday' ? 'on' : ''" :class="time == 'yesterday' ? 'on' : ''"
@click="setTime('yesterday')" @click="setTime('yesterday')">
>
昨天 昨天
</view> </view>
<view <view
class="item" class="item"
:class="time == 'seven' ? 'on' : ''" :class="time == 'seven' ? 'on' : ''"
@click="setTime('seven')" @click="setTime('seven')">
>
最近7天 最近7天
</view> </view>
<view <view
class="item" class="item"
:class="time == 'month' ? 'on' : ''" :class="time == 'month' ? 'on' : ''"
@click="setTime('month')" @click="setTime('month')">
>
本月 本月
</view> </view>
<view <view
class="item" class="item"
:class="time == 'date' ? 'on' : ''" :class="time == 'date' ? 'on' : ''"
@click="dateTitle" @click="dateTitle">
>
自定义 自定义
</view> </view>
</view> </view>
</view> </view>
<view class="wrapper"> <view class="wrapper">
<view class="flex justify-between">
<view>
<view class="title"> <view class="title">
{{ title }}{{ where.type == 1 ? "营业额" : "订单量" }} {{ title }}{{ where.type == 1 ? '营业额' : '订单量' }}
</view> </view>
<view v-if="where.type == 1" class="money">{{ dataObj.all || 0 }}</view> <view v-if="where.type == 1" class="money">{{
dataObj.all || 0
}}</view>
<view v-else 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 class="increase"> <view class="increase">
<view> <view>
{{ time === "date" ? "" : title }}增长率<text {{ time === 'date' ? '' : title }}增长率<text
:class="dataObj.growthRate >= 0 ? 'red' : 'green'" :class="dataObj.growthRate >= 0 ? 'red' : 'green'">
>
{{ dataObj.growthRate }}% {{ dataObj.growthRate }}%
<text <text
class="iconfont" class="iconfont"
:class=" :class="
dataObj.growthRate >= 0 ? 'icon-xiangshang1' : 'icon-xiangxia2' dataObj.growthRate >= 0 ? 'icon-xiangshang1' : 'icon-xiangxia2'
" "></text
></text
></text> ></text>
</view> </view>
<view> <view>
{{ time === "date" ? "" : title }}增长<text {{ time === 'date' ? '' : title }}增长<text
:class="dataObj.growthNumber >= 0 ? 'red' : 'green'" :class="dataObj.growthNumber >= 0 ? 'red' : 'green'"
>{{ dataObj.growthNumber }} >{{ dataObj.growthNumber }}
<text <text
@@ -69,8 +73,7 @@
dataObj.growthNumber >= 0 dataObj.growthNumber >= 0
? 'icon-xiangshang1' ? 'icon-xiangshang1'
: 'icon-xiangxia2' : 'icon-xiangxia2'
" "></text
></text
></text> ></text>
</view> </view>
</view> </view>
@@ -82,8 +85,7 @@
:ontouch="true" :ontouch="true"
@touchstart="touchStart" @touchstart="touchStart"
@touchmove="touchMove" @touchmove="touchMove"
@touchend="touchEnd" @touchend="touchEnd" />
/>
</view> </view>
<view class="Card"> <view class="Card">
@@ -96,8 +98,7 @@
:bordered="true" :bordered="true"
class="table" class="table"
:columns="columns" :columns="columns"
:data="dataObj?.list" :data="dataObj?.list"></nut-table>
></nut-table>
</view> </view>
<nut-empty v-else description="暂无订单数据"></nut-empty> <nut-empty v-else description="暂无订单数据"></nut-empty>
</view> </view>
@@ -109,20 +110,19 @@
:default-value="pickerVal" :default-value="pickerVal"
:start-date="date_start" :start-date="date_start"
@close="isVisible = false" @close="isVisible = false"
@choose="setChooseValue" @choose="setChooseValue">
>
</nut-calendar> </nut-calendar>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, h } from "vue"; import { ref, computed, h } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { growthRate } from "../../../api/admin"; import { growthRate } from '../../../api/admin';
import dayjs from "dayjs"; import dayjs from 'dayjs';
import uCharts from "../../../utils/js_sdk/u-charts.min.js"; import uCharts from '../../../utils/js_sdk/u-charts.min.js';
const time = ref(""); const time = ref('');
const isVisible = ref(false); const isVisible = ref(false);
@@ -138,44 +138,44 @@ const chartWH = ref({
const columns = ref([ const columns = ref([
{ {
title: "日期", title: '日期',
key: "Date", key: 'Date',
align: "center", align: 'center',
}, },
{ {
title: "订单数", title: '订单数',
key: "TotalCount", key: 'TotalCount',
align: "center", align: 'center',
}, },
{ {
title: "交易额", title: '交易额',
key: "NumberSum", key: 'NumberSum',
align: "center", align: 'center',
render: (row) => { render: row => {
return h( return h(
"view", 'view',
{ {
style: { style: {
color: "red", color: 'red',
}, },
}, },
row.NumberSum row.NumberSum,
); );
}, },
}, },
]); ]);
const date_start = computed(() => { const date_start = computed(() => {
return dayjs().startOf("year").format("YYYY-MM-DD"); return dayjs().startOf('year').format('YYYY-MM-DD');
}); });
const title = ref(""); const title = ref('');
const where = ref({ const where = ref({
type: 1, type: 1,
status: 2, status: 2,
start: "", start: '',
end: "", end: '',
}); });
const dataObj = ref<any>({}); const dataObj = ref<any>({});
@@ -184,20 +184,20 @@ const opts = ref<any>({
categories: [], categories: [],
series: [ series: [
{ {
name: "营业额", name: '营业额',
data: [], data: [],
}, },
{ {
name: "订单量", name: '订单量',
data: [], data: [],
}, },
], ],
}); });
const pickerVal = ref<any>([]) const pickerVal = ref<any>([]);
Taro.useLoad((options) => { Taro.useLoad(options => {
where.value.type = options.type === "price" ? 1 : 2; where.value.type = options.type === 'price' ? 1 : 2;
time.value = options.time; time.value = options.time;
setTime(options.time); setTime(options.time);
// getData(); // getData();
@@ -210,29 +210,29 @@ Taro.useLoad((options) => {
const setTime = (type: string) => { const setTime = (type: string) => {
time.value = type; time.value = type;
switch (type) { switch (type) {
case "today": case 'today':
title.value = "今日"; title.value = '今日';
where.value.status = 2; where.value.status = 2;
where.value.start = dayjs().format("YYYY-MM-DD"); where.value.start = dayjs().format('YYYY-MM-DD');
where.value.end = dayjs().format("YYYY-MM-DD"); where.value.end = dayjs().format('YYYY-MM-DD');
break; break;
case "yesterday": case 'yesterday':
title.value = "昨日"; title.value = '昨日';
where.value.status = 2; where.value.status = 2;
where.value.start = dayjs().add(-1, "day").format("YYYY-MM-DD"); where.value.start = dayjs().add(-1, 'day').format('YYYY-MM-DD');
where.value.end = dayjs().add(-1, "day").format("YYYY-MM-DD"); where.value.end = dayjs().add(-1, 'day').format('YYYY-MM-DD');
break; break;
case "seven": case 'seven':
title.value = "7天"; title.value = '7天';
where.value.status = 2; where.value.status = 2;
where.value.start = dayjs().add(-6, "day").format("YYYY-MM-DD"); where.value.start = dayjs().add(-6, 'day').format('YYYY-MM-DD');
where.value.end = dayjs().format("YYYY-MM-DD"); where.value.end = dayjs().format('YYYY-MM-DD');
break; break;
case "month": case 'month':
title.value = "本月"; title.value = '本月';
where.value.status = 1; where.value.status = 1;
where.value.start = dayjs().startOf("month").format("YYYY-MM-DD"); where.value.start = dayjs().startOf('month').format('YYYY-MM-DD');
where.value.end = dayjs().format("YYYY-MM-DD"); where.value.end = dayjs().format('YYYY-MM-DD');
break; break;
} }
getData(); getData();
@@ -240,7 +240,7 @@ const setTime = (type: string) => {
const dateTitle = () => { const dateTitle = () => {
where.value.status = 1; where.value.status = 1;
time.value = "date"; time.value = 'date';
isVisible.value = true; isVisible.value = true;
}; };
@@ -253,7 +253,7 @@ const setChooseValue = (ref: any) => {
const getData = async () => { const getData = async () => {
try { try {
const user_info = Taro.getStorageSync("userInfo"); const user_info = Taro.getStorageSync('userInfo');
const res = await growthRate({ const res = await growthRate({
bid: user_info.data.bid, bid: user_info.data.bid,
status: where.value.status, status: where.value.status,
@@ -273,16 +273,16 @@ const getData = async () => {
} catch (error) { } catch (error) {
Taro.showToast({ Taro.showToast({
title: error.msg, title: error.msg,
icon: "none", icon: 'none',
}); });
throw error; throw error;
} }
}; };
const create_canvas = () => { const create_canvas = () => {
const ctx = Taro.createCanvasContext("myChart"); const ctx = Taro.createCanvasContext('myChart');
canvas_obj = new uCharts({ canvas_obj = new uCharts({
type: "column", type: 'column',
context: ctx, context: ctx,
width: chartWH.value.width, width: chartWH.value.width,
height: chartWH.value.height, height: chartWH.value.height,
@@ -290,17 +290,17 @@ const create_canvas = () => {
series: opts.value.series, series: opts.value.series,
pixelRatio: chartWH.value.pixelRatio, pixelRatio: chartWH.value.pixelRatio,
animation: true, animation: true,
background: "#FFFFFF", background: '#FFFFFF',
color: [ color: [
"#1890FF", '#1890FF',
"#91CB74", '#91CB74',
"#FAC858", '#FAC858',
"#EE6666", '#EE6666',
"#73C0DE", '#73C0DE',
"#3CA272", '#3CA272',
"#FC8452", '#FC8452',
"#9A60B4", '#9A60B4',
"#ea7ccc", '#ea7ccc',
], ],
padding: [15, 15, 0, 15], padding: [15, 15, 0, 15],
enableScroll: true, enableScroll: true,
@@ -319,9 +319,9 @@ const create_canvas = () => {
}, },
extra: { extra: {
column: { column: {
type: "group", type: 'group',
width: 20, width: 20,
activeBgColor: "#000000", activeBgColor: '#000000',
activeBgOpacity: 0.08, activeBgOpacity: 0.08,
}, },
}, },
@@ -331,7 +331,7 @@ const create_canvas = () => {
const touchStart = (e: any) => { const touchStart = (e: any) => {
canvas_obj.showToolTip(e, { canvas_obj.showToolTip(e, {
format: function (item: any, category: any) { format: function (item: any, category: any) {
return category + " " + item.name + ":" + item.data; return category + ' ' + item.name + ':' + item.data;
}, },
}); });
canvas_obj.scrollStart(e); canvas_obj.scrollStart(e);
@@ -406,6 +406,7 @@ const touchEnd = (e: any) => {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.red { .red {
color: #ff6969; color: #ff6969;
} }
@@ -413,6 +414,7 @@ const touchEnd = (e: any) => {
.green { .green {
color: #1abb1d; color: #1abb1d;
} }
.iconfont { .iconfont {
font-size: 23px; font-size: 23px;
margin-left: 15px; margin-left: 15px;
@@ -439,6 +441,7 @@ const touchEnd = (e: any) => {
.top { .top {
display: flex; display: flex;
align-items: center; align-items: center;
text { text {
margin-right: 5px; margin-right: 5px;
} }
@@ -447,6 +450,7 @@ const touchEnd = (e: any) => {
color: #fa2c19; color: #fa2c19;
} }
} }
.table { .table {
margin-top: 10px; margin-top: 10px;
} }

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "订单核销", navigationBarTitleText: '订单核销',
}); });

View File

@@ -4,14 +4,86 @@
<image <image
class="image" class="image"
@tap="scanCode" @tap="scanCode"
src="http://p1.meituan.net/csc/696924dda634f05689dabdfbb18e88cc13551.png" /> src="https://p1.meituan.net/csc/696924dda634f05689dabdfbb18e88cc13551.png" />
<view class="mt-2 text-[#7A7A7A]">扫描二维码核销</view> <view class="mt-2 text-[#7A7A7A]">扫描二维码核销</view>
</view> </view>
<view class="bg-white p-2">
<view class="mt-2 text-center text-[#7A7A7A]">最近核销记录</view>
<view v-if="list.length > 0">
<view
class="order-card"
v-for="(item, index) in list"
:key="index"
@click="toDetailPage(item)">
<view class="top">
<view class="text-[#9C9C9C] text-[25px]"
>订单号{{ item.oid }}</view
>
<view
:style="{
color:
item.status === 0
? '#FF850A'
: item.status === 1
? '#F83D3D'
: item.status === 2
? '#333333'
: '#9C9C9C',
}"
>{{
item.status === 0
? '待付款'
: item.status === 1
? '待使用'
: item.status === 2
? '已使用'
: '已失效'
}}
</view>
</view>
<view class="line"></view>
<view class="center" v-for="(itm, idx) in item.OrderGoods" :key="idx">
<view class="top">
<image class="mr-10" :src="itm.Goods.cover" />
<view class="flex-1">
<view class="title">{{ itm.Goods?.name }}</view>
<view class="text-[#F83D3D] mt-5">
<view
>{{ itm.pay_price }}
<text v-if="itm.pay_integral > 0"
>+{{ itm.pay_integral }}积分</text
>
</view>
</view>
</view>
<view class="right">
<view>x{{ itm.number }}</view>
</view>
</view>
</view>
<view
class="flex justify-between items-center mt-2 mb-2 text-[25px]"
v-if="item.status !== 0">
<text class="text-[#9C9C9C]">{{ item.count }}件商品</text>
<text class="text-[26px] flex-1 text-right"
>{{ item.status !== 0 ? '实' : '应' }}付款:
{{ item.discount_price }} ()
<text v-if="item.exchange > 0"
>积分抵扣: {{ item.exchange }}</text
>
</text>
</view>
</view>
</view>
<nut-empty v-else description="暂无数据"></nut-empty>
</view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import { getActiveOrderList } from '@/api/admin';
import { ref } from 'vue';
// url参数转对象 // url参数转对象
// const urlParse = (url: string) => { // const urlParse = (url: string) => {
@@ -47,12 +119,42 @@ const scanCode = () => {
}, },
}); });
}; };
Taro.useLoad(() => {
getListOne();
});
const list = ref<any[]>([]);
const getListOne = async () => {
try {
const { data } = Taro.getStorageSync('userInfo');
const res = await getActiveOrderList({
PageNum: 1,
PageSize: 1,
bid: data.bid,
status: 0,
});
list.value = [res.data.data[0]];
console.log(list.value);
} catch (error) {
console.log(error);
}
};
const toDetailPage = (item: any) => {
Taro.setStorageSync('ver_order_info', item);
Taro.navigateTo({
url: '/pages/admin/order_manage/detail/index',
});
};
</script> </script>
<style lang="scss"> <style lang="scss">
page { page {
background-color: #f5f5f5; background-color: #f5f5f5;
background-image: url('http://p0.meituan.net/csc/e6ff5582788af2023f49241afe22fc89391851.png'); background-image: url('https://p0.meituan.net/csc/e6ff5582788af2023f49241afe22fc89391851.png');
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 25%; background-size: 100% 25%;
} }
@@ -62,7 +164,7 @@ page {
height: 300px; height: 300px;
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
margin: 300px auto; margin: 300px auto 50px auto;
border-radius: 33px; border-radius: 33px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@@ -75,4 +177,62 @@ page {
height: 150px; height: 150px;
} }
} }
.order-card {
box-sizing: border-box;
margin: 15px auto;
background-color: #fff;
padding: 20px;
.line {
width: 100%;
height: 1px;
background-color: #f5f5f5;
margin: 10px;
}
.top {
display: flex;
justify-content: space-between;
align-items: center;
}
.btn {
display: flex;
justify-content: flex-end;
align-items: center;
}
.center {
// margin-bottom: 10px;
.top {
display: flex;
// justify-content: space-between;
align-items: flex-start;
image {
width: 150px;
height: 150px;
border-radius: 15px;
margin-right: 10px;
}
.title {
display: -webkit-box;
overflow: hidden;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
width: 350px;
}
.right {
margin-left: 10px;
font-size: 28px;
text-align: right;
color: #9c9c9c;
}
}
}
}
</style> </style>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "核销列表", navigationBarTitleText: '核销列表',
}); });

View File

@@ -23,13 +23,12 @@
<text class="text-[#9C9C9C] text-left" <text class="text-[#9C9C9C] text-left"
>{{ goodInfo.count }}件商品</text >{{ goodInfo.count }}件商品</text
> >
<text class="flex-1" <text class="text-[26px] flex-1"
>{{ goodInfo.status !== 0 ? '实' : '应' }}付款{{ >实付款: {{ goodInfo.discount_price }} ()
goodInfo.pay_type === 1 ? '(元): ' : '(积分): ' <text v-if="goodInfo.exchange > 0"
}}{{ >积分抵扣: {{ goodInfo.exchange }}</text
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
}}</text
> >
</text>
</view> </view>
<!-- <view class="line"></view> --> <!-- <view class="line"></view> -->
<!-- <view class="cz"> <!-- <view class="cz">
@@ -73,7 +72,7 @@ Taro.useLoad(options => {
const goodInfo = ref<any>({}); const goodInfo = ref<any>({});
const getData = async (options: any) => { const getData = async (options: any) => {
const merInfo = Taro.getStorageSync("userInfo"); const merInfo = Taro.getStorageSync('userInfo');
const res = await getActiveVerifyList({ const res = await getActiveVerifyList({
oid: options.oid, oid: options.oid,
bid: merInfo.data.bid, bid: merInfo.data.bid,
@@ -98,15 +97,21 @@ const subVerify = async () => {
oid: goodInfo.value.oid, oid: goodInfo.value.oid,
bid: goodInfo.value.bid, bid: goodInfo.value.bid,
}); });
Taro.showToast({ //Taro.showToast({
title: res.msg, // title: res.msg,
icon: 'none', // icon: 'none',
}); //});
Taro.showModal({
title: '核销成功',
content: res.msg,
success: () => {
setTimeout(() => { setTimeout(() => {
Taro.navigateBack({ Taro.navigateBack({
delta: 1, delta: 1,
}); });
}, 3000); }, 3000);
},
});
} catch (error) { } catch (error) {
Taro.showToast({ Taro.showToast({
title: error.msg, title: error.msg,
@@ -123,7 +128,9 @@ const getPayType = (type: number) => {
case 2: case 2:
return '平台积分支付'; return '平台积分支付';
case 3: case 3:
return '天才小猪支付'; return '智多鑫积分支付';
case 3:
return '渔乐潮玩支付';
default: default:
return '未知'; return '未知';
} }

View File

@@ -1,4 +1,4 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '收益提现', navigationBarTitleText: '余额提现',
enablePullDownRefresh: true, enablePullDownRefresh: true,
}); });

View File

@@ -41,7 +41,7 @@
.card { .card {
margin: 20px auto; margin: 20px auto;
background-image: url('http://p0.meituan.net/csc/902ecf4ba9765a8200817d58a3a5a655172781.png'); background-image: url('https://p0.meituan.net/csc/902ecf4ba9765a8200817d58a3a5a655172781.png');
background-size: 100% 100%; background-size: 100% 100%;
width: 95%; width: 95%;
height: 250px; height: 250px;
@@ -54,7 +54,7 @@
color: #fff; color: #fff;
padding: 45px 100px; padding: 45px 100px;
display: flex; display: flex;
justify-content: space-between; justify-content: center;
align-items: center; align-items: center;
text-align: center; text-align: center;

View File

@@ -1,5 +1,5 @@
<script lang="ts" setup> <script lang="ts" setup>
import {ref, h} from 'vue'; import { ref } from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import { getWithdrawList, addWithdraw } from '@/api/admin'; import { getWithdrawList, addWithdraw } from '@/api/admin';
@@ -8,6 +8,7 @@ const user_info = ref<any>({});
const mer_info = ref<any>({}); const mer_info = ref<any>({});
const row = ref(0); const row = ref(0);
const str = ref(0);
const formRef = ref(); const formRef = ref();
@@ -48,6 +49,7 @@ const getData = async () => {
data.value.push(...res.data.data); data.value.push(...res.data.data);
pagination.value.total = res.data.total; pagination.value.total = res.data.total;
row.value = res.data.integral || 0; row.value = res.data.integral || 0;
str.value = res.data.number || 0;
} catch (e) { } catch (e) {
throw e; throw e;
} }
@@ -77,34 +79,21 @@ const add = async () => {
const rules = ref({ const rules = ref({
num: [ num: [
{ {
message: '请填写提现积分', message: '请填写提现余额',
validator: (value, _) => { validator: (value, _) => {
console.log(value); return value;
if (!value) {
return false;
} else {
return true;
}
}, },
}, },
{ {
message: '提现积分最低为100', message: '提现余额最低为1',
validator: (value, _) => { validator: (value, _) => {
if (Number(value) < 100) { return Number(value) >= 1;
return false;
} else {
return true;
}
}, },
}, },
{ {
message: '提现积分不能大于可提现积分', message: '提现余额不能大于可提现余额',
validator: (value, _) => { validator: (value, _) => {
if (Number(value) > row.value) { return Number(value) <= row.value;
return false;
} else {
return true;
}
}, },
}, },
], ],
@@ -141,17 +130,15 @@ Taro.useReachBottom(() => {
<view> <view>
<view class="card"> <view class="card">
<view class="container"> <view class="container">
<view class=""> <view>
<view class="font-bold text-[35px]">{{ row }}</view> <view class="font-bold text-[35px]">{{ row }}</view>
<view class="text-[25px] mt-2">可提现积分</view> <view class="text-[25px] mt-2">可提现余额</view>
</view> </view>
<view class="line"></view> <!-- <view class="line"></view>
<view class=""> <view class="">
<view class="font-bold text-[35px]">{{ <view class="font-bold text-[35px]">{{ str }}</view>
(row / 100 - (row / 100) * 0.138).toFixed(2)
}}</view>
<view class="text-[25px] mt-2">实际到账</view> <view class="text-[25px] mt-2">实际到账</view>
</view> </view> -->
</view> </view>
<view class="footer"> <view class="footer">
<text>到账方式</text> <text>到账方式</text>
@@ -165,20 +152,20 @@ Taro.useReachBottom(() => {
</view> </view>
<view class="formCard"> <view class="formCard">
<view class="flex justify-between mb-[25px]"> <view class="flex justify-between mb-[25px]">
<text>积分提现</text> <text>余额提现</text>
<view class="flex items-center" @click="visible1 = true"> <!-- <view class="flex items-center" @click="visible1 = true">
<image <image
class="w-[26px] h-[26px]" class="w-[26px] h-[26px]"
src="http://p1.meituan.net/csc/5437a800f4ed4a49f14984494c1c3077994.png"></image> src="https://p1.meituan.net/csc/5437a800f4ed4a49f14984494c1c3077994.png"></image>
<view class="text-[#EC4443] text-[26px] ml-1">提现疑问</view> <view class="text-[#EC4443] text-[26px] ml-1">提现疑问</view>
</view> </view> -->
</view> </view>
<nut-form ref="formRef" :model-value="basicData" :rules="rules"> <nut-form ref="formRef" :model-value="basicData" :rules="rules">
<nut-form-item prop="num"> <nut-form-item prop="num">
<nut-input <nut-input
v-model="basicData.num" v-model="basicData.num"
class="nut-input-text" class="nut-input-text"
placeholder="请输入提现积分" placeholder="请输入提现余额"
type="text"> type="text">
<template #right> <template #right>
<text <text
@@ -222,7 +209,7 @@ Taro.useReachBottom(() => {
</view> </view>
<view> <view>
<view class="mt-3 mb-3 text-[35px]">{{ item.number }}</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.integral }}</view>
<view class="text-[25px] mb-1" <view class="text-[25px] mb-1"
>信息服务费{{ item.commission }}</view >信息服务费{{ item.commission }}</view
> >
@@ -237,8 +224,8 @@ Taro.useReachBottom(() => {
v-if="item.status === 1" v-if="item.status === 1"
class="text-[23px] mt-2 text-[#df3526]" class="text-[23px] mt-2 text-[#df3526]"
@click="openPreview(item)" @click="openPreview(item)"
>点我查看回执单</view >点我查看回执单
> </view>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "全部服务", navigationBarTitleText: '全部服务',
}); });

View File

@@ -8,8 +8,7 @@
v-for="itm in item.Classify" v-for="itm in item.Classify"
:key="itm.ID" :key="itm.ID"
:text="itm.name" :text="itm.name"
@click="toDetails(itm)" @click="toDetails(itm)">
>
<image :src="itm.icon" /> <image :src="itm.icon" />
</nut-grid-item> </nut-grid-item>
</nut-grid> </nut-grid>
@@ -20,9 +19,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { getAllMerCategory } from "@/api/goods"; import { getAllMerCategory } from '@/api/goods';
const list = ref< const list = ref<
{ {

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "购物车", navigationBarTitleText: '购物车',
}); });

View File

@@ -20,10 +20,14 @@
<view class="box-left"> <view class="box-left">
<img class="cover" :src="item.cover" alt="" /> <img class="cover" :src="item.cover" alt="" />
<view class="center"> <view class="center">
<view>{{ item.name }}</view> <view class="line-clamp-2 text-[25px]">{{ item.name }}</view>
<view class="price"> <view class="price">
<view>{{ item.price }} </view> <view
<view>{{ item.exchange }} 积分</view> >{{ item.price }}
<text v-if="item.discount_integral > 0"
>+{{ item.discount_integral }}积分</text
>
</view>
</view> </view>
</view> </view>
</view> </view>
@@ -40,7 +44,7 @@
</view> </view>
<nut-empty v-else description="购物车暂无数据"></nut-empty> <nut-empty v-else description="购物车暂无数据"></nut-empty>
<view> <view>
<view style="height: 100rpx"></view> <view style="height: 100px"></view>
</view> </view>
<view class="bottom-box" v-if="list.length > 0"> <view class="bottom-box" v-if="list.length > 0">
<view class="left"> <view class="left">
@@ -90,6 +94,8 @@ interface CardList {
number: string; number: string;
price: number; price: number;
exchange: number; exchange: number;
pay_price: number;
discount_integral: number;
} }
// const selectAllVal = ref(false); // const selectAllVal = ref(false);
@@ -139,7 +145,7 @@ const changeBox = (label: string[], item: any) => {
item.Goods.forEach((itm: any) => { item.Goods.forEach((itm: any) => {
if (itm.gid === id) { if (itm.gid === id) {
item['Count'].priceCount += itm.price; item['Count'].priceCount += itm.price;
item['Count'].exchangeCount += itm.exchange; item['Count'].exchangeCount += itm.discount_integral;
} }
}); });
}); });
@@ -187,6 +193,8 @@ const isShowPay = ref(false);
const orderData = ref<any>([]); const orderData = ref<any>([]);
const sub = async () => { const sub = async () => {
try {
console.log('sub');
const arr: any = list.value.filter( const arr: any = list.value.filter(
(item: any) => item.state.checkboxgroup.length > 0, (item: any) => item.state.checkboxgroup.length > 0,
); );
@@ -198,7 +206,6 @@ const sub = async () => {
}); });
return; return;
} }
try {
const { data: res } = await createActiveOrder({ const { data: res } = await createActiveOrder({
Bid: arr.map((item: any) => item.StoreBid), Bid: arr.map((item: any) => item.StoreBid),
}); });
@@ -212,7 +219,7 @@ const sub = async () => {
} }
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg || '订单创建失败',
icon: 'none', icon: 'none',
}); });
} }
@@ -308,16 +315,18 @@ const add_cart = async (item: CardList, num: number = 1) => {
align-items: center; align-items: center;
.cover { .cover {
width: 130rpx; width: 130px;
height: 130rpx; height: 130px;
margin-right: 15rpx; min-width: 130px;
border-radius: 20rpx; min-height: 130px;
margin-right: 15px;
border-radius: 20px;
} }
.center { .center {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-between;
.price { .price {
display: flex; display: flex;
@@ -335,21 +344,21 @@ const add_cart = async (item: CardList, num: number = 1) => {
bottom: 0; bottom: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100rpx; height: 100px;
z-index: 9999; z-index: 9999;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 0 20rpx; padding: 0 20px;
box-shadow: 100rpx 104rpx 288rpx rgba(0, 0, 0, 0.01); box-shadow: 100px 104px 288px rgba(0, 0, 0, 0.01);
border-top: 1rpx solid #f5f5f5; border-top: 1px solid #f5f5f5;
.left { .left {
display: flex; display: flex;
align-items: center; align-items: center;
.text-box { .text-box {
margin-left: 10rpx; margin-left: 10px;
} }
} }
} }

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "分类", navigationBarTitleText: '分类',
}); });

View File

@@ -7,19 +7,16 @@
:animated-time="10" :animated-time="10"
name="tabs" name="tabs"
direction="vertical" direction="vertical"
@change="tabChange" @change="tabChange">
>
<nut-tab-pane <nut-tab-pane
v-for="item in list" v-for="item in list"
:title="(item.name as string)" :title="item.name as string"
:key="item.ID" :key="item.ID">
>
<view v-if="goodList.length > 0"> <view v-if="goodList.length > 0">
<view <view
class="list" class="list"
v-for="(item, index) in (goodList as any)" v-for="(item, index) in goodList as any"
:key="index" :key="index">
>
<view class="item"> <view class="item">
<img :src="item.cover" /> <img :src="item.cover" />
<view class="right"> <view class="right">
@@ -46,9 +43,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { ref } from "vue"; import { ref } from 'vue';
import { getCategoryList, getCategoryGoods } from "@/api/goods"; import { getCategoryList, getCategoryGoods } from '@/api/goods';
const val = ref(0); const val = ref(0);

View File

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

View File

@@ -0,0 +1,6 @@
page {
background-image: url('https://p1.meituan.net/csc/75a139bcec06745d385ec211aa313a98196174.png');
background-size: 100% 40%;
background-repeat: no-repeat;
background-color: #f9f8f6;
}

141
src/pages/fastBuy/index.vue Normal file
View File

@@ -0,0 +1,141 @@
<template>
<view class="flex flex-col items-center pt-[208px]">
<back />
<image class="h-[152px]" :src="par.header" />
<view class="list mt-[30px]" v-if="data.length > 0">
<view
class="bg-white p-[20px] w-[700px] rounded-[20px] mb-[20px] flex"
v-for="(item, index) in data"
:key="index">
<image
class="w-[200px] h-[200px] rounded-[10px] mr-[10px]"
:src="item.cover"></image>
<view class="flex-1 flex flex-col justify-between">
<nut-ellipsis
style="font-size: 20px"
direction="end"
:rows="2"
:content="item.name"></nut-ellipsis>
<view>
<view class="text-[#9E9E9E] text-[26px]"
>剩余: {{ item.stock }}</view
>
<view class="flex justify-between items-end">
<view>
<view class="text-[#F83D3D] text-[30px] font-bold"
>{{ item.number }}</view
>
<view class="text-[#F83D3D] text-[30px] font-bold"
>{{ item.exchange }}积分</view
>
</view>
<nut-button type="primary" size="mini" @click="toPay(item)"
>购买</nut-button
>
</view>
</view>
</view>
</view>
</view>
<nut-empty
class="mt-[130px]"
v-else
image="empty"
description="暂时没有商品"></nut-empty>
</view>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import Taro from '@tarojs/taro';
import { getHdOrJfGoods, createActiveOrder } from '@/api/goods';
import { getUserPoint } from '@/api/admin';
import { addCart } from '@/api/cart';
import Back from '@/components/Back.vue';
const par = ref<any>({});
Taro.useLoad(e => {
switch (e.type) {
case '1':
par.value = {
header:
'https://p0.meituan.net/csc/6229068017d3b199aafd9eed47bfd50513859.png',
};
break;
case '2':
par.value = {
header:
'https://p0.meituan.net/csc/ccfb8d3119200f81e2d6a5241081eb4b13797.png',
};
break;
}
par.value = {
...par.value,
type: e.type,
};
getList();
});
const data = ref<any[]>([]);
const page = ref({
page: 1,
pageSize: 10,
itemCount: 0,
});
const getList = async () => {
Taro.showLoading({
title: '加载中',
});
const res = await getHdOrJfGoods({
PageNum: page.value.page,
PageSize: page.value.pageSize,
type: Number(par.value.type),
});
data.value.push(...res.data.data);
page.value.itemCount = res.data.total;
Taro.hideLoading();
};
Taro.useReachBottom(() => {
if (page.value.page < Math.ceil(page.value.itemCount / page.value.pageSize)) {
page.value.page++;
getList();
}
});
const toPay = async item => {
const tk = Taro.getStorageSync('token');
if (!tk) {
Taro.navigateTo({
url: '/pages/users/login/index',
});
return;
}
await addCart({
Bid: item.Store.bid,
Gid: item.gid,
Number: 1,
});
const user_info = Taro.getStorageSync('userInfo');
const data = await getUserPoint({
phone: user_info.data.phone,
bid: item.Store.bid,
});
const res = await createActiveOrder({
Bid: [item.Store.bid],
custID: data.data.store_user_id,
});
Taro.navigateTo({
url: `/pages/goods/pay/index?oid=${res.data.oid}&bid=${item.Store.bid}&OrderType=1`,
});
};
</script>
<style lang="scss">
@import './index.scss';
</style>

View File

@@ -1,4 +1,4 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "游戏详情", navigationBarTitleText: '游戏详情',
navigationStyle: "custom", // navigationStyle: 'custom',
}); });

View File

@@ -0,0 +1,43 @@
// page {
// font-size: 10px;
// }
.index {
position: relative;
width: 100%;
height: 100vh;
.swiper {
background-color: white;
width: 100%;
}
.container {
z-index: 1;
position: absolute;
top: 260px;
background-color: white;
box-sizing: border-box;
width: 100%;
padding: 10px;
text-align: center;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
.btn {
margin: 20px auto;
padding: 10px;
border-radius: 50px;
background-color: #7950f2;
color: #fff;
width: 300px;
text-align: center;
border: 1px solid #f5f5f5;
}
}
}
.text {
padding: 10px;
font-size: 30px;
text-align: left;
}

View File

@@ -1,159 +1,52 @@
<template> <template>
<view> <view class="index">
<view <swiper class="swiper" :circular="true" :autoplay="true">
class="head-wrapper" <swiper-item v-for="(item, index) in list" :key="index">
:style="{ <image style="width: 100%" :src="item" />
top: statusHeight + 'px', </swiper-item>
}" </swiper>
> <view class="container">
<view class="head-menu"> <rich-text :nodes="info.introduction"></rich-text>
<Left class="iconfont" @click="returns" /> <view class="btn" @click="startGame()">开始游戏</view>
<Home class="iconfont" @click="goHome" />
</view>
</view>
<nut-swiper
class="swiper"
:pagination-visible="true"
pagination-color="#426543"
auto-play="3000"
>
<nut-swiper-item>
<image
src="https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg"
alt=""
/>
</nut-swiper-item>
<nut-swiper-item>
<image
src="https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg"
alt=""
/>
</nut-swiper-item>
<nut-swiper-item>
<image
src="https://storage.360buyimg.com/jdc-article/welcomenutui.jpg"
alt=""
/>
</nut-swiper-item>
<nut-swiper-item>
<image
src="https://storage.360buyimg.com/jdc-article/fristfabu.jpg"
alt=""
/>
</nut-swiper-item>
</nut-swiper>
<view class="box">
<view class="line"></view>
<view class="game-title"></view>
<view class="game-title"></view>
<view class="game-title"></view>
<view class="game-btn" @click="toGame()">开始游戏</view>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from 'vue';
import { import Taro from '@tarojs/taro';
useLoad, import './index.scss';
getSystemInfoSync,
navigateBack,
switchTab,
navigateTo,
} from "@tarojs/taro";
import { Left, Home } from "@nutui/icons-vue-taro";
var statusBarHeight = getSystemInfoSync().statusBarHeight as number;
console.log(statusBarHeight); const info = ref<any>({});
const list = ref<string[]>([]);
const statusHeight = ref<number>(statusBarHeight); Taro.useLoad(() => {
info.value = Taro.getStorageSync('gameItem');
// const swiperList = ref([]); list.value.push(info.value.cover);
useLoad((options) => {
console.log(options);
}); });
const returns = () => { const startGame = () => {
navigateBack(); // 判断url中是否含有http
}; if (info.value.url.indexOf('http') === -1) {
Taro.navigateTo({
const goHome = () => { url: info.value.url,
switchTab({
url: "/pages/index/index",
}); });
}; } else {
const user = Taro.getStorageSync('userInfo');
const toGame = () => { // if (user.data.pulse <= 0)
navigateTo({ // return Taro.showToast({
url: "/pages/game/gameview/index", // title: '您的豆子不足,无法进入游戏',
// icon: 'none',
// });
Taro.setStorageSync(
'game_url',
`${info.value.url}?uid=${Taro.getStorageSync('token')}&id=${
info.value.ID
}`,
);
Taro.navigateTo({
url: `/pages/game/view/index`,
}); });
}
}; };
</script> </script>
<style lang="scss">
.head-wrapper {
z-index: 999;
display: flex;
align-items: center;
position: fixed;
left: 30px;
top: 0;
height: 100px;
}
.head-menu {
display: flex;
align-items: center;
height: 54px;
width: 140px;
background: rgba(0, 0, 0, 0.25);
border-radius: 27px;
.iconfont {
flex: 1;
text-align: center;
color: #fff;
box-sizing: border-box;
&.icon-xiangzuo {
border-right: 1px solid #fff;
}
}
}
.swiper {
height: 450rpx;
width: 100vw;
image {
width: 100%;
}
}
.box {
width: 100%;
height: 90vh;
background-color: #fff;
z-index: 1;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
box-sizing: border-box;
position: absolute;
padding: 20px;
top: 400px;
.line {
width: 90px;
height: 10px;
border-radius: 4px;
background-color: rgba(202, 202, 202, 1);
margin: auto;
}
.game-btn {
width: 300px;
height: 75px;
margin: 50px auto;
color: #fff;
background-color: rgba(85, 77, 132, 1);
border-radius: 50px;
text-align: center;
line-height: 75px;
}
}
</style>

View File

@@ -1,3 +1,4 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '', navigationBarTitleText: '游戏大厅',
// navigationStyle: 'custom',
}); });

View File

@@ -1,19 +1,32 @@
<template> <template>
<view> <view class="index">
<web-view :src="url"></web-view> <!-- <view class="title">游戏大厅</view> -->
<view class="card_list">
<view
class="card_item"
v-for="item in list"
:key="item.ID"
:style="{ backgroundImage: `url(${item.cover})` }"
@click="toPage(item)"></view>
</view>
</view> </view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import { getPersonalInfo } from '@/api/user';
import { getGameList } from '@/api/game';
const url = ref(''); const list = ref<any[]>([]);
Taro.useDidShow(() => { Taro.useDidShow(() => {
const token = Taro.getStorageSync('token'); const token = Taro.getStorageSync('token');
// url.value = 'https://huakk.jdt168.com/#/pages/index/index';
if (token) { if (token) {
url.value = `${process.env.TARO_APP_GAME}${Taro.getStorageSync('token')}`; // url.value = `${process.env.TARO_APP_GAME}${Taro.getStorageSync('token')}`;
getUserInfo();
getList();
} else { } else {
Taro.showToast({ Taro.showToast({
title: '请先登录,再尝试进入游戏大厅。', title: '请先登录,再尝试进入游戏大厅。',
@@ -26,6 +39,77 @@ Taro.useDidShow(() => {
}, 1000); }, 1000);
} }
}); });
const getUserInfo = async () => {
const res = await getPersonalInfo();
const userInfo = {
...res.data,
data: {
...res.data.data,
permission: res.data.data.permission
? JSON.parse(res.data.data.permission)
: {},
},
};
Taro.setStorageSync('userInfo', userInfo);
};
const getList = async () => {
// console.log(process.env.TARO_APP_HALL_API)
const res = await getGameList();
list.value = res.data.data.sort((a: any, b: any) => b.sort - a.sort) || [];
};
const toPage = item => {
Taro.setStorageSync('gameItem', item);
Taro.navigateTo({
url: `/pages/game/gamedetail/index`,
});
};
</script> </script>
<style lang="scss"></style> <style lang="scss">
.index {
padding-top: 10px;
width: 100%;
height: 100vh;
.title {
margin: 60px;
font-size: 50px;
}
.card_list {
display: flex;
justify-content: center;
flex-wrap: wrap;
.card_item {
width: 700px;
height: 300px;
background-color: #fff;
margin-bottom: 20px;
border-radius: 20px;
text-align: center;
line-height: 300px;
// background-image: url('../../static/qietu.png');
background-size: 100% 100%;
position: relative;
// .btn {
// position: absolute;
// width: 150px;
// height: 100px;
// background-image: url('../../static/an.png');
// background-size: 100% 100%;
// right: 30px;
// bottom: 10px;
// &:active {
// transform: scale(1.1);
// }
// }
}
}
}
</style>

View File

@@ -1,21 +0,0 @@
<template>
<web-view
style="height: 100vh; width: 100vw"
:src="`https://www.jdt168.com/public/?uid=${user.uid}`"
></web-view>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { getStorageSync, useLoad } from "@tarojs/taro";
import { WebView } from "@tarojs/components";
const user = ref<any>({});
useLoad(() => {
user.value = getStorageSync("userInfo");
console.log(user);
});
</script>
<style lang="scss"></style>

View File

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

View File

@@ -1,5 +1,5 @@
<template> <template>
<web-view style="height: 100vh; width: 100vw" :src="url"></web-view> <web-view class="web-view" :src="url"></web-view>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -14,4 +14,10 @@ useDidShow(() => {
}); });
</script> </script>
<style lang="scss"></style> <style lang="scss">
.web-view {
// 适配ios底部安全区域
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
</style>

View File

@@ -1,5 +1,5 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "商品详情", navigationBarTitleText: '商品详情',
navigationStyle: "custom", navigationStyle: 'custom',
enableShareAppMessage: true, enableShareAppMessage: true,
}); });

View File

@@ -20,13 +20,12 @@
<view class="card"> <view class="card">
<view class="flex items-center justify-between"> <view class="flex items-center justify-between">
<view class="flex items-center"> <view class="flex items-center">
<nut-price size="large" :price="goodInfo.number"></nut-price> <nut-price size="large" :price="goodInfo.discount_price"></nut-price>
<view class="ml-5 line"></view>
<nut-price <nut-price
class="ml-5" v-if="goodInfo.exchange"
size="large" size="large"
:price="goodInfo.exchange" :price="goodInfo.exchange"
symbol="积分"></nut-price> symbol="+积分"></nut-price>
</view> </view>
<nut-button <nut-button
size="small" size="small"
@@ -38,15 +37,17 @@
</nut-button> </nut-button>
</view> </view>
<view class="flex items-center justify-between mt-3"> <view class="flex items-center justify-between mt-3">
<view class="title text-lg">{{ goodInfo.name }}</view> <view class="title text-[25px]">{{ goodInfo.name }}</view>
<view class="stock text-[#9E9E9E]"> 库存:{{ goodInfo.stock }}</view>
</view> </view>
<view class="stock text-[#9E9E9E] text-[25px] mt-[10px]"
>库存: {{ goodInfo.stock }}</view
>
<view class="line1"></view> <view class="line1"></view>
<view class="sub">{{ goodInfo.profile }}</view> <view class="sub">{{ goodInfo.profile }}</view>
</view> </view>
<!-- 商品详情 --> <!-- 商品详情 -->
<view class="rich-box"> <view class="rich-box">
<view class="title">-----商品详情-----</view> <view class="title">商品详情</view>
<rich-text <rich-text
v-if="goodInfo.details" v-if="goodInfo.details"
class="rich" class="rich"
@@ -64,7 +65,7 @@
import { Ref, ref } from 'vue'; import { Ref, ref } from 'vue';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import { Home, Left } from '@nutui/icons-vue-taro'; import { Home, Left } from '@nutui/icons-vue-taro';
import {getActiveGoodsDetail} from '@/api/goods'; import { getActiveGoodsDetail, getMerDetail } from '@/api/goods';
import Cart from '@/components/Cart.vue'; import Cart from '@/components/Cart.vue';
import { Cart2 } from '@nutui/icons-vue-taro'; import { Cart2 } from '@nutui/icons-vue-taro';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
@@ -86,18 +87,28 @@ interface GoodInfo {
profile?: string; profile?: string;
price?: number; price?: number;
cartNum?: number; cartNum?: number;
discount_price?: number;
} }
const goodInfo = ref<GoodInfo>({}); const goodInfo = ref<GoodInfo>({});
const bid = ref('');
Taro.useLoad(async options => { Taro.useLoad(async options => {
await get_good_detail(options.gid); await get_good_detail(options.gid);
mer_info.value = Taro.getStorageSync('mer_info'); bid.value = options.bid;
await getMerInfo();
await nextTick(async () => { await nextTick(async () => {
await cartRef.value.get_cart_list(); await cartRef.value.get_cart_list(bid.value);
}); });
}); });
const getMerInfo = async () => {
const res = await getMerDetail({ bid: bid.value });
mer_info.value = res.data.data;
};
Taro.useShareAppMessage(() => ({ Taro.useShareAppMessage(() => ({
title: `捷兑通-${goodInfo.value.name}`, title: `捷兑通-${goodInfo.value.name}`,
path: `/pages/goods/goods_detail/index?gid=${goodInfo.value.gid}&type=1`, path: `/pages/goods/goods_detail/index?gid=${goodInfo.value.gid}&type=1`,
@@ -149,7 +160,7 @@ const cartRef = ref(null) as Ref;
const add_cart = async (item: any) => { const add_cart = async (item: any) => {
const num = item.cartNum ? Number(item.cartNum) + 1 : 1; const num = item.cartNum ? Number(item.cartNum) + 1 : 1;
await nextTick(async () => { await nextTick(async () => {
await cartRef.value.add_cart(item, num); await cartRef.value.add_cart(item, num, bid.value);
}); });
}; };
@@ -219,7 +230,7 @@ page {
margin: auto; margin: auto;
.sub { .sub {
font-size: 30px; font-size: 25px;
color: #999; color: #999;
} }
} }
@@ -227,7 +238,7 @@ page {
.rich-box { .rich-box {
background-color: #fff; background-color: #fff;
margin-top: 20px; margin-top: 20px;
width: 100vw; //width: 100vw;
box-sizing: border-box; box-sizing: border-box;
text-align: center; text-align: center;
padding: 15px 0; padding: 15px 0;
@@ -239,10 +250,6 @@ page {
font-weight: bold; font-weight: bold;
color: #333; color: #333;
} }
.rich {
width: 100%;
}
} }
.nut-sku { .nut-sku {
@@ -305,10 +312,11 @@ page {
height: 30px; height: 30px;
background-color: #8f8f8f; background-color: #8f8f8f;
} }
.line1 { .line1 {
width: 100%; width: 100%;
height: 1px; height: 1px;
background-color: #F0F0F0; background-color: #f0f0f0;
margin: 20px auto; margin: 20px auto;
} }
</style> </style>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "提交订单", navigationBarTitleText: '提交订单',
}); });

View File

@@ -20,24 +20,21 @@
:border="false" :border="false"
v-model="basicData.name" v-model="basicData.name"
placeholder="请输入姓名" placeholder="请输入姓名"
type="text" type="text" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item body-align="right" label="联系电话"> <nut-form-item body-align="right" label="联系电话">
<nut-input <nut-input
:border="false" :border="false"
v-model="basicData.phone" v-model="basicData.phone"
placeholder="请输入联系电话" placeholder="请输入联系电话"
type="text" type="text" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item body-align="right" label="订单备注"> <nut-form-item body-align="right" label="订单备注">
<nut-textarea <nut-textarea
class="nut-input-text" class="nut-input-text"
v-model="basicData.notes" v-model="basicData.notes"
placeholder="请输入备注" placeholder="请输入备注"
type="text" type="text" />
/>
</nut-form-item> </nut-form-item>
</nut-form> </nut-form>
<!-- 底部 --> <!-- 底部 -->
@@ -51,22 +48,22 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { Find } from "@nutui/icons-vue-taro"; import { Find } from '@nutui/icons-vue-taro';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { calculateDistance } from "@/utils"; import { calculateDistance } from '@/utils';
import { ref } from "vue"; import { ref } from 'vue';
const distance = ref(""); const distance = ref('');
const basicData = ref({ const basicData = ref({
name: "", name: '',
phone: "", phone: '',
notes: "", notes: '',
}); });
Taro.useLoad(() => { Taro.useLoad(() => {
Taro.getLocation({ Taro.getLocation({
type: "wgs84", type: 'wgs84',
success: function (res) { success: function (res) {
const latitude = res.latitude; const latitude = res.latitude;
const longitude = res.longitude; const longitude = res.longitude;
@@ -74,7 +71,7 @@ Taro.useLoad(() => {
108.24898, 108.24898,
22.83646, 22.83646,
longitude, longitude,
latitude latitude,
); );
}, },
}); });
@@ -90,12 +87,12 @@ const toLocal = () => {
const orderPay = () => { const orderPay = () => {
Taro.showToast({ Taro.showToast({
title: "支付成功", title: '支付成功',
icon: "success", icon: 'success',
success: () => { success: () => {
setTimeout(() => { setTimeout(() => {
Taro.redirectTo({ Taro.redirectTo({
url: "/pages/goods/order_status/index", url: '/pages/goods/order_status/index',
}); });
}, 2000); }, 2000);
}, },

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "订单状态", navigationBarTitleText: '订单状态',
}); });

View File

@@ -24,18 +24,18 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { Check, CloseLittle } from "@nutui/icons-vue-taro"; import { Check, CloseLittle } from '@nutui/icons-vue-taro';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
const toHome = () => { const toHome = () => {
Taro.switchTab({ Taro.switchTab({
url: "/pages/index/index", url: '/pages/index/index',
}); });
}; };
const toOrderPage = () => { const toOrderPage = () => {
Taro.redirectTo({ Taro.redirectTo({
url: "/pages/users/order_list/index?type=0", url: '/pages/users/order_list/index?type=0',
}); });
}; };
</script> </script>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '支付订单', navigationBarTitleText: '确认订单',
}); });

Some files were not shown because too many files have changed in this diff Show More