蜘蛛云仓dist文件

This commit is contained in:
郭鸿轩 2023-05-12 11:37:23 +08:00
parent 05d1af4837
commit 6f29e82d1d
552 changed files with 0 additions and 72094 deletions

View File

@ -1,8 +0,0 @@
/node_modules
/build
/key
/dist
project.*.json
*.lock
*.log
iconfont/

View File

@ -1,15 +0,0 @@
{
"extends": ["taro/react", "@aaronghx/eslint-config-react"],
"rules": {
"no-console": "off",
"@typescript-eslint/no-shadow": "off",
"@typescript-eslint/no-unused-vars": "off",
"eqeqeq": "off",
"no-prototype-builtins": "off",
"import/first": "off",
"react/no-children-prop": "off",
"import/no-commonjs": "off",
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off"
}
}

8
.gitignore vendored
View File

@ -1,8 +0,0 @@
dist/
build/
deploy_versions/
.temp/
.rn_temp/
node_modules/
.DS_Store
.swc/

View File

@ -1,10 +0,0 @@
{
"printWidth": 160,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true,
"jsxBracketSameLine": true,
"trailingComma": "all"
}

39
.vscode/settings.json vendored
View File

@ -1,39 +0,0 @@
{
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"eslint.validate": ["javascript", "typescript", "javascriptreact", "typescriptreact", "vue", "html", "markdown", "json", "jsonc", "json5"],
// Set the default
"editor.formatOnSave": true,
// Enable per-language
"[javascript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescript]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[typescriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[javascriptreact]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"[css]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[json]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}

View File

@ -1 +0,0 @@
# 阿里图标库 iconfont 使用 Symbol 我们使用了 [taro-iconfont-svg](https://github.com/HongxuanG/taro-iconfont-svg) 这个库

View File

@ -1,13 +0,0 @@
// babel-preset-taro 更多选项和默认值:
// https://github.com/NervJS/taro/blob/next/packages/babel-preset-taro/README.md
module.exports = {
presets: [
[
'taro',
{
framework: 'react',
ts: true,
},
],
],
}

View File

@ -1,51 +0,0 @@
const path = require('path')
module.exports = {
env: {
NODE_ENV: '"development"',
},
defineConstants: {
CURRENT_BASE_URL: '"https://test.zzfzyc.com/lymarket"',
CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://test.zzfzyc.com"',
CURRENT_PAY_H5_CODE_URL: '"https://test.zzfzyc.com/cashier"',
CURRENT_IMG_CND_Prefix: '"https://test.cdn.zzfzyc.com"',
},
mini: {
// optimizeMainPackage: {
// enable: true
// },
webpackChain: (chain, webpack) => {
chain.merge({
plugin: {
install: {
plugin: require('terser-webpack-plugin'),
args: [
{
terserOptions: {
compress: false, // 默认使用terser压缩
// compress: {
// drop_console: true, // 去掉打印
// }, // 默认使用terser压缩
// mangle: false,
keep_classnames: true, // 不改变class名称
keep_fnames: true, // 不改变函数名称
},
},
],
},
},
})
},
},
h5: {},
alias: {
'@': path.resolve(__dirname, '..', 'src'),
},
sass: {
resource: [path.resolve(__dirname, '..', 'src/styles/common.scss'), path.resolve(__dirname, '..', 'src/styles/iconfont.scss')],
},
// plugins: [
// '@tarojs/plugin-react-devtools'
// ],
}

View File

@ -1,139 +0,0 @@
const path = require('path')
const childProcess = require('child_process')
const versions
= childProcess.execSync('git rev-parse --abbrev-ref HEAD', {
encoding: 'utf8',
}) != 'HEAD\n'
? childProcess.execSync('git rev-parse --abbrev-ref HEAD', {
encoding: 'utf8',
})
: childProcess.execSync('git describe --tags --abbrev=0', {
encoding: 'utf8',
})
const CURRENT_GITHASH = childProcess.execSync('git rev-parse --short HEAD', {
encoding: 'utf8',
})
const CURRENT_VERSION = `Version: ${JSON.stringify(process.env.CODE_BRANCH || versions)} ${CURRENT_GITHASH} ${new Date().toLocaleString()}`.replace(
/\"|\\n/g,
'',
)
const config = {
appid: 'wx64fe67f111d52457', // 测试/体验环境
projectName: 'SpiderSteward',
date: '2022-4-6',
designWidth: 750,
deviceRatio: {
640: 2.34 / 2,
750: 1,
828: 1.81 / 2,
},
sourceRoot: 'src',
outputRoot: 'dist',
defineConstants: {
CURRENT_VERSION: JSON.stringify(CURRENT_VERSION),
CURRENT_GITHASH: JSON.stringify(CURRENT_GITHASH),
CURRENT_ENV: JSON.stringify(process.env.NODE_ENV),
},
copy: {
patterns: [],
options: {},
},
framework: 'react',
mini: {
postcss: {
pxtransform: {
enable: true,
config: {
onePxTransform: false,
},
},
url: {
enable: true,
config: {
limit: 1024, // 设定转换尺寸上限
},
},
cssModules: {
enable: true, // 默认为 false如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
},
enableSourceMap: true, // 默认值watch 模式下为 true否则为 false。 用于控制是否生成 js、css 对应的 sourceMap。
},
h5: {
router: {
mode: 'hash',
},
// 设置代理服务器转发
// devServer: {
// proxy: {
// '/mp/': {
// target: Domain,
// pathRewrite: {
// '^/mp/': '' // 所以带有/api/请求的链接一律替换为空并追加域名请求
// },
// changeOrigin: true
// }
// }
// }
// },
output: {
filename: 'js/[name].[hash].js',
chunkFilename: 'js/[name].[chunkhash].js',
},
imageUrlLoaderOption: {
limit: 5000,
name: 'static/images/[name].[hash].[ext]',
},
miniCssExtractPluginOption: {
filename: 'css/[name].[hash].css',
chunkFilename: 'css/[name].[chunkhash].css',
},
devServer: {
https: true,
},
publicPath: '/',
staticDirectory: 'static',
postcss: {
autoprefixer: {
enable: true,
config: {},
},
cssModules: {
enable: true, // 默认为 false如需使用 css modules 功能,则设为 true
config: {
namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]',
},
},
},
},
compiler: {
type: 'webpack5',
// 依赖预编译配置
prebundle: {
enable: false,
timings: true,
},
},
// 持久化缓存配置
cache: {
enable: true,
},
plugins: [['@tarojs/plugin-framework-react', { reactMode: 'concurrent' }]],
}
module.exports = function(merge) {
if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev'))
}
if (process.env.NODE_ENV === 'pre') {
return merge({}, config, require('./pre'))
}
return merge({}, config, require('./prod'))
}

View File

@ -1,47 +0,0 @@
const path = require('path')
module.exports = {
env: {
NODE_ENV: '"pre"',
},
defineConstants: {
CURRENT_BASE_URL: '"https://pre.zzfzyc.com/lymarket"',
CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://pre.zzfzyc.com"',
CURRENT_PAY_H5_CODE_URL: '"https://pre.zzfzyc.com/cashier"',
CURRENT_IMG_CND_Prefix: '"https://test.cdn.zzfzyc.com"',
},
mini: {
optimizeMainPackage: {
enable: true,
},
webpackChain: (chain, webpack) => {
chain.merge({
plugin: {
install: {
plugin: require('terser-webpack-plugin'),
args: [
{
terserOptions: {
// compress: true, // 默认使用terser压缩
compress: {
drop_console: false, // 去掉打印
}, // 默认使用terser压缩
// mangle: false,
keep_classnames: true, // 不改变class名称
keep_fnames: true, // 不改变函数名称
},
},
],
},
},
})
},
},
h5: {},
alias: {
'@': path.resolve(__dirname, '..', 'src'),
},
sass: {
resource: [path.resolve(__dirname, '..', 'src/styles/common.scss')],
},
}

View File

@ -1,56 +0,0 @@
const path = require('path')
module.exports = {
env: {
NODE_ENV: '"production"',
},
defineConstants: {
CURRENT_BASE_URL: '"https://www.zzfzyc.com/lymarket"',
CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: '"https://www.zzfzyc.com"',
CURRENT_PAY_H5_CODE_URL: '"https://www.zzfzyc.com/cashier"',
CURRENT_IMG_CND_Prefix: '"https://cdn.zzfzyc.com"',
},
mini: {
optimizeMainPackage: {
enable: false,
},
webpackChain: (chain, webpack) => {
chain.merge({
plugin: {
install: {
plugin: require('terser-webpack-plugin'),
args: [
{
terserOptions: {
// compress: true, // 默认使用terser压缩
compress: {
drop_console: false, // 去掉打印
}, // 默认使用terser压缩
// mangle: false,
keep_classnames: true, // 不改变class名称
keep_fnames: true, // 不改变函数名称
},
},
],
},
},
})
},
},
h5: {
/**
* 如果h5端编译后体积过大可以使用webpack-bundle-analyzer插件对打包体积进行分析
* 参考代码如下
* webpackChain (chain) {
* chain.plugin('analyzer')
* .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [])
* }
*/
},
alias: {
'@': path.resolve(__dirname, '..', 'src'),
},
sass: {
resource: path.resolve(__dirname, '..', 'src/styles/common.scss'),
},
}

26
global.d.ts vendored
View File

@ -1,26 +0,0 @@
/// <reference types="@tarojs/taro" />
declare module '*.png'
declare module '*.gif'
declare module '*.jpg'
declare module '*.jpeg'
declare module '*.svg'
declare module '*.css'
declare module '*.less'
declare module '*.scss'
declare module '*.sass'
declare module '*.styl'
declare namespace NodeJS {
interface ProcessEnv {
TARO_ENV: 'weapp' | 'swan' | 'alipay' | 'h5' | 'rn' | 'tt' | 'quickapp' | 'qq' | 'jd'
}
}
declare const CURRENT_VERSION: string
declare const CURRENT_GITHASH: string
declare const CURRENT_ENV: string
declare const CURRENT_BASE_URL: string
declare const CURRENT_CAP_HTML_TO_IMAGE_BASE_URL: string
declare const CURRENT_PAY_H5_CODE_URL: string
declare const CURRENT_IMG_CND_Prefix: string

View File

@ -1,8 +0,0 @@
{
"symbol_url": "http://at.alicdn.com/t/c/font_3619513_vf4qkipwb0s.js",
"parse_local_svg": true,
"local_svg_dir": "./src/styles/svg",
"save_dir": "./src/components/iconfont",
"trim_icon_prefix": "",
"default_icon_size": 36
}

View File

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA7MJYN3Kid2crMZu9ujUQF3ReSHT/PzZfEi65nxjp73Wn30jy
BcB0hkoFTDSr11U5/YIsH60T3UGJFpFsVU4K9acMlR//+/FlNJnHxCBpsLV6SvQH
IKzvjxHyNyB4eEUKiIod7AcnB2y7ppOKh1i6RemunfApCgHrJciFMn9ngzdSTihc
91WEVjqbSX5vOBnXH8O5+Gv8hzC8Oy9xEBhuJTkgIv5R6vtWIo87YlgaQagDq9cd
3GT//Jo6UCvp2PeVVnNCS40cG8QYS26dFDq/p4ZWcrcq67epliB3yDTMEgMEdSoA
gLEvdGcEPE9HG3A5eQwbwMI8A5pftEAgpo+ciQIDAQABAoIBAQCW0LnHIFPTwbln
EXFLM0/70NnaSATsLGNlPrRpX0JtkkIMXvgkp9LSVEaJo6evNJALJ6eZyfO0ZnHA
GYSr1lnu36mJOOgkgkHYvvjcu1T4BrJPGqGLs/2p4mGrshhrbHdoQKsM1gWLmjzy
wFtnGiMWM+RSoVBTGqPC3rfSUgwLLbGsI/qsxuSJ6bA6lay2/r/is0nupjtnjvlt
PkIo5r9gpGFRCyiW0qh3XsFzL2sVp2scuFEGAj1dodscR9sUrnsdmPTctqs5sY8M
EEN7FghkX8MQYUKHjsUeL4Qe8cUWyqD+L1y29HvgLOqdbw2oqu8RhVPQUsJ7I50y
H017wf1xAoGBAPfwIk1/2QPjRrCmTA2mM9TAyBRfumcxHi9BUsi4UIzZvgZpp1pY
i5i3w/YYawnuVZb1M7d0eo7ak4Gl7KrRkvVl2ulAQHcJesn4vCVNLRjVw3k8Jz8V
/3hzp+wwUL5Y6bdWPnusdkP5tyhqw7eYz171t9T+frqhysrIZrl5MRfFAoGBAPR1
KAinx6ZPbw/jh7I/MnQmm9u+dGJGXZo9FCOZQr+wKRITFlxXmlUNsBTpkmqQ71xb
qjCeXJ1YwSv5QRVpohtykO/1g7+5zORMzV3MrGLg5PsZugmetLX57Vrxpe832LZc
wsVq1D5jbDjXbY4mj/R0mOfacHlOfnHgpIcWtTn1AoGAbjkMFuYCRS8xyvBzGRJN
MoTtrdkM1jlI0Ps6YU9HSAa46sLnikuY67CuZmZel5Cj7jNd5W3b2kwjjVyFRT9c
FMpOMqnEvuaw9r8kbXTM2qCVgP0T+YC/DP5lpaOpEaYXaNDngDWgcgG+wjIMhj9h
2TZlnkPxdOjebZ3/xO6yu30CgYATN6KOC6KGUHhKp3hjatRsjRxzieVcVGvHVEXh
BotYxmB0K0v2tmxLg2f0POhluD8Y45vddpWRSQjmjBGxvTwhLEB4nLRevhx9VgxO
82gZ3dQiaUNWvkM2iw89twF0bM98ho5JNry4qtg3H7hdFGr8rK3YjDOLVcBa8237
sK1OgQKBgQDZ3YdqxlEhp6mG+HqQVe7vh+t1hUyLqcLt6T+DpRFP3BYBRSd/Ftom
qXUn6NcZWjzkvY5npG7+c/XFuqYc18BDh0egADDh0dqdl8tBzXVGNYuXSyT/oQOd
WAWvYvyvXvuOBqf5Ov4OVXiGtrzcxBuAFWTudaKOTh4APyFrOSHSfw==
-----END RSA PRIVATE KEY-----

View File

@ -1,91 +0,0 @@
{
"name": "wechat-lymarket",
"version": "1.0.0",
"private": true,
"description": "重构内部商城小程序",
"templateInfo": {
"name": "default",
"typescript": true,
"css": "sass"
},
"author": "",
"scripts": {
"build:weapp": "taro build --type weapp",
"build:swan": "taro build --type swan",
"build:alipay": "taro build --type alipay",
"build:tt": "taro build --type tt",
"build:h5": "taro build --type h5",
"build:rn": "taro build --type rn",
"build:qq": "taro build --type qq",
"build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp",
"dev:weapp": "npm run build:weapp -- --watch",
"dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch",
"dev:h5": "npm run build:h5 -- --watch",
"dev:rn": "npm run build:rn -- --watch",
"dev:qq": "npm run build:qq -- --watch",
"dev:jd": "npm run build:jd -- --watch",
"dev:quickapp": "npm run build:quickapp -- --watch",
"build:weapp:pre": "cross-env NODE_ENV=pre taro build --type weapp",
"dev:weapp:pre": "cross-env NODE_ENV=pre npm run build:weapp -- --watch",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"iconfont:update": "npx iconfont-taro",
"iconfont:init": "npx iconfont-init"
},
"browserslist": [
"last 3 versions",
"Android >= 4.1",
"ios >= 8"
],
"dependencies": {
"@babel/runtime": "^7.20.6",
"@tarojs/cli": "3.6.6",
"@tarojs/components": "3.6.6",
"@tarojs/helper": "3.6.6",
"@tarojs/plugin-framework-react": "3.6.6",
"@tarojs/react": "3.6.6",
"@tarojs/router": "3.6.6",
"@tarojs/runtime": "3.6.6",
"@tarojs/shared": "3.6.6",
"@tarojs/taro": "3.6.6",
"@tarojs/taro-h5": "3.6.6",
"big.js": "^6.2.1",
"dayjs": "^1.11.6",
"immer": "^9.0.16",
"lodash": "^4.17.10",
"qs": "^6.10.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-redux": "^8.0.5",
"redux": "^4.2.0",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.4.2"
},
"devDependencies": {
"@aaronghx/eslint-config-react": "^0.1.11",
"@babel/core": "^7.20.5",
"@pmmmwh/react-refresh-webpack-plugin": "0.5.10",
"@tarojs/plugin-platform-weapp": "3.6.6",
"@tarojs/plugin-react-devtools": "3.6.6",
"@tarojs/webpack5-runner": "3.6.6",
"@types/node": "^18.11.10",
"@types/qs": "^6.9.7",
"@types/react": "^18.0.25",
"@types/webpack-env": "^1.13.6",
"babel-preset-taro": "3.6.6",
"classnames": "^2.3.2",
"cross-env": "^7.0.3",
"eslint": "^8.28.0",
"eslint-config-taro": "3.6.6",
"prettier": "^2.8.0",
"react-refresh": "0.14.0",
"stylelint": "14.15.0",
"taro-iconfont-svg": "^1.1.1",
"terser-webpack-plugin": "^5.3.6",
"typescript": "^4.9.3",
"webpack": "^5.75.0"
}
}

View File

@ -1,50 +0,0 @@
{
"miniprogramRoot": "dist/",
"projectname": "Mall-lymarket",
"description": "项目配置文件详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"appid": "wx64fe67f111d52457",
"setting": {
"urlCheck": false,
"es6": true,
"postcss": false,
"minified": false,
"coverView": true,
"lazyloadPlaceholderEnable": false,
"preloadBackgroundData": false,
"autoAudits": false,
"uglifyFileName": false,
"uploadWithSourceMap": true,
"enhance": true,
"useMultiFrameRuntime": true,
"showShadowRootInWxmlPanel": true,
"packNpmManually": false,
"packNpmRelationList": [],
"minifyWXSS": false,
"useStaticServer": true,
"showES6CompileOption": false,
"checkInvalidKey": true,
"compileHotReLoad": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"disableUseStrict": false,
"useCompilerPlugins": false,
"minifyWXML": false,
"condition": false,
"ignoreUploadUnusedFiles": false
},
"compileType": "miniprogram",
"libVersion": "2.24.5",
"srcMiniprogramRoot": "dist/",
"packOptions": {
"ignore": [],
"include": []
},
"condition": {},
"editorSetting": {
"tabIndent": "insertSpaces",
"tabSize": 2
}
}

View File

