Browse Source

feat: 增加院区选择页面

carver 1 year ago
parent
commit
204e6c3644

+ 2 - 1
antbuilder/core/components/industry-container/index.json

@@ -68,6 +68,7 @@
 		"scenic-order-list":"/antbuilder/industry/scenicSpotTicket/components/scenic-order-list/index",
 		"hospital-consulting-service-component":"/antbuilder/industry/hospitalV2/components/medical-consultation/medicalConsultation",
     	"patient-guide":"/antbuilder/industry/hospitalV2/components/patient-guide/index",
-    	"hospital-introduce":"/antbuilder/industry/hospitalV2/components/hospital-introduce/index"
+    	"hospital-introduce":"/antbuilder/industry/hospitalV2/components/hospital-introduce/index",
+		"select-hospital-area-introduce":"/antbuilder/industry/hospitalV2/components/select-hospital-area-introduce/index"
 	}
 }

+ 2 - 2
antbuilder/industry/hospitalV2/components/general-services/generalServices.js

@@ -16,8 +16,8 @@ Component({
     },
     async gotoHospitalIntroduce(e) {
       history.push({
-        title: "医院介绍",
-        pageType: "hospital-introduce",
+        title: "院区选择",
+        pageType: "select-hospital-area-introduce",
       });
     },
     toMorePage() {

+ 1 - 0
antbuilder/industry/hospitalV2/components/hospital-introduce/index.acss

@@ -3,6 +3,7 @@
   font-size: 17px;
   color: #333;
   line-height: 24px;
+  background-color: #fff;
 }
 .content1 {
   height: 200px;

+ 4 - 4
antbuilder/industry/hospitalV2/components/hospital-introduce/index.js

@@ -8,18 +8,18 @@ Component({
 
   didMount() {
     // hospitalId 白云 41,太和12
-    const hospitalId = envContext == "th" ? 12 : 41;
+    const { subHospitalId, hospitalId } = this.$page.data.query || {};
     this.getIntroduce(hospitalId);
   },
 
   methods: {
-    async getIntroduce(hospitalId = 41) {
+    async getIntroduce(subHospitalId) {
       console.log("xxxx000");
       const [err, result] = await getIntroduce({
-        subHospitalId: hospitalId,
+        subHospitalId: Number(subHospitalId),
         type: 3,
       });
-      if (!err) {
+      if (!err && result.content !== "<p></p>") {
         this.setData({
           content: result.content,
         });

+ 54 - 0
antbuilder/industry/hospitalV2/components/select-hospital-area-introduce/index.acss

@@ -0,0 +1,54 @@
+.hospital-new-component .select-hospital-area .item {
+  padding: 0 24rpx;
+  margin-top: 24rpx;
+}
+.hospital-new-component .select-hospital-area .area-item {
+  padding: 24rpx;
+  overflow: hidden;
+  background: #fff;
+  border-radius: 16rpx;
+}
+.hospital-new-component .select-hospital-area .area-item-header {
+  display: flex;
+  margin-bottom: 12px;
+  align-items: center;
+  justify-content: space-between;
+}
+.hospital-new-component .select-hospital-area .hospital-name {
+  color: #333;
+  font-size: 34rpx;
+  font-weight: 800;
+}
+.hospital-new-component .select-hospital-area .follow-button {
+  height: 49rpx;
+  padding: 0 32rpx;
+  background: #1677FF;
+  border-radius: 8rpx;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  color: #fff;
+  font-size: 24rpx;
+  width: 120rpx;
+  padding: 0;
+}
+.hospital-new-component .select-hospital-area .follow-button:active {
+  opacity: 0.9;
+}
+.hospital-new-component .select-hospital-area .follow-button.disabled {
+  color: #999;
+  background-color: #f5f5f5;
+}
+.hospital-new-component .select-hospital-area .area-address {
+  color: #333;
+  font-size: 30rpx;
+  margin-bottom: 12rpx;
+}
+.hospital-new-component .select-hospital-area .scroll-view {
+  max-height: 80vh;
+}
+.hospital-new-component .select-hospital-area .hospital-desc {
+  color: #999;
+  font-size: 30rpx;
+  line-height: 45rpx;
+}

+ 34 - 0
antbuilder/industry/hospitalV2/components/select-hospital-area-introduce/index.axml

@@ -0,0 +1,34 @@
+<wrapper>
+  <view class="select-hospital-area">
+    <scroll-fetch
+      height="{{ height }}"
+      onService="onService"
+    >
+      <view
+        class="item"
+        slot-scope="props"
+        onTap="onItemTap"
+        item="{{ props.item }}"
+        data-item="{{ props.item }}"
+      >
+        <view class="area-item">
+          <view class="area-item-header">
+            <text class="hospital-name">
+              {{ props.item.name }}
+            </text>
+          </view>
+          <view class="area-address">
+            <text number-of-lines="1">
+              {{ props.item.address }}
+            </text>
+          </view>
+          <view class="hospital-desc">
+            <text number-of-lines="2">
+              {{ props.item.description }}
+            </text>
+          </view>
+        </view>
+      </view>
+    </scroll-fetch>
+  </view>
+</wrapper>

+ 50 - 0
antbuilder/industry/hospitalV2/components/select-hospital-area-introduce/index.js

@@ -0,0 +1,50 @@
+import history from "../../utils/history";
+import { getHospitalDistrictList } from "./service";
+import { getRegisteredAnnouncement } from "../../../../core/utils/ywtService";
+Component({
+  props: {
+    height: "100vh",
+    componentData: {},
+  },
+  methods: {
+    getExtInfo() {
+      const { componentData } = this.props;
+      const { componentExtInfo } = componentData;
+      return componentExtInfo || {};
+    },
+
+    async onService() {
+      const list = await getHospitalDistrictList();
+      return {
+        list,
+        pagination: {
+          total: list.length,
+        },
+      };
+    },
+
+    onItemTap({ target: { dataset } }) {
+      this.toNextPage(dataset.item);
+    },
+
+    async toNextPage(item, replace) {
+      const { name, hospitalDistrictId, extInfo, address } = item;
+      const { componentData } = this.props;
+      const { query = {} } = this.$page.data;
+      history[replace ? "replace" : "push"]({
+        query: {
+          ...query,
+          name,
+          hospitalDistrictId,
+          hospitalId: extInfo.hospitalId || "",
+          subHospitalId: extInfo.subHospitalId || "",
+          subHospitalTitle: `${name}(${address})`,
+        },
+        componentData,
+        title: "医院介绍",
+        pageType: "hospital-introduce",
+      });
+      return;
+    },
+  },
+});

+ 7 - 0
antbuilder/industry/hospitalV2/components/select-hospital-area-introduce/index.json

@@ -0,0 +1,7 @@
+{
+  "component": true,
+  "usingComponents": {
+    "wrapper": "../components/wrapper/index",
+    "scroll-fetch": "../components/scroll-fetch/index"
+  }
+}

+ 9 - 0
antbuilder/industry/hospitalV2/components/select-hospital-area-introduce/service.js

@@ -0,0 +1,9 @@
+import request from "./../../service/request";
+
+/* 获取院区列表 */
+// eslint-disable-next-line
+
+export const getHospitalDistrictList = () => {
+	const url = "/isvRequest.order.queryHospitalDistrictList";
+	return request.post(url);
+};

+ 2 - 0
antbuilder/industry/hospitalV2/pages/page-no-pull/index.axml

@@ -81,5 +81,7 @@
   <patient-guide componentData="{{ componentData }}"  a:elif="{{ pageType === 'patient-guide' }}" />
   <!-- 医院介绍页面 -->
   <hospital-introduce componentData="{{ componentData }}"  a:elif="{{ pageType === 'hospital-introduce' }}" />
+  <!-- 院区选择页面 -->
+  <select-hospital-area-introduce componentData="{{ componentData }}"  a:elif="{{ pageType === 'select-hospital-area-introduce' }}" />
 
 </block>

+ 2 - 1
antbuilder/industry/hospitalV2/pages/page-no-pull/index.json

@@ -43,7 +43,8 @@
     "pre-settlement": "../../components/pre-settlement/index",
     "discharge-settlement": "../../components/discharge-settlement/index",
     "patient-guide": "../../components/patient-guide/index",
-    "hospital-introduce": "../../components/hospital-introduce/index"
+    "hospital-introduce": "../../components/hospital-introduce/index",
+    "select-hospital-area-introduce": "../../components/select-hospital-area-introduce/index"
   },
   "allowsBounceVertical": "NO",
   "pullRefresh": false