Merge branch 'dev' into test

This commit is contained in:
2023-11-28 18:56:29 +08:00
120 changed files with 27779 additions and 17682 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_size = 4
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false

View File

@@ -1,8 +1,11 @@
# 开发版appid
TARO_APP_ID='wx7b3322daa2cf9c88'
# 开发版appkey
TARO_APP_KEY='1234567890'
# API接口
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
# 游戏链接
TARO_APP_GAME='https://game.wanzhuanyongcheng.cn/public/#/pages/index/index?uid='
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='

View File

@@ -1,7 +1,10 @@
# 正式版版appid
TARO_APP_ID='wxdd00d46fa6f07974'
# 开发版appkey
TARO_APP_KEY='private.wxdd00d46fa6f07974.key'
# API接口
TARO_APP_API='https://www.wanzhuanyongcheng.cn/app'
TARO_APP_GAME = 'https://www.jdt168.com/public/#/pages/index/index?uid='
TARO_APP_GAME='https://jdt-prod-tz.wanzhuanyongcheng.cn/pages/index/index?uid='

View File

@@ -1,8 +1,11 @@
# 开发版appid
TARO_APP_ID='wx7b3322daa2cf9c88'
# 开发版appkey
TARO_APP_KEY='private.wx7b3322daa2cf9c88.key'
# API接口
TARO_APP_API='https://test.wanzhuanyongcheng.cn/app'
# 游戏链接
TARO_APP_GAME = 'https://game.wanzhuanyongcheng.cn/public/#/pages/index/index?uid='
TARO_APP_GAME='https://jdt-test-tz.wanzhuanyongcheng.cn/pages/index/index?uid='

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

3
.prettierignore Normal file
View File

@@ -0,0 +1,3 @@
/node_modules/**
/dist/*
/public/*

View File

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

85
components.d.ts vendored
View File

@@ -1,49 +1,52 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
import "@vue/runtime-core";
export {}
export {};
declare module '@vue/runtime-core' {
declare module "@vue/runtime-core" {
export interface GlobalComponents {
Auth: typeof import('./src/components/Auth.vue')['default']
NutAvatar: typeof import('@nutui/nutui-taro')['Avatar']
NutBacktop: typeof import('@nutui/nutui-taro')['Backtop']
NutButton: typeof import('@nutui/nutui-taro')['Button']
NutCalendar: typeof import('@nutui/nutui-taro')['Calendar']
NutCell: typeof import('@nutui/nutui-taro')['Cell']
NutCellGroup: typeof import('@nutui/nutui-taro')['CellGroup']
NutCheckbox: typeof import('@nutui/nutui-taro')['Checkbox']
NutDialog: typeof import('@nutui/nutui-taro')['Dialog']
NutEllipsis: typeof import('@nutui/nutui-taro')['Ellipsis']
NutEmpty: typeof import('@nutui/nutui-taro')['Empty']
NutForm: typeof import('@nutui/nutui-taro')['Form']
NutFormItem: typeof import('@nutui/nutui-taro')['FormItem']
NutGrid: typeof import('@nutui/nutui-taro')['Grid']
NutGridItem: typeof import('@nutui/nutui-taro')['GridItem']
NutImagePreview: typeof import('@nutui/nutui-taro')['ImagePreview']
NutInput: typeof import('@nutui/nutui-taro')['Input']
NutInputNumber: typeof import('@nutui/nutui-taro')['InputNumber']
NutOverlay: typeof import('@nutui/nutui-taro')['Overlay']
NutPagination: typeof import('@nutui/nutui-taro')['Pagination']
NutPicker: typeof import('@nutui/nutui-taro')['Picker']
NutPopup: typeof import('@nutui/nutui-taro')['Popup']
NutPrice: typeof import('@nutui/nutui-taro')['Price']
NutSearchbar: typeof import('@nutui/nutui-taro')['Searchbar']
NutSwipe: typeof import('@nutui/nutui-taro')['Swipe']
NutSwiper: typeof import('@nutui/nutui-taro')['Swiper']
NutSwiperItem: typeof import('@nutui/nutui-taro')['SwiperItem']
NutSwitch: typeof import('@nutui/nutui-taro')['Switch']
NutTable: typeof import('@nutui/nutui-taro')['Table']
NutTabPane: typeof import('@nutui/nutui-taro')['TabPane']
NutTabs: typeof import('@nutui/nutui-taro')['Tabs']
NutTextarea: typeof import('@nutui/nutui-taro')['Textarea']
NutUploader: typeof import('@nutui/nutui-taro')['Uploader']
Pay: typeof import('./src/components/Pay.vue')['default']
RichEditor: typeof import('./src/components/RichEditor.vue')['default']
Ucharts: typeof import('./src/components/Ucharts.vue')['default']
Upload: typeof import('./src/components/Upload.vue')['default']
UserModal: typeof import('./src/components/UserModal.vue')['default']
Auth: typeof import("./src/components/Auth.vue")["default"];
Cart: typeof import("./src/components/Cart.vue")["default"];
MerList: typeof import("./src/components/MerList.vue")["default"];
NutAvatar: typeof import("@nutui/nutui-taro")["Avatar"];
NutBacktop: typeof import("@nutui/nutui-taro")["Backtop"];
NutButton: typeof import("@nutui/nutui-taro")["Button"];
NutCalendar: typeof import("@nutui/nutui-taro")["Calendar"];
NutCell: typeof import("@nutui/nutui-taro")["Cell"];
NutCellGroup: typeof import("@nutui/nutui-taro")["CellGroup"];
NutCheckbox: typeof import("@nutui/nutui-taro")["Checkbox"];
NutCheckboxGroup: typeof import("@nutui/nutui-taro")["CheckboxGroup"];
NutDialog: typeof import("@nutui/nutui-taro")["Dialog"];
NutEllipsis: typeof import("@nutui/nutui-taro")["Ellipsis"];
NutEmpty: typeof import("@nutui/nutui-taro")["Empty"];
NutForm: typeof import("@nutui/nutui-taro")["Form"];
NutFormItem: typeof import("@nutui/nutui-taro")["FormItem"];
NutGrid: typeof import("@nutui/nutui-taro")["Grid"];
NutGridItem: typeof import("@nutui/nutui-taro")["GridItem"];
NutImagePreview: typeof import("@nutui/nutui-taro")["ImagePreview"];
NutInput: typeof import("@nutui/nutui-taro")["Input"];
NutInputNumber: typeof import("@nutui/nutui-taro")["InputNumber"];
NutOverlay: typeof import("@nutui/nutui-taro")["Overlay"];
NutPagination: typeof import("@nutui/nutui-taro")["Pagination"];
NutPicker: typeof import("@nutui/nutui-taro")["Picker"];
NutPopup: typeof import("@nutui/nutui-taro")["Popup"];
NutPrice: typeof import("@nutui/nutui-taro")["Price"];
NutSearchbar: typeof import("@nutui/nutui-taro")["Searchbar"];
NutSwiper: typeof import("@nutui/nutui-taro")["Swiper"];
NutSwiperItem: typeof import("@nutui/nutui-taro")["SwiperItem"];
NutSwitch: typeof import("@nutui/nutui-taro")["Switch"];
NutTable: typeof import("@nutui/nutui-taro")["Table"];
NutTabPane: typeof import("@nutui/nutui-taro")["TabPane"];
NutTabs: typeof import("@nutui/nutui-taro")["Tabs"];
NutTextarea: typeof import("@nutui/nutui-taro")["Textarea"];
NutUploader: typeof import("@nutui/nutui-taro")["Uploader"];
Pay: typeof import("./src/components/Pay.vue")["default"];
Popup: typeof import("./src/components/Popup.vue")["default"];
RichEditor: typeof import("./src/components/RichEditor.vue")["default"];
Ucharts: typeof import("./src/components/Ucharts.vue")["default"];
Upload: typeof import("./src/components/Upload.vue")["default"];
UserModal: typeof import("./src/components/UserModal.vue")["default"];
}
}

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
module.exports = {
env: {
NODE_ENV: '"production"'
NODE_ENV: '"production"',
},
defineConstants: {},
mini: {},
@@ -18,7 +18,6 @@ module.exports = {
// */
// chain.plugin('analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
// /**
// * 如果 h5 端首屏加载时间过长,可以使用 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') })
// }))
// }
}
}
},
};

View File

@@ -1,13 +1,16 @@
{
"name": "taroApp",
"version": "1.0.0",
"name": "jdt-user",
"version": "3.0.0",
"private": true,
"description": "",
"templateInfo": {
"name": "vue3-NutUI4",
"name": "jdt-user",
"typescript": true,
"css": "sass"
},
"taroConfig": {
"version": "3.0.0"
},
"scripts": {
"build:weapp": "taro build --type weapp",
"build:test": "taro build --type weapp --mode test",
@@ -27,7 +30,16 @@
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch"
"dev:quickapp": "npm run build:quickapp -- --watch",
"lint": "eslint --ext .ts,.vue .",
"lint:fix": "eslint --fix --ext .ts,.vue .",
"lint:staged": "lint-staged",
"prepare": "husky install",
"preview": "vite preview",
"cz": "cz",
"lf": "npx prettier --write --end-of-line lf .",
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
},
"browserslist": [
"last 3 versions",
@@ -35,51 +47,69 @@
"ios >= 8"
],
"author": "",
"lint-staged": {
"*.{ts,vue}": [
"eslint --ext .ts,.vue .",
"npx prettier --write --end-of-line lf ."
]
},
"config": {
"commitizen": {
"path": "node_modules/cz-customizable"
}
},
"dependencies": {
"@babel/runtime": "^7.23.1",
"@babel/runtime": "^7.23.2",
"@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",
"@tarojs/components": "3.6.16",
"@tarojs/helper": "3.6.16",
"@tarojs/plugin-framework-vue3": "3.6.16",
"@tarojs/plugin-html": "3.6.16",
"@tarojs/plugin-platform-alipay": "3.6.16",
"@tarojs/plugin-platform-h5": "3.6.16",
"@tarojs/plugin-platform-jd": "3.6.16",
"@tarojs/plugin-platform-qq": "3.6.16",
"@tarojs/plugin-platform-swan": "3.6.16",
"@tarojs/plugin-platform-tt": "3.6.16",
"@tarojs/plugin-platform-weapp": "3.6.16",
"@tarojs/runtime": "3.6.16",
"@tarojs/shared": "3.6.16",
"@tarojs/taro": "3.6.16",
"@tarojs/components": "3.6.19",
"@tarojs/helper": "3.6.19",
"@tarojs/plugin-framework-vue3": "3.6.19",
"@tarojs/plugin-html": "3.6.19",
"@tarojs/plugin-platform-alipay": "3.6.19",
"@tarojs/plugin-platform-h5": "3.6.19",
"@tarojs/plugin-platform-jd": "3.6.19",
"@tarojs/plugin-platform-qq": "3.6.19",
"@tarojs/plugin-platform-swan": "3.6.19",
"@tarojs/plugin-platform-tt": "3.6.19",
"@tarojs/plugin-platform-weapp": "3.6.19",
"@tarojs/runtime": "3.6.19",
"@tarojs/shared": "3.6.19",
"@tarojs/taro": "3.6.19",
"dayjs": "^1.11.10",
"pinia": "^2.1.6",
"vue": "^3.3.4"
"pinia": "^2.1.7",
"vue": "^3.3.8"
},
"devDependencies": {
"@babel/core": "^7.23.0",
"@tarojs/cli": "3.6.16",
"@tarojs/taro-loader": "3.6.16",
"@tarojs/webpack5-runner": "3.6.16",
"@types/node": "^18.18.4",
"@types/webpack-env": "^1.18.2",
"@typescript-eslint/eslint-plugin": "^6.7.4",
"@typescript-eslint/parser": "^6.7.4",
"@babel/core": "^7.23.3",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@tarojs/cli": "3.6.19",
"@tarojs/plugin-mini-ci": "^3.6.20",
"@tarojs/taro-loader": "3.6.19",
"@tarojs/webpack5-runner": "3.6.19",
"@types/node": "^18.18.9",
"@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/compiler-sfc": "^3.3.4",
"babel-preset-taro": "3.6.16",
"@vue/compiler-sfc": "^3.3.8",
"babel-preset-taro": "3.6.19",
"commitizen": "^4.3.0",
"css-loader": "3.4.2",
"eslint": "^8.51.0",
"eslint-config-taro": "3.6.16",
"eslint-plugin-vue": "^9.17.0",
"cz-customizable": "^7.0.0",
"eslint": "^8.53.0",
"eslint-config-taro": "3.6.19",
"eslint-plugin-vue": "^9.18.1",
"husky": "^8.0.3",
"lint-staged": "^15.0.2",
"style-loader": "1.3.0",
"stylelint": "9.3.0",
"ts-node": "^10.9.1",
"typescript": "^4.9.5",
"unplugin-vue-components": "^0.23.0",
"vue-loader": "^17.3.0",
"webpack": "^5.88.2"
"vue-loader": "^17.3.1",
"webpack": "^5.89.0"
}
}

23446
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAqSpzKeiW3x8pHNgPNxnhx4wb5gyM21cJcwE5N+82iX0qMH2f
QcU8WVyHvuYDK9d7kuzDFSbFNsUUeUB/Mqt2rzZcrGyO/6cRUaV8hjXClf4vZGvK
gzMEExNzSIxwu+XYAur9FKm2h4J300PvmGD6zPGyr7pqYyzkSpltadRVsQebU1Cb
f+gCmyzQSDY+dk+0cNmPeSJxXdbj6PJpmU+PVe9CoWmfapRqV3aEDWhTlOvTUQwf
8bOoZn5r8a6H2W0HdNu0flMnoYWX/WNSTOF4izlaKOq7oRLnfjaefEO+WOUctzPE
HpWw/k/LyMZJCiGZVdczfVSkR2Jq4iMC4arrDwIDAQABAoIBABeCgsbMQEt59SjB
DjxGKI6m9imejOTez71f6ifP4vBwqLBchQmK87wnk+X/6WjqZY4hwWrrHHVkJlhD
kmnkUnY/Q9nirGzzNwD10ryENCrMTKHUKSzapjJQfbETc4dphf/B0LJSc7+ZbjW6
N04iDDj3TjIF4ksuLfwAHqiajd4wSpmiPFzwNFJSgNl86d3VuqnylPKDE0wG5yBf
54AXkxrnzhL+cGCBazE+mYQoSihpDt0JP4zGb8W1AoWmXNoTlbP5AiTcf/1nza92
HOd1IJN89YBgm707yEvY7pVsM5ftx8HlUtGopZq3DEBar3dTRT9+tGnLoOVyvbEF
dvgV/oECgYEA0dNsZvHuAXIG62dgj+hLTtqxbdi0BaqChj2Y/bhLBbzjlScfiCJ/
hczTSUMj1XAuYzZLXFHwEd7tZnXhhWOfALsFzodVoO6Zt5Y5lQ0Ed5d9GAg/JsDe
Z1nn6WMH5c7+1gfpN+dzZVK/AWYZgYhIiaVFeiC5XxE4/mfFClIT0HECgYEAzmRv
csA3WuuR9hSAl238g0bcDFjQS5I2tWJMRVDpA9m5A9tNCCIkh2Azn3LcGAnkPwbZ
mCt0/Ck3hZPV7v9nuPAP9uOUC0+nGIaJSxcbZpH944meiVs3J+VQGcS4ubrEcaQ+
KRT4fisnXI85/qc1r7XaziWgtCX7dvDHNFRQM38CgYEAuR2ZBp2siDPsbOTQaUXc
ot4IKUxFTrZm3z4a6sUb0x0Zf657gCRHc2kIgxsr0xNcqYTuKa3Uaj/OHFYluAPy
9LcLYXE+l3PJxBFSDfDlHwlUgM5NwMfpry6/jsUi45midHuYQwz8XskI4JgOKpxs
uptH135lbL0KFlDAouFUv9ECgYADsa6A+knDWdYJ9oH6s+BCJUGJAwnvYFWUV4cP
8ovJItt54zH0xE+tEJ676t1fnMW2DxRT8estHDu/K0838OBVYg6XF6mtriZKfRX1
/xrhchl+OhdZVAWftC4D2A6KXHppokvuhk6QS4tvz6x1D18ZnwKkj+3Za5idn1+h
YyTwVwKBgQCscqYudlBUyIuCnhxaaHNSwVDRvkYcncwIFGv8KMc9UChWehSj9mzb
qmrsA1iifR1SW0vrGzNnzDo67BYNYhme3uNs5cfv6jmeMDj79eOIABJtYICSzHx2
kzLzBtO804Q2CygVHae7qadf592Ex7b4CKfVVs4ZpqnknuoDKTWEGw==
-----END RSA PRIVATE KEY-----

