chenxiong 3 лет назад
Родитель
Сommit
831beab46b

+ 8 - 0
src/apis/bank.js

@@ -270,4 +270,12 @@ export default {
 			method: 'GET',
 		})
 	},
+
+  bankQuestionListFreeGoodsList(data) {
+		return request({
+			url: '/bank/question/listFreeGoodsList',
+			method: 'get',
+			params: data
+		})
+	}
 }

+ 10 - 0
src/apis/common.js

@@ -286,5 +286,15 @@ export default {
 			noToken: true
 		})
 	},
+	appCommonGoodsCourseModuleFreeExamList(data) {
+		return request({
+			url: '/app/common/goods/course/moduleFreeExamList/'+data,
+			method: 'get',
+			noToken:true
+			
+		})
+	}
+
+  
 
 }

+ 8 - 0
src/apis/profileTp.js

@@ -93,4 +93,12 @@ export default {
 		})
 	},
 
+  baseProfileStampV2AddWord(data) {
+		return request({
+			url: '/base/profileStamp/V2/addWord',
+			method: 'post',
+			data: data
+		})
+	}
+
 }

+ 4 - 4
src/axios.js

@@ -1,13 +1,13 @@
 import axios from 'axios'
 import store from './store'
-export const BASE_URL = 'https://api.xyyxt.net'   //release
-// export const BASE_URL = 'http://42.192.164.187:19005'    //test
+// export const BASE_URL = 'https://api.xyyxt.net'   //release
+export const BASE_URL = 'http://42.192.164.187:19005'    //test
 export const tenantId = '867735392558919680'
 
 
 //图片上传api
-export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release
-// export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
+// export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release
+export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'  //test
 
 import tools from './common/tools'
 import router from './router'

+ 154 - 3
src/pages/course-detail/index.vue

@@ -2051,6 +2051,64 @@
                 </div>
               </el-form-item>
             </div>
+            <el-form-item
+              :key="index"
+              v-if="item.inputType == 4"
+              :label="item.fieldName"
+              :required="item.required"
+              label-width="120px"
+              label-position="top"
+              :prop="item.required ? item.fieldKey : ''"
+            >
+              <el-button
+                type="primary"
+                size="small"
+                round
+                @click="downloadStamp(item)"
+                >下载模板</el-button
+              >
+              <el-upload
+                action=""
+                :max-size="2097152"
+                accept="image/jpeg, image/jpg, image/png"
+                :show-file-list="false"
+                list-type="picture"
+                :auto-upload="false"
+                ref="stamp"
+                :on-change="changePhotoListStamp"
+                :file-list="fileListStamp"
+              >
+                <div style="display: inline-block; vertical-align: top">
+                  <div
+                    :style="
+                      'width: 120px; height: 120px;background:url(' +
+                      require('@/assets/info_4.png') +
+                      ') no-repeat center;background-size:cover;position:relative;'
+                    "
+                  >
+                    <el-image
+                      style="width: 100%; height: 100%"
+                      :src="$tools.splitImgHost(fileListStamp[0].url)"
+                      v-if="fileListStamp[0]"
+                      :preview-src-list="[
+                        $tools.splitImgHost(fileListStamp[0].url),
+                      ]"
+                    >
+                    </el-image>
+                  </div>
+
+                  <div>
+                    <span style="color: #999999">文件大小≤2M</span>
+                  </div>
+                </div>
+
+                <div style="display: inline-block" slot="trigger">
+                  <el-button type="primary" size="small" round
+                    >浏览文件</el-button
+                  >
+                </div>
+              </el-upload>
+            </el-form-item>
           </template>
         </el-form>
       </div>
@@ -2351,6 +2409,7 @@ export default {
         idcard_face_photo: "",
         idcard_national_photo: "",
         commitment_electr_signature: "",
+        commitment_seal: "",
       },
       recommendList: [],
       rules: {
@@ -2519,6 +2578,13 @@ export default {
             trigger: ["change", "blur"],
           },
         ],
