Przeglądaj źródła

Merge branch 'dev' into stage-7

# Conflicts:
#	pages/index/index.vue
chenxiong 3 lat temu
rodzic
commit
0ad44ce5ff

+ 3 - 2
components/course/courseSection.vue

@@ -67,11 +67,12 @@
           </view>
           </view>
           <view
           <view
             style="font-size: 20rpx; color: #ff3b30"
             style="font-size: 20rpx; color: #ff3b30"
-            v-if="menuItem.sectionType == 3 && !menuItem.recordingUrl"
+            v-if="menuItem.sectionType == 3"
           >
           >
-            <view>
+            <view v-if="!menuItem.recordingUrl">
               <text>当前直播回放视频请稍后再查看</text>
               <text>当前直播回放视频请稍后再查看</text>
             </view>
             </view>
+            <view v-else> 回放中 </view>
           </view>
           </view>
         </view>
         </view>
         <view v-if="menuItem.sectionType == null">{{
         <view v-if="menuItem.sectionType == null">{{

+ 6 - 0
pages/course/index.vue

@@ -541,6 +541,12 @@ export default {
         this.bankList();
         this.bankList();
       }
       }
     }
     }
+		if (this.current == 2) {
+		  if (this.list3.length < this.paramList[2].total) {
+		    this.paramList[2].pageNum++;
+		    this.liveList();
+		  }
+		}
   },
   },
   computed: { ...mapGetters(["userInfo"]) },
   computed: { ...mapGetters(["userInfo"]) },
 };
 };

+ 552 - 0
pages/index/index.vue

@@ -176,6 +176,7 @@ export default {
           name: "直播课",
           name: "直播课",
         },
         },
       ],
       ],
+<<<<<<< HEAD
 			goodsIndex: 0,
 			goodsIndex: 0,
 			goodsItem: 0,
 			goodsItem: 0,
 			workList: [],
 			workList: [],
@@ -585,6 +586,557 @@ export default {
 		},
 		},
 	},
 	},
 	computed: { ...mapGetters(['userInfo']) }
 	computed: { ...mapGetters(['userInfo']) }
