build(custom): 修正提交规范

This commit is contained in:
2023-11-09 19:49:24 +08:00
parent 76d57cea37
commit 29c1d4280f
105 changed files with 29374 additions and 18618 deletions

57
.cz-config.js Normal file
View File

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

View File

@@ -5,7 +5,7 @@ root = true
[*] [*]
indent_style = space indent_style = space
indent_size = 4 indent_size = 2
end_of_line = lf end_of_line = lf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = false trim_trailing_whitespace = false

8
.eslintrc Normal file
View File

@@ -0,0 +1,8 @@
// ESLint 检查 .vue 文件需要单独配置编辑器:
// https://eslint.vuejs.org/user-guide/#editor-integrations
{
"extends": ["taro/vue3"],
"rules": {
"vue/multi-word-component-names": "off"
}
}

4
.husky/commit-msg Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx --no -- commitlint --edit "$1"

4
.husky/pre-commit Normal file
View File

@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npm run lint:staged

View File

@@ -2,9 +2,12 @@
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md // https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = { module.exports = {
presets: [ presets: [
['taro', { [
framework: 'vue3', "taro",
ts: true {
}] framework: "vue3",
] ts: true,
} },
],
],
};

26
commitlint.config.js Normal file
View File

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

View File

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

View File

@@ -1,105 +1,109 @@
// @ts-nocheck // @ts-nocheck
import Components from 'unplugin-vue-components/webpack' import Components from "unplugin-vue-components/webpack";
import NutUIResolver from '@nutui/nutui-taro/dist/resolver' import NutUIResolver from "@nutui/nutui-taro/dist/resolver";
import {join} from 'node:path' import { join } from "node:path";
const config = { const config = {
projectName: 'taroApp', projectName: "taroApp",
date: '2023-8-13', date: "2023-8-13",
designWidth(input: { file: string; }) { designWidth(input: { file: string }) {
if (input?.file?.replace(/\\+/g, '/').indexOf('@nutui') > -1) { if (input?.file?.replace(/\\+/g, "/").indexOf("@nutui") > -1) {
return 375 return 375;
} }
return 750 return 750;
}, },
deviceRatio: { deviceRatio: {
640: 2.34 / 2, 640: 2.34 / 2,
750: 1, 750: 1,
828: 1.81 / 2, 828: 1.81 / 2,
375: 2 375: 2,
}, },
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: {
type: 'webpack5', type: "webpack5",
prebundle: {enable: false} prebundle: { enable: false },
}, },
cache: { cache: {
enable: false // Webpack 持久化缓存配置建议开启。默认配置请参考https://docs.taro.zone/docs/config-detail#cache enable: true, // Webpack 持久化缓存配置建议开启。默认配置请参考https://docs.taro.zone/docs/config-detail#cache
}, },
sass: { sass: {
data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";` data: `@import "@nutui/nutui-taro/dist/styles/variables.scss";`,
}, },
alias: { alias: {
'@': join(__dirname, '..', 'src') "@": join(__dirname, "..", "src"),
}, },
mini: { mini: {
webpackChain(chain) { webpackChain(chain) {
chain.plugin('unplugin-vue-components').use(Components({ chain.plugin("unplugin-vue-components").use(
resolvers: [NutUIResolver({taro: true})] Components({
})) resolvers: [NutUIResolver({ taro: true })],
})
);
}, },
miniCssExtractPluginOption: { miniCssExtractPluginOption: {
//忽略css文件引入顺序 //忽略css文件引入顺序
ignoreOrder: true ignoreOrder: true,
}, },
postcss: { postcss: {
pxtransform: { pxtransform: {
enable: true, enable: true,
config: { config: {
// selectorBlackList: ['nut-'] // selectorBlackList: ['nut-']
} },
}, },
url: { url: {
enable: true, enable: true,
config: { config: {
limit: 1024 // 设定转换尺寸上限 limit: 1024, // 设定转换尺寸上限
} },
}, },
cssModules: { cssModules: {
enable: true, // 默认为 false如需使用 css modules 功能,则设为 true enable: true, // 默认为 false如需使用 css modules 功能,则设为 true
config: { config: {
namingPattern: 'module', // 转换模式,取值为 global/module namingPattern: "module", // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]' generateScopedName: "[name]__[local]___[hash:base64:5]",
} },
} },
} },
}, },
h5: { h5: {
webpackChain(chain) { webpackChain(chain) {
chain.plugin('unplugin-vue-components').use(Components({ chain.plugin("unplugin-vue-components").use(
resolvers: [NutUIResolver({taro: true})] Components({
})) resolvers: [NutUIResolver({ taro: true })],
})
);
}, },
publicPath: '/', publicPath: "/",
staticDirectory: 'static', staticDirectory: "static",
esnextModules: ['nutui-taro', 'icons-vue-taro'], esnextModules: ["nutui-taro", "icons-vue-taro"],
postcss: { postcss: {
autoprefixer: { autoprefixer: {
enable: true, enable: true,
config: {} config: {},
}, },
cssModules: { cssModules: {
enable: false, // 默认为 false如需使用 css modules 功能,则设为 true enable: false, // 默认为 false如需使用 css modules 功能,则设为 true
config: { config: {
namingPattern: 'module', // 转换模式,取值为 global/module namingPattern: "module", // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]' generateScopedName: "[name]__[local]___[hash:base64:5]",
} },
} },
} },
} },
} };
module.exports = function (merge) { module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === "development") {
return merge({}, config, require('./dev')) return merge({}, config, require("./dev"));
}
return merge({}, config, require('./prod'))
} }
return merge({}, config, require("./prod"));
};

View File

@@ -2,7 +2,7 @@
module.exports = { module.exports = {
env: { env: {
NODE_ENV: '"production"' NODE_ENV: '"production"',
}, },
defineConstants: {}, defineConstants: {},
mini: {}, mini: {},
@@ -18,7 +18,6 @@ module.exports = {
// */ // */
// chain.plugin('analyzer') // chain.plugin('analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, []) // .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
// /** // /**
// * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。 // * 如果 h5 端首屏加载时间过长,可以使用 prerender-spa-plugin 插件预加载首页。
// * @docs https://github.com/chrisvfritz/prerender-spa-plugin // * @docs https://github.com/chrisvfritz/prerender-spa-plugin
@@ -34,5 +33,5 @@ module.exports = {
// postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') }) // postProcess: (context) => ({ ...context, outputPath: path.join(staticDir, 'index.html') })
// })) // }))
// } // }
} },
} };

View File

@@ -27,7 +27,14 @@
"dev:rn": "npm run build:rn -- --watch", "dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch", "dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch", "dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch" "dev:quickapp": "npm run build:quickapp -- --watch",
"lint": "eslint --ext .ts,.vue .",
"lint:fix": "eslint --fix --ext .ts,.vue .",
"lint:staged": "lint-staged",
"prepare": "husky install",
"preview": "vite preview",
"cz": "cz",
"lf": "npx prettier --write --end-of-line lf ."
}, },
"browserslist": [ "browserslist": [
"last 3 versions", "last 3 versions",
@@ -35,51 +42,68 @@
"ios >= 8" "ios >= 8"
], ],
"author": "", "author": "",
"lint-staged": {
"*.{ts,vue}": [
"eslint --ext .ts,.vue .",
"npx prettier --write --end-of-line lf ."
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
},
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.1", "@babel/runtime": "^7.23.2",
"@nutui/icons-vue-taro": "^0.0.9", "@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.1.6", "@nutui/nutui-taro": "^4.2.0",
"@qiun/vue-ucharts": "2.5.0-20230101", "@qiun/vue-ucharts": "2.5.0-20230101",
"@tarojs/components": "3.6.16", "@tarojs/components": "3.6.18",
"@tarojs/helper": "3.6.16", "@tarojs/helper": "3.6.18",
"@tarojs/plugin-framework-vue3": "3.6.16", "@tarojs/plugin-framework-vue3": "3.6.18",
"@tarojs/plugin-html": "3.6.16", "@tarojs/plugin-html": "3.6.18",
"@tarojs/plugin-platform-alipay": "3.6.16", "@tarojs/plugin-platform-alipay": "3.6.18",
"@tarojs/plugin-platform-h5": "3.6.16", "@tarojs/plugin-platform-h5": "3.6.18",
"@tarojs/plugin-platform-jd": "3.6.16", "@tarojs/plugin-platform-jd": "3.6.18",
"@tarojs/plugin-platform-qq": "3.6.16", "@tarojs/plugin-platform-qq": "3.6.18",
"@tarojs/plugin-platform-swan": "3.6.16", "@tarojs/plugin-platform-swan": "3.6.18",
"@tarojs/plugin-platform-tt": "3.6.16", "@tarojs/plugin-platform-tt": "3.6.18",
"@tarojs/plugin-platform-weapp": "3.6.16", "@tarojs/plugin-platform-weapp": "3.6.18",
"@tarojs/runtime": "3.6.16", "@tarojs/runtime": "3.6.18",
"@tarojs/shared": "3.6.16", "@tarojs/shared": "3.6.18",
"@tarojs/taro": "3.6.16", "@tarojs/taro": "3.6.18",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"pinia": "^2.1.6", "pinia": "^2.1.7",
"vue": "^3.3.4" "vue": "^3.3.8"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.23.0", "@babel/core": "^7.23.3",
"@tarojs/cli": "3.6.16", "@commitlint/cli": "^18.2.0",
"@tarojs/taro-loader": "3.6.16", "@commitlint/config-conventional": "^18.1.0",
"@tarojs/webpack5-runner": "3.6.16", "@tarojs/cli": "3.6.18",
"@types/node": "^18.18.4", "@tarojs/taro-loader": "3.6.18",
"@types/webpack-env": "^1.18.2", "@tarojs/webpack5-runner": "3.6.18",
"@typescript-eslint/eslint-plugin": "^6.7.4", "@types/node": "^18.18.9",
"@typescript-eslint/parser": "^6.7.4", "@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vue/babel-plugin-jsx": "^1.1.5", "@vue/babel-plugin-jsx": "^1.1.5",
"@vue/compiler-sfc": "^3.3.4", "@vue/compiler-sfc": "^3.3.8",
"babel-preset-taro": "3.6.16", "babel-preset-taro": "3.6.18",
"commitizen": "^4.3.0",
"css-loader": "3.4.2", "css-loader": "3.4.2",
"eslint": "^8.51.0", "cz-customizable": "^7.0.0",
"eslint-config-taro": "3.6.16", "eslint": "^8.53.0",
"eslint-plugin-vue": "^9.17.0", "eslint-config-taro": "3.6.18",
"eslint-plugin-vue": "^9.18.1",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"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",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"unplugin-vue-components": "^0.23.0", "unplugin-vue-components": "^0.23.0",
"vue-loader": "^17.3.0", "vue-loader": "^17.3.1",
"webpack": "^5.88.2" "webpack": "^5.89.0"
} }
} }

26609
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,40 +1,41 @@
import request from '../utils/request' import request from "../utils/request";
// 订单核销 // 订单核销
export const orderVerify = (data: object) => export const orderVerify = (data: object) =>
request('/user/cancelPointOrder', data, 'POST') request("/user/cancelPointOrder", data, "POST");
// 活动订单核销 // 活动订单核销
export const activeOrderVerify = (data: object) => export const activeOrderVerify = (data: object) =>
request('/user/cancelOrder', data, 'POST') request("/user/cancelOrder", data, "POST");
// 获取订单统计 // 获取订单统计
export const orderStatistics = (data: object) => export const orderStatistics = (data: object) =>
request('/store/order/count', data, 'POST') request("/store/order/count", data, "POST");
// 获取商家积分订单列表 // 获取商家积分订单列表
export const getJfOrderList = (data: object) => export const getJfOrderList = (data: object) =>
request('/store/point/order', data, 'POST') request("/store/point/order", data, "POST");
// 获取商家活动订单列表 // 获取商家活动订单列表
export const getActiveOrderList = (data: object) => export const getActiveOrderList = (data: object) =>
request('/store/order', data, 'POST') request("/store/order", data, "POST");
// 获取积分核销列表 // 获取积分核销列表
export const getJfVerifyList = (data: object) => export const getJfVerifyList = (data: object) =>
request('/point/order/details', data, 'POST') request("/point/order/details", data, "POST");
// 获取活动核销列表 // 获取活动核销列表
export const getActiveVerifyList = (data: object) => export const getActiveVerifyList = (data: object) =>
request('/order/details', data, 'POST') request("/order/details", data, "POST");
// 增长率统计 // 增长率统计
export const growthRate = (data: object) => export const growthRate = (data: object) =>
request('/store/date/count', data, 'POST') request("/store/date/count", data, "POST");
// 获取提现列表 // 获取提现列表
export const getWithdrawList = (data: object) => request('/store/withdraw', data, 'POST') export const getWithdrawList = (data: object) =>
request("/store/withdraw", data, "POST");
// 获取提现列表 // 获取提现列表
export const addWithdraw = (data: object) => request('/store/withdraw/set', data, 'POST') export const addWithdraw = (data: object) =>
request("/store/withdraw/set", data, "POST");

