瀏覽代碼

新增列表

lyy@qq.com 1 年之前
父節點
當前提交
db1579f6c1
共有 5 個文件被更改,包括 373 次插入27 次删除
  1. 47 0
      main.js
  2. 250 1
      package-lock.json
  3. 37 6
      pages.json
  4. 38 19
      pages/classify/classify.vue
  5. 1 1
      utils/request.js

+ 47 - 0
main.js

@@ -10,6 +10,8 @@ Vue.prototype.$request = request;
 import uView from "uview-ui";
 Vue.use(uView);
 
+import './css/style.css'
+
 import mySwiper from './components/my-swiper/my-swiper.vue';
 Vue.component('my-swiper', mySwiper);
 import useEmpty from './components/use-empty/use-empty.vue';
@@ -27,6 +29,51 @@ Vue.component('send-type', sendType);
 import useListTitle from './components/use-list-title/use-list-title.vue';
 Vue.component('use-list-title', useListTitle);
 
+// const autoLogin = async () => { // 小程序自动登录
+//   return new Promise(resolve => {
+// 		console.log('1111111111111111111111111111')
+//     uni.login({
+//       success: async (res) => {
+//         const result = await request('post', '/miniLogin', {
+//           code: res.code,
+// 		  appid:'000000'
+//           // appid: Vue.prototype.appId
+//         })
+//         if (result) {
+//           uni.setStorageSync("token", result.data.token);
+//           // await Vue.prototype.getUser()
+//           resolve(true)
+//         } else {
+//           uni.showModal({
+//             title: '温馨提示',
+//             content: '您尚未注册,是否前往注册?',
+//             showCancel: true,
+//             confirmText: '去注册',
+//             success: (response) => {
+//               if (response.confirm) {
+//                 // 用户点击确定
+//                 uni.navigateTo({
+//                   url: '/pages/bindPhone/bindPhone'
+//                 })
+//                 resolve(true)
+//               } else if (response.cancel) {
+//                 // 用户点击取消
+//                 resolve(false)
+//               }
+//             },
+//             fail: () => {
+//               resolve(false)
+//             }
+//           })
+//         }
+//       },
+//       fail: (e) => {
+//         resolve(false)
+//       }
+//     })
+//   })
+// }
+// autoLogin()
 Vue.config.productionTip = false
 App.mpType = 'app'
 

+ 250 - 1
package-lock.json

@@ -5,7 +5,224 @@
   "packages": {
     "": {
       "dependencies": {
-        "uview-ui": "^2.0.36"
+        "uview-ui": "^2.0.36",
+        "vuex": "^4.0.2"
+      }
+    },
+    "node_modules/@babel/parser": {
+      "version": "7.24.5",
+      "resolved": "https://registry.npmmirror.com/@babel/parser/-/parser-7.24.5.tgz",
+      "integrity": "sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==",
+      "peer": true,
+      "bin": {
+        "parser": "bin/babel-parser.js"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/sourcemap-codec": {
+      "version": "1.4.15",
+      "resolved": "https://registry.npmmirror.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+      "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
+      "peer": true
+    },
+    "node_modules/@vue/compiler-core": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-core/-/compiler-core-3.4.27.tgz",
+      "integrity": "sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==",
+      "peer": true,
+      "dependencies": {
+        "@babel/parser": "^7.24.4",
+        "@vue/shared": "3.4.27",
+        "entities": "^4.5.0",
+        "estree-walker": "^2.0.2",
+        "source-map-js": "^1.2.0"
+      }
+    },
+    "node_modules/@vue/compiler-dom": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-dom/-/compiler-dom-3.4.27.tgz",
+      "integrity": "sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-core": "3.4.27",
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/compiler-sfc": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-sfc/-/compiler-sfc-3.4.27.tgz",
+      "integrity": "sha512-nDwntUEADssW8e0rrmE0+OrONwmRlegDA1pD6QhVeXxjIytV03yDqTey9SBDiALsvAd5U4ZrEKbMyVXhX6mCGA==",
+      "peer": true,
+      "dependencies": {
+        "@babel/parser": "^7.24.4",
+        "@vue/compiler-core": "3.4.27",
+        "@vue/compiler-dom": "3.4.27",
+        "@vue/compiler-ssr": "3.4.27",
+        "@vue/shared": "3.4.27",
+        "estree-walker": "^2.0.2",
+        "magic-string": "^0.30.10",
+        "postcss": "^8.4.38",
+        "source-map-js": "^1.2.0"
+      }
+    },
+    "node_modules/@vue/compiler-ssr": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/compiler-ssr/-/compiler-ssr-3.4.27.tgz",
+      "integrity": "sha512-CVRzSJIltzMG5FcidsW0jKNQnNRYC8bT21VegyMMtHmhW3UOI7knmUehzswXLrExDLE6lQCZdrhD4ogI7c+vuw==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-dom": "3.4.27",
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/devtools-api": {
+      "version": "6.6.1",
+      "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.1.tgz",
+      "integrity": "sha512-LgPscpE3Vs0x96PzSSB4IGVSZXZBZHpfxs+ZA1d+VEPwHdOXowy/Y2CsvCAIFrf+ssVU1pD1jidj505EpUnfbA=="
+    },
+    "node_modules/@vue/reactivity": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/reactivity/-/reactivity-3.4.27.tgz",
+      "integrity": "sha512-kK0g4NknW6JX2yySLpsm2jlunZJl2/RJGZ0H9ddHdfBVHcNzxmQ0sS0b09ipmBoQpY8JM2KmUw+a6sO8Zo+zIA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/runtime-core": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/runtime-core/-/runtime-core-3.4.27.tgz",
+      "integrity": "sha512-7aYA9GEbOOdviqVvcuweTLe5Za4qBZkUY7SvET6vE8kyypxVgaT1ixHLg4urtOlrApdgcdgHoTZCUuTGap/5WA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/reactivity": "3.4.27",
+        "@vue/shared": "3.4.27"
+      }
+    },
+    "node_modules/@vue/runtime-dom": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/runtime-dom/-/runtime-dom-3.4.27.tgz",
+      "integrity": "sha512-ScOmP70/3NPM+TW9hvVAz6VWWtZJqkbdf7w6ySsws+EsqtHvkhxaWLecrTorFxsawelM5Ys9FnDEMt6BPBDS0Q==",
+      "peer": true,
+      "dependencies": {
+        "@vue/runtime-core": "3.4.27",
+        "@vue/shared": "3.4.27",
+        "csstype": "^3.1.3"
+      }
+    },
+    "node_modules/@vue/server-renderer": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/server-renderer/-/server-renderer-3.4.27.tgz",
+      "integrity": "sha512-dlAMEuvmeA3rJsOMJ2J1kXU7o7pOxgsNHVr9K8hB3ImIkSuBrIdy0vF66h8gf8Tuinf1TK3mPAz2+2sqyf3KzA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-ssr": "3.4.27",
+        "@vue/shared": "3.4.27"
+      },
+      "peerDependencies": {
+        "vue": "3.4.27"
+      }
+    },
+    "node_modules/@vue/shared": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/@vue/shared/-/shared-3.4.27.tgz",
+      "integrity": "sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==",
+      "peer": true
+    },
+    "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/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/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/magic-string": {
+      "version": "0.30.10",
+      "resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.30.10.tgz",
+      "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==",
+      "peer": true,
+      "dependencies": {
+        "@jridgewell/sourcemap-codec": "^1.4.15"
+      }
+    },
+    "node_modules/nanoid": {
+      "version": "3.3.7",
+      "resolved": "https://registry.npmmirror.com/nanoid/-/nanoid-3.3.7.tgz",
+      "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
+      "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/picocolors": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz",
+      "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==",
+      "peer": true
+    },
+    "node_modules/postcss": {
+      "version": "8.4.38",
+      "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.38.tgz",
+      "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==",
+      "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.7",
+        "picocolors": "^1.0.0",
+        "source-map-js": "^1.2.0"
+      },
+      "engines": {
+        "node": "^10 || ^12 || >=14"
+      }
+    },
+    "node_modules/source-map-js": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz",
+      "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==",
+      "peer": true,
+      "engines": {
+        "node": ">=0.10.0"
       }
     },
     "node_modules/uview-ui": {
@@ -15,6 +232,38 @@
       "engines": {
         "HBuilderX": "^3.1.0"
       }
+    },
+    "node_modules/vue": {
+      "version": "3.4.27",
+      "resolved": "https://registry.npmmirror.com/vue/-/vue-3.4.27.tgz",
+      "integrity": "sha512-8s/56uK6r01r1icG/aEOHqyMVxd1bkYcSe9j8HcKtr/xTOFWvnzIVTehNW+5Yt89f+DLBe4A569pnZLS5HzAMA==",
+      "peer": true,
+      "dependencies": {
+        "@vue/compiler-dom": "3.4.27",
+        "@vue/compiler-sfc": "3.4.27",
+        "@vue/runtime-dom": "3.4.27",
+        "@vue/server-renderer": "3.4.27",
+        "@vue/shared": "3.4.27"
+      },
+      "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"
+      }
     }
   }
 }

+ 37 - 6
pages.json

@@ -1,5 +1,12 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
+		{
+			"path" : "pages/diningList/diningList",
+			"style" : 
+			{
+				"navigationBarTitleText" : "餐车列表"
+			}
+		},
 		{
 			"path" : "pages/classify/classify",
 			"style" : 
@@ -8,6 +15,29 @@
 				"enablePullDownRefresh" : false
 			}
 		},
