Prechádzať zdrojové kódy

Merge branch 'master' of http://git.ketter.cn/farwalker/ycwh

huitong 2 rokov pred
rodič
commit
df190fbb86

+ 1 - 1
admin/src/main/resources/application.yml

@@ -242,7 +242,7 @@ blade:
     #接口放行
     skip-url:
       #- /blade-test/**
-      - /yuecai-wx/member/login
+      - /yuecai-wx/**
     #授权认证配置
     auth:
       - method: ALL

+ 1 - 1
miniapp/manifest.json

@@ -108,7 +108,7 @@
             "disableHostCheck" : true, // 开启可以用自己的域名
             "proxy" : {
                 "/api" : {
-                    "target" : "http://localhost:8826",
+                    "target" : "http://localhost:9232",
                     "changeOrigin" : true,
                     "secure" : false,
                     "pathRewrite" : {

+ 185 - 38
miniapp/pages/yuecai/dish/index.vue

@@ -12,20 +12,32 @@
     </view>
     <u-tabs ref="tabs" :list="tabList" :scrollable="false" :current="currentTab" @change="tabChange" lineColor="#65371b"
       :activeStyle="{color:'#65371b'}" inactiveStyle="{color:'#65371b'}"></u-tabs>
-    <u-list @scrolltolower="scrolltolower" height="calc(100% - 91px)" lowerThreshold="10">
-      <view class="info-list">
-        <view class="info-item" v-for="(item, index) in list" :key="index" @click="toDetail(item.id)">
-          <view class="info-pic">
-            <u-image width="175rpx" height="175rpx" mode="aspectFill" :src="item.cover"></u-image>
-          </view>
-          <view class="info-title">
+    <view class="search-view">
+      <view class="area-selector">
+        <u-list height="100%">
+          <view class="area-name" :class="{'area-name-active': currentArea==item.code}"
+            v-for="(item,index) in areaOptions[cuisineType]" :key="index" @click="areaChange(item.code)">
             {{item.name}}
           </view>
-        </view>
+        </u-list>
+      </view>
+      <view class="search-result">
+        <u-list @scrolltolower="scrolltolower" height="100%" lowerThreshold="10">
+          <view class="info-list">
+            <view class="info-item" v-for="(item, index) in list" :key="index" @click="toDetail(item.id)">
+              <view class="info-pic">
+                <u-image width="175rpx" height="175rpx" mode="aspectFill" :src="item.cover"></u-image>
+              </view>
+              <view class="info-title">
+                {{item.name}}
+              </view>
+            </view>
+          </view>
+          <u-loadmore :status="page.status" :loading-text="page.loadingText" :loadmore-text="page.loadmoreText"
+            :nomore-text="page.nomoreText" />
+        </u-list>
       </view>
-      <u-loadmore :status="page.status" :loading-text="page.loadingText" :loadmore-text="page.loadmoreText"
-        :nomore-text="page.nomoreText" />
-    </u-list>
+    </view>
   </view>
 </template>
 
@@ -54,41 +66,147 @@
         }, {
           name: '名点',
         }],
+        currentArea: '',
+        cuisineType: '',
+        areaOptions: {
+          'guagnfu': [{
+              code: "4401",
+              name: "广州市"
+            },
+            {
+              code: "4403",
+              name: "深圳市"
+            },
+            {
+              code: "4404",
+              name: "珠海市"
+            },
+            {
+              code: "4405",
+              name: "汕头市"
+            },
+            {
+              code: "4406",
+              name: "佛山市"
+            },
+            {
+              code: "4407",
+              name: "江门市"
+            },
+            {
+              code: "4408",
+              name: "湛江市"
+            },
+            {
+              code: "4409",
+              name: "茂名市"
+            },
+            {
+              code: "4412",
+              name: "肇庆市"
+            },
+            {
+              code: "4417",
+              name: "阳江市"
+            },
+            {
+              code: "4418",
+              name: "清远市"
+            },
+            {
+              code: "4419",
+              name: "东莞市"
+            },
+            {
+              code: "4420",
+              name: "中山市"
+            },
+            {
+              code: "4453",
+              name: "云浮市"
+            }
+          ],
+          'chaozhou': [{
+            code: "4405",
+            name: "汕头市"
+          }, {
+            code: "4415",
+            name: "汕尾市"
+          }, {
+            code: "4451",
+            name: "潮州市"
+          }, {
+            code: "4452",
+            name: "揭阳市"
+          }],
+          'kejia': [{
+            code: "4402",
+            name: "韶关市"
+          }, {
+            code: "4413",
+            name: "惠州市"
+          }, {
+            code: "4414",
+            name: "梅州市"
+          }, {
+            code: "4416",
+            name: "河源市"
+          }]
+        },
         currentTab: 0
       }
     },
     onLoad(options) {
-      switch (options.type) {
-        case 'restaurant':
-          this.currentTab = 0;
-          wx.setNavigationBarTitle({
-            title: '名店'
-          })
-          break;
-        case 'dish':
-          this.currentTab = 1;
-          wx.setNavigationBarTitle({
-            title: '名菜'
-          })
-          break;
-        case 'snacks':
-          this.currentTab = 2;
-          wx.setNavigationBarTitle({
-            title: '名点'
-          })
-          break;
-        default:
-          this.currentTab = 0;
-          wx.setNavigationBarTitle({
-            title: '名店'
-          })
-          break;
-      }
+      this.cuisineType = options.cuisineType || ''
+      //
+      this.currentTab = 0;
+      wx.setNavigationBarTitle({
+        title: '名店'
+      })
+      //
+      // switch (options.type) {
+      //   case 'restaurant':
+      //     this.currentTab = 0;
+      //     wx.setNavigationBarTitle({
+      //       title: '名店'
+      //     })
+      //     break;
+      //   case 'dish':
+      //     this.currentTab = 1;
+      //     wx.setNavigationBarTitle({
+      //       title: '名菜'
+      //     })
+      //     break;
+      //   case 'snacks':
+      //     this.currentTab = 2;
+      //     wx.setNavigationBarTitle({
+      //       title: '名点'
+      //     })
+      //     break;
+      //   default:
+      //     this.currentTab = 0;
+      //     wx.setNavigationBarTitle({
+      //       title: '名店'
+      //     })
+      //     break;
+      // }
 
       this.keyword = '';
       this.doRefresh();
     },
     methods: {
+      areaChange(areaCode) {
+        if (!areaCode) {
+          return;
+        }
+        //
+        if (this.currentArea == areaCode) {
+          this.currentArea = '';
+        } else {
+          this.currentArea = areaCode;
+        }
+        this.doRefresh();
+      },
       tabChange(e) {
         this.currentTab = e.index;
         switch (this.currentTab) {
@@ -152,7 +270,9 @@
 
         //
         listFunc(this.page.current, this.page.size, {
-          name: this.keyword || ''
+          name: this.keyword || '',
+          cuisineCode: this.cuisineType || '',
+          regionId: this.currentArea || ''
         }).then(res => {
           if (res.data.records && res.data.records.length > 0) {
             this.list.push(...res.data.records)
@@ -232,4 +352,31 @@
       }
     }
   }
+
+  .search-view {
+    height: calc(100% - 91px);
+    display: flex;
+  }
+
+  .area-selector {
+    height: 100%;
+    width: 70px;
+
+    .area-name {
+      text-align: center;
+      line-height: 35px;
+      border-top: 1rpx solid #f0f0f0;
+    }
+
+    .area-name-active {
+      color: white;
+      background-color: #65371b;
+      font-weight: bold;
+    }
+  }
+
+  .search-result {
+    width: calc(100% - 70px);
+    height: 100%;
+  }
 </style>

+ 7 - 7
miniapp/pages/yuecai/home/index.vue

@@ -21,23 +21,23 @@
           </view>
           <view class="nav-btn-text">专业风采</view>
         </view>
-        <view class="nav-btn" @click="navTo('restaurant')">
+        <view class="nav-btn" @click="navTo('guagnfu')">
           <view class="nav-btn-icon icon-circle">
             <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/restaurant.png"></u-image>
           </view>
-          <view class="nav-btn-text">名店</view>
+          <view class="nav-btn-text">广府菜</view>
         </view>
-        <view class="nav-btn" @click="navTo('dish')">
+        <view class="nav-btn" @click="navTo('chaozhou')">
           <view class="nav-btn-icon icon-circle">
             <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/dish.png"></u-image>
           </view>
-          <view class="nav-btn-text">菜</view>
+          <view class="nav-btn-text">潮州菜</view>
         </view>
-        <view class="nav-btn" @click="navTo('snacks')">
+        <view class="nav-btn" @click="navTo('kejia')">
           <view class="nav-btn-icon icon-circle">
             <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/snacks.png"></u-image>
           </view>
-          <view class="nav-btn-text">名点</view>
+          <view class="nav-btn-text">客家菜</view>
         </view>
 
       </view>
@@ -107,7 +107,7 @@
           })
         } else {
           uni.navigateTo({
-            url: "/pages/yuecai/dish/index?type=" + type,
+            url: "/pages/yuecai/dish/index?cuisineType=" + type,
           })
         }