feat(custom): 新增消息订阅
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-08-27 17:06:59 +08:00
parent f199320de0
commit 1d8532eccf
104 changed files with 2350 additions and 2477 deletions

View File

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

View File

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

View File

@@ -133,7 +133,7 @@ const config = {
}, },
}; };
module.exports = function(merge) { module.exports = function (merge) {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev')); return merge({}, config, require('./dev'));
} }

View File

@@ -1,125 +1,125 @@
{ {
"name": "jdt-user", "name": "jdt-user",
"version": "4.0.4", "version": "4.0.4",
"private": true, "private": true,
"description": "", "description": "",
"templateInfo": { "templateInfo": {
"name": "jdt-user", "name": "jdt-user",
"typescript": true, "typescript": true,
"css": "sass" "css": "sass"
}, },
"taroConfig": { "taroConfig": {
"version": "4.0.4" "version": "4.0.4"
}, },
"scripts": { "scripts": {
"build:weapp": "taro build --type weapp", "build:weapp": "taro build --type weapp",
"build:test": "taro build --type weapp --mode test", "build:test": "taro build --type weapp --mode test",
"build:swan": "taro build --type swan", "build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay", "build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt", "build:tt": "taro build --type tt",
"build:h5": "taro build --type h5", "build:h5": "taro build --type h5",
"build:rn": "taro build --type rn", "build:rn": "taro build --type rn",
"build:qq": "taro build --type qq", "build:qq": "taro build --type qq",
"build:jd": "taro build --type jd", "build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp", "build:quickapp": "taro build --type quickapp",
"dev:weapp": "taro build --type weapp --watch", "dev:weapp": "taro build --type weapp --watch",
"dev:swan": "npm run build:swan -- --watch", "dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch", "dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch", "dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch", "dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch", "dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch", "dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch", "dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch", "dev:quickapp": "npm run build:quickapp -- --watch",
"lint": "eslint --ext .ts,.vue .", "lint": "eslint --ext .ts,.vue .",
"lint:fix": "eslint --fix --ext .ts,.vue .", "lint:fix": "eslint --fix --ext .ts,.vue .",
"lint:staged": "lint-staged", "lint:staged": "lint-staged",
"prepare": "husky install", "prepare": "husky install",
"preview": "vite preview", "preview": "vite preview",
"cz": "cz", "cz": "cz",
"lf": "npx prettier --write --end-of-line lf .", "lf": "npx prettier --write --end-of-line lf .",
"postinstall": "weapp-tw patch", "postinstall": "weapp-tw patch",
"build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'", "build:weapp:prod:upload": "taro build --type weapp --upload --robot=1 --desc='正式环境'",
"build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test" "build:weapp:test:upload": "taro build --type weapp --upload --robot=2 --desc='测试环境' --mode test"
}, },
"browserslist": [ "browserslist": [
"last 3 versions", "last 3 versions",
"Android >= 4.1", "Android >= 4.1",
"ios >= 8" "ios >= 8"
], ],
"author": "", "author": "",
"lint-staged": { "lint-staged": {
"*.{ts,vue}": [ "*.{ts,vue}": [
"eslint --ext .ts,.vue .", "eslint --ext .ts,.vue .",
"npx prettier --write --end-of-line lf ." "npx prettier --write --end-of-line lf ."
] ]
}, },
"config": { "config": {
"commitizen": { "commitizen": {
"path": "node_modules/cz-customizable" "path": "node_modules/cz-customizable"
} }
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.23.5", "@babel/runtime": "^7.23.5",
"@nutui/icons-vue-taro": "^0.0.9", "@nutui/icons-vue-taro": "^0.0.9",
"@nutui/nutui-taro": "^4.3.12", "@nutui/nutui-taro": "^4.3.12",
"@qiun/vue-ucharts": "2.5.0-20230101", "@qiun/vue-ucharts": "2.5.0-20230101",
"@tarojs/components": "3.6.34", "@tarojs/components": "3.6.34",
"@tarojs/helper": "3.6.34", "@tarojs/helper": "3.6.34",
"@tarojs/plugin-framework-vue3": "3.6.34", "@tarojs/plugin-framework-vue3": "3.6.34",
"@tarojs/plugin-html": "3.6.34", "@tarojs/plugin-html": "3.6.34",
"@tarojs/plugin-platform-alipay": "3.6.34", "@tarojs/plugin-platform-alipay": "3.6.34",
"@tarojs/plugin-platform-h5": "3.6.34", "@tarojs/plugin-platform-h5": "3.6.34",
"@tarojs/plugin-platform-jd": "3.6.34", "@tarojs/plugin-platform-jd": "3.6.34",
"@tarojs/plugin-platform-qq": "3.6.34", "@tarojs/plugin-platform-qq": "3.6.34",
"@tarojs/plugin-platform-swan": "3.6.34", "@tarojs/plugin-platform-swan": "3.6.34",
"@tarojs/plugin-platform-tt": "3.6.34", "@tarojs/plugin-platform-tt": "3.6.34",
"@tarojs/plugin-platform-weapp": "3.6.34", "@tarojs/plugin-platform-weapp": "3.6.34",
"@tarojs/runtime": "3.6.34", "@tarojs/runtime": "3.6.34",
"@tarojs/shared": "3.6.34", "@tarojs/shared": "3.6.34",
"@tarojs/taro": "3.6.34", "@tarojs/taro": "3.6.34",
"dayjs": "^1.11.10", "dayjs": "^1.11.10",
"pinia": "^2.1.7", "pinia": "^2.1.7",
"uqrcodejs": "^4.0.7", "uqrcodejs": "^4.0.7",
"vue": "^3.3.9" "vue": "^3.3.9"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.23.5", "@babel/core": "^7.23.5",
"@commitlint/cli": "^18.4.3", "@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3", "@commitlint/config-conventional": "^18.4.3",
"@tarojs/cli": "3.6.34", "@tarojs/cli": "3.6.34",
"@tarojs/plugin-mini-ci": "3.6.34", "@tarojs/plugin-mini-ci": "3.6.34",
"@tarojs/taro-loader": "3.6.34", "@tarojs/taro-loader": "3.6.34",
"@tarojs/webpack5-runner": "3.6.34", "@tarojs/webpack5-runner": "3.6.34",
"@types/node": "^18.19.1", "@types/node": "^18.19.1",
"@types/webpack-env": "^1.18.4", "@types/webpack-env": "^1.18.4",
"@typescript-eslint/eslint-plugin": "^6.13.1", "@typescript-eslint/eslint-plugin": "^6.13.1",
"@typescript-eslint/parser": "^6.13.1", "@typescript-eslint/parser": "^6.13.1",
"@unocss/webpack": "^0.60.0", "@unocss/webpack": "^0.60.0",
"@vue/babel-plugin-jsx": "^1.1.5", "@vue/babel-plugin-jsx": "^1.1.5",
"@vue/compiler-sfc": "^3.3.9", "@vue/compiler-sfc": "^3.3.9",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"babel-preset-taro": "3.6.34", "babel-preset-taro": "3.6.34",
"commitizen": "^4.3.0", "commitizen": "^4.3.0",
"css-loader": "3.4.2", "css-loader": "3.4.2",
"cz-customizable": "^7.0.0", "cz-customizable": "^7.0.0",
"eslint": "^8.55.0", "eslint": "^8.55.0",
"eslint-config-taro": "3.6.34", "eslint-config-taro": "3.6.34",
"eslint-plugin-vue": "^9.19.2", "eslint-plugin-vue": "^9.19.2",
"husky": "^8.0.3", "husky": "^8.0.3",
"lint-staged": "^15.1.0", "lint-staged": "^15.1.0",
"miniprogram-ci": "^2.0.8", "miniprogram-ci": "^2.0.8",
"postcss": "8.4.29", "postcss": "8.4.29",
"postcss-rem-to-responsive-pixel": "^6.0.1", "postcss-rem-to-responsive-pixel": "^6.0.1",
"style-loader": "1.3.0", "style-loader": "1.3.0",
"stylelint": "9.3.0", "stylelint": "9.3.0",
"tailwindcss": "^3.4.3", "tailwindcss": "^3.4.3",
"ts-node": "^10.9.1", "ts-node": "^10.9.1",
"typescript": "^4.9.5", "typescript": "^4.9.5",
"unplugin-vue-components": "^0.23.0", "unplugin-vue-components": "^0.23.0",
"vue-loader": "^17.3.1", "vue-loader": "^17.3.1",
"weapp-tailwindcss": "^3.2.0", "weapp-tailwindcss": "^3.2.0",
"webpack": "^5.89.0" "webpack": "^5.89.0"
}, },
"packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0" "packageManager": "pnpm@9.1.4+sha512.9df9cf27c91715646c7d675d1c9c8e41f6fce88246f1318c1aa6a1ed1aeb3c4f032fcdf4ba63cc69c4fe6d634279176b5358727d8f2cc1e65b65f43ce2f8bfb0"
} }