+=======
+      goodsIndex: 0,
+      goodsItem: 0,
+      workList: [],
+      workTextList: [],
+      planGoodsList: [],
+      paramList: [
+        {
+          pageNum: 1,
+          pageSize: 10,
+          total: 0,
+          showStatus: 0,
+          goodsType: 1,
+        },
+        {
+          pageNum: 1,
+          pageSize: 10,
+          total: 0,
+          showStatus: 0,
+          goodsType: 2,
+        },
+      ],
+      list1: [],
+      list2: [],
+      isLogin: false,
+      isOld: false,
+    };
+  },
+  onPullDownRefresh() {},
+  async onLoad(option) {
+    this.dictObj;
+    this.getAdvertising();
+    if (this.$method.isLogin()) {
+      try {
+        await this.getUserInfo();
+        // websocket.sokcet(socket_url+this.userInfo.userId+'-'+this.$method.getRandomString(6))
+        // websocket.sokcet(socket_url+this.userInfo.userAccount)
+      } catch (err) {}
+    } else {
+      if (uni.getStorageSync("needToLogin")) {
+        uni.removeStorageSync("needToLogin");
+        uni.navigateTo({
+          url: "/pages4/login/login",
+        });
+      }
+    }
+
+    this.init();
+  },
+  onShow() {
+    uni.removeStorageSync("goPath");
+    this.courseList();
+    this.bankList();
+    if (uni.getStorageSync("updateHome")) {
+      this.init();
+      uni.removeStorageSync("updateHome"); //消费首页刷新事件
+    }
+
+    this.appCommonConfig({
+      version,
+    });
+
+    if (this.$method.isLogin()) {
+      this.$store.state.allowLoading = false;
+      this.$api.getinfoAttached().then((res) => {
+        if (res.data.code === 200) {
+          this.infoNums = res.data.data.informSum;
+          const nums =
+            res.data.data.informSum +
+            res.data.data.orderSum +
+            res.data.data.periodSum +
+            res.data.data.planSum +
+            res.data.data.subscribeSum;
+          this.$store.commit("tabNum", nums);
+        }
+      });
+      this.$store.state.allowLoading = true;
+    } else {
+      this.$store.commit("tabNum", 0);
+    }
+  },
+  onShareAppMessage(res) {
+    var self = this;
+    return {
+      title: "中正",
+      path:
+        `/pages/index/index?inviteCode=` + userInfo == null
+          ? ""
+          : userInfo.userAccount,
+    };
+  },
+  methods: {
+    ...mapActions(["getUserInfo", "appCommonConfig"]),
+    toFixed(number) {
+      if (number > 0) {
+        return number.toFixed(2);
+      } else {
+        return "0.00";
+      }
+    },
+    /**
+     * @param {Object} swiper
+     * 点击轮播图
+     */
+    swiperClick(swiper) {
+      if (swiper.jumpType == 1) {
+        //无跳转
+        return;
+      } else if (swiper.jumpType == 2) {
+        //url
+        let url = encodeURIComponent(swiper.jumpUrl);
+        uni.navigateTo({
+          url: "/pages/webview/index?url=" + swiper.jumpUrl,
+        });
+      } else if (swiper.jumpType == 3) {
+        //内部接口
+        uni.navigateTo({
+          url: swiper.jumpUrl,
+        });
+      } else if (swiper.jumpType == 4) {
+        //外部接口
+        uni.navigateToMiniProgram({
+          appId: swiper.remarks,
+          path: swiper.jumpUrl,
+          extraData: {},
+          success(res) {
+            // 打开成功
+          },
+          fail(err) {
+            console.log(err);
+            //  uni.showToast({
+            //  	title:'无效的appId,'+err.errMsg,
+            // icon:'none'
+            //  })
+          },
+        });
+      }
+    },
+    /**
+     * banner图片加载完成
+     */
+    imageLoad(e) {
+      let winW = 750;
+      let imgW = e.detail.width;
+      let imgH = e.detail.height;
+      this.swiperHeight = (750 * imgH) / imgW;
+    },
+    async getAdvertising() {
+      await this.advertisingHomeLocation();
+      await this.advertisingList();
+    },
+
+    getUserSubscribeRecentExam() {
+      return new Promise((resolve) => {
+        this.$api.getUserSubscribeRecentExam().then((res) => {
+          if (res.data.code == 200) {
+            if (res.data.data) {
+              let day = this.$method
+                .timestampToTime(res.data.data.applySiteExamTime, true)
+                .replace(/-/g, "/");
+              let dayTime = day + " " + res.data.data.applySiteStartTime;
+              let NowTime = new Date(); //考试时间
+              let examTime = new Date(dayTime); //考试时间
+              let t =
+                examTime.getTime() / 1000 -
+                (NowTime.getTime() / 1000).toFixed(0);
+              if (t > 0) {
+                let day = +this.$method.GetRTime(
+                  examTime.getTime() / 1000,
+                  true
+                );
+                this.nearByDay = day;
+              }
+            }
+
+            resolve();
+          }
+
+          console.log(res);
+        });
+      });
+    },
+
+    advertisingHomeLocation() {
+      return new Promise((resolve) => {
+        this.$api.advertisingHomeLocation().then((res) => {
+          this.interval = res.data.data.intervalTime * 1000;
+          resolve();
+        });
+      });
+    },
+    advertisingList() {
+      return new Promise((resolve) => {
+        this.$api.advertisingList({ locationId: 1 }).then((res) => {
+          this.list = res.data.rows;
+          resolve();
+        });
+      });
+    },
+    jumpPage() {
+      this.$navTo.togo("/pages4/msg/index");
+    },
+    go(type) {
+      if (!this.$method.isLogin()) {
+        if (type == "course") {
+          uni.setStorageSync("goPath", "course");
+        } else if (type == "bank") {
+          uni.setStorageSync("goPath", "bank");
+        }
+        this.$navTo.togo("/pages4/login/login");
+      } else {
+        if (type == "course") {
+          uni.navigateTo({
+            url: "/pages2/wd/class",
+          });
+        } else if (type == "bank") {
+          this.$api
+            .lockLockStatus({
+              action: "bank",
+            })
+            .then((res) => {
+              if (res.data.code == 200) {
+                //有其他端在操作,不能学习
+                uni.showToast({
+                  icon: "none",
+                  title: res.data.msg,
+                  duration: 3000,
+                });
+              } else if (res.data.code == 500) {
+                //可以学习
+                uni.navigateTo({
+                  url: "/pages2/wd/question_bank",
+                });
+              }
+            });
+        }
+      }
+    },
+    //课程
+    courseList() {
+      var self = this;
+      var param = this.paramList[0];
+      this.$api.goodsList(param).then((res) => {
+        console.log(res, "res");
+        self.paramList[0].total = res.data.total;
+        self.list1 = res.data.rows;
+        if (self.list1.length === res.data.total) {
+          self.paramList[0].showStatus = true;
+        }
+      });
+    },
+    //题库
+    bankList() {
+      var self = this;
+      var param = this.paramList[1];
+      this.$api.goodsList(param).then((res) => {
+        self.paramList[1].total = res.data.total;
+        self.list2 = res.data.rows;
+        if (self.list2.length === res.data.total) {
+          self.paramList[1].showStatus = true;
+        }
+      });
+    },
+    /**
+     * @param {Object} item
+     * 跳转课程详情
+     */
+    async jumpGoodsDetail(item) {
+      uni.navigateTo({
+        url: "/pages2/wd/class",
+      });
+      // let currentTime = this.$method.getZeroTime();
+
+      // if(currentTime < item.studyStartTime || currentTime > item.studyEndTime) {
+      // 	uni.showToast({
+      // 		title:'不在学习有效期,不可以学习了哦',
+      // 		icon:'none'
+      // 	})
+      // 	return;
+      // }
+
+      // if( (item.classStartTime && currentTime <= item.classStartTime) || (item.classEndTime && currentTime >= item.classEndTime) ) {
+      // 	uni.showToast({
+      // 		title:'不在班级有效期,不能进入学习',
+      // 		icon:'none'
+      // 	})
+      // 	return;
+      // }
+
+      // if(item.learningStatus == 2) {
+      // 	uni.showToast({
+      // 		title:'开放学习时间待定,不能进入学习',
+      // 		icon:'none'
+      // 	})
+      // 	return;
+      // }
+
+      // if(item.classStatus == 0 ) {
+      // 	uni.showToast({
+      // 		title:'尚未开班,不能进入学习',
+      // 		icon:'none'
+      // 	})
+      // 	return;
+      // }
+
+      // if(item.learningStatus == 3 && (currentTime < item.learningTimeStart) ) {
+      // 	uni.showToast({
+      // 		title:'不在开放学习时间,不能进入学习',
+      // 		icon:'none'
+      // 	})
+      // 	return;
+      // }
+
+      // if(item.gradeStatus == 1 && item.status == 1 && (item.studyEndTime > currentTime) &&  (item.classEndTime && (item.classEndTime < currentTime)) && (item.periodStatus == 0 || item.periodStatus == -1) && item.studyCount > 0) {
+
+      // 	uni.showModal({
+      // 		title:'提示',
+      // 		content:'班级已过期,需要重新选班',
+      // 		showCancel:false,
+      // 		success:() => {
+      // 			uni.navigateTo({
+      // 				url:"/pages2/wd/class"
+      // 			})
+      // 		}
+      // 	})
+      // 	return;
+      // }
+
+      // let rebuildStatus = await this.courseGoodsRebuildStatus(item.goodsId,item.gradeId);
+
+      // if(rebuildStatus == 0) {
+      // 	this.$navTo.togo('/pages2/learn/details', {
+      // 		gradeId:item.gradeId,
+      // 		goodsId: item.goodsId
+      // 	})
+      // 	return;
+      // }
+
+      // if(item.courseNum == 1 ) {
+
+      // 	this.$api.courseCourseList({
+      // 		pageNum:1,
+      // 		pageSize:1,
+      // 		goodsId:item.goodsId,
+      // 		gradeId:item.gradeId
+      // 	}).then(res => {
+      // 		if(res.data.code == 200) {
+      // 			uni.navigateTo({
+      // 				url:`/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}`
+      // 			})
+      // 		}
+      // 	});
+      // 	return;
+      // }
+
+      // this.$navTo.togo('/pages2/wd/course', {
+      // 	id: item.goodsId,
+      // 	gid:item.gradeId
+      // });
+    },
+    /**
+     * @param {Object} goodsId 商品id
+     * 查询商品重修状态
+     */
+    courseGoodsRebuildStatus(goodsId, gradeId) {
+      return new Promise((resolve) => {
+        this.$api
+          .courseGoodsRebuildStatus({
+            goodsId: goodsId,
+            gradeId: gradeId,
+          })
+          .then((res) => {
+            resolve(res.data.data);
+          });
+      });
+    },
+    preveItem() {
+      if (this.goodsIndex > 0) {
+        this.goodsIndex = this.goodsIndex - 1;
+        this.planGoodsList = this.workList[this.goodsIndex].goodsVos;
+        this.goodsItem = this.planGoodsList[0];
+        this.dealRL(this.workList[this.goodsIndex].calendarStudyVo);
+      }
+    },
+    nextItem() {
+      if (this.goodsIndex < this.workList.length - 1) {
+        this.goodsIndex = this.goodsIndex + 1;
+        this.planGoodsList = this.workList[this.goodsIndex].goodsVos;
+        this.goodsItem = this.planGoodsList[0];
+        this.dealRL(this.workList[this.goodsIndex].calendarStudyVo);
+      }
+    },
+    jumpPlan() {
+      if (!this.$method.isLogin()) {
+        this.$navTo.togo("/pages4/login/login");
+      } else {
+        this.$navTo.togo("/pages2/plan/index", {});
+      }
+    },
+    async init() {
+      if (!this.$method.isLogin()) {
+        //未登录
+        this.date_num = [];
+        this.workList = [];
+        this.planGoodsList = [];
+        this.initDay();
+      } else {
+        this.date_num = [];
+        this.workList = [];
+        this.planGoodsList = [];
+        await this.userPlanSeven();
+        await this.getUserSubscribeRecentExam();
+      }
+    },
+    getMonDate() {
+      var d = new Date(),
+        day = d.getDay(),
+        date = d.getDate();
+      if (day == 0) return d;
+      else d.setDate(date - day);
+      return d;
+    },
+    initDay() {
+      // d是当前星期一的日期对象
+      var d = this.getMonDate();
+      var arr = [];
+      let date = new Date();
+      let num = date.getDate();
+      this.date_num = [];
+      for (var i = 0; i < 7; i++) {
+        let item = { date: d.getDate() };
+        item.color = 0;
+        if (d.getDate() == num) {
+          item.color = 3;
+        }
+        this.date_num.push(item);
+        d.setDate(d.getDate() + 1);
+      }
+    },
+    dealRL(calendarStudyVo) {
+      let self = this;
+      self.date_num = [];
+      let date = new Date();
+      let num = date.getDate();
+      let month = date.getMonth() + 1;
+      let list = [];
+      for (let j = 0; j < calendarStudyVo.length; j++) {
+        let item = calendarStudyVo[j];
+        list = item.dayStudyList;
+        for (let i = 0; i < list.length; i++) {
+          let item = list[i];
+          item.color = 0;
+          if (item.date == num) {
+            item.color = 3;
+          }
+          if (item.perform == 1) {
+            item.color = 1;
+          }
+          if (item.perform == 2) {
+            item.color = 2;
+          }
+          item.note = item.studyCourseKnob;
+          if (item.note > 0) {
+            item.dot = true;
+          }
+          self.date_num.push(item);
+        }
+      }
+    },
+    userPlanSeven() {
+      return new Promise((resolve) => {
+        let self = this;
+        this.$api.userPlanSeven().then((result) => {
+          if (result.data.data && result.data.data.length > 0) {
+            self.workList = result.data.data;
+            self.planGoodsList = self.workList[0].goodsVos;
+            if (self.planGoodsList != null && self.planGoodsList.length > 0) {
+              self.goodsItem = self.planGoodsList[0];
+            }
+            self.dealRL(result.data.data[0].calendarStudyVo);
+            /* let date = new Date();
+						let num = date.getDate();
+						let month = date.getMonth() + 1;
+						let list = [];
+						for (let i = 0; i < result.data.data[0].calendarStudyVo.length; i++) {
+							let item = result.data.data[0].calendarStudyVo[i];
+							if (item.month == month) {
+								list = item.dayStudyList;
+							}
+						}
+						for (let i = 0; i < list.length; i++) {
+							let item = list[i];
+							item.color = 0;
+							if (item.date == num) {
+								item.color = 3;
+							}
+							if (item.perform == 1) {
+								item.color = 1;
+							}
+							if (item.perform == 2) {
+								item.color = 2;
+							}
+							item.note = item.studyCourseKnob;
+							if (item.note > 0) {
+								item.dot = true;
+							}
+							self.date_num.push(item);
+						} */
+          } else {
+            self.initDay();
+          }
+
+          resolve();
+        });
+      });
+    },
+    swiperChange(e) {
+      this.current = e.detail.current;
+    },
+    tab(e) {
+      this.tabCurrent = e;
+    },
+    updateHomePlan() {
+      this.$refs.home.init();
+    },
+    beforeSwitch(index) {
+      let that = this;
+      if (index == 1) {
+        this.isClick1 = true;
+      }
+      if (index == this.current) {
+        return false;
+      }
+      if (!this.$method.isLogin()) {
+        if (index == 0 || index == 1) {
+          return true;
+        } else {
+          this.$navTo.togo("/pages4/login/login");
+          return false;
+        }
+      } else {
+        if (index == 2) {
+          this.$refs.refMy.init();
+        }
+        return true;
+      }
+    },
+  },
+  onReachBottom() {},
+  computed: { ...mapGetters(["dictObj", "userInfo"]) },
+>>>>>>> dev
 };
 };
 </script>
 </script>
 <style>
 <style>

