Browse Source

检测接口更改

谢杰标 2 years ago
parent
commit
5831bf06de
3 changed files with 20 additions and 19 deletions
  1. 3 1
      components/course/handoutsTree.vue
  2. 2 2
      pages/webview/sdlink.vue
  3. 15 16
      pages3/polyv/detail.vue

+ 3 - 1
components/course/handoutsTree.vue

@@ -70,6 +70,9 @@ export default {
       let url = this.$method.splitImgHost(this.fileInfo.url);
       // #ifdef H5
       window.location.href = url;
+      //   uni.navigateTo({
+      //     url: `/pages/webview/sdlink?url=` + url,
+      //   });
       // #endif
       // #ifdef MP-WEIXIN
       this.downLoading = true;
@@ -80,7 +83,6 @@ export default {
           // h5不支持
           uni.openDocument({
             filePath: filePath,
-            fileType: "pdf",
             showMenu: this.canDownload == 1 ? true : false,
             success: (res) => {
               this.downLoading = false;

+ 2 - 2
pages/webview/sdlink.vue

@@ -18,9 +18,9 @@ export default {
   },
   onLoad(option) {
     this.url = option.url;
+    console.log(this.url, "123");
   },
 };
 </script>
 
-<style>
-</style>
+<style></style>

+ 15 - 16
pages3/polyv/detail.vue

@@ -956,9 +956,9 @@ export default {
     option.informId && this.clickOfficial(option.informId);
   },
   async onShow() {
-    if(uni.getStorageSync('nofresh')){
-      uni.removeStorageSync('nofresh')
-      return
+    if (uni.getStorageSync("nofresh")) {
+      uni.removeStorageSync("nofresh");
+      return;
     }
     if (this.option.skipPort) {
       await this.$method.skipLogin(this.option.skipPort);
@@ -3428,19 +3428,19 @@ export default {
       return this.$api
         .checkFinishRequiredCourse({
           businessId: this.goodsData.businessId,
+          goodsId: this.goodsId,
         })
         .then((res) => {
-          if (res.data.data == 0) {
-            // uni.showModal({
-            //   showCancel: false,
-            //   confirmText: "确定",
-            //   content:
-            //     "请先学完必修课程!",
-            //   success: function (resultst) {
-            //     uni.navigateBack();
-            //   },
-            // });
-            // return Promise.reject()
+          if (res.data.data > 0) {
+            uni.showModal({
+              showCancel: false,
+              confirmText: "确定",
+              content: "该业务层次下有未学完的商品,无法学习新商品!",
+              success: function (resultst) {
+                uni.navigateBack();
+              },
+            });
+            return Promise.reject();
           }
           return Promise.resolve();
         });
@@ -3450,8 +3450,7 @@ export default {
       // '/goods/'+ data,
       this.$api.goodsDetail(this.goodsId).then(async (res) => {
         this.goodsData = res.data.data;
-        this.goodsData.categoryName != "必修" &&
-          (await this.checkFinishRequiredCourse());
+        await this.checkFinishRequiredCourse();
         if (self.goodsData.buyNote) {
           this.baseHandoutTipList();
         }