@ -1,342 +0,0 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"condition": {
"miniprogram": {
"list": [
{
"name": "",
"pathName": "pages/getColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/sampleCutting/addSampleCutting/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/colorCardDetail/index",
"query": "id=2",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/sampleCutting/sampleCuttingDetail/index",
"query": "id=1",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/sampleCutting/sampleCuttingList/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/login/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/addColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/colorCardList/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/addColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/sampleCutting/addSampleCutting/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/addColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/sampleCutting/sampleCuttingDetail/index",
"query": "id=45",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/addColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/sampleCutting/addSampleCutting/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/addColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/submitOrder/index",
"query": "purchaser_id=1860&sale_mode=2&shopping_cart_product_color_list=%5B75384%2C75385%5D&purchaser_name=%E5%A4%A7%E5%90%89%E5%A4%A7%E5%88%A9",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/submitOrder/index",
"query": "purchaser_id=1808&sale_mode=0&shopping_cart_product_color_list=%5B71143%2C71159%2C71160%5D&purchaser_name=%E6%B8%B8%E5%AE%A2_65d59b5",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderDetails/index",
"query": "id=34311",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/submitOrder/index",
"query": "purchaser_id=1873&sale_mode=0&shopping_cart_product_color_list=%5B75484%2C75485%5D&purchaser_name=%E5%AD%9C%E7%84%B6%E7%83%A4%E9%B1%BF%E9%B1%BC",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/submitOrder/index",
"query": "purchaser_id=1861&sale_mode=0&shopping_cart_product_color_list=%5B75615%5D&purchaser_name=%E5%93%88%E5%96%BD",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderDetails/index",
"query": "id=36955",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/refundDetail/index",
"query": "id=907",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/refundDetail/index",
"query": "id=1059",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/getColorCard/colorCardDetail/index",
"query": "id=180",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/refundDetail/index",
"query": "id=902",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/refundMoneyDetail/index",
"query": "id=835",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/collectionDetail/index",
"query": "id=9622",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderWarningAnalysis/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderWarningAnalysis/orderWarningAnalysisDetail/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderDetails/index",
"query": "id=34514",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderWarningAnalysis/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderWarningAnalysis/orderWarningAnalysisDetail/index",
"query": "sale_order_no=XS-IT-2304270017",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/delivery/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderWarningAnalysis/orderWarningAnalysisDetail/index",
"query": "sale_order_no=XS-IT-2304270012",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/deliveryDetail/index",
"query": "id=28127&order_no=FH-IT-2303310002",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderWarningAnalysis/orderWarningAnalysisDetail/index",
"query": "sale_order_no=XS-IT-2304270018",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/orderDetails/index",
"query": "id=36796",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/refundPage/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/newCollection/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/index/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/login/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/login/index",
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/deliveryDetail/index",
"query": "id=28215",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/takeDeliveryDetail/index",
"query": "id=40320",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/takeDelivery/index",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
},
"projectname": "spider_cloud_warehouse",
"setting": {
"compileHotReLoad": true
}
}

View File

@ -1,9 +0,0 @@
{
"miniprogramRoot": "./",
"projectname": "EShop",
"appid": "touristappid",
"setting": {
"es6": false,
"minified": false
}
}

View File

@ -1,48 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
*/
export const GetAddressListApi = () => {
return useRequest({
url: '/v2/mp/district/list',
method: 'get',
})
}
// 获取客户地址
export const MpPurchaserAddressList = () => {
return useRequest({
url: '/v2/mp/purchaser/address/list',
method: 'get',
})
}
// 新增客户地址
export const MpPurchaserAddress = () => {
return useRequest({
url: '/v2/mp/purchaser/address',
method: 'post',
})
}
// 获取编辑地址信息
export const MpPurchaserAddressGet = () => {
return useRequest({
url: '/v2/mp/purchaser/address',
method: 'get',
})
}
// 编辑收货地址信息
export const MpPurchaserAddressPut = () => {
return useRequest({
url: '/v2/mp/purchaser/address',
method: 'put',
})
}
// 删除收货地址信息
export const MpPurchaserAddressDelete = () => {
return useRequest({
url: '/v2/mp/purchaser/address',
method: 'delete',
})
}

View File

@ -1,12 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
* cdn /
* @returns
*/
export const GetSignApi = () => {
return useRequest({
url: '/v2/mp/cdn/token',
method: 'get',
})
}

View File

@ -1,78 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const GetColorCardOrderList = () => {
return useRequest({
url: '/v1/mp/colorCardOrder/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const GetColorCardOrderDetail = () => {
return useRequest({
url: '/v1/mp/colorCardOrder',
method: 'get',
})
}
/**
*
* @returns
*/
export const SubmitColorCardOrder = () => {
return useRequest({
url: '/v1/mp/colorCardOrder/submit',
method: 'post',
})
}
/**
*
* @returns
*/
export const GetCanAddCardList = () => {
return useRequest({
url: '/v1/mp/colorCardOrder/canAddCard',
method: 'post',
})
}
/**
*
* @returns
*/
export const CancelColorCardOrder = () => {
return useRequest({
url: '/v1/mp/colorCardOrder/cancel',
method: 'post',
})
}
/**
*
* @returns
*/
export const RefuseColorCardOrder = () => {
return useRequest({
url: '/v1/mp/colorCardOrder/auditRefuse',
method: 'put',
})
}
/**
*
* @returns
*/
export const AuditPassColorCardOrder = () => {
return useRequest({
url: '/v1/mp/colorCardOrder/auditPass',
method: 'put',
})
}

View File

@ -1,13 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const EnumColorCardStatus = () => {
return useRequest({
url: '/v1/mp/colorCardOrder/enum/auditStatus',
method: 'get',
})
}

View File

@ -1,12 +0,0 @@
export {
GetColorCardOrderList,
GetColorCardOrderDetail,
SubmitColorCardOrder,
GetCanAddCardList,
CancelColorCardOrder,
RefuseColorCardOrder,
AuditPassColorCardOrder,
} from './colorCardOrder'
export {
EnumColorCardStatus,
} from './enum'

View File

@ -1,45 +0,0 @@
import { useRequest } from '@/use/useHttp'
// 获取客户信息
export const MpPurchaser = () => {
return useRequest({
url: '/v2/mp/purchaser',
method: 'get',
})
}
// 新建客户
export const MpPurchaserPost = () => {
return useRequest({
url: '/v2/mp/purchaser',
method: 'post',
})
}
// 编辑客户
export const MpPurchaserPut = () => {
return useRequest({
url: '/v2/mp/purchaser',
method: 'put',
})
}
// 获取标签列表
export const MpPurchaserList = () => {
return useRequest({
url: '/v2/mp/purchaser/label/list',
method: 'get',
})
}
// 保存标签
export const MpPurchaserLabelAdd = () => {
return useRequest({
url: '/v2/mp/purchaser/label/add',
method: 'post',
})
}
// [枚举] 平台来源
export const EnumSourcePlatform = () => {
return useRequest({
url: '/v1/mp/enum/sourcePlatform',
method: 'get',
})
}

View File

@ -1,59 +0,0 @@
import { useRequest } from '@/use/useHttp'
// 列表
export const DeliverNoticeOrderList = () => {
return useRequest({
url: '/v2/mp/deliveryNoticeOrder/list',
method: 'get',
})
}
// 发货详情
export const DeliverNoticeOrder = () => {
return useRequest({
url: '/v2/mp/deliveryNoticeOrder',
method: 'get',
})
}
// 发货附件上传
export const DeliveryNoticeOrderUpload = () => {
return useRequest({
url: '/v2/mp/deliveryNoticeOrder/upload',
method: 'put',
})
}
// 审核发货单
export const DeliveryNoticeOrderAudit = () => {
return useRequest({
url: '/v2/mp/deliveryNoticeOrder/audit',
method: 'put',
})
}
// 采购退货的拒收接口
export const DeliveryNoticeOrderRejection = () => {
return useRequest({
url: '/v2/mp/deliveryNoticeOrder/rejection',
method: 'put',
})
}
// 类型枚举
export const EnumDeliveryNoticeTypeList = () => {
return useRequest({
url: '/v2/mp/enum/deliveryNoticeType/list',
method: 'get',
})
}
// tabs枚举
export const EnumSaleorderStatus = () => {
return useRequest({
url: '/v2/mp/enum/sale/order/status',
method: 'get',
})
}
// 扫描出仓码类型
export const TakeOutOfStorage = () => {
return useRequest({
url: '/v1/mp/deliveryNoticeOrder/outbound',
method: 'put',
})
}

View File

@ -1,97 +0,0 @@
// 关于登录
import { useRequest } from '@/use/useHttp'
export { LoginApi } from './login/index'
export {
ProductAbsorbContrast,
SelectProductListApi,
ColorListApi,
ColorDetailedApi,
ColorSamplingSaveApi,
TextureSaveApi,
FindColorListApi,
} from './product/index'
// 关于购物页面
export { ShoppingCartDeleteApi, ShoppingCartListApi } from './shopping/index'
// 关于发货列表
export {
DeliverNoticeOrderList,
DeliverNoticeOrder,
DeliveryNoticeOrderUpload,
DeliveryNoticeOrderAudit,
DeliveryNoticeOrderRejection,
EnumDeliveryNoticeTypeList,
EnumSaleorderStatus,
} from './delivery/index'
// 关于提货列表
export {
EnumTakeGoodsOrderStatus,
EnumTakeGoodsOrderTypeList,
TakeGoodsOrderList,
TakeGoodsOrderRefuse,
TakeGoodsOrderAudit,
TakeGoodsOrder,
} from './takeDelivery/index'
// 关于销售统计
export {
EnumMarketingDepartmentApi,
EnumSalesTypeApi,
SalesmanRankApi,
ProductRankApi,
PurchaserRankApi,
SupplierRankApi,
SaleOrderDataFormdataFormStatus,
SaleOrderDataFormApi,
} from './statistic/index'
// 邀请码
export {
GetInvitationInfo,
GenBarCodeOrQrCode,
GetInvitationList,
} from './inviteCode/index'
/**
*
* @returns
*/
export const KindListApi = () => {
return useRequest({
url: '/v2/mp/product/kind/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const ProductListApi = () => {
return useRequest({
url: '/v2/mp/product/list',
method: 'get',
})
}
/**
*
*/
export const GetClassList = () => {
return useRequest({
url: '/v2/mp/product/kind/sub/list',
method: 'get',
})
}
/**
* id
*/
export const SubscriptionMessageApi = () => {
return useRequest({
url: '/v1/mp/subscriptionMessage',
method: 'get',
})
}

View File

@ -1,26 +0,0 @@
import { CAP_HTML_TO_IMAGE_BASE_URL } from '@/common/constant'
import { useRequest } from '@/use/useHttp'
// 邀请码
export const GetInvitationInfo = () => {
return useRequest({
url: '/v1/mp/user/invitationInfoRecord',
method: 'get',
})
}
// 获取邀请进度
export const GetInvitationList = () => {
return useRequest({
url: '/v2/mp/user/inviterList',
method: 'get',
pagination: true,
})
}
// 生成二维码
export const GenBarCodeOrQrCode = () => {
return useRequest({
url: '/xima-caphtml/genBarcodeOrQrCode',
base_url: CAP_HTML_TO_IMAGE_BASE_URL,
method: 'post',
})
}

View File

@ -1 +0,0 @@
export { LoginApi } from './login'

View File

@ -1,23 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const LoginApi = () => {
return useRequest({
url: '/v2/mp/login',
method: 'post',
})
}
/**
*
* @returns
*/
export const MpuserwechatBinding = () => {
return useRequest({
url: '/v1/mp/user/wechatBinding',
method: 'post',
})
}

View File

@ -1,37 +0,0 @@
import { useRequest } from '@/use/useHttp'
// 收款单列表
export const MpCashManagementOrderList = () => {
return useRequest({
url: '/v2/mp/cashManagementOrder/list',
method: 'get',
})
}
// 收款单详情
export const MpCashManagementOrder = () => {
return useRequest({
url: '/v2/mp/cashManagementOrder',
method: 'get',
})
}
// 收款账号
export const MpCashManagementOrderAccount = () => {
return useRequest({
url: '/v2/mp/cashManagementOrder/account',
method: 'get',
})
}
// 新建收款单
export const MpCashManagementOrderPost = () => {
return useRequest({
url: '/v2/mp/cashManagementOrder',
method: 'post',
})
}
// 扫描获取应收单的客户信息
export const MpShouldCollectOrderPurchaser = () => {
return useRequest({
url: '/v2/mp/shouldCollectOrder/purchaser',
method: 'get',
})
}

View File

@ -1,266 +0,0 @@
import { useRequest } from '@/use/useHttp'
import { CAP_HTML_TO_IMAGE_BASE_URL } from '@/common/constant'
export const MpEnumSaleOrderStatus = () => {
return useRequest({
url: '/v2/mp/enum/filterMPSaleOrderStatus',
method: 'get',
})
}
/**
*
* @returns
*/
export const OrderListApi = () => {
return useRequest({
url: '/v2/mp/saleOrder/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const ClientListApi = () => {
return useRequest({
url: '/v2/mp/purchaser/list',
method: 'get',
})
}
// 面料种类列表
export const MpProductColorList = () => {
return useRequest({
url: '/v2/mp/product/color/list',
method: 'get',
})
}
// 购物车提交
export const MpSaleOrderPreview = () => {
return useRequest({
url: '/v2/mp/saleOrder/preView',
method: 'put',
})
}
// 业务员枚举
export const MpEnumSaleUserList = () => {
return useRequest({
url: '/v2/mp/enum/saleUser/list',
method: 'get',
})
}
// 订单详情
export const MpSaleOrder = () => {
return useRequest({
url: '/v2/mp/saleOrder',
method: 'get',
})
}
// 取消订单
export const MpSaleOrderCancel = () => {
return useRequest({
url: '/v2/mp/saleOrder/cancel',
method: 'put',
})
}
// 再次购买
export const MpShoppingCartProductColorList = () => {
return useRequest({
url: '/v2/mp/shoppingCart/productColor/list',
method: 'post',
})
}
// 获取账期付款
export const OrderPaymentOrderPaymentMethodInfo = () => {
return useRequest({
url: '/v2/mp/orderPayment/orderPaymentMethodInfo',
method: 'get',
})
}
// 预收单获取接口信息
export const OrderPaymentPreCollectOrderOrderPaymentMethodInfo = () => {
return useRequest({
url: '/v2/mp/orderPayment/preCollectOrder/orderPaymentMethodInfo',
method: 'get',
})
}
// 确认交易
export const OrderPaymentOrderPaymentSubmission = () => {
return useRequest({
url: '/v2/mp/orderPayment/orderPaymentSubmission',
method: 'put',
})
}
// 订单预支付提交
export const OrderPaymentPreCollectOrderOrderPaymentSubmission = () => {
return useRequest({
url: '/v2/mp/orderPayment/preCollectOrder/orderPaymentSubmission',
method: 'put',
})
}
/**
* 线
*/
export const GetPayCode = () => {
return useRequest({
url: '/xima-caphtml/caphtml',
base_url: CAP_HTML_TO_IMAGE_BASE_URL,
method: 'post',
})
}
/**
* 退
*/
export const GetReturnPayCode = () => {
return useRequest({
url: '/xima-caphtml/caphtml-return',
base_url: CAP_HTML_TO_IMAGE_BASE_URL,
method: 'post',
})
}
// 编辑备注信息
export const MpSaleOrderPut = () => {
return useRequest({
url: '/v2/mp/saleOrder',
method: 'put',
})
}
// 修改销售单的收货地址
export const MpSaleOrderAddress = () => {
return useRequest({
url: '/v2/mp/saleOrder/address',
method: 'put',
})
}
// 关键字搜索历史
export const MpSearchHistoryList = () => {
return useRequest({
url: '/v2/mp/searchHistory/list',
method: 'get',
})
}
// 关键字搜索历史
export const DeleteSearchHistoryList = () => {
return useRequest({
url: '/v1/mp/searchHistory/delete',
method: 'delete',
})
}
// 添加关键字搜索
export const MpSearchHistory = () => {
return useRequest({
url: '/v2/mp/searchHistory',
method: 'post',
})
}
// 确认收货
export const MpSaleOrderReceive = () => {
return useRequest({
url: '/v2/mp/saleOrder/receive',
method: 'put',
})
}
// 退货原因
export const MpEnumReturnOrderReturnReason = () => {
return useRequest({
url: '/v2/mp/enum/returnOrder/returnReason',
method: 'get',
})
}
// 二次选择退货原因
export const MpEnumReturnExplain = () => {
return useRequest({
url: '/v2/mp/enum/returnExplain',
method: 'get',
})
}
// 货物状况
export const MpEnumReturnGoodsStatus = () => {
return useRequest({
url: '/v2/mp/enum/return/goodsStatus',
method: 'get',
})
}
// 申请退货
export const MpReturnApplyOrder = () => {
return useRequest({
url: '/v2/mp/returnApplyOrder',
method: 'put',
})
}
// 退款说明
export const MpEnumRefundExplainOne = () => {
return useRequest({
url: '/v2/mp/enum/refundExplain',
method: 'get',
})
}
// 提交订单
export const MpSaleOrderPost = () => {
return useRequest({
url: '/v2/mp/saleOrder',
method: 'post',
})
}
// 修改销售单物流方式
export const MpSaleOrderShipmentMode = () => {
return useRequest({
url: '/v2/mp/saleOrder/shipmentMode',
method: 'put',
})
}
// 修改销售单物流方式
export const EnumPurchaserType = () => {
return useRequest({
url: '/v2/mp/enum/purchaserType',
method: 'get',
})
}
// 订单修改添加面料
export const MpsaleOrderaddProductList = () => {
return useRequest({
url: '/v2/mp/saleOrder/addProductList',
method: 'post',
})
}
// 提交修改订单
export const MpsaleOrdersubmit = () => {
return useRequest({
url: '/v2/mp/saleOrder/submit',
method: 'put',
})
}
// 通过调价销售单审核
export const PassAdjustPriceAudit = () => {
return useRequest({
url: '/v2/mp/saleOrder/passAdjustPriceAudit',
method: 'put',
})
}
// 拒绝调价销售单审核
export const RefuseAdjustPriceAudit = () => {
return useRequest({
url: '/v2/mp/saleOrder/refuseAdjustPriceAudit',
method: 'put',
})
}
// 立即下单(预览)
export const SaleOrderPreViewBuyNow = () => {
return useRequest({
url: '/v2/mp/saleOrder/preView/atOnce',
method: 'put',
})
}
// 立即下单(提交订单)
export const SaleOrderSubmitBuyNow = () => {
return useRequest({
url: '/v2/mp/saleOrder/atOnce',
method: 'post',
})
}

View File

@ -1,12 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const GetOrderEarlyWarningListApi = () => {
return useRequest({
url: '/v1/mp/orderEarlyWarning/list',
method: 'get',
})
}

View File

@ -1,12 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const FindColorListApi = () => {
return useRequest({
url: '/v2/mp/product/color/absorb/match',
method: 'get',
pagination: true,
})
}

View File

@ -1,3 +0,0 @@
export { ProductAbsorbContrast, SelectProductListApi } from './product'
export { ColorListApi, ColorDetailedApi, ColorSamplingSaveApi, TextureSaveApi } from './takeColor'
export { FindColorListApi } from './findColor'

View File

@ -1,20 +0,0 @@
import { useRequest } from '@/use/useHttp'
// 取色对比
export const ProductAbsorbContrast = () => {
return useRequest({
url: '/v2/mp/product/color/absorb/contrast',
method: 'get',
})
}
/**
* ()
* @returns
*/
export const SelectProductListApi = () => {
return useRequest({
url: '/v2/mp/enum/product/list',
method: 'get',
})
}

View File

@ -1,45 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const ColorListApi = () => {
return useRequest({
url: '/v2/mp/product/color/absorb/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const ColorDetailedApi = () => {
return useRequest({
url: '/v2/mp/product/texture',
method: 'get',
})
}
/**
*
* @returns
*/
export const ColorSamplingSaveApi = () => {
return useRequest({
url: '/v2/mp/product/color/absorb',
method: 'put',
})
}
/**
*
* @returns
*/
export const TextureSaveApi = () => {
return useRequest({
url: '/v2/mp/product/texture',
method: 'put',
})
}

View File

@ -1,65 +0,0 @@
import { useRequest } from '@/use/useHttp'
// 售后订单列表
export const MpReturnApplyOrderList = () => {
return useRequest({
url: '/v2/mp/returnApplyOrder/list',
method: 'get',
})
}
// 售后状态枚举
export const MpEnumReturnStage = () => {
return useRequest({
url: '/v2/mp/enum/returnStage',
method: 'get',
})
}
// 退款类型枚举
export const MpEnumReturnType = () => {
return useRequest({
url: '/v2/mp/enum/returnType',
method: 'get',
})
}
// 售后详情
export const MpReturnApplyOrder = () => {
return useRequest({
url: '/v2/mp/returnApplyOrder',
method: 'get',
})
}
// 取消退货
export const ReturnApplyOrderCancel = () => {
return useRequest({
url: '/v2/mp/returnApplyOrder/cancel',
method: 'post',
})
}
// 售后确认上传附件
export const ReturnApplyOrderUploadAccessory = () => {
return useRequest({
url: '/v2/mp/returnApplyOrder/uploadAccessory',
method: 'put',
})
}
// 售后审批
export const AuditReturnApplyOrder = () => {
return useRequest({
url: '/v1/mp/returnApplyOrder/audit',
method: 'put',
})
}
// 售后拒绝
export const RefuseReturnApplyOrder = () => {
return useRequest({
url: '/v1/mp/returnApplyOrder/refuse',
method: 'put',
})
}
// 获取仓库列表
export const GetWarehouseList = () => {
return useRequest({
url: '/v1/mp/enum/warehouse/return/list',
method: 'get',
})
}

View File

@ -1,13 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const EnumCutSampleOrderStatus = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/audit_status',
method: 'get',
})
}

View File

@ -1,13 +0,0 @@
export {
GetCutSampleOrderList,
GetCutSampleOrderProducts,
SubmitCutSampleOrder,
GetCutSampleOrderDetail,
CancelCutSampleOrder,
GetCutSampleOrderColorList,
AuditPassCutSampleOrder,
RefuseCutSampleOOrder,
} from './sampleCutting'
export {
EnumCutSampleOrderStatus,
} from './enum'

View File

@ -1,89 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const GetCutSampleOrderList = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const GetCutSampleOrderProducts = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/products',
method: 'get',
})
}
/**
*
* @returns
*/
export const SubmitCutSampleOrder = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/submit',
method: 'post',
})
}
/**
*
* @returns
*/
export const GetCutSampleOrderDetail = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/detail',
method: 'get',
})
}
/**
*
* @returns
*/
export const CancelCutSampleOrder = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/cancel',
method: 'put',
})
}
/**
*
* @returns
*/
export const GetCutSampleOrderColorList = () => {
return useRequest({
url: '/v1/mp/product/color/absorb/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const AuditPassCutSampleOrder = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/audit',
method: 'put',
})
}
/**
*
* @returns
*/
export const RefuseCutSampleOOrder = () => {
return useRequest({
url: '/v1/mp/cutSampleOrder/refuse',
method: 'put',
})
}