+		{
+			"path" : "pages/login/login",
+			"style" : 
+			{
+				"navigationBarTitleText" : "登录"
+			}
+		},
+		{
+			"path" : "pages/diningCar/diningCar",
+			"style" : 
+			{
+				"navigationBarTitleText" : "餐车信息",
+				"enablePullDownRefresh" : false
+			}
+		},
+		{
+			"path" : "pages/bindPhone/bindPhone",
+			"style" : 
+			{
+				"navigationBarTitleText" : "登录",
+				"enablePullDownRefresh" : false
+			}
+		},
 		{
 			"path" : "pages/order/myOrder/myOrder",
 			"style" : 
@@ -32,12 +62,7 @@
 				"enablePullDownRefresh" : false
 			}
 		},
-		{
-			"path": "pages/index/index",
-			"style": {
-				"navigationBarTitleText": "首页"
-			}
-		},
+		
 		{
 			"path" : "pages/order/submitOrder/submitOrder",
 			"style" : 
@@ -62,6 +87,12 @@
 				"navigationBarTitleText" : "商品详情",
 				"enablePullDownRefresh" : false
 			}
+		},
+		{
+			"path": "pages/index/index",
+			"style": {
+				"navigationBarTitleText": "首页"
+			}
 		}
 	],
 	"easycom": {

+ 38 - 19
pages/classify/classify.vue

@@ -3,17 +3,22 @@
 		<view>
 			<u-row justify="space-between" customStyle="margin-bottom: 10px">
 				<u-col span="3">
-					<view class="icon-container">
-						<u-icon label="自提" labelPos="bottom" size="42" name="order"></u-icon>
-						<u-tag class="ictag" text="0" shape="circle" type="error"></u-tag>
+					<view class="icon-container-l">
+						<uni-badge size="small" :text="100" absolute="rightTop">
+							<u-icon label="自提" labelPos="bottom" size="38" name="order"></u-icon>
+						</uni-badge>
 					</view>
 				</u-col>
-				<view>
+				<view class="container">
 					<u-tag text="营业中" plain shape="circle" type="success"></u-tag>
-					<u-icon label="当前餐车名称" labelPos="left" size="16" name="arrow-down"></u-icon>
+					<view @click="btnIc">
+						<u-icon label="当前餐车名称" labelPos="left" size="16" name="arrow-down"></u-icon>
+					</view>
 				</view>
 				<u-col span="3">
-					<u-icon label="我的" labelPos="bottom" size="42" name="account"></u-icon>
+					<view class="icon-container-r">
+						<u-icon label="我的" labelPos="bottom" size="38" name="account"></u-icon>
+					</view>
 				</u-col>
 			</u-row>
 		</view>
@@ -41,11 +46,14 @@
 				</view>
 				<view class="title">我是标题我是标题我是标题我是标题</view>
 				<view class="dflex padding-bottom-xs">
-					<u-tag text="夏季校服" type="error" bgColor="#E8341F" size="mini"></u-tag>
+					<u-tag plain text="销量: 199" borderColor="#FF6D20" color="#FF6D20" size="mini"></u-tag>
 				</view>
 				<view class="w-full dflex-b">
 					<view class="price">23.30</view>
-					<u-tag text="加购" bgColor="#000" shape="circle" size="mini" @click="goCart"></u-tag>
+					<view>
+						<u-button type="primary" shape="circle" size="small" icon="map"
+							color="linear-gradient(to right, #F54319, #FF6D20)"></u-button>
+					</view>
 				</view>
 			</view>
 		</view>
@@ -58,7 +66,7 @@
 				</uni-badge>
 				<text class="cart-total">¥35.60</text>
 			</view>
-			<view class="balance dflex-c">去结算</view>
+			<view class="balance dflex-c background-gradient">去结算</view>
 		</view>
 		<cartPopupVue ref="cartPopup" />
 	</view>
@@ -81,6 +89,11 @@
 			goCart() {},
 			showCart() {
 				this.$refs.cartPopup.setShow(true);
+			},
+			btnIc() {
+				uni.navigateTo({
+					url: `/pages/dingingList/dingingList`
+				})
 			}
 		}
 	}
@@ -183,16 +196,22 @@
 		width: 400rpx;
 	}
 
-	.icon-container {
-		position: relative;
-		display: inline-block;
-		width: 42px; // 根据u-icon的size调整
-		height: 42px; // 根据u-icon的size调整
+	.container {
+		display: flex;
+		flex-direction: column;
+		/* 垂直排列子元素 */
+		align-items: center;
+		/* 垂直居中子元素 */
+		justify-content: center;
+		/* 水平居中子元素 */
 	}
-	.ictag {
-		position: absolute;
-		top: 0;
-		right: 0;
-		z-index: 1;
+
+	.icon-container-l {
+		margin-top: 10px;
+		margin-left: 15px;
+	}
+
+	.icon-container-r {
+		margin-left: 20px;
 	}
 </style>

+ 1 - 1
utils/request.js

@@ -22,7 +22,7 @@ const request = parames => {
 		console.warn('请求url参数为空,请检查!');
 		return
 	}
-	const port = '';
+	const port = 'http://36.137.224.81:8030/auth';
 	let reqData = {};
 	reqData.url = port + parames.url;
 	reqData.method = parames.method ? parames.method : 'GET';