From a6cdbcfe28fcc40ebb4919f57d60fb20122e8e57 Mon Sep 17 00:00:00 2001 From: wwl <xchao828@163.com> Date: 星期二, 12 八月 2025 09:10:35 +0800 Subject: [PATCH] 1 --- pages/fg/fg.vue | 96 +++++++++++++++++++++-------------------------- 1 files changed, 43 insertions(+), 53 deletions(-) diff --git a/pages/fg/fg.vue b/pages/fg/fg.vue index b644ace..14ac436 100644 --- a/pages/fg/fg.vue +++ b/pages/fg/fg.vue @@ -16,23 +16,9 @@ <view class="header"> <view class="search-bar"> <uni-icons class="search-icon" type="search" size="18" color="#999"></uni-icons> - <input type="text" placeholder="鎼滅储鍖婚櫌" placeholder-class="placeholder" v-model="name"/> + <input type="text" placeholder="鎼滅储鍖婚櫌" placeholder-class="placeholder" v-model="name" /> <view class="search-btn" @click="search">鎼滅储</view> </view> - <!-- <view class="filter-bar"> - <view class="filter-item"> - 鍏ㄩ儴鍘垮尯 - <uni-icons type="bottom" size="14" color="#666"></uni-icons> - </view> - <view class="filter-item"> - 绾у埆浼樺厛 - <uni-icons type="bottom" size="14" color="#666"></uni-icons> - </view> - <view class="filter-item active"> - 鍏朵粬 - <uni-icons type="bottom" size="14" color="#2979ff"></uni-icons> - </view> - </view> --> <view class="filter-tabs"> <view class="filter-item" v-for="(item, index) in filterOptions" :key="index" :class="{ 'active': currentFilter === index }" @click="selectFilter(index)"> @@ -78,30 +64,10 @@ </uni-popup> </view> - <!-- 鍒嗛櫌閫夐」鍗� --> - <!-- <view class="padding-l" v-for="(item,index) in hosplist" :key="index" @click="gohosp"> - <div class="Package"> - <div class="Package_left"> - <img class="Package_left_img" src="https://ltpeis.xaltjdkj.cn:5502/static/images/hosp.png" alt=""> - </div> - <div class="Package_right"> - <span class="Package_txt">{{item.hospAreaName}}</span> - - <div class="Package_t"> - <span class="Package_txt1">钀ヤ笟鏃堕棿锛氬懆涓�鑷冲懆鍏�8:00-12:00,鍛ㄦ棩浼戞伅</span> - </div> - - <div class="Package_right_txt"> - <div class="Package_txt2">鍦板潃锛歿{item.areaName}}</div> - <div class="Package_txt2">鑱旂郴鐢佃瘽锛歿{item.phone}}</div> - </div> - - </div> - </div> - </view> --> + <scroll-view class="hospital-list" scroll-y> - <view class="hospital-item" v-for="(hospital, index) in hosplist" :key="index" @click="gohosp"> + <view class="hospital-item" v-for="(hospital, index) in hosplist" :key="index" @click="gohosp(hospital)"> <image src="https://ltpeis.xaltjdkj.cn:5502/static/images/hosp.png" mode="aspectFill" class="hospital-image" /> <view class="hospital-info"> @@ -166,12 +132,12 @@ this.getList(); }, methods: { - search(){ + search() { getHospList({ - hospName:this.name + hospName: this.name }).then((response) => { this.hosplist = response.data; - + }); }, /** 鏌ヨ闄㈠尯淇℃伅鍒楄〃 */ @@ -191,21 +157,45 @@ this.$refs.popup.close() }, - //璺宠浆椤甸潰 - ComparisonReport() { - uni.navigateTo({ - url: '/pagesA/ComparisonReport/ComparisonReport' - }) + + + isBase64(str) { + if (!str || typeof str !== 'string') return false; + const base64Regex = /^[A-Za-z0-9+/=]+$/; + if (!base64Regex.test(str) || str.length % 4 !== 0) return false; + try { + return btoa(atob(str)) === str; + } catch (e) { + return false; + } }, - ReportDetails() { - uni.navigateTo({ - url: '/pagesA/ReportDetails/ReportDetails' - }) + // 瑙g爜 Base64锛屽鐞� Unicode 瀛楃 + decodeBase64(str) { + try { + str = str.replace(/-/g, '+').replace(/_/g, '/'); + const decoded = atob(str); + return decodeURIComponent(escape(decoded)); + } catch (e) { + console.error("Base64 瑙g爜澶辫触:", e); + return null; + } }, - gohosp() { + gohosp(item) { + // 灏� hospId 瀛樺偍鍒版湰鍦� + uni.setStorageSync('hospId', item.code); + + // 澶勭悊 introduction 鐨� Base64 瑙g爜 + let introduction = item.introduction; + if (this.isBase64(introduction)) { + const decoded = this.decodeBase64(introduction); + introduction = decoded || '<p>鏃犳硶瑙g爜鍖婚櫌绠�浠嬶紝璇锋鏌ユ暟鎹�</p>'; + } + uni.setStorageSync('introduction', introduction); + + // 閫氳繃 URL 浼犻�掑弬鏁� uni.navigateTo({ - url: '/pagesA/goHosp/goHosp' - }) + url: `/pagesA/hospIntroduce/hospIntroduce?hospId=${item.code}&introduction=${encodeURIComponent(introduction)}` + }); } }, @@ -399,7 +389,7 @@ .hospital-item { display: flex; - padding:20rpx 30rpx; + padding: 20rpx 30rpx; margin: 0 0rpx 20rpx; // background: #fff; border-radius: 12rpx; -- Gitblit v1.8.0