View File

@ -1,8 +0,0 @@
import { useRequest } from '@/use/useHttp'
// 搜索商品
export const MpProductList = () => {
return useRequest({
url: '/v2/mp/product/list',
method: 'get',
})
}

View File

@ -1,41 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
// export const ShoppingCartUpdateApi = () => {
// return useRequest({
// url: `/v2/mp/shoppingCart/productColor`,
// method: 'put',
// })
// }
/**
*
* @returns
*/
export const ShoppingCartDeleteApi = () => {
return useRequest({
url: '/v2/mp/shoppingCart/productColor',
method: 'delete',
})
}
/**
*
* @returns
*/
export const ShoppingCartListApi = () => {
return useRequest({
url: '/v2/mp/shoppingCart/productColor',
method: 'get',
})
}
/**
*
* @returns
*/
export const AdjestShoppingCartApi = () => {
return useRequest({
url: '/v2/mp/shoppingCart/productColor',
method: 'put',
})
}

View File

@ -1,23 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const EnumSalesTypeApi = () => {
return useRequest({
url: '/v2/mp/enum/saleType',
method: 'get',
})
}
/**
*
* @returns
*/
export const EnumMarketingDepartmentApi = () => {
return useRequest({
url: '/v2/mp/enum/saleDepartment/list',
method: 'get',
})
}

View File

@ -1,2 +0,0 @@
export { EnumSalesTypeApi, EnumMarketingDepartmentApi } from './enum'
export { SaleOrderDataFormdataFormStatus, SaleOrderDataFormApi, ProductRankApi, PurchaserRankApi, SupplierRankApi, SalesmanRankApi } from './saleStatistic'

View File

@ -1,64 +0,0 @@
import { useRequest } from '@/use/useHttp'
/**
*
* @returns
*/
export const SaleOrderDataFormApi = () => {
return useRequest({
url: '/v2/mp/saleOrderDataForm',
method: 'get',
})
}
/**
*
* @returns
*/
export const ProductRankApi = () => {
return useRequest({
url: '/v2/mp/saleOrderDataForm/product/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const PurchaserRankApi = () => {
return useRequest({
url: '/v2/mp/saleOrderDataForm/purchaser/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const SupplierRankApi = () => {
return useRequest({
url: '/v2/mp/saleOrderDataForm/supplier/list',
method: 'get',
})
}
/**
*
* @returns
*/
export const SalesmanRankApi = () => {
return useRequest({
url: '/v2/mp/saleOrderDataForm/saleUser/list',
method: 'get',
})
}
// 获取排行指标枚举
export const SaleOrderDataFormdataFormStatus = () => {
return useRequest({
url: '/v2/mp/saleOrderDataForm/dataFormStatus',
method: 'get',
})
}

View File

@ -1,15 +0,0 @@
import { useRequest } from '@/use/useHttp'
// 提货类型
export const EnumTakeGoodsOrderTypeList = () => {
return useRequest({
url: '/v2/mp/enum/takeGoodsOrderType/list',
method: 'get',
})
}
// tabs枚举
export const EnumTakeGoodsOrderStatus = () => {
return useRequest({
url: '/v2/mp/enum/takeGoodsOrderStatus/list',
method: 'get',
})
}

View File

@ -1,2 +0,0 @@
export { EnumTakeGoodsOrderStatus, EnumTakeGoodsOrderTypeList } from './enum'
export { TakeGoodsOrderList, TakeGoodsOrderRefuse, TakeGoodsOrderAudit, TakeGoodsOrder } from './takeDelivery'

View File

@ -1,30 +0,0 @@
import { useRequest } from '@/use/useHttp'
import { CAP_HTML_TO_IMAGE_BASE_URL } from '@/common/constant'
// 列表
export const TakeGoodsOrderList = () => {
return useRequest({
url: '/v2/mp/takeGoodsOrder/list',
method: 'get',
})
}
// 拒收提货
export const TakeGoodsOrderRefuse = () => {
return useRequest({
url: '/v2/mp/takeGoodsOrder/refuse',
method: 'put',
})
}
// 审核提货单
export const TakeGoodsOrderAudit = () => {
return useRequest({
url: '/v2/mp/takeGoodsOrder/audit',
method: 'put',
})
}
// 详情
export const TakeGoodsOrder = () => {
return useRequest({
url: '/v2/mp/takeGoodsOrder',
method: 'get',
})
}

View File

@ -1,172 +0,0 @@
export default defineAppConfig({
pages: ['pages/index/index', 'pages/order/index', 'pages/shopping/index', 'pages/user/index', 'pages/login/index'],
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
navigationBarTitleText: 'WeChat',
navigationBarTextStyle: 'black',
backgroundColor: '#ffffff',
},
tabBar: {
custom: true,
list: [
{
pagePath: 'pages/index/index',
text: '首页',
},
{
pagePath: 'pages/shopping/index',
text: '购物',
},
{
pagePath: 'pages/order/index',
text: '订单',
},
{
pagePath: 'pages/user/index',
text: '我的',
},
],
color: '#707070',
selectedColor: '#2680EB',
backgroundColor: '#fff',
borderStyle: 'white',
},
usingComponents: {
'custom-wrapper': '/custom-wrapper',
},
subPackages: [
{
root: 'pages/orderWarningAnalysis',
pages: ['index', 'orderWarningAnalysisDetail/index'],
},
{
root: 'pages/wareHousePage',
pages: ['index'],
},
{
root: 'pages/clauseDetail',
pages: ['index'],
},
{
root: 'pages/sampleCutting',
pages: ['index', 'addSampleCutting/index', 'sampleCuttingList/index', 'sampleCuttingDetail/index'],
},
{
root: 'pages/getColorCard',
pages: ['index', 'addColorCard/index', 'colorCardList/index', 'colorCardDetail/index'],
},
{
root: 'pages/inviteCode',
pages: ['index'],
},
{
root: 'pages/saleStatistic',
pages: ['index'],
},
{
root: 'pages/takeDelivery',
pages: ['index'],
},
{
root: 'pages/takeDeliveryDetail',
pages: ['index'],
},
{
root: 'pages/delivery',
pages: ['index'],
},
{
root: 'pages/deliveryDetail',
pages: ['index'],
},
{
root: 'pages/colorRelated',
pages: ['sampleComparison/index', 'takeColor/index', 'findColor/index'],
},
{
root: 'pages/addAddress',
pages: ['index'],
},
{
root: 'pages/addressManager',
pages: ['index'],
},
{
root: 'pages/customerPage',
pages: ['index'],
},
{
root: 'pages/orderDetails',
pages: ['index'],
},
{
root: 'pages/saleuserPage',
pages: ['index'],
},
{
root: 'pages/searchPage',
pages: ['index'],
},
{
root: 'pages/submitOrder',
pages: ['index'],
},
{
root: 'pages/refundPage',
pages: ['index'],
},
{
root: 'pages/refundDetail',
pages: ['index'],
},
{
root: 'pages/refundMoneyDetail',
pages: ['index'],
},
{
root: 'pages/applyGoods',
pages: ['index'],
},
{
root: 'pages/applyMoney',
pages: ['index'],
},
{
root: 'pages/newCollection',
pages: ['index'],
},
{
root: 'pages/addCollection',
pages: ['index'],
},
{
root: 'pages/accountPage',
pages: ['index'],
},
{
root: 'pages/collectionDetail',
pages: ['index'],
},
{
root: 'pages/customerManagement',
pages: ['index'],
},
{
root: 'pages/customerDetails',
pages: ['index'],
},
{
root: 'pages/customerEditor',
pages: ['index'],
},
{
root: 'pages/orderEdit',
pages: ['index'],
},
{
root: 'pages/addFabric',
pages: ['index'],
},
],
})

View File

@ -1,16 +0,0 @@
@import './styles/common.scss';
@import './styles/iconfont.scss';
/**
由于Cover-view标签并不支持iconfont 所以需要把 .ttf 转成 base64 之后得到的 stylesheet.css 文件覆盖掉 iconfont.css 里的 @font-face 即可
[转换工具](https://transfonter.org/)
[教程](https://blog.csdn.net/VoidLuffy/article/details/123530341)
[相关说明](https://developers.weixin.qq.com/community/develop/doc/000a60f7d58a982f08d7ddfc456000)
*/
// 总高度 - 自定义tabbar高度 - apple小黑条高度
page {
height: calc(100% - #{$customTabBarHeight} - constant(safe-area-inset-bottom));
height: calc(100% - #{$customTabBarHeight} - env(safe-area-inset-bottom));
background-color: #f7f7f7;
}

View File

@ -1,56 +0,0 @@
import Taro, { onAppShow } from '@tarojs/taro'
import type { FC } from 'react'
import { Provider } from 'react-redux'
import configStore from './store'
import { shareShop } from './common/util'
import ContextBlueTooth from '@/use/contextBlueTooth'
import './app.scss'
interface ParamsType {
children?: React.ReactNode
}
const store = configStore()
const App: FC<ParamsType> = (params) => {
const { children } = params
if (process.env.TARO_ENV === 'weapp') {
Taro.showShareMenu({
withShareTicket: true,
})
// 分享
shareShop()
// 检查版本更新
onAppShow(() => {
const updateManager = Taro.getUpdateManager()
updateManager.onCheckForUpdate((res) => {
// 请求完新版本信息的回调
console.log('版本信息:', res.hasUpdate)
})
updateManager.onUpdateReady(() => {
Taro.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
},
})
})
updateManager.onUpdateFailed(() => {
console.log('新版本更新失败')
})
})
}
return (
<ContextBlueTooth>
<Provider store={store}>{children}</Provider>
</ContextBlueTooth>
)
}
export default App

View File

@ -1,35 +0,0 @@
// 订单类型
// 0 大货 1 剪板 2 散剪
export const enum EnumSaleMode {
Bulk = 0,
Plate = 1,
BulkCut = 2,
}
// 订单类型
export const selectList = {
0: { value: 0, title: '大货', unit: '条', eunit: 'kg', step: 1, digits: 0, minNum: 1, maxNum: 100000, defaultNum: 1 },
1: {
value: 1,
title: '剪板',
unit: '米',
eunit: 'm',
step: 1,
digits: 2,
minNum: 0.3,
maxNum: 100000,
defaultNum: 0.3,
},
2: {
value: 2,
title: '散剪',
unit: '米',
eunit: 'kg',
step: 1,
digits: 2,
minNum: 6,
maxNum: 100000,
defaultNum: 6,
},
}

View File

@ -1 +0,0 @@
export { EnumSaleMode } from './BaseEnum/index'

View File

@ -1,76 +0,0 @@
module.exports = function(lab1, lab2) {
const rgb2labArray1 = lab1
const rgb2labArray2 = lab2
const l1 = rgb2labArray1[0]
const a1 = rgb2labArray1[1]
const b1 = rgb2labArray1[2]
const l2 = rgb2labArray2[0]
const a2 = rgb2labArray2[1]
const b2 = rgb2labArray2[2]
const avg_lp = (l1 + l2) / 2
const c1 = Math.sqrt(Math.pow(a1, 2) + Math.pow(b1, 2))
const c2 = Math.sqrt(Math.pow(a2, 2) + Math.pow(b2, 2))
const avg_c = (c1 + c2) / 2
const g = (1 - Math.sqrt(Math.pow(avg_c, 7) / (Math.pow(avg_c, 7) + Math.pow(25, 7)))) / 2
const a1p = a1 * (1 + g)
const a2p = a2 * (1 + g)
const c1p = Math.sqrt(Math.pow(a1p, 2) + Math.pow(b1, 2))
const c2p = Math.sqrt(Math.pow(a2p, 2) + Math.pow(b2, 2))
const avg_cp = (c1p + c2p) / 2
let h1p = rad2deg(Math.atan2(b1, a1p))
if (h1p < 0) {
h1p = h1p + 360
}
let h2p = rad2deg(Math.atan2(b2, a2p))
if (h2p < 0) {
h2p = h2p + 360
}
const avg_hp = Math.abs(h1p - h2p) > 180 ? (h1p + h2p + 360) / 2 : (h1p + h1p) / 2
const t = 1 - 0.17 * Math.cos(deg2rad(avg_hp - 30)) + 0.24 * Math.cos(deg2rad(2 * avg_hp)) + 0.32 * Math.cos(deg2rad(3 * avg_hp + 6)) - 0.2 * Math.cos(deg2rad(4 * avg_hp - 63))
let delta_hp = h2p - h1p
if (Math.abs(delta_hp) > 180) {
if (h2p <= h1p) {
delta_hp += 360
}
else {
delta_hp -= 360
}
}
const delta_lp = l2 - l1
const delta_cp = c2p - c1p
delta_hp = 2 * Math.sqrt(c1p * c2p) * Math.sin(deg2rad(delta_hp) / 2)
const s_l = 1 + ((0.015 * Math.pow(avg_lp - 50, 2)) / Math.sqrt(20 + Math.pow(avg_lp - 50, 2)))
const s_c = 1 + 0.045 * avg_cp
const s_h = 1 + 0.015 * avg_cp * t
const delta_ro = 30 * Math.exp(-(Math.pow((avg_hp - 275) / 25, 2)))
const r_c = 2 * Math.sqrt(Math.pow(avg_cp, 7) / (Math.pow(avg_cp, 7) + Math.pow(25, 7)))
const r_t = -r_c * Math.sin(2 * deg2rad(delta_ro))
const kl = 1; const kc = 1; const kh = 1
const delta_e = Math.sqrt(Math.pow(delta_lp / (kl * s_l), 2) + Math.pow(delta_cp / (kc * s_c), 2) + Math.pow(delta_hp / (kh * s_h), 2) + r_t * (delta_cp / (kc * s_c)) * (delta_hp / (kh * s_h)))
return delta_e
function rad2deg(rad) {
return 360 * rad / (2 * Math.PI)
}
function deg2rad(deg) {
return (2 * Math.PI * deg) / 360
}
}

View File

@ -1,13 +0,0 @@
import LabCom from './lab'
import XyzCom from './xyz'
import ColorDiff from './colorDiff'
export const toRgb = (lab) => {
const xyz = LabCom.xyz(lab)
return XyzCom.rgb(xyz)
}
export const Ediff = (lab1, lab2) => {
return ColorDiff(lab1, lab2)
}

View File

@ -1,55 +0,0 @@
/* eslint-disable import/no-commonjs */
const xyz = require('./xyz')
module.exports = {
name: 'lab',
min: [0, -100, -100],
max: [100, 100, 100],
channel: ['lightness', 'a', 'b'],
alias: ['LAB', 'cielab'],
xyz(lab) {
const l = lab[0]
const a = lab[1]
const b = lab[2]
let x; let y; let z; let y2
if (l <= 8) {
y = (l * 100) / 903.3
y2 = (7.787 * (y / 100)) + (16 / 116)
}
else {
y = 100 * Math.pow((l + 16) / 116, 3)
y2 = Math.pow(y / 100, 1 / 3)
}
x = x / 95.047 <= 0.008856 ? x = (95.047 * ((a / 500) + y2 - (16 / 116))) / 7.787 : 95.047 * Math.pow((a / 500) + y2, 3)
z = z / 108.883 <= 0.008859 ? z = (108.883 * (y2 - (b / 200) - (16 / 116))) / 7.787 : 108.883 * Math.pow(y2 - (b / 200), 3)
return [x, y, z]
},
}
// extend xyz
xyz.lab = function(xyz1) {
let x = xyz1[0]
let y = xyz1[1]
let z = xyz1[2]
x /= 95.047
y /= 100
z /= 108.883
x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116)
y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116)
z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116)
const l = (116 * y) - 16
const a = 500 * (x - y)
const b = 200 * (y - z)
return [l, a, b]
}

View File

@ -1,9 +0,0 @@
/* eslint-disable import/no-commonjs */
module.exports = {
name: 'rgb',
min: [0, 0, 0],
max: [255, 255, 255],
channel: ['red', 'green', 'blue'],
alias: ['RGB'],
}

View File