+ 22 - 22
pages2/wd/class.vue

@@ -29,15 +29,18 @@
             <image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
             <image src="/static/icon/wk_icon2.png" class="wk_icon"></image>
             学习服务期:
             学习服务期:
             <text class="content">
             <text class="content">
-							{{$method.timestampToTime(item.serviceStartTime, true, true)}}-{{$method.timestampToTime(item.serviceEndTime, true, true)}}
-						</text>
+              {{
+                $method.timestampToTime(item.serviceStartTime, true, true)
+              }}-{{ $method.timestampToTime(item.serviceEndTime, true, true) }}
+            </text>
           </view>
           </view>
         </view>
         </view>
 
 
         <!-- 不在学习服务期 -->
         <!-- 不在学习服务期 -->
         <template
         <template
           v-if="
           v-if="
-            sysTime < item.serviceStartTime || sysTime > item.serviceEndTime
+            item.serviceStartTime &&
+            (sysTime < item.serviceStartTime || sysTime > item.serviceEndTime)
           "
           "
         >
         >
           <view
           <view
@@ -62,11 +65,17 @@
               >
               >
               </u-icon>
               </u-icon>
               <view class="class-warm__text">
               <view class="class-warm__text">
-                <view class="date">
-									班级有效期:{{$method.timestampToTime(item.classStartTime, true, true)}}-{{$method.timestampToTime(item.classEndTime, true, true)}}
-								</view>
+                <view class="date"
+                  >班级有效期:{{
+                    $method.timestampToTime(item.classStartTime, true, true)
+                  }}
+                  -
+                  {{
+                    $method.timestampToTime(item.classEndTime, true, true)
+                  }}</view
+                >
                 <view class="state"
                 <view class="state"