View File

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

View File

@@ -65,12 +65,10 @@ export const qxOrder = (data: object) =>
request("/user/point/off", data, "POST"); request("/user/point/off", data, "POST");
// 用户签到 // 用户签到
export const userSign = () => export const userSign = () => request("/sign/user", {}, "POST");
request("/sign/user", {}, "POST");
// 获取签到记录 // 获取签到记录
export const getSignRecord = () => export const getSignRecord = () => request("/sign/pulse/count", {}, "POST");
request("/sign/pulse/count", {}, "POST");
// 获取赠送总记录 // 获取赠送总记录
export const getGiftRecord = (data: object) => export const getGiftRecord = (data: object) =>
request("/user/giftPulseRecord", data, "POST"); request("/user/giftPulseRecord", data, "POST");

View File

@@ -1,85 +1,81 @@
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', "account/index",
'distribution/index', "distribution/index",
'distribution/integral/index', "distribution/integral/index",
'distribution/userlist/index', "distribution/userlist/index",
'login/index', "login/index",
'bindPhone/index' "bindPhone/index",
] ],
}, },
{ {
root: 'pages/goods', root: "pages/goods",
pages: ["goods_detail/index", "order_create/index", "order_status/index"],
},
{
root: "pages/admin",
pages: [ pages: [
'goods_detail/index', "verify/index",
'order_create/index', "order_manage/index",
'order_status/index' "order_manage/list/index",
] "order_manage/detail/index",
"verify/verify_list/index",
"statistics/index",
"withdrawal/index",
],
}, },
{ {
root: 'pages/admin', root: "pages/product",
pages: [ pages: ["list/index", "addGoods/index"],
'verify/index',
'order_manage/index',
'order_manage/list/index',
'order_manage/detail/index',
'verify/verify_list/index',
'statistics/index',
'withdrawal/index'
]
}, },
{ {
root: 'pages/product', root: "pages/game",
pages: ['list/index', 'addGoods/index'] pages: ["gamehome/index", "gamedetail/index", "gameview/index"],
}, },
{ {
root: 'pages/game', root: "pages/hotGoods",
pages: ['gamehome/index', 'gamedetail/index', 'gameview/index'] pages: ["index/index", "hot_list/index"],
}, },
{ {
root: 'pages/hotGoods', root: "pages/mer",
pages: ['index/index', 'hot_list/index'] pages: ["mer_detail/index"],
}, },
{ {
root: 'pages/mer', root: "pages/marketing",
pages: ['mer_detail/index'] pages: ["sign/index"],
}, },
{
root: 'pages/marketing',
pages: ['sign/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",
@@ -94,20 +90,20 @@ export default defineAppConfig({
// 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"],
lazyCodeLoading: 'requiredComponents' lazyCodeLoading: "requiredComponents",
}); });

View File

@@ -1,21 +1,4 @@
@import "static/iconfont/iconfont.css";
//@font-face {
// font-family: AlibabaPuHuiTi-3-55-Regular;
// src: url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.eot)
// format("embedded-opentype"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.otf)
// format("opentype"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.ttf)
// format("TrueType"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff)
// format("woff"),
// url(https://puhuiti.oss-cn-hangzhou.aliyuncs.com/AlibabaPuHuiTi-3/AlibabaPuHuiTi-3-55-Regular/AlibabaPuHuiTi-3-55-Regular.woff2)
// format("woff2");
//}
page { page {
//font-family: AlibabaPuHuiTi-3-55-Regular, sans-serif;
background-color: #f5f5f5; background-color: #f5f5f5;
} }

View File

@@ -1,9 +1,10 @@
import {createApp} from 'vue' import { createApp } from "vue";
import './app.scss' import "./app.scss";
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import "static/iconfont/iconfont.css";
// 小程序场景值 // 小程序场景值
const scenes = [1007, 1008, 1011, 1012, 1013, 1047, 1048, 1049] const scenes = [1007, 1008, 1011, 1012, 1013, 1047, 1048, 1049];
const App = createApp({ const App = createApp({
onLaunch(options: { onLaunch(options: {
@@ -14,49 +15,49 @@ const App = createApp({
referrerInfo: object | any; referrerInfo: object | any;
}) { }) {
// 检测更新 // 检测更新
if (Taro.canIUse('getUpdateManager') && options.scene !== 1154) { if (Taro.canIUse("getUpdateManager") && options.scene !== 1154) {
const updateManager = Taro.getUpdateManager() const updateManager = Taro.getUpdateManager();
updateManager.onCheckForUpdate(function (res) { updateManager.onCheckForUpdate(function (res) {
if (res.hasUpdate) { if (res.hasUpdate) {
updateManager.onUpdateFailed(function () { updateManager.onUpdateFailed(function () {
return Taro.showToast({ return Taro.showToast({
title: '新版本下载失败', title: "新版本下载失败",
icon: 'none' icon: "none",
}) });
}) });
updateManager.onUpdateReady(function () { updateManager.onUpdateReady(function () {
Taro.showModal({ Taro.showModal({
title: '更新提示', title: "更新提示",
content: '新版本已经下载好,是否重启当前应用?', content: "新版本已经下载好,是否重启当前应用?",
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
updateManager.applyUpdate() updateManager.applyUpdate();
} }
} },
}) });
}) });
updateManager.onUpdateFailed(function () { updateManager.onUpdateFailed(function () {
Taro.showModal({ Taro.showModal({
title: '发现新版本', title: "发现新版本",
content: '请删除当前小程序,重启搜索打开...' content: "请删除当前小程序,重启搜索打开...",
}) });
}) });
} }
}) });
} }
}, },
onShow() { onShow() {
const options = Taro.getCurrentInstance().router as any const options = Taro.getCurrentInstance().router as any;
if (scenes.includes(options.scene)) { if (scenes.includes(options.scene)) {
if (options.query.scene) { if (options.query.scene) {
Taro.showToast({ Taro.showToast({
title: '已检测到推荐人', title: "已检测到推荐人",
icon: 'none' icon: "none",
}) });
Taro.setStorageSync('bind_id', options.query.scene) Taro.setStorageSync("bind_id", options.query.scene);
} }
} }
} },
}) });
export default App export default App;

View File

@@ -46,68 +46,68 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {ref, watch} from 'vue' import { ref, watch } from "vue";
import {IconFont} from '@nutui/icons-vue-taro' import { IconFont } from "@nutui/icons-vue-taro";
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {payOrder} from '@/api/order' import { payOrder } from "@/api/order";
import {payJfOrder} from '@/api/goods' import { payJfOrder } from "@/api/goods";
import {getPersonalInfo} from '@/api/user' import { getPersonalInfo } from "@/api/user";
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: { jfInfo: {
type: Object, type: Object,
default: () => { default: () => {
return {} return {};
} },
} },
}) });
const emit = defineEmits(['closePay', 'successPay']) const emit = defineEmits(["closePay", "successPay"]);
const info = ref<{ integral?: any }>({}) const info = ref<{ integral?: any }>({});
watch( watch(
() => prop.isShowPay, () => prop.isShowPay,
() => { () => {
getInfo() getInfo();
} }
) );
const getInfo = async () => { const getInfo = async () => {
try { try {
const res = await getPersonalInfo() const res = await getPersonalInfo();
info.value = res.data.data info.value = res.data.data;
} catch (error) { } catch (error) {
Taro.showToast({ Taro.showToast({
title: error.msg, title: error.msg,
icon: 'none' icon: "none",
}) });
throw error throw error;
}
} }
};
const goPay = async () => { const goPay = async () => {
console.log(prop.jfInfo) console.log(prop.jfInfo);
if (!prop.jfInfo) if (!prop.jfInfo)
return Taro.showToast({ return Taro.showToast({
title: '未获取到订单信息', title: "未获取到订单信息",
icon: 'none' icon: "none",
}) });
if (prop.payType === 'wx') { if (prop.payType === "wx") {
try { try {
const { data } = await payOrder({ const { data } = await payOrder({
oid: prop.jfInfo.oid oid: prop.jfInfo.oid,
}) });
Taro.requestPayment({ Taro.requestPayment({
timeStamp: data.data.timeStamp, timeStamp: data.data.timeStamp,
nonceStr: data.data.nonceStr, nonceStr: data.data.nonceStr,
@@ -116,51 +116,51 @@ const goPay = async () => {
paySign: data.data.paySign, paySign: data.data.paySign,
success: function () { success: function () {
Taro.showToast({ Taro.showToast({
title: '支付成功', title: "支付成功",
icon: 'success', icon: "success",
duration: 2000 duration: 2000,
}) });
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/hotGoods/hot_list/index' url: "/pages/hotGoods/hot_list/index",
}) });
}, },
fail: function () { fail: function () {
Taro.showToast({ Taro.showToast({
title: '支付失败', title: "支付失败",
icon: 'none', icon: "none",
duration: 2000 duration: 2000,
}) });
} },
}) });
emit('closePay', false) emit("closePay", false);
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
icon: 'none' icon: "none",
}) });
throw e throw e;
} }
} else { } else {
const res = await payJfOrder(prop.jfInfo) const res = await payJfOrder(prop.jfInfo);
Taro.showToast({ Taro.showToast({
title: res.msg, title: res.msg,
icon: 'success', icon: "success",
duration: 2000 duration: 2000,
}) });
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/users/order_list/index?type=0' url: "/pages/users/order_list/index?type=0",
}) });
emit('closePay', false) emit("closePay", false);
}
} }
};
const closePay = () => { const closePay = () => {
Taro.showToast({ Taro.showToast({
title: '取消支付', title: "取消支付",
icon: 'none' icon: "none",
}) });
emit('closePay', false) emit("closePay", false);
} };
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@@ -1,32 +1,36 @@
<script setup lang="ts"> <script setup lang="ts">
import {ref} from 'vue' import { ref } from "vue";
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {getSignRecord, userSign} from '@/api/user' import { getSignRecord, userSign } from "@/api/user";
const show = ref(false) const show = ref(false);
Taro.useLoad(async () => { Taro.useLoad(async () => {
show.value = true show.value = true;
// const res = await getSignRecord() // const res = await getSignRecord()
// console.log(res) // console.log(res)
}) });
const toSign = async () => { const toSign = async () => {
try { try {
await userSign() await userSign();
Taro.showToast({ Taro.showToast({
title: '签到成功', title: "签到成功",
icon: 'none' icon: "none",
}) });
} catch (e) { } catch (e) {
console.log(e) console.log(e);
}
show.value = false
} }
show.value = false;
};
</script> </script>
<template> <template>
<nut-overlay v-model:visible="show" :lock-scroll="true" :close-on-click-overlay="false"> <nut-overlay
v-model:visible="show"
:lock-scroll="true"
:close-on-click-overlay="false"
>
<view class="wrapper"> <view class="wrapper">
<view @click.stop="toSign"> <view @click.stop="toSign">
<image class="image" src="../static/index/poppBg.png" /> <image class="image" src="../static/index/poppBg.png" />

View File