@ -1,136 +0,0 @@
/* eslint-disable import/no-commonjs */
const rgb = require('./rgb')
const xyz = {
name: 'xyz',
min: [0, 0, 0],
channel: ['X', 'Y', 'Z'],
alias: ['XYZ', 'ciexyz', 'cie1931'],
}
/**
* Whitepoint reference values with observer/illuminant
*
* http://en.wikipedia.org/wiki/Standard_illuminant
*/
xyz.whitepoint = {
// 1931 2°
2: {
// incadescent
A: [109.85, 100, 35.585],
// B:[],
C: [98.074, 100, 118.232],
D50: [96.422, 100, 82.521],
D55: [95.682, 100, 92.149],
// daylight
D65: [95.045592705167, 100, 108.9057750759878],
D75: [94.972, 100, 122.638],
// flourescent
// F1: [],
F2: [99.187, 100, 67.395],
// F3: [],
// F4: [],
// F5: [],
// F6:[],
F7: [95.044, 100, 108.755],
// F8: [],
// F9: [],
// F10: [],
F11: [100.966, 100, 64.370],
// F12: [],
E: [100, 100, 100],
},
// 1964 10°
10: {
// incadescent
A: [111.144, 100, 35.200],
C: [97.285, 100, 116.145],
D50: [96.720, 100, 81.427],
D55: [95.799, 100, 90.926],
// daylight
D65: [94.811, 100, 107.304],
D75: [94.416, 100, 120.641],
// flourescent
F2: [103.280, 100, 69.026],
F7: [95.792, 100, 107.687],
F11: [103.866, 100, 65.627],
E: [100, 100, 100],
},
}
/**
* Top values are the whitepoints top values, default are D65
*/
xyz.max = xyz.whitepoint[2].D65
/**
* Transform xyz to rgb
*
* @param {Array} xyz Array of xyz values
*
* @return {Array} RGB values
*/
xyz.rgb = function(_xyz, white) {
// FIXME: make sure we have to divide like this. Probably we have to replace matrix as well then
white = white || xyz.whitepoint[2].E
const x = _xyz[0] / white[0]
const y = _xyz[1] / white[1]
const z = _xyz[2] / white[2]
let r; let g; let b
// assume sRGB
// http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
r = (x * 3.240969941904521) + (y * -1.537383177570093) + (z * -0.498610760293)
g = (x * -0.96924363628087) + (y * 1.87596750150772) + (z * 0.041555057407175)
b = (x * 0.055630079696993) + (y * -0.20397695888897) + (z * 1.056971514242878)
r = r > 0.0031308
? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
: r = (r * 12.92)
g = g > 0.0031308
? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
: g = (g * 12.92)
b = b > 0.0031308
? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
: b = (b * 12.92)
r = Math.min(Math.max(0, r), 1)
g = Math.min(Math.max(0, g), 1)
b = Math.min(Math.max(0, b), 1)
return [r * 255, g * 255, b * 255]
}
/**
* RGB to XYZ
*
* @param {Array} rgb RGB channels
*
* @return {Array} XYZ channels
*/
rgb.xyz = function(rgb1, white) {
let r = rgb1[0] / 255
let g = rgb1[1] / 255
let b = rgb1[2] / 255
// assume sRGB
r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92)
g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92)
b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92)
const x = (r * 0.41239079926595) + (g * 0.35758433938387) + (b * 0.18048078840183)
const y = (r * 0.21263900587151) + (g * 0.71516867876775) + (b * 0.072192315360733)
const z = (r * 0.019330818715591) + (g * 0.11919477979462) + (b * 0.95053215224966)
white = white || xyz.whitepoint[2].E
return [x * white[0], y * white[1], z * white[2]]
}
module.exports = xyz

View File

@ -1,141 +0,0 @@
import { uint32ToUint8Array, uint8ArrayToHex } from './utils'
export class Command {
// 测量序号
static measureId = 1
// 命令完整响应的长度
responseSize = 0
// 命令发送的数据
content = new Uint8Array(0)
// 命令响应的数据
response = new Uint8Array(0)
// 等待响应的超时时间
timeout = 3000
// 发送的数据是否需要生成和校验值
needSign = true
/**
* @param {Uint8Array|ArrayBuffer|number[]} content
* @param {number} responseSize
* @param {number} timeout
* @param {boolean} needSign
*/
constructor(content, responseSize, timeout = 3000, needSign = true) {
if (content instanceof Uint8Array) {
this.content = content
}
else {
this.content = new Uint8Array(content)
}
this.responseSize = responseSize
if (typeof timeout === 'number' && timeout >= 0) {
this.timeout = timeout
}
this.needSign = needSign
}
/**
* 返回一个 ArrayBuffer 数组, 用于发送
* @returns {ArrayBuffer[]}
*/
get data() {
if (this.content.length === 0) { throw new Error('正文内容不能为空') }
const data = []
const b = new Uint8Array(this.content.buffer)
if (this.needSign) {
b[b.length - 1] = Command.getSign(b)
}
for (let i = 0; i < b.length; i += 20) {
data.push(b.slice(i, i + 20).buffer)
}
return data
}
/** 是否接收完成 */
get isComplete() {
return this.response.length >= this.responseSize
}
/** 是否有效 */
get isValid() {
return Command.getSign(this.response) === this.response[this.response.length - 1]
}
/**
* 填充响应数组
* @param {ArrayBuffer} buffer
*/
fillResponse(buffer) {
this.response = new Uint8Array([...this.response, ...(new Uint8Array(buffer))])
}
/**
* 获取和校验值
* @param {ArrayBuffer|Uint8Array} buffer
*/
static getSign(buffer) {
const _b = buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer)
let sum = 0
_b.slice(0, _b.length - 1).forEach(i => sum += i)
return new Uint8Array([sum])[0]
}
// 唤醒命令
static WakeUp = new Command([0xF0], 0, 0, false)
/**
* 获取测量命令
* @param {number} mode
*/
static measure(mode = 0) {
Command.measureId += 1
const measureId = uint32ToUint8Array(Command.measureId)
return new Command([0xBB, 1, mode, ...measureId, 0, 0xFF, 0], 10, 1500)
}
/**
* 获取测量数据 (Lab)
* @param {number} mode
*/
static getLab(mode = 0) {
return new Command([0xBB, 3, mode, 0, 0, 0, 0, 0, 0xFF, 0], 20, 1500)
}
/**
* 获取测量数据 (RGB)
* @param {number} mode
*/
static getRGB(mode = 0) {
return new Command([0xBB, 4, mode, 0, 0, 0, 0, 0, 0xFF, 0], 20, 1500)
}
/**
* 获取测量的光谱数据
* @param {number} mode
*/
static getSpectral(mode = 0) {
return new Command([0xBB, 2, 0x10 + mode, 0, 0, 0, 0, 0, 0xFF, 0], 200, 5000)
}
/**
* 白校准
* @param {number} check 是否判断校准成功 1 判断 0 不判断
*/
static whiteCalibrate(check = 1) {
return new Command([0xBB, 0x11, check, 0, 0, 0, 0, 0, 0xFF, 0], 10, 1500)
}
/**
* 黑校准
* @param {number} check 是否判断校准成功
*/
static blackCalibrate(check = 1) {
return new Command([0xBB, 0x10, check, 0, 0, 0, 0, 0, 0xFF, 0], 10, 1500)
}
/** 获取校准状态 */
static GetCalibrationInf = new Command([0xBB, 0x1E, 0, 0, 0, 0, 0, 0, 0xFF, 0], 20, 1500)
static GetDeviceInf = new Command([0xBB, 0x12, 0x01, 0, 0, 0, 0, 0, 0xFF, 0], 200, 5000)
}

View File

@ -1,65 +0,0 @@
/**
* Uint32 Uint8 数组
* @param {number} n
*/
export function uint32ToUint8Array(n) {
return new Uint8Array(new Uint32Array([n]).buffer)
}
/**
* Uint8 数组 Float32
* @param {Uint8Array} raw
*/
export function uint8ArrayToFloat32(raw) {
return new Float32Array(raw.buffer)[0]
}
/**
* Uint8 数组 Uint16
* @param {Uint8Array} raw
*/
export function uint8ArrayToUint16(raw) {
return new Uint16Array(raw.buffer)[0]
}
/**
* Uint8 数组转 Uint32
* @param {Uint8Array} raw
* @returns
*/
export function uint8ArrayToUnit32(raw) {
return new Uint32Array(raw.buffer)[0]
}
/**
* 等待指定时长
* @param {number} duration
*/
export function waitFor(duration) {
return new Promise((resolve) => {
setTimeout(resolve, duration)
})
}
/**
* uint8 数组转 hex 字符串
* @param {Uint8Array} raw
*/
export function uint8ArrayToHex(raw) {
const s = []
raw.forEach((i) => {
const b = i.toString(16)
s.push(b.length > 1 ? b : `0${b}`)
})
return s.join(' ')
}
// 二进制转字符串(ascii)
// export function bufferToString(buffer) {
// let str = ''
// for (const code of buffer) {
// if (code === 0) { break }
// str += utf82string(code)
// }
// return str
// }

View File

@ -1,233 +0,0 @@
import Taro from '@tarojs/taro'
const setUrlQuery = (options: { url: string; query: object | null }) => {
let { url } = options
const { query } = options
if (!url) { return '' }
if (query) {
const queryArr: any[] = []
for (const key in query) {
if (query.hasOwnProperty(key)) {
queryArr.push(`${key}=${query[key]}`)
}
}
if (url.includes('?')) {
url = `${url}&${queryArr.join('&')}`
}
else {
url = `${url}?${queryArr.join('&')}`
}
}
return url
}
/**
*
* @param path
* @param params
* @param type false true tabbar页面
*/
type ParamLink = 'navigateTo' | 'switchTab' | 'reLaunch' | 'redirectTo'
export const goLink = (path = '', params: object | null = null, way: ParamLink = 'navigateTo') => {
if (path) {
// let params_str = Qs_.stringify(params || {}, { encode: false })
// path = params_str ? path + '?' + params_str : path
path = setUrlQuery({ url: path, query: params })
Taro[way]({ url: path })
}
}
/**
*
* @param object
* @returns
*/
export const isEmptyObject = (object: any) => {
if (object == undefined || object == null || Number.isNaN(object)) {
return true
}
else {
if (object.constructor == Object) {
return Reflect.ownKeys(object).length == 0
}
else if (object.constructor == Array) {
return object.length == 0
}
else if (object.constructor == String) {
return object == ''
}
}
return false
}
/**
*
* @param data
* @param rules = {
account: [{
message: "请输入正确的用户名",
// regex: /\d/, // 正则匹配规则
// validator: (value:any, rule:any)=>{ // 自定义验证返回true表示匹配到了(错误)
// return false;
// }
}],
password: [{
message: "请输入正确的密码",
// regex: /\d/
}]
};
* @param message
* @returns
*/
// export const retrieval = (data: any, rules?: Object, message = '请填写完信息') => {
// return new Promise((resolve, reject) => {
// if (rules) {
// const keys = Reflect.ownKeys(rules)
// const result = keys.some((key: any) => {
// for (const item of (rules as any)[key]) {
// let _res = false
// if (item.validator) {
// if (item.validator(data[key], item)) {
// _res = true
// }
// }
// else if (item.regex) {
// if (!item.regex.test(data[key])) {
// _res = true
// }
// }
// else {
// if (isEmptyObject(data[key])) {
// _res = true
// }
// }
// message = item.message
// return _res
// }
// })
// if (result) {
// reject(message)
// }
// }
// else {
// const keys = Reflect.ownKeys(data)
// if (keys.some((key: any) => isEmptyObject(data[key]))) {
// reject(message)
// }
// }
// resolve(null)
// })
// }
/**
* toast提示
*/
export const alert = {
success(title: string) {
Taro.showToast({
title,
icon: 'success',
})
},
error(title: string) {
Taro.showToast({
title,
icon: 'error',
})
},
loading(title: string, mask = false) {
Taro.showToast({
title,
icon: 'loading',
mask,
})
},
none(title: string) {
Taro.showToast({
title,
icon: 'none',
})
},
showLoading(title: string, mask = true) {
Taro.showLoading({ title, mask })
},
hideLoading() {
Taro.hideLoading()
},
}
// 金额千位分割符
export const formatKbPrice = (number: string) => {
const ret = Array.from(number)
.reverse()
.reduce((result: string[], next, i, arr) => {
if ((i + 1) % 3 === 0 && i + 1 !== arr.length) {
result.push(next, ',')
return result
}
result.push(next)
return result
}, [])
return ret.reverse().join('')
}
/**
*
* @param {key} key
* @returns
*/
export const checkKey = (key = '') => {
if (key === 'ignore') { return true }
const getUser = JSON.parse(Taro.getStorageSync('userInfo') || '{}')
return getUser.mp_role_access_list?.includes(key)
}
// 判断是否整数类型
export function isInteger(obj) {
return (obj | 0) === obj
}
export const handleTimeout = (minutes: number) => {
const days = Math.floor(minutes / (24 * 60)) // 计算出天数
const leavel = minutes % (24 * 60) // 计算天数后剩余的时间
const hours = Math.floor(leavel / 60)
const mins = leavel % 60
const dayStr = days ? `${days}d` : ''
const hoursStr = hours ? `${hours}h` : ''
const minsStr = mins ? `${mins}m` : ''
return `${dayStr} ${hoursStr} ${minsStr}`
}
export const paywayList = [
{
id: 2,
iconfont: 'icon-yufukuan1',
name: '预存款',
fonts: '可用额度 ',
money: '',
isCheck: false,
},
{
id: 5,
iconfont: 'icon-xianxiahuizong',
name: '货到付款',
fonts: '发货后3天内付款',
isCheck: false,
money: '',
color: '#ffffff',
},
{
id: 3,
iconfont: 'icon-a-0tianzhangqi',
name: 'x天账期',
fonts: '可用额度 ',
money: '',
isCheck: false,
},
{
iconfont: 'icon-yue',
name: '线下汇款',
},
{
iconfont: 'icon-saomiao',
name: '扫码支付',
color: '#ffffff',
},
]

View File

@ -1,53 +0,0 @@
// export const BASE_URL = CURRENT_BASE_URL
// export const BASE_URL = `http://192.168.0.75:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:50001/lymarket`
// export const BASE_URL = `http://10.0.0.5:50001/lymarket`
// export const BASE_URL = `http://192.168.0.89:40001/lymarket`
// export const BASE_URL = 'https://test.zzfzyc.com/lymarket' // 测试环境
export const BASE_URL = 'https://pre.zzfzyc.com/lymarket' // 预发布
// export const BASE_URL = `https://dev.zzfzyc.com/lymarket` // 开发环境
// export const BASE_URL = 'https://www.zzfzyc.com/lymarket' // 正式环境
// export const BASE_URL = 'http://192.168.1.7:50002/lymarket' // 添
// export const BASE_URL = 'http://192.168.1.163:50002/lymarket' // 杰
// CDN
// 生成密钥
export const GET_UPLOAD_SIGN = '/upyun/getsign' // 请求签名 url
export const UPLOAD_CDN_URL = 'https://v0.api.upyun.com/'
// cdn
export const IMG_CND_Prefix = CURRENT_IMG_CND_Prefix
// 在线支付图片baseUrl
export const CAP_HTML_TO_IMAGE_BASE_URL = CURRENT_CAP_HTML_TO_IMAGE_BASE_URL
// 上传图片视频
export const CDN_UPLOAD_IMG = `${UPLOAD_CDN_URL || ''}`
// appid
export const WX_APPID = 'wx64fe67f111d52457'
export const LIST_EMPTY_IMAGE = `${IMG_CND_Prefix}/list_empty.png`
export const EMPTY_IMAGE = `${IMG_CND_Prefix}/empty.png`
export const SEARCH_EMPTY_IMAGE = `${IMG_CND_Prefix}/search_empty.png`
export const COLOR_CARD_LIST_EMPTY_IMAGE = `${IMG_CND_Prefix}/color_card/colorCardList_empty.png`
export const BUSINESS_MANAGER = `${IMG_CND_Prefix}/color_card/businessManager.png`
export const ORDER_WARNING_FAIL = `${IMG_CND_Prefix}/orderWarningAnalysis/fail.png`
export const ORDER_WARNING_PENDING = `${IMG_CND_Prefix}/orderWarningAnalysis/pending.png`
export const ORDER_WARNING_CANCEL = `${IMG_CND_Prefix}/orderWarningAnalysis/cancel.png`
export const ORDER_WARNING_SUCCESS = `${IMG_CND_Prefix}/orderWarningAnalysis/success.png`
// 客服
export const BUSINESS_MANAGER_PHONE = '0757-86834274'
// 获取CND资源
export const getCDNSource = (suffix: string) => {
return IMG_CND_Prefix + suffix
}
// 场景值
export const SCENE = {
SearchScene: 0, // 商城面料搜索
}
// 支付码单跳转链接
export const PAY_H5_CODE_URL = CURRENT_PAY_H5_CODE_URL

View File

@ -1,72 +0,0 @@
// 订单状态枚举
export const ORDER_STATUS = {
SaleorderstatusWaitingPrePayment: { value: 10, label: '预付款' }, // 预付款
SaleOrderStatusBooking: { value: 0, label: '待接单' }, // 待接单
SaleOrderStatusArranging: { value: 1, label: '配布中' }, // 配布中
SaleOrderStatusArranged: { value: 2, label: '已配布' }, // 已配布
SaleOrderStatusWaitingPayment: { value: 7, label: '待付款' }, // 待付款
SaleOrderStatusTaking: { value: 11, label: '提货中' }, // 提货中
SaleOrderStatusWaitingDelivery: { value: 3, label: '待发货' }, // 待发货
SaleOrderStatusWaitingReceipt: { value: 8, label: '待收货' }, // 待收货
SaleOrderStatusAlreadyReceipt: { value: 9, label: '已收货' }, // 已收货
SaleOrderStatusComplete: { value: 4, label: '已完成' }, // 已完成
SaleOrderStatusRefund: { value: 6, label: '已退款' }, // 已退款
SaleOrderStatusCancel: { value: 5, label: '已取消' }, // 已取消
}
// 售后单状态枚举
export const AFTER_ORDER_STATUS = {
ReturnStageApplying: { value: 0, label: '申请中' }, // 申请中
ReturnStageWaitCheck: { value: 1, label: '退货中' }, // 退货中
ReturnStageChecked: { value: 2, label: '待验布' }, // 待验布
ReturnStageReturned: { value: 3, label: '已退款' }, // 已退款
ReturnStageCancel: { value: 4, label: '已取消' }, // 已取消
ReturnStageQualityCheckPendingRefund: { value: 5, label: '待退款' }, // 已验布
ReturnStageServiceOrderPendingRefund: { value: 6, label: '待退款' }, // 待退款
ReturnStageRejected: { value: 7, label: '已拒绝' }, // 已拒绝
}
// 支付方式
export const PAYMENT_METHOD = {
PaymentMethodPreDeposit: { value: 2, label: '预存款' },
PaymentMethodAccountPeriod: { value: 3, label: '账期' },
PaymentMethodofflineRemittance: { value: 1, label: '线下汇款' },
PaymentMethodScanCodeToPay: { value: 4, label: '扫码支付' },
PaymentMethodCashOnDelivery: { value: 5, label: '货到付款' },
}
// 订单类型
export const SALE_MODE = {
SaLeModeBulk: { value: 0, label: '大货' },
SaleModeLengthCut: { value: 1, label: '剪版' },
SaLeModeWeightCut: { value: 2, label: '散剪' },
}
// 分享场景枚举
export const SHARE_SCENE = {
ShareDetail: { value: 1, label: '详情分享' },
SharePage: { value: 2, label: '页面分享' },
}
// 订阅消息
export const SUBSCRIPTION_MESSAGE_SCENE = {
SubmitOrder: { value: 1, label: '确认下单' },
ToPay: { value: 2, label: '去付款' },
ApplyGoods: { value: 3, label: '申请退款' },
}
// 应收单退款状态枚举
export const REFUND_STATUS = {
ShouldCollectOrderRefundTypeUnknown: { value: 0, label: '未知退款' },
ShouldCollectOrderRefundTypeAdvanceReceiptRefund: { value: 1, label: '预收退款' },
ShouldCollectOrderRefundTypeReturnForRefund: { value: 2, label: '退货退款' },
ShouldCollectOrderRefundTypeSalesRefund: { value: 3, label: '销售退款' },
}
// 申请单退款状态枚举
export const REFUND_STATUS_ORDER = {
ReturnApplyOrderTypeAdvanceReceiptRefund: { value: 2, label: '预收退款' }, // 预收退款
ReturnApplyOrderTypeReturnForRefund: { value: 1, label: '退货退款' }, // 退货退款
ReturnApplyOrderTypeSalesRefund: { value: 3, label: '销售退款' }, // 销售退款
}

