Explorar el Código

跳转选课中心限制

谢杰标 hace 2 años
padre
commit
b1e75a5892

+ 37 - 13
pages/course/index.vue

@@ -18,9 +18,7 @@
           </view>
           <view class="check_search u-flex">
             <view class="check_level u-flex" @click="openLeft()">
-              <view class="u-line-1"
-                >{{ selObj.eName }}:{{ selObj.aliasName }}</view
-              >
+              <view class="u-line-1">{{ selectName }}</view>
               <u-icon name="arrow-down-fill" color="#333333" size="20"> </u-icon
             ></view>
             <view class="line">|</view>
@@ -437,9 +435,6 @@ export default {
       bList: [],
       sList: [],
       selObj: {
-        eName: "",
-        pName: "",
-        bName: "",
         eId: 0,
         bId: 0,
         pId: 0,
@@ -455,8 +450,28 @@ export default {
     }, 500);
   },
   onLoad(option) {
-    console.log("item", this.current);
-    let eduStr = uni.getStorageSync("eduObj");
+    let eduStr = null;
+    // 小程序分享跳转
+    if (option.scene) {
+      let arrs = decodeURIComponent(option.scene).split("&");
+      for (let i = 0; i < arrs.length; i++) {
+        option[arrs[i].split("=")[0]] = arrs[i].split("=")[1]*1;
+      }
+    }
+    // 默认值
+    let { bid, pid, eid, cur } = option;
+    if (bid && pid && eid) {
+      uni.setStorageSync(
+        "eduObj",
+        JSON.stringify({
+          bId: bid * 1,
+          pId: pid * 1,
+          eId: eid * 1,
+        })
+      );
+    }
+    cur && (this.current = cur);
+    eduStr = uni.getStorageSync("eduObj");
     if (eduStr) {
       this.selObj = JSON.parse(eduStr);
       this.subjectList({
@@ -508,9 +523,6 @@ export default {
       this.selObj.bId = item.id;
       this.show = false;
       this.selObj.pId = item.projectId;
-      this.selObj.bName = item.businessName;
-      this.selObj.pName = item.projectName;
-      this.selObj.aliasName = item.aliasName;
       uni.setStorageSync("eduObj", JSON.stringify(this.selObj));
       this.subjectList({
         businessId: item.id,
@@ -532,7 +544,6 @@ export default {
     },
     active1(item) {
       this.selObj.eId = item.id;
-      this.selObj.eName = item.educationName;
       this.businessList({ educationId: item.id });
     },
     educationList() {
@@ -643,7 +654,20 @@ export default {
       }
     }
   },
-  computed: { ...mapGetters(["userInfo", "config"]) },
+  computed: {
+    ...mapGetters(["userInfo", "config"]),
+    selectName() {
+      let { eId, bId } = this.selObj;
+      if (!eId || !bId) {
+        return "";
+      }
+      let eItem = this.eList.find((e) => e.id === eId);
+      let bItem = this.bList.find((e) => e.id === bId);
+      return `${eItem ? eItem.educationName : ""}:${
+        bItem ? bItem.aliasName : ""
+      }`;
+    },
+  },
 };
 </script>
 <style>

+ 1 - 1
pages2/appointment/appointment_success.vue

@@ -39,7 +39,7 @@
 						<view class="txt_right">{{$method.timestampToTime(listData.applyStartTime)}} ~ {{$method.timestampToTime(listData.applyEndTime)}}</view>
 					</view>
 					<view class="list_item">
-						<view class="txt_left">报考业</view>
+						<view class="txt_left">报考业</view>
 						<view class="txt_right" v-if="listData.categoryName">{{listData.categoryName}}专业</view>
 					</view>
 					<view class="list_item">

+ 1 - 1
pages2/appointment/index.vue

@@ -28,7 +28,7 @@
       </view>
       <view class="appointmentItem appointmentMajor">
         <view class="top">
-          <view class="labelName">报考业:</view>
+          <view class="labelName">报考业:</view>
           <view class="valName">{{ listData.major || "" }}</view>
         </view>
       </view>

+ 2 - 2
pages2/exam/exam_appointment.vue

@@ -15,7 +15,7 @@
 							<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
 						</view>
 						<view class="item">
-							<view class="left">报考业</view>
+							<view class="left">报考业</view>
 							<view class="right" v-if="item.categoryName">{{ item.categoryName }}专业</view>
 						</view>
 						<view class="item">
@@ -94,7 +94,7 @@
 						<text class="val">{{ $method.timestampToTime(activeList.applyStartTime) }} ~ {{ $method.timestampToTime(activeList.applyEndTime) }}</text>
 					</view>
 					<view class="item">
-						报考业:
+						报考业
 						<text class="val">{{ activeList.categoryName || ''}}</text>
 					</view>
 					<view class="item">

+ 2 - 2
pages2/exam/exam_result.vue

@@ -15,7 +15,7 @@
 							<u-icon name="arrow-right" color="#999999" size="28"></u-icon>
 						</view>
 						<view class="item">
-							<view class="left">报考业</view>
+							<view class="left">报考业</view>
 							<view class="right">{{ item.categoryName }}</view>
 						</view>
 						<view class="item">
@@ -76,7 +76,7 @@
 						<text class="val">{{ $method.timestampToTime(activeList.applyStartTime) }} ~ {{ $method.timestampToTime(activeList.applyEndTime) }}</text>
 					</view>
 					<view class="item">
-						报考业:
+						报考业
 						<text class="val">{{ activeList.categoryName }}</text>
 					</view>
 					<view class="item">

+ 1 - 1
pages5/mockExam/examApply.vue

@@ -106,7 +106,7 @@
           <view class="item_title">
             <text class="star_red">*</text>
             <text class="number">04</text>
-            <text class="category">报考业</text>
+            <text class="category">报考业</text>
           </view>
           <u-form-item
             label=" "