diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c0b65b5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +unpackage/ \ No newline at end of file diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json new file mode 100644 index 0000000..81f13f4 --- /dev/null +++ b/.hbuilderx/launch.json @@ -0,0 +1,16 @@ +{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/ + // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数 + "version": "0.0", + "configurations": [{ + "default" : + { + "launchtype" : "local" + }, + "mp-weixin" : + { + "launchtype" : "local" + }, + "type" : "uniCloud" + } + ] +} diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..10b731c --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,5 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml +# 基于编辑器的 HTTP 客户端请求 +/httpRequests/ diff --git a/.idea/TakeOutShop.iml b/.idea/TakeOutShop.iml new file mode 100644 index 0000000..24643cc --- /dev/null +++ b/.idea/TakeOutShop.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/UniappTool.xml b/.idea/UniappTool.xml new file mode 100644 index 0000000..adde661 --- /dev/null +++ b/.idea/UniappTool.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/.idea/git_toolbox_blame.xml b/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000..7dc1249 --- /dev/null +++ b/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/git_toolbox_prj.xml b/.idea/git_toolbox_prj.xml new file mode 100644 index 0000000..02b915b --- /dev/null +++ b/.idea/git_toolbox_prj.xml @@ -0,0 +1,15 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml new file mode 100644 index 0000000..c27af06 --- /dev/null +++ b/.idea/jsLibraryMappings.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/material_theme_project_new.xml b/.idea/material_theme_project_new.xml new file mode 100644 index 0000000..d05d957 --- /dev/null +++ b/.idea/material_theme_project_new.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..0c8b6f0 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/App.vue b/App.vue new file mode 100644 index 0000000..5224a66 --- /dev/null +++ b/App.vue @@ -0,0 +1,36 @@ + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..c3ff205 --- /dev/null +++ b/index.html @@ -0,0 +1,20 @@ + + + + + + + + + + +
+ + + diff --git a/main.js b/main.js new file mode 100644 index 0000000..742f11f --- /dev/null +++ b/main.js @@ -0,0 +1,14 @@ +import { createSSRApp } from 'vue' +// import store from './store' // 如果使用Vuex等状态管理库,则需要引入store等配置项。 +import { createPinia } from 'pinia'; // 引入 Pinia +import App from './App.vue' +// 创建 Pinia 实例 +const pinia = createPinia(); + +export function createApp() { + const app = createSSRApp(App) // 使用createSSRApp创建应用实例(对于小程序很重要) + // 使用 Pinia + app.use(pinia); + // app.use(store) // 使用Vuex等状态管理库(如果有的话) + return { app } // 注意此处返回的是app实例的引用,这对于小程序很重要。 +} \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..a02b7af --- /dev/null +++ b/manifest.json @@ -0,0 +1,80 @@ +{ + "name" : "TakeOutShop", + "appid" : "__UNI__5830F80", + "description" : "", + "versionName" : "1.0.0", + "versionCode" : "100", + "transformPx" : false, + /* 5+App特有相关 */ + "app-plus" : { + "usingComponents" : true, + "nvueStyleCompiler" : "uni-app", + "compilerVersion" : 3, + "splashscreen" : { + "alwaysShowBeforeRender" : true, + "waiting" : true, + "autoclose" : true, + "delay" : 0 + }, + /* 模块配置 */ + "modules" : {}, + /* 应用发布信息 */ + "distribute" : { + /* android打包配置 */ + "android" : { + "permissions" : [ + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "", + "" + ] + }, + /* ios打包配置 */ + "ios" : {}, + /* SDK配置 */ + "sdkConfigs" : {} + } + }, + /* 快应用特有相关 */ + "quickapp" : {}, + /* 小程序特有相关 */ + "mp-weixin" : { + "appid" : "wxae650b415f68bf70", + "setting" : { + "urlCheck" : false, + "es6" : true, + "postcss" : true, + "minified" : false + }, + "usingComponents" : true, + "permission" : { + "scope.userLocation" : { + "desc" : "将获取您的具体位置信息,用于门店和您之间的距离以变您进行消费" + } + } + }, + "mp-alipay" : { + "usingComponents" : true + }, + "mp-baidu" : { + "usingComponents" : true + }, + "mp-toutiao" : { + "usingComponents" : true + }, + "uniStatistics" : { + "enable" : false + }, + "vueVersion" : "3" +} diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..049c2f9 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,484 @@ +{ + "name": "takeoutshop", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "takeoutshop", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "js-md5": "^0.7.3", + "jweixin-module": "^1.4.1", + "mini-html-parser2": "^0.3.0", + "number-precision": "^1.3.2", + "pinia": "^3.0.1", + "qs": "^5.2.1", + "vuex": "^4.0.2" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.25.9", + "resolved": "https://registry.npmmirror.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", + "peer": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.26.9.tgz", + "integrity": "sha512-81NWa1njQblgZbQHxWHpxxCzNsa3ZwvFqpUg7P+NNUU6f3UU2jBEg4OlF/J6rl8+PQGh1q6/zWScd001YwcA5A==", + "peer": true, + "dependencies": { + "@babel/types": "^7.26.9" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.26.9", + "resolved": "https://registry.npmmirror.com/@babel/types/-/types-7.26.9.tgz", + "integrity": "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw==", + "peer": true, + "dependencies": { + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "peer": true + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.5.13.tgz", + "integrity": "sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==", + "peer": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.13", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-core/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "peer": true, + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.5.13.tgz", + "integrity": "sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==", + "peer": true, + "dependencies": { + "@vue/compiler-core": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.5.13.tgz", + "integrity": "sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==", + "peer": true, + "dependencies": { + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.13", + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.11", + "postcss": "^8.4.48", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.5.13.tgz", + "integrity": "sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==" + }, + "node_modules/@vue/devtools-kit": { + "version": "7.7.2", + "resolved": "https://registry.npmmirror.com/@vue/devtools-kit/-/devtools-kit-7.7.2.tgz", + "integrity": "sha512-CY0I1JH3Z8PECbn6k3TqM1Bk9ASWxeMtTCvZr7vb+CHi+X/QwQm5F1/fPagraamKMAHVfuuCbdcnNg1A4CYVWQ==", + "dependencies": { + "@vue/devtools-shared": "^7.7.2", + "birpc": "^0.2.19", + "hookable": "^5.5.3", + "mitt": "^3.0.1", + "perfect-debounce": "^1.0.0", + "speakingurl": "^14.0.1", + "superjson": "^2.2.1" + } + }, + "node_modules/@vue/devtools-shared": { + "version": "7.7.2", + "resolved": "https://registry.npmmirror.com/@vue/devtools-shared/-/devtools-shared-7.7.2.tgz", + "integrity": "sha512-uBFxnp8gwW2vD6FrJB8JZLUzVb6PNRG0B0jBnHsOH8uKyva2qINY8PTF5Te4QlTbMDqU5K6qtJDr6cNsKWhbOA==", + "dependencies": { + "rfdc": "^1.4.1" + } + }, + "node_modules/@vue/reactivity": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.5.13.tgz", + "integrity": "sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==", + "peer": true, + "dependencies": { + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.5.13.tgz", + "integrity": "sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==", + "peer": true, + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/shared": "3.5.13" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.5.13.tgz", + "integrity": "sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==", + "peer": true, + "dependencies": { + "@vue/reactivity": "3.5.13", + "@vue/runtime-core": "3.5.13", + "@vue/shared": "3.5.13", + "csstype": "^3.1.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.5.13.tgz", + "integrity": "sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==", + "peer": true, + "dependencies": { + "@vue/compiler-ssr": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "vue": "3.5.13" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.5.13.tgz", + "integrity": "sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==", + "peer": true + }, + "node_modules/birpc": { + "version": "0.2.19", + "resolved": "https://registry.npmmirror.com/birpc/-/birpc-0.2.19.tgz", + "integrity": "sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==", + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/copy-anything": { + "version": "3.0.5", + "resolved": "https://registry.npmmirror.com/copy-anything/-/copy-anything-3.0.5.tgz", + "integrity": "sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==", + "dependencies": { + "is-what": "^4.1.8" + }, + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/csstype": { + "version": "3.1.3", + "resolved": "https://registry.npmmirror.com/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", + "peer": true + }, + "node_modules/domelementtype": { + "version": "1.3.1", + "resolved": "https://registry.npmmirror.com/domelementtype/-/domelementtype-1.3.1.tgz", + "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" + }, + "node_modules/domhandler": { + "version": "2.4.2", + "resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-2.4.2.tgz", + "integrity": "sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==", + "dependencies": { + "domelementtype": "1" + } + }, + "node_modules/entities": { + "version": "1.1.2", + "resolved": "https://registry.npmmirror.com/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==" + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "peer": true + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmmirror.com/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/hookable": { + "version": "5.5.3", + "resolved": "https://registry.npmmirror.com/hookable/-/hookable-5.5.3.tgz", + "integrity": "sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==" + }, + "node_modules/is-what": { + "version": "4.1.16", + "resolved": "https://registry.npmmirror.com/is-what/-/is-what-4.1.16.tgz", + "integrity": "sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==", + "engines": { + "node": ">=12.13" + }, + "funding": { + "url": "https://github.com/sponsors/mesqueeb" + } + }, + "node_modules/js-md5": { + "version": "0.7.3", + "resolved": "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz", + "integrity": "sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==" + }, + "node_modules/jweixin-module": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/jweixin-module/-/jweixin-module-1.6.0.tgz", + "integrity": "sha512-dGk9cf+ipipHmtzYmKZs5B2toX+p4hLyllGLF6xuC8t+B05oYxd8fYoaRz0T30U2n3RUv8a4iwvjhA+OcYz52w==" + }, + "node_modules/magic-string": { + "version": "0.30.17", + "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.17.tgz", + "integrity": "sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==", + "peer": true, + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0" + } + }, + "node_modules/mini-html-parser2": { + "version": "0.3.0", + "resolved": "https://registry.npmmirror.com/mini-html-parser2/-/mini-html-parser2-0.3.0.tgz", + "integrity": "sha512-W4x1MCmtlnAH5M9qQ1WbRn+hTvv7bdrJx4VI+6SD0MUZatW/6K7v213Aidx7VDQmSKoRv+iAn5TswJnesOs71Q==", + "dependencies": { + "domhandler": "^2.4.2", + "entities": "^1.1.1", + "events": "^3.0.0" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==" + }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/number-precision": { + "version": "1.6.0", + "resolved": "https://registry.npmmirror.com/number-precision/-/number-precision-1.6.0.tgz", + "integrity": "sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ==" + }, + "node_modules/perfect-debounce": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/perfect-debounce/-/perfect-debounce-1.0.0.tgz", + "integrity": "sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "peer": true + }, + "node_modules/pinia": { + "version": "3.0.1", + "resolved": "https://registry.npmmirror.com/pinia/-/pinia-3.0.1.tgz", + "integrity": "sha512-WXglsDzztOTH6IfcJ99ltYZin2mY8XZCXujkYWVIJlBjqsP6ST7zw+Aarh63E1cDVYeyUcPCxPHzJpEOmzB6Wg==", + "dependencies": { + "@vue/devtools-api": "^7.7.2" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "typescript": ">=4.4.4", + "vue": "^2.7.0 || ^3.5.11" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/pinia/node_modules/@vue/devtools-api": { + "version": "7.7.2", + "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-7.7.2.tgz", + "integrity": "sha512-1syn558KhyN+chO5SjlZIwJ8bV/bQ1nOVTG66t2RbG66ZGekyiYNmRO7X9BJCXQqPsFHlnksqvPhce2qpzxFnA==", + "dependencies": { + "@vue/devtools-kit": "^7.7.2" + } + }, + "node_modules/postcss": { + "version": "8.5.3", + "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.5.3.tgz", + "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "peer": true, + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/qs": { + "version": "5.2.1", + "resolved": "https://registry.npmmirror.com/qs/-/qs-5.2.1.tgz", + "integrity": "sha512-sh/hmLUTLEiYFhSbRvkM4zj6fMWnbqQt9wrppR2LJA/U/u4xS2eWN8LBE1xc79ExYZJBVZYSMBv/INC7wpE+fw==", + "engines": ">=0.10.40" + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmmirror.com/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==" + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/speakingurl": { + "version": "14.0.1", + "resolved": "https://registry.npmmirror.com/speakingurl/-/speakingurl-14.0.1.tgz", + "integrity": "sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/superjson": { + "version": "2.2.2", + "resolved": "https://registry.npmmirror.com/superjson/-/superjson-2.2.2.tgz", + "integrity": "sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q==", + "dependencies": { + "copy-anything": "^3.0.2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/vue": { + "version": "3.5.13", + "resolved": "https://registry.npmmirror.com/vue/-/vue-3.5.13.tgz", + "integrity": "sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==", + "peer": true, + "dependencies": { + "@vue/compiler-dom": "3.5.13", + "@vue/compiler-sfc": "3.5.13", + "@vue/runtime-dom": "3.5.13", + "@vue/server-renderer": "3.5.13", + "@vue/shared": "3.5.13" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vuex": { + "version": "4.0.2", + "resolved": "https://registry.npmmirror.com/vuex/-/vuex-4.0.2.tgz", + "integrity": "sha512-M6r8uxELjZIK8kTKDGgZTYX/ahzblnzC4isU1tpmEuOIIKmV+TRdc+H4s8ds2NuZ7wpUTdGRzJRtoj+lI+pc0Q==", + "dependencies": { + "@vue/devtools-api": "^6.0.0-beta.11" + }, + "peerDependencies": { + "vue": "^3.0.2" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..c41b206 --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "takeoutshop", + "version": "1.0.0", + "main": "main.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "description": "", + "dependencies": { + "js-md5": "^0.7.3", + "jweixin-module": "^1.4.1", + "mini-html-parser2": "^0.3.0", + "number-precision": "^1.3.2", + "pinia": "^3.0.1", + "qs": "^5.2.1", + "vuex": "^4.0.2" + } +} diff --git a/pages.json b/pages.json new file mode 100644 index 0000000..d9bf482 --- /dev/null +++ b/pages.json @@ -0,0 +1,87 @@ +{ + "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages + { + "path": "pages/index/index", + "style": { + "navigationBarTitleText": "首页", + "enablePullDownRefresh": true, + "navigationStyle": "custom" + } + }, + { + "path": "pages/classify/classify", + "style": { + "navigationBarTitleText": "分类", + "navigationBarBackgroundColor": "#f2f5f7", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/sidedish/sidedish", + "style": { + "navigationBarTitleText": "帮你配", + "navigationBarBackgroundColor": "#f2f5f7", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/cart/cart", + "style": { + "navigationBarTitleText": "购物车", + "navigationBarBackgroundColor": "#f2f5f7", + "enablePullDownRefresh": true + } + }, + { + "path": "pages/user/user", + "style": { + "navigationBarTitleText": "我的", + "navigationBarBackgroundColor": "#f2f5f7" + } + } + ], + "tabBar": { + "color": "#000000", + "selectedColor": "#E60703", + "backgroundColor": "#ffffff", + "borderStyle": "white", + "list": [ + { + "pagePath": "pages/index/index", + "text": "首页", + "iconPath": "static/tabBar/Home.png", + "selectedIconPath": "static/tabBar/Home_active.png" + }, + { + "pagePath": "pages/classify/classify", + "text": "分类", + "iconPath": "static/tabBar/class.png", + "selectedIconPath": "static/tabBar/class_active.png" + }, + { + "pagePath": "pages/sidedish/sidedish", + "text": "帮你配", + "iconPath": "static/tabBar/sidedish.png", + "selectedIconPath": "static/tabBar/sidedish_active.png" + }, + { + "pagePath": "pages/cart/cart", + "text": "购物车", + "iconPath": "static/tabBar/cart.png", + "selectedIconPath": "static/tabBar/cart_active.png" + }, + { + "pagePath": "pages/user/user", + "text": "我的", + "iconPath": "static/tabBar/user.png", + "selectedIconPath": "static/tabBar/user_active.png" + } + ] + }, + "globalStyle": { + "navigationBarTextStyle": "black", + "navigationBarTitleText": "外卖点餐", + "navigationBarBackgroundColor": "#F8F8F8", + "backgroundColor": "#F8F8F8" + } +} diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue new file mode 100644 index 0000000..3832237 --- /dev/null +++ b/pages/cart/cart.vue @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file diff --git a/pages/cart/style.scss b/pages/cart/style.scss new file mode 100644 index 0000000..e69de29 diff --git a/pages/classify/classify.vue b/pages/classify/classify.vue new file mode 100644 index 0000000..06a29c0 --- /dev/null +++ b/pages/classify/classify.vue @@ -0,0 +1,33 @@ + + + + + \ No newline at end of file diff --git a/pages/classify/style.scss b/pages/classify/style.scss new file mode 100644 index 0000000..e69de29 diff --git a/pages/index/index.vue b/pages/index/index.vue new file mode 100644 index 0000000..2f2d3a4 --- /dev/null +++ b/pages/index/index.vue @@ -0,0 +1,220 @@ + + + + + \ No newline at end of file diff --git a/pages/index/style.scss b/pages/index/style.scss new file mode 100644 index 0000000..14028ac --- /dev/null +++ b/pages/index/style.scss @@ -0,0 +1,270 @@ +page{ + background-color: #F6F6F6; +} +.main{ + .head{ + position: fixed; + z-index: 100; + width: 100%; + top: 0; + left: 0; + background: linear-gradient(405deg, #F4CECD 0%, #F6F1DC 100%); + padding-bottom: 10px; + .head_location{ + display: flex; + align-items: center; + height: 45px; + .location_img{ + width: 18px; + height: 18px; + margin: 3px 5px 0 10px; + } + .location_title{ + font-size: 28rpx; + color: #000000; + font-weight: 500; + } + .location_arrow_down{ + width: 0; + height: 0; + border-left: 11rpx solid transparent; + border-right: 11rpx solid transparent; + border-top: 13rpx solid #000000; + margin-left: 5px; + margin-top: 3px; + } + } + .head_search{ + margin:0rpx 10px 0rpx 10px;; + display: flex; + align-items: center; + background-color: #FFFFFF; + height: 40px; + border-radius: 50rpx; + font-size: 28rpx; + color: #000000; + justify-content: space-between; + .head_search_img{ + width: 20px; + height: 20px; + margin-left: 13px; + } + .head_search_input{ + width: 500rpx; + height: 100%; + margin-left: 10px; + font-size: 26rpx; + } + .head_search_border{ + height: 15px; + width: 1px; + background-color: #D9D9D9; + } + .head_search_btn{ + width: 120rpx; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + } + } + } + + .grid_wrap{ + padding: 20rpx 20rpx 20rpx 20rpx; + display: flex; + justify-content: space-between; + background: linear-gradient(124deg, #F4CECD 0%, #F6F6F6 50%); + // background: linear-gradient(405deg, #F4CECD 0%, #F6F1DC 100%); + .grid_wrap_l{ + width: 338rpx; + height: 338rpx; + background-color: #000000; + border-radius: 20rpx; + overflow: hidden; + position: relative; + .grid_wrap_live{ + width: 338rpx; + height: 338rpx; + position: absolute; + top: 0; + z-index: 1; + } + .grid_wrap_live_title{ + font-size: 30rpx; + color: #FFFFFF; + display: flex; + z-index: 2; + top: 20rpx; + left: 20rpx; + font-weight: 500; + position: absolute; + display: flex; + align-items: center; + .grid_wrap_live_img{ + width: 28rpx; + height: 28rpx; + margin-right: 10rpx; + } + } + } + .grid_wrap_r{ + width: 355rpx; + .grid_wrap_li{ + padding: 20rpx; + width: 315rpx; + height: 123rpx; + background: #FFFFFF; + border-radius: 17rpx 17rpx 17rpx 17rpx; + display: flex; + justify-content: space-between; + align-items: center; + box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.05); + .grid_wrap_li_l{ + .grid_wrap_li_title{ + font-size: 30rpx; + color: #333333; + font-weight: 500; + display: flex; + align-items: center; + .grid_wrap_li_arrow{ + width: 24rpx; + height: 24rpx; + margin-left: 10rpx; + } + } + .grid_wrap_li_desc{ + color: #999999; + font-size: 24rpx; + } + } + .grid_wrap_li_r{ + width: 140rpx; + height: 140rpx; + } + } + .grid_wrap_top{ + margin-top: 20rpx; + } + } + } + .scroll_view{ + width: 100%; + display: flex; + overflow: hidden; + white-space: nowrap; + .typescoll{ + .scroll_view_li{ + width: 620rpx; + background-color: #FFFFFF; + border-radius: 20rpx; + overflow: hidden; + padding-bottom: 30rpx; + display: inline-block; + margin-left: 20rpx; + box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(0, 0, 0, 0.05); + .scroll_view_banner{ + width: 100%; + height: 340rpx; + .scroll_view_bannerimg{ + width: 100%; + height: 340rpx; + } + } + .scroll_view_shop{ + padding: 30rpx 30rpx 0rpx 30rpx; + display: flex; + align-items: center; + justify-content: space-between; + .scroll_view_shop_l{ + width:150rpx; + height:150rpx; + position: relative; + .scroll_view_shop_no{ + width: 32rpx; + height: 45rpx; + position: absolute; + z-index: 2; + top: 0; + left: 0; + } + .scroll_view_shop_img{ + width:150rpx; + height:150rpx; + position: absolute; + z-index: 1; + top: 0; + } + } + .scroll_view_shop_r{ + width: 385rpx; + .scroll_view_shop_title{ + font-size: 28rpx; + color: #000000; + font-weight: 500; + .scroll_view_shop_desc{ + color: #666666; + font-size: 22rpx; + font-weight: 400; + } + } + .scroll_view_shop_tag{ + display: flex; + .scroll_view_shop_li{ + border-radius: 6rpx 6rpx 6rpx 6rpx; + border: 1rpx solid #FF6868; + padding: 0rpx 10rpx 0rpx 10rpx; + border-radius: 10rpx; + color: #FF6868; + font-size: 18rpx; + margin-top: 10rpx; + margin-right: 10rpx; + + } + } + .scroll_view_shop_bottom{ + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 12rpx; + .scroll_view_shop_price{ + font-size: 34rpx; + color: #FF0000; + font-weight: 500; + .market_name{ + color: #999999; + font-size: 24rpx; + text-decoration: line-through; + margin-left: 5rpx; + font-weight: 400; + } + } + .scroll_view_shop_cart{ + width: 65rpx; + height: 65rpx; + display: flex; + align-items: center; + justify-content: center; + .scroll_view_shop_cart_img{ + width: 50rpx; + height: 50rpx; + } + } + } + } + } + } + } + } +} +.price::before { + content: '¥'; + font-size: 24rpx; + margin-right: 5rpx; +} +.prices::before { + content: '¥'; + font-size: 20rpx; + margin-right: 5rpx; + margin-left: 5rpx; +} \ No newline at end of file diff --git a/pages/sidedish/sidedish.vue b/pages/sidedish/sidedish.vue new file mode 100644 index 0000000..86d7c9e --- /dev/null +++ b/pages/sidedish/sidedish.vue @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/pages/sidedish/style.scss b/pages/sidedish/style.scss new file mode 100644 index 0000000..e69de29 diff --git a/pages/user/style.scss b/pages/user/style.scss new file mode 100644 index 0000000..e69de29 diff --git a/pages/user/user.vue b/pages/user/user.vue new file mode 100644 index 0000000..07d1043 --- /dev/null +++ b/pages/user/user.vue @@ -0,0 +1,32 @@ + + + + + \ No newline at end of file diff --git a/server/api.service.js b/server/api.service.js new file mode 100644 index 0000000..fce18bb --- /dev/null +++ b/server/api.service.js @@ -0,0 +1,38 @@ +import { url } from './config' +import {signGen} from "@/utils" + +function _request(options, showErrorModal = true) { + return new Promise((resolve, reject)=> { + uni.request(options).then(({data}) => { + if(data.status === "OK"){ + resolve(data) + }else{ + reject(data); + } + }).catch((err) => { + reject(err); + }) + }) +} + +export const apiService = { + query(path, query, sign = false) { + return _request({ + url: url + path, + data: sign ? signGen(query) : query + }) + }, + get(path, query, sign = true) { + return _request({ + url: url + path, + data: sign ? signGen(query) : query + }) + }, + post(path, params, sign = true, showErrorModal = true) { + return _request({ + url: url + path, + data: sign ? signGen(params) : params, + method: 'POST' + }, showErrorModal) + } +} \ No newline at end of file diff --git a/server/config.js b/server/config.js new file mode 100644 index 0000000..3e56091 --- /dev/null +++ b/server/config.js @@ -0,0 +1,21 @@ +// 环境接口域名变量 +let url = ''; +// 手动切换环境 +const type = 'prod' +/** + * 环境配置地址 + * dev开发 + * test测试 + * prod生产 + */ +if(type === 'dev'){ + url = "https://japitest.3721zh.com/webapp"; +} +if(type === 'test'){ + url = "https://japiuat.3721zh.com/webapp"; +} +if(type === 'prod'){ + url = "https://newapi.3721zh.com/webapp" +} +export{url} + diff --git a/static/index/AI.png b/static/index/AI.png new file mode 100644 index 0000000..847e960 Binary files /dev/null and b/static/index/AI.png differ diff --git a/static/index/arrow.png b/static/index/arrow.png new file mode 100644 index 0000000..8e6f627 Binary files /dev/null and b/static/index/arrow.png differ diff --git a/static/index/cart_img.png b/static/index/cart_img.png new file mode 100644 index 0000000..daaab7b Binary files /dev/null and b/static/index/cart_img.png differ diff --git a/static/index/img.png b/static/index/img.png new file mode 100644 index 0000000..f1046e6 Binary files /dev/null and b/static/index/img.png differ diff --git a/static/index/location.png b/static/index/location.png new file mode 100644 index 0000000..b228820 Binary files /dev/null and b/static/index/location.png differ diff --git a/static/index/location_active.png b/static/index/location_active.png new file mode 100644 index 0000000..b9ee08a Binary files /dev/null and b/static/index/location_active.png differ diff --git a/static/index/no1.png b/static/index/no1.png new file mode 100644 index 0000000..6c66126 Binary files /dev/null and b/static/index/no1.png differ diff --git a/static/index/no2.png b/static/index/no2.png new file mode 100644 index 0000000..3690e59 Binary files /dev/null and b/static/index/no2.png differ diff --git a/static/index/no3.png b/static/index/no3.png new file mode 100644 index 0000000..1dc542a Binary files /dev/null and b/static/index/no3.png differ diff --git a/static/index/refund_img.png b/static/index/refund_img.png new file mode 100644 index 0000000..80a880e Binary files /dev/null and b/static/index/refund_img.png differ diff --git a/static/index/scroll_img.png b/static/index/scroll_img.png new file mode 100644 index 0000000..f99d488 Binary files /dev/null and b/static/index/scroll_img.png differ diff --git a/static/index/shopimg.png b/static/index/shopimg.png new file mode 100644 index 0000000..3beb97b Binary files /dev/null and b/static/index/shopimg.png differ diff --git a/static/index/v.png b/static/index/v.png new file mode 100644 index 0000000..d52ec84 Binary files /dev/null and b/static/index/v.png differ diff --git a/static/index/直播炒菜@2x.png b/static/index/直播炒菜@2x.png new file mode 100644 index 0000000..c57235e Binary files /dev/null and b/static/index/直播炒菜@2x.png differ diff --git a/static/oncatr01.png b/static/oncatr01.png new file mode 100644 index 0000000..cf57759 Binary files /dev/null and b/static/oncatr01.png differ diff --git a/static/oncatr02.png b/static/oncatr02.png new file mode 100644 index 0000000..dbdc31a Binary files /dev/null and b/static/oncatr02.png differ diff --git a/static/search_img.png b/static/search_img.png new file mode 100644 index 0000000..7fc77e4 Binary files /dev/null and b/static/search_img.png differ diff --git a/static/tabBar/Home.png b/static/tabBar/Home.png new file mode 100644 index 0000000..f798ea2 Binary files /dev/null and b/static/tabBar/Home.png differ diff --git a/static/tabBar/Home_active.png b/static/tabBar/Home_active.png new file mode 100644 index 0000000..0b39a02 Binary files /dev/null and b/static/tabBar/Home_active.png differ diff --git a/static/tabBar/cart.png b/static/tabBar/cart.png new file mode 100644 index 0000000..1dc9316 Binary files /dev/null and b/static/tabBar/cart.png differ diff --git a/static/tabBar/cart_active.png b/static/tabBar/cart_active.png new file mode 100644 index 0000000..194cddb Binary files /dev/null and b/static/tabBar/cart_active.png differ diff --git a/static/tabBar/class.png b/static/tabBar/class.png new file mode 100644 index 0000000..060a44e Binary files /dev/null and b/static/tabBar/class.png differ diff --git a/static/tabBar/class_active.png b/static/tabBar/class_active.png new file mode 100644 index 0000000..778cf32 Binary files /dev/null and b/static/tabBar/class_active.png differ diff --git a/static/tabBar/sidedish.png b/static/tabBar/sidedish.png new file mode 100644 index 0000000..699cdd9 Binary files /dev/null and b/static/tabBar/sidedish.png differ diff --git a/static/tabBar/sidedish_active.png b/static/tabBar/sidedish_active.png new file mode 100644 index 0000000..3ceee8d Binary files /dev/null and b/static/tabBar/sidedish_active.png differ diff --git a/static/tabBar/user.png b/static/tabBar/user.png new file mode 100644 index 0000000..0355dbc Binary files /dev/null and b/static/tabBar/user.png differ diff --git a/static/tabBar/user_active.png b/static/tabBar/user_active.png new file mode 100644 index 0000000..fe9ad65 Binary files /dev/null and b/static/tabBar/user_active.png differ diff --git a/static/tag_img.png b/static/tag_img.png new file mode 100644 index 0000000..20cb609 Binary files /dev/null and b/static/tag_img.png differ diff --git a/store/counter.js b/store/counter.js new file mode 100644 index 0000000..7599c55 --- /dev/null +++ b/store/counter.js @@ -0,0 +1,23 @@ +import { defineStore } from 'pinia'; +import { computed,ref } from 'vue'; +import { apiService } from "@/server/api.service"; +export const useCounterStore = defineStore('counter',()=>{ + //定义数据(state) + const count = ref(0); + const openId = ref(''); + const cellPhone = ref(''); + const isLogin = ref(''); + + //定义数据修改的方法(action) + const clickSType = (params)=>{ + return apiService.post('/product/getPictureShareUrl',params) + } + //定义getters + // const doubleCount = computed(()=>count.value * 2) + + //以对象的形式return供组件调用 + return{ + count, + clickSType + } +}) \ No newline at end of file diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..04a6e03 --- /dev/null +++ b/store/index.js @@ -0,0 +1,44 @@ +import { createStore } from 'vuex'; +import { apiService } from "@/server/api.service" +// 创建 Vuex Store +const store = createStore({ + state: { + count: 0, // 示例状态 + userInfo: null // 用户信息 + }, + mutations: { + // 修改状态的方法 + increment(state) { + state.count++; + }, + setUserInfo(state, userInfo) { + state.userInfo = userInfo; + } + }, + actions: { + // 异步操作 + incrementAsync({ commit }) { + setTimeout(() => { + commit('increment'); + }, 1000); + }, + fetchUserInfo({ commit }, userId) { + // 模拟异步请求 + return new Promise((resolve) => { + setTimeout(() => { + const userInfo = { id: userId, name: 'John Doe' }; + commit('setUserInfo', userInfo); + resolve(userInfo); + }, 1000); + }); + } + }, + getters: { + // 计算属性 + doubleCount(state) { + return state.count * 2; + } + } +}); + +export default store; \ No newline at end of file diff --git a/uni.scss b/uni.scss new file mode 100644 index 0000000..a05adb4 --- /dev/null +++ b/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:#ffffff; +$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: #555555; // 二级标题颜色 +$uni-font-size-subtitle:26px; +$uni-color-paragraph: #3F536E; // 文章段落颜色 +$uni-font-size-paragraph:15px; diff --git a/utils/index.js b/utils/index.js new file mode 100644 index 0000000..7a51fc9 --- /dev/null +++ b/utils/index.js @@ -0,0 +1,33 @@ +import md5 from 'js-md5' +import qs from 'qs' +const appKey = "3721zhkj" +// 生成签名 +function alphabeticalSort(a, b) { + return a.toUpperCase().localeCompare(b.toUpperCase()); +} +function filterFunc(prefix, value) { + if (prefix === "dishOtherOrderItems" || prefix === "template"|| prefix==='productItems') { + const rel = value.map(item => + `{${ + qs.stringify(item, { + sort: alphabeticalSort, + delimiter: ",", + encode: false + }) + }}` + ); + return `[${rel.join(",")}]` + } + return value; +} +export const signGen = function(data) { + const str = qs.stringify(data, { + sort: alphabeticalSort, + encode: false, + filter: filterFunc + }) + '&key=' + appKey + let sign = md5(str).toUpperCase(); + return Object.assign({ + sign + }, data) +} \ No newline at end of file