View File

@ -1,302 +0,0 @@
import { IMG_CND_Prefix } from './constant'
/**
* 精度
* @param {*} num
* @param {*} precision
* @returns
*/
export const strip = (num, precision = 12) => {
return +parseFloat(num.toPrecision(precision))
}
/**
*
* @param {千位分割付} number
* @returns
*/
export const numberWithCommas = ({ number = 0, digit = 2 }) => {
if (!Number.isNaN(Number(number))) {
return parseFloat(number).toFixed(digit).replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
// return parseFloat(number).toFixed(digit).replace(/^\B(?<!\.\d*)(?=(\d{3})+(?!\d))$/g, ",");
// return parseFloat(number).toLocaleString('zh', { minimumFractionDigits: digit })
}
else {
return 0.0
}
}
/**
* 移除井号
* @param {String} val code 编码
* @returns
*/
export const formatRemoveHashTag = (val = '') => {
// console.log('移除标签',val,val.endsWith("#"));
return val.endsWith('#') ? val.replace('#', '') : val
}
/**
* 格式化编码+名称显示方式
* @param {String} code 编码
* @param {String} name 名称
* @param {*} mode 模式 both:code + 名称 name: 仅显示名称
* @returns
*/
export const formatHashTag = (code = '', name = '', mode = 'both') => {
if (mode == 'both') {
return `${formatRemoveHashTag(code)}# ${name}`
}
else if (mode == 'name') {
return `${name}`
}
}
const Digit = 10 * 10
/**
* 重量 进退位 单位
*/
export const weightDigit = 1000
/**
* 厘米进退位单位
*/
export const meterDigit = 100
/**
* 除以
* @param {*} val
* @param {*} digit
* @param {*} priceStatus //是否显示千位分割
* @returns
*/
export const formatPriceDiv = (val, digit = Digit, priceStatus = false) => {
const res = strip(Number(val / digit)) || 0
return priceStatus ? numberWithCommas({ number: res }) : res
}
/**
* 乘以
* @param {*} val
* @param {*} digit
* @returns
*/
export const formatPriceMul = (val, digit = Digit) => {
return strip(Number(val * digit)) || 0
}
/**
* 格式化长度 (乘以)
* @param {Number} val
* @returns
*/
export const formatMeterMul = (val, digit = meterDigit) => {
return strip(Number(val * digit)) || 0
}
/**
* 格式化长度 (除以)
* @param {*} val
*/
export const formatMeterDiv = (val, digit = meterDigit) => {
return strip(Number(val / digit)) || 0
}
/**
* 格式化重量单位 (乘以)
* @param {Number} val
* @returns
*/
export const formatWeightMul = (val, digit = weightDigit) => {
return strip(Number(val * digit)) || 0
}
/**
* 格式化重量单位 (除以)
* @param {*} val
*/
export const formatWeightDiv = (val, digit = weightDigit) => {
return strip(Number(val / digit)) || 0
}
export const formatDateTime = (val, fmt = 'YYYY-MM-DD HH:mm:ss') => {
if (val) {
const time = new Date(val)
const Y = time.getFullYear()
const M = time.getMonth() + 1
const d = time.getDate()
const h = time.getHours()
const m = time.getMinutes()
const s = time.getSeconds()
fmt = fmt
.replace('YYYY', Y)
.replace('MM', M.toString().padStart(2, '0'))
.replace('DD', d.toString().padStart(2, '0'))
.replace('HH', h.toString().padStart(2, '0'))
.replace('mm', m.toString().padStart(2, '0'))
.replace('ss', s.toString().padStart(2, '0'))
return fmt
}
else {
return val
}
}
/**
* 数值保留两位小数
* @param {*} x
* @returns
*/
export const toDecimal2 = (x) => {
let f = parseFloat(x)
if (Number.isNaN(f)) {
return 0
}
f = `${f}`
const index = f.lastIndexOf('.')
if (index >= 0) {
const decimal = f.substring(index + 1)
if (decimal.length == 1) {
f = `${f.substring(0, index + 1) + decimal}0`
}
else {
f = f.substring(0, index + 1) + decimal.substring(0, 2)
}
}
return f
}
/**
* 转换金额单位
* @param {*} num 金额 / 数值
* @param {*} digit 转换单位
* @returns
*/
export const formatMillionYuan = (num, digit = 10000) => {
return num / digit > 1 ? { num: toDecimal2(num / digit), million: true } : { num, million: false }
}
// 匹配前缀 例如://xxx.com 或者 http://xxx.com 或者 https://xxx.com
// eslint-disable-next-line no-useless-escape
const URL_REGEXP = /(https?:)?\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_\+.~#?&=]*)/gi
/**
* 判断是否有前缀
* @param {string} url url路径
*/
export const withBaseUrl = function(url) {
return URL_REGEXP.test(url)
}
/**
* 去除前缀 //xxx.com 或者 http://xxx.com 或者 https://xxx.com
* @param {string} url url路径
*/
export const breakupUrl = (url) => {
return url?.replace(URL_REGEXP, '') ?? url
}
/**
* 拼接前缀 http://xxx.com + /asdfsafdas/154531asdf465413.png
* @param {string} url url路径
*/
export const jointUrl = (url) => {
return withBaseUrl(url) ? url : `${IMG_CND_Prefix}${url}`
}
export const formatUrl = (url, suffix = '!w200') => {
if (url) {
url = url.includes(',') ? url.split(',')[0] : url
return withBaseUrl(url) ? url + suffix : jointUrl(url) + suffix
}
else {
return `${IMG_CND_Prefix}/mall/no_img.png`
}
}
/**
* 格式化图片路径
* @param {*} url
* @status true|false
* @returns
*/
export const formatImgUrl = (url, suffix = '!w200') => {
if (url) {
return url.includes('http') ? url + suffix : IMG_CND_Prefix + url + suffix
}
else {
return `${IMG_CND_Prefix}/mall/no_img.png`
}
}
/**
*
* @param {纹理图} imgurl
* @param {rgb} rgb
* @param {} suffix
* @returns 1 有纹理图2 有rgb 3默认图
*/
export const isLabImage = (imgurl, rgb, suffix = '!w200') => {
if (imgurl) {
return { status: 1, value: `${IMG_CND_Prefix}/${imgurl}${suffix}` }
}
else if (rgb.r != 0 || rgb.g != 0 || rgb.b != 0) {
return { status: 2, value: rgb }
}
else {
return { status: 3, value: `${IMG_CND_Prefix}/mall/no_img.png` }
}
}
// 计算数值大于指定值
export const setPriceUnit = (num, cls) => {
if (cls) {
const res = formatMillionYuan(num, 1000)
return {
cls: res.million ? cls : '',
num: res.num,
}
}
else if (num > 100000000) {
const res = formatMillionYuan(num, 100000000)
return {
cls: res.million ? 's-e' : '',
num: res.num,
}
}
else {
const res = formatMillionYuan(num)
return {
cls: res.million ? 's-w' : '',
num: res.num,
}
}
}
// 不四舍五入, val:原数据,num:保留位数
const noScale = (val, num = 2) => {
val = parseFloat(val)
num = parseInt(num)
const power = Math.pow(10, num)
val = `${val * power}`
val = val.split('.')[0]
val = parseInt(val) / power
return val
}
// 处理数据单位(自然数)
export const dataUnit = (val) => {
let newVal = ''
val = parseFloat(val)
if (val >= 100000000) {
newVal = `${noScale(val / 100000000)}亿`
}
else if (val >= 10000000) {
newVal = `${noScale(val / 10000000)}kw`
}
else if (val >= 10000) {
newVal = `${noScale(val / 10000)}w`
}
else if (val >= 1000) {
newVal = `${noScale(val / 1000)}k`
}
else {
newVal = val
}
return newVal
}

View File

@ -1,90 +0,0 @@
const smallToBig = function(money) {
// 将数字金额转换为大写金额
const cnNums = [
'零',
'壹',
'贰',
'叁',
'肆',
'伍',
'陆',
'柒',
'捌',
'玖',
] // 汉字的数字
const cnIntRadice = ['', '拾', '佰', '仟'] // 基本单位
const cnIntUnits = ['', '万', '亿', '兆'] // 对应整数部分扩展单位
const cnDecUnits = ['角', '分', '毫', '厘'] // 对应小数部分单位
const cnInteger = '整' // 整数金额时后面跟的字符
const cnIntLast = '元' // 整数完以后的单位
// 最大处理的数字
// eslint-disable-next-line @typescript-eslint/no-loss-of-precision
const maxNum = 999999999999999.9999
// 输出的中文金额字符串
let chineseStr = ''
let parts // 分离金额后用的数组,预定义
if (money == '') {
return ''
}
money = parseFloat(money)
if (money >= maxNum) {
// 超出最大处理数字
return '超出最大处理数字'
}
if (money == 0) {
chineseStr = cnNums[0] + cnIntLast + cnInteger
return chineseStr
}
// 四舍五入保留两位小数,转换为字符串
money = Math.round(money * 100).toString()
const integerNum = money.substr(0, money.length - 2) // 金额整数部分
const decimalNum = money.substr(money.length - 2) // 金额小数部分
// 获取整型部分转换
if (parseInt(integerNum, 10) > 0) {
let zeroCount = 0
const IntLen = integerNum.length
for (let i = 0; i < IntLen; i++) {
const n = integerNum.substr(i, 1)
const p = IntLen - i - 1
const q = p / 4
const m = p % 4
if (n == '0') {
zeroCount++
}
else {
if (zeroCount > 0) {
chineseStr += cnNums[0]
}
// 归零
zeroCount = 0
chineseStr += cnNums[parseInt(n)] + cnIntRadice[m]
}
if (m == 0 && zeroCount < 4) {
chineseStr += cnIntUnits[q]
}
}
chineseStr += cnIntLast
}
// 小数部分
if (decimalNum != '') {
const decLen = decimalNum.length
for (let i = 0; i < decLen; i++) {
const n = decimalNum.substr(i, 1)
if (n != '0') {
chineseStr += cnNums[Number(n)] + cnDecUnits[i]
}
}
}
if (chineseStr == '') {
chineseStr += cnNums[0] + cnIntLast + cnInteger
}
else if (decimalNum == '' || /^0*$/.test(decimalNum)) {
chineseStr += cnInteger
}
return chineseStr
}
export default smallToBig

View File

@ -1,32 +0,0 @@
import Taro from '@tarojs/taro'
import { BASE_URL } from '../constant'
// 绑定上下级
const bindParent = (share_user_id) => {
// 绑定上下级
Taro.request({
url: `${BASE_URL}/v1/mall/shortCode/bind`,
method: 'POST',
data: { share_user_id },
success: (res) => {
if (res.data.code == 0) {
// 绑定上下级
}
},
})
}
// 解析短码(主要用于右上角按钮分享)
export const analysisShortCodeApi = (val) => {
// 解析短码
Taro.request({
url: `${BASE_URL}/v1/mall/shortCode`,
method: 'GET',
data: { md5_key: val },
success: (res) => {
if (res.data.code == 0) {
// 绑定上下级
bindParent(res.data.data.share_user_id)
}
},
})
}

View File

@ -1,49 +0,0 @@
import Taro from '@tarojs/taro'
/**
*
* @param {Object} systemInfo
*/
export const setSystem = (systemInfo) => {
Taro.setStorageSync('system', JSON.stringify(systemInfo))
}
/**
*
*/
export const getSystem = () => {
const result = Taro.getStorageSync('system')
return result ? JSON.parse(result) : null
}
/**
*
* @param {Object} systemInfo
*/
export const setAccountInfo = (systemInfo) => {
Taro.setStorageSync('accountInfo', JSON.stringify(systemInfo))
}
/**
*
*/
export const getAccountInfo = () => {
const result = Taro.getStorageSync('accountInfo')
return result ? JSON.parse(result) : null
}
/**
*
* @param {Object} info
*/
export const setParam = (info: Object) => {
Taro.setStorageSync('params', JSON.stringify(info))
}
/**
*
*/
export const getParam = () => {
const res = Taro.getStorageSync('params') || null
return res ? JSON.parse(res) : null
}

View File

@ -1,184 +0,0 @@
import Taro from '@tarojs/taro'
import type { SelectorQuery } from '@tarojs/taro/types/index'
import { formatImgUrl } from './format'
import { analysisShortCodeApi } from './shortCode'
/**
*
* @param {*} fn
* @param {*} delay
* @returns
*/
export const debounce = (fn, delay) => {
let timer: any = null
return (...param) => {
if (timer) { clearTimeout(timer) }
timer = setTimeout(() => {
fn(...param)
}, delay)
}
}
/**
*
* @param {*} fn
* @param {*} delay
* @returns
*/
export const throttle = (fn, delay) => {
let pre = 0
return (...params) => {
const now = new Date().getTime()
if (now - pre > delay) {
fn(...params)
pre = now
}
}
}
/**
*
* @param {Object} val
* @param {Array} arr
* @returns
*/
export const getFilterData = (val = {}, arr: string[] = []) => {
const res = {}
for (const key in val) {
// undefined == null output: true
if (val[key] != null && val[key] !== '' && !arr.includes(key)) {
if (typeof val[key] == 'number') {
if (!Number.isNaN(val[key])) {
res[key] = val[key]
}
}
else {
res[key] = val[key]
}
}
}
return res
}
/**
*
* @param {*} object
* @returns
*/
export const copyObject = (object) => {
if (object.constructor == Object) {
const keys = Object.keys(object)
const newObject = {}
keys.forEach((key) => {
newObject[key] = copyObject(object[key])
})
return newObject
}
else if (object.constructor == Array) {
return object.map((item) => {
return copyObject(item)
})
}
else {
return object
}
}
/**
*
* @param {*} suffix
* !w80
!w100
!w160
!w200
!w400
!w800
!wh400
!w600
*/
export const screenshot = (url, suffix = '!w200') => {
return url + suffix
}
interface DataLoadingStatus {
list: any[]
total: number
status: boolean
}
// 获取数据加载状态 //0:数据从无到有加载数据1没有任何数据 2下拉加载3下拉没有数据
export const dataLoadingStatus = ({ list = [], total = 0, status = false }: DataLoadingStatus) => {
console.log('list & status', list, status)
// 类型校验
if (Object.prototype.toString.call(list) !== '[object Array]') {
list = []
}
if (list.length == 0 && status) {
return 0
}
else if (list.length == 0 && !status) {
return 1
}
else if (list.length < total) {
return 2
}
else {
return 3
}
}
function delay(delayTime = 25): Promise<null> {
return new Promise((resolve) => {
setTimeout(() => {
// @ts-expect-error no error
resolve()
}, delayTime)
})
}
export function delayQuerySelector(selectorStr: string, delayTime = 500): Promise<any[]> {
return new Promise((resolve) => {
const selector: SelectorQuery = Taro.createSelectorQuery()
delay(delayTime).then(() => {
selector
.select(selectorStr)
.boundingClientRect()
.exec((res: any[]) => {
resolve(res)
})
})
})
}
// 全局分享监听
export const shareShop = () => {
const page = Taro.getCurrentInstance().page
// 当有分享参数时,绑定上下级
if (page && page.options?.share) {
analysisShortCodeApi(page.options.share)
}
if (page && page.onShareAppMessage) {
page.onShareAppMessage = (res) => {
let path = ''
let title = ''
let imageUrl = ''
const sortCode = Taro.getStorageSync('sort_code') ? JSON.parse(Taro.getStorageSync('sort_code')) : ''
const pageInfo: any = page
// 商品详情分享
if (pageInfo.route === 'pages/details/index') {
path = `/pages/details/index?share=${sortCode.shareShortDetail.code}`
title = sortCode.shareShortDetail.title
imageUrl = sortCode.shareShortDetail.img
}
else {
path
= pageInfo.route === 'pages/user/index'
? `/pages/user/index?share=${sortCode.shareShortPage.code}`
: `/pages/index/index?share=${sortCode.shareShortPage.code}`
title = sortCode.shareShortPage.title
imageUrl = pageInfo.route === 'pages/user/index' ? sortCode.shareShortPage.img : formatImgUrl('/mall/share_img_02.png', '!w400')
}
return {
title,
path,
imageUrl,
}
}
}
}

View File

@ -1,134 +0,0 @@
.address-container {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
align-items: center;
}
.address-scroll-view {
height: 100%;
box-sizing: border-box;
position: relative;
scroll-view {
height: 100%;
box-sizing: border-box;
}
.address-scroll-view-content {
padding-bottom: 300px;
}
.address-list {
background: #ffffff;
border-radius: 20px;
padding: 24px 30px;
box-sizing: border-box;
margin: 18px 24px 0;
}
.address-active {
border: 1px solid #68b4ff;
}
.address-list-last {
margin-bottom: 300px;
}
.address-user {
font-size: 32px;
font-weight: 700;
text-align: left;
color: #000000;
display: flex;
align-items: center;
}
.address-list-default {
background: #ffffff;
border-radius: 6px;
font-size: 20px;
font-weight: 400;
text-align: center;
color: #007aff;
padding: 4px 10px;
}
.address-list-phone {
font-size: 28px;
font-weight: 400;
color: #717171;
margin-left: 16px;
margin-right: 16px;
}
.address-edit {
padding: 10px;
}
.address-edit .icon-bianji {
font-size: 40px;
}
.address-list-info {
font-size: 28px;
font-weight: 400;
color: #000000;
display: flex;
width: 557px;
}
.address-list-info view {
max-width: 557px;
// text-overflow: ellipsis;
// overflow: hidden;
// white-space: nowrap;
}
.address-list-bottom {
display: flex;
justify-content: space-between;
margin-top: 10px;
}
.add-address {
width: 668px;
height: 82px;
background: #007aff;
border-radius: 40px;
font-size: 32px;
font-weight: 400;
color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
position: absolute;
bottom: 100px;
left: 50%;
transform: translateX(-50%);
}
.address-no-data {
font-size: 24px;
font-weight: 400;
text-align: center;
color: #707070;
height: 100%;
padding-top: 40%;
box-sizing: border-box;
}
.line {
margin-top: 16px;
width: 100%;
height: 1px;
background: #000000;
opacity: 0.1;
}
.bottom-font {
margin-top: 16px;
font-size: 28px;
font-weight: 400;
color: #676767;
}
}