-                  >班级状态:已过期,有疑问请联系
+                  >班级状态已过期,有疑问请联系
                   <text @click="call">020-87085982</text></view
                   <text @click="call">020-87085982</text></view
                 >
                 >
               </view>
               </view>
@@ -173,23 +182,13 @@
                       >
                       >
                     </template>
                     </template>
                     <template v-else>
                     <template v-else>
-                      已过学习服务期,不可以学习了哦!
+                      <template v-if="item.serviceStartTime"
+                        >已过学习服务期,不可以学习了哦!</template
+                      >
                     </template>
                     </template>
                   </view>
                   </view>
                 </view>
                 </view>
               </view>
               </view>
-
-              <!-- <view class="class-warm" v-if="item.profileTpStatus == 1">
-								<view class="class-warm__text">
-									<view class="date">
-										资料审核状态:
-										<text v-if="item.profileStatus == null">未提交资料</text>
-										<text v-else-if="item.profileStatus == 1">已通过</text>
-										<text v-else-if="item.profileStatus == 2">审核中</text>
-										<text v-else-if="item.profileStatus == 3">待完善</text>
-									</view>
-								</view>
-							</view> -->
             </template>
             </template>
 
 
             <!-- 学时审核状态可以审核 -->
             <!-- 学时审核状态可以审核 -->