@@ -124,116 +124,115 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {reactive} from 'vue' import { reactive } from "vue";
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {BASE_URL} from '@/utils/request' import { BASE_URL } from "@/utils/request";
const { content } = defineProps<{ const { content } = defineProps<{
content: string; content: string;
}>() }>();
let emits = defineEmits(['input']) let emits = defineEmits(["input"]);
const data = reactive<any>({ const data = reactive<any>({
editorCtx: '', editorCtx: "",
readOnly: false, readOnly: false,
placeholder: '请输入商品详情...', placeholder: "请输入商品详情...",
richText: '', richText: "",
formats: {} formats: {},
}) });
function onEditorReady() { function onEditorReady() {
// 富文本节点渲染完成 // 富文本节点渲染完成
Taro Taro.createSelectorQuery()
.createSelectorQuery() .select("#editor")
.select('#editor')
.context((res) => { .context((res) => {
data.editorCtx = res.context data.editorCtx = res.context;
// 初始化数据 // 初始化数据
if (content) { if (content) {
data.editorCtx.setContents({ data.editorCtx.setContents({
html: content html: content,
}) });
} }
}) })
.exec() .exec();
} }
// 失去焦点时,获取富文本的内容 // 失去焦点时,获取富文本的内容
function getCtx(e: { detail: { html: any; }; }) { function getCtx(e: { detail: { html: any } }) {
data.richText = e.detail.html data.richText = e.detail.html;
emits('input', e.detail.html) emits("input", e.detail.html);
} }
// 撤销操作 // 撤销操作
function undo() { function undo() {
data.editorCtx.undo() data.editorCtx.undo();
} }
// 复原操作 // 复原操作
function redo() { function redo() {
data.editorCtx.redo() data.editorCtx.redo();
} }
//修改样式 //修改样式
function format(e: { target: { dataset: { name: any; value: any; }; }; }) { function format(e: { target: { dataset: { name: any; value: any } } }) {
// console.log("format", e.target.dataset); // console.log("format", e.target.dataset);
let {name, value} = e.target.dataset let { name, value } = e.target.dataset;
if (!name) return if (!name) return;
data.editorCtx.format(name, value) data.editorCtx.format(name, value);
} }
//通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式 //通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式
function onStatusChange(e: { detail: any; }) { function onStatusChange(e: { detail: any }) {
data.formats = e.detail data.formats = e.detail;
} }
// 插入分割线 // 插入分割线
function insertDivider() { function insertDivider() {
data.editorCtx.insertDivider() data.editorCtx.insertDivider();
} }
// 插入图片 // 插入图片
function insertImage() { function insertImage() {
Taro.chooseImage({ Taro.chooseImage({
count: 1, count: 1,
sizeType: ['original', 'compressed'], sizeType: ["original", "compressed"],
sourceType: ['album', 'camera'], sourceType: ["album", "camera"],
success: (res) => { success: (res) => {
// 上传图片的逻辑各有不同,自行调整即可 // 上传图片的逻辑各有不同,自行调整即可
Taro.uploadFile({ Taro.uploadFile({
url: `${BASE_URL}/upload`, url: `${BASE_URL}/upload`,
name: 'file', name: "file",
header: {token: Taro.getStorageSync('token')}, header: { token: Taro.getStorageSync("token") },
filePath: res.tempFilePaths[0], filePath: res.tempFilePaths[0],
success: (res) => { success: (res) => {
console.log(res) console.log(res);
const imgData = JSON.parse(res.data) as { const imgData = JSON.parse(res.data) as {
code: number; code: number;
msg: string; msg: string;
data: any; data: any;
} };
if (imgData.code === 200) { if (imgData.code === 200) {
// 将图片展示在编辑器中 // 将图片展示在编辑器中
data.editorCtx.insertImage({ data.editorCtx.insertImage({
width: '100%', width: "100%",
height: 'auto', height: "auto",
src: imgData.data.data, src: imgData.data.data,
alt: '图像', alt: "图像",
success: function () { success: function () {
console.log('insert image success') console.log("insert image success");
} },
}) });
} else { } else {
console.log('上传失败') console.log("上传失败");
} }
}, },
fail: (err) => { fail: (err) => {
console.log(err) console.log(err);
} },
}) });
} },
}) });
} }
</script> </script>

View File

@@ -12,52 +12,52 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {BASE_URL} from '@/utils/request' import { BASE_URL } from "@/utils/request";
import {computed, ref} from 'vue' import { computed, ref } from "vue";
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
const props = defineProps({ const props = defineProps({
list: { list: {
type: Array, type: Array,
default: () => [] default: () => [],
}, },
max: { max: {
type: Number, type: Number,
default: 1 default: 1,
}, },
multiple: { multiple: {
type: Boolean, type: Boolean,
default: false default: false,
} },
}); });
const emits = defineEmits(['update:list']) const emits = defineEmits(["update:list"]);
const fileList = computed({ const fileList = computed({
get: () => props.list, get: () => props.list,
set: (val) => emits('update:list', val) set: (val) => emits("update:list", val),
}); });
const config = ref({ const config = ref({
url: `${BASE_URL}/upload`, url: `${BASE_URL}/upload`,
headers: { headers: {
token: Taro.getStorageSync('token') token: Taro.getStorageSync("token"),
}, },
}); });
const success = (res: any) => { const success = (res: any) => {
const data = JSON.parse(res.responseText.data) const data = JSON.parse(res.responseText.data);
res.fileItem.url = data.data.data res.fileItem.url = data.data.data;
Taro.showToast({ Taro.showToast({
title: '上传成功', title: "上传成功",
icon: 'success' icon: "success",
}); });
}; };
const failure = () => { const failure = () => {
Taro.showToast({ Taro.showToast({
title: '上传失败', title: "上传失败",
icon: 'error' icon: "error",
}); });
}; };
</script> </script>

View File