View File

@@ -0,0 +1,27 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEA5MJntNKGXv+0z6Imaz0P/uZM57LiQwwmv6fLNsE8EzsW5JPC
Bwvm1sWDJ670WxYQuXI2xEc4bXc4ACRdHwEPt1gJMbnXMCUh7HlzhRSh1mJQsMNP
yVOFIz6lsAAnOrqHq2P7N1lOx8bIFwLr5HzeWYWj0XZWU4259JjJ+nn1EcBcaVtZ
Txgn18K9MBSppc4vRQ/YEQF51LPNOs934vqHSnNEY0jW3HK+DXa5UPwT5Jj5RV16
1aFiXAvxvY/DcaQKOx+CCA4QNa03ncmlLMLW1jZfQBijCnsrIfdMdsB/cJ2b1lpQ
IiLZKiL8vBWR6tjdccD+XT62BMmfuCkpCJDAeQIDAQABAoIBAQCh4z4XBiFXm2gu
xFah742hWwOzuLFMt424dhtmvWsxRNDXpAVcjTyoYxCFBdghmcTuJ/jAAJLbTNJR
r2pDJbIkkuW2zgiOJskSG4T3+fjpyZvG7AFLvZJrtcr1ebZJZnXagZ/ntIj+8hrp
xgSAJyoHen7LHg7LhHHDuli9rI8VJpDT5TZeXVXynD0bjMJ4z7MHA27ZO9nNk52P
HML0pLYxs6+ubCL1IB5sy6gDO9eQUYzlVWEcDiVXBqlftjj100kbxvLVm0ydlwci
SX2e/oV+iXPW0qiyOBjyc1Dp8uYxqYhvmdy7ajxL5f3mrepiydkI+lnYp9rnh9NO
GfFvsQTNAoGBAPldj1JUXGB7TO5NAj0RiE2hkeQI6G3x3rDZz1DlkLs6oM7rAqds
6EMMN7MONNQ53Qw0eFhuB/5gFH/EfDqufTjFIRiR9rcwa7NsYieewIfAksOJCyf1
H3tfH+Wr0sQNIA/9tKzgzosSU1gcdCQFcmvzX+bUBowJ0oj0zSuskNeLAoGBAOrY
fw2T7hQTJsiZ5y1GkhZ7Dq/l1qY3Mwodl339YzOxUFQyPDWC8UFHp9FZZ49CvG1Z
1NUIN3fcIPORoKjCjdxvDh+PWUp0XV7Zp0yUtvehI8ex31U5Zc2nKfr3+ILhRS2b
ZfoKX/3vQvItfpJfRlSZSpgt1Kl9XXE+O550eiiLAoGAXA2mt8y+oTtDJgE1n1eW
ipnnYlfLfbK4824kcwebyxIUhO4Kd8XjY8Th1u6an/GQYU4JUxOjTcsoJhZhicQa
I9fZpNlVS0DLsVuETH31MufrBdXUUXbSnVd7TeyFDKyPtneAuATxGjO0oqU2VonQ
OHuKXorMs+t4VeiQyNuWSIsCgYBtjF4ADHBzZtehncEr6o589BxOyw0M7hTd9B3V
xJxA4caR7/kMES/O/sj2rBjVyBCzhcL1OOb+/21TkSv7bP3VxOw2ppzFUXC4rRkQ
bRLIgp95KK0ASU0G2KKJkqCXFNQ7SRERyUMr5i85XyV6y/y3u+YDBOX9xiAPkjMn
YDgXrwKBgBlBiQxGI/JrzXgAoGox8sBmQcGplgnUL/QTJIiKugTbzfNA9STyW0E0
j+Zcp2vf4wLZwOUMD74gGhtAUDMhOB+RlOUTFSHcyOAJ+Se9pZPNcaY6tqiZNeVS
WsRqHJtoQkcUU2k+tCYXz2tib4R/FHgoL5QK/OkHRS61H481eWeZ
-----END RSA PRIVATE KEY-----

View File

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

15
src/api/cart.ts Normal file
View File

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

View File

@@ -28,7 +28,7 @@ export const getActiveGoods = () => request("/goods", {}, "POST");
export const getActiveGoodsDetail = (data: object) =>
request("/goods/details", data, "POST");
// 活动商品下
// 创建订
export const createActiveOrder = (data: object) =>
request("/order/place", data, "POST");

7
src/api/home.ts Normal file
View File

@@ -0,0 +1,7 @@
import request from "../utils/request";
// 获取商户分类
export const getHomeList = () => request("/home/classify", {}, "POST");
// 获取商户子列表
export const getHomeSubList = () => request("/home/all/classify", {}, "POST");

View File

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

View File

@@ -63,3 +63,12 @@ export const getRefereeCode = () => request("/user/promotion", {}, "POST");
// 取消订单返回积分
export const qxOrder = (data: object) =>
request("/user/point/off", data, "POST");
// 用户签到
export const userSign = () => request("/sign/user", {}, "POST");
// 获取签到记录
export const getSignRecord = () => request("/sign/pulse/count", {}, "POST");
// 获取赠送总记录
export const getGiftRecord = (data: object) =>
request("/user/giftPulseRecord", data, "POST");

View File

@@ -1,81 +1,85 @@
export default defineAppConfig({
pages: [
'pages/index/index',
'pages/category/index',
'pages/cart/index',
'pages/user/index'
"pages/index/index",
"pages/category/index",
"pages/cart/index",
"pages/user/index",
],
subPackages: [
{
root: 'pages/users',
root: "pages/users",
pages: [
'order_list/index',
'setting/index',
'user_setting/index',
'settled_mer/index',
'order_list_detail/index',
'account/index',
'distribution/index',
'distribution/integral/index',
'distribution/userlist/index',
'login/index',
'bindPhone/index'
]
"order_list/index",
"setting/index",
"user_setting/index",
"settled_mer/index",
"order_list_detail/index",
"account/index",
"distribution/index",
"distribution/integral/index",
"distribution/userlist/index",
"login/index",
"bindPhone/index",
],
},
{
root: 'pages/goods',
root: "pages/goods",
pages: ["goods_detail/index", "order_create/index", "order_status/index"],
},
{
root: "pages/admin",
pages: [
'goods_detail/index',
'order_create/index',
'order_status/index'
]
"verify/index",
"order_manage/index",
"order_manage/list/index",
"order_manage/detail/index",
"verify/verify_list/index",
"statistics/index",
"withdrawal/index",
],
},
{
root: 'pages/admin',
pages: [
'verify/index',
'order_manage/index',
'order_manage/list/index',
'order_manage/detail/index',
'verify/verify_list/index',
'statistics/index',
'withdrawal/index'
]
root: "pages/product",
pages: ["list/index", "addGoods/index"],
},
{
root: 'pages/product',
pages: ['list/index', 'addGoods/index']
root: "pages/game",
pages: ["gamehome/index", "gamedetail/index", "gameview/index"],
},
{
root: 'pages/game',
pages: ['gamehome/index', 'gamedetail/index', 'gameview/index']
root: "pages/hotGoods",
pages: ["index/index", "hot_list/index"],
},
{
root: 'pages/hotGoods',
pages: ['index/index', 'hot_list/index']
root: "pages/mer",
pages: ["mer_detail/index"],
},
{
root: 'pages/mer',
pages: ['mer_detail/index']
}
root: "pages/marketing",
pages: ["sign/index"],
},
{
root: "pages/search",
pages: ["index"],
},
],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black'
backgroundTextStyle: "light",
navigationBarBackgroundColor: "#fff",
navigationBarTitleText: "WeChat",
navigationBarTextStyle: "black",
},
tabBar: {
color: '#666666',
selectedColor: '#ff0000',
backgroundColor: '#ffffff',
borderStyle: 'white',
color: "#666666",
selectedColor: "#ff0000",
backgroundColor: "#ffffff",
borderStyle: "white",
list: [
{
pagePath: 'pages/index/index',
iconPath: 'static/tabbar/1-001.png',
selectedIconPath: 'static/tabbar/1-002.png',
text: '首页'
pagePath: "pages/index/index",
iconPath: "static/tabbar/1-001.png",
selectedIconPath: "static/tabbar/1-002.png",
text: "首页",
},
// {
// pagePath: "pages/category/index",
@@ -83,27 +87,27 @@ export default defineAppConfig({
// selectedIconPath: "static/tabbar/2-002.png",
// text: "分类",
// },
// {
// pagePath: "pages/cart/index",
// iconPath: "static/tabbar/3-001.png",
// selectedIconPath: "static/tabbar/3-002.png",
// text: "购物车",
// },
{
pagePath: 'pages/user/index',
iconPath: 'static/tabbar/4-001.png',
selectedIconPath: 'static/tabbar/4-002.png',
text: '我的'
}
]
pagePath: "pages/cart/index",
iconPath: "static/tabbar/3-001.png",
selectedIconPath: "static/tabbar/3-002.png",
text: "购物车",
},
{
pagePath: "pages/user/index",
iconPath: "static/tabbar/4-001.png",
selectedIconPath: "static/tabbar/4-002.png",
text: "我的",
},
],
},
permission: {
'scope.userLocation': {
desc: '你的位置信息将用于小程序位置接口的效果展示'
}
"scope.userLocation": {
desc: "你的位置信息将用于小程序位置接口的效果展示",
},
requiredBackgroundModes: ['audio', 'location'],
},
requiredBackgroundModes: ["audio", "location"],
// @ts-ignore
requiredPrivateInfos: ['getLocation'],
lazyCodeLoading: 'requiredComponents'
requiredPrivateInfos: ["getLocation"],
lazyCodeLoading: "requiredComponents",
});

View File

