Bladeren bron

优化跳转医保电子凭证

lighter 3 jaren geleden
bovenliggende
commit
3feac488ce

+ 0 - 5
src/store/index.js

@@ -17,7 +17,6 @@ export default createStore({
     covidExamIndexes: [],
     currentBook: {},
     yjReqNo: null,
-    weappApiExist: false,
   },
   mutations: {
     SET_LOADING: (state, payload) => (state.loading = payload),
@@ -32,7 +31,6 @@ export default createStore({
     SET_COVIDEXAMINDEXES: (state, payload) => (state.covidExamIndexes = payload),
     SET_CURRENTBOOK: (state, payload) => (state.currentBook = payload),
     SET_YJREQNO: (state, payload) => (state.yjReqNo = payload),
-    SET_WEAPPAPIEXIST: (state, payload) => (state.weappApiExist = payload),
   },
   actions: {
     SET_LOADING({ commit }, payload) {
@@ -71,8 +69,5 @@ export default createStore({
     SET_YJREQNO({ commit }, payload) {
       commit('SET_YJREQNO', payload)
     },
-    SET_WEAPPAPIEXIST({ commit }, payload) {
-      commit('SET_WEAPPAPIEXIST', payload)
-    },
   },
 })

+ 32 - 43
src/views/hospital-info/HospitalIntroduction.vue

@@ -37,7 +37,7 @@
   </window-size>
 </template>
 
-<script>
+<script setup name="HospitalIntroduction">
 import store from '../../store'
 import blueprint from '../../assets/hospital-blueprint.jpg'
 import hall from '../../assets/hall.jpg'
@@ -45,50 +45,39 @@ import nurseStation from '../../assets/nurse-station.jpg'
 import childrenCenter from '../../assets/children-center.jpg'
 import { onMounted, reactive, ref } from 'vue'
 import { getJsApiSHA1 } from '../../api/wx-jsapi'
-export default {
-  name: 'HospitalIntroduction',
-  setup() {
-    const images = [blueprint, hall, nurseStation, childrenCenter]
-    const headDiv = ref(null)
-    const mScroll = reactive({
-      height: '',
-      padding: '10px',
-      overflowY: 'scroll',
-      backgroundColor: 'lightskyblue',
-      backgroundImage: 'linear-gradient(to bottom right, #d6dbe9, #c4ceeb)',
+const images = [blueprint, hall, nurseStation, childrenCenter]
+const headDiv = ref(null)
+const mScroll = reactive({
+  height: '',
+  padding: '10px',
+  overflowY: 'scroll',
+  backgroundColor: 'lightskyblue',
+  backgroundImage: 'linear-gradient(to bottom right, #d6dbe9, #c4ceeb)',
+})
+const showRoute = () => {
+  getJsApiSHA1(encodeURI(location.href)).then((res) => {
+    wx.config({
+      debug: false,
+      appId: res.appId,
+      timestamp: res.timestamp,
+      nonceStr: res.noncestr,
+      signature: res.signature,
+      jsApiList: ['openLocation'],
     })
-    const showRoute = () => {
-      getJsApiSHA1(encodeURI(location.href)).then((res) => {
-        wx.config({
-          debug: false,
-          appId: res.appId,
-          timestamp: res.timestamp,
-          nonceStr: res.noncestr,
-          signature: res.signature,
-          jsApiList: ['openLocation'],
-        })
-        wx.ready(() => {
-          wx.openLocation({
-            latitude: 28.304346,
-            longitude: 112.961423,
-            name: '长沙泰和医院', // 位置名
-            address: '湖南省长沙市开福区芙蓉北路529号', // 地址详情说明
-            scale: 15, // 地图缩放级别,整形值,范围从1~28。默认为最大
-            // infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
-          })
-        })
+    wx.ready(() => {
+      wx.openLocation({
+        latitude: 28.304346,
+        longitude: 112.961423,
+        name: '长沙泰和医院', // 位置名
+        address: '湖南省长沙市开福区芙蓉北路529号', // 地址详情说明
+        scale: 15, // 地图缩放级别,整形值,范围从1~28。默认为最大
+        // infoUrl: '', // 在查看位置界面底部显示的超链接,可点击跳转
       })
-    }
-
-    onMounted(() => {
-      mScroll.height = store.state.windowSize.h - 250 - headDiv.value.offsetHeight + 'px'
     })
-    return {
-      images,
-      headDiv,
-      mScroll,
-      showRoute,
-    }
-  },
+  })
 }
+
+onMounted(() => {
+  mScroll.height = store.state.windowSize.h - 250 - headDiv.value.offsetHeight + 'px'
+})
 </script>

+ 9 - 35
src/views/hospital-service/HospitalServiceHome.vue

@@ -62,7 +62,7 @@
       </van-row>
     </div>
 
-    <div style="position: relative; width: 95%; margin-top: 10px; height: 70px">
+    <div style="position: relative; width: 95%; margin-top: 10px; height: 70px" @click="toybdzpz">
       <div
         style="
           margin-left: 5%;
@@ -81,16 +81,6 @@
           医保电子凭证
         </div>
       </div>
-      <wx-open-launch-weapp
-        username="gh_598eb49157c6"
-        appid="wxb032bc789053daf4"
-        path="yibao/pages/new_index/index/index.html?cityCode=430000&channel=AAFPgL4CyNqERXbiPt10sAv1"
-        :style="{ position: 'absolute', top: 0, left: 0, width: '100%', height: '100%' }"
-      >
-        <div v-is="'script'" type="text/wxtag-template">
-          <div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0"></div>
-        </div>
-      </wx-open-launch-weapp>
     </div>
 
     <div style="width: 90%; margin-left: 5%; margin-top: 15px">
@@ -123,13 +113,12 @@
 </template>
 
 <script>
-import { computed, onActivated, onMounted, ref } from 'vue'
+import { computed, onMounted, ref } from 'vue'
 import store from '../../store'
 import { getDate } from '../../utils/date'
 import router from '../../router'
 import axios from 'axios'
 import { apiUrl } from '../../utils/dev-prod'
-import { getJsApiSHA1 } from '../../api/wx-jsapi'
 export default {
   setup() {
     const windowSize = store.state.windowSize
@@ -182,9 +171,6 @@ export default {
       fontWeight: 'normal',
       paddingRight: '15px',
     }
-    const weappApiExist = computed(() => {
-      return store.state.weappApiExist
-    })
     const cards = computed(() => {
       return store.state.patientCards
     })
@@ -230,6 +216,12 @@ export default {
       }
     }
 
+    const toybdzpz = () => {
+      window.open(
+        'https://mp.weixin.qq.com/insurance/card/creditjump?cityid=430100&from=u1ZYLGrYTJspxoHAQoU96w.%3D#wechat_redirect'
+      )
+    }
+
     const loading = ref(false)
     onMounted(() => {
       if (doctors.value.length === 0) {
@@ -243,25 +235,6 @@ export default {
           loading.value = false
         })
       }
-
-      if (!weappApiExist.value) {
-        setTimeout(() => {
-          getJsApiSHA1(encodeURI(location.href)).then((res) => {
-            wx.config({
-              debug: false,
-              appId: res.appId,
-              timestamp: res.timestamp,
-              nonceStr: res.noncestr,
-              signature: res.signature,
-              jsApiList: [],
-              openTagList: ['wx-open-launch-weapp'],
-            })
-            wx.ready(() => {
-              store.commit('SET_WEAPPAPIEXIST', true)
-            })
-          })
-        }, 300)
-      }
     })
     return {
       filterPath,
@@ -280,6 +253,7 @@ export default {
       toVaccinateAppointment,
       loadingStyle,
       loading,
+      toybdzpz,
     }
   },
 }

+ 1 - 9
vite.config.js

@@ -2,15 +2,7 @@ import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
 
 export default defineConfig({
-  plugins: [
-    vue({
-      template: {
-        compilerOptions: {
-          isCustomElement: (tag) => tag === 'wx-open-launch-weapp',
-        },
-      },
-    }),
-  ],
+  plugins: [vue()],
   server: {
     host: '0.0.0.0',
     port: 4000,