+        commitment_seal: [
+          {
+            required: true,
+            message: "请上传承诺书盖章",
+            trigger: ["change", "blur"],
+          },
+        ],
       },
 
       stampRules: {
@@ -3120,9 +3186,90 @@ export default {
       this.uploadDatas(data);
     },
 
-    downloadStamp(item) {
+    async downloadStamp(item) {
+      let self = this;
+
+      var ast = this.listData.some((item) => {
+        return item.fieldKey === "commitment_electr_signature";
+      });
+      if (ast) {
+        await this.subCanvas();
+      }
+
+      let data = JSON.parse(JSON.stringify(this.infoForm));
+      if (data["sex"]) {
+        data.sex = this.dictObj["sys_user_sex"][Number(data.sex)];
+      }
+      if (data["education"]) {
+        data.education = this.dictObj["edu_level"][Number(data.education)];
+      }
+      if (data["working_years"]) {
+        data.working_years =
+          this.dictObj["working_years"][Number(data.working_years)];
+      }
+
+      console.log(data, "data");
+
+      if (this.remarkStatus) {
+        var arsty = {};
+        for (let k in data) {
+          for (let j in self.copyData) {
+            if (k === j) {
+              if (self.copyData[j].value === data[k]) {
+                arsty[k] = {
+                  fieldKey: k,
+                  value: data[k],
+                  fieldName: (function () {
+                    for (let i = 0; i < self.listData.length; i++) {
+                      if (self.listData[i].fieldKey == k) {
+                        return self.listData[i].fieldName;
+                      }
+                    }
+                  })(),
+                  status: 0,
+                };
+              } else {
+                arsty[k] = {
+                  fieldKey: k,
+                  value: data[k],
+                  fieldName: (function () {
+                    for (let i = 0; i < self.listData.length; i++) {
+                      if (self.listData[i].fieldKey == k) {
+                        return self.listData[i].fieldName;
+                      }
+                    }
+                  })(),
+                  status: 1,
+                };
+              }
+            }
+          }
+        }
+      } else {
+        var arsty = {};
+        for (let k in data) {
+          arsty[k] = {
+            fieldKey: k,
+            value: data[k],
+            fieldName: (function () {
+              for (let i = 0; i < self.listData.length; i++) {
+                if (self.listData[i].fieldKey == k) {
+                  return self.listData[i].fieldName;
+                }
+              }
+            })(),
+            status: 0,
+          };
+        }
+      }
+
+      console.log(arsty, "arsty");
+
       this.$request
-        .addWordbaseprofileStamp({ goodsId: this.goodsId })
+        .baseProfileStampV2AddWord({
+          goodsId: this.goodsId,
+          keyValue: JSON.stringify(arsty),
+        })
         .then((res) => {
           let url = this.$tools.splitImgHost(res.msg);
           let name = res.msg.substring(res.msg.lastIndexOf("/") + 1);
@@ -3791,7 +3938,11 @@ export default {
       var self = this;
       this.$request.getbaseprofiletpId(this.goodsId).then((res) => {
         console.log(res, "res");
-        self.listData = JSON.parse(res.data.keyValue);
+        var listData = JSON.parse(res.data.keyValue);
+        var ast = JSON.parse(res.data.keyValue2);
+        self.listData = [...listData, ...ast];
+
+        console.log(self.listData, "self.listData");
 
         self.listData.forEach((item) => {
           if (item.fieldKey == "idcard") {

+ 55 - 0
src/pages/goods-detail/course-detail.vue

@@ -287,6 +287,50 @@
                       "
                     ></div>
                   </el-tab-pane>
+                  <el-tab-pane
+                    label="赠送题卷"
+                    name="4"
+                    v-if="freeMenuList.length > 0"
+                  >
+                    <div class="goods-menu clearfix">
+                      <div class="left-box">
+                        <div class="left-box__body">
+                          <div
+                            class="course-list-item"
+                            v-for="(course, index) in freeMenuList"
+                            :key="index"
+                          >
+                            <div class="item__content">
+                              <div class="bank-section">
+                                <div class="bank-section__item">
+                                  <div class="bank-section__item__text">
+                                    {{ course.freeExamName }}
+                                  </div>
+                                </div>
+                              </div>
+                            </div>
+                          </div>
+                        </div>
+                      </div>
+                      <div class="right-box">
+                        <div class="title" v-if="recommendList.goodsList">
+                          推荐课程
+                          <a class="more" @click="comeMoreList">更多></a>
+                        </div>
+                        <ul class="list" v-if="recommendList.goodsList">
+                          <li
+                            class="course-item"
+                            v-for="(itemy, index) in compyRecommend(
+                              recommendList.goodsList
+                            )"
+                            :key="index"
+                          >
+                            <GoodsItem :item="itemy"></GoodsItem>
+                          </li>
+                        </ul>
+                      </div>
+                    </div>
+                  </el-tab-pane>
                 </el-tabs>
               </div>
             </div>
@@ -523,12 +567,14 @@ export default {
       recommendList: {}, //推荐课程
       needOpen: true, //是否需要一进来展开第一章节
       menuIndex: [], //需要展开的章节索引值
+      freeMenuList: [], //赠送题卷列表
     };
   },
   mounted() {
     this.goodsId = this.$route.params.goodsId;
     this.getGoodsDetail();
     this.goodsCourseList();
+    this.appCommonGoodsCourseModuleFreeExamList();
     if (this.$tools.isLogin()) {
       this.getProvinceList();
     }
@@ -552,6 +598,15 @@ export default {
   },
   methods: {
     ...mapMutations(["setCurrentRouter", "getCartCount"]),
+    appCommonGoodsCourseModuleFreeExamList() {
+      this.$request
+        .appCommonGoodsCourseModuleFreeExamList(this.goodsId)
+        .then((res) => {
+          if (res.data.length) {
+            this.freeMenuList = res.data;
+          }
+        });
+    },
     toGoodsDetail(item) {
       this.$router.push({
         path: "/course-detail/" + item.goodsId,

+ 3 - 0
src/pages/person-center/index.vue

@@ -41,6 +41,9 @@
                 <router-link to="/person-center/my-bank">
                   <div class="item">自购题卷</div>
                 </router-link>
+                <router-link to="/person-center/free-bank">
+                  <div class="item">赠送题卷</div>
+                </router-link>
                 <router-link to="/person-center/bank-record">
                   <div class="item">做题记录</div>
                 </router-link>

+ 3 - 3
src/pages/person-center/my-bank/index/index.vue

@@ -258,13 +258,13 @@ export default {
               color: #333333;
 
               &-line {
-                width: 250px;
+                width: 220px;
                 display: inline-block;
               }
 
               /deep/ .el-progress-bar {
-                padding-right: 100px;
-                margin-right: -100px;
+                padding-right: 70px;
+                margin-right: -70px;
               }
             }
           }

+ 1 - 1
src/pages/person-center/my-order/index.vue

@@ -144,7 +144,7 @@
               </div>
               <div class="refund-wrap">
                 <div class="btns">
-                  <template v-if="!item.wxpay_refund_id"> 退款失败 </template>
+                  <template v-if="!item.wxpayRefundId"> 退款失败 </template>
                   <template v-else>
                     <div class="price-text">已退款</div>
                     <div class="price-number">¥{{ item.refundFee }}</div>

+ 1 - 1
src/pages/subject/collect-bank.vue

@@ -1042,7 +1042,7 @@ export default {
       this.$request
         .collectQuestionExamQuestionList({
           examId: this.examId,
-          orderGoodsId: this.orderGoodsId,
+          // orderGoodsId: this.orderGoodsId,
         })
         .then(async (res) => {
           res.rows.forEach((item, index) => {

+ 160 - 129
src/router/index.js

@@ -6,7 +6,7 @@ import { Notification, MessageBox, Message } from 'element-ui'
 import tools from '../common/tools'
 Vue.use(Router)
 
-let bankAdmin = ['/person-center/bank-record','/person-center/my-bank/index','/person-center/my-collect','/person-center/my-wrong','/person-center/my-bank/bank-detail/','/person-center/my-bank/bank-statistics/','/person-center/my-bank/bank-explain-detail/','/bank-exam-continue/','/bank-exam/','/subject/collect-bank/','/bank-exam-explain/','/bank-report/'];
+let bankAdmin = ['/person-center/bank-record','/person-center/my-bank/index','/person-center/free-bank/index','/person-center/my-collect','/person-center/my-wrong','/person-center/my-bank/bank-detail/','/person-center/my-bank/bank-statistics/','/person-center/my-bank/bank-explain-detail/','/person-center/free-bank/bank-detail/','/person-center/free-bank/bank-statistics/','/person-center/free-bank/bank-explain-detail/','/bank-exam-continue/','/bank-exam/','/subject/collect-bank/','/bank-exam-explain/','/bank-report/'];
 let canToBank = null;
 let courseAdmin = ['/my-course-detail/','/course-exam/']
 let canToCourse = null;
@@ -327,7 +327,7 @@ const router =  new Router({
         {
           path: 'my-bank',
           component: resolve => require(['@/pages/person-center/my-bank/index'],resolve),
-          name:'我的题库',
+          name:'自购题卷',
           children:[
             {
               path: '/',
@@ -336,7 +336,7 @@ const router =  new Router({
             {
               path: 'index',
               component: resolve => require(['@/pages/person-center/my-bank/index/index'],resolve),
-              name: '我的题库',
+              name: '自购题卷',
             },
             {
               path: 'bank-detail/:goodsId',
@@ -355,6 +355,37 @@ const router =  new Router({
             },
           ]
         },
+        {
+          path: 'free-bank',
+          component: resolve => require(['@/pages/person-center/free-bank/index'],resolve),
+          name:'赠送题卷',
+          children:[
+            {
+              path: '/',
+              redirect: 'index',
+            },
+            {
+              path: 'index',
+              component: resolve => require(['@/pages/person-center/free-bank/index/index'],resolve),
+              name: '赠送题卷',
+            },
+            {
+              path: 'bank-detail/:goodsId',
+              component: resolve => require(['@/pages/person-center/free-bank/bank-detail/index'],resolve),
+              name: '题库详情'
+            },
+            {
+              path: 'bank-statistics/:goodsId',
+              component: resolve => require(['@/pages/person-center/free-bank/bank-statistics/index'],resolve),
+              name: '做题统计'
+            },
+            {
+              path: 'bank-explain-detail/:goodsId',
+              component: resolve => require(['@/pages/person-center/free-bank/bank-explain-detail/index'],resolve),
+              name: '详情'
+            },
+          ]
+        },
         {
           path: 'bank-record',
           component: resolve => require(['@/pages/person-center/bank-record/index'],resolve),
@@ -491,155 +522,155 @@ router.beforeEach((to,from,next) => {
         store.dispatch('getUserInfo')
       }
 
-      // //题库页面要检测是否需要锁定
-      let isBankLock = bankAdmin.some(item => {
-        return to.path.indexOf(item) != -1
-      })
-      console.log(isBankLock,'isBankLock')
-      if(isBankLock) {
+      // // //题库页面要检测是否需要锁定
+      // let isBankLock = bankAdmin.some(item => {
+      //   return to.path.indexOf(item) != -1
+      // })
+      // console.log(isBankLock,'isBankLock')
+      // if(isBankLock) {
         
-        //没有执行定时器,开启锁定
-        if(!canToBank) {
-          request
-            .lockLockStatus({
-              action: "bank",
-              uuid:tools.getUuid()
-            })
-            .then((res) => {
-              //有其他端在操作,不能学习
-              Message({
-                type: "warning",
-                message: res.msg,
-              });
+      //   //没有执行定时器,开启锁定
+      //   if(!canToBank) {
+      //     request
+      //       .lockLockStatus({
+      //         action: "bank",
+      //         uuid:tools.getUuid()
+      //       })
+      //       .then((res) => {
+      //         //有其他端在操作,不能学习
+      //         Message({
+      //           type: "warning",
+      //           message: res.msg,
+      //         });
               
-              if(from.path=='/') {
-                next('/')
-              }
+      //         if(from.path=='/') {
+      //           next('/')
+      //         }
 
-            }).catch(err => {
-              //可以学习,开启锁定
-                canToBank = 1;
-              request.lockLockAction({
-                action:'bank',
-                uuid:tools.getUuid()
-              }).then(res => {
-              })
-              canToBank = setInterval(() => {
-                request.lockLockAction({
-                  action:'bank',
-                  uuid:tools.getUuid()
-                }).then(res => {
+      //       }).catch(err => {
+      //         //可以学习,开启锁定
+      //           canToBank = 1;
+      //         request.lockLockAction({
+      //           action:'bank',
+      //           uuid:tools.getUuid()
+      //         }).then(res => {
+      //         })
+      //         canToBank = setInterval(() => {
+      //           request.lockLockAction({
+      //             action:'bank',
+      //             uuid:tools.getUuid()
+      //           }).then(res => {
                   
-                })
-              }, 10000);
-              next()
-            })
+      //           })
+      //         }, 10000);
+      //         next()
+      //       })
 
-            return;
-        } else {
-          //正在执行定时器,可以直接进入
-          next()
-        }
+      //       return;
+      //   } else {
+      //     //正在执行定时器,可以直接进入
+      //     next()
+      //   }
         
-        return;
-      } else {
-        //从题库页面离开删除锁定
+      //   return;
+      // } else {
+      //   //从题库页面离开删除锁定
 
-        let isLeaveBank = bankAdmin.some(item => {
-          return from.path.indexOf(item) != -1
-        })
+      //   let isLeaveBank = bankAdmin.some(item => {
+      //     return from.path.indexOf(item) != -1
+      //   })
 
-        if(isLeaveBank) {
+      //   if(isLeaveBank) {
           
-          clearInterval(canToBank)
-          canToBank = null;
-          request.lockDelLock({
-            action:'bank',
-            uuid:tools.getUuid()
-          }).then(res => {
+      //     clearInterval(canToBank)
+      //     canToBank = null;
+      //     request.lockDelLock({
+      //       action:'bank',
+      //       uuid:tools.getUuid()
+      //     }).then(res => {
             
-          })
-        }
-      }
+      //     })
+      //   }
+      // }
       
-      let isCourseLock = courseAdmin.some(item => {
-        return to.path.indexOf(item) != -1
-      })
+      // let isCourseLock = courseAdmin.some(item => {
+      //   return to.path.indexOf(item) != -1
+      // })
 
-      console.log(isCourseLock,'isCourseLock')
-      if(isCourseLock) {
+      // console.log(isCourseLock,'isCourseLock')
+      // if(isCourseLock) {
         
-        //没有执行定时器,开启锁定
-        if(!canToCourse) {
+      //   //没有执行定时器,开启锁定
+      //   if(!canToCourse) {
           
-          request.goodsDetail(to.params.goodsId).then(res => {
-            //继续教育锁定
-            if(res.data.educationName == '继续教育') {
-              request
-                .lockLockStatus({
-                  action: "jxjy",
-                  uuid:tools.getUuid()
-                })
-                .then((res) => {
-                  //有其他端在操作,不能学习
-                  Message({
-                    type: "warning",
-                    message: res.msg,
-                  });
+      //     request.goodsDetail(to.params.goodsId).then(res => {
+      //       //继续教育锁定
+      //       if(res.data.educationName == '继续教育') {
+      //         request
+      //           .lockLockStatus({
+      //             action: "jxjy",
+      //             uuid:tools.getUuid()
+      //           })
+      //           .then((res) => {
+      //             //有其他端在操作,不能学习
+      //             Message({
+      //               type: "warning",
+      //               message: res.msg,
+      //             });
                   
-                  if(from.path=='/') {
-                    next('/')
-                  }
+      //             if(from.path=='/') {
+      //               next('/')
+      //             }
 
-                }).catch(err => {
-                  //可以学习,开启锁定
-                  canToCourse = 1;
-                  request.lockLockAction({
-                    action:'jxjy',
-                    uuid:tools.getUuid()
-                  }).then(res => {
-                  })
-                  canToCourse = setInterval(() => {
-                    request.lockLockAction({
-                      action:'jxjy',
-                      uuid:tools.getUuid()
-                    }).then(res => {
+      //           }).catch(err => {
+      //             //可以学习,开启锁定
+      //             canToCourse = 1;
+      //             request.lockLockAction({
+      //               action:'jxjy',
+      //               uuid:tools.getUuid()
+      //             }).then(res => {
+      //             })
+      //             canToCourse = setInterval(() => {
+      //               request.lockLockAction({
+      //                 action:'jxjy',
+      //                 uuid:tools.getUuid()
+      //               }).then(res => {
                       
-                    })
-                  }, 10000);
-                  next()
-                })
-            } else {
-              next()
-            }
-          })
+      //               })
+      //             }, 10000);
+      //             next()
+      //           })
+      //       } else {
+      //         next()
+      //       }
+      //     })
           
 
-            return;
-        } else {
-          //正在执行定时器,可以直接进入
-          next()
-        }
+      //       return;
+      //   } else {
+      //     //正在执行定时器,可以直接进入
+      //     next()
+      //   }
         
-        return;
-      } else {
-        //非题库页面删除锁定
-        let isLeaveCouese = courseAdmin.some(item => {
-          return from.path.indexOf(item) != -1
-        })
+      //   return;
+      // } else {
+      //   //非题库页面删除锁定
+      //   let isLeaveCouese = courseAdmin.some(item => {
+      //     return from.path.indexOf(item) != -1
+      //   })
 
-        if(isLeaveCouese) {
+      //   if(isLeaveCouese) {
           
-          clearInterval(canToCourse)
-          canToCourse = null;
-          request.lockDelLock({
-            action:'jxjy',
-            uuid:tools.getUuid()
-          }).then(res => {
+      //     clearInterval(canToCourse)
+      //     canToCourse = null;
+      //     request.lockDelLock({
+      //       action:'jxjy',
+      //       uuid:tools.getUuid()
+      //     }).then(res => {
             
-          })
-        }
-      }
+      //     })
+      //   }
+      // }
       
       next()
     } else {