路泰科技体检小程序UI设计新版本
1
wwl
5 天以前 a6cdbcfe28fcc40ebb4919f57d60fb20122e8e57
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" />
               <view class="search-btn">搜索</view>
               <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">
@@ -142,6 +108,7 @@
                  value: 'other'
               }
            ],
            name: '',
            timeOptions: [
               '当日可约',
               '次日可约',
@@ -165,6 +132,14 @@
         this.getList();
      },
      methods: {
         search() {
            getHospList({
               hospName: this.name
            }).then((response) => {
               this.hosplist = response.data;
            });
         },
         /** 查询院区信息列表 */
         getList() {
            getHospList(this.queryParams).then((response) => {
@@ -182,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'
            })
         // 解码 Base64,处理 Unicode 字符
         decodeBase64(str) {
            try {
               str = str.replace(/-/g, '+').replace(/_/g, '/');
               const decoded = atob(str);
               return decodeURIComponent(escape(decoded));
            } catch (e) {
               console.error("Base64 解码失败:", e);
               return null;
            }
         },
         gohosp() {
         gohosp(item) {
            // 将 hospId 存储到本地
            uni.setStorageSync('hospId', item.code);
            // 处理 introduction 的 Base64 解码
            let introduction = item.introduction;
            if (this.isBase64(introduction)) {
               const decoded = this.decodeBase64(introduction);
               introduction = decoded || '<p>无法解码医院简介,请检查数据</p>';
            }
            uni.setStorageSync('introduction', introduction);
            // 通过 URL 传递参数
            uni.navigateTo({
               url: '/pagesA/goHosp/goHosp'
            })
               url: `/pagesA/hospIntroduce/hospIntroduce?hospId=${item.code}&introduction=${encodeURIComponent(introduction)}`
            });
         }
      },
@@ -390,7 +389,7 @@
   .hospital-item {
      display: flex;
      padding:20rpx 30rpx;
      padding: 20rpx 30rpx;
      margin: 0 0rpx 20rpx;
      // background: #fff;
      border-radius: 12rpx;