@@ -327,8 +326,9 @@
               <u-button
               <u-button
                 :class="{
                 :class="{
                   disabled:
                   disabled:
-                    sysTime <= item.serviceStartTime ||
-                    sysTime >= item.serviceEndTime ||
+                    (item.serviceStartTime &&
+                      (sysTime <= item.serviceStartTime ||
+                        sysTime >= item.serviceEndTime)) ||
                     (item.classStartTime && sysTime <= item.classStartTime) ||
                     (item.classStartTime && sysTime <= item.classStartTime) ||
                     (item.classEndTime && sysTime >= item.classEndTime) ||
                     (item.classEndTime && sysTime >= item.classEndTime) ||
                     item.learningStatus == 2 ||
                     item.learningStatus == 2 ||

+ 1 - 1
pages3/polyv/detail.vue

@@ -7,7 +7,7 @@
     <view id="top">
     <view id="top">
       <view class="video_box" v-if="!startStatus">
       <view class="video_box" v-if="!startStatus">
         <image
         <image
-          :src="$method.splitImgHost(detail.coverUrl)"
+          :src="$method.splitImgHost(goodsData.coverUrl)"
           mode="widthFix"
           mode="widthFix"
           style="width: 100%; height: 421rpx"
           style="width: 100%; height: 421rpx"
         ></image>
         ></image>