View File

@ -1,172 +0,0 @@
import Taro, { showModal, useDidShow, useRouter } from '@tarojs/taro'
import { Button, Navigator, ScrollView, Text, View } from '@tarojs/components'
import { forwardRef, memo, useEffect, useImperativeHandle, useState } from 'react'
import './index.scss'
import Tag from '../tag'
import { MpPurchaserAddressList } from '@/api/addressList'
import { alert } from '@/common/common'
import IconFont from '@/components/iconfont/iconfont'
import { MpSaleOrderAddress } from '@/api/order'
interface Params {
refresherEnabled?: boolean// 是否开启刷新
onSelect?: (item: any, index: number) => void// 列表选择
addButtonEnabled?: boolean // 是否显示添加按钮
focusBorderEnabled?: boolean // 焦点显示蓝色边框
id?: number // 默认选择值,
purchaser_id: Number
// handSelect?: (any) => void
}
// 地址列表
const AddressList = (props: Params, AddressListRef) => {
const pages = Taro.getCurrentPages() // 获取当前的页面栈
const prevPage = pages[pages.length - 2]
// 焦点
const [focusId, setFocusId] = useState()
const { addButtonEnabled = true, focusBorderEnabled = false } = props
const { fetchData, state } = MpPurchaserAddressList()
// 获取数据
const getData = async() => {
const result = await fetchData({ purchaser_id: props.purchaser_id })
if (props.id) {
setFocusId(props.id as any)
}
else {
result.data.list?.every((item) => {
if (item.is_default) {
setFocusId(item.id)
return false
}
return true
})
}
const itemList: any[] = []
result?.data?.list?.forEach((item) => {
itemList.push(item?.id)
})
prevPage.setData({ // 设置上一个页面的值
ids: itemList,
})
}
useDidShow(() => {
getData()
// 监听刷新
Taro.eventCenter.on('addressList:refresh', getData)
return () => {
Taro.eventCenter.off('addressList:refresh', getData)
}
})
// 处理刷新
const [refreshState, setRefreshState] = useState(false)
const handleRefresh = async() => {
setRefreshState(true)
await getData()
setRefreshState(false)
}
const router = useRouter()
// 列表选择
const { fetchData: selectFetch } = MpSaleOrderAddress()
const handleSelect = async(item: any, index: number) => {
if (router.params.orderId && router.params.orderId != '-100') {
console.log(router.params.orderId != '-100', 'ssss')
console.log(typeof (router.params.orderId) != 'undefined', 'router.params.orderId')
Taro.showLoading({
title: '请稍等...',
mask: true,
})
const res = await selectFetch({ address_id: item.id, id: Number(router.params.orderId), shipment_mode: 2 })
if (res.msg === 'success') {
Taro.hideLoading()
Taro.showToast({
title: '成功',
icon: 'success',
})
Taro.navigateBack({
delta: 1,
})
}
else {
Taro.hideLoading()
Taro.showToast({
title: res.msg,
icon: 'error',
})
}
}
else {
prevPage.setData({ // 设置上一个页面的值
addressObj: item,
// ids: itemList
})
Taro.navigateBack({
delta: 1,
})
}
props.onSelect && props.onSelect(item, index)
if (focusBorderEnabled) {
setFocusId(item?.id)
}
}
useImperativeHandle(AddressListRef, () => ({
getData,
}))
return (
<View className="address-scroll-view">
<ScrollView scrollY refresherEnabled={props.refresherEnabled} enhanced refresherTriggered={refreshState} onRefresherRefresh={handleRefresh}>
<View className="address-scroll-view-content" >
{
state?.data?.list?.length > 0
? state?.data?.list?.map((item, index) => {
// data.length>0?
// data.map((item,index)=>{
return (
<View key={index} onClick={() => handleSelect(item, index)} className={`address-list ${focusId == item.id && 'address-active'}`}>
<View className="address-container">
<View>
<View className="address-user">
{item.name}
<Text className="address-list-phone">{item.phone}</Text>
{
item.is_default
&& <Tag type="primary" size="small" circle plain customClassName="address-list-default">
</Tag>
}
</View>
<View className="address-list-bottom">
<View className="address-list-info">
<View>{item.province_name + item.city_name + item.district_name + item.address_detail}
</View>
</View>
</View>
</View>
<View>
<Navigator onClick={e => e.stopPropagation()} url={`/pages/addAddress/index?type=edit&id=${item.id}&&purchaser_id=${Number(props.purchaser_id)}`} hoverClass="none" className="address-edit">
<IconFont name="icon-bianji" size={40} color="#717171"></IconFont>
</Navigator>
</View>
</View>
{
item.factory !== '' && <>
<View className="line"></View>
<View className="bottom-font">{item.factory}</View></>
}
</View>
)
})
: <View className="address-no-data"></View>
}
</View>
</ScrollView>
{addButtonEnabled && <Navigator url={`/pages/addAddress/index?type=add&purchaser_id=${Number(props.purchaser_id)}`} hoverClass="none" className="add-address"></Navigator>}
</View>
)
}
export default memo(forwardRef(AddressList))

View File

@ -1,48 +0,0 @@
.flexBox {
width: 100%;
display: flex;
align-items: center;
justify-content: flex-end;
.cancle {
width: 160px;
height: 65px;
border-radius: 40px;
opacity: 0.6;
border: 1px solid #000000;
font-size: 28px;
font-weight: 400;
color: #000000;
text-align: center;
line-height: 65px;
margin-right: 24px;
}
.nextBuy {
// margin-right: 24px;
width: 160px;
height: 65px;
border-radius: 40px;
opacity: 0.6;
border: 1px solid #000000;
font-size: 28px;
font-weight: 400;
color: #000000;
text-align: center;
line-height: 65px;
margin-right: 24px;
}
.toBuy {
margin-right: 24px;
width: 160px;
height: 65px;
border-radius: 40px;
border: 1px solid #087eff;
font-size: 28px;
font-weight: 400;
color: #4581ff;
text-align: center;
line-height: 65px;
}
}

View File

@ -1,332 +0,0 @@
import { View } from '@tarojs/components'
import { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'
import classnames from 'classnames'
import style from './index.module.scss'
interface prosObj {
obj?: {
sale_mode?: Number
collect_status?: Number | string
status?: Number
payment_method?: Number
settle_mode?: Number | string
is_shipper_picks_up?: boolean
}
cancle?: (any) => void
nextBuy?: (any) => void
toPay?: (any) => void
handSureGoods?: () => void
showTuiGoods?: boolean
handApplyGoods?: () => void
handApplyMoney?: () => void
handShowCodeList?: () => void
handEdit?: () => void
showDetail?: boolean
goodsObj?: any
}
const BottomBtns = (props: prosObj, ref) => {
const {
obj = {
sale_mode: 0,
collect_status: '',
status: '',
payment_method: 0,
settle_mode: '',
is_shipper_picks_up: false,
},
showTuiGoods = false,
cancle,
nextBuy,
toPay,
handSureGoods,
handApplyGoods,
handApplyMoney,
handShowCodeList,
handEdit,
showDetail = false,
goodsObj = {},
} = props
// 判断显示取消订单
const showCancel = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status === 0)
|| (obj.sale_mode === 0 && obj.status === 1)
|| (obj.sale_mode === 0 && obj.status === 2 && obj.collect_status == 0)
|| (obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 0)
|| (obj.sale_mode === 0 && obj.status === 11 && obj.collect_status == 0)
|| (obj.sale_mode === 0 && obj.status === 11 && obj.settle_mode == 3)
|| (obj.sale_mode === 0 && obj.status === 3 && obj.settle_mode == 3)
|| (obj.sale_mode === 1 && obj.status === 10)
|| (obj.sale_mode === 2 && obj.status === 10)
|| (obj.sale_mode === 2 && obj.status === 0 && (obj.collect_status == 1 || obj.collect_status == 2))
|| (obj.sale_mode === 2 && obj.status === 0 && obj.collect_status == 0)
|| (obj.sale_mode === 1 && obj.status === 10)
|| (obj.sale_mode === 2 && obj.status === 10)
|| (obj.sale_mode === 0 && obj.status === 13)
) {
return true
}
else { return false }
}, [obj])
// 判断显示再次购买
const showBuy = useMemo(() => {
if (
obj.sale_mode === 0
|| (obj.sale_mode === 1 && obj.status !== 10)
|| (obj.sale_mode === 2 && obj.status !== 10)
) {
return true
}
else { return false }
}, [obj])
// 判断显示去付款
const canBuy = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 1)
|| (obj.sale_mode === 0 && obj.status === 7 && obj.collect_status == 0)
|| (obj.sale_mode === 0 && obj.status === 7 && obj.settle_mode == 3)
|| (obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 1)
|| (obj.sale_mode === 0 && obj.status === 3 && obj.collect_status == 0)
|| (obj.sale_mode === 0 && obj.status === 8 && obj.collect_status == 1)
|| (obj.sale_mode === 0 && obj.status === 8 && obj.collect_status == 0)
|| (obj.sale_mode === 0 && obj.status === 9 && obj.collect_status == 1)
|| (obj.sale_mode === 0 && obj.status === 9 && obj.collect_status == 0)
|| (obj.sale_mode === 2 && obj.status === 2)
|| (obj.sale_mode === 2 && obj.status === 7)
|| (obj.sale_mode === 1 && obj.status === 10)
|| (obj.sale_mode === 1 && obj.status === 7)
|| (obj.sale_mode === 2 && obj.status === 10)
) {
return true
}
else { return false }
}, [obj])
// 判断显示确认收货
const showTake = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 0)
|| (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 1)
|| (obj.sale_mode === 0 && obj.status == 8 && obj.collect_status == 2)
|| (obj.sale_mode === 0 && obj.status == 8 && obj.settle_mode == 3)
|| (obj.sale_mode === 1 && obj.status == 8)
|| (obj.sale_mode === 2 && obj.status == 8)
) {
return true
}
else { return false }
}, [obj])
// 判断显示申请退货
const showTuihuo = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 0 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 1 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 9 && obj.collect_status == 2 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 9 && obj.settle_mode == 3 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 2 && obj.status == 9 && goodsObj?.av_return_product?.length)
) {
return true
}
else { return false }
}, [obj])
// 判断显示申请退款
const showTuikuan = useMemo(() => {
if (
(obj.sale_mode === 0 && obj.status == 2 && obj.collect_status == 1 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 2 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 7 && obj.collect_status == 3 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 11 && (obj.collect_status == 1 || obj.collect_status == 2) && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 0 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up)
|| (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 2 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up)
|| (obj.sale_mode === 0 && obj.status == 3 && obj.collect_status == 1 && goodsObj?.av_return_product?.length && !obj.is_shipper_picks_up)
|| (obj.sale_mode === 1 && obj.status == 0 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 1 && obj.status == 9 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 1 && goodsObj?.av_return_product?.length)
|| (obj.sale_mode === 2 && obj.status == 0 && obj.collect_status == 2 && goodsObj?.av_return_product?.length)
) {
return true
}
else { return false }
}, [obj])
// 判断是否显示码单
// 订单状态:待付款、待发货、待提货、待收货、已收货、已完成
const showCodeList = useMemo(() => {
if (obj.status == 3 || obj.status == 8 || obj.status == 11 || obj.status == 9 || obj.status == 4) {
return true
}
else { return false }
}, [obj])
// 判断是否显示修改订单
const showEdit = useMemo(() => {
if (obj.status == 0 || obj.status == 1) {
return true
}
else {
return false
}
}, [obj])
// 多的不显示别的按钮
const [btnList, setbtnList] = useState<any[]>([])
const itemNums = useMemo(() => {
const arr: any[] = []
let nums = 0
if (showCancel) {
nums = nums + 1
console.log('222')
arr.push({
key: 'showCancel',
label: '取消订单',
bgKind: 1,
sort: 1,
})
}
if (canBuy) {
nums = nums + 1
console.log('333')
arr.push({
key: 'canBuy',
label: '去付款',
bgKind: 2,
sort: 20,
})
}
if (showBuy) {
nums = nums + 1
console.log('444')
arr.push({
key: 'showBuy',
label: '再次购买',
bgKind: 3,
sort: 10,
})
}
if (showTake) {
nums = nums + 1
console.log('111')
arr.push({
key: 'showTake',
label: '确认收货',
bgKind: 1,
sort: 9,
})
}
if (showCodeList) {
nums = nums + 1
console.log('555')
arr.push({
key: 'showCodeList',
label: '销售码单',
bgKind: 1,
sort: 12,
})
}
if (showTuikuan) {
nums = nums + 1
console.log('666')
arr.push({
key: 'showTuikuan',
label: '申请退款',
bgKind: 3,
sort: 3,
})
}
if (showTuihuo) {
nums = nums + 1
console.log('777')
arr.push({
key: 'showTuihuo',
label: '申请退货',
bgKind: 3,
sort: 2,
})
}
if (showEdit) {
nums = nums + 1
console.log('101010')
arr.push({
key: 'showEdit',
label: '修改订单',
bgKind: 3,
sort: 9,
})
}
console.log(arr, 'arr')
const fiterArr = arr.sort((a, b) => a.sort - b.sort)
setbtnList([...fiterArr])
return nums
}, [obj])
useImperativeHandle(ref, () => ({
itemNums,
btnList,
}))
const submitBtns = (e, key) => {
if (key === 'showTuihuo') {
handApplyGoods?.()
}
if (key === 'showTuikuan') {
handApplyMoney?.()
}
if (key === 'showCodeList') {
handShowCodeList?.()
}
if (key === 'showTake') {
handSureGoods?.()
}
if (key === 'showCancel') {
cancle?.(e)
}
if (key === 'showBuy') {
nextBuy?.(e)
}
if (key === 'canBuy') {
toPay?.(e)
}
if (key === 'showEdit') {
handEdit?.()
}
}
return (
<View className={style.flexBox}>
{
(showDetail || showTuiGoods) && <>
{
btnList.map((item, index) =>
btnList.length - 3 <= index && (
<View key={index} className={classnames(item.bgKind === 1 ? style.cancle : item.bgKind === 2 ? style.toBuy : style.nextBuy)} onClick={e => submitBtns(e, item.key)}>
{item.label}
</View>
),
)
}
</>
}
{
!showDetail && !showTuiGoods && <>
{
showCancel && <View className={style.cancle} onClick={e => cancle?.(e)}></View>
}
{
showBuy && <View className={style.nextBuy} onClick={e => nextBuy?.(e)}></View>
}
{
canBuy && <View className={style.toBuy} onClick={e => toPay?.(e)}></View>
}
</>
}
</View>
)
}
export default memo(forwardRef(BottomBtns))

View File

@ -1,40 +0,0 @@
$am-ms: 200ms;
.dialog {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100vw;
height: 100vh;
&_mask {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
z-index: 1;
opacity: 0;
transition: opacity $am-ms ease-in;
&_active {
opacity: 1;
}
&--hidden {
background: transparent;
}
}
&_content {
position: fixed;
z-index: 2;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
opacity: 0;
transition: opacity $am-ms ease-in;
&_active {
opacity: 1;
}
}
}

View File

@ -1,68 +0,0 @@
import { Image, View } from '@tarojs/components'
import classnames from 'classnames'
import { useEffect, useState } from 'react'
import style from './index.module.scss'
import { usePropsValue } from '@/use/useCommon'
interface PropsType {
showOverLay?: boolean
show: boolean
onClose?: (show: boolean) => void
onChange?: (isShow) => void
children?: React.ReactNode
zIndex?: number
}
// 弹出框
const Dialog = (props: PropsType) => {
const { showOverLay = true, zIndex = 99, show = false, onClose: _onClose, onChange: _onChange, children } = props
const [_show, setShow] = usePropsValue({
value: show,
defaultValue: false,
onChange: (value) => {
_onChange?.(value)
},
})
const [animShow, setAnimShow] = useState(false)
const handleAnimShow = () => {
setShow(true)
setTimeout(() => {
setAnimShow(true)
}, 200)
}
const handleAnimHide = () => {
setAnimShow(false)
setTimeout(() => {
setShow(false)
}, 200)
}
const onClose = () => {
handleAnimHide()
_onClose?.(_show)
}
useEffect(() => {
if (show) {
handleAnimShow()
}
}, [show])
return _show
? <View className={style.dialog} style={{ zIndex }}>
{/* 遮罩层 start */}
<View
style={{ zIndex: zIndex + 1 }}
className={classnames(style.dialog_mask, { [style.dialog_mask_active]: animShow, [style['drawer_mask--hidden']]: !showOverLay })}
onClick={onClose}
></View>
{/* 遮罩层 end */}
<View
style={{ zIndex: zIndex + 2 }}
className={classnames(style.dialog_content, { [style.dialog_content_active]: animShow })}
>
{children}
</View>
</View>
: <View></View>
}
export default Dialog

View File

@ -1,47 +0,0 @@
.divider {
position: relative;
font-size: 28px;
color: $color_font_one;
// 垂直
&-vertical {
display: inline-block;
width: 1px;
height: 1em;
margin: 0 8px;
border-left: 1px $borderStyle $borderColor;
vertical-align: middle;
}
// 水平
&-horizontal {
display: block;
width: 100%;
height: 1px;
margin: 48px 0;
border-top: 1px $borderStyle $borderColor;
}
&-text{
position: absolute;
text-align: center;
padding: 0 40px;
font-size: inherit;
font-weight: 500;
color: currentColor;
background-color: #fff;
}
}
.is{
&-center{
left: 50%;
transform: translateX(-50%) translateY(-50%);
}
&-left{
left: 20px;
transform:translateY(-50%);
}
&-right{
right: 20px;
transform:translateY(-50%);
}
}

View File

@ -1,47 +0,0 @@
/**
* Usage:
*
* <View></View>
* <Divider direction="vertical" borderStyle="solid"></Divider
* <View></View>
*
*/
import { View } from '@tarojs/components'
import type { FC, ReactNode } from 'react'
import React from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
type BorderStype = 'solid' | 'dashed' | 'dotted' | 'double'
interface DividerProps {
direction?: 'horizontal' | 'vertical'
borderStyle?: BorderStype
contentPosition?: 'left' | 'center' | 'right'
children?: ReactNode
customClassName?: string
customStyles?: React.CSSProperties
}
const Divider: FC<DividerProps> = (props) => {
const { direction = 'horizontal', borderStyle = 'solid', contentPosition = 'center', customClassName = '', customStyles = {} } = props
const classname = classnames(styles.divider, styles[`divider-${direction}`], customClassName)
const contentClassname = classnames(styles['divider-text'], styles[`is-${contentPosition}`])
const borderTopStyle: { borderTopStyle: BorderStype } = {
borderTopStyle: borderStyle,
}
const borderLeftStyle: { borderLeftStyle: BorderStype } = {
borderLeftStyle: borderStyle,
}
const dividerStyle = direction === 'horizontal' ? borderTopStyle : borderLeftStyle
return (
<View className={classname} style={{ ...dividerStyle, ...customStyles }}>
{props.children && direction !== 'vertical' && <View className={contentClassname}>{props.children}</View>}
</View>
)
}
export default Divider

View File

@ -1,92 +0,0 @@
.form-list{
display: flex;
justify-content: space-between;
margin: 30px 30px 0;
.form-list-label{
font-size: 28px;
font-weight: 700;
color: #000000;
margin-top: 20px;
}
.form-list-label-required::before{
content: "*";
color: #FF0000;
font-size: 28px;
}
.form-list-right{
width: 506px;
font-size: 26px;
font-weight: 400;
}
.form-list-right-meet{
background: #f6f6f6;
width: 506px;
min-height: 80px;
border-radius: 20px;
box-sizing: border-box;
padding: 10px 20px;
display: flex;justify-content: space-between;
align-items: center;
}
.form-list-input{
width: 100%;
display: flex;align-items: center;
}
.form-list-input view{
height: 100%;
padding: 0 10px;
box-sizing: border-box;
}
.form-list-input text{
width: 30px;
min-width: 30px;
height: 30px;
background: rgba(0,0,0,0.3);
border-radius: 50%;
font-size: 18px;
display: flex;align-items: center;
justify-content: center;
flex: 1;
color: white;
}
.form-list-right input,.form-list-right textarea{
// flex: 0 0 auto;
min-height: 100%;
width: 100%;
color: #000000;
}
.form-list-right textarea{
height: 186px;
border-radius: 10px;
padding: 10px 0;
}
.form-list-right .phcolor{
color: #ababab;
}
.form-list-right-placeholder{
color: #ababab;
}
.form-list-right-enter .icon-a-moreback{
font-size: 28px;
}
.add-address-default{
display: flex;align-items: center;justify-content: space-between;
margin: 70px 30px 0;
font-size: 26px;
font-weight: 700;
color: #000000;
}
.add-address-save{
width: 668px;
height: 82px;
background: #007aff;
border-radius: 40px;
font-size: 32px;
font-weight: 400;
color: #ffffff;
display: flex;align-items: center;justify-content: center;
margin: 620px auto 0;
}
}

View File

@ -1,59 +0,0 @@
import { Input, Text, Textarea, View } from '@tarojs/components'
import { memo } from 'react'
import './index.scss'
interface ListParams{
label: string // 左边label
onInput?: (ev: Object) => void // 输入框输入
onClick?: () => any // 点击列表
placeholder?: string // 提示文本
children?: any // 插槽
type?: string // 类型1.input,2.textarea,3.select,
primordialType?: 'text'|'number'|'idcard'|'digit'
value?: any
style?: object // 整行样式
labelStyle?: object // label样式
contentStyle?: object
required?: boolean
}
// 表单列表
const FromList = (props: ListParams) => {
const { type = 'input', value = '', style = {}, labelStyle = {}, contentStyle = {}, required = false } = props
return (
<View style={style} className="form-list">
<View style={labelStyle} className={`form-list-label ${required && 'form-list-label-required'}`}>{props.label}</View>
<View onClick={props?.onClick} className="form-list-right">
{
props.children
?? <View style={contentStyle} onClick={props?.onClick} className="form-list-right-meet">
{
type == 'input'
? <View className="form-list-input">
<Input value={value} placeholder-class="phcolor" type={props.primordialType || 'text'} onInput={props?.onInput} placeholder={props.placeholder} />
{value
&& <View><Text onClick={() => props.onInput && props.onInput({ detail: { value: '' } })} className="iconfont icon-qingkong" /></View>
}
</View>
: type == 'textarea'
? <Textarea value={value} placeholder-class="phcolor" onInput={props?.onInput} placeholder={props.placeholder} />
: <>
{
props.value
? <View>{value}</View>
: <View className="form-list-right-placeholder">
{props.placeholder}
</View>
}
<View className="form-list-right-enter"><Text className="iconfont icon-a-moreback"></Text></View>
</>
}
</View>
}
</View>
</View>
)
}
export default memo(FromList)

View File

@ -1,97 +0,0 @@
.From-list-certification{
display: flex;
justify-content: space-between;
margin: 0 30px;
border-bottom: 1px solid #F0F0F0;
padding: 15px 0;
.From-list-certification-label{
font-size: 28px;
font-weight: 400;
color: #000000;
width: 200px;
border-right: 1px solid #F0F0F0;
display: flex;align-items: center;
}
.From-list-certification-label-required::before{
content: "*";
color: #FF0000;
font-size: 28px;
}
.From-list-certification-right{
min-width: 100px;
flex: 1;
font-size: 26px;
font-weight: 400;
}
.From-list-certification-right-meet{
min-height: 45px;
border-radius: 20px;
box-sizing: border-box;
padding: 10px 20px;
display: flex;justify-content: space-between;
align-items: center;
}
.From-list-certification-input{
width: 100%;
display: flex;align-items: center;
}
.From-list-certification-input view{
height: 100%;
padding: 0 10px;
box-sizing: border-box;
}
.From-list-certification-input text{
width: 30px;
min-width: 30px;
height: 30px;
background: rgba(0,0,0,0.3);
border-radius: 50%;
font-size: 18px;
display: flex;align-items: center;
justify-content: center;
flex: 1;
color: white;
}
.From-list-certification-right input,.From-list-certification-right textarea{
// flex: 0 0 auto;
min-height: 100%;
width: 100%;
color: #000000;
}
.From-list-certification-right textarea{
height: 186px;
border-radius: 10px;
padding: 10px 0;
}
.From-list-certification-right .phcolor{
color: #ababab;
}
.From-list-certification-right-placeholder{
color: #ababab;
text-overflow: ellipsis;overflow: hidden;white-space: nowrap;
width: 100%;
}
.From-list-certification-right-enter .icon-a-moreback{
font-size: 28px;
}
.add-address-default{
display: flex;align-items: center;justify-content: space-between;
margin: 70px 30px 0;
font-size: 26px;
font-weight: 700;
color: #000000;
}
.add-address-save{
width: 668px;
height: 82px;
background: #007aff;
border-radius: 40px;
font-size: 32px;
font-weight: 400;
color: #ffffff;
display: flex;align-items: center;justify-content: center;
margin: 620px auto 0;
}
}

View File

@ -1,62 +0,0 @@
import { Input, Text, Textarea, View } from '@tarojs/components'
import { memo } from 'react'
import './index.scss'
interface ListParams{
label: string // 左边label
onInput?: (ev: Object) => void // 输入框输入
onClick?: () => any // 点击列表
placeholder?: string // 提示文本
children?: any // 插槽
type?: string // 类型1.input,2.textarea,3.select
value?: any
style?: object // 整行样式
labelStyle?: object // label样式
contentStyle?: object
required?: boolean
showIcon?: boolean // 是否显示右边的箭头type=select
}
const FromListCertification = (props: ListParams) => {
const { type = 'input', value = '', style = {}, labelStyle = {}, contentStyle = {}, required = false, showIcon = true } = props
return (
<View style={style} className="From-list-certification">
<View style={labelStyle} className={`From-list-certification-label ${required && 'From-list-certification-label-required'}`}>{props.label}</View>
<View onClick={props?.onClick} className="From-list-certification-right">
{
props.children
?? <View style={contentStyle} onClick={props?.onClick} className="From-list-certification-right-meet">
{
type == 'input'
? <View className="From-list-certification-input">
<Input value={value} placeholder-class="phcolor" onInput={props?.onInput} placeholder={props.placeholder} />
{value
&& <View><Text onClick={() => props.onInput && props.onInput({ detail: { value: '' } })} className="iconfont icon-qingkong" /></View>
}
</View>
: type == 'textarea'
? <Textarea value={value} placeholder-class="phcolor" onInput={props?.onInput} placeholder={props.placeholder} />
: <>
{
props.value
? <View>{value}</View>
: <View className="From-list-certification-right-placeholder">
{props.placeholder}
</View>
}
<View className="From-list-certification-right-enter">
{showIcon && <Text className="iconfont icon-a-moreback"></Text>}
</View>
</>
}
</View>
}
</View>
</View>
)
}
// 表单列表
const FromList = memo(FromListCertification)
export default FromList

View File

@ -1,21 +0,0 @@
.scroll_main{
height: 100%;
.infinite_scroll{
font-size: $font_size_medium;
color: $color_font_two;
width: 100%;
display: flex;
justify-content: center;
.loading_more{
display: flex;
align-items: center;
}
.noMore{
padding-top: 20px;
}
}
.scrollViewCon {
// height: 100%;
}
}

View File

@ -1,136 +0,0 @@
import type { ReactNode } from 'react'
import { useEffect, useMemo, useRef, useState } from 'react'
import InfiniteScroll from '@/components/infiniteScroll'
import { dataLoadingStatus, getFilterData } from '@/common/util'
import { alert, isEmptyObject } from '@/common/common'
interface Params {
children?: ReactNode
query?: object
fetchData: (data: object) => any
change?: (data: any) => void
}
const InfiniteScrollPaging = (props: Params) => {
const { query = {} } = props
// 加载刷新数据
const [refreshData, setRefreshData] = useState({
refreshStatus: false,
moreStatus: false,
page: 1,
size: 10,
loading: false,
})
const refreshDataRef = useRef({})
// 渲染(数据)
const [data, setData] = useState({
list: [],
total: 0,
})
const getData = async(startStatus, endStatus) => {
const tRefreshDataRef = refreshDataRef.current as any
setRefreshData({
...tRefreshDataRef,
...startStatus,
loading: true,
})
const result = await props.fetchData({
...query,
page: tRefreshDataRef.page,
size: tRefreshDataRef.size,
})
if (result.success) {
// 返回数据
props.change && props.change(result)
if (result.data.total <= 0) {
setRefreshData({
...tRefreshDataRef,
...endStatus,
loading: false,
})
}
else {
setData({
list: result.data.list,
// list: tRefreshDataRef.page>1?(dataRef.current as any).list.concat(result.data.list):result.data.list,
total: result.data.total,
})
setRefreshData({
...tRefreshDataRef,
refreshStatus: false,
moreStatus: false,
loading: false,
})
}
}
else {
alert.none(result.msg)
setRefreshData({
...tRefreshDataRef,
refreshStatus: false,
moreStatus: true,
loading: false,
})
}
}
const dataRef = useRef({})
// 下拉刷新
const handleRefresh = async() => {
const tRefreshData = refreshDataRef.current as any
setRefreshData({
...tRefreshData,
page: 1,
size: 10,
})
getData({ refreshStatus: true, moreStatus: false }, { refreshStatus: false, moreStatus: true })
}
// 加载更多
const handleMoreLoad = async() => {
const t = dataRef.current as any
const tRefreshData = refreshDataRef.current as any
if (t.list.length < t.total) {
setRefreshData({
...tRefreshData,
page: ++tRefreshData.page,
size: ++tRefreshData.page * tRefreshData.size,
})
getData(
{
moreStatus: true,
},
{
moreStatus: true,
},
)
}
}
// 数据加载状态
const statusMore = useMemo(() => {
return dataLoadingStatus({ list: data.list, total: data.total, status: refreshData.loading })
}, [refreshData.loading])
useEffect(() => {
refreshDataRef.current = refreshData
dataRef.current = data
getData({ moreStatus: true }, { moreStatus: true })
}, [])
useEffect(() => {
if (!isEmptyObject(query)) {
setData({ list: [], total: 0 })
getData({ moreStatus: true }, { moreStatus: true })
}
}, [query])
return (
<InfiniteScroll
refresherEnabled
refresherTriggered={refreshData.refreshStatus}
moreStatus={refreshData.moreStatus}
selfOnRefresherRefresh={handleRefresh}
selfonScrollToLower={handleMoreLoad}
statusMore={statusMore}
>
{props.children}
</InfiniteScroll>
)
}
export default InfiniteScrollPaging

View File

@ -1,24 +0,0 @@
import type { InputProps } from '@tarojs/components'
import { CustomWrapper, Input, View } from '@tarojs/components'
import type { FC } from 'react'
import React from 'react'
// 解决 input 组件输入过快会出现闪烁的问题
// https://github.com/NervJS/taro/issues/9664
interface PropsType extends InputProps {
customClassName?: string
customStyle?: React.CSSProperties
customInputStyle?: React.CSSProperties
customInputClassName?: string
}
const InputX: FC<PropsType> = (props) => {
const { customClassName, customStyle, customInputStyle, customInputClassName, ...inputProps } = props
return (
<View className={customClassName} style={customStyle}>
<CustomWrapper>
<Input className={customInputClassName} style={customInputStyle} {...inputProps} ></Input>
</CustomWrapper>
</View>
)
}
export default InputX

View File

@ -1,34 +0,0 @@
.labAndImg_main {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
// border: 1px #eee solid;
display: flex;
justify-content: center;
.boxColor {
width: 100%;
height: 100%;
border-radius: 8px;
box-sizing: border-box;
}
.labAndImg_image {
width: 100%;
height: 100%;
border-radius: 8px;
}
.labAndImg_name {
position: absolute;
margin: auto;
bottom: 0;
left: 0;
right: 0;
width: 80%;
text-align: center;
font-size: 24px;
border-radius: 50px;
padding: 7px;
background-color: #fff;
@include common_ellipsis;
}
}

View File

@ -1,103 +0,0 @@
import { Image, View } from '@tarojs/components'
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import LabAndImgShow from '../LabAndImgShow'
import styles from './index.module.scss'
import { formatImgUrl, formatRemoveHashTag } from '@/common/format'
export type onClickLabAndImgEvent = LabAndImgProps['value']
// 该组件宽高为100%需调整外层元素宽高
export interface LabAndImgProps {
value: {
texture_url?: string // 纹理图路径
lab?: { l: number; a: number; b: number } // lab
rgb?: { r: number; g: number; b: number } // rgb
title?: string
[property: string]: any
}
customImageStyle?: React.CSSProperties
showStatus?: boolean
onClick?: (val: onClickLabAndImgEvent) => void
round?: boolean
name?: string
suffix?: string
}
const LabAndImg = ({ value, onClick, showStatus = false, round = false, name = '', customImageStyle = {}, suffix = '' }: LabAndImgProps) => {
const _value = useRef(value)
// 重新渲染时 更新 _value
_value.current = value
// lab是否都是0
const rgbStyle = useMemo(() => {
const value = _value.current
if (value?.lab && (value?.lab.l || value?.lab.a || value?.lab.b)) {
return { backgroundColor: `rgb(${value.rgb?.r} ${value.rgb?.g} ${value.rgb?.b})` }
}
else {
return null
}
}, [_value.current])
// useEffect(() => {
// if (value?.texture_url) {
// const imgs = value.texture_url.split(',').map((item) => {
// return formatImgUrl(item, suffix)
// })
// setImgs(() => imgs[0])
// }
// }, [value])
const img = useMemo(() => {
const value = _value.current
if (value?.texture_url) {
const imgs = value.texture_url.split(',').map((item) => {
return formatImgUrl(item, suffix)
})
return imgs[0]
}
else {
return ''
}
}, [_value.current, suffix])
const [labAndImgShow, setLabAndImgShow] = useState(false)
const closeLabAndImgShow = useCallback(() => {
setLabAndImgShow(false)
}, [])
const onShowLabAndImg = () => {
onClick?.(_value.current)
if (!showStatus) { return false }
setLabAndImgShow(true)
}
const [_, setForceUpdate] = useState({})
const checkLoad = () => {
_value.current = { ..._value.current, texture_url: '' }
setForceUpdate({})
}
return (
<>
<View className={styles.labAndImg_main} style={{ borderRadius: round ? '50%' : '' }} onClick={onShowLabAndImg}>
{_value.current.texture_url && (
<Image
lazyLoad
mode="aspectFill"
src={img}
onError={checkLoad}
className={styles.labAndImg_image}
style={{ borderRadius: round ? '50%' : '', ...customImageStyle }}
></Image>
)}
{!_value.current.texture_url && rgbStyle && <View className={styles.boxColor} style={{ ...rgbStyle, borderRadius: round ? '50%' : '', ...customImageStyle }}></View>}
{!_value.current.texture_url && !rgbStyle && (
<Image mode="aspectFill" src={formatImgUrl('')} className={styles.labAndImg_image} style={{ borderRadius: round ? '50%' : '', ...customImageStyle }} lazyLoad></Image>
)}
{name && <View className={styles.labAndImg_name}>{name}</View>}
</View>
<LabAndImgShow suffix={suffix} value={_value.current} show={labAndImgShow} onClose={closeLabAndImgShow} />
</>
)
}
export default memo(LabAndImg)

View File

@ -1,35 +0,0 @@
.labAndImg_main {
width: 100%;
height: 100%;
overflow: hidden;
position: relative;
// border: 1px #eee solid;
display: flex;
justify-content: center;
.boxColor {
width: 100%;
height: 100%;
border-radius: 20px;
// border: 1px solid #818181;
box-sizing: border-box;
}
.labAndImg_image {
width: 100%;
height: 100%;
border-radius: 20px;
}
.labAndImg_name {
position: absolute;
margin: auto;
bottom: 0;
left: 0;
right: 0;
width: 80%;
text-align: center;
font-size: 24px;
border-radius: 50px;
padding: 7px;
background-color: #fff;
@include common_ellipsis;
}
}

View File

@ -1,81 +0,0 @@
import { Image, View } from '@tarojs/components'
import { memo, useCallback, useEffect, useMemo, useState } from 'react'
import LabAndImgShow from '../LabAndImgShow'
import styles from './index.module.scss'
import { formatImgUrl, formatRemoveHashTag } from '@/common/format'
// 该组件宽高为100%需调整外层元素宽高
interface Param {
value: {
texture_url?: string // 纹理图路径
lab?: { l: number; a: number; b: number } // lab
rgb?: { r: number; g: number; b: number } // rgb
title?: string
}
customImageStyle?: React.CSSProperties
showStatus?: true | false
onClick?: (val: Param['value']) => void
round?: boolean
name?: string
}
const LabAndImg = ({ value, onClick, showStatus = false, round = false, name = '', customImageStyle = {} }: Param) => {
const [imgs, setImgs] = useState<string>('')
// lab是否都是0
const rgbStyle = useMemo(() => {
if (value?.lab && (value?.lab.l || value?.lab.a || value?.lab.b)) {
return { backgroundColor: `rgb(${value.rgb?.r} ${value.rgb?.g} ${value.rgb?.b})` }
}
else {
return null
}
}, [value])
useEffect(() => {
if (value?.texture_url) {
const imgs = value.texture_url.split(',').map((item) => {
return formatImgUrl(item)
})
setImgs(() => imgs[0])
}
}, [value])
const [labAndImgShow, setLabAndImgShow] = useState(false)
const closeLabAndImgShow = useCallback(() => {
setLabAndImgShow(false)
}, [])
const onShowLabAndImg = (e) => {
onClick?.(value)
if (!showStatus) { return false }
setLabAndImgShow(true)
}
const checkLoad = (val) => {
setImgs(() => formatImgUrl(''))
}
return (
<>
<View className={styles.labAndImg_main} style={{ borderRadius: round ? '50%' : '' }} onClick={onShowLabAndImg}>
{value.texture_url && (
<Image
lazyLoad
mode="aspectFill"
src={imgs}
onError={e => checkLoad(e)}
className={styles.labAndImg_image}
style={{ borderRadius: round ? '50%' : '', ...customImageStyle }}
></Image>
)}
{!value.texture_url && rgbStyle && <View className={styles.boxColor} style={{ ...rgbStyle, borderRadius: round ? '50%' : '', ...customImageStyle }}></View>}
{!value.texture_url && !rgbStyle && (
<Image mode="aspectFill" src={formatImgUrl('')} className={styles.labAndImg_image} style={{ borderRadius: round ? '50%' : '', ...customImageStyle }} lazyLoad></Image>
)}
{name && <View className={styles.labAndImg_name}>{name}</View>}
</View>
<LabAndImgShow value={value} show={labAndImgShow} onClose={closeLabAndImgShow} />
</>
)
}
export default memo(LabAndImg)

View File

@ -1,45 +0,0 @@
.main{
position: fixed;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
background-color: rgba(0,0,0, 0.8);
display: flex;
justify-content: center;
align-items: flex-start;
z-index: 99999;
.con{
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 100%;
height: 60vh;
margin-top: 100px;
padding: 20px;
box-sizing: border-box;
.rgb{
width: 600px;
height: 600px;
border-radius: 20px;
}
image{
width:100%;
border-radius: 10px;
}
.name {
width: 488px;
height: 72px;
color: #fff;
text-align: center;
font-size: 26px;
border-radius: 20px;
line-height: 72px;
margin-top: 10px;
background-color: rgba(0,0,0, 0.5);
padding: 0 10px;
@include common_ellipsis(1);
}
}
}

View File

@ -1,99 +0,0 @@
import { Image, View } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { useEffect, useMemo, useState } from 'react'
import styles from './index.module.scss'
import { formatImgUrl } from '@/common/format'
export interface colorParams {
value?: {
texture_url?: string // 纹理图路径
lab?: { l: number; a: number; b: number } // lab
rgb?: { r: number; g: number; b: number } // rgb
title?: string // 标题
}
show?: boolean
onClose?: () => void
showNumber?: number // 图片显示张数0不限制
suffix?: string
}
const LabAndImgShow = (props: colorParams) => {
const { value, show = false, onClose, showNumber = 1, suffix = '!w200' } = props
// 显示颜色
const [labShow, setLabShow] = useState(false)
// lab是否都是0
const rgbStyle = useMemo(() => {
if (value?.lab && (value.lab.l || value.lab.a || value.lab.b)) {
return { backgroundColor: `rgb(${value.rgb?.r} ${value.rgb?.g} ${value.rgb?.b})` }
}
else {
return null
}
}, [value])
// 显示图片
const onShowImage = () => {
onClose?.()
let res: string[] = []
if (value?.texture_url) {
res = value?.texture_url?.split(',').map(item => formatImgUrl(item, suffix))
}
console.log('res==>', res)
const n_res = showNumber == 0 ? res : res?.splice(0, showNumber)
console.log('第一张图片', n_res[0])
Taro.previewImage({
current: n_res[0],
urls: n_res,
})
}
const [reload, setReload] = useState(false)
// 检测图片是否加载成功
const checkLoad = () => {
console.log('图片加载失败')
setReload(true)
}
const onLoad = () => {
setReload(false)
}
useEffect(() => {
if (reload) {
if (show && rgbStyle) {
setLabShow(true)
return
}
}
if (show && value?.texture_url) {
onShowImage()
}
else if (show && rgbStyle) {
setLabShow(true)
}
}, [show, reload])
useEffect(() => {
if (!show) { setLabShow(false) }
}, [show])
return (
<View>
{labShow && (
<View className={styles.main} catch-move="true" onClick={() => onClose?.()}>
<View className={styles.con}>
<View className={styles.rgb} style={rgbStyle!}></View>
<View className={styles.name}>{value?.title}</View>
</View>
</View>
)}
{
value?.texture_url && <Image
src={formatImgUrl(value?.texture_url)}
onError={checkLoad}
onLoad={onLoad}
style={{ position: 'absolute', top: '9999', width: '0', height: '0' }}
></Image>
}
</View>
)
}
export default LabAndImgShow

View File

@ -1,12 +0,0 @@
.loadMore{
display: flex;
flex-flow: row nowrap;
justify-content: center;
align-items: center;
font-size: 28px;
color: $color_font_three;
padding: 24px 0;
}
.empty{
padding: 100px;
}

View File

@ -1,52 +0,0 @@
import { Text, View } from '@tarojs/components'
import type { FC } from 'react'
import Iconfont from '../iconfont/iconfont'
import LoadingCard from '../loadingCard/index'
import styles from './index.module.scss'
export type LoadMoreStatus = 'more' | 'loading' | 'noMore' | 'empty'
interface LoadMoreEvent {
onClick?: () => void
}
interface LoadMorePropsType extends LoadMoreEvent {
status: LoadMoreStatus
moreText?: string
loadingText?: string
noMoreText?: string
emptyText?: string
}
const LoadMore: FC<LoadMorePropsType> = (props) => {
const { status, moreText = '查看更多', loadingText = '加载中', noMoreText = '没有更多', emptyText = '暂无数据', onClick } = props
const handleShowMore = () => {
onClick && onClick()
}
let component: JSX.Element | null = null
if (status === 'loading') {
component = <LoadingCard title={loadingText}></LoadingCard>
}
else if (status === 'more') {
component = (
<View className="flex-row" onClick={handleShowMore}>
<Text style={{ marginRight: '5px' }}>{moreText}</Text>
<Iconfont name="icon-zhankai" size={32}></Iconfont>
</View>
)
}
else if (status === 'empty') {
component = (
<View className={styles.empty}>
<Text>{emptyText}</Text>
</View>
)
}
else {
component = <Text>{noMoreText}</Text>
}
return <View className={styles.loadMore}>{component}</View>
}
export default LoadMore

View File

@ -1,16 +0,0 @@
.message-custom-tips{
width: 100%;
height: 66px;
background: #FFE6CE;
border: 2px solid #ffe6ce;
padding: 0 30px;
display: flex;align-items: center;
font-size: 24px;
font-weight: 400;
box-sizing: border-box;
color: #EE7500;
text{
margin-right: 10px;
font-size: 30px;
}
}

View File

@ -1,19 +0,0 @@
import { Button, Navigator, ScrollView, Text, View } from '@tarojs/components'
import { memo } from 'react'
import './index.scss'
interface Params{
text: String// 提示信息
}
// 消息提示
const Message = (props: Params) => {
return (
<View className="message-custom-tips">
<Text className="iconfont icon-zhuyi"></Text> {props.text}
</View>
)
}
export default memo(Message)

View File

@ -1,21 +0,0 @@
.popupBox {
.scroStyle {
height: 900px;
}
.sure {
// margin-top: 35px;
margin-left: 40px;
margin-right: 40px;
// width: 670px;
height: 80px;
background: #337FFF;
border-radius: 44px;
font-size: 28px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
text-align: center;
line-height: 80px;
}
}

View File

@ -1,183 +0,0 @@
import { Image, ScrollView, View } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
// import BottomBtns from '@/components/BottomBtns'
import { formatPriceDiv } from '@/common/format'
import Popup from '@/components/popup'
import useCheckAuthorize from '@/use/useCheckAuthorize'
import { alert } from '@/common/common'
import { GetReturnPayCode } from '@/api/order'
import { formatDateTime, formatWeightDiv } from '@/common/format'
interface Props {
obj: any
// picUrl?: string,
showPopup: boolean
popupClose: () => void
}
const RefundCodelist = (props: Props) => {
const { fetchData: payFetch } = GetReturnPayCode()
const [PicUrl, setPicUrl] = useState<string>('')
const totalNums = useMemo(() => {
if (props?.obj.type == 1 || props?.obj.type == 3) {
return props?.obj.quality_check_pass_number
}
else {
return props?.obj.total_number
}
}, [props?.obj])
const getPic = async() => {
Taro.showLoading({
title: '请稍等...',
mask: true,
})
const list: any = []
let arr: any[] = []
if (props.obj.type == 1 || props?.obj.type == 3) {
arr = props.obj.quality_check_pass_product
}
else {
arr = props.obj.product_list
}
arr.forEach((item) => {
item.product_colors.forEach((it) => {
list.push({
product_code: item.code,
product_name: item.name,
product_color_code: it.code,
product_color_name: it.name,
num: it.roll.toString(),
weight: formatWeightDiv(it.label_weight).toString(),
deduction_weight: formatWeightDiv(it.deductions_weight).toString(),
settle_weight: formatWeightDiv(it.settle_weight).toString(),
deduction_amount: (it.deductions_amount / 100).toString(),
sale_price: (it.sale_price / 100).toString(),
total_price: (it.estimate_amount / 100).toString(),
length: (it.length / 100).toString(),
weight_error: formatWeightDiv(it.settle_weight_error).toString(),
})
})
})
const query = {
list,
title: '售后确认单',
order_type: props.obj.sale_mode_name,
sale_user: props.obj.sale_user_name,
order_created_time: formatDateTime(props.obj.create_time),
order_no: props.obj.return_order_no,
pay_account: props.obj.transfer_remittance_account,
bank_account_name: props.obj.account_name,
bank_name: props.obj.bank_of_deposit,
client: props.obj.purchaser_name,
order_total_length: (props.obj.total_number / 100).toString(),
order_total_price: (
props.obj.refund_amount / 100
).toString(),
order_total_num: totalNums.toString(),
order_total_settle_weight: (
props.obj.order_total_settle_weight / 1000
).toString(),
order_total_deduction_weight: (
props.obj.order_total_deduction_weight / 1000
).toString(),
order_total_deduction_amount: (
props.obj.order_total_deduction_amount / 100
).toString(),
order_total_weight_error: (
props.obj.total_weight_error / 1000
).toString(),
show_sale_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_total_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_deduction_amount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_order_total_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_order_total_deduction_amount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
// show_tips: true,
// tips: `请核对本单后验收, <b>如发现质量问题请于收到货之日起3天内与平台客服联系协商解决</b>逾期不作处理即表示购方默认对货物无异议;<b>购方确认无任何问题方可裁剪/加工,一经裁剪,缩水等工艺,平台概不负责;</b>
// 看布购货,请先试缩水,并注意分缸裁布!如需撞色拼接,请先试色牢度。非质量问题,恕不退换,谢谢合作!`,
}
const res = await payFetch(query)
if (res.data) {
setPicUrl(res.data.base64)
Taro.hideLoading()
}
}
const fileData = useRef({
filePath: '',
base64: '',
})
// 预览图片
const showImage = () => {
const time = new Date().valueOf()
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(PicUrl) || []
const filePath = `${Taro.env.USER_DATA_PATH}/img${time}.${format}`
fileData.current.filePath = filePath
fileData.current.base64 = bodyData
const save = Taro.getFileSystemManager()
save.writeFile({
filePath: fileData.current.filePath,
data: fileData.current.base64,
encoding: 'base64',
})
Taro.previewImage({
current: fileData.current.filePath, // 当前显示
urls: [fileData.current.filePath], // 需要预览的图片http链接列表
})
}
// 检查是否开启保存图片权限
const { check } = useCheckAuthorize({ scope: 'scope.writePhotosAlbum', msg: '您没授权,无法保存图片' })
useEffect(() => {
// 判断进来的是否是空对象,减少性能问题
const length = Object.keys(props.obj)
if (length.length > 0) { getPic() }
}, [props.obj])
// 保存图片
const saveImage = () => {
const time = new Date().valueOf()
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(PicUrl) || []
const filePath = `${Taro.env.USER_DATA_PATH}/img${time}.${format}`
fileData.current.filePath = filePath
fileData.current.base64 = bodyData
const save = Taro.getFileSystemManager()
save.writeFile({
filePath: fileData.current.filePath,
data: fileData.current.base64,
encoding: 'base64',
})
alert.loading('正在保存图片')
Taro.saveImageToPhotosAlbum({
filePath: fileData.current.filePath,
success() {
alert.success('图片保存成功')
},
fail(err) {
console.log('err::', err)
},
})
}
const saveImageCheck = async() => {
const res = await check()
res && saveImage()
}
return (
<Popup show={props.showPopup} title="退款码单" onClose={() => props.popupClose?.()}>
<View className={styles.popupBox}>
<ScrollView enhanced scrollY className={styles.scroStyle}>
<View className={styles.pic}>
<Image lazyLoad mode="widthFix" style={{ width: '100%', height: '100%' }} src={PicUrl} onClick={() => showImage()}></Image>
</View>
</ScrollView>
<View className={styles.sure} onClick={() => saveImageCheck()}></View>
</View>
</Popup>
)
}
export default memo(RefundCodelist)

View File

@ -1,21 +0,0 @@
.popupBox {
.scroStyle {
height: 900px;
}
.sure {
// margin-top: 35px;
margin-left: 40px;
margin-right: 40px;
// width: 670px;
height: 80px;
background: #337FFF;
border-radius: 44px;
font-size: 28px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
text-align: center;
line-height: 80px;
}
}

View File

@ -1,180 +0,0 @@
import { Image, ScrollView, View } from '@tarojs/components'
import Taro from '@tarojs/taro'
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import classnames from 'classnames'
import styles from './index.module.scss'
// import BottomBtns from '@/components/BottomBtns'
import { formatPriceDiv } from '@/common/format'
import Popup from '@/components/popup'
import useCheckAuthorize from '@/use/useCheckAuthorize'
import { alert } from '@/common/common'
import { GetPayCode } from '@/api/order'
import { formatDateTime, formatRemoveHashTag, formatWeightDiv } from '@/common/format'
import { PAY_H5_CODE_URL } from '@/common/constant'
interface Props {
obj: any
// picUrl?: string,
showPopup: boolean
popupClose: () => void
}
const CodeList = (props: Props) => {
const { fetchData: payFetch } = GetPayCode()
const [PicUrl, setPicUrl] = useState<string>('')
const getPic = async() => {
Taro.showLoading({
title: '请稍等...',
mask: true,
})
const list: any = []
props.obj.product_list?.forEach((item) => {
item.product_colors.forEach((it) => {
list.push({
product_code: item.code,
product_name: item.name,
product_color_code: formatRemoveHashTag(it.code),
product_color_name: it.name,
num: it.roll.toString(),
weight: formatWeightDiv(it.actual_weight).toString(),
sale_price: (it.sale_price / 100).toString(),
total_price:
it.total_sale_price !== 0
? (it.total_sale_price / 100).toString()
: (it.estimate_amount / 100).toString(),
length: (it.length / 100).toString(),
weight_error: formatWeightDiv(it.weight_error).toString(),
})
})
})
const query = {
list,
title: '面料销售电子确认单',
// show_qrcode: true,
// show_barcode: true,
order_type: props?.obj.sale_mode_name,
shipment_mode: props?.obj.shipment_mode_name,
company: props?.obj.title_purchaser_name,
sale_user: props?.obj.sale_user_name,
order_created_time: formatDateTime(props?.obj.create_time),
order_no: props?.obj.order_no,
target_user_name: props?.obj.target_user_name,
target_address: props?.obj.address_detail,
target_description: props?.obj.remark,
pay_account: props?.obj.transfer_remittance_account,
bank_account_name: props?.obj.account_name,
bank_name: props?.obj.bank_of_deposit,
pay_type: props?.obj.settle_mode_name,
client: props?.obj.purchaser_name,
phone: props?.obj.target_user_phone,
order_total_length: (props?.obj.total_number / 100).toString(),
order_total_price: (
props?.obj.bill_total_sale_price / 100
).toString(),
total_weight_error_discount: (
props?.obj.total_weight_error_discount / 100
).toString(),
order_total_num: props?.obj.total_number.toString(),
qrcode: `${PAY_H5_CODE_URL}?sale_order_no=${props?.obj.order_no}`,
order_total_weight: (props?.obj.total_weight / 1000).toString(),
estimate_amount: (props?.obj.estimate_amount / 100).toString(),
total_sale_price: (props?.obj.total_sale_price / 100).toString(),
actual_amount: (props?.obj.actual_amount / 100).toString(),
wait_pay_amount: (props?.obj.wait_pay_amount / 100).toString(),
order_total_weight_error: (
props?.obj.total_weight_error / 1000
).toString(),
show_sale_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_total_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_estimate_amount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_total_sale_price: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_total_weight_error_discount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_actual_amount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_wait_pay_amount: props?.obj?.sale_mode === 0 && props?.obj?.is_display_price ? true : !!((props?.obj?.sale_mode === 1 || props?.obj?.sale_mode === 2)),
show_tips: true,
tips: `请核对本单后验收, <b>如发现质量问题请于收到货之日起3天内与平台客服联系协商解决</b>逾期不作处理即表示购方默认对货物无异议;<b>购方确认无任何问题方可裁剪/加工,一经裁剪,缩水等工艺,平台概不负责;</b>
退`,
}
const res = await payFetch(query)
if (res.data) {
setPicUrl(res.data.base64)
Taro.hideLoading()
}
}
const fileData = useRef({
filePath: '',
base64: '',
})
// 预览图片
const showImage = () => {
const time = new Date().valueOf()
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(PicUrl) || []
const filePath = `${Taro.env.USER_DATA_PATH}/img${time}.${format}`
fileData.current.filePath = filePath
fileData.current.base64 = bodyData
const save = Taro.getFileSystemManager()
save.writeFile({
filePath: fileData.current.filePath,
data: fileData.current.base64,
encoding: 'base64',
})
Taro.previewImage({
current: fileData.current.filePath, // 当前显示
urls: [fileData.current.filePath], // 需要预览的图片http链接列表
})
}
// 检查是否开启保存图片权限
const { check } = useCheckAuthorize({ scope: 'scope.writePhotosAlbum', msg: '您没授权,无法保存图片' })
// 保存图片
const saveImage = () => {
const time = new Date().valueOf()
const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(PicUrl) || []
const filePath = `${Taro.env.USER_DATA_PATH}/img${time}.${format}`
fileData.current.filePath = filePath
fileData.current.base64 = bodyData
const save = Taro.getFileSystemManager()
save.writeFile({
filePath: fileData.current.filePath,
data: fileData.current.base64,
encoding: 'base64',
})
alert.loading('正在保存图片')
Taro.saveImageToPhotosAlbum({
filePath: fileData.current.filePath,
success() {
alert.success('图片保存成功')
},
fail(err) {
console.log('err::', err)
},
})
}
const saveImageCheck = async() => {
const res = await check()
res && saveImage()
}
useEffect(() => {
// 判断进来的是否是空对象,减少性能问题
const length = Object.keys(props.obj)
if (length.length > 0) { getPic() }
}, [props.obj])
return (
<Popup show={props.showPopup} title="销售码单" onClose={() => props.popupClose?.()}>
<View className={styles.popupBox}>
<ScrollView enhanced scrollY className={styles.scroStyle}>
<View className={styles.pic}>
<Image lazyLoad mode="widthFix" style={{ width: '100%', height: '100%' }} src={PicUrl} onClick={() => showImage()}></Image>
</View>
</ScrollView>
<View className={styles.sure} onClick={() => saveImageCheck()}></View>
</View>
</Popup>
)
}
export default memo(CodeList)

View File

@ -1,22 +0,0 @@
.status_list {
display: flex;
flex-flow: row nowrap;
background-color: #fff;
font-size: $font_size;
color: #5c5c5c;
// margin-top: 20px;
.status_item {
padding: 20px;
box-sizing: border-box;
}
.list_scroll {
display: flex;
justify-content: space-around;
white-space: nowrap;
}
}
.selected {
font-weight: 700;
color: #337fff;
border-bottom: 4px solid #337fff;
}

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