Compare commits
19 Commits
e7fc232ba7
...
test
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c0036acfd | |||
| 2c38893c43 | |||
| a30d3572a5 | |||
| b6b6649a9b | |||
| 985c8fa766 | |||
| ef380ff569 | |||
| 63b61bbc98 | |||
| d831ee932b | |||
| 8b55419643 | |||
| f567cf7c94 | |||
| e1c00d6bb1 | |||
| 9edcf67620 | |||
| 8ca7001e3f | |||
| 6f5d722e6e | |||
| 6ca3669950 | |||
| 54b1d4b07c | |||
| 896acaef9e | |||
| 92d7bf1933 | |||
| 9af020af37 |
@@ -1,8 +1,8 @@
|
||||
module.exports = {
|
||||
types: [
|
||||
{value: 'feat', name: 'feat: 新增功能'},
|
||||
{value: 'fix', name: 'fix: 修复bug'},
|
||||
{value: 'docs', name: 'docs: 文档变更'},
|
||||
{ value: 'feat', name: 'feat: 新增功能' },
|
||||
{ value: 'fix', name: 'fix: 修复bug' },
|
||||
{ value: 'docs', name: 'docs: 文档变更' },
|
||||
{
|
||||
value: 'style',
|
||||
name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)',
|
||||
@@ -11,21 +11,21 @@ module.exports = {
|
||||
value: 'refactor',
|
||||
name: 'refactor: 代码重构(不包括 bug 修复、功能新增)',
|
||||
},
|
||||
{value: 'perf', name: 'perf: 性能优化'},
|
||||
{value: 'test', name: 'test: 添加、修改测试用例'},
|
||||
{ value: 'perf', name: 'perf: 性能优化' },
|
||||
{ value: 'test', name: 'test: 添加、修改测试用例' },
|
||||
{
|
||||
value: 'build',
|
||||
name: 'build: 构建流程、外部依赖变更(如升级 npm 包、修改 脚手架 配置等)',
|
||||
},
|
||||
{value: 'ci', name: 'ci: 修改 CI 配置、脚本'},
|
||||
{ value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
|
||||
{
|
||||
value: 'chore',
|
||||
name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)',
|
||||
},
|
||||
{value: 'revert', name: 'revert: 回滚 commit'},
|
||||
{value: 'wip', name: 'wip: 开发中'},
|
||||
{value: 'mod', name: 'mod: 不确定分类的修改'},
|
||||
{value: 'release', name: 'release: 发布'},
|
||||
{ value: 'revert', name: 'revert: 回滚 commit' },
|
||||
{ value: 'wip', name: 'wip: 开发中' },
|
||||
{ value: 'mod', name: 'mod: 不确定分类的修改' },
|
||||
{ value: 'release', name: 'release: 发布' },
|
||||
],
|
||||
scopes: [
|
||||
['custom', '自定义'],
|
||||
|
||||
62
.drone.yml
62
.drone.yml
@@ -1,62 +0,0 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: 测试服-构建部署
|
||||
pull: if-not-exists
|
||||
image: node:22-alpine
|
||||
when:
|
||||
branch:
|
||||
- test
|
||||
commands:
|
||||
- npm install -g pnpm
|
||||
- pnpm config set registry https://registry.npmmirror.com/
|
||||
- pnpm install
|
||||
- pnpm build:weapp:test:upload
|
||||
- rm -rf dist.tar
|
||||
|
||||
- name: 正式服-构建部署
|
||||
pull: if-not-exists
|
||||
image: node:22-alpine
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
commands:
|
||||
- npm install -g pnpm
|
||||
- pnpm config set registry https://registry.npmmirror.com/
|
||||
- pnpm install
|
||||
- pnpm build:weapp:prod:upload
|
||||
- rm -rf dist.tar
|
||||
|
||||
- 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}}\n
|
||||
**项目**: {{ repo.owner }}/{{ repo.name }} (构建 #{{build.number}})\n
|
||||
**分支**: {{ build.branch }}\n
|
||||
**提交**: {{ build.commit }}\n
|
||||
**作者**: {{ build.author }}\n
|
||||
**信息**: {{ build.message }}\n
|
||||
**耗时**: {{ since build.started }} 分钟\n
|
||||
**详情**: [查看构建详情]({{ build.link }})"
|
||||
}
|
||||
}
|
||||
@@ -2,32 +2,17 @@
|
||||
TARO_APP_ID='wx7b3322daa2cf9c88'
|
||||
|
||||
# 开发版appkey
|
||||
TARO_APP_KEY='1234567890'
|
||||
TARO_APP_KEY=''
|
||||
|
||||
# API接口
|
||||
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
|
||||
|
||||
# 骰子游戏链接
|
||||
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
||||
# TARO_APP_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='玩赚商城版权所有'
|
||||
|
||||
# 游戏API
|
||||
TARO_APP_HALL_API='https://game.wanzhuanyongcheng.cn'
|
||||
TARO_APP_TITLE_IMG='../../../static/index/1.png'
|
||||
TARO_APP_LOGO_IMG='../../../static/logo.jpg'
|
||||
|
||||
# 游戏大厅
|
||||
TARO_APP_HOME= 'https://test.wanzhuanyongcheng.cn/app/game'
|
||||
|
||||
# 游戏ws链接
|
||||
TARO_APP_WS='wss://game.wanzhuanyongcheng.cn/dice/home'
|
||||
|
||||
# 大转盘ws
|
||||
TARO_APP_TURNTABLE_WS='wss://game2.wanzhuanyongcheng.cn/turntable/home'
|
||||
|
||||
# 大转盘api
|
||||
TARO_APP_TURNTABLE_API='https://game2.wanzhuanyongcheng.cn/turntable'
|
||||
|
||||
# 澳拾
|
||||
TARO_APP_AOSHI_API='https://game3.wanzhuanyongcheng.cn'
|
||||
TARO_APP_SHOW_NEW_HOME='no'
|
||||
@@ -1,16 +1,19 @@
|
||||
# 正式版版appid
|
||||
# 正式版appid
|
||||
TARO_APP_ID='wxdd00d46fa6f07974'
|
||||
|
||||
# 开发版appkey
|
||||
# 正式版appkey
|
||||
TARO_APP_KEY='private.wxdd00d46fa6f07974.key'
|
||||
|
||||
# API接口
|
||||
TARO_APP_API='https://www.wanzhuanyongcheng.cn/app'
|
||||
|
||||
TARO_APP_GAME='https://jdt-prod-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
||||
|
||||
# 捕鱼游戏链接
|
||||
TARO_APP_FISH_GAME='https://jdt-prod-fish.wanzhuanyongcheng.cn/?uid='
|
||||
# 版权文字
|
||||
TARO_APP_NAME='捷兑通'
|
||||
TARO_APP_COP='鑫瓴科技版权所有'
|
||||
|
||||
# 游戏大厅
|
||||
TARO_APP_HOME= 'https://www.wanzhuanyongcheng.cn/app/game'
|
||||
TARO_APP_TITLE_IMG='../../../static/index/1.png'
|
||||
TARO_APP_LOGO_IMG='../../../static/logo.jpg'
|
||||
|
||||
|
||||
TARO_APP_SHOW_NEW_HOME='no'
|
||||
18
.env.reserve
Normal file
18
.env.reserve
Normal file
@@ -0,0 +1,18 @@
|
||||
# 备用版appid
|
||||
TARO_APP_ID='wx4a9380d8bb16d9de'
|
||||
|
||||
# 备用版appkey
|
||||
TARO_APP_KEY='private.wx4a9380d8bb16d9de.key'
|
||||
|
||||
# API接口
|
||||
TARO_APP_API='https://api.gxwzwh.com/app'
|
||||
|
||||
# 版权文字
|
||||
TARO_APP_NAME='玩赚商城'
|
||||
|
||||
TARO_APP_COP='玩赚商城版权所有'
|
||||
|
||||
TARO_APP_TITLE_IMG='../../../static/index/title.png'
|
||||
TARO_APP_LOGO_IMG='../../../static/logo-1.jpg'
|
||||
|
||||
TARO_APP_SHOW_NEW_HOME='yes'
|
||||
26
.env.test
26
.env.test
@@ -7,26 +7,12 @@ TARO_APP_KEY='private.wx7b3322daa2cf9c88.key'
|
||||
# API接口
|
||||
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
|
||||
|
||||
# 游戏链接
|
||||
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='
|
||||
|
||||
# 捕鱼游戏链接
|
||||
TARO_APP_FISH_GAME='https://jdt-test-fish.wanzhuanyongcheng.cn/?uid='
|
||||
# 版权文字
|
||||
TARO_APP_NAME='捷兑通'
|
||||
TARO_APP_COP='鑫瓴科技版权所有'
|
||||
|
||||
# 游戏API
|
||||
TARO_APP_HALL_API='https://game.wanzhuanyongcheng.cn'
|
||||
TARO_APP_TITLE_IMG='../../static/index/1.png'
|
||||
TARO_APP_LOGO_IMG='../../../static/logo.jpg'
|
||||
|
||||
# 游戏大厅
|
||||
TARO_APP_HOME= 'https://test.wanzhuanyongcheng.cn/app/game'
|
||||
|
||||
# 游戏ws链接
|
||||
TARO_APP_WS='wss://game.wanzhuanyongcheng.cn/dice/home'
|
||||
|
||||
# 大转盘ws
|
||||
TARO_APP_TURNTABLE_WS='wss://game2.wanzhuanyongcheng.cn/turntable/home'
|
||||
|
||||
# 大转盘api
|
||||
TARO_APP_TURNTABLE_API='https://game2.wanzhuanyongcheng.cn/turntable'
|
||||
|
||||
# 澳拾
|
||||
TARO_APP_AOSHI_API='https://game3.wanzhuanyongcheng.cn'
|
||||
TARO_APP_SHOW_NEW_HOME='no'
|
||||
4
.eslintignore
Normal file
4
.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
/node_modules/**
|
||||
/dist/*
|
||||
/public/*
|
||||
/src/static/*
|
||||
126
.gitea/workflows/ci.yaml
Normal file
126
.gitea/workflows/ci.yaml
Normal file
@@ -0,0 +1,126 @@
|
||||
name: CI Build & Upload (WeApp)
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- test
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-upload-dev:
|
||||
if: ${{ gitea.ref == 'refs/heads/test' }}
|
||||
runs-on: gitea_act_runner
|
||||
container:
|
||||
image: node:24-alpine
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
npm install -g pnpm
|
||||
pnpm config set registry https://registry.npmmirror.com/
|
||||
pnpm install
|
||||
|
||||
- name: Build & Upload (test)
|
||||
run: |
|
||||
pnpm build:weapp:test:upload
|
||||
rm -rf dist.tar || true
|
||||
|
||||
- name: Notify WeCom (Dev)
|
||||
if: always()
|
||||
env:
|
||||
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||
STATUS: ${{ job.status }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||
BRANCH: ${{ gitea.ref_name }}
|
||||
COMMIT: ${{ gitea.sha }}
|
||||
ACTOR: ${{ gitea.actor }}
|
||||
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
||||
run: |
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --no-cache curl jq
|
||||
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
||||
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
||||
"$EMOJI" "$REPO" "${{ gitea.run_number }}" "$BRANCH" "$COMMIT" "$ACTOR" "$(echo "$COMMIT_MSG" | tr '\n' ' ' | tr -s ' ')" "$RUN_URL")"
|
||||
JSON=$(jq -n --arg content "$MSG" '{msgtype:"markdown", markdown:{content:$content}}')
|
||||
curl -sS -H 'Content-Type: application/json' -d "$JSON" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||
|
||||
build-upload-prod:
|
||||
if: ${{ gitea.ref == 'refs/heads/master' }}
|
||||
runs-on: gitea_act_runner
|
||||
container:
|
||||
image: node:24-alpine
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
npm install -g pnpm
|
||||
pnpm config set registry https://registry.npmmirror.com/
|
||||
pnpm install
|
||||
|
||||
- name: Build & Upload (prod)
|
||||
run: |
|
||||
pnpm build:weapp:prod:upload
|
||||
rm -rf dist.tar || true
|
||||
|
||||
- name: Notify WeCom (Prod)
|
||||
if: always()
|
||||
env:
|
||||
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||
STATUS: ${{ job.status }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||
BRANCH: ${{ gitea.ref_name }}
|
||||
COMMIT: ${{ gitea.sha }}
|
||||
ACTOR: ${{ gitea.actor }}
|
||||
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
||||
run: |
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk add --no-cache curl jq
|
||||
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
||||
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
||||
"$EMOJI" "$REPO" "${{ gitea.run_number }}" "$BRANCH" "$COMMIT" "$ACTOR" "$(echo "$COMMIT_MSG" | tr '\n' ' ' | tr -s ' ')" "$RUN_URL")"
|
||||
JSON=$(jq -n --arg content "$MSG" '{msgtype:"markdown", markdown:{content:$content}}')
|
||||
curl -sS -H 'Content-Type: application/json' -d "$JSON" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||
|
||||
build-upload-reserve:
|
||||
if: ${{ gitea.ref == 'refs/heads/master' }}
|
||||
runs-on: gitea_act_runner
|
||||
container:
|
||||
image: node:24-alpine
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install deps
|
||||
run: |
|
||||
npm install -g pnpm
|
||||
pnpm config set registry https://registry.npmmirror.com/
|
||||
pnpm install
|
||||
|
||||
- name: Build & Upload (reserve)
|
||||
run: |
|
||||
pnpm build:weapp:reserve:upload
|
||||
rm -rf dist.tar || true
|
||||
|
||||
- name: Notify WeCom (Reserve)
|
||||
if: always()
|
||||
env:
|
||||
WEBHOOK_KEY: ${{ secrets.QYWX_WEBHOOK_KEY }}
|
||||
STATUS: ${{ job.status }}
|
||||
REPO: ${{ gitea.repository }}
|
||||
RUN_URL: ${{ gitea.server_url }}/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
||||
BRANCH: ${{ gitea.ref_name }}
|
||||
COMMIT: ${{ gitea.sha }}
|
||||
ACTOR: ${{ gitea.actor }}
|
||||
COMMIT_MSG: ${{ gitea.event.head_commit.message }}
|
||||
run: |
|
||||
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories || true
|
||||
apk add --no-cache curl jq
|
||||
EMOJI=$( [ "$STATUS" = "success" ] && echo "✅ 构建成功" || echo "❌ 构建失败" )
|
||||
MSG="$(printf "%s\n**项目**: %s (构建 #%s)\n**分支**: %s\n**提交**: %s\n**作者**: %s\n**信息**: %s\n**详情**: [查看构建详情](%s)" \
|
||||
"$EMOJI" "$REPO" "${{ gitea.run_number }}" "$BRANCH" "$COMMIT" "$ACTOR" "$(echo "$COMMIT_MSG" | tr '\n' ' ' | tr -s ' ')" "$RUN_URL")"
|
||||
JSON=$(jq -n --arg content "$MSG" '{msgtype:"markdown", markdown:{content:$content}}')
|
||||
curl -sS -H 'Content-Type: application/json' -d "$JSON" "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${WEBHOOK_KEY}"
|
||||
@@ -1,3 +1,4 @@
|
||||
/node_modules/**
|
||||
/dist/*
|
||||
/public/*
|
||||
/public/*
|
||||
/src/static/*
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"arrowParens": "avoid",
|
||||
"bracketSameLine": true,
|
||||
"bracketSpacing": false,
|
||||
"bracketSpacing": true,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "all"
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// babel-preset-taro 更多选项和默认值:
|
||||
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
|
||||
module.exports = {
|
||||
presets: [
|
||||
[
|
||||
|
||||
105
components.d.ts
vendored
105
components.d.ts
vendored
@@ -1,57 +1,58 @@
|
||||
// generated by unplugin-vue-components
|
||||
// We suggest you to commit this file into source control
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
import '@vue/runtime-core';
|
||||
// biome-ignore lint: disable
|
||||
export {}
|
||||
|
||||
export {};
|
||||
|
||||
declare module '@vue/runtime-core' {
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
Auth: (typeof import('./src/components/Auth.vue'))['default'];
|
||||
Back: (typeof import('./src/components/Back.vue'))['default'];
|
||||
Cart: (typeof import('./src/components/Cart.vue'))['default'];
|
||||
MerList: (typeof import('./src/components/MerList.vue'))['default'];
|
||||
NutAvatar: (typeof import('@nutui/nutui-taro'))['Avatar'];
|
||||
NutBacktop: (typeof import('@nutui/nutui-taro'))['Backtop'];
|
||||
NutButton: (typeof import('@nutui/nutui-taro'))['Button'];
|
||||
NutCalendar: (typeof import('@nutui/nutui-taro'))['Calendar'];
|
||||
NutCell: (typeof import('@nutui/nutui-taro'))['Cell'];
|
||||
NutCellGroup: (typeof import('@nutui/nutui-taro'))['CellGroup'];
|
||||
NutCheckbox: (typeof import('@nutui/nutui-taro'))['Checkbox'];
|
||||
NutCheckboxGroup: (typeof import('@nutui/nutui-taro'))['CheckboxGroup'];
|
||||
NutDialog: (typeof import('@nutui/nutui-taro'))['Dialog'];
|
||||
NutEllipsis: (typeof import('@nutui/nutui-taro'))['Ellipsis'];
|
||||
NutEmpty: (typeof import('@nutui/nutui-taro'))['Empty'];
|
||||
NutForm: (typeof import('@nutui/nutui-taro'))['Form'];
|
||||
NutFormItem: (typeof import('@nutui/nutui-taro'))['FormItem'];
|
||||
NutGrid: (typeof import('@nutui/nutui-taro'))['Grid'];
|
||||
NutGridItem: (typeof import('@nutui/nutui-taro'))['GridItem'];
|
||||
NutImagePreview: (typeof import('@nutui/nutui-taro'))['ImagePreview'];
|
||||
NutInput: (typeof import('@nutui/nutui-taro'))['Input'];
|
||||
NutInputNumber: (typeof import('@nutui/nutui-taro'))['InputNumber'];
|
||||
NutOverlay: (typeof import('@nutui/nutui-taro'))['Overlay'];
|
||||
NutPagination: (typeof import('@nutui/nutui-taro'))['Pagination'];
|
||||
NutPicker: (typeof import('@nutui/nutui-taro'))['Picker'];
|
||||
NutPopover: (typeof import('@nutui/nutui-taro'))['Popover'];
|
||||
NutPopup: (typeof import('@nutui/nutui-taro'))['Popup'];
|
||||
NutPrice: (typeof import('@nutui/nutui-taro'))['Price'];
|
||||
NutRadio: (typeof import('@nutui/nutui-taro'))['Radio'];
|
||||
NutRadioGroup: (typeof import('@nutui/nutui-taro'))['RadioGroup'];
|
||||
NutRate: (typeof import('@nutui/nutui-taro'))['Rate'];
|
||||
NutSwiper: (typeof import('@nutui/nutui-taro'))['Swiper'];
|
||||
NutSwiperItem: (typeof import('@nutui/nutui-taro'))['SwiperItem'];
|
||||
NutSwitch: (typeof import('@nutui/nutui-taro'))['Switch'];
|
||||
NutTable: (typeof import('@nutui/nutui-taro'))['Table'];
|
||||
NutTabPane: (typeof import('@nutui/nutui-taro'))['TabPane'];
|
||||
NutTabs: (typeof import('@nutui/nutui-taro'))['Tabs'];
|
||||
NutTextarea: (typeof import('@nutui/nutui-taro'))['Textarea'];
|
||||
NutUploader: (typeof import('@nutui/nutui-taro'))['Uploader'];
|
||||
Pay: (typeof import('./src/components/Pay.vue'))['default'];
|
||||
Popup: (typeof import('./src/components/Popup.vue'))['default'];
|
||||
RichEditor: (typeof import('./src/components/RichEditor.vue'))['default'];
|
||||
StoreList: (typeof import('./src/components/StoreList.vue'))['default'];
|
||||
Ucharts: (typeof import('./src/components/Ucharts.vue'))['default'];
|
||||
Upload: (typeof import('./src/components/Upload.vue'))['default'];
|
||||
UserModal: (typeof import('./src/components/UserModal.vue'))['default'];
|
||||
Auth: typeof import('./src/components/Auth.vue')['default']
|
||||
Back: typeof import('./src/components/Back.vue')['default']
|
||||
Cart: typeof import('./src/components/Cart.vue')['default']
|
||||
MerList: typeof import('./src/components/MerList.vue')['default']
|
||||
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
|
||||
NutBacktop: typeof import('@nutui/nutui-taro')['Backtop']
|
||||
NutButton: typeof import('@nutui/nutui-taro')['Button']
|
||||
NutCalendar: typeof import('@nutui/nutui-taro')['Calendar']
|
||||
NutCell: typeof import('@nutui/nutui-taro')['Cell']
|
||||
NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']
|
||||
NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']
|
||||
NutCheckboxGroup: typeof import('@nutui/nutui-taro')['CheckboxGroup']
|
||||
NutDialog: typeof import('@nutui/nutui-taro')['Dialog']
|
||||
NutEllipsis: typeof import('@nutui/nutui-taro')['Ellipsis']
|
||||
NutEmpty: typeof import('@nutui/nutui-taro')['Empty']
|
||||
NutForm: typeof import('@nutui/nutui-taro')['Form']
|
||||
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
|
||||
NutGrid: typeof import('@nutui/nutui-taro')['Grid']
|
||||
NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']
|
||||
NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview']
|
||||
NutInput: typeof import('@nutui/nutui-taro')['Input']
|
||||
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
|
||||
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
|
||||
NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
|
||||
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
|
||||
NutPopover: typeof import('@nutui/nutui-taro')['Popover']
|
||||
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
|
||||
NutPrice: typeof import('@nutui/nutui-taro')['Price']
|
||||
NutRadio: typeof import('@nutui/nutui-taro')['Radio']
|
||||
NutRadioGroup: typeof import('@nutui/nutui-taro')['RadioGroup']
|
||||
NutRate: typeof import('@nutui/nutui-taro')['Rate']
|
||||
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
|
||||
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
|
||||
NutSwitch: typeof import('@nutui/nutui-taro')['Switch']
|
||||
NutTable: typeof import('@nutui/nutui-taro')['Table']
|
||||
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
|
||||
NutTabs: typeof import('@nutui/nutui-taro')['Tabs']
|
||||
NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']
|
||||
NutUploader: typeof import('@nutui/nutui-taro')['Uploader']
|
||||
Pay: typeof import('./src/components/Pay.vue')['default']
|
||||
Popup: typeof import('./src/components/Popup.vue')['default']
|
||||
RichEditor: typeof import('./src/components/RichEditor.vue')['default']
|
||||
StoreList: typeof import('./src/components/StoreList.vue')['default']
|
||||
Ucharts: typeof import('./src/components/Ucharts.vue')['default']
|
||||
Upload: typeof import('./src/components/Upload.vue')['default']
|
||||
UserModal: typeof import('./src/components/UserModal.vue')['default']
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ module.exports = {
|
||||
env: {
|
||||
NODE_ENV: '"development"',
|
||||
},
|
||||
defineConstants: {},
|
||||
mini: {},
|
||||
h5: {},
|
||||
};
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
// @ts-nocheck
|
||||
import Components from 'unplugin-vue-components/webpack';
|
||||
import NutUIResolver from '@nutui/nutui-taro/dist/resolver';
|
||||
import {UnifiedWebpackPluginV5} from 'weapp-tailwindcss/webpack';
|
||||
import {join} from 'node:path';
|
||||
import {argv} from 'yargs';
|
||||
|
||||
const {robot = 1, desc} = argv;
|
||||
import { UnifiedWebpackPluginV5 } from 'weapp-tailwindcss/webpack';
|
||||
import { join } from 'node:path';
|
||||
import { argv } from 'yargs';
|
||||
|
||||
const CIPluginOptFn = async () => {
|
||||
/**
|
||||
* @typedef { import('@tarojs/plugin-mini-ci').CIOptions } CIOptions
|
||||
* @type {CIOptions}
|
||||
*/
|
||||
|
||||
const parsedArgs = await argv;
|
||||
|
||||
return {
|
||||
weapp: {
|
||||
appid: process.env.TARO_APP_ID,
|
||||
privateKeyPath: process.env.TARO_APP_KEY,
|
||||
robot,
|
||||
robot: parsedArgs.robot || 1,
|
||||
},
|
||||
desc,
|
||||
desc: parsedArgs.desc,
|
||||
};
|
||||
};
|
||||
|
||||
const config = {
|
||||
projectName: 'taroApp',
|
||||
date: '2023-8-13',
|
||||
designWidth(input: {file: string}) {
|
||||
designWidth(input: { file: string }) {
|
||||
if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) {
|
||||
return 375;
|
||||
}
|
||||
@@ -48,13 +48,14 @@ const config = {
|
||||
framework: 'vue3',
|
||||
compiler: {
|
||||
type: 'webpack5',
|
||||
prebundle: {enable: false},
|
||||
prebundle: { enable: process.env.TARO_ENV === 'h5' },
|
||||
},
|
||||
cache: {
|
||||
enable: false, // Webpack 持久化缓存配置,建议开启。默认配置请参考:https://docs.taro.zone/docs/config-detail#cache
|
||||
},
|
||||
sass: {
|
||||
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`,
|
||||
silenceDeprecations: ['import'],
|
||||
},
|
||||
alias: {
|
||||
'@': join(__dirname, '..', 'src'),
|
||||
@@ -75,7 +76,7 @@ const config = {
|
||||
});
|
||||
chain.plugin('unplugin-vue-components').use(
|
||||
Components({
|
||||
resolvers: [NutUIResolver({taro: true})],
|
||||
resolvers: [NutUIResolver({ taro: true })],
|
||||
}),
|
||||
);
|
||||
},
|
||||
@@ -110,7 +111,7 @@ const config = {
|
||||
webpackChain(chain) {
|
||||
chain.plugin('unplugin-vue-components').use(
|
||||
Components({
|
||||
resolvers: [NutUIResolver({taro: true})],
|
||||
resolvers: [NutUIResolver({ taro: true })],
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -4,7 +4,6 @@ module.exports = {
|
||||
env: {
|
||||
NODE_ENV: '"production"',
|
||||
},
|
||||
defineConstants: {},
|
||||
mini: {},
|
||||
h5: {
|
||||
/**
|
||||
|
||||
103
package.json
103
package.json
@@ -1,19 +1,12 @@
|
||||
{
|
||||
"name": "jdt-user",
|
||||
"version": "4.0.9",
|
||||
"private": true,
|
||||
"description": "",
|
||||
"templateInfo": {
|
||||
"name": "jdt-user",
|
||||
"typescript": true,
|
||||
"css": "sass"
|
||||
},
|
||||
"version": "4.0.18",
|
||||
"taroConfig": {
|
||||
"version": "4.0.9"
|
||||
"version": "4.0.18"
|
||||
},
|
||||
"scripts": {
|
||||
"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:alipay": "taro build --type alipay",
|
||||
"build:tt": "taro build --type tt",
|
||||
@@ -23,7 +16,7 @@
|
||||
"build:jd": "taro build --type jd",
|
||||
"build:quickapp": "taro build --type quickapp",
|
||||
"dev:weapp": "taro build --type weapp --watch",
|
||||
"dev:weapp:prview": "taro build --type weapp --watch --mode production",
|
||||
"dev:weapp:prview": "taro build --type weapp --watch --mode reserve",
|
||||
"dev:swan": "npm run build:swan -- --watch",
|
||||
"dev:alipay": "npm run build:alipay -- --watch",
|
||||
"dev:tt": "npm run build:tt -- --watch",
|
||||
@@ -36,11 +29,10 @@
|
||||
"lint:fix": "eslint --fix --ext .ts,.vue .",
|
||||
"lint:staged": "lint-staged",
|
||||
"prepare": "husky install",
|
||||
"preview": "vite preview",
|
||||
"cz": "cz",
|
||||
"lf": "npx prettier --write --end-of-line lf .",
|
||||
"postinstall": "weapp-tw patch",
|
||||
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
|
||||
"build:weapp:reserve:upload": "taro build --type weapp --upload --robot=3 --desc='备用环境' --mode reserve",
|
||||
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
|
||||
},
|
||||
"browserslist": [
|
||||
@@ -48,11 +40,10 @@
|
||||
"Android >= 4.1",
|
||||
"ios >= 8"
|
||||
],
|
||||
"author": "",
|
||||
"author": "JDT",
|
||||
"lint-staged": {
|
||||
"*.{ts,vue}": [
|
||||
"eslint --ext .ts,.vue .",
|
||||
"npx prettier --write --end-of-line lf ."
|
||||
"eslint --ext .ts,.vue ."
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
@@ -61,66 +52,68 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.26.7",
|
||||
"@babel/runtime": "^7.28.4",
|
||||
"@nutui/icons-vue-taro": "^0.0.9",
|
||||
"@nutui/nutui-taro": "^4.3.13",
|
||||
"@nutui/nutui-taro": "^4.3.14",
|
||||
"@qiun/vue-ucharts": "2.5.0-20230101",
|
||||
"@tarojs/components": "4.0.9",
|
||||
"@tarojs/helper": "4.0.9",
|
||||
"@tarojs/plugin-framework-vue3": "4.0.9",
|
||||
"@tarojs/plugin-html": "4.0.9",
|
||||
"@tarojs/plugin-platform-alipay": "4.0.9",
|
||||
"@tarojs/plugin-platform-h5": "4.0.9",
|
||||
"@tarojs/plugin-platform-jd": "4.0.9",
|
||||
"@tarojs/plugin-platform-qq": "4.0.9",
|
||||
"@tarojs/plugin-platform-swan": "4.0.9",
|
||||
"@tarojs/plugin-platform-tt": "4.0.9",
|
||||
"@tarojs/plugin-platform-weapp": "4.0.9",
|
||||
"@tarojs/runtime": "4.0.9",
|
||||
"@tarojs/shared": "4.0.9",
|
||||
"@tarojs/taro": "4.0.9",
|
||||
"dayjs": "^1.11.13",
|
||||
"@tarojs/components": "4.1.6",
|
||||
"@tarojs/helper": "4.1.6",
|
||||
"@tarojs/plugin-framework-vue3": "4.1.6",
|
||||
"@tarojs/plugin-html": "4.1.6",
|
||||
"@tarojs/plugin-platform-alipay": "4.1.6",
|
||||
"@tarojs/plugin-platform-h5": "4.1.6",
|
||||
"@tarojs/plugin-platform-jd": "4.1.6",
|
||||
"@tarojs/plugin-platform-qq": "4.1.6",
|
||||
"@tarojs/plugin-platform-swan": "4.1.6",
|
||||
"@tarojs/plugin-platform-tt": "4.1.6",
|
||||
"@tarojs/plugin-platform-weapp": "4.1.6",
|
||||
"@tarojs/runtime": "4.1.6",
|
||||
"@tarojs/shared": "4.1.6",
|
||||
"@tarojs/taro": "4.1.6",
|
||||
"dayjs": "^1.11.18",
|
||||
"pinia": "^2.3.1",
|
||||
"uqrcodejs": "^4.0.7",
|
||||
"vue": "^3.5.13"
|
||||
"vue": "^3.5.21"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.26.8",
|
||||
"@babel/core": "^7.28.4",
|
||||
"@commitlint/cli": "^18.6.1",
|
||||
"@commitlint/config-conventional": "^18.6.3",
|
||||
"@tarojs/cli": "4.0.9",
|
||||
"@tarojs/plugin-mini-ci": "4.0.9",
|
||||
"@tarojs/taro-loader": "4.0.9",
|
||||
"@tarojs/webpack5-runner": "4.0.9",
|
||||
"@types/node": "^18.19.75",
|
||||
"@tarojs/cli": "4.1.6",
|
||||
"@tarojs/plugin-mini-ci": "4.1.6",
|
||||
"@tarojs/taro-loader": "4.1.6",
|
||||
"@tarojs/webpack5-runner": "4.1.6",
|
||||
"@types/node": "^18.19.124",
|
||||
"@types/webpack-env": "^1.18.8",
|
||||
"@types/yargs": "^17.0.33",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"@unocss/webpack": "^0.60.4",
|
||||
"@vue/babel-plugin-jsx": "^1.2.5",
|
||||
"@vue/compiler-sfc": "^3.5.13",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"babel-preset-taro": "4.0.9",
|
||||
"@vue/babel-plugin-jsx": "^1.5.0",
|
||||
"@vue/compiler-sfc": "^3.5.21",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"babel-preset-taro": "4.1.6",
|
||||
"commitizen": "^4.3.1",
|
||||
"css-loader": "3.4.2",
|
||||
"cz-customizable": "^7.4.0",
|
||||
"cz-customizable": "^7.5.1",
|
||||
"eslint": "^8.57.1",
|
||||
"eslint-config-taro": "4.0.9",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"eslint-config-taro": "4.1.6",
|
||||
"eslint-plugin-vue": "^9.33.0",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^15.4.3",
|
||||
"miniprogram-ci": "^2.0.10",
|
||||
"lint-staged": "^15.5.2",
|
||||
"miniprogram-ci": "^2.1.26",
|
||||
"postcss": "8.4.29",
|
||||
"postcss-rem-to-responsive-pixel": "^6.0.2",
|
||||
"postcss-rem-to-responsive-pixel": "^6.1.0",
|
||||
"prettier": "^3.6.2",
|
||||
"style-loader": "1.3.0",
|
||||
"stylelint": "9.3.0",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^4.9.5",
|
||||
"unplugin-vue-components": "^0.23.0",
|
||||
"typescript": "^5.9.2",
|
||||
"unplugin-vue-components": "^28.8.0",
|
||||
"vue-loader": "^17.4.2",
|
||||
"weapp-tailwindcss": "^3.7.0",
|
||||
"webpack": "^5.97.1"
|
||||
},
|
||||
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
|
||||
"webpack": "^5.101.3",
|
||||
"yargs": "^17.7.2"
|
||||
}
|
||||
}
|
||||
|
||||
13
pnpm-workspace.yaml
Normal file
13
pnpm-workspace.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
onlyBuiltDependencies:
|
||||
- '@parcel/watcher'
|
||||
- '@swc/core'
|
||||
- '@tarojs/binding'
|
||||
- '@tarojs/cli'
|
||||
- core-js
|
||||
- core-js-pure
|
||||
- esbuild
|
||||
- less
|
||||
- protobufjs
|
||||
- swiper
|
||||
- vue-demi
|
||||
- weapp-tailwindcss
|
||||
27
private.wx4a9380d8bb16d9de.key
Normal file
27
private.wx4a9380d8bb16d9de.key
Normal file
@@ -0,0 +1,27 @@
|
||||
-----BEGIN RSA PRIVATE KEY-----
|
||||
MIIEogIBAAKCAQEAmHk5BywZ6y2rji/dL2HooKGiTuHrcSeGFODvDK6PPUjnieWB
|
||||
ev7C6N9kBWNbtYiwyLVpW5iKCxCb/GaBa5EIE0nXnKiOhThP3a8OYDW0oA9Xyp03
|
||||
1W56U3tnHA/GziyABIIMxqA45WYh3e9ar/sdhDvDyre0yl+8cWcPdNOVOW7as88W
|
||||
yXDsCQbQedPIAy3sRANZ6K2QTNe5Aht3Y7F1uMKRlJwLodutUopPd32rxJz7WNhB
|
||||
j9CrjzgnfLJa7siURM2r6om2osNFqHP4bmy5yO68TPI8JQgJTUqoNswgFDa2ng9Y
|
||||
lOhks6kMR8ldL89+fYqILGDVG7124LKIo1awTQIDAQABAoIBACS+Kaj5zrEmy02z
|
||||
aRjO/lEfQk7CEIuvG5eScOjcc/YvyGQpo18xX2Tg2GiX/fSsIPXtCZuiEboC4aQc
|
||||
S5nRVGHZjJTa5aVi4ZQpaEx1BLcBm4VfB6JuQho2Ba30e1MZ1CvB7zQ6Thux1f12
|
||||
faMk34MLJ+6FAJM4KOAnFslvZ2l0VxIlBq5pbF71dO/MsIrpBWVFNGqu6jtXRUJw
|
||||
J92PbaFMi/smsgdXixsokzPmE5em3zLdp5cfHQCRBjNBclMjlnHhwQVK8wU7D609
|
||||
CPcvPS8J3PMceMeGXC1QXFANllVecmn7jECVBU5H4Ed0pb89T9Q7yWVnVBo31ZB7
|
||||
r4GuL+ECgYEAyLcE4cuPsp31oaKATSZrBmypQuGFsarddyereN8ATZ9DjbFL9Y2/
|
||||
NazLmG1KjeD1yN1q9/ek+nctKTNzuY14cVeahDoiv0ALNUOuS7IFzoHWf5SnNKEx
|
||||
oEgGJV9D6olk9YnPF5iwn/lRL84af3dxSnKr75hh8Yv5hWrPnJ95xJkCgYEAwniQ
|
||||
z6yFg2SmnzwwYV72/aoukmsI3KKBHMEDkAFOummy7iv8eT+9DLumQ9BC+mT3eFmq
|
||||
GVNVM+199NTQ5b5CzXYalSsw93rewhRkk0RVV31AJUwaRbYy6F6O502SpFYb4n8f
|
||||
S7KfDv70utGOnycMBNjeaFGWxAZbUCLjfUv8JdUCgYBb1fGz5lHPZhrXY+TUZ/mc
|
||||
LOedJFbpncZLGKmKWm5nFbHxCOg6aCrOwks9aPQtynpq93RUFMk1mIXfTh1rDuHG
|
||||
6lBWo8r2OrVmH5uGIuQpQpsEMN34ZLCyJ4I4Y0hN7aN1/SH2J/TYnViaSPEy1VHO
|
||||
wH0O2Wgm/uaiNubbQNSUMQKBgCXT5fc/i8j/LxoSTybhnhHBpMV+ZH7mbU72jIba
|
||||
ekHwhYmmrLm5GED9z12piR3Dvg9/AYNjnlM3gyS4sNm/pKbqrkkN2byJ/gKqjNXI
|
||||
mQEnr+6RWxrsUgK5QfrkL/4fcdUg/SlwWVhFZ71fPerfYYsf1ENee4Et610vLCkX
|
||||
OrjxAoGATIlZgaPuDA/Sh/YTxxSEjNZGCWx4YvWZfL+PW2ItuadMeD2lLai6lOOi
|
||||
9ew2xXZkvaeA9PGOA5YK2121M5brwkB0Kc3zNvEmrkpQDJYqeoRvLEuFGDmZ/MX1
|
||||
p0bzKs1vvh5dyFjWQ5IN9FckZ3Fpk6A1zMEuyQdk35TwX+w5EdE=
|
||||
-----END RSA PRIVATE KEY-----
|
||||
4
src/api/game.ts
Normal file
4
src/api/game.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import request from '../utils/request';
|
||||
|
||||
// 获取游戏列表
|
||||
export const getGameList = () => request('/game', {}, 'POST');
|
||||
@@ -97,12 +97,12 @@ export default defineAppConfig({
|
||||
selectedIconPath: 'static/tabbar/1-1.png',
|
||||
text: '首页',
|
||||
},
|
||||
{
|
||||
pagePath: 'pages/game/gamehome/index',
|
||||
iconPath: 'static/tabbar/2-0.png',
|
||||
selectedIconPath: 'static/tabbar/2-1.png',
|
||||
text: '游戏',
|
||||
},
|
||||
// {
|
||||
// pagePath: 'pages/game/gamehome/index',
|
||||
// iconPath: 'static/tabbar/2-0.png',
|
||||
// selectedIconPath: 'static/tabbar/2-1.png',
|
||||
// text: '游戏',
|
||||
// },
|
||||
{
|
||||
pagePath: 'pages/cart/index',
|
||||
iconPath: 'static/tabbar/3-0.png',
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
|
||||
page {
|
||||
background-color: #f5f5f5;
|
||||
// font-size: 30rpx;
|
||||
// IOS安全区域
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {createApp} from 'vue';
|
||||
import { createApp } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import './app.scss';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<script setup lang="ts">
|
||||
// import { computed, ref } from "vue";
|
||||
import Taro from '@tarojs/taro';
|
||||
import {login} from '@/api/user';
|
||||
import { login } from '@/api/user';
|
||||
|
||||
defineProps({
|
||||
visible: {
|
||||
@@ -40,9 +40,9 @@ const onOk = () => {
|
||||
desc: '完善用户资料',
|
||||
success: async user => {
|
||||
Taro.login({
|
||||
success: async ({code}) => {
|
||||
success: async ({ code }) => {
|
||||
try {
|
||||
const {data}: any = await login({
|
||||
const { data }: any = await login({
|
||||
code: code,
|
||||
nickName: user.userInfo.nickName,
|
||||
avatarUrl: user.userInfo.avatarUrl,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<view class="head-wrapper" :style="{top: BarHeight + 'px'}">
|
||||
<view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
|
||||
<view class="head-menu">
|
||||
<Left class="iconfont" @click="returns" />
|
||||
<view class="line"></view>
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {computed} from 'vue';
|
||||
import {Home, Left} from '@nutui/icons-vue-taro';
|
||||
import { computed } from 'vue';
|
||||
import { Home, Left } from '@nutui/icons-vue-taro';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight as number;
|
||||
const BarHeight = computed(() => statusBarHeight - 7);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {addCart, getCart, clearCart} from '@/api/cart';
|
||||
import {Plus, Minus} from '@nutui/icons-vue-taro';
|
||||
import {createActiveOrder} from '@/api/goods';
|
||||
import {createAfterOrder, getUserPoint} from '@/api/admin';
|
||||
import { addCart, getCart, clearCart } from '@/api/cart';
|
||||
import { Plus, Minus } from '@nutui/icons-vue-taro';
|
||||
import { createActiveOrder } from '@/api/goods';
|
||||
import { createAfterOrder, getUserPoint } from '@/api/admin';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
|
||||
interface CardList {
|
||||
@@ -202,7 +202,7 @@ defineExpose({
|
||||
<!-- <view>购物车数量: {{ cartInfo.count }}</view> -->
|
||||
<view class="cardImg">
|
||||
<image
|
||||
src="http://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png">
|
||||
src="https://p1.meituan.net/csc/929f447a96a44b09a09b2e0055433222717.png">
|
||||
</image>
|
||||
<view class="count-text" v-if="cartInfo.count > 0">
|
||||
<text>{{ cartInfo.count }}</text>
|
||||
@@ -221,7 +221,7 @@ defineExpose({
|
||||
</view>
|
||||
<!-- 购物车弹窗 -->
|
||||
<nut-popup
|
||||
:style="{padding: '15px'}"
|
||||
:style="{ padding: '15px' }"
|
||||
round
|
||||
position="bottom"
|
||||
z-index="1"
|
||||
@@ -233,7 +233,7 @@ defineExpose({
|
||||
<!-- <Del2 color="#666666" /> -->
|
||||
<image
|
||||
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>
|
||||
</view>
|
||||
</view>
|
||||
@@ -316,7 +316,7 @@ $h-border-radius: 50px;
|
||||
position: absolute;
|
||||
top: -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%;
|
||||
// padding: 0 8px;
|
||||
width: 35px;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<view class="list-box">
|
||||
<view class="list">
|
||||
<swiper
|
||||
v-if="bannerList.length !== 0"
|
||||
class="item"
|
||||
:style="{
|
||||
height: '250px',
|
||||
@@ -82,13 +83,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {calculateDistance, parseQueryString} from '@/utils';
|
||||
import {bindParent, getBanner} from '@/api/user';
|
||||
import {getMerList} from '@/api/goods';
|
||||
import { calculateDistance, parseQueryString } from '@/utils';
|
||||
import { bindParent, getBanner } from '@/api/user';
|
||||
import { getMerList } from '@/api/goods';
|
||||
|
||||
const classId = defineModel({default: 0});
|
||||
const classId = defineModel({ default: 0 });
|
||||
|
||||
const list1 = ref<Array<MerData>>([]);
|
||||
const list2 = ref<Array<MerData>>([]);
|
||||
@@ -166,8 +167,8 @@ const get_mer_list = async () => {
|
||||
const bannerList = ref<any[]>([]);
|
||||
|
||||
const get_banner_list = async () => {
|
||||
const {data}: any = await getBanner();
|
||||
bannerList.value = data.data;
|
||||
const { data }: any = await getBanner();
|
||||
bannerList.value = data.data || [];
|
||||
};
|
||||
|
||||
const toPage = async (url: string) => {
|
||||
@@ -175,7 +176,7 @@ const toPage = async (url: string) => {
|
||||
// url转对象
|
||||
const obj = parseQueryString(url);
|
||||
if (obj.type === '1') {
|
||||
const {data: res} = await getMerList({});
|
||||
const { data: res } = await getMerList({});
|
||||
const mer = res.data.filter(item => item.bid === obj.bid)[0];
|
||||
Taro.setStorageSync('mer_info', mer);
|
||||
}
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
round
|
||||
safe-area-inset-bottom
|
||||
:close-on-click-overlay="false"
|
||||
:style="{height: 'auto'}"
|
||||
:style="{ height: 'auto' }"
|
||||
:visible="isShowPay"
|
||||
@click-close-icon="closePay">
|
||||
<view class="div">
|
||||
<view style="text-align: center">支付方式</view>
|
||||
<nut-cell-group
|
||||
:style="{margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0'}">
|
||||
:style="{ margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0' }">
|
||||
<nut-cell
|
||||
title="微信支付"
|
||||
desc="使用微信快捷支付"
|
||||
@@ -45,11 +45,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, watch} from 'vue';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import { ref, watch } from 'vue';
|
||||
import { IconFont } from '@nutui/icons-vue-taro';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {payOrder} from '@/api/order';
|
||||
import {getPersonalInfo} from '@/api/user';
|
||||
import { payOrder } from '@/api/order';
|
||||
import { getPersonalInfo } from '@/api/user';
|
||||
|
||||
const prop = defineProps({
|
||||
interval: {
|
||||
@@ -75,7 +75,7 @@ const prop = defineProps({
|
||||
|
||||
const emit = defineEmits(['closePay', 'successPay']);
|
||||
|
||||
const info = ref<{integral?: any}>({});
|
||||
const info = ref<{ integral?: any }>({});
|
||||
|
||||
watch(
|
||||
() => prop.isShowPay,
|
||||
@@ -106,7 +106,7 @@ const goPay = async (type: number) => {
|
||||
try {
|
||||
console.log(prop.jfInfo);
|
||||
// 1微信支付 2积分支付 3专属积分兑换
|
||||
const {data} = await payOrder({
|
||||
const { data } = await payOrder({
|
||||
oid: prop.jfInfo.oid,
|
||||
OrderType: prop.OrderType,
|
||||
PayType: type,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const isShow = ref(false);
|
||||
|
||||
@@ -108,11 +108,11 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {reactive} from 'vue';
|
||||
import { reactive } from 'vue';
|
||||
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;
|
||||
}>();
|
||||
|
||||
@@ -143,7 +143,7 @@ function onEditorReady() {
|
||||
}
|
||||
|
||||
// 失去焦点时,获取富文本的内容
|
||||
function getCtx(e: {detail: {html: any}}) {
|
||||
function getCtx(e: { detail: { html: any } }) {
|
||||
data.richText = e.detail.html;
|
||||
emits('input', e.detail.html);
|
||||
}
|
||||
@@ -159,15 +159,15 @@ function redo() {
|
||||
}
|
||||
|
||||
//修改样式
|
||||
function format(e: {target: {dataset: {name: any; value: any}}}) {
|
||||
function format(e: { target: { dataset: { name: any; value: any } } }) {
|
||||
// console.log("format", e.target.dataset);
|
||||
let {name, value} = e.target.dataset;
|
||||
let { name, value } = e.target.dataset;
|
||||
if (!name) return;
|
||||
data.editorCtx.format(name, value);
|
||||
}
|
||||
|
||||
//通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式
|
||||
function onStatusChange(e: {detail: any}) {
|
||||
function onStatusChange(e: { detail: any }) {
|
||||
data.formats = e.detail;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ function insertImage() {
|
||||
Taro.uploadFile({
|
||||
url: `${BASE_URL}/upload`,
|
||||
name: 'file',
|
||||
header: {token: Taro.getStorageSync('token')},
|
||||
header: { token: Taro.getStorageSync('token') },
|
||||
filePath: res.tempFilePaths[0],
|
||||
success: res => {
|
||||
console.log(res);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="flex justify-center" v-if="storeList.length > 0">
|
||||
<view v-if="storeList.length > 0">
|
||||
<view
|
||||
class="bg-white rounded-[15px] mt-3 p-2 w-[95%] flex items-center"
|
||||
v-for="(item, index) in storeList"
|
||||
@@ -15,6 +15,7 @@
|
||||
}}</view>
|
||||
<nut-rate
|
||||
spacing="1"
|
||||
disabled
|
||||
active-color="rgba(252, 207, 10, 1)"
|
||||
v-model="item.rate" />
|
||||
<view class="text-[#9E9E9E] text-[25px]">销量:10000</view>
|
||||
@@ -30,9 +31,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {getStoreList} from '@/api/home';
|
||||
import { getStoreList } from '@/api/home';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
const name = defineModel({
|
||||
default: '',
|
||||
});
|
||||
@@ -51,9 +52,10 @@ const getList = async () => {
|
||||
};
|
||||
|
||||
const goDetail = item => {
|
||||
console.log(item);
|
||||
Taro.setStorageSync('mer_info', item);
|
||||
Taro.navigateTo({
|
||||
url: `/pages/mer/mer_detail/index`,
|
||||
url: `/pages/mer/mer_detail/index?bid=${item.bid}`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {BASE_URL} from '@/utils/request';
|
||||
import {computed, ref} from 'vue';
|
||||
import { BASE_URL } from '@/utils/request';
|
||||
import { computed, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import {computed, ref} from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import headImg from '../static/def_avatar.png';
|
||||
import logoImg from '../static/logo.jpg';
|
||||
import {BASE_URL} from '@/utils/request';
|
||||
import {getPhone, login} from '@/api/user';
|
||||
import { BASE_URL } from '@/utils/request';
|
||||
import { getPhone, login } from '@/api/user';
|
||||
|
||||
const props = defineProps({
|
||||
isShow: {
|
||||
@@ -36,7 +36,7 @@ const closeAttr = () => {
|
||||
};
|
||||
|
||||
const onChooseAvatar = e => {
|
||||
const {avatarUrl} = e.detail;
|
||||
const { avatarUrl } = e.detail;
|
||||
Taro.uploadFile({
|
||||
url: `${BASE_URL}/upload`,
|
||||
filePath: avatarUrl,
|
||||
@@ -57,7 +57,7 @@ const getPhoneNumber = async (e: any) => {
|
||||
title: '授权手机号中',
|
||||
mask: true,
|
||||
});
|
||||
const {code} = e.detail;
|
||||
const { code } = e.detail;
|
||||
const res = await getPhone({
|
||||
code: code,
|
||||
});
|
||||
@@ -112,7 +112,7 @@ const formSubmit = async (e: any) => {
|
||||
position="bottom"
|
||||
safe-area-inset-bottom
|
||||
closeable
|
||||
:style="{padding: '20px 10px'}"
|
||||
:style="{ padding: '20px 10px' }"
|
||||
v-model:visible="show"
|
||||
@close="closeAttr"
|
||||
:close-on-click-overlay="false">
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
// 用于配置项目的一些常量,如接口地址、websocket地址等
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
export const app = {
|
||||
API_URL: () => `${process.env.TARO_APP_HALL_API}`,
|
||||
API_WS: () =>
|
||||
`${process.env.TARO_APP_WS}?uid=${Taro.getStorageSync('uid')}&game_id=${
|
||||
Taro.getStorageSync('gameItem').ID
|
||||
}`,
|
||||
};
|
||||
@@ -62,11 +62,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {Ref, ref} from 'vue';
|
||||
import { Ref, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Cart from '../../../../components/Cart.vue';
|
||||
import {Cart2} from '@nutui/icons-vue-taro';
|
||||
import {getGoodList, getMerCategory} from '../../../../api/goods';
|
||||
import { Cart2 } from '@nutui/icons-vue-taro';
|
||||
import { getGoodList, getMerCategory } from '../../../../api/goods';
|
||||
|
||||
interface goodList {
|
||||
ID: number;
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import BackComponent from '../../../../components/Back.vue';
|
||||
import {checkPhone} from '../../../../api/admin';
|
||||
import { checkPhone } from '../../../../api/admin';
|
||||
|
||||
const formVal = ref({
|
||||
seat: '',
|
||||
@@ -64,7 +64,7 @@ const formVal = ref({
|
||||
|
||||
const visible = ref(false);
|
||||
|
||||
const formSubmit = async ({detail}: any) => {
|
||||
const formSubmit = async ({ detail }: any) => {
|
||||
if (!detail.value.seat)
|
||||
return Taro.showToast({
|
||||
title: '请填写台号',
|
||||
@@ -80,7 +80,7 @@ const formSubmit = async ({detail}: any) => {
|
||||
icon: 'none',
|
||||
});
|
||||
try {
|
||||
await checkPhone({phone: detail.value.phone});
|
||||
await checkPhone({ phone: detail.value.phone });
|
||||
const user_info = await Taro.getStorageSync('userInfo');
|
||||
Taro.navigateTo({
|
||||
url: `/pages/admin/add_order/add_menu/index?type=1&bid=${user_info.data.bid}&seat=${formVal.value.seat}&phone=${formVal.value.phone}¬es=${formVal.value.notes}`,
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
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-repeat: no-repeat;
|
||||
|
||||
|
||||
@@ -78,8 +78,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {onMounted, ref} from 'vue';
|
||||
import {cancelAfterOrder, confirmAfterOrder, editAfterOrder} from '@/api/admin';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import {
|
||||
cancelAfterOrder,
|
||||
confirmAfterOrder,
|
||||
editAfterOrder,
|
||||
} from '@/api/admin';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const props = defineProps({
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Footer from './components/Footer.vue';
|
||||
import {getAfterOrderList} from '@/api/admin';
|
||||
import { getAfterOrderList } from '@/api/admin';
|
||||
|
||||
const tabsIndex = ref(0);
|
||||
|
||||
@@ -108,7 +108,7 @@ const get_list = async () => {
|
||||
title: '加载中',
|
||||
});
|
||||
const user_info = await Taro.getStorageSync('userInfo');
|
||||
const {data: res} = await getAfterOrderList({
|
||||
const { data: res } = await getAfterOrderList({
|
||||
bid: user_info.data.bid,
|
||||
status: tabsIndex.value,
|
||||
});
|
||||
|
||||
@@ -57,9 +57,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getAfterOrder, createPayQr} from '@/api/admin';
|
||||
import { getAfterOrder, createPayQr } from '@/api/admin';
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
@@ -71,11 +71,11 @@ Taro.useLoad((e: any) => {
|
||||
get_data(e);
|
||||
});
|
||||
|
||||
const get_data = async ({bid, oid}) => {
|
||||
const get_data = async ({ bid, oid }) => {
|
||||
Taro.showLoading({
|
||||
title: '加载中',
|
||||
});
|
||||
const res = await getAfterOrder({bid, oid});
|
||||
const res = await getAfterOrder({ bid, oid });
|
||||
data.value = res.data.data;
|
||||
Taro.hideLoading();
|
||||
};
|
||||
|
||||
@@ -79,10 +79,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Footer from '../components/Footer.vue';
|
||||
import {getAfterOrder} from '@/api/admin';
|
||||
import { getAfterOrder } from '@/api/admin';
|
||||
// import BackComponent from "../../../../../components/Back.vue";
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {onUnmounted, ref} from 'vue';
|
||||
import { onUnmounted, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getAfterOrder} from '@/api/admin';
|
||||
import { getAfterOrder } from '@/api/admin';
|
||||
|
||||
const time_id = ref();
|
||||
|
||||
@@ -25,7 +25,7 @@ Taro.useLoad(e => {
|
||||
info.value = e;
|
||||
dataUrl.value = Taro.getStorageSync('pay_code');
|
||||
time_id.value = setInterval(async () => {
|
||||
const {data} = await getAfterOrder({
|
||||
const { data } = await getAfterOrder({
|
||||
bid: info.value.bid,
|
||||
oid: info.value.oid,
|
||||
});
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const info = ref<any>({});
|
||||
|
||||
|
||||
@@ -116,10 +116,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {h, ref} from 'vue';
|
||||
import { h, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {TriangleDown} from '@nutui/icons-vue-taro';
|
||||
import {orderStatistics} from '../../../api/admin';
|
||||
import { TriangleDown } from '@nutui/icons-vue-taro';
|
||||
import { orderStatistics } from '../../../api/admin';
|
||||
|
||||
Taro.useLoad(() => {
|
||||
getData();
|
||||
|
||||
@@ -86,9 +86,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getActiveOrderList} from '../../../../api/admin';
|
||||
import { getActiveOrderList } from '../../../../api/admin';
|
||||
|
||||
const opt = ref([
|
||||
{
|
||||
|
||||
@@ -116,9 +116,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, computed, h} from 'vue';
|
||||
import { ref, computed, h } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {growthRate} from '../../../api/admin';
|
||||
import { growthRate } from '../../../api/admin';
|
||||
import dayjs from 'dayjs';
|
||||
import uCharts from '../../../utils/js_sdk/u-charts.min.js';
|
||||
|
||||
|
||||
@@ -4,14 +4,86 @@
|
||||
<image
|
||||
class="image"
|
||||
@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>
|
||||
<view class="bg-white p-2">
|
||||
<view class="mt-2 text-center text-[#7A7A7A]">最近核销记录</view>
|
||||
<view v-if="list.length > 0">
|
||||
<view
|
||||
class="order-card"
|
||||
v-for="(item, index) in list"
|
||||
:key="index"
|
||||
@click="toDetailPage(item)">
|
||||
<view class="top">
|
||||
<view class="text-[#9C9C9C] text-[25px]"
|
||||
>订单号:{{ item.oid }}</view
|
||||
>
|
||||
<view
|
||||
:style="{
|
||||
color:
|
||||
item.status === 0
|
||||
? '#FF850A'
|
||||
: item.status === 1
|
||||
? '#F83D3D'
|
||||
: item.status === 2
|
||||
? '#333333'
|
||||
: '#9C9C9C',
|
||||
}"
|
||||
>{{
|
||||
item.status === 0
|
||||
? '待付款'
|
||||
: item.status === 1
|
||||
? '待使用'
|
||||
: item.status === 2
|
||||
? '已使用'
|
||||
: '已失效'
|
||||
}}
|
||||
</view>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
<view class="center" v-for="(itm, idx) in item.OrderGoods" :key="idx">
|
||||
<view class="top">
|
||||
<image class="mr-10" :src="itm.Goods.cover" />
|
||||
<view class="flex-1">
|
||||
<view class="title">{{ itm.Goods?.name }}</view>
|
||||
<view class="text-[#F83D3D] mt-5">
|
||||
<view
|
||||
>{{ itm.pay_price }}元
|
||||
<text v-if="itm.pay_integral > 0"
|
||||
>+{{ itm.pay_integral }}积分</text
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view>x{{ itm.number }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="flex justify-between items-center mt-2 mb-2 text-[25px]"
|
||||
v-if="item.status !== 0">
|
||||
<text class="text-[#9C9C9C]">共{{ item.count }}件商品</text>
|
||||
<text class="text-[26px] flex-1 text-right"
|
||||
>{{ item.status !== 0 ? '实' : '应' }}付款:
|
||||
{{ item.discount_price }} (元)
|
||||
<text v-if="item.exchange > 0"
|
||||
>积分抵扣: {{ item.exchange }}</text
|
||||
>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<nut-empty v-else description="暂无数据"></nut-empty>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import { getActiveOrderList } from '@/api/admin';
|
||||
import { ref } from 'vue';
|
||||
|
||||
// url参数转对象
|
||||
// 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>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
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-size: 100% 25%;
|
||||
}
|
||||
@@ -62,7 +164,7 @@ page {
|
||||
height: 300px;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
margin: 300px auto;
|
||||
margin: 300px auto 50px auto;
|
||||
border-radius: 33px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -75,4 +177,62 @@ page {
|
||||
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>
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getActiveVerifyList, activeOrderVerify} from '@/api/admin';
|
||||
import {ref} from 'vue';
|
||||
import { getActiveVerifyList, activeOrderVerify } from '@/api/admin';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const opt = ref<any>({});
|
||||
|
||||
@@ -102,7 +102,7 @@ const subVerify = async () => {
|
||||
// icon: 'none',
|
||||
//});
|
||||
Taro.showModal({
|
||||
title: '核销提示',
|
||||
title: '核销成功',
|
||||
content: res.msg,
|
||||
success: () => {
|
||||
setTimeout(() => {
|
||||
@@ -129,6 +129,8 @@ const getPayType = (type: number) => {
|
||||
return '平台积分支付';
|
||||
case 3:
|
||||
return '智多鑫积分支付';
|
||||
case 3:
|
||||
return '渔乐潮玩支付';
|
||||
default:
|
||||
return '未知';
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
.card {
|
||||
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%;
|
||||
width: 95%;
|
||||
height: 250px;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getWithdrawList, addWithdraw} from '@/api/admin';
|
||||
import { getWithdrawList, addWithdraw } from '@/api/admin';
|
||||
|
||||
const user_info = ref<any>({});
|
||||
|
||||
@@ -57,7 +57,7 @@ const getData = async () => {
|
||||
|
||||
const add = async () => {
|
||||
try {
|
||||
formRef.value?.validate().then(async ({valid}) => {
|
||||
formRef.value?.validate().then(async ({ valid }) => {
|
||||
if (valid) {
|
||||
const res = await addWithdraw({
|
||||
Bid: user_info.value.data.bid,
|
||||
@@ -156,7 +156,7 @@ Taro.useReachBottom(() => {
|
||||
<!-- <view class="flex items-center" @click="visible1 = true">
|
||||
<image
|
||||
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> -->
|
||||
</view>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getAllMerCategory} from '@/api/goods';
|
||||
import { getAllMerCategory } from '@/api/goods';
|
||||
|
||||
const list = ref<
|
||||
{
|
||||
|
||||
@@ -80,10 +80,10 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {nextTick, ref} from 'vue';
|
||||
import { nextTick, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {addCart, getAllCart} from '@/api/cart';
|
||||
import {createActiveOrder} from '@/api/goods';
|
||||
import { addCart, getAllCart } from '@/api/cart';
|
||||
import { createActiveOrder } from '@/api/goods';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
|
||||
interface CardList {
|
||||
@@ -206,7 +206,7 @@ const sub = async () => {
|
||||
});
|
||||
return;
|
||||
}
|
||||
const {data: res} = await createActiveOrder({
|
||||
const { data: res } = await createActiveOrder({
|
||||
Bid: arr.map((item: any) => item.StoreBid),
|
||||
});
|
||||
if (res.oid) {
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {getCategoryList, getCategoryGoods} from '@/api/goods';
|
||||
import { ref } from 'vue';
|
||||
import { getCategoryList, getCategoryGoods } from '@/api/goods';
|
||||
|
||||
const val = ref(0);
|
||||
|
||||
|
||||
@@ -46,11 +46,11 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
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 { 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>({});
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import './index.scss';
|
||||
|
||||
|
||||
@@ -6,22 +6,23 @@
|
||||
class="card_item"
|
||||
v-for="item in list"
|
||||
:key="item.ID"
|
||||
:style="{backgroundImage: `url(${item.cover})`}"
|
||||
:style="{ backgroundImage: `url(${item.cover})` }"
|
||||
@click="toPage(item)"></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getPersonalInfo} from '@/api/user';
|
||||
import { getPersonalInfo } from '@/api/user';
|
||||
import { getGameList } from '@/api/game';
|
||||
|
||||
const list = ref<any[]>([]);
|
||||
|
||||
Taro.useDidShow(() => {
|
||||
const token = Taro.getStorageSync('token');
|
||||
// url.value = 'http://huakk.jdt168.com/#/pages/index/index';
|
||||
// url.value = 'https://huakk.jdt168.com/#/pages/index/index';
|
||||
if (token) {
|
||||
// url.value = `${process.env.TARO_APP_GAME}${Taro.getStorageSync('token')}`;
|
||||
getUserInfo();
|
||||
@@ -55,14 +56,8 @@ const getUserInfo = async () => {
|
||||
|
||||
const getList = async () => {
|
||||
// console.log(process.env.TARO_APP_HALL_API)
|
||||
Taro.request({
|
||||
url: `${process.env.TARO_APP_HOME}`,
|
||||
method: 'POST',
|
||||
success: ({data: res}) => {
|
||||
list.value =
|
||||
res.data.data.sort((a: any, b: any) => b.sort - a.sort) || [];
|
||||
},
|
||||
});
|
||||
const res = await getGameList();
|
||||
list.value = res.data.data.sort((a: any, b: any) => b.sort - a.sort) || [];
|
||||
};
|
||||
|
||||
const toPage = item => {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import {getStorageSync, useDidShow} from '@tarojs/taro';
|
||||
import {WebView} from '@tarojs/components';
|
||||
import { ref } from 'vue';
|
||||
import { getStorageSync, useDidShow } from '@tarojs/taro';
|
||||
import { WebView } from '@tarojs/components';
|
||||
|
||||
const url = ref('');
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view class="app">
|
||||
<view class="head-wrapper" :style="{top: BarHeight + 'px'}">
|
||||
<view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
|
||||
<view class="head-menu">
|
||||
<Left class="iconfont" @click="returns" />
|
||||
<Home class="iconfont" @click="goHome" />
|
||||
@@ -62,13 +62,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {Ref, ref} from 'vue';
|
||||
import { Ref, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {Home, Left} from '@nutui/icons-vue-taro';
|
||||
import {getActiveGoodsDetail, getMerDetail} from '@/api/goods';
|
||||
import { Home, Left } from '@nutui/icons-vue-taro';
|
||||
import { getActiveGoodsDetail, getMerDetail } from '@/api/goods';
|
||||
import Cart from '@/components/Cart.vue';
|
||||
import {Cart2} from '@nutui/icons-vue-taro';
|
||||
import {nextTick} from 'vue';
|
||||
import { Cart2 } from '@nutui/icons-vue-taro';
|
||||
import { nextTick } from 'vue';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight;
|
||||
const BarHeight = ref((statusBarHeight as number) + 7);
|
||||
@@ -105,7 +105,7 @@ Taro.useLoad(async options => {
|
||||
});
|
||||
|
||||
const getMerInfo = async () => {
|
||||
const res = await getMerDetail({bid: bid.value});
|
||||
const res = await getMerDetail({ bid: bid.value });
|
||||
mer_info.value = res.data.data;
|
||||
};
|
||||
|
||||
@@ -117,7 +117,7 @@ Taro.useShareAppMessage(() => ({
|
||||
|
||||
const get_good_detail = async (gid: string) => {
|
||||
try {
|
||||
const res = await getActiveGoodsDetail({gid: gid});
|
||||
const res = await getActiveGoodsDetail({ gid: gid });
|
||||
goodInfo.value = {
|
||||
...res.data.data,
|
||||
// details: res.data.data.details.,
|
||||
|
||||
@@ -48,10 +48,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {Find} from '@nutui/icons-vue-taro';
|
||||
import { Find } from '@nutui/icons-vue-taro';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {calculateDistance} from '@/utils';
|
||||
import {ref} from 'vue';
|
||||
import { calculateDistance } from '@/utils';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const distance = ref('');
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</template>
|
||||
|
||||
<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';
|
||||
|
||||
const toHome = () => {
|
||||
|
||||
@@ -95,10 +95,10 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import {onUnmounted, ref} from 'vue';
|
||||
import {getActiveOrderDetail, getPayList} from '@/api/goods';
|
||||
import {payOrder} from '@/api/order';
|
||||
import { IconFont } from '@nutui/icons-vue-taro';
|
||||
import { onUnmounted, ref } from 'vue';
|
||||
import { getActiveOrderDetail, getPayList } from '@/api/goods';
|
||||
import { payOrder } from '@/api/order';
|
||||
import * as dayjs from 'dayjs';
|
||||
|
||||
const payVal = ref();
|
||||
@@ -114,7 +114,7 @@ const isLoading = ref(false);
|
||||
const opt = ref<any>({});
|
||||
|
||||
Taro.useLoad(e => {
|
||||
const {oid, bid, OrderType} = e;
|
||||
const { oid, bid, OrderType } = e;
|
||||
opt.value = e;
|
||||
get_pay_list();
|
||||
getData(oid, bid, OrderType);
|
||||
@@ -176,7 +176,7 @@ const pay = async () => {
|
||||
if (isLoading.value) return;
|
||||
isLoading.value = true;
|
||||
if (!payVal.value)
|
||||
return Taro.showToast({title: '请选择支付方式', icon: 'none'});
|
||||
return Taro.showToast({ title: '请选择支付方式', icon: 'none' });
|
||||
await confirmPay();
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
@@ -188,23 +188,22 @@ const pay = async () => {
|
||||
|
||||
const confirmPay = async () => {
|
||||
try {
|
||||
const res = await payOrder({
|
||||
const { data: res } = await payOrder({
|
||||
oid: opt.value.oid,
|
||||
OrderType: payVal.value,
|
||||
PayType: payVal.value,
|
||||
});
|
||||
Taro.requestPayment({
|
||||
timeStamp: res.data.data.timeStamp,
|
||||
nonceStr: res.data.data.nonceStr,
|
||||
package: res.data.data.package,
|
||||
signType: res.data.data.signType,
|
||||
paySign: res.data.data.paySign,
|
||||
timeStamp: res.data.timeStamp,
|
||||
nonceStr: res.data.nonceStr,
|
||||
package: res.data.package,
|
||||
signType: res.data.signType,
|
||||
paySign: res.data.paySign,
|
||||
success: function () {
|
||||
Taro.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'success',
|
||||
});
|
||||
isLoading.value = false;
|
||||
},
|
||||
fail: function () {
|
||||
Taro.showToast({
|
||||
@@ -214,11 +213,10 @@ const confirmPay = async () => {
|
||||
},
|
||||
complete: function () {
|
||||
setTimeout(() => {
|
||||
Taro.redirectTo({
|
||||
Taro.reLaunch({
|
||||
url: `/pages/users/order_list/index?type=0`,
|
||||
});
|
||||
}, 2000);
|
||||
// isLoading.value = false;
|
||||
},
|
||||
});
|
||||
} catch (err) {
|
||||
@@ -227,7 +225,7 @@ const confirmPay = async () => {
|
||||
icon: 'none',
|
||||
});
|
||||
} finally {
|
||||
// isLoading.value = false;
|
||||
isLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import {
|
||||
useLoad,
|
||||
useReachBottom,
|
||||
@@ -8,8 +8,8 @@ import {
|
||||
setStorageSync,
|
||||
} from '@tarojs/taro';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
import {getActiveOrderList, deleteActiveOrder} from '@/api/goods';
|
||||
import {getOrderStatistics} from '@/api/order';
|
||||
import { getActiveOrderList, deleteActiveOrder } from '@/api/goods';
|
||||
import { getOrderStatistics } from '@/api/order';
|
||||
|
||||
const tabValue = ref(0);
|
||||
|
||||
@@ -189,7 +189,9 @@ const delOrder = async (oid: string) => {
|
||||
@click="tabChange(item.value)">
|
||||
<view class="text">{{ item.title }}</view>
|
||||
<view>{{ item.num }}</view>
|
||||
<view class="line" :class="{lineColor: item.value === tabValue}"></view>
|
||||
<view
|
||||
class="line"
|
||||
:class="{ lineColor: item.value === tabValue }"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="orderList.length > 0">
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<view class="item">
|
||||
<view @click="hotGoodsDetail">
|
||||
<IconFont
|
||||
name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
|
||||
name="https://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
|
||||
size="40" />
|
||||
<view>我的订单</view>
|
||||
</view>
|
||||
@@ -67,14 +67,14 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {
|
||||
// getActiveGoods,
|
||||
getMerList,
|
||||
} from '../../../api/goods';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import {calculateDistance} from '@/utils';
|
||||
import { IconFont } from '@nutui/icons-vue-taro';
|
||||
import { calculateDistance } from '@/utils';
|
||||
|
||||
// const list = ref<any>([]);
|
||||
|
||||
@@ -129,7 +129,7 @@ const get_mer_list = async () => {
|
||||
const toMerDetails = (item: any) => {
|
||||
Taro.setStorageSync('mer_info', item);
|
||||
Taro.navigateTo({
|
||||
url: `/pages/mer/mer_detail/index`,
|
||||
url: `/pages/mer/mer_detail/index?bid=${item.bid}`,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
877
src/pages/index/components/HomeNew.vue
Normal file
877
src/pages/index/components/HomeNew.vue
Normal file
@@ -0,0 +1,877 @@
|
||||
<template>
|
||||
<view class="home-new">
|
||||
<!-- Header & Search -->
|
||||
<view class="header-fixed">
|
||||
<view :style="{ paddingTop: statusBarHeight + 'px' }"></view>
|
||||
<view class="header-content">
|
||||
<!-- Location -->
|
||||
<view class="location-bar">
|
||||
<view class="location-inner" @click="getUserLocal">
|
||||
<view class="iconfont icon-dizhi location-icon"></view>
|
||||
<text class="location-text">{{ address }}</text>
|
||||
<view class="iconfont icon-xiangxia location-arrow"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Search Bar -->
|
||||
<view class="search-container">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入商家名称搜索"
|
||||
class="search-input"
|
||||
v-model="searchVal" />
|
||||
<view class="search-icon-left">
|
||||
<view class="iconfont icon-sousuo"></view>
|
||||
</view>
|
||||
<view class="search-btn" @click.stop="clickSearch">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Main Content -->
|
||||
<view class="main-content">
|
||||
<!-- Banner / Hero -->
|
||||
<view class="banner-hero">
|
||||
<!-- Background Pattern Decoration -->
|
||||
<view class="banner-decoration banner-decoration-top"></view>
|
||||
<view class="banner-decoration banner-decoration-bottom"></view>
|
||||
|
||||
<view class="banner-inner">
|
||||
<view class="banner-title">
|
||||
玩赚积分<text class="banner-title-yellow">商城</text>
|
||||
</view>
|
||||
<view class="banner-subtitle-wrapper">
|
||||
<view class="banner-divider"></view>
|
||||
<text class="banner-subtitle">积分当钱花 · 兑换无上限</text>
|
||||
<view class="banner-divider"></view>
|
||||
</view>
|
||||
|
||||
<view class="banner-buttons">
|
||||
<view class="banner-btn banner-btn-primary">
|
||||
<text class="banner-btn-icon">💎</text> 积分兑换
|
||||
</view>
|
||||
<view class="banner-btn banner-btn-secondary">同城兑换</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Quick Actions Grid -->
|
||||
<view class="nav-grid-wrapper">
|
||||
<view class="nav-grid">
|
||||
<view
|
||||
class="nav-item"
|
||||
v-for="(item, index) in navigationList"
|
||||
:key="index"
|
||||
@click="toPage(item)">
|
||||
<view class="nav-icon-wrapper">
|
||||
<image :src="item.icon" class="nav-icon" mode="aspectFit" />
|
||||
</view>
|
||||
<text class="nav-label">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Store List -->
|
||||
<view class="store-section">
|
||||
<view class="store-header">
|
||||
<view class="store-header-line"></view>
|
||||
附近商家
|
||||
</view>
|
||||
|
||||
<view class="store-list">
|
||||
<view
|
||||
class="store-item"
|
||||
v-for="(item, index) in merList"
|
||||
:key="index"
|
||||
@click="toMerDetails(item)">
|
||||
<view class="store-image-wrapper">
|
||||
<image
|
||||
:src="item.head_photo"
|
||||
class="store-image"
|
||||
mode="aspectFill" />
|
||||
<!-- <view class="store-badge" v-if="index < 3">严选</view> -->
|
||||
</view>
|
||||
<view class="store-info">
|
||||
<view class="store-name">{{ item.name }}</view>
|
||||
<view class="store-rating">
|
||||
<view class="rating-stars">
|
||||
<text class="stars-text">★★★★★</text>
|
||||
<text class="rating-score">5.0分</text>
|
||||
</view>
|
||||
<text class="rating-divider">|</text>
|
||||
<text class="rating-sales">月售 1000+</text>
|
||||
</view>
|
||||
<view class="store-distance">
|
||||
<text class="distance-placeholder">.</text>
|
||||
<text class="distance-text">
|
||||
距离我{{
|
||||
calculateDistance(
|
||||
userLocalNum.t,
|
||||
userLocalNum.l,
|
||||
Number(item.lat),
|
||||
Number(item.lon),
|
||||
)
|
||||
}}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Empty State -->
|
||||
<view v-if="merList.length === 0" class="store-empty">
|
||||
暂无附近商家
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<Popup :imgArr="imgList" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import { ref } from 'vue';
|
||||
import { getHomeList } from '@/api/home';
|
||||
import { getMerList } from '@/api/goods';
|
||||
import { bindParent } from '@/api/user';
|
||||
import { calculateDistance } from '@/utils';
|
||||
import Popup from '@/components/Popup.vue';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync().statusBarHeight || 20;
|
||||
|
||||
const address = ref('获取位置中...');
|
||||
const searchVal = ref('');
|
||||
const navigationList = ref<any[]>([]);
|
||||
const merList = ref<any[]>([]);
|
||||
const pageVal = ref({
|
||||
page: 1,
|
||||
total: 0,
|
||||
});
|
||||
const userLocalNum = ref({
|
||||
l: 0,
|
||||
t: 0,
|
||||
});
|
||||
|
||||
const imgList = ref([require('../../../static/zhenggai.png')]);
|
||||
|
||||
// Lifecycle
|
||||
Taro.useLoad(() => {
|
||||
getPrivacy();
|
||||
getUserLocal();
|
||||
getNavLists();
|
||||
checkBindParent();
|
||||
});
|
||||
|
||||
Taro.useShareAppMessage(() => ({
|
||||
title: '捷兑通',
|
||||
path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`,
|
||||
imageUrl: 'https://upload.jdt168.com/1714375021923881119_Share.jpg',
|
||||
}));
|
||||
|
||||
Taro.useReachBottom(() => {
|
||||
if (merList.value.length >= pageVal.value.total) {
|
||||
if (pageVal.value.total > 0) {
|
||||
Taro.showToast({ title: '没有更多了', icon: 'none' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
pageVal.value.page += 1;
|
||||
fetchMerList();
|
||||
});
|
||||
|
||||
// Methods
|
||||
const checkBindParent = async () => {
|
||||
if (Taro.getStorageSync('token') && Taro.getStorageSync('bind_id')) {
|
||||
try {
|
||||
const res: any = await bindParent({
|
||||
uid: Taro.getStorageSync('bind_id'),
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
});
|
||||
Taro.removeStorageSync('bind_id');
|
||||
} catch (error) {
|
||||
Taro.removeStorageSync('bind_id');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getPrivacy = () => {
|
||||
Taro.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
Taro.requirePrivacyAuthorize({
|
||||
success: () => console.log('用户同意授权'),
|
||||
fail: () => {
|
||||
console.log('用户拒绝授权');
|
||||
// Taro.exitMiniProgram();
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const getUserLocal = () => {
|
||||
Taro.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
userLocalNum.value.l = res.longitude;
|
||||
userLocalNum.value.t = res.latitude;
|
||||
fetchAddress(res.latitude, res.longitude);
|
||||
// Refresh list with location
|
||||
pageVal.value.page = 1;
|
||||
merList.value = [];
|
||||
fetchMerList();
|
||||
},
|
||||
fail: () => {
|
||||
address.value = '未能获取定位';
|
||||
// Load list anyway
|
||||
fetchMerList();
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const fetchAddress = (lat, lon) => {
|
||||
Taro.request({
|
||||
url: `https://api.tianditu.gov.cn/geocoder?postStr={'lon':${lon},'lat':${lat},'ver':1}&type=geocode&tk=42db4f3dfd1a18d31e73ee90aa2ce054`,
|
||||
method: 'GET',
|
||||
success: res => {
|
||||
const { msg, result } = res.data;
|
||||
if (msg === 'ok') {
|
||||
address.value = `${result.addressComponent.county}${result.addressComponent.town}${result.addressComponent.address}`;
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const getNavLists = async () => {
|
||||
const defaults = [
|
||||
{
|
||||
type: 1,
|
||||
icon: '//p0.meituan.net/csc/f33ad2443a67e9f3474a1d5fd9d529db7504.png',
|
||||
url: '/pages/users/settled_mer/index',
|
||||
name: '商户入驻',
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
icon: '//p0.meituan.net/csc/0403cf37dd14a6b44b22ffccaa2878f95703.png',
|
||||
url: '/pages/allClassList/index',
|
||||
name: '全部服务',
|
||||
},
|
||||
];
|
||||
|
||||
try {
|
||||
const res = await getHomeList();
|
||||
const apiList = res.data.data.map(item => ({
|
||||
ID: item.ID,
|
||||
type: 2,
|
||||
icon: item.icon,
|
||||
url: item.url,
|
||||
name: item.name,
|
||||
}));
|
||||
navigationList.value = [...apiList, ...defaults];
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
navigationList.value = defaults;
|
||||
}
|
||||
};
|
||||
|
||||
const fetchMerList = async () => {
|
||||
try {
|
||||
const res = await getMerList({
|
||||
PageNum: pageVal.value.page,
|
||||
PageSize: 10,
|
||||
// class_id: 0
|
||||
});
|
||||
pageVal.value.total = res.data.total;
|
||||
if (res.data.data) {
|
||||
merList.value.push(...res.data.data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
};
|
||||
|
||||
const clickSearch = () => {
|
||||
if (!searchVal.value)
|
||||
return Taro.showToast({ title: '请输入商家名称', icon: 'none' });
|
||||
Taro.navigateTo({ url: `/pages/search/index?name=${searchVal.value}` });
|
||||
searchVal.value = '';
|
||||
};
|
||||
|
||||
const toPage = item => {
|
||||
item.type !== 1
|
||||
? Taro.navigateTo({
|
||||
url: `/pages/search/index?id=${item.ID}&name=${item.name}`,
|
||||
})
|
||||
: Taro.navigateTo({ url: item.url });
|
||||
};
|
||||
|
||||
const toMerDetails = item => {
|
||||
Taro.navigateTo({ url: `/pages/mer/mer_detail/index?bid=${item.bid}` });
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 所有新版样式包裹在 .home-new 作用域下 */
|
||||
.home-new {
|
||||
background-color: #f5f6f7;
|
||||
min-height: 100vh;
|
||||
/* Header Styles */
|
||||
.header-fixed {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
background: linear-gradient(180deg, #eff6ff 0%, #f5f6f7 100%);
|
||||
}
|
||||
|
||||
.header-content {
|
||||
padding: 10px 20px 10px;
|
||||
}
|
||||
|
||||
.location-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
font-size: 22px;
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.location-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
max-width: 90%;
|
||||
background-color: rgba(255, 255, 255, 0.6);
|
||||
padding: 8px 16px;
|
||||
border-radius: 50px;
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.location-icon {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
margin-right: 8px;
|
||||
color: #374151;
|
||||
}
|
||||
|
||||
.location-text {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.location-arrow {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-left: 8px;
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
.search-container {
|
||||
position: relative;
|
||||
// margin: 10px auto;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.search-input {
|
||||
height: 70px;
|
||||
background-color: #ffffff;
|
||||
border: none;
|
||||
border-radius: 20px;
|
||||
padding: 10px 20px 10px 70px;
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.search-icon-left {
|
||||
position: absolute;
|
||||
left: 20px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: #9ca3af;
|
||||
font-size: 30px;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: linear-gradient(90deg, #fa2c19 0%, #ff5d45 100%);
|
||||
color: #ffffff;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
padding: 12px 30px;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 6px rgba(250, 44, 25, 0.2);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
/* Main Content */
|
||||
.main-content {
|
||||
padding: 0 20px 180px;
|
||||
}
|
||||
|
||||
/* Banner Hero */
|
||||
.banner-hero {
|
||||
position: relative;
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
|
||||
height: 280px;
|
||||
margin-top: 20px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.banner-decoration {
|
||||
position: absolute;
|
||||
border-radius: 50%;
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
.banner-decoration-top {
|
||||
top: -80px;
|
||||
right: -80px;
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.banner-decoration-bottom {
|
||||
bottom: -60px;
|
||||
left: -60px;
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
background-color: rgba(147, 197, 253, 0.3);
|
||||
}
|
||||
|
||||
.banner-inner {
|
||||
position: relative;
|
||||
// height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 30px;
|
||||
}
|
||||
|
||||
.banner-title {
|
||||
font-size: 60px;
|
||||
font-weight: 900;
|
||||
color: #ffffff;
|
||||
letter-spacing: 4px;
|
||||
font-style: italic;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.banner-title-yellow {
|
||||
color: #fde047;
|
||||
}
|
||||
|
||||
.banner-subtitle-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-bottom: 30px;
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
.banner-divider {
|
||||
width: 60px;
|
||||
height: 1px;
|
||||
background-color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
|
||||
.banner-subtitle {
|
||||
color: #ffffff;
|
||||
font-size: 22px;
|
||||
font-weight: 500;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.banner-buttons {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
max-width: 600px;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.banner-btn {
|
||||
flex: 1;
|
||||
border-radius: 50px;
|
||||
padding: 15px 0;
|
||||
font-size: 26px;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
pointer-events: none;
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
.banner-btn-primary {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
color: #ffffff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.banner-btn-secondary {
|
||||
background-color: rgba(255, 255, 255, 0.1);
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.banner-btn-icon {
|
||||
font-size: 36px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
/* Navigation Grid */
|
||||
.nav-grid-wrapper {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20px;
|
||||
padding: 30px;
|
||||
margin-top: 20px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.nav-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.nav-icon-wrapper {
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
border-radius: 50%;
|
||||
background-color: #f9fafb;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.nav-icon {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
.nav-label {
|
||||
font-size: 22px;
|
||||
font-weight: 500;
|
||||
color: #374151;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Featured Section */
|
||||
.featured-section {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
height: 280px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.featured-card {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.featured-card-left {
|
||||
flex: 1.2;
|
||||
background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%);
|
||||
border: 1px solid #fed7aa;
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.featured-content {
|
||||
position: relative;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.featured-title {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.featured-desc {
|
||||
font-size: 20px;
|
||||
color: #f97316;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.featured-btn {
|
||||
margin-top: 20px;
|
||||
background: linear-gradient(90deg, #f97316 0%, #ef4444 100%);
|
||||
color: #ffffff;
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
padding: 10px 20px;
|
||||
border-radius: 50px;
|
||||
border: none;
|
||||
display: inline-block;
|
||||
line-height: 1.5;
|
||||
box-shadow: 0 2px 4px rgba(249, 115, 22, 0.3);
|
||||
}
|
||||
|
||||
.featured-bg {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
opacity: 0.1;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.featured-svg {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
color: #ea580c;
|
||||
transform: rotate(-12deg) translate(30px, 30px);
|
||||
}
|
||||
|
||||
.featured-card-right {
|
||||
flex: 1;
|
||||
border: 1px solid #e5e7eb;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.featured-image {
|
||||
height: 67%;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.featured-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.featured-overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(
|
||||
180deg,
|
||||
transparent 0%,
|
||||
rgba(0, 0, 0, 0.6) 100%
|
||||
);
|
||||
padding: 10px 15px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.featured-overlay-title {
|
||||
color: #ffffff;
|
||||
font-weight: bold;
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.featured-footer {
|
||||
height: 33%;
|
||||
padding: 0 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.featured-footer-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.featured-footer-title {
|
||||
font-size: 22px;
|
||||
font-weight: bold;
|
||||
color: #1f2937;
|
||||
}
|
||||
|
||||
.featured-footer-arrow {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
border-radius: 50%;
|
||||
background-color: #eff6ff;
|
||||
color: #3b82f6;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
/* Store Section */
|
||||
.store-section {
|
||||
padding-bottom: 20px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.store-header {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
color: #1f2937;
|
||||
padding: 0 8px 15px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.store-header-line {
|
||||
width: 6px;
|
||||
height: 30px;
|
||||
background-color: #fa2c19;
|
||||
border-radius: 50px;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.store-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.store-item {
|
||||
background-color: #ffffff;
|
||||
border-radius: 20px;
|
||||
padding: 15px;
|
||||
display: flex;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
|
||||
border: 1px solid #f9fafb;
|
||||
}
|
||||
|
||||
.store-image-wrapper {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
flex-shrink: 0;
|
||||
background-color: #f3f4f6;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.store-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.store-badge {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: #eab308;
|
||||
color: #ffffff;
|
||||
font-size: 20px;
|
||||
padding: 4px 12px;
|
||||
border-bottom-right-radius: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.store-info {
|
||||
margin-left: 20px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 180px;
|
||||
justify-content: space-between;
|
||||
padding: 8px 0;
|
||||
}
|
||||
|
||||
.store-name {
|
||||
font-weight: bold;
|
||||
color: #1f2937;
|
||||
font-size: 30px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.store-rating {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 22px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.rating-stars {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.stars-text {
|
||||
color: #fbbf24;
|
||||
font-size: 20px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.rating-score {
|
||||
color: #fa2c19;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.rating-divider {
|
||||
color: #d1d5db;
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.rating-sales {
|
||||
color: #6b7280;
|
||||
}
|
||||
|
||||
.store-distance {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.distance-placeholder {
|
||||
font-size: 22px;
|
||||
color: transparent;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.distance-text {
|
||||
font-size: 22px;
|
||||
color: #9ca3af;
|
||||
}
|
||||
|
||||
.store-empty {
|
||||
text-align: center;
|
||||
padding: 80px 0;
|
||||
color: #9ca3af;
|
||||
font-size: 26px;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: inherit;
|
||||
}
|
||||
} /* .home-new 作用域结束 */
|
||||
</style>
|
||||
366
src/pages/index/components/HomeOld.vue
Normal file
366
src/pages/index/components/HomeOld.vue
Normal file
@@ -0,0 +1,366 @@
|
||||
<template>
|
||||
<view class="home-old">
|
||||
<view :style="{ marginTop: BarHeight + 'px' }"></view>
|
||||
<view class="local">
|
||||
<view class="iconfont icon-dizhi" style="font-size: 20px"></view>
|
||||
<text class="text-[28px]">{{ address }}</text>
|
||||
</view>
|
||||
<view class="search">
|
||||
<view
|
||||
class="iconfont icon-sousuo"
|
||||
style="color: #8f8f8f; margin-right: 8px"></view>
|
||||
<input placeholder="请输入商家名称搜索" v-model="searchVal" />
|
||||
<view class="search-btn" @click="clickSearch">搜索</view>
|
||||
</view>
|
||||
<view class="banner">
|
||||
<!-- <view
|
||||
class="title"
|
||||
:style="{
|
||||
backgroundImage: `url('${titleImgPath}')`,
|
||||
}"></view> -->
|
||||
<image class="title" :src="titleImgPath"></image>
|
||||
<view class="jf-btn" hover-class="none"></view>
|
||||
<!-- <view class="footer">
|
||||
<navigator
|
||||
hover-class="none"
|
||||
class="btn-1"
|
||||
url="/pages/fastBuy/index?type=1"></navigator>
|
||||
<navigator
|
||||
hover-class="none"
|
||||
openType="switchTab"
|
||||
url="/pages/game/gamehome/index"
|
||||
class="btn-2"></navigator>
|
||||
<navigator
|
||||
hover-class="none"
|
||||
class="btn-3"
|
||||
url="/pages/fastBuy/index?type=2"></navigator>
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="navigation">
|
||||
<view
|
||||
class="item"
|
||||
v-for="(item, index) in navigationList"
|
||||
:key="index"
|
||||
@click="toPage(item)">
|
||||
<image class="icon" :src="item.icon" />
|
||||
<view class="text">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <navigator
|
||||
class="ad"
|
||||
url="/pages/marketing/yq/index"
|
||||
open-type="navigate"
|
||||
hover-class="none">
|
||||
</navigator> -->
|
||||
<MerList :get-user-location="getUserLocal" />
|
||||
<Popup :imgArr="imgList" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import { ref } from 'vue';
|
||||
import { getHomeList } from '@/api/home';
|
||||
import { bindParent } from '@/api/user';
|
||||
import MerList from '@/components/MerList.vue';
|
||||
import Popup from '@/components/Popup.vue';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync().statusBarHeight;
|
||||
const BarHeight = ref((statusBarHeight as number) + 7);
|
||||
|
||||
const titleImgPath = require(process.env.TARO_APP_TITLE_IMG as string);
|
||||
|
||||
interface navigationType {
|
||||
ID?: number;
|
||||
type: number;
|
||||
icon: string;
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
const navigationList = ref<Array<navigationType>>([]);
|
||||
|
||||
const imgList = ref([
|
||||
// require('../../static/popTip-1.png'),
|
||||
// require('../../static/popTip.png'),
|
||||
require('../../../static/zhenggai.png'),
|
||||
]);
|
||||
|
||||
Taro.useShareAppMessage(() => ({
|
||||
title: '捷兑通',
|
||||
path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`,
|
||||
imageUrl: 'https://upload.jdt168.com/1714375021923881119_Share.jpg',
|
||||
}));
|
||||
|
||||
const searchVal = ref('');
|
||||
|
||||
const clickSearch = () => {
|
||||
if (!searchVal.value)
|
||||
return Taro.showToast({
|
||||
title: '请输入商家名称再搜索',
|
||||
icon: 'none',
|
||||
});
|
||||
Taro.navigateTo({
|
||||
url: `/pages/search/index?name=${searchVal.value}`,
|
||||
});
|
||||
searchVal.value = '';
|
||||
};
|
||||
|
||||
Taro.useLoad(() => {
|
||||
Taro.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
Taro.requirePrivacyAuthorize({
|
||||
success: () => {
|
||||
console.log('用户同意授权');
|
||||
},
|
||||
fail: () => {
|
||||
console.log('用户拒绝授权');
|
||||
Taro.exitMiniProgram();
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
getNavLists();
|
||||
getUserLocal();
|
||||
checkBindParent();
|
||||
});
|
||||
|
||||
const checkBindParent = async () => {
|
||||
if (Taro.getStorageSync('token') && Taro.getStorageSync('bind_id')) {
|
||||
try {
|
||||
const res: any = await bindParent({
|
||||
uid: Taro.getStorageSync('bind_id'),
|
||||
});
|
||||
Taro.showToast({
|
||||
title: res.msg,
|
||||
});
|
||||
Taro.removeStorageSync('bind_id');
|
||||
} catch (error) {
|
||||
Taro.removeStorageSync('bind_id');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const address = ref('获取位置中......');
|
||||
|
||||
const getUserLocal = async () => {
|
||||
Taro.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
// Taro.request({
|
||||
// url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=4EJBZ-TZXCV-IHUPX-UMI2L-MK3N3-37FSQ&get_poi=1`,
|
||||
// method: 'GET',
|
||||
// success: res => {
|
||||
// switch (res.data.status) {
|
||||
// case 121:
|
||||
// Taro.showToast({
|
||||
// title: res.data.message,
|
||||
// icon: 'none',
|
||||
// });
|
||||
// break;
|
||||
// default:
|
||||
// const data = res.data.result.address_component;
|
||||
// address.value = `${data.district}${data.street_number}`;
|
||||
// break;
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
Taro.request({
|
||||
url: `https://api.tianditu.gov.cn/geocoder?postStr={'lon':${res.longitude},'lat':${res.latitude},'ver':1}&type=geocode&tk=42db4f3dfd1a18d31e73ee90aa2ce054`,
|
||||
method: 'GET',
|
||||
success: res => {
|
||||
const { msg, result } = res.data;
|
||||
if (msg === 'ok') {
|
||||
address.value = `${result.addressComponent.county}${result.addressComponent.town}${result.addressComponent.address}`;
|
||||
} else {
|
||||
Taro.showToast({
|
||||
title: msg,
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const getNavLists = async () => {
|
||||
navigationList.value = [
|
||||
// {
|
||||
// type: 1,
|
||||
// icon: '//p0.meituan.net/csc/5c770748f0028c63741c5ec14df3cc386715.png',
|
||||
// url: '',
|
||||
// name: '活动商家',
|
||||
// },
|
||||
// {
|
||||
// type: 1,
|
||||
// icon: '//p0.meituan.net/csc/4868c06b99008ff7d5f81e6514858c8a7950.png',
|
||||
// url: '',
|
||||
// name: '兑换商家',
|
||||
// },
|
||||
{
|
||||
type: 1,
|
||||
icon: '//p0.meituan.net/csc/f33ad2443a67e9f3474a1d5fd9d529db7504.png',
|
||||
url: '/pages/users/settled_mer/index',
|
||||
name: '商户入驻',
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
icon: '//p0.meituan.net/csc/0403cf37dd14a6b44b22ffccaa2878f95703.png',
|
||||
url: '/pages/allClassList/index',
|
||||
name: '全部服务',
|
||||
},
|
||||
];
|
||||
const res = await getHomeList();
|
||||
res.data.data.forEach(item => {
|
||||
navigationList.value.unshift({
|
||||
ID: item.ID,
|
||||
type: 2,
|
||||
icon: item.icon,
|
||||
url: item.url,
|
||||
name: item.name,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const toPage = item => {
|
||||
item.type !== 1
|
||||
? Taro.navigateTo({
|
||||
url: `/pages/search/index?id=${item.ID}&name=${item.name}`,
|
||||
})
|
||||
: Taro.navigateTo({
|
||||
url: item.url as string,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
/* 旧版样式 - 所有样式包裹在 .home-old 作用域下 */
|
||||
page {
|
||||
background-image: url('//p0.meituan.net/csc/aaaccd28594119e4b838d07d30739471440261.png');
|
||||
background-size: 100% 57%;
|
||||
background-repeat: no-repeat;
|
||||
box-sizing: border-box;
|
||||
min-height: 100vh;
|
||||
}
|
||||
.home-old {
|
||||
.local {
|
||||
margin-left: 15px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.search {
|
||||
margin: 30px auto;
|
||||
display: flex;
|
||||
border-radius: 18px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 15px;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
width: 730px;
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
background-color: #f83d3d;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
width: 100px;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
.banner {
|
||||
position: relative;
|
||||
text-align: center;
|
||||
.title {
|
||||
width: 600px;
|
||||
height: 90px;
|
||||
left: 50%;
|
||||
}
|
||||
|
||||
.jf-btn {
|
||||
margin: 15px auto;
|
||||
background-image: url('//p1.meituan.net/csc/e125184432dc591137c24a26abe5796a25262.png');
|
||||
background-size: 100% 100%;
|
||||
width: 350px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
margin: 0 auto;
|
||||
padding: 0 15px;
|
||||
|
||||
.btn-1 {
|
||||
background-image: url('//p0.meituan.net/csc/7708348ee250eae910328bb7c12197f029562.png');
|
||||
background-size: 100% 100%;
|
||||
width: 200px;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.btn-2 {
|
||||
// background-image: url('//p1.meituan.net/csc/8cc2b518031eb7424b184d90a583d805146287.png');
|
||||
background-image: url('../../../static/game_banner.png');
|
||||
background-size: 100% 100%;
|
||||
width: 300px;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.btn-3 {
|
||||
background-image: url('//p0.meituan.net/csc/31bd1f5c791c95557758dfa5c96e001529545.png');
|
||||
background-size: 100% 100%;
|
||||
width: 200px;
|
||||
height: 220px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navigation {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-gap: 40px;
|
||||
margin: 20px;
|
||||
height: auto;
|
||||
background-color: #fff;
|
||||
border-radius: 20px;
|
||||
padding: 32px 0;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
background-size: 100% 100%;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #333333;
|
||||
font-size: 26px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ad {
|
||||
// background-image: url('https://jdt168.oss-cn-guangzhou.aliyuncs.com/ad.png');
|
||||
background-image: url('https://pic.imgdb.cn/item/6697aa0dd9c307b7e95c94d9.png');
|
||||
background-size: 100% 100%;
|
||||
height: 180px;
|
||||
margin: 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,123 +0,0 @@
|
||||
page {
|
||||
background-image: url('//p0.meituan.net/csc/aaaccd28594119e4b838d07d30739471440261.png');
|
||||
background-size: 100% 57%;
|
||||
background-repeat: no-repeat;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.local {
|
||||
margin-left: 15px;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.search {
|
||||
margin: 30px auto;
|
||||
display: flex;
|
||||
border-radius: 18px;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 15px;
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
width: 730px;
|
||||
|
||||
input {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.search-btn {
|
||||
background-color: #f83d3d;
|
||||
color: #fff;
|
||||
border-radius: 10px;
|
||||
width: 100px;
|
||||
height: 60px;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
.banner {
|
||||
.title {
|
||||
background-image: url('//p0.meituan.net/csc/542112fc072d4687b437848bc29b0a1730495.png');
|
||||
background-size: 100% 100%;
|
||||
width: 600px;
|
||||
height: 90px;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
.jf-btn {
|
||||
margin: 15px auto;
|
||||
background-image: url('//p1.meituan.net/csc/e125184432dc591137c24a26abe5796a25262.png');
|
||||
background-size: 100% 100%;
|
||||
width: 350px;
|
||||
height: 70px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
margin: 0 auto;
|
||||
padding: 0 15px;
|
||||
|
||||
.btn-1 {
|
||||
background-image: url('//p0.meituan.net/csc/7708348ee250eae910328bb7c12197f029562.png');
|
||||
background-size: 100% 100%;
|
||||
width: 200px;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.btn-2 {
|
||||
// background-image: url('//p1.meituan.net/csc/8cc2b518031eb7424b184d90a583d805146287.png');
|
||||
background-image: url('../../static/game_banner.png');
|
||||
background-size: 100% 100%;
|
||||
width: 300px;
|
||||
height: 220px;
|
||||
}
|
||||
|
||||
.btn-3 {
|
||||
background-image: url('//p0.meituan.net/csc/31bd1f5c791c95557758dfa5c96e001529545.png');
|
||||
background-size: 100% 100%;
|
||||
width: 200px;
|
||||
height: 220px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.navigation {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
grid-gap: 40px;
|
||||
margin: 20px;
|
||||
height: auto;
|
||||
background-color: #fff;
|
||||
border-radius: 20px;
|
||||
padding: 32px 0;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.icon {
|
||||
background-size: 100% 100%;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #333333;
|
||||
font-size: 26px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ad {
|
||||
// background-image: url('https://jdt168.oss-cn-guangzhou.aliyuncs.com/ad.png');
|
||||
background-image: url('https://pic.imgdb.cn/item/6697aa0dd9c307b7e95c94d9.png');
|
||||
background-size: 100% 100%;
|
||||
height: 180px;
|
||||
margin: 20px;
|
||||
}
|
||||
@@ -1,190 +1,14 @@
|
||||
<template>
|
||||
<view>
|
||||
<view :style="{marginTop: BarHeight + 'px'}"></view>
|
||||
<view class="local">
|
||||
<view class="iconfont icon-dizhi" style="font-size: 20px"></view>
|
||||
<text class="text-[28px]">{{ address }}</text>
|
||||
</view>
|
||||
<view class="search">
|
||||
<view
|
||||
class="iconfont icon-sousuo"
|
||||
style="color: #8f8f8f; margin-right: 8px"></view>
|
||||
<input placeholder="请输入商家名称搜索" v-model="searchVal" />
|
||||
<view class="search-btn" @click="clickSearch">搜索</view>
|
||||
</view>
|
||||
<view class="banner">
|
||||
<view class="title"></view>
|
||||
<navigator class="jf-btn" hover-class="none"></navigator>
|
||||
<view class="footer">
|
||||
<navigator
|
||||
hover-class="none"
|
||||
class="btn-1"
|
||||
url="/pages/fastBuy/index?type=1"></navigator>
|
||||
<navigator
|
||||
hover-class="none"
|
||||
openType="switchTab"
|
||||
url="/pages/game/gamehome/index"
|
||||
class="btn-2"></navigator>
|
||||
<navigator
|
||||
hover-class="none"
|
||||
class="btn-3"
|
||||
url="/pages/fastBuy/index?type=2"></navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="navigation">
|
||||
<view
|
||||
class="item"
|
||||
v-for="(item, index) in navigationList"
|
||||
:key="index"
|
||||
@click="toPage(item)">
|
||||
<image class="icon" :src="item.icon" />
|
||||
<view class="text">{{ item.name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<navigator
|
||||
class="ad"
|
||||
url="/pages/marketing/yq/index"
|
||||
open-type="navigate"
|
||||
hover-class="none">
|
||||
</navigator>
|
||||
<MerList :get-user-location="getUserLocal" />
|
||||
<Popup :imgArr="imgList" />
|
||||
</view>
|
||||
<HomeNew v-if="isNewHome" />
|
||||
<HomeOld v-else />
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {getHomeList} from '@/api/home';
|
||||
import MerList from '@/components/MerList.vue';
|
||||
import Popup from '@/components/Popup.vue';
|
||||
import { ref } from 'vue';
|
||||
import HomeOld from './components/HomeOld.vue';
|
||||
import HomeNew from './components/HomeNew.vue';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync().statusBarHeight;
|
||||
const BarHeight = ref((statusBarHeight as number) + 7);
|
||||
|
||||
interface navigationType {
|
||||
ID?: number;
|
||||
type: number;
|
||||
icon: string;
|
||||
name: string;
|
||||
url: string;
|
||||
}
|
||||
|
||||
const navigationList = ref<Array<navigationType>>([]);
|
||||
|
||||
const imgList = ref([
|
||||
// require('../../static/popTip-1.png'),
|
||||
require('../../static/popTip.png'),
|
||||
]);
|
||||
|
||||
Taro.useShareAppMessage(() => ({
|
||||
title: '捷兑通',
|
||||
path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`,
|
||||
imageUrl: 'https://upload.jdt168.com/1714375021923881119_Share.jpg',
|
||||
}));
|
||||
|
||||
const searchVal = ref('');
|
||||
|
||||
const clickSearch = () => {
|
||||
if (!searchVal.value)
|
||||
return Taro.showToast({
|
||||
title: '请输入商家名称再搜索',
|
||||
icon: 'none',
|
||||
});
|
||||
Taro.navigateTo({
|
||||
url: `/pages/search/index?name=${searchVal.value}`,
|
||||
});
|
||||
searchVal.value = '';
|
||||
};
|
||||
|
||||
Taro.useLoad(() => {
|
||||
Taro.getPrivacySetting({
|
||||
success: res => {
|
||||
if (res.needAuthorization) {
|
||||
Taro.requirePrivacyAuthorize({
|
||||
success: () => {
|
||||
console.log('用户同意授权');
|
||||
},
|
||||
fail: () => {
|
||||
console.log('用户拒绝授权');
|
||||
Taro.exitMiniProgram();
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
getNavLists();
|
||||
getUserLocal();
|
||||
});
|
||||
|
||||
const address = ref('获取位置中......');
|
||||
|
||||
const getUserLocal = async () => {
|
||||
Taro.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
Taro.request({
|
||||
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=S3GBZ-WR26O-IXNW2-SXBOD-LZXV6-WAFNO&get_poi=1`,
|
||||
method: 'GET',
|
||||
success: res => {
|
||||
const data = res.data.result.address_component;
|
||||
address.value = `${data.district}${data.street_number}`;
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const getNavLists = async () => {
|
||||
navigationList.value = [
|
||||
// {
|
||||
// type: 1,
|
||||
// icon: '//p0.meituan.net/csc/5c770748f0028c63741c5ec14df3cc386715.png',
|
||||
// url: '',
|
||||
// name: '活动商家',
|
||||
// },
|
||||
// {
|
||||
// type: 1,
|
||||
// icon: '//p0.meituan.net/csc/4868c06b99008ff7d5f81e6514858c8a7950.png',
|
||||
// url: '',
|
||||
// name: '兑换商家',
|
||||
// },
|
||||
{
|
||||
type: 1,
|
||||
icon: '//p0.meituan.net/csc/f33ad2443a67e9f3474a1d5fd9d529db7504.png',
|
||||
url: '/pages/users/settled_mer/index',
|
||||
name: '商户入驻',
|
||||
},
|
||||
{
|
||||
type: 1,
|
||||
icon: '//p0.meituan.net/csc/0403cf37dd14a6b44b22ffccaa2878f95703.png',
|
||||
url: '/pages/allClassList/index',
|
||||
name: '全部服务',
|
||||
},
|
||||
];
|
||||
const res = await getHomeList();
|
||||
res.data.data.forEach(item => {
|
||||
navigationList.value.unshift({
|
||||
ID: item.ID,
|
||||
type: 2,
|
||||
icon: item.icon,
|
||||
url: item.url,
|
||||
name: item.name,
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const toPage = item => {
|
||||
item.type !== 1
|
||||
? Taro.navigateTo({
|
||||
url: `/pages/search/index?id=${item.ID}&name=${item.name}`,
|
||||
})
|
||||
: Taro.navigateTo({
|
||||
url: item.url as string,
|
||||
});
|
||||
};
|
||||
const isNewHome = process.env.TARO_APP_SHOW_NEW_HOME === 'yes';
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './index.scss';
|
||||
</style>
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
@@ -41,9 +41,9 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {getPhone, login} from '@/api/user';
|
||||
import {getQrCode, bindQrCode} from '@/api/code';
|
||||
import { ref } from 'vue';
|
||||
import { getPhone, login } from '@/api/user';
|
||||
import { getQrCode, bindQrCode } from '@/api/code';
|
||||
import './index.scss';
|
||||
|
||||
const status = ref(0);
|
||||
@@ -104,7 +104,7 @@ const getPhoneNumber = async (e: any) => {
|
||||
title: '授权手机号中',
|
||||
mask: true,
|
||||
});
|
||||
const {code} = e.detail;
|
||||
const { code } = e.detail;
|
||||
const res = await getPhone({
|
||||
code: code,
|
||||
});
|
||||
|
||||
@@ -52,13 +52,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
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 { getHdOrJfGoods, createActiveOrder } from '@/api/goods';
|
||||
import { getUserPoint } from '@/api/admin';
|
||||
import { addCart } from '@/api/cart';
|
||||
import Back from '@/components/Back.vue';
|
||||
import {RectRight} from '@nutui/icons-vue-taro';
|
||||
import { RectRight } from '@nutui/icons-vue-taro';
|
||||
import './index.scss';
|
||||
|
||||
const data = ref<any[]>([]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="head-wrapper" :style="{top: BarHeight + 'px'}">
|
||||
<view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
|
||||
<view class="head-menu">
|
||||
<Left class="iconfont" @click="returns" />
|
||||
<Home class="iconfont" @click="goHome" />
|
||||
@@ -27,7 +27,7 @@
|
||||
spacing="1"
|
||||
active-color="rgba(252, 207, 10, 1)"
|
||||
v-model="mer_info.rate" />
|
||||
<view class="text-[#9E9E9E] text-[25px]">销量:10000</view>
|
||||
<view class="text-[#9E9E9E] text-[25px]">销量:1000+</view>
|
||||
<view class="text-[#9E9E9E] text-[25px]"
|
||||
>营业时间:{{ mer_info.week_start }}-{{ mer_info.week_end }}
|
||||
</view>
|
||||
@@ -54,12 +54,12 @@
|
||||
<view @click="clickMap">
|
||||
<image
|
||||
class="w-[50px] h-[50px]"
|
||||
src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
|
||||
src="https://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
|
||||
</view>
|
||||
<view @click="clickPhone">
|
||||
<image
|
||||
class="w-[50px] h-[50px]"
|
||||
src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
|
||||
src="https://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -134,10 +134,10 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {Left, Home, Plus, Minus} from '@nutui/icons-vue-taro';
|
||||
import {Ref, ref} from 'vue';
|
||||
import {calculateDistance} from '@/utils';
|
||||
import {getGoodList, getMerCategory, getMerDetail} from '@/api/goods';
|
||||
import { Left, Home, Plus, Minus } from '@nutui/icons-vue-taro';
|
||||
import { Ref, ref } from 'vue';
|
||||
import { calculateDistance } from '@/utils';
|
||||
import { getGoodList, getMerCategory, getMerDetail } from '@/api/goods';
|
||||
import Cart from '@/components/Cart.vue';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight;
|
||||
@@ -161,12 +161,12 @@ Taro.useLoad(opt => {
|
||||
});
|
||||
|
||||
Taro.useDidShow(() => {
|
||||
if (!Taro.getStorageSync('token')) {
|
||||
Taro.navigateTo({
|
||||
url: '/pages/users/login/index?isBack=1',
|
||||
});
|
||||
return;
|
||||
}
|
||||
// if (!Taro.getStorageSync('token')) {
|
||||
// Taro.navigateTo({
|
||||
// url: '/pages/users/login/index?isBack=1',
|
||||
// });
|
||||
// return;
|
||||
// }
|
||||
Taro.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import Taro from '@tarojs/taro';
|
||||
import {Ref, ref} from 'vue';
|
||||
import { Ref, ref } from 'vue';
|
||||
import Upload from '../../../components/Upload.vue';
|
||||
import RichEditor from '../../../components/RichEditor.vue';
|
||||
import {addGood} from '@/api/product';
|
||||
import { addGood } from '@/api/product';
|
||||
|
||||
const ruleForm = ref(null) as Ref;
|
||||
|
||||
@@ -90,7 +90,7 @@ const confirmClass = (val: any) => {
|
||||
};
|
||||
|
||||
const ok = async () => {
|
||||
ruleForm.value.validate().then(({valid, errors}: any) => {
|
||||
ruleForm.value.validate().then(({ valid, errors }: any) => {
|
||||
if (valid) {
|
||||
console.log('success', basicData.value);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import {productList} from '@/api/product';
|
||||
import { ref } from 'vue';
|
||||
import { productList } from '@/api/product';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const swiperCur = ref(0);
|
||||
@@ -69,7 +69,7 @@ const changeState = (item: List) => {
|
||||
next-margin="0"
|
||||
:current="swiperCur"
|
||||
@change="swiperChange">
|
||||
<swiper-item :class="{active: 0 == swiperCur}">
|
||||
<swiper-item :class="{ active: 0 == swiperCur }">
|
||||
<view class="slide-navigator">
|
||||
<view class="item" @click="jumpAddGoods(null, 1)">
|
||||
<image
|
||||
@@ -120,7 +120,7 @@ const changeState = (item: List) => {
|
||||
</navigator>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item :class="{active: 1 == swiperCur}">
|
||||
<swiper-item :class="{ active: 1 == swiperCur }">
|
||||
<view class="slide-navigator">
|
||||
<navigator
|
||||
class="item"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import {ref, onMounted} from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import MerList from '@/components/MerList.vue';
|
||||
import Storelist from '@/components/StoreList.vue';
|
||||
@@ -25,10 +25,16 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<view>
|
||||
<view class="search-page">
|
||||
<MerList v-if="classId" v-model="classId" />
|
||||
<Storelist v-else v-model="name" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss"></style>
|
||||
<style lang="scss">
|
||||
.search-page {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f6f7;
|
||||
background-image: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
box-sizing: border-box;
|
||||
// background-color: #f8f8f8;
|
||||
height: 100%;
|
||||
background-image: url('http://p0.meituan.net/csc/f44bb11463e3c538c307d7ce4b303bec33520.png');
|
||||
background-image: url('https://p0.meituan.net/csc/f44bb11463e3c538c307d7ce4b303bec33520.png');
|
||||
background-size: 100% 500px;
|
||||
background-repeat: no-repeat;
|
||||
position: relative;
|
||||
@@ -103,7 +103,7 @@
|
||||
}
|
||||
|
||||
.user-acc {
|
||||
background-image: url('http://p0.meituan.net/csc/a74c44a7af541f01efbcc6fb023e6e09132712.png');
|
||||
background-image: url('https://p0.meituan.net/csc/a74c44a7af541f01efbcc6fb023e6e09132712.png');
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
width: 90%;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<view class="appUser">
|
||||
<view
|
||||
:style="{ width: isLogin ? '100%' : '70%' }"
|
||||
class="user-center-card__header__transparent"
|
||||
v-if="isLogin"
|
||||
:style="{width: isLogin ? '100%' : '70%'}">
|
||||
v-if="isLogin">
|
||||
<view
|
||||
class="user-center-card__header__avatar"
|
||||
@click="toPage('/pages/users/user_setting/index')">
|
||||
<nut-avatar size="large">
|
||||
<img :src="userInfo.data?.avatarUrl" />
|
||||
<img :src="userInfo.data?.avatarUrl" alt="" />
|
||||
</nut-avatar>
|
||||
</view>
|
||||
<view
|
||||
@@ -34,7 +34,8 @@
|
||||
<view class="user-center-card__header__avatar">
|
||||
<nut-avatar size="large">
|
||||
<img
|
||||
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png" />
|
||||
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
|
||||
alt="" />
|
||||
</nut-avatar>
|
||||
</view>
|
||||
<view class="user-center-card__header__info">
|
||||
@@ -72,7 +73,7 @@
|
||||
class="mt-[30px] flex flex-col items-center"
|
||||
@click="toOrderList(1)">
|
||||
<IconFont
|
||||
name="http://p0.meituan.net/csc/9943f6c938fc0e310141a2b99d5bde6617483.png"
|
||||
name="https://p0.meituan.net/csc/9943f6c938fc0e310141a2b99d5bde6617483.png"
|
||||
size="42" />
|
||||
<view class="mt-[15px] text-[25px] text-[#333333]">待付款</view>
|
||||
</view>
|
||||
@@ -80,7 +81,7 @@
|
||||
class="mt-[30px] flex flex-col items-center"
|
||||
@click="toOrderList(2)">
|
||||
<IconFont
|
||||
name="http://p0.meituan.net/csc/5306d094d7b4b61848dd21c86b693a9515523.png"
|
||||
name="https://p0.meituan.net/csc/5306d094d7b4b61848dd21c86b693a9515523.png"
|
||||
size="42" />
|
||||
<view class="mt-[15px] text-[25px] text-[#333333]">待使用</view>
|
||||
</view>
|
||||
@@ -88,7 +89,7 @@
|
||||
class="mt-[30px] flex flex-col items-center"
|
||||
@click="toOrderList(3)">
|
||||
<IconFont
|
||||
name="http://p0.meituan.net/csc/32ea9bbf51e3bbb0cbd75bc0fea97ca815779.png"
|
||||
name="https://p0.meituan.net/csc/32ea9bbf51e3bbb0cbd75bc0fea97ca815779.png"
|
||||
size="42" />
|
||||
<view class="mt-[15px] text-[25px] text-[#333333]">已使用</view>
|
||||
</view>
|
||||
@@ -96,7 +97,7 @@
|
||||
class="mt-[30px] flex flex-col items-center"
|
||||
@click="toOrderList(4)">
|
||||
<IconFont
|
||||
name="http://p0.meituan.net/csc/2e0dee89e9a3e3f2e7bf65db355fa11c11630.png"
|
||||
name="https://p0.meituan.net/csc/2e0dee89e9a3e3f2e7bf65db355fa11c11630.png"
|
||||
size="42" />
|
||||
<view class="mt-[15px] text-[25px] text-[#333333]">已失效</view>
|
||||
</view>
|
||||
@@ -135,7 +136,7 @@
|
||||
@click="toPage('/pages/admin/add_order/index')">
|
||||
<IconFont
|
||||
size="42"
|
||||
name="http://p0.meituan.net/csc/72a389ac6a441061fd534b96644c431b7839.png"></IconFont>
|
||||
name="https://p0.meituan.net/csc/72a389ac6a441061fd534b96644c431b7839.png"></IconFont>
|
||||
<view class="label">后结点单</view>
|
||||
</view>
|
||||
<view
|
||||
@@ -144,7 +145,7 @@
|
||||
@click="toPage('/pages/admin/verify/index')">
|
||||
<IconFont
|
||||
size="42"
|
||||
name="http://p1.meituan.net/csc/c236a8b7a73178da25218e1fb59a96f06610.png"></IconFont>
|
||||
name="https://p1.meituan.net/csc/c236a8b7a73178da25218e1fb59a96f06610.png"></IconFont>
|
||||
<view class="label">订单核销</view>
|
||||
</view>
|
||||
<view
|
||||
@@ -153,7 +154,7 @@
|
||||
@click="toPage('/pages/admin/order_manage/index')">
|
||||
<IconFont
|
||||
size="42"
|
||||
name="http://p0.meituan.net/csc/bd9aca457a109b4d69a692a9109a73ed9045.png"></IconFont>
|
||||
name="https://p0.meituan.net/csc/bd9aca457a109b4d69a692a9109a73ed9045.png"></IconFont>
|
||||
<view class="label">订单管理</view>
|
||||
</view>
|
||||
<view
|
||||
@@ -162,7 +163,7 @@
|
||||
@click="toPage('/pages/admin/withdrawal/index')">
|
||||
<IconFont
|
||||
size="42"
|
||||
name="http://p0.meituan.net/csc/f85d7dc1bf9eda8977e9089b260a586b7440.png"></IconFont>
|
||||
name="https://p0.meituan.net/csc/f85d7dc1bf9eda8977e9089b260a586b7440.png"></IconFont>
|
||||
<view class="label">余额提现</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -170,7 +171,7 @@
|
||||
|
||||
<!-- 版权 -->
|
||||
<view class="mt-5 text-[20px] text-center">
|
||||
<view class="text-[#999999]">鑫瓴科技版权所有</view>
|
||||
<view class="text-[#999999]">{{ copText }}</view>
|
||||
<!-- <view>v4.0.0</view> -->
|
||||
</view>
|
||||
<!-- 登录 -->
|
||||
@@ -182,17 +183,23 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import {ArrowRight, IconFont} from '@nutui/icons-vue-taro';
|
||||
import { ref } from 'vue';
|
||||
import { ArrowRight, IconFont } from '@nutui/icons-vue-taro';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Auth from '@/components/Auth.vue';
|
||||
import {getPersonalInfo, getPhone, bindParent} from '@/api/user';
|
||||
import {maskString} from '@/utils';
|
||||
import {
|
||||
getPersonalInfo,
|
||||
getPhone,
|
||||
// bindParent
|
||||
} from '@/api/user';
|
||||
import { maskString } from '@/utils';
|
||||
|
||||
const isShowLogin = ref(false);
|
||||
|
||||
const isLogin = ref(false);
|
||||
|
||||
const copText = process.env.TARO_APP_COP;
|
||||
|
||||
interface UserInfo {
|
||||
data?: {
|
||||
nickName?: string;
|
||||
@@ -231,15 +238,15 @@ const init_data = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const test = () => {
|
||||
console.log(process.env.TARO_APP_ID);
|
||||
Taro.openCustomerServiceChat({
|
||||
corpId: 'wwb5dd953ca36043ef',
|
||||
extInfo: {
|
||||
url: 'https://work.weixin.qq.com/kfid/kfcb2b0420e94102346',
|
||||
},
|
||||
});
|
||||
};
|
||||
// const test = () => {
|
||||
// console.log(process.env.TARO_APP_ID);
|
||||
// Taro.openCustomerServiceChat({
|
||||
// corpId: 'wwb5dd953ca36043ef',
|
||||
// extInfo: {
|
||||
// url: 'https://work.weixin.qq.com/kfid/kfcb2b0420e94102346',
|
||||
// },
|
||||
// });
|
||||
// };
|
||||
|
||||
const cancelLogin = () => {
|
||||
isShowLogin.value = false;
|
||||
@@ -284,39 +291,39 @@ const userMenuList = ref([
|
||||
{
|
||||
label: '账户明细',
|
||||
url: '/pages/users/account/index',
|
||||
icon: 'http://p0.meituan.net/csc/104f787b7cc5582868be46ff52475ecf7084.png',
|
||||
icon: 'https://p0.meituan.net/csc/104f787b7cc5582868be46ff52475ecf7084.png',
|
||||
},
|
||||
{
|
||||
label: '后结订单',
|
||||
url: '/pages/users/pending_order/index',
|
||||
icon: 'http://p0.meituan.net/csc/68d3f1f1ea375897a2b918851199b6546322.png',
|
||||
icon: 'https://p0.meituan.net/csc/68d3f1f1ea375897a2b918851199b6546322.png',
|
||||
},
|
||||
{
|
||||
label: '我的推广',
|
||||
url: '/pages/users/distribution/index',
|
||||
icon: 'http://p0.meituan.net/csc/950814cc0ed1289f170e8612fab597cd5310.png',
|
||||
icon: 'https://p0.meituan.net/csc/950814cc0ed1289f170e8612fab597cd5310.png',
|
||||
},
|
||||
{
|
||||
label: '联系客服',
|
||||
type: 333,
|
||||
url: '/pages/users/account/index',
|
||||
icon: 'http://p0.meituan.net/csc/ddd4b6ff4271ec05ced60db0aee1e9548383.png',
|
||||
icon: 'https://p0.meituan.net/csc/ddd4b6ff4271ec05ced60db0aee1e9548383.png',
|
||||
},
|
||||
{
|
||||
label: '设置',
|
||||
url: '/pages/users/setting/index',
|
||||
icon: 'http://p0.meituan.net/csc/1d8e6b328d384ff042c282976b82feec6005.png',
|
||||
icon: 'https://p0.meituan.net/csc/1d8e6b328d384ff042c282976b82feec6005.png',
|
||||
},
|
||||
{
|
||||
label: '关于我们',
|
||||
url: '',
|
||||
icon: 'http://p0.meituan.net/csc/3e772eca05bd56104e8a0a5c6cffe56c7447.png',
|
||||
icon: 'https://p0.meituan.net/csc/3e772eca05bd56104e8a0a5c6cffe56c7447.png',
|
||||
},
|
||||
]);
|
||||
|
||||
const clickLogin = () => {
|
||||
// isShowLogin.value = true
|
||||
Taro.redirectTo({
|
||||
Taro.navigateTo({
|
||||
url: '/pages/users/login/index',
|
||||
});
|
||||
};
|
||||
@@ -327,28 +334,28 @@ const toPage = (url: string) => {
|
||||
});
|
||||
};
|
||||
|
||||
const scanCode = () => {
|
||||
Taro.scanCode({
|
||||
onlyFromCamera: true,
|
||||
scanType: ['qrCode'],
|
||||
success: async data => {
|
||||
try {
|
||||
await bindParent({
|
||||
uid: data.result,
|
||||
});
|
||||
Taro.showToast({
|
||||
title: '绑定成功',
|
||||
icon: 'none',
|
||||
});
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
icon: 'none',
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
// const scanCode = () => {
|
||||
// Taro.scanCode({
|
||||
// onlyFromCamera: true,
|
||||
// scanType: ['qrCode'],
|
||||
// success: async data => {
|
||||
// try {
|
||||
// await bindParent({
|
||||
// uid: data.result,
|
||||
// });
|
||||
// Taro.showToast({
|
||||
// title: '绑定成功',
|
||||
// icon: 'none',
|
||||
// });
|
||||
// } catch (error) {
|
||||
// Taro.showToast({
|
||||
// title: error.msg,
|
||||
// icon: 'none',
|
||||
// });
|
||||
// }
|
||||
// },
|
||||
// });
|
||||
// };
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import {computed, ref} from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import * as dayjs from 'dayjs';
|
||||
import {getIntegralDetail, getBeanDetail, getGiftRecord} from '@/api/user';
|
||||
import {TriangleDown} from '@nutui/icons-vue-taro';
|
||||
import { getIntegralDetail, getBeanDetail, getGiftRecord } from '@/api/user';
|
||||
import { TriangleDown } from '@nutui/icons-vue-taro';
|
||||
|
||||
const tabValue = ref(1);
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {getVerifyCode, phoneLogin, getPersonalInfo} from '@/api/user';
|
||||
import { ref } from 'vue';
|
||||
import { getVerifyCode, phoneLogin, getPersonalInfo } from '@/api/user';
|
||||
import logoImg from '../../../static/logo.jpg';
|
||||
|
||||
const optData = ref<any>({});
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<view style="width: 45%"></view>
|
||||
</view>
|
||||
<!-- 二维码弹窗 -->
|
||||
<nut-popup :style="{padding: '30px 50px'}" v-model:visible="show">
|
||||
<nut-popup :style="{ padding: '30px 50px' }" v-model:visible="show">
|
||||
<view class="popup">
|
||||
<view>推荐人二维码绑定</view>
|
||||
<image style="margin-top: 10px" :src="urlCode" />
|
||||
@@ -24,10 +24,10 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import { ref } from 'vue';
|
||||
import { IconFont } from '@nutui/icons-vue-taro';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getRefereeCode} from '@/api/user';
|
||||
import { getRefereeCode } from '@/api/user';
|
||||
|
||||
const show = ref(false);
|
||||
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {useLoad, showToast} from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {getTGIntegralDetail} from '../../../../api/user';
|
||||
import { useLoad, showToast } from '@tarojs/taro';
|
||||
import { ref } from 'vue';
|
||||
import { getTGIntegralDetail } from '../../../../api/user';
|
||||
|
||||
const data = ref([]);
|
||||
|
||||
@@ -59,7 +59,7 @@ const getData = async () => {
|
||||
data.value = res.data.data || [];
|
||||
page.value.ItemCount = res.data.count;
|
||||
} catch (error) {
|
||||
showToast({title: error.msg, icon: 'none'});
|
||||
showToast({ title: error.msg, icon: 'none' });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -27,9 +27,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import {useLoad, showToast} from '@tarojs/taro';
|
||||
import {getTGUserList} from '../../../../api/user';
|
||||
import { ref } from 'vue';
|
||||
import { useLoad, showToast } from '@tarojs/taro';
|
||||
import { getTGUserList } from '../../../../api/user';
|
||||
|
||||
useLoad(() => {
|
||||
getData();
|
||||
@@ -37,7 +37,7 @@ useLoad(() => {
|
||||
|
||||
const data = ref([]);
|
||||
|
||||
const page = ref({PageNum: 1, PageSize: 10, ItemCount: 0});
|
||||
const page = ref({ PageNum: 1, PageSize: 10, ItemCount: 0 });
|
||||
|
||||
const pageChange = (e: number) => {
|
||||
page.value.PageNum = e;
|
||||
@@ -53,7 +53,7 @@ const getData = async () => {
|
||||
data.value = res.data.data || [];
|
||||
page.value.ItemCount = res.data.count;
|
||||
} catch (error) {
|
||||
showToast({title: error.msg, icon: 'none'});
|
||||
showToast({ title: error.msg, icon: 'none' });
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -1,14 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import UserModal from '@/components/UserModal.vue';
|
||||
import {ref} from 'vue';
|
||||
import {getPhone, login, getPersonalInfo} from '@/api/user';
|
||||
import logoImg from '../../../static/logo.jpg';
|
||||
import { ref } from 'vue';
|
||||
import { getPhone, login, getPersonalInfo } from '@/api/user';
|
||||
// import logoImg from '../../../static/logo.jpg';
|
||||
import { Left, Home } from '@nutui/icons-vue-taro';
|
||||
|
||||
const statusBarHeight = Taro.getSystemInfoSync().statusBarHeight;
|
||||
const BarHeight = ref((statusBarHeight as number) - 7);
|
||||
|
||||
const appName = process.env.TARO_APP_NAME;
|
||||
|
||||
const logoImg = require(process.env.TARO_APP_LOGO_IMG as string);
|
||||
// const logoImg = process.env.TARO_APP_LOGO_IMG;
|
||||
|
||||
const isShow = ref(false);
|
||||
|
||||
const val = ref(false);
|
||||
|
||||
const returns = () => {
|
||||
Taro.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
};
|
||||
|
||||
const goHome = () => {
|
||||
Taro.switchTab({
|
||||
url: '/pages/index/index',
|
||||
});
|
||||
};
|
||||
|
||||
const getCode = () => {
|
||||
if (!val.value)
|
||||
return Taro.showToast({
|
||||
@@ -53,7 +74,7 @@ const getPhoneNumber = async (e: any) => {
|
||||
title: '授权手机号中',
|
||||
mask: true,
|
||||
});
|
||||
const {code} = e.detail;
|
||||
const { code } = e.detail;
|
||||
const res = await getPhone({
|
||||
code: code,
|
||||
});
|
||||
@@ -133,10 +154,16 @@ const clickText = (type: number, text: string) => {
|
||||
|
||||
<template>
|
||||
<view class="wrapper">
|
||||
<view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
|
||||
<view class="head-menu">
|
||||
<!-- <Left class="iconfont" @click="returns" /> -->
|
||||
<Home class="iconfont" @click="goHome" />
|
||||
</view>
|
||||
</view>
|
||||
<image src="../../../static/wechat_login.jpg" />
|
||||
<view class="logo">
|
||||
<image :src="logoImg" />
|
||||
<view>捷兑通</view>
|
||||
<image :src="logoImg"></image>
|
||||
<view>{{ appName }}</view>
|
||||
</view>
|
||||
<view class="center">
|
||||
<nut-button
|
||||
@@ -227,4 +254,30 @@ page {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.head-wrapper {
|
||||
z-index: 999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
left: 30px;
|
||||
top: 0;
|
||||
//height: 114px;
|
||||
}
|
||||
|
||||
.head-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 54px;
|
||||
width: 100px;
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
border-radius: 27px;
|
||||
|
||||
.iconfont {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
import {getActiveOrderList, deleteActiveOrder} from '@/api/goods';
|
||||
import {getOrderStatistics} from '@/api/order';
|
||||
import { getActiveOrderList, deleteActiveOrder } from '@/api/goods';
|
||||
import { getOrderStatistics } from '@/api/order';
|
||||
import UQRCode from 'uqrcodejs';
|
||||
|
||||
const tabValue = ref(0);
|
||||
@@ -97,7 +97,11 @@ const getList = async () => {
|
||||
const res = await getActiveOrderList({
|
||||
status: tabValue.value,
|
||||
});
|
||||
orderList.value = res.data.data;
|
||||
if (res.data.data.length >= 2) {
|
||||
orderList.value = res.data.data.slice(0, 2);
|
||||
} else {
|
||||
orderList.value = res.data.data;
|
||||
}
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
@@ -162,7 +166,7 @@ const toDetail = (item: any) => {
|
||||
|
||||
const delOrder = async (oid: string) => {
|
||||
try {
|
||||
await deleteActiveOrder({oid});
|
||||
await deleteActiveOrder({ oid });
|
||||
} catch (error) {
|
||||
Taro.showToast({
|
||||
title: error.msg,
|
||||
@@ -249,7 +253,9 @@ const closed = () => {
|
||||
>{{ item.title }}
|
||||
</view>
|
||||
<!-- <view>{{ item.num }}</view> -->
|
||||
<view class="line" :class="{lineColor: item.value === tabValue}"></view>
|
||||
<view
|
||||
class="line"
|
||||
:class="{ lineColor: item.value === tabValue }"></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="orderList.length > 0">
|
||||
|
||||
@@ -77,11 +77,11 @@
|
||||
<image
|
||||
@tap="toPhone()"
|
||||
class="w-[50px] h-[50px]"
|
||||
src="http://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
|
||||
src="https://p0.meituan.net/csc/ab0493b124a6bb858bf82a2340767c0d919.png" />
|
||||
<image
|
||||
@tap="toAdder()"
|
||||
class="w-[50px] h-[50px] ml-2"
|
||||
src="http://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
|
||||
src="https://p1.meituan.net/csc/92ee8512c90527169b44e07fd11d250d924.png" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -232,13 +232,13 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {onUnmounted, ref} from 'vue';
|
||||
import { onUnmounted, ref } from 'vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import Pay from '@/components/Pay.vue';
|
||||
import {calculateDistance} from '@/utils';
|
||||
import {IconFont} from '@nutui/icons-vue-taro';
|
||||
import {getActiveOrderDetail} from '@/api/goods';
|
||||
import { calculateDistance } from '@/utils';
|
||||
import { IconFont } from '@nutui/icons-vue-taro';
|
||||
import { getActiveOrderDetail } from '@/api/goods';
|
||||
import UQRCode from 'uqrcodejs';
|
||||
|
||||
dayjs.extend(duration);
|
||||
@@ -268,6 +268,9 @@ Taro.useLoad(options => {
|
||||
type.value = options.type;
|
||||
oid.value = options.orderId;
|
||||
tId.value = Number(options.OrderType);
|
||||
});
|
||||
|
||||
Taro.useDidShow(() => {
|
||||
Taro.getLocation({
|
||||
type: 'wgs84',
|
||||
success: res => {
|
||||
@@ -277,7 +280,7 @@ Taro.useLoad(options => {
|
||||
});
|
||||
// goodInfo.value = Taro.getStorageSync('item');
|
||||
getOrderDetail();
|
||||
});
|
||||
})
|
||||
|
||||
const getOrderDetail = async () => {
|
||||
const res = await getActiveOrderDetail({
|
||||
|
||||
@@ -74,9 +74,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getUserAfterOrderList} from '../../../api/user';
|
||||
import { getUserAfterOrderList } from '../../../api/user';
|
||||
|
||||
const tabsIndex = ref(0);
|
||||
|
||||
@@ -121,7 +121,7 @@ const get_list = async () => {
|
||||
title: '加载中',
|
||||
});
|
||||
const user_info = await Taro.getStorageSync('userInfo');
|
||||
const {data: res} = await getUserAfterOrderList({
|
||||
const { data: res } = await getUserAfterOrderList({
|
||||
phone: user_info.data.phone,
|
||||
status: tabsIndex.value,
|
||||
PageNum: pageOpt.value.page,
|
||||
|
||||
@@ -58,9 +58,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {getUserAfterOrderDetail} from '../../../../api/user';
|
||||
import { getUserAfterOrderDetail } from '../../../../api/user';
|
||||
|
||||
const data = ref<any>({});
|
||||
|
||||
|
||||
@@ -70,9 +70,9 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import Taro from '@tarojs/taro';
|
||||
import {editTradePwd, getVerifyCode} from '@/api/user';
|
||||
import { editTradePwd, getVerifyCode } from '@/api/user';
|
||||
|
||||
const userinfo = ref<any>({});
|
||||
|
||||
@@ -100,23 +100,23 @@ Taro.useLoad(() => {
|
||||
const formSubmit = async () => {
|
||||
try {
|
||||
if (!formVal.value.password)
|
||||
return Taro.showToast({title: '请输入交易密码', icon: 'none'});
|
||||
return Taro.showToast({ title: '请输入交易密码', icon: 'none' });
|
||||
if (!formVal.value.confirmPassword)
|
||||
return Taro.showToast({title: '请再次输入交易密码', icon: 'none'});
|
||||
return Taro.showToast({ title: '请再次输入交易密码', icon: 'none' });
|
||||
if (formVal.value.password !== formVal.value.confirmPassword)
|
||||
return Taro.showToast({title: '两次密码不一致', icon: 'none'});
|
||||
return Taro.showToast({ title: '两次密码不一致', icon: 'none' });
|
||||
if (!formVal.value.code)
|
||||
return Taro.showToast({title: '请输入验证码', icon: 'none'});
|
||||
return Taro.showToast({ title: '请输入验证码', icon: 'none' });
|
||||
const res = await editTradePwd({
|
||||
pay_password: formVal.value.password,
|
||||
code: formVal.value.code,
|
||||
});
|
||||
Taro.showToast({title: res.msg, icon: 'none'});
|
||||
Taro.showToast({ title: res.msg, icon: 'none' });
|
||||
Taro.navigateBack({
|
||||
delta: 1,
|
||||
});
|
||||
} catch (err) {
|
||||
Taro.showToast({title: err.msg, icon: 'none'});
|
||||
Taro.showToast({ title: err.msg, icon: 'none' });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
const toPage = (url: string) => {
|
||||
if (url === '1') return Taro.showToast({title: '暂未开放', icon: 'none'});
|
||||
if (url === '1') return Taro.showToast({ title: '暂未开放', icon: 'none' });
|
||||
Taro.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {applyMer, getMerTypeList, getVerifyCode} from '@/api/user';
|
||||
import { ref } from 'vue';
|
||||
import { applyMer, getMerTypeList, getVerifyCode } from '@/api/user';
|
||||
import Upload from '@/components/Upload.vue';
|
||||
|
||||
const visible = ref(false);
|
||||
@@ -116,7 +116,7 @@ const onOk = async () => {
|
||||
|
||||
// 获取验证码
|
||||
const getSmsCode = () => {
|
||||
ruleForm.value.validate('phone').then(async ({valid}: any) => {
|
||||
ruleForm.value.validate('phone').then(async ({ valid }: any) => {
|
||||
if (valid) {
|
||||
try {
|
||||
await getVerifyCode({
|
||||
@@ -152,7 +152,7 @@ const confirmGooType = (e: any) => {
|
||||
|
||||
// 提交
|
||||
const submit = () => {
|
||||
ruleForm.value.validate().then(({valid, errors}: any) => {
|
||||
ruleForm.value.validate().then(({ valid, errors }: any) => {
|
||||
if (valid) {
|
||||
console.log('success', formValue.value);
|
||||
visible.value = true;
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {getAgreement} from '../../../api/user';
|
||||
import { ref } from 'vue';
|
||||
import { getAgreement } from '../../../api/user';
|
||||
|
||||
const nodes = ref(``);
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<script lang="ts" setup>
|
||||
import Taro from '@tarojs/taro';
|
||||
import {ref} from 'vue';
|
||||
import {editPersonalInfo} from '@/api/user';
|
||||
import {BASE_URL} from '@/utils/request';
|
||||
import { ref } from 'vue';
|
||||
import { editPersonalInfo } from '@/api/user';
|
||||
import { BASE_URL } from '@/utils/request';
|
||||
|
||||
// const toPage = (e: string) => {};
|
||||
|
||||
const userInfo = ref<any>({});
|
||||
|
||||
Taro.useLoad(() => {
|
||||
const {data: data} = Taro.getStorageSync('userInfo');
|
||||
const { data: data } = Taro.getStorageSync('userInfo');
|
||||
userInfo.value = data;
|
||||
});
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* Project id 4211210 */
|
||||
src:
|
||||
url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff2?t=1692081500100')
|
||||
src: url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff2?t=1692081500100')
|
||||
format('woff2'),
|
||||
url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff?t=1692081500100')
|
||||
format('woff'),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
@font-face {
|
||||
font-family: 'iconfont'; /* Project id 993865 */
|
||||
src:
|
||||
url('https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.woff2?t=1681715156711')
|
||||
src: url('https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.woff2?t=1681715156711')
|
||||
format('woff2'),
|
||||
url('https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.woff?t=1681715156711')
|
||||
format('woff'),
|
||||
|
||||
BIN
src/static/index/title.png
Normal file
BIN
src/static/index/title.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
BIN
src/static/logo-1.jpg
Normal file
BIN
src/static/logo-1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.7 KiB |
BIN
src/static/zhenggai.png
Normal file
BIN
src/static/zhenggai.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 318 KiB |
@@ -1,32 +0,0 @@
|
||||
import {app} from '@/config';
|
||||
import Taro from '@tarojs/taro';
|
||||
|
||||
export interface RequestParams {
|
||||
url: string;
|
||||
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
||||
header?: object;
|
||||
data?: string | object;
|
||||
}
|
||||
|
||||
const request = (request: RequestParams): Promise<any> => {
|
||||
return new Promise((resolve, reject) => {
|
||||
Taro.request({
|
||||
url: `${app.API_URL()}${request.url}`,
|
||||
method: request.method,
|
||||
timeout: 5000,
|
||||
dataType: 'json',
|
||||
header: request.header || {},
|
||||
data: request.data || {},
|
||||
success: res => {
|
||||
resolve(res.data);
|
||||
// Taro.hideLoading()
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
Taro.hideLoading();
|
||||
},
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export default request;
|
||||
186
src/utils/js_sdk/u-charts.min.js
vendored
186
src/utils/js_sdk/u-charts.min.js
vendored
@@ -2,7 +2,7 @@
|
||||
* uCharts (R)
|
||||
* 高性能跨平台图表库,支持H5、APP、小程序(微信/支付宝/百度/头条/QQ/360/快手)、Vue、Taro等支持canvas的框架平台
|
||||
* Copyright (C) 2021 QIUN (R) 秋云 https://www.ucharts.cn All rights reserved.
|
||||
* Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
* Licensed ( https://www.apache.org/licenses/LICENSE-2.0 )
|
||||
* 复制使用请保留本段注释,感谢支持开源!
|
||||
*
|
||||
* uCharts (R) 官方网站
|
||||
@@ -12,7 +12,7 @@
|
||||
* https://gitee.com/uCharts/uCharts
|
||||
*
|
||||
* uni-app插件市场地址:
|
||||
* http://ext.dcloud.net.cn/plugin?id=271
|
||||
* https://ext.dcloud.net.cn/plugin?id=271
|
||||
*
|
||||
*/
|
||||
'use strict';
|
||||
@@ -113,8 +113,8 @@ var util = {
|
||||
},
|
||||
};
|
||||
function getH5Offset(t) {
|
||||
t.mp = {changedTouches: []};
|
||||
t.mp.changedTouches.push({x: t.offsetX, y: t.offsetY});
|
||||
t.mp = { changedTouches: [] };
|
||||
t.mp.changedTouches.push({ x: t.offsetX, y: t.offsetY });
|
||||
return t;
|
||||
}
|
||||
function hexToRgb(t, e) {
|
||||
@@ -159,7 +159,7 @@ function findRange(t, e, a) {
|
||||
function calCandleMA(o, t, e, n) {
|
||||
let a = [];
|
||||
for (let r = 0; r < o.length; r++) {
|
||||
let i = {data: [], name: t[r], color: e[r]};
|
||||
let i = { data: [], name: t[r], color: e[r] };
|
||||
for (let a = 0, t = n.length; a < t; a++) {
|
||||
if (a < o[r]) {
|
||||
i.data.push(null);
|
||||
@@ -292,10 +292,10 @@ function createCurveControlPoints(t, e) {
|
||||
if (l >= Math.max(t[e].x, t[e + 1].x) || l <= Math.min(t[e].x, t[e + 1].x)) {
|
||||
l = t[e + 1].x;
|
||||
}
|
||||
return {ctrA: {x: o, y: n}, ctrB: {x: l, y: s}};
|
||||
return { ctrA: { x: o, y: n }, ctrB: { x: l, y: s } };
|
||||
}
|
||||
function convertCoordinateOrigin(t, e, a) {
|
||||
return {x: a.x + t, y: a.y - e};
|
||||
return { x: a.x + t, y: a.y - e };
|
||||
}
|
||||
function avoidCollision(t, e) {
|
||||
if (e) {
|
||||
@@ -503,7 +503,7 @@ function getTouches(t, e, a) {
|
||||
r = t.y * e.pix;
|
||||
}
|
||||
}
|
||||
return {x: i, y: r};
|
||||
return { x: i, y: r };
|
||||
}
|
||||
function getSeriesDataItem(e, i, a) {
|
||||
var r = [];
|
||||
@@ -590,8 +590,8 @@ function getToolTipData(t, a, i, r, o) {
|
||||
: a.extra.tooltip.legendShape,
|
||||
};
|
||||
});
|
||||
var h = {x: Math.round(s.x), y: Math.round(s.y)};
|
||||
return {textList: e, offset: h};
|
||||
var h = { x: Math.round(s.x), y: Math.round(s.y) };
|
||||
return { textList: e, offset: h };
|
||||
}
|
||||
function getMixToolTipData(t, e, a, i) {
|
||||
var r =
|
||||
@@ -613,8 +613,8 @@ function getMixToolTipData(t, e, a, i) {
|
||||
return t;
|
||||
}
|
||||
});
|
||||
var l = {x: Math.round(o), y: 0};
|
||||
return {textList: n, offset: l};
|
||||
var l = { x: Math.round(o), y: 0 };
|
||||
return { textList: n, offset: l };
|
||||
}
|
||||
function getCandleToolTipData(o, e, n, l, i, t) {
|
||||
var r =
|
||||
@@ -680,7 +680,7 @@ function getCandleToolTipData(o, e, n, l, i, t) {
|
||||
d.push(e, a, i, r);
|
||||
});
|
||||
var x = [];
|
||||
var f = {x: 0, y: 0};
|
||||
var f = { x: 0, y: 0 };
|
||||
for (let e = 0; e < a.length; e++) {
|
||||
let t = a[e];
|
||||
if (typeof t[l] !== 'undefined' && t[l] !== null) {
|
||||
@@ -688,7 +688,7 @@ function getCandleToolTipData(o, e, n, l, i, t) {
|
||||
}
|
||||
}
|
||||
f.x = Math.round(x[0][0].x);
|
||||
return {textList: d, offset: f};
|
||||
return { textList: d, offset: f };
|
||||
}
|
||||
function filterSeries(e) {
|
||||
let a = [];
|
||||
@@ -701,7 +701,7 @@ function filterSeries(e) {
|
||||
}
|
||||
function findCurrentIndex(o, n, e, t) {
|
||||
var a = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
||||
var l = {index: -1, group: []};
|
||||
var l = { index: -1, group: [] };
|
||||
var i = e.chartData.eachSpacing / 2;
|
||||
let r = [];
|
||||
if (n && n.length > 0) {
|
||||
@@ -754,7 +754,7 @@ function findCurrentIndex(o, n, e, t) {
|
||||
}
|
||||
function findBarChartCurrentIndex(a, t, e, i) {
|
||||
var r = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
||||
var o = {index: -1, group: []};
|
||||
var o = { index: -1, group: [] };
|
||||
var n = e.chartData.eachSpacing / 2;
|
||||
let l = e.chartData.yAxisPoints;
|
||||
if (t && t.length > 0) {
|
||||
@@ -972,8 +972,8 @@ function splitPoints(t, a) {
|
||||
function calLegendData(l, s, e, t, h) {
|
||||
let c = {
|
||||
area: {
|
||||
start: {x: 0, y: 0},
|
||||
end: {x: 0, y: 0},
|
||||
start: { x: 0, y: 0 },
|
||||
end: { x: 0, y: 0 },
|
||||
width: 0,
|
||||
height: 0,
|
||||
wholeWidth: 0,
|
||||
@@ -1210,7 +1210,7 @@ function getXAxisTextList(t, e, h, c) {
|
||||
return f;
|
||||
}
|
||||
function calXAxisData(t, e, a, i) {
|
||||
var r = assign({}, {type: ''}, e.extra.bar);
|
||||
var r = assign({}, { type: '' }, e.extra.bar);
|
||||
var o = {
|
||||
angle: 0,
|
||||
xAxisHeight: e.xAxis.lineHeight * e.pix + e.xAxis.marginTop * e.pix,
|
||||
@@ -1611,7 +1611,7 @@ function getXAxisPoints(t, e, h) {
|
||||
n.push(s);
|
||||
}
|
||||
}
|
||||
return {xAxisPoints: n, startX: l, endX: s, eachSpacing: o};
|
||||
return { xAxisPoints: n, startX: l, endX: s, eachSpacing: o };
|
||||
}
|
||||
function getCandleDataPoints(t, l, s, h, c, d, a) {
|
||||
var x = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 1;
|
||||
@@ -1953,7 +1953,7 @@ function getYAxisTextList(t, e, h, c, a) {
|
||||
return u.reverse();
|
||||
}
|
||||
function calYAxisData(a, o, e, n) {
|
||||
var l = assign({}, {type: ''}, o.extra.column);
|
||||
var l = assign({}, { type: '' }, o.extra.column);
|
||||
var t = o.yAxis.data.length;
|
||||
var s = new Array(t);
|
||||
if (t > 0) {
|
||||
@@ -1990,7 +1990,7 @@ function calYAxisData(a, o, e, n) {
|
||||
h[r] = getYAxisTextList(s[r], o, e, l.type, i, r);
|
||||
}
|
||||
let a = i.fontSize * o.pix || e.fontSize;
|
||||
d[r] = {position: i.position ? i.position : 'left', width: 0};
|
||||
d[r] = { position: i.position ? i.position : 'left', width: 0 };
|
||||
c[r] = h[r].map(function (t, e) {
|
||||
t = i.formatter(t, e, o);
|
||||
d[r].width = Math.max(d[r].width, measureText(t, a, n) + 5);
|
||||
@@ -2021,7 +2021,7 @@ function calYAxisData(a, o, e, n) {
|
||||
}
|
||||
h[0] = getYAxisTextList(a, o, e, l.type, {});
|
||||
}
|
||||
d[0] = {position: 'left', width: 0};
|
||||
d[0] = { position: 'left', width: 0 };
|
||||
var i = o.yAxis.fontSize * o.pix || e.fontSize;
|
||||
c[0] = h[0].map(function (t, e) {
|
||||
t = o.yAxis.formatter(t, e, o);
|
||||
@@ -2030,8 +2030,8 @@ function calYAxisData(a, o, e, n) {
|
||||
});
|
||||
d[0].width += 3 * o.pix;
|
||||
if (o.yAxis.disabled === true) {
|
||||
d[0] = {position: 'left', width: 0};
|
||||
o.yAxis.data[0] = {disabled: true};
|
||||
d[0] = { position: 'left', width: 0 };
|
||||
o.yAxis.data[0] = { disabled: true };
|
||||
} else {
|
||||
o.yAxis.data[0] = {
|
||||
disabled: false,
|
||||
@@ -2046,7 +2046,7 @@ function calYAxisData(a, o, e, n) {
|
||||
}
|
||||
}
|
||||
}
|
||||
return {rangesFormat: c, ranges: h, yAxisWidth: d};
|
||||
return { rangesFormat: c, ranges: h, yAxisWidth: d };
|
||||
}
|
||||
function calTooltipYAxisData(r, t, o, e, a) {
|
||||
let n = [].concat(o.chartData.yAxisData.ranges);
|
||||
@@ -2386,7 +2386,7 @@ function drawGaugeLabel(e, a, i, r, o, n) {
|
||||
let l = e.startAngle;
|
||||
let s = e.startNumber;
|
||||
for (let t = 0; t < e.splitLine.splitNumber + 1; t++) {
|
||||
var h = {x: a * Math.cos(l * Math.PI), y: a * Math.sin(l * Math.PI)};
|
||||
var h = { x: a * Math.cos(l * Math.PI), y: a * Math.sin(l * Math.PI) };
|
||||
var f = e.formatter ? e.formatter(s, t, r) : s;
|
||||
h.x += i.x - measureText(f, o.fontSize, n) / 2;
|
||||
h.y += i.y;
|
||||
@@ -2409,7 +2409,7 @@ function drawRadarLabel(t, s, h, c, d, x) {
|
||||
var f = c.extra.radar || {};
|
||||
t.forEach(function (t, e) {
|
||||
if (f.labelPointShow === true && c.categories[e] !== '') {
|
||||
var a = {x: s * Math.cos(t), y: s * Math.sin(t)};
|
||||
var a = { x: s * Math.cos(t), y: s * Math.sin(t) };
|
||||
var i = convertCoordinateOrigin(a.x, a.y, h);
|
||||
x.setFillStyle(f.labelPointColor);
|
||||
x.beginPath();
|
||||
@@ -2474,7 +2474,7 @@ function drawPieText(n, d, x, f, t, l) {
|
||||
let n = a;
|
||||
let l = measureText(t.text, t.textSize * d.pix || x.fontSize, f);
|
||||
let s = n;
|
||||
if (g && util.isSameXCoordinateArea(g.start, {x: o})) {
|
||||
if (g && util.isSameXCoordinateArea(g.start, { x: o })) {
|
||||
if (o > 0) {
|
||||
s = Math.min(n, g.start.y);
|
||||
} else if (e < 0) {
|
||||
@@ -2491,9 +2491,9 @@ function drawPieText(n, d, x, f, t, l) {
|
||||
o -= l;
|
||||
}
|
||||
let h = {
|
||||
lineStart: {x: i, y: r},
|
||||
lineEnd: {x: e, y: a},
|
||||
start: {x: o, y: s},
|
||||
lineStart: { x: i, y: r },
|
||||
lineEnd: { x: e, y: a },
|
||||
start: { x: o, y: s },
|
||||
width: l,
|
||||
height: x.fontSize,
|
||||
text: t.text,
|
||||
@@ -2589,7 +2589,7 @@ function drawToolTipSplitLine(r, o, n, l) {
|
||||
function drawMarkLine(h, t, c) {
|
||||
let e = assign(
|
||||
{},
|
||||
{type: 'solid', dashLength: 4, data: []},
|
||||
{ type: 'solid', dashLength: 4, data: [] },
|
||||
h.extra.markLine,
|
||||
);
|
||||
let a = h.area[3];
|
||||
@@ -2652,7 +2652,7 @@ function drawMarkLine(h, t, c) {
|
||||
}
|
||||
}
|
||||
function drawToolTipHorizentalLine(x, f, p, t, e) {
|
||||
var u = assign({}, {gridType: 'solid', dashLength: 4}, x.extra.tooltip);
|
||||
var u = assign({}, { gridType: 'solid', dashLength: 4 }, x.extra.tooltip);
|
||||
var a = x.area[3];
|
||||
var i = x.width - x.area[1];
|
||||
if (u.gridType == 'dash') {
|
||||
@@ -2715,7 +2715,7 @@ function drawToolTipHorizentalLine(x, f, p, t, e) {
|
||||
function drawToolTipSplitArea(t, e, a, i, r) {
|
||||
var o = assign(
|
||||
{},
|
||||
{activeBgColor: '#000000', activeBgOpacity: 0.08, activeWidth: r},
|
||||
{ activeBgColor: '#000000', activeBgOpacity: 0.08, activeWidth: r },
|
||||
e.extra.column,
|
||||
);
|
||||
o.activeWidth = o.activeWidth > r ? r : o.activeWidth;
|
||||
@@ -2731,7 +2731,7 @@ function drawToolTipSplitArea(t, e, a, i, r) {
|
||||
function drawBarToolTipSplitArea(t, e, a, i, r) {
|
||||
var o = assign(
|
||||
{},
|
||||
{activeBgColor: '#000000', activeBgOpacity: 0.08},
|
||||
{ activeBgColor: '#000000', activeBgOpacity: 0.08 },
|
||||
e.extra.bar,
|
||||
);
|
||||
var n = e.area[3];
|
||||
@@ -2767,7 +2767,7 @@ function drawToolTip(e, r, o, a, n, i, f) {
|
||||
o.extra.tooltip,
|
||||
);
|
||||
if (l.showCategory == true && o.categories) {
|
||||
e.unshift({text: o.categories[o.tooltip.index], color: null});
|
||||
e.unshift({ text: o.categories[o.tooltip.index], color: null });
|
||||
}
|
||||
var s = l.fontSize * o.pix;
|
||||
var p = l.lineHeight * o.pix;
|
||||
@@ -2791,7 +2791,7 @@ function drawToolTip(e, r, o, a, n, i, f) {
|
||||
drawToolTipSplitLine(o.tooltip.offset.x, o, a, n);
|
||||
}
|
||||
}
|
||||
r = assign({x: 0, y: 0}, r);
|
||||
r = assign({ x: 0, y: 0 }, r);
|
||||
r.y -= 8 * o.pix;
|
||||
var y = e.map(function (t) {
|
||||
return measureText(t.text, s, n);
|
||||
@@ -3168,7 +3168,7 @@ function drawColumnDataPoints(T, b, S, w) {
|
||||
});
|
||||
}
|
||||
w.restore();
|
||||
return {xAxisPoints: P, calPoints: M, eachSpacing: C};
|
||||
return { xAxisPoints: P, calPoints: M, eachSpacing: C };
|
||||
}
|
||||
function drawMountDataPoints(i, r, o, n) {
|
||||
let f = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -3432,7 +3432,7 @@ function drawMountDataPoints(i, r, o, n) {
|
||||
drawMountPointText(c, i, o, n, r, h);
|
||||
}
|
||||
n.restore();
|
||||
return {xAxisPoints: p, calPoints: c, eachSpacing: l};
|
||||
return { xAxisPoints: p, calPoints: c, eachSpacing: l };
|
||||
}
|
||||
function drawBarDataPoints(y, v, m, T) {
|
||||
let b = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -3585,11 +3585,11 @@ function drawBarDataPoints(y, v, m, T) {
|
||||
}
|
||||
});
|
||||
}
|
||||
return {yAxisPoints: S, calPoints: P, eachSpacing: w};
|
||||
return { yAxisPoints: S, calPoints: P, eachSpacing: w };
|
||||
}
|
||||
function drawCandleDataPoints(e, t, h, c, d) {
|
||||
var g = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
||||
var s = assign({}, {color: {}, average: {}}, h.extra.candle);
|
||||
var s = assign({}, { color: {}, average: {} }, h.extra.candle);
|
||||
s.color = assign(
|
||||
{},
|
||||
{
|
||||
@@ -3602,7 +3602,7 @@ function drawCandleDataPoints(e, t, h, c, d) {
|
||||
);
|
||||
s.average = assign(
|
||||
{},
|
||||
{show: false, name: [], day: [], color: c.color},
|
||||
{ show: false, name: [], day: [], color: c.color },
|
||||
s.average,
|
||||
);
|
||||
h.extra.candle = s;
|
||||
@@ -3715,7 +3715,7 @@ function drawCandleDataPoints(e, t, h, c, d) {
|
||||
}
|
||||
});
|
||||
d.restore();
|
||||
return {xAxisPoints: x, calPoints: y, eachSpacing: f};
|
||||
return { xAxisPoints: x, calPoints: y, eachSpacing: f };
|
||||
}
|
||||
function drawAreaDataPoints(t, s, h, c) {
|
||||
var d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -3904,11 +3904,11 @@ function drawAreaDataPoints(t, s, h, c) {
|
||||
});
|
||||
}
|
||||
c.restore();
|
||||
return {xAxisPoints: f, calPoints: v, eachSpacing: p};
|
||||
return { xAxisPoints: f, calPoints: v, eachSpacing: p };
|
||||
}
|
||||
function drawScatterDataPoints(t, s, h, c) {
|
||||
var d = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
var i = assign({}, {type: 'circle'}, s.extra.scatter);
|
||||
var i = assign({}, { type: 'circle' }, s.extra.scatter);
|
||||
let e = s.chartData.xAxisData,
|
||||
x = e.xAxisPoints,
|
||||
f = e.eachSpacing;
|
||||
@@ -3989,11 +3989,11 @@ function drawScatterDataPoints(t, s, h, c) {
|
||||
});
|
||||
}
|
||||
c.restore();
|
||||
return {xAxisPoints: x, calPoints: r, eachSpacing: f};
|
||||
return { xAxisPoints: x, calPoints: r, eachSpacing: f };
|
||||
}
|
||||
function drawBubbleDataPoints(a, l, s, h) {
|
||||
var c = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
var d = assign({}, {opacity: 1, border: 2}, l.extra.bubble);
|
||||
var d = assign({}, { opacity: 1, border: 2 }, l.extra.bubble);
|
||||
let t = l.chartData.xAxisData,
|
||||
x = t.xAxisPoints,
|
||||
f = t.eachSpacing;
|
||||
@@ -4043,7 +4043,7 @@ function drawBubbleDataPoints(a, l, s, h) {
|
||||
}
|
||||
});
|
||||
h.restore();
|
||||
return {xAxisPoints: x, calPoints: i, eachSpacing: f};
|
||||
return { xAxisPoints: x, calPoints: i, eachSpacing: f };
|
||||
}
|
||||
function drawLineDataPoints(t, d, x, f) {
|
||||
var p = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -4187,7 +4187,7 @@ function drawLineDataPoints(t, d, x, f) {
|
||||
});
|
||||
}
|
||||
f.restore();
|
||||
return {xAxisPoints: g, calPoints: T, eachSpacing: y};
|
||||
return { xAxisPoints: g, calPoints: T, eachSpacing: y };
|
||||
}
|
||||
function drawMixDataPoints(t, v, m, T) {
|
||||
let D = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -4208,8 +4208,8 @@ function drawMixDataPoints(t, v, m, T) {
|
||||
},
|
||||
v.extra.mix.column,
|
||||
);
|
||||
let A = assign({}, {opacity: 0.2, gradient: false}, v.extra.mix.area);
|
||||
let M = assign({}, {width: 2}, v.extra.mix.line);
|
||||
let A = assign({}, { opacity: 0.2, gradient: false }, v.extra.mix.area);
|
||||
let M = assign({}, { width: 2 }, v.extra.mix.line);
|
||||
let L = v.height - v.area[2];
|
||||
let F = [];
|
||||
var _ = 0;
|
||||
@@ -4455,7 +4455,7 @@ function drawMixDataPoints(t, v, m, T) {
|
||||
});
|
||||
}
|
||||
T.restore();
|
||||
return {xAxisPoints: b, calPoints: F, eachSpacing: S};
|
||||
return { xAxisPoints: b, calPoints: F, eachSpacing: S };
|
||||
}
|
||||
function drawToolTipBridge(t, e, a, i, r, o) {
|
||||
var n = t.extra.tooltip || {};
|
||||
@@ -5164,7 +5164,7 @@ function drawPieDataPoints(t, r, e, o) {
|
||||
if (a === 1 && r.type === 'ring') {
|
||||
drawRingTitle(r, e, o, l);
|
||||
}
|
||||
return {center: l, radius: i, series: t};
|
||||
return { center: l, radius: i, series: t };
|
||||
}
|
||||
function drawRoseDataPoints(t, r, e, o) {
|
||||
var a = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -5263,7 +5263,7 @@ function drawRoseDataPoints(t, r, e, o) {
|
||||
if (r.dataLabel !== false && a === 1) {
|
||||
drawPieText(t, r, e, o, i, l);
|
||||
}
|
||||
return {center: l, radius: i, series: t};
|
||||
return { center: l, radius: i, series: t };
|
||||
}
|
||||
function drawArcbarDataPoints(a, i, t, r) {
|
||||
var e = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -5290,7 +5290,7 @@ function drawArcbarDataPoints(a, i, t, r) {
|
||||
y: o.centerY ? o.centerY : i.height / 2,
|
||||
};
|
||||
} else {
|
||||
n = {x: i.width / 2, y: i.height / 2};
|
||||
n = { x: i.width / 2, y: i.height / 2 };
|
||||
}
|
||||
var l;
|
||||
if (o.radius) {
|
||||
@@ -5350,7 +5350,7 @@ function drawArcbarDataPoints(a, i, t, r) {
|
||||
r.stroke();
|
||||
}
|
||||
drawRingTitle(i, t, r, n);
|
||||
return {center: n, radius: l, series: a};
|
||||
return { center: n, radius: l, series: a };
|
||||
}
|
||||
function drawGaugeDataPoints(n, h, c, t, d) {
|
||||
var x = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 1;
|
||||
@@ -5370,7 +5370,7 @@ function drawGaugeDataPoints(n, h, c, t, d) {
|
||||
childNumber: 5,
|
||||
childWidth: 5,
|
||||
},
|
||||
pointer: {width: 15, color: 'auto'},
|
||||
pointer: { width: 15, color: 'auto' },
|
||||
},
|
||||
c.extra.gauge,
|
||||
);
|
||||
@@ -5381,7 +5381,7 @@ function drawGaugeDataPoints(n, h, c, t, d) {
|
||||
f.oldData = 0;
|
||||
}
|
||||
n = getGaugeAxisPoints(n, f.startAngle, f.endAngle);
|
||||
var p = {x: c.width / 2, y: c.height / 2};
|
||||
var p = { x: c.width / 2, y: c.height / 2 };
|
||||
var u = Math.min(p.x, p.y);
|
||||
u -= 5 * c.pix;
|
||||
u -= f.width / 2;
|
||||
@@ -5556,7 +5556,7 @@ function drawGaugeDataPoints(n, h, c, t, d) {
|
||||
c.extra.gauge.oldAngle = h[0]._proportion_;
|
||||
c.extra.gauge.oldData = h[0].data;
|
||||
}
|
||||
return {center: p, radius: u, innerRadius: g, categories: n, totalAngle: y};
|
||||
return { center: p, radius: u, innerRadius: g, categories: n, totalAngle: y };
|
||||
}
|
||||
function drawRadarDataPoints(o, n, i, l) {
|
||||
var t = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
@@ -5727,7 +5727,7 @@ function drawRadarDataPoints(o, n, i, l) {
|
||||
});
|
||||
l.setTextAlign('left');
|
||||
}
|
||||
return {center: h, radius: c, angleList: a};
|
||||
return { center: h, radius: c, angleList: a };
|
||||
}
|
||||
function lonlat2mercator(t, e) {
|
||||
var a = Array(2);
|
||||
@@ -5766,7 +5766,7 @@ function getBoundingBox(t) {
|
||||
for (var n = 0; n < a.length; n++) {
|
||||
var l = a[n][0];
|
||||
var s = a[n][1];
|
||||
var h = {x: l, y: s};
|
||||
var h = { x: l, y: s };
|
||||
e.xMin = e.xMin < h.x ? e.xMin : h.x;
|
||||
e.xMax = e.xMax > h.x ? e.xMax : h.x;
|
||||
e.yMin = e.yMin < h.y ? e.yMin : h.y;
|
||||
@@ -5777,10 +5777,10 @@ function getBoundingBox(t) {
|
||||
return e;
|
||||
}
|
||||
function coordinateToPoint(t, e, a, i, r, o) {
|
||||
return {x: (e - a.xMin) * i + r, y: (a.yMax - t) * i + o};
|
||||
return { x: (e - a.xMin) * i + r, y: (a.yMax - t) * i + o };
|
||||
}
|
||||
function pointToCoordinate(t, e, a, i, r, o) {
|
||||
return {x: (e - r) / i + a.xMin, y: a.yMax - (t - o) / i};
|
||||
return { x: (e - r) / i + a.xMin, y: a.yMax - (t - o) / i };
|
||||
}
|
||||
function isRayIntersectsSegment(t, e, a) {
|
||||
if (e[1] == a[1]) {
|
||||
@@ -6086,7 +6086,7 @@ function getWordCloudPoint(c, t, d) {
|
||||
}
|
||||
function drawWordCloudDataPoints(t, r, e, o) {
|
||||
let n = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;
|
||||
let a = assign({}, {type: 'normal', autoColors: true}, r.extra.word);
|
||||
let a = assign({}, { type: 'normal', autoColors: true }, r.extra.word);
|
||||
if (!r.chartData.wordCloudData) {
|
||||
r.chartData.wordCloudData = getWordCloudPoint(r, a.type, o);
|
||||
}
|
||||
@@ -6394,7 +6394,7 @@ function drawFunnelDataPoints(t, e, c, a) {
|
||||
if (d === 1) {
|
||||
drawFunnelCenterText(l, e, a, r, i.labelAlign, n, o);
|
||||
}
|
||||
return {center: o, radius: x, series: l};
|
||||
return { center: o, radius: x, series: l };
|
||||
}
|
||||
function drawFunnelText(l, s, h, c, d, x, f) {
|
||||
for (let n = 0; n < l.length; n++) {
|
||||
@@ -6712,7 +6712,7 @@ function drawCharts(t, l, n, s) {
|
||||
l.area[2] += e;
|
||||
l.chartData.categoriesData = t;
|
||||
} else {
|
||||
l.chartData.xAxisData = {xAxisPoints: []};
|
||||
l.chartData.xAxisData = { xAxisPoints: [] };
|
||||
}
|
||||
}
|
||||
if (
|
||||
@@ -7275,7 +7275,7 @@ var uCharts = function t(a) {
|
||||
},
|
||||
a.legend,
|
||||
);
|
||||
a.extra = assign({tooltip: {legendShape: 'auto'}}, a.extra);
|
||||
a.extra = assign({ tooltip: { legendShape: 'auto' } }, a.extra);
|
||||
a.rotate = a.rotate ? true : false;
|
||||
a.animation = a.animation ? true : false;
|
||||
a.rotate = a.rotate ? true : false;
|
||||
@@ -7475,10 +7475,10 @@ uCharts.prototype.dobuleZoom = function (t) {
|
||||
const c = Math.abs(i[0].x - i[1].x);
|
||||
if (!this.scrollOption.moveCount) {
|
||||
let t = {
|
||||
changedTouches: [{x: a[0].x, y: this.opts.area[0] / this.opts.pix + 2}],
|
||||
changedTouches: [{ x: a[0].x, y: this.opts.area[0] / this.opts.pix + 2 }],
|
||||
};
|
||||
let e = {
|
||||
changedTouches: [{x: a[1].x, y: this.opts.area[0] / this.opts.pix + 2}],
|
||||
changedTouches: [{ x: a[1].x, y: this.opts.area[0] / this.opts.pix + 2 }],
|
||||
};
|
||||
if (this.opts.rotate) {
|
||||
t = {
|
||||
@@ -7561,37 +7561,37 @@ uCharts.prototype.getCurrentDataIndex = function (e) {
|
||||
let t = getTouches(a, this.opts, e);
|
||||
if (this.opts.type === 'pie' || this.opts.type === 'ring') {
|
||||
return findPieChartCurrentIndex(
|
||||
{x: t.x, y: t.y},
|
||||
{ x: t.x, y: t.y },
|
||||
this.opts.chartData.pieData,
|
||||
this.opts,
|
||||
);
|
||||
} else if (this.opts.type === 'rose') {
|
||||
return findRoseChartCurrentIndex(
|
||||
{x: t.x, y: t.y},
|
||||
{ x: t.x, y: t.y },
|
||||
this.opts.chartData.pieData,
|
||||
this.opts,
|
||||
);
|
||||
} else if (this.opts.type === 'radar') {
|
||||
return findRadarChartCurrentIndex(
|
||||
{x: t.x, y: t.y},
|
||||
{ x: t.x, y: t.y },
|
||||
this.opts.chartData.radarData,
|
||||
this.opts.categories.length,
|
||||
);
|
||||
} else if (this.opts.type === 'funnel') {
|
||||
return findFunnelChartCurrentIndex(
|
||||
{x: t.x, y: t.y},
|
||||
{ x: t.x, y: t.y },
|
||||
this.opts.chartData.funnelData,
|
||||
);
|
||||
} else if (this.opts.type === 'map') {
|
||||
return findMapChartCurrentIndex({x: t.x, y: t.y}, this.opts);
|
||||
return findMapChartCurrentIndex({ x: t.x, y: t.y }, this.opts);
|
||||
} else if (this.opts.type === 'word') {
|
||||
return findWordChartCurrentIndex(
|
||||
{x: t.x, y: t.y},
|
||||
{ x: t.x, y: t.y },
|
||||
this.opts.chartData.wordCloudData,
|
||||
);
|
||||
} else if (this.opts.type === 'bar') {
|
||||
return findBarChartCurrentIndex(
|
||||
{x: t.x, y: t.y},
|
||||
{ x: t.x, y: t.y },
|
||||
this.opts.chartData.calPoints,
|
||||
this.opts,
|
||||
this.config,
|
||||
@@ -7599,7 +7599,7 @@ uCharts.prototype.getCurrentDataIndex = function (e) {
|
||||
);
|
||||
} else {
|
||||
return findCurrentIndex(
|
||||
{x: t.x, y: t.y},
|
||||
{ x: t.x, y: t.y },
|
||||
this.opts.chartData.calPoints,
|
||||
this.opts,
|
||||
this.config,
|
||||
@@ -7618,7 +7618,7 @@ uCharts.prototype.getLegendDataIndex = function (e) {
|
||||
}
|
||||
if (a) {
|
||||
let t = getTouches(a, this.opts, e);
|
||||
return findLegendIndex({x: t.x, y: t.y}, this.opts.chartData.legendData);
|
||||
return findLegendIndex({ x: t.x, y: t.y }, this.opts.chartData.legendData);
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
@@ -7666,7 +7666,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
}
|
||||
var a = getTouches(c, this.opts, t);
|
||||
var d = this.scrollOption.currentOffset;
|
||||
var i = assign({}, this.opts, {_scrollDistance_: d, animation: false});
|
||||
var i = assign({}, this.opts, { _scrollDistance_: d, animation: false });
|
||||
if (
|
||||
this.opts.type === 'line' ||
|
||||
this.opts.type === 'area' ||
|
||||
@@ -7704,7 +7704,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
if (this.opts.type === 'mount') {
|
||||
var o = e.index == undefined ? this.getCurrentDataIndex(t).index : e.index;
|
||||
if (o > -1) {
|
||||
var i = assign({}, this.opts, {animation: false});
|
||||
var i = assign({}, this.opts, { animation: false });
|
||||
var n = assign({}, i._series_[o]);
|
||||
var s = [
|
||||
{
|
||||
@@ -7718,7 +7718,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
: this.opts.extra.tooltip.legendShape,
|
||||
},
|
||||
];
|
||||
var h = {x: i.chartData.calPoints[o].x, y: a.y};
|
||||
var h = { x: i.chartData.calPoints[o].x, y: a.y };
|
||||
i.tooltip = {
|
||||
textList: e.textList ? e.textList : s,
|
||||
offset: e.offset !== undefined ? e.offset : h,
|
||||
@@ -7760,7 +7760,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
var o = e.index == undefined ? r.index : e.index;
|
||||
if (o > -1) {
|
||||
var d = this.scrollOption.currentOffset;
|
||||
var i = assign({}, this.opts, {_scrollDistance_: d, animation: false});
|
||||
var i = assign({}, this.opts, { _scrollDistance_: d, animation: false });
|
||||
var n = getSeriesDataItem(this.opts.series, o);
|
||||
if (n.length !== 0) {
|
||||
var x = getMixToolTipData(n, this.opts, o, this.opts.categories, e),
|
||||
@@ -7782,7 +7782,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
var o = e.index == undefined ? r.index : e.index;
|
||||
if (o > -1) {
|
||||
var d = this.scrollOption.currentOffset;
|
||||
var i = assign({}, this.opts, {_scrollDistance_: d, animation: false});
|
||||
var i = assign({}, this.opts, { _scrollDistance_: d, animation: false });
|
||||
var n = getSeriesDataItem(this.opts.series, o);
|
||||
if (n.length !== 0) {
|
||||
var l = getCandleToolTipData(
|
||||
@@ -7815,7 +7815,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
) {
|
||||
var o = e.index == undefined ? this.getCurrentDataIndex(t) : e.index;
|
||||
if (o > -1) {
|
||||
var i = assign({}, this.opts, {animation: false});
|
||||
var i = assign({}, this.opts, { animation: false });
|
||||
var n = assign({}, i._series_[o]);
|
||||
var s = [
|
||||
{
|
||||
@@ -7829,7 +7829,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
: this.opts.extra.tooltip.legendShape,
|
||||
},
|
||||
];
|
||||
var h = {x: a.x, y: a.y};
|
||||
var h = { x: a.x, y: a.y };
|
||||
i.tooltip = {
|
||||
textList: e.textList ? e.textList : s,
|
||||
offset: e.offset !== undefined ? e.offset : h,
|
||||
@@ -7842,7 +7842,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
if (this.opts.type === 'map') {
|
||||
var o = e.index == undefined ? this.getCurrentDataIndex(t) : e.index;
|
||||
if (o > -1) {
|
||||
var i = assign({}, this.opts, {animation: false});
|
||||
var i = assign({}, this.opts, { animation: false });
|
||||
var n = assign({}, this.opts.series[o]);
|
||||
n.name = n.properties.name;
|
||||
var s = [
|
||||
@@ -7855,7 +7855,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
: this.opts.extra.tooltip.legendShape,
|
||||
},
|
||||
];
|
||||
var h = {x: a.x, y: a.y};
|
||||
var h = { x: a.x, y: a.y };
|
||||
i.tooltip = {
|
||||
textList: e.textList ? e.textList : s,
|
||||
offset: e.offset !== undefined ? e.offset : h,
|
||||
@@ -7869,7 +7869,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
if (this.opts.type === 'word') {
|
||||
var o = e.index == undefined ? this.getCurrentDataIndex(t) : e.index;
|
||||
if (o > -1) {
|
||||
var i = assign({}, this.opts, {animation: false});
|
||||
var i = assign({}, this.opts, { animation: false });
|
||||
var n = assign({}, this.opts.series[o]);
|
||||
var s = [
|
||||
{
|
||||
@@ -7881,7 +7881,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
: this.opts.extra.tooltip.legendShape,
|
||||
},
|
||||
];
|
||||
var h = {x: a.x, y: a.y};
|
||||
var h = { x: a.x, y: a.y };
|
||||
i.tooltip = {
|
||||
textList: e.textList ? e.textList : s,
|
||||
offset: e.offset !== undefined ? e.offset : h,
|
||||
@@ -7895,7 +7895,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
if (this.opts.type === 'radar') {
|
||||
var o = e.index == undefined ? this.getCurrentDataIndex(t) : e.index;
|
||||
if (o > -1) {
|
||||
var i = assign({}, this.opts, {animation: false});
|
||||
var i = assign({}, this.opts, { animation: false });
|
||||
var n = getSeriesDataItem(this.opts.series, o);
|
||||
if (n.length !== 0) {
|
||||
var s = n.map(t => {
|
||||
@@ -7910,7 +7910,7 @@ uCharts.prototype.showToolTip = function (t) {
|
||||
: this.opts.extra.tooltip.legendShape,
|
||||
};
|
||||
});
|
||||
var h = {x: a.x, y: a.y};
|
||||
var h = { x: a.x, y: a.y };
|
||||
i.tooltip = {
|
||||
textList: e.textList ? e.textList : s,
|
||||
offset: e.offset !== undefined ? e.offset : h,
|
||||
@@ -7929,7 +7929,7 @@ uCharts.prototype.translate = function (t) {
|
||||
distance: 0,
|
||||
lastMoveTime: 0,
|
||||
};
|
||||
let e = assign({}, this.opts, {_scrollDistance_: t, animation: false});
|
||||
let e = assign({}, this.opts, { _scrollDistance_: t, animation: false });
|
||||
drawCharts.call(this, this.opts.type, e, this.config, this.context);
|
||||
};
|
||||
uCharts.prototype.scrollStart = function (t) {
|
||||
|
||||
@@ -27,8 +27,8 @@ const request = (
|
||||
'content-type': 'application/json',
|
||||
token: Taro.getStorageSync('token') || '',
|
||||
},
|
||||
success: ({data}) => {
|
||||
if (data.code !== 200) {
|
||||
success: ({ data }) => {
|
||||
if (data.code !== 200 && data.code !== 401) {
|
||||
if (!IGNORED_TIPS.includes(url)) {
|
||||
Taro.showToast({
|
||||
title: data.msg,
|
||||
@@ -36,9 +36,26 @@ const request = (
|
||||
});
|
||||
}
|
||||
reject(data);
|
||||
} else {
|
||||
resolve(data);
|
||||
return;
|
||||
}
|
||||
if (data.code === 401) {
|
||||
Taro.showModal({
|
||||
title: '提示',
|
||||
content: '你当前未登录,是否前往登录?',
|
||||
confirmText: '去登录',
|
||||
cancelText: '暂不登录',
|
||||
success: ({ confirm }) => {
|
||||
if (confirm) {
|
||||
Taro.reLaunch({
|
||||
url: '/pages/users/login/index',
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
reject(data);
|
||||
return;
|
||||
}
|
||||
resolve(data);
|
||||
},
|
||||
fail: err => {
|
||||
reject(err);
|
||||
|
||||
@@ -2,7 +2,16 @@
|
||||
module.exports = {
|
||||
content: ['./src/pages/index.html', './src/**/*.{html,js,ts,jsx,tsx,vue}'],
|
||||
theme: {
|
||||
extend: {},
|
||||
extend: {
|
||||
colors: {
|
||||
primary: '#fa2c19', // Theme Red
|
||||
secondary: '#ff5d45', // Lighter Red
|
||||
surface: '#ffffff',
|
||||
},
|
||||
boxShadow: {
|
||||
'card': '0 2px 8px rgba(0, 0, 0, 0.04)',
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [],
|
||||
corePlugins: {
|
||||
|
||||
Reference in New Issue
Block a user