View File

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

View File

@@ -1,9 +1,8 @@
import request from "../utils/request"; import request from '../utils/request';
// 获取二维码信息 // 获取二维码信息
export const getQrCode = (data: object) => export const getQrCode = (data: object) => request('/qrcode/get', data, 'POST');
request("/qrcode/get", data, "POST");
// 绑定二维码 // 绑定二维码
export const bindQrCode = (data: object) => export const bindQrCode = (data: object) =>
request("/qrcode/bind", data, "POST"); request('/qrcode/bind', data, 'POST');

View File

@@ -1,10 +1,10 @@
import request from "../utils/request"; import request from '../utils/request';
// 获取商户分类 // 获取商户分类
export const getHomeList = () => request("/home/classify", {}, "POST"); export const getHomeList = () => request('/home/classify', {}, 'POST');
// 获取商户子列表 // 获取商户子列表
export const getHomeSubList = () => request("/home/all/classify", {}, "POST"); export const getHomeSubList = () => request('/home/all/classify', {}, 'POST');
// 查找商家 // 查找商家
export const getStoreList = (data) => request("/find/store", data, "POST"); export const getStoreList = data => request('/find/store', data, 'POST');

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
@import "./static/iconfont/iconfont.css"; @import './static/iconfont/iconfont.css';
@import 'tailwindcss/base'; @import 'tailwindcss/base';
@import 'tailwindcss/components'; @import 'tailwindcss/components';
@import 'tailwindcss/utilities'; @import 'tailwindcss/utilities';

View File

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

View File

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

View File

@@ -185,8 +185,14 @@ const toPage = async (url: string) => {
}; };
const toMerDetails = item => { const toMerDetails = item => {
Taro.navigateTo({ Taro.requestSubscribeMessage({
url: `/pages/mer/mer_detail/index?bid=${item.bid}`, tmplIds: ['ewjjRxDJAQ_RbKU8CIjMNwfJXazyGQ95XbpKW16vMZs'],
entityIds: [],
complete: () => {
Taro.navigateTo({
url: `/pages/mer/mer_detail/index?bid=${item.bid}`,
});
},
}); });
}; };

View File

@@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import {ref} from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
const show = ref(false); const show = ref(false);
@@ -14,7 +14,7 @@ defineProps({
src: { src: {
required: true, required: true,
type: String, type: String,
default: "", default: '',
}, },
type: Number, type: Number,
cb: { cb: {
@@ -25,7 +25,7 @@ defineProps({
}); });
Taro.useLoad(async () => { Taro.useLoad(async () => {
if (Taro.getStorageSync("token")) show.value = true; if (Taro.getStorageSync('token')) show.value = true;
// const res = await getSignRecord() // const res = await getSignRecord()
// console.log(res) // console.log(res)
}); });
@@ -35,8 +35,7 @@ Taro.useLoad(async () => {
<nut-overlay <nut-overlay
v-model:visible="show" v-model:visible="show"
:lock-scroll="true" :lock-scroll="true"
:close-on-click-overlay="false" :close-on-click-overlay="false">
>
<view class="wrapper"> <view class="wrapper">
<view @click.stop="cb(type)"> <view @click.stop="cb(type)">
<image class="image" :src="src" /> <image class="image" :src="src" />

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -64,4 +64,4 @@ page {
} }
} }
} }
} }

View File

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

View File

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

View File

@@ -3,7 +3,7 @@
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
height: 100vh; height: 100vh;
background-image: url("https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png"); background-image: url('https://cdn-we-retail.ym.tencent.com/miniapp/template/user-center-bg-v1.png');
background-size: auto 40%; background-size: auto 40%;
background-repeat: no-repeat; background-repeat: no-repeat;
@@ -43,4 +43,4 @@
.nut-dialog__content { .nut-dialog__content {
text-align: left !important; text-align: left !important;
font-size: 28px; font-size: 28px;
} }

View File

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

View File

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

View File

@@ -3,7 +3,7 @@
justify-content: center; justify-content: center;
box-sizing: border-box; box-sizing: border-box;
height: 100vh; height: 100vh;
background-image: url("./static/WechatIMG10.jpg"); background-image: url('./static/WechatIMG10.jpg');
background-size: 100% 35%; background-size: 100% 35%;
background-repeat: no-repeat; background-repeat: no-repeat;
@@ -39,7 +39,7 @@
.line { .line {
width: 1px; width: 1px;
height: 188px; height: 188px;
background: #C8C8C8; background: #c8c8c8;
} }
} }
} }

View File

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

View File

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

View File

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

View File

@@ -18,12 +18,12 @@
} }
&::before { &::before {
content: "¥"; content: '¥';
color: #666666; color: #666666;
} }
&::after { &::after {
content: ""; content: '';
position: absolute; position: absolute;
bottom: -1px; bottom: -1px;
width: 700px; width: 700px;
@@ -38,46 +38,46 @@
border-radius: 12px; border-radius: 12px;
margin: 20px auto; margin: 20px auto;
box-sizing: border-box; box-sizing: border-box;
.header { .header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 20px; padding: 20px;
text { text {
margin-right: 10px; margin-right: 10px;
color: #333333; color: #333333;
font-size: 28px; font-size: 28px;
} }
} }
.line { .line {
width: inherit; width: inherit;
height: 1px; height: 1px;
background-color: #e9e9e9; background-color: #e9e9e9;
} }
.goods-list { .goods-list {
display: flex; display: flex;
margin: 20px; margin: 20px;
image { image {
width: 195px; width: 195px;
height: 195px; height: 195px;
border-radius: 12px; border-radius: 12px;
} }
.center { .center {
margin-left: 20px; margin-left: 20px;
.title { .title {
font-weight: bold; font-weight: bold;
text-align: left; text-align: left;
font-size: 30px; font-size: 30px;
} }
} }
.num { .num {
flex: 1; flex: 1;
text-align: right; text-align: right;
@@ -85,7 +85,7 @@
font-size: 26px; font-size: 26px;
} }
} }
.desc { .desc {
padding: 10px 20px; padding: 10px 20px;
color: #666666; color: #666666;
@@ -101,7 +101,7 @@
.btn { .btn {
width: 709px; width: 709px;
height: 92px; height: 92px;
background: #FD0100; background: #fd0100;
color: #ffffff; color: #ffffff;
font-size: 32px; font-size: 32px;
text-align: center; text-align: center;

View File

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

View File

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

View File

@@ -35,4 +35,4 @@ page {
right: 55px; right: 55px;
} }
} }
} }

View File

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

View File

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

View File

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

View File

@@ -62,4 +62,4 @@
color: #999; color: #999;
} }
} }
} }

View File