@@ -177,11 +177,7 @@ const formSubmit = async (e: any) => {
open-type="getPhoneNumber" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber" @getphonenumber="getPhoneNumber"
> >
{{ {{ !userInfo.phone ? "请授权手机号" : "授权成功" }}
!userInfo.phone
? "请授权手机号"
: "授权成功"
}}
</button> </button>
</view> </view>
</view> </view>
@@ -189,12 +185,7 @@ const formSubmit = async (e: any) => {
</view> </view>
<view class="bottom"> <view class="bottom">
<nut-button <nut-button formType="submit" block type="success" color="#07C160">
formType="submit"
block
type="success"
color="#07C160"
>
保存 保存
</nut-button> </nut-button>
</view> </view>

View File

@@ -1,15 +1,20 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport"> <meta
<meta name="apple-mobile-web-app-capable" content="yes"> content="width=device-width,initial-scale=1,user-scalable=no"
<meta name="apple-touch-fullscreen" content="yes"> name="viewport"
<meta name="format-detection" content="telephone=no,address=no"> />
<meta name="apple-mobile-web-app-status-bar-style" content="white"> <meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" > <meta name="apple-touch-fullscreen" content="yes" />
<meta name="format-detection" content="telephone=no,address=no" />
<meta name="apple-mobile-web-app-status-bar-style" content="white" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>taroApp</title> <title>taroApp</title>
<script><%= htmlWebpackPlugin.options.script %></script> <script>
<%= htmlWebpackPlugin.options.script %>
</script>
</head> </head>
<body> <body>
<div id="app"></div> <div id="app"></div>

View File

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

View File

@@ -17,14 +17,8 @@
</view> </view>
<nut-cell-group> <nut-cell-group>
<nut-cell title="订单状态:" :desc="orderStatus"></nut-cell> <nut-cell title="订单状态:" :desc="orderStatus"></nut-cell>
<nut-cell <nut-cell title="下单用户:" :desc="info.BindUser?.nickName"></nut-cell>
title="下单用户:" <nut-cell title="用户手机号:" :desc="info.BindUser?.phone"></nut-cell>
:desc="info.BindUser?.nickName"
></nut-cell>
<nut-cell
title="用户手机号:"
:desc="info.BindUser?.phone"
></nut-cell>
<nut-cell <nut-cell
v-if="info.status === 2" v-if="info.status === 2"
title="核销人员:" title="核销人员:"
@@ -41,7 +35,7 @@
<script setup lang="ts"> <script setup lang="ts">
import Taro from "@tarojs/taro"; import Taro from "@tarojs/taro";
import { ref, computed } from "vue"; import { ref } from "vue";
const info = ref<any>({}); const info = ref<any>({});
@@ -49,7 +43,7 @@ Taro.useLoad(() => {
info.value = Taro.getStorageSync("ver_order_info"); info.value = Taro.getStorageSync("ver_order_info");
}); });
const orderStatus = computed(() => { const orderStatus = () => {
switch (info.value.status) { switch (info.value.status) {
case 1: case 1:
return "待核销"; return "待核销";
@@ -58,7 +52,7 @@ const orderStatus = computed(() => {
case 3: case 3:
return "已失效"; return "已失效";
} }
}); };
</script> </script>
<style lang="scss"> <style lang="scss">

View File

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

View File

@@ -36,9 +36,7 @@
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=today`" :url="`/pages/admin/statistics/index?type=price&time=today`"
> >
<view class="title">{{ <view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view>
orderInfo?.total?.TodayNumber || 0
}}</view>
<view class="sub">今日成交额</view> <view class="sub">今日成交额</view>
</navigator> </navigator>
<navigator <navigator
@@ -56,9 +54,7 @@
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=month`" :url="`/pages/admin/statistics/index?type=price&time=month`"
> >
<view class="title">{{ <view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view>
orderInfo?.total?.MonthNumber || 0
}}</view>
<view class="sub">本月成交额</view> <view class="sub">本月成交额</view>
</navigator> </navigator>
<navigator <navigator
@@ -66,9 +62,7 @@
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=today`" :url="`/pages/admin/statistics/index?type=order&time=today`"
> >
<view class="title">{{ <view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view>
orderInfo?.total?.TodayOrder || 0
}}</view>
<view class="sub">今日订单数</view> <view class="sub">今日订单数</view>
</navigator> </navigator>
<navigator <navigator
@@ -76,9 +70,7 @@
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=yesterday`" :url="`/pages/admin/statistics/index?type=order&time=yesterday`"
> >
<view class="title">{{ <view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view>
orderInfo?.total?.YesterdayOrder || 0
}}</view>
<view class="sub">昨日订单数</view> <view class="sub">昨日订单数</view>
</navigator> </navigator>
<navigator <navigator
@@ -86,9 +78,7 @@
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=month`" :url="`/pages/admin/statistics/index?type=order&time=month`"
> >
<view class="title">{{ <view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view>
orderInfo?.total?.MonthOrder || 0
}}</view>
<view class="sub">本月订单数</view> <view class="sub">本月订单数</view>
</navigator> </navigator>
</view> </view>

View File

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

View File

@@ -26,9 +26,7 @@
<view class="top"> <view class="top">
<view class="name">订单号:{{ item.oid }}</view> <view class="name">订单号:{{ item.oid }}</view>
<!-- <view class="sub">下单时间{{ item.add_time }}</view> --> <!-- <view class="sub">下单时间{{ item.add_time }}</view> -->
<view class="sub" <view class="sub">核销时间{{ item.cancel_time || "待核销" }}</view>
>核销时间{{ item.cancel_time || "待核销" }}</view
>
<!-- <view style="color: red">{{ <!-- <view style="color: red">{{
item.status === 0 item.status === 0
? "待付款" ? "待付款"

View File

@@ -43,9 +43,7 @@
<view class="title"> <view class="title">
{{ title }}{{ where.type == 1 ? "营业额" : "订单量" }} {{ title }}{{ where.type == 1 ? "营业额" : "订单量" }}
</view> </view>
<view v-if="where.type == 1" class="money">{{ <view v-if="where.type == 1" class="money">{{ dataObj.all || 0 }}</view>
dataObj.all || 0
}}</view>
<view v-else class="money">{{ dataObj.all || 0 }}</view> <view v-else class="money">{{ dataObj.all || 0 }}</view>
<view class="increase"> <view class="increase">
<view> <view>
@@ -56,9 +54,7 @@
<text <text
class="iconfont" class="iconfont"
:class=" :class="
dataObj.growthRate >= 0 dataObj.growthRate >= 0 ? 'icon-xiangshang1' : 'icon-xiangxia2'
? 'icon-xiangshang1'
: 'icon-xiangxia2'
" "
></text ></text
></text> ></text>

View File

@@ -1,9 +1,7 @@
<template> <template>
<view> <view>
<view class="card"> <view class="card">
<nut-button block type="primary" @click="scanCode" <nut-button block type="primary" @click="scanCode">扫码核销</nut-button>
>扫码核销</nut-button
>
</view> </view>
</view> </view>
</template> </template>

View File

@@ -4,18 +4,11 @@
<view>订单号{{ goodInfo.oid }}</view> <view>订单号{{ goodInfo.oid }}</view>
<view class="line"></view> <view class="line"></view>
<view class="container"> <view class="container">
<image <image class="image" :src="goodInfo.cover" mode="widthFix"></image>
class="image"
:src="goodInfo.cover"
mode="widthFix"
></image>
<view class="info"> <view class="info">
<view class="title">{{ goodInfo.goods_name }}</view> <view class="title">{{ goodInfo.goods_name }}</view>
<view class="num" <view class="num"
>数量: >数量: <text style="color: red">{{ goodInfo.count }}</text></view
<text style="color: red">{{
goodInfo.count
}}</text></view
> >
</view> </view>
<view></view> <view></view>

View File

@@ -1,65 +1,83 @@
<script lang="ts" setup> <script lang="ts" setup>
import {ref, h} from 'vue' import { ref, h } from "vue";
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {getWithdrawList, addWithdraw} from '@/api/admin' import { getWithdrawList, addWithdraw } from "@/api/admin";
const user_info = Taro.getStorageSync('userInfo') const user_info = Taro.getStorageSync("userInfo");
const row = ref(0) const row = ref(0);
const basicData = ref({ const basicData = ref({
num: '' num: "",
}) });
const showPreview = ref(false) const showPreview = ref(false);
const imgData = ref([{ const imgData = ref([
src: '' {
}]) src: "",
},
]);
const columns = ref([ const columns = ref([
{ {
title: '时间', title: "时间",
key: 'add_time', key: "add_time",
align: 'center' align: "center",
}, {
title: '提现金额',
key: 'integral',
align: 'center',
render: (row: { integral: number; }) => {
return h('view', {}, row.integral / 100)
}
}, },
{ {
title: '审核状态', title: "提现金额",
key: 'status', key: "integral",
align: 'center', align: "center",
render: (row: { status: number; }) => { render: (row: { integral: number }) => {
return h('view', { return h("view", {}, row.integral / 100);
class: `tag ${row.status === 1 ? 'success' : row.status === 2 ? 'danger' : 'warning'}` },
}, {
default: () => row.status === 1 ? '已打款' : row.status === 2 ? '已拒绝' : '待审核'
})
}
}, },
{ {
title: '备注', title: "审核状态",
key: 'img', key: "status",
align: 'center', align: "center",
render: (row: { status_img: string; }) => { render: (row: { status: number }) => {
return h('img', { return h(
class: 'image', "view",
{
class: `tag ${
row.status === 1
? "success"
: row.status === 2
? "danger"
: "warning"
}`,
},
{
default: () =>
row.status === 1
? "已打款"
: row.status === 2
? "已拒绝"
: "待审核",
}
);
},
},
{
title: "备注",
key: "img",
align: "center",
render: (row: { status_img: string }) => {
return h("img", {
class: "image",
onClick: () => { onClick: () => {
imgData.value[0].src = row.status_img imgData.value[0].src = row.status_img;
showPreview.value = true showPreview.value = true;
}, },
src: row.status_img src: row.status_img,
}) });
} },
} },
]) ]);
const data = ref([]) const data = ref([]);
const pagination = ref({ const pagination = ref({
page: 1, page: 1,
@@ -67,61 +85,67 @@ const pagination = ref({
showPageSize: 5, showPageSize: 5,
totalItems: 0, totalItems: 0,
change: (page: number) => { change: (page: number) => {
pagination.value.page = page pagination.value.page = page;
getData() getData();
} },
}) });
const hideFn = () => { const hideFn = () => {
showPreview.value = false showPreview.value = false;
} };
Taro.useLoad(() => { Taro.useLoad(() => {
getData() getData();
}) });
const getData = async () => { const getData = async () => {
try { try {
const res = await getWithdrawList({ const res = await getWithdrawList({
PageNum: pagination.value.page, PageNum: pagination.value.page,
PageSize: pagination.value.showPageSize, PageSize: pagination.value.showPageSize,
Bid: user_info.bid Bid: user_info.bid,
}) });
data.value = res.data.data || [] data.value = res.data.data || [];
pagination.value.totalItems = res.data.total pagination.value.totalItems = res.data.total;
row.value = res.data.integral || 0 row.value = res.data.integral || 0;
console.log(res) console.log(res);
} catch (e) { } catch (e) {
throw e throw e;
}
} }
};
const add = async () => { const add = async () => {
try { try {
if (Number(basicData.value.num) === 0) return Taro.showToast({ if (Number(basicData.value.num) === 0)
title: '提现积分需大于0', return Taro.showToast({
icon: 'none' title: "提现积分需大于0",
}) icon: "none",
});
const res = await addWithdraw({ const res = await addWithdraw({
Bid: user_info.bid, Bid: user_info.bid,
Number: Number(basicData.value.num) Number: Number(basicData.value.num),
}) });
Taro.showToast({ Taro.showToast({
title: res.msg, title: res.msg,
icon: 'none' icon: "none",
}) });
await getData() await getData();
} catch (e) { } catch (e) {
throw e throw e;
}
} }
};
</script> </script>
<template> <template>
<view> <view>
<nut-form> <nut-form>
<nut-form-item label="提现积分:"> <nut-form-item label="提现积分:">
<nut-input v-model="basicData.num" class="nut-input-text" placeholder="请输入提现积分" type="text"/> <nut-input
v-model="basicData.num"
class="nut-input-text"
placeholder="请输入提现积分"
type="text"
/>
</nut-form-item> </nut-form-item>
<nut-form-item> <nut-form-item>
<view> <view>
@@ -141,9 +165,15 @@ const add = async () => {
<view v-if="data.length > 0"> <view v-if="data.length > 0">
<view class="data"> <view class="data">
<nut-table :columns="columns" :data="data"></nut-table> <nut-table :columns="columns" :data="data"></nut-table>
<nut-pagination class="pagination" v-model="pagination.page" :total-items="pagination.totalItems" <nut-pagination
:items-per-page="pagination.itemsPerPage" :show-page-size="pagination.showPageSize" class="pagination"
@change="pagination.change" :bordered="false"/> v-model="pagination.page"
:total-items="pagination.totalItems"
:items-per-page="pagination.itemsPerPage"
:show-page-size="pagination.showPageSize"
@change="pagination.change"
:bordered="false"
/>
</view> </view>
</view> </view>
<nut-empty v-else description="暂无提现记录"></nut-empty> <nut-empty v-else description="暂无提现记录"></nut-empty>
@@ -153,7 +183,6 @@ const add = async () => {
</template> </template>
<style lang="scss"> <style lang="scss">
.text-red { .text-red {
color: red; color: red;
} }

View File

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

View File

@@ -3,20 +3,34 @@
<view v-if="list.length > 0"> <view v-if="list.length > 0">
<nut-swipe v-for="(item, index) in list" :key="index"> <nut-swipe v-for="(item, index) in list" :key="index">
<view class="item"> <view class="item">
<nut-checkbox v-model="item.checkbox" @click="select">{{ item.ID }}</nut-checkbox> <nut-checkbox v-model="item.checkbox" @click="select">{{
<image src="https://s2.loli.net/2023/08/16/6KgdSQa4WRoT3sz.jpg" item.ID
style="width: 100px;height: 100px"/> }}</nut-checkbox>
<image
src="https://s2.loli.net/2023/08/16/6KgdSQa4WRoT3sz.jpg"
style="width: 100px; height: 100px"
/>
<view class="text"> <view class="text">
<view>{{ item.name }}</view> <view>{{ item.name }}</view>
<view class="bom"> <view class="bom">
<nut-price :price="item.number" size="normal" :need-symbol="false"/> <nut-price
<nut-input-number readonly @add="select()" @reduce="select()" :price="item.number"
v-model="item.count"/> size="normal"
:need-symbol="false"
/>
<nut-input-number
readonly
@add="select()"
@reduce="select()"
v-model="item.count"
/>
</view> </view>
</view> </view>
</view> </view>
<template #right> <template #right>
<nut-button shape="square" style="height:100%" type="danger">删除</nut-button> <nut-button shape="square" style="height: 100%" type="danger"
>删除</nut-button
>
</template> </template>
</nut-swipe> </nut-swipe>
</view> </view>
@@ -28,10 +42,16 @@
</view> </view>
<view class="bottom-box"> <view class="bottom-box">
<view class="left"> <view class="left">
<nut-checkbox v-model="selectAllVal" @change="selectAll">全选</nut-checkbox> <nut-checkbox v-model="selectAllVal" @change="selectAll"
>全选</nut-checkbox
>
<view class="text-box"> <view class="text-box">
总计积分 总计积分
<nut-price v-model:price="localCount" 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" @click="sub">去结算</nut-button>
@@ -40,78 +60,77 @@
</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' import { getCartList } from "@/api/goods";
const selectAllVal = ref(false) const selectAllVal = ref(false);
const list = ref([]) const list = ref([]);
const localCount = ref(0) const localCount = ref(0);
Taro.useDidShow(() => { Taro.useDidShow(() => {
getList() getList();
}) });
const select = () => { const select = () => {
localCount.value = 0 localCount.value = 0;
list.value.forEach((item: any) => { list.value.forEach((item: any) => {
if (item.checkbox) { if (item.checkbox) {
setTimeout(() => { setTimeout(() => {
item.countNum = Number(item.number) * Number(item.count) item.countNum = Number(item.number) * Number(item.count);
localCount.value += item.countNum localCount.value += item.countNum;
console.log(localCount.value) console.log(localCount.value);
}, 1) }, 1);
selectAllVal.value = true selectAllVal.value = true;
} else { } else {
selectAllVal.value = false selectAllVal.value = false;
}
})
} }
});
};
const selectAll = () => { const selectAll = () => {
localCount.value = 0 localCount.value = 0;
list.value.forEach((item: any) => { list.value.forEach((item: any) => {
item.checkbox = selectAllVal.value item.checkbox = selectAllVal.value;
}) });
select() select();
console.log(list.value) console.log(list.value);
} };
const sub = () => { const sub = () => {
const arr = list.value.filter((item: any) => item.checkbox) const arr = list.value.filter((item: any) => item.checkbox);
if (arr.length === 0) { if (arr.length === 0) {
Taro.showToast({ Taro.showToast({
title: '请选择商品', title: "请选择商品",
icon: 'none' icon: "none",
}) });
return return;
} }
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/goods/order_create/index' url: "/pages/goods/order_create/index",
}) });
} };
const getList = async () => { const getList = async () => {
const res = await getCartList() const res = await getCartList();
list.value = res.data.data.Goods.map((item: any) => { list.value = res.data.data.Goods.map((item: any) => {
return { return {
...item, ...item,
count: 1, count: 1,
countNum: item.number, countNum: item.number,
checkbox: false checkbox: false,
} };
}) });
} };
const toPage = () => { const toPage = () => {
Taro.switchTab({ Taro.switchTab({
url: '/pages/index/index' url: "/pages/index/index",
}) });
} };
</script> </script>
<style lang="scss"> <style lang="scss">
@@ -176,7 +195,5 @@ const toPage = () => {
margin-left: 10px; margin-left: 10px;
} }
} }
} }
</style> </style>

View File

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

View File

@@ -26,17 +26,13 @@
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
<view class="bom"> <view class="bom">
<view class="price" <view class="price"
><text style="font-size: 15px">{{ ><text style="font-size: 15px">{{ item.number }}</text>
item.number
}}</text>
积分</view 积分</view
> >
<nut-button <nut-button
size="mini" size="mini"
type="primary" type="primary"
@click.stop=" @click.stop="toGoodDetails(item.gid as number)"
toGoodDetails(item.gid as number)
"
>去兑换</nut-button >去兑换</nut-button
> >
</view> </view>

View File

@@ -12,7 +12,7 @@ import { WebView } from "@tarojs/components";
const gameUrl = ref(""); const gameUrl = ref("");
const user = ref({}) const user = ref({});
useLoad(() => { useLoad(() => {
user.value = getStorageSync("userInfo"); user.value = getStorageSync("userInfo");

View File

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

View File

@@ -26,9 +26,7 @@
position="after" position="after"
:symbol="payType === 'jf' ? '积分' : '元'" :symbol="payType === 'jf' ? '积分' : '元'"
/> />
<view class="stock"> <view class="stock"> 库存剩余:{{ goodInfo.stock }} </view>
库存剩余:{{ goodInfo.stock }}
</view>
</view> </view>
<view class="title">{{ goodInfo.name }}</view> <view class="title">{{ goodInfo.name }}</view>
<view class="sub">{{ goodInfo.profile }}</view> <view class="sub">{{ goodInfo.profile }}</view>
@@ -76,7 +74,7 @@
<!-- >加入购物车--> <!-- >加入购物车-->
<!-- </nut-button>--> <!-- </nut-button>-->
<nut-button type="primary" block @click="toOrderDetail()" <nut-button type="primary" block @click="toOrderDetail()"
>{{ payType === 'jf' ? '立即兑换' : '立即购买' }} >{{ payType === "jf" ? "立即兑换" : "立即购买" }}
</nut-button> </nut-button>
</view> </view>
</view> </view>
@@ -123,28 +121,33 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight;
import {ref} from 'vue' import { ref } from "vue";
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {Home, Left, My} from '@nutui/icons-vue-taro' import { Home, Left, My } from "@nutui/icons-vue-taro";
import {createActiveOrder, createOrder, getActiveGoodsDetail, getGoodsDetail} from '@/api/goods' import {
import Pay from '@/components/Pay.vue' createActiveOrder,
createOrder,
getActiveGoodsDetail,
getGoodsDetail,
} 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([]);
const isSkuShow = ref(false) const isSkuShow = ref(false);
const isShowPay = ref(false) const isShowPay = ref(false);
// const sku = ref([]); // const sku = ref([]);
const payType = ref('') const payType = ref("");
const orderData = ref([]) const orderData = ref([]);
const count = ref(1) const count = ref(1);
interface GoodInfo { interface GoodInfo {
gid?: number; gid?: number;
@@ -157,61 +160,61 @@ interface GoodInfo {
profile?: string; profile?: string;
} }
const goodInfo = ref<GoodInfo>({}) const goodInfo = ref<GoodInfo>({});
Taro.useLoad((options) => { Taro.useLoad((options) => {
payType.value = options.type === '1' ? 'wx' : 'jf' payType.value = options.type === "1" ? "wx" : "jf";
get_good_detail(options.gid) get_good_detail(options.gid);
}) });
const get_good_detail = async (gid: string) => { const get_good_detail = async (gid: string) => {
try { try {
let res: any let res: any;
if (payType.value === 'jf') { if (payType.value === "jf") {
res = await getGoodsDetail({gid: gid}) res = await getGoodsDetail({ gid: gid });
} else { } else {
res = await getActiveGoodsDetail({gid: gid}) res = await getActiveGoodsDetail({ gid: gid });
} }
goodInfo.value = { goodInfo.value = {
...res.data.data ...res.data.data,
// details: res.data.data.details., // details: res.data.data.details.,
} };
swiperList.value = res.data.data.rotation.split(',') swiperList.value = res.data.data.rotation.split(",");
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
icon: 'none' icon: "none",
}) });
}
} }
};
const addCount = () => { const addCount = () => {
if (count.value >= (goodInfo.value.stock as number)) { if (count.value >= (goodInfo.value.stock as number)) {
count.value = goodInfo.value.stock as number count.value = goodInfo.value.stock as number;
Taro.showToast({ Taro.showToast({
title: '库存不足', title: "库存不足",
icon: 'none' icon: "none",
}) });
return 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 clickBtnOperate = () => {};
@@ -235,76 +238,76 @@ const openSku = () => {
// }; // };
const toOrderDetail = async () => { const toOrderDetail = async () => {
if (!Taro.getStorageSync('token')) { if (!Taro.getStorageSync("token")) {
return Taro.showModal({ return Taro.showModal({
title: '提示', title: "提示",
content: '你还没登录,请先登录', content: "你还没登录,请先登录",
cancelText: '先逛逛', cancelText: "先逛逛",
confirmText: '去登录', confirmText: "去登录",
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
Taro.reLaunch({ Taro.reLaunch({
url: '/pages/users/login/index' url: "/pages/users/login/index",
}) });
} }
},
});
} }
}) 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'
// }) // })
try { try {
let res: any let res: any;
if (payType.value === 'jf') { if (payType.value === "jf") {
res = await createOrder([ res = await createOrder([
{ {
gid: goodInfo.value.gid, gid: goodInfo.value.gid,
count: Number(count.value) count: Number(count.value),
} },
]) ]);
} else { } else {
res = await createActiveOrder({ res = await createActiveOrder({
gid: goodInfo.value.gid, gid: goodInfo.value.gid,
stock: Number(count.value) stock: Number(count.value),
}) });
} }
orderData.value = res?.data?.data orderData.value = res?.data?.data;
isShowPay.value = true isShowPay.value = true;
count.value = 1 count.value = 1;
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
icon: 'none' icon: "none",
}) });
} }
isSkuShow.value = false isSkuShow.value = false;
} };
const closePay = (val: boolean) => { const closePay = (val: boolean) => {
isShowPay.value = val isShowPay.value = val;
orderData.value = [] 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">
@@ -356,7 +359,6 @@ page {
background-color: #fff; background-color: #fff;
.header { .header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@@ -372,7 +374,6 @@ page {
} }
} }
.sub { .sub {
font-size: 24px; font-size: 24px;
color: #999; color: #999;

View File

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

View File

@@ -43,10 +43,7 @@
<!-- 底部 --> <!-- 底部 -->
<view class="bottom-box"> <view class="bottom-box">
<view <view
>总计<nut-price >总计<nut-price :price="8888.01" position="after" symbol="积分"
:price="8888.01"
position="after"
symbol="积分"
/></view> /></view>
<nut-button type="primary" @click="orderPay">提交订单</nut-button> <nut-button type="primary" @click="orderPay">提交订单</nut-button>
</view> </view>

View File

@@ -2,11 +2,7 @@
<view> <view>
<view class="card"> <view class="card">
<view class="icon"> <view class="icon">
<Check <Check font-class-name="nutui-iconfont check" size="70" color="#fff" />
font-class-name="nutui-iconfont check"
size="70"
color="#fff"
/>
<!-- <CloseLittle font-class-name="nutui-iconfont check" size="70" color="#fff" /> --> <!-- <CloseLittle font-class-name="nutui-iconfont check" size="70" color="#fff" /> -->
</view> </view>
<view class="text-box"> <view class="text-box">

View File

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

View File

@@ -197,15 +197,9 @@ const delOrder = async (oid: string) => {
</view> </view>
</view> </view>
<view v-if="orderList.length > 0"> <view v-if="orderList.length > 0">
<view <view class="order-card" v-for="(item, index) in orderList" :key="index">
class="order-card"
v-for="(item, index) in orderList"
:key="index"
>
<view class="top"> <view class="top">
<view>{{ <view>{{ item.add_time.slice(0, 19).replace("T", " ") }}</view>
item.add_time.slice(0, 19).replace("T", " ")
}}</view>
<view style="color: red">{{ <view style="color: red">{{
item.status === 0 item.status === 0
? "待付款" ? "待付款"

View File

@@ -1,4 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '活动商品', navigationBarTitleText: "活动商品",
}) });

View File

@@ -1,4 +1,4 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '首页', navigationBarTitleText: "首页",
enableShareAppMessage: true enableShareAppMessage: true,
}) });

View File

@@ -48,8 +48,7 @@
Number(item.lon) Number(item.lon)
) )
}} }}
</text </text>
>
</view> </view>
</view> </view>
</view> </view>
@@ -59,112 +58,112 @@
</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 {bindParent, getBanner} from '@/api/user' import { bindParent, getBanner } from "@/api/user";
import {getMerList} from '@/api/goods' import { getMerList } from "@/api/goods";
import {calculateDistance} from '@/utils' import { calculateDistance } from "@/utils";
import Popup from "@/components/Popup.vue"; import Popup from "@/components/Popup.vue";
const searchValue = ref('') const searchValue = ref("");
const swiperList = ref<any>([]) const swiperList = ref<any>([]);
const userMenuList = ref([ const userMenuList = ref([
{ {
id: 1, id: 1,
label: '活动游戏', label: "活动游戏",
url: `/pages/game/gamehome/index?uid=${Taro.getStorageSync('token')}`, url: `/pages/game/gamehome/index?uid=${Taro.getStorageSync("token")}`,
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: '/pages/hotGoods/index/index', url: "/pages/hotGoods/index/index",
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",
} },
]) ]);
Taro.useDidShow(async () => { Taro.useDidShow(async () => {
await getBannerList() await getBannerList();
await get_mer_list() await get_mer_list();
if (Taro.getStorageSync('token') && Taro.getStorageSync('bind_id')) { if (Taro.getStorageSync("token") && Taro.getStorageSync("bind_id")) {
try { try {
const res = await bindParent({ const res = await bindParent({
uid: Taro.getStorageSync('bind_id') uid: Taro.getStorageSync("bind_id"),
}) });
Taro.showToast({ Taro.showToast({
title: res.msg title: res.msg,
}) });
Taro.removeStorageSync('bind_id') Taro.removeStorageSync("bind_id");
} catch (error) { } catch (error) {
Taro.removeStorageSync('bind_id') Taro.removeStorageSync("bind_id");
throw error throw error;
} }
} }
}) });
Taro.useShareAppMessage(() => ({ Taro.useShareAppMessage(() => ({
title: '捷兑通', title: "捷兑通",
path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`, path: `/pages/index/index?scene=${Taro.getStorageSync("token")}`,
imageUrl: imageUrl:
'https://upload.jdt168.com/1694242954957988438_微信图片_20230909150016.jpg' "https://upload.jdt168.com/1694242954957988438_微信图片_20230909150016.jpg",
})) }));
const merdata = ref([]) const merdata = ref([]);
const userLocalNum = ref({ const userLocalNum = ref({
l: 0, l: 0,
t: 0 t: 0,
}) });
const get_mer_list = async () => { const get_mer_list = async () => {
Taro.getLocation({ Taro.getLocation({
type: 'wgs84', type: "wgs84",
success: (res) => { success: (res) => {
userLocalNum.value.l = res.longitude userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude userLocalNum.value.t = res.latitude;
} },
}) });
const res = await getMerList({ const res = await getMerList({
PageNum: 1, PageNum: 1,
PageSize: 10, PageSize: 10,
Btype: 2, Btype: 2,
classid: 0 classid: 0,
}) });
merdata.value = res.data.data merdata.value = res.data.data;
} };
const getBannerList = async () => { const getBannerList = async () => {
const {data}: any = await getBanner() const { data }: any = await getBanner();
swiperList.value = data.data swiperList.value = data.data;
} };
const toPage = (url: string) => { const toPage = (url: string) => {
Taro.navigateTo({ Taro.navigateTo({
url: url url: url,
}) });
} };
const toMerDetails = (item: any) => { const toMerDetails = (item: any) => {
Taro.setStorageSync('mer_info', item) Taro.setStorageSync("mer_info", item);
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/mer/mer_detail/index` url: `/pages/mer/mer_detail/index`,
}) });
} };
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@@ -1,11 +1,7 @@
<script setup lang="ts"> <script setup lang="ts"></script>
</script>
<template> <template>
<view></view> <view></view>
</template> </template>
<style lang="scss"> <style lang="scss"></style>
</style>

View File

@@ -7,10 +7,7 @@
pagination-color="red" pagination-color="red"
auto-play="3000" auto-play="3000"
> >
<nut-swiper-item <nut-swiper-item v-for="(itm, idx) in (swiperList as any)" :key="idx">
v-for="(itm, idx) in (swiperList as any)"
:key="idx"
>
<img <img
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
:src="itm" :src="itm"
@@ -23,7 +20,7 @@
<view class="title">{{ mer_info.name }}</view> <view class="title">{{ mer_info.name }}</view>
<view class="bom"> <view class="bom">
<view class="left"> <view class="left">
<view>{{ mer_info.address || '暂无商家地址' }}</view> <view>{{ mer_info.address || "暂无商家地址" }}</view>
<view class="sub" <view class="sub"
>距你{{ >距你{{
calculateDistance( calculateDistance(
@@ -33,8 +30,7 @@
Number(mer_info.lon) Number(mer_info.lon)
) )
}} }}
</view </view>
>
</view> </view>
<view class="right"> <view class="right">
<view @click="clickMap"> <view @click="clickMap">
@@ -64,6 +60,7 @@
> >
<nut-tab-pane <nut-tab-pane
v-for="(item, index) in class_list as any[]" v-for="(item, index) in class_list as any[]"
:key="index"
:title="item.name" :title="item.name"
:pane-key="index" :pane-key="index"
> >
@@ -77,55 +74,31 @@
<img :src="item.cover" /> <img :src="item.cover" />
<view class="right"> <view class="right">
<view class="name">{{ item.name }}</view> <view class="name">{{ item.name }}</view>
<view class="stock"> <view class="stock"> 库存剩余:{{ item.stock }} </view>
库存剩余:{{ item.stock }}
</view>
<view class="bom"> <view class="bom">
<view class="price" <view class="price">
> <text style="font-size: 15px">{{ item.number }} </text>
<text style="font-size: 15px">{{ {{ mer_info.bType === 1 ? "元" : "积分" }}
item.number </view>
}}
</text>
{{
mer_info.bType === 1
? '元'
: '积分'
}}
</view
>
<nut-button <nut-button
size="mini" size="mini"
v-if="mer_info.bType === 1" v-if="mer_info.bType === 1"
type="primary" type="primary"
@click.stop=" @click.stop="toGoodDetails(item.gid as number, 1)"
toGoodDetails(
item.gid as number,
1
)
"
>去购买 >去购买
</nut-button </nut-button>
>
<nut-button <nut-button
size="mini" size="mini"
v-else v-else
type="primary" type="primary"
@click.stop=" @click.stop="toGoodDetails(item.gid as number, 2)"
toGoodDetails(
item.gid as number,
2
)
"
>去兑换 >去兑换
</nut-button </nut-button>
> </view>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
</view
>
<nut-empty v-else description="该分类暂无商品"></nut-empty> <nut-empty v-else description="该分类暂无商品"></nut-empty>
</nut-tab-pane> </nut-tab-pane>
</nut-tabs> </nut-tabs>
@@ -135,44 +108,44 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {Find, Locationg3} from '@nutui/icons-vue-taro' import { Find, Locationg3 } from "@nutui/icons-vue-taro";
import {ref} from 'vue' import { ref } from "vue";
import {calculateDistance} from '@/utils' import { calculateDistance } from "@/utils";
import {getGoodList, getMerCategory} from '@/api/goods' import { getGoodList, getMerCategory } from "@/api/goods";
const swiperList = ref([]) const swiperList = ref([]);
const mer_info = ref<any>({}) const mer_info = ref<any>({});
const value = ref('0') const value = ref("0");
const userLocalNum = ref({ const userLocalNum = ref({
l: 0, l: 0,
t: 0 t: 0,
}) });
Taro.useLoad(() => { Taro.useLoad(() => {
Taro.getLocation({ Taro.getLocation({
type: 'wgs84', type: "wgs84",
success: (res) => { success: (res) => {
userLocalNum.value.l = res.longitude userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude userLocalNum.value.t = res.latitude;
} },
}) });
mer_info.value = Taro.getStorageSync('mer_info') mer_info.value = Taro.getStorageSync("mer_info");
Taro.setNavigationBarTitle({ Taro.setNavigationBarTitle({
title: mer_info.value.name title: mer_info.value.name,
}) });
swiperList.value = mer_info.value.img.split(',') swiperList.value = mer_info.value.img.split(",");
get_class_list() get_class_list();
}) });
const clickPhone = () => { const clickPhone = () => {
Taro.makePhoneCall({ Taro.makePhoneCall({
phoneNumber: mer_info.value.mobile phoneNumber: mer_info.value.mobile,
}) });
} };
const clickMap = () => { const clickMap = () => {
Taro.openLocation({ Taro.openLocation({
@@ -180,50 +153,50 @@ const clickMap = () => {
address: mer_info.value.address, address: mer_info.value.address,
latitude: Number(mer_info.value.lat), latitude: Number(mer_info.value.lat),
longitude: Number(mer_info.value.lon), longitude: Number(mer_info.value.lon),
scale: 18 scale: 18,
}) });
} };
const class_list = ref< const class_list = ref<
Array<{ Array<{
ID?: number; ID?: number;
name?: string; name?: string;
}> }>
>([]) >([]);
const get_class_list = async () => { const get_class_list = async () => {
const res = await getMerCategory({ const res = await getMerCategory({
Bid: mer_info.value.bid Bid: mer_info.value.bid,
}) });
class_list.value = res.data.data || [] class_list.value = res.data.data || [];
await get_good_list(class_list.value[0].ID as number) await get_good_list(class_list.value[0].ID as number);
} };
const clickTab = (val: any) => { const clickTab = (val: any) => {
get_good_list(class_list.value[val.paneKey].ID as number) get_good_list(class_list.value[val.paneKey].ID as number);
} };
const good_list = ref([]) const good_list = ref([]);
const get_good_list = async (id: number) => { const get_good_list = async (id: number) => {
Taro.showLoading({ Taro.showLoading({
title: '加载中', title: "加载中",
mask: true mask: true,
}) });
const res = await getGoodList({ const res = await getGoodList({
bid: mer_info.value.bid, bid: mer_info.value.bid,
BType: mer_info.value.bType, BType: mer_info.value.bType,
class_id: id, class_id: id,
status: 1, status: 1,
state: 1 state: 1,
}) });
good_list.value = res.data.data || [] good_list.value = res.data.data || [];
Taro.hideLoading() Taro.hideLoading();
} };
const toGoodDetails = (id: number, type: number) => { const toGoodDetails = (id: number, type: number) => {
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}` url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}`,
}) });
} };
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@@ -1,4 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '商品添加/编辑' navigationBarTitleText: "商品添加/编辑",
}) });

View File

@@ -1,87 +1,103 @@
<script lang="ts" setup> <script lang="ts" setup>
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {Ref, ref} from 'vue' import { Ref, ref } from "vue";
import Upload from '../../../components/Upload.vue' import Upload from "../../../components/Upload.vue";
import RichEditor from '../../../components/RichEditor.vue' import RichEditor from "../../../components/RichEditor.vue";
import {addGood} from '@/api/product' import { addGood } from "@/api/product";
const ruleForm = ref(null) as Ref const ruleForm = ref(null) as Ref;
const basicData = ref({ const basicData = ref({
name: '', name: "",
class_id: null, class_id: null,
cover: [], cover: [],
rotation: [], rotation: [],
profile: '', profile: "",
details: '', details: "",
stock: null, stock: null,
number: null, number: null,
market_num: null, market_num: null,
state: 2 state: 2,
}) });
const rules = { const rules = {
name: [{ name: [
{
required: true, required: true,
message: '请填写商品名称' message: "请填写商品名称",
}], },
class_id: [{ ],
class_id: [
{
required: true, required: true,
message: '请选择商品分类' message: "请选择商品分类",
}], },
cover: [{ ],
cover: [
{
required: true, required: true,
message: '请上传商品封面', message: "请上传商品封面",
validator: (value) => { validator: (value) => {
return value.length > 0 return value.length > 0;
} },
}], },
rotation: [{ ],
rotation: [
{
required: true, required: true,
message: '请上传商品轮播图', message: "请上传商品轮播图",
validator: (value) => { validator: (value) => {
return value.length > 0 return value.length > 0;
} },
}], },
profile: [{ ],
profile: [
{
required: true, required: true,
message: '请填写商品名称' message: "请填写商品名称",
}], },
stock: [{ ],
stock: [
{
required: true, required: true,
message: '请填写商品库存' message: "请填写商品库存",
}], },
number: [{ ],
number: [
{
required: true, required: true,
message: '请填写商品价格' message: "请填写商品价格",
}], },
market_num: [{ ],
market_num: [
{
required: true, required: true,
message: '请填写商品市场价' message: "请填写商品市场价",
}] },
} ],
};
const columnsClass = ref([]) const columnsClass = ref([]);
Taro.useLoad((options) => { Taro.useLoad((options) => {
console.log(options) console.log(options);
}) });
const openGoodClass = ref(false) const openGoodClass = ref(false);
const confirmClass = (val: any) => { const confirmClass = (val: any) => {
console.log(val) console.log(val);
} };
const ok = async () => { const ok = async () => {
ruleForm.value.validate().then(({ valid, errors }: any) => { ruleForm.value.validate().then(({ valid, errors }: any) => {
if (valid) { if (valid) {
console.log('success', basicData.value) console.log("success", basicData.value);
} else { } else {
console.log('error submit!!', errors) console.log("error submit!!", errors);
}
})
} }
});
};
</script> </script>
<template> <template>
@@ -91,8 +107,12 @@ const ok = async () => {
<template v-slot:content> <template v-slot:content>
<nut-form ref="ruleForm" :model-value="basicData" :rules="rules"> <nut-form ref="ruleForm" :model-value="basicData" :rules="rules">
<nut-form-item label="商品分类:" required prop="class_id"> <nut-form-item label="商品分类:" required prop="class_id">
<nut-input v-model="basicData.class_id" disabled placeholder="请选择商品分类" <nut-input
@click="openGoodClass = true"/> v-model="basicData.class_id"
disabled
placeholder="请选择商品分类"
@click="openGoodClass = true"
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="商品封面:" required prop="cover"> <nut-form-item label="商品封面:" required prop="cover">
<Upload v-model:list="basicData.cover" /> <Upload v-model:list="basicData.cover" />
@@ -101,33 +121,47 @@ const ok = async () => {
<Upload v-model:list="basicData.rotation" :max="10" /> <Upload v-model:list="basicData.rotation" :max="10" />
</nut-form-item> </nut-form-item>
<nut-form-item label="商品名称:" required prop="name"> <nut-form-item label="商品名称:" required prop="name">
<nut-input v-model="basicData.name" placeholder="请输入商品名称" <nut-input
v-model="basicData.name"
placeholder="请输入商品名称"
type="text" type="text"
/> />
</nut-form-item> </nut-form-item>
<nut-form-item label="商品价格:" required prop="number"> <nut-form-item label="商品价格:" required prop="number">
<nut-input v-model="basicData.number" placeholder="请输入商品价格" <nut-input
v-model="basicData.number"
placeholder="请输入商品价格"
/> />
</nut-form-item> </nut-form-item>
<nut-form-item label="市场价格:" required prop="market_num"> <nut-form-item label="市场价格:" required prop="market_num">
<nut-input v-model="basicData.market_num" placeholder="请输入市场价格" <nut-input
v-model="basicData.market_num"
placeholder="请输入市场价格"
/> />
</nut-form-item> </nut-form-item>
<nut-form-item label="商品库存:" required prop="stock"> <nut-form-item label="商品库存:" required prop="stock">
<nut-input v-model="basicData.stock" placeholder="请输入商品库存" <nut-input v-model="basicData.stock" placeholder="请输入商品库存" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="商品简介:" required prop="profile"> <nut-form-item label="商品简介:" required prop="profile">
<nut-textarea <nut-textarea
class="textarea" class="textarea"
v-model="basicData.profile" placeholder="请输入商品简介" v-model="basicData.profile"
type="text"/> placeholder="请输入商品简介"
type="text"
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="上架状态:" prop="state"> <nut-form-item label="上架状态:" prop="state">
<nut-switch v-model="basicData.state" :active-value="1" :inactive-value="2"/> <nut-switch
v-model="basicData.state"
:active-value="1"
:inactive-value="2"
/>
</nut-form-item> </nut-form-item>
<nut-form-item prop="details"> <nut-form-item prop="details">
<RichEditor :content="basicData.details" @input="(val) => basicData.details = val"/> <RichEditor
:content="basicData.details"
@input="(val) => (basicData.details = val)"
/>
</nut-form-item> </nut-form-item>
<nut-form-item prop="ok"> <nut-form-item prop="ok">
<nut-button block type="primary" @click="ok">提交</nut-button> <nut-button block type="primary" @click="ok">提交</nut-button>
@@ -136,8 +170,15 @@ const ok = async () => {
</template> </template>
</nut-backtop> </nut-backtop>
<!-- 商品分类 --> <!-- 商品分类 -->
<nut-popup position="bottom" v-model:visible="openGoodClass" @close="openGoodClass = false"> <nut-popup
<nut-picker :columns="columnsClass" title="商品分类" @confirm="confirmClass" position="bottom"
v-model:visible="openGoodClass"
@close="openGoodClass = false"
>
<nut-picker
:columns="columnsClass"
title="商品分类"
@confirm="confirmClass"
></nut-picker> ></nut-picker>
</nut-popup> </nut-popup>
</view> </view>
@@ -151,7 +192,7 @@ const ok = async () => {
.textarea { .textarea {
height: 100px; height: 100px;
background-color: #FAFAFA; background-color: #fafafa;
padding: 10px !important; padding: 10px !important;
border-radius: 10px; border-radius: 10px;
} }

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -15,8 +15,7 @@
class="user-center-card__header__info__name" class="user-center-card__header__info__name"
@click="toPage('/pages/users/user_setting/index')" @click="toPage('/pages/users/user_setting/index')"
>{{ userInfo.nickName }} >{{ userInfo.nickName }}
</view </view>
>
<view v-if="!userInfo.phone"> <view v-if="!userInfo.phone">
<nut-button <nut-button
size="mini" size="mini"
@@ -28,11 +27,7 @@
</view> </view>
<view class="rightIcon"> <view class="rightIcon">
<Scan style="margin-right: 20px" @click="scanCode" size="22" /> <Scan style="margin-right: 20px" @click="scanCode" size="22" />
<Setting <Setting style="margin-right: 20px" @click="toSetting" size="22" />
style="margin-right: 20px"
@click="toSetting"
size="22"
/>
</view> </view>
</view> </view>
<view v-else class="user-center-card__header__transparent"> <view v-else class="user-center-card__header__transparent">
@@ -44,9 +39,7 @@
</nut-avatar> </nut-avatar>
</view> </view>
<view class="user-center-card__header__info"> <view class="user-center-card__header__info">
<view <view class="user-center-card__header__info__name" @click="clickLogin"
class="user-center-card__header__info__name"
@click="clickLogin"
>点击立即登录 >点击立即登录
</view> </view>
</view> </view>
@@ -101,9 +94,9 @@
<view class="user-center"> <view class="user-center">
<view>我的服务</view> <view>我的服务</view>
<view class="box"> <view class="box">
<template v-if="isLogin">
<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)" @click="toPage(item.url)"
@@ -112,9 +105,13 @@
<IconFont size="40" :name="item.icon"></IconFont> <IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view> <view class="label">{{ item.label }}</view>
</view> </view>
<button v-if="isLogin" class="box-mini" open-type='contact'> </template>
<IconFont size="40"
name="http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png"></IconFont> <button v-if="isLogin" class="box-mini" open-type="contact">
<IconFont
size="40"
name="http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png"
></IconFont>
<text class="label">联系客服</text> <text class="label">联系客服</text>
</button> </button>
</view> </view>
@@ -176,15 +173,15 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {ref} from 'vue' import { ref } from "vue";
import {ArrowRight, Setting, IconFont, Scan} from '@nutui/icons-vue-taro' import { ArrowRight, Setting, IconFont, Scan } 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, getPhone, bindParent} from '@/api/user' import { getPersonalInfo, getPhone, bindParent } from "@/api/user";
const isShowLogin = ref(false) const isShowLogin = ref(false);
const isLogin = ref(false) const isLogin = ref(false);
interface UserInfo { interface UserInfo {
nickName?: string; nickName?: string;
@@ -195,57 +192,57 @@ interface UserInfo {
uid?: string; uid?: string;
} }
const userInfo = ref<UserInfo>({}) const userInfo = ref<UserInfo>({});
Taro.useDidShow(() => { Taro.useDidShow(() => {
const token = Taro.getStorageSync('token') const token = Taro.getStorageSync("token");
if (token) { if (token) {
getUserInfo() getUserInfo();
} }
}) });
const cancelLogin = () => { const cancelLogin = () => {
isShowLogin.value = false isShowLogin.value = false;
} };
const getUserInfo = async () => { const getUserInfo = async () => {
Taro.showLoading({ Taro.showLoading({
title: '加载中' title: "加载中",
}) });
const res = await getPersonalInfo() const res = await getPersonalInfo();
userInfo.value = res.data.data userInfo.value = res.data.data;
Taro.setStorageSync('userInfo', res.data.data) Taro.setStorageSync("userInfo", res.data.data);
Taro.setStorageSync('mer_type', res.data.store_type) Taro.setStorageSync("mer_type", res.data.store_type);
isLogin.value = true isLogin.value = true;
cancelLogin() cancelLogin();
Taro.hideLoading() Taro.hideLoading();
} };
const getphonenumber = async (e: any) => { const getphonenumber = async (e: any) => {
await getPhone({ await getPhone({
uid: userInfo.value.uid, uid: userInfo.value.uid,
code: e.detail.code code: e.detail.code,
}) });
await getUserInfo() await getUserInfo();
} };
const toOrderList = (e: number) => { const toOrderList = (e: number) => {
if (!isLogin) if (!isLogin.value)
return Taro.showToast({ return Taro.showToast({
title: '请先登录', title: "请先登录",
icon: 'none' icon: "none",
}) });
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,
@@ -255,65 +252,65 @@ const userMenuList = ref([
// }, // },
{ {
id: 3, id: 3,
label: '我的推广', label: "我的推广",
url: '/pages/users/distribution/index', url: "/pages/users/distribution/index",
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: '', 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: '', // 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
Taro.redirectTo({ Taro.redirectTo({
url: '/pages/users/login/index' url: "/pages/users/login/index",
}) });
} };
const toPage = (url: string) => { const toPage = (url: string) => {
Taro.navigateTo({ Taro.navigateTo({
url: url url: url,
}) });
} };
const scanCode = () => { const scanCode = () => {
Taro.scanCode({ Taro.scanCode({
onlyFromCamera: true, onlyFromCamera: true,
scanType: ['qrCode'], scanType: ["qrCode"],
success: async (data) => { success: async (data) => {
try { try {
await bindParent({ await bindParent({
uid: data.result uid: data.result,
}) });
Taro.showToast({ Taro.showToast({
title: '绑定成功', title: "绑定成功",
icon: 'none' icon: "none",
}) });
} catch (error) { } catch (error) {
Taro.showToast({ Taro.showToast({
title: error.msg, title: error.msg,
icon: 'none' icon: "none",
}) });
}
}
})
} }
},
});
};
</script> </script>
<style lang="scss"> <style lang="scss">
@@ -457,7 +454,6 @@ const scanCode = () => {
color: #000000; color: #000000;
background-color: #fff; background-color: #fff;
height: 100%; height: 100%;
} }
button::after { button::after {

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '我的账户' navigationBarTitleText: "我的账户",
}) });

View File

@@ -21,21 +21,21 @@ const tabsList = ref([
{ {
title: "活动赠送", title: "活动赠送",
value: 4, value: 4,
} },
]); ]);
const computerType = computed(() => { const computerType = computed(() => {
return (val: number) => { return (val: number) => {
switch (val) { switch (val) {
case 5: case 5:
return '注册赠送'; return "注册赠送";
case 6: case 6:
return '签到赠送'; return "签到赠送";
case 7: case 7:
return '系统赠送'; return "系统赠送";
} }
} };
}) });
const tabChange = (index: number) => { const tabChange = (index: number) => {
tabValue.value = index; tabValue.value = index;
@@ -44,7 +44,7 @@ const tabChange = (index: number) => {
page.value.PageNum = 1; page.value.PageNum = 1;
}; };
const data = ref([]); const data = ref<any>([]);
const userInfo = ref<any>({}); const userInfo = ref<any>({});
@@ -75,12 +75,12 @@ const getList = async () => {
if (tabValue.value === 1 || tabValue.value === 3) { if (tabValue.value === 1 || tabValue.value === 3) {
res = await getBeanDetail(newData); res = await getBeanDetail(newData);
} else if (tabValue.value === 2) { } else if (tabValue.value === 2) {
delete data.Type; // delete data.value.Type;
Reflect.deleteProperty(data.value, "Type");
res = await getIntegralDetail(newData); res = await getIntegralDetail(newData);
} else { } else {
res = await getGiftRecord(newData); res = await getGiftRecord(newData);
} }
console.log(res);
data.value = res.data.data || []; data.value = res.data.data || [];
page.value.ItemCount = res.data.count; page.value.ItemCount = res.data.count;
} catch (error) { } catch (error) {
@@ -136,16 +136,12 @@ const getList = async () => {
<view v-if="tabValue === 1" style="color: green" <view v-if="tabValue === 1" style="color: green"
>- >-
<text>{{ item.number }}积分</text> <text>{{ item.number }}积分</text>
</view </view>
>
<view v-if="tabValue === 3" style="color: red" <view v-if="tabValue === 3" style="color: red"
>+ >+
<text>{{ item.number }} <text>{{ item.number }} </text>
</text
>
积分 积分
</view </view>
>
</view> </view>
</view> </view>
</view> </view>
@@ -163,12 +159,9 @@ const getList = async () => {
<view class="right"> <view class="right">
<view style="color: red" <view style="color: red"
>+ >+
<text>{{ item.number }} <text>{{ item.number }} </text>
</text
>
豆子 豆子
</view </view>
>
</view> </view>
</view> </view>
</view> </view>
@@ -185,12 +178,9 @@ const getList = async () => {
<view class="right"> <view class="right">
<view style="color: red" <view style="color: red"
>+ >+
<text>{{ item.number }} <text>{{ item.number }} </text>
</text
>
豆子 豆子
</view </view>
>
</view> </view>
</view> </view>
</view> </view>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '手机号登录' navigationBarTitleText: "手机号登录",
}) });

View File

@@ -115,9 +115,7 @@ const login = async () => {
</view> </view>
</nut-form-item> </nut-form-item>
<nut-form-item> <nut-form-item>
<nut-button type="primary" block @click="login" <nut-button type="primary" block @click="login">登录</nut-button>
>登录</nut-button
>
</nut-form-item> </nut-form-item>
</nut-form> </nut-form>
</view> </view>

View File

@@ -12,7 +12,6 @@
<view>{{ item.nickName }}</view> <view>{{ item.nickName }}</view>
<view>{{ item.phone }}</view> <view>{{ item.phone }}</view>
</view> </view>
</view> </view>
<view class="right"></view> <view class="right"></view>
</view> </view>

View File

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

View File

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

View File

@@ -188,11 +188,7 @@ const getTj = async () => {
</view> </view>
</view> </view>
<view v-if="orderList.length > 0"> <view v-if="orderList.length > 0">
<view <view class="order-card" v-for="(item, index) in orderList" :key="index">
class="order-card"
v-for="(item, index) in orderList"
:key="index"
>
<view class="top"> <view class="top">
<view>{{ item.add_time.slice(0, 19) }}</view> <view>{{ item.add_time.slice(0, 19) }}</view>
<view style="color: red">{{ <view style="color: red">{{

View File

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

View File

@@ -47,9 +47,7 @@
<template #default> <template #default>
<view class="top"> <view class="top">
<image :src="goodInfo.BindGoods?.cover" /> <image :src="goodInfo.BindGoods?.cover" />
<view class="title" <view class="title">{{ goodInfo.BindGoods?.name }} </view>
>{{ goodInfo.BindGoods?.name }}
</view>
<view class="right"> <view class="right">
<view>{{ goodInfo.BindGoods?.number }}</view> <view>{{ goodInfo.BindGoods?.number }}</view>
<view>x{{ goodInfo.count }}</view> <view>x{{ goodInfo.count }}</view>
@@ -65,9 +63,7 @@
<nut-cell <nut-cell
v-if="goodInfo.expires !== 0" v-if="goodInfo.expires !== 0"
title="订单过期时间:" title="订单过期时间:"
:desc=" :desc="dayjs.unix(goodInfo.expires).format('YYYY-MM-DD HH:mm:ss')"
dayjs.unix(goodInfo.expires).format('YYYY-MM-DD HH:mm:ss')
"
></nut-cell> ></nut-cell>
<nut-cell <nut-cell
title="支付状态:" title="支付状态:"
@@ -89,9 +85,9 @@
<template #default> <template #default>
<view style="text-align: right; width: 100%"> <view style="text-align: right; width: 100%">
<view <view
>{{ >{{ goodInfo.status === 0 ? "应付款" : "实付款" }}({{
goodInfo.status === 0 ? '应付款' : '实付款' type === "1" ? "元" : "积分"
}}({{ type === '1' ? '元' : '积分' }}): }}):
<nut-price <nut-price
:price="goodInfo.number" :price="goodInfo.number"
size="normal" size="normal"
@@ -153,123 +149,123 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {Find, Service} from '@nutui/icons-vue-taro' import { Find, Service } from "@nutui/icons-vue-taro";
import {ref} from 'vue' import { ref } from "vue";
import dayjs from 'dayjs' import dayjs from "dayjs";
import duration from 'dayjs/plugin/duration' import duration from "dayjs/plugin/duration";
import Pay from '@/components/Pay.vue' import Pay from "@/components/Pay.vue";
dayjs.extend(duration) dayjs.extend(duration);
const goodInfo = ref<any>({}) const goodInfo = ref<any>({});
const statusList = ref([ const statusList = ref([
{ {
id: 0, id: 0,
text: '待付款' text: "待付款",
}, },
{ {
id: 1, id: 1,
text: '待使用' text: "待使用",
}, },
{ {
id: 2, id: 2,
text: '已使用' text: "已使用",
}, },
{ {
id: 3, id: 3,
text: '已失效' text: "已失效",
} },
]) ]);
const isShowCode = ref(false) const isShowCode = ref(false);
const isShowPay = ref(false) const isShowPay = ref(false);
const jfInfo = ref<any>({}) const jfInfo = ref<any>({});
const type = ref('') const type = ref("");
const url = ref('') const url = ref("");
Taro.useLoad((options) => { Taro.useLoad((options) => {
type.value = options.type type.value = options.type;
goodInfo.value = Taro.getStorageSync('item') goodInfo.value = Taro.getStorageSync("item");
if (goodInfo.value.status === 1) { if (goodInfo.value.status === 1) {
startTime() startTime();
} }
}) });
const toPhone = () => { const toPhone = () => {
Taro.makePhoneCall({ Taro.makePhoneCall({
phoneNumber: goodInfo.value.BindStore.mobile phoneNumber: goodInfo.value.BindStore.mobile,
}) });
} };
const toAdder = () => { const toAdder = () => {
Taro.openLocation({ Taro.openLocation({
latitude: Number(goodInfo.value.BindStore.lat), latitude: Number(goodInfo.value.BindStore.lat),
longitude: Number(goodInfo.value.BindStore.lon), longitude: Number(goodInfo.value.BindStore.lon),
scale: 18 scale: 18,
}) });
} };
const openPay = () => { const openPay = () => {
isShowPay.value = true isShowPay.value = true;
jfInfo.value = Taro.getStorageSync('item') jfInfo.value = Taro.getStorageSync("item");
} };
const errPay = () => { const errPay = () => {
isShowPay.value = false isShowPay.value = false;
Taro.showToast({ Taro.showToast({
title: '支付失败', title: "支付失败",
icon: 'none' icon: "none",
}) });
jfInfo.value = {} jfInfo.value = {};
} };
const closePay = () => { const closePay = () => {
isShowPay.value = false isShowPay.value = false;
Taro.showToast({ Taro.showToast({
title: '支付取消', title: "支付取消",
icon: 'none' icon: "none",
}) });
jfInfo.value = {} jfInfo.value = {};
} };
const openCode = () => { const openCode = () => {
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}` url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`;
isShowCode.value = true isShowCode.value = true;
} };
const closed = () => { const closed = () => {
isShowCode.value = false isShowCode.value = false;
url.value = '' url.value = "";
} };
let timeId: any let timeId: any;
const timeStr = ref('????') const timeStr = ref("????");
const startTime = () => { const startTime = () => {
const nowTime = dayjs() const nowTime = dayjs();
const endTime = dayjs(goodInfo.value.expires * 1000) const endTime = dayjs(goodInfo.value.expires * 1000);
// 计算剩余时间的持续时间对象 // 计算剩余时间的持续时间对象
const duration = dayjs.duration(endTime.diff(nowTime)) const duration = dayjs.duration(endTime.diff(nowTime));
// 格式化剩余时间 // 格式化剩余时间
timeStr.value = duration.format('D天H小时m分钟s秒') timeStr.value = duration.format("D天H小时m分钟s秒");
if (goodInfo.value.expires - dayjs().unix() > 0) { if (goodInfo.value.expires - dayjs().unix() > 0) {
clearInterval(timeId) clearInterval(timeId);
timeId = setTimeout(() => { timeId = setTimeout(() => {
startTime() startTime();
}, 1000) }, 1000);
}
} }
};
Taro.useUnload(() => { Taro.useUnload(() => {
clearTimeout(timeId) clearTimeout(timeId);
}) });
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '个人设置' navigationBarTitleText: "个人设置",
}) });

View File

@@ -1,18 +1,22 @@
<script lang="ts" setup> <script lang="ts" setup>
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
const toPage = (url: string) => { const toPage = (url: string) => {
if (url === '1') return Taro.showToast({title: '暂未开放', icon: 'none'}) if (url === "1") return Taro.showToast({ title: "暂未开放", icon: "none" });
Taro.navigateTo({ Taro.navigateTo({
url: url url: url,
}) });
} };
</script> </script>
<template> <template>
<view class="app"> <view class="app">
<nut-cell-group> <nut-cell-group>
<nut-cell title="个人信息" is-link @click="toPage('/pages/users/user_setting/index')"></nut-cell> <nut-cell
title="个人信息"
is-link
@click="toPage('/pages/users/user_setting/index')"
></nut-cell>
<nut-cell title="关于我们" is-link @click="toPage('1')"></nut-cell> <nut-cell title="关于我们" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="资质证明" is-link @click="toPage('1')"></nut-cell> <nut-cell title="资质证明" is-link @click="toPage('1')"></nut-cell>
<nut-cell title="协议规则" is-link @click="toPage('1')"></nut-cell> <nut-cell title="协议规则" is-link @click="toPage('1')"></nut-cell>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '商户入驻', navigationBarTitleText: "商户入驻",
}) });

View File

@@ -1,8 +1,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
import {ref} from 'vue' import { ref } from "vue";
import {applyMer, getMerTypeList, getVerifyCode} from '@/api/user' import { applyMer, getMerTypeList, getVerifyCode } from "@/api/user";
import Upload from '@/components/Upload.vue' import Upload from "@/components/Upload.vue";
const visible = ref(false); const visible = ref(false);

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: '个人资料', navigationBarTitleText: "个人资料",
}) });

View File

@@ -50,8 +50,7 @@ const chooseavatar = (e: any) => {
const subUser = async () => { const subUser = async () => {
try { try {
const reg = const reg = /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
/^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/;
if (!reg.test(userInfo.value.phone)) if (!reg.test(userInfo.value.phone))
return Taro.showToast({ return Taro.showToast({
title: "请输入正确的手机号码", title: "请输入正确的手机号码",
@@ -93,15 +92,9 @@ const getUserInfo = async () => {
<!-- {{ userInfo }} --> <!-- {{ userInfo }} -->
<view class="avatar-card"> <view class="avatar-card">
<view class="left"> <view class="left">
<nut-button <nut-button open-type="chooseAvatar" @chooseavatar="chooseavatar">
open-type="chooseAvatar"
@chooseavatar="chooseavatar"
>
<nut-avatar size="large"> <nut-avatar size="large">
<img <img style="border-radius: 50%" :src="userInfo.avatarUrl" />
style="border-radius: 50%"
:src="userInfo.avatarUrl"
/>
</nut-avatar> </nut-avatar>
</nut-button> </nut-button>
@@ -140,16 +133,13 @@ const getUserInfo = async () => {
/> />
</template> </template>
</nut-cell> </nut-cell>
<nut-cell title="注销账号" desc="账号注销后不能恢复" is-link> <nut-cell title="注销账号" desc="账号注销后不能恢复" is-link> </nut-cell>
</nut-cell>
</nut-cell-group> </nut-cell-group>
<view class="btn"> <view class="btn">
<nut-button block @click="subUser">保存信息</nut-button> <nut-button block @click="subUser">保存信息</nut-button>
</view> </view>
<view class="btn"> <view class="btn">
<nut-button block type="primary" @click="logOut" <nut-button block type="primary" @click="logOut">退出登录</nut-button>
>退出登录</nut-button
>
</view> </view>
</view> </view>
</template> </template>

View File

@@ -1,8 +1,11 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4211210 */ font-family: "iconfont"; /* Project id 4211210 */
src: url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff2?t=1692081500100') format('woff2'), src: url("https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff2?t=1692081500100")
url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff?t=1692081500100') format('woff'), format("woff2"),
url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.ttf?t=1692081500100') format('truetype'); url("https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff?t=1692081500100")
format("woff"),
url("https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.ttf?t=1692081500100")
format("truetype");
} }
.iconfont { .iconfont {
@@ -136,4 +139,3 @@
.icon-fontbgcolor-copy:before { .icon-fontbgcolor-copy:before {
content: "\eae7"; content: "\eae7";
} }

View File

@@ -1,8 +1,11 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 993865 */ font-family: "iconfont"; /* Project id 993865 */
src: url('https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.woff2?t=1681715156711') format('woff2'), src: url("https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.woff2?t=1681715156711")
url('https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.woff?t=1681715156711') format('woff'), format("woff2"),
url('https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.ttf?t=1681715156711') format('truetype'); url("https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.woff?t=1681715156711")
format("woff"),
url("https://at.alicdn.com/t/c/font_993865_zmqjk4lvax.ttf?t=1681715156711")
format("truetype");
} }
.iconfont { .iconfont {

View File

@@ -7,14 +7,21 @@ export function calculateDistance(
la2: number, la2: number,
lo2: number lo2: number
): any { ): any {
var radLat1 = la1 * Math.PI / 180.0; var radLat1 = (la1 * Math.PI) / 180.0;
var radLat2 = la2 * Math.PI / 180.0; var radLat2 = (la2 * Math.PI) / 180.0;
var a = radLat1 - radLat2; var a = radLat1 - radLat2;
var b = lo1 * Math.PI / 180.0 - lo2 * Math.PI / 180.0; var b = (lo1 * Math.PI) / 180.0 - (lo2 * Math.PI) / 180.0;
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) + Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2))); var s =
2 *
Math.asin(
Math.sqrt(
Math.pow(Math.sin(a / 2), 2) +
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)
)
);
s = s * 6378.137; s = s * 6378.137;
s = Math.round(s * 10000) / 10000; s = Math.round(s * 10000) / 10000;
return s.toFixed(2) + 'km' return s.toFixed(2) + "km";
} }
// 将角度转换为弧度 // 将角度转换为弧度

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
import Taro from '@tarojs/taro' import Taro from "@tarojs/taro";
export const BASE_URL = process.env.TARO_APP_API export const BASE_URL = process.env.TARO_APP_API;
interface Res<T> { interface Res<T> {
code: number; code: number;
@@ -8,47 +8,42 @@ interface Res<T> {
msg: string; msg: string;
} }
type Method = 'GET' | 'POST' | 'PUT' | 'DELETE'; type Method = "GET" | "POST" | "PUT" | "DELETE";
const request = ( const request = (
url: string, url: string,
data: object = {}, data: object = {},
method: Method = 'GET' method: Method = "GET"
): Promise<Res<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 + url, url: BASE_URL + 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 }) => {
// Taro.hideLoading()
if (data.code !== 200) { if (data.code !== 200) {
Taro.showToast({ Taro.showToast({
title: data.msg, title: data.msg,
icon: 'none' icon: "none",
}) });
reject(data) reject(data);
return return;
} }
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 export default request;

View File

@@ -19,7 +19,7 @@
"allowJs": true, "allowJs": true,
"resolveJsonModule": true, "resolveJsonModule": true,
"typeRoots": ["node_modules/@types"], "typeRoots": ["node_modules/@types"],
"types": ["@tarojs/components/vue3"], "types": ["@tarojs/components/vue3", "node"],
"paths": { "paths": {
"@/*": ["src/*"] "@/*": ["src/*"]
} }

35
types/global.d.ts vendored
View File

@@ -1,22 +1,31 @@
/// <reference types="@tarojs/taro" /> /// <reference types="@tarojs/taro" />
declare module '*.png'; declare module "*.png";
declare module '*.gif'; declare module "*.gif";
declare module '*.jpg'; declare module "*.jpg";
declare module '*.jpeg'; declare module "*.jpeg";
declare module '*.svg'; declare module "*.svg";
declare module '*.css'; declare module "*.css";
declare module '*.less'; declare module "*.less";
declare module '*.scss'; declare module "*.scss";
declare module '*.sass'; declare module "*.sass";
declare module '*.styl'; declare module "*.styl";
declare namespace NodeJS { declare namespace NodeJS {
interface ProcessEnv { interface ProcessEnv {
TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd' TARO_ENV:
| "weapp"
| "swan"
| "alipay"
| "h5"
| "rn"
| "tt"
| "quickapp"
| "qq"
| "jd";
} }
} }
declare module '@tarojs/components' { declare module "@tarojs/components" {
export * from '@tarojs/components/types/index.vue3' export * from "@tarojs/components/types/index.vue3";
} }

4
types/vue.d.ts vendored
View File

@@ -1,6 +1,6 @@
export {} export {};
declare module 'vue' { declare module "vue" {
export interface GlobalComponents extends JSX.IntrinsicElements { export interface GlobalComponents extends JSX.IntrinsicElements {
/** Note: Vue 在 runtime 中将 JSX.IntrinsicElements 通过 index signature 重复声明标签 /** Note: Vue 在 runtime 中将 JSX.IntrinsicElements 通过 index signature 重复声明标签
* 这会导致插件无法正常跳转类型,可以手动覆盖声明标签活得更好的体验,参考如下: * 这会导致插件无法正常跳转类型,可以手动覆盖声明标签活得更好的体验,参考如下: