lijj 2 éve
szülő
commit
dde7e45624

+ 29 - 17
miniapp/pages.json

@@ -5,54 +5,66 @@
   "subPackages": [],
   // "requiredBackgroundModes": ["audio", "location"],
   "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
-   {
-        "path": "pages/yuecai/professional_style/index",
-        "style": {
-          "navigationBarTitleText": "专业风采",
-          "enablePullDownRefresh": false
-        }
-    },{
+    {
+      "path": "pages/yuecai/professional_style/index",
+      "style": {
+        "navigationBarTitleText": "专业风采",
+        "enablePullDownRefresh": false
+      }
+    }, {
+      "path": "pages/yuecai/professional_style/detail/index",
+      "style": {
+        "navigationBarTitleText": "专业风采",
+        "enablePullDownRefresh": false
+      }
+    }, {
       "path": "pages/yuecai/dish/index",
       "style": {
         "navigationBarTitleText": "名菜",
         "enablePullDownRefresh": false
       }
-    },{
+    }, {
       "path": "pages/yuecai/dish/detail/index",
       "style": {
         "navigationBarTitleText": "名菜详情",
         "enablePullDownRefresh": false
       }
-    },{
+    }, {
       "path": "pages/yuecai/location/index",
       "style": {
         "navigationBarTitleText": "名点",
         "enablePullDownRefresh": false
       }
-    },{
+    }, {
       "path": "pages/yuecai/location/detail/index",
       "style": {
         "navigationBarTitleText": "名点详情",
         "enablePullDownRefresh": false
       }
-    },{
+    }, {
       "path": "pages/yuecai/restaurant/index",
       "style": {
         "navigationBarTitleText": "名店",
         "enablePullDownRefresh": false
       }
-    },{
+    }, {
       "path": "pages/yuecai/restaurant/detail/index",
       "style": {
         "navigationBarTitleText": "名店详情",
         "enablePullDownRefresh": false
       }
-    },{
+    }, {
       "path": "pages/yuecai/usercenter/index",
       "style": {
         "navigationBarTitleText": "我的",
         "enablePullDownRefresh": false
       }
+    }, {
+      "path": "pages/yuecai/information/detail/index",
+      "style": {
+        "navigationBarTitleText": "资讯",
+        "enablePullDownRefresh": false
+      }
     },
     {
       "path": "pages/index",
@@ -81,22 +93,22 @@
       "selectedIconPath": "@selectedIconPath1",
       "text": "专业风采",
       "pagePath": "pages/yuecai/professional_style/index"
-    },{
+    }, {
       "iconPath": "@iconPath2",
       "selectedIconPath": "@selectedIconPath2",
       "text": "名菜",
       "pagePath": "pages/yuecai/dish/index"
-    },{
+    }, {
       "iconPath": "@iconPath2",
       "selectedIconPath": "@selectedIconPath2",
       "text": "名点",
       "pagePath": "pages/yuecai/location/index"
-    },{
+    }, {
       "iconPath": "@iconPath2",
       "selectedIconPath": "@selectedIconPath2",
       "text": "名店",
       "pagePath": "pages/yuecai/restaurant/index"
-    },{
+    }, {
       "iconPath": "@iconPath2",
       "selectedIconPath": "@selectedIconPath2",
       "text": "我的",

+ 3 - 0
miniapp/pages/yuecai/dish/detail/index.vue

@@ -21,6 +21,9 @@
     methods: {
       getDishDetail(id) {
         this.$u.api.getDishDetail(id).then(res => {
+          if (res.data.content) {
+            res.data.content = decodeURIComponent(res.data.content);
+          }
           this.detailVO = res.data || {}
         })
       }

+ 9 - 1
miniapp/pages/yuecai/dish/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="width-100 height-100 view-page">
-    <u-swiper :list="bannerList" @click="click" keyName="cover"></u-swiper>
+    <u-swiper :list="bannerList" @click="clickInfo" keyName="cover"></u-swiper>
     <view class="p-10">
       <u-search :clearabled="true" placeholder="请输入搜索关键字" v-model="keyword" :shape="square" search="doRefresh"
         @custom="doRefresh"></u-search>
@@ -45,6 +45,14 @@
       this.doRefresh();
     },
     methods: {
+      clickInfo(index) {
+        if (index < 0) {
+          return;
+        }
+        uni.navigateTo({
+          url: "/pages/yuecai/information/detail/index?id=" + this.bannerList[index].id,
+        })
+      },
       getBanners() {
         this.$u.api.getInformationList(0, 6, {}).then(res => {
           this.bannerList = res.data.records || []

+ 39 - 0
miniapp/pages/yuecai/information/detail/index.vue

@@ -0,0 +1,39 @@
+<template>
+  <page-theme :theme="theme">
+    <template>
+      <view class="f-30 p-40 flex-dir-column flex-x-center">
+        <view>{{detailVO.address}}</view>
+        <view class="col-info-d t-c m-b-30" v-html="detailVO.content"></view>
+      </view>
+    </template>
+  </page-theme>
+</template>
+
+<script>
+  import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
+  export default {
+    mixins: [themeMixins],
+    data() {
+      return {
+        detailVO: {},
+      }
+    },
+    methods: {
+      getInformationDetail(id) {
+        this.$u.api.getInformationDetail(id).then(res => {
+          if (res.data.content) {
+            res.data.content = decodeURIComponent(res.data.content);
+          }
+
+          this.detailVO = res.data || {}
+        })
+      }
+    },
+    onLoad(options) {
+      this.getInformationDetail(options.id);
+    },
+  }
+</script>
+
+<style scoped lang="scss">
+</style>

+ 3 - 0
miniapp/pages/yuecai/location/detail/index.vue

@@ -21,6 +21,9 @@
     methods: {
       getLocationDetail() {
         this.$u.api.getLocationDetail().then(res => {
+          if (res.data.content) {
+            res.data.content = decodeURIComponent(res.data.content);
+          }
           this.detailVO = res.data || {}
         })
       }

+ 3 - 0
miniapp/pages/yuecai/professional_style/detail/index.vue

@@ -21,6 +21,9 @@
     methods: {
       getProfessionalStyleDetail() {
         this.$u.api.getProfessionalStyleDetail().then(res => {
+          if (res.data.content) {
+            res.data.content = decodeURIComponent(res.data.content);
+          }
           this.detailVO = res.data || {}
         })
       }

+ 10 - 2
miniapp/pages/yuecai/professional_style/index.vue

@@ -1,6 +1,6 @@
 <template>
   <view class="width-100 height-100 view-page">
-    <u-swiper :list="bannerList" @click="click" keyName="cover"></u-swiper>
+    <u-swiper :list="bannerList" @click="clickInfo" keyName="cover"></u-swiper>
     <u-list @scrolltolower="scrolltolower" height="calc(100% - 50px)" lowerThreshold="10">
       <u-list-item v-for="(item, index) in list" :key="index">
         <u-cell :title="item.name" @click="toDetail(item.id)">
@@ -40,6 +40,14 @@
       this.getBanners()
     },
     methods: {
+      clickInfo(index) {
+        if (index < 0) {
+          return;
+        }
+        uni.navigateTo({
+          url: "/pages/yuecai/information/detail/index?id=" + this.bannerList[index].id,
+        })
+      },
       getBanners() {
         this.$u.api.getInformationList(0, 6, {}).then(res => {
           this.bannerList = res.data.records || []
@@ -81,7 +89,7 @@
       },
       toDetail(id) {
         uni.navigateTo({
-          url: "/pages/yuecai/dish/detail/index?id=" + id,
+          url: "/pages/yuecai/professional_style/detail/index" + id,
         })
       }
     },

+ 3 - 0
miniapp/pages/yuecai/restaurant/detail/index.vue

@@ -21,6 +21,9 @@
     methods: {
       getRestaurantDetail() {
         this.$u.api.getRestaurantDetail().then(res => {
+          if (res.data.content) {
+            res.data.content = decodeURIComponent(res.data.content);
+          }
           this.detailVO = res.data || {}
         })
       }