@@ -34,16 +34,14 @@
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=today`" :url="`/pages/admin/statistics/index?type=price&time=today`">
>
<view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view> <view class="title">{{ orderInfo?.total?.TodayNumber || 0 }}</view>
<view class="sub">今日成交额</view> <view class="sub">今日成交额</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=yesterday`" :url="`/pages/admin/statistics/index?type=price&time=yesterday`">
>
<view class="title">{{ <view class="title">{{
orderInfo?.total?.YesterdayNumber || 0 orderInfo?.total?.YesterdayNumber || 0
}}</view> }}</view>
@@ -52,32 +50,28 @@
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=price&time=month`" :url="`/pages/admin/statistics/index?type=price&time=month`">
>
<view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view> <view class="title">{{ orderInfo?.total?.MonthNumber || 0 }}</view>
<view class="sub">本月成交额</view> <view class="sub">本月成交额</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=today`" :url="`/pages/admin/statistics/index?type=order&time=today`">
>
<view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view> <view class="title">{{ orderInfo?.total?.TodayOrder || 0 }}</view>
<view class="sub">今日订单数</view> <view class="sub">今日订单数</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=yesterday`" :url="`/pages/admin/statistics/index?type=order&time=yesterday`">
>
<view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view> <view class="title">{{ orderInfo?.total?.YesterdayOrder || 0 }}</view>
<view class="sub">昨日订单数</view> <view class="sub">昨日订单数</view>
</navigator> </navigator>
<navigator <navigator
class="item" class="item"
hover-class="none" hover-class="none"
:url="`/pages/admin/statistics/index?type=order&time=month`" :url="`/pages/admin/statistics/index?type=order&time=month`">
>
<view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view> <view class="title">{{ orderInfo?.total?.MonthOrder || 0 }}</view>
<view class="sub">本月订单数</view> <view class="sub">本月订单数</view>
</navigator> </navigator>
@@ -93,8 +87,7 @@
:bordered="true" :bordered="true"
class="table" class="table"
:columns="columns" :columns="columns"
:data="orderInfo?.list" :data="orderInfo?.list"></nut-table>
></nut-table>
</view> </view>
<nut-empty v-else description="暂无订单数据"></nut-empty> <nut-empty v-else description="暂无订单数据"></nut-empty>
</view> </view>
@@ -102,9 +95,9 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { h, ref } from "vue"; import {h, ref} from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { orderStatistics } from "../../../api/admin"; import {orderStatistics} from '../../../api/admin';
Taro.useLoad(() => { Taro.useLoad(() => {
getData(); getData();
@@ -114,35 +107,35 @@ const orderInfo = ref<any>({});
const columns = ref([ const columns = ref([
{ {
title: "日期", title: '日期',
key: "Date", key: 'Date',
align: "center", align: 'center',
}, },
{ {
title: "订单数", title: '订单数',
key: "TotalCount", key: 'TotalCount',
align: "center", align: 'center',
}, },
{ {
title: "交易额", title: '交易额',
key: "NumberSum", key: 'NumberSum',
align: "center", align: 'center',
render: (row) => { render: row => {
return h( return h(
"view", 'view',
{ {
style: { style: {
color: "red", color: 'red',
}, },
}, },
row.NumberSum row.NumberSum,
); );
}, },
}, },
]); ]);
const getData = async () => { const getData = async () => {
const user_info = Taro.getStorageSync("userInfo"); const user_info = Taro.getStorageSync('userInfo');
const res = await orderStatistics({ const res = await orderStatistics({
bid: user_info.data.bid, bid: user_info.data.bid,
}); });

View File

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

View File

@@ -141,4 +141,4 @@
} }
} }
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

@@ -73,7 +73,7 @@ Taro.useLoad(options => {
const goodInfo = ref<any>({}); const goodInfo = ref<any>({});
const getData = async (options: any) => { const getData = async (options: any) => {
const merInfo = Taro.getStorageSync("userInfo"); const merInfo = Taro.getStorageSync('userInfo');
const res = await getActiveVerifyList({ const res = await getActiveVerifyList({
oid: options.oid, oid: options.oid,
bid: merInfo.data.bid, bid: merInfo.data.bid,

View File

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

View File

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

View File

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

View File

@@ -188,16 +188,16 @@ const orderData = ref<any>([]);
const sub = async () => { const sub = async () => {
const arr: any = list.value.filter( const arr: any = list.value.filter(
(item: any) => item.state.checkboxgroup.length > 0, (item: any) => item.state.checkboxgroup.length > 0,
); );
console.log(arr); console.log(arr);
if (arr.length === 0) { if (arr.length === 0) {
Taro.showToast({ Taro.showToast({
title: '请选择商品', title: '请选择商品',
icon: 'none', icon: 'none',
}); });
return; return;
} }
try { try {
const {data: res} = await createActiveOrder({ const {data: res} = await createActiveOrder({
Bid: arr.map((item: any) => item.StoreBid), Bid: arr.map((item: any) => item.StoreBid),

View File

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

View File

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

View File

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

View File

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

View File

@@ -4,8 +4,7 @@
class="head-wrapper" class="head-wrapper"
:style="{ :style="{
top: statusHeight + 'px', top: statusHeight + 'px',
}" }">
>
<view class="head-menu"> <view class="head-menu">
<Left class="iconfont" @click="returns" /> <Left class="iconfont" @click="returns" />
<Home class="iconfont" @click="goHome" /> <Home class="iconfont" @click="goHome" />
@@ -15,31 +14,26 @@
class="swiper" class="swiper"
:pagination-visible="true" :pagination-visible="true"
pagination-color="#426543" pagination-color="#426543"
auto-play="3000" auto-play="3000">
>
<nut-swiper-item> <nut-swiper-item>
<image <image
src="https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg" src="https://storage.360buyimg.com/jdc-article/NutUItaro34.jpg"
alt="" alt="" />
/>
</nut-swiper-item> </nut-swiper-item>
<nut-swiper-item> <nut-swiper-item>
<image <image
src="https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg" src="https://storage.360buyimg.com/jdc-article/NutUItaro2.jpg"
alt="" alt="" />
/>
</nut-swiper-item> </nut-swiper-item>
<nut-swiper-item> <nut-swiper-item>
<image <image
src="https://storage.360buyimg.com/jdc-article/welcomenutui.jpg" src="https://storage.360buyimg.com/jdc-article/welcomenutui.jpg"
alt="" alt="" />
/>
</nut-swiper-item> </nut-swiper-item>
<nut-swiper-item> <nut-swiper-item>
<image <image
src="https://storage.360buyimg.com/jdc-article/fristfabu.jpg" src="https://storage.360buyimg.com/jdc-article/fristfabu.jpg"
alt="" alt="" />
/>
</nut-swiper-item> </nut-swiper-item>
</nut-swiper> </nut-swiper>
<view class="box"> <view class="box">
@@ -53,15 +47,15 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import {ref} from 'vue';
import { import {
useLoad, useLoad,
getSystemInfoSync, getSystemInfoSync,
navigateBack, navigateBack,
switchTab, switchTab,
navigateTo, navigateTo,
} from "@tarojs/taro"; } from '@tarojs/taro';
import { Left, Home } from "@nutui/icons-vue-taro"; import {Left, Home} from '@nutui/icons-vue-taro';
var statusBarHeight = getSystemInfoSync().statusBarHeight as number; var statusBarHeight = getSystemInfoSync().statusBarHeight as number;
console.log(statusBarHeight); console.log(statusBarHeight);
@@ -70,7 +64,7 @@ const statusHeight = ref<number>(statusBarHeight);
// const swiperList = ref([]); // const swiperList = ref([]);
useLoad((options) => { useLoad(options => {
console.log(options); console.log(options);
}); });
@@ -80,13 +74,13 @@ const returns = () => {
const goHome = () => { const goHome = () => {
switchTab({ switchTab({
url: "/pages/index/index", url: '/pages/index/index',
}); });
}; };
const toGame = () => { const toGame = () => {
navigateTo({ navigateTo({
url: "/pages/game/gameview/index", url: '/pages/game/gameview/index',
}); });
}; };
</script> </script>

View File

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

View File

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

View File

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

View File

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

View File

@@ -308,7 +308,7 @@ page {
.line1 { .line1 {
width: 100%; width: 100%;
height: 1px; height: 1px;
background-color: #F0F0F0; background-color: #f0f0f0;
margin: 20px auto; margin: 20px auto;
} }
</style> </style>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,15 +1,15 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import {ref} from 'vue';
import { import {
useLoad, useLoad,
useReachBottom, useReachBottom,
showToast, showToast,
navigateTo, navigateTo,
setStorageSync, setStorageSync,
} from "@tarojs/taro"; } from '@tarojs/taro';
import Pay from "@/components/Pay.vue"; import Pay from '@/components/Pay.vue';
import { getActiveOrderList, deleteActiveOrder } from "@/api/goods"; import {getActiveOrderList, deleteActiveOrder} from '@/api/goods';
import { getOrderStatistics } from "@/api/order"; import {getOrderStatistics} from '@/api/order';
const tabValue = ref(0); const tabValue = ref(0);
@@ -17,27 +17,27 @@ const isShowPay = ref(false);
const tabsList = ref([ const tabsList = ref([
{ {
title: "全部", title: '全部',
value: 0, value: 0,
num: 0, num: 0,
}, },
{ {
title: "待付款", title: '待付款',
value: 1, value: 1,
num: 0, num: 0,
}, },
{ {
title: "待使用", title: '待使用',
value: 2, value: 2,
num: 0, num: 0,
}, },
{ {
title: "已使用", title: '已使用',
value: 3, value: 3,
num: 0, num: 0,
}, },
{ {
title: "已失效", title: '已失效',
value: 4, value: 4,
num: 0, num: 0,
}, },
@@ -60,7 +60,7 @@ interface OrderList {
const orderList = ref<OrderList[]>([]); const orderList = ref<OrderList[]>([]);
useLoad((options) => { useLoad(options => {
console.log(options); console.log(options);
// tabValue.value = Number(options.type); // tabValue.value = Number(options.type);
getList(); getList();
@@ -83,7 +83,7 @@ const getTj = async () => {
} catch (error) { } catch (error) {
showToast({ showToast({
title: error.msg, title: error.msg,
icon: "none", icon: 'none',
}); });
} }
}; };
@@ -98,7 +98,7 @@ const getList = async () => {
} catch (error) { } catch (error) {
showToast({ showToast({
title: error.msg, title: error.msg,
icon: "none", icon: 'none',
}); });
} }
getTj(); getTj();
@@ -110,7 +110,7 @@ const tabChange = (index: number) => {
}; };
useReachBottom(() => { useReachBottom(() => {
console.log("useReachBottom"); console.log('useReachBottom');
}); });
const openPay = (item: OrderList) => { const openPay = (item: OrderList) => {
@@ -121,8 +121,8 @@ const openPay = (item: OrderList) => {
const errPay = () => { const errPay = () => {
isShowPay.value = false; isShowPay.value = false;
showToast({ showToast({
title: "支付失败", title: '支付失败',
icon: "none", icon: 'none',
}); });
jfInfo.value = {}; jfInfo.value = {};
getList(); getList();
@@ -141,15 +141,15 @@ const errPay = () => {
const closePay = () => { const closePay = () => {
isShowPay.value = false; isShowPay.value = false;
showToast({ showToast({
title: "支付取消", title: '支付取消',
icon: "none", icon: 'none',
}); });
jfInfo.value = {}; jfInfo.value = {};
getList(); getList();
}; };
const toDetail = (item: any) => { const toDetail = (item: any) => {
setStorageSync("item", item); setStorageSync('item', item);
navigateTo({ navigateTo({
url: `/pages/users/order_list_detail/index?Id=${item.oid}&type=1`, url: `/pages/users/order_list_detail/index?Id=${item.oid}&type=1`,
}); });
@@ -165,7 +165,7 @@ const delOrder = async (oid: string) => {
} catch (error) { } catch (error) {
showToast({ showToast({
title: error.msg, title: error.msg,
icon: "none", icon: 'none',
}); });
} }
}; };
@@ -186,29 +186,25 @@ const delOrder = async (oid: string) => {
<view <view
v-for="item in tabsList" v-for="item in tabsList"
:key="item.value" :key="item.value"
@click="tabChange(item.value)" @click="tabChange(item.value)">
>
<view class="text">{{ item.title }}</view> <view class="text">{{ item.title }}</view>
<view>{{ item.num }}</view> <view>{{ item.num }}</view>
<view <view class="line" :class="{lineColor: item.value === tabValue}"></view>
class="line"
:class="{ lineColor: item.value === tabValue }"
></view>
</view> </view>
</view> </view>
<view v-if="orderList.length > 0"> <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 class="top">
<view>{{ item.add_time.slice(0, 19).replace("T", " ") }}</view> <view>{{ item.add_time.slice(0, 19).replace('T', ' ') }}</view>
<view style="color: red" <view style="color: red"
>{{ >{{
item.status === 0 item.status === 0
? "待付款" ? '待付款'
: item.status === 1 : item.status === 1
? "待使用" ? '待使用'
: item.status === 2 : item.status === 2
? "已使用" ? '已使用'
: "已失效" : '已失效'
}} }}
</view> </view>
</view> </view>
@@ -264,8 +260,7 @@ const delOrder = async (oid: string) => {
payType="wx" payType="wx"
@errPay="errPay" @errPay="errPay"
@closePay="closePay" @closePay="closePay"
:jfInfo="jfInfo" :jfInfo="jfInfo" />
/>
</view> </view>
</template> </template>

View File

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

View File

@@ -6,8 +6,7 @@
<view @click="hotGoodsDetail"> <view @click="hotGoodsDetail">
<IconFont <IconFont
name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png" name="http://article.biliimg.com/bfs/article/131eda0add8662808d97ffb1191d19bf3e420647.png"
size="40" size="40" />
/>
<view>我的订单</view> <view>我的订单</view>
</view> </view>
</view> </view>
@@ -47,8 +46,7 @@
class="good" class="good"
v-for="item in (merdata as any)" v-for="item in (merdata as any)"
:key="item.ID" :key="item.ID"
@click.stop="toMerDetails(item)" @click.stop="toMerDetails(item)">
>
<image :src="(item.head_photo as string)" /> <image :src="(item.head_photo as string)" />
<view class="good-text-box"> <view class="good-text-box">
<text class="good-text">{{ item.name }}</text> <text class="good-text">{{ item.name }}</text>
@@ -58,7 +56,7 @@
userLocalNum.t, userLocalNum.t,
userLocalNum.l, userLocalNum.l,
Number(item.lat), Number(item.lat),
Number(item.lon) Number(item.lon),
) )
}}</text }}</text
> >
@@ -69,14 +67,14 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import {ref} from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { import {
// getActiveGoods, // getActiveGoods,
getMerList, getMerList,
} from "../../../api/goods"; } from '../../../api/goods';
import { IconFont } from "@nutui/icons-vue-taro"; import {IconFont} from '@nutui/icons-vue-taro';
import { calculateDistance } from "@/utils"; import {calculateDistance} from '@/utils';
// const list = ref<any>([]); // const list = ref<any>([]);
@@ -112,8 +110,8 @@ const userLocalNum = ref({
const get_mer_list = async () => { const get_mer_list = async () => {
Taro.getLocation({ Taro.getLocation({
type: "wgs84", type: 'wgs84',
success: (res) => { success: res => {
userLocalNum.value.l = res.longitude; userLocalNum.value.l = res.longitude;
userLocalNum.value.t = res.latitude; userLocalNum.value.t = res.latitude;
}, },
@@ -129,7 +127,7 @@ const get_mer_list = async () => {
}; };
const toMerDetails = (item: any) => { const toMerDetails = (item: any) => {
Taro.setStorageSync("mer_info", item); Taro.setStorageSync('mer_info', item);
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/mer/mer_detail/index`, url: `/pages/mer/mer_detail/index`,
}); });