@@ -1,22 +1,8 @@
@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 {
//font-family: AlibabaPuHuiTi-3-55-Regular, sans-serif;
background-color: #f5f5f5;
font-size: 30rpx;
}
view {

View File

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

289
src/components/Cart.vue Normal file
View File

@@ -0,0 +1,289 @@
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { addCart, getCart, clearCart } from "@/api/cart";
import { Del2 } from "@nutui/icons-vue-taro";
import { createActiveOrder } from "@/api/goods";
import Pay from "@/components/Pay.vue";
interface CardList {
name: string;
cover: string;
bid: string;
gid: string;
number: string;
price: number;
exchange: number;
}
const show = ref(false);
const props = defineProps({
merInfo: {
required: true,
type: Object,
},
});
const emit = defineEmits(["updateCart"]);
const openModal = async () => {
await get_cart_list();
if (card_list.value.length === 0) return;
show.value = !show.value;
};
const add_cart = async (item: CardList, num: number = 1) => {
try {
const res = await addCart({
Bid: item.bid,
Gid: item.gid,
Number: Number(num),
});
Taro.showToast({
title: res.msg,
icon: "none",
});
await get_cart_list();
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
}
};
const onAdd = async (item: CardList) => {
await add_cart(item, Number(item.number) + 1);
};
const onReduce = async (item: CardList) => {
await add_cart(item, Number(item.number) - 1);
if (card_list.value.length === 0) show.value = false;
};
const card_list = ref<CardList[]>([]);
const cartInfo = ref({
count: 0,
price: 0,
exchange: 0,
});
const get_cart_list = async () => {
try {
const res = await getCart({
Bid: props.merInfo.bid,
});
card_list.value = res.data.data || [];
cartInfo.value = {
count: 0,
price: 0,
exchange: 0,
};
card_list.value.forEach((item: CardList) => {
cartInfo.value.count += Number(item.number);
cartInfo.value.price += Number(item.price);
cartInfo.value.exchange += Number(item.exchange);
});
emit("updateCart", res.data.data || []);
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
}
};
const clear_cart = async () => {
try {
await clearCart({
Bid: props.merInfo.bid,
});
await get_cart_list();
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
}
show.value = false;
};
const isShowPay = ref(false);
const orderData = ref<any>([]);
const closePay = (val: boolean) => {
isShowPay.value = val;
orderData.value = [];
Taro.redirectTo({
url: "/pages/users/order_list/index?type=0",
});
};
const create_order = async () => {
try {
const { data: res } = await createActiveOrder({
Bid: [props.merInfo.bid],
});
if (res.oid) {
orderData.value = res.oid;
isShowPay.value = true;
}
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
}
// await get_cart_list();
};
defineExpose({
add_cart,
get_cart_list,
});
</script>
<template>
<view>
<view class="cart" @click.stop="openModal">
<view class="container">
<view>购物车数量: {{ cartInfo.count }}</view>
<view v-if="cartInfo.count > 0">
<text>总金额: {{ cartInfo.price.toFixed(2) }}</text
>,
<text>总积分: {{ cartInfo.exchange.toFixed(2) }}</text>
</view>
</view>
<view v-if="cartInfo.count > 0" class="payBtn" @click.stop="create_order"
>立即结算</view
>
</view>
<!-- 购物车弹窗 -->
<nut-popup
:style="{ padding: '20rpx' }"
round
position="bottom"
z-index="1"
:catch-move="true"
:safe-area-inset-bottom="true"
v-model:visible="show"
>
<view class="list-header">
<view class="left" @click.stop="clear_cart">
<Del2 color="#666666" />
<text style="color: #666666">清空购物车</text>
</view>
</view>
<scroll-view :scroll-y="true" class="cart-list">
<view class="item" v-for="(item, index) in card_list" :key="index">
<view class="left">
<image :src="item.cover" />
<view class="center">
<view class="name">{{ item.name }}</view>
<view class="price">
<view>现金:{{ item.price }}</view>
<view>积分:{{ item.exchange }}</view>
</view>
</view>
</view>
<nut-input-number
v-model="item.number"
readonly
:min="-1"
@add="() => onAdd(item)"
@reduce="() => onReduce(item)"
/>
</view>
</scroll-view>
<view style="height: 140rpx"></view>
</nut-popup>
<!-- 支付 -->
<Pay
:is-show-pay="isShowPay"
v-model:jfInfo="orderData"
@closePay="closePay"
@successPay="closePay"
/>
</view>
</template>
<style lang="scss">
$h-border-radius: 50rpx;
.cart {
position: fixed;
bottom: 50rpx;
left: 50%;
transform: translateX(-50%);
z-index: 9999;
width: 95%;
background-color: red;
border-radius: $h-border-radius;
color: #fff;
height: 100rpx;
display: flex;
justify-content: space-between;
align-items: center;
.container {
margin-left: 30rpx;
}
.payBtn {
width: 180rpx;
height: 100rpx;
line-height: 100rpx;
text-align: center;
background-color: #000;
border-radius: 0 $h-border-radius $h-border-radius 0;
}
}
.list-header {
margin: 15rpx 0;
.left {
display: flex;
align-items: center;
}
}
.cart-list {
height: 290rpx;
.item {
display: flex;
align-items: flex-end;
margin-bottom: 10rpx;
justify-content: space-between;
.left {
display: flex;
image {
width: 130rpx;
height: 130rpx;
border-radius: 10rpx;
margin-right: 10rpx;
}
.center {
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
.price {
color: red;
margin-top: 20rpx;
}
}
}
}
}
</style>

152
src/components/MerList.vue Normal file
View File

@@ -0,0 +1,152 @@
<template>
<view class="goodBox">
<view
class="good"
v-for="item in merdata"
:key="item.ID"
@click.stop="toMerDetails(item)"
>
<image :src="item.head_photo" />
<view class="good-text-box">
<text class="good-text">{{ item.name }}</text>
<text style="color: #999"
>距离我{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(item.lat),
Number(item.lon)
)
}}
</text>
</view>
</view>
</view>
</template>
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { calculateDistance } from "@/utils";
import { bindParent } from "@/api/user";
import { getMerList } from "@/api/goods";
const props = defineProps({
classId: {
type: Number,
default: 0,
},
});
Taro.useDidShow(async () => {
await get_mer_list();
if (Taro.getStorageSync("token") && Taro.getStorageSync("bind_id")) {
try {
const res = await bindParent({
uid: Taro.getStorageSync("bind_id"),
});
Taro.showToast({
title: res.msg,
});
Taro.removeStorageSync("bind_id");
} catch (error) {
Taro.removeStorageSync("bind_id");
throw error;
}
}
});
interface MerData {
ID: number;
name: string;
head_photo: string;
lat: string;
lon: string;
}
const merdata = ref<MerData[]>([]);
const userLocalNum = ref({
l: 0,
t: 0,
});
const get_mer_list = async () => {
Taro.getLocation({
type: "wgs84",
success: (res) => {
userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude;
},
});
const res = await getMerList({
PageNum: 1,
PageSize: 10,
class_id: props.classId,
});
merdata.value = res.data.data;
};
const toMerDetails = (item: any) => {
Taro.setStorageSync("mer_info", item);
Taro.navigateTo({
url: `/pages/mer/mer_detail/index`,
});
};
</script>
<style lang="scss">
.goodBox {
display: flex;
padding: 20px;
flex-wrap: wrap;
justify-content: space-between;
.good {
width: 340px;
background-color: #fff;
margin-bottom: 20px;
border-radius: 10px;
image {
width: 100%;
height: 250px;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
}
.good-text-box {
padding: 10px;
.good-text {
flex-shrink: 0;
font-size: 28px;
color: #333;
font-weight: 400;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
word-break: break-word;
}
.good-price-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.good-text-price {
font-size: 28px;
font-weight: bold;
color: #ff0000;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
}
}
</style>

View File

@@ -11,13 +11,14 @@
>
<view class="div">
<view style="text-align: center">支付方式</view>
<nut-cell-group>
<nut-cell-group
:style="{ margin: interval ? '40rpx 0 150rpx 0' : '40rpx 0' }"
>
<nut-cell
v-if="payType === 'wx'"
title="微信支付"
desc="使用微信快捷支付"
is-link
@click="goPay()"
@click="goPay(1)"
>
<template v-slot:icon>
<IconFont
@@ -27,11 +28,10 @@
</template>
</nut-cell>
<nut-cell
v-if="payType === 'jf'"
title="积分支付"
:desc="`剩余积分:${info.integral || 0}`"
is-link
@click="goPay()"
@click="goPay(2)"
>
<template v-slot:icon>
<IconFont
@@ -46,68 +46,74 @@
</template>
<script setup lang="ts">
import {ref, watch} from 'vue'
import {IconFont} from '@nutui/icons-vue-taro'
import Taro from '@tarojs/taro'
import {payOrder} from '@/api/order'
import {payJfOrder} from '@/api/goods'
import {getPersonalInfo} from '@/api/user'
import { ref, watch } from "vue";
import { IconFont } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import { payOrder } from "@/api/order";
import { getPersonalInfo } from "@/api/user";
const prop = defineProps({
interval: {
type: Boolean,
default: true,
},
isShowPay: {
required: true,
type: Boolean,
default: false
},
payType: {
required: true,
type: String,
default: 'wx'
default: false,
},
jfInfo: {
type: Object,
default: () => {
return {}
}
}
})
return {};
},
},
OrderType: {
type: Number,
default: 1,
},
});
const emit = defineEmits(['closePay', 'successPay'])
const emit = defineEmits(["closePay", "successPay"]);
const info = ref<{ integral?: any }>({})
const info = ref<{ integral?: any }>({});
watch(
() => prop.isShowPay,
() => {
getInfo()
getInfo();
}
)
);
const getInfo = async () => {
try {
const res = await getPersonalInfo()
info.value = res.data.data
const res = await getPersonalInfo();
info.value = res.data.data;
} catch (error) {
Taro.showToast({
title: error.msg,
icon: 'none'
})
throw error
icon: "none",
});
throw error;
}
}
};
const goPay = async () => {
console.log(prop.jfInfo)
const goPay = async (type: number) => {
console.log(prop);
if (!prop.jfInfo)
return Taro.showToast({
title: '未获取到订单信息',
icon: 'none'
})
if (prop.payType === 'wx') {
title: "未获取到订单信息",
icon: "none",
});
try {
const {data} = await payOrder({
oid: prop.jfInfo.oid
})
const { data } = await payOrder({
oid: prop.jfInfo,
OrderType: prop.OrderType,
PayType: type,
});
if (data.data) {
// 1微信支付 2积分支付
if (type === 1) {
Taro.requestPayment({
timeStamp: data.data.timeStamp,
nonceStr: data.data.nonceStr,
@@ -116,63 +122,65 @@ const goPay = async () => {
paySign: data.data.paySign,
success: function () {
Taro.showToast({
title: '支付成功',
icon: 'success',
duration: 2000
})
Taro.navigateTo({
url: '/pages/hotGoods/hot_list/index'
})
title: "支付成功",
icon: "success",
duration: 2000,
});
emit("successPay", false);
},
fail: function () {
Taro.showToast({
title: '支付失败',
icon: 'none',
duration: 2000
})
title: "支付失败",
icon: "none",
duration: 2000,
});
emit("closePay", false);
},
});
} else {
Taro.showToast({
title: "支付成功",
icon: "success",
duration: 2000,
});
emit("successPay", false);
}
} else {
Taro.showToast({
title: "未知异常",
icon: "none",
});
emit("closePay", false);
}
})
emit('closePay', false)
} catch (e) {
Taro.showToast({
title: e.msg,
icon: 'none'
})
throw e
icon: "none",
});
// emit("closePay", false);
throw e;
}
} else {
const res = await payJfOrder(prop.jfInfo)
Taro.showToast({
title: res.msg,
icon: 'success',
duration: 2000
})
Taro.navigateTo({
url: '/pages/users/order_list/index?type=0'
})
emit('closePay', false)
}
}
};
const closePay = () => {
Taro.showToast({
title: '取消支付',
icon: 'none'
})
emit('closePay', false)
}
title: "取消支付",
icon: "none",
});
emit("closePay", false);
};
</script>
<style lang="scss">
.nut-popup {
.nut-popup__container {
border-radius: 10px;
border-radius: 10rpx;
}
}
.div {
padding: 20px;
// text-align: center;
padding: 20rpx;
--nut-cell-box-shadow: none;
.nut-cell {
align-items: center;

63
src/components/Popup.vue Normal file
View File

@@ -0,0 +1,63 @@
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { userSign } from "@/api/user";
const show = ref(false);
Taro.useLoad(async () => {
if (Taro.getStorageSync("token")) show.value = true;
// const res = await getSignRecord()
// console.log(res)
});
const toSign = async () => {
try {
await userSign();
Taro.showToast({
title: "签到成功",
icon: "none",
});
} catch (e) {
console.log(e);
}
show.value = false;
};
</script>
<template>
<nut-overlay
v-model:visible="show"
:lock-scroll="true"
:close-on-click-overlay="false"
>
<view class="wrapper">
<view @click.stop="toSign">
<image class="image" src="../static/index/poppBg.png" />
</view>
<view @click.stop="show = false">
<image class="icon" src="../static/index/close.png" />
</view>
</view>
</nut-overlay>
</template>
<style lang="scss">
.wrapper {
display: flex;
height: 100%;
align-items: center;
justify-content: center;
flex-direction: column;
}
.image {
width: 500px;
height: 600px;
}
.icon {
width: 80px;
height: 80px;
}
</style>

View File

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

View File

@@ -85,7 +85,7 @@ const initColumnChart = () => {
enableScroll: true,
width: props.cWidth,
height: props.cHeight,
padding: [15,15,0,5],
padding: [15, 15, 0, 5],
legend: {},
xAxis: {
disableGrid: true,

View File

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

View File

@@ -37,7 +37,6 @@ const closeAttr = () => {
const onChooseAvatar = (e) => {
const { avatarUrl } = e.detail;
console.log(avatarUrl);
Taro.uploadFile({
url: `${BASE_URL}/upload`,
filePath: avatarUrl,
@@ -177,11 +176,7 @@ const formSubmit = async (e: any) => {
open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber"
>
{{
!userInfo.phone
? "请授权手机号"
: "授权成功"
}}
{{ !userInfo.phone ? "请授权手机号" : "授权成功" }}
</button>
</view>
</view>
@@ -189,12 +184,7 @@ const formSubmit = async (e: any) => {
</view>
<view class="bottom">
<nut-button
formType="submit"
block
type="success"
color="#07C160"
>
<nut-button formType="submit" block type="success" color="#07C160">
保存
</nut-button>
</view>

View File

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

View File

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

View File

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

View File

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

View File

@@ -36,9 +36,7 @@
hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=today`"
>
<view class="title">{{
orderInfo?.total?.TodayNumber || 0
}}</view>
<view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view>
<view class="sub">今日成交额</view>
</navigator>
<navigator
@@ -56,9 +54,7 @@
hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=month`"
>
<view class="title">{{
orderInfo?.total?.MonthNumber || 0
}}</view>
<view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view>
<view class="sub">本月成交额</view>
</navigator>
<navigator
@@ -66,9 +62,7 @@
hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=today`"
>
<view class="title">{{
orderInfo?.total?.TodayOrder || 0
}}</view>
<view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view>
<view class="sub">今日订单数</view>
</navigator>
<navigator
@@ -76,9 +70,7 @@
hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=yesterday`"
>
<view class="title">{{
orderInfo?.total?.YesterdayOrder || 0
}}</view>
<view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view>
<view class="sub">昨日订单数</view>
</navigator>
<navigator
@@ -86,9 +78,7 @@
hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=month`"
>
<view class="title">{{
orderInfo?.total?.MonthOrder || 0
}}</view>
<view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view>
<view class="sub">本月订单数</view>
</navigator>
</view>
@@ -152,11 +142,9 @@ const columns = ref([
]);
const getData = async () => {
const mer_type = Taro.getStorageSync("mer_type");
const user_info = Taro.getStorageSync("userInfo");
const res = await orderStatistics({
bid: user_info.bid,
type: mer_type,
bid: user_info.data.bid,
});
orderInfo.value = res.data;
};

View File

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

View File

@@ -26,9 +26,7 @@
<view class="top">
<view class="name">订单号:{{ item.oid }}</view>
<!-- <view class="sub">下单时间{{ item.add_time }}</view> -->
<view class="sub"
>核销时间{{ item.cancel_time || "待核销" }}</view
>
<view class="sub">核销时间{{ item.cancel_time || "待核销" }}</view>
<!-- <view style="color: red">{{
item.status === 0
? "待付款"
@@ -40,24 +38,26 @@
}}</view> -->
</view>
<view class="line"></view>
<view class="center">
<view class="center" v-for="(itm, idx) in item.OrderGoods" :key="idx">
<view class="top">
<image :src="item.BindGoods.cover" />
<view class="title">{{ item.BindGoods.name }} </view>
<image :src="itm.Goods.cover" />
<view class="title">{{ itm.Goods.name }} </view>
<view class="right">
<view>{{ item.number }}</view>
<view>x{{ item.count }}</view>
<view>{{ itm.pay_price }}</view>
<view>{{ itm.pay_integral }}积分</view>
<view>x{{ itm.number }}</view>
</view>
</view>
<!-- <view
class="bom"
style="text-align: right; font-size: 13px"
>
{{ item.count }}件商品,实付积分:
<text style="color: red">{{ item.number }}</text>
</view> -->
</view>
<view class="line"></view>
<view class="bom" style="text-align: right">
{{ item.count }}件商品,支付方式:{{
item.pay_type === 1 ? "微信" : "积分"
}},实付:
<text style="color: red">{{
item.pay_type === 1 ? item.price : item.exchange
}}</text>
</view>
</view>
</view>
<nut-empty v-else description="暂无订单数据"></nut-empty>
@@ -67,7 +67,7 @@
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import { getJfOrderList, getActiveOrderList } from "../../../../api/admin";
import { getActiveOrderList } from "../../../../api/admin";
const opt = ref([
{
@@ -103,18 +103,12 @@ Taro.useLoad((options) => {
const getData = async () => {
try {
const mer_type = Taro.getStorageSync("mer_type");
const user_info = Taro.getStorageSync("userInfo");
let res: any = null;
const data = {
bid: user_info.bid,
bid: user_info.data.bid,
status: tabVal.value,
};
if (mer_type === 1) {
res = await getActiveOrderList(data);
} else {
res = await getJfOrderList(data);
}
const res = await getActiveOrderList(data);
dataList.value = res.data.data;
} catch (error) {
Taro.showToast({

View File

@@ -43,9 +43,7 @@
<view class="title">
{{ title }}{{ where.type == 1 ? "营业额" : "订单量" }}
</view>
<view v-if="where.type == 1" class="money">{{
dataObj.all || 0
}}</view>
<view v-if="where.type == 1" class="money">{{ dataObj.all || 0 }}</view>
<view v-else class="money">{{ dataObj.all || 0 }}</view>
<view class="increase">
<view>
@@ -56,9 +54,7 @@
<text
class="iconfont"
:class="
dataObj.growthRate >= 0
? 'icon-xiangshang1'
: 'icon-xiangxia2'
dataObj.growthRate >= 0 ? 'icon-xiangshang1' : 'icon-xiangxia2'
"
></text
></text>
@@ -250,11 +246,9 @@ const setChooseValue = (ref: any) => {
const getData = async () => {
try {
const mer_type = Taro.getStorageSync("mer_type");
const user_info = Taro.getStorageSync("userInfo");
const res = await growthRate({
bid: user_info.bid,
type: mer_type,
bid: user_info.data.bid,
status: where.value.status,
StartTime: where.value.start,
EndTime: where.value.end,

View File

@@ -1,9 +1,7 @@
<template>
<view>
<view class="card">
<nut-button block type="primary" @click="scanCode"
>扫码核销</nut-button
>
<nut-button block type="primary" @click="scanCode">扫码核销</nut-button>
</view>
</view>
</template>
@@ -33,9 +31,8 @@ const scanCode = () => {
scanType: ["qrCode"],
success: async (res) => {
try {
const mer_type = JSON.parse(Taro.getStorageSync("mer_type"));
Taro.navigateTo({
url: `/pages/admin/verify/verify_list/index?oid=${res.result}&mer_type=${mer_type}`,
url: `/pages/admin/verify/verify_list/index?oid=${res.result}`,
});
} catch (error) {
Taro.showToast({

View File

@@ -3,24 +3,29 @@
<view class="card">
<view>订单号{{ goodInfo.oid }}</view>
<view class="line"></view>
<view class="container">
<image
class="image"
:src="goodInfo.cover"
mode="widthFix"
></image>
<view
class="container"
v-for="(item, index) in goodInfo.OrderGoods"
:key="index"
>
<image class="image" :src="item.Goods.cover" mode="widthFix"></image>
<view class="info">
<view class="title">{{ goodInfo.goods_name }}</view>
<view class="title">商品名称{{ item.Goods.name }}</view>
<view class="num"
>数量:
<text style="color: red">{{
goodInfo.count
}}</text></view
>数量: <text style="color: red">{{ item.number }}</text></view
>
</view>
<view></view>
</view>
<view class="line"></view>
<text>支付方式{{ goodInfo.pay_type === 1 ? "微信" : "积分" }}</text
>
<text
>总计{{
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
}}</text
>
<view class="line"></view>
<view class="cz">
<nut-button size="small" type="primary" @click="subVerify"
>确定核销</nut-button
@@ -32,12 +37,7 @@
<script setup lang="ts">
import Taro from "@tarojs/taro";
import {
getJfVerifyList,
getActiveVerifyList,
activeOrderVerify,
orderVerify,
} from "@/api/admin";
import { getActiveVerifyList, activeOrderVerify } from "@/api/admin";
import { ref } from "vue";
const opt = ref<any>({});
@@ -50,16 +50,9 @@ Taro.useLoad((options) => {
const goodInfo = ref<any>({});
const getData = async (options: any) => {
let res;
if (Number(options.mer_type) === 1) {
res = await getActiveVerifyList({
const res = await getActiveVerifyList({
oid: options.oid,
});
} else {
res = await getJfVerifyList({
oid: options.oid,
});
}
if (!res.data.data.oid) {
Taro.showToast({
title: "没有此订单",
@@ -76,16 +69,9 @@ const getData = async (options: any) => {
const subVerify = async () => {
try {
let res;
if (Number(opt.value.mer_type) === 1) {
res = await activeOrderVerify({
const res = await activeOrderVerify({
oid: goodInfo.value.oid,
});
} else {
res = await orderVerify({
oid: goodInfo.value.oid,
});
}
Taro.showToast({
title: res.msg,
icon: "none",
@@ -117,8 +103,8 @@ const subVerify = async () => {
display: flex;
image {
width: 200px;
height: 100%;
width: 150rpx;
height: 150rpx;
border-radius: 7px;
display: block;
}

View File

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

View File

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

View File

@@ -1,117 +1,292 @@
<template>
<view>
<view v-if="list.length > 0">
<nut-swipe v-for="(item,index) in list" :key="index">
<view class="item">
<nut-checkbox v-model="item.checkbox" @click="select">{{ item.ID }}</nut-checkbox>
<image src="https://s2.loli.net/2023/08/16/6KgdSQa4WRoT3sz.jpg"
style="width: 100px;height: 100px"/>
<view class="text">
<nut-cell-group v-for="(itm, idx) in list" :key="idx">
<nut-cell>
<nut-checkbox
v-model="itm.state.checkbox"
:indeterminate="itm.state.indeterminate"
@change="(val: boolean) => changeBoxAll(val,idx)"
>{{ itm.StoreName }}
</nut-checkbox>
</nut-cell>
<nut-checkbox-group
v-model="itm.state.checkboxgroup"
:ref="(el) => getGroup(el, idx)"
@change="(label) => changeBox(label, itm)"
>
<nut-cell v-for="(item, idx1) in itm.Goods" :key="idx1">
<nut-checkbox :label="item.gid" style="width: 10%"></nut-checkbox>
<view class="box">
<view class="box-left">
<img class="cover" :src="item.cover" alt="" />
<view class="center">
<view>{{ item.name }}</view>
<view class="bom">
<nut-price :price="item.number" size="normal" :need-symbol="false"/>
<nut-input-number readonly @add="select()" @reduce="select()"
v-model="item.count"/>
<view class="price">
<view>{{ item.price }} </view>
<view>{{ item.exchange }} 积分</view>
</view>
</view>
</view>
<template #right>
<nut-button shape="square" style="height:100%" type="danger">删除</nut-button>
</template>
</nut-swipe>
<nut-input-number
v-model="item.number"
readonly
:min="-1"
@add.stop="() => onAdd(item)"
@reduce.stop="() => onReduce(item)"
/>
</view>
<nut-empty v-else description="购物车暂无数据">
<!-- <nut-button icon="refresh" type="primary" @click="toPage()">去兑换商品</nut-button>-->
</nut-empty>
</nut-cell>
</nut-checkbox-group>
</nut-cell-group>
</view>
<nut-empty v-else description="购物车暂无数据"></nut-empty>
<view>
<view style="height: 100px"></view>
<view style="height: 100rpx"></view>
</view>
<view class="bottom-box">
<view class="left">
<nut-checkbox v-model="selectAllVal" @change="selectAll">全选</nut-checkbox>
<!-- <nut-checkbox v-model="selectAllVal" @change="selectAll"
>全选
</nut-checkbox> -->
<view>
<view class="text-box">
总计积分
<nut-price v-model:price="localCount" size="normal" :need-symbol="false"/>
总金额
<nut-price
v-model:price="localCount.price"
size="normal"
:need-symbol="false"
/>
</view>
<view class="text-box">
总积分
<nut-price
v-model:price="localCount.exchange"
size="normal"
:need-symbol="false"
/>
</view>
</view>
</view>
<nut-button type="primary" @click="sub">去结算</nut-button>
</view>
<!-- 支付 -->
<Pay
:is-show-pay="isShowPay"
:interval="true"
v-model:jfInfo="orderData"
@closePay="closePay"
/>
</view>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import Taro from '@tarojs/taro'
import {getCartList} from '@/api/goods'
import { nextTick, ref } from "vue";
import Taro from "@tarojs/taro";
import { addCart, getAllCart } from "@/api/cart";
import { createActiveOrder } from "@/api/goods";
import Pay from "@/components/Pay.vue";
const selectAllVal = ref(false)
interface CardList {
name: string;
cover: string;
bid: string;
gid: string;
number: string;
price: number;
exchange: number;
}
const list = ref([])
// const selectAllVal = ref(false);
const localCount = ref(0)
interface List {
StoreName: string;
Goods: CardList[];
state: {
checkbox: boolean;
indeterminate: boolean;
checkboxgroup: string[];
};
}
const list = ref<List[]>([]);
const groupList = ref(new Map());
const localCount = ref({
price: 0,
exchange: 0,
});
const getGroup = (el: any, idx: number) => {
return groupList.value.set(idx, el);
};
const changeBoxAll = async (value: boolean, idx: number) => {
await nextTick(() => {
groupList.value.get(idx).toggleAll(value);
});
};
const changeBox = (label: string[], item: any) => {
localCount.value = {
price: 0,
exchange: 0,
};
item["Count"] = {
priceCount: 0,
exchangeCount: 0,
};
if (label.length > 0) {
label.forEach((id: string) => {
item.Goods.forEach((itm: any) => {
if (itm.gid === id) {
item["Count"].priceCount += itm.price * itm.number;
item["Count"].exchangeCount += itm.exchange * itm.number;
}
});
});
}
list.value.forEach((item: any) => {
localCount.value.price += item.Count.priceCount;
localCount.value.exchange += item.Count.exchangeCount;
});
if (label.length === item.Goods.length) {
item.state.checkbox = true;
item.state.indeterminate = false;
} else if (label.length && label.length < item.Goods.length) {
item.state.indeterminate = true;
} else {
item.state.indeterminate = false;
item.state.checkbox = false;
}
};
Taro.useDidShow(() => {
getList()
})
getList();
});
const select = () => {
localCount.value = 0
list.value.forEach((item: any) => {
if (item.checkbox) {
setTimeout(() => {
item.countNum = Number(item.number) * Number(item.count)
localCount.value += item.countNum
console.log(localCount.value)
}, 1)
selectAllVal.value = true
} else {
selectAllVal.value = false
}
})
}
// const selectAll = () => {
// localCount.value = {
// price: 0,
// exchange: 0,
// };
// groupList.value.forEach((item: any) => {
// item.toggleAll(selectAllVal.value);
// });
// list.value.forEach((item: any) => {
// if (item.state.checkboxgroup.length > 0) {
// item.Goods.forEach((itm: any) => {
// localCount.value.price += itm.price;
// localCount.value.exchange += itm.exchange;
// });
// }
// });
// };
const selectAll = () => {
localCount.value = 0
list.value.forEach((item: any) => {
item.checkbox = selectAllVal.value
})
select()
console.log(list.value)
}
const isShowPay = ref(false);
const orderData = ref<any>([]);
const sub = () => {
const arr = list.value.filter((item: any) => item.checkbox)
const sub = async () => {
const arr: any = list.value.filter(
(item: any) => item.state.checkboxgroup.length > 0
);
if (arr.length === 0) {
Taro.showToast({
title: '请选择商品',
icon: 'none'
})
return
title: "请选择商品",
icon: "none",
});
return;
}
Taro.navigateTo({
url: '/pages/goods/order_create/index'
})
}
try {
const { data: res } = await createActiveOrder({
Bid: arr.map((item: any) => item.StoreBid),
});
if (res.oid) {
orderData.value = res?.oid;
isShowPay.value = true;
}
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
}
};
const closePay = async (val: boolean) => {
isShowPay.value = val;
orderData.value = [];
await getList();
Taro.navigateTo({
url: "/pages/users/order_list/index?type=0",
});
};
const getList = async () => {
const res = await getCartList()
list.value = res.data.data.Goods.map((item: any) => {
return {
localCount.value = {
price: 0,
exchange: 0,
};
const res = await getAllCart();
list.value = res.data.data || [];
if (list.value.length > 0) {
list.value = list.value.map((item: any) => ({
...item,
count: 1,
countNum: item.number,
checkbox: false
Goods: item.Goods.sort(
(a: CardList, b: CardList) => Number(a.gid) - Number(b.gid)
),
state: {
indeterminate: false,
checkbox: false,
checkboxgroup: [],
},
Count: {
priceCount: 0,
exchangeCount: 0,
},
}));
}
})
}
};
const toPage = () => {
Taro.switchTab({
url: '/pages/index/index'
})
}
// const toPage = () => {
// Taro.switchTab({
// url: "/pages/index/index",
// });
// };
const onAdd = async (item: CardList) => {
await add_cart(item, Number(item.number) + 1);
};
const onReduce = async (item: CardList) => {
await add_cart(item, Number(item.number) - 1);
};
const add_cart = async (item: CardList, num: number = 1) => {
try {
const res = await addCart({
Bid: item.bid,
Gid: item.gid,
Number: Number(num),
});
Taro.showToast({
title: res.msg,
icon: "none",
});
await getList();
} catch (e) {
Taro.showToast({
title: e.msg,
icon: "none",
});
}
};
</script>
<style lang="scss">
@@ -122,33 +297,34 @@ const toPage = () => {
text-align: center;
}
.item {
margin-top: 10px;
padding: 20px;
background-color: white;
display: flex;
justify-items: center;
justify-content: space-between;
.box {
width: 100%;
box-sizing: border-box;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
image {
width: 200px;
height: 150px;
.box-left {
display: flex;
align-items: center;
.cover {
width: 130rpx;
height: 130rpx;
margin-right: 15rpx;
border-radius: 20rpx;
}
.text {
width: 60%;
margin-left: 20px;
.center {
display: flex;
flex-direction: column;
padding: 20px;
justify-content: space-between;
justify-content: space-around;
.bom {
.price {
display: flex;
justify-content: space-between;
align-items: center;
flex-direction: column;
color: red;
}
}
}
}
@@ -160,23 +336,22 @@ const toPage = () => {
bottom: 0;
left: 0;
width: 100%;
height: 100px;
z-index: 999;
height: 100rpx;
z-index: 9999;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 20px;
box-shadow: 100px 104px 288px rgba(0, 0, 0, 0.01);
padding: 0 20rpx;
box-shadow: 100rpx 104rpx 288rpx rgba(0, 0, 0, 0.01);
border-top: 1rpx solid #f5f5f5;
.left {
display: flex;
align-items: center;
.text-box {
margin-left: 10px;
margin-left: 10rpx;
}
}
}
</style>

View File

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

View File

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

View File

@@ -11,8 +11,8 @@ import { useLoad, getStorageSync } from "@tarojs/taro";
const url = ref("");
useLoad(() => {
const user = getStorageSync("userInfo");
url.value = `${process.env.TARO_APP_GAME}${user.uid}`;
// const user = getStorageSync("userInfo");
url.value = `${process.env.TARO_APP_GAME}${getStorageSync("token")}`;
});
</script>

View File

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

View File

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

View File

@@ -2,8 +2,8 @@
<view class="app">
<view class="head-wrapper" :style="{ top: BarHeight + 'px' }">
<view class="head-menu">
<Left class="iconfont" @click="returns"/>
<Home class="iconfont" @click="goHome"/>
<Left class="iconfont" @click="returns" />
<Home class="iconfont" @click="goHome" />
</view>
</view>
<!-- 幻灯片 -->
@@ -14,26 +14,37 @@
auto-play="3000"
>
<nut-swiper-item v-for="(itm, idx) in swiperList" :key="idx">
<img :alt="idx.toString()" :src="itm"/>
<img :alt="idx.toString()" :src="itm" />
</nut-swiper-item>
</nut-swiper>
<!-- 标题价格 -->
<view class="card">
<view class="header">
<view class="price">
<nut-price
size="large"
size="normal"
:price="goodInfo.number as number"
position="after"
:symbol="payType === 'jf' ? '积分' : '元'"
symbol=""
/>
<nut-price
size="normal"
:price="goodInfo.exchange as number"
position="after"
symbol="积分"
/>
<view class="stock">
库存剩余:{{ goodInfo.stock }}
</view>
<view class="stock"> 库存剩余:{{ goodInfo.stock }}</view>
</view>
<view class="title">{{ goodInfo.name }}</view>
<view class="sub">{{ goodInfo.profile }}</view>
<nut-button size="small" type="primary" @click.stop="add_cart(goodInfo)">
<template #icon>
<Cart2 />
</template>
</nut-button>
</view>
<nut-cell title="请选择规格: " is-link @click="openSku"></nut-cell>
<!-- 产品介绍 -->
<view class="rich-box">
<view class="title">产品介绍</view>
@@ -46,271 +57,114 @@
</view>
<view style="height: 9vh"></view>
<!-- 底部 -->
<view class="bottom-box">
<view class="left">
<view class="icon" @click="toPage('/pages/index/index')">
<Home/>
<view>首页</view>
</view>
<!-- <view-->
<!-- class="icon"-->
<!-- v-if="payType === 'jf'"-->
<!-- @click="toPage('/pages/cart/index')"-->
<!-- >-->
<!-- <Cart/>-->
<!-- <view>购物车</view>-->
<!-- </view>-->
<view class="icon" @click="toPage('/pages/kefu/index', 2)">
<My/>
<view>客服</view>
</view>
</view>
<!-- 占位 -->
<view style="width: 80%">
<!-- <nut-button-->
<!-- v-if="payType === 'jf'"-->
<!-- style="margin-right: 10px"-->
<!-- type="warning"-->
<!-- @click="add_cart()"-->
<!-- >加入购物车-->
<!-- </nut-button>-->
<nut-button type="primary" block @click="toOrderDetail()"
>{{ payType === 'jf' ? '立即兑换' : '立即购买' }}
</nut-button>
</view>
</view>
<!-- 规格选择 -->
<nut-popup
position="bottom"
overlay-class="overlay"
safe-area-inset-bottom
closeable
round
:style="{ zIndex: 1 }"
v-model:visible="isSkuShow"
>
<view class="sku-box">
<view>商品规格</view>
<nut-cell-group>
<nut-cell title="数量:">
<template v-slot:link>
<nut-input-number
v-model="count"
@change="addCount"
button-size="30"
/>
</template>
</nut-cell>
</nut-cell-group>
</view>
</nut-popup>
<!-- <nut-sku
v-model:visible="isSkuShow"
:sku="sku"
:goods="goods"
@selectSku="selectSku"
@clickBtnOperate="clickBtnOperate"
@close="close"
></nut-sku> -->
<Pay
:is-show-pay="isShowPay"
:pay-type="payType"
v-model:jfInfo="orderData"
@closePay="closePay"
/>
<!-- 购物车 -->
<cart ref="cartRef" :mer-info="mer_info" @update-cart="updateCartNum" />
</view>
</template>
<script setup lang="ts">
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight
import {ref} from 'vue'
import Taro from '@tarojs/taro'
import {Home, Left, My} from '@nutui/icons-vue-taro'
import {createActiveOrder, createOrder, getActiveGoodsDetail, getGoodsDetail} from '@/api/goods'
import Pay from '@/components/Pay.vue'
import { Ref, ref } from "vue";
import Taro from "@tarojs/taro";
import { Home, Left } from "@nutui/icons-vue-taro";
import { getActiveGoodsDetail } from "@/api/goods";
import Cart from "@/components/Cart.vue";
import { Cart2 } from "@nutui/icons-vue-taro";
import { nextTick } from "vue";
const BarHeight = ref((statusBarHeight as number) + 7)
const statusBarHeight = Taro.getSystemInfoSync()?.statusBarHeight;
const BarHeight = ref((statusBarHeight as number) + 7);
const swiperList = ref([])
const isSkuShow = ref(false)
const isShowPay = ref(false)
// const sku = ref([]);
const payType = ref('')
const orderData = ref([])
const count = ref(1)
const swiperList = ref([]);
interface GoodInfo {
gid?: number;
gid?: string;
name?: string;
number?: number;
exchange?: number;
cover?: string;
details?: string;
sku?: any[];
stock?: number;
profile?: string;
price?: number;
cartNum?: number;
}
const goodInfo = ref<GoodInfo>({})
const goodInfo = ref<GoodInfo>({});
Taro.useLoad((options) => {
payType.value = options.type === '1' ? 'wx' : 'jf'
get_good_detail(options.gid)
})
Taro.useLoad(async (options) => {
await get_good_detail(options.gid);
mer_info.value = Taro.getStorageSync("mer_info");
await nextTick(async () => {
await cartRef.value.get_cart_list();
});
});
const get_good_detail = async (gid: string) => {
try {
let res: any
if (payType.value === 'jf') {
res = await getGoodsDetail({gid: gid})
} else {
res = await getActiveGoodsDetail({gid: gid})
}
const res = await getActiveGoodsDetail({ gid: gid });
goodInfo.value = {
...res.data.data
...res.data.data,
// details: res.data.data.details.,
}
swiperList.value = res.data.data.rotation.split(',')
};
swiperList.value = res.data.data.rotation.split(",");
} catch (e) {
Taro.showToast({
title: e.msg,
icon: 'none'
})
icon: "none",
});
}
}
const addCount = () => {
if (count.value >= (goodInfo.value.stock as number)) {
count.value = goodInfo.value.stock as number
Taro.showToast({
title: '库存不足',
icon: 'none'
})
return
}
}
};
const returns = () => {
Taro.navigateBack({
delta: 1
})
}
delta: 1,
});
};
const goHome = () => {
Taro.switchTab({
url: '/pages/index/index'
})
url: "/pages/index/index",
});
};
interface CartItems {
bid: string;
gid: string;
number: number;
price: number;
cover: string;
name: string;
exchange: number;
}
const openSku = () => {
isSkuShow.value = true
}
const mer_info = ref<any>({});
// const selectSku = () => {};
// const clickBtnOperate = () => {};
// const close = () => {};
// const add_cart = async () => {
// if (isSkuShow.value === false) return openSku();
// try {
// await addCart({ gid: goodInfo.value.gid });
// Taro.showToast({
// title: "加入购物车成功",
// icon: "success",
// duration: 2000,
// });
// } catch (e) {
// Taro.showToast({
// title: e.msg,
// icon: "none",
// });
// }
// isSkuShow.value = false;
// };
const cartRef = ref(null) as Ref;
const toOrderDetail = async () => {
if (!Taro.getStorageSync('token')) {
return Taro.showModal({
title: '提示',
content: '你还没登录,请先登录',
cancelText: '先逛逛',
confirmText: '去登录',
success: (res) => {
if (res.confirm) {
Taro.reLaunch({
url: '/pages/users/login/index'
})
const add_cart = async (item: any) => {
const num = item.cartNum ? Number(item.cartNum) + 1 : 1;
await nextTick(async () => {
await cartRef.value.add_cart(item, num);
});
};
const updateCartNum = (cartItems: CartItems[]) => {
if (cartItems.length > 0) {
cartItems.forEach((cartItem: CartItems) => {
if (goodInfo.value.gid === cartItem.gid) {
goodInfo.value.cartNum = cartItem.number;
}
}
})
}
if (isSkuShow.value === false) return openSku()
// Taro.navigateTo({
// url: '/pages/goods/order_create/index'
// })
try {
let res: any
if (payType.value === 'jf') {
res = await createOrder([
{
gid: goodInfo.value.gid,
count: Number(count.value)
}
])
});
} else {
res = await createActiveOrder({
gid: goodInfo.value.gid,
stock: Number(count.value)
})
Reflect.deleteProperty(goodInfo.value, "cartNum");
}
orderData.value = res?.data?.data
isShowPay.value = true
count.value = 1
} catch (e) {
Taro.showToast({
title: e.msg,
icon: 'none'
})
}
isSkuShow.value = false
}
const closePay = (val: boolean) => {
isShowPay.value = val
orderData.value = []
}
const toPage = (url: string, type: number = 1) => {
if (type === 1) {
Taro.switchTab({
url: url
})
} else {
// Taro.navigateTo({
// url: url,
// });
Taro.showToast({
title: '暂未开放',
icon: 'none'
})
}
}
};
</script>
<style lang="scss">
page {
--nut-cell-box-shadow: none;
// --nut-cell-padding: 0;
--nut-cell-title-font: 30px;
}
@@ -354,13 +208,18 @@ page {
.card {
padding: 30px;
background-color: #fff;
position: relative;
.header {
display: flex;
justify-content: space-between;
align-items: center;
.price {
display: flex;
flex-direction: column;
}
.title {
font-size: 30px;
font-weight: bold;
@@ -372,11 +231,17 @@ page {
}
}
.sub {
font-size: 24px;
color: #999;
}
.nut-button {
// margin: 10px;
position: absolute;
right: 40rpx;
bottom: 20rpx;
}
}
.rich-box {
@@ -395,12 +260,6 @@ page {
.rich {
width: 100%;
// img {
// width: 100%;
// height: auto;
// display: block;
// }
}
}
@@ -446,7 +305,6 @@ page {
color: #333;
font-size: 25px;
width: 100px;
// margin-right: 100px;
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -197,16 +197,11 @@ const delOrder = async (oid: string) => {
</view>
</view>
<view v-if="orderList.length > 0">
<view
class="order-card"
v-for="(item, index) in orderList"
:key="index"
>
<view class="order-card" v-for="(item, index) in orderList" :key="index">
<view class="top">
<view>{{
item.add_time.slice(0, 19).replace("T", " ")
}}</view>
<view style="color: red">{{
<view>{{ item.add_time.slice(0, 19).replace("T", " ") }}</view>
<view style="color: red"
>{{
item.status === 0
? "待付款"
: item.status === 1
@@ -214,13 +209,14 @@ const delOrder = async (oid: string) => {
: item.status === 2
? "已使用"
: "已失效"
}}</view>
}}
</view>
</view>
<view class="line"></view>
<view class="center">
<view class="top">
<image :src="item.BindGoods.cover" />
<view class="title">{{ item.BindGoods.name }} </view>
<view class="title">{{ item.BindGoods.name }}</view>
<view class="right">
<view>{{ item.number }}</view>
<!-- <view>x{{ item.count }}</view> -->

View File

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

View File

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

View File

@@ -9,11 +9,20 @@
<nut-swiper
:init-page="0"
:pagination-visible="true"
pagination-color="#426543"
auto-play="3000"
pagination-color="#000"
duration="1000"
:loop="false"
>
<nut-swiper-item v-for="(itm, idx) in swiperList" :key="idx">
<img :alt="itm.ID.toString()" :src="itm.url"/>
<view
class="item"
v-for="(item, index) in itm"
:key="index"
@click="toDetails(item)"
>
<image :src="item.icon" />
<text>{{ item.name }}</text>
</view>
</nut-swiper-item>
</nut-swiper>
<!-- 金刚区 -->
@@ -25,149 +34,124 @@
:text="item.label"
@click="toPage(item.url)"
>
<image :src="item.icon"/>
<image :src="item.icon" />
</nut-grid-item>
</nut-grid>
</view>
<view class="goodBox">
<view
class="good"
v-for="item in (merdata as any)"
:key="item.ID"
@click.stop="toMerDetails(item)"
>
<image :src="(item.head_photo as string)"/>
<view class="good-text-box">
<text class="good-text">{{ item.name }}</text>
<text style="color: #999"
>距离我{{
calculateDistance(
userLocalNum.t,
userLocalNum.l,
Number(item.lat),
Number(item.lon)
)
}}
</text
>
</view>
</view>
</view>
<MerList />
<!-- 签到弹窗 -->
<Popup />
</view>
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import Taro from '@tarojs/taro'
import {bindParent, getBanner} from '@/api/user'
import {getMerList} from '@/api/goods'
import {calculateDistance} from '@/utils'
import { ref } from "vue";
import Taro from "@tarojs/taro";
import Popup from "@/components/Popup.vue";
import MerList from "@/components/MerList.vue";
import { getHomeList } from "@/api/home";
const searchValue = ref('')
const searchValue = ref("");
const swiperList = ref<any>([])
interface SwiperList {
ID: number;
icon: string;
name: string;
}
const swiperList = ref<Array<Array<SwiperList>>>([]);
const userMenuList = ref([
{
id: 1,
label: '活动游戏',
url: `/pages/game/gamehome/index?uid=${Taro.getStorageSync('token')}`,
icon: 'http://jdt168.com/uploads/merchant/20220829/caad6be8983e88c41d28da7d124bc37b.png'
label: "活动游戏",
url: `/pages/game/gamehome/index?uid=${Taro.getStorageSync("token")}`,
icon: "//jdt168.com/uploads/merchant/20220829/caad6be8983e88c41d28da7d124bc37b.png",
},
{
id: 2,
label: '活动商品',
url: '/pages/hotGoods/index/index',
icon: 'http://jdt168.com/uploads/def/20230509/d59e7fcb65a88bc56694dae4f9d21b51.png'
label: "活动商品",
// url: "/pages/hotGoods/index/index",
url: "",
icon: "//jdt168.com/uploads/def/20230509/d59e7fcb65a88bc56694dae4f9d21b51.png",
},
{
id: 3,
label: '商户入驻',
url: '/pages/users/settled_mer/index',
icon: 'http://jdt168.com/uploads/merchant/20220829/6fe67b93721a42aedc842c4f19d6f2d3.png'
label: "商户入驻",
url: "/pages/users/settled_mer/index",
icon: "//jdt168.com/uploads/merchant/20220829/6fe67b93721a42aedc842c4f19d6f2d3.png",
},
{
id: 4,
label: '最新资讯',
url: '',
icon: 'http://jdt168.com/uploads/merchant/20220829/b975136a9b64aab69bf11d75a194f1ea.png'
}
])
label: "最新资讯",
url: "",
icon: "//jdt168.com/uploads/merchant/20220829/b975136a9b64aab69bf11d75a194f1ea.png",
},
]);
Taro.useDidShow(async () => {
await getBannerList()
await get_mer_list()
if (Taro.getStorageSync('token') && Taro.getStorageSync('bind_id')) {
try {
const res = await bindParent({
uid: Taro.getStorageSync('bind_id')
})
Taro.showToast({
title: res.msg
})
Taro.removeStorageSync('bind_id')
} catch (error) {
Taro.removeStorageSync('bind_id')
throw error
}
}
})
await getBannerList();
});
Taro.useShareAppMessage(() => ({
title: '捷兑通',
path: `/pages/index/index?scene=${Taro.getStorageSync('token')}`,
title: "捷兑通",
path: `/pages/index/index?scene=${Taro.getStorageSync("token")}`,
imageUrl:
'https://upload.jdt168.com/1694242954957988438_微信图片_20230909150016.jpg'
}))
const merdata = ref([])
const userLocalNum = ref({
l: 0,
t: 0
})
const get_mer_list = async () => {
Taro.getLocation({
type: 'wgs84',
success: (res) => {
userLocalNum.value.l = res.longitude
userLocalNum.value.t = res.latitude
}
})
const res = await getMerList({
PageNum: 1,
PageSize: 10,
Btype: 2,
classid: 0
})
merdata.value = res.data.data
}
"https://upload.jdt168.com/1694242954957988438_微信图片_20230909150016.jpg",
}));
const getBannerList = async () => {
const {data}: any = await getBanner()
swiperList.value = data.data
}
const { data } = await getHomeList();
if (data.data.length > 0) {
// for (let i = 0; i < 31; i++) {
// data.data.push({
// ID: i,
// icon: "//jdt168.com/uploads/def/20230509/d59e7fcb65a88bc56694dae4f9d21b51.png",
// name: "活动商品",
// });
// }
// 数组分组
const arr = [];
for (let i = 0; i < data.data.length; i += 10) {
arr.push(data.data.slice(i, i + 10));
}
swiperList.value = arr;
}
};
const toPage = (url: string) => {
Taro.navigateTo({
url: url
})
}
url: url,
});
};
const toMerDetails = (item: any) => {
Taro.setStorageSync('mer_info', item)
const toDetails = (item: SwiperList) => {
Taro.navigateTo({
url: `/pages/mer/mer_detail/index`
})
}
url: `/pages/search/index?id=${item.ID}&name=${item.name}`,
});
};
</script>
<style lang="scss">
.nut-swiper-item img {
width: 100%;
height: 350px;
.nut-swiper {
background: #ffffff;
.nut-swiper-item {
display: grid;
grid-template-columns: repeat(5, 1fr);
.item {
display: flex;
flex-direction: column;
align-items: center;
image {
width: 100px;
height: 100px;
border-radius: 50%;
}
}
}
}
.titleImg {
@@ -193,57 +177,4 @@ const toMerDetails = (item: any) => {
height: 80px;
}
}
.goodBox {
display: flex;
padding: 20px;
flex-wrap: wrap;
justify-content: space-between;
.good {
width: 340px;
background-color: #fff;
margin-bottom: 20px;
border-radius: 10px;
image {
width: 100%;
height: 250px;
border-top-right-radius: 10px;
border-top-left-radius: 10px;
}
.good-text-box {
padding: 10px;
.good-text {
flex-shrink: 0;
font-size: 28px;
color: #333;
font-weight: 400;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
word-break: break-word;
}
.good-price-box {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 10px;
.good-text-price {
font-size: 28px;
font-weight: bold;
color: #ff0000;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
}
}
}
}
</style>

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
navigationBarTitleText: "每日签到",
});

View File

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

View File

@@ -7,10 +7,7 @@
pagination-color="red"
auto-play="3000"
>
<nut-swiper-item
v-for="(itm, idx) in (swiperList as any)"
:key="idx"
>
<nut-swiper-item v-for="(itm, idx) in swiperList" :key="idx">
<img
style="width: 100%; height: 100%"
:src="itm"
@@ -23,7 +20,7 @@
<view class="title">{{ mer_info.name }}</view>
<view class="bom">
<view class="left">
<view>{{ mer_info.address || '暂无商家地址' }}</view>
<view>{{ mer_info.address || "暂无商家地址" }}</view>
<view class="sub"
>距你{{
calculateDistance(
@@ -33,25 +30,21 @@
Number(mer_info.lon)
)
}}
</view
>
</view>
</view>
<view class="right">
<view @click="clickMap">
<Locationg3 color="red" size="25"/>
<Locationg3 color="red" size="25" />
<view>导航</view>
</view>
<view @click="clickPhone">
<Find color="red" size="25"/>
<Find color="red" size="25" />
<view>电话</view>
</view>
</view>
</view>
</view>
<!-- 商品列表 -->
<!-- <view class="good">
<view class="item"></view>
</view> -->
<view class="good-class" v-if="class_list.length > 0">
<nut-tabs
v-model="value"
@@ -60,119 +53,98 @@
title-gutter="5"
animated-time="0"
name="tabName"
@click="clickTab"
>
<nut-tab-pane
v-for="(item, index) in class_list as any[]"
:title="item.name"
v-for="(itm, index) in good_list"
:key="index"
:title="itm.name"
:pane-key="index"
>
<view v-if="good_list.length > 0">
<view
class="list"
v-for="(item, index) in good_list as any[]"
:key="index"
>
<view class="item">
<img :src="item.cover"/>
<view v-if="itm.Goods.length > 0">
<view class="list" v-for="(item, index) in itm.Goods" :key="index">
<view class="item" @click.stop="toGoodDetails(item.gid, 1)">
<image :src="item.cover" lazy-load />
<view class="right">
<view class="name">{{ item.name }}</view>
<view class="stock">
库存剩余:{{ item.stock }}
</view>
<view class="stock">剩余:{{ item.stock }}</view>
<view class="bom">
<view class="price"
>
<text style="font-size: 15px">{{
item.number
}}
</text>
{{
mer_info.bType === 1
? '元'
: '积分'
}}
</view
<view>
<view class="price">
<text style="font-size: 15px">{{ item.number }}</text>
</view>
<view class="price">
<text style="font-size: 15px"
>{{ item.exchange }}积分</text
>
</view>
</view>
<nut-button
size="mini"
v-if="mer_info.bType === 1"
type="primary"
@click.stop="
toGoodDetails(
item.gid as number,
1
)
"
>去购买
</nut-button
>
<nut-button
size="mini"
v-else
type="primary"
@click.stop="
toGoodDetails(
item.gid as number,
2
)
"
>去兑换
</nut-button
@click.stop="add_cart(item)"
>
<template #icon>
<Cart2 />
</template>
</nut-button>
</view>
</view>
</view>
</view>
</view>
</view
>
<nut-empty v-else description="该分类暂无商品"></nut-empty>
<view style="height: 180rpx"></view>
</nut-tab-pane>
</nut-tabs>
</view>
<nut-empty v-else description="该商家暂无商品"></nut-empty>
<!-- 购物车 -->
<cart ref="cartRef" :mer-info="mer_info" @update-cart="updateCartNum" />
</view>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro'
import {Find, Locationg3} from '@nutui/icons-vue-taro'
import {ref} from 'vue'
import {calculateDistance} from '@/utils'
import {getGoodList, getMerCategory} from '@/api/goods'
import Taro from "@tarojs/taro";
import { Find, Locationg3 } from "@nutui/icons-vue-taro";
import { Ref, ref } from "vue";
import { calculateDistance } from "@/utils";
import { getGoodList, getMerCategory } from "@/api/goods";
import Cart from "@/components/Cart.vue";
import { Cart2 } from "@nutui/icons-vue-taro";
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({
l: 0,
t: 0
})
t: 0,
});
Taro.useLoad(() => {
Taro.useLoad(async () => {
Taro.getLocation({
type: 'wgs84',
type: "wgs84",
success: (res) => {
userLocalNum.value.l = res.longitude
userLocalNum.value.t = res.latitude
}
})
mer_info.value = Taro.getStorageSync('mer_info')
userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude;
},
});
mer_info.value = Taro.getStorageSync("mer_info");
Taro.setNavigationBarTitle({
title: mer_info.value.name
})
swiperList.value = mer_info.value.img.split(',')
get_class_list()
})
title: mer_info.value.name,
});
swiperList.value = mer_info.value.img.split(",");
await get_class_list();
await cartRef.value.get_cart_list();
});
const clickPhone = () => {
Taro.makePhoneCall({
phoneNumber: mer_info.value.mobile
})
}
phoneNumber: mer_info.value.mobile,
});
};
const clickMap = () => {
Taro.openLocation({
@@ -180,53 +152,112 @@ const clickMap = () => {
address: mer_info.value.address,
latitude: Number(mer_info.value.lat),
longitude: Number(mer_info.value.lon),
scale: 18
})
}
scale: 18,
});
};
const class_list = ref<
Array<{
ID?: number;
name?: string;
}>
>([])
>([]);
const get_class_list = async () => {
const res = await getMerCategory({
Bid: mer_info.value.bid
})
class_list.value = res.data.data || []
await get_good_list(class_list.value[0].ID as number)
Bid: mer_info.value.bid,
});
class_list.value = res.data.data || [];
await get_good_list(class_list.value[0].ID as number);
};
// const clickTab = (val: any) => {
// get_good_list(class_list.value[val.paneKey].ID as number);
// };
interface goodList {
ID: number;
name: string;
bid: string;
Goods: GoodsType[];
}
const clickTab = (val: any) => {
get_good_list(class_list.value[val.paneKey].ID as number)
interface GoodsType {
gid: string;
cover: string;
name: string;
number: number;
stock: number;
cartNum: number;
exchange: number;
}
const good_list = ref([])
interface CartItems {
bid: string;
gid: string;
number: number;
price: number;
cover: string;
name: string;
exchange: number;
}
const good_list = ref<goodList[]>([]);
const get_good_list = async (id: number) => {
Taro.showLoading({
title: '加载中',
mask: true
})
title: "加载中",
mask: true,
});
const res = await getGoodList({
bid: mer_info.value.bid,
BType: mer_info.value.bType,
class_id: id,
goods_class_id: id,
status: 1,
state: 1
})
good_list.value = res.data.data || []
Taro.hideLoading()
}
state: 1,
});
good_list.value = res.data.data || [];
Taro.hideLoading();
};
const toGoodDetails = (id: number, type: number) => {
const toGoodDetails = (id: string, type: number) => {
Taro.navigateTo({
url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}`
})
}
url: `/pages/goods/goods_detail/index?gid=${id}&type=${type}`,
});
};
const cartRef = ref(null) as Ref;
const add_cart = (item: GoodsType) => {
const num = item.cartNum ? Number(item.cartNum) + 1 : 1;
cartRef.value.add_cart(item, num);
};
const updateCartNum = (cartItems: CartItems[]) => {
if (cartItems.length > 0) {
good_list.value.forEach((category: goodList) => {
category.Goods.forEach((good: GoodsType) => {
cartItems.forEach((cartItem: CartItems) => {
if (good.gid === cartItem.gid) {
good.cartNum = cartItem.number;
}
});
});
});
} else {
good_list.value.forEach((category: goodList) => {
category.Goods.forEach((good: GoodsType) => {
Reflect.deleteProperty(good, "cartNum");
});
});
}
};
</script>
<style lang="scss">
page {
// IOS安全区域
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.nut-swiper {
height: 350px;
}
@@ -277,9 +308,9 @@ const toGoodDetails = (id: number, type: number) => {
display: flex;
margin-bottom: 10px;
img {
width: 140px;
height: 150px;
image {
width: 180px;
height: 180px;
border-radius: 10px;
}

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,3 @@
export default definePageConfig({
enableShareAppMessage: true,
});

View File

@@ -0,0 +1,23 @@
<script setup lang="ts">
import { ref } from "vue";
import Taro from "@tarojs/taro";
import MerList from "@/components/MerList.vue";
const classId = ref<null | number>(null);
Taro.useLoad((e) => {
console.log(e);
Taro.setNavigationBarTitle({
title: e.name,
});
classId.value = Number(e.id);
});
</script>
<template>
<view>
<MerList :classId="classId" />
</view>
</template>
<style lang="scss"></style>

View File

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

View File

@@ -7,17 +7,16 @@
>
<view class="user-center-card__header__avatar">
<nut-avatar size="large">
<img :src="userInfo.avatarUrl"/>
<img :src="userInfo.data?.avatarUrl" />
</nut-avatar>
</view>
<view class="user-center-card__header__info">
<view
class="user-center-card__header__info__name"
@click="toPage('/pages/users/user_setting/index')"
>{{ userInfo.nickName }}
</view
>
<view v-if="!userInfo.phone">
>{{ userInfo.data?.nickName }}
</view>
<view v-if="!userInfo.data?.phone">
<nut-button
size="mini"
open-type="getPhoneNumber"
@@ -27,12 +26,8 @@
</view>
</view>
<view class="rightIcon">
<Scan style="margin-right: 20px" @click="scanCode" size="22"/>
<Setting
style="margin-right: 20px"
@click="toSetting"
size="22"
/>
<Scan style="margin-right: 20px" @click="scanCode" size="22" />
<Setting style="margin-right: 20px" @click="toSetting" size="22" />
</view>
</view>
<view v-else class="user-center-card__header__transparent">
@@ -44,9 +39,7 @@
</nut-avatar>
</view>
<view class="user-center-card__header__info">
<view
class="user-center-card__header__info__name"
@click="clickLogin"
<view class="user-center-card__header__info__name" @click="clickLogin"
>点击立即登录
</view>
</view>
@@ -58,7 +51,7 @@
<view>我的订单</view>
<view class="sub" @click="toOrderList(0)">
<view>全部订单</view>
<ArrowRight/>
<ArrowRight />
</view>
</view>
<view class="center">
@@ -101,9 +94,9 @@
<view class="user-center">
<view>我的服务</view>
<view class="box">
<template v-if="isLogin">
<view
class="box-mini"
v-if="isLogin"
v-for="item in userMenuList"
:key="item.id"
@click="toPage(item.url)"
@@ -112,16 +105,23 @@
<IconFont size="40" :name="item.icon"></IconFont>
<view class="label">{{ item.label }}</view>
</view>
<button v-if="isLogin" class="box-mini" open-type='contact'>
<IconFont size="40"
name="http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png"></IconFont>
</template>
<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>
</button>
</view>
</view>
<!-- 商家管理 -->
<view class="mer-box" v-if="userInfo.bid">
<view
class="mer-box"
v-if="userInfo.data?.bid && userInfo.store_status === 1"
>
<nut-grid :gutter="10" :border="false">
<nut-grid-item
:border="false"
@@ -176,76 +176,79 @@
</template>
<script lang="ts" setup>
import {ref} from 'vue'
import {ArrowRight, Setting, IconFont, Scan} from '@nutui/icons-vue-taro'
import Taro from '@tarojs/taro'
import Auth from '@/components/Auth.vue'
import {getPersonalInfo, getPhone, bindParent} from '@/api/user'
import { ref } from "vue";
import { ArrowRight, Setting, IconFont, Scan } from "@nutui/icons-vue-taro";
import Taro from "@tarojs/taro";
import Auth from "@/components/Auth.vue";
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 {
data?: {
nickName?: string;
avatarUrl?: string;
ID?: string;
bid?: string;
phone?: string;
uid?: string;
};
store_status?: number;
store_name?: string;
}
const userInfo = ref<UserInfo>({})
const userInfo = ref<UserInfo>({});
Taro.useDidShow(() => {
const token = Taro.getStorageSync('token')
const token = Taro.getStorageSync("token");
if (token) {
getUserInfo()
getUserInfo();
}
})
});
const cancelLogin = () => {
isShowLogin.value = false
}
isShowLogin.value = false;
};
const getUserInfo = async () => {
Taro.showLoading({
title: '加载中'
})
const res = await getPersonalInfo()
userInfo.value = res.data.data
Taro.setStorageSync('userInfo', res.data.data)
Taro.setStorageSync('mer_type', res.data.store_type)
isLogin.value = true
cancelLogin()
Taro.hideLoading()
}
title: "加载中",
});
const res = await getPersonalInfo();
userInfo.value = res.data;
Taro.setStorageSync("userInfo", res.data);
isLogin.value = true;
cancelLogin();
Taro.hideLoading();
};
const getphonenumber = async (e: any) => {
await getPhone({
uid: userInfo.value.uid,
code: e.detail.code
})
await getUserInfo()
}
uid: userInfo.value.data?.uid,
code: e.detail.code,
});
await getUserInfo();
};
const toOrderList = (e: number) => {
if (!isLogin)
if (!isLogin.value)
return Taro.showToast({
title: '请先登录',
icon: 'none'
})
title: "请先登录",
icon: "none",
});
Taro.navigateTo({
url: `/pages/users/order_list/index?type=${e}`
})
}
url: `/pages/users/order_list/index?type=${e}`,
});
};
const userMenuList = ref([
{
id: 1,
label: '我的账户',
url: '/pages/users/account/index',
icon: 'http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png'
label: "我的账户",
url: "/pages/users/account/index",
icon: "http://jdt168.com/uploads/default/20220829/e819815623276fdbb9a54d685292e5c7.png",
},
// {
// id: 2,
@@ -255,65 +258,65 @@ const userMenuList = ref([
// },
{
id: 3,
label: '我的推广',
url: '/pages/users/distribution/index',
icon: 'http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png'
label: "我的推广",
url: "/pages/users/distribution/index",
icon: "http://jdt168.com/uploads/default/20220829/73656833c1d849c050638f9ee9903b9d.png",
},
{
id: 4,
label: '关注商家',
url: '',
icon: 'http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png'
}
label: "关注商家",
url: "",
icon: "http://jdt168.com/uploads/default/20220829/13637589cd20785aa21fca1d4f9b26bc.png",
},
// {
// id: 5,
// label: '联系客服',
// url: '',
// icon: 'http://jdt168.com/uploads/default/20220829/7437d90fdd0fba868084bd9cd0b59049.png'
// }
])
]);
const toSetting = () => {
Taro.navigateTo({
url: '/pages/users/setting/index'
})
}
url: "/pages/users/setting/index",
});
};
const clickLogin = () => {
// isShowLogin.value = true
Taro.redirectTo({
url: '/pages/users/login/index'
})
}
url: "/pages/users/login/index",
});
};
const toPage = (url: string) => {
Taro.navigateTo({
url: url
})
}
url: url,
});
};
const scanCode = () => {
Taro.scanCode({
onlyFromCamera: true,
scanType: ['qrCode'],
scanType: ["qrCode"],
success: async (data) => {
try {
await bindParent({
uid: data.result
})
uid: data.result,
});
Taro.showToast({
title: '绑定成功',
icon: 'none'
})
title: "绑定成功",
icon: "none",
});
} catch (error) {
Taro.showToast({
title: error.msg,
icon: 'none'
})
icon: "none",
});
}
}
})
}
},
});
};
</script>
<style lang="scss">
@@ -457,7 +460,6 @@ const scanCode = () => {
color: #000000;
background-color: #fff;
height: 100%;
}
button::after {

View File

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

View File

@@ -1,7 +1,9 @@
<script lang="ts" setup>
import { ref } from "vue";
import { showToast, useLoad, getStorageSync } from "@tarojs/taro";
import { getIntegralDetail, getBeanDetail } from "@/api/user";
import { computed, ref } from "vue";
import Taro from "@tarojs/taro";
import { getIntegralDetail, getBeanDetail, getGiftRecord } from "@/api/user";
// Taro.setStorageSync("token", "ok_OL66Ej4_lkQKNA0AwxnGwGyXo");
const tabValue = ref(1);
@@ -18,8 +20,25 @@ const tabsList = ref([
title: "豆子明细",
value: 2,
},
{
title: "活动赠送",
value: 4,
},
]);
const computerType = computed(() => {
return (val: number) => {
switch (val) {
case 5:
return "注册赠送";
case 6:
return "签到赠送";
case 7:
return "系统赠送";
}
};
});
const tabChange = (index: number) => {
tabValue.value = index;
data.value = [];
@@ -27,13 +46,22 @@ const tabChange = (index: number) => {
page.value.PageNum = 1;
};
const data = ref([]);
interface DataType {
goods_name: string;
add_time: string;
number: number;
order_number: number;
type: number;
oid: string;
}
const data = ref<DataType[]>([]);
const userInfo = ref<any>({});
useLoad(() => {
Taro.useLoad(() => {
getList();
userInfo.value = getStorageSync("userInfo");
userInfo.value = Taro.getStorageSync("userInfo");
});
const page = ref({
@@ -57,14 +85,17 @@ const getList = async () => {
};
if (tabValue.value === 1 || tabValue.value === 3) {
res = await getBeanDetail(newData);
} else {
delete data.Type;
} else if (tabValue.value === 2) {
// delete data.value.Type;
Reflect.deleteProperty(data.value, "Type");
res = await getIntegralDetail(newData);
} else {
res = await getGiftRecord(newData);
}
data.value = res.data.data || [];
page.value.ItemCount = res.data.count;
} catch (error) {
showToast({
Taro.showToast({
title: error.msg,
icon: "none",
});
@@ -75,14 +106,14 @@ const getList = async () => {
<template>
<view>
<view class="card">
<!-- <view class="greeting">Hello! YuanHuakk</view> -->
<!-- <view class="greeting">Hello! YuanHuakk</view>-->
<view class="info">
<view class="left">
<view>
<view class="num">豆子: {{ userInfo.pulse }}</view>
<view class="num">豆子: {{ userInfo.data?.pulse }}</view>
</view>
<view>
<view class="num">积分: {{ userInfo.integral }}</view>
<view class="num">积分: {{ userInfo.data?.integral }}</view>
</view>
</view>
<!-- <image class="img" src="https://picdm.sunbangyan.cn/2023/08/15/ste192.png"/> -->
@@ -103,42 +134,51 @@ const getList = async () => {
</view>
<view v-if="data.length > 0">
<view v-if="tabValue === 1 || tabValue === 3">
<view
class="card-list"
v-for="(item, index) in (data as any[])"
:key="index"
>
<view class="card-list" v-for="(item, index) in data" :key="index">
<view class="left">
<view>商品{{ item.goods_name }}</view>
<view>订单{{ item.oid }}</view>
<view>时间{{ item.add_time.slice(0, 10) }}</view>
</view>
<view class="right">
<view v-if="tabValue === 1" style="color: green"
>-<text>{{ item.number }}积分</text></view
>
>-
<text>{{ item.number }}积分</text>
</view>
<view v-if="tabValue === 3" style="color: red"
>+<text>{{ item.number }}</text
>积分</view
>
>+
<text>{{ item.number }}</text>
积分
</view>
</view>
</view>
<view v-else>
<view
class="card-list"
v-for="(item, index) in (data as any[])"
:key="index"
>
</view>
<view v-else-if="tabValue === 2">
<view class="card-list" v-for="(item, index) in data" :key="index">
<view class="left">
<view class="text">商品{{ item.goods_name }}</view>
<view>金额{{ item.order_number }}</view>
<view class="text">订单{{ item.oid }}</view>
<view>时间{{ item.add_time.slice(0, 10) }}</view>
</view>
<view class="right">
<view style="color: red"
>+<text>{{ item.number }}</text
>豆子</view
>
>+
<text>{{ item.number }}</text>
豆子
</view>
</view>
</view>
</view>
<view v-else-if="tabValue === 4">
<view class="card-list" v-for="(item, index) in data" :key="index">
<view class="left">
<view class="text">类型{{ computerType(item.type) }}</view>
<view>时间{{ item.add_time.slice(0, 10) }}</view>
</view>
<view class="right">
<view style="color: red"
>+
<text>{{ item.number }}</text>
豆子
</view>
</view>
</view>
</view>
@@ -159,6 +199,7 @@ const getList = async () => {
left: 50%;
transform: translateX(-50%);
}
.card {
width: 90%;
height: 300px;
@@ -230,6 +271,7 @@ const getList = async () => {
background-color: #ff0000;
}
}
.card-list {
margin: 10px 20px;
background-color: #fff;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,16 +1,8 @@
<script lang="ts" setup>
import { ref } from "vue";
import {
useLoad,
useReachBottom,
showToast,
navigateTo,
setStorageSync,
useDidShow,
} from "@tarojs/taro";
import Taro from "@tarojs/taro";
import Pay from "@/components/Pay.vue";
import { getIntegralOrderList } from "@/api/user";
import { deleteJfOrder } from "@/api/goods";
import { getActiveOrderList, deleteActiveOrder } from "@/api/goods";
import { getOrderStatistics } from "@/api/order";
const tabValue = ref(0);
@@ -51,40 +43,50 @@ interface OrderList {
oid: string;
add_time: string;
status: number;
BindGoods: {
cover: string;
name: string;
number: number;
};
OrderGoods: GoodsItem[];
count: number;
number: number;
pay_type: number;
exchange: number;
price: number;
}
interface GoodsItem {
Goods: {
name: string;
cover: string;
};
ID: number;
gid: string;
number: number;
oid: string;
pay_integral: number;
pay_price: number;
}
const orderList = ref<OrderList[]>([]);
useLoad((options) => {
Taro.useLoad((options) => {
tabValue.value = Number(options.type);
});
useDidShow(() => {
Taro.useDidShow(() => {
getList();
});
const getList = async () => {
try {
const res = await getIntegralOrderList({
const res = await getActiveOrderList({
status: tabValue.value,
});
console.log(res);
orderList.value = res.data.data;
} catch (error) {
showToast({
Taro.showToast({
title: error.msg,
icon: "none",
});
}
getTj();
await getTj();
};
const tabChange = (index: number) => {
@@ -92,18 +94,18 @@ const tabChange = (index: number) => {
getList();
};
useReachBottom(() => {
Taro.useReachBottom(() => {
console.log("useReachBottom");
});
const openPay = (item: OrderList) => {
isShowPay.value = true;
jfInfo.value = [item];
jfInfo.value = item.oid;
};
const errPay = () => {
isShowPay.value = false;
showToast({
Taro.showToast({
title: "支付失败",
icon: "none",
});
@@ -112,7 +114,7 @@ const errPay = () => {
};
const closePay = () => {
isShowPay.value = false;
showToast({
Taro.showToast({
title: "支付取消",
icon: "none",
});
@@ -121,26 +123,32 @@ const closePay = () => {
};
const toDetail = (item: any) => {
setStorageSync("item", item);
navigateTo({
Taro.setStorageSync("item", item);
Taro.navigateTo({
url: `/pages/users/order_list_detail/index?orderId=${item.oid}`,
});
};
const delOrder = async (oid: string) => {
try {
const res = await deleteJfOrder({ oid });
console.log(res);
await deleteActiveOrder({ oid });
} catch (error) {
showToast({
Taro.showToast({
title: error.msg,
icon: "none",
});
}
getList();
await getList();
};
const countInfo = ref<any>({});
const countInfo = ref<{
A?: number;
B?: number;
C?: number;
D?: number;
F?: number;
Total?: number;
}>({});
const getTj = async () => {
try {
@@ -154,7 +162,7 @@ const getTj = async () => {
tabsList.value[3].num = countInfo.value.D || 0;
tabsList.value[4].num = countInfo.value.F || 0;
} catch (error) {
showToast({
Taro.showToast({
title: error.msg,
icon: "none",
});
@@ -188,14 +196,11 @@ const getTj = async () => {
</view>
</view>
<view v-if="orderList.length > 0">
<view
class="order-card"
v-for="(item, index) in orderList"
:key="index"
>
<view class="order-card" v-for="(item, index) in orderList" :key="index">
<view class="top">
<view>{{ item.add_time.slice(0, 19) }}</view>
<view style="color: red">{{
<view style="color: red"
>{{
item.status === 0
? "待付款"
: item.status === 1
@@ -203,27 +208,31 @@ const getTj = async () => {
: item.status === 2
? "已使用"
: "已失效"
}}</view>
}}
</view>
</view>
<view class="line"></view>
<view class="center">
<view class="center" v-for="(itm, idx) in item.OrderGoods" :key="idx">
<view class="top">
<image :src="item.BindGoods.cover" />
<view class="title">{{ item.BindGoods?.name }} </view>
<image :src="itm.Goods.cover" />
<view class="title">{{ itm.Goods?.name }}</view>
<view class="right">
<view>{{ item.BindGoods?.number }}</view>
<view>x{{ item?.count }}</view>
<view>{{ itm.pay_price }}</view>
<view>{{ itm.pay_integral }}积分</view>
<view>x{{ itm.number }}</view>
</view>
</view>
<!-- <view
class="bom"
style="text-align: right; font-size: 13px"
>
{{ item.count }}件商品,实付积分:
<text style="color: red">{{ item.number }}</text>
</view> -->
</view>
<view class="line"></view>
<view v-if="item.status !== 0" style="text-align: right">
<text>{{ item.count }}件商品</text>,
<text
>实付款:{{ item.pay_type === 1 ? item.price : item.exchange }},{{
item.pay_type === 1 ? "微信支付" : "积分支付"
}}</text
>
<view class="line"></view>
</view>
<view class="btn">
<nut-button
v-if="item.status === 0"
@@ -254,15 +263,22 @@ const getTj = async () => {
<nut-empty v-else description="暂无订单"></nut-empty>
<pay
:isShowPay="isShowPay"
payType="jf"
:interval="false"
:jfInfo="jfInfo"
:OrderType="2"
@errPay="errPay"
@closePay="closePay"
:jfInfo="jfInfo"
/>
</view>
</template>
<style lang="scss">
page {
// IOS安全区域
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
.topTips {
box-sizing: border-box;
width: 100%;
@@ -335,14 +351,16 @@ const getTj = async () => {
}
.center {
margin-bottom: 10px;
.top {
display: flex;
justify-content: space-between;
// align-items: flex-start;
image {
width: 150px;
height: 150px;
width: 150rpx;
height: 150rpx;
border-radius: 10rpx;
}
.title {

View File

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

View File

@@ -19,22 +19,22 @@
<view class="mer-info">
<view class="left">
<view>
<text>{{ goodInfo.BindStore?.name }}</text>
<text>{{ goodInfo.BindStore?.phone }}</text>
<text>{{ goodInfo.Store?.name }}</text>
<text>{{ goodInfo.Store?.phone }}</text>
</view>
<nut-ellipsis
:rows="2"
:content="goodInfo.BindStore?.address"
:content="goodInfo.Store?.address"
direction="end"
></nut-ellipsis>
</view>
<view class="right">
<view class="icon" @click="toPhone">
<Service/>
<Service />
<text>电话</text>
</view>
<view class="icon" @click="toAdder">
<Find/>
<Find />
<text>导航</text>
</view>
</view>
@@ -45,14 +45,19 @@
<nut-cell :title="`共${goodInfo.count}件商品`"></nut-cell>
<nut-cell>
<template #default>
<view class="top">
<image :src="goodInfo.BindGoods?.cover"/>
<view class="title"
>{{ goodInfo.BindGoods?.name }}
</view>
<view class="center-box">
<view
class="top"
v-for="(item, index) in goodInfo.OrderGoods"
:key="index"
>
<image :src="item.Goods?.cover" />
<view class="title">{{ item.Goods?.name }} </view>
<view class="right">
<view>{{ goodInfo.BindGoods?.number }}</view>
<view>x{{ goodInfo.count }}</view>
<view>{{ item.pay_price }}</view>
<view>{{ item.pay_integral }}积分</view>
<view>x{{ item.number }}</view>
</view>
</view>
</view>
</template>
@@ -65,9 +70,7 @@
<nut-cell
v-if="goodInfo.expires !== 0"
title="订单过期时间:"
:desc="
dayjs.unix(goodInfo.expires).format('YYYY-MM-DD HH:mm:ss')
"
:desc="dayjs.unix(goodInfo.expires).format('YYYY-MM-DD HH:mm:ss')"
></nut-cell>
<nut-cell
title="支付状态:"
@@ -81,19 +84,20 @@
: '已失效'
"
></nut-cell>
<nut-cell
<!-- <nut-cell
:title="`商品总价(${type === '1' ? '元' : '积分'}):`"
:desc="goodInfo.number"
></nut-cell>
<nut-cell>
>
</nut-cell> -->
<nut-cell v-if="goodInfo.status !== 0">
<template #default>
<view style="text-align: right; width: 100%">
<view
>{{
goodInfo.status === 0 ? '应付款' : '实付款'
}}({{ type === '1' ? '元' : '积分' }}):
>实付款({{ goodInfo.pay_type === 1 ? "微信" : "积分" }})
<nut-price
:price="goodInfo.number"
:price="
goodInfo.pay_type === 1 ? goodInfo.price : goodInfo.exchange
"
size="normal"
:need-symbol="false"
/>
@@ -144,136 +148,149 @@
</nut-popup>
<pay
:isShowPay="isShowPay"
:payType="type === '1' ? 'wx' : 'jf'"
:interval="false"
:jfInfo="jfInfo"
:OrderType="2"
@errPay="errPay"
@closePay="closePay"
:jfInfo="jfInfo"
/>
</view>
</template>
<script setup lang="ts">
import Taro from '@tarojs/taro'
import {Find, Service} from '@nutui/icons-vue-taro'
import {ref} from 'vue'
import dayjs from 'dayjs'
import duration from 'dayjs/plugin/duration'
import Pay from '@/components/Pay.vue'
import Taro from "@tarojs/taro";
import { Find, Service } from "@nutui/icons-vue-taro";
import { ref } from "vue";
import dayjs from "dayjs";
import duration from "dayjs/plugin/duration";
import Pay from "@/components/Pay.vue";
dayjs.extend(duration)
dayjs.extend(duration);
const goodInfo = ref<any>({})
const goodInfo = ref<any>({});
const statusList = ref([
{
id: 0,
text: '待付款'
text: "待付款",
},
{
id: 1,
text: '待使用'
text: "待使用",
},
{
id: 2,
text: '已使用'
text: "已使用",
},
{
id: 3,
text: '已失效'
}
])
text: "已失效",
},
]);
const isShowCode = ref(false)
const isShowPay = ref(false)
const jfInfo = ref<any>({})
const isShowCode = ref(false);
const isShowPay = ref(false);
const jfInfo = ref<any>({});
const type = ref('')
const type = ref("");
const url = ref('')
const url = ref("");
Taro.useLoad((options) => {
type.value = options.type
goodInfo.value = Taro.getStorageSync('item')
type.value = options.type;
goodInfo.value = Taro.getStorageSync("item");
if (goodInfo.value.status === 1) {
startTime()
startTime();
}
})
});
const toPhone = () => {
Taro.makePhoneCall({
phoneNumber: goodInfo.value.BindStore.mobile
})
}
phoneNumber: goodInfo.value.Store.mobile,
});
};
const toAdder = () => {
Taro.openLocation({
latitude: Number(goodInfo.value.BindStore.lat),
longitude: Number(goodInfo.value.BindStore.lon),
scale: 18
})
}
latitude: Number(goodInfo.value.Store.lat),
longitude: Number(goodInfo.value.Store.lon),
scale: 18,
});
};
const openPay = () => {
isShowPay.value = true
jfInfo.value = Taro.getStorageSync('item')
}
isShowPay.value = true;
jfInfo.value = Taro.getStorageSync("item");
};
const successPay = (val: boolean) => {
isShowPay.value = val;
Taro.showToast({
title: "支付成功",
icon: "none",
});
Taro.navigateBack({
delta: 1,
});
};
const errPay = () => {
isShowPay.value = false
isShowPay.value = false;
Taro.showToast({
title: '支付失败',
icon: 'none'
})
jfInfo.value = {}
}
title: "支付失败",
icon: "none",
});
jfInfo.value = {};
};
const closePay = () => {
isShowPay.value = false
isShowPay.value = false;
Taro.showToast({
title: '支付取消',
icon: 'none'
})
jfInfo.value = {}
}
title: "支付取消",
icon: "none",
});
jfInfo.value = {};
};
const openCode = () => {
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`
isShowCode.value = true
}
url.value = `https://api.pwmqr.com/qrcode/create?url=${goodInfo.value.oid}`;
isShowCode.value = true;
};
const closed = () => {
isShowCode.value = false
url.value = ''
}
isShowCode.value = false;
url.value = "";
};
let timeId: any
let timeId: any;
const timeStr = ref('????')
const timeStr = ref("????");
const startTime = () => {
const nowTime = dayjs()
const endTime = dayjs(goodInfo.value.expires * 1000)
const nowTime = dayjs();
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) {
clearInterval(timeId)
clearInterval(timeId);
timeId = setTimeout(() => {
startTime()
}, 1000)
startTime();
}, 1000);
}
}
};
Taro.useUnload(() => {
clearTimeout(timeId)
})
clearTimeout(timeId);
});
</script>
<style lang="scss">
page {
--nut-cell-desc-color: #999;
height: 100vh;
box-sizing: border-box;
padding-bottom: 100px;
@@ -391,15 +408,22 @@ page {
align-items: flex-start;
}
.top {
.center-box {
display: flex;
flex-direction: column;
width: 100%;
.top {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10rpx;
image {
width: 150px;
height: 150px;
border-radius: 10rpx;
}
.title {
@@ -417,6 +441,7 @@ page {
font-size: 28px;
text-align: right;
}
}
}
.code-box {

View File

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

View File

@@ -1,18 +1,22 @@
<script lang="ts" setup>
import Taro from '@tarojs/taro'
import Taro from "@tarojs/taro";
const toPage = (url: string) => {
if (url === '1') return Taro.showToast({title: '暂未开放', icon: 'none'})
if (url === "1") return Taro.showToast({ title: "暂未开放", icon: "none" });
Taro.navigateTo({
url: url
})
}
url: url,
});
};
</script>
<template>
<view class="app">
<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>

View File

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

View File

@@ -1,13 +1,11 @@
<script lang="ts" setup>
import Taro from '@tarojs/taro'
import {ref} from 'vue'
import {applyMer, getMerTypeList, getVerifyCode} from '@/api/user'
import Upload from '@/components/Upload.vue'
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { applyMer, getMerTypeList, getVerifyCode } from "@/api/user";
import Upload from "@/components/Upload.vue";
const visible = ref(false);
const merType = ref(false);
const merGooType = ref(false);
// 验证码按钮文字
@@ -17,13 +15,30 @@ const smsStr = ref("获取验证码");
const smsDisabled = ref(false);
// 表单数据
const formValue = ref<any>({
const formValue = ref<{
name: string;
userName: string;
phone: string;
mobile: string;
code: string;
classId: string;
merGooTypeStr: string;
license: any[];
front: any[];
back: any[];
head_photo: any[];
img: any[];
bank: string;
bank_card: string;
bank_name: string;
bank_user: string;
address: string;
}>({
name: "",
userName: "",
phone: "",
mobile: "",
code: "",
bType: "",
merTypeStr: "",
classId: "",
merGooTypeStr: "",
license: [],
@@ -40,8 +55,6 @@ const formValue = ref<any>({
const merGooList = ref([]);
const merList = ref([]);
// 表单校验
const ruleForm = ref<any>(null);
@@ -53,19 +66,10 @@ Taro.useLoad(() => {
const getMerType = async () => {
try {
const res = await getMerTypeList();
console.log(res);
merList.value = res.data.type.map((item: any) => {
return {
merGooList.value = res.data.class.map((item: any) => ({
text: item.name,
value: item.ID,
};
});
merGooList.value = res.data.class.map((item: any) => {
return {
text: item.name,
value: item.ID,
};
});
}));
} catch (e) {
Taro.showToast({
title: e.msg,
@@ -139,13 +143,6 @@ const getSmsCode = () => {
});
};
// 选择商户类型
const confirmMerType = (e: any) => {
formValue.value.merTypeStr = e.selectedOptions[0].text;
formValue.value.bType = e.selectedOptions[0].value;
merType.value = false;
};
// 选择经营类目
const confirmGooType = (e: any) => {
formValue.value.merGooTypeStr = e.selectedOptions[0].text;
@@ -357,33 +354,6 @@ const submit = () => {
placeholder="请输入银行卡号"
/>
</nut-form-item>
<nut-form-item
required
label="商户类型"
prop="merTypeStr"
:rules="[
{
required: true,
message: '请选择商户类型',
},
]"
>
<input
type="text"
:disabled="true"
v-model="formValue.merTypeStr"
placeholder="请选择商户类型"
@click="merType = true"
/>
<nut-popup position="bottom" v-model:visible="merType">
<nut-picker
:columns="merList"
title="商户类型"
@confirm="confirmMerType"
@cancel="merType = false"
></nut-picker>
</nut-popup>
</nut-form-item>
<nut-form-item
required
label="经营类目"
@@ -402,9 +372,14 @@ const submit = () => {
placeholder="请选择经营类目"
@click="merGooType = true"
/>
<nut-popup position="bottom" v-model:visible="merGooType">
<nut-popup
position="bottom"
v-model:visible="merGooType"
:safe-area-inset-bottom="true"
:catch-move="true"
>
<nut-picker
:columns="merGooList"
v-model:columns="merGooList"
title="商户类型"
@confirm="confirmGooType"
@cancel="merGooType = false"
@@ -489,13 +464,13 @@ const submit = () => {
},
]"
>
<Upload v-model:list="formValue.img" :max="5" multiple/>
<Upload v-model:list="formValue.img" :max="5" multiple />
</nut-form-item>
<view class="btn">
<nut-button block type="primary" round @click="submit()"
>提交</nut-button
>
>提交
</nut-button>
</view>
</nut-form>
<!-- 入驻协议弹窗 -->

View File

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

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import Taro from "@tarojs/taro";
import { ref } from "vue";
import { getPersonalInfo, editPersonalInfo, getPhone } from "@/api/user";
import { getPersonalInfo, editPersonalInfo } from "@/api/user";
import { View } from "@tarojs/components";
import { BASE_URL } from "@/utils/request";
@@ -10,7 +10,7 @@ import { BASE_URL } from "@/utils/request";
const userInfo = ref<any>({});
Taro.useLoad(() => {
const data = Taro.getStorageSync("userInfo");
const { data: data } = Taro.getStorageSync("userInfo");
userInfo.value = data;
});
@@ -50,8 +50,7 @@ const chooseavatar = (e: any) => {
const subUser = async () => {
try {
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}$/;
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}$/;
if (!reg.test(userInfo.value.phone))
return Taro.showToast({
title: "请输入正确的手机号码",
@@ -73,17 +72,17 @@ const subUser = async () => {
}
};
const getUserInfo = async () => {
try {
const res = await getPersonalInfo();
userInfo.value = res.data.data;
} catch (error) {
Taro.showToast({
title: error.msg,
icon: "none",
});
}
};
// const getUserInfo = async () => {
// try {
// const res = await getPersonalInfo();
// userInfo.value = res.data.data;
// } catch (error) {
// Taro.showToast({
// title: error.msg,
// icon: "none",
// });
// }
// };
</script>
<template>
@@ -93,15 +92,9 @@ const getUserInfo = async () => {
<!-- {{ userInfo }} -->
<view class="avatar-card">
<view class="left">
<nut-button
open-type="chooseAvatar"
@chooseavatar="chooseavatar"
>
<nut-button open-type="chooseAvatar" @chooseavatar="chooseavatar">
<nut-avatar size="large">
<img
style="border-radius: 50%"
:src="userInfo.avatarUrl"
/>
<img style="border-radius: 50%" :src="userInfo.avatarUrl" />
</nut-avatar>
</nut-button>
@@ -140,16 +133,13 @@ const getUserInfo = async () => {
/>
</template>
</nut-cell>
<nut-cell title="注销账号" desc="账号注销后不能恢复" is-link>
</nut-cell>
<nut-cell title="注销账号" desc="账号注销后不能恢复" is-link> </nut-cell>
</nut-cell-group>
<view class="btn">
<nut-button block @click="subUser">保存信息</nut-button>
</view>
<view class="btn">
<nut-button block type="primary" @click="logOut"
>退出登录</nut-button
>
<nut-button block type="primary" @click="logOut">退出登录</nut-button>
</view>
</view>
</template>

View File

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

View File

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

BIN
src/static/index/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
src/static/index/poppBg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -7,14 +7,21 @@ export function calculateDistance(
la2: number,
lo2: number
): any {
var radLat1 = la1 * Math.PI / 180.0;
var radLat2 = la2 * Math.PI / 180.0;
var radLat1 = (la1 * Math.PI) / 180.0;
var radLat2 = (la2 * Math.PI) / 180.0;
var a = radLat1 - radLat2;
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 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)
)
);
s = s * 6378.137;
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> {
code: number;
@@ -8,47 +8,38 @@ interface Res<T> {
msg: string;
}
type Method = 'GET' | 'POST' | 'PUT' | 'DELETE';
type Method = "GET" | "POST" | "PUT" | "DELETE";
const request = (
url: string,
data: object = {},
method: Method = 'GET'
method: Method = "GET"
): Promise<Res<any>> => {
return new Promise((resolve, reject) => {
// Taro.showLoading({
// title: '加载中...',
// mask: true
// })
Taro.request({
url: BASE_URL + url,
data: data,
method: method,
header: {
'content-type': 'application/json',
token: Taro.getStorageSync('token') || ''
"content-type": "application/json",
token: Taro.getStorageSync("token") || "",
},
success: ({data}) => {
// Taro.hideLoading()
success: ({ data }) => {
if (data.code !== 200) {
Taro.showToast({
title: data.msg,
icon: 'none'
})
reject(data)
return
icon: "none",
});
reject(data);
} else {
resolve(data);
}
resolve(data)
},
fail: () => {
Taro.showToast({
title: '服务器异常',
icon: 'none'
})
reject({code: 1, msg: '服务器异常'})
}
})
})
}
fail: (err) => {
reject(err);
},
});
});
};
export default request
export default request;

View File

@@ -19,11 +19,10 @@
"allowJs": true,
"resolveJsonModule": true,
"typeRoots": ["node_modules/@types"],
"types": ["@tarojs/components/vue3"],
"paths": {
"@/*": ["src/*"]
}
},
"include": ["./src", "./types", "components.d.ts"],
"include": ["./src", "./types", "./config"],
"compileOnSave": false
}

35
types/global.d.ts vendored
View File

@@ -1,22 +1,31 @@
/// <reference types="@tarojs/taro" />
declare module '*.png';
declare module '*.gif';
declare module '*.jpg';
declare module '*.jpeg';
declare module '*.svg';
declare module '*.css';
declare module '*.less';
declare module '*.scss';
declare module '*.sass';
declare module '*.styl';
declare module "*.png";
declare module "*.gif";
declare module "*.jpg";
declare module "*.jpeg";
declare module "*.svg";
declare module "*.css";
declare module "*.less";
declare module "*.scss";
declare module "*.sass";
declare module "*.styl";
declare namespace NodeJS {
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' {
export * from '@tarojs/components/types/index.vue3'
declare module "@tarojs/components" {
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 {
/** Note: Vue 在 runtime 中将 JSX.IntrinsicElements 通过 index signature 重复声明标签
* 这会导致插件无法正常跳转类型,可以手动覆盖声明标签活得更好的体验,参考如下: