diff --git a/mes-ui/uni-app/.hbuilderx/launch.json b/mes-ui/uni-app/.hbuilderx/launch.json new file mode 100644 index 00000000..5e2090f2 --- /dev/null +++ b/mes-ui/uni-app/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ + "version" : "1.0", + "configurations" : [ + { + "playground" : "standard", + "type" : "uni-app:app-android" + }, + { + "app-plus" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/mes-ui/uni-app/.vscode/settings.json b/mes-ui/uni-app/.vscode/settings.json new file mode 100644 index 00000000..da12062f --- /dev/null +++ b/mes-ui/uni-app/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "eggHelper.serverPort": 35684 +} \ No newline at end of file diff --git a/mes-ui/uni-app/LICENSE b/mes-ui/uni-app/LICENSE new file mode 100644 index 00000000..29f81d81 --- /dev/null +++ b/mes-ui/uni-app/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/mes-ui/uni-app/README.md b/mes-ui/uni-app/README.md new file mode 100644 index 00000000..fee5849c --- /dev/null +++ b/mes-ui/uni-app/README.md @@ -0,0 +1,39 @@ +### 技术栈 + +- 前端框架:[uni-app](https://uniapp.dcloud.net.cn/) (Vue3 + TS) +- 状态管理:[pinia](https://pinia.vuejs.org/zh/) +- 组件库:[uni-ui](https://uniapp.dcloud.net.cn/component/uniui/uni-ui.html) + +### 开发环境 + +- 开发工具: VS Code 、 HbuilderX 、 微信开发者工具 +- Node 版本: v16.15.0 +- pnpm 版本:v8.6.10 + +### 运行程序 + +1. 安装依赖 + +```shell +# npm +npm i --registry=https://registry.npmmirror.com + +# pnpm +pnpm i --registry=https://registry.npmmirror.com +``` + +2. 运行程序 + +```shell +# 微信小程序端 +npm run dev:mp-weixin + +# H5端 +npm run dev:h5 + +# App端 +需 HbuilderX 工具,运行 - 运行到手机或模拟器 +``` + +3. 微信开发者工具导入 `/dist/dev/mp-weixin` 目录 + diff --git a/mes-ui/uni-app/deploy.sh b/mes-ui/uni-app/deploy.sh new file mode 100755 index 00000000..6ed6f01d --- /dev/null +++ b/mes-ui/uni-app/deploy.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh + +# 确保脚本抛出遇到的错误 +set -e + + +# 1. 先提交 master + +git push git@github.com:xxx.git master:master + +# 2. 打包生成静态文件 +# npm run build:h5 +# 注意:项目使用了 uniClound,需在 HbuilderX 打包 H5 网站,否则无法使用云功能 +cli publish --platform h5 --project erabbit-uni-app --spaceId mp-2fac390c-2ea7-4d12-9726-f5b9a3bb6c37 + +# 3. 生成流水线.yml +mkdir -p "./dist/build/h5/.github/workflows" +cp "./deploy.yml" "./dist/build/h5/.github/workflows/deploy.yml" + +# 4. 进入生成的文件夹,提交到主仓库 gh-pages 分支 +# 如果是发布到自定义域名 +# echo 'www.example.com' > CNAME +cd dist/build/h5 +git init -b master +git add -A +git commit -m 'deploy: gh-pages' + +# 如果发布到 https://.github.io/ +# git push -f git@gitee.com:/.git master:gh-pages +git push -f git@github.com:xxx.git master:gh-pages + +cd - diff --git a/mes-ui/uni-app/deploy.yml b/mes-ui/uni-app/deploy.yml new file mode 100644 index 00000000..388924c7 --- /dev/null +++ b/mes-ui/uni-app/deploy.yml @@ -0,0 +1,36 @@ +name: deploy + +on: + push: + branches: [gh-pages] + pull_request: + branches: [gh-pages] + +jobs: + gitee: + runs-on: ubuntu-latest + steps: + - name: Sync To Gitee + uses: wearerequired/git-mirror-action@master + env: + # 注意在 Settings->Secrets 配置 GITEE_RSA_PRIVATE_KEY + SSH_PRIVATE_KEY: ${{ secrets.GITEE_RSA_PRIVATE_KEY }} + with: + # 注意替换为你的 GitHub 源仓库地址 + source-repo: git@github.com:xxx.git + # 注意替换为你的 Gitee 目标仓库地址 + destination-repo: git@gitee.com:xxx.git + # dry-run: true + + - name: Build Gitee Pages + uses: yanglbme/gitee-pages-action@main + with: + # 注意替换为你的 Gitee 用户名 + gitee-username: xxx + # 注意在 Settings->Secrets 配置 GITEE_PASSWORD + gitee-password: ${{ secrets.GITEE_PASSWORD }} + # 注意替换为你的 Gitee 仓库,仓库名严格区分大小写,请准确填写,否则会出错 + gitee-repo: Megasu/uniapp-shop-vue3-ts + # 要部署的分支,默认是 master,若是其他分支,则需要指定(指定的分支必须存在) + branch: gh-pages + # directory: docs/.vitepress/dist diff --git a/mes-ui/uni-app/index.html b/mes-ui/uni-app/index.html new file mode 100644 index 00000000..04d9a456 --- /dev/null +++ b/mes-ui/uni-app/index.html @@ -0,0 +1,42 @@ + + + + + + + + + + + + +
+ +
+ + // + + + + diff --git a/mes-ui/uni-app/package.json b/mes-ui/uni-app/package.json new file mode 100644 index 00000000..e23aafed --- /dev/null +++ b/mes-ui/uni-app/package.json @@ -0,0 +1,94 @@ +{ + "name": "uni-app-personal", + "version": "0.0.0", + "scripts": { + "dev:app": "uni -p app", + "dev:app-android": "uni -p app-android", + "dev:app-ios": "uni -p app-ios", + "dev:custom": "uni -p", + "dev:h5": "uni", + "dev:h5:ssr": "uni --ssr", + "dev:mp-alipay": "uni -p mp-alipay", + "dev:mp-baidu": "uni -p mp-baidu", + "dev:mp-kuaishou": "uni -p mp-kuaishou", + "dev:mp-lark": "uni -p mp-lark", + "dev:mp-qq": "uni -p mp-qq", + "dev:mp-toutiao": "uni -p mp-toutiao", + "dev:mp-weixin": "uni -p mp-weixin", + "dev:quickapp-webview": "uni -p quickapp-webview", + "dev:quickapp-webview-huawei": "uni -p quickapp-webview-huawei", + "dev:quickapp-webview-union": "uni -p quickapp-webview-union", + "build:app": "uni build -p app", + "build:app-android": "uni build -p app-android", + "build:app-ios": "uni build -p app-ios", + "build:custom": "uni build -p", + "build:h5": "uni build", + "build:h5:ssr": "uni build --ssr", + "build:mp-alipay": "uni build -p mp-alipay", + "build:mp-baidu": "uni build -p mp-baidu", + "build:mp-kuaishou": "uni build -p mp-kuaishou", + "build:mp-lark": "uni build -p mp-lark", + "build:mp-qq": "uni build -p mp-qq", + "build:mp-toutiao": "uni build -p mp-toutiao", + "build:mp-weixin": "uni build -p mp-weixin", + "build:quickapp-webview": "uni build -p quickapp-webview", + "build:quickapp-webview-huawei": "uni build -p quickapp-webview-huawei", + "build:quickapp-webview-union": "uni build -p quickapp-webview-union", + "tsc": "vue-tsc --noEmit --skipLibCheck", + "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", + "prepare": "husky install", + "lint-staged": "lint-staged" + }, + "lint-staged": { + "*.{js,ts,vue}": [ + "eslint --fix" + ] + }, + "dependencies": { + "@dcloudio/uni-app": "3.0.0-3090920231225001", + "@dcloudio/uni-app-plus": "3.0.0-3090920231225001", + "@dcloudio/uni-components": "3.0.0-3090920231225001", + "@dcloudio/uni-h5": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-alipay": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-baidu": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-jd": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-kuaishou": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-lark": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-qq": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-toutiao": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-weixin": "3.0.0-3090920231225001", + "@dcloudio/uni-mp-xhs": "3.0.0-3090920231225001", + "@dcloudio/uni-quickapp-webview": "3.0.0-3090920231225001", + "@dcloudio/uni-ui": "^1.4.28", + "pinia": "2.0.27", + "pinia-plugin-persistedstate": "^3.2.0", + "vue": "3.4.21", + "vue-i18n": "9.10.1" + }, + "devDependencies": { + "@dcloudio/types": "3.4.8", + "@dcloudio/uni-automator": "3.0.0-3090920231225001", + "@dcloudio/uni-cli-shared": "3.0.0-3090920231225001", + "@dcloudio/uni-stacktracey": "3.0.0-3090920231225001", + "@dcloudio/uni-vue-devtools": "3.0.0-alpha-3080220230511001", + "@dcloudio/vite-plugin-uni": "3.0.0-3090920231225001", + "@rushstack/eslint-patch": "^1.1.4", + "@types/node": "^18.11.9", + "@uni-helper/uni-app-types": "^0.5.12", + "@uni-helper/uni-ui-types": "^0.5.11", + "@vue/eslint-config-prettier": "^7.0.0", + "@vue/eslint-config-typescript": "^11.0.0", + "@vue/runtime-core": "3.4.21", + "@vue/tsconfig": "^0.4.0", + "eslint": "^8.22.0", + "eslint-plugin-vue": "^9.3.0", + "husky": "^8.0.0", + "lint-staged": "^13.0.3", + "miniprogram-api-typings": "^3.12.0", + "prettier": "^2.7.1", + "sass": "^1.56.1", + "typescript": "^5.1.6", + "vite": "4.0.3", + "vue-tsc": "^1.8.8" + } +} diff --git a/mes-ui/uni-app/project.config.json b/mes-ui/uni-app/project.config.json new file mode 100644 index 00000000..532f76f1 --- /dev/null +++ b/mes-ui/uni-app/project.config.json @@ -0,0 +1,28 @@ +{ + "appid": "wxa29fe397274614b5", + "compileType": "miniprogram", + "libVersion": "3.3.0", + "packOptions": { + "ignore": [], + "include": [] + }, + "setting": { + "coverView": true, + "es6": true, + "postcss": true, + "minified": true, + "enhance": true, + "showShadowRootInWxmlPanel": true, + "packNpmRelationList": [], + "babelSetting": { + "ignore": [], + "disablePlugins": [], + "outputPath": "" + } + }, + "condition": {}, + "editorSetting": { + "tabIndent": "insertSpaces", + "tabSize": 4 + } +} \ No newline at end of file diff --git a/mes-ui/uni-app/project.private.config.json b/mes-ui/uni-app/project.private.config.json new file mode 100644 index 00000000..0f3f0e6a --- /dev/null +++ b/mes-ui/uni-app/project.private.config.json @@ -0,0 +1,7 @@ +{ + "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", + "projectname": "app-nx-personal", + "setting": { + "compileHotReLoad": true + } +} \ No newline at end of file diff --git a/mes-ui/uni-app/src/App.vue b/mes-ui/uni-app/src/App.vue new file mode 100644 index 00000000..a1be8ffb --- /dev/null +++ b/mes-ui/uni-app/src/App.vue @@ -0,0 +1,28 @@ + + + + diff --git a/mes-ui/uni-app/src/components/XtxGuess.vue b/mes-ui/uni-app/src/components/XtxGuess.vue new file mode 100644 index 00000000..2d1fc8b6 --- /dev/null +++ b/mes-ui/uni-app/src/components/XtxGuess.vue @@ -0,0 +1,152 @@ + + + + + diff --git a/mes-ui/uni-app/src/components/XtxSwiper.vue b/mes-ui/uni-app/src/components/XtxSwiper.vue new file mode 100644 index 00000000..526be33a --- /dev/null +++ b/mes-ui/uni-app/src/components/XtxSwiper.vue @@ -0,0 +1,40 @@ + + + + + diff --git a/mes-ui/uni-app/src/components/styles/XtxSwiper.scss b/mes-ui/uni-app/src/components/styles/XtxSwiper.scss new file mode 100644 index 00000000..79cc1415 --- /dev/null +++ b/mes-ui/uni-app/src/components/styles/XtxSwiper.scss @@ -0,0 +1,31 @@ +/* 轮播图 */ +.carousel { + height: 280rpx; + position: relative; + overflow: hidden; + transform: translateY(0); + background-color: #efefef; + .indicator { + position: absolute; + left: 0; + right: 0; + bottom: 16rpx; + display: flex; + justify-content: center; + .dot { + width: 30rpx; + height: 6rpx; + margin: 0 8rpx; + border-radius: 6rpx; + background-color: rgba(255, 255, 255, 0.4); + } + .active { + background-color: #fff; + } + } + .navigator, + .image { + width: 100%; + height: 100%; + } +} diff --git a/mes-ui/uni-app/src/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup.d.ts b/mes-ui/uni-app/src/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup.d.ts new file mode 100644 index 00000000..19ba3e32 --- /dev/null +++ b/mes-ui/uni-app/src/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup.d.ts @@ -0,0 +1,145 @@ +import { Component } from '@uni-helper/uni-app-types' + +/** SKU 弹出层 */ +export type SkuPopup = Component + +/** SKU 弹出层实例 */ +export type SkuPopupInstance = InstanceType + +/** SKU 弹出层属性 */ +export type SkuPopupProps = { + /** 双向绑定,true 为打开组件,false 为关闭组件 */ + modelValue: boolean + /** 商品信息本地数据源 */ + localdata: SkuPopupLocaldata + /** 按钮模式 1:都显示 2:只显示购物车 3:只显示立即购买 */ + mode?: 1 | 2 | 3 + /** 该商品已抢完时的按钮文字 */ + noStockText?: string + /** 库存文字 */ + stockText?: string + /** 点击遮罩是否关闭组件 */ + maskCloseAble?: boolean + /** 顶部圆角值 */ + borderRadius?: string | number + /** 最小购买数量 */ + minBuyNum?: number + /** 最大购买数量 */ + maxBuyNum?: number + /** 每次点击后的数量 */ + stepBuyNum?: number + /** 是否只能输入 step 的倍数 */ + stepStrictly?: boolean + /** 是否隐藏库存的显示 */ + hideStock?: false + /** 主题风格 */ + theme?: 'default' | 'red-black' | 'black-white' | 'coffee' | 'green' + /** 默认金额会除以100(即100=1元),若设置为0,则不会除以100(即1=1元) */ + amountType?: 1 | 0 + /** 自定义获取商品信息的函数(已知支付宝不支持,支付宝请改用localdata属性) */ + customAction?: () => void + /** 是否显示右上角关闭按钮 */ + showClose?: boolean + /** 关闭按钮的图片地址 */ + closeImage?: string + /** 价格的字体颜色 */ + priceColor?: string + /** 立即购买 - 按钮的文字 */ + buyNowText?: string + /** 立即购买 - 按钮的字体颜色 */ + buyNowColor?: string + /** 立即购买 - 按钮的背景颜色 */ + buyNowBackgroundColor?: string + /** 加入购物车 - 按钮的文字 */ + addCartText?: string + /** 加入购物车 - 按钮的字体颜色 */ + addCartColor?: string + /** 加入购物车 - 按钮的背景颜色 */ + addCartBackgroundColor?: string + /** 商品缩略图背景颜色 */ + goodsThumbBackgroundColor?: string + /** 样式 - 不可点击时,按钮的样式 */ + disableStyle?: object + /** 样式 - 按钮点击时的样式 */ + activedStyle?: object + /** 样式 - 按钮常态的样式 */ + btnStyle?: object + /** 字段名 - 商品表id的字段名 */ + goodsIdName?: string + /** 字段名 - sku表id的字段名 */ + skuIdName?: string + /** 字段名 - 商品对应的sku列表的字段名 */ + skuListName?: string + /** 字段名 - 商品规格名称的字段名 */ + specListName?: string + /** 字段名 - sku库存的字段名 */ + stockName?: string + /** 字段名 - sku组合路径的字段名 */ + skuArrName?: string + /** 字段名 - 商品缩略图字段名(未选择sku时) */ + goodsThumbName?: string + /** 被选中的值 */ + selectArr?: string[] + + /** 打开弹出层 */ + onOpen: () => void + /** 关闭弹出层 */ + onClose: () => void + /** 点击加入购物车时(需选择完SKU才会触发)*/ + onAddCart: (event: SkuPopupEvent) => void + /** 点击立即购买时(需选择完SKU才会触发)*/ + onBuyNow: (event: SkuPopupEvent) => void +} + +/** 商品信息本地数据源 */ +export type SkuPopupLocaldata = { + /** 商品 ID */ + _id: string + /** 商品名称 */ + name: string + /** 商品图片 */ + goods_thumb: string + /** 商品规格列表 */ + spec_list: SkuPopupSpecItem[] + /** 商品SKU列表 */ + sku_list: SkuPopupSkuItem[] +} + +/** 商品规格名称的集合 */ +export type SkuPopupSpecItem = { + /** 规格名称 */ + name: string + /** 规格集合 */ + list: { name: string }[] +} + +/** 商品SKU列表 */ +export type SkuPopupSkuItem = { + /** SKU ID */ + _id: string + /** 商品 ID */ + goods_id: string + /** 商品名称 */ + goods_name: string + /** 商品图片 */ + image: string + /** SKU 价格 * 100, 注意:需要乘以 100 */ + price: number + /** SKU 规格组成, 注意:需要与 spec_list 数组顺序对应 */ + sku_name_arr: string[] + /** SKU 库存 */ + stock: number +} + +/** 当前选择的sku数据 */ +export type SkuPopupEvent = SkuPopupSkuItem & { + /** 商品购买数量 */ + buy_num: number +} + +/** 全局组件类型声明 */ +declare module '@vue/runtime-core' { + export interface GlobalComponents { + 'vk-data-goods-sku-popup': SkuPopup + } +} diff --git a/mes-ui/uni-app/src/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup.vue b/mes-ui/uni-app/src/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup.vue new file mode 100644 index 00000000..799392d5 --- /dev/null +++ b/mes-ui/uni-app/src/components/vk-data-goods-sku-popup/vk-data-goods-sku-popup.vue @@ -0,0 +1,1426 @@ + + + + + diff --git a/mes-ui/uni-app/src/components/vk-data-input-number-box/vk-data-input-number-box.d.ts b/mes-ui/uni-app/src/components/vk-data-input-number-box/vk-data-input-number-box.d.ts new file mode 100644 index 00000000..52486675 --- /dev/null +++ b/mes-ui/uni-app/src/components/vk-data-input-number-box/vk-data-input-number-box.d.ts @@ -0,0 +1,52 @@ +import { Component } from '@uni-helper/uni-app-types' + +/** 步进器 */ +export type InputNumberBox = Component + +/** 步进器实例 */ +export type InputNumberBoxInstance = InstanceType + +/** 步进器属性 */ +export type InputNumberBoxProps = { + /** 输入框初始值(默认1) */ + modelValue: number + /** 用户可输入的最小值(默认0) */ + min: number + /** 用户可输入的最大值(默认99999) */ + max: number + /** 步长,每次加或减的值(默认1) */ + step: number + /** 是否禁用操作,包括输入框,加减按钮 */ + disabled: boolean + /** 输入框宽度,单位rpx(默认80) */ + inputWidth: string | number + /** 输入框和按钮的高度,单位rpx(默认50) */ + inputHeight: string | number + /** 输入框和按钮的背景颜色(默认#F2F3F5) */ + bgColor: string + /** 步进器标识符 */ + index: string + /** 输入框内容发生变化时触发 */ + onChange: (event: InputNumberBoxEvent) => void + /** 输入框失去焦点时触发 */ + onBlur: (event: InputNumberBoxEvent) => void + /** 点击增加按钮时触发 */ + onPlus: (event: InputNumberBoxEvent) => void + /** 点击减少按钮时触发 */ + onMinus: (event: InputNumberBoxEvent) => void +} + +/** 步进器事件对象 */ +export type InputNumberBoxEvent = { + /** 输入框当前值 */ + value: number + /** 步进器标识符 */ + index: string +} + +/** 全局组件类型声明 */ +declare module '@vue/runtime-core' { + export interface GlobalComponents { + 'vk-data-input-number-box': InputNumberBox + } +} diff --git a/mes-ui/uni-app/src/components/vk-data-input-number-box/vk-data-input-number-box.vue b/mes-ui/uni-app/src/components/vk-data-input-number-box/vk-data-input-number-box.vue new file mode 100644 index 00000000..8eab54ae --- /dev/null +++ b/mes-ui/uni-app/src/components/vk-data-input-number-box/vk-data-input-number-box.vue @@ -0,0 +1,458 @@ + + + + + + diff --git a/mes-ui/uni-app/src/composables/index.ts b/mes-ui/uni-app/src/composables/index.ts new file mode 100644 index 00000000..78d58586 --- /dev/null +++ b/mes-ui/uni-app/src/composables/index.ts @@ -0,0 +1,21 @@ +import type { XtxGuessInstance } from '@/types/components' +import { ref } from 'vue' + +/** + * 猜你喜欢组合式函数 + */ +export const useGuessList = () => { + // 获取猜你喜欢组件实例 + const guessRef = ref() + + // 滚动触底事件 + const onScrolltolower = () => { + guessRef.value?.getMore() + } + + // 返回 ref 和事件处理函数 + return { + guessRef, + onScrolltolower, + } +} diff --git a/mes-ui/uni-app/src/env.d.ts b/mes-ui/uni-app/src/env.d.ts new file mode 100644 index 00000000..e01a638f --- /dev/null +++ b/mes-ui/uni-app/src/env.d.ts @@ -0,0 +1,8 @@ +/// +declare module '*.vue' { + //@ts-ignore + import { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/mes-ui/uni-app/src/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js b/mes-ui/uni-app/src/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js new file mode 100644 index 00000000..69f3cf1d --- /dev/null +++ b/mes-ui/uni-app/src/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js @@ -0,0 +1,923 @@ +/* + * @Author: 王文杰 + * @Date: 2019-03-05 14:39:24 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-01-30 16:59:47 + * @FilePath: /app-nx-recycle/src/libs/qqmap-wx-jssdk1.2/qqmap-wx-jssdk.min.js + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +var ERROR_CONF = { + KEY_ERR: 311, + KEY_ERR_MSG: 'key格式错误', + PARAM_ERR: 310, + PARAM_ERR_MSG: '请求参数信息有误', + SYSTEM_ERR: 600, + SYSTEM_ERR_MSG: '系统错误', + WX_ERR_CODE: 1000, + WX_OK_CODE: 200, +} +var BASE_URL = 'https://apis.map.qq.com/ws/' +var URL_SEARCH = BASE_URL + 'place/v1/search' +var URL_SUGGESTION = BASE_URL + 'place/v1/suggestion' +var URL_GET_GEOCODER = BASE_URL + 'geocoder/v1/' +var URL_CITY_LIST = BASE_URL + 'district/v1/list' +var URL_AREA_LIST = BASE_URL + 'district/v1/getchildren' +var URL_DISTANCE = BASE_URL + 'distance/v1/' +var URL_DIRECTION = BASE_URL + 'direction/v1/' +var MODE = { driving: 'driving', transit: 'transit' } +var EARTH_RADIUS = 6378136.49 +var Utils = { + safeAdd(x, y) { + var lsw = (x & 0xffff) + (y & 0xffff) + var msw = (x >> 16) + (y >> 16) + (lsw >> 16) + return (msw << 16) | (lsw & 0xffff) + }, + bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)) + }, + md5cmn(q, a, b, x, s, t) { + return this.safeAdd( + this.bitRotateLeft(this.safeAdd(this.safeAdd(a, q), this.safeAdd(x, t)), s), + b, + ) + }, + md5ff(a, b, c, d, x, s, t) { + return this.md5cmn((b & c) | (~b & d), a, b, x, s, t) + }, + md5gg(a, b, c, d, x, s, t) { + return this.md5cmn((b & d) | (c & ~d), a, b, x, s, t) + }, + md5hh(a, b, c, d, x, s, t) { + return this.md5cmn(b ^ c ^ d, a, b, x, s, t) + }, + md5ii(a, b, c, d, x, s, t) { + return this.md5cmn(c ^ (b | ~d), a, b, x, s, t) + }, + binlMD5(x, len) { + x[len >> 5] |= 0x80 << len % 32 + x[(((len + 64) >>> 9) << 4) + 14] = len + var i + var olda + var oldb + var oldc + var oldd + var a = 1732584193 + var b = -271733879 + var c = -1732584194 + var d = 271733878 + for (i = 0; i < x.length; i += 16) { + olda = a + oldb = b + oldc = c + oldd = d + a = this.md5ff(a, b, c, d, x[i], 7, -680876936) + d = this.md5ff(d, a, b, c, x[i + 1], 12, -389564586) + c = this.md5ff(c, d, a, b, x[i + 2], 17, 606105819) + b = this.md5ff(b, c, d, a, x[i + 3], 22, -1044525330) + a = this.md5ff(a, b, c, d, x[i + 4], 7, -176418897) + d = this.md5ff(d, a, b, c, x[i + 5], 12, 1200080426) + c = this.md5ff(c, d, a, b, x[i + 6], 17, -1473231341) + b = this.md5ff(b, c, d, a, x[i + 7], 22, -45705983) + a = this.md5ff(a, b, c, d, x[i + 8], 7, 1770035416) + d = this.md5ff(d, a, b, c, x[i + 9], 12, -1958414417) + c = this.md5ff(c, d, a, b, x[i + 10], 17, -42063) + b = this.md5ff(b, c, d, a, x[i + 11], 22, -1990404162) + a = this.md5ff(a, b, c, d, x[i + 12], 7, 1804603682) + d = this.md5ff(d, a, b, c, x[i + 13], 12, -40341101) + c = this.md5ff(c, d, a, b, x[i + 14], 17, -1502002290) + b = this.md5ff(b, c, d, a, x[i + 15], 22, 1236535329) + a = this.md5gg(a, b, c, d, x[i + 1], 5, -165796510) + d = this.md5gg(d, a, b, c, x[i + 6], 9, -1069501632) + c = this.md5gg(c, d, a, b, x[i + 11], 14, 643717713) + b = this.md5gg(b, c, d, a, x[i], 20, -373897302) + a = this.md5gg(a, b, c, d, x[i + 5], 5, -701558691) + d = this.md5gg(d, a, b, c, x[i + 10], 9, 38016083) + c = this.md5gg(c, d, a, b, x[i + 15], 14, -660478335) + b = this.md5gg(b, c, d, a, x[i + 4], 20, -405537848) + a = this.md5gg(a, b, c, d, x[i + 9], 5, 568446438) + d = this.md5gg(d, a, b, c, x[i + 14], 9, -1019803690) + c = this.md5gg(c, d, a, b, x[i + 3], 14, -187363961) + b = this.md5gg(b, c, d, a, x[i + 8], 20, 1163531501) + a = this.md5gg(a, b, c, d, x[i + 13], 5, -1444681467) + d = this.md5gg(d, a, b, c, x[i + 2], 9, -51403784) + c = this.md5gg(c, d, a, b, x[i + 7], 14, 1735328473) + b = this.md5gg(b, c, d, a, x[i + 12], 20, -1926607734) + a = this.md5hh(a, b, c, d, x[i + 5], 4, -378558) + d = this.md5hh(d, a, b, c, x[i + 8], 11, -2022574463) + c = this.md5hh(c, d, a, b, x[i + 11], 16, 1839030562) + b = this.md5hh(b, c, d, a, x[i + 14], 23, -35309556) + a = this.md5hh(a, b, c, d, x[i + 1], 4, -1530992060) + d = this.md5hh(d, a, b, c, x[i + 4], 11, 1272893353) + c = this.md5hh(c, d, a, b, x[i + 7], 16, -155497632) + b = this.md5hh(b, c, d, a, x[i + 10], 23, -1094730640) + a = this.md5hh(a, b, c, d, x[i + 13], 4, 681279174) + d = this.md5hh(d, a, b, c, x[i], 11, -358537222) + c = this.md5hh(c, d, a, b, x[i + 3], 16, -722521979) + b = this.md5hh(b, c, d, a, x[i + 6], 23, 76029189) + a = this.md5hh(a, b, c, d, x[i + 9], 4, -640364487) + d = this.md5hh(d, a, b, c, x[i + 12], 11, -421815835) + c = this.md5hh(c, d, a, b, x[i + 15], 16, 530742520) + b = this.md5hh(b, c, d, a, x[i + 2], 23, -995338651) + a = this.md5ii(a, b, c, d, x[i], 6, -198630844) + d = this.md5ii(d, a, b, c, x[i + 7], 10, 1126891415) + c = this.md5ii(c, d, a, b, x[i + 14], 15, -1416354905) + b = this.md5ii(b, c, d, a, x[i + 5], 21, -57434055) + a = this.md5ii(a, b, c, d, x[i + 12], 6, 1700485571) + d = this.md5ii(d, a, b, c, x[i + 3], 10, -1894986606) + c = this.md5ii(c, d, a, b, x[i + 10], 15, -1051523) + b = this.md5ii(b, c, d, a, x[i + 1], 21, -2054922799) + a = this.md5ii(a, b, c, d, x[i + 8], 6, 1873313359) + d = this.md5ii(d, a, b, c, x[i + 15], 10, -30611744) + c = this.md5ii(c, d, a, b, x[i + 6], 15, -1560198380) + b = this.md5ii(b, c, d, a, x[i + 13], 21, 1309151649) + a = this.md5ii(a, b, c, d, x[i + 4], 6, -145523070) + d = this.md5ii(d, a, b, c, x[i + 11], 10, -1120210379) + c = this.md5ii(c, d, a, b, x[i + 2], 15, 718787259) + b = this.md5ii(b, c, d, a, x[i + 9], 21, -343485551) + a = this.safeAdd(a, olda) + b = this.safeAdd(b, oldb) + c = this.safeAdd(c, oldc) + d = this.safeAdd(d, oldd) + } + return [a, b, c, d] + }, + binl2rstr(input) { + var i + var output = '' + var length32 = input.length * 32 + for (i = 0; i < length32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> i % 32) & 0xff) + } + return output + }, + rstr2binl(input) { + var i + var output = [] + output[(input.length >> 2) - 1] = undefined + for (i = 0; i < output.length; i += 1) { + output[i] = 0 + } + var length8 = input.length * 8 + for (i = 0; i < length8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32 + } + return output + }, + rstrMD5(s) { + return this.binl2rstr(this.binlMD5(this.rstr2binl(s), s.length * 8)) + }, + rstrHMACMD5(key, data) { + var i + var bkey = this.rstr2binl(key) + var ipad = [] + var opad = [] + var hash + ipad[15] = opad[15] = undefined + if (bkey.length > 16) { + bkey = this.binlMD5(bkey, key.length * 8) + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636 + opad[i] = bkey[i] ^ 0x5c5c5c5c + } + hash = this.binlMD5(ipad.concat(this.rstr2binl(data)), 512 + data.length * 8) + return this.binl2rstr(this.binlMD5(opad.concat(hash), 512 + 128)) + }, + rstr2hex(input) { + var hexTab = '0123456789abcdef' + var output = '' + var x + var i + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i) + output += hexTab.charAt((x >>> 4) & 0x0f) + hexTab.charAt(x & 0x0f) + } + return output + }, + str2rstrUTF8(input) { + return unescape(encodeURIComponent(input)) + }, + rawMD5(s) { + return this.rstrMD5(this.str2rstrUTF8(s)) + }, + hexMD5(s) { + return this.rstr2hex(this.rawMD5(s)) + }, + rawHMACMD5(k, d) { + return this.rstrHMACMD5(this.str2rstrUTF8(k), str2rstrUTF8(d)) + }, + hexHMACMD5(k, d) { + return this.rstr2hex(this.rawHMACMD5(k, d)) + }, + md5(string, key, raw) { + if (!key) { + if (!raw) { + return this.hexMD5(string) + } + return this.rawMD5(string) + } + if (!raw) { + return this.hexHMACMD5(key, string) + } + return this.rawHMACMD5(key, string) + }, + getSig(requestParam, sk, feature, mode) { + var sig = null + var requestArr = [] + Object.keys(requestParam) + .sort() + .forEach(function (key) { + requestArr.push(key + '=' + requestParam[key]) + }) + if (feature == 'search') { + sig = '/ws/place/v1/search?' + requestArr.join('&') + sk + } + if (feature == 'suggest') { + sig = '/ws/place/v1/suggestion?' + requestArr.join('&') + sk + } + if (feature == 'reverseGeocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk + } + if (feature == 'geocoder') { + sig = '/ws/geocoder/v1/?' + requestArr.join('&') + sk + } + if (feature == 'getCityList') { + sig = '/ws/district/v1/list?' + requestArr.join('&') + sk + } + if (feature == 'getDistrictByCityId') { + sig = '/ws/district/v1/getchildren?' + requestArr.join('&') + sk + } + if (feature == 'calculateDistance') { + sig = '/ws/distance/v1/?' + requestArr.join('&') + sk + } + if (feature == 'direction') { + sig = '/ws/direction/v1/' + mode + '?' + requestArr.join('&') + sk + } + sig = this.md5(sig) + return sig + }, + location2query(data) { + if (typeof data == 'string') { + return data + } + var query = '' + for (var i = 0; i < data.length; i++) { + var d = data[i] + if (query) { + query += ';' + } + if (d.location) { + query = query + d.location.lat + ',' + d.location.lng + } + if (d.latitude && d.longitude) { + query = query + d.latitude + ',' + d.longitude + } + } + return query + }, + rad(d) { + return (d * Math.PI) / 180.0 + }, + getEndLocation(location) { + var to = location.split(';') + var endLocation = [] + for (var i = 0; i < to.length; i++) { + endLocation.push({ + lat: parseFloat(to[i].split(',')[0]), + lng: parseFloat(to[i].split(',')[1]), + }) + } + return endLocation + }, + getDistance(latFrom, lngFrom, latTo, lngTo) { + var radLatFrom = this.rad(latFrom) + var radLatTo = this.rad(latTo) + var a = radLatFrom - radLatTo + var b = this.rad(lngFrom) - this.rad(lngTo) + var distance = + 2 * + Math.asin( + Math.sqrt( + Math.pow(Math.sin(a / 2), 2) + + Math.cos(radLatFrom) * Math.cos(radLatTo) * Math.pow(Math.sin(b / 2), 2), + ), + ) + distance = distance * EARTH_RADIUS + distance = Math.round(distance * 10000) / 10000 + return parseFloat(distance.toFixed(0)) + }, + getWXLocation(success, fail, complete) { + wx.getLocation({ type: 'gcj02', success: success, fail: fail, complete: complete }) + }, + getLocationParam(location) { + if (typeof location == 'string') { + var locationArr = location.split(',') + if (locationArr.length === 2) { + location = { latitude: location.split(',')[0], longitude: location.split(',')[1] } + } else { + location = {} + } + } + return location + }, + polyfillParam(param) { + param.success = param.success || function () {} + param.fail = param.fail || function () {} + param.complete = param.complete || function () {} + }, + checkParamKeyEmpty(param, key) { + if (!param[key]) { + var errconf = this.buildErrorConfig( + ERROR_CONF.PARAM_ERR, + ERROR_CONF.PARAM_ERR_MSG + key + '参数格式有误', + ) + param.fail(errconf) + param.complete(errconf) + return true + } + return false + }, + checkKeyword(param) { + return !this.checkParamKeyEmpty(param, 'keyword') + }, + checkLocation(param) { + var location = this.getLocationParam(param.location) + if (!location || !location.latitude || !location.longitude) { + var errconf = this.buildErrorConfig( + ERROR_CONF.PARAM_ERR, + ERROR_CONF.PARAM_ERR_MSG + ' location参数格式有误', + ) + param.fail(errconf) + param.complete(errconf) + return false + } + return true + }, + buildErrorConfig(errCode, errMsg) { + return { status: errCode, message: errMsg } + }, + handleData(param, data, feature) { + if (feature == 'search') { + var searchResult = data.data + var searchSimplify = [] + for (var i = 0; i < searchResult.length; i++) { + searchSimplify.push({ + id: searchResult[i].id || null, + title: searchResult[i].title || null, + latitude: (searchResult[i].location && searchResult[i].location.lat) || null, + longitude: (searchResult[i].location && searchResult[i].location.lng) || null, + address: searchResult[i].address || null, + category: searchResult[i].category || null, + tel: searchResult[i].tel || null, + adcode: (searchResult[i].ad_info && searchResult[i].ad_info.adcode) || null, + city: (searchResult[i].ad_info && searchResult[i].ad_info.city) || null, + district: (searchResult[i].ad_info && searchResult[i].ad_info.district) || null, + province: (searchResult[i].ad_info && searchResult[i].ad_info.province) || null, + }) + } + param.success(data, { searchResult: searchResult, searchSimplify: searchSimplify }) + } else if (feature == 'suggest') { + var suggestResult = data.data + var suggestSimplify = [] + for (var i = 0; i < suggestResult.length; i++) { + suggestSimplify.push({ + adcode: suggestResult[i].adcode || null, + address: suggestResult[i].address || null, + category: suggestResult[i].category || null, + city: suggestResult[i].city || null, + district: suggestResult[i].district || null, + id: suggestResult[i].id || null, + latitude: (suggestResult[i].location && suggestResult[i].location.lat) || null, + longitude: (suggestResult[i].location && suggestResult[i].location.lng) || null, + province: suggestResult[i].province || null, + title: suggestResult[i].title || null, + type: suggestResult[i].type || null, + }) + } + param.success(data, { suggestResult: suggestResult, suggestSimplify: suggestSimplify }) + } else if (feature == 'reverseGeocoder') { + var reverseGeocoderResult = data.result + var reverseGeocoderSimplify = { + address: reverseGeocoderResult.address || null, + latitude: (reverseGeocoderResult.location && reverseGeocoderResult.location.lat) || null, + longitude: (reverseGeocoderResult.location && reverseGeocoderResult.location.lng) || null, + adcode: (reverseGeocoderResult.ad_info && reverseGeocoderResult.ad_info.adcode) || null, + city: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.city) || + null, + district: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.district) || + null, + nation: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.nation) || + null, + province: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.province) || + null, + street: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.street) || + null, + street_number: + (reverseGeocoderResult.address_component && + reverseGeocoderResult.address_component.street_number) || + null, + recommend: + (reverseGeocoderResult.formatted_addresses && + reverseGeocoderResult.formatted_addresses.recommend) || + null, + rough: + (reverseGeocoderResult.formatted_addresses && + reverseGeocoderResult.formatted_addresses.rough) || + null, + } + if (reverseGeocoderResult.pois) { + var pois = reverseGeocoderResult.pois + var poisSimplify = [] + for (var i = 0; i < pois.length; i++) { + poisSimplify.push({ + id: pois[i].id || null, + title: pois[i].title || null, + latitude: (pois[i].location && pois[i].location.lat) || null, + longitude: (pois[i].location && pois[i].location.lng) || null, + address: pois[i].address || null, + category: pois[i].category || null, + adcode: (pois[i].ad_info && pois[i].ad_info.adcode) || null, + city: (pois[i].ad_info && pois[i].ad_info.city) || null, + district: (pois[i].ad_info && pois[i].ad_info.district) || null, + province: (pois[i].ad_info && pois[i].ad_info.province) || null, + }) + } + param.success(data, { + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify, + pois: pois, + poisSimplify: poisSimplify, + }) + } else { + param.success(data, { + reverseGeocoderResult: reverseGeocoderResult, + reverseGeocoderSimplify: reverseGeocoderSimplify, + }) + } + } else if (feature == 'geocoder') { + var geocoderResult = data.result + var geocoderSimplify = { + title: geocoderResult.title || null, + latitude: (geocoderResult.location && geocoderResult.location.lat) || null, + longitude: (geocoderResult.location && geocoderResult.location.lng) || null, + adcode: (geocoderResult.ad_info && geocoderResult.ad_info.adcode) || null, + province: + (geocoderResult.address_components && geocoderResult.address_components.province) || null, + city: (geocoderResult.address_components && geocoderResult.address_components.city) || null, + district: + (geocoderResult.address_components && geocoderResult.address_components.district) || null, + street: + (geocoderResult.address_components && geocoderResult.address_components.street) || null, + street_number: + (geocoderResult.address_components && geocoderResult.address_components.street_number) || + null, + level: geocoderResult.level || null, + } + param.success(data, { geocoderResult: geocoderResult, geocoderSimplify: geocoderSimplify }) + } else if (feature == 'getCityList') { + var provinceResult = data.result[0] + var cityResult = data.result[1] + var districtResult = data.result[2] + param.success(data, { + provinceResult: provinceResult, + cityResult: cityResult, + districtResult: districtResult, + }) + } else if (feature == 'getDistrictByCityId') { + var districtByCity = data.result[0] + param.success(data, districtByCity) + } else if (feature == 'calculateDistance') { + var calculateDistanceResult = data.result.elements + var distance = [] + for (var i = 0; i < calculateDistanceResult.length; i++) { + distance.push(calculateDistanceResult[i].distance) + } + param.success(data, { calculateDistanceResult: calculateDistanceResult, distance: distance }) + } else if (feature == 'direction') { + var direction = data.result.routes + param.success(data, direction) + } else { + param.success(data) + } + }, + buildWxRequestConfig(param, options, feature) { + var that = this + options.header = { 'content-type': 'application/json' } + options.method = 'GET' + options.success = function (res) { + var data = res.data + if (data.status === 0) { + that.handleData(param, data, feature) + } else { + param.fail(data) + } + } + options.fail = function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) + } + options.complete = function (res) { + var statusCode = +res.statusCode + switch (statusCode) { + case ERROR_CONF.WX_ERR_CODE: { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) + break + } + case ERROR_CONF.WX_OK_CODE: { + var data = res.data + if (data.status === 0) { + param.complete(data) + } else { + param.complete(that.buildErrorConfig(data.status, data.message)) + } + break + } + default: { + param.complete(that.buildErrorConfig(ERROR_CONF.SYSTEM_ERR, ERROR_CONF.SYSTEM_ERR_MSG)) + } + } + } + return options + }, + locationProcess(param, locationsuccess, locationfail, locationcomplete) { + var that = this + locationfail = + locationfail || + function (res) { + res.statusCode = ERROR_CONF.WX_ERR_CODE + param.fail(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) + } + locationcomplete = + locationcomplete || + function (res) { + if (res.statusCode == ERROR_CONF.WX_ERR_CODE) { + param.complete(that.buildErrorConfig(ERROR_CONF.WX_ERR_CODE, res.errMsg)) + } + } + if (!param.location) { + that.getWXLocation(locationsuccess, locationfail, locationcomplete) + } else if (that.checkLocation(param)) { + var location = Utils.getLocationParam(param.location) + locationsuccess(location) + } + }, +} +class QQMapWX { + constructor(options) { + if (!options.key) { + throw Error('key值不能为空') + } + this.key = options.key + } + search(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + if (!Utils.checkKeyword(options)) { + return + } + var requestParam = { + keyword: options.keyword, + orderby: options.orderby || '_distance', + page_size: options.page_size || 10, + page_index: options.page_index || 1, + output: 'json', + key: that.key, + } + if (options.address_format) { + requestParam.address_format = options.address_format + } + if (options.filter) { + requestParam.filter = options.filter + } + var distance = options.distance || '1000' + var auto_extend = options.auto_extend || 1 + var region = null + var rectangle = null + if (options.region) { + region = options.region + } + if (options.rectangle) { + rectangle = options.rectangle + } + var locationsuccess = function (result) { + if (region && !rectangle) { + requestParam.boundary = + 'region(' + + region + + ',' + + auto_extend + + ',' + + result.latitude + + ',' + + result.longitude + + ')' + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') + } + } else if (rectangle && !region) { + requestParam.boundary = 'rectangle(' + rectangle + ')' + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') + } + } else { + requestParam.boundary = + 'nearby(' + + result.latitude + + ',' + + result.longitude + + ',' + + distance + + ',' + + auto_extend + + ')' + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'search') + } + } + wx.request( + Utils.buildWxRequestConfig(options, { url: URL_SEARCH, data: requestParam }, 'search'), + ) + } + Utils.locationProcess(options, locationsuccess) + } + getSuggestion(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + if (!Utils.checkKeyword(options)) { + return + } + var requestParam = { + keyword: options.keyword, + region: options.region || '全国', + region_fix: options.region_fix || 0, + policy: options.policy || 0, + page_size: options.page_size || 10, + page_index: options.page_index || 1, + get_subpois: options.get_subpois || 0, + output: 'json', + key: that.key, + } + if (options.address_format) { + requestParam.address_format = options.address_format + } + if (options.filter) { + requestParam.filter = options.filter + } + if (options.location) { + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_SUGGESTION, data: requestParam }, + 'suggest', + ), + ) + } + Utils.locationProcess(options, locationsuccess) + } else { + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'suggest') + } + wx.request( + Utils.buildWxRequestConfig(options, { url: URL_SUGGESTION, data: requestParam }, 'suggest'), + ) + } + } + reverseGeocoder(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + var requestParam = { + coord_type: options.coord_type || 5, + get_poi: options.get_poi || 0, + output: 'json', + key: that.key, + } + if (options.poi_options) { + requestParam.poi_options = options.poi_options + } + var locationsuccess = function (result) { + requestParam.location = result.latitude + ',' + result.longitude + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'reverseGeocoder') + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_GET_GEOCODER, data: requestParam }, + 'reverseGeocoder', + ), + ) + } + Utils.locationProcess(options, locationsuccess) + } + geocoder(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + if (Utils.checkParamKeyEmpty(options, 'address')) { + return + } + var requestParam = { address: options.address, output: 'json', key: that.key } + if (options.region) { + requestParam.region = options.region + } + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'geocoder') + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_GET_GEOCODER, data: requestParam }, + 'geocoder', + ), + ) + } + getCityList(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + var requestParam = { output: 'json', key: that.key } + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getCityList') + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_CITY_LIST, data: requestParam }, + 'getCityList', + ), + ) + } + getDistrictByCityId(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + if (Utils.checkParamKeyEmpty(options, 'id')) { + return + } + var requestParam = { id: options.id || '', output: 'json', key: that.key } + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'getDistrictByCityId') + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_AREA_LIST, data: requestParam }, + 'getDistrictByCityId', + ), + ) + } + calculateDistance(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + if (Utils.checkParamKeyEmpty(options, 'to')) { + return + } + var requestParam = { + mode: options.mode || 'walking', + to: Utils.location2query(options.to), + output: 'json', + key: that.key, + } + if (options.from) { + options.location = options.from + } + if (requestParam.mode == 'straight') { + var locationsuccess = function (result) { + var locationTo = Utils.getEndLocation(requestParam.to) + var data = { message: 'query ok', result: { elements: [] }, status: 0 } + for (var i = 0; i < locationTo.length; i++) { + data.result.elements.push({ + distance: Utils.getDistance( + result.latitude, + result.longitude, + locationTo[i].lat, + locationTo[i].lng, + ), + duration: 0, + from: { lat: result.latitude, lng: result.longitude }, + to: { lat: locationTo[i].lat, lng: locationTo[i].lng }, + }) + } + var calculateResult = data.result.elements + var distanceResult = [] + for (var i = 0; i < calculateResult.length; i++) { + distanceResult.push(calculateResult[i].distance) + } + return options.success(data, { + calculateResult: calculateResult, + distanceResult: distanceResult, + }) + } + Utils.locationProcess(options, locationsuccess) + } else { + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'calculateDistance') + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: URL_DISTANCE, data: requestParam }, + 'calculateDistance', + ), + ) + } + Utils.locationProcess(options, locationsuccess) + } + } + direction(options) { + var that = this + options = options || {} + Utils.polyfillParam(options) + if (Utils.checkParamKeyEmpty(options, 'to')) { + return + } + var requestParam = { output: 'json', key: that.key } + if (typeof options.to == 'string') { + requestParam.to = options.to + } else { + requestParam.to = options.to.latitude + ',' + options.to.longitude + } + var SET_URL_DIRECTION = null + options.mode = options.mode || MODE.driving + SET_URL_DIRECTION = URL_DIRECTION + options.mode + if (options.from) { + options.location = options.from + } + if (options.mode == MODE.driving) { + if (options.from_poi) { + requestParam.from_poi = options.from_poi + } + if (options.heading) { + requestParam.heading = options.heading + } + if (options.speed) { + requestParam.speed = options.speed + } + if (options.accuracy) { + requestParam.accuracy = options.accuracy + } + if (options.road_type) { + requestParam.road_type = options.road_type + } + if (options.to_poi) { + requestParam.to_poi = options.to_poi + } + if (options.from_track) { + requestParam.from_track = options.from_track + } + if (options.waypoints) { + requestParam.waypoints = options.waypoints + } + if (options.policy) { + requestParam.policy = options.policy + } + if (options.plate_number) { + requestParam.plate_number = options.plate_number + } + } + if (options.mode == MODE.transit) { + if (options.departure_time) { + requestParam.departure_time = options.departure_time + } + if (options.policy) { + requestParam.policy = options.policy + } + } + var locationsuccess = function (result) { + requestParam.from = result.latitude + ',' + result.longitude + if (options.sig) { + requestParam.sig = Utils.getSig(requestParam, options.sig, 'direction', options.mode) + } + wx.request( + Utils.buildWxRequestConfig( + options, + { url: SET_URL_DIRECTION, data: requestParam }, + 'direction', + ), + ) + } + Utils.locationProcess(options, locationsuccess) + } +} +export default QQMapWX diff --git a/mes-ui/uni-app/src/main.ts b/mes-ui/uni-app/src/main.ts new file mode 100644 index 00000000..4e7496fc --- /dev/null +++ b/mes-ui/uni-app/src/main.ts @@ -0,0 +1,19 @@ +import { createSSRApp } from 'vue' +import App from './App.vue' + +// 导入 pinia 实例 +import pinia from './stores' + + +export function createApp() { + // 创建 vue 实例 + const app = createSSRApp(App) + + // 使用 pinia + app.use(pinia) + + + return { + app, + } +} diff --git a/mes-ui/uni-app/src/manifest.json b/mes-ui/uni-app/src/manifest.json new file mode 100644 index 00000000..b77abb5d --- /dev/null +++ b/mes-ui/uni-app/src/manifest.json @@ -0,0 +1,131 @@ +{ + "name" : "合力机械小程序", + "appid" : "__UNI__F93316F", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + // 忽略版本检查提示框 + "compatible" : { + "ignoreVersion" : true + }, + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : {}, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios" : { + "dSYMs" : false + }, + /* SDK配置 */ + "sdkConfigs" : { + "ad" : {} + }, + "icons" : { + "android" : { + "hdpi" : "unpackage/res/icons/72x72.png", + "xhdpi" : "unpackage/res/icons/96x96.png", + "xxhdpi" : "unpackage/res/icons/144x144.png", + "xxxhdpi" : "unpackage/res/icons/192x192.png" + }, + "ios" : { + "appstore" : "unpackage/res/icons/1024x1024.png", + "ipad" : { + "app" : "unpackage/res/icons/76x76.png", + "app@2x" : "unpackage/res/icons/152x152.png", + "notification" : "unpackage/res/icons/20x20.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "proapp@2x" : "unpackage/res/icons/167x167.png", + "settings" : "unpackage/res/icons/29x29.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "spotlight" : "unpackage/res/icons/40x40.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png" + }, + "iphone" : { + "app@2x" : "unpackage/res/icons/120x120.png", + "app@3x" : "unpackage/res/icons/180x180.png", + "notification@2x" : "unpackage/res/icons/40x40.png", + "notification@3x" : "unpackage/res/icons/60x60.png", + "settings@2x" : "unpackage/res/icons/58x58.png", + "settings@3x" : "unpackage/res/icons/87x87.png", + "spotlight@2x" : "unpackage/res/icons/80x80.png", + "spotlight@3x" : "unpackage/res/icons/120x120.png" + } + } + }, + "splashscreen" : { + "androidStyle" : "default" + } + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 网页端特有配置 */ + "h5" : { + "router" : { + // 路由基础路径。默认为 / + "base" : "./" + } + }, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "wxa29fe397274614b5", + "setting" : { + "minified" : true, + "urlCheck" : true, + "es6" : true, + "postcss" : true + }, + // 启用组件按需注入 + "lazyCodeLoading" : "requiredComponents", + "usingComponents" : true, + "uniStatistics" : { + "enable" : true + } + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "3", + "fallbackLocale" : "zh-Hans" +} diff --git a/mes-ui/uni-app/src/pages.json b/mes-ui/uni-app/src/pages.json new file mode 100644 index 00000000..9bbb6600 --- /dev/null +++ b/mes-ui/uni-app/src/pages.json @@ -0,0 +1,95 @@ +{ + // 组件自动引入规则 + "easycom": { + // 是否开启自动扫描 + "autoscan": true, + // 以正则方式自定义组件匹配规则 + "custom": { + // uni-ui 规则如下配置 + "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue", + // 以 Xtx 开头的组件,在 components 文件夹中查找引入(需要重启服务器) + "^Xtx(.*)": "@/components/Xtx$1.vue" + } + }, + "pages": [ + { + "path": "pages/index/index", + "style": { + "navigationStyle": "custom" + } + }, + { + "path": "pages/previewPdf/previewPdf", + "style": { + "navigationBarTitleText": "预览" + } + }, + { + "path": "pages/unqualifiedNotification/unqualifiedNotification", + "style": { + "navigationBarTitleText": "品质异常通知单" + } + }, + { + "path": "pages/productionReport/productionReport-detail", + "style": { + "navigationBarTitleText": "报工详情" + } + }, + { + "path": "pages/productionReport/productionReport", + "style": { + "navigationBarTitleText": "生产报工" + } + }, + { + "path": "pages/my/my", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "我的" + } + }, + { + "path": "pages/login/login", + "style": { + "navigationStyle": "custom", + "navigationBarTitleText": "登录" + } + }, + { + "path": "pages/password/password", + "style": { + "navigationBarTitleText": "修改密码" + } + } + ], + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "", + "navigationBarBackgroundColor": "#E8EEF5", + "backgroundColor": "#E8EEF5" + }, + // 设置 TabBar + "tabBar": { + "color": "#333", + "selectedColor": "#356899", + "backgroundColor": "#fff", + "borderStyle": "white", + "list": [{ + "text": "工作台", + "pagePath": "pages/index/index", + "iconPath": "static/tabs/home_default.png", + "selectedIconPath": "static/tabs/home_selected.png" + }, + { + "text": "我的", + "pagePath": "pages/my/my", + "iconPath": "static/tabs/user_default.png", + "selectedIconPath": "static/tabs/user_selected.png" + } + ] + }, + // 分包预下载规则 + "preloadRule": { + } +} diff --git a/mes-ui/uni-app/src/pages/index/components/CategoryPanel.vue b/mes-ui/uni-app/src/pages/index/components/CategoryPanel.vue new file mode 100644 index 00000000..b5601f47 --- /dev/null +++ b/mes-ui/uni-app/src/pages/index/components/CategoryPanel.vue @@ -0,0 +1,45 @@ + + + + + + diff --git a/mes-ui/uni-app/src/pages/index/components/CustomNavbar.vue b/mes-ui/uni-app/src/pages/index/components/CustomNavbar.vue new file mode 100644 index 00000000..e376a735 --- /dev/null +++ b/mes-ui/uni-app/src/pages/index/components/CustomNavbar.vue @@ -0,0 +1,93 @@ + + + + + + diff --git a/mes-ui/uni-app/src/pages/index/components/PageSkeleton.vue b/mes-ui/uni-app/src/pages/index/components/PageSkeleton.vue new file mode 100644 index 00000000..7151946a --- /dev/null +++ b/mes-ui/uni-app/src/pages/index/components/PageSkeleton.vue @@ -0,0 +1,51 @@ + + \ No newline at end of file diff --git a/mes-ui/uni-app/src/pages/index/components/footRight.vue b/mes-ui/uni-app/src/pages/index/components/footRight.vue new file mode 100644 index 00000000..70709b13 --- /dev/null +++ b/mes-ui/uni-app/src/pages/index/components/footRight.vue @@ -0,0 +1,19 @@ + + + + diff --git a/mes-ui/uni-app/src/pages/index/index.vue b/mes-ui/uni-app/src/pages/index/index.vue new file mode 100644 index 00000000..a0008158 --- /dev/null +++ b/mes-ui/uni-app/src/pages/index/index.vue @@ -0,0 +1,98 @@ + + + + + diff --git a/mes-ui/uni-app/src/pages/index/styles/category.scss b/mes-ui/uni-app/src/pages/index/styles/category.scss new file mode 100644 index 00000000..d01e2208 --- /dev/null +++ b/mes-ui/uni-app/src/pages/index/styles/category.scss @@ -0,0 +1,30 @@ +.category { + padding: 32rpx 0rpx; + margin: 16rpx; + border-radius: 4rpx; + display: flex; + flex-wrap: wrap; + .category-item { + border-radius: 16rpx; + margin: 12rpx; + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + box-shadow: 0px 3px 12px 0px rgba(63, 112, 157, 0.5); + width: 45%; + .icon { + width: 330rpx; + height: 240rpx; + } + } + .empty-data { + position: absolute; + left: 50%; + top: 50%; + width: 480rpx; + height: 528rpx; + transform: translate(-50%, -50%); + } +} diff --git a/mes-ui/uni-app/src/pages/index/styles/category.wxss b/mes-ui/uni-app/src/pages/index/styles/category.wxss new file mode 100644 index 00000000..afbe29e2 --- /dev/null +++ b/mes-ui/uni-app/src/pages/index/styles/category.wxss @@ -0,0 +1,33 @@ +.category { + padding: 32rpx 0rpx; + margin: 16rpx; + border-radius: 4rpx; + display: flex; + flex-wrap: wrap; +} + +.category .category-item { + border-radius: 16rpx; + margin: 12rpx; + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + box-shadow: 0px 3px 12px 0px rgba(63, 112, 157, 0.5); + width: 45%; +} + +.category .category-item .icon { + width: 330rpx; + height: 240rpx; +} + +.category .empty-data { + position: absolute; + left: 50%; + top: 50%; + width: 480rpx; + height: 528rpx; + transform: translate(-50%, -50%); +} diff --git a/mes-ui/uni-app/src/pages/login/login.vue b/mes-ui/uni-app/src/pages/login/login.vue new file mode 100644 index 00000000..a7058636 --- /dev/null +++ b/mes-ui/uni-app/src/pages/login/login.vue @@ -0,0 +1,198 @@ + + + + diff --git a/mes-ui/uni-app/src/pages/my/my.vue b/mes-ui/uni-app/src/pages/my/my.vue new file mode 100644 index 00000000..762bdd76 --- /dev/null +++ b/mes-ui/uni-app/src/pages/my/my.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/mes-ui/uni-app/src/pages/password/password.vue b/mes-ui/uni-app/src/pages/password/password.vue new file mode 100644 index 00000000..17e5e69c --- /dev/null +++ b/mes-ui/uni-app/src/pages/password/password.vue @@ -0,0 +1,172 @@ + + + + + diff --git a/mes-ui/uni-app/src/pages/previewPdf/previewPdf.vue b/mes-ui/uni-app/src/pages/previewPdf/previewPdf.vue new file mode 100644 index 00000000..a500f89c --- /dev/null +++ b/mes-ui/uni-app/src/pages/previewPdf/previewPdf.vue @@ -0,0 +1,23 @@ + + + \ No newline at end of file diff --git a/mes-ui/uni-app/src/pages/productionReport/components/dataItem.vue b/mes-ui/uni-app/src/pages/productionReport/components/dataItem.vue new file mode 100644 index 00000000..ce2968d2 --- /dev/null +++ b/mes-ui/uni-app/src/pages/productionReport/components/dataItem.vue @@ -0,0 +1,407 @@ + + + +import type { stringify } from 'querystring'; diff --git a/mes-ui/uni-app/src/pages/productionReport/productionReport-detail.vue b/mes-ui/uni-app/src/pages/productionReport/productionReport-detail.vue new file mode 100644 index 00000000..61564a27 --- /dev/null +++ b/mes-ui/uni-app/src/pages/productionReport/productionReport-detail.vue @@ -0,0 +1,597 @@ + + + diff --git a/mes-ui/uni-app/src/pages/productionReport/productionReport.vue b/mes-ui/uni-app/src/pages/productionReport/productionReport.vue new file mode 100644 index 00000000..05cdadf0 --- /dev/null +++ b/mes-ui/uni-app/src/pages/productionReport/productionReport.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/mes-ui/uni-app/src/pages/unqualifiedNotification/components/dataItem.vue b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/dataItem.vue new file mode 100644 index 00000000..84e4c8b5 --- /dev/null +++ b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/dataItem.vue @@ -0,0 +1,301 @@ + + + + diff --git a/mes-ui/uni-app/src/pages/unqualifiedNotification/components/detailPanel.vue b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/detailPanel.vue new file mode 100644 index 00000000..31257ec2 --- /dev/null +++ b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/detailPanel.vue @@ -0,0 +1,354 @@ + + + + diff --git a/mes-ui/uni-app/src/pages/unqualifiedNotification/components/mySelect.vue b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/mySelect.vue new file mode 100644 index 00000000..2a012692 --- /dev/null +++ b/mes-ui/uni-app/src/pages/unqualifiedNotification/components/mySelect.vue @@ -0,0 +1,250 @@ + + + + diff --git a/mes-ui/uni-app/src/pages/unqualifiedNotification/unqualifiedNotification.vue b/mes-ui/uni-app/src/pages/unqualifiedNotification/unqualifiedNotification.vue new file mode 100644 index 00000000..9f753d25 --- /dev/null +++ b/mes-ui/uni-app/src/pages/unqualifiedNotification/unqualifiedNotification.vue @@ -0,0 +1,188 @@ + + + + + diff --git a/mes-ui/uni-app/src/services/approveOrder.ts b/mes-ui/uni-app/src/services/approveOrder.ts new file mode 100644 index 00000000..5ea07cdb --- /dev/null +++ b/mes-ui/uni-app/src/services/approveOrder.ts @@ -0,0 +1,73 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: jevononlie 728254585@qq.com + * @LastEditTime: 2024-05-08 14:16:18 + * @FilePath: /app-nx-personal/src/services/home.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { http } from '@/utils/http' + +export const getApproveOrderAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/project-order/page', + data, + }) +} + +export const getApproveOrderDetailAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/project-order/get', + data, + }) +} +/** + * 操作项目订单(批准/打回/直接终止) + */ +export const postOperateAPI = (data: Object) => { + return http({ + method: 'POST', + url: '/biz/project-order/operate', + data, + }) +} +/** + * 项目订单子项目列表 + */ +export const getChildProductAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/project-order/project-order-sub/list-by-project-order-id', + data, + }) +} +/** + * 附件信息查询 + */ +export const getFileAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/infra/file/page', + data, + }) +} +/** + * 操作日志分页查询 + */ +export const getLogAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/system/operate-log/page', + data, + }) +} + +export const getDictAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/system/dict-data/page', + data, + }) +} diff --git a/mes-ui/uni-app/src/services/constants.ts b/mes-ui/uni-app/src/services/constants.ts new file mode 100644 index 00000000..7a4517f5 --- /dev/null +++ b/mes-ui/uni-app/src/services/constants.ts @@ -0,0 +1,11 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: jevononlie 728254585@qq.com + * @LastEditTime: 2024-05-09 13:20:50 + * @FilePath: /hl-app/src/services/constants.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +// export const serviceDomain = 'https://nxhs.cjyx.cc' +export const serviceDomain = 'http://192.168.0.72:9021' + diff --git a/mes-ui/uni-app/src/services/home.ts b/mes-ui/uni-app/src/services/home.ts new file mode 100644 index 00000000..7586d5f8 --- /dev/null +++ b/mes-ui/uni-app/src/services/home.ts @@ -0,0 +1,19 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-19 17:27:47 + * @FilePath: /app-nx-personal/src/services/home.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import type { PageParams, PageResult } from '@/types/global' +import type { BannerItem, CategoryItem, GuessItem, HotItem } from '@/types/home' +import { http } from '@/utils/http' + + +export const getHomeCategoryAPI = () => { + return http({ + method: 'GET', + url: '/system/auth/get-permission-info', + }) +} diff --git a/mes-ui/uni-app/src/services/login.ts b/mes-ui/uni-app/src/services/login.ts new file mode 100644 index 00000000..59153c0d --- /dev/null +++ b/mes-ui/uni-app/src/services/login.ts @@ -0,0 +1,72 @@ +/* + * @Author: 王文杰 + * @Date: 2024-03-04 14:13:16 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-26 09:35:18 + * @FilePath: /hl-app/src/services/login.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ + + +import type { LoginResult } from '@/types/login' +import { http } from '@/utils/http' + +type LoginWxMinParams = { + code: string + encryptedData?: string + iv?: string +} +/** + * 小程序登录 + * @param data 请求参数 + */ +export const postLoginWxMinAPI = (data: LoginWxMinParams) => { + return http({ + method: 'POST', + url: '/common/shlogin', + data, + }) +} + + + +type LoginParams = { + username: string + password: string +} +/** + * 传统登录-用户名+密码 + * @param data 请求参数 + */ +export const postLoginAPI = (data: LoginParams) => { + return http({ + method: 'POST', + url: '/system/auth/login', + data, + }) +} +// 获得全部字典数据列表 +export const getDictAPI = (data: any) => { + return http({ + method: 'GET', + url: '/system/dict-data/simple-list', + data, + }) +} +/** + * 退出登录 + */ +export const postLogoutAPI = (data: Object) => { + return http({ + method: 'POST', + url: '/system/auth/logout', + data, + }) +} + +export const getAuthAPI = () => { + return http({ + method: 'GET', + url: '/system/auth/get-permission-info', + }) +} diff --git a/mes-ui/uni-app/src/services/my.ts b/mes-ui/uni-app/src/services/my.ts new file mode 100644 index 00000000..abddc9d9 --- /dev/null +++ b/mes-ui/uni-app/src/services/my.ts @@ -0,0 +1,23 @@ +/* + * @Author: 王文杰 + * @Date: 2024-03-20 13:30:51 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-20 17:58:26 + * @FilePath: /hl-app/src/services/my.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { http } from '@/utils/http' +export const getUserInfoAPI = (data: any) => { + return http({ + method: 'GET', + url: '/system/user/get', + data, + }) +} +export const putUpdatePasswordAPI = (data: any) => { + return http({ + method: 'PUT', + url: '/system/user/profile/update-password', + data, + }) +} diff --git a/mes-ui/uni-app/src/services/productionReport.ts b/mes-ui/uni-app/src/services/productionReport.ts new file mode 100644 index 00000000..59393d32 --- /dev/null +++ b/mes-ui/uni-app/src/services/productionReport.ts @@ -0,0 +1,44 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-29 15:44:53 + * @FilePath: /app-nx-personal/src/services/home.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { http } from '@/utils/http' +// 获取工序分页 +export const getListAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/task-dispatch/task-dispatch-detail/page', + data, + }) +} +// 报工记录分页查询 +export const getTaskRepotPageAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/task-report/page', + data, + }) +} +// 派工任务详情 +export const getTaskDetailAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/task-dispatch/task-dispatch-detail/get', + data, + }) +} + +/** + * 操作生产任务(开始/结束/提交/完成) + */ +export const postOperateAPI = (data: Object) => { + return http({ + method: 'POST', + url: '/biz/task-dispatch/task-dispatch-detail/operate', + data, + }) +} diff --git a/mes-ui/uni-app/src/services/profile.ts b/mes-ui/uni-app/src/services/profile.ts new file mode 100644 index 00000000..3e8a1765 --- /dev/null +++ b/mes-ui/uni-app/src/services/profile.ts @@ -0,0 +1,32 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-07 15:49:32 + * @FilePath: /app-nx-personal/src/services/profile.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import type { ProfileDetail, ProfileParams } from '@/types/member' +import { http } from '@/utils/http' + +/** + * 获取个人信息 + */ +export const getMemberProfileAPI = () => { + return http({ + method: 'GET', + url: '/client/info', + }) +} + +/** + * 修改个人信息 + * @param data 请求体参数 + */ +export const postMemberProfileAPI = (data: ProfileParams) => { + return http({ + method: 'POST', + url: '/client/update', + data, + }) +} diff --git a/mes-ui/uni-app/src/services/unqualifiedNotification.ts b/mes-ui/uni-app/src/services/unqualifiedNotification.ts new file mode 100644 index 00000000..e134764e --- /dev/null +++ b/mes-ui/uni-app/src/services/unqualifiedNotification.ts @@ -0,0 +1,54 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: jevononlie 728254585@qq.com + * @LastEditTime: 2024-05-09 14:53:49 + * @FilePath: /app-nx-personal/src/services/home.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { http } from '@/utils/http' + + +// 异常通知单分页查询 +export const getNotificationPageAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/unqualified-notification/page', + data, + }) +} + +// 获取生产车间分页 +export const getWorkshopsPageAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/app/workshops', + data, + }) +} +// 获取工序分页 +export const getProcedurePageAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/biz/procedure/page', + data, + }) +} + +// 获取用户分页 +export const getUserPageAPI = (data: Object) => { + return http({ + method: 'GET', + url: '/system/user/page', + data, + }) +} + +// 创建品质异常通知单审核 +export const postAddAPI = (data: Object) => { + return http({ + method: 'POST', + url: '/biz/unqualified-notification/create', + data, + }) +} diff --git a/mes-ui/uni-app/src/static/images/approveOrder-default.png b/mes-ui/uni-app/src/static/images/approveOrder-default.png new file mode 100644 index 00000000..dd157789 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/approveOrder-default.png differ diff --git a/mes-ui/uni-app/src/static/images/approveOrder.png b/mes-ui/uni-app/src/static/images/approveOrder.png new file mode 100644 index 00000000..ac0c170c Binary files /dev/null and b/mes-ui/uni-app/src/static/images/approveOrder.png differ diff --git a/mes-ui/uni-app/src/static/images/assembleReport-default.png b/mes-ui/uni-app/src/static/images/assembleReport-default.png new file mode 100644 index 00000000..f2f6860b Binary files /dev/null and b/mes-ui/uni-app/src/static/images/assembleReport-default.png differ diff --git a/mes-ui/uni-app/src/static/images/assembleReport.png b/mes-ui/uni-app/src/static/images/assembleReport.png new file mode 100644 index 00000000..1de27d9d Binary files /dev/null and b/mes-ui/uni-app/src/static/images/assembleReport.png differ diff --git a/mes-ui/uni-app/src/static/images/blank.png b/mes-ui/uni-app/src/static/images/blank.png new file mode 100644 index 00000000..a74df519 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/blank.png differ diff --git a/mes-ui/uni-app/src/static/images/home-empty.png b/mes-ui/uni-app/src/static/images/home-empty.png new file mode 100644 index 00000000..6f4ca069 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/home-empty.png differ diff --git a/mes-ui/uni-app/src/static/images/login-hd.png b/mes-ui/uni-app/src/static/images/login-hd.png new file mode 100644 index 00000000..d4388771 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/login-hd.png differ diff --git a/mes-ui/uni-app/src/static/images/logo.png b/mes-ui/uni-app/src/static/images/logo.png new file mode 100644 index 00000000..623c6a82 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/logo.png differ diff --git a/mes-ui/uni-app/src/static/images/my-empty.png b/mes-ui/uni-app/src/static/images/my-empty.png new file mode 100644 index 00000000..30eeb9b1 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/my-empty.png differ diff --git a/mes-ui/uni-app/src/static/images/my.avatar.png b/mes-ui/uni-app/src/static/images/my.avatar.png new file mode 100644 index 00000000..4d29a570 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/my.avatar.png differ diff --git a/mes-ui/uni-app/src/static/images/order_auto_my.png b/mes-ui/uni-app/src/static/images/order_auto_my.png new file mode 100644 index 00000000..35e89549 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/order_auto_my.png differ diff --git a/mes-ui/uni-app/src/static/images/productionReport-default.png b/mes-ui/uni-app/src/static/images/productionReport-default.png new file mode 100644 index 00000000..174cba70 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/productionReport-default.png differ diff --git a/mes-ui/uni-app/src/static/images/productionReport-detail-complate.png b/mes-ui/uni-app/src/static/images/productionReport-detail-complate.png new file mode 100644 index 00000000..c2760d1f Binary files /dev/null and b/mes-ui/uni-app/src/static/images/productionReport-detail-complate.png differ diff --git a/mes-ui/uni-app/src/static/images/productionReport-detail-index.png b/mes-ui/uni-app/src/static/images/productionReport-detail-index.png new file mode 100644 index 00000000..4017b327 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/productionReport-detail-index.png differ diff --git a/mes-ui/uni-app/src/static/images/productionReport-page.png b/mes-ui/uni-app/src/static/images/productionReport-page.png new file mode 100644 index 00000000..d5ae31cf Binary files /dev/null and b/mes-ui/uni-app/src/static/images/productionReport-page.png differ diff --git a/mes-ui/uni-app/src/static/images/productionReport.png b/mes-ui/uni-app/src/static/images/productionReport.png new file mode 100644 index 00000000..4e5b61a7 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/productionReport.png differ diff --git a/mes-ui/uni-app/src/static/images/remove.png b/mes-ui/uni-app/src/static/images/remove.png new file mode 100644 index 00000000..97b35e36 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/remove.png differ diff --git a/mes-ui/uni-app/src/static/images/seting_my.png b/mes-ui/uni-app/src/static/images/seting_my.png new file mode 100644 index 00000000..8fed7725 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/seting_my.png differ diff --git a/mes-ui/uni-app/src/static/images/site_selected.png b/mes-ui/uni-app/src/static/images/site_selected.png new file mode 100644 index 00000000..565be973 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/site_selected.png differ diff --git a/mes-ui/uni-app/src/static/images/unqualifiedNotification-add.png b/mes-ui/uni-app/src/static/images/unqualifiedNotification-add.png new file mode 100644 index 00000000..6f356736 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/unqualifiedNotification-add.png differ diff --git a/mes-ui/uni-app/src/static/images/unqualifiedNotification-agree.png b/mes-ui/uni-app/src/static/images/unqualifiedNotification-agree.png new file mode 100644 index 00000000..c7ad2772 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/unqualifiedNotification-agree.png differ diff --git a/mes-ui/uni-app/src/static/images/unqualifiedNotification-default.png b/mes-ui/uni-app/src/static/images/unqualifiedNotification-default.png new file mode 100644 index 00000000..af33529b Binary files /dev/null and b/mes-ui/uni-app/src/static/images/unqualifiedNotification-default.png differ diff --git a/mes-ui/uni-app/src/static/images/unqualifiedNotification.png b/mes-ui/uni-app/src/static/images/unqualifiedNotification.png new file mode 100644 index 00000000..fca33fc4 Binary files /dev/null and b/mes-ui/uni-app/src/static/images/unqualifiedNotification.png differ diff --git a/mes-ui/uni-app/src/static/images/warn_home.png b/mes-ui/uni-app/src/static/images/warn_home.png new file mode 100644 index 00000000..0235945d Binary files /dev/null and b/mes-ui/uni-app/src/static/images/warn_home.png differ diff --git a/mes-ui/uni-app/src/static/tabs/home_default.png b/mes-ui/uni-app/src/static/tabs/home_default.png new file mode 100644 index 00000000..f2d8046c Binary files /dev/null and b/mes-ui/uni-app/src/static/tabs/home_default.png differ diff --git a/mes-ui/uni-app/src/static/tabs/home_selected.png b/mes-ui/uni-app/src/static/tabs/home_selected.png new file mode 100644 index 00000000..5e27524f Binary files /dev/null and b/mes-ui/uni-app/src/static/tabs/home_selected.png differ diff --git a/mes-ui/uni-app/src/static/tabs/user_default.png b/mes-ui/uni-app/src/static/tabs/user_default.png new file mode 100644 index 00000000..908385ea Binary files /dev/null and b/mes-ui/uni-app/src/static/tabs/user_default.png differ diff --git a/mes-ui/uni-app/src/static/tabs/user_selected.png b/mes-ui/uni-app/src/static/tabs/user_selected.png new file mode 100644 index 00000000..6b96f215 Binary files /dev/null and b/mes-ui/uni-app/src/static/tabs/user_selected.png differ diff --git a/mes-ui/uni-app/src/stores/index.ts b/mes-ui/uni-app/src/stores/index.ts new file mode 100644 index 00000000..763a3c9e --- /dev/null +++ b/mes-ui/uni-app/src/stores/index.ts @@ -0,0 +1,18 @@ +/* + * @Author: 王文杰 + * @Date: 2024-03-04 14:13:16 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-26 14:35:40 + * @FilePath: /hl-app/src/stores/index.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { createPinia } from 'pinia' +import persist from 'pinia-plugin-persistedstate' + +// 创建 pinia 实例 +const pinia = createPinia() +// 使用持久化存储插件 +pinia.use(persist) + +// 默认导出,给 main.ts 使用 +export default pinia diff --git a/mes-ui/uni-app/src/stores/modules/login.ts b/mes-ui/uni-app/src/stores/modules/login.ts new file mode 100644 index 00000000..b82ee41a --- /dev/null +++ b/mes-ui/uni-app/src/stores/modules/login.ts @@ -0,0 +1,56 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: jevononlie 728254585@qq.com + * @LastEditTime: 2024-04-09 18:09:07 + * @FilePath: /app-nx-recycle/src/stores/modules/member.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import type { LoginResult } from '@/types/login' +import { defineStore } from 'pinia' +import { ref, computed } from 'vue' +// 定义 Store +export const useLoginStore = defineStore('login', () => { + // 会员信息 + const userInfo = ref({}) + const dictInfo = ref([]) + + // 保存会员信息,登录时使用 + const setInfo = (val: Object) => { + userInfo.value = val + } + + // 清理会员信息,退出时使用 + const clearInfo = () => { + userInfo.value = undefined + } + + // 保存枚举 + const setDict = (val: any) => { + dictInfo.value = val + } + + // 清理枚举 + const clearDict = () => { + dictInfo.value = [] + } + return { + userInfo, + dictInfo, + setInfo, + clearInfo, + setDict, + clearDict, + } +},{ + persist: { + storage: { + getItem(key) { + return uni.getStorageSync(key) + }, + setItem(key, value) { + uni.setStorageSync(key, value) + }, + } + } +}) diff --git a/mes-ui/uni-app/src/styles/base.scss b/mes-ui/uni-app/src/styles/base.scss new file mode 100644 index 00000000..4c75478b --- /dev/null +++ b/mes-ui/uni-app/src/styles/base.scss @@ -0,0 +1,32 @@ +view, +navigator, +input, +scroll-view { + box-sizing: border-box; +} + +button::after { + border: none; +} + +swiper, +scroll-view { + flex: 1; + height: 100%; + overflow: auto; +} + +image { + width: 100%; + height: 100%; + vertical-align: middle; +} + +// 两行省略 +.ellipsis { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} diff --git a/mes-ui/uni-app/src/styles/base.wxss b/mes-ui/uni-app/src/styles/base.wxss new file mode 100644 index 00000000..5f702394 --- /dev/null +++ b/mes-ui/uni-app/src/styles/base.wxss @@ -0,0 +1,31 @@ +view, +navigator, +input, +scroll-view { + box-sizing: border-box; +} + +button::after { + border: none; +} + +swiper, +scroll-view { + flex: 1; + height: 100%; + overflow: auto; +} + +image { + width: 100%; + height: 100%; + vertical-align: middle; +} + +.ellipsis { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} diff --git a/mes-ui/uni-app/src/styles/fonts.scss b/mes-ui/uni-app/src/styles/fonts.scss new file mode 100644 index 00000000..19f1ae20 --- /dev/null +++ b/mes-ui/uni-app/src/styles/fonts.scss @@ -0,0 +1,147 @@ +@font-face { + font-family: 'erabbit'; + src: url('https://at.alicdn.com/t/c/font_4009193_lnbhmo3yos.woff?t=1681201348304') format('woff'), + url('https://at.alicdn.com/t/c/font_4009193_lnbhmo3yos.ttf?t=1681201348304') format('truetype'), + url('https://at.alicdn.com/t/c/font_4009193_lnbhmo3yos.svg?t=1681201348304#erabbit') + format('svg'); +} + +[class^='icon-'], +[class*=' icon-'] { + font-family: 'erabbit' !important; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-mail:before { + content: '\e644'; +} + +.icon-weixin:before { + content: '\e620'; +} + +.icon-phone:before { + content: '\e618'; +} + +.icon-camera-plus:before { + content: '\e636'; +} + +.icon-close:before { + content: '\e6e1'; +} + +.icon-help:before { + content: '\e617'; +} + +.icon-cart:before { + content: '\e6d1'; +} + +.icon-settings:before { + content: '\e6cf'; +} + +.icon-clock:before { + content: '\e609'; +} + +.icon-delete:before { + content: '\e6ce'; +} + +.icon-checked:before { + content: '\e6cc'; +} + +.icon-ring:before { + content: '\e6cd'; +} + +.icon-locate:before { + content: '\e6cb'; +} + +.icon-mark:before { + content: '\e6ca'; +} + +.icon-check:before { + content: '\e6c9'; +} + +.icon-handset:before { + content: '\e6c8'; +} + +.icon-gift:before { + content: '\e6c7'; +} + +.icon-currency:before { + content: '\e6c6'; +} + +.icon-comment:before { + content: '\e6c5'; +} + +.icon-caret:before { + content: '\e6c3'; +} + +.icon-right:before { + content: '\e6c2'; +} + +.icon-left:before { + content: '\e6c1'; +} + +.icon-down:before { + content: '\e6c0'; +} + +.icon-up:before { + content: '\e6bf'; +} + +.icon-sort:before { + content: '\e616'; +} + +.icon-clear:before { + content: '\e6be'; +} + +.icon-user:before { + content: '\e6bb'; +} + +.icon-scan:before { + content: '\e6bc'; +} + +.icon-search:before { + content: '\e632'; +} + +.icon-preview:before { + content: '\e61d'; +} + +.icon-heart:before { + content: '\e647'; +} + +.icon-filter:before { + content: '\e629'; +} + +.icon-home:before { + content: '\e8b9'; +} diff --git a/mes-ui/uni-app/src/styles/fonts.wxss b/mes-ui/uni-app/src/styles/fonts.wxss new file mode 100644 index 00000000..3358a411 --- /dev/null +++ b/mes-ui/uni-app/src/styles/fonts.wxss @@ -0,0 +1,144 @@ +@font-face { + font-family: 'erabbit'; + src: url("https://at.alicdn.com/t/c/font_4009193_lnbhmo3yos.woff?t=1681201348304") format("woff"), url("https://at.alicdn.com/t/c/font_4009193_lnbhmo3yos.ttf?t=1681201348304") format("truetype"), url("https://at.alicdn.com/t/c/font_4009193_lnbhmo3yos.svg?t=1681201348304#erabbit") format("svg"); +} + +[class^='icon-'], +[class*=' icon-'] { + font-family: 'erabbit' !important; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-mail:before { + content: '\e644'; +} + +.icon-weixin:before { + content: '\e620'; +} + +.icon-phone:before { + content: '\e618'; +} + +.icon-camera-plus:before { + content: '\e636'; +} + +.icon-close:before { + content: '\e6e1'; +} + +.icon-help:before { + content: '\e617'; +} + +.icon-cart:before { + content: '\e6d1'; +} + +.icon-settings:before { + content: '\e6cf'; +} + +.icon-clock:before { + content: '\e609'; +} + +.icon-delete:before { + content: '\e6ce'; +} + +.icon-checked:before { + content: '\e6cc'; +} + +.icon-ring:before { + content: '\e6cd'; +} + +.icon-locate:before { + content: '\e6cb'; +} + +.icon-mark:before { + content: '\e6ca'; +} + +.icon-check:before { + content: '\e6c9'; +} + +.icon-handset:before { + content: '\e6c8'; +} + +.icon-gift:before { + content: '\e6c7'; +} + +.icon-currency:before { + content: '\e6c6'; +} + +.icon-comment:before { + content: '\e6c5'; +} + +.icon-caret:before { + content: '\e6c3'; +} + +.icon-right:before { + content: '\e6c2'; +} + +.icon-left:before { + content: '\e6c1'; +} + +.icon-down:before { + content: '\e6c0'; +} + +.icon-up:before { + content: '\e6bf'; +} + +.icon-sort:before { + content: '\e616'; +} + +.icon-clear:before { + content: '\e6be'; +} + +.icon-user:before { + content: '\e6bb'; +} + +.icon-scan:before { + content: '\e6bc'; +} + +.icon-search:before { + content: '\e632'; +} + +.icon-preview:before { + content: '\e61d'; +} + +.icon-heart:before { + content: '\e647'; +} + +.icon-filter:before { + content: '\e629'; +} + +.icon-home:before { + content: '\e8b9'; +} diff --git a/mes-ui/uni-app/src/types/category.d.ts b/mes-ui/uni-app/src/types/category.d.ts new file mode 100644 index 00000000..180f2fc9 --- /dev/null +++ b/mes-ui/uni-app/src/types/category.d.ts @@ -0,0 +1,27 @@ +import type { GoodsItem } from './global' + +/** 一级分类项 */ +export type CategoryTopItem = { + /** 二级分类集合[ 二级分类项 ] */ + children: CategoryChildItem[] + /** 一级分类id */ + id: string + /** 一级分类图片集[ 一级分类图片项 ] */ + imageBanners: string[] + /** 一级分类名称 */ + name: string + /** 一级分类图片 */ + picture: string +} + +/** 二级分类项 */ +export type CategoryChildItem = { + /** 商品集合[ 商品项 ] */ + goods: GoodsItem[] + /** 二级分类id */ + id: string + /** 二级分类名称 */ + name: string + /** 二级分类图片 */ + picture: string +} diff --git a/mes-ui/uni-app/src/types/components.d.ts b/mes-ui/uni-app/src/types/components.d.ts new file mode 100644 index 00000000..cce4effc --- /dev/null +++ b/mes-ui/uni-app/src/types/components.d.ts @@ -0,0 +1,13 @@ +import XtxSwiper from '@/components/XtxSwiper.vue' +import XtxGuess from '@/components/XtxGuess.vue' + +declare module 'vue' { + export interface GlobalComponents { + XtxSwiper: typeof XtxSwiper + XtxGuess: typeof XtxGuess + } +} + +// 组件实例类型 +export type XtxGuessInstance = InstanceType +export type XtxSwiperInstance = InstanceType diff --git a/mes-ui/uni-app/src/types/global.d.ts b/mes-ui/uni-app/src/types/global.d.ts new file mode 100644 index 00000000..a4385e44 --- /dev/null +++ b/mes-ui/uni-app/src/types/global.d.ts @@ -0,0 +1,40 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-02-22 17:00:35 + * @FilePath: /app-nx-recycle/src/types/global.d.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +/** 通用分页结果类型 */ +export type PageResult = { + /** 列表数据 */ + list: T[] + pages: string, +} + +/** 通用分页参数类型 */ +export type PageParams = { + /** 页码:默认值为 1 */ + pageNo?: number + /** 页大小:默认值为 10 */ + pageSize?: number, +} + +/** 通用商品类型 */ +export type GoodsItem = { + /** 商品描述 */ + desc: string + /** 商品折扣 */ + discount: number + /** id */ + id: string + /** 商品名称 */ + name: string + /** 商品已下单数量 */ + orderNum: number + /** 商品图片 */ + picture: string + /** 商品价格 */ + price: number +} diff --git a/mes-ui/uni-app/src/types/goods.d.ts b/mes-ui/uni-app/src/types/goods.d.ts new file mode 100644 index 00000000..1fc428c7 --- /dev/null +++ b/mes-ui/uni-app/src/types/goods.d.ts @@ -0,0 +1,90 @@ +import type { AddressItem } from './address' +import type { GoodsItem } from './global' + +/** 商品信息 */ +export type GoodsResult = { + /** id */ + id: string + /** 商品名称 */ + name: string + /** 商品描述 */ + desc: string + /** 当前价格 */ + price: number + /** 原价 */ + oldPrice: number + /** 商品详情: 包含详情属性 + 详情图片 */ + details: Details + /** 主图图片集合[ 主图图片链接 ] */ + mainPictures: string[] + /** 同类商品[ 商品信息 ] */ + similarProducts: GoodsItem[] + /** sku集合[ sku信息 ] */ + skus: SkuItem[] + /** 可选规格集合备注[ 可选规格信息 ] */ + specs: SpecItem[] + /** 用户地址列表[ 地址信息 ] */ + userAddresses: AddressItem[] +} + +/** 商品详情: 包含详情属性 + 详情图片 */ +export type Details = { + /** 商品属性集合[ 属性信息 ] */ + properties: DetailsPropertyItem[] + /** 商品详情图片集合[ 图片链接 ] */ + pictures: string[] +} + +/** 属性信息 */ +export type DetailsPropertyItem = { + /** 属性名称 */ + name: string + /** 属性值 */ + value: string +} + +/** sku信息 */ +export type SkuItem = { + /** sku id */ + id: string + /** sku 库存 */ + inventory: number + /** sku 原价 */ + oldPrice: number + /** sku 图片 */ + picture: string + /** sku 当前价 */ + price: number + /** sku 编码 */ + skuCode: string + /** 规格集合[ 规格信息 ] */ + specs: SkuSpecItem[] +} + +/** 规格信息 */ +export type SkuSpecItem = { + /** 规格名称 */ + name: string + /** 可选值名称 */ + valueName: string +} + +/** 可选规格信息 */ +export type SpecItem = { + /** 规格名称 */ + name: string + /** 可选值集合[ 可选值信息 ] */ + values: SpecValueItem[] +} + +/** 可选值信息 */ +export type SpecValueItem = { + /** 是否可售 */ + available: boolean + /** 可选值备注 */ + desc: string + /** 可选值名称 */ + name: string + /** 可选值图片链接 */ + picture: string +} diff --git a/mes-ui/uni-app/src/types/home.d.ts b/mes-ui/uni-app/src/types/home.d.ts new file mode 100644 index 00000000..32e25390 --- /dev/null +++ b/mes-ui/uni-app/src/types/home.d.ts @@ -0,0 +1,42 @@ +import type { GoodsItem } from './global' + +/** 首页-广告区域数据类型 */ +export type BannerItem = { + /** 跳转链接 */ + hrefUrl: string + /** id */ + id: string + /** 图片链接 */ + imgUrl: string + /** 跳转类型 */ + type: number +} + +/** 首页-前台类目数据类型 */ +export type CategoryItem = { + /** 图标路径 */ + icon: string + /** id */ + id: string + /** 分类名称 */ + name: string +} + +/** 首页-热门推荐数据类型 */ +export type HotItem = { + /** 说明 */ + alt: string + /** id */ + id: string + /** 图片集合[ 图片路径 ] */ + pictures: string[] + /** 跳转地址 */ + target: string + /** 标题 */ + title: string + /** 推荐类型 */ + type: string +} + +/** 猜你喜欢-商品类型 */ +export type GuessItem = GoodsItem diff --git a/mes-ui/uni-app/src/types/hot.d.ts b/mes-ui/uni-app/src/types/hot.d.ts new file mode 100644 index 00000000..0b64de91 --- /dev/null +++ b/mes-ui/uni-app/src/types/hot.d.ts @@ -0,0 +1,23 @@ +import type { PageResult, GoodsItem } from './global' + +/** 热门推荐-子类选项 */ +export type SubTypeItem = { + /** 子类id */ + id: string + /** 子类标题 */ + title: string + /** 子类对应的商品集合 */ + goodsItems: PageResult +} + +/** 热门推荐 */ +export type HotResult = { + /** id信息 */ + id: string + /** 活动图片 */ + bannerPicture: string + /** 活动标题 */ + title: string + /** 子类选项 */ + subTypes: SubTypeItem[] +} diff --git a/mes-ui/uni-app/src/types/login.ts b/mes-ui/uni-app/src/types/login.ts new file mode 100644 index 00000000..e0f2f2e0 --- /dev/null +++ b/mes-ui/uni-app/src/types/login.ts @@ -0,0 +1,21 @@ +/* + * @Author: 王文杰 + * @Date: 2024-03-19 16:49:52 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-19 17:14:46 + * @FilePath: /hl-app/src/types/login.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ + +/** 登录信息 */ +export type LoginResult = { + /** 用户ID */ + // code: number + // data: Object + // /** 昵称 */ + // msg?: string + accessToken: string + expiresTime: number + refreshToken: string + userId: number +} diff --git a/mes-ui/uni-app/src/types/member.d.ts b/mes-ui/uni-app/src/types/member.d.ts new file mode 100644 index 00000000..e70f88b6 --- /dev/null +++ b/mes-ui/uni-app/src/types/member.d.ts @@ -0,0 +1,50 @@ + +/** 通用的用户信息 */ +type BaseProfile = { + /** 用户ID */ + id: number + /** 头像 */ + avatar: string + /** 账户名 */ + account: string + /** 昵称 */ + nickname?: string +} + +/** 小程序登录 登录用户信息 */ +export type LoginResult = { + id: string + openid: string + phone: string + /** 登录凭证 */ + token: string + userType: Object + username: string +} + +/** 个人信息 用户详情信息 */ +export type ProfileDetail = BaseProfile & { + /** 性别 */ + gender?: Gender + /** 生日 */ + birthday?: string + /** 省市区 */ + fullLocation?: string + /** 职业 */ + profession?: string +} +/** 性别 */ +export type Gender = '女' | '男' + +/** 个人信息 修改请求体参数 */ +export type ProfileParams = Pick< + ProfileDetail, + 'nickname' | 'gender' | 'birthday' | 'profession' +> & { + /** 省份编码 */ + provinceCode?: string + /** 城市编码 */ + cityCode?: string + /** 区/县编码 */ + countyCode?: string +} diff --git a/mes-ui/uni-app/src/types/order.d.ts b/mes-ui/uni-app/src/types/order.d.ts new file mode 100644 index 00000000..29a535aa --- /dev/null +++ b/mes-ui/uni-app/src/types/order.d.ts @@ -0,0 +1,165 @@ +import type { OrderState } from '@/services/constants' +import type { AddressItem } from './address' +import type { PageParams } from '@/types/global' + +/** 获取预付订单 返回信息 */ +export type OrderPreResult = { + /** 商品集合 [ 商品信息 ] */ + goods: OrderPreGoods[] + /** 结算信息 */ + summary: { + /** 商品总价 */ + totalPrice: number + /** 邮费 */ + postFee: number + /** 应付金额 */ + totalPayPrice: number + } + /** 用户地址列表 [ 地址信息 ] */ + userAddresses: AddressItem[] +} + +/** 商品信息 */ +export type OrderPreGoods = { + /** 属性文字,例如“颜色:瓷白色 尺寸:8寸” */ + attrsText: string + /** 数量 */ + count: number + /** id */ + id: string + /** 商品名称 */ + name: string + /** 实付单价 */ + payPrice: string + /** 图片 */ + picture: string + /** 原单价 */ + price: string + /** SKUID */ + skuId: string + /** 实付价格小计 */ + totalPayPrice: string + /** 小计总价 */ + totalPrice: string +} + +/** 提交订单 请求参数 */ +export type OrderCreateParams = { + /** 所选地址Id */ + addressId: string + /** 配送时间类型,1为不限,2为工作日,3为双休或假日 */ + deliveryTimeType: number + /** 订单备注 */ + buyerMessage: string + /** 商品集合[ 商品信息 ] */ + goods: { + /** 数量 */ + count: number + /** skuId */ + skuId: string + }[] + /** 支付渠道:支付渠道,1支付宝、2微信--支付方式为在线支付时,传值,为货到付款时,不传值 */ + payChannel: 1 | 2 + /** 支付方式,1为在线支付,2为货到付款 */ + payType: 1 | 2 +} + +/** 提交订单 返回信息 */ +export type OrderCreateResult = { + /** 订单Id */ + id: string +} + +/** 订单详情 返回信息 */ +export type OrderResult = { + /** 订单编号 */ + id: string + /** 订单状态,1为待付款、2为待发货、3为待收货、4为待评价、5为已完成、6为已取消 */ + orderState: OrderState + /** 倒计时--剩余的秒数 -1 表示已经超时,正数表示倒计时未结束 */ + countdown: number + /** 商品集合 [ 商品信息 ] */ + skus: OrderSkuItem[] + /** 收货人 */ + receiverContact: string + /** 收货人手机 */ + receiverMobile: string + /** 收货人地址 */ + receiverAddress: string + /** 下单时间 */ + createTime: string + /** 商品总价 */ + totalMoney: number + /** 运费 */ + postFee: number + /** 应付金额 */ + payMoney: number +} + +/** 商品信息 */ +export type OrderSkuItem = { + /** sku id */ + id: string + /** 商品 id */ + spuId: string + /** 商品名称 */ + name: string + /** 商品属性文字 */ + attrsText: string + /** 数量 */ + quantity: number + /** 购买时单价 */ + curPrice: number + /** 图片地址 */ + image: string +} + +/** 物流信息 返回值类型 */ +export type OrderLogisticResult = { + /** 快递公司 */ + company: { + /** 公司名称 */ + name: string + /** 快递编号 */ + number: string + /** 联系电话 */ + tel: string + } + /** 商品件数 */ + count: number + /** 物流日志 */ + list: LogisticItem[] +} + +/** 物流日志 */ +export type LogisticItem = { + /** 信息ID */ + id: string + /** 信息文字 */ + text: string + /** 时间 */ + time: string +} + +/** 订单列表参数 */ +export type OrderListParams = PageParams + +/** 订单列表 */ +export type OrderListResult = { + /** 总记录数 */ + counts: number + /** 数据集合 [ 订单信息 ] */ + items: OrderItem[] + /** 当前页码 */ + page: number + /** 总页数 */ + pages: number + /** 页尺寸 */ + pageSize: number +} + +/** 订单列表项 */ +export type OrderItem = OrderResult & { + /** 总件数 */ + totalNum: number +} diff --git a/mes-ui/uni-app/src/uni.scss b/mes-ui/uni-app/src/uni.scss new file mode 100644 index 00000000..d0551103 --- /dev/null +++ b/mes-ui/uni-app/src/uni.scss @@ -0,0 +1,76 @@ +/** + * 这里是uni-app内置的常用样式变量 + * + * uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量 + * 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App + * + */ + +/** + * 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能 + * + * 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件 + */ + +/* 颜色变量 */ + +/* 行为相关颜色 */ +$uni-color-primary: #007aff; +$uni-color-success: #4cd964; +$uni-color-warning: #f0ad4e; +$uni-color-error: #dd524d; + +/* 文字基本颜色 */ +$uni-text-color: #333; // 基本色 +$uni-text-color-inverse: #fff; // 反色 +$uni-text-color-grey: #999; // 辅助灰色,如加载更多的提示信息 +$uni-text-color-placeholder: #808080; +$uni-text-color-disable: #c0c0c0; + +/* 背景颜色 */ +$uni-bg-color: #fff; +$uni-bg-color-grey: #f8f8f8; +$uni-bg-color-hover: #f1f1f1; // 点击状态颜色 +$uni-bg-color-mask: rgba(0, 0, 0, 0.4); // 遮罩颜色 + +/* 边框颜色 */ +$uni-border-color: #c8c7cc; + +/* 尺寸变量 */ + +/* 文字尺寸 */ +$uni-font-size-sm: 12px; +$uni-font-size-base: 14px; +$uni-font-size-lg: 16; + +/* 图片尺寸 */ +$uni-img-size-sm: 20px; +$uni-img-size-base: 26px; +$uni-img-size-lg: 40px; + +/* Border Radius */ +$uni-border-radius-sm: 2px; +$uni-border-radius-base: 3px; +$uni-border-radius-lg: 6px; +$uni-border-radius-circle: 50%; + +/* 水平间距 */ +$uni-spacing-row-sm: 5px; +$uni-spacing-row-base: 10px; +$uni-spacing-row-lg: 15px; + +/* 垂直间距 */ +$uni-spacing-col-sm: 4px; +$uni-spacing-col-base: 8px; +$uni-spacing-col-lg: 12px; + +/* 透明度 */ +$uni-opacity-disabled: 0.3; // 组件禁用态的透明度 + +/* 文章场景相关 */ +$uni-color-title: #2c405a; // 文章标题颜色 +$uni-font-size-title: 20px; +$uni-color-subtitle: #555; // 二级标题颜色 +$uni-font-size-subtitle: 18px; +$uni-color-paragraph: #3f536e; // 文章段落颜色 +$uni-font-size-paragraph: 15px; diff --git a/mes-ui/uni-app/src/uni_modules/lin-select/changelog.md b/mes-ui/uni-app/src/uni_modules/lin-select/changelog.md new file mode 100644 index 00000000..8b8ba750 --- /dev/null +++ b/mes-ui/uni-app/src/uni_modules/lin-select/changelog.md @@ -0,0 +1,17 @@ +## 1.2.6(2024-03-11) +1.增加了value-key绑定字段; +2.修复选中值无法绑定的问题; +## 1.2.5(2024-01-18) +修复v-model无法响应的问题 +## 1.2.4(2023-10-17) +修复了vue2版本,点击选项后无法更新value的问题 +## 1.2.3(2023-09-21) +修复了vue2版本的v-model 无法初始化绑定值的bug +## 1.2.2(2023-08-11) +修复了选中值未变化的bug +## 1.2.1(2023-07-22) +修复了一直加载中,不消失的bug +## 1.2.0(2023-07-22) +兼容vue2,添加了远程加载数据样式 +## 1.0.0(2023-07-06) +先更新1.0.0版本,如有别的需求再提 diff --git a/mes-ui/uni-app/src/uni_modules/lin-select/components/lin-select/lin-select.vue b/mes-ui/uni-app/src/uni_modules/lin-select/components/lin-select/lin-select.vue new file mode 100644 index 00000000..346f25da --- /dev/null +++ b/mes-ui/uni-app/src/uni_modules/lin-select/components/lin-select/lin-select.vue @@ -0,0 +1,248 @@ + + + + diff --git a/mes-ui/uni-app/src/uni_modules/lin-select/package.json b/mes-ui/uni-app/src/uni_modules/lin-select/package.json new file mode 100644 index 00000000..3fb328d3 --- /dev/null +++ b/mes-ui/uni-app/src/uni_modules/lin-select/package.json @@ -0,0 +1,82 @@ +{ + "id": "lin-select", + "displayName": "lin-select", + "version": "1.2.6", + "description": "Select 下拉选择器,支持远程搜索,输入搜索", + "keywords": [ + "lin-select,", + "select" +], + "repository": "", + "engines": { + "HBuilderX": "^3.8.1" + }, + "dcloudext": { + "type": "component-vue", + "sale": { + "regular": { + "price": "0.00" + }, + "sourcecode": { + "price": "0.00" + } + }, + "contact": { + "qq": "" + }, + "declaration": { + "ads": "无", + "data": "插件不采集任何数据", + "permissions": "无" + }, + "npmurl": "" + }, + "uni_modules": { + "dependencies": [], + "encrypt": [], + "platforms": { + "cloud": { + "tcb": "y", + "aliyun": "y" + }, + "client": { + "Vue": { + "vue2": "y", + "vue3": "y" + }, + "App": { + "app-vue": "u", + "app-nvue": "u" + }, + "H5-mobile": { + "Safari": "u", + "Android Browser": "u", + "微信浏览器(Android)": "u", + "QQ浏览器(Android)": "u" + }, + "H5-pc": { + "Chrome": "u", + "IE": "u", + "Edge": "u", + "Firefox": "u", + "Safari": "u" + }, + "小程序": { + "微信": "y", + "阿里": "u", + "百度": "u", + "字节跳动": "u", + "QQ": "u", + "钉钉": "u", + "快手": "u", + "飞书": "u", + "京东": "u" + }, + "快应用": { + "华为": "u", + "联盟": "u" + } + } + } + } +} \ No newline at end of file diff --git a/mes-ui/uni-app/src/uni_modules/lin-select/readme.md b/mes-ui/uni-app/src/uni_modules/lin-select/readme.md new file mode 100644 index 00000000..d948e52b --- /dev/null +++ b/mes-ui/uni-app/src/uni_modules/lin-select/readme.md @@ -0,0 +1,93 @@ +# lin-select + +## **使用说明** + +### **==注意:需要依赖 [uni-easyinput](https://ext.dcloud.net.cn/plugin?name=uni-easyinput) ,请先导入[uni-easyinput](https://ext.dcloud.net.cn/plugin?name=uni-easyinput)后再使用;==** + +```html +//将插件导入到Hubilder之后,直接通过标签使用 + +``` + +```javascript + +``` + +# **Props** + +| 参数 | 说明 | 类型 | 是否必填 | +| :----------- | :---------------- | :--------------- | :------- | +| list | 数据源数组 | Array | 必填 | +| value-key | 取值的 key | string | 必填 | +| name-key | 显示的 key | string | 必填 | +| max-height | 列表最大高度 | string \| number | 否 | +| @input | 输入框 input 事件 | function | 否 | +| @confirm | 点击选项事件 | function | 否 | +| v-model | 绑定的字段 | - | 否 | +| loading | 是否正在加载 | Boolean | 否 | +| loading-text | 远程加载中的文案 | string | 否 | + +## **联系作者** + +如使用上有问题可以留言或者联系我哈,我会一直更新的; diff --git a/mes-ui/uni-app/src/utils/http.ts b/mes-ui/uni-app/src/utils/http.ts new file mode 100644 index 00000000..7007ffcf --- /dev/null +++ b/mes-ui/uni-app/src/utils/http.ts @@ -0,0 +1,129 @@ + +/** + * 添加拦截器: + * 拦截 request 请求 + * 拦截 uploadFile 文件上传 + * + * TODO: + * 1. 非 http 开头需拼接地址 + * 2. 请求超时 + * 3. 添加小程序端请求头标识 + * 4. 添加 token 请求头标识 + */ +import { useLoginStore } from '@/stores/modules/login' +import { serviceDomain } from '@/services/constants' +const baseURL = serviceDomain + '/admin-api' +const loginStore = useLoginStore() +// 添加拦截器 +const httpInterceptor = { + // 拦截前触发 + invoke(options: UniApp.RequestOptions) { + + // 1. 非 http 开头需拼接地址 + if (!options.url.startsWith('http')) { + options.url = baseURL + options.url + } + // 2. 请求超时, 默认 60s + options.timeout = 10000 + // 3. 添加小程序端请求头标识 + options.header = { + ...options.header, + // 'tenant-id': loginStore.userInfo?.userId || 2, + 'tenant-id': 2, + } + // 4. 添加 token 请求头标识 + + const storage_token = uni.getStorageSync('storage_loginInfo')?.accessToken + const token = loginStore.userInfo?.accessToken || storage_token + if (token) { + options.header.Authorization = token + } + }, +} +uni.addInterceptor('request', httpInterceptor) +uni.addInterceptor('uploadFile', httpInterceptor) + +/** + * 请求函数 + * @param UniApp.RequestOptions + * @returns Promise + * 1. 返回 Promise 对象 + * 2. 获取数据成功 + * 2.1 提取核心数据 res.data + * 2.2 添加类型,支持泛型 + * 3. 获取数据失败 + * 3.1 401错误 -> 清理用户信息,跳转到登录页 + * 3.2 其他错误 -> 根据后端错误信息轻提示 + * 3.3 网络错误 -> 提示用户换网络 + */ +type Data = { + code: string + msg: string + result: T +} + +function ajaxError(data) { + uni.showToast({ + title: data.msg || '请求出错,请重试', + duration: 3000, + icon: 'none', + complete() { + if (data.code === 600 || data.code === 601 || data.code === 602) { + const memberStore = useMemberStore() + memberStore.clearProfile() + uni.reLaunch({ + url: '/pages/login/login' + }) + } + } + }) +} +// 2.2 添加类型,支持泛型 +export const http = (options: UniApp.RequestOptions) => { + // 1. 返回 Promise 对象 + return new Promise>((resolve, reject) => { + uni.request({ + ...options, + // 响应成功 + success(res) { + console.log(res) + // 状态码 2xx, axios 就是这样设计的 + if (res.statusCode >= 200 && res.statusCode < 300) { + if (res.data?.code == 0) { + resolve(res.data.data as Data) + } else if (res.data?.code === 401) { + // 401错误 -> 清理用户信息,跳转到登录页 + loginStore.clearInfo() + uni.navigateTo({ url: '/pages/login/login' }) + reject(res) + } else { + const msg = (res.data as Data).msg + uni.showToast({ + icon: 'none', + duration: 3000, + title: msg || '请求错误', + }) + reject(res) + } + } else { + // 其他错误 -> 根据后端错误信息轻提示 + uni.showToast({ + icon: 'none', + duration: 3000, + title: (res.data as Data).msg || '请求错误', + }) + reject(res) + } + }, + // 响应失败 + fail(err) { + uni.showToast({ + icon: 'none', + duration: 3000, + title: '网络错误,换个网络试试', + }) + reject(err) + }, + }) + }) +} diff --git a/mes-ui/uni-app/src/utils/index.ts b/mes-ui/uni-app/src/utils/index.ts new file mode 100644 index 00000000..f8c19c52 --- /dev/null +++ b/mes-ui/uni-app/src/utils/index.ts @@ -0,0 +1,69 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: jevononlie 728254585@qq.com + * @LastEditTime: 2024-04-07 09:36:33 + * @FilePath: /app-nx-personal/src/utils/index.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +/** + * 日期格式化函数 + * @param date 日期对象 + * @param format 日期格式,默认为 YYYY-MM-DD HH:mm:ss + */ +export const formatDate = (datePramas: Date, format = 'YYYY-MM-DD HH:mm:ss') => { + // 获取年月日时分秒,通过 padStart 补 0 + const date = new Date(datePramas) + const year = String(date.getFullYear()) + const month = String(date.getMonth() + 1).padStart(2, '0') + const day = String(date.getDate()).padStart(2, '0') + const hours = String(date.getHours()).padStart(2, '0') + const minutes = String(date.getMinutes()).padStart(2, '0') + const seconds = String(date.getSeconds()).padStart(2, '0') + + // 返回格式化后的结果 + return format + .replace('YYYY', year) + .replace('MM', month) + .replace('DD', day) + .replace('HH', hours) + .replace('mm', minutes) + .replace('ss', seconds) +} +/** + * 微信小程序发布后提醒用户更新版本 + * + * @return {[type]} [return description] + */ +export const updateManager = () => { + const updateManager = uni.getUpdateManager() // 小程序版本更新管理器 + updateManager.onCheckForUpdate((res) => { + // 检测新版本后的回调 + if (res.hasUpdate) { + // 如果有新版本提醒并进行强制升级 + uni.showModal({ + content: '新版本已经准备好,是否重启应用?', + showCancel: false, + confirmText: '确定', + success: (res) => { + if (res.confirm) { + updateManager.onUpdateReady((res) => { + // 新版本下载完成的回调 + updateManager.applyUpdate() // 强制当前小程序应用上新版本并重启 + }) + + updateManager.onUpdateFailed((res) => { + // 新版本下载失败的回调 + // 新版本下载失败,提示用户删除后通过冷启动重新打开 + uni.showModal({ + content: '下载失败,请删除当前小程序后重新打开', + showCancel: false, + confirmText: '知道了', + }) + }) + } + }, + }) + } + }) +} diff --git a/mes-ui/uni-app/tsconfig.json b/mes-ui/uni-app/tsconfig.json new file mode 100644 index 00000000..389d7999 --- /dev/null +++ b/mes-ui/uni-app/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "@vue/tsconfig/tsconfig.json", + "compilerOptions": { + "allowJs": true, + "sourceMap": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + }, + "lib": ["esnext", "dom"], + "types": [ + "@dcloudio/types", + "miniprogram-api-typings", + "@uni-helper/uni-app-types", + "@uni-helper/uni-ui-types" + ] + }, + // 校验 uni-app 组件类型 + "vueCompilerOptions": { + // experimentalRuntimeMode 已废弃,现调整为 nativeTags,请升级 Volar 插件至最新版本 + "nativeTags": ["block", "component", "template", "slot"] + }, + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/mes-ui/uni-app/unpackage/res/icons/1024x1024.png b/mes-ui/uni-app/unpackage/res/icons/1024x1024.png new file mode 100644 index 00000000..22f21b66 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/1024x1024.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/120x120.png b/mes-ui/uni-app/unpackage/res/icons/120x120.png new file mode 100644 index 00000000..5be9fb9a Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/120x120.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/144x144.png b/mes-ui/uni-app/unpackage/res/icons/144x144.png new file mode 100644 index 00000000..2d40251e Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/144x144.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/152x152.png b/mes-ui/uni-app/unpackage/res/icons/152x152.png new file mode 100644 index 00000000..6a827bbb Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/152x152.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/167x167.png b/mes-ui/uni-app/unpackage/res/icons/167x167.png new file mode 100644 index 00000000..7c7122ba Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/167x167.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/180x180.png b/mes-ui/uni-app/unpackage/res/icons/180x180.png new file mode 100644 index 00000000..94a18ced Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/180x180.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/192x192.png b/mes-ui/uni-app/unpackage/res/icons/192x192.png new file mode 100644 index 00000000..5eed0f0f Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/192x192.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/20x20.png b/mes-ui/uni-app/unpackage/res/icons/20x20.png new file mode 100644 index 00000000..97c61b88 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/20x20.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/29x29.png b/mes-ui/uni-app/unpackage/res/icons/29x29.png new file mode 100644 index 00000000..200586a6 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/29x29.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/40x40.png b/mes-ui/uni-app/unpackage/res/icons/40x40.png new file mode 100644 index 00000000..c0427451 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/40x40.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/58x58.png b/mes-ui/uni-app/unpackage/res/icons/58x58.png new file mode 100644 index 00000000..ca037e61 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/58x58.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/60x60.png b/mes-ui/uni-app/unpackage/res/icons/60x60.png new file mode 100644 index 00000000..279ea6d3 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/60x60.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/72x72.png b/mes-ui/uni-app/unpackage/res/icons/72x72.png new file mode 100644 index 00000000..352ca10b Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/72x72.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/76x76.png b/mes-ui/uni-app/unpackage/res/icons/76x76.png new file mode 100644 index 00000000..630b5dd6 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/76x76.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/80x80.png b/mes-ui/uni-app/unpackage/res/icons/80x80.png new file mode 100644 index 00000000..4173c42d Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/80x80.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/87x87.png b/mes-ui/uni-app/unpackage/res/icons/87x87.png new file mode 100644 index 00000000..7816dc27 Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/87x87.png differ diff --git a/mes-ui/uni-app/unpackage/res/icons/96x96.png b/mes-ui/uni-app/unpackage/res/icons/96x96.png new file mode 100644 index 00000000..26ad3c4d Binary files /dev/null and b/mes-ui/uni-app/unpackage/res/icons/96x96.png differ diff --git a/mes-ui/uni-app/vite.config.ts b/mes-ui/uni-app/vite.config.ts new file mode 100644 index 00000000..d16cbe46 --- /dev/null +++ b/mes-ui/uni-app/vite.config.ts @@ -0,0 +1,25 @@ +/* + * @Author: 王文杰 + * @Date: 2024-01-04 12:54:56 + * @LastEditors: 王文杰 + * @LastEditTime: 2024-03-02 09:17:56 + * @FilePath: /app-nx-personal/vite.config.ts + * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE + */ +import { defineConfig } from 'vite' +// import { viteMockServe } from "vite-plugin-mock"; +import uni from '@dcloudio/vite-plugin-uni' + +// https://vitejs.dev/config/ +export default defineConfig({ + build: { + // 开发阶段启用源码映射:https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#需主动开启-sourcemap + sourcemap: process.env.NODE_ENV === 'development', + }, + plugins: [ + uni(), + // viteMockServe({ + // supportTs: true, + // }) + ], +})