View File

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

View File

@@ -41,7 +41,11 @@
<view class="text">{{ item.name }}</view> <view class="text">{{ item.name }}</view>
</view> </view>
</view> </view>
<navigator class="ad" url="/pages/marketing/yq/index" open-type="navigate" hover-class="none"> <navigator
class="ad"
url="/pages/marketing/yq/index"
open-type="navigate"
hover-class="none">
</navigator> </navigator>
<MerList :get-user-location="getUserLocal" /> <MerList :get-user-location="getUserLocal" />
</view> </view>
@@ -87,14 +91,13 @@ const clickSearch = () => {
searchVal.value = ''; searchVal.value = '';
}; };
Taro.useLoad(async () => { Taro.useLoad(() => {
Taro.getPrivacySetting({ Taro.getPrivacySetting({
success: res => { success: res => {
if (res.needAuthorization) { if (res.needAuthorization) {
Taro.requirePrivacyAuthorize({ Taro.requirePrivacyAuthorize({
success: res => { success: () => {
console.log('用户同意授权'); console.log('用户同意授权');
console.log(res);
}, },
fail: () => { fail: () => {
console.log('用户拒绝授权'); console.log('用户拒绝授权');

View File

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

View File

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

View File

@@ -78,8 +78,6 @@ page {
color: #999; color: #999;
text-align: center; text-align: center;
} }
} }
} }
.btn { .btn {

View File

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

View File

@@ -1,19 +1,19 @@
<script lang="ts" setup> <script lang="ts" setup>
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { Ref, ref } from "vue"; import {Ref, ref} from 'vue';
import Upload from "../../../components/Upload.vue"; import Upload from '../../../components/Upload.vue';
import RichEditor from "../../../components/RichEditor.vue"; import RichEditor from '../../../components/RichEditor.vue';
import { addGood } from "@/api/product"; import {addGood} from '@/api/product';
const ruleForm = ref(null) as Ref; const ruleForm = ref(null) as Ref;
const basicData = ref({ const basicData = ref({
name: "", name: '',
class_id: null, class_id: null,
cover: [], cover: [],
rotation: [], rotation: [],
profile: "", profile: '',
details: "", details: '',
stock: null, stock: null,
number: null, number: null,
market_num: null, market_num: null,
@@ -24,20 +24,20 @@ const rules = {
name: [ name: [
{ {
required: true, required: true,
message: "请填写商品名称", message: '请填写商品名称',
}, },
], ],
class_id: [ class_id: [
{ {
required: true, required: true,
message: "请选择商品分类", message: '请选择商品分类',
}, },
], ],
cover: [ cover: [
{ {
required: true, required: true,
message: "请上传商品封面", message: '请上传商品封面',
validator: (value) => { validator: value => {
return value.length > 0; return value.length > 0;
}, },
}, },
@@ -45,8 +45,8 @@ const rules = {
rotation: [ rotation: [
{ {
required: true, required: true,
message: "请上传商品轮播图", message: '请上传商品轮播图',
validator: (value) => { validator: value => {
return value.length > 0; return value.length > 0;
}, },
}, },
@@ -54,32 +54,32 @@ const rules = {
profile: [ profile: [
{ {
required: true, required: true,
message: "请填写商品名称", message: '请填写商品名称',
}, },
], ],
stock: [ stock: [
{ {
required: true, required: true,
message: "请填写商品库存", message: '请填写商品库存',
}, },
], ],
number: [ number: [
{ {
required: true, required: true,
message: "请填写商品价格", message: '请填写商品价格',
}, },
], ],
market_num: [ market_num: [
{ {
required: true, required: true,
message: "请填写商品市场价", message: '请填写商品市场价',
}, },
], ],
}; };
const columnsClass = ref([]); const columnsClass = ref([]);
Taro.useLoad((options) => { Taro.useLoad(options => {
console.log(options); console.log(options);
}); });
@@ -90,11 +90,11 @@ const confirmClass = (val: any) => {
}; };
const ok = async () => { const ok = async () => {
ruleForm.value.validate().then(({ valid, errors }: any) => { ruleForm.value.validate().then(({valid, errors}: any) => {
if (valid) { if (valid) {
console.log("success", basicData.value); console.log('success', basicData.value);
} else { } else {
console.log("error submit!!", errors); console.log('error submit!!', errors);
} }
}); });
}; };
@@ -111,8 +111,7 @@ const ok = async () => {
v-model="basicData.class_id" v-model="basicData.class_id"
disabled disabled
placeholder="请选择商品分类" placeholder="请选择商品分类"
@click="openGoodClass = true" @click="openGoodClass = true" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="商品封面:" required prop="cover"> <nut-form-item label="商品封面:" required prop="cover">
<Upload v-model:list="basicData.cover" /> <Upload v-model:list="basicData.cover" />
@@ -124,20 +123,17 @@ const ok = async () => {
<nut-input <nut-input
v-model="basicData.name" v-model="basicData.name"
placeholder="请输入商品名称" placeholder="请输入商品名称"
type="text" type="text" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="商品价格:" required prop="number"> <nut-form-item label="商品价格:" required prop="number">
<nut-input <nut-input
v-model="basicData.number" v-model="basicData.number"
placeholder="请输入商品价格" placeholder="请输入商品价格" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="市场价格:" required prop="market_num"> <nut-form-item label="市场价格:" required prop="market_num">
<nut-input <nut-input
v-model="basicData.market_num" v-model="basicData.market_num"
placeholder="请输入市场价格" placeholder="请输入市场价格" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="商品库存:" required prop="stock"> <nut-form-item label="商品库存:" required prop="stock">
<nut-input v-model="basicData.stock" placeholder="请输入商品库存" /> <nut-input v-model="basicData.stock" placeholder="请输入商品库存" />
@@ -147,21 +143,18 @@ const ok = async () => {
class="textarea" class="textarea"
v-model="basicData.profile" v-model="basicData.profile"
placeholder="请输入商品简介" placeholder="请输入商品简介"
type="text" type="text" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item label="上架状态:" prop="state"> <nut-form-item label="上架状态:" prop="state">
<nut-switch <nut-switch
v-model="basicData.state" v-model="basicData.state"
:active-value="1" :active-value="1"
:inactive-value="2" :inactive-value="2" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item prop="details"> <nut-form-item prop="details">
<RichEditor <RichEditor
:content="basicData.details" :content="basicData.details"
@input="(val) => (basicData.details = val)" @input="val => (basicData.details = val)" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item prop="ok"> <nut-form-item prop="ok">
<nut-button block type="primary" @click="ok">提交</nut-button> <nut-button block type="primary" @click="ok">提交</nut-button>
@@ -173,13 +166,11 @@ const ok = async () => {
<nut-popup <nut-popup
position="bottom" position="bottom"
v-model:visible="openGoodClass" v-model:visible="openGoodClass"
@close="openGoodClass = false" @close="openGoodClass = false">
>
<nut-picker <nut-picker
:columns="columnsClass" :columns="columnsClass"
title="商品分类" title="商品分类"
@confirm="confirmClass" @confirm="confirmClass"></nut-picker>
></nut-picker>
</nut-popup> </nut-popup>
</view> </view>
</template> </template>

View File

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

File diff suppressed because one or more lines are too long

View File

@@ -138,4 +138,4 @@
background: transparent; background: transparent;
line-height: 1; line-height: 1;
} }
} }

View File

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

View File

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

View File

@@ -5,8 +5,7 @@
class="item" class="item"
v-for="(item, index) in list" v-for="(item, index) in list"
:key="index" :key="index"
@click="clickItem(item)" @click="clickItem(item)">
>
<view class="text"> <view class="text">
<IconFont :name="item.icon" color="red" size="30" /> <IconFont :name="item.icon" color="red" size="30" />
<view>{{ item.label }}</view> <view>{{ item.label }}</view>
@@ -15,7 +14,7 @@
<view style="width: 45%"></view> <view style="width: 45%"></view>
</view> </view>
<!-- 二维码弹窗 --> <!-- 二维码弹窗 -->
<nut-popup :style="{ padding: '30px 50px' }" v-model:visible="show"> <nut-popup :style="{padding: '30px 50px'}" v-model:visible="show">
<view class="popup"> <view class="popup">
<view>推荐人二维码绑定</view> <view>推荐人二维码绑定</view>
<image style="margin-top: 10px" :src="urlCode" /> <image style="margin-top: 10px" :src="urlCode" />
@@ -25,30 +24,30 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import {ref} from 'vue';
import { IconFont } from "@nutui/icons-vue-taro"; import {IconFont} from '@nutui/icons-vue-taro';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { getRefereeCode } from "@/api/user"; import {getRefereeCode} from '@/api/user';
const show = ref(false); const show = ref(false);
const urlCode = ref(""); const urlCode = ref('');
const list = ref([ const list = ref([
{ {
id: 1, id: 1,
icon: "scan", icon: 'scan',
label: "推广名片", label: '推广名片',
}, },
{ {
id: 2, id: 2,
icon: "date", icon: 'date',
label: "积分明细", label: '积分明细',
}, },
{ {
id: 3, id: 3,
icon: "my2", icon: 'my2',
label: "推广用户", label: '推广用户',
}, },
]); ]);
@@ -58,7 +57,7 @@ const clickItem = async (item: any) => {
// "token" // "token"
// )}`; // )}`;
Taro.showLoading({ Taro.showLoading({
title: "加载中", title: '加载中',
mask: true, mask: true,
}); });
const res = await getRefereeCode(); const res = await getRefereeCode();
@@ -67,11 +66,11 @@ const clickItem = async (item: any) => {
Taro.hideLoading(); Taro.hideLoading();
} else if (item.id === 2) { } else if (item.id === 2) {
Taro.navigateTo({ Taro.navigateTo({
url: "/pages/users/distribution/integral/index", url: '/pages/users/distribution/integral/index',
}); });
} else { } else {
Taro.navigateTo({ Taro.navigateTo({
url: "/pages/users/distribution/userlist/index", url: '/pages/users/distribution/userlist/index',
}); });
} }
}; };

View File

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

View File

@@ -4,8 +4,7 @@
<view <view
class="card-list" class="card-list"
v-for="(item, index) in (data as any[])" v-for="(item, index) in (data as any[])"
:key="index" :key="index">
>
<view class="left"> <view class="left">
<view>昵称{{ item.nick_name }}</view> <view>昵称{{ item.nick_name }}</view>
<view>订单号{{ item.oid }}</view> <view>订单号{{ item.oid }}</view>
@@ -21,8 +20,7 @@
v-model="page.PageNum" v-model="page.PageNum"
:total-items="page.ItemCount" :total-items="page.ItemCount"
:items-per-page="page.PageSize" :items-per-page="page.PageSize"
@change="pageChange" @change="pageChange" />
/>
</view> </view>
<view v-else> <view v-else>
<nut-empty description="暂无积分明细" /> <nut-empty description="暂无积分明细" />
@@ -31,9 +29,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { useLoad, showToast } from "@tarojs/taro"; import {useLoad, showToast} from '@tarojs/taro';
import { ref } from "vue"; import {ref} from 'vue';
import { getTGIntegralDetail } from "../../../../api/user"; import {getTGIntegralDetail} from '../../../../api/user';
const data = ref([]); const data = ref([]);
@@ -61,7 +59,7 @@ const getData = async () => {
data.value = res.data.data || []; data.value = res.data.data || [];
page.value.ItemCount = res.data.count; page.value.ItemCount = res.data.count;
} catch (error) { } catch (error) {
showToast({ title: error.msg, icon: "none" }); showToast({title: error.msg, icon: 'none'});
} }
}; };
</script> </script>

View File

@@ -1,3 +1,3 @@
export default definePageConfig({ export default definePageConfig({
navigationBarTitleText: "推广人统计", navigationBarTitleText: '推广人统计',
}); });

View File

@@ -4,8 +4,7 @@
<view <view
class="card-list" class="card-list"
v-for="(item, index) in (data as any[])" v-for="(item, index) in (data as any[])"
:key="index" :key="index">
>
<view class="left"> <view class="left">
<image :src="item.avatarUrl" /> <image :src="item.avatarUrl" />
<view class="text"> <view class="text">
@@ -19,8 +18,7 @@
v-model="page.PageNum" v-model="page.PageNum"
:total-items="page.ItemCount" :total-items="page.ItemCount"
:items-per-page="page.PageSize" :items-per-page="page.PageSize"
@change="pageChange" @change="pageChange" />
/>
</view> </view>
<view v-else> <view v-else>
<nut-empty description="暂无明细"></nut-empty> <nut-empty description="暂无明细"></nut-empty>
@@ -29,9 +27,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import {ref} from 'vue';
import { useLoad, showToast } from "@tarojs/taro"; import {useLoad, showToast} from '@tarojs/taro';
import { getTGUserList } from "../../../../api/user"; import {getTGUserList} from '../../../../api/user';
useLoad(() => { useLoad(() => {
getData(); getData();
@@ -39,7 +37,7 @@ useLoad(() => {
const data = ref([]); const data = ref([]);
const page = ref({ PageNum: 1, PageSize: 10, ItemCount: 0 }); const page = ref({PageNum: 1, PageSize: 10, ItemCount: 0});
const pageChange = (e: number) => { const pageChange = (e: number) => {
page.value.PageNum = e; page.value.PageNum = e;
@@ -55,7 +53,7 @@ const getData = async () => {
data.value = res.data.data || []; data.value = res.data.data || [];
page.value.ItemCount = res.data.count; page.value.ItemCount = res.data.count;
} catch (error) { } catch (error) {
showToast({ title: error.msg, icon: "none" }); showToast({title: error.msg, icon: 'none'});
} }
}; };
</script> </script>

View File

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

View File

@@ -143,24 +143,25 @@ const clickText = (type: number, text: string) => {
type="primary" type="primary"
open-type="getPhoneNumber" open-type="getPhoneNumber"
@getphonenumber="getPhoneNumber" @getphonenumber="getPhoneNumber"
>手机号一键登录</nut-button >手机号一键登录
> </nut-button>
<nut-button style="margin-top: 15px" @click="toPage" <nut-button style="margin-top: 15px" @click="toPage"
>手机号登录/注册</nut-button >手机号登录/注册
> </nut-button>
</view> </view>
<view class="checkbox" <view class="checkbox">
><nut-checkbox v-model="val"></nut-checkbox> <nut-checkbox v-model="val"></nut-checkbox>
<view class="text"> <view class="text">
阅读并同意 阅读并同意
<view style="color: #fa2c1a" @click.stop="clickText(1, '用户协议')"> <view style="color: #fa2c1a" @click.stop="clickText(1, '用户协议')">
用户协议 用户协议
</view> </view>
&<view style="color: #fa2c1a" @click.stop="clickText(2, '隐私政策')"> &
隐私政策 </view <view style="color: #fa2c1a" @click.stop="clickText(2, '隐私政策')">
>&<view 隐私政策
style="color: #fa2c1a" </view>
@click.stop="clickText(3, '积分使用规则')"> &
<view style="color: #fa2c1a" @click.stop="clickText(3, '积分使用规则')">
积分使用规则 积分使用规则
</view> </view>
</view> </view>

View File

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

View File

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

View File

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

View File

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

View File

@@ -74,4 +74,4 @@
color: #333333; color: #333333;
font-size: 32px; font-size: 32px;
} }
} }

View File

@@ -20,8 +20,7 @@
<view class="center"> <view class="center">
<nut-ellipsis <nut-ellipsis
direction="end" direction="end"
:content="itm.Goods.name" :content="itm.Goods.name"></nut-ellipsis>
></nut-ellipsis>
<!-- <view class="title">{{ itm.Goods.name }}</view> --> <!-- <view class="title">{{ itm.Goods.name }}</view> -->
</view> </view>
<view class="num"> <view class="num">
@@ -46,8 +45,7 @@
<nut-cell title="挂帐时间" :desc="data.payment_time"></nut-cell> <nut-cell title="挂帐时间" :desc="data.payment_time"></nut-cell>
<nut-cell <nut-cell
title="订单状态" title="订单状态"
:desc="get_status_text(data.status)" :desc="get_status_text(data.status)"></nut-cell>
></nut-cell>
<nut-cell title="下单数量" :desc="String(data.count)"></nut-cell> <nut-cell title="下单数量" :desc="String(data.count)"></nut-cell>
<nut-cell title="订单金额" :desc="String(data.payments)"></nut-cell> <nut-cell title="订单金额" :desc="String(data.payments)"></nut-cell>
<nut-cell title="应收金额" :desc="String(data.payments)"></nut-cell> <nut-cell title="应收金额" :desc="String(data.payments)"></nut-cell>
@@ -60,9 +58,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import {ref} from 'vue';
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { getUserAfterOrderDetail } from "../../../../api/user"; import {getUserAfterOrderDetail} from '../../../../api/user';
const data = ref<any>({}); const data = ref<any>({});
@@ -75,7 +73,7 @@ Taro.useLoad((e: any) => {
const get_data = async () => { const get_data = async () => {
Taro.showLoading({ Taro.showLoading({
title: "加载中", title: '加载中',
}); });
const res = await getUserAfterOrderDetail({ const res = await getUserAfterOrderDetail({
bid: params.value.bid, bid: params.value.bid,
@@ -88,26 +86,26 @@ const get_data = async () => {
const get_color = (status: number) => { const get_color = (status: number) => {
switch (status) { switch (status) {
case 0: case 0:
return "#FD0100"; return '#FD0100';
case 1: case 1:
return "#03A113"; return '#03A113';
case 2: case 2:
return "#FFA938"; return '#FFA938';
} }
}; };
const get_status_text = (status: number) => { const get_status_text = (status: number) => {
switch (status) { switch (status) {
case 0: case 0:
return "未付款"; return '未付款';
case 1: case 1:
return "已付款"; return '已付款';
case 2: case 2:
return "挂帐中"; return '挂帐中';
} }
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./index.scss"; @import './index.scss';
</style> </style>

View File

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

View File

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

View File

@@ -1,15 +1,15 @@
<script lang="ts" setup> <script lang="ts" setup>
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { ref } from "vue"; import {ref} from 'vue';
import { applyMer, getMerTypeList, getVerifyCode } from "@/api/user"; import {applyMer, getMerTypeList, getVerifyCode} from '@/api/user';
import Upload from "@/components/Upload.vue"; import Upload from '@/components/Upload.vue';
const visible = ref(false); const visible = ref(false);
const merGooType = ref(false); const merGooType = ref(false);
// 验证码按钮文字 // 验证码按钮文字
const smsStr = ref("获取验证码"); const smsStr = ref('获取验证码');
// 验证码按钮是否禁用 // 验证码按钮是否禁用
const smsDisabled = ref(false); const smsDisabled = ref(false);
@@ -34,23 +34,23 @@ const formValue = ref<{
bank_user: string; bank_user: string;
address: string; address: string;
}>({ }>({
name: "", name: '',
userName: "", userName: '',
phone: "", phone: '',
mobile: "", mobile: '',
code: "", code: '',
classId: "", classId: '',
merGooTypeStr: "", merGooTypeStr: '',
license: [], license: [],
front: [], front: [],
back: [], back: [],
head_photo: [], head_photo: [],
img: [], img: [],
bank: "", bank: '',
bank_card: "", bank_card: '',
bank_name: "", bank_name: '',
bank_user: "", bank_user: '',
address: "", address: '',
}); });
const merGooList = ref([]); const merGooList = ref([]);
@@ -73,7 +73,7 @@ const getMerType = async () => {
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
icon: "none", icon: 'none',
}); });
} }
}; };
@@ -87,22 +87,22 @@ const onOk = async () => {
front: formValue.value.front[0]?.url, front: formValue.value.front[0]?.url,
back: formValue.value.back[0]?.url, back: formValue.value.back[0]?.url,
head_photo: formValue.value.head_photo[0]?.url, head_photo: formValue.value.head_photo[0]?.url,
img: formValue.value.img.map((item: any) => item.url).join(","), img: formValue.value.img.map((item: any) => item.url).join(','),
}; };
const res = await applyMer(data); const res = await applyMer(data);
Taro.showToast({ Taro.showToast({
title: res.msg, title: res.msg,
icon: "none", icon: 'none',
}); });
setTimeout(() => { setTimeout(() => {
Taro.switchTab({ Taro.switchTab({
url: "/pages/index/index", url: '/pages/index/index',
}); });
}, 3000); }, 3000);
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.msg, title: e.msg,
icon: "none", icon: 'none',
}); });
} }
visible.value = false; visible.value = false;
@@ -116,7 +116,7 @@ const onOk = async () => {
// 获取验证码 // 获取验证码
const getSmsCode = () => { const getSmsCode = () => {
ruleForm.value.validate("phone").then(async ({ valid }: any) => { ruleForm.value.validate('phone').then(async ({valid}: any) => {
if (valid) { if (valid) {
try { try {
await getVerifyCode({ await getVerifyCode({
@@ -130,13 +130,13 @@ const getSmsCode = () => {
if (time === 0) { if (time === 0) {
clearInterval(timer); clearInterval(timer);
smsDisabled.value = false; smsDisabled.value = false;
smsStr.value = "获取验证码"; smsStr.value = '获取验证码';
} }
}, 1000); }, 1000);
} catch (e) { } catch (e) {
Taro.showToast({ Taro.showToast({
title: e.message, title: e.message,
icon: "none", icon: 'none',
}); });
} }
} }
@@ -152,12 +152,12 @@ const confirmGooType = (e: any) => {
// 提交 // 提交
const submit = () => { const submit = () => {
ruleForm.value.validate().then(({ valid, errors }: any) => { ruleForm.value.validate().then(({valid, errors}: any) => {
if (valid) { if (valid) {
console.log("success", formValue.value); console.log('success', formValue.value);
visible.value = true; visible.value = true;
} else { } else {
console.log("error submit!!", errors); console.log('error submit!!', errors);
} }
}); });
}; };
@@ -175,13 +175,11 @@ const submit = () => {
required: true, required: true,
message: '请输入商户名称', message: '请输入商户名称',
}, },
]" ]">
>
<input <input
type="text" type="text"
v-model="formValue.name" v-model="formValue.name"
placeholder="请输入商户名称" placeholder="请输入商户名称" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -192,13 +190,11 @@ const submit = () => {
required: true, required: true,
message: '请输入用户姓名', message: '请输入用户姓名',
}, },
]" ]">
>
<input <input
type="text" type="text"
v-model="formValue.userName" v-model="formValue.userName"
placeholder="请输入真实姓名" placeholder="请输入真实姓名" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -210,14 +206,12 @@ const submit = () => {
message: '请输入正确的电话号码', message: '请输入正确的电话号码',
regex: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/, regex: /^1(3\d|4[5-9]|5[0-35-9]|6[567]|7[0-8]|8\d|9[0-35-9])\d{8}$/,
}, },
]" ]">
>
<input <input
type="text" type="text"
:maxlength="11" :maxlength="11"
v-model="formValue.phone" v-model="formValue.phone"
placeholder="请输入联系电话" placeholder="请输入联系电话" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
:rules="[ :rules="[
@@ -229,14 +223,12 @@ const submit = () => {
]" ]"
label="店铺号码" label="店铺号码"
prop="phone" prop="phone"
required required>
>
<input <input
v-model="formValue.mobile" v-model="formValue.mobile"
:maxlength="11" :maxlength="11"
placeholder="请输入店铺号码" placeholder="请输入店铺号码"
type="text" type="text" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -247,15 +239,13 @@ const submit = () => {
required: true, required: true,
message: '请输入验证码', message: '请输入验证码',
}, },
]" ]">
>
<view class="yanCode"> <view class="yanCode">
<input <input
type="text" type="text"
:maxlength="6" :maxlength="6"
v-model="formValue.code" v-model="formValue.code"
placeholder="请输入验证码" placeholder="请输入验证码" />
/>
<nut-button <nut-button
style="width: 100px; padding: 3px" style="width: 100px; padding: 3px"
plain plain
@@ -263,8 +253,7 @@ const submit = () => {
size="mini" size="mini"
:disabled="smsDisabled" :disabled="smsDisabled"
round round
@click="getSmsCode" @click="getSmsCode">
>
{{ smsStr }} {{ smsStr }}
</nut-button> </nut-button>
</view> </view>
@@ -278,13 +267,11 @@ const submit = () => {
required: true, required: true,
message: '请输入店铺详细地址', message: '请输入店铺详细地址',
}, },
]" ]">
>
<input <input
type="text" type="text"
v-model="formValue.address" v-model="formValue.address"
placeholder="请输入店铺详细地址" placeholder="请输入店铺详细地址" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -295,13 +282,11 @@ const submit = () => {
required: true, required: true,
message: '请输入法人', message: '请输入法人',
}, },
]" ]">
>
<input <input
type="text" type="text"
v-model="formValue.bank_user" v-model="formValue.bank_user"
placeholder="请输入法人" placeholder="请输入法人" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -312,13 +297,11 @@ const submit = () => {
required: true, required: true,
message: '请输入账户名称', message: '请输入账户名称',
}, },
]" ]">
>
<input <input
type="text" type="text"
v-model="formValue.bank_name" v-model="formValue.bank_name"
placeholder="请输入账户名称" placeholder="请输入账户名称" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -329,13 +312,11 @@ const submit = () => {
required: true, required: true,
message: '请输入银行名称', message: '请输入银行名称',
}, },
]" ]">
>
<input <input
type="text" type="text"
v-model="formValue.bank" v-model="formValue.bank"
placeholder="请输入银行名称" placeholder="请输入银行名称" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -346,13 +327,11 @@ const submit = () => {
required: true, required: true,
message: '请输入银行卡号', message: '请输入银行卡号',
}, },
]" ]">
>
<input <input
type="text" type="text"
v-model="formValue.bank_card" v-model="formValue.bank_card"
placeholder="请输入银行卡号" placeholder="请输入银行卡号" />
/>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
required required
@@ -363,27 +342,23 @@ const submit = () => {
required: true, required: true,
message: '请选择经营类目', message: '请选择经营类目',
}, },
]" ]">
>
<input <input
type="text" type="text"
:disabled="true" :disabled="true"
v-model="formValue.merGooTypeStr" v-model="formValue.merGooTypeStr"
placeholder="请选择经营类目" placeholder="请选择经营类目"
@click="merGooType = true" @click="merGooType = true" />
/>
<nut-popup <nut-popup
position="bottom" position="bottom"
v-model:visible="merGooType" v-model:visible="merGooType"
:safe-area-inset-bottom="true" :safe-area-inset-bottom="true"
:catch-move="true" :catch-move="true">
>
<nut-picker <nut-picker
v-model:columns="merGooList" v-model:columns="merGooList"
title="商户类型" title="商户类型"
@confirm="confirmGooType" @confirm="confirmGooType"
@cancel="merGooType = false" @cancel="merGooType = false"></nut-picker>
></nut-picker>
</nut-popup> </nut-popup>
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
@@ -394,12 +369,11 @@ const submit = () => {
{ {
required: true, required: true,
message: '请上传营业执照', message: '请上传营业执照',
validator: (value) => { validator: value => {
return value.length > 0; return value.length > 0;
}, },
}, },
]" ]">
>
<Upload v-model:list="formValue.license" /> <Upload v-model:list="formValue.license" />
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
@@ -410,12 +384,11 @@ const submit = () => {
{ {
required: true, required: true,
message: '法人身份证(正面)', message: '法人身份证(正面)',
validator: (value) => { validator: value => {
return value.length > 0; return value.length > 0;
}, },
}, },
]" ]">
>
<Upload v-model:list="formValue.front" /> <Upload v-model:list="formValue.front" />
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
@@ -426,12 +399,11 @@ const submit = () => {
{ {
required: true, required: true,
message: '法人身份证(反面)', message: '法人身份证(反面)',
validator: (value) => { validator: value => {
return value.length > 0; return value.length > 0;
}, },
}, },
]" ]">
>
<Upload v-model:list="formValue.back" /> <Upload v-model:list="formValue.back" />
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
@@ -442,12 +414,11 @@ const submit = () => {
{ {
required: true, required: true,
message: '请上传门头照', message: '请上传门头照',
validator: (value) => { validator: value => {
return value.length > 0; return value.length > 0;
}, },
}, },
]" ]">
>
<Upload v-model:list="formValue.head_photo" /> <Upload v-model:list="formValue.head_photo" />
</nut-form-item> </nut-form-item>
<nut-form-item <nut-form-item
@@ -458,12 +429,11 @@ const submit = () => {
{ {
required: true, required: true,
message: '请上传店内照至少3张', message: '请上传店内照至少3张',
validator: (value) => { validator: value => {
return value.length >= 3; return value.length >= 3;
}, },
}, },
]" ]">
>
<Upload v-model:list="formValue.img" :max="5" multiple /> <Upload v-model:list="formValue.img" :max="5" multiple />
</nut-form-item> </nut-form-item>
@@ -479,8 +449,7 @@ const submit = () => {
title="入驻协议" title="入驻协议"
ok-text="已阅读并且同意" ok-text="已阅读并且同意"
v-model:visible="visible" v-model:visible="visible"
@ok="onOk" @ok="onOk">
>
<view>入驻协议</view> <view>入驻协议</view>
</nut-dialog> </nut-dialog>
</view> </view>
@@ -488,7 +457,7 @@ const submit = () => {
<style lang="scss"> <style lang="scss">
page { page {
background-image: url("~@/static/merchantBg.jpg"); background-image: url('~@/static/merchantBg.jpg');
background-size: 100%; background-size: 100%;
background-color: #e93423; background-color: #e93423;
background-repeat: no-repeat; background-repeat: no-repeat;

View File

@@ -3,13 +3,13 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import Taro from "@tarojs/taro"; import Taro from '@tarojs/taro';
import { ref } from "vue"; import {ref} from 'vue';
import { getAgreement } from "../../../api/user"; import {getAgreement} from '../../../api/user';
const nodes = ref(``); const nodes = ref(``);
Taro.useLoad((e) => { Taro.useLoad(e => {
Taro.setNavigationBarTitle({ Taro.setNavigationBarTitle({
title: e.name, title: e.name,
}); });
@@ -19,13 +19,13 @@ Taro.useLoad((e) => {
const get_data = async (type: string) => { const get_data = async (type: string) => {
const res = await getAgreement(); const res = await getAgreement();
switch (type) { switch (type) {
case "1": case '1':
nodes.value = res.data.data.user; nodes.value = res.data.data.user;
break; break;
case "2": case '2':
nodes.value = res.data.data.policy; nodes.value = res.data.data.policy;
break; break;
case "3": case '3':
nodes.value = res.data.data.integral; nodes.value = res.data.data.integral;
break; break;
} }
@@ -33,5 +33,5 @@ const get_data = async (type: string) => {
</script> </script>
<style lang="scss"> <style lang="scss">
@import "./index.scss"; @import './index.scss';
</style> </style>

View File

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

View File

@@ -1,15 +1,15 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 4211210 */ font-family: 'iconfont'; /* Project id 4211210 */
src: url("https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff2?t=1692081500100") src: url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff2?t=1692081500100')
format("woff2"), format('woff2'),
url("https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff?t=1692081500100") url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.woff?t=1692081500100')
format("woff"), format('woff'),
url("https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.ttf?t=1692081500100") url('https://at.alicdn.com/t/c/font_4211210_2x20brbrv94.ttf?t=1692081500100')
format("truetype"); format('truetype');
} }
.iconfont { .iconfont {
font-family: "iconfont" !important; font-family: 'iconfont' !important;
font-size: 16px; font-size: 16px;
font-style: normal; font-style: normal;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
@@ -17,125 +17,125 @@
} }
.icon-H:before { .icon-H:before {
content: "\e609"; content: '\e609';
} }
.icon-indent:before { .icon-indent:before {
content: "\e618"; content: '\e618';
} }
.icon-outdent:before { .icon-outdent:before {
content: "\e620"; content: '\e620';
} }
.icon-image:before { .icon-image:before {
content: "\e63f"; content: '\e63f';
} }
.icon-shanchu:before { .icon-shanchu:before {
content: "\e74b"; content: '\e74b';
} }
.icon-formatheader1:before { .icon-formatheader1:before {
content: "\e860"; content: '\e860';
} }
.icon-zitishangbiao:before { .icon-zitishangbiao:before {
content: "\e65c"; content: '\e65c';
} }
.icon-zitixiabiao:before { .icon-zitixiabiao:before {
content: "\e65d"; content: '\e65d';
} }
.icon-direction-rtl:before { .icon-direction-rtl:before {
content: "\e6de"; content: '\e6de';
} }
.icon-fengexian:before { .icon-fengexian:before {
content: "\e62d"; content: '\e62d';
} }
.icon-clearformat:before { .icon-clearformat:before {
content: "\e60b"; content: '\e60b';
} }
.icon-redo:before { .icon-redo:before {
content: "\e627"; content: '\e627';
} }
.icon-undo:before { .icon-undo:before {
content: "\e633"; content: '\e633';
} }
.icon-font:before { .icon-font:before {
content: "\eae6"; content: '\eae6';
} }
.icon-font-colors:before { .icon-font-colors:before {
content: "\e7f7"; content: '\e7f7';
} }
.icon-font-size:before { .icon-font-size:before {
content: "\e7f8"; content: '\e7f8';
} }
.icon-Character-Spacing:before { .icon-Character-Spacing:before {
content: "\e964"; content: '\e964';
} }
.icon-duanhouju:before { .icon-duanhouju:before {
content: "\e61a"; content: '\e61a';
} }
.icon-duanqianju:before { .icon-duanqianju:before {
content: "\e61b"; content: '\e61b';
} }
.icon-line-height:before { .icon-line-height:before {
content: "\e7c4"; content: '\e7c4';
} }
.icon-juzhongduiqi:before { .icon-juzhongduiqi:before {
content: "\e621"; content: '\e621';
} }
.icon-wuxupailie:before { .icon-wuxupailie:before {
content: "\e63e"; content: '\e63e';
} }
.icon-youduiqi:before { .icon-youduiqi:before {
content: "\e64b"; content: '\e64b';
} }
.icon-youxupailie:before { .icon-youxupailie:before {
content: "\e64c"; content: '\e64c';
} }
.icon-zitijiacu:before { .icon-zitijiacu:before {
content: "\e656"; content: '\e656';
} }
.icon-zitishanchuxian:before { .icon-zitishanchuxian:before {
content: "\e657"; content: '\e657';
} }
.icon-zitixiahuaxian:before { .icon-zitixiahuaxian:before {
content: "\e658"; content: '\e658';
} }
.icon-zitixieti:before { .icon-zitixieti:before {
content: "\e659"; content: '\e659';
} }
.icon-zuoyouduiqi:before { .icon-zuoyouduiqi:before {
content: "\e65a"; content: '\e65a';
} }
.icon-zuoduiqi:before { .icon-zuoduiqi:before {
content: "\e65b"; content: '\e65b';
} }
.icon-fontbgcolor-copy:before { .icon-fontbgcolor-copy:before {
content: "\eae7"; content: '\eae7';
} }

File diff suppressed because it is too large Load Diff

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