Browse Source

增加踢用户下线 以及ui学习中心状态更改部分

谢杰标 2 years ago
parent
commit
1ced3673db

+ 11 - 1
common/httpList/lock.js

@@ -41,6 +41,16 @@ export default {
 		})
 	},
 	
-	
+    /**
+	 * @param {Object} data
+	 * 踢其他用户下线
+	 */
+	offline(data) {
+		return myRequest({
+			url: '/app/user/offline',
+			method: 'post',
+			data: data,
+		})
+	},
 	
 }

+ 38 - 5
common/methodTool.js

@@ -165,6 +165,9 @@ export default {
           res = year + "." + month + "." + day;
           break;
         case "yyyy-mm-dd hh:mm:ss":
+        case "yyyy/mm/dd":
+          res = year + "/" + month + "/" + day;
+          break;
         default: {
           res =
             year +
@@ -725,10 +728,40 @@ export default {
       /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i;
     return reg.test(str);
   },
-  isObject (object) {
-    return object !== null && typeof object === 'object'
+  isObject(object) {
+    return object !== null && typeof object === "object";
+  },
+  isEmptyObject(object) {
+    return this.isObject(object) && Object.keys(object).length < 1;
+  },
+  checkLock(action = "jxjy") {
+    return new Promise((resolve, reject) => {
+      api
+        .lockLockStatus({
+          action,
+          uuid: this.getUuid(),
+        })
+        .then((res) => {
+          if (res.data.code == 200) {
+            //有其他端在操作,不能学习
+            uni.showModal({
+              title: "提示",
+              content: "有其他端在操作,是否将该用户踢下线?",
+              success: (res) => {
+                if (res.confirm) {
+                  api.offline().then((r) => {
+                    if (r.data.code === 200) {
+                      resolve();
+                    }
+                  });
+                }
+              },
+            });
+          } else if (res.data.code == 500) {
+            //可以学习
+            resolve();
+          }
+        });
+    });
   },
-  isEmptyObject (object) {
-    return this.isObject(object) && Object.keys(object).length < 1
-  }
 };

+ 9 - 0
pages/index/index.vue

@@ -407,6 +407,9 @@ export default {
     };
   },
   async onLoad(option) {
+    this.$method.checkLock().then((res) => {
+      console.log(7897897)
+    });
     // #ifdef H5
     uni.setNavigationBarTitle({
       title: this.config.companyName,
@@ -723,6 +726,12 @@ export default {
             url: "/pages2/wd/class",
           });
         } else if (type == "bank") {
+          this.$method.checkLock("bank").then((res) => {
+            uni.navigateTo({
+              url: "/pages2/wd/question_bank",
+            });
+          });
+          return;
           this.$api
             .lockLockStatus({
               action: "bank",

File diff suppressed because it is too large
+ 492 - 482
pages/learn/index.scss


+ 202 - 41
pages/learn/index.vue

@@ -142,6 +142,109 @@
             :key="index"
             class="course_item"
           >
+            <view
+              class="c_downs"
+              @click="studyIn(item.goodsId, item.gradeId, item, index)"
+            >
+              <view class="lefts">
+                <image
+                  class="lefet_img"
+                  :src="$method.splitImgHost(item.coverUrl, true)"
+                  mode=""
+                ></image>
+                <view v-if="item.goodsType == 6" class="live_icon">直播</view>
+              </view>
+              <view class="rights">
+                <view class="learn_progress">
+                  <view class="progress_up">
+                    <view class="cou_titles line2"
+                      >{{ item.goodsName }}{{ item.goodsName }}</view
+                    >
+                    <view class="classHour">
+                      <text
+                        >{{
+                          item.courseNum || item.courseNum == 0
+                            ? item.courseNum
+                            : "-"
+                        }}课程/</text
+                      >
+                      <text
+                        >{{
+                          item.classHours || item.classHours == 0
+                            ? item.classHours
+                            : "-"
+                        }}学时/</text
+                      >
+                      <text>{{ item.secAllNum + item.examNum || "-" }}节</text>
+                    </view>
+                  </view>
+                </view>
+              </view>
+            </view>
+            <view class="course_item_info">
+              <view>
+                <text>学习状态:</text>
+                <text class="eb" v-if="item.stuAllNum + item.recordNum == 0"
+                  >未开始</text
+                >
+                <text
+                  class="eb"
+                  v-else-if="
+                    item.stuAllNum + item.recordNum > 0 &&
+                    item.stuAllNum + item.recordNum <
+                      item.secAllNum + item.examNum
+                  "
+                  >学习中</text
+                >
+                <text
+                  class="eb"
+                  v-else-if="
+                    item.stuAllNum + item.recordNum >=
+                    item.secAllNum + item.examNum
+                  "
+                  >已学完</text
+                >
+              </view>
+              <view>
+                <text>学习进度:</text>
+                <text>
+                  {{ item.stuAllNum + item.recordNum }}/{{
+                    item.secAllNum + item.examNum
+                  }}
+                </text>
+              </view>
+              <view>
+                <text>学习服务:</text>
+                <text>
+                  {{
+                    $method.formDate(item.serviceStartTime, "yyyy/mm/dd")
+                  }}至{{
+                    $method.formDate(item.serviceEndTime, "yyyy/mm/dd")
+                  }}</text
+                >
+              </view>
+              <view>
+                <text>班级状态:</text>
+                <text>
+                  <text v-if="item.classEndTime && item.classEndTime < sysTime"
+                    >已过期</text
+                  >
+                  <text v-else-if="item.classStatus == 1">开班中</text>
+                  <text v-else>未开班</text>
+                </text>
+              </view>
+              <view>
+                <text>班级有效:</text>
+                <template v-if="item.classEndTime">
+                  <text>
+                    {{ $method.formDate(item.classEndTime, "yyyy/mm/dd") }}
+                  </text>
+                  <text class="eb">(剩余10天)</text>
+                </template>
+                <text v-else>——</text>
+              </view>
+            </view>
+
             <view
               class="titlews"
               @click="studyIn(item.goodsId, item.gradeId, item, index)"
@@ -919,6 +1022,7 @@ export default {
           const [{ data: res1 }, { data: res2 }] = res;
           if (res1.code == 200) {
             this.total = res1.total;
+            // res1.rows[0].goodsType = 6
             this.courseLists = res1.rows || [];
           }
           // if (res2.code == 200) {
@@ -1154,7 +1258,49 @@ export default {
         return;
       }
 
-      // /lock/lockStatus
+      this.$method.checkLock().then(() => {
+        this.$http({
+          url: "/course/courseList",
+          method: "get",
+          data: {
+            pageNum: 1,
+            pageSize: 100,
+            goodsId: item.goodsId,
+            gradeId: item.gradeId,
+            orderGoodsId: item.orderGoodsId,
+          },
+          noLoading: true,
+        }).then((res) => {
+          if (res.data.code == 200) {
+            if (res.data.total > 1) {
+              // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
+              uni.navigateTo({
+                url: `/pages3/polyv/detail?id=''&goodsId=${
+                  item.goodsId
+                }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+                  item.gradeId
+                }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
+              });
+            } else if (res.data.total == 1) {
+              uni.navigateTo({
+                url: `/pages3/polyv/detail?id=${
+                  res.data.rows[0].courseId
+                }&goodsId=${item.goodsId}&orderGoodsId=${
+                  item.orderGoodsId
+                }&gradeId=${item.gradeId}&periodWaitTime=${
+                  item.periodWaitTime ? "" : 1
+                }`,
+              });
+            } else {
+              uni.showToast({
+                icon: "none",
+                title: "暂无可观看的视频课程",
+              });
+            }
+          }
+        });
+      });
+      return;
       this.$api
         .lockLockStatus({
           action: "jxjy",
@@ -1163,52 +1309,67 @@ export default {
         .then((res) => {
           if (res.data.code == 200) {
             //有其他端在操作,不能学习
-            uni.showToast({
-              icon: "none",
-              title: res.data.msg,
-              mask: true,
-              duration: 3000,
-            });
-          } else if (res.data.code == 500) {
-            //可以学习
-            this.$http({
-              url: "/course/courseList",
-              method: "get",
-              data: {
-                pageNum: 1,
-                pageSize: 100,
-                goodsId: item.goodsId,
-                gradeId: item.gradeId,
-                orderGoodsId: item.orderGoodsId,
-              },
-              noLoading: true,
-            }).then((res) => {
-              if (res.data.code == 200) {
-                if (res.data.total > 1) {
-                  // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
-                  uni.navigateTo({
-                    url: `/pages3/polyv/detail?id=''&goodsId=${
-                      item.goodsId
-                    }&orderGoodsId=${item.orderGoodsId}&gradeId=${
-                      item.gradeId
-                    }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
-                  });
-                } else if (res.data.total == 1) {
-                  uni.navigateTo({
-                    url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}&periodWaitTime=${item.periodWaitTime ? "" : 1}`,
-                  });
-                } else {
-                  uni.showToast({
-                    icon: "none",
-                    title: "暂无可观看的视频课程",
+            uni.showModal({
+              title: "提示",
+              content: "有其他端在操作,是否将该用户踢下线?",
+              success: (res) => {
+                if (res.confirm) {
+                  this.$api.offline().then((r) => {
+                    if (r.data.code === 200) {
+                      this.toDetail();
+                    }
                   });
                 }
-              }
+              },
             });
-            return;
+          } else if (res.data.code == 500) {
+            //可以学习
+            this.toDetail();
           }
         });
     },
+    toDetail() {
+      this.$http({
+        url: "/course/courseList",
+        method: "get",
+        data: {
+          pageNum: 1,
+          pageSize: 100,
+          goodsId: item.goodsId,
+          gradeId: item.gradeId,
+          orderGoodsId: item.orderGoodsId,
+        },
+        noLoading: true,
+      }).then((res) => {
+        if (res.data.code == 200) {
+          if (res.data.total > 1) {
+            // this.$navTo.togo(`/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`);
+            uni.navigateTo({
+              url: `/pages3/polyv/detail?id=''&goodsId=${
+                item.goodsId
+              }&orderGoodsId=${item.orderGoodsId}&gradeId=${
+                item.gradeId
+              }&periodWaitTime=${item.periodWaitTime ? 1 : ""}`,
+            });
+          } else if (res.data.total == 1) {
+            uni.navigateTo({
+              url: `/pages3/polyv/detail?id=${
+                res.data.rows[0].courseId
+              }&goodsId=${item.goodsId}&orderGoodsId=${
+                item.orderGoodsId
+              }&gradeId=${item.gradeId}&periodWaitTime=${
+                item.periodWaitTime ? "" : 1
+              }`,
+            });
+          } else {
+            uni.showToast({
+              icon: "none",
+              title: "暂无可观看的视频课程",
+            });
+          }
+        }
+      });
+    },
     /**
      * @param {Object} goodsId 商品id
      * 查询商品重修状态

+ 22 - 0
pages/questionBank/index.vue

@@ -198,6 +198,28 @@ export default {
       });
     },
     toDailyPractice(item, child) {
+      this.$method.checkLock("bank").then((res) => {
+        if (child.paperName == "每日一练") {
+          uni.navigateTo({
+            url:
+              "/pages2/dailyPractice/index?goodsId=" +
+              item.goodsId +
+              "&orderGoodsId=" +
+              item.orderGoodsId,
+          });
+        } else if (child.paperName == "随机练习") {
+          uni.navigateTo({
+            url:
+              "/pages2/randomPractice/index?goodsId=" +
+              item.goodsId +
+              "&orderGoodsId=" +
+              item.orderGoodsId,
+          });
+        } else {
+          this.studyques(item, child);
+        }
+      });
+      return;
       this.$api
         .lockLockStatus({
           action: "bank",

+ 7 - 2
pages/wd/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <view style="height:100%">
+  <view style="height: 100%">
     <nav-logo title="我的"></nav-logo>
     <view v-if="isLogin" class="imgs_bg">
       <view class="infos">
@@ -143,7 +143,6 @@
       </view>
       <view class="logout" @click="logout">退出</view>
     </view>
-
   </view>
 </template>
 
@@ -196,6 +195,12 @@ export default {
       });
     },
     goBank() {
+      this.$method.checkLock("bank").then((res) => {
+        uni.navigateTo({
+          url: "/pages2/wd/question_bank",
+        });
+      });
+      return;
       this.$api
         .lockLockStatus({
           action: "bank",

+ 32 - 0
pages2/learn/my_learn.vue

@@ -321,6 +321,38 @@ export default {
       //int 1.课程学习 2.预约考试 3.进入刷题 4.查看详情 5.重修目录
       if (int === 1 || int === 5) {
         // /lock/lockStatus
+        this.$method.checkLock().then((res) => {
+          this.$http({
+            url: "/course/courseList",
+            method: "get",
+            data: {
+              pageNum: 1,
+              pageSize: 100,
+              goodsId: v.goodsId,
+              gradeId: v.gradeId,
+              orderGoodsId: v.orderGoodsId,
+            },
+            noLoading: true,
+          }).then((res) => {
+            if (res.data.code == 200) {
+              if (res.data.total > 1) {
+                uni.navigateTo({
+                  url: `/pages3/polyv/detail?id=''&goodsId=${v.goodsId}&orderGoodsId=${v.orderGoodsId}&gradeId=${v.gradeId}`,
+                });
+              } else if (res.data.total == 1) {
+                uni.navigateTo({
+                  url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${v.goodsId}&orderGoodsId=${v.orderGoodsId}&gradeId=${v.gradeId}`,
+                });
+              } else {
+                uni.showToast({
+                  icon: "none",
+                  title: "暂无可观看的视频课程",
+                });
+              }
+            }
+          });
+        });
+        return;
         this.$api
           .lockLockStatus({
             action: "jxjy",

+ 28 - 6
pages2/wd/class.vue

@@ -659,8 +659,7 @@ export default {
                 uni.showModal({
                   showCancel: false,
                   title: "提示",
-                  content:
-                    "开通信息推送不成功,无法进入学习!",
+                  content: "开通信息推送不成功,无法进入学习!",
                 });
                 resolve(false);
               }
@@ -693,8 +692,7 @@ export default {
                 uni.showModal({
                   showCancel: false,
                   title: "提示",
-                  content:
-                    "开通信息推送不成功,无法进入学习!",
+                  content: "开通信息推送不成功,无法进入学习!",
                 });
               }
               this.showUserConfirmInfo = false;
@@ -798,8 +796,7 @@ export default {
           // ,请联系020-87085982
           uni.showModal({
             showCancel: false,
-            content:
-              "您的学习账号未开通,请稍后再尝试,有疑问!",
+            content: "您的学习账号未开通,请稍后再尝试,有疑问!",
           });
           return;
         }
@@ -909,6 +906,31 @@ export default {
       }
 
       // if (item.educationName == '继续教育') {
+      this.$method.checkLock("bank").then((res) => {
+        //可以学习
+        if (item.courseNum == 1) {
+          this.$api
+            .courseCourseList({
+              pageNum: 1,
+              pageSize: 1,
+              goodsId: item.goodsId,
+              gradeId: item.gradeId,
+              orderGoodsId: item.orderGoodsId,
+            })
+            .then((res) => {
+              if (res.data.code == 200) {
+                uni.navigateTo({
+                  url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}`,
+                });
+              }
+            });
+          return;
+        }
+        this.$navTo.togo(
+          `/pages2/wd/course?id=${v}&gid=${i}&orderGoodsId=${item.orderGoodsId}`
+        );
+      });
+      return;
       this.$api
         .lockLockStatus({
           action: "jxjy",

+ 51 - 26
pages2/wd/course.vue

@@ -47,7 +47,7 @@
               size="mini"
               @click.stop="jump(item, index)"
               >进入学习</u-button> -->
-            </view>
+          </view>
         </view>
       </view>
     </view>
@@ -69,30 +69,31 @@ export default {
       },
       businessData: {},
       itemIndex: "",
-      informId: '', //消息id,从公众号消息模板进来的才有
+      informId: "", //消息id,从公众号消息模板进来的才有
       options: {},
     };
   },
   onLoad(option) {
-    console.log('onload的', option)
-    this.options = option
+    console.log("onload的", option);
+    this.options = option;
     this.goodsId = Number(option.id);
     this.gradeId = Number(option.gid);
     this.orderGoodsId = Number(option.orderGoodsId);
     // 公众号模板消息的数据埋点
     if (option.informId) {
-      this.informId = option.informId
+      this.informId = option.informId;
       // this.clickOfficial()
     }
-    
+
     this.$store.getters.dictObj;
   },
   onShow(option) {
-    if (this.$method.isGoLogin()) { // 从公众号消息进来的没登录需要跳到登录页,登录后返回
+    if (this.$method.isGoLogin()) {
+      // 从公众号消息进来的没登录需要跳到登录页,登录后返回
       return;
     }
     this.courseCourseList();
-    this.informId && this.clickOfficial() // 从公众号消息点击进来上报一次
+    this.informId && this.clickOfficial(); // 从公众号消息点击进来上报一次
     if (this.itemIndex !== "") {
       this.refreshByIndex();
     }
@@ -107,14 +108,14 @@ export default {
     // 新增微信公众号模板消息点击数据
     clickOfficial() {
       this.$http({
-        url: '/data/click',
-        method: 'post',
-        data: { informId: this.informId }
+        url: "/data/click",
+        method: "post",
+        data: { informId: this.informId },
       }).then((res) => {
         if (res.data.code == 200) {
-          console.log('埋点')
+          console.log("埋点");
         }
-      })
+      });
     },
     /**
      * 返回刷新之前进入的课程数据
@@ -142,7 +143,7 @@ export default {
       });
     },
     jump(item, index) {
-      console.log('00000000')
+      console.log("00000000");
       this.itemIndex = index;
 
       if (index == 0) {
@@ -160,6 +161,14 @@ export default {
         this.$api.courseDetail(item.courseId).then((res) => {
           if (res.data.code == 200) {
             // if (res.data.data.educationName == "继续教育") {
+            this.$method.checkLock().then((res) => {
+              this.$navTo.togo("/pages3/polyv/detail", {
+                id: item.courseId,
+                goodsId: this.goodsId,
+                orderGoodsId: this.orderGoodsId,
+              });
+            });
+            return;
             this.$api
               .lockLockStatus({
                 action: "jxjy",
@@ -216,6 +225,14 @@ export default {
             this.$api.courseDetail(item.courseId).then((res) => {
               if (res.data.code == 200) {
                 // if (res.data.data.educationName == "继续教育") {
+                this.$method.checkLock().then((res) => {
+                  this.$navTo.togo("/pages3/polyv/detail", {
+                    id: item.courseId,
+                    goodsId: this.goodsId,
+                    orderGoodsId: this.orderGoodsId,
+                  });
+                });
+                return;
                 this.$api
                   .lockLockStatus({
                     action: "jxjy",
@@ -271,6 +288,14 @@ export default {
           this.$api.courseDetail(item.courseId).then((res) => {
             if (res.data.code == 200) {
               // if (res.data.data.educationName == "继续教育") {
+              this.$method.checkLock().then((res) => {
+                this.$navTo.togo("/pages3/polyv/detail", {
+                  id: item.courseId,
+                  goodsId: this.goodsId,
+                  orderGoodsId: this.orderGoodsId,
+                });
+              });
+              return;
               this.$api
                 .lockLockStatus({
                   action: "jxjy",
@@ -352,16 +377,16 @@ page {
   margin: 0 auto;
   padding: 20rpx;
   .learing_bt {
-			width: 165rpx;
-			height: 48rpx;
-			line-height: 48rpx;
-			background: #FFB102;
-			border-radius: 16rpx;
-			font-size: 24rpx;
-			font-weight: 400;
-			color: #FFFFFF;
-			text-align: center;
-		}
+    width: 165rpx;
+    height: 48rpx;
+    line-height: 48rpx;
+    background: #ffb102;
+    border-radius: 16rpx;
+    font-size: 24rpx;
+    font-weight: 400;
+    color: #ffffff;
+    text-align: center;
+  }
 }
 .content_box {
   display: flex;
@@ -386,7 +411,7 @@ page {
   padding: 20rpx 20rpx 30rpx 20rpx;
   z-index: 999;
   position: relative;
-  background: #FFFFFF;
-  box-shadow: 0px 0px 20px 1px rgba(1,99,235,0.1000);
+  background: #ffffff;
+  box-shadow: 0px 0px 20px 1px rgba(1, 99, 235, 0.1);
 }
 </style>

+ 32 - 1
pages3/course/detail.vue

@@ -1157,7 +1157,38 @@ export default {
         });
         return;
       }
-
+      this.$method.checkLock().then((res) => {
+        this.$http({
+          url: "/course/courseList",
+          method: "get",
+          data: {
+            pageNum: 1,
+            pageSize: 1,
+            goodsId: item.goodsId,
+            gradeId: item.gradeId,
+            orderGoodsId: item.orderGoodsId,
+          },
+        }).then((res) => {
+          if (res.data.code == 200) {
+            if (res.data.total > 1) {
+              // this.$navTo.togo(`/pages2/wd/course?id=${item.goodsId}&gid=${item.gradeId}&orderGoodsId=${item.orderGoodsId}`);
+              uni.navigateTo({
+                url: `/pages3/polyv/detail?id=''&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
+              });
+            } else if (res.data.total == 1) {
+              uni.navigateTo({
+                url: `/pages3/polyv/detail?id=${res.data.rows[0].courseId}&goodsId=${item.goodsId}&orderGoodsId=${item.orderGoodsId}&gradeId=${item.gradeId}`,
+              });
+            } else {
+              uni.showToast({
+                icon: "none",
+                title: "暂无可观看的视频课程",
+              });
+            }
+          }
+        });
+      });
+      return;
       // /lock/lockStatus
       this.$api
         .lockLockStatus({

+ 19 - 80
pages3/polyv/detail.vue

@@ -997,6 +997,7 @@ export default {
     if (this.$method.isGoLogin()) {
       return;
     }
+    this.closePhoto()
     this.courseCourseList();
   },
   onUnload() {
@@ -1411,32 +1412,11 @@ export default {
         this.$api.courseDetail(item.courseId).then((res) => {
           if (res.data.code == 200) {
             // if (res.data.data.educationName == "继续教育") {
-            this.$api
-              .lockLockStatus({
-                action: "jxjy",
-                uuid: this.$method.getUuid(),
-              })
-              .then((res) => {
-                if (res.data.code == 200) {
-                  //有其他端在操作,不能学习
-                  uni.showToast({
-                    icon: "none",
-                    title: res.data.msg,
-                    mask: true,
-                    duration: 3000,
-                  });
-                } else if (res.data.code == 500) {
-                  //可以学习
-                  // this.$navTo.togo("/pages3/polyv/detail", {
-                  //   id: item.courseId,
-                  //   goodsId: this.goodsId,
-                  //   orderGoodsId: this.orderGoodsId,
-                  // });
-                  this.courseId = item.courseId;
-                  this.originOnShow();
-                  this.originMounted();
-                }
-              });
+            this.$method.checkLock().then((res) => {
+              this.courseId = item.courseId;
+              this.originOnShow();
+              this.originMounted();
+            });
           }
         });
       } else {
@@ -1460,32 +1440,11 @@ export default {
             this.$api.courseDetail(item.courseId).then((res) => {
               if (res.data.code == 200) {
                 // if (res.data.data.educationName == "继续教育") {
-                this.$api
-                  .lockLockStatus({
-                    action: "jxjy",
-                    uuid: this.$method.getUuid(),
-                  })
-                  .then((res) => {
-                    if (res.data.code == 200) {
-                      //有其他端在操作,不能学习
-                      uni.showToast({
-                        icon: "none",
-                        title: res.data.msg,
-                        duration: 2000,
-                      });
-                    } else if (res.data.code == 500) {
-                      //可以学习
-
-                      // this.$navTo.togo("/pages3/polyv/detail", {
-                      //   id: item.courseId,
-                      //   goodsId: this.goodsId,
-                      //   orderGoodsId: this.orderGoodsId,
-                      // });
-                      this.courseId = item.courseId;
-                      this.originOnShow();
-                      this.originMounted();
-                    }
-                  });
+                this.$method.checkLock().then((res) => {
+                  this.courseId = item.courseId;
+                  this.originOnShow();
+                  this.originMounted();
+                });
               }
             });
           } else {
@@ -1510,31 +1469,11 @@ export default {
           this.$api.courseDetail(item.courseId).then((res) => {
             if (res.data.code == 200) {
               // if (res.data.data.educationName == "继续教育") {
-              this.$api
-                .lockLockStatus({
-                  action: "jxjy",
-                  uuid: this.$method.getUuid(),
-                })
-                .then((res) => {
-                  if (res.data.code == 200) {
-                    //有其他端在操作,不能学习
-                    uni.showToast({
-                      icon: "none",
-                      title: res.data.msg,
-                      duration: 2000,
-                    });
-                  } else if (res.data.code == 500) {
-                    //可以学习
-                    // this.$navTo.togo("/pages3/polyv/detail", {
-                    //   id: item.courseId,
-                    //   goodsId: this.goodsId,
-                    //   orderGoodsId: this.orderGoodsId,
-                    // });
-                    this.courseId = item.courseId;
-                    this.originOnShow();
-                    this.originMounted();
-                  }
-                });
+              this.$method.checkLock().then((res) => {
+                this.courseId = item.courseId;
+                this.originOnShow();
+                this.originMounted();
+              });
             }
           });
         }
@@ -1649,7 +1588,7 @@ export default {
         });
     },
     async initPlayVideo(sectionItem) {
-      console.log(sectionItem,'this.sectionItem',this.menuList)
+      console.log(sectionItem, "this.sectionItem", this.menuList);
       this.moduleId = sectionItem.moduleId;
       this.chapterId = sectionItem.chapterId;
       this.sectionItem = sectionItem;
@@ -1723,13 +1662,13 @@ export default {
         })
         .then((res) => {
           let { data } = res.data;
-          console.log(data,789)
+          console.log(data, 789);
           if (!data.sectionId) {
             data = this.menuAllList[0];
           } else {
             if (data.learning == 1 && this.orderNum == 2) {
               let next = this.menuAllList.find((e) => e.studyStatus != 1);
-              console.log(next,789)
+              console.log(next, 789);
               next && (data = next);
             }
           }

+ 14 - 0
static/style/index.scss

@@ -14,3 +14,17 @@
   align-items: center;
   justify-content: center;
 }
+
+.line1 {
+  overflow: hidden; /*超出部分隐藏*/
+  white-space: nowrap; /*禁止换行*/
+  text-overflow: ellipsis; /*省略号*/
+}
+
+.line2 {
+  display: -webkit-box; /* 必须结合的属性 ,将对象作为弹性伸缩盒子模型显示 。*/
+  -webkit-box-orient: vertical; /* 必须结合的属性 ,设置或检索伸缩盒对象的子元素的排列方式 。*/
+  text-overflow: ellipsis; /* 可以用来多行文本的情况下,用省略号“…”隐藏超出范围的文本 。*/
+  -webkit-line-clamp: 2;
+  overflow: hidden;
+}

Some files were not shown because too many files changed in this diff