i
This commit is contained in:
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
5
.idea/codeStyles/codeStyleConfig.xml
generated
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
|
<state>
|
||||||
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
6
.idea/jsLibraryMappings.xml
generated
Normal file
6
.idea/jsLibraryMappings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JavaScriptLibraryMappings">
|
||||||
|
<includedPredefinedLibrary name="Node.js Core" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
6
.idea/jsLinters/eslint.xml
generated
Normal file
6
.idea/jsLinters/eslint.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="EslintConfiguration">
|
||||||
|
<custom-configuration-file used="true" path="$PROJECT_DIR$/.eslintrc.js" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
3
components.d.ts
vendored
3
components.d.ts
vendored
@@ -14,17 +14,20 @@ declare module '@vue/runtime-core' {
|
|||||||
NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']
|
NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']
|
||||||
NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']
|
NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']
|
||||||
NutDialog: typeof import('@nutui/nutui-taro')['Dialog']
|
NutDialog: typeof import('@nutui/nutui-taro')['Dialog']
|
||||||
|
NutEllipsis: typeof import('@nutui/nutui-taro')['Ellipsis']
|
||||||
NutEmpty: typeof import('@nutui/nutui-taro')['Empty']
|
NutEmpty: typeof import('@nutui/nutui-taro')['Empty']
|
||||||
NutForm: typeof import('@nutui/nutui-taro')['Form']
|
NutForm: typeof import('@nutui/nutui-taro')['Form']
|
||||||
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
|
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
|
||||||
NutGrid: typeof import('@nutui/nutui-taro')['Grid']
|
NutGrid: typeof import('@nutui/nutui-taro')['Grid']
|
||||||
NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']
|
NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']
|
||||||
NutInput: typeof import('@nutui/nutui-taro')['Input']
|
NutInput: typeof import('@nutui/nutui-taro')['Input']
|
||||||
|
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
|
||||||
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
|
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
|
||||||
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
|
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
|
||||||
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
|
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
|
||||||
NutPrice: typeof import('@nutui/nutui-taro')['Price']
|
NutPrice: typeof import('@nutui/nutui-taro')['Price']
|
||||||
NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar']
|
NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar']
|
||||||
|
NutSwipe: typeof import('@nutui/nutui-taro')['Swipe']
|
||||||
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
|
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
|
||||||
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
|
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
|
||||||
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
|
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"development"'
|
NODE_ENV: '"development"'
|
||||||
},
|
},
|
||||||
defineConstants: {
|
defineConstants: {},
|
||||||
},
|
|
||||||
mini: {},
|
mini: {},
|
||||||
h5: {}
|
h5: {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import Components from 'unplugin-vue-components/webpack';
|
// @ts-nocheck
|
||||||
import NutUIResolver from '@nutui/nutui-taro/dist/resolver';
|
import Components from 'unplugin-vue-components/webpack'
|
||||||
|
import NutUIResolver from '@nutui/nutui-taro/dist/resolver'
|
||||||
|
import { join } from 'node:path'
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
projectName: 'taroApp',
|
projectName: 'taroApp',
|
||||||
@@ -19,13 +21,10 @@ const config = {
|
|||||||
sourceRoot: 'src',
|
sourceRoot: 'src',
|
||||||
outputRoot: 'dist',
|
outputRoot: 'dist',
|
||||||
plugins: ['@tarojs/plugin-html'],
|
plugins: ['@tarojs/plugin-html'],
|
||||||
defineConstants: {
|
defineConstants: {},
|
||||||
},
|
|
||||||
copy: {
|
copy: {
|
||||||
patterns: [
|
patterns: [],
|
||||||
],
|
options: {}
|
||||||
options: {
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
framework: 'vue3',
|
framework: 'vue3',
|
||||||
compiler: {
|
compiler: {
|
||||||
@@ -38,12 +37,19 @@ const config = {
|
|||||||
sass: {
|
sass: {
|
||||||
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`
|
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`
|
||||||
},
|
},
|
||||||
|
alias: {
|
||||||
|
'@': join(__dirname, '..', 'src')
|
||||||
|
},
|
||||||
mini: {
|
mini: {
|
||||||
webpackChain(chain) {
|
webpackChain(chain) {
|
||||||
chain.plugin('unplugin-vue-components').use(Components({
|
chain.plugin('unplugin-vue-components').use(Components({
|
||||||
resolvers: [NutUIResolver({taro: true})]
|
resolvers: [NutUIResolver({taro: true})]
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
|
miniCssExtractPluginOption: {
|
||||||
|
//忽略css文件引入顺序
|
||||||
|
ignoreOrder: true
|
||||||
|
},
|
||||||
postcss: {
|
postcss: {
|
||||||
pxtransform: {
|
pxtransform: {
|
||||||
enable: true,
|
enable: true,
|
||||||
@@ -78,9 +84,7 @@ const config = {
|
|||||||
postcss: {
|
postcss: {
|
||||||
autoprefixer: {
|
autoprefixer: {
|
||||||
enable: true,
|
enable: true,
|
||||||
config: {
|
config: {}
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
cssModules: {
|
cssModules: {
|
||||||
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
env: {
|
env: {
|
||||||
NODE_ENV: '"production"'
|
NODE_ENV: '"production"'
|
||||||
},
|
},
|
||||||
defineConstants: {
|
defineConstants: {},
|
||||||
},
|
|
||||||
mini: {},
|
mini: {},
|
||||||
h5: {
|
h5: {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
"build:qq": "taro build --type qq",
|
"build:qq": "taro build --type qq",
|
||||||
"build:jd": "taro build --type jd",
|
"build:jd": "taro build --type jd",
|
||||||
"build:quickapp": "taro build --type quickapp",
|
"build:quickapp": "taro build --type quickapp",
|
||||||
"dev:weapp": "taro build --type weapp --watch",
|
"dev:weapp": "set NODE_ENV=production && taro build --type weapp --watch",
|
||||||
"dev:swan": "npm run build:swan -- --watch",
|
"dev:swan": "npm run build:swan -- --watch",
|
||||||
"dev:alipay": "npm run build:alipay -- --watch",
|
"dev:alipay": "npm run build:alipay -- --watch",
|
||||||
"dev:tt": "npm run build:tt -- --watch",
|
"dev:tt": "npm run build:tt -- --watch",
|
||||||
@@ -53,6 +53,7 @@
|
|||||||
"@tarojs/shared": "3.6.11",
|
"@tarojs/shared": "3.6.11",
|
||||||
"@tarojs/taro": "3.6.11",
|
"@tarojs/taro": "3.6.11",
|
||||||
"pinia": "^2.1.6",
|
"pinia": "^2.1.6",
|
||||||
|
"uqrcodejs": "^4.0.7",
|
||||||
"vue": "^3.2.40"
|
"vue": "^3.2.40"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -62,15 +63,15 @@
|
|||||||
"@tarojs/webpack5-runner": "3.6.11",
|
"@tarojs/webpack5-runner": "3.6.11",
|
||||||
"@types/node": "^18.15.11",
|
"@types/node": "^18.15.11",
|
||||||
"@types/webpack-env": "^1.13.6",
|
"@types/webpack-env": "^1.13.6",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.20.0",
|
"@typescript-eslint/eslint-plugin": "^6.4.0",
|
||||||
"@typescript-eslint/parser": "^5.20.0",
|
"@typescript-eslint/parser": "^6.4.0",
|
||||||
"@vue/babel-plugin-jsx": "^1.0.6",
|
"@vue/babel-plugin-jsx": "^1.0.6",
|
||||||
"@vue/compiler-sfc": "^3.2.40",
|
"@vue/compiler-sfc": "^3.2.40",
|
||||||
"babel-preset-taro": "3.6.11",
|
"babel-preset-taro": "3.6.11",
|
||||||
"css-loader": "3.4.2",
|
"css-loader": "3.4.2",
|
||||||
"eslint": "^8.12.0",
|
"eslint": "^8.12.0",
|
||||||
"eslint-config-taro": "3.6.11",
|
"eslint-config-taro": "3.6.11",
|
||||||
"eslint-plugin-vue": "^8.0.0",
|
"eslint-plugin-vue": "^9.17.0",
|
||||||
"style-loader": "1.3.0",
|
"style-loader": "1.3.0",
|
||||||
"stylelint": "9.3.0",
|
"stylelint": "9.3.0",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
|
|||||||
189
pnpm-lock.yaml
generated
189
pnpm-lock.yaml
generated
@@ -59,6 +59,9 @@ dependencies:
|
|||||||
pinia:
|
pinia:
|
||||||
specifier: ^2.1.6
|
specifier: ^2.1.6
|
||||||
version: 2.1.6(typescript@4.1.2)(vue@3.2.40)
|
version: 2.1.6(typescript@4.1.2)(vue@3.2.40)
|
||||||
|
uqrcodejs:
|
||||||
|
specifier: ^4.0.7
|
||||||
|
version: 4.0.7
|
||||||
vue:
|
vue:
|
||||||
specifier: ^3.2.40
|
specifier: ^3.2.40
|
||||||
version: 3.2.40
|
version: 3.2.40
|
||||||
@@ -83,11 +86,11 @@ devDependencies:
|
|||||||
specifier: ^1.13.6
|
specifier: ^1.13.6
|
||||||
version: 1.13.6
|
version: 1.13.6
|
||||||
'@typescript-eslint/eslint-plugin':
|
'@typescript-eslint/eslint-plugin':
|
||||||
specifier: ^5.20.0
|
specifier: ^6.4.0
|
||||||
version: 5.20.0(@typescript-eslint/parser@5.20.0)(eslint@8.12.0)(typescript@4.1.2)
|
version: 6.4.0(@typescript-eslint/parser@6.4.0)(eslint@8.12.0)(typescript@4.1.2)
|
||||||
'@typescript-eslint/parser':
|
'@typescript-eslint/parser':
|
||||||
specifier: ^5.20.0
|
specifier: ^6.4.0
|
||||||
version: 5.20.0(eslint@8.12.0)(typescript@4.1.2)
|
version: 6.4.0(eslint@8.12.0)(typescript@4.1.2)
|
||||||
'@vue/babel-plugin-jsx':
|
'@vue/babel-plugin-jsx':
|
||||||
specifier: ^1.0.6
|
specifier: ^1.0.6
|
||||||
version: 1.0.6(@babel/core@7.8.0)
|
version: 1.0.6(@babel/core@7.8.0)
|
||||||
@@ -107,17 +110,14 @@ devDependencies:
|
|||||||
specifier: 3.6.11
|
specifier: 3.6.11
|
||||||
version: 3.6.11(@babel/core@7.8.0)(eslint@8.12.0)(typescript@4.1.2)
|
version: 3.6.11(@babel/core@7.8.0)(eslint@8.12.0)(typescript@4.1.2)
|
||||||
eslint-plugin-vue:
|
eslint-plugin-vue:
|
||||||
specifier: ^8.0.0
|
specifier: ^9.17.0
|
||||||
version: 8.0.0(eslint@8.12.0)
|
version: 9.17.0(eslint@8.12.0)
|
||||||
style-loader:
|
style-loader:
|
||||||
specifier: 1.3.0
|
specifier: 1.3.0
|
||||||
version: 1.3.0(webpack@5.78.0)
|
version: 1.3.0(webpack@5.78.0)
|
||||||
stylelint:
|
stylelint:
|
||||||
specifier: 9.3.0
|
specifier: 9.3.0
|
||||||
version: 9.3.0
|
version: 9.3.0
|
||||||
taro-plugin-pinia:
|
|
||||||
specifier: ^1.0.0
|
|
||||||
version: 1.0.0
|
|
||||||
ts-node:
|
ts-node:
|
||||||
specifier: ^10.9.1
|
specifier: ^10.9.1
|
||||||
version: 10.9.1(@swc/core@1.3.23)(@types/node@18.15.11)(typescript@4.1.2)
|
version: 10.9.1(@swc/core@1.3.23)(@types/node@18.15.11)(typescript@4.1.2)
|
||||||
@@ -2588,6 +2588,16 @@ packages:
|
|||||||
requiresBuild: true
|
requiresBuild: true
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
/@eslint-community/eslint-utils@4.4.0(eslint@8.12.0):
|
||||||
|
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
|
||||||
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
|
peerDependencies:
|
||||||
|
eslint: ^6.0.0 || ^7.0.0 || >=8.0.0
|
||||||
|
dependencies:
|
||||||
|
eslint: 8.12.0
|
||||||
|
eslint-visitor-keys: 3.4.3
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@eslint-community/eslint-utils@4.4.0(eslint@8.41.0):
|
/@eslint-community/eslint-utils@4.4.0(eslint@8.41.0):
|
||||||
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
|
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
@@ -4023,6 +4033,10 @@ packages:
|
|||||||
dependencies:
|
dependencies:
|
||||||
sass: 1.50.0
|
sass: 1.50.0
|
||||||
|
|
||||||
|
/@types/semver@7.5.0:
|
||||||
|
resolution: {integrity: sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@types/send@0.17.1:
|
/@types/send@0.17.1:
|
||||||
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
|
resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -4071,28 +4085,30 @@ packages:
|
|||||||
'@types/node': 18.15.11
|
'@types/node': 18.15.11
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/eslint-plugin@5.20.0(@typescript-eslint/parser@5.20.0)(eslint@8.12.0)(typescript@4.1.2):
|
/@typescript-eslint/eslint-plugin@6.4.0(@typescript-eslint/parser@6.4.0)(eslint@8.12.0)(typescript@4.1.2):
|
||||||
resolution: {integrity: sha512-fapGzoxilCn3sBtC6NtXZX6+P/Hef7VDbyfGqTTpzYydwhlkevB+0vE0EnmHPVTVSy68GUncyJ/2PcrFBeCo5Q==}
|
resolution: {integrity: sha512-62o2Hmc7Gs3p8SLfbXcipjWAa6qk2wZGChXG2JbBtYpwSRmti/9KHLqfbLs9uDigOexG+3PaQ9G2g3201FWLKg==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@typescript-eslint/parser': ^5.0.0
|
'@typescript-eslint/parser': ^6.0.0 || ^6.0.0-alpha
|
||||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
eslint: ^7.0.0 || ^8.0.0
|
||||||
typescript: '*'
|
typescript: '*'
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/parser': 5.20.0(eslint@8.12.0)(typescript@4.1.2)
|
'@eslint-community/regexpp': 4.6.2
|
||||||
'@typescript-eslint/scope-manager': 5.20.0
|
'@typescript-eslint/parser': 6.4.0(eslint@8.12.0)(typescript@4.1.2)
|
||||||
'@typescript-eslint/type-utils': 5.20.0(eslint@8.12.0)(typescript@4.1.2)
|
'@typescript-eslint/scope-manager': 6.4.0
|
||||||
'@typescript-eslint/utils': 5.20.0(eslint@8.12.0)(typescript@4.1.2)
|
'@typescript-eslint/type-utils': 6.4.0(eslint@8.12.0)(typescript@4.1.2)
|
||||||
|
'@typescript-eslint/utils': 6.4.0(eslint@8.12.0)(typescript@4.1.2)
|
||||||
|
'@typescript-eslint/visitor-keys': 6.4.0
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
eslint: 8.12.0
|
eslint: 8.12.0
|
||||||
functional-red-black-tree: 1.0.1
|
graphemer: 1.4.0
|
||||||
ignore: 5.2.4
|
ignore: 5.2.4
|
||||||
regexpp: 3.2.0
|
natural-compare: 1.4.0
|
||||||
semver: 7.5.4
|
semver: 7.5.4
|
||||||
tsutils: 3.21.0(typescript@4.1.2)
|
ts-api-utils: 1.0.1(typescript@4.1.2)
|
||||||
typescript: 4.1.2
|
typescript: 4.1.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
@@ -4118,6 +4134,27 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@typescript-eslint/parser@6.4.0(eslint@8.12.0)(typescript@4.1.2):
|
||||||
|
resolution: {integrity: sha512-I1Ah1irl033uxjxO9Xql7+biL3YD7w9IU8zF+xlzD/YxY6a4b7DYA08PXUUCbm2sEljwJF6ERFy2kTGAGcNilg==}
|
||||||
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
|
peerDependencies:
|
||||||
|
eslint: ^7.0.0 || ^8.0.0
|
||||||
|
typescript: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
typescript:
|
||||||
|
optional: true
|
||||||
|
dependencies:
|
||||||
|
'@typescript-eslint/scope-manager': 6.4.0
|
||||||
|
'@typescript-eslint/types': 6.4.0
|
||||||
|
'@typescript-eslint/typescript-estree': 6.4.0(typescript@4.1.2)
|
||||||
|
'@typescript-eslint/visitor-keys': 6.4.0
|
||||||
|
debug: 4.3.4
|
||||||
|
eslint: 8.12.0
|
||||||
|
typescript: 4.1.2
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/scope-manager@5.20.0:
|
/@typescript-eslint/scope-manager@5.20.0:
|
||||||
resolution: {integrity: sha512-h9KtuPZ4D/JuX7rpp1iKg3zOH0WNEa+ZIXwpW/KWmEFDxlA/HSfCMhiyF1HS/drTICjIbpA6OqkAhrP/zkCStg==}
|
resolution: {integrity: sha512-h9KtuPZ4D/JuX7rpp1iKg3zOH0WNEa+ZIXwpW/KWmEFDxlA/HSfCMhiyF1HS/drTICjIbpA6OqkAhrP/zkCStg==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
@@ -4126,20 +4163,29 @@ packages:
|
|||||||
'@typescript-eslint/visitor-keys': 5.20.0
|
'@typescript-eslint/visitor-keys': 5.20.0
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/type-utils@5.20.0(eslint@8.12.0)(typescript@4.1.2):
|
/@typescript-eslint/scope-manager@6.4.0:
|
||||||
resolution: {integrity: sha512-WxNrCwYB3N/m8ceyoGCgbLmuZwupvzN0rE8NBuwnl7APgjv24ZJIjkNzoFBXPRCGzLNkoU/WfanW0exvp/+3Iw==}
|
resolution: {integrity: sha512-TUS7vaKkPWDVvl7GDNHFQMsMruD+zhkd3SdVW0d7b+7Zo+bd/hXJQ8nsiUZMi1jloWo6c9qt3B7Sqo+flC1nig==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
|
dependencies:
|
||||||
|
'@typescript-eslint/types': 6.4.0
|
||||||
|
'@typescript-eslint/visitor-keys': 6.4.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/@typescript-eslint/type-utils@6.4.0(eslint@8.12.0)(typescript@4.1.2):
|
||||||
|
resolution: {integrity: sha512-TvqrUFFyGY0cX3WgDHcdl2/mMCWCDv/0thTtx/ODMY1QhEiyFtv/OlLaNIiYLwRpAxAtOLOY9SUf1H3Q3dlwAg==}
|
||||||
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: '*'
|
eslint: ^7.0.0 || ^8.0.0
|
||||||
typescript: '*'
|
typescript: '*'
|
||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
typescript:
|
typescript:
|
||||||
optional: true
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
'@typescript-eslint/utils': 5.20.0(eslint@8.12.0)(typescript@4.1.2)
|
'@typescript-eslint/typescript-estree': 6.4.0(typescript@4.1.2)
|
||||||
|
'@typescript-eslint/utils': 6.4.0(eslint@8.12.0)(typescript@4.1.2)
|
||||||
debug: 4.3.4
|
debug: 4.3.4
|
||||||
eslint: 8.12.0
|
eslint: 8.12.0
|
||||||
tsutils: 3.21.0(typescript@4.1.2)
|
ts-api-utils: 1.0.1(typescript@4.1.2)
|
||||||
typescript: 4.1.2
|
typescript: 4.1.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
@@ -4150,6 +4196,11 @@ packages:
|
|||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@typescript-eslint/types@6.4.0:
|
||||||
|
resolution: {integrity: sha512-+FV9kVFrS7w78YtzkIsNSoYsnOtrYVnKWSTVXoL1761CsCRv5wpDOINgsXpxD67YCLZtVQekDDyaxfjVWUJmmg==}
|
||||||
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/typescript-estree@5.20.0(typescript@4.1.2):
|
/@typescript-eslint/typescript-estree@5.20.0(typescript@4.1.2):
|
||||||
resolution: {integrity: sha512-36xLjP/+bXusLMrT9fMMYy1KJAGgHhlER2TqpUVDYUQg4w0q/NW/sg4UGAgVwAqb8V4zYg43KMUpM8vV2lve6w==}
|
resolution: {integrity: sha512-36xLjP/+bXusLMrT9fMMYy1KJAGgHhlER2TqpUVDYUQg4w0q/NW/sg4UGAgVwAqb8V4zYg43KMUpM8vV2lve6w==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||||
@@ -4171,19 +4222,41 @@ packages:
|
|||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/@typescript-eslint/utils@5.20.0(eslint@8.12.0)(typescript@4.1.2):
|
/@typescript-eslint/typescript-estree@6.4.0(typescript@4.1.2):
|
||||||
resolution: {integrity: sha512-lHONGJL1LIO12Ujyx8L8xKbwWSkoUKFSO+0wDAqGXiudWB2EO7WEUT+YZLtVbmOmSllAjLb9tpoIPwpRe5Tn6w==}
|
resolution: {integrity: sha512-iDPJArf/K2sxvjOR6skeUCNgHR/tCQXBsa+ee1/clRKr3olZjZ/dSkXPZjG6YkPtnW6p5D1egeEPMCW6Gn4yLA==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^6.0.0 || ^7.0.0 || ^8.0.0
|
typescript: '*'
|
||||||
|
peerDependenciesMeta:
|
||||||
|
typescript:
|
||||||
|
optional: true
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@typescript-eslint/types': 6.4.0
|
||||||
|
'@typescript-eslint/visitor-keys': 6.4.0
|
||||||
|
debug: 4.3.4
|
||||||
|
globby: 11.1.0
|
||||||
|
is-glob: 4.0.3
|
||||||
|
semver: 7.5.4
|
||||||
|
ts-api-utils: 1.0.1(typescript@4.1.2)
|
||||||
|
typescript: 4.1.2
|
||||||
|
transitivePeerDependencies:
|
||||||
|
- supports-color
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/@typescript-eslint/utils@6.4.0(eslint@8.12.0)(typescript@4.1.2):
|
||||||
|
resolution: {integrity: sha512-BvvwryBQpECPGo8PwF/y/q+yacg8Hn/2XS+DqL/oRsOPK+RPt29h5Ui5dqOKHDlbXrAeHUTnyG3wZA0KTDxRZw==}
|
||||||
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
|
peerDependencies:
|
||||||
|
eslint: ^7.0.0 || ^8.0.0
|
||||||
|
dependencies:
|
||||||
|
'@eslint-community/eslint-utils': 4.4.0(eslint@8.12.0)
|
||||||
'@types/json-schema': 7.0.12
|
'@types/json-schema': 7.0.12
|
||||||
'@typescript-eslint/scope-manager': 5.20.0
|
'@types/semver': 7.5.0
|
||||||
'@typescript-eslint/types': 5.20.0
|
'@typescript-eslint/scope-manager': 6.4.0
|
||||||
'@typescript-eslint/typescript-estree': 5.20.0(typescript@4.1.2)
|
'@typescript-eslint/types': 6.4.0
|
||||||
|
'@typescript-eslint/typescript-estree': 6.4.0(typescript@4.1.2)
|
||||||
eslint: 8.12.0
|
eslint: 8.12.0
|
||||||
eslint-scope: 5.1.1
|
semver: 7.5.4
|
||||||
eslint-utils: 3.0.0(eslint@8.12.0)
|
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
- typescript
|
- typescript
|
||||||
@@ -4197,6 +4270,14 @@ packages:
|
|||||||
eslint-visitor-keys: 3.4.3
|
eslint-visitor-keys: 3.4.3
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/@typescript-eslint/visitor-keys@6.4.0:
|
||||||
|
resolution: {integrity: sha512-yJSfyT+uJm+JRDWYRYdCm2i+pmvXJSMtPR9Cq5/XQs4QIgNoLcoRtDdzsLbLsFM/c6um6ohQkg/MLxWvoIndJA==}
|
||||||
|
engines: {node: ^16.0.0 || >=18.0.0}
|
||||||
|
dependencies:
|
||||||
|
'@typescript-eslint/types': 6.4.0
|
||||||
|
eslint-visitor-keys: 3.4.3
|
||||||
|
dev: true
|
||||||
|
|
||||||
/@vue/babel-helper-vue-transform-on@1.1.5:
|
/@vue/babel-helper-vue-transform-on@1.1.5:
|
||||||
resolution: {integrity: sha512-SgUymFpMoAyWeYWLAY+MkCK3QEROsiUnfaw5zxOVD/M64KQs8D/4oK6Q5omVA2hnvEOE0SCkH2TZxs/jnnUj7w==}
|
resolution: {integrity: sha512-SgUymFpMoAyWeYWLAY+MkCK3QEROsiUnfaw5zxOVD/M64KQs8D/4oK6Q5omVA2hnvEOE0SCkH2TZxs/jnnUj7w==}
|
||||||
dev: true
|
dev: true
|
||||||
@@ -7136,17 +7217,20 @@ packages:
|
|||||||
- typescript
|
- typescript
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/eslint-plugin-vue@8.0.0(eslint@8.12.0):
|
/eslint-plugin-vue@9.17.0(eslint@8.12.0):
|
||||||
resolution: {integrity: sha512-BhS+B4bHFXS4b3bwpfPIJXgvydgvw+2lsM7Ue2AA8BscBjCFT+PbsTAGqpOnc+k28AsM6S8oplqgu/R/5ISeag==}
|
resolution: {integrity: sha512-r7Bp79pxQk9I5XDP0k2dpUC7Ots3OSWgvGZNu3BxmKK6Zg7NgVtcOB6OCna5Kb9oQwJPl5hq183WD0SY5tZtIQ==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^14.17.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
|
eslint: ^6.2.0 || ^7.0.0 || ^8.0.0
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@eslint-community/eslint-utils': 4.4.0(eslint@8.12.0)
|
||||||
eslint: 8.12.0
|
eslint: 8.12.0
|
||||||
eslint-utils: 3.0.0(eslint@8.12.0)
|
|
||||||
natural-compare: 1.4.0
|
natural-compare: 1.4.0
|
||||||
|
nth-check: 2.1.1
|
||||||
|
postcss-selector-parser: 6.0.13
|
||||||
semver: 7.5.4
|
semver: 7.5.4
|
||||||
vue-eslint-parser: 8.3.0(eslint@8.12.0)
|
vue-eslint-parser: 9.3.1(eslint@8.12.0)
|
||||||
|
xml-name-validator: 4.0.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: true
|
dev: true
|
||||||
@@ -13149,10 +13233,6 @@ packages:
|
|||||||
postcss-value-parser: 3.3.1
|
postcss-value-parser: 3.3.1
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
/taro-plugin-pinia@1.0.0:
|
|
||||||
resolution: {integrity: sha512-Ip2LTRh7NGsFyEzkZWvU115xDqV3D8cRRbqqw0JKTvzHFBzpwycmrUVQQxV61AMg0r2RJm3mcEbQ997j7xNjtg==}
|
|
||||||
dev: true
|
|
||||||
|
|
||||||
/terser-webpack-plugin@5.3.9(@swc/core@1.3.23)(esbuild@0.14.54)(webpack@5.78.0):
|
/terser-webpack-plugin@5.3.9(@swc/core@1.3.23)(esbuild@0.14.54)(webpack@5.78.0):
|
||||||
resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==}
|
resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==}
|
||||||
engines: {node: '>= 10.13.0'}
|
engines: {node: '>= 10.13.0'}
|
||||||
@@ -13348,6 +13428,15 @@ packages:
|
|||||||
resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==}
|
resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==}
|
||||||
dev: true
|
dev: true
|
||||||
|
|
||||||
|
/ts-api-utils@1.0.1(typescript@4.1.2):
|
||||||
|
resolution: {integrity: sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==}
|
||||||
|
engines: {node: '>=16.13.0'}
|
||||||
|
peerDependencies:
|
||||||
|
typescript: '>=4.2.0'
|
||||||
|
dependencies:
|
||||||
|
typescript: 4.1.2
|
||||||
|
dev: true
|
||||||
|
|
||||||
/ts-node@10.9.1(@swc/core@1.3.23)(@types/node@18.15.11)(typescript@4.1.2):
|
/ts-node@10.9.1(@swc/core@1.3.23)(@types/node@18.15.11)(typescript@4.1.2):
|
||||||
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
|
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
@@ -13720,6 +13809,10 @@ packages:
|
|||||||
tslib: 2.6.1
|
tslib: 2.6.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/uqrcodejs@4.0.7:
|
||||||
|
resolution: {integrity: sha512-84+aZmD2godCVI+93lxE3YUAPNY8zAJvNA7xRS7R7U+q57KzMDepBSfNCwoRUhWOfR6eHFoAOcHRPwsP6ka1cA==}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/uri-js@4.4.1:
|
/uri-js@4.4.1:
|
||||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||||
dependencies:
|
dependencies:
|
||||||
@@ -13898,9 +13991,9 @@ packages:
|
|||||||
vue: 3.2.40
|
vue: 3.2.40
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/vue-eslint-parser@8.3.0(eslint@8.12.0):
|
/vue-eslint-parser@9.3.1(eslint@8.12.0):
|
||||||
resolution: {integrity: sha512-dzHGG3+sYwSf6zFBa0Gi9ZDshD7+ad14DGOdTLjruRVgZXe2J+DcZ9iUhyR48z5g1PqRa20yt3Njna/veLJL/g==}
|
resolution: {integrity: sha512-Clr85iD2XFZ3lJ52/ppmUDG/spxQu6+MAeHXjjyI4I1NUYZ9xmenQp4N0oaHJhrA8OOxltCVxMRfANGa70vU0g==}
|
||||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
engines: {node: ^14.17.0 || >=16.0.0}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
eslint: '>=6.0.0'
|
eslint: '>=6.0.0'
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|||||||
4
src/api/admin.ts
Normal file
4
src/api/admin.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
import request from '../utils/request';
|
||||||
|
|
||||||
|
// 订单核销
|
||||||
|
export const orderVerify = (data: object) => request('/user/cancelPointOrder', data, 'POST');
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取商品列表
|
||||||
|
export const getGoodsList = () => request('/point/goods', {}, 'POST')
|
||||||
|
|
||||||
|
// 添加购物车
|
||||||
|
export const addCart = (data: object) => request('/user/addCart', data, 'POST')
|
||||||
|
|
||||||
|
// 获取购物车列表
|
||||||
|
export const getCartList = () => request('/user/cart', {}, 'POST')
|
||||||
|
|
||||||
|
// 获取积分商品详情
|
||||||
|
export const getGoodsDetail = (data: object) => request('/point/details', data, 'POST')
|
||||||
|
|
||||||
|
// 积分商品下单
|
||||||
|
export const createOrder = (data: object) => request('/point/place', data, 'POST')
|
||||||
|
|
||||||
|
// 确认付款
|
||||||
|
export const payJfOrder = (data: object) => request('/point/confirmOrder', data, 'POST')
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 订单支付
|
||||||
|
export const payOrder = (data: object) => request('/order/place', data, 'POST')
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { request } from "../utils/request";
|
import request from "@/utils/request";
|
||||||
|
|
||||||
// 登录
|
// 登录
|
||||||
export const login = (data: object) => request("/login", data, "POST");
|
export const login = (data: object) => request("/login", data, "POST");
|
||||||
@@ -6,5 +6,20 @@ export const login = (data: object) => request("/login", data, "POST");
|
|||||||
// 获取用户信息
|
// 获取用户信息
|
||||||
export const getUserInfo = () => request("/user/detail", {}, "GET");
|
export const getUserInfo = () => request("/user/detail", {}, "GET");
|
||||||
|
|
||||||
// 支付订单
|
// 获取短信验证码
|
||||||
export const payOrder = (data: object) => request("/order/place", data, "POST");
|
export const getVerifyCode = (data: object) => request("/getSmsCode", data, "POST");
|
||||||
|
|
||||||
|
// 商家入驻申请
|
||||||
|
export const applyMer = (data: object) => request("/store/settle", data, "POST");
|
||||||
|
|
||||||
|
// 获取商家类型列表
|
||||||
|
export const getMerTypeList = () => request("/store/getOther", {},"POST");
|
||||||
|
|
||||||
|
// 获取个人信息
|
||||||
|
export const getPersonalInfo = () => request("/user/info", {}, "POST");
|
||||||
|
|
||||||
|
// 获取轮播图
|
||||||
|
export const getBanner = () => request("/rotation", {}, "POST");
|
||||||
|
|
||||||
|
// 获取积分订单列表
|
||||||
|
export const getIntegralOrderList = (data: object) => request("/user/pointOrder", data, "POST");
|
||||||
|
|||||||
@@ -1,78 +1,86 @@
|
|||||||
export default defineAppConfig({
|
export default defineAppConfig({
|
||||||
pages: [
|
pages: [
|
||||||
"pages/index/index",
|
'pages/index/index',
|
||||||
"pages/category/index",
|
'pages/category/index',
|
||||||
"pages/cart/index",
|
'pages/cart/index',
|
||||||
"pages/user/index",
|
'pages/user/index',
|
||||||
],
|
],
|
||||||
subPackages: [
|
subPackages: [
|
||||||
{
|
{
|
||||||
root: "pages/users",
|
root: 'pages/users',
|
||||||
pages: [
|
pages: [
|
||||||
"order_list/index",
|
'order_list/index',
|
||||||
"setting/index",
|
'setting/index',
|
||||||
"user_setting/index",
|
'user_setting/index',
|
||||||
"settled_mer/index",
|
'settled_mer/index',
|
||||||
"order_list_detail/index",
|
'order_list_detail/index',
|
||||||
],
|
'account/index'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/goods",
|
root: 'pages/goods',
|
||||||
pages: [
|
pages: [
|
||||||
"goods_detail/index",
|
'goods_detail/index',
|
||||||
"order_create/index",
|
'order_create/index',
|
||||||
"order_status/index",
|
'order_status/index'
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
root: "pages/admin",
|
root: 'pages/admin',
|
||||||
pages: ["verify/index"],
|
pages: ['verify/index']
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
root: 'pages/game',
|
||||||
|
pages: [
|
||||||
|
'gamehome/index',
|
||||||
|
'gamedetail/index',
|
||||||
|
]
|
||||||
|
}
|
||||||
],
|
],
|
||||||
window: {
|
window: {
|
||||||
backgroundTextStyle: "light",
|
backgroundTextStyle: 'light',
|
||||||
navigationBarBackgroundColor: "#fff",
|
navigationBarBackgroundColor: '#fff',
|
||||||
navigationBarTitleText: "WeChat",
|
navigationBarTitleText: 'WeChat',
|
||||||
navigationBarTextStyle: "black",
|
navigationBarTextStyle: 'black'
|
||||||
},
|
},
|
||||||
tabBar: {
|
tabBar: {
|
||||||
color: "#666666",
|
color: '#666666',
|
||||||
selectedColor: "#ff0000",
|
selectedColor: '#ff0000',
|
||||||
backgroundColor: "#ffffff",
|
backgroundColor: '#ffffff',
|
||||||
borderStyle: "white",
|
borderStyle: 'white',
|
||||||
list: [
|
list: [
|
||||||
{
|
{
|
||||||
pagePath: "pages/index/index",
|
pagePath: 'pages/index/index',
|
||||||
iconPath: "static/tabbar/1-001.png",
|
iconPath: 'static/tabbar/1-001.png',
|
||||||
selectedIconPath: "static/tabbar/1-002.png",
|
selectedIconPath: 'static/tabbar/1-002.png',
|
||||||
text: "首页",
|
text: '首页'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: "pages/category/index",
|
pagePath: 'pages/category/index',
|
||||||
iconPath: "static/tabbar/2-001.png",
|
iconPath: 'static/tabbar/2-001.png',
|
||||||
selectedIconPath: "static/tabbar/2-002.png",
|
selectedIconPath: 'static/tabbar/2-002.png',
|
||||||
text: "分类",
|
text: '分类'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: "pages/cart/index",
|
pagePath: 'pages/cart/index',
|
||||||
iconPath: "static/tabbar/3-001.png",
|
iconPath: 'static/tabbar/3-001.png',
|
||||||
selectedIconPath: "static/tabbar/3-002.png",
|
selectedIconPath: 'static/tabbar/3-002.png',
|
||||||
text: "购物车",
|
text: '购物车'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
pagePath: "pages/user/index",
|
pagePath: 'pages/user/index',
|
||||||
iconPath: "static/tabbar/4-001.png",
|
iconPath: 'static/tabbar/4-001.png',
|
||||||
selectedIconPath: "static/tabbar/4-002.png",
|
selectedIconPath: 'static/tabbar/4-002.png',
|
||||||
text: "我的",
|
text: '我的'
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
permission: {
|
permission: {
|
||||||
"scope.userLocation": {
|
'scope.userLocation': {
|
||||||
desc: "你的位置信息将用于小程序位置接口的效果展示",
|
desc: '你的位置信息将用于小程序位置接口的效果展示'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
},
|
requiredBackgroundModes: ['audio', 'location'],
|
||||||
requiredBackgroundModes: ["audio", "location"],
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
requiredPrivateInfos: ["getLocation"],
|
requiredPrivateInfos: ['getLocation']
|
||||||
});
|
})
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
page {
|
page {
|
||||||
font-family: AlibabaPuHuiTi-3-55-Regular, serif;
|
font-family: AlibabaPuHuiTi-3-55-Regular, serif;
|
||||||
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.app {
|
.app {
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
<view class="text">
|
<view class="text">
|
||||||
<view>授权提醒</view>
|
<view>授权提醒</view>
|
||||||
<view style="margin-top: 10px"
|
<view style="margin-top: 10px"
|
||||||
>请授权头像信息,以便为您提供更好的服务!</view
|
>请授权头像信息,以便为您提供更好的服务!
|
||||||
|
</view
|
||||||
>
|
>
|
||||||
<view class="bom">
|
<view class="bom">
|
||||||
<view class="btn b" @click="onCancel">随便逛逛</view>
|
<view class="btn b" @click="onCancel">随便逛逛</view>
|
||||||
@@ -15,45 +16,53 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
// import { computed, ref } from "vue";
|
// import { computed, ref } from "vue";
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro'
|
||||||
import { login } from "../api/user";
|
import {login} from '@/api/user'
|
||||||
|
|
||||||
defineProps({
|
defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
const emit = defineEmits(["update:visible", "update:info"]);
|
const emit = defineEmits(['update:visible', 'ok'])
|
||||||
|
|
||||||
const onCancel = () => {
|
const onCancel = () => {
|
||||||
emit("update:visible", false);
|
emit('update:visible', false)
|
||||||
};
|
}
|
||||||
|
|
||||||
const onOk = () => {
|
const onOk = () => {
|
||||||
Taro.getUserProfile({
|
Taro.getUserProfile({
|
||||||
desc: "用于完善会员资料",
|
desc: '完善用户资料',
|
||||||
success: async (user) => {
|
success: async (user) => {
|
||||||
console.log(user);
|
|
||||||
Taro.login({
|
Taro.login({
|
||||||
success: async ({code}) => {
|
success: async ({code}) => {
|
||||||
|
try {
|
||||||
const {data}: any = await login({
|
const {data}: any = await login({
|
||||||
code: code,
|
code: code,
|
||||||
});
|
nickName: user.userInfo.nickName,
|
||||||
Taro.setStorageSync("token", data.token);
|
avatarUrl: user.userInfo.avatarUrl
|
||||||
emit("update:visible", false);
|
})
|
||||||
|
Taro.setStorageSync('token', data.token)
|
||||||
|
emit('ok', false)
|
||||||
|
} catch (error) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: error.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
console.log(err)
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
console.log(err)
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -71,6 +80,7 @@ const onOk = () => {
|
|||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|||||||
@@ -46,64 +46,74 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {IconFont} from "@nutui/icons-vue-taro";
|
import {IconFont} from '@nutui/icons-vue-taro'
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro'
|
||||||
import {payOrder} from "../api/user";
|
import {payOrder} from '@/api/order'
|
||||||
|
import {payJfOrder} from '@/api/goods'
|
||||||
|
|
||||||
const prop = defineProps({
|
const prop = defineProps({
|
||||||
isShowPay: {
|
isShowPay: {
|
||||||
required: true,
|
required: true,
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false
|
||||||
},
|
},
|
||||||
payType: {
|
payType: {
|
||||||
required: true,
|
required: true,
|
||||||
type: String,
|
type: String,
|
||||||
default: "wx",
|
default: 'wx'
|
||||||
},
|
},
|
||||||
});
|
jfInfo: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
const emit = defineEmits(["errPay", "closePay"]);
|
const emit = defineEmits(['closePay'])
|
||||||
|
|
||||||
const goPay = async () => {
|
const goPay = async () => {
|
||||||
if (prop.payType === "wx") {
|
if (prop.payType === 'wx') {
|
||||||
const {data} = await payOrder({gid: 1, token: Taro.getStorageSync("token")});
|
try {
|
||||||
console.log(data);
|
const {data} = await payOrder({gid: 1, token: Taro.getStorageSync('token')})
|
||||||
// Taro.request({
|
Taro.requestPayment({
|
||||||
// url: "http://192.168.2.3:9000/app/order/place",
|
timeStamp: data.data.timeStamp,
|
||||||
// method: "POST",
|
nonceStr: data.data.nonceStr,
|
||||||
// data: {
|
package: data.data.package,
|
||||||
// gid: 1,
|
signType: data.data.signType,
|
||||||
// token: Taro.getStorageSync("token"),
|
paySign: data.data.paySign,
|
||||||
// },
|
success: function (res) {
|
||||||
// success: function ({data}) {
|
console.log(res)
|
||||||
// console.log(data);
|
},
|
||||||
// Taro.requestPayment({
|
fail: function (res) {
|
||||||
// timeStamp: data.data.data.timeStamp,
|
console.log(res)
|
||||||
// nonceStr: data.data.data.nonceStr,
|
}
|
||||||
// package: data.data.data.package,
|
})
|
||||||
// signType: "MD5",
|
} catch (e) {
|
||||||
// paySign: data.data.data.paySign,
|
Taro.showToast({
|
||||||
// success: function (res) {
|
title: e.msg,
|
||||||
// console.log(res);
|
icon: 'none'
|
||||||
// },
|
})
|
||||||
// fail: function (res) {
|
}
|
||||||
// console.log("1111", res);
|
} else {
|
||||||
// emit("errPay", false);
|
if (!prop.jfInfo) return Taro.showToast({
|
||||||
// },
|
title: '未获取到订单信息',
|
||||||
// });
|
icon: 'none'
|
||||||
// },
|
})
|
||||||
// fail: function (res) {
|
console.log(prop.jfInfo)
|
||||||
// console.log("1111", res);
|
const res = await payJfOrder(prop.jfInfo)
|
||||||
// emit("errPay", false);
|
Taro.showToast({
|
||||||
// },
|
title: res.msg,
|
||||||
// });
|
icon: 'success',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
emit('closePay', false)
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
const closePay = () => {
|
const closePay = () => {
|
||||||
emit("closePay", false);
|
emit('closePay', false)
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -10,29 +10,43 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
|
import { orderVerify } from "@/api/admin";
|
||||||
|
|
||||||
// url参数转对象
|
// url参数转对象
|
||||||
const urlParse = (url: string) => {
|
// const urlParse = (url: string) => {
|
||||||
const obj: any = {};
|
// const obj: any = {};
|
||||||
const reg = /[?&][^?&]+=[^?&]+/g;
|
// const reg = /[?&][^?&]+=[^?&]+/g;
|
||||||
const arr = url.match(reg);
|
// const arr = url.match(reg);
|
||||||
if (arr) {
|
// if (arr) {
|
||||||
arr.forEach((item) => {
|
// arr.forEach((item) => {
|
||||||
const tempArr = item.substring(1).split("=");
|
// const tempArr = item.substring(1).split("=");
|
||||||
const key = decodeURIComponent(tempArr[0]);
|
// const key = decodeURIComponent(tempArr[0]);
|
||||||
const val = decodeURIComponent(tempArr[1]);
|
// const val = decodeURIComponent(tempArr[1]);
|
||||||
obj[key] = val;
|
// obj[key] = val;
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
return obj;
|
// return obj;
|
||||||
};
|
// };
|
||||||
|
|
||||||
const scanCode = () => {
|
const scanCode = () => {
|
||||||
Taro.scanCode({
|
Taro.scanCode({
|
||||||
onlyFromCamera: true,
|
onlyFromCamera: true,
|
||||||
scanType: ["qrCode"],
|
scanType: ["qrCode"],
|
||||||
success: (res) => {
|
success: async (res) => {
|
||||||
console.log(urlParse(res.result));
|
try {
|
||||||
|
const data = await orderVerify({
|
||||||
|
oid: res.result,
|
||||||
|
});
|
||||||
|
Taro.showToast({
|
||||||
|
title: data.msg,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: error.msg,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -41,7 +55,7 @@ const scanCode = () => {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
page {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
background-image: url("../../../static/admin/cancellation-header.png");
|
background-image: url("~@/static/admin/cancellation-header.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: 100% 30%;
|
background-size: 100% 30%;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<nut-empty description="购物车暂无数据">
|
<view v-if="list.length > 0">
|
||||||
|
<nut-swipe v-for="(item,index) in list" :key="index">
|
||||||
|
<view class="item">
|
||||||
|
<nut-checkbox v-model="item.checkbox" @click="select">{{ item.ID }}</nut-checkbox>
|
||||||
|
<image src="https://s2.loli.net/2023/08/16/6KgdSQa4WRoT3sz.jpg"
|
||||||
|
style="width: 100px;height: 100px"/>
|
||||||
|
<view class="text">
|
||||||
|
<view>{{ item.name }}</view>
|
||||||
|
<view class="bom">
|
||||||
|
<nut-price :price="item.number" size="normal" :need-symbol="false"/>
|
||||||
|
<nut-input-number readonly @add="select()" @reduce="select()"
|
||||||
|
v-model="item.count"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<template #right>
|
||||||
|
<nut-button shape="square" style="height:100%" type="danger">删除</nut-button>
|
||||||
|
</template>
|
||||||
|
</nut-swipe>
|
||||||
|
</view>
|
||||||
|
<nut-empty v-else description="购物车暂无数据">
|
||||||
<!-- <nut-button icon="refresh" type="primary" @click="toPage()">去兑换商品</nut-button>-->
|
<!-- <nut-button icon="refresh" type="primary" @click="toPage()">去兑换商品</nut-button>-->
|
||||||
</nut-empty>
|
</nut-empty>
|
||||||
<view>
|
<view>
|
||||||
@@ -8,23 +28,84 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="bottom-box">
|
<view class="bottom-box">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<nut-checkbox v-model="checkbox">全选</nut-checkbox>
|
<nut-checkbox v-model="selectAllVal" @change="selectAll">全选</nut-checkbox>
|
||||||
<view class="text-box">
|
<view class="text-box">
|
||||||
总计积分:
|
总计积分:
|
||||||
<nut-price :price="0" size="normal" :need-symbol="false"/>
|
<nut-price v-model:price="localCount" size="normal" :need-symbol="false"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<nut-button type="primary" @click="sub">去结算</nut-button>
|
||||||
<nut-button type="primary">去结算</nut-button>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref} from 'vue';
|
import {ref} from 'vue'
|
||||||
import Taro from '@tarojs/taro'
|
import Taro from '@tarojs/taro'
|
||||||
|
import {getCartList} from '@/api/goods'
|
||||||
|
|
||||||
const checkbox = ref(false)
|
const selectAllVal = ref(false)
|
||||||
|
|
||||||
|
const list = ref([])
|
||||||
|
|
||||||
|
const localCount = ref(0)
|
||||||
|
|
||||||
|
Taro.useDidShow(() => {
|
||||||
|
getList()
|
||||||
|
})
|
||||||
|
|
||||||
|
const select = () => {
|
||||||
|
localCount.value = 0
|
||||||
|
list.value.forEach((item: any) => {
|
||||||
|
if (item.checkbox) {
|
||||||
|
setTimeout(() => {
|
||||||
|
item.countNum = Number(item.number) * Number(item.count)
|
||||||
|
localCount.value += item.countNum
|
||||||
|
console.log(localCount.value)
|
||||||
|
}, 1)
|
||||||
|
selectAllVal.value = true
|
||||||
|
} else {
|
||||||
|
selectAllVal.value = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const selectAll = () => {
|
||||||
|
localCount.value = 0
|
||||||
|
list.value.forEach((item: any) => {
|
||||||
|
item.checkbox = selectAllVal.value
|
||||||
|
})
|
||||||
|
select()
|
||||||
|
console.log(list.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
const sub = () => {
|
||||||
|
const arr = list.value.filter((item: any) => item.checkbox)
|
||||||
|
if (arr.length === 0) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: '请选择商品',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
Taro.navigateTo({
|
||||||
|
url: '/pages/goods/order_create/index'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
const res = await getCartList()
|
||||||
|
list.value = res.data.data.Goods.map((item: any) => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
count: 1,
|
||||||
|
countNum: item.number,
|
||||||
|
checkbox: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const toPage = () => {
|
const toPage = () => {
|
||||||
Taro.switchTab({
|
Taro.switchTab({
|
||||||
@@ -41,6 +122,37 @@ const toPage = () => {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.item {
|
||||||
|
margin-top: 10px;
|
||||||
|
padding: 20px;
|
||||||
|
background-color: white;
|
||||||
|
display: flex;
|
||||||
|
justify-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 200px;
|
||||||
|
height: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
width: 60%;
|
||||||
|
margin-left: 20px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 20px;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.bom {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.bottom-box {
|
.bottom-box {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|||||||
@@ -1,13 +1,36 @@
|
|||||||
<template>
|
<template>
|
||||||
<nut-tabs style="height:100vh" v-model="val" title-scroll name="tab4value" direction="vertical">
|
<nut-tabs style="height:100vh" v-model="val" title-scroll name="tab4value" direction="vertical">
|
||||||
<nut-tab-pane v-for="item in 10" :title="'Tab '+ item"> Tab {{ item }}</nut-tab-pane>
|
<nut-tab-pane v-for="item in list" :title="(item.name as string)"> Tab {{ item.name }}</nut-tab-pane>
|
||||||
</nut-tabs>
|
</nut-tabs>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {ref, onMounted} from 'vue';
|
import Taro from '@tarojs/taro'
|
||||||
|
import {ref} from 'vue'
|
||||||
|
import {getMerTypeList} from '@/api/user'
|
||||||
|
|
||||||
const val = ref('0');
|
const val = ref('0')
|
||||||
|
|
||||||
|
interface List {
|
||||||
|
ID?: number
|
||||||
|
name?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = ref<Array<List>>([])
|
||||||
|
|
||||||
|
Taro.useLoad(() => {
|
||||||
|
getGoodsType()
|
||||||
|
console.log('load')
|
||||||
|
})
|
||||||
|
|
||||||
|
Taro.useDidShow(() => {
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取商品分类
|
||||||
|
const getGoodsType = async () => {
|
||||||
|
const res = await getMerTypeList()
|
||||||
|
list.value = res.data.class
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
4
src/pages/game/gamedetail/index.config.ts
Normal file
4
src/pages/game/gamedetail/index.config.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: "游戏详情",
|
||||||
|
navigationStyle: "custom",
|
||||||
|
});
|
||||||
117
src/pages/game/gamedetail/index.vue
Normal file
117
src/pages/game/gamedetail/index.vue
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view class="head-wrapper" :style="'top:' + statusHeight + 'px'">
|
||||||
|
<view class="head-menu">
|
||||||
|
<Left class="iconfont" @click="returns" />
|
||||||
|
<Home class="iconfont" @click="goHome" />
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- <swiper class="swiper" :autoplay="true" :circular="true">
|
||||||
|
<swiper-item v-for="(item, index) in swiperList" :key="index">
|
||||||
|
<image style="width: 100%" :src="item"></image>
|
||||||
|
</swiper-item>
|
||||||
|
</swiper> -->
|
||||||
|
<view class="box">
|
||||||
|
<view class="line"></view>
|
||||||
|
<view class="game-title"></view>
|
||||||
|
<view class="game-title"></view>
|
||||||
|
<view class="game-title"></view>
|
||||||
|
<view class="game-btn" @click="toGame()">开始游戏</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import {
|
||||||
|
useLoad,
|
||||||
|
getSystemInfoSync,
|
||||||
|
navigateBack,
|
||||||
|
switchTab,
|
||||||
|
navigateTo,
|
||||||
|
} from "@tarojs/taro";
|
||||||
|
import { Left, Home } from "@nutui/icons-vue-taro";
|
||||||
|
var statusBarHeight = (getSystemInfoSync().statusBarHeight as number) - 7;
|
||||||
|
|
||||||
|
const statusHeight = ref<number>(statusBarHeight);
|
||||||
|
|
||||||
|
const swiperList = ref([]);
|
||||||
|
|
||||||
|
useLoad(() => {});
|
||||||
|
|
||||||
|
const returns = () => {
|
||||||
|
navigateBack();
|
||||||
|
};
|
||||||
|
|
||||||
|
const goHome = () => {
|
||||||
|
switchTab({
|
||||||
|
url: "/pages/index/index",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const toGame = () => {
|
||||||
|
navigateTo({
|
||||||
|
url: "/pages/game/gamehome/index",
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.head-wrapper {
|
||||||
|
z-index: 999;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
position: fixed;
|
||||||
|
left: 30px;
|
||||||
|
top: 0;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
.head-menu {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
height: 54px;
|
||||||
|
width: 140px;
|
||||||
|
background: rgba(0, 0, 0, 0.25);
|
||||||
|
border-radius: 27px;
|
||||||
|
.iconfont {
|
||||||
|
flex: 1;
|
||||||
|
text-align: center;
|
||||||
|
color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
|
&.icon-xiangzuo {
|
||||||
|
border-right: 1px solid #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.box {
|
||||||
|
width: 100%;
|
||||||
|
height: 90vh;
|
||||||
|
background-color: #fff;
|
||||||
|
z-index: 1;
|
||||||
|
border-top-left-radius: 20px;
|
||||||
|
border-top-right-radius: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
position: absolute;
|
||||||
|
padding: 20px;
|
||||||
|
top: 400px;
|
||||||
|
|
||||||
|
.line {
|
||||||
|
width: 90px;
|
||||||
|
height: 10px;
|
||||||
|
border-radius: 4px;
|
||||||
|
background-color: rgba(202, 202, 202, 1);
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
.game-btn {
|
||||||
|
width: 300px;
|
||||||
|
height: 75px;
|
||||||
|
margin: 50px auto;
|
||||||
|
color: #fff;
|
||||||
|
background-color: rgba(85, 77, 132, 1);
|
||||||
|
border-radius: 50px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 75px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
3
src/pages/game/gamehome/index.config.ts
Normal file
3
src/pages/game/gamehome/index.config.ts
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: "活动游戏",
|
||||||
|
});
|
||||||
67
src/pages/game/gamehome/index.vue
Normal file
67
src/pages/game/gamehome/index.vue
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<template>
|
||||||
|
<view>
|
||||||
|
<view
|
||||||
|
v-for="item in listVal"
|
||||||
|
:key="item.id"
|
||||||
|
class="list-box"
|
||||||
|
:class="{ listBoxAnim: item.status }"
|
||||||
|
@click="toDetails(item.id)"
|
||||||
|
>
|
||||||
|
<view>摇骰子</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { useLoad, navigateTo } from "@tarojs/taro";
|
||||||
|
|
||||||
|
const listVal = ref<any>([]);
|
||||||
|
|
||||||
|
useLoad(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
const getList = () => {
|
||||||
|
for (let i = 0; i < 1; i++) {
|
||||||
|
setTimeout(() => {
|
||||||
|
listVal.value.push({
|
||||||
|
id: i,
|
||||||
|
status: true,
|
||||||
|
});
|
||||||
|
}, 50 * i);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const toDetails = (id: string) => {
|
||||||
|
navigateTo({
|
||||||
|
url: "/pages/game/gamedetail/index?id=" + id,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.list-box {
|
||||||
|
background-color: #fff;
|
||||||
|
border-radius: 15rpx;
|
||||||
|
width: 630rpx;
|
||||||
|
height: 200rpx;
|
||||||
|
margin: 20rpx auto;
|
||||||
|
padding: 30rpx;
|
||||||
|
font-size: 45rpx;
|
||||||
|
}
|
||||||
|
|
||||||
|
.listBoxAnim {
|
||||||
|
animation: 0.5s leftAnim;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes leftAnim {
|
||||||
|
from {
|
||||||
|
transform: translateX(110%);
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -22,21 +22,22 @@
|
|||||||
<view>
|
<view>
|
||||||
<nut-price
|
<nut-price
|
||||||
size="large"
|
size="large"
|
||||||
:price="8888"
|
:price="goodInfo.number as number"
|
||||||
position="after"
|
position="after"
|
||||||
symbol="积分"
|
symbol="积分"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view class="title"
|
<view class="title"
|
||||||
>MIUCHO可爱卡通学生通勤手提电脑包13.3寸14村女适用苹果联想小米</view
|
>{{ goodInfo.name }}
|
||||||
|
</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<nut-cell title="请选择规格: " is-link @click="openSku"></nut-cell>
|
<nut-cell title="请选择规格: " is-link @click="openSku"></nut-cell>
|
||||||
<!-- 产品介绍 -->
|
<!-- 产品介绍 -->
|
||||||
<view class="rich-box">
|
<view class="rich-box">
|
||||||
<view class="title">产品介绍</view>
|
<view class="title">产品介绍</view>
|
||||||
<view></view>
|
<view v-if="goodInfo.details" v-html="goodInfo.details"></view>
|
||||||
<nut-empty description="暂无产品介绍"></nut-empty>
|
<nut-empty v-else description="暂无产品介绍"></nut-empty>
|
||||||
</view>
|
</view>
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<view class="bottom-box">
|
<view class="bottom-box">
|
||||||
@@ -60,11 +61,13 @@
|
|||||||
<nut-button
|
<nut-button
|
||||||
style="margin-right: 10px"
|
style="margin-right: 10px"
|
||||||
type="warning"
|
type="warning"
|
||||||
@click="addCart()"
|
@click="add_cart()"
|
||||||
>加入购物车</nut-button
|
>加入购物车
|
||||||
|
</nut-button
|
||||||
>
|
>
|
||||||
<nut-button type="primary" @click="toOrderDetail()"
|
<nut-button type="primary" @click="toOrderDetail()"
|
||||||
>立即兑换</nut-button
|
>立即兑换
|
||||||
|
</nut-button
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -75,9 +78,21 @@
|
|||||||
safe-area-inset-bottom
|
safe-area-inset-bottom
|
||||||
closeable
|
closeable
|
||||||
round
|
round
|
||||||
:style="{ height: '45%', zIndex: 1 }"
|
:style="{zIndex: 1 }"
|
||||||
v-model:visible="isSkuShow"
|
v-model:visible="isSkuShow"
|
||||||
></nut-popup>
|
>
|
||||||
|
<view class="sku-box">
|
||||||
|
<view>商品规格</view>
|
||||||
|
<nut-cell-group>
|
||||||
|
<nut-cell title="数量:">
|
||||||
|
<template v-slot:link>
|
||||||
|
<nut-input-number v-model="count" @change="addCount"/>
|
||||||
|
</template>
|
||||||
|
</nut-cell>
|
||||||
|
</nut-cell-group>
|
||||||
|
|
||||||
|
</view>
|
||||||
|
</nut-popup>
|
||||||
<!-- <nut-sku
|
<!-- <nut-sku
|
||||||
v-model:visible="isSkuShow"
|
v-model:visible="isSkuShow"
|
||||||
:sku="sku"
|
:sku="sku"
|
||||||
@@ -86,95 +101,184 @@
|
|||||||
@clickBtnOperate="clickBtnOperate"
|
@clickBtnOperate="clickBtnOperate"
|
||||||
@close="close"
|
@close="close"
|
||||||
></nut-sku> -->
|
></nut-sku> -->
|
||||||
|
<Pay :is-show-pay="isShowPay" pay-type="jf" :jfInfo="orderData" @closePay="closePay"/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
var statusBarHeight = Taro.getSystemInfoSync().statusBarHeight;
|
var statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight
|
||||||
import { ref } from "vue";
|
import {ref} from 'vue'
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro'
|
||||||
import { Left, Home, Cart, My } from "@nutui/icons-vue-taro";
|
import {Left, Home, Cart, My} from '@nutui/icons-vue-taro'
|
||||||
|
import {getGoodsDetail, addCart, createOrder, payOrder} from '@/api/goods'
|
||||||
|
import Pay from '@/components/Pay.vue'
|
||||||
|
|
||||||
|
|
||||||
const BarHeight = ref((statusBarHeight as number) + 7);
|
const BarHeight = ref((statusBarHeight as number) + 7)
|
||||||
|
|
||||||
const swiperList = ref([
|
const swiperList = ref([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/welcomenutui.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/welcomenutui.jpg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/fristfabu.jpg'
|
||||||
},
|
}
|
||||||
]);
|
])
|
||||||
|
|
||||||
const isSkuShow = ref(false);
|
const isSkuShow = ref(false)
|
||||||
|
|
||||||
const sku = ref([]);
|
const isShowPay = ref(false)
|
||||||
|
|
||||||
const goods = ref({});
|
const sku = ref([])
|
||||||
|
|
||||||
|
const orderData = ref([])
|
||||||
|
|
||||||
|
const count = ref(1)
|
||||||
|
|
||||||
|
interface GoodInfo {
|
||||||
|
gid?: number
|
||||||
|
name?: string
|
||||||
|
number?: number
|
||||||
|
cover?: string
|
||||||
|
details?: string
|
||||||
|
sku?: any[]
|
||||||
|
stock?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const goodInfo = ref<GoodInfo>({})
|
||||||
|
|
||||||
|
Taro.useLoad((options) => {
|
||||||
|
get_good_detail(options.gid)
|
||||||
|
})
|
||||||
|
|
||||||
|
const get_good_detail = async (gid: string) => {
|
||||||
|
try {
|
||||||
|
const res = await getGoodsDetail({gid: Number(gid)})
|
||||||
|
goodInfo.value = res.data.data
|
||||||
|
} catch (e) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: e.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const addCount = () => {
|
||||||
|
if (count.value >= (goodInfo.value.stock as number)) {
|
||||||
|
count.value = goodInfo.value.stock as number
|
||||||
|
Taro.showToast({
|
||||||
|
title: '库存不足',
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const returns = () => {
|
const returns = () => {
|
||||||
Taro.navigateBack({
|
Taro.navigateBack({
|
||||||
delta: 1,
|
delta: 1
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const goHome = () => {
|
const goHome = () => {
|
||||||
Taro.switchTab({
|
Taro.switchTab({
|
||||||
url: "/pages/index/index",
|
url: '/pages/index/index'
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const openSku = () => {
|
const openSku = () => {
|
||||||
isSkuShow.value = true;
|
isSkuShow.value = true
|
||||||
};
|
}
|
||||||
|
|
||||||
const selectSku = () => {};
|
const selectSku = () => {
|
||||||
const clickBtnOperate = () => {};
|
}
|
||||||
const close = () => {};
|
const clickBtnOperate = () => {
|
||||||
|
}
|
||||||
const addCart = () => {
|
const close = () => {
|
||||||
if (isSkuShow.value === false) return openSku();
|
}
|
||||||
|
const add_cart = async () => {
|
||||||
|
if (isSkuShow.value === false) return openSku()
|
||||||
|
try {
|
||||||
|
await addCart({gid: Number(goodInfo.value.gid)})
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "加入购物车成功",
|
title: '加入购物车成功',
|
||||||
icon: "none",
|
icon: 'success',
|
||||||
});
|
duration: 2000
|
||||||
isSkuShow.value = false;
|
})
|
||||||
};
|
} catch (e) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: e.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
isSkuShow.value = false
|
||||||
|
}
|
||||||
|
|
||||||
const toOrderDetail = () => {
|
const toOrderDetail = async () => {
|
||||||
if (isSkuShow.value === false) return openSku();
|
if (isSkuShow.value === false) return openSku()
|
||||||
Taro.navigateTo({
|
// Taro.navigateTo({
|
||||||
url: "/pages/goods/order_create/index",
|
// url: '/pages/goods/order_create/index'
|
||||||
});
|
// })
|
||||||
isSkuShow.value = false;
|
try {
|
||||||
};
|
const {data} = await createOrder([
|
||||||
|
{
|
||||||
|
gid: Number(goodInfo.value.gid),
|
||||||
|
count: Number(count.value)
|
||||||
|
}
|
||||||
|
])
|
||||||
|
// 删除不必要的字段
|
||||||
|
// orderData.value = data.data.map((item: any) => {
|
||||||
|
// delete item.ID
|
||||||
|
// delete item.uid
|
||||||
|
// delete item.status
|
||||||
|
// delete item.add_time
|
||||||
|
// delete item.expires
|
||||||
|
// return item
|
||||||
|
// })
|
||||||
|
orderData.value = data.data
|
||||||
|
|
||||||
|
isShowPay.value = true
|
||||||
|
|
||||||
|
} catch (e) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: e.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
isSkuShow.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
const closePay = (val: boolean) => {
|
||||||
|
isShowPay.value = val
|
||||||
|
orderData.value = []
|
||||||
|
}
|
||||||
|
|
||||||
const toPage = (url: string, type: number = 1) => {
|
const toPage = (url: string, type: number = 1) => {
|
||||||
if (type === 1) {
|
if (type === 1) {
|
||||||
Taro.switchTab({
|
Taro.switchTab({
|
||||||
url: url,
|
url: url
|
||||||
});
|
})
|
||||||
} else {
|
} else {
|
||||||
// Taro.navigateTo({
|
// Taro.navigateTo({
|
||||||
// url: url,
|
// url: url,
|
||||||
// });
|
// });
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "暂未开放",
|
title: '暂未开放',
|
||||||
icon: "none",
|
icon: 'none'
|
||||||
});
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -183,27 +287,30 @@ const toPage = (url: string, type: number = 1) => {
|
|||||||
background-color: rgba(0, 0, 0, 0.5);
|
background-color: rgba(0, 0, 0, 0.5);
|
||||||
z-index: 1 !important;
|
z-index: 1 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.head-wrapper {
|
.head-wrapper {
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
left: 30rpx;
|
left: 30px;
|
||||||
top: 0;
|
top: 0;
|
||||||
/* #ifdef MP */
|
/* #ifdef MP */
|
||||||
// height: 43px;
|
// height: 43px;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
/* #ifdef H5 */
|
/* #ifdef H5 */
|
||||||
height: 114rpx;
|
height: 114px;
|
||||||
/* #endif */
|
/* #endif */
|
||||||
}
|
}
|
||||||
|
|
||||||
.head-menu {
|
.head-menu {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: 54rpx;
|
height: 54px;
|
||||||
width: 140rpx;
|
width: 140px;
|
||||||
background: rgba(0, 0, 0, 0.25);
|
background: rgba(0, 0, 0, 0.25);
|
||||||
border-radius: 27rpx;
|
border-radius: 27px;
|
||||||
|
|
||||||
.iconfont {
|
.iconfont {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@@ -235,6 +342,7 @@ const toPage = (url: string, type: number = 1) => {
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 15px 0;
|
padding: 15px 0;
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-size: 30px;
|
font-size: 30px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
@@ -248,6 +356,10 @@ const toPage = (url: string, type: number = 1) => {
|
|||||||
padding-bottom: env(safe-area-inset-bottom);
|
padding-bottom: env(safe-area-inset-bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sku-box {
|
||||||
|
padding: 100px 50px;
|
||||||
|
}
|
||||||
|
|
||||||
.bottom-box {
|
.bottom-box {
|
||||||
border-top: 1px solid #e5e5e585;
|
border-top: 1px solid #e5e5e585;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { Find } from "@nutui/icons-vue-taro";
|
import { Find } from "@nutui/icons-vue-taro";
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from "@tarojs/taro";
|
||||||
import { calculateDistance } from "../../../utils";
|
import { calculateDistance } from "@/utils";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
const distance = ref("");
|
const distance = ref("");
|
||||||
|
|||||||
@@ -35,23 +35,24 @@
|
|||||||
<view class="goodBox">
|
<view class="goodBox">
|
||||||
<view
|
<view
|
||||||
class="good"
|
class="good"
|
||||||
v-for="item in 5"
|
v-for="item in list"
|
||||||
:key="item"
|
:key="item.gid"
|
||||||
@click.stop="toGoodDetails(item)"
|
@click.stop="toGoodDetails(item.gid as number)"
|
||||||
>
|
>
|
||||||
<image
|
<image
|
||||||
src="https://cdn-we-retail.ym.tencent.com/tsr/goods/nz-09a.png?imageMogr2/thumbnail/564x564/quality/70/strip/format/webp"
|
:src="item.cover"
|
||||||
/>
|
/>
|
||||||
<view class="good-text-box">
|
<view class="good-text-box">
|
||||||
<text class="good-text"
|
<text class="good-text"
|
||||||
>白色短袖连衣裙荷叶边裙摆宽松韩版休闲纯白清爽优雅连衣裙</text
|
>{{ item.name }}
|
||||||
|
</text
|
||||||
>
|
>
|
||||||
<view class="good-price-box">
|
<view class="good-price-box">
|
||||||
<text class="good-text-price">
|
<text class="good-text-price">
|
||||||
<text style="font-size: 20px">188</text>
|
<text style="font-size: 20px">{{ item.number }}</text>
|
||||||
积分
|
积分
|
||||||
</text>
|
</text>
|
||||||
<Cart size="20" color="#ff0000" @click.stop="addCart()" />
|
<Cart size="20" color="#ff0000" @click.stop="add_cart(item.gid)"/>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -60,78 +61,113 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import {ref} from 'vue'
|
||||||
import { Cart } from "@nutui/icons-vue-taro";
|
import {Cart} from '@nutui/icons-vue-taro'
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro'
|
||||||
|
import {getBanner} from '@/api/user'
|
||||||
|
import {getGoodsList, addCart} from '@/api/goods'
|
||||||
|
|
||||||
const searchValue = ref("");
|
const searchValue = ref('')
|
||||||
// const tabvalue = ref("0");
|
// const tabvalue = ref("0");
|
||||||
|
|
||||||
const swiperList = ref([
|
const swiperList = ref([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/welcomenutui.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/welcomenutui.jpg'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
url: "https://storage.360buyimg.com/jdc-article/fristfabu.jpg",
|
url: 'https://storage.360buyimg.com/jdc-article/fristfabu.jpg'
|
||||||
},
|
}
|
||||||
]);
|
])
|
||||||
|
|
||||||
const userMenuList = ref([
|
const userMenuList = ref([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
label: "活动游戏",
|
label: '活动游戏',
|
||||||
url: "",
|
url: '/pages/game/gamehome/index',
|
||||||
icon: "http://jdt168.com/uploads/merchant/20220829/caad6be8983e88c41d28da7d124bc37b.png",
|
icon: 'http://jdt168.com/uploads/merchant/20220829/caad6be8983e88c41d28da7d124bc37b.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
label: "活动商品",
|
label: '活动商品',
|
||||||
url: "",
|
url: '',
|
||||||
icon: "http://jdt168.com/uploads/def/20230509/d59e7fcb65a88bc56694dae4f9d21b51.png",
|
icon: 'http://jdt168.com/uploads/def/20230509/d59e7fcb65a88bc56694dae4f9d21b51.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
label: "商户入驻",
|
label: '商户入驻',
|
||||||
url: "/pages/users/settled_mer/index",
|
url: '/pages/users/settled_mer/index',
|
||||||
icon: "http://jdt168.com/uploads/merchant/20220829/6fe67b93721a42aedc842c4f19d6f2d3.png",
|
icon: 'http://jdt168.com/uploads/merchant/20220829/6fe67b93721a42aedc842c4f19d6f2d3.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
label: "最新资讯",
|
label: '最新资讯',
|
||||||
url: "",
|
url: '',
|
||||||
icon: "http://jdt168.com/uploads/merchant/20220829/b975136a9b64aab69bf11d75a194f1ea.png",
|
icon: 'http://jdt168.com/uploads/merchant/20220829/b975136a9b64aab69bf11d75a194f1ea.png'
|
||||||
},
|
}
|
||||||
]);
|
])
|
||||||
|
|
||||||
const addCart = () => {
|
interface List {
|
||||||
|
gid?: number
|
||||||
|
name?: string
|
||||||
|
number?: number
|
||||||
|
cover?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const list = ref<Array<List>>([])
|
||||||
|
|
||||||
|
Taro.useLoad(() => {
|
||||||
|
getBannerList()
|
||||||
|
get_goods_list()
|
||||||
|
})
|
||||||
|
|
||||||
|
const get_goods_list = async () => {
|
||||||
|
const {data} = await getGoodsList()
|
||||||
|
list.value = data.data
|
||||||
|
}
|
||||||
|
|
||||||
|
const getBannerList = async () => {
|
||||||
|
const {data}: any = await getBanner()
|
||||||
|
console.log(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
const add_cart = async (gid: number) => {
|
||||||
|
try {
|
||||||
|
await addCart({gid: Number(gid)})
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "加入购物车成功",
|
title: '加入购物车成功',
|
||||||
icon: "success",
|
icon: 'success',
|
||||||
duration: 2000,
|
duration: 2000
|
||||||
});
|
})
|
||||||
};
|
} catch (e) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: e.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
const toPage = (url: string) => {
|
const toPage = (url: string) => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: url,
|
url: url
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const toGoodDetails = (item: number) => {
|
const toGoodDetails = (gid: number) => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/goods/goods_detail/index?id=${item}`,
|
url: `/pages/goods/goods_detail/index?gid=${gid}`
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -150,7 +186,7 @@ const toGoodDetails = (item: number) => {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
background-image: url("../../static/index/index-title.png");
|
background-image: url("~@/static/index/index-title.png");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-size: 50%;
|
background-size: 50%;
|
||||||
@@ -196,12 +232,10 @@ const toGoodDetails = (item: number) => {
|
|||||||
color: #333;
|
color: #333;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
height: 72px;
|
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
line-height: 36px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.good-price-box {
|
.good-price-box {
|
||||||
|
|||||||
@@ -8,14 +8,15 @@
|
|||||||
<view class="user-center-card__header__avatar">
|
<view class="user-center-card__header__avatar">
|
||||||
<nut-avatar size="large">
|
<nut-avatar size="large">
|
||||||
<img
|
<img
|
||||||
src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png"
|
:src="userInfo.avatarUrl"
|
||||||
/>
|
/>
|
||||||
</nut-avatar>
|
</nut-avatar>
|
||||||
</view>
|
</view>
|
||||||
<view class="user-center-card__header__info">
|
<view class="user-center-card__header__info">
|
||||||
<view class="user-center-card__header__info__name">小明</view>
|
<view class="user-center-card__header__info__name">{{ userInfo.nickName }}</view>
|
||||||
<view class="user-center-card__header__info__desc"
|
<view class="user-center-card__header__info__desc"
|
||||||
>ID:{{ 1 }}</view
|
>ID:{{ userInfo.ID }}
|
||||||
|
</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
<view class="rightIcon">
|
<view class="rightIcon">
|
||||||
@@ -34,7 +35,8 @@
|
|||||||
<view
|
<view
|
||||||
class="user-center-card__header__info__name"
|
class="user-center-card__header__info__name"
|
||||||
@tap="clickLogin"
|
@tap="clickLogin"
|
||||||
>点击立即授权</view
|
>点击立即授权
|
||||||
|
</view
|
||||||
>
|
>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@@ -74,8 +76,10 @@
|
|||||||
<view class="box">
|
<view class="box">
|
||||||
<view
|
<view
|
||||||
class="box-mini"
|
class="box-mini"
|
||||||
|
v-if="isLogin"
|
||||||
v-for="item in userMenuList"
|
v-for="item in userMenuList"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
@click="toPage(item.url)"
|
||||||
>
|
>
|
||||||
<!-- <image :src="item.icon" /> -->
|
<!-- <image :src="item.icon" /> -->
|
||||||
<IconFont size="40" :name="item.icon"></IconFont>
|
<IconFont size="40" :name="item.icon"></IconFont>
|
||||||
@@ -85,7 +89,7 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 商家管理 -->
|
<!-- 商家管理 -->
|
||||||
<view class="mer-box">
|
<view class="mer-box" v-if="userInfo.bid !== 0">
|
||||||
<nut-grid :gutter="10" :border="false">
|
<nut-grid :gutter="10" :border="false">
|
||||||
<nut-grid-item
|
<nut-grid-item
|
||||||
:border="false"
|
:border="false"
|
||||||
@@ -105,14 +109,17 @@
|
|||||||
</nut-grid-item>
|
</nut-grid-item>
|
||||||
</nut-grid>
|
</nut-grid>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<!-- 版权 -->
|
||||||
|
<!--<view class="copy">© 2023 </view>-->
|
||||||
</view>
|
</view>
|
||||||
<!-- 登录 -->
|
<!-- 登录 -->
|
||||||
<Auth :visible="isShowLogin" @update:visible="cancelLogin" />
|
<Auth :visible="isShowLogin" @update:visible="cancelLogin" @ok="getUserInfo"/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import {ref} from 'vue'
|
||||||
import {
|
import {
|
||||||
ArrowRight,
|
ArrowRight,
|
||||||
Order,
|
Order,
|
||||||
@@ -120,40 +127,60 @@ import {
|
|||||||
Clock,
|
Clock,
|
||||||
Shop,
|
Shop,
|
||||||
Setting,
|
Setting,
|
||||||
IconFont,
|
IconFont
|
||||||
} from "@nutui/icons-vue-taro";
|
} from '@nutui/icons-vue-taro'
|
||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro'
|
||||||
import Auth from "../../components/Auth.vue";
|
import Auth from '@/components/Auth.vue'
|
||||||
|
import {getPersonalInfo} from '@/api/user'
|
||||||
|
|
||||||
const isShowLogin = ref(false);
|
const isShowLogin = ref(false)
|
||||||
|
|
||||||
const isLogin = ref(false);
|
const isLogin = ref(false)
|
||||||
|
|
||||||
// const userInfo = ref({});
|
interface UserInfo {
|
||||||
|
nickName?: string
|
||||||
|
avatarUrl?: string
|
||||||
|
ID?: string
|
||||||
|
bid?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const userInfo = ref<UserInfo>({})
|
||||||
|
|
||||||
Taro.useLoad(() => {
|
Taro.useLoad(() => {
|
||||||
const token = Taro.getStorageSync("token");
|
const token = Taro.getStorageSync('token')
|
||||||
if (token) {
|
if (token) {
|
||||||
isLogin.value = true;
|
getUserInfo()
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
const cancelLogin = () => {
|
const cancelLogin = () => {
|
||||||
isShowLogin.value = false;
|
isShowLogin.value = false
|
||||||
};
|
}
|
||||||
|
|
||||||
|
const getUserInfo = async () => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: '加载中'
|
||||||
|
})
|
||||||
|
const res = await getPersonalInfo()
|
||||||
|
userInfo.value = res.data.data
|
||||||
|
Taro.setStorageSync('userInfo', res.data.data)
|
||||||
|
isLogin.value = true
|
||||||
|
cancelLogin()
|
||||||
|
Taro.hideLoading()
|
||||||
|
}
|
||||||
|
|
||||||
const toOrderList = (e: number) => {
|
const toOrderList = (e: number) => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: `/pages/users/order_list/index?type=${e}`,
|
url: `/pages/users/order_list/index?type=${e}`
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const userMenuList = ref([
|
const userMenuList = ref([
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
label: "我的账户",
|
label: '我的账户',
|
||||||
url: "/pages/users/account/index",
|
url: '/pages/users/account/index',
|
||||||
icon: "http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png",
|
icon: 'http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png'
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// id: 2,
|
// id: 2,
|
||||||
@@ -163,39 +190,40 @@ const userMenuList = ref([
|
|||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
label: "分销中心",
|
label: '分销中心',
|
||||||
url: "/pages/users/account/index",
|
url: '',
|
||||||
icon: "http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png",
|
icon: 'http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
label: "关注商家",
|
label: '关注商家',
|
||||||
url: "/pages/users/account/index",
|
url: '',
|
||||||
icon: "http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png",
|
icon: 'http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 5,
|
id: 5,
|
||||||
label: "问题反馈",
|
label: '问题反馈',
|
||||||
url: "/pages/users/account/index",
|
url: '',
|
||||||
icon: "http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png",
|
icon: 'http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png'
|
||||||
},
|
}
|
||||||
]);
|
])
|
||||||
|
|
||||||
const toSetting = () => {
|
const toSetting = () => {
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: "/pages/users/setting/index",
|
url: '/pages/users/setting/index'
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
const clickLogin = () => {
|
const clickLogin = () => {
|
||||||
isShowLogin.value = true;
|
isShowLogin.value = true
|
||||||
};
|
}
|
||||||
|
|
||||||
const toPage = (url: string) => {
|
const toPage = (url: string) => {
|
||||||
|
console.log(url)
|
||||||
Taro.navigateTo({
|
Taro.navigateTo({
|
||||||
url: url,
|
url: url
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@@ -210,6 +238,12 @@ const toPage = (url: string) => {
|
|||||||
color: var(--nut-grid-item-text-color, var(--nut-title-color2, #666666));
|
color: var(--nut-grid-item-text-color, var(--nut-title-color2, #666666));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.user-center-card__header__avatar {
|
||||||
|
img {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.user-center-card__header__transparent {
|
.user-center-card__header__transparent {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 30px;
|
left: 30px;
|
||||||
@@ -321,7 +355,6 @@ const toPage = (url: string) => {
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
//padding: 30px;
|
|
||||||
width: 710px;
|
width: 710px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
export default definePageConfig({
|
||||||
|
navigationBarTitleText: '我的账户'
|
||||||
|
})
|
||||||
@@ -1,15 +1,73 @@
|
|||||||
<script lang="ts">
|
<script lang="ts" setup>
|
||||||
import {defineComponent} from 'vue'
|
|
||||||
|
|
||||||
export default defineComponent({
|
|
||||||
name: "index"
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
$END$
|
<view>
|
||||||
|
<view class="card">
|
||||||
|
<view class="greeting">Hello! YuanHuakk</view>
|
||||||
|
<view class="info">
|
||||||
|
<view class="left">
|
||||||
|
<view>
|
||||||
|
<view class="num">豆子:188888</view>
|
||||||
|
</view>
|
||||||
|
<view>
|
||||||
|
<view class="num">积分:188888</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<image class="img" src="https://picdm.sunbangyan.cn/2023/08/15/ste192.png"/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
//background-color: #111;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 90%;
|
||||||
|
height: 300px;
|
||||||
|
border-radius: 20px;
|
||||||
|
background-color: #282828;
|
||||||
|
box-shadow: 0 0 10px rgba(40, 40, 40, 0.1);
|
||||||
|
background-size: 100% 100%;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
margin: 10px auto;
|
||||||
|
color: #D0A568;
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
|
.greeting {
|
||||||
|
font-size: 35px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
height: 300px;
|
||||||
|
width: 50%;
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.num {
|
||||||
|
font-size: 40px;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-top: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.img {
|
||||||
|
width: 380px;
|
||||||
|
height: 270px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,7 +1,14 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import Taro from "@tarojs/taro";
|
import {
|
||||||
import Pay from "../../../components/Pay.vue";
|
useLoad,
|
||||||
|
useReachBottom,
|
||||||
|
showToast,
|
||||||
|
navigateTo,
|
||||||
|
setStorageSync,
|
||||||
|
} from "@tarojs/taro";
|
||||||
|
import Pay from "@/components/Pay.vue";
|
||||||
|
import { getIntegralOrderList } from "@/api/user";
|
||||||
|
|
||||||
const tabValue = ref(0);
|
const tabValue = ref(0);
|
||||||
|
|
||||||
@@ -35,38 +42,79 @@ const tabsList = ref([
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const orderList = ref([{}]);
|
const jfInfo = ref({});
|
||||||
|
|
||||||
Taro.useLoad((options) => {
|
interface OrderList {
|
||||||
|
add_time: string;
|
||||||
|
status: number;
|
||||||
|
BindGoods: {
|
||||||
|
cover: string;
|
||||||
|
name: string;
|
||||||
|
number: number;
|
||||||
|
};
|
||||||
|
count: number;
|
||||||
|
number: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const orderList = ref<OrderList[]>([]);
|
||||||
|
|
||||||
|
useLoad((options) => {
|
||||||
tabValue.value = Number(options.type);
|
tabValue.value = Number(options.type);
|
||||||
|
getList();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const getList = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getIntegralOrderList({
|
||||||
|
status: tabValue.value,
|
||||||
|
});
|
||||||
|
console.log(res);
|
||||||
|
orderList.value = res.data.data;
|
||||||
|
} catch (error) {
|
||||||
|
showToast({
|
||||||
|
title: error.msg,
|
||||||
|
icon: "none",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const tabChange = (index: number) => {
|
const tabChange = (index: number) => {
|
||||||
tabValue.value = index;
|
tabValue.value = index;
|
||||||
|
getList();
|
||||||
};
|
};
|
||||||
|
|
||||||
Taro.useReachBottom(() => {
|
useReachBottom(() => {
|
||||||
console.log("useReachBottom");
|
console.log("useReachBottom");
|
||||||
});
|
});
|
||||||
|
|
||||||
const openPay = () => {
|
const openPay = (item: OrderList) => {
|
||||||
console.log("openPay");
|
console.log("openPay", item);
|
||||||
isShowPay.value = true;
|
isShowPay.value = true;
|
||||||
|
jfInfo.value = item;
|
||||||
};
|
};
|
||||||
|
|
||||||
const errPay = () => {
|
const errPay = () => {
|
||||||
isShowPay.value = false;
|
isShowPay.value = false;
|
||||||
Taro.showToast({
|
showToast({
|
||||||
title: "支付失败",
|
title: "支付失败",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
jfInfo.value = {};
|
||||||
};
|
};
|
||||||
const closePay = () => {
|
const closePay = () => {
|
||||||
isShowPay.value = false;
|
isShowPay.value = false;
|
||||||
Taro.showToast({
|
showToast({
|
||||||
title: "支付取消",
|
title: "支付取消",
|
||||||
icon: "none",
|
icon: "none",
|
||||||
});
|
});
|
||||||
|
jfInfo.value = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
const toDetail = (item: any) => {
|
||||||
|
setStorageSync("item", item);
|
||||||
|
navigateTo({
|
||||||
|
url: `/pages/users/order_list_detail/index?orderId=${item.oid}`,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -77,8 +125,7 @@ const closePay = () => {
|
|||||||
<view style="font-weight: bold">订单信息</view>
|
<view style="font-weight: bold">订单信息</view>
|
||||||
<view style="font-size: 15px"
|
<view style="font-size: 15px"
|
||||||
>消费订单:{{ 10 || 0 }} 总消费积分:{{ 12312 || 0 }}
|
>消费订单:{{ 10 || 0 }} 总消费积分:{{ 12312 || 0 }}
|
||||||
</view
|
</view>
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
<image src="../static/user/order_list_top.png" />
|
<image src="../static/user/order_list_top.png" />
|
||||||
</view>
|
</view>
|
||||||
@@ -97,80 +144,80 @@ const closePay = () => {
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view v-if="orderList.length > 0">
|
<view v-if="orderList.length > 0">
|
||||||
<view class="order-card" v-for="item in 10" :key="item">
|
<view
|
||||||
|
class="order-card"
|
||||||
|
v-for="(item, index) in orderList"
|
||||||
|
:key="index"
|
||||||
|
>
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<view>2023-08-14 14:24:23</view>
|
<view>{{ item.add_time.slice(0, 19) }}</view>
|
||||||
<view style="color: red">待付款</view>
|
<view style="color: red">{{
|
||||||
|
item.status === 1
|
||||||
|
? "待付款"
|
||||||
|
: item.status === 2
|
||||||
|
? "待使用"
|
||||||
|
: item.status === 3
|
||||||
|
? "已使用"
|
||||||
|
: "已失效"
|
||||||
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="center">
|
<view class="center">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<image src="../static/user/order_list_top.png"/>
|
<image :src="item.BindGoods.cover" />
|
||||||
<view class="title"
|
<view class="title">{{ item.BindGoods.name }} </view>
|
||||||
>商品名称商品名称商品名称商品名称商品名称商品名称商品名称商品名称
|
|
||||||
</view
|
|
||||||
>
|
|
||||||
<view class="right">
|
<view class="right">
|
||||||
<view>123.00</view>
|
<view>{{ item.BindGoods.number }}</view>
|
||||||
<view>x1</view>
|
<view>x{{ item.count }}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view
|
<view
|
||||||
class="bom"
|
class="bom"
|
||||||
style="text-align: right; font-size: 13px"
|
style="text-align: right; font-size: 13px"
|
||||||
>
|
>
|
||||||
共10件商品,实付积分:
|
共{{ item.count }}件商品,实付积分:
|
||||||
<text style="color: red"
|
<text style="color: red">{{ item.number }}</text>
|
||||||
>123.00
|
|
||||||
</text
|
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
<nut-button plain size="small" type="primary"
|
<nut-button
|
||||||
|
v-if="item.status === 0"
|
||||||
|
plain
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
>取消订单
|
>取消订单
|
||||||
</nut-button
|
</nut-button>
|
||||||
>
|
|
||||||
<nut-button
|
<nut-button
|
||||||
style="margin-left: 5px"
|
style="margin-left: 5px"
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@click="toDetail(item)"
|
||||||
>查看详情
|
>查看详情
|
||||||
</nut-button
|
</nut-button>
|
||||||
>
|
|
||||||
<nut-button
|
<nut-button
|
||||||
style="margin-left: 5px"
|
style="margin-left: 5px"
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
@click="openPay()"
|
v-if="item.status === 0"
|
||||||
|
@click="openPay(item)"
|
||||||
>立即付款
|
>立即付款
|
||||||
</nut-button
|
</nut-button>
|
||||||
>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<nut-empty v-else description="暂无订单"></nut-empty>
|
<nut-empty v-else description="暂无订单"></nut-empty>
|
||||||
<pay
|
<pay
|
||||||
:isShowPay="isShowPay"
|
:isShowPay="isShowPay"
|
||||||
payType="wx"
|
payType="jf"
|
||||||
@errPay="errPay"
|
@errPay="errPay"
|
||||||
@closePay="closePay"
|
@closePay="closePay"
|
||||||
|
:jfInfo="jfInfo"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
page {
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
scroll-view {
|
|
||||||
// IOS安全区域
|
|
||||||
padding-bottom: constant(safe-area-inset-bottom);
|
|
||||||
padding-bottom: env(safe-area-inset-bottom);
|
|
||||||
}
|
|
||||||
|
|
||||||
.topTips {
|
.topTips {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -246,7 +293,7 @@ scroll-view {
|
|||||||
.top {
|
.top {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
// align-items: flex-start;
|
||||||
|
|
||||||
image {
|
image {
|
||||||
width: 150px;
|
width: 150px;
|
||||||
|
|||||||
@@ -1,7 +1,354 @@
|
|||||||
<template>
|
<template>
|
||||||
<view>这里是订单详情</view>
|
<view>
|
||||||
|
<!-- 步骤条 -->
|
||||||
|
<view class="step-bar">
|
||||||
|
<view
|
||||||
|
class="item"
|
||||||
|
v-for="item in statusList"
|
||||||
|
:key="item.id"
|
||||||
|
:class="{ activation: item.id === goodInfo.status }"
|
||||||
|
>
|
||||||
|
<view class="text">{{ item.text }}</view>
|
||||||
|
<view class="dot"></view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<!-- 商家信息 -->
|
||||||
|
<view class="mer-info">
|
||||||
|
<view class="left">
|
||||||
|
<view>
|
||||||
|
<text>{{ goodInfo.BindStore.name }}</text>
|
||||||
|
<text>{{ goodInfo.BindStore.phone }}</text>
|
||||||
|
</view>
|
||||||
|
<nut-ellipsis
|
||||||
|
:rows="2"
|
||||||
|
:content="goodInfo.BindStore.address"
|
||||||
|
direction="end"
|
||||||
|
></nut-ellipsis>
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view class="icon" @click="toPhone">
|
||||||
|
<Service />
|
||||||
|
<text>电话</text>
|
||||||
|
</view>
|
||||||
|
<view class="icon" @click="toAdder">
|
||||||
|
<Find />
|
||||||
|
<text>导航</text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 订单信息 -->
|
||||||
|
<nut-cell-group>
|
||||||
|
<nut-cell :title="`共${goodInfo.count}件商品`"></nut-cell>
|
||||||
|
<nut-cell>
|
||||||
|
<template #default>
|
||||||
|
<view class="top">
|
||||||
|
<image :src="goodInfo.BindGoods.cover" />
|
||||||
|
<view class="title"
|
||||||
|
>{{ goodInfo.BindGoods.name }}
|
||||||
|
</view>
|
||||||
|
<view class="right">
|
||||||
|
<view>{{ goodInfo.BindGoods.number }}</view>
|
||||||
|
<view>x{{ goodInfo.count }}</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</nut-cell>
|
||||||
|
<nut-cell title="订单号:" :desc="goodInfo.oid"></nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="下单时间:"
|
||||||
|
:desc="goodInfo.add_time.slice(0, 19)"
|
||||||
|
></nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="支付状态:"
|
||||||
|
:desc="
|
||||||
|
goodInfo.status === 0
|
||||||
|
? '待付款'
|
||||||
|
: goodInfo.status === 1
|
||||||
|
? '待使用'
|
||||||
|
: goodInfo.status === 2
|
||||||
|
? '已使用'
|
||||||
|
: '已失效'
|
||||||
|
"
|
||||||
|
></nut-cell>
|
||||||
|
<nut-cell
|
||||||
|
title="商品总价(积分):"
|
||||||
|
:desc="goodInfo.number"
|
||||||
|
></nut-cell>
|
||||||
|
<nut-cell>
|
||||||
|
<template #default>
|
||||||
|
<view style="text-align: right; width: 100%">
|
||||||
|
<view
|
||||||
|
>实付款(积分):
|
||||||
|
<nut-price
|
||||||
|
:price="goodInfo.number"
|
||||||
|
size="normal"
|
||||||
|
:need-symbol="false"
|
||||||
|
/>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</template>
|
||||||
|
</nut-cell>
|
||||||
|
</nut-cell-group>
|
||||||
|
<view class="btn">
|
||||||
|
<nut-button
|
||||||
|
plain
|
||||||
|
v-if="goodInfo.status === 0"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
>取消订单
|
||||||
|
</nut-button>
|
||||||
|
<nut-button
|
||||||
|
v-if="goodInfo.status === 0"
|
||||||
|
style="margin-left: 5px"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="openPay()"
|
||||||
|
>立即付款
|
||||||
|
</nut-button>
|
||||||
|
<nut-button
|
||||||
|
v-if="goodInfo.status === 1"
|
||||||
|
style="margin-left: 5px"
|
||||||
|
size="small"
|
||||||
|
type="primary"
|
||||||
|
@click="openCode()"
|
||||||
|
>出示核销码
|
||||||
|
</nut-button>
|
||||||
|
</view>
|
||||||
|
|
||||||
|
<!-- 核销码弹窗 -->
|
||||||
|
<nut-popup
|
||||||
|
v-model:visible="isShowCode"
|
||||||
|
position="bottom"
|
||||||
|
:style="{ height: 'auto' }"
|
||||||
|
:maskClosable="true"
|
||||||
|
safe-area-inset-bottom
|
||||||
|
@closed="closed"
|
||||||
|
>
|
||||||
|
<view class="code-box">
|
||||||
|
<view>请出示核销码核销</view>
|
||||||
|
<image class="qrcode" :src="url"></image>
|
||||||
|
</view>
|
||||||
|
</nut-popup>
|
||||||
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts"></script>
|
<script setup lang="ts">
|
||||||
|
import {
|
||||||
|
useLoad,
|
||||||
|
getStorageSync,
|
||||||
|
makePhoneCall,
|
||||||
|
openLocation,
|
||||||
|
} from "@tarojs/taro";
|
||||||
|
import { Service, Find } from "@nutui/icons-vue-taro";
|
||||||
|
import { ref } from "vue";
|
||||||
|
|
||||||
<style lang="scss"></style>
|
const goodInfo = ref<any>({});
|
||||||
|
|
||||||
|
const statusList = ref([
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
text: "待付款",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
text: "待使用",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
text: "已使用",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
text: "已失效",
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
|
const isShowCode = ref(false);
|
||||||
|
|
||||||
|
const url = ref("");
|
||||||
|
|
||||||
|
useLoad((options) => {
|
||||||
|
console.log("options", options);
|
||||||
|
goodInfo.value = getStorageSync("item");
|
||||||
|
});
|
||||||
|
|
||||||
|
const toPhone = () => {
|
||||||
|
makePhoneCall({
|
||||||
|
phoneNumber: goodInfo.value.BindStore.phone,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const toAdder = () => {
|
||||||
|
openLocation({
|
||||||
|
latitude: Number(goodInfo.value.BindStore.lat),
|
||||||
|
longitude: Number(goodInfo.value.BindStore.lon),
|
||||||
|
scale: 18,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const openPay = () => {};
|
||||||
|
|
||||||
|
const openCode = () => {
|
||||||
|
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`;
|
||||||
|
isShowCode.value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const closed = () => {
|
||||||
|
isShowCode.value = false;
|
||||||
|
url.value = "";
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
page {
|
||||||
|
height: 100vh;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-bottom: 100px;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.step-bar {
|
||||||
|
width: 100%;
|
||||||
|
height: 100px;
|
||||||
|
background: #fff;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.item {
|
||||||
|
width: 200px;
|
||||||
|
height: 100px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
font-size: small;
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 25px;
|
||||||
|
height: 25px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #cecece;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.activation {
|
||||||
|
.text {
|
||||||
|
color: #ff0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
background: #ff0000;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
content: "";
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: #fff;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
top: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.mer-info {
|
||||||
|
background-color: white;
|
||||||
|
padding: 20px 30px;
|
||||||
|
margin-top: 10px;
|
||||||
|
width: 100%;
|
||||||
|
box-sizing: border-box;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.left {
|
||||||
|
width: 50%;
|
||||||
|
|
||||||
|
text {
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.address {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-line-clamp: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
color: #858585;
|
||||||
|
text-align: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 120px;
|
||||||
|
justify-content: space-between;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
//margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
box-sizing: border-box;
|
||||||
|
background-color: #fff;
|
||||||
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
padding: 20px;
|
||||||
|
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
align-items: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.top {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
image {
|
||||||
|
width: 150px;
|
||||||
|
height: 150px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
margin-left: 10px;
|
||||||
|
display: -webkit-box;
|
||||||
|
overflow: hidden;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
width: 350px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
margin-left: 10px;
|
||||||
|
font-size: 28px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.code-box {
|
||||||
|
padding: 20px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
text-align: center;
|
||||||
|
font-size: large;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qrcode {
|
||||||
|
width: 300px;
|
||||||
|
height: 300px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
export default definePageConfig({
|
export default definePageConfig({
|
||||||
navigationBarTitleText: '申请商户',
|
navigationBarTitleText: '商户入驻',
|
||||||
})
|
})
|
||||||
@@ -1,83 +1,182 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import {reactive, ref} from "vue";
|
import Taro from '@tarojs/taro'
|
||||||
|
import {ref} from 'vue'
|
||||||
|
import {getVerifyCode, applyMer, getMerTypeList} from '@/api/user'
|
||||||
|
|
||||||
const basicData = reactive({
|
const visible = ref(false)
|
||||||
name: '',
|
|
||||||
age: '',
|
|
||||||
tel: '',
|
|
||||||
address: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
const visible = ref(false);
|
const merType = ref(false)
|
||||||
const merType = ref(false);
|
|
||||||
const merGooType = ref(false);
|
|
||||||
|
|
||||||
|
|
||||||
|
const merGooType = ref(false)
|
||||||
|
|
||||||
|
// 验证码按钮文字
|
||||||
|
const smsStr = ref('获取验证码')
|
||||||
|
|
||||||
|
// 验证码按钮是否禁用
|
||||||
|
const smsDisabled = ref(false)
|
||||||
|
|
||||||
|
// 表单数据
|
||||||
const formValue = ref({
|
const formValue = ref({
|
||||||
merName: '',
|
|
||||||
name: '',
|
name: '',
|
||||||
|
userName: '',
|
||||||
phone: '',
|
phone: '',
|
||||||
merType: '',
|
code: '',
|
||||||
|
bType: '',
|
||||||
merTypeStr: '',
|
merTypeStr: '',
|
||||||
merGooType: '',
|
classId: '',
|
||||||
merGooTypeStr: '',
|
merGooTypeStr: ''
|
||||||
});
|
})
|
||||||
|
|
||||||
const ruleForm = ref<any>(null);
|
const merGooList = ref([])
|
||||||
|
|
||||||
const onOk = () => {
|
const merList = ref([])
|
||||||
visible.value = false;
|
|
||||||
|
|
||||||
};
|
// 表单校验
|
||||||
|
const ruleForm = ref<any>(null)
|
||||||
|
|
||||||
|
Taro.useLoad(() => {
|
||||||
|
getMerType()
|
||||||
|
})
|
||||||
|
|
||||||
|
// 获取商户类型
|
||||||
|
const getMerType = async () => {
|
||||||
|
try {
|
||||||
|
const res = await getMerTypeList()
|
||||||
|
console.log(res)
|
||||||
|
merList.value = res.data.type.map((item: any) => {
|
||||||
|
return {
|
||||||
|
text: item.name,
|
||||||
|
value: item.ID
|
||||||
|
}
|
||||||
|
})
|
||||||
|
merGooList.value = res.data.class.map((item: any) => {
|
||||||
|
return {
|
||||||
|
text: item.name,
|
||||||
|
value: item.ID
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: e.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 关闭弹窗
|
||||||
|
const onOk = async () => {
|
||||||
|
try {
|
||||||
|
const res = await applyMer(formValue.value)
|
||||||
|
Taro.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
} catch (e) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: e.msg,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
visible.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 打开弹窗
|
||||||
const open = () => {
|
const open = () => {
|
||||||
console.log('open');
|
console.log('open')
|
||||||
visible.value = true;
|
visible.value = true
|
||||||
};
|
}
|
||||||
|
|
||||||
|
// 获取验证码
|
||||||
|
const getSmsCode = () => {
|
||||||
|
ruleForm.value.validate('phone').then(async ({valid}: any) => {
|
||||||
|
if (valid) {
|
||||||
|
try {
|
||||||
|
await getVerifyCode({
|
||||||
|
phone: formValue.value.phone.toString()
|
||||||
|
})
|
||||||
|
smsDisabled.value = true
|
||||||
|
let time = 10
|
||||||
|
const timer = setInterval(() => {
|
||||||
|
time--
|
||||||
|
smsStr.value = `${time}s`
|
||||||
|
if (time === 0) {
|
||||||
|
clearInterval(timer)
|
||||||
|
smsDisabled.value = false
|
||||||
|
smsStr.value = '获取验证码'
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
} catch (e) {
|
||||||
|
Taro.showToast({
|
||||||
|
title: e.message,
|
||||||
|
icon: 'none'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择商户类型
|
||||||
const confirmMerType = (e: any) => {
|
const confirmMerType = (e: any) => {
|
||||||
formValue.value.merTypeStr = e.selectedOptions[0].text;
|
formValue.value.merTypeStr = e.selectedOptions[0].text
|
||||||
formValue.value.merType = e.selectedOptions[0].value;
|
formValue.value.bType = e.selectedOptions[0].value
|
||||||
merType.value = false;
|
merType.value = false
|
||||||
}
|
|
||||||
const confirmGooType = (e: any) => {
|
|
||||||
formValue.value.merGooTypeStr = e.selectedOptions[0].text;
|
|
||||||
formValue.value.merGooType = e.selectedOptions[0].value;
|
|
||||||
merGooType.value = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 选择经营类目
|
||||||
|
const confirmGooType = (e: any) => {
|
||||||
|
formValue.value.merGooTypeStr = e.selectedOptions[0].text
|
||||||
|
formValue.value.classId = e.selectedOptions[0].value
|
||||||
|
merGooType.value = false
|
||||||
|
}
|
||||||
|
|
||||||
|
// 提交
|
||||||
const submit = () => {
|
const submit = () => {
|
||||||
ruleForm.value.validate().then(({valid, errors}: any) => {
|
ruleForm.value.validate().then(({valid, errors}: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('success', formValue.value);
|
console.log('success', formValue.value)
|
||||||
visible.value = true;
|
visible.value = true
|
||||||
} else {
|
} else {
|
||||||
console.log('error submit!!', errors);
|
console.log('error submit!!', errors)
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<view class="appBg">
|
<view>
|
||||||
<nut-form ref="ruleForm" class="form" :model-value="formValue">
|
<nut-form ref="ruleForm" class="form" :model-value="formValue">
|
||||||
<nut-form-item required label="商户名称" prop="merName" :rules="[{
|
<nut-form-item required label="商户名称" prop="name" :rules="[{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入商户名称',
|
message: '请输入商户名称',
|
||||||
}]">
|
}]">
|
||||||
<input type="text" v-model="formValue.merName" placeholder="请输入商户名称"/>
|
<input type="text" v-model="formValue.name" placeholder="请输入商户名称"/>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<nut-form-item required label="用户姓名" prop="name" :rules="[{
|
<nut-form-item required label="用户姓名" prop="userName" :rules="[{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入用户姓名',
|
message: '请输入用户姓名',
|
||||||
}]">
|
}]">
|
||||||
<input type="text" v-model="formValue.name" placeholder="请输入真实姓名"/>
|
<input type="text" v-model="formValue.userName" placeholder="请输入真实姓名"/>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<nut-form-item required label="联系电话" prop="phone" :rules="[{
|
<nut-form-item required label="联系电话" prop="phone" :rules="[{
|
||||||
required: true,
|
required: true,
|
||||||
message: '请输入正确的电话号码',
|
message: '请输入正确的电话号码',
|
||||||
regex: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
|
regex: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
|
||||||
}]">
|
}]">
|
||||||
<input type="number" :maxlength="11" v-model="formValue.phone" placeholder="请输入联系电话"/>
|
<input type="text" :maxlength="11" v-model="formValue.phone" placeholder="请输入联系电话"/>
|
||||||
|
</nut-form-item>
|
||||||
|
<nut-form-item required label="验证码" prop="code" :rules="[{
|
||||||
|
required: true,
|
||||||
|
message: '请输入验证码',
|
||||||
|
}]">
|
||||||
|
<view class="yanCode">
|
||||||
|
<input type="text" :maxlength="6" v-model="formValue.code" placeholder="请输入验证码"/>
|
||||||
|
<nut-button style="width: 100px; padding: 3px" plain type="primary" size="mini"
|
||||||
|
:disabled="smsDisabled" round
|
||||||
|
@click="getSmsCode">
|
||||||
|
{{ smsStr }}
|
||||||
|
</nut-button>
|
||||||
|
</view>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<nut-form-item required label="商户类型" prop="merTypeStr" :rules="[{
|
<nut-form-item required label="商户类型" prop="merTypeStr" :rules="[{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -86,13 +185,8 @@ const submit = () => {
|
|||||||
<input type="text" :disabled="true" v-model="formValue.merTypeStr" placeholder="请选择商户类型"
|
<input type="text" :disabled="true" v-model="formValue.merTypeStr" placeholder="请选择商户类型"
|
||||||
@click="merType = true"/>
|
@click="merType = true"/>
|
||||||
<nut-popup position="bottom" v-model:visible="merType">
|
<nut-popup position="bottom" v-model:visible="merType">
|
||||||
<nut-picker :columns="[{
|
<nut-picker :columns="merList" title="商户类型" @confirm="confirmMerType"
|
||||||
text: '供应商',
|
@cancel="merType = false"></nut-picker>
|
||||||
value: '1'
|
|
||||||
},{
|
|
||||||
text: '兑换商',
|
|
||||||
value: '2'
|
|
||||||
}]" title="商户类型" @confirm="confirmMerType" @cancel="merType = false"></nut-picker>
|
|
||||||
</nut-popup>
|
</nut-popup>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<nut-form-item required label="经营类目" prop="merGooTypeStr" :rules="[{
|
<nut-form-item required label="经营类目" prop="merGooTypeStr" :rules="[{
|
||||||
@@ -102,24 +196,14 @@ const submit = () => {
|
|||||||
<input type="text" :disabled="true" v-model="formValue.merGooTypeStr" placeholder="请选择经营类目"
|
<input type="text" :disabled="true" v-model="formValue.merGooTypeStr" placeholder="请选择经营类目"
|
||||||
@click="merGooType = true"/>
|
@click="merGooType = true"/>
|
||||||
<nut-popup position="bottom" v-model:visible="merGooType">
|
<nut-popup position="bottom" v-model:visible="merGooType">
|
||||||
<nut-picker :columns="[{
|
<nut-picker :columns="merGooList" title="商户类型" @confirm="confirmGooType"
|
||||||
text: '酒吧',
|
@cancel="merGooType = false"></nut-picker>
|
||||||
value: '1'
|
|
||||||
},{
|
|
||||||
text: 'KTV',
|
|
||||||
value: '2'
|
|
||||||
},{
|
|
||||||
text: '餐饮',
|
|
||||||
value: '2'
|
|
||||||
},{
|
|
||||||
text: '娱乐',
|
|
||||||
value: '4'
|
|
||||||
},{
|
|
||||||
text: '其他',
|
|
||||||
value: '5'
|
|
||||||
}]" title="商户类型" @confirm="confirmGooType" @cancel="merGooType = false"></nut-picker>
|
|
||||||
</nut-popup>
|
</nut-popup>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
|
<!-- <nut-form-item label="资质上传" prop="img">-->
|
||||||
|
<!-- <nut-uploader url="www.baidu.com"></nut-uploader>-->
|
||||||
|
<!-- </nut-form-item>-->
|
||||||
|
|
||||||
<view class="btn">
|
<view class="btn">
|
||||||
<nut-button block type="primary" round @click="submit()">提交</nut-button>
|
<nut-button block type="primary" round @click="submit()">提交</nut-button>
|
||||||
</view>
|
</view>
|
||||||
@@ -139,12 +223,13 @@ const submit = () => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.appBg {
|
page {
|
||||||
background-image: url("../../../static/merchantBg.jpg");
|
background-image: url("~@/static/merchantBg.jpg");
|
||||||
background-size: 100%;
|
background-size: 100%;
|
||||||
background-color: #E93423;
|
background-color: #E93423;
|
||||||
height: 100vh;
|
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.form {
|
.form {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -156,5 +241,10 @@ const submit = () => {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.yanCode {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,46 +1,48 @@
|
|||||||
import Taro from "@tarojs/taro";
|
import Taro from '@tarojs/taro'
|
||||||
|
|
||||||
const BASE_URL = () => {
|
const BASE_URL = process.env.NODE_ENV === 'development' ? 'http://192.168.2.3:9000' : 'https://www.wanzhuanyongcheng.cn'
|
||||||
if (process.env.NODE_ENV === "development") {
|
|
||||||
return "http://192.168.2.3:9000";
|
interface Res<T> {
|
||||||
} else {
|
code: number;
|
||||||
return "https://api.imooc.hybrid.lgdsunday.club";
|
data: T;
|
||||||
|
msg: string;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
|
||||||
// interface Res {
|
type Method = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
type Method = "GET" | "POST" | "PUT" | "DELETE";
|
const request = (
|
||||||
|
|
||||||
export const request = (
|
|
||||||
url: string,
|
url: string,
|
||||||
data: object = {},
|
data: object = {},
|
||||||
method: Method = "GET"
|
method: Method = 'GET'
|
||||||
): Promise<any> => {
|
): Promise<Res<any>> => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
Taro.showLoading({
|
||||||
|
title: '加载中...',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: BASE_URL() + "/app" + url,
|
url: BASE_URL + '/app' + url,
|
||||||
data: data,
|
data: data,
|
||||||
method: method,
|
method: method,
|
||||||
header: {
|
header: {
|
||||||
"content-type": "application/json",
|
'content-type': 'application/json',
|
||||||
token: Taro.getStorageSync("token"),
|
token: Taro.getStorageSync('token')
|
||||||
},
|
},
|
||||||
success: ({data}) => {
|
success: ({data}) => {
|
||||||
console.log(data);
|
Taro.hideLoading()
|
||||||
if (data.code !== 200)
|
if (data.code !== 200)
|
||||||
return reject({code: 1, msg: data.msg});
|
return reject({code: 1, msg: data.msg})
|
||||||
resolve(data);
|
resolve(data)
|
||||||
},
|
},
|
||||||
fail: () => {
|
fail: () => {
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: "服务器异常",
|
title: '服务器异常',
|
||||||
icon: "none",
|
icon: 'none'
|
||||||
});
|
})
|
||||||
reject({code: 1, msg: "服务器异常"});
|
reject({code: 1, msg: '服务器异常'})
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default request
|
||||||
@@ -23,7 +23,12 @@
|
|||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"@tarojs/components/vue3"
|
"@tarojs/components/vue3"
|
||||||
|
],
|
||||||
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"src/*"
|
||||||
]
|
]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"./src",
|
"./src",
|
||||||
|
|||||||
Reference in New Issue
Block a user