首次搭建提交
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
unpackage/
|
16
.hbuilderx/launch.json
Normal file
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
5
.idea/.gitignore
generated
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
12
.idea/TakeOutShop.iml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
14
.idea/UniappTool.xml
generated
Normal file
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="cn.fjdmy.uniapp.UniappProjectDataService">
|
||||
<option name="basePath" value="$PROJECT_DIR$" />
|
||||
<option name="generalBasePath" value="$PROJECT_DIR$" />
|
||||
<option name="manifestPath" value="$PROJECT_DIR$/manifest.json" />
|
||||
<option name="pagesPath" value="$PROJECT_DIR$/pages.json" />
|
||||
<option name="scanNum" value="1" />
|
||||
<option name="type" value="store" />
|
||||
<option name="uniapp" value="true" />
|
||||
<option name="uniappHx" value="true" />
|
||||
<option name="vueVersion" value="3" />
|
||||
</component>
|
||||
</project>
|
6
.idea/git_toolbox_blame.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxBlameSettings">
|
||||
<option name="version" value="2" />
|
||||
</component>
|
||||
</project>
|
15
.idea/git_toolbox_prj.xml
generated
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GitToolBoxProjectSettings">
|
||||
<option name="commitMessageIssueKeyValidationOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
<option name="commitMessageValidationEnabledOverride">
|
||||
<BoolValueOverride>
|
||||
<option name="enabled" value="true" />
|
||||
</BoolValueOverride>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
6
.idea/jsLibraryMappings.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="JavaScriptLibraryMappings">
|
||||
<excludedPredefinedLibrary name="uni-api" />
|
||||
</component>
|
||||
</project>
|
12
.idea/material_theme_project_new.xml
generated
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="migrated" value="true" />
|
||||
<option name="pristineConfig" value="false" />
|
||||
<option name="userId" value="415afea9:18e7e68a059:-7ff6" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/TakeOutShop.iml" filepath="$PROJECT_DIR$/.idea/TakeOutShop.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
36
App.vue
Normal file
@ -0,0 +1,36 @@
|
||||
<script>
|
||||
export default {
|
||||
onLaunch: function() {
|
||||
console.log('App Launch')
|
||||
},
|
||||
onShow: function() {
|
||||
// 获得小程序最新版本
|
||||
let updateManager = wx.getUpdateManager();
|
||||
if (updateManager) {
|
||||
updateManager.onCheckForUpdate(function(res) {
|
||||
// 请求完新版本信息的回调
|
||||
console.log(res.hasUpdate);
|
||||
});
|
||||
updateManager.onUpdateReady(function() {
|
||||
uni.showModal({
|
||||
title: '更新提示',
|
||||
content: '新版本已经准备好,是否重启应用?',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
||||
updateManager.applyUpdate();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
onHide: function() {
|
||||
console.log('App Hide')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/*每个页面公共css */
|
||||
</style>
|
20
index.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<script>
|
||||
var coverSupport = 'CSS' in window && typeof CSS.supports === 'function' && (CSS.supports('top: env(a)') ||
|
||||
CSS.supports('top: constant(a)'))
|
||||
document.write(
|
||||
'<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' +
|
||||
(coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
</script>
|
||||
<title></title>
|
||||
<!--preload-links-->
|
||||
<!--app-context-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"><!--app-html--></div>
|
||||
<script type="module" src="/main.js"></script>
|
||||
</body>
|
||||
</html>
|
14
main.js
Normal file
@ -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实例的引用,这对于小程序很重要。
|
||||
}
|
80
manifest.json
Normal file
@ -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" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
|
||||
]
|
||||
},
|
||||
/* 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"
|
||||
}
|
484
package-lock.json
generated
Normal file
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
20
package.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
87
pages.json
Normal file
@ -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"
|
||||
}
|
||||
}
|
33
pages/cart/cart.vue
Normal file
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 购物车页面 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed,ref } from 'vue';
|
||||
import { useCounterStore } from '@/store/counter'; // 引入 Pinia Store
|
||||
import { storeToRefs } from 'pinia';//实现解构付值
|
||||
import { onLoad,onShow,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
const counterStore = useCounterStore(); // 使用 Store
|
||||
//使用pinia:storeToRefs方法包裹(保持响应式更新,不使用视图无法更新)
|
||||
// const { count,doubleCount } = storeToRefs(counterStore);
|
||||
|
||||
// 使用 uni.onLoad 监听页面加载
|
||||
onLoad((options) => {
|
||||
|
||||
});
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
onPullDownRefresh(()=>{
|
||||
|
||||
})
|
||||
onReachBottom(()=>{
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './style.scss';
|
||||
</style>
|
0
pages/cart/style.scss
Normal file
33
pages/classify/classify.vue
Normal file
@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 分类页面 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed,ref } from 'vue';
|
||||
import { useCounterStore } from '@/store/counter'; // 引入 Pinia Store
|
||||
import { storeToRefs } from 'pinia';//实现解构付值
|
||||
import { onLoad,onShow,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
const counterStore = useCounterStore(); // 使用 Store
|
||||
//使用pinia:storeToRefs方法包裹(保持响应式更新,不使用视图无法更新)
|
||||
// const { count,doubleCount } = storeToRefs(counterStore);
|
||||
|
||||
// 使用 uni.onLoad 监听页面加载
|
||||
onLoad((options) => {
|
||||
|
||||
});
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
onPullDownRefresh(()=>{
|
||||
|
||||
})
|
||||
onReachBottom(()=>{
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './style.scss';
|
||||
</style>
|
0
pages/classify/style.scss
Normal file
220
pages/index/index.vue
Normal file
@ -0,0 +1,220 @@
|
||||
<template>
|
||||
<view class="main">
|
||||
<view class="head" :style="{'padding-top':headerHeight+'px'}">
|
||||
<view class="head_location">
|
||||
<image class="location_img" src="../../static/index/location_active.png" mode="widthFix"></image>
|
||||
<view class="location_title">常州体育中心</view>
|
||||
<view class="location_arrow_down"></view>
|
||||
</view>
|
||||
<view class="head_search">
|
||||
<image class="head_search_img" src="../../static/search_img.png" mode="widthFix"></image>
|
||||
<input class="head_search_input" type="text" placeholder="请输入搜索内容" v-model="searchtext"/>
|
||||
<view class="head_search_border"></view>
|
||||
<view class="head_search_btn">搜索</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 推荐区域 -->
|
||||
<view class="grid_wrap" :style="{'padding-top':105+headerHeight+'px'}">
|
||||
<view class="grid_wrap_l">
|
||||
<image class="grid_wrap_live" src="../../static/index/直播炒菜@2x.png"></image>
|
||||
<view class="grid_wrap_live_title"><image class="grid_wrap_live_img" src="../../static/index/v.png"></image>直播</view>
|
||||
</view>
|
||||
<view class="grid_wrap_r">
|
||||
<view class="grid_wrap_li">
|
||||
<view class="grid_wrap_li_l">
|
||||
<view class="grid_wrap_li_title">AI学做菜<image class="grid_wrap_li_arrow" src="../../static/index/arrow.png" mode="widthFix"></image></view>
|
||||
<view class="grid_wrap_li_desc">好看又好吃</view>
|
||||
</view>
|
||||
<image class="grid_wrap_li_r" src="../../static/index/AI.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="grid_wrap_li grid_wrap_top">
|
||||
<view class="grid_wrap_li_l">
|
||||
<view class="grid_wrap_li_title">极速退款<image class="grid_wrap_li_arrow" src="../../static/index/arrow.png" mode="widthFix"></image></view>
|
||||
<view class="grid_wrap_li_desc">食材有问题?</view>
|
||||
</view>
|
||||
<image class="grid_wrap_li_r" src="../../static/index/refund_img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 滚动区域 -->
|
||||
<view class="scroll_view">
|
||||
<scroll-view class="typescoll" :scroll-with-animation="true" :enhanced="true" :show-scrollbar="false" scroll-x="true">
|
||||
<view class="scroll_view_li">
|
||||
<view class="scroll_view_banner">
|
||||
<image class="scroll_view_bannerimg" src="../../static/index/scroll_img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop">
|
||||
<view class="scroll_view_shop_l">
|
||||
<image class="scroll_view_shop_no" src="../../static/index/no1.png"></image>
|
||||
<image class="scroll_view_shop_img" src="../../static/index/img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop_r">
|
||||
<view class="scroll_view_shop_title">单人餐1<text class="scroll_view_shop_desc">(大盘鸡+番茄炒鸡蛋+米饭)</text></view>
|
||||
<view class="scroll_view_shop_tag">
|
||||
<view class="scroll_view_shop_li">半小时送达</view>
|
||||
<view class="scroll_view_shop_li">劲辣胃浓</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop_bottom">
|
||||
<view class="scroll_view_shop_price price">43.9<text class="market_name prices">59.9</text></view>
|
||||
<view class="scroll_view_shop_cart">
|
||||
<image class="scroll_view_shop_cart_img" src="../../static/oncatr01.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop">
|
||||
<view class="scroll_view_shop_l">
|
||||
<image class="scroll_view_shop_no" src="../../static/index/no2.png"></image>
|
||||
<image class="scroll_view_shop_img" src="../../static/index/img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop_r">
|
||||
<view class="scroll_view_shop_title">单人餐1<text class="scroll_view_shop_desc">(大盘鸡+番茄炒鸡蛋+米饭)</text></view>
|
||||
<view class="scroll_view_shop_tag">
|
||||
<view class="scroll_view_shop_li">半小时送达</view>
|
||||
<view class="scroll_view_shop_li">劲辣胃浓</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop_bottom">
|
||||
<view class="scroll_view_shop_price price">43.9<text class="market_name prices">59.9</text></view>
|
||||
<view class="scroll_view_shop_cart">
|
||||
<image class="scroll_view_shop_cart_img" src="../../static/oncatr01.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop">
|
||||
<view class="scroll_view_shop_l">
|
||||
<image class="scroll_view_shop_no" src="../../static/index/no3.png"></image>
|
||||
<image class="scroll_view_shop_img" src="../../static/index/img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop_r">
|
||||
<view class="scroll_view_shop_title">单人餐1<text class="scroll_view_shop_desc">(大盘鸡+番茄炒鸡蛋+米饭)</text></view>
|
||||
<view class="scroll_view_shop_tag">
|
||||
<view class="scroll_view_shop_li">半小时送达</view>
|
||||
<view class="scroll_view_shop_li">劲辣胃浓</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop_bottom">
|
||||
<view class="scroll_view_shop_price price">43.9<text class="market_name prices">59.9</text></view>
|
||||
<view class="scroll_view_shop_cart">
|
||||
<image class="scroll_view_shop_cart_img" src="../../static/oncatr01.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll_view_li">
|
||||
<view class="scroll_view_banner">
|
||||
<image class="scroll_view_bannerimg" src="../../static/index/scroll_img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop">
|
||||
<view class="scroll_view_shop_l">
|
||||
<image class="scroll_view_shop_no" src="../../static/index/no1.png"></image>
|
||||
<image class="scroll_view_shop_img" src="../../static/index/img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop_r">
|
||||
<view class="scroll_view_shop_title">单人餐1<text class="scroll_view_shop_desc">(大盘鸡+番茄炒鸡蛋+米饭)</text></view>
|
||||
<view class="scroll_view_shop_tag">
|
||||
<view class="scroll_view_shop_li">半小时送达</view>
|
||||
<view class="scroll_view_shop_li">劲辣胃浓</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop_bottom">
|
||||
<view class="scroll_view_shop_price price">43.9<text class="market_name prices">59.9</text></view>
|
||||
<view class="scroll_view_shop_cart">
|
||||
<image class="scroll_view_shop_cart_img" src="../../static/oncatr01.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop">
|
||||
<view class="scroll_view_shop_l">
|
||||
<image class="scroll_view_shop_no" src="../../static/index/no2.png"></image>
|
||||
<image class="scroll_view_shop_img" src="../../static/index/img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop_r">
|
||||
<view class="scroll_view_shop_title">单人餐1<text class="scroll_view_shop_desc">(大盘鸡+番茄炒鸡蛋+米饭)</text></view>
|
||||
<view class="scroll_view_shop_tag">
|
||||
<view class="scroll_view_shop_li">半小时送达</view>
|
||||
<view class="scroll_view_shop_li">劲辣胃浓</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop_bottom">
|
||||
<view class="scroll_view_shop_price price">43.9<text class="market_name prices">59.9</text></view>
|
||||
<view class="scroll_view_shop_cart">
|
||||
<image class="scroll_view_shop_cart_img" src="../../static/oncatr01.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop">
|
||||
<view class="scroll_view_shop_l">
|
||||
<image class="scroll_view_shop_no" src="../../static/index/no3.png"></image>
|
||||
<image class="scroll_view_shop_img" src="../../static/index/img.png" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="scroll_view_shop_r">
|
||||
<view class="scroll_view_shop_title">单人餐1<text class="scroll_view_shop_desc">(大盘鸡+番茄炒鸡蛋+米饭)</text></view>
|
||||
<view class="scroll_view_shop_tag">
|
||||
<view class="scroll_view_shop_li">半小时送达</view>
|
||||
<view class="scroll_view_shop_li">劲辣胃浓</view>
|
||||
</view>
|
||||
<view class="scroll_view_shop_bottom">
|
||||
<view class="scroll_view_shop_price price">43.9<text class="market_name prices">59.9</text></view>
|
||||
<view class="scroll_view_shop_cart">
|
||||
<image class="scroll_view_shop_cart_img" src="../../static/oncatr01.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed,ref } from 'vue';
|
||||
import { useCounterStore } from '@/store/counter'; // 引入 Pinia Store
|
||||
import { storeToRefs } from 'pinia';//实现解构付值
|
||||
import { onLoad,onShow,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
const counterStore = useCounterStore(); // 使用 Store
|
||||
//使用pinia:storeToRefs方法包裹(保持响应式更新,不使用视图无法更新)
|
||||
// const { count,doubleCount } = storeToRefs(counterStore);
|
||||
//使用pinia:方法还是从原来的counterStore中解构赋值
|
||||
const { clickSType } = counterStore;
|
||||
const statusHeight = ref(uni.getMenuButtonBoundingClientRect()['height'])
|
||||
const headerHeight = ref(uni.getSystemInfoSync()['statusBarHeight'])
|
||||
|
||||
const classify = ()=>{
|
||||
let params ={
|
||||
productImgUrl: "http://zhkjmall.oss-cn-shanghai.aliyuncs.com/mall-20240611-c7e219dab5864847bee8c3f0cffbb658.jpg"
|
||||
}
|
||||
//链式调用
|
||||
return clickSType(params).then(({message}) => {
|
||||
console.log('message',message);
|
||||
|
||||
}).catch((err) => {
|
||||
const {code,message } = err;
|
||||
uni.showModal({
|
||||
content:message,
|
||||
showCancel: false
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
onLoad((options) => {
|
||||
|
||||
});
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
onPullDownRefresh(()=>{
|
||||
|
||||
})
|
||||
onReachBottom(()=>{
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './style.scss';
|
||||
</style>
|
270
pages/index/style.scss
Normal file
@ -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;
|
||||
}
|
32
pages/sidedish/sidedish.vue
Normal file
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 帮你配页面 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed,ref } from 'vue';
|
||||
import { useCounterStore } from '@/store/counter'; // 引入 Pinia Store
|
||||
import { storeToRefs } from 'pinia';//实现解构付值
|
||||
import { onLoad,onShow,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
const counterStore = useCounterStore(); // 使用 Store
|
||||
//使用pinia:storeToRefs方法包裹(保持响应式更新,不使用视图无法更新)
|
||||
// const { count,doubleCount } = storeToRefs(counterStore);
|
||||
|
||||
onLoad((options) => {
|
||||
|
||||
});
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
onPullDownRefresh(()=>{
|
||||
|
||||
})
|
||||
onReachBottom(()=>{
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './style.scss';
|
||||
</style>
|
0
pages/sidedish/style.scss
Normal file
0
pages/user/style.scss
Normal file
32
pages/user/user.vue
Normal file
@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<view>
|
||||
个人中心页面
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed,ref } from 'vue';
|
||||
import { useCounterStore } from '@/store/counter'; // 引入 Pinia Store
|
||||
import { storeToRefs } from 'pinia';//实现解构付值
|
||||
import { onLoad,onShow,onPullDownRefresh,onReachBottom } from "@dcloudio/uni-app"
|
||||
const counterStore = useCounterStore(); // 使用 Store
|
||||
//使用pinia:storeToRefs方法包裹(保持响应式更新,不使用视图无法更新)
|
||||
//const { count,doubleCount } = storeToRefs(counterStore);
|
||||
|
||||
onLoad((options) => {
|
||||
|
||||
});
|
||||
onShow(() => {
|
||||
|
||||
});
|
||||
onPullDownRefresh(()=>{
|
||||
|
||||
})
|
||||
onReachBottom(()=>{
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './style.scss';
|
||||
</style>
|
38
server/api.service.js
Normal file
@ -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)
|
||||
}
|
||||
}
|
21
server/config.js
Normal file
@ -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}
|
||||
|
BIN
static/index/AI.png
Normal file
After Width: | Height: | Size: 67 KiB |
BIN
static/index/arrow.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
static/index/cart_img.png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
static/index/img.png
Normal file
After Width: | Height: | Size: 218 KiB |
BIN
static/index/location.png
Normal file
After Width: | Height: | Size: 996 B |
BIN
static/index/location_active.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
static/index/no1.png
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
static/index/no2.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
static/index/no3.png
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
static/index/refund_img.png
Normal file
After Width: | Height: | Size: 50 KiB |
BIN
static/index/scroll_img.png
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
static/index/shopimg.png
Normal file
After Width: | Height: | Size: 398 KiB |
BIN
static/index/v.png
Normal file
After Width: | Height: | Size: 474 B |
BIN
static/index/直播炒菜@2x.png
Normal file
After Width: | Height: | Size: 857 KiB |
BIN
static/oncatr01.png
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
static/oncatr02.png
Normal file
After Width: | Height: | Size: 1015 B |
BIN
static/search_img.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
static/tabBar/Home.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
static/tabBar/Home_active.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
static/tabBar/cart.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
BIN
static/tabBar/cart_active.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
static/tabBar/class.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
BIN
static/tabBar/class_active.png
Normal file
After Width: | Height: | Size: 4.1 KiB |
BIN
static/tabBar/sidedish.png
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
static/tabBar/sidedish_active.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
static/tabBar/user.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
static/tabBar/user_active.png
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
static/tag_img.png
Normal file
After Width: | Height: | Size: 7.6 KiB |
23
store/counter.js
Normal file
@ -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
|
||||
}
|
||||
})
|
44
store/index.js
Normal file
@ -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;
|
76
uni.scss
Normal file
@ -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;
|
33
utils/index.js
Normal file
@ -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)
|
||||
}
|