Pārlūkot izejas kodu

fix: 分类优化

chenjj 3 nedēļas atpakaļ
vecāks
revīzija
3a4d90ef71
2 mainītis faili ar 12 papildinājumiem un 14 dzēšanām
  1. 2 2
      config.js
  2. 10 12
      pages/mallMenu.vue

+ 2 - 2
config.js

@@ -2,8 +2,8 @@
 const config = {
 	// baseUrl: 'https://vue.ruoyi.vip/prod-api',
 	//cloud后台网关地址
-	baseUrl: 'http://192.168.100.133:9527',
-	// baseUrl: 'https://zybooks.tech/prod-api',
+	// baseUrl: 'http://192.168.100.133:9527',
+	baseUrl: 'https://zybooks.tech/prod-api',
 	mapKey:'KFEBZ-P2GKZ-A5PX4-7Q6Y7-KXOBF-XCB4C',
 	appName: '金邻助家',
 	// 应用信息

+ 10 - 12
pages/mallMenu.vue

@@ -12,19 +12,16 @@
                 @scroll="rightScroll">
                 <view class="page-view">
                     <view class="class-item" :id="'item' + index" v-for="(item, index) in tabbar" :key="index">
-                        <view v-for="(classItem, index) in item.children" :key="index + 'title'">
-                            <view class="item-title">
-                                <text>{{ classItem.businessName }}</text>
-                            </view>
-                            <view class="item-container">
+                        <view class="item-title">
+							<text>{{ item.businessName }}</text>
+						</view>
+                        <view class="item-container">
                                 <view class="thumb-box"
-                                    v-for="(item1, index1) in (classItem.children ? classItem.children : [classItem])"
-                                    :key="index1" @click="clickMenu(item1, classItem.parentId)">
-                                    <!-- <image class="item-menu-image" src="https://cdn.uviewui.com/uview/common/classify/1/1.jpg" mode=""></image> -->
+                                    v-for="(item1, index1) in  (item.children?item.children:[item])"
+                                    :key="index1" @click="clickMenu(item)">
                                     <view class="item-menu-name">{{ item1.businessName }}</view>
                                 </view>
                             </view>
-                        </view>
                     </view>
                 </view>
             </scroll-view>
@@ -167,9 +164,10 @@ export default {
                 }
             }, 10)
         },
-        async clickMenu(service, key) {
-            console.log(service, key);
-
+        async clickMenu(service) {
+            console.log(service);
+            const { id } = service;
+            const key = id;
             if (this.userType == '2') {
                 const res = await getVolunteerInfo({
                     serviceCategory: key