Browse Source

🎨 按要求隐藏菜单和修改细节问题

快乐的梦鱼 2 months ago
parent
commit
3d0ab7b4f2

+ 2 - 0
src/api/RequestModules.ts

@@ -49,10 +49,12 @@ function requestInceptor(url: string, req: RequestOptions) {
   if (req.method == 'GET') {
     //追加GET参数
     url = appendGetUrlParams(url, 'main_body_id', ApiCofig.mainBodyId);
+    //url = appendGetUrlParams(url, 'platform', ApiCofig.platformId);
     if (append_main_body_user_id)
       url = appendGetUrlParams(url, 'main_body_user_id', main_body_user_id);
   } else {
     req.data = appendPostParams(req.data,'main_body_id', ApiCofig.mainBodyId);
+    //req.data = appendPostParams(req.data,'platform', ApiCofig.platformId);
     if (append_main_body_user_id)
       req.data = appendPostParams(req.data,'main_body_user_id', main_body_user_id);
   } 

+ 1 - 0
src/common/config/ApiCofig.ts

@@ -6,4 +6,5 @@ export default {
   serverDev: 'https://mn.wenlvti.net/api',
   serverProd: 'https://mn.wenlvti.net/api',
   mainBodyId: 1,
+  platformId: 327,
 }

+ 0 - 6
src/pages.json

@@ -69,12 +69,6 @@
       }
     },
     {
-      "path": "pages/travel/nav/navto",
-      "style": {
-        "navigationBarTitleText": "导航"
-      }
-    },
-    {
       "path": "pages/discover",
       "style": {
         "navigationBarTitleText": "闽南文化生态保护-发现",

+ 4 - 4
src/pages/discover.vue

@@ -36,8 +36,8 @@
       /> -->
 
       <!-- 文化挑战 -->
-      <HomeTitle title="文化挑战" />
-      <!-- 
+      <!--<HomeTitle title="文化挑战" />
+       
       方言配音大赛隐藏
       <Box2LineRightSlot 
         title="方言配音大赛"
@@ -45,13 +45,13 @@
         @click="navTo('/pages/answer/index')"
       >
         <image class="width-60 height-60 radius-base" src="https://mncdn.wenlvti.net/app_static/minnan/images/discover/IconCup.png" mode="aspectFill" />
-      </Box2LineRightSlot> -->
+      </Box2LineRightSlot>
       <Box2LineRightSlot
         title="非遗百科问答"
         desc="可获积分:500"
       >
         <Button :radius="40" type="primary" size="small" @click="goAnswer">立即报名</Button>
-      </Box2LineRightSlot>
+      </Box2LineRightSlot> -->
 
       <!-- 文化社区 -->
       <!-- <HomeTitle title="文化社区" />

+ 12 - 4
src/pages/home.vue

@@ -32,7 +32,7 @@
             class="d-flex flex-column align-center width-1-4 mt-2 mb-2"
             @click="tab.onClick"
           >
-            <image class="width-100" :src="tab.icon" mode="widthFix" />
+            <image class="width-100" :src="tab.icon" mode="widthFix" :style="{ maxHeight: '100rpx' }" />
             <text class="color-second-text mt-2 size-base text-align-center">{{ tab.name }}</text>
           </view>
 
@@ -203,16 +203,24 @@ const subTabs = [
     icon: MainBoxIcon1, 
     onClick: () => navTo('/pages/inhert/language/list') 
   },
-  { 
+  /* { 
     name: '闽南美食', 
     icon: MainBoxIcon2, 
     onClick: () => navTo('/pages/introduction/food/list') 
-  },
+  }, */
   { name: '历史人物', icon: MainBoxIcon3, onClick: () => navTo('/pages/introduction/character/list') },
-  { 
+  /* { 
     name: '闽南民俗', 
     icon: MainBoxIcon4, 
     onClick: () => navTo('/pages/introduction/custom/list')
+  }, */
+  { 
+    name: '', 
+    icon: '',
+  },
+  { 
+    name: '', 
+    icon: '',
   },
 ];
 

+ 5 - 3
src/pages/inhert/artifact/details.vue

@@ -117,9 +117,11 @@ function handleGoToVr(vr: string) {
   navTo('/pages/article/web/ewebview', { url: vr })
 }
 function handleNavTo(content: any) {
-  navTo('../../travel/nav/navto', {
-    latitude: content?.latitude,  
-    longitude: content?.longitude,  
+  if (!content?.latitude || !content?.longitude) 
+    return;
+  uni.openLocation({
+    latitude: Number(content.latitude),  
+    longitude: Number(content.longitude),  
   }) 
 }
 

+ 11 - 5
src/pages/inhert/intangible/DetailsCommon.vue

@@ -122,10 +122,7 @@
               <text class="iconfont icon-navigation"></text>
               <text class="address">{{ content.address }}</text>
             </view>
-            <view class="d-flex flex-row align-center flex-shrink-0" @click="navTo('/pages/travel/nav/navto', {
-              latitude: content.latitude,
-              longitude: content.longitude,
-            })">
+            <view class="d-flex flex-row align-center flex-shrink-0" @click="handleNavTo(content)">
               <text class="color-orange">去这里</text>
               <text class="iconfont icon-arrow-right"></text>
             </view>
@@ -214,7 +211,7 @@ import CommonListPage from "@/pages/article/common/CommonListPage.vue";
 import IntroBlock from "@/pages/article/common/IntroBlock.vue";
 import { useLoadQuerys } from "@/common/composeabe/LoadQuerys";
 import type { TabControlItem } from "@/common/composeabe/TabControl";
-import { ref, type Ref } from "vue";
+import { h, ref, type Ref } from "vue";
 import { navTo } from "@/components/utils/PageAction";
 import { StringUtils } from "@imengyu/imengyu-utils";
 import InheritorContent from "@/api/inheritor/InheritorContent";
@@ -285,6 +282,15 @@ async function loadSubList(page: number, pageSize: number, content: any, subList
   }
 }
 
+function handleNavTo(content: any) {
+  if (!content?.latitude || !content?.longitude) 
+    return;
+  uni.openLocation({
+    latitude: Number(content.latitude),  
+    longitude: Number(content.longitude),  
+  }) 
+}
+
 const page = ref();
 
 const { querys } = useLoadQuerys({ modelId: 0 })

+ 3 - 3
src/pages/inhert/village/details.vue

@@ -158,9 +158,9 @@ const data = ref<Record<string, any>>({
   villageName: '',
 })
 function goAddress() {
-  navTo('/pages/travel/nav/navto', {
-    latitude: data.value.latitude,
-    longitude: data.value.longitude,
+  uni.openLocation({
+    latitude: Number(data.value.latitude),
+    longitude: Number(data.value.longitude),
   })
 }
 const { onPreviewImage } = useSwiperImagePreview(() => data.value.images || [])

+ 0 - 207
src/pages/travel/nav/navto.vue

@@ -1,207 +0,0 @@
-<template>
-  <view class="container">
-    <map
-      id="map"
-      class="map"
-      :latitude="querys.latitude"
-      :longitude="querys.longitude"
-      :polyline="polyline"
-      :markers="markers"
-      scale="15"
-      show-compass
-      show-traffic
-      show-locate
-    >
-    </map>
-    <cover-view class="map-info">
-      <cover-view class="title">{{ distance }}</cover-view>
-      <cover-view class="sub-title">{{ taxi_cost }}</cover-view>
-      <cover-view class="go" @click="goSystem">其他导航</cover-view>
-    </cover-view>
-  </view>
-</template>
-
-<script setup lang="ts">
-import { showError } from '@/common/composeabe/ErrorDisplay';
-import { useLoadQuerys } from '@/common/composeabe/LoadQuerys';
-import AppCofig from '@/common/config/AppCofig';
-import { back } from '@/components/utils/PageAction';
-import { ref } from 'vue';
-import amapFile from '@/libs/amap-wx.130';
-import { toast } from '@/components/utils/DialogAction';
-
-const mapCtx = uni.createMapContext('map');
-const polyline = ref();
-const markers = ref();
-const distance = ref('');
-const taxi_cost = ref('');
-const { querys } = useLoadQuerys({ 
-  latitude: 0,  
-  longitude: 0,
-}, async (querys) => {
-  uni.showLoading({ title: '加载中...' });
-  try {
-    
-    if (querys.latitude == 0 || querys.longitude == 0) {
-      throw new Error('传入参数不正确');
-    }
-
-    const curretLocation = await new Promise<{ latitude: number, longitude: number }>((resolve, reject) => {
-      uni.getLocation({
-        type: 'gcj02',
-        success: function(res) {
-          const latitude = res.latitude;
-          const longitude = res.longitude;
-          resolve({ latitude, longitude });
-        }, 
-        fail: (err) => {
-          let message = err.errMsg
-          if (err.errMsg.includes('auth deny')) {
-            message = '请允许定位后,才能为您导航哦';
-          } else if (err.errMsg.includes('location service off')) {
-            message = '请未开启定位服务,才能为您导航哦';
-          } 
-          reject(message);
-        },
-      }) 
-    })
-
-    markers.value = [
-      {
-        id: 1,
-        latitude: querys.latitude,
-        longitude: querys.longitude, 
-        iconPath: 'https://mncdn.wenlvti.net/app_static/minnan/images/icon_marker.png',
-        width: 40,
-        height: 40,
-      },
-      {
-        id: 2,
-        latitude: curretLocation.latitude,
-        longitude: curretLocation.longitude, 
-        iconPath: 'https://mncdn.wenlvti.net/app_static/minnan/images/icon_marker2.png',
-        width: 50,
-        height: 50,
-      }
-    ];
-
-    polyline.value = await new Promise((resolve, reject) => {
-      const color1 = [223, 53, 51];
-      const color2 = [0, 145, 255];
-
-      const myAmapFun = new amapFile.AMapWX({key:  AppCofig.amapKey});
-      myAmapFun.getDrivingRoute({
-        origin: `${curretLocation.longitude.toFixed(5)},${curretLocation.latitude.toFixed(5)}`,
-        destination: `${querys.longitude.toFixed(5)},${querys.latitude.toFixed(5)}`,
-        nosteps: 1,
-        success: function(data: any){
-          let points = [];
-          let colorList : string[] = [];
-          if(data.paths && data.paths[0] && data.paths[0].steps){
-            var steps = data.paths[0].steps;
-            for(var i = 0; i < steps.length; i++){
-              var poLen = steps[i].polyline.split(';');
-              for(var j = 0;j < poLen.length; j++){
-                points.push({
-                  longitude: parseFloat(poLen[j].split(',')[0]),
-                  latitude: parseFloat(poLen[j].split(',')[1])
-                })
-              } 
-            }
-          } 
-          distance.value = '距离您约 ' + formatMeter(data.paths[0].distance) + '米'
-          taxi_cost.value =  '打车约' + parseInt(data.taxi_cost) + '元'
-          resolve([{
-            points: points,
-            color: "#0091ff",
-            width: 6
-          }]);
-        },
-        fail: function(info: any) {
-          reject('路线规划失败:' + info);
-        }
-      })
-    });
-
-    mapCtx.includePoints({
-      points: [
-        { latitude: querys.latitude, longitude: querys.longitude },
-        { latitude: curretLocation.latitude, longitude: curretLocation.longitude }
-      ],
-      padding: [20, 20, 20, 20],
-    });
-  } catch (e) {
-    showError(e, undefined, () => back());
-  } finally {
-    uni.hideLoading();
-  }
-});
-
-function goSystem() {
-  uni.openLocation({
-    latitude: querys.value.latitude,
-    longitude: querys.value.longitude,
-    scale: 15,
-    name: '目标位置',
-    success() {},
-    fail(error) {
-      toast('导航启动失败');
-    },
-  });
-}
-
-function formatMeter(n: number) {
-  if (n > 1000) {
-    return (n / 1000).toFixed(1) + '千'; 
-  }
-  return n + '';
-}
-
-</script>
-
-<style lang="scss">
-.container {
-  position: relative;
-  display: flex;
-  flex-direction: column;
-  height: 100vh;
-  padding-bottom: 0;
-  
-  #map {
-    width: 100%;
-    height: 100%;
-  }
-  .map-info {
-    position: absolute;
-    bottom: 50px;
-    left: 40rpx;
-    right: 40rpx;
-    display: flex;
-    flex-direction: column;
-    background-color: #fff;
-    border-radius: 8px;
-    padding: 20rpx;
-    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
-
-    .title {
-      font-size: 34rpx;
-      font-weight: bold;
-      color: #333;
-    }
-    .sub-title {
-      font-size: 26rpx;
-      margin-top: 10rpx;
-      color: #666;
-    }
-    .go {
-      position: absolute;
-      padding: 15rpx;
-      background-color: #bdbdbd;
-      border-radius: 10rpx;
-      top: 50%;
-      right: 20rpx;
-      transform: translateY(-50%);
-    }
-  }
-}
-</style>