浏览代码

fix:模考和智慧考试

xuqiaoying 3 年之前
父节点
当前提交
999beedab1
共有 5 个文件被更改,包括 50 次插入44 次删除
  1. 2 2
      common/request.js
  2. 4 5
      pages2/appointment/order.vue
  3. 34 34
      pages2/exam/signCommit.vue
  4. 4 2
      pages5/exam/index.vue
  5. 6 1
      pages5/examList/index.vue

+ 2 - 2
common/request.js

@@ -6,11 +6,11 @@ var num = 1
 //接口api   
 // export const BASE_URL = 'https://api.xyyxt.net'   //release
 // export const BASE_URL = 'https://test.xyyxt.net'   //预发布
-// export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
+export const BASE_URL = 'http://120.79.166.78:19012' // 测试环境
 // export const BASE_URL = 'http://42.192.164.187:19005'    //test(后端本地)
 // export const BASE_URL = 'http://192.168.1.222:5055'    //后端本地更新到222
 // export const BASE_URL = 'http://192.168.1.24:5055'    //后端本地
-export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
+// export const BASE_URL = 'http://192.168.1.7:5055'    //后端本地
 
  //图片上传api
 // export const BASE_IMG_URL = 'https://file.xyyxt.net/'     //release

+ 4 - 5
pages2/appointment/order.vue

@@ -323,10 +323,10 @@ export default {
                 title: "请签名",
                 icon: "none",
               })
+              this.isUploading = false
               return
             } else {
               // await this.submitApi()
-              if (this.commitment_electr_signature) {
                 uni.request({
                   url: this.commitment_electr_signature, //临时路径
                   responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
@@ -338,9 +338,9 @@ export default {
                   },
                   fail: err => {
                     console.log(err)
+                    this.isUploading = false
                   }
                 })
-              }
             }
           } else {
             this.submits()
@@ -437,7 +437,6 @@ export default {
         this.handwriting.saveCanvas().then((res) => {
             if (this.handwriting.linePrack.length) {
               console.log('签名-----res', res)
-              // this.$set(this.form, "commitment_electr_signature", res);
               this.commitment_electr_signature = res
             }
             resolve(res)
@@ -447,9 +446,9 @@ export default {
               title: "签名上传失败",
               icon: "error",
             });
-
+            this.isUploading = false
           });
-          this.isUploading = false
+          
       });
     },
      //提交表单

+ 34 - 34
pages2/exam/signCommit.vue

@@ -136,40 +136,40 @@ export default {
             this.isUploading = false
             return
         } else {
-            if (this.commitment_electr_signature) {
-                uni.request({
-                    url: this.commitment_electr_signature, //临时路径
-                    responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
-                    success: res => {
-                        const base64 = "data:image/jpeg;base64," + uni.arrayBufferToBase64(res.data)
-                        console.log('sfs签名转成base64', base64)
-                        this.baseAddress = base64
-                        // return
-                        this.$http({
-                            url: '/apply/signReport',
-                            method: 'post',
-                            data: {
-                                signImageStr: this.baseAddress,
-                                subscribeId: this.subscribeId,
-                            }
-                        }).then((res) => {
-                            console.log('res', res)
-                            if (res.data.data == 200) {
-                                this.$u.toast('签署成功')
-                                uni.navigateBack()
-                            } else {
-                                this.$u.toast(res.data.msg)
-                            }
-                        }).catch((err) => {
-                            this.$u.toast('签署失败,请重新签署')
-                        })
-                    },
-                    fail: err => {
-                        console.log(err)
-                    }
-                })
-                this.isUploading = false
-            }
+            uni.request({
+                url: this.commitment_electr_signature, //临时路径
+                responseType: 'arraybuffer', //设置返回的数据格式为arraybuffer
+                success: res => {
+                    const base64 = "data:image/jpeg;base64," + uni.arrayBufferToBase64(res.data)
+                    console.log('sfs签名转成base64', base64)
+                    this.baseAddress = base64
+                    this.$http({
+                        url: '/apply/signReport',
+                        method: 'post',
+                        data: {
+                            signImageStr: this.baseAddress,
+                            subscribeId: this.subscribeId,
+                        }
+                    }).then((res) => {
+                        console.log('res', res)
+                        if (res.data.data == 200) {
+                            this.$u.toast('签署成功')
+                            uni.navigateBack()
+                        } else {
+                            this.$u.toast(res.data.msg)
+                        }
+                        this.isUploading = false
+                    }).catch((err) => {
+                        this.$u.toast('签署失败,请重新签署')
+                        this.isUploading = false
+                    })
+                },
+                fail: err => {
+                    console.log(err)
+                    this.isUploading = false
+                }
+            })
+                
         }
       },
     },

+ 4 - 2
pages5/exam/index.vue

@@ -44,11 +44,13 @@ export default {
 		};
 	},
 	onLoad(){
-		this.getCount()
-		this.mockApplyMockLiving();
+		// this.getCount()
+		// this.mockApplyMockLiving();
 	},
 	onShow() {
 		// this.getInfo()
+		this.getCount()
+		this.mockApplyMockLiving();
 	},
 	methods: {
 		goLive() {

+ 6 - 1
pages5/examList/index.vue

@@ -43,7 +43,9 @@
 						<view class="btn-wrap">
 							<view class="btn-line">
 								<!-- mockActivity 1是活动模考,0否 && (!item.handStatus || item.handStatus == 0)-->
-								<view v-if="item.mockActivity == 1 && (!item.handStatus || item.handStatus == 0) " class="btn" @click="goExamCount(item,index)">去考试</view>
+								<view v-if="item.mockActivity == 1 && (!item.handStatus || item.handStatus == 0) " class="btn"
+									:class="{'test-disabled': item.activityStartTime < nowTime }"
+								 	@click="goExamCount(item,index)">去考试</view>
 								<view v-else>
 								<view class="btn test-disabled" v-if="goTest(item)" @click="goExamCount(item,index)">去考试</view>
 								<view class="btn test-disabled"  v-else-if="item.handStatus">已考试</view>
@@ -342,6 +344,9 @@ export default {
 		async goExamCount(item,index) {
 			console.log('item', item)
 			if (item.mockActivity && item.mockActivity == 1) {
+				if (item.activityStartTime < this.nowTime) {
+					return
+				}
 				await this.$http({
 					url: '/mock/apply/addMockTime',
 					method: 'post',