Kaynağa Gözat

Merge branch 'dev' into xqy_h5

谢杰标 2 yıl önce
ebeveyn
işleme
e74b48228b

+ 1 - 0
common/config.js

@@ -10,6 +10,7 @@ const test = {
     version: '1.0.2',
     TOP_LOGO: '/static/logo2.png',
     SCAN_LOGO: '/static/me/logo.png',
+    tenantName: '祥粤云学堂',
 }
 const index = 0 // 测试环境
 // const index = 1 // 祥粤云学堂

+ 3 - 2
common/httpList/goods.js

@@ -320,8 +320,9 @@ export default {
 
 	examWrongRecordWrongNum(data) {
 		return myRequest({
-			url: `/exam/wwrong/record/wrongNum/${data}`,
-			method: 'get'
+			url: `/exam/wwrong/record/wrongNum`,
+			method: 'get',
+			data
 		})
 	},
 

+ 497 - 437
common/methodTool.js

@@ -1,443 +1,503 @@
-import store from '@/store/index.js'
-import config from '@/common/config'
-import api from '@/common/api.js'
+import store from "@/store/index.js";
+import config from "@/common/config";
+import api from "@/common/api.js";
 
 export default {
-	isGoLogin(isBack = true) {
-		if (!uni.getStorageSync('user_account')) {
-			uni.navigateTo({
-				url: '/pages4/login/login?isBack=' + isBack
-			});
-			return true;
-		} else {
-			return false
-		}
-	},
-	isLogin() {
-		if (uni.getStorageSync('user_account')) {
-			return true;
-		} else {
-			return false
-		}
-	},
-	isLogout() {
-		// uni.removeStorageSync('user_account')
-		// uni.removeStorageSync('token')
-	},
-	//提示
-	showToast(title, icon = 'none', time = 2000) {
-		return setTimeout(() => {
-			uni.showToast({
-				title: title,
-				icon: icon,
-				duration: time
-			})
-		}, 500)
-	},
-	//图片路径填补
-	splitImgHost(url, scale = false, width = 250) {
-		if (!url) {
-			return ''
-		} else if (url.indexOf("http") != -1 || url.indexOf("https") != -1 || url.indexOf("wxfile") != -1) {
+  isGoLogin(isBack = true) {
+    if (!uni.getStorageSync("user_account")) {
+      uni.navigateTo({
+        url: "/pages4/login/login?isBack=" + isBack,
+      });
+      return true;
+    } else {
+      return false;
+    }
+  },
+  isLogin() {
+    if (uni.getStorageSync("user_account")) {
+      return true;
+    } else {
+      return false;
+    }
+  },
+  isLogout() {
+    // uni.removeStorageSync('user_account')
+    // uni.removeStorageSync('token')
+  },
+  //提示
+  showToast(title, icon = "none", time = 2000) {
+    return setTimeout(() => {
+      uni.showToast({
+        title: title,
+        icon: icon,
+        duration: time,
+      });
+    }, 500);
+  },
+  //图片路径填补
+  splitImgHost(url, scale = false, width = 250) {
+    if (!url) {
+      return "";
+    } else if (
+      url.indexOf("http") != -1 ||
+      url.indexOf("https") != -1 ||
+      url.indexOf("wxfile") != -1
+    ) {
+    } else {
+      url = config.BASE_IMG_URL + url;
+    }
+    if (scale) {
+      url = url + "?x-oss-process=image/resize,w_" + width;
+    }
+    return url;
+  },
+  setUuid(id) {
+    uni.setStorageSync("uuid", id);
+  },
 
-		} else {
-			url = config.BASE_IMG_URL + url
-		}
-		if (scale) {
-			url = url + "?x-oss-process=image/resize,w_" + width
-		}
-		return url;
+  getUuid() {
+    return uni.getStorageSync("uuid");
+  },
+  exit() {
+    uni.removeStorageSync("user_account");
+    uni.removeStorageSync("token");
+    uni.removeStorageSync("h5_code");
+    store.state.userInfo = null;
+    uni.reLaunch({
+      url: "/pages/index/index",
+    });
+  },
+  /* 时间戳转换成日期
+   * @param timestamp
+   * @returns {*}
+   */
+  timestampToTime(timestamp, isDay = true, hasChinese, line) {
+    if (!timestamp) {
+      return "";
+    }
+    var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+    var Y = date.getFullYear() + (hasChinese ? "" : "-");
+    var M =
+      (date.getMonth() + 1 < 10
+        ? "0" + (date.getMonth() + 1)
+        : date.getMonth() + 1) + (hasChinese ? "" : "-");
+    var D =
+      date.getDate() < 10
+        ? "0" + date.getDate() + (hasChinese ? "" : " ")
+        : date.getDate() + (hasChinese ? "" : " ");
+    var h =
+      date.getHours() < 10
+        ? "0" + date.getHours() + ":"
+        : date.getHours() + ":";
+    var m =
+      date.getMinutes() < 10
+        ? "0" + date.getMinutes() + ":"
+        : date.getMinutes() + ":";
+    var s =
+      date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
+    if (isDay) {
+      if (hasChinese) {
+        return Y + "年" + M + "月" + D + "日";
+      } else {
+        return Y + M + D;
+      }
+    }
+    if (line) {
+      return h + m + s;
+    }
 
-	},
-	setUuid(id) {
-		uni.setStorageSync('uuid', id)
-	},
+    if (hasChinese) {
+      return Y + "年" + M + "月" + D + "日" + h + m + s;
+    } else {
+      return Y + M + D + h + m + s;
+    }
+  },
+  // 时间戳转换日期
+  formDate(time, formate = "yyyy-mm-dd hh:mm:ss") {
+    var padDate = function (va) {
+      va = va < 10 ? "0" + va : va;
+      return va;
+    };
+    if (time) {
+      var value = new Date(time * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
+      // var value = new Date(parseFloat(time))
+      var year = value.getFullYear();
+      var month = padDate(value.getMonth() + 1);
+      var day = padDate(value.getDate());
+      var hour = padDate(value.getHours());
+      var minutes = padDate(value.getMinutes());
+      var seconds = padDate(value.getSeconds());
+      let res = "";
+      switch (formate) {
+        case "mm-dd": {
+          res = month + "-" + day;
+          break;
+        }
+        case "yyyy-mm-dd": {
+          res = year + "-" + month + "-" + day;
+          break;
+        }
+        case "yyyy-mm": {
+          res = year + "-" + month;
+          break;
+        }
+        case "mm月dd日": {
+          res = month + "月" + day + "日";
+          break;
+        }
+        case "yyyy年mm月dd日": {
+          res = year + "年" + month + "月" + day + "日";
+          break;
+        }
+        case "yyyy年mm月": {
+          res = year + "年" + month + "月";
+          break;
+        }
+        case "hh:mm": {
+          res = hour + ":" + minutes;
+          break;
+        }
+        case "yyyy-mm-dd hh:mm": {
+          res = year + "-" + month + "-" + day + " " + hour + ":" + minutes;
+          break;
+        }
+        case "yyyy.mm.dd":
+          res = year + "." + month + "." + day;
+          break;
+        case "yyyy-mm-dd hh:mm:ss":
+        default: {
+          res =
+            year +
+            "-" +
+            month +
+            "-" +
+            day +
+            " " +
+            hour +
+            ":" +
+            minutes +
+            ":" +
+            seconds;
+          break;
+        }
+      }
+      return res;
+    }
+    return "--";
+  },
+  //当前时间距离目标时间还有多久
+  GetRTime(EndTime, isDay = true) {
+    var EndTime = EndTime; //结束时间
+    var NowTime = new Date(); //当前时间
+    //后台给我的是10位 精确到秒的 所有下面我就除以了1000,不要小数点后面的
+    var t = EndTime - (NowTime.getTime() / 1000).toFixed(0);
 
-	getUuid() {
-		return uni.getStorageSync('uuid')
-	},
-	exit() {
-		uni.removeStorageSync('user_account')
-		uni.removeStorageSync('token')
-		uni.removeStorageSync('h5_code')
-		store.state.userInfo = null
-		uni.reLaunch({
-			url: '/pages/index/index'
-		});
-	},
-	/* 时间戳转换成日期
-	 * @param timestamp
-	 * @returns {*}
-	 */
-	timestampToTime(timestamp, isDay = true, hasChinese, line) {
-		if (!timestamp) {
-			return ''
-		}
-		var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-		var Y = date.getFullYear() + (hasChinese ? '' : '-');
-		var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + (hasChinese ? '' : '-');
-		var D = date.getDate() < 10 ? '0' + date.getDate() + (hasChinese ? '' : ' ') : date.getDate() + (hasChinese ? '' : ' ');
-		var h = date.getHours() < 10 ? '0' + date.getHours() + ':' : date.getHours() + ':';
-		var m = date.getMinutes() < 10 ? '0' + date.getMinutes() + ':' : date.getMinutes() + ':';
-		var s = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds();
-		if (isDay) {
+    if (t <= 0) {
+      return "已结束";
+    }
+    //如果后台给的是毫秒 上面不用除以1000 下面的计算时间也都要除以1000 这里我去掉1000了
+    var d = Math.floor(t / 60 / 60 / 24); //天 var d=Math.floor(t/1000/60/60/24)
+    var h = Math.floor((t / 60 / 60) % 24); //时 var h=Math.floor(t/1000/60/60%24)
+    var m = Math.floor((t / 60) % 60); //分 var m=Math.floor(t/1000/60%60)
+    var s = Math.floor(t % 60); //秒 var s=Math.floor(t/1000%60)
+    if (parseInt(d) < 10) {
+      d = "0" + d;
+    }
+    if (parseInt(h) < 10) {
+      h = "0" + h;
+    }
+    if (parseInt(m) < 10) {
+      m = "0" + m;
+    }
+    if (parseInt(s) < 10) {
+      s = "0" + s;
+    }
+    if (isDay) {
+      return d;
+    }
+    return d + "天" + h + "小时" + m + "分" + s + "秒";
+  },
+  TimeTotimestamp(date) {
+    var date = date.replace(/-/g, "/");
+    var newDate = new Date(date);
+    return newDate.getTime() / 1000;
+  },
+  timest() {
+    var tmp = Date.parse(new Date()).toString();
+    tmp = tmp.substr(0, 10);
+    return tmp;
+  },
+  //压缩图片
+  imageInfos(url) {
+    var self = this;
+    return new Promise((resolve, reject) => {
+      uni.getImageInfo({
+        src: url,
+        success: async (res) => {
+          let canvasWidth = res.width; //图片原始长宽
+          let canvasHeight = res.height;
+          if (canvasWidth > 2000 || canvasHeight > 2000) {
+            uni.compressImage({
+              src: url,
+              quality: 75,
+              width: "35%",
+              height: "35%",
+              success: async (rest) => {
+                const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+                console.log(waitUpload, "waitUpload");
+                resolve(waitUpload);
+              },
+            });
+          } else if (canvasWidth > 1000 || canvasHeight > 1000) {
+            uni.compressImage({
+              src: url,
+              quality: 75,
+              width: "50%",
+              height: "50%",
+              success: async (rest) => {
+                const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
+                console.log(waitUpload, "waitUpload");
+                resolve(waitUpload);
+              },
+            });
+          } else {
+            const waitUpload = await self.uploadFile(url, 0);
+            console.log(waitUpload, "waitUpload");
+            resolve(waitUpload);
+            // console.log('无需压缩', url);
+            // resolve(url);
+          }
+        },
+      });
+    });
+  },
+  //上传图片
+  uploadFile(options, int) {
+    return new Promise((resolve, reject) => {
+      var self = this;
+      if (options.indexOf("//tmp") === -1 && options.indexOf("//temp") === -1) {
+        resolve(options);
+        return;
+      }
+      var data = {
+        imageStatus: int,
+      };
+      api.aliyunpolicy(data).then((res) => {
+        var ossToken = res.data.data.resultContent;
+        uni.uploadFile({
+          url: ossToken.host,
+          name: "file",
+          filePath: options,
+          fileType: "image",
+          header: {
+            AuthorizationToken: "WX " + uni.getStorageSync("token"),
+          },
+          formData: {
+            key: ossToken.dir,
+            OSSAccessKeyId: ossToken.accessid,
+            policy: ossToken.policy,
+            Signature: ossToken.signature,
+            // callback: ossToken.callback,
+            success_action_status: 200,
+          },
+          success: (result) => {
+            // if (result.statusCode === 200) {
+            resolve(ossToken.dir);
+            // } else {
+            // 	uni.showToast({
+            // 		title: '上传失败',
+            // 		icon: 'none'
+            // 	});
+            // 	return;
+            // }
+          },
+          fail: (error) => {
+            uni.showToast({
+              title: "上传接口报错",
+              icon: "none",
+            });
+            return;
+          },
+        });
+      });
+    });
+  },
+  getYears(strBirthday) {
+    if (!strBirthday) {
+      return "-";
+    }
+    var returnAge;
+    var strBirthdayArr = strBirthday.split("-");
+    var birthYear = strBirthdayArr[0];
+    var birthMonth = strBirthdayArr[1];
+    var birthDay = strBirthdayArr[2];
+    var d = new Date();
+    var nowYear = d.getFullYear();
+    var nowMonth = d.getMonth() + 1;
+    var nowDay = d.getDate();
 
-			if (hasChinese) {
-				return Y + '年' + M + '月' + D + '日';
-			} else {
-				return Y + M + D;
-			}
-
-		}
-		if (line) {
-			return h + m + s
-		}
-
-		if (hasChinese) {
-			return Y + '年' + M + '月' + D + '日' + h + m + s;
-		} else {
-			return Y + M + D + h + m + s;
-		}
-
-	},
-	// 时间戳转换日期
-	formDate(time, formate = 'yyyy-mm-dd hh:mm:ss') {
-		var padDate = function (va) {
-			va = va < 10 ? '0' + va : va
-			return va
-		}
-		if (time) {
-
-			var value = new Date(time * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
-			// var value = new Date(parseFloat(time))
-			var year = value.getFullYear()
-			var month = padDate(value.getMonth() + 1)
-			var day = padDate(value.getDate())
-			var hour = padDate(value.getHours())
-			var minutes = padDate(value.getMinutes())
-			var seconds = padDate(value.getSeconds())
-			let res = ''
-			switch (formate) {
-				case 'mm-dd': {
-					res = month + '-' + day
-					break
-				}
-				case 'yyyy-mm-dd': {
-					res = year + '-' + month + '-' + day
-					break
-				}
-				case 'yyyy-mm': {
-					res = year + '-' + month
-					break
-				}
-				case 'mm月dd日': {
-					res = month + '月' + day + '日'
-					break
-				}
-				case 'yyyy年mm月dd日': {
-					res = year + '年' + month + '月' + day + '日'
-					break
-				}
-				case 'yyyy年mm月': {
-					res = year + '年' + month + '月'
-					break
-				}
-				case 'hh:mm': {
-					res = hour + ':' + minutes
-					break
-				}
-				case 'yyyy-mm-dd hh:mm': {
-					res = year + '-' + month + '-' + day + ' ' + hour + ':' + minutes
-					break
-				}
-				case 'yyyy.mm.dd':
-					res = year + '.' + month + '.' + day
-					break
-				case 'yyyy-mm-dd hh:mm:ss':
-				default: {
-					res = year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
-					break
-				}
-			}
-			return res
-		}
-		return '--'
-	},
-	//当前时间距离目标时间还有多久
-	GetRTime(EndTime, isDay = true) {
-		var EndTime = EndTime //结束时间
-		var NowTime = new Date(); //当前时间
-		//后台给我的是10位 精确到秒的 所有下面我就除以了1000,不要小数点后面的
-		var t = EndTime - (NowTime.getTime() / 1000).toFixed(0);
-
-		if (t <= 0) {
-			return '已结束'
-		}
-		//如果后台给的是毫秒 上面不用除以1000 下面的计算时间也都要除以1000 这里我去掉1000了
-		var d = Math.floor(t / 60 / 60 / 24); //天 var d=Math.floor(t/1000/60/60/24)
-		var h = Math.floor(t / 60 / 60 % 24); //时 var h=Math.floor(t/1000/60/60%24)
-		var m = Math.floor(t / 60 % 60); //分 var m=Math.floor(t/1000/60%60)
-		var s = Math.floor(t % 60); //秒 var s=Math.floor(t/1000%60)
-		if (parseInt(d) < 10) {
-			d = "0" + d;
-		}
-		if (parseInt(h) < 10) {
-			h = "0" + h;
-		}
-		if (parseInt(m) < 10) {
-			m = "0" + m;
-		}
-		if (parseInt(s) < 10) {
-			s = "0" + s;
-		}
-		if (isDay) {
-			return d;
-		}
-		return d + '天' + h + '小时' + m + '分' + s + '秒'
-	},
-	TimeTotimestamp(date) {
-		var date = date.replace(/-/g, '/');
-		var newDate = new Date(date)
-		return (newDate.getTime() / 1000)
-	},
-	timest() {
-		var tmp = Date.parse(new Date()).toString();
-		tmp = tmp.substr(0, 10);
-		return tmp;
-	},
-	//压缩图片
-	imageInfos(url) {
-		var self = this;
-		return new Promise((resolve, reject) => {
-			uni.getImageInfo({
-				src: url,
-				success: async res => {
-					let canvasWidth = res.width; //图片原始长宽
-					let canvasHeight = res.height;
-					if (canvasWidth > 2000 || canvasHeight > 2000) {
-						uni.compressImage({
-							src: url,
-							quality: 75,
-							width: '35%',
-							height: '35%',
-							success: async rest => {
-								const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-								console.log(waitUpload, 'waitUpload')
-								resolve(waitUpload);
-							}
-						});
-					} else if (canvasWidth > 1000 || canvasHeight > 1000) {
-						uni.compressImage({
-							src: url,
-							quality: 75,
-							width: '50%',
-							height: '50%',
-							success: async rest => {
-								const waitUpload = await self.uploadFile(rest.tempFilePath, 0);
-								console.log(waitUpload, 'waitUpload')
-								resolve(waitUpload);
-							}
-						});
-					} else {
-						const waitUpload = await self.uploadFile(url, 0);
-						console.log(waitUpload, 'waitUpload')
-						resolve(waitUpload);
-						// console.log('无需压缩', url);
-						// resolve(url);
-					}
-				}
-			});
-		});
-	},
-	//上传图片
-	uploadFile(options, int) {
-		return new Promise((resolve, reject) => {
-			var self = this;
-			if (options.indexOf('//tmp') === -1 && options.indexOf('//temp') === -1) {
-				resolve(options)
-				return
-			}
-			var data = {
-				imageStatus: int
-			};
-			api.aliyunpolicy(data).then(res => {
-				var ossToken = res.data.data.resultContent;
-				uni.uploadFile({
-					url: ossToken.host,
-					name: 'file',
-					filePath: options,
-					fileType: 'image',
-					header: {
-						AuthorizationToken: 'WX ' + uni.getStorageSync('token')
-					},
-					formData: {
-						key: ossToken.dir,
-						OSSAccessKeyId: ossToken.accessid,
-						policy: ossToken.policy,
-						Signature: ossToken.signature,
-						// callback: ossToken.callback,
-						success_action_status: 200
-					},
-					success: result => {
-						// if (result.statusCode === 200) {
-						resolve(ossToken.dir);
-						// } else {
-						// 	uni.showToast({
-						// 		title: '上传失败',
-						// 		icon: 'none'
-						// 	});
-						// 	return;
-						// }
-					},
-					fail: error => {
-						uni.showToast({
-							title: '上传接口报错',
-							icon: 'none'
-						});
-						return;
-					}
-				});
-			});
-		});
-	},
-	getYears(strBirthday) {
-
-		if (!strBirthday) {
-			return '-';
-		}
-		var returnAge;
-		var strBirthdayArr = strBirthday.split('-');
-		var birthYear = strBirthdayArr[0];
-		var birthMonth = strBirthdayArr[1];
-		var birthDay = strBirthdayArr[2];
-		var d = new Date();
-		var nowYear = d.getFullYear();
-		var nowMonth = d.getMonth() + 1;
-		var nowDay = d.getDate();
-
-		if (nowYear == birthYear) {
-			returnAge = 0; //同年 则为0岁
-		} else {
-			var ageDiff = nowYear - birthYear; //年之差
-			if (ageDiff > 0) {
-				if (nowMonth == birthMonth) {
-					var dayDiff = nowDay - birthDay; //日之差
-					if (dayDiff < 0) {
-						returnAge = ageDiff - 1;
-					} else {
-						returnAge = ageDiff;
-					}
-				} else {
-					var monthDiff = nowMonth - birthMonth; //月之差
-					if (monthDiff < 0) {
-						returnAge = ageDiff - 1;
-					} else {
-						returnAge = ageDiff;
-					}
-				}
-			} else {
-				returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
-			}
-		}
-		return returnAge; //返回周岁年龄
-	},
-	getDate() {
-		let nowDate = new Date()
-		let date = {
-			year: nowDate.getFullYear(),
-			month: nowDate.getMonth() + 1,
-			date: nowDate.getDate()
-		}
-		return date.year + '-' + date.month + '-' + date.date
-	},
-	getZeroTime() {
-		return Number(new Date(new Date().toLocaleDateString()).getTime() / 1000)
-	},
-	setClock: function (time) {
-		var that = this, sec = parseInt(time), clockCount = {}, strTimer = "";
-		clockCount = setInterval(function () {
-			if (sec == 0) {
-				$(".js-count-down").html("活动已经结束");
-				clearInterval(clockCount);
-				return false;
-			}
-			strTimer = that.secondToDate(sec);
-			$(".js-count-down").html(strTimer);
-			sec--;
-		}, 1000)
-	},
-	secondToDate(result) {
-		var h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
-		var m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
-		var s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
-		if (h == 0) {
-			result = m + ":" + s;
-		} else {
-			result = h + ':' + m + ":" + s
-		}
-		return result;
-	},
-	/**
-	 * 
-	 * @param {int} result 
-	 * @returns {string}
-	 * @remard 单位S转小时分钟秒
-	 */
-	secondToTime(result, Diszing = true) {
-		var h = Math.floor(result / 3600) < 10 ? '0' + Math.floor(result / 3600) : Math.floor(result / 3600);
-		var m = Math.floor((result / 60 % 60)) < 10 ? '0' + Math.floor((result / 60 % 60)) : Math.floor((result / 60 % 60));
-		var s = Math.floor((result % 60)) < 10 ? '0' + Math.floor((result % 60)) : Math.floor((result % 60));
-		if (h == 0 && Diszing) {
-			result = m + ":" + s;
-		} else {
-			result = h + ':' + m + ":" + s
-		}
-		return result;
-	},
-	/**
-	 * @param {Object} length  长度
-	 * 获取随机字符串
-	 */
-	getRandomString(length) {
-		var str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
-		var result = '';
-		for (var i = length; i > 0; --i)
-			result += str[Math.floor(Math.random() * str.length)];
-		return result;
-	},
-	skipLogin(sign) {
-		return api.skipLogin({ sign }).then(res => {
-			if (res.data.code == 200) {
-				uni.removeStorageSync('newUser_sc')
-				uni.removeStorageSync('shareActivityCode')
-				//信息完善,直接进入页面
-				uni.setStorageSync('user_account', res.data.data.user_account);
-				uni.setStorageSync('token', res.data.data.token);
-				store.dispatch('getUserInfo').finally(e => {
-					return Promise.resolve()
-				})
-			} else {
-				uni.navigateTo({
-					url: '/pages4/login/login'
-				});
-				return Promise.reject()
-			}
-		})
-	},
-	getCanvas(that, className = ".canvas") {
-		return new Promise((resolve, reject) => {
-			uni.getSystemInfo({
-				success: res => {
-					const query = uni.createSelectorQuery().in(that)
-					setTimeout(() => {
-						query.select(className)
-							.boundingClientRect()
-							.exec((newRes) => {  
-								resolve({ systemInfo: res, newRes })
-							});
-					}, 1000)
-				}
-			})
-		});
-	},
-}
+    if (nowYear == birthYear) {
+      returnAge = 0; //同年 则为0岁
+    } else {
+      var ageDiff = nowYear - birthYear; //年之差
+      if (ageDiff > 0) {
+        if (nowMonth == birthMonth) {
+          var dayDiff = nowDay - birthDay; //日之差
+          if (dayDiff < 0) {
+            returnAge = ageDiff - 1;
+          } else {
+            returnAge = ageDiff;
+          }
+        } else {
+          var monthDiff = nowMonth - birthMonth; //月之差
+          if (monthDiff < 0) {
+            returnAge = ageDiff - 1;
+          } else {
+            returnAge = ageDiff;
+          }
+        }
+      } else {
+        returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
+      }
+    }
+    return returnAge; //返回周岁年龄
+  },
+  getDate() {
+    let nowDate = new Date();
+    let date = {
+      year: nowDate.getFullYear(),
+      month: nowDate.getMonth() + 1,
+      date: nowDate.getDate(),
+    };
+    return date.year + "-" + date.month + "-" + date.date;
+  },
+  getZeroTime() {
+    return Number(new Date(new Date().toLocaleDateString()).getTime() / 1000);
+  },
+  setClock: function (time) {
+    var that = this,
+      sec = parseInt(time),
+      clockCount = {},
+      strTimer = "";
+    clockCount = setInterval(function () {
+      if (sec == 0) {
+        $(".js-count-down").html("活动已经结束");
+        clearInterval(clockCount);
+        return false;
+      }
+      strTimer = that.secondToDate(sec);
+      $(".js-count-down").html(strTimer);
+      sec--;
+    }, 1000);
+  },
+  secondToDate(result) {
+    var h =
+      Math.floor(result / 3600) < 10
+        ? "0" + Math.floor(result / 3600)
+        : Math.floor(result / 3600);
+    var m =
+      Math.floor((result / 60) % 60) < 10
+        ? "0" + Math.floor((result / 60) % 60)
+        : Math.floor((result / 60) % 60);
+    var s =
+      Math.floor(result % 60) < 10
+        ? "0" + Math.floor(result % 60)
+        : Math.floor(result % 60);
+    if (h == 0) {
+      result = m + ":" + s;
+    } else {
+      result = h + ":" + m + ":" + s;
+    }
+    return result;
+  },
+  /**
+   *
+   * @param {int} result
+   * @returns {string}
+   * @remard 单位S转小时分钟秒
+   */
+  secondToTime(result, Diszing = true) {
+    var h =
+      Math.floor(result / 3600) < 10
+        ? "0" + Math.floor(result / 3600)
+        : Math.floor(result / 3600);
+    var m =
+      Math.floor((result / 60) % 60) < 10
+        ? "0" + Math.floor((result / 60) % 60)
+        : Math.floor((result / 60) % 60);
+    var s =
+      Math.floor(result % 60) < 10
+        ? "0" + Math.floor(result % 60)
+        : Math.floor(result % 60);
+    if (h == 0 && Diszing) {
+      result = m + ":" + s;
+    } else {
+      result = h + ":" + m + ":" + s;
+    }
+    return result;
+  },
+  /**
+   * @param {Object} length  长度
+   * 获取随机字符串
+   */
+  getRandomString(length) {
+    var str = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
+    var result = "";
+    for (var i = length; i > 0; --i)
+      result += str[Math.floor(Math.random() * str.length)];
+    return result;
+  },
+  skipLogin(sign) {
+    return api.skipLogin({ sign }).then((res) => {
+      if (res.data.code == 200) {
+        uni.removeStorageSync("newUser_sc");
+        uni.removeStorageSync("shareActivityCode");
+        //信息完善,直接进入页面
+        uni.setStorageSync("user_account", res.data.data.user_account);
+        uni.setStorageSync("token", res.data.data.token);
+        store.dispatch("getUserInfo").finally((e) => {
+          return Promise.resolve();
+        });
+      } else {
+        uni.navigateTo({
+          url: "/pages4/login/login",
+        });
+        return Promise.reject();
+      }
+    });
+  },
+  getCanvas(that, className = ".canvas") {
+    return new Promise((resolve, reject) => {
+      uni.getSystemInfo({
+        success: (res) => {
+          const query = uni.createSelectorQuery().in(that);
+          setTimeout(() => {
+            query
+              .select(className)
+              .boundingClientRect()
+              .exec((newRes) => {
+                resolve({ systemInfo: res, newRes });
+              });
+          }, 1000);
+        },
+      });
+    });
+  },
+  toLink(externalLink) {
+    if (!externalLink) {
+      uni.showModal({
+        showCancel: false,
+        content: "链接不存在",
+      });
+      return;
+    }
+    // #ifdef MP-WEIXIN
+    uni.navigateTo({
+      url: `/pages/webview/sdlink?url=` + externalLink,
+    });
+    // #endif
+    // #ifdef H5
+    window.location.href = externalLink;
+    // #endif
+  },
+};

+ 1 - 1
pages.json

@@ -3,7 +3,7 @@
 		{
 			"path": "pages/index/index",
 			"style": {
-				"navigationBarTitleText": "祥粤云学堂",
+				"navigationBarTitleText": "云学堂",
 				"onReachBottomDistance": 50,
 				"app-plus": {
 					"titleNView": false //禁用原生导航栏  

+ 3 - 2
pages/course/index.vue

@@ -356,6 +356,7 @@
       mode="bottom"
       border-radius="32"
       :mask-close-able="false"
+      :closeable="!!selObj.bId"
     >
       <view class="popuBox">
         <view class="popuBox-title">选择分类</view>
@@ -659,7 +660,7 @@ export default {
   computed: { ...mapGetters(["userInfo"]) },
 };
 </script>
-<style >
+<style>
 ::-webkit-scrollbar {
   width: 0;
   height: 0;
@@ -885,7 +886,7 @@ page {
 }
 .listBox {
   background-color: #eaeef1;
-  padding: 24rpx 24rpx 150rpx 24rpx;
+  padding: 24rpx 24rpx 120rpx 24rpx;
   position: relative;
   // top: 235rpx;
 }

+ 11 - 6
pages/index/index.vue

@@ -314,8 +314,8 @@
           <u-empty text="暂无推荐题库" mode="list" margin-top="100"></u-empty>
         </template>
       </view>
-      <view class="bom-tip">{{tenantInfo.tips1}}</view>
-      <view class="bom-tip">{{tenantInfo.tips2}}</view>
+      <view class="bom-tip">{{ tenantInfo.tips1 }}</view>
+      <view class="bom-tip">{{ tenantInfo.tips2 }}</view>
     </view>
     <!-- #ifdef MP-WEIXIN -->
     <view :style="{ opacity: opacitys }" class="officials">
@@ -416,6 +416,11 @@ export default {
     };
   },
   async onLoad(option) {
+    // #ifdef H5
+    uni.setNavigationBarTitle({
+      title: config.tenantName,
+    });
+    // #endif
     this.isLogin = this.$method.isLogin();
     this.dictObj;
     this.getAdvertising();
@@ -1172,7 +1177,7 @@ page {
     overflow: hidden;
     padding: 0 16rpx;
     background: rgba(234, 238, 241, 1);
-    padding-bottom: 100rpx;
+    padding-bottom: 30rpx;
     .notice {
       background: #fff;
       border-radius: 16rpx;
@@ -1462,8 +1467,8 @@ page {
         }
       }
     }
-    .bom-tip{
-      color: #A7B0B8;
+    .bom-tip {
+      color: #a7b0b8;
       text-align: center;
       padding: 0 30rpx;
       font-size: 26rpx;
@@ -1783,4 +1788,4 @@ page {
     color: #7b8284;
   }
 }
-</style>
+</style>

+ 3 - 20
pages/learn/index.vue

@@ -1030,27 +1030,10 @@ export default {
           }
         });
     },
-    toLink(externalLink) {
-      if (!externalLink) {
-        uni.showModal({
-          showCancel: false,
-          content: "链接不存在",
-        });
-        return;
-      }
-      // #ifdef MP-WEIXIN
-      uni.navigateTo({
-        url: `/pages/webview/sdlink?url=` + externalLink,
-      });
-      // #endif
-      // #ifdef H5
-      window.location.href = externalLink;
-      // #endif
-    },
     async studyIn(v, i, item, index) {
       if (item.externalLinkStatus) {
-        this.toLink(item.externalLink);
-        return
+        this.$method.toLink(item.externalLink);
+        return;
       }
       if (item.goodsType == 6) {
         // 进入直播课
@@ -1493,4 +1476,4 @@ page {
 </style>
 <style lang="scss" scoped>
 @import "./index.scss";
-</style>
+</style>

+ 2 - 19
pages/questionBank/index.vue

@@ -119,7 +119,7 @@
             <view class="study_btns" v-else>
               <view
                 class="exam_word intos"
-                @click.stop="toLink(item.externalLink)"
+                @click.stop="$method.toLink(item.externalLink)"
                 >进入学习</view
               >
             </view>
@@ -206,23 +206,6 @@ export default {
         url: "/pages/course/index",
       });
     },
-    toLink(externalLink) {
-      if (!externalLink) {
-        uni.showModal({
-          showCancel: false,
-          content: "链接不存在",
-        });
-        return;
-      }
-      // #ifdef MP-WEIXIN
-      uni.navigateTo({
-        url: `/pages/webview/sdlink?url=` + externalLink,
-      });
-      // #endif
-      // #ifdef H5
-      window.location.href = externalLink;
-      // #endif
-    },
     toDailyPractice(item, child) {
       this.$api
         .lockLockStatus({
@@ -298,4 +281,4 @@ page {
 </style>
 <style lang="scss" scoped>
 @import "./index.scss";
-</style>
+</style>

+ 1 - 1
pages/wd/index.vue

@@ -378,7 +378,7 @@ page {
 }
 .loginBox {
   position: relative;
-  padding: 0 30rpx 180rpx 30rpx;
+  padding: 0 30rpx 50rpx 30rpx;
   top: 430rpx;
   width: 100%;
   height: 100%;

+ 1 - 0
pages2/bank/detail.vue

@@ -770,6 +770,7 @@ page {
 					flex: 1;
 					font-size: 30rpx;
     				color: #666666;
+					word-break: break-all;
 				}
 			
 				&:nth-last-of-type(1) {

+ 25 - 28
pages2/bank/questionBank.vue

@@ -435,7 +435,7 @@
                             bank.ques[ansIndex] != bank.ans[ansIndex],
                           user_choose:
                             bankType == 2 &&
-                            item.optionsId == bank.ques[ansIndex],
+                            option.optionsId == bank.ques[ansIndex],
                         }"
                         class="activeTI"
                       >
@@ -1157,7 +1157,6 @@ export default {
 
             if (isOver) {
               count++;
-              console.log(item, 444);
             }
           }
         } else if (item.type == 5) {
@@ -1593,18 +1592,7 @@ export default {
           this.examData = res.data.data || {};
           this.id = this.examData.examId;
           if (!this.examData.questionList.length) {
-            this.hideDialog();
-            uni.showModal({
-              showCancel: false,
-              content: "该试卷暂无题目",
-              success: (k) => {
-                if (k.confirm) {
-                  this.isSubmit = true;
-                  uni.navigateBack();
-                }
-              },
-            });
-            return;
+            return this.noListTip()
           }
           this.dataAnlyze(this.examData.questionList || []);
         } else {
@@ -1615,6 +1603,19 @@ export default {
         }
       });
     },
+    noListTip(content = "该试卷暂无题目") {
+      this.hideDialog();
+      uni.showModal({
+        showCancel: false,
+        content,
+        success: (k) => {
+          if (k.confirm) {
+            this.isSubmit = true;
+            uni.navigateBack();
+          }
+        },
+      });
+    },
     /**
      * 请求题目列表 app/common/bank/question/list
      */
@@ -1625,25 +1626,18 @@ export default {
         examId: this.id,
         goodsId: this.goodsId,
         orderGoodsId: this.orderGoodsId,
+        from: 1,
       }).then((res) => {
+        if (res.data.code == 500) {
+          return this.noListTip('你已完成所有题目')
+        }
         let data = res.data.data;
         if (this.doMode == 3) {
           this.simulateExamId = data.simulateExamId;
           data = data.questionList;
         }
         if (!data.length) {
-          this.hideDialog();
-          uni.showModal({
-            showCancel: false,
-            content: "该试卷暂无题目",
-            success: (k) => {
-              if (k.confirm) {
-                this.isSubmit = true;
-                uni.navigateBack();
-              }
-            },
-          });
-          return;
+          return this.noListTip()
         }
         this.allTimes = data[0].answerTime * 60;
         this.lastTime = data[0].answerTime && data[0].answerTime * 60;
@@ -2306,7 +2300,8 @@ export default {
                   "&bankNum=" +
                   this.bankNum +
                   "&doMode=" +
-                  this.doMode,
+                  this.doMode +
+                  "&courseType=1",
               });
             }, 1000);
           }
@@ -2578,7 +2573,6 @@ export default {
      * 简答题答案确认
      */
     submitAns(bankindex) {
-      console.log(this.questionList[bankindex]);
       if (
         !this.questionList[bankindex].ansText.text &&
         !this.questionList[bankindex].ansText.imageList.length
@@ -2595,6 +2589,7 @@ export default {
         imageList: this.questionList[bankindex].ansText.imageList || [],
         text: this.questionList[bankindex].ansText.text || "",
       });
+      this.$u.toast("已确认答案");
       this.isDoOver();
     },
 
@@ -2622,6 +2617,7 @@ export default {
           [],
         text: this.questionList[bankindex].jsonStr[ansindex].ansText.text || "",
       });
+      this.$u.toast("已确认答案");
       this.isDoOver();
     },
     isCheck(item, index) {
@@ -2853,6 +2849,7 @@ export default {
   align-items: center;
 
   .flex_auto {
+    word-break: break-all;
     flex: 1;
   }
 }

+ 16 - 21
pages2/bank/questionBankAllExplain.vue

@@ -1,11 +1,7 @@
 <template>
   <view class="questionBank">
     <nav-bar title="全部解析"></nav-bar>
-    <swiper
-      class="swiper"
-      :current="current"
-      @change="swiperChange"
-    >
+    <swiper class="swiper" :current="current" @change="swiperChange">
       <swiper-item v-for="(bank, bankIndex) in questionList" :key="bankIndex">
         <view class="pageContent">
           <view class="pad_8 titBox">
@@ -280,12 +276,9 @@
                 问题{{ tabIndex + 1 }}
               </view>
             </view>
-            <view
-              v-for="(ansItem, ansIndex) in bank.jsonStr"
-              v-if="bank.current == ansIndex"
-              :key="ansIndex"
-            >
-              <template v-if="ansItem.type == 1">
+            <!-- v-if="bank.current == ansIndex" -->
+            <view v-for="(ansItem, ansIndex) in bank.jsonStr" :key="ansIndex">
+              <template v-if="ansItem.type == 1 && bank.current == ansIndex">
                 <view class="pad_8 titBox">
                   <view class="leftLetters">
                     <view class="btnType">
@@ -358,13 +351,13 @@
                   <view class="pad_8 answerInfos">
                     <view class="answerTitle">答案解析</view>
                     <view class="answerContent">
-                      <rich-text :nodes="option.analysisContent"></rich-text>
+                      <rich-text :nodes="ansItem.analysisContent"></rich-text>
                     </view>
                   </view>
                 </view>
               </template>
 
-              <template v-if="ansItem.type == 2">
+              <template v-if="ansItem.type == 2 && bank.current == ansIndex">
                 <view class="pad_8 titBox">
                   <view class="leftLetters">
                     <view class="btnType">
@@ -373,11 +366,11 @@
                   </view>
                   <view class="titles">
                     <rich-text :nodes="ansItem.content"></rich-text>
-                    <view v-if="option.imgUrl">
+                    <view v-if="ansItem.imgUrl">
                       <image
                         style="width: 600rpx"
                         mode="widthFix"
-                        :src="$method.splitImgHost(option.imgUrl)"
+                        :src="$method.splitImgHost(ansItem.imgUrl)"
                       ></image>
                     </view>
                   </view>
@@ -452,7 +445,7 @@
                 </view>
               </template>
 
-              <template v-if="ansItem.type == 3">
+              <template v-if="ansItem.type == 3 && bank.current == ansIndex">
                 <view class="pad_8 titBox">
                   <view class="leftLetters">
                     <view class="btnType">
@@ -528,7 +521,7 @@
               </template>
 
               <!-- 简答题 -->
-              <template v-if="ansItem.type == 5">
+              <template v-if="ansItem.type == 5 && bank.current == ansIndex">
                 <view class="pad_8 titBox_title">
                   <view class="leftLetters">
                     <view class="btnType">
@@ -662,7 +655,7 @@ export default {
     this.chapterId = option.chapterId || "";
     this.moduleId = option.moduleId || "";
     this.recordId = option.recordId || "";
-    this.courseType = option.courseType
+    this.courseType = option.courseType;
     let showDialog = uni.getStorageSync("showDialog");
 
     if (showDialog) {
@@ -685,14 +678,15 @@ export default {
     goodsQuestionList() {
       if (this.courseType == 2) {
         this.$api.bankReportData(this.recordId).then((res) => {
-          this.questionList = JSON.parse(res.data.data.historyExamJson)
-        })
+          this.questionList = JSON.parse(res.data.data.historyExamJson);
+          this.questionList.map((e, i) => e.type == 4 && this.tabSelect(0, i));
+        });
       } else {
         this.$api.examReport(this.recordId).then((res) => {
           this.questionList = JSON.parse(res.data.data.historyExamJson);
+          this.questionList.map((e, i) => e.type == 4 && this.tabSelect(0, i));
         });
       }
-      
     },
 
     openFooterTab() {
@@ -841,6 +835,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/bank/questionBankContinue.vue

@@ -2023,6 +2023,7 @@ export default {
   align-items: center;
 
   .flex_auto {
+    word-break: break-all;
     flex: 1;
   }
 }

+ 1 - 0
pages2/bank/questionBankExplain.vue

@@ -716,6 +716,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/bank/questionBankExplainDetail.vue

@@ -1817,6 +1817,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/bank/questionBankTest.vue

@@ -1430,6 +1430,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/bank/questionBankWrongExplain.vue

@@ -861,6 +861,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/bank/question_detail.vue

@@ -632,6 +632,7 @@ page {
 
 				.flex_auto {
 					flex: 1;
+					word-break: break-all;
 				}
 
 				&:nth-last-of-type(1) {

+ 14 - 4
pages2/bank/question_record.vue

@@ -226,11 +226,13 @@ export default {
             "&moduleId=" +
             record.moduleId +
             "&chapterId=" +
-            record.chapterExamId +
+            record.chapterId +
             "&recordId=" +
             record.recordId +
             "&orderGoodsId=" +
-            record.orderGoodsId,
+            record.orderGoodsId +
+            "&courseType=" +
+            record.courseType,
         });
         return;
       }
@@ -261,7 +263,11 @@ export default {
             "&type=" +
             record.type +
             "&orderGoodsId=" +
-            record.orderGoodsId,
+            record.orderGoodsId +
+            "&doMode=" +
+            record.doMode +
+            "&courseType=" +
+            record.courseType,
         });
       } else {
         let entryType = record.doMode == 2 ? "random" : "";
@@ -280,7 +286,11 @@ export default {
             "&orderGoodsId=" +
             record.orderGoodsId +
             "&entryType=" +
-            entryType,
+            entryType +
+            "&doMode=" +
+            record.doMode +
+            "&courseType=" +
+            record.courseType,
         });
       }
     },

+ 11 - 4
pages2/bank/question_report.vue

@@ -246,6 +246,7 @@ export default {
       bankNum: 5, // 随机练习的题目数量
       examName: "", // 试卷名称
       doMode: "",
+      courseType:''
     };
   },
   onUnload() {},
@@ -267,6 +268,7 @@ export default {
     this.chapterId = option.chapterId || 0;
     this.goodsId = option.goodsId || "";
     this.doMode = option.doMode;
+    this.courseType = option.courseType
     this.examWrongRecordWrongNum();
     this.bankExamNextExam();
     // await this.bankExam();
@@ -582,10 +584,15 @@ export default {
     },
     examWrongRecordWrongNum() {
       return new Promise((resolve) => {
-        this.$api.examWrongRecordWrongNum(this.recordId).then((res) => {
-          this.wrongRecordWrongNum = res.data.data || 0;
-          resolve();
-        });
+        this.$api
+          .examWrongRecordWrongNum({
+            recordId: this.recordId,
+            courseType: this.courseType,
+          })
+          .then((res) => {
+            this.wrongRecordWrongNum = res.data.data || 0;
+            resolve();
+          });
       });
     },
     /**

+ 267 - 181
pages2/class/questionBank.vue

@@ -27,9 +27,9 @@
               }}</view>
               <view class="leftLetters"></view>
             </view>
-            <view class="titles"
-              ><rich-text :nodes="bank.content"></rich-text
-            ></view>
+            <view class="titles">
+              <rich-text :nodes="bank.content"></rich-text>
+            </view>
           </view>
 
           <template v-if="bank.type == 1">
@@ -79,9 +79,9 @@
               </view>
               <view class="pad_8 answerInfos">
                 <view class="answerTitle">答案解析</view>
-                <view class="answerContent"
-                  ><rich-text :nodes="bank.analysisContent"></rich-text
-                ></view>
+                <view class="answerContent">
+                  <rich-text :nodes="bank.analysisContent"></rich-text>
+                </view>
               </view>
             </view>
           </template>
@@ -156,9 +156,9 @@
               </view>
               <view class="pad_8 answerInfos">
                 <view class="answerTitle">答案解析</view>
-                <view class="answerContent"
-                  ><rich-text :nodes="bank.analysisContent"></rich-text
-                ></view>
+                <view class="answerContent">
+                  <rich-text :nodes="bank.analysisContent"></rich-text>
+                </view>
               </view>
             </view>
           </template>
@@ -215,9 +215,9 @@
               </view>
               <view class="pad_8 answerInfos">
                 <view class="answerTitle">答案解析</view>
-                <view class="answerContent"
-                  ><rich-text :nodes="bank.analysisContent"></rich-text
-                ></view>
+                <view class="answerContent">
+                  <rich-text :nodes="bank.analysisContent"></rich-text>
+                </view>
               </view>
             </view>
           </template>
@@ -279,14 +279,14 @@
                 >
                   <view class="answerTitle">我的答案:</view>
                   {{ bank.ques.text }}
-                  <view class="imgs"
-                    ><image
+                  <view class="imgs">
+                    <image
                       class="img"
                       v-for="(ques, quesIndex) in bank.ques.imageList"
                       :key="quesIndex"
                       :src="$method.splitImgHost(ques, true)"
-                    ></image
-                  ></view>
+                    ></image>
+                  </view>
                 </view>
               </view>
             </view>
@@ -299,9 +299,9 @@
             >
               <view class="pad_8 answerInfos">
                 <view class="answerTitle">答案解析:</view>
-                <view class="answerContent"
-                  ><rich-text :nodes="bank.analysisContent"></rich-text
-                ></view>
+                <view class="answerContent">
+                  <rich-text :nodes="bank.analysisContent"></rich-text>
+                </view>
               </view>
             </view>
           </template>
@@ -392,9 +392,9 @@
                   </view>
                   <view class="pad_8 answerInfos">
                     <view class="answerTitle">答案解析</view>
-                    <view class="answerContent"
-                      ><rich-text :nodes="option.analysisContent"></rich-text
-                    ></view>
+                    <view class="answerContent">
+                      <rich-text :nodes="option.analysisContent"></rich-text>
+                    </view>
                   </view>
                 </view>
               </template>
@@ -421,8 +421,9 @@
                       <view
                         :class="{ checked: option.checked }"
                         class="activeTI"
-                        >{{ ast[childindex] }}</view
                       >
+                        {{ ast[childindex] }}
+                      </view>
                       <view class="flex_auto">
                         <rich-text :nodes="option.content"></rich-text>
                       </view>
@@ -487,9 +488,9 @@
                   </view>
                   <view class="pad_8 answerInfos">
                     <view class="answerTitle">答案解析</view>
-                    <view class="answerContent"
-                      ><rich-text :nodes="ansItem.analysisContent"></rich-text
-                    ></view>
+                    <view class="answerContent">
+                      <rich-text :nodes="ansItem.analysisContent"></rich-text>
+                    </view>
                   </view>
                 </view>
               </template>
@@ -563,9 +564,9 @@
                   </view>
                   <view class="pad_8 answerInfos">
                     <view class="answerTitle">答案解析</view>
-                    <view class="answerContent"
-                      ><rich-text :nodes="ansItem.analysisContent"></rich-text
-                    ></view>
+                    <view class="answerContent">
+                      <rich-text :nodes="ansItem.analysisContent"></rich-text>
+                    </view>
                   </view>
                 </view>
               </template>
@@ -602,13 +603,13 @@
                           mode=""
                         ></image>
                         <view class="progress"
-                          >{{ ansItem.ansText.imageList.length || "0" }}/4</view
-                        >
+                          >{{ ansItem.ansText.imageList.length || "0" }}/4
+                        </view>
                         <view
                           class="submit"
                           @click="submitAnsChild(bankIndex, ansIndex)"
-                          >确认答案</view
-                        >
+                          >确认答案
+                        </view>
                       </view>
                       <view class="textarea">
                         <textarea
@@ -653,9 +654,9 @@
                 <view v-if="bankType == 1 && bank.ques[ansIndex]">
                   <view class="pad_8 answerInfos">
                     <view class="answerTitle">答案解析</view>
-                    <view class="answerContent"
-                      ><rich-text :nodes="ansItem.analysisContent"></rich-text
-                    ></view>
+                    <view class="answerContent">
+                      <rich-text :nodes="ansItem.analysisContent"></rich-text>
+                    </view>
                   </view>
                 </view>
               </template>
@@ -825,14 +826,14 @@
       <view v-if="examType != 2 && photoPopup">
         <view class="photoBox">
           <view class="photoTop">
-            <view class="sqzz" v-if="false"
-              ><u-icon
+            <view class="sqzz" v-if="false">
+              <u-icon
                 name="close"
                 color="#333333"
                 size="30"
                 @click="closePhoto"
-              ></u-icon
-            ></view>
+              ></u-icon>
+            </view>
             <view class="centersq">请正视手机屏幕</view>
             <view class="sqzz"></view>
           </view>
@@ -965,6 +966,7 @@ export default {
       popupPhotoShow: false,
       // h5
       faceUrl: "",
+      simulateExamId: undefined,
     };
   },
   watch: {
@@ -1050,8 +1052,8 @@ export default {
       await this.getGoodsDetail();
       this.needPhoto && (await this.getExamLearnStatus());
       // 请求题目列表
+      await this.bankExam();
       this.goodsQuestionList();
-      this.bankExam();
     }
   },
   mounted() {},
@@ -1085,6 +1087,12 @@ export default {
       this.examRecordEdit();
     }
   },
+  computed: {
+    doMode() {
+      // 做题模式 1章卷 2随机练习 3模拟组卷
+      return this.examData.simulateStatus ? 3 : undefined;
+    },
+  },
   methods: {
     getExamLearnStatus() {
       return this.$api
@@ -1094,7 +1102,7 @@ export default {
           chapterId: this.chapterId,
           courseId: this.courseId,
           moduleId: this.moduleId,
-          type:this.examType,
+          type: this.examType,
           examId: this.id,
         })
         .then((res) => {
@@ -1521,12 +1529,13 @@ export default {
      * 获取试卷类型2考试,1练习
      */
     bankExam() {
-      this.$api.bankExam(this.id).then((res) => {
+      return this.$api.bankExam(this.id).then((res) => {
         this.bankType = res.data.data.doType;
         this.examData = res.data.data;
         if (this.bankType == 2) {
           this.needBack = true;
         }
+        return Promise.resolve();
       });
     },
     /**
@@ -1954,157 +1963,170 @@ export default {
         return "";
       }
     },
+    noListTip(content = "该试卷暂无题目") {
+      this.hideDialog();
+      uni.showModal({
+        showCancel: false,
+        content,
+        success: (k) => {
+          if (k.confirm) {
+            this.isSubmit = true;
+            uni.navigateBack();
+          }
+        },
+      });
+    },
     /**
      * 请求题目列表
      */
     goodsQuestionList() {
-      this.$api
-        .goodsQuestionList({
-          examId: this.id,
-        })
-        .then(async (res) => {
-          if (!res.data.data.length) {
-            this.hideDialog();
-            uni.showModal({
-              showCancel: false,
-              content: "该试卷暂无题目",
-              success: function (k) {
-                if (k.confirm) {
-                  uni.navigateBack();
-                }
-              },
-            });
-            return;
-          }
-          this.allTimes = res.data.data[0].answerTime * 60;
-          this.lastTime =
-            res.data.data[0].answerTime && res.data.data[0].answerTime * 60;
-
-          res.data.data.forEach((item, index) => {
-            if (typeof item.jsonStr == "string") {
-              item.jsonStr = JSON.parse(item.jsonStr);
-
-              if (item.type == 2) {
-                //多选
-                item.jsonStr.forEach((str) => {
-                  str.optionsId = "" + str.optionsId;
-                });
-                let arr = item.answerQuestion.split(",");
-                arr.forEach((a, i) => {
-                  arr[i] = "" + a;
-                });
-                item.ans = arr;
-                item.analysisContent &&
-                  (item.analysisContent = item.analysisContent.replace(
-                    /<img/gi,
-                    '<img style="max-width:100%;"'
-                  ));
-                item.content &&
-                  (item.content = item.content.replace(
-                    /<img/gi,
-                    '<img style="max-width:100%;"'
-                  ));
-                return;
-              } else if (item.type == 5) {
-                //简答题
-                item.ansText = {
-                  text: "",
-                  imageList: [],
-                };
-
-                item.ques = {
-                  text: "",
-                  imageList: [],
-                };
-                item.analysisContent &&
-                  (item.analysisContent = item.analysisContent.replace(
-                    /<img/gi,
-                    '<img style="max-width:100%;"'
-                  ));
-                item.content &&
-                  (item.content = item.content.replace(
-                    /<img/gi,
-                    '<img style="max-width:100%;"'
-                  ));
-              } else if (item.type == 4) {
-                //案例题
-                console.log(item.jsonStr);
-                item.ques = [];
-                item.current = 0;
-                let ansArr = [];
-                item.jsonStr.forEach((json, index) => {
-                  if (json.type == 1) {
-                    ansArr[index] = json.answerQuestion;
-                    json.content &&
-                      (json.content = json.content.replace(
-                        /<img/gi,
-                        '<img style="max-width:100%;"'
-                      ));
-                  } else if (json.type == 2) {
-                    json.optionsList.forEach((str) => {
-                      str.optionsId = "" + str.optionsId;
-                    });
-                    let arr = json.answerQuestion.split(",");
-                    arr.forEach((a, i) => {
-                      arr[i] = "" + a;
-                    });
-                    ansArr[index] = arr;
-                    json.content &&
-                      (json.content = json.content.replace(
-                        /<img/gi,
-                        '<img style="max-width:100%;"'
-                      ));
-                  } else if (json.type == 3) {
-                    ansArr[index] = json.answerQuestion;
-                    json.content &&
-                      (json.content = json.content.replace(
-                        /<img/gi,
-                        '<img style="max-width:100%;"'
-                      ));
-                  } else if (json.type == 5) {
-                    ansArr[index] = {
-                      text: "",
-                      imageList: [],
-                    };
-                    json.ansText = {
-                      text: "",
-                      imageList: [],
-                    };
-                    json.content &&
-                      (json.content = json.content.replace(
-                        /<img/gi,
-                        '<img style="max-width:100%;"'
-                      ));
-                  }
-                });
-                item.analysisContent &&
-                  (item.analysisContent = item.analysisContent.replace(
-                    /<img/gi,
-                    '<img style="max-width:100%;"'
-                  ));
-                item.content &&
-                  (item.content = item.content.replace(
-                    /<img/gi,
-                    '<img style="max-width:100%;"'
-                  ));
-                item.ans = ansArr;
-                return;
-              }
+      this.$api[
+        this.doMode == 3 ? "goodsRandomQuestionList" : "goodsQuestionList"
+      ]({
+        examId: this.id,
+        goodsId: this.goodsId,
+        orderGoodsId: this.orderGoodsId,
+        from: 2,
+      }).then(async (res) => {
+        if (res.data.code == 500) {
+          return this.noListTip('你已完成所有题目')
+        }
+        let data = res.data.data;
+        if (this.doMode == 3) {
+          this.simulateExamId = data.simulateExamId;
+          data = data.questionList;
+        }
+        if (!data.length) {
+          return this.noListTip()
+        }
+        this.allTimes = data[0].answerTime * 60;
+        this.lastTime = data[0].answerTime && data[0].answerTime * 60;
+
+        data.forEach((item, index) => {
+          if (typeof item.jsonStr == "string") {
+            item.jsonStr = JSON.parse(item.jsonStr);
 
+            if (item.type == 2) {
+              //多选
+              item.jsonStr.forEach((str) => {
+                str.optionsId = "" + str.optionsId;
+              });
+              let arr = item.answerQuestion.split(",");
+              arr.forEach((a, i) => {
+                arr[i] = "" + a;
+              });
+              item.ans = arr;
+              item.analysisContent &&
+                (item.analysisContent = item.analysisContent.replace(
+                  /<img/gi,
+                  '<img style="max-width:100%;"'
+                ));
               item.content &&
                 (item.content = item.content.replace(
                   /<img/gi,
                   '<img style="max-width:100%;"'
                 ));
-              item.ans = item.answerQuestion;
+              return;
+            } else if (item.type == 5) {
+              //简答题
+              item.ansText = {
+                text: "",
+                imageList: [],
+              };
+
+              item.ques = {
+                text: "",
+                imageList: [],
+              };
+              item.analysisContent &&
+                (item.analysisContent = item.analysisContent.replace(
+                  /<img/gi,
+                  '<img style="max-width:100%;"'
+                ));
+              item.content &&
+                (item.content = item.content.replace(
+                  /<img/gi,
+                  '<img style="max-width:100%;"'
+                ));
+            } else if (item.type == 4) {
+              //案例题
+              console.log(item.jsonStr);
+              item.ques = [];
+              item.current = 0;
+              let ansArr = [];
+              item.jsonStr.forEach((json, index) => {
+                if (json.type == 1) {
+                  ansArr[index] = json.answerQuestion;
+                  json.content &&
+                    (json.content = json.content.replace(
+                      /<img/gi,
+                      '<img style="max-width:100%;"'
+                    ));
+                } else if (json.type == 2) {
+                  json.optionsList.forEach((str) => {
+                    str.optionsId = "" + str.optionsId;
+                  });
+                  let arr = json.answerQuestion.split(",");
+                  arr.forEach((a, i) => {
+                    arr[i] = "" + a;
+                  });
+                  ansArr[index] = arr;
+                  json.content &&
+                    (json.content = json.content.replace(
+                      /<img/gi,
+                      '<img style="max-width:100%;"'
+                    ));
+                } else if (json.type == 3) {
+                  ansArr[index] = json.answerQuestion;
+                  json.content &&
+                    (json.content = json.content.replace(
+                      /<img/gi,
+                      '<img style="max-width:100%;"'
+                    ));
+                } else if (json.type == 5) {
+                  ansArr[index] = {
+                    text: "",
+                    imageList: [],
+                  };
+                  json.ansText = {
+                    text: "",
+                    imageList: [],
+                  };
+                  json.content &&
+                    (json.content = json.content.replace(
+                      /<img/gi,
+                      '<img style="max-width:100%;"'
+                    ));
+                }
+              });
+              item.analysisContent &&
+                (item.analysisContent = item.analysisContent.replace(
+                  /<img/gi,
+                  '<img style="max-width:100%;"'
+                ));
+              item.content &&
+                (item.content = item.content.replace(
+                  /<img/gi,
+                  '<img style="max-width:100%;"'
+                ));
+              item.ans = ansArr;
+              return;
             }
-          });
 
-          this.questionList = res.data.data;
-          this.lastCount = this.questionList.length;
-          this.getCollectInfo(this.current);
-          await this.examRecord();
+            item.content &&
+              (item.content = item.content.replace(
+                /<img/gi,
+                '<img style="max-width:100%;"'
+              ));
+            item.ans = item.answerQuestion;
+          }
         });
+
+        this.questionList = data;
+        this.lastCount = this.questionList.length;
+        this.getCollectInfo(this.current);
+        await this.examRecord();
+      });
     },
     /**
      * 记录总题数,获取recordId
@@ -2138,6 +2160,8 @@ export default {
             totalQuestionNum: questionList,
             allQuestionNum: this.questionList.length,
             type: this.examType,
+            simulateExamId: this.simulateExamId,
+            doMode: this.doMode,
           })
           .then((res) => {
             this.recordId = res.data.data;
@@ -2397,6 +2421,7 @@ export default {
             questionId: this.questionList[index].questionId,
             goodsId: this.goodsId || "",
             orderGoodsId: this.orderGoodsId,
+            doMode: this.doMode,
           })
           .then((res) => {
             if (res.data.code == 200) {
@@ -2683,6 +2708,7 @@ export default {
           questionIds: doWrongQuestionIds,
           recordId: this.recordId,
           type: 2, // 视频课程的传2
+          doMode: this.doMode,
         })
         .then((res) => {})
         .catch((err) => {});
@@ -2826,6 +2852,7 @@ export default {
         imageList: this.questionList[bankindex].ansText.imageList,
         text: this.questionList[bankindex].ansText.text,
       });
+      this.$u.toast("已确认答案");
       this.isDoOver();
     },
 
@@ -2852,6 +2879,7 @@ export default {
           this.questionList[bankindex].jsonStr[ansindex].ansText.imageList,
         text: this.questionList[bankindex].jsonStr[ansindex].ansText.text,
       });
+      this.$u.toast("已确认答案");
       this.isDoOver();
     },
     isCheck(item, index) {
@@ -3107,6 +3135,7 @@ export default {
 <style lang="scss" scoped>
 .photoBox {
   width: 100%;
+
   // background-color: #ffffff;
   // border-radius: 24px 24px 0px 0px;
   .photoTop {
@@ -3118,6 +3147,7 @@ export default {
     align-items: center;
     justify-content: center;
     padding: 0rpx 38rpx;
+
     .sqzz {
       width: 28rpx;
       height: 28rpx;
@@ -3125,54 +3155,66 @@ export default {
       align-items: center;
       justify-content: center;
     }
+
     .centersq {
       color: #333;
       font-size: 30rpx;
       font-weight: 500;
     }
   }
+
   .photoCenter {
     width: 750rpx;
     height: 75vh;
     position: relative;
+
     .center_camera {
       width: 100%;
       height: 75vh;
       position: fixed;
+
       .head_take {
         width: 100%;
         height: 75vh;
         display: flex;
         flex-direction: column;
       }
+
       .headTake_up {
         width: 100%;
         height: 100rpx;
       }
+
       .headTake_minddle {
         display: flex;
+
         .min_img {
           width: 500rpx;
           height: 550rpx;
         }
+
         .min_left,
         .min_right {
           flex: 1;
           height: 550rpx;
         }
       }
+
       .headTake_down {
         width: 100%;
         flex: 1;
       }
+
       .color {
         background-color: #333;
         opacity: 0.5;
       }
+
       .photo_v {
         width: 100%;
         height: 100%;
       }
+
       .mask {
         width: 500rpx;
         height: 550rpx;
@@ -3185,6 +3227,7 @@ export default {
         box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.4);
       }
     }
+
     .custom {
       width: 750rpx;
       height: 75vh;
@@ -3192,6 +3235,7 @@ export default {
       z-index: 1000;
       top: 0;
       left: 0;
+
       image {
         width: 100%;
         height: 100%;
@@ -3201,6 +3245,7 @@ export default {
 
   .photoBoxbtns {
     display: flex;
+
     .takePhoto_btn {
       width: 100%;
       display: flex;
@@ -3208,6 +3253,7 @@ export default {
       justify-content: space-between;
       background: #a9a7a9;
       padding: 40rpx 26rpx;
+
       .middle_btn {
         width: 120rpx;
         height: 120rpx;
@@ -3217,18 +3263,21 @@ export default {
         align-items: center;
         justify-content: center;
       }
+
       .square {
         width: 96rpx;
         height: 96rpx;
         background: #ffffff;
         border-radius: 28rpx;
       }
+
       .rights {
         font-size: 32rpx;
         font-weight: 500;
         color: #ffffff;
       }
     }
+
     .btnResult {
       height: 100rpx;
       width: 100%;
@@ -3246,24 +3295,29 @@ export default {
   position: relative;
   z-index: 20000;
 }
+
 .questionBank {
   width: 100%;
   height: 100vh;
   display: flex;
   flex-direction: column;
 }
+
 .swiper {
   width: 100%;
   flex: 1;
 }
+
 .lisSty {
   margin-bottom: 16rpx;
   display: flex;
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
+
 .activeTI {
   vertical-align: middle;
   display: inline-block;
@@ -3313,10 +3367,12 @@ export default {
     opacity: 0.6;
   }
 }
+
 .titles {
   overflow: hidden;
   margin-bottom: 24rpx;
 }
+
 .titBox {
   padding: 41rpx 25rpx 24rpx 25rpx;
 }
@@ -3328,6 +3384,7 @@ export default {
 .tabs {
   margin: 10rpx;
   display: flex;
+
   .tab {
     margin: 0 4rpx;
     padding: 10rpx 13rpx;
@@ -3350,6 +3407,7 @@ export default {
   .ans_input {
     border-radius: 16rpx;
     background: #fff;
+
     .top {
       border-bottom: 1rpx solid #eeeeee;
       padding: 16rpx;
@@ -3394,6 +3452,7 @@ export default {
       overflow: hidden;
       display: flex;
       width: 100%;
+
       .img {
         width: 104rpx;
         height: 104rpx;
@@ -3431,6 +3490,7 @@ export default {
       overflow: hidden;
       display: flex;
       width: 100%;
+
       .img {
         width: 104rpx;
         height: 104rpx;
@@ -3446,10 +3506,12 @@ export default {
     }
   }
 }
+
 .leftLetters {
   display: flex;
   align-items: center;
   width: 220rpx;
+
   .btnType {
     padding: 5rpx 10rpx;
     border: 1rpx solid #007aff;
@@ -3460,15 +3522,18 @@ export default {
     margin-right: 15rpx;
   }
 }
+
 .firstLetter {
   display: flex;
   justify-content: space-between;
   align-items: center;
   margin-bottom: 30rpx;
 }
+
 .popupView {
   height: 100%;
   padding-bottom: 100rpx;
+
   .popupTops {
     height: 77rpx;
     border-bottom: 1rpx solid #eee;
@@ -3477,6 +3542,7 @@ export default {
     font-size: 24rpx;
     color: #999;
     position: relative;
+
     .topIcon {
       position: absolute;
       top: 10rpx;
@@ -3488,9 +3554,11 @@ export default {
       border-radius: 4rpx;
     }
   }
+
   .popupContent {
   }
 }
+
 .pageContent {
   position: relative;
   background-color: #eaeef1;
@@ -3499,6 +3567,7 @@ export default {
   padding-bottom: 100rpx;
   overflow-y: scroll;
 }
+
 .pad_8 {
   background-color: #fff;
   margin: 0rpx 8rpx 8rpx;
@@ -3509,6 +3578,7 @@ export default {
     border-radius: 0 0 16rpx 16rpx;
   }
 }
+
 .answer {
   height: 80rpx;
   line-height: 80rpx;
@@ -3519,6 +3589,7 @@ export default {
   color: #666;
   font-size: 30rpx;
 }
+
 .footer_btn {
   background-color: #fff;
   z-index: 10078;
@@ -3547,12 +3618,14 @@ export default {
       width: 100%;
       display: flex;
       justify-content: center;
+
       image {
         width: 58rpx;
         height: 21rpx;
       }
     }
   }
+
   .collect {
     visibility: hidden;
     width: 100rpx;
@@ -3580,9 +3653,11 @@ export default {
     }
   }
 }
+
 .boxSty {
   padding: 44rpx 41rpx 0rpx;
 }
+
 .liListSty {
   border: 1rpx solid #eeeeee;
   width: 88rpx;
@@ -3618,20 +3693,24 @@ export default {
     color: #fff;
     background: blue;
   }
+
   &.check_ans {
     border: 1rpx solid #eeeeee;
     color: #fff;
     background: #007aff;
   }
 }
+
 .answerInfos {
   padding: 25rpx 25rpx 25rpx 23rpx;
 }
+
 .answerTitle {
   margin-bottom: 28rpx;
   color: #666;
   font-size: 30rpx;
 }
+
 .answerContent {
   font-size: 30rpx;
   color: #666;
@@ -3779,6 +3858,7 @@ export default {
     }
   }
 }
+
 .popboxs {
   width: 100%;
   height: 100%;
@@ -3786,6 +3866,7 @@ export default {
   flex-direction: column;
   align-items: center;
 }
+
 .classTops {
   flex-shrink: 0;
   padding: 39rpx 0rpx 4rpx;
@@ -3793,17 +3874,20 @@ export default {
   color: #333;
   font-size: 30rpx;
 }
+
 .textStys {
   width: 100%;
   flex: 1;
   padding: 36rpx;
 }
+
 .classFootsty {
   flex-shrink: 0;
   display: flex;
   align-items: center;
   justify-content: center;
   padding: 10rpx 0rpx 40rpx;
+
   .btnsty {
     width: 200rpx;
     height: 80rpx;
@@ -3813,10 +3897,12 @@ export default {
     text-align: center;
     line-height: 80rpx;
   }
+
   .btns1 {
     background-color: #f5f5f5;
     color: #007aff;
   }
+
   .btns2 {
     margin-left: 40rpx;
     background-color: #007aff;

+ 70 - 77
pages2/learn/my_learn.vue

@@ -26,83 +26,84 @@
         >
         <view class="learnItem" v-for="(item, index) in listData" :key="index">
           <view class="title">{{ item.goodsName }}</view>
-          <view class="status">
-            <view class="label">审核状态:</view>
-            <view
-              class="val"
-              :class="
-                item.periodStatus === -1
-                  ? 'red'
-                  : item.periodStatus === 1
-                  ? 'green'
-                  : item.periodStatus === 2 || item.periodStatus === 3
-                  ? 'blue'
-                  : ''
-              "
-            >
-              <text>
-                {{
+          <template v-if="!item.externalLinkStatus">
+            <view class="status">
+              <view class="label">审核状态:</view>
+              <view
+                class="val"
+                :class="
                   item.periodStatus === -1
-                    ? "不可审核"
+                    ? 'red'
                     : item.periodStatus === 1
-                    ? "机构审核通过"
-                    : item.periodStatus === 2
-                    ? "等待审核"
-                    : item.periodStatus === 3
-                    ? "审核中"
-                    : item.periodStatus === 0
-                    ? "机构审核不通过"
-                    : ""
-                }}
-              </text>
-              <view
-                v-if="item.periodStatus === 0"
-                style="font-size: 24rpx; color: #666"
+                    ? 'green'
+                    : item.periodStatus === 2 || item.periodStatus === 3
+                    ? 'blue'
+                    : ''
+                "
               >
-                有
-                <text style="color: #ff3b30">{{ item.rebuild }}节</text>
-                需要重修
+                <text>
+                  {{
+                    item.periodStatus === -1
+                      ? "不可审核"
+                      : item.periodStatus === 1
+                      ? "机构审核通过"
+                      : item.periodStatus === 2
+                      ? "等待审核"
+                      : item.periodStatus === 3
+                      ? "审核中"
+                      : item.periodStatus === 0
+                      ? "机构审核不通过"
+                      : ""
+                  }}
+                </text>
+                <view
+                  v-if="item.periodStatus === 0"
+                  style="font-size: 24rpx; color: #666"
+                >
+                  有
+                  <text style="color: #ff3b30">{{ item.rebuild }}节</text>
+                  需要重修
+                </view>
               </view>
             </view>
-          </view>
-
-          <view class="tip" v-if="item.periodStatus === 1">
-            <template
-              v-if="
-                item.educationName == '继续教育' &&
-                item.businessName == '二级' &&
-                item.projectName == '建造师'
-              "
-            >
+            <view class="tip" v-if="item.periodStatus === 1">
+              <template
+                v-if="
+                  item.educationName == '继续教育' &&
+                  item.businessName == '二级' &&
+                  item.projectName == '建造师'
+                "
+              >
+                <view class="label">审核提示:</view>
+                <view>
+                  机构已审核通过,需等待注册中心复审后即可获得继续教育学时。审核时间约15个工作日,届时请前往官网申请证书延期。
+                  <view class="copySty" @tap="copyText">复制官网链接</view>
+                </view>
+              </template>
+            </view>
+            <view class="tip" v-else>
               <view class="label">审核提示:</view>
-              <view>
-                机构已审核通过,需等待注册中心复审后即可获得继续教育学时。审核时间约15个工作日,届时请前往官网申请证书延期。
-                <view class="copySty" @tap="copyText">复制官网链接</view>
-              </view>
-            </template>
-          </view>
-          <view class="tip" v-else>
-            <view class="label">审核提示:</view>
-            <view class="val color666" v-if="item.periodStatus === -1"
-              >您的学时还未修完,请尽快完成课程学习</view
-            >
-            <view class="val color666" v-if="item.periodStatus === 2"
-              >学习完成后7-15个工作日完成学时审核。</view
-            >
-            <view class="val color666" v-if="item.periodStatus === 0"
-              >请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。</view
-            >
-            <view class="val color666" v-if="item.periodStatus === 3"
-              >会在7-15个工作日左右完成学时审核</view
-            >
-          </view>
+              <view class="val color666" v-if="item.periodStatus === -1"
+                >您的学时还未修完,请尽快完成课程学习</view
+              >
+              <view class="val color666" v-if="item.periodStatus === 2"
+                >学习完成后7-15个工作日完成学时审核。</view
+              >
+              <view class="val color666" v-if="item.periodStatus === 0"
+                >请查看需重学记录,并及时重学对应课程,以免延误学时审核进度。</view
+              >
+              <view class="val color666" v-if="item.periodStatus === 3"
+                >会在7-15个工作日左右完成学时审核</view
+              >
+            </view>
+          </template>
           <view v-if="item.periodStatus !== 2">
             <u-line color="#EEEEEE" />
             <view v-if="item.periodStatus === -1">
               <view class="btnBox"
                 ><view
                   class="btn"
-                  v-if="!showLearn(item)"
+                  v-if="item.externalLinkStatus || !showLearn(item)"
                   @click="jumpPage(item, 1, index)"
                   >课程学习</view
                 ></view
@@ -235,7 +236,6 @@ export default {
         {
           name: "学时审核",
         },
-        
       ],
       param: {
         pageNum: 1,
@@ -274,17 +274,6 @@ export default {
   },
   methods: {
     showLearn(item) {
-      console.log(item.goodsName);
-      console.log(
-        (item.interfacePushId > 0 && item.officialStatus != 1) ||
-          this.sysTime <= item.serviceStartTime ||
-          this.sysTime >= item.serviceEndTime ||
-          (item.classStartTime && this.sysTime <= item.classStartTime) ||
-          (item.classEndTime && this.sysTime >= item.classEndTime) ||
-          item.learningStatus == 2 ||
-          item.classStatus == 0 ||
-          (item.learningStatus == 3 && this.sysTime < item.learningTimeStart)
-      );
       return (
         (item.interfacePushId > 0 && item.officialStatus != 1) ||
         this.sysTime <= item.serviceStartTime ||
@@ -322,6 +311,10 @@ export default {
       });
     },
     jumpPage(v, int, index, appoint) {
+      if (v.externalLinkStatus) {
+        this.$method.toLink(v.externalLink);
+        return;
+      }
       console.log("--item", v);
       // return
       this.itemIndex = index;

+ 70 - 31
pages2/order/index.vue

@@ -70,7 +70,6 @@
                   "
                 >
                   <view
-                    class="btn2"
                     v-if="
                       items.refundStatus === 0 &&
                       (item.orderFrom === 2 || item.orderFrom === 3) &&
@@ -82,11 +81,12 @@
                         items.goodsType == '6') &&
                       items.goodsPrice > 0
                     "
-                    @click.stop="refund(item.orderSn, items.goodsId)"
-                    >退款</view
+                    class="btn2"
+                    @click.stop="handelRefund(item.orderSn, items.goodsId)"
+                    >申请退款</view
                   >
                   <!-- <view v-if="items.refundStatus == 2"> 已退款</view> -->
-                  <view v-if="item.periodStatus">{{
+                  <view v-if="items.periodStatus !== null">{{
                     [
                       "复审不通过",
                       "初审不通过",
@@ -94,7 +94,7 @@
                       "初审通过",
                       "复审通过待退款",
                       "已退款",
-                    ][item.periodStatus + 2]
+                    ][items.periodStatus + 2]
                   }}</view>
                 </view>
               </view>
@@ -170,6 +170,29 @@
         </view>
       </template>
     </view>
+    <!-- 退款弹窗 -->
+    <u-popup
+      v-model="show"
+      :mask-close-able="false"
+      closeable
+      mode="center"
+      width="80%"
+      border-radius="24"
+    >
+      <view class="rf-popup-main">
+        <view class="title">提示</view>
+        <view class="tip">确认要退款吗</view>
+        <u-input
+          v-model="refundForm.applyReason"
+          placeholder-style="color:#999999"
+          type="textarea"
+          placeholder="请输入退款原因"
+        />
+        <u-button type="primary" style="border-radius: 60rpx" @click="refund"
+          >确定</u-button
+        >
+      </view>
+    </u-popup>
   </view>
 </template>
 
@@ -208,6 +231,9 @@ export default {
       pageNum2: 0,
       pageNum3: 0,
       pageNum4: 0,
+      refundForm: {},
+      show: false,
+      value: "",
     };
   },
   // onPullDownRefresh() {},
@@ -215,7 +241,6 @@ export default {
     this.current = +option.current || 0;
     this.getOrderList();
     this.getOrderNum();
-    console.log(this.current);
   },
   onShow() {
     /* if(this.current === 2 && this.$method.isLogin()){
@@ -286,30 +311,23 @@ export default {
         url: `/pages2/invoice/index`,
       });
     },
-    refund(orderSn, goodsId) {
-      uni.showModal({
-        title: "提示",
-        content: "确定要退款吗",
-        success: (res) => {
-          if (res.confirm) {
-            let self = this;
-            this.$api
-              .refundSmallOrder({ orderSn: orderSn, goodsId: goodsId })
-              .then((res) => {
-                if (res.data.code == 200) {
-                  if (res.data.code === 200) {
-                    self.$method.showToast("退款成功");
-                    self.getOrderList();
-                  }
-                } else {
-                  uni.showToast({
-                    icon: "none",
-                    title: "不可以退款哦",
-                  });
-                }
-              });
-          }
-        },
+    confirm() {},
+    handelRefund(orderSn, goodsId) {
+      this.refundForm = { orderSn: orderSn, goodsId: goodsId, applyReason: "" };
+      this.show = true;
+    },
+    refund() {
+      this.$api.refundSmallOrder(this.refundForm).then((res) => {
+        this.show = false;
+        if (res.data.code == 200) {
+          this.$method.showToast(res.data.msg);
+          this.getOrderList();
+        } else {
+          uni.showToast({
+            icon: "none",
+            title: res.data.msg,
+          });
+        }
       });
     },
     /**
@@ -753,4 +771,25 @@ page {
   align-items: center;
   padding: 0 30rpx;
 }
-</style>
+.rf-popup-main {
+  text-align: center;
+  padding: 40rpx;
+  .title {
+    font-size: 40rpx;
+    font-weight: 600;
+  }
+  .tip {
+    margin: 30rpx 0 40rpx;
+    font-size: 32rpx;
+  }
+  .u-input {
+    border-radius: 20rpx;
+    background: #eee;
+    padding-left: 20rpx !important;
+    margin-bottom: 40rpx;
+  }
+  .u-button {
+    border-radius: 60rpx !important;
+  }
+}
+</style>

+ 316 - 261
pages2/register/forget.vue

@@ -1,277 +1,332 @@
 <template>
-	<view style="height: 100%;">
-		<image mode="widthFix" src="/pages2/static/login_bg.jpg" class="full_img"></image>
-		<u-navbar title="忘记密码" :border-bottom="false" background="{ background: '#ffffff',opacity:0.4; }" title-color="#ffffff" back-icon-color="#ffffff"></u-navbar>
-		<view style="padding: 30rpx;">
-			<view class="login_box">
-				<u-form :model="form" ref="uForm" >
-					<u-form-item prop="tel" ref="tel"><u-input  v-model="form.tel" type="number" maxlength="11" placeholder-style="color:#999999" placeholder="手机号"/></u-form-item>
-					<u-form-item prop="code">
-						<u-input v-model="form.code" type="number" placeholder-style="color:#999999"  placeholder="验证码"/>
-						<u-button slot="right"  size="mini" @click="getCode">{{codeTips}}</u-button>
-					</u-form-item>
-					<u-form-item prop="pwd"><u-input class="password" placeholder-style="color:#999999" v-model="form.pwd" type="password" placeholder="请输入新密码"/></u-form-item>
-					<u-form-item prop="pwdAgain"><u-input class="password" placeholder-style="color:#999999" v-model="form.pwdAgain" type="password" placeholder="再次输入新密码"/></u-form-item>
-				</u-form>
-			</view>
-			
-			<button :disabled="isUse" class="loginBtn" :class="{able:canSubmit()}" @click="submit">
-				确定
-			</button>
-			
-		</view>
-		<u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
-	</view>
+  <view style="height: 100%">
+    <image
+      mode="widthFix"
+      src="/pages2/static/login_bg.jpg"
+      class="full_img"
+    ></image>
+    <u-navbar
+      title="忘记密码"
+      :border-bottom="false"
+      background="{ background: '#ffffff',opacity:0.4; }"
+      title-color="#ffffff"
+      back-icon-color="#ffffff"
+    ></u-navbar>
+    <view style="padding: 30rpx">
+      <view class="login_box">
+        <u-form :model="form" ref="uForm">
+          <u-form-item prop="tel" ref="tel"
+            ><u-input
+              v-model="form.tel"
+              type="number"
+              maxlength="11"
+              placeholder-style="color:#999999"
+              placeholder="手机号"
+          /></u-form-item>
+          <u-form-item prop="code">
+            <u-input
+              v-model="form.code"
+              type="number"
+              placeholder-style="color:#999999"
+              placeholder="验证码"
+            />
+            <u-button slot="right" size="mini" @click="getCode">{{
+              codeTips
+            }}</u-button>
+          </u-form-item>
+          <u-form-item prop="pwd"
+            ><u-input
+              class="password"
+              placeholder-style="color:#999999"
+              v-model="form.pwd"
+              type="password"
+              placeholder="请输入新密码"
+          /></u-form-item>
+          <u-form-item prop="pwdAgain"
+            ><u-input
+              class="password"
+              placeholder-style="color:#999999"
+              v-model="form.pwdAgain"
+              type="password"
+              placeholder="再次输入新密码"
+          /></u-form-item>
+        </u-form>
+      </view>
+
+      <button
+        :disabled="isUse"
+        class="loginBtn"
+        :class="{ able: canSubmit() }"
+        @click="submit"
+      >
+        确定
+      </button>
+    </view>
+    <u-verification-code
+      seconds="60"
+      ref="uCode"
+      @change="codeChange"
+    ></u-verification-code>
+  </view>
 </template>
 
 <script>
 export default {
-	data() {
-		return {
-			code: '',
-			form:{
-				code:'',
-				tel:'',
-				pwd:'',
-				pwdAgain:''
-			},
-			rules: {
-				tel: [
-					{ 
-						required: true, 
-						message: '请输入手机号', 
-						// 可以单个或者同时写两个触发验证方式 
-						trigger: ['change'],
-					},
-					{
-						validator: (rule, value, callback) => {
-							// 上面有说,返回true表示校验通过,返回false表示不通过
-							// this.$u.test.mobile()就是返回true或者false的
-							return this.$u.test.mobile(value);
-						},
-						message: '手机号码格式不正确',
-						// 触发器可以同时用blur和change
-						trigger: ['change'],
-					}
-				],
-				pwd: [
-					{ 
-						required: true, 
-						message: '请输入密码', 
-						// 可以单个或者同时写两个触发验证方式 
-						trigger: ['change'],
-					}
-				],
-				pwdAgain: [
-					{ 
-						required: true, 
-						message: '请输入密码', 
-						// 可以单个或者同时写两个触发验证方式 
-						trigger: ['change'],
-					}
-				],
-				code: [
-					{ 
-						required: true, 
-						message: '请输入验证码', 
-						// 可以单个或者同时写两个触发验证方式 
-						trigger: ['change'],
-					}
-				],
-			},
-			codeTips: '',
-			read:'',
-			isUse:false
-		};
-	},
-	methods: {
-		canSubmit() {
-			if(this.form.tel && this.form.code && this.form.pwd && this.form.pwdAgain) {
-				return true;
-			}
-			return false;
-		},
-		submit(){
-			let that = this
-			if(!this.form.tel){
-				this.$u.toast('请输入手机号码');
-				return 
-			}
-			if(!this.form.code){
-				this.$u.toast('请输入验证码');
-				return 
-			}
-			if(!this.form.pwd){
-				this.$u.toast('请输入新密码');
-				return 
-			}
-			if(!this.form.pwdAgain){
-				this.$u.toast('请输入确定新密码');
-				return 
-			}
-			if(this.form.pwd!=this.form.pwdAgain){
-				this.$u.toast('两次密码不一致');
-				return 
-			}
-			that.isUse = true
-			let datas = {
-				tel:this.form.tel,
-				code:this.form.code,
-				pwd:this.form.pwd
-				}
-			that.$api.forgetUser(datas).then(
-				res => {
-					that.isUse = false
-					if (res.data.code == 200) {
-						uni.showModal({
-							title: '提示',
-							content: '修改成功',
-							showCancel:false,
-							success: function(resst) {
-								uni.navigateBack()
-							}
-						});
-					} else {
-						that.$u.toast(res.data.msg);
-					}
-				},
-				err => {
-					that.isUse = false
-					console.log(err);
-				}
-			);
-		},
-		codeChange(text) {
-			this.codeTips = text;
-		},
-		// 获取验证码
-		getCode() {
-			let that = this
-			if(that.$refs.uCode.canGetCode) {
-				if(that.$refs.tel.validateState == 'success') {
-					let datas = {tel:this.form.tel}
-					that.$api.forgetSms(datas).then(
-						res => {
-							if (res.data.code == 200) {
-								that.$u.toast('验证码已发送');
-								// 通知验证码组件内部开始倒计时
-								that.$refs.uCode.start();
-							} else {
-								that.$u.toast(res.data.msg);
-							}
-						},
-						err => {
-							console.log(err);
-						});
-				} else {
-					this.$refs.tel.onFieldChange()
-				}
-			}
-				
-		},
-	},
-	onLoad(option) {
-		let that = this;
-		// this.from = option.from; // 看页面没有用到
-		uni.login({
-			provider: 'weixin',
-			success: function(loginRes) {
-				that.code = loginRes.code;
-			}
-		});
-	},
-	onReady() {
-		this.$refs.uForm.setRules(this.rules)
-	},
+  data() {
+    return {
+      code: "",
+      form: {
+        code: "",
+        tel: "",
+        pwd: "",
+        pwdAgain: "",
+      },
+      rules: {
+        tel: [
+          {
+            required: true,
+            message: "请输入手机号",
+            // 可以单个或者同时写两个触发验证方式
+            trigger: ["change"],
+          },
+          {
+            validator: (rule, value, callback) => {
+              // 上面有说,返回true表示校验通过,返回false表示不通过
+              // this.$u.test.mobile()就是返回true或者false的
+              return this.$u.test.mobile(value);
+            },
+            message: "手机号码格式不正确",
+            // 触发器可以同时用blur和change
+            trigger: ["change"],
+          },
+        ],
+        pwd: [
+          {
+            required: true,
+            message: "请输入密码",
+            // 可以单个或者同时写两个触发验证方式
+            trigger: ["change"],
+          },
+        ],
+        pwdAgain: [
+          {
+            required: true,
+            message: "请输入密码",
+            // 可以单个或者同时写两个触发验证方式
+            trigger: ["change"],
+          },
+        ],
+        code: [
+          {
+            required: true,
+            message: "请输入验证码",
+            // 可以单个或者同时写两个触发验证方式
+            trigger: ["change"],
+          },
+        ],
+      },
+      codeTips: "",
+      read: "",
+      isUse: false,
+    };
+  },
+  methods: {
+    canSubmit() {
+      if (
+        this.form.tel &&
+        this.form.code &&
+        this.form.pwd &&
+        this.form.pwdAgain
+      ) {
+        return true;
+      }
+      return false;
+    },
+    submit() {
+      let that = this;
+      if (!this.form.tel) {
+        this.$u.toast("请输入手机号码");
+        return;
+      }
+      if (!this.form.code) {
+        this.$u.toast("请输入验证码");
+        return;
+      }
+      if (!this.form.pwd) {
+        this.$u.toast("请输入新密码");
+        return;
+      }
+      if (!this.form.pwdAgain) {
+        this.$u.toast("请输入确定新密码");
+        return;
+      }
+      if (this.form.pwd != this.form.pwdAgain) {
+        this.$u.toast("两次密码不一致");
+        return;
+      }
+      that.isUse = true;
+      let datas = {
+        tel: this.form.tel,
+        code: this.form.code,
+        pwd: this.form.pwd,
+      };
+      that.$api.forgetUser(datas).then(
+        (res) => {
+          that.isUse = false;
+          if (res.data.code == 200) {
+            uni.showModal({
+              title: "提示",
+              content: "修改成功",
+              showCancel: false,
+              success: function (resst) {
+                uni.navigateBack();
+              },
+            });
+          } else {
+            that.$u.toast(res.data.msg);
+          }
+        },
+        (err) => {
+          that.isUse = false;
+          console.log(err);
+        }
+      );
+    },
+    codeChange(text) {
+      this.codeTips = text;
+    },
+    // 获取验证码
+    getCode() {
+      let that = this;
+      if (that.$refs.uCode.canGetCode) {
+        if (that.$refs.tel.validateState == "success") {
+          let datas = { tel: this.form.tel };
+          that.$api.forgetSms(datas).then(
+            (res) => {
+              if (res.data.code == 200) {
+                that.$u.toast("验证码已发送");
+                // 通知验证码组件内部开始倒计时
+                that.$refs.uCode.start();
+              } else {
+                that.$u.toast(res.data.msg);
+              }
+            },
+            (err) => {
+              console.log(err);
+            }
+          );
+        } else {
+          this.$refs.tel.onFieldChange();
+        }
+      }
+    },
+  },
+  onLoad(option) {
+    let that = this;
+    // this.from = option.from; // 看页面没有用到
+    uni.login({
+      provider: "weixin",
+      success: function (loginRes) {
+        that.code = loginRes.code;
+      },
+    });
+  },
+  onReady() {
+    this.$refs.uForm.setRules(this.rules);
+  },
 };
 </script>
 
 <style scoped lang="scss">
-	.wxBtn{
-		position: fixed;
-		bottom: 10%;
-		width: 100%;
-		left: 0;
-	}
-	/deep/ .wxBtn button::after{
-	    border: none; 
-	}
-	.loginBtn{
-		width: 526rpx;
-		height: 80rpx;
-		background: linear-gradient(90deg, #015EEA, #00C0FA);
-		box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
-		opacity: 0.6;
-		border-radius: 40rpx;
-		color: #FFFFFF;
-		text-align: center;
-		line-height: 80rpx;
-		margin: 40rpx auto;
-		
-		&.able {
-			opacity: 1;
-		}
-	}
-	
-	
-	.wxloginBtn{
-		background: url("/static/loginBtn.png") no-repeat;
-		background-size:100% 100%;
-		border:none;
-		width: 100rpx;
-		height: 100rpx;
-	}
-	
-	/deep/page {
-		background-color: #FFFFFF;
-		height: 100%;
-		width: 100%;
-	}
-	.login_box{
-		width: 100%;
-		height: 566rpx;
-		background: #FFFFFF;
-		box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(1, 99, 235, 0.1);
-		border-radius: 24rpx;
-		margin-top: 30rpx;
-		padding:40rpx 35rpx;
-		
-		.password {
-			/deep/.uicon-eye-fill {
-				&::before{
-					color:#007AFF;
-					content:"\e613";
-				}
-			}
-		}
-	}
-	/deep/ .u-item-bg{
-		border-radius: 32px !important;
-	}
-	/deep/ .u-subsection{
-		border-radius: 32px !important;
-	}
+.wxBtn {
+  position: fixed;
+  bottom: 10%;
+  width: 100%;
+  left: 0;
+}
+/deep/ .wxBtn button::after {
+  border: none;
+}
+.loginBtn {
+  width: 526rpx;
+  height: 80rpx;
+  background: linear-gradient(90deg, #015eea, #00c0fa);
+  box-shadow: 0rpx 10rpx 16rpx 4rpx rgba(1, 99, 235, 0.04);
+  opacity: 0.6;
+  border-radius: 40rpx;
+  color: #ffffff;
+  text-align: center;
+  line-height: 80rpx;
+  margin: 40rpx auto;
+
+  &.able {
+    opacity: 1;
+  }
+}
+
+.wxloginBtn {
+  background: url("/static/loginBtn.png") no-repeat;
+  background-size: 100% 100%;
+  border: none;
+  width: 100rpx;
+  height: 100rpx;
+}
+
+/deep/page {
+  background-color: #ffffff;
+  height: 100%;
+  width: 100%;
+}
+.login_box {
+  width: 100%;
+  height: 566rpx;
+  background: #ffffff;
+  box-shadow: 0rpx 0rpx 16rpx 4rpx rgba(1, 99, 235, 0.1);
+  border-radius: 24rpx;
+  margin-top: 30rpx;
+  padding: 40rpx 35rpx;
+
+  .password {
+    /deep/.uicon-eye-fill {
+      &::before {
+        color: #007aff;
+        content: "\e613";
+      }
+    }
+  }
+}
+/deep/ .u-item-bg {
+  border-radius: 32px !important;
+}
+/deep/ .u-subsection {
+  border-radius: 32px !important;
+}
 .full_img {
-	position: absolute;
-	left: 0;
-	display: block;
-	width: 100%;
-	z-index: -999;
-	top: 0;
+  position: absolute;
+  left: 0;
+  display: block;
+  width: 100%;
+  z-index: -999;
+  top: 0;
 }
 
 .head {
-	height: 96rpx;
-	width: 100%;
-	line-height: 96rpx;
-	margin-top: 40rpx;
-	text-align: center;
-	display: flex;
-	position: relative;
-	justify-content: center;
+  height: 96rpx;
+  width: 100%;
+  line-height: 96rpx;
+  margin-top: 40rpx;
+  text-align: center;
+  display: flex;
+  position: relative;
+  justify-content: center;
 }
 .icon {
-	position: absolute;
-	left: 30rpx;
+  position: absolute;
+  left: 30rpx;
+}
+.aa {
+  padding: 10rpx;
+  text-align: center;
+  margin-top: 10rpx;
 }
-</style>
+</style>

+ 1 - 0
pages2/subject/collectBank.vue

@@ -1412,6 +1412,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/subject/collectTypeBank.vue

@@ -1311,6 +1311,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/subject/wrongBank.vue

@@ -1499,6 +1499,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages2/subject/wrongTypeBank.vue

@@ -1374,6 +1374,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages3/live/detail.vue

@@ -2931,6 +2931,7 @@ page {
   .flex_auto {
     flex: 1;
     margin-left: 10%;
+    word-break: break-all;
   }
 
   .btn {

+ 1 - 1
pages3/polyv/detail.vue

@@ -4274,7 +4274,7 @@ export default {
   .flex_auto {
     flex: 1;
     margin-left: 10%;
-
+    word-break: break-all;
     // .input {
     //   height: 60rpx;
     // }

+ 886 - 816
pages5/examAppointList/index.vue

@@ -1,854 +1,924 @@
 <template>
-	<view>
-		<nav-bar title="模考预约" class="nav"></nav-bar>
-		<view class="tabs">
-			<view class="tab" :class="{ active: index == 1 }" data-index="1" @click="tab(1)">
-				<view>{{ businessName}}</view>
-				<u-icon class="icon" :class="index ==1? 'animals':''" name="arrow-down"></u-icon>
-			</view>
-			<view class="tab" :class="{ active: index == 2 }" data-index="2">
-				<view class="dateRange">
-					<picker mode="date" :value="param.startTime" :end="endDate" @change="bindDateFromChange">
-						<view class="uni-input">{{param.startTime || '开始时间'}}</view>
-					</picker>
-					- 
-					<picker mode="date" :value="param.endTime" :end="endDate" @change="bindDateToChange">
-						<view class="uni-input">{{param.endTime || '结束时间'}}</view>
-					</picker></view>
-				<u-icon class="icon" name="calendar"></u-icon>
-			</view>
-		</view>
-		<view class="scroll">
-			<scroll-view scroll-x="true" class="scroll-x" >
-				<view class="content">
-					<view v-for="(item,index) in sList" :key="index" class="scroll-tag" :class="{active:param.majorId == item.id}" @click="tagSelect(item)">{{item.categoryName}}</view>
-				</view>
-				
-			</scroll-view>
-		</view>
-		
-
-		<view class="record">
-			<view class="item" v-for="(item,index) in mockList" :key="index">
-				<view class="item__header">{{item.subjectName}}</view>
-				<view class="item__body">
-					<view class="title">
-						<image class="img" mode="widthFix" src="/pages5/static/time.png"></image>
-						<text>考试时间</text>
-					</view>
-					<view class="desc">{{$method.timestampToTime(item.examTime)}}
-						<view> {{item.startTime}} - {{item.endTime}} </view>
-					</view>
-					<view class="btn" @click="appoint(item)" :class="{disabled: !canApply(item) || !item.isSubscribe }">{{item.isSubscribe?'预约考试' : '已预约'}}</view>
-				</view>
-			</view>
-		</view>
-		
-		
-		<view class="notice" @click="noticeModal=true">
-			<u-icon class="icon" color="#fff" name="info-circle"></u-icon>
-			<view class="text">模考说明</view>
-		</view>
-
-		<view class="modal" :style="{top:modalTop+'px'}" v-if="index == 1">
-			<view class="content">
-				<scroll-view scroll-y="true" style="height:100%">
-					<view class="list">
-						<view class="item" :class="param.businessId == listItem.businessId ? 'activesty' : ''" v-for="(listItem,listIndex) in businesslist" :key="listIndex" @click="testClick(listItem)">
-							{{ listItem.educationName }}:{{ listItem.businessName }}-{{listItem.projectName}}
-						</view>
-					</view>
-				</scroll-view>
-				
-			</view>
-			<view class="modal_wrap" @click="index = 0"></view>
-		</view>
-		
-		
-		<u-popup class="notice__modal" v-model="noticeModal" mode="center" border-radius="24" :mask-close-able="false">
-			<view class="notice__content">
-				<view class="body">
-					<scroll-view scroll-y="true" style="height:700rpx">
-						<view class="content">
-							<view class="bold text">模拟考试说明</view>
-							
-							<view>在您注册过程中,您需要完成我们的注册流程并通过点击“同意并继续”的形式在线签署以下协议及政策,请您务必仔细阅读、充分理解协议中的条款内容后再点击同意(尤其是以粗体标识的条款,因为这些条款可能会明确您应履行的义务或对您的权利有所限制)。
-							</view>
-							
-						</view>
-					</scroll-view>
-				</view>
-				<view class="footer">
-					<view class="btn close" @click="noticeModal = false">我知道了</view>
-				</view>
-			</view>
-		</u-popup>
-		
-		<view class="appoint__modal" v-if="appointModal" mode="center" border-radius="24" :mask-close-able="false">
-			<view class="appoint__content">
-				<view class="body">
-						<image class="img" src="/pages5/static/img-header.png" mode="widthFix"></image>
-						<view class="content">
-							<view class="bold center">模拟考试说明</view>
-							
-							<view>
-								您预约的模拟考试,安排如下: 
-							</view>
-							<view>
-								<text class="bold text">模考场次: </text>
-								<text class="text">{{showItem.applyName}}</text>
-							</view>
-							<view>
-								<text class="bold text">项目:   </text>
-								<text class="text">{{ showItem.businessName }} {{ showItem.projectName }}</text>
-							</view>
-							<view>
-								<text class="bold text">专业:</text>
-								<text class="text">{{showItem.categoryName}}</text>
-							</view>
-							<view>
-								<text class="bold text">科目:</text>
-								<text class="text">{{showItem.subjectName}}</text>
-							</view>
-							<view>
-								<text class="bold text">考试时间:</text>
-								<text class="text">
-									{{ $method.timestampToTime(showItem.examTime) }}
-									{{ showItem.startTime }} - {{ showItem.endTime }}
-								</text>
-							</view>
-							<view>请准时参加考试哦~</view>
-							
-						</view>
-				</view>
-				<view class="footer">
-					<view class="btn close" @click="appointModal = false;openAppoint=true">我知道了</view>
-				</view>
-			</view>
-		</view>
-		
-		<u-popup class="open__modal" v-model="openAppoint" mode="center" border-radius="24" :mask-close-able="false">
-			<view class="open__content">
-				<view class="body">
-						<view class="content">
-							<view class="bold center">开考提醒</view>
-							
-							<view class="center">
-								开考前10分钟提醒入场,不错过实战机会
-							</view>
-							
-						</view>
-				</view>
-				<view class="footer">
-					<view class="btn close" @click="closeNotice()">我知道了</view>
-				</view>
-			</view>
-		</u-popup>
-	</view>
+  <view>
+    <nav-bar title="模考预约" class="nav"></nav-bar>
+    <view class="tabs">
+      <view
+        class="tab"
+        :class="{ active: index == 1 }"
+        data-index="1"
+        @click="tab(1)"
+      >
+        <view>{{ businessName }}</view>
+        <u-icon
+          class="icon"
+          :class="index == 1 ? 'animals' : ''"
+          name="arrow-down"
+        ></u-icon>
+      </view>
+      <view class="tab" :class="{ active: index == 2 }" data-index="2">
+        <view class="dateRange">
+          <picker
+            mode="date"
+            :value="param.startTime"
+            :end="endDate"
+            @change="bindDateFromChange"
+          >
+            <view class="uni-input">{{ param.startTime || "开始时间" }}</view>
+          </picker>
+          -
+          <picker
+            mode="date"
+            :value="param.endTime"
+            :end="endDate"
+            @change="bindDateToChange"
+          >
+            <view class="uni-input">{{ param.endTime || "结束时间" }}</view>
+          </picker></view
+        >
+        <u-icon class="icon" name="calendar"></u-icon>
+      </view>
+    </view>
+    <view class="scroll">
+      <scroll-view scroll-x="true" class="scroll-x">
+        <view class="content">
+          <view
+            v-for="(item, index) in sList"
+            :key="index"
+            class="scroll-tag"
+            :class="{ active: param.majorId == item.id }"
+            @click="tagSelect(item)"
+            >{{ item.categoryName }}</view
+          >
+        </view>
+      </scroll-view>
+    </view>
+
+    <view class="record">
+      <view class="item" v-for="(item, index) in mockList" :key="index">
+        <view class="item__header">{{ item.subjectName }}</view>
+        <view class="item__body">
+          <view class="title">
+            <image
+              class="img"
+              mode="widthFix"
+              src="/pages5/static/time.png"
+            ></image>
+            <text>考试时间</text>
+          </view>
+          <view class="desc"
+            >{{ $method.timestampToTime(item.examTime) }}
+            <view> {{ item.startTime }} - {{ item.endTime }} </view>
+          </view>
+          <view
+            class="btn"
+            @click="appoint(item)"
+            :class="{ disabled: !canApply(item) || !item.isSubscribe }"
+            >{{ item.isSubscribe ? "预约考试" : "已预约" }}</view
+          >
+        </view>
+      </view>
+    </view>
+
+    <view class="notice" @click="noticeModal = true">
+      <u-icon class="icon" color="#fff" name="info-circle"></u-icon>
+      <view class="text">模考说明</view>
+    </view>
+
+    <view class="modal" :style="{ top: modalTop + 'px' }" v-if="index == 1">
+      <view class="content">
+        <scroll-view scroll-y="true" style="height: 100%">
+          <view class="list">
+            <view
+              class="item"
+              :class="
+                param.businessId == listItem.businessId ? 'activesty' : ''
+              "
+              v-for="(listItem, listIndex) in businesslist"
+              :key="listIndex"
+              @click="testClick(listItem)"
+            >
+              {{ listItem.educationName }}:{{ listItem.businessName }}-{{
+                listItem.projectName
+              }}
+            </view>
+          </view>
+        </scroll-view>
+      </view>
+      <view class="modal_wrap" @click="index = 0"></view>
+    </view>
+
+    <u-popup
+      class="notice__modal"
+      v-model="noticeModal"
+      mode="center"
+      border-radius="24"
+      :mask-close-able="false"
+    >
+      <view class="notice__content">
+        <view class="body">
+          <scroll-view scroll-y="true" style="height: 700rpx">
+            <view class="content">
+              <view class="bold text">模拟考试说明</view>
+
+              <view
+                >在您注册过程中,您需要完成我们的注册流程并通过点击“同意并继续”的形式在线签署以下协议及政策,请您务必仔细阅读、充分理解协议中的条款内容后再点击同意(尤其是以粗体标识的条款,因为这些条款可能会明确您应履行的义务或对您的权利有所限制)。
+              </view>
+            </view>
+          </scroll-view>
+        </view>
+        <view class="footer">
+          <view class="btn close" @click="noticeModal = false">我知道了</view>
+        </view>
+      </view>
+    </u-popup>
+
+    <view
+      class="appoint__modal"
+      v-if="appointModal"
+      mode="center"
+      border-radius="24"
+      :mask-close-able="false"
+    >
+      <view class="appoint__content">
+        <view class="body">
+          <image
+            class="img"
+            src="/pages5/static/img-header.png"
+            mode="widthFix"
+          ></image>
+          <view class="content">
+            <view class="bold center">模拟考试说明</view>
+
+            <view> 您预约的模拟考试,安排如下: </view>
+            <view>
+              <text class="bold text">模考场次: </text>
+              <text class="text">{{ showItem.applyName }}</text>
+            </view>
+            <view>
+              <text class="bold text">项目: </text>
+              <text class="text"
+                >{{ showItem.businessName }} {{ showItem.projectName }}</text
+              >
+            </view>
+            <view>
+              <text class="bold text">专业:</text>
+              <text class="text">{{ showItem.categoryName }}</text>
+            </view>
+            <view>
+              <text class="bold text">科目:</text>
+              <text class="text">{{ showItem.subjectName }}</text>
+            </view>
+            <view>
+              <text class="bold text">考试时间:</text>
+              <text class="text">
+                {{ $method.timestampToTime(showItem.examTime) }}
+                {{ showItem.startTime }} - {{ showItem.endTime }}
+              </text>
+            </view>
+            <view>请准时参加考试哦~</view>
+          </view>
+        </view>
+        <view class="footer">
+          <view
+            class="btn close"
+            @click="
+              appointModal = false;
+              openAppoint = true;
+            "
+            >我知道了</view
+          >
+        </view>
+      </view>
+    </view>
+
+    <u-popup
+      class="open__modal"
+      v-model="openAppoint"
+      mode="center"
+      border-radius="24"
+      :mask-close-able="false"
+    >
+      <view class="open__content">
+        <view class="body">
+          <view class="content">
+            <view class="bold center">开考提醒</view>
+
+            <view class="center"> 开考前10分钟提醒入场,不错过实战机会 </view>
+          </view>
+        </view>
+        <view class="footer">
+          <view class="btn close" @click="closeNotice()">我知道了</view>
+        </view>
+      </view>
+    </u-popup>
+  </view>
 </template>
 
 <script>
-	import {mapGetters,mapActions} from 'vuex'
+import { mapGetters, mapActions } from "vuex";
 export default {
-	computed:{
-		...mapGetters(['userInfo','sysTime'])
-	},
-	data() {
-		return {
-			tagActive:'',
-			openAppoint:false,
-			appointModal:false,
-			noticeModal:false,
-			index: 0,
-			list: [],
-			list1: [],
-			mockList: [],
-			businesslist:[],
-			param: {
-				endTime:'',
-				startTime:'',
-				pageNum: 1,
-				pageSize: 10,
-				businessId:'',
-				majorId:''
-			},
-			isRepeat:false,
-			total: 0,
-			activeIndex: '',
-			typeIndex:0,
-			itemIndex:'',
-			modalTop:0,
-			endDate:'',
-			businessName:'',
-			subscribeId:0,
-			nowTime:'',
-			sList:[],
-			showItem:{},
-		};
-	},
-	async onLoad(option) {
-		this.endDate = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
-		this.nowTime = +this.$method.timest();
-			await this.setSystemTime();
-		await this.mockApplyListApplyBusiness();
-		
-		this.mockApplyListApply();
-		uni.getSystemInfo({
-			success:(e) => {
-				let info = uni.createSelectorQuery().select(".nav");
-				info.boundingClientRect((navData) => { //data - 各种参数
-				
-					let info = uni.createSelectorQuery().select(".tabs");
-					info.boundingClientRect((tabData) => { //data - 各种参数
-						this.modalTop = navData.height + tabData.height
-					}).exec()
-				}).exec()
-			}
-		})
-	},
-	onPullDownRefresh() {
-		let that = this;
-		this.param.pageNum = 1;
-		this.mockApplyListApply();
-		setTimeout(function() {
-			uni.stopPullDownRefresh();
-		}, 500);
-	},
-	onReachBottom() {
-		if (this.mockList.length < this.total) {
-			this.param.pageNum++;
-			this.mockApplyListApply();
-		}
-	},
-	onShow() {
-		
-	},
-	methods: {
-		...mapActions(['setSystemTime']),
-		closeNotice() {
-			this.mockSubscribeEdit();
-			this.openAppoint = false;
-			this.param.pageNum = 1;
-			this.mockList = [];
-			this.mockApplyListApply()
-		},
-		canApply(item) {
-			console.log(item)
-			let startTime = item.applyStartTime
-			let endTime = item.applyEndTime
-			let examTime = item.examTime
-			
-			if(this.sysTime >= startTime && this.sysTime <= endTime && this.sysTime < examTime) {
-				return true;
-			} else {
-				return false;
-			}
-		},
-		tagSelect(item) {
-			this.param.majorId = item.id;
-			this.mockList = []
-			this.mockApplyListApply()
-		},
-		testClick(item) {
-			if(!item) {
-				this.param.businessId = ''
-				this.businessId = ''
-				this.index = 0;
-				this.mockList = []
-				this.mockApplyListApply();
-				return;
-			}
-			console.log(item,'item')
-			this.param.businessId = item.businessId
-			this.businessName = item.educationName  +':'+item.businessName +'-'+ item.projectName
-			this.index = 0;
-			this.mockList = []
-			this.courseMajorList({businessId:item.businessId,projectId:item.projectId,status:1})
-			this.mockApplyListApply();
-			
-			console.log(this.b)
-		},
-		mockApplyListApplyBusiness() {
-			return new Promise(resolve => {
-				this.$api.mockApplyListApplyBusiness().then(async res => {
-					this.businesslist = res.data.rows;
-					this.param.businessId = res.data.rows[0].businessId;
-					this.businessName = res.data.rows[0].businessName + res.data.rows[0].projectName
-					await this.courseMajorList({businessId:res.data.rows[0].businessId,projectId:res.data.rows[0].projectId,status:1})
-					resolve()
-				})
-			})
-			
-		},
-		mockApplyListApply() {
-			let param = JSON.parse(JSON.stringify(this.param))
-			if(param.endTime) {
-				param.endTime = this.$method.TimeTotimestamp(param.endTime)
-			}
-			
-			if(param.startTime) {
-				param.startTime = this.$method.TimeTotimestamp(param.startTime)
-			}
-			
-			
-			this.$api.mockApplyListApply(param).then(res => {
-				this.mockList.push(...res.data.rows)
-				this.total = res.data.total;
-			})
-		},
-		refreshByIndex() {
-			
-		},
-		courseMajorList(data) {
-			return new Promise(resolve => {
-				
-				let self = this;
-				this.$api.courseMajorList(data).then(res => {
-					if(res.data.code==200){
-						self.sList = res.data.rows
-						let allItem = {id:'',categoryName:'全部'}
-						self.sList.unshift(allItem)
-						this.param.majorId = '';
-						
-						resolve()
-					}
-				});
-			})
-		},
-		
-		appoint(item) {
-			let canApply = this.canApply(item);
-			console.log(canApply)
-			if(!canApply) {
-				uni.showToast({
-					icon:'none',
-					title:'不在预约时间范围'
-				})
-				
-				return;
-			} 
-			
-			if(!item.isSubscribe) {
-				uni.showToast({
-					icon:'none',
-					title:'您已预约'
-				})
-				return;
-			}
-			
-			this.$api.mockSubscribe({
-				applySiteExamTime:item.examTime,
-				applySiteEndTime:item.endTime,
-				applySiteStartTime:item.startTime,
-				applyId:item.applyId,
-				mockMajorSubjectId:item.mockMajorSubjectId,
-				eachExamId:item.eachExamId
-				// applySiteExamTime:1653899220,
-				// applySiteEndTime:"17:27:54",
-				// applySiteStartTime:'16:27:54', 
-				// applyId:26,
-				// mockMajorSubjectId:49
-			}).then(res => {
-				console.log(res)
-				if(res.data.code == 200) {
-					this.showItem = item;
-					this.appointModal = true;
-					this.subscribeId = res.data.data;
-				} else {
-					uni.showToast({
-						icon:'none',
-						title:res.data.msg
-					})
-				}
-				
-				
-			}).catch(err => {
-				uni.showToast({
-					icon:'none',
-					title:err.data.msg
-				})
-			})
-			
-		},
-		tab(index) {
-			console.log(index,this.index)
-			if(this.index == index) {
-				this.index = 0;
-				return;
-			}
-			this.index = index;
-			console.log(this.index);
-		},
-		bindDateFromChange(e) {
-			this.param.startTime = e.detail.value
-			this.param.pageNum = 1;
-			this.mockList = []
-			this.mockApplyListApply();
-		},
-		
-		 mockSubscribeEdit() {
-			this.$api
-				.mockSubscribeEdit({
-					mockRemind: 1,
-					subscribeId: this.subscribeId,
-				})
-				.then((res) => {
-					uni.showToast({
-						icon:'none',
-						title:'开启成功'
-					})
-				});
-		},
-		
-		bindDateToChange(e) {
-			this.param.endTime = e.detail.value
-			this.param.pageNum = 1;
-			this.mockList = []
-			this.mockApplyListApply();
-		}
-	}
+  computed: {
+    ...mapGetters(["userInfo", "sysTime"]),
+  },
+  data() {
+    return {
+      tagActive: "",
+      openAppoint: false,
+      appointModal: false,
+      noticeModal: false,
+      index: 0,
+      list: [],
+      list1: [],
+      mockList: [],
+      businesslist: [],
+      param: {
+        endTime: "",
+        startTime: "",
+        pageNum: 1,
+        pageSize: 10,
+        businessId: "",
+        majorId: "",
+      },
+      isRepeat: false,
+      total: 0,
+      activeIndex: "",
+      typeIndex: 0,
+      itemIndex: "",
+      modalTop: 0,
+      endDate: "",
+      businessName: "",
+      subscribeId: 0,
+      nowTime: "",
+      sList: [],
+      showItem: {},
+    };
+  },
+  async onLoad(option) {
+    this.endDate = this.$method
+      .timestampToTime(new Date().getTime() / 1000)
+      .replace(/-/g, "/");
+    this.nowTime = +this.$method.timest();
+    await this.setSystemTime();
+    await this.mockApplyListApplyBusiness();
+
+    this.mockApplyListApply();
+    uni.getSystemInfo({
+      success: (e) => {
+        let info = uni.createSelectorQuery().select(".nav");
+        info
+          .boundingClientRect((navData) => {
+            //data - 各种参数
+
+            let info = uni.createSelectorQuery().select(".tabs");
+            info
+              .boundingClientRect((tabData) => {
+                //data - 各种参数
+                this.modalTop = navData.height + tabData.height;
+              })
+              .exec();
+          })
+          .exec();
+      },
+    });
+  },
+  onPullDownRefresh() {
+    let that = this;
+    this.param.pageNum = 1;
+    this.mockApplyListApply();
+    setTimeout(function () {
+      uni.stopPullDownRefresh();
+    }, 500);
+  },
+  onReachBottom() {
+    if (this.mockList.length < this.total) {
+      this.param.pageNum++;
+      this.mockApplyListApply();
+    }
+  },
+  onShow() {},
+  methods: {
+    ...mapActions(["setSystemTime"]),
+    closeNotice() {
+      this.mockSubscribeEdit();
+      this.openAppoint = false;
+      this.param.pageNum = 1;
+      this.mockList = [];
+      this.mockApplyListApply();
+    },
+    canApply(item) {
+      console.log(item);
+      let startTime = item.applyStartTime;
+      let endTime = item.applyEndTime;
+      let examTime = item.examTime;
+
+      if (
+        this.sysTime >= startTime &&
+        this.sysTime <= endTime &&
+        this.sysTime < examTime
+      ) {
+        return true;
+      } else {
+        return false;
+      }
+    },
+    tagSelect(item) {
+      this.param.majorId = item.id;
+      this.mockList = [];
+      this.mockApplyListApply();
+    },
+    testClick(item) {
+      if (!item) {
+        this.param.businessId = "";
+        this.businessId = "";
+        this.index = 0;
+        this.mockList = [];
+        this.mockApplyListApply();
+        return;
+      }
+      console.log(item, "item");
+      this.param.businessId = item.businessId;
+      this.businessName =
+        item.educationName + ":" + item.businessName + "-" + item.projectName;
+      this.index = 0;
+      this.mockList = [];
+      this.courseMajorList({
+        businessId: item.businessId,
+        projectId: item.projectId,
+        status: 1,
+      });
+      this.mockApplyListApply();
+
+      console.log(this.b);
+    },
+    mockApplyListApplyBusiness() {
+      return new Promise((resolve) => {
+        this.$api.mockApplyListApplyBusiness().then(async (res) => {
+          this.businesslist = res.data.rows;
+          this.param.businessId = res.data.rows[0].businessId;
+          this.businessName =
+            res.data.rows[0].businessName + res.data.rows[0].projectName;
+          await this.courseMajorList({
+            businessId: res.data.rows[0].businessId,
+            projectId: res.data.rows[0].projectId,
+            status: 1,
+          });
+          resolve();
+        });
+      });
+    },
+    mockApplyListApply() {
+      let param = JSON.parse(JSON.stringify(this.param));
+      if (param.endTime) {
+        param.endTime = this.$method.TimeTotimestamp(param.endTime);
+      }
+
+      if (param.startTime) {
+        param.startTime = this.$method.TimeTotimestamp(param.startTime);
+      }
+
+      this.$api.mockApplyListApply(param).then((res) => {
+        this.mockList.push(...res.data.rows);
+        this.total = res.data.total;
+      });
+    },
+    refreshByIndex() {},
+    courseMajorList(data) {
+      return new Promise((resolve) => {
+        let self = this;
+        this.$api.courseMajorList(data).then((res) => {
+          if (res.data.code == 200) {
+            self.sList = res.data.rows;
+            let allItem = { id: "", categoryName: "全部" };
+            self.sList.unshift(allItem);
+            this.param.majorId = "";
+
+            resolve();
+          }
+        });
+      });
+    },
+
+    appoint(item) {
+      let canApply = this.canApply(item);
+      console.log(canApply);
+    //   if (!canApply) {
+    //     uni.showToast({
+    //       icon: "none",
+    //       title: "不在预约时间范围",
+    //     });
+
+    //     return;
+    //   }
+
+    //   if (!item.isSubscribe) {
+    //     uni.showToast({
+    //       icon: "none",
+    //       title: "您已预约",
+    //     });
+    //     return;
+    //   }
+
+      this.$api
+        .mockSubscribe({
+          applySiteExamTime: item.examTime,
+          applySiteEndTime: item.endTime,
+          applySiteStartTime: item.startTime,
+          applyId: item.applyId,
+          mockMajorSubjectId: item.mockMajorSubjectId,
+          eachExamId: item.eachExamId,
+          goodsId: item.goodsId,
+          orderGoodsId: item.orderGoodsId,
+          // applySiteExamTime:1653899220,
+          // applySiteEndTime:"17:27:54",
+          // applySiteStartTime:'16:27:54',
+          // applyId:26,
+          // mockMajorSubjectId:49
+        })
+        .then((res) => {
+          console.log(res);
+          if (res.data.code == 200) {
+            this.showItem = item;
+            this.appointModal = true;
+            this.subscribeId = res.data.data;
+          } else {
+            uni.showToast({
+              icon: "none",
+              title: res.data.msg,
+            });
+          }
+        })
+        .catch((err) => {
+          uni.showToast({
+            icon: "none",
+            title: err.data.msg,
+          });
+        });
+    },
+    tab(index) {
+      console.log(index, this.index);
+      if (this.index == index) {
+        this.index = 0;
+        return;
+      }
+      this.index = index;
+      console.log(this.index);
+    },
+    bindDateFromChange(e) {
+      this.param.startTime = e.detail.value;
+      this.param.pageNum = 1;
+      this.mockList = [];
+      this.mockApplyListApply();
+    },
+
+    mockSubscribeEdit() {
+      this.$api
+        .mockSubscribeEdit({
+          mockRemind: 1,
+          subscribeId: this.subscribeId,
+        })
+        .then((res) => {
+          uni.showToast({
+            icon: "none",
+            title: "开启成功",
+          });
+        });
+    },
+
+    bindDateToChange(e) {
+      this.param.endTime = e.detail.value;
+      this.param.pageNum = 1;
+      this.mockList = [];
+      this.mockApplyListApply();
+    },
+  },
 };
 </script>
 <style>
 page {
-	background: #eaeef1;
+  background: #eaeef1;
 }
 </style>
 <style lang="scss" scope>
-	.animals{
-		transition: all 0.3s;
-		transform: rotate(180deg);
-	}
+.animals {
+  transition: all 0.3s;
+  transform: rotate(180deg);
+}
 .tabs {
-	position: fixed;
-	left: 0;
-	width: 100%;
-	display: flex;
-	height:80rpx;
-	z-index: 10;
-	.tab {
-		padding:0 18rpx;
-		flex: 1;
-		display: flex;
-		justify-content: space-between;
-		height: 80rpx;
-		line-height: 80rpx;
-		background: #ffffff;
-		font-size: 24rpx;
-		color: #999999;
-		
-		&:nth-of-type(1) {
-			border-right:1px solid #EEEEEE;
-		}
-		
-		.uni-input {
-			text-align: center;
-			width:150rpx;
-		}
-		
-		
-		.dateRange {
-			display: flex;
-			justify-content: space-between;
-		}
-
-		&.active {
-			color: #333333;
-			.icon{
-				transform: rotate(180deg);
-			}
-		}
-	}
+  position: fixed;
+  left: 0;
+  width: 100%;
+  display: flex;
+  height: 80rpx;
+  z-index: 10;
+  .tab {
+    padding: 0 18rpx;
+    flex: 1;
+    display: flex;
+    justify-content: space-between;
+    height: 80rpx;
+    line-height: 80rpx;
+    background: #ffffff;
+    font-size: 24rpx;
+    color: #999999;
+
+    &:nth-of-type(1) {
+      border-right: 1px solid #eeeeee;
+    }
+
+    .uni-input {
+      text-align: center;
+      width: 150rpx;
+    }
+
+    .dateRange {
+      display: flex;
+      justify-content: space-between;
+    }
+
+    &.active {
+      color: #333333;
+      .icon {
+        transform: rotate(180deg);
+      }
+    }
+  }
 }
 
 .scroll {
-	width:100%;
-	margin-top:80rpx;
-	.scroll-x {
-		
-		.content {
-				padding:16rpx;
-				white-space:nowrap;
-				
-				.scroll-tag {
-					display: inline-block;
-					padding:11rpx 17rpx;
-					background: #fff;
-					color:#666666;
-					margin-right:16rpx;
-					border-radius:16rpx;;
-					
-					&.active {
-						background: #007AFF;
-						color:#fff;
-					}
-				}
-		}
-		
-	}
-}
+  width: 100%;
+  margin-top: 80rpx;
+  .scroll-x {
+    .content {
+      padding: 16rpx;
+      white-space: nowrap;
+
+      .scroll-tag {
+        display: inline-block;
+        padding: 11rpx 17rpx;
+        background: #fff;
+        color: #666666;
+        margin-right: 16rpx;
+        border-radius: 16rpx;
 
+        &.active {
+          background: #007aff;
+          color: #fff;
+        }
+      }
+    }
+  }
+}
 
 .record {
-	padding: 16rpx 16rpx;
-	display: flex;
-	flex-wrap: wrap;
-	.item {
-		margin-bottom: 16rpx;
-		width:351rpx;
-		background: #ffffff;
-		border-radius: 16rpx;
-		position: relative;
-		
-		&:nth-of-type(2n) {
-			margin-left:16rpx;
-			
-		}
-
-		&__header {
-			padding:24rpx 16rpx;
-			background: #F2F6FF;
-			font-size: 30rpx;
-			color:#007AFF;
-			
-			&::before {
-				content:'';
-				display: inline-block;
-				width: 4rpx;
-				height: 32rpx;
-				background: #007AFF;
-				margin-right:10rpx;
-				vertical-align: middle;
-			}
-		}
-		
-		&__body {
-			padding:16rpx;
-			
-			.title {
-				font-size: 24rpx;
-				color: #666666;
-				line-height: 48rpx;
-				
-				.img {
-					vertical-align: middle;
-					width:32rpx;
-				}
-			}
-			
-			.desc {
-				margin-top:10rpx;
-				font-size: 28rpx;
-				font-weight: bold;
-				color: #666666;
-				line-height: 36rpx;
-			}
-			
-			.btn {
-				margin-top:30rpx;
-				background: #FFFFFF;
-				border-radius: 16rpx;
-				height: 64rpx;
-				line-height: 62rpx;
-				text-align: center;
-				font-size: 28rpx;
-				
-				border: 1px solid #007AFF;
-				color:#007AFF;
-					
-				
-				&.disabled {
-					border: 1px solid #D9D9D9;
-					color:#D9D9D9;
-				}
-			}
-		}
-	}
+  padding: 16rpx 16rpx;
+  display: flex;
+  flex-wrap: wrap;
+  .item {
+    margin-bottom: 16rpx;
+    width: 351rpx;
+    background: #ffffff;
+    border-radius: 16rpx;
+    position: relative;
+
+    &:nth-of-type(2n) {
+      margin-left: 16rpx;
+    }
+
+    &__header {
+      padding: 24rpx 16rpx;
+      background: #f2f6ff;
+      font-size: 30rpx;
+      color: #007aff;
+
+      &::before {
+        content: "";
+        display: inline-block;
+        width: 4rpx;
+        height: 32rpx;
+        background: #007aff;
+        margin-right: 10rpx;
+        vertical-align: middle;
+      }
+    }
+
+    &__body {
+      padding: 16rpx;
+
+      .title {
+        font-size: 24rpx;
+        color: #666666;
+        line-height: 48rpx;
+
+        .img {
+          vertical-align: middle;
+          width: 32rpx;
+        }
+      }
+
+      .desc {
+        margin-top: 10rpx;
+        font-size: 28rpx;
+        font-weight: bold;
+        color: #666666;
+        line-height: 36rpx;
+      }
+
+      .btn {
+        margin-top: 30rpx;
+        background: #ffffff;
+        border-radius: 16rpx;
+        height: 64rpx;
+        line-height: 62rpx;
+        text-align: center;
+        font-size: 28rpx;
+
+        border: 1px solid #007aff;
+        color: #007aff;
+
+        &.disabled {
+          border: 1px solid #d9d9d9;
+          color: #d9d9d9;
+        }
+      }
+    }
+  }
 }
 
 .notice {
-	position:fixed;
-	right:0;
-	top:50%;
-	width: 48rpx;
-	height: 200rpx;
-	background: #52C41A;
-	box-shadow: 0px 3rpx 16rpx 0rpx rgba(44, 121, 7, 0.5);
-	border-radius: 24rpx;
-	display: flex;
-	flex-direction: column;
-	align-items: center;
-	justify-content: center;
-	padding:10rpx 0;
-	
-	.text {
-		flex:1;
-		color:#fff;
-		text-align: center;
-	}
-}
+  position: fixed;
+  right: 0;
+  top: 50%;
+  width: 48rpx;
+  height: 200rpx;
+  background: #52c41a;
+  box-shadow: 0px 3rpx 16rpx 0rpx rgba(44, 121, 7, 0.5);
+  border-radius: 24rpx;
+  display: flex;
+  flex-direction: column;
+  align-items: center;
+  justify-content: center;
+  padding: 10rpx 0;
 
+  .text {
+    flex: 1;
+    color: #fff;
+    text-align: center;
+  }
+}
 
 .modal {
-	bottom:0;
-	z-index: 199999999;
-	position: fixed;
-	left: 0;
-	width: 100%;
-
-	.content {
-		height:80%;
-		overflow: hidden;
-		position: relative;
-		z-index: 10;
-		background: #fff;
-		padding: 8rpx 12rpx 20rpx;
-		display: flex;
-		flex-wrap: wrap;
-
-		.top {
-			margin: 0 auto;
-			width: 726rpx;
-			height: 80rpx;
-			background: #f5f5f5;
-			color: #666666;
-			border-radius: 16rpx;
-			text-align: center;
-			line-height: 80rpx;
-			font-size: 32rpx;
-		}
-
-		.list {
-			width:100%;
-			margin-top: 16rpx;
-			display: flex;
-			flex-wrap: wrap;
-			justify-content: space-between;
-
-			.item {
-				padding: 25rpx 20rpx;
-				width: 49%;
-				background: #f5f5f5;
-				border-radius: 16rpx;
-				font-size: 32rpx;
-				color: #666666;
-				margin: 8rpx 0;
-			}
-		}
-	}
-
-	.modal_wrap {
-		position: absolute;
-		left: 0;
-		width: 100%;
-		top: 0;
-		height: 100%;
-		background: rgba(0, 0, 0, 0.3);
-	}
-}
+  bottom: 0;
+  z-index: 199999999;
+  position: fixed;
+  left: 0;
+  width: 100%;
+
+  .content {
+    height: 80%;
+    overflow: hidden;
+    position: relative;
+    z-index: 10;
+    background: #fff;
+    padding: 8rpx 12rpx 20rpx;
+    display: flex;
+    flex-wrap: wrap;
 
+    .top {
+      margin: 0 auto;
+      width: 726rpx;
+      height: 80rpx;
+      background: #f5f5f5;
+      color: #666666;
+      border-radius: 16rpx;
+      text-align: center;
+      line-height: 80rpx;
+      font-size: 32rpx;
+    }
+
+    .list {
+      width: 100%;
+      margin-top: 16rpx;
+      display: flex;
+      flex-wrap: wrap;
+      justify-content: space-between;
+
+      .item {
+        padding: 25rpx 20rpx;
+        width: 49%;
+        background: #f5f5f5;
+        border-radius: 16rpx;
+        font-size: 32rpx;
+        color: #666666;
+        margin: 8rpx 0;
+      }
+    }
+  }
+
+  .modal_wrap {
+    position: absolute;
+    left: 0;
+    width: 100%;
+    top: 0;
+    height: 100%;
+    background: rgba(0, 0, 0, 0.3);
+  }
+}
 
 .notice__modal {
-	.notice__content {
-		width: 640rpx;
-		height: 818rpx;
-		background: #FFFFFF;
-		display: flex;
-		flex-direction: column;
-		
-		.body {
-			flex:1;
-			
-			.content {
-				padding:30rpx 40rpx 28rpx;
-				line-height: 40rpx;
-				font-size: 28rpx;
-				color:#666;
-				
-				.bold {
-					color:#333;
-					font-size: 32rpx;
-					font-weight: bold;
-				}
-				
-				.center {
-					text-align: center;
-				}
-			}
-		}
-		
-		.footer {
-			height:140rpx;
-			border-top:1px solid #EEEEEE;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			
-			.btn {
-				margin:0 12rpx;
-				width: 200rpx;
-				height: 80rpx;
-				color:#007AFF;
-				font-size: 30rpx;
-				text-align: center;
-				line-height: 80rpx;
-				background: #F5F5F5;
-				border-radius: 40rpx 40rpx 40rpx 40rpx;
-				
-				
-				&.close {
-					color:#fff;
-					width: 560rpx;
-					height: 80rpx;
-					background: #007AFF;
-					border-radius: 40rpx 40rpx 40rpx 40rpx;
-				}
-			}
-		}
-	}
+  .notice__content {
+    width: 640rpx;
+    height: 818rpx;
+    background: #ffffff;
+    display: flex;
+    flex-direction: column;
+
+    .body {
+      flex: 1;
+
+      .content {
+        padding: 30rpx 40rpx 28rpx;
+        line-height: 40rpx;
+        font-size: 28rpx;
+        color: #666;
+
+        .bold {
+          color: #333;
+          font-size: 32rpx;
+          font-weight: bold;
+        }
+
+        .center {
+          text-align: center;
+        }
+      }
+    }
+
+    .footer {
+      height: 140rpx;
+      border-top: 1px solid #eeeeee;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+
+      .btn {
+        margin: 0 12rpx;
+        width: 200rpx;
+        height: 80rpx;
+        color: #007aff;
+        font-size: 30rpx;
+        text-align: center;
+        line-height: 80rpx;
+        background: #f5f5f5;
+        border-radius: 40rpx 40rpx 40rpx 40rpx;
+
+        &.close {
+          color: #fff;
+          width: 560rpx;
+          height: 80rpx;
+          background: #007aff;
+          border-radius: 40rpx 40rpx 40rpx 40rpx;
+        }
+      }
+    }
+  }
 }
 
 .open__modal {
-	.open__content {
-		width: 640rpx;
-		background: #FFFFFF;
-		
-		.body {
-			
-			.content {
-				padding:30rpx 40rpx 28rpx;
-				line-height: 40rpx;
-				font-size: 28rpx;
-				color:#666;
-				
-				.bold {
-					color:#333;
-					font-size: 32rpx;
-					font-weight: bold;
-				}
-				
-				.center {
-					text-align: center;
-				}
-			}
-		}
-		
-		.footer {
-			height:140rpx;
-			border-top:1px solid #EEEEEE;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			
-			.btn {
-				margin:0 12rpx;
-				width: 200rpx;
-				height: 80rpx;
-				color:#007AFF;
-				font-size: 30rpx;
-				text-align: center;
-				line-height: 80rpx;
-				background: #F5F5F5;
-				border-radius: 40rpx 40rpx 40rpx 40rpx;
-				
-				
-				&.close {
-					color:#fff;
-					width: 560rpx;
-					height: 80rpx;
-					background: #007AFF;
-					border-radius: 40rpx 40rpx 40rpx 40rpx;
-				}
-			}
-		}
-	}
+  .open__content {
+    width: 640rpx;
+    background: #ffffff;
+
+    .body {
+      .content {
+        padding: 30rpx 40rpx 28rpx;
+        line-height: 40rpx;
+        font-size: 28rpx;
+        color: #666;
+
+        .bold {
+          color: #333;
+          font-size: 32rpx;
+          font-weight: bold;
+        }
+
+        .center {
+          text-align: center;
+        }
+      }
+    }
+
+    .footer {
+      height: 140rpx;
+      border-top: 1px solid #eeeeee;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+
+      .btn {
+        margin: 0 12rpx;
+        width: 200rpx;
+        height: 80rpx;
+        color: #007aff;
+        font-size: 30rpx;
+        text-align: center;
+        line-height: 80rpx;
+        background: #f5f5f5;
+        border-radius: 40rpx 40rpx 40rpx 40rpx;
+
+        &.close {
+          color: #fff;
+          width: 560rpx;
+          height: 80rpx;
+          background: #007aff;
+          border-radius: 40rpx 40rpx 40rpx 40rpx;
+        }
+      }
+    }
+  }
 }
 
 .appoint__modal {
-	position:fixed;
-	left:0;
-	top:0;
-	z-index: 9999;
-	width:100%;
-	height:100%;
-	background:rgba(0,0,0,0.3);
-	.img {
-		width:280rpx;
-		position:absolute;
-		left:50%;
-		margin-left:-140rpx;
-		top:-70rpx;
-	}
-	.appoint__content {
-		border-radius:20rpx;
-		position:absolute;
-		left:50%;
-		top:50%;
-		transform: translate3D(-50%,-50%,0);
-		width: 640rpx;
-		height: 867rpx;
-		background: #FFFFFF;
-		
-		.body {
-			position: relative;
-			
-			
-			.content {
-				padding:160rpx 40rpx 28rpx;
-				line-height: 60rpx;
-				font-size: 28rpx;
-				color:#666;
-				
-				.bold {
-					color:#333;
-					font-size: 32rpx;
-					font-weight: bold;
-				}
-				
-				.center {
-					text-align: center;
-				}
-				
-				
-				.text {
-					color:#666;
-					font-size: 28rpx;
-				}
-			}
-		}
-		
-		.footer {
-			height:140rpx;
-			border-top:1px solid #EEEEEE;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			
-			.btn {
-				margin:0 12rpx;
-				width: 200rpx;
-				height: 80rpx;
-				color:#007AFF;
-				font-size: 30rpx;
-				text-align: center;
-				line-height: 80rpx;
-				background: #F5F5F5;
-				border-radius: 40rpx 40rpx 40rpx 40rpx;
-				
-				
-				&.close {
-					color:#fff;
-					width: 560rpx;
-					height: 80rpx;
-					background: #007AFF;
-					border-radius: 40rpx 40rpx 40rpx 40rpx;
-				}
-			}
-		}
-	}
+  position: fixed;
+  left: 0;
+  top: 0;
+  z-index: 9999;
+  width: 100%;
+  height: 100%;
+  background: rgba(0, 0, 0, 0.3);
+  .img {
+    width: 280rpx;
+    position: absolute;
+    left: 50%;
+    margin-left: -140rpx;
+    top: -70rpx;
+  }
+  .appoint__content {
+    border-radius: 20rpx;
+    position: absolute;
+    left: 50%;
+    top: 50%;
+    transform: translate3D(-50%, -50%, 0);
+    width: 640rpx;
+    height: 867rpx;
+    background: #ffffff;
+
+    .body {
+      position: relative;
+
+      .content {
+        padding: 160rpx 40rpx 28rpx;
+        line-height: 60rpx;
+        font-size: 28rpx;
+        color: #666;
+
+        .bold {
+          color: #333;
+          font-size: 32rpx;
+          font-weight: bold;
+        }
+
+        .center {
+          text-align: center;
+        }
+
+        .text {
+          color: #666;
+          font-size: 28rpx;
+        }
+      }
+    }
+
+    .footer {
+      height: 140rpx;
+      border-top: 1px solid #eeeeee;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+
+      .btn {
+        margin: 0 12rpx;
+        width: 200rpx;
+        height: 80rpx;
+        color: #007aff;
+        font-size: 30rpx;
+        text-align: center;
+        line-height: 80rpx;
+        background: #f5f5f5;
+        border-radius: 40rpx 40rpx 40rpx 40rpx;
+
+        &.close {
+          color: #fff;
+          width: 560rpx;
+          height: 80rpx;
+          background: #007aff;
+          border-radius: 40rpx 40rpx 40rpx 40rpx;
+        }
+      }
+    }
+  }
 }
 .activesty {
-	background: #007aff !important;
-	color: #fff !important;
+  background: #007aff !important;
+  color: #fff !important;
 }
 </style>

Dosya farkı çok büyük olduğundan ihmal edildi
+ 351 - 294
pages5/examBank/index.vue


+ 201 - 154
pages5/examCount/index.vue

@@ -1,165 +1,212 @@
 <template>
-	<view class="safeArea">
-		<nav-bar title="模拟考试-一级建造师-管理"></nav-bar>
-		<view class="examWrap">
-			<view class="title">距离管理开考还有</view>
-			<view class="circle">
-				<u-circle-progress class="img" width="448" bg-color="rgba(0,0,0,0)" type="primary" :percent="percent"></u-circle-progress>
-				<view class="time">{{timeText}}</view>
-			</view>
-			
-			<view v-if="mockActivity == 1" class="btn" @click="examBank()">开始考试</view>
-			<view v-else class="btn" @click="examBank()" :class="{disabled:!((nowTime > start) && (nowTime < end ))}">开始考试</view>
-		</view>
-	</view>
+  <view class="safeArea">
+    <nav-bar title="模拟考试-一级建造师-管理"></nav-bar>
+    <view class="examWrap">
+      <view class="title">距离管理开考还有</view>
+      <view class="circle">
+        <u-circle-progress
+          class="img"
+          width="448"
+          bg-color="rgba(0,0,0,0)"
+          type="primary"
+          :percent="percent"
+        ></u-circle-progress>
+        <view class="time">{{ timeText }}</view>
+      </view>
+
+      <view v-if="mockActivity == 1" class="btn" @click="examBank()"
+        >开始考试</view
+      >
+      <view
+        v-else
+        class="btn"
+        @click="examBank()"
+        :class="{ disabled: !(nowTime > start && nowTime < end) }"
+        >开始考试</view
+      >
+    </view>
+  </view>
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
+import { mapGetters } from "vuex";
 export default {
-	components: {
-	},
-	data() {
-		return {
-			mockName:'',
-			state:1,
-			start:0,
-			timer:null,
-			timeText:'',
-			nowTime:0,
-			timeLimit:0,
-			examId:0,
-			eachExamId:0,
-			subscribeId:0,
-			end:0,
-			percent:0,
-			examEndTime:0,
-			mockActivity: 0,
-		};
-	},
-	onLoad(option){
-		this.examEndTime = option.examEndTime;
-		this.mockName = option.mockName || ''
-		this.subscribeId = option.subscribeId
-		this.eachExamId = option.eachExamId
-		this.examId = option.examId
-		this.timeLimit = +option.limit || 0
-		this.start = +option.start;
-		this.mockActivity = option.mockActivity
-		this.end = (this.timeLimit* 60) + this.start ;
-		this.timer = setInterval(() => {
-			this.timeText = this.getDuring()
-		},1000)
-	},
-	onShow() {
-		clearInterval(this.timer)
-		this.timer = setInterval(() => {
-			this.timeText = this.getDuring()
-		},1000)
-	},
-	onUnload() {
-		clearInterval(this.timer)
-	},
-	methods: {
-		getDuring() {
-			this.nowTime = +this.$method.timest();
-			let during = this.start - this.nowTime;
-			console.log('during', during)
-			this.percent = during <= 0 ? 100 : during >= 600 ? 0 :  (600 - during) / 600 * 100;
-			if(during <= 0) {
-				return '00:00'
-			}
-			let minutes = parseInt(during/60) >= 10 ? '0'+ parseInt(during/60) : parseInt(during/60);
-			let seconds = during % 60 >= 10 ? during % 60 :'0'+ during % 60;
-			
-			return minutes+':'+seconds
-		},
-		canTest() {
-			
-		},
-		examBank() {
-			if (this.mockActivity == 1) {
-				uni.redirectTo({
-					url:'../examBank/index?examId='+this.examId+'&eachExamId='+this.eachExamId+'&subscribeId='+this.subscribeId+'&examEndTime='+this.examEndTime+'&examStartTime='+this.start
-				})
-			} else {
-				if(((this.nowTime > this.start) && (this.nowTime < this.end ))) {
-					uni.redirectTo({
-						url:'../examBank/index?examId='+this.examId+'&eachExamId='+this.eachExamId+'&subscribeId='+this.subscribeId+'&examEndTime='+this.examEndTime+'&examStartTime='+this.start
-					})
-				} else {
-					uni.showToast({
-						icon:'none',
-						title:'不在考试时间'
-					})
-				}
-			}
-		}
-	},
-	onReachBottom() {},
-	computed: { ...mapGetters(['userInfo']) }
+  components: {},
+  data() {
+    return {
+      mockName: "",
+      state: 1,
+      start: 0,
+      timer: null,
+      timeText: "",
+      nowTime: 0,
+      timeLimit: 0,
+      examId: 0,
+      eachExamId: 0,
+      subscribeId: 0,
+      end: 0,
+      percent: 0,
+      examEndTime: 0,
+      mockActivity: 0,
+      goodsId: "",
+      orderGoodsId: "",
+    };
+  },
+  onLoad(option) {
+    this.examEndTime = option.examEndTime;
+    this.mockName = option.mockName || "";
+    this.subscribeId = option.subscribeId;
+    this.eachExamId = option.eachExamId;
+    this.examId = option.examId;
+    this.timeLimit = +option.limit || 0;
+    this.start = +option.start;
+    this.mockActivity = option.mockActivity;
+    this.end = this.timeLimit * 60 + this.start;
+    this.goodsId = option.goodsId;
+    this.orderGoodsId = option.orderGoodsId;
+    this.timer = setInterval(() => {
+      this.timeText = this.getDuring();
+    }, 1000);
+  },
+  onShow() {
+    clearInterval(this.timer);
+    this.timer = setInterval(() => {
+      this.timeText = this.getDuring();
+    }, 1000);
+  },
+  onUnload() {
+    clearInterval(this.timer);
+  },
+  methods: {
+    getDuring() {
+      this.nowTime = +this.$method.timest();
+      let during = this.start - this.nowTime;
+      console.log("during", during);
+      this.percent =
+        during <= 0 ? 100 : during >= 600 ? 0 : ((600 - during) / 600) * 100;
+      if (during <= 0) {
+        return "00:00";
+      }
+      let minutes =
+        parseInt(during / 60) >= 10
+          ? "0" + parseInt(during / 60)
+          : parseInt(during / 60);
+      let seconds = during % 60 >= 10 ? during % 60 : "0" + (during % 60);
+
+      return minutes + ":" + seconds;
+    },
+    canTest() {},
+    examBank() {
+      if (this.mockActivity == 1) {
+        uni.redirectTo({
+          url:
+            "../examBank/index?examId=" +
+            this.examId +
+            "&eachExamId=" +
+            this.eachExamId +
+            "&subscribeId=" +
+            this.subscribeId +
+            "&examEndTime=" +
+            this.examEndTime +
+            "&examStartTime=" +
+            this.start +
+            "&goodsId=" +
+            this.goodsId +
+            "&orderGoodsId=" +
+            this.orderGoodsId,
+        });
+      } else {
+        if (this.nowTime > this.start && this.nowTime < this.end) {
+          uni.redirectTo({
+            url:
+              "../examBank/index?examId=" +
+              this.examId +
+              "&eachExamId=" +
+              this.eachExamId +
+              "&subscribeId=" +
+              this.subscribeId +
+              "&examEndTime=" +
+              this.examEndTime +
+              "&examStartTime=" +
+              this.start +
+              "&goodsId=" +
+              this.goodsId +
+              "&orderGoodsId=" +
+              this.orderGoodsId,
+          });
+        } else {
+          uni.showToast({
+            icon: "none",
+            title: "不在考试时间",
+          });
+        }
+      }
+    },
+  },
+  onReachBottom() {},
+  computed: { ...mapGetters(["userInfo"]) },
 };
 </script>
-<style >
-	page {
-			background: #EAEEF1;
-		}
+<style>
+page {
+  background: #eaeef1;
+}
 </style>
 <style scoped lang="scss">
-.examWrap{
-	padding: 16rpx;
-	
-	.title {
-		margin-top:70rpx;
-		font-size: 32rpx;
-		color: #666666;
-		line-height: 48rpx;
-		text-align: center;
-	}
-	
-	.circle {
-		margin:60rpx auto 0;
-		width:480rpx;
-		height:480rpx;
-		position:relative;
-		background: #fff;
-		border-radius:50%;
-		
-		.img {
-			position:absolute;
-			left:50%;
-			top:50%;
-			transform: translate3D(-50%,-50%,0);
-		}
-		
-		.time {
-			width:100%;
-			height:100%;
-			display: flex;
-			align-items: center;
-			justify-content: center;
-			position:relative;
-			z-index: 999;
-			font-size: 80rpx;
-			text-align: center;
-			font-weight: bold;
-			color: #333333;
-		}
-	}
-	
-	.btn {
-		margin:330rpx auto 0;
-		width: 528rpx;
-		height: 80rpx;
-		background: #007AFF;
-		border-radius: 40rpx;
-		text-align: center;
-		line-height: 80rpx;
-		color:#fff;
-		
-		&.disabled {
-			background:#ccc;
-		}
-	}
+.examWrap {
+  padding: 16rpx;
+
+  .title {
+    margin-top: 70rpx;
+    font-size: 32rpx;
+    color: #666666;
+    line-height: 48rpx;
+    text-align: center;
+  }
+
+  .circle {
+    margin: 60rpx auto 0;
+    width: 480rpx;
+    height: 480rpx;
+    position: relative;
+    background: #fff;
+    border-radius: 50%;
+
+    .img {
+      position: absolute;
+      left: 50%;
+      top: 50%;
+      transform: translate3D(-50%, -50%, 0);
+    }
+
+    .time {
+      width: 100%;
+      height: 100%;
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      position: relative;
+      z-index: 999;
+      font-size: 80rpx;
+      text-align: center;
+      font-weight: bold;
+      color: #333333;
+    }
+  }
+
+  .btn {
+    margin: 330rpx auto 0;
+    width: 528rpx;
+    height: 80rpx;
+    background: #007aff;
+    border-radius: 40rpx;
+    text-align: center;
+    line-height: 80rpx;
+    color: #fff;
+
+    &.disabled {
+      background: #ccc;
+    }
+  }
 }
 </style>

+ 777 - 648
pages5/examList/index.vue

@@ -1,674 +1,803 @@
 <template>
-	<view>
-		<nav-bar title="模考预约" class="nav"></nav-bar>
-		<view class="tabs">
-			<view class="tab" :class="{ active: param.mockStatus == 0 }" data-index="1" @click="tab(0)">
-				<view>未考试</view>
-			</view>
-			<view class="tab" :class="{ active:  param.mockStatus == 1 }" data-index="2" @click="tab(1)">
-				<view>已结束</view>
-			</view>
-			<view class="sort" @click="showSort = true">
-				筛选
-			</view>
-		</view>
-		
-		
-		<view class="record">
-			<template v-if=" param.mockStatus == 0">
-				<view v-if="recordList.length">
-				<view class="examList" v-for="(item,index) in recordList" :key="index">
-					<view class="main">
-						<view class="top" @click="showDetails(item)">
-							<view class="subject">{{item.applyName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">项目</view>
-							<view class="right">{{ item.businessName }} {{item.projectName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">专业</view>
-							<view class="right">{{item.categoryName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">科目</view>
-							<view class="right">{{item.subjectName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">考试时间</view>
-							<view v-if="item.mockActivity == 0" class="right">
-								{{ $method.timestampToTime(item.applySiteExamTime) }}
-								{{ item.applySiteStartTime }} - {{ item.applySiteEndTime }}
-							</view>
-						</view>
-						<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"
-									: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>
-								<view class="btn" v-else @click="goExamCount(item,index)">去考试</view>
-								</view>
-							</view>
-						</view>
-					</view>
-				</view>
-				</view>
-				<view v-else class="nodata">暂无相关数据</view>
-			</template>
-			
-			<template v-if=" param.mockStatus == 1">
-				<view v-if="recordList.length">
-				<view class="examList" v-for="(item,index) in recordList" :key="index">
-					<view class="main">
-						<view class="top" @click="showDetails(item)">
-							<view class="subject">{{item.applyName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">项目</view>
-							<view class="right">{{ item.businessName }} {{item.projectName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">专业</view>
-							<view class="right">{{item.categoryName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">科目</view>
-							<view class="right">{{item.subjectName}}</view>
-						</view>
-						<view class="item">
-							<view class="left">考试时间</view>
-							<view class="right">
-								{{ $method.timestampToTime(item.applySiteExamTime) }}
-								{{ item.applySiteStartTime }} - {{ item.applySiteEndTime }}
-							</view>
-						</view>
-						<view class="btn-wrap">
-							<view class="btn-line" v-if="item.reSubscribe == 1">
-								<view class="btn border" @click="reApply(item)">重新预约</view>
-							</view>
-							<template v-else>
-								<view class="btn-line">
-									<view class="text" v-if="item.handStatus">当前报告含主观题需人工阅卷,阅卷完成后显示完整报告</view>
-									<view class="text" v-if="!item.handStatus">由于未按时参加考试,主观题将不会提交至后台进行人工阅卷</view>
-									<view class="btn border" :class="{disabled : item.canDo === 0,'btn--half':item.handStatus}" @click="doQuestion(item)">去做题</view>
-									<view class="btn btn--half border" @click="report(item)" v-if="item.handStatus">查看报告</view>
-								</view>
-								<view class="btn-line" v-if="item.liveEndTime && item.liveStartTime && item.liveUrl">
-									<view class="text-half">
-										<view>模考讲解直播时间</view>
-										<view>{{$method.timestampToTime(item.liveStartTime,false)}} - {{$method.timestampToTime(item.liveEndTime,false)}}</view>
-										
-									</view>
-									<view class="btn btn--half border" @click="goLive(item)">去查看</view>
-								</view>
-							</template>
-							
-						</view>
-						
-					</view>
-				</view>
-				</view>
-				<view v-else class="nodata">暂无相关数据</view>
-			</template>
-			
-		</view>
-		
-		<view class="modal" :style="{top:modalTop+'px'}" v-if="showSort">
-			<view class="content">
-				<view class="item">
-					<view class="item__title">考试时间</view>
-					<view class="item__box">
-						<view class="text">
-							<picker mode="date"  :value="param.startTime" :end="endDate" @change="bindDateFromChange">
-								<view class="uni-input">{{param.startTime || '开始时间'}}</view>
-							</picker>
-							- 
-							<picker mode="date" :value="param.endTime" :end="endDate"  @change="bindDateToChange">
-								<view class="uni-input">{{param.endTime || '结束时间'}}</view>
-							</picker>
-						</view>
-						<u-icon class="icon" name="calendar"></u-icon>
-					</view>
-				</view>
-				
-				<view class="item">
-					<view class="item__title">考试标题</view>
-					<view class="item__box">
-							<picker class="picker" mode="selector" :range="listApplyName" range-key="applyName" :value="param.applyName" @change="bindTitleChange">
-								<view style="width:650rpx;height:40rpx;">{{param.applyName}}</view>
-							</picker>
-						<u-icon class="icon" name="arrow-down"></u-icon>
-					</view>
-				</view>
-				
-			</view>
-			<view class="modal_wrap" @click="showSort = false"></view>
-		</view>
-		
-	</view>
+  <view>
+    <nav-bar title="模考预约" class="nav"></nav-bar>
+    <view class="tabs">
+      <view
+        class="tab"
+        :class="{ active: param.mockStatus == 0 }"
+        data-index="1"
+        @click="tab(0)"
+      >
+        <view>未考试</view>
+      </view>
+      <view
+        class="tab"
+        :class="{ active: param.mockStatus == 1 }"
+        data-index="2"
+        @click="tab(1)"
+      >
+        <view>已结束</view>
+      </view>
+      <view class="sort" @click="showSort = true"> 筛选 </view>
+    </view>
+
+    <view class="record">
+      <template v-if="param.mockStatus == 0">
+        <view v-if="recordList.length">
+          <view
+            class="examList"
+            v-for="(item, index) in recordList"
+            :key="index"
+          >
+            <view class="main">
+              <view class="top" @click="showDetails(item)">
+                <view class="subject">{{ item.applyName }}</view>
+              </view>
+              <view class="item">
+                <view class="left">项目</view>
+                <view class="right"
+                  >{{ item.businessName }} {{ item.projectName }}</view
+                >
+              </view>
+              <view class="item">
+                <view class="left">专业</view>
+                <view class="right">{{ item.categoryName }}</view>
+              </view>
+              <view class="item">
+                <view class="left">科目</view>
+                <view class="right">{{ item.subjectName }}</view>
+              </view>
+              <view class="item">
+                <view class="left">考试时间</view>
+                <view v-if="item.mockActivity == 0" class="right">
+                  {{ $method.timestampToTime(item.applySiteExamTime) }}
+                  {{ item.applySiteStartTime }} - {{ item.applySiteEndTime }}
+                </view>
+              </view>
+              <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"
+                    :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
+                    >
+                    <view class="btn" v-else @click="goExamCount(item, index)"
+                      >去考试</view
+                    >
+                  </view>
+                </view>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view v-else class="nodata">暂无相关数据</view>
+      </template>
+
+      <template v-if="param.mockStatus == 1">
+        <view v-if="recordList.length">
+          <view
+            class="examList"
+            v-for="(item, index) in recordList"
+            :key="index"
+          >
+            <view class="main">
+              <view class="top" @click="showDetails(item)">
+                <view class="subject">{{ item.applyName }}</view>
+              </view>
+              <view class="item">
+                <view class="left">项目</view>
+                <view class="right"
+                  >{{ item.businessName }} {{ item.projectName }}</view
+                >
+              </view>
+              <view class="item">
+                <view class="left">专业</view>
+                <view class="right">{{ item.categoryName }}</view>
+              </view>
+              <view class="item">
+                <view class="left">科目</view>
+                <view class="right">{{ item.subjectName }}</view>
+              </view>
+              <view class="item">
+                <view class="left">考试时间</view>
+                <view class="right">
+                  {{ $method.timestampToTime(item.applySiteExamTime) }}
+                  {{ item.applySiteStartTime }} - {{ item.applySiteEndTime }}
+                </view>
+              </view>
+              <view class="btn-wrap">
+                <view class="btn-line" v-if="item.reSubscribe == 1">
+                  <view class="btn border" @click="reApply(item)"
+                    >重新预约</view
+                  >
+                </view>
+                <template v-else>
+                  <view class="btn-line">
+                    <view class="text" v-if="item.handStatus"
+                      >当前报告含主观题需人工阅卷,阅卷完成后显示完整报告</view
+                    >
+                    <view class="text" v-if="!item.handStatus"
+                      >由于未按时参加考试,主观题将不会提交至后台进行人工阅卷</view
+                    >
+                    <view
+                      class="btn border"
+                      :class="{
+                        disabled: item.canDo === 0,
+                        'btn--half': item.handStatus,
+                      }"
+                      @click="doQuestion(item)"
+                      >去做题</view
+                    >
+                    <view
+                      class="btn btn--half border"
+                      @click="report(item)"
+                      v-if="item.handStatus"
+                      >查看报告</view
+                    >
+                  </view>
+                  <view
+                    class="btn-line"
+                    v-if="
+                      item.liveEndTime && item.liveStartTime && item.liveUrl
+                    "
+                  >
+                    <view class="text-half">
+                      <view>模考讲解直播时间</view>
+                      <view
+                        >{{
+                          $method.timestampToTime(item.liveStartTime, false)
+                        }}
+                        -
+                        {{
+                          $method.timestampToTime(item.liveEndTime, false)
+                        }}</view
+                      >
+                    </view>
+                    <view class="btn btn--half border" @click="goLive(item)"
+                      >去查看</view
+                    >
+                  </view>
+                </template>
+              </view>
+            </view>
+          </view>
+        </view>
+        <view v-else class="nodata">暂无相关数据</view>
+      </template>
+    </view>
+
+    <view class="modal" :style="{ top: modalTop + 'px' }" v-if="showSort">
+      <view class="content">
+        <view class="item">
+          <view class="item__title">考试时间</view>
+          <view class="item__box">
+            <view class="text">
+              <picker
+                mode="date"
+                :value="param.startTime"
+                :end="endDate"
+                @change="bindDateFromChange"
+              >
+                <view class="uni-input">{{
+                  param.startTime || "开始时间"
+                }}</view>
+              </picker>
+              -
+              <picker
+                mode="date"
+                :value="param.endTime"
+                :end="endDate"
+                @change="bindDateToChange"
+              >
+                <view class="uni-input">{{ param.endTime || "结束时间" }}</view>
+              </picker>
+            </view>
+            <u-icon class="icon" name="calendar"></u-icon>
+          </view>
+        </view>
+
+        <view class="item">
+          <view class="item__title">考试标题</view>
+          <view class="item__box">
+            <picker
+              class="picker"
+              mode="selector"
+              :range="listApplyName"
+              range-key="applyName"
+              :value="param.applyName"
+              @change="bindTitleChange"
+            >
+              <view style="width: 650rpx; height: 40rpx">{{
+                param.applyName
+              }}</view>
+            </picker>
+            <u-icon class="icon" name="arrow-down"></u-icon>
+          </view>
+        </view>
+      </view>
+      <view class="modal_wrap" @click="showSort = false"></view>
+    </view>
+  </view>
 </template>
 
 <script>
-import { mapGetters } from 'vuex';
-import config from '@/common/config'
+import { mapGetters } from "vuex";
+import config from "@/common/config";
 export default {
-	data() {
-		return {
-			showSort:false,
-			index: 0,
-			list: [],
-			list1: [],
-			recordList: [],
-			goodsData: {},
-			param: {
-				pageNum: 1,
-				pageSize: 10,
-				mockStatus:0,
-				endTime:'',
-				startTime:'',
-				applyName:''
-			},
-			nowTime:0,
-			sysTime: Date.now(),
-			dateFrom:'',
-			dateTo:'',
-			isRepeat:false,
-			total: 0,
-			activeIndex: 0,
-			typeIndex:0,
-			itemIndex:'',
-			modalTop:0,
-			endDate:'',
-			titleName:3,
-			listApplyName:[],
-		};
-	},
-	computed:{
-		...mapGetters(['userInfo'])
-	},
-	onLoad(option) {
-		this.param.mockStatus = option.state || 0
-		
-		this.endDate = this.$method.timestampToTime(new Date().getTime() / 1000).replace(/-/g,'/');
-			
-		// this.mockSubscribeListSubscribe();
-		uni.getSystemInfo({
-			success:(e) => {
-				let info = uni.createSelectorQuery().select(".nav");
-				info.boundingClientRect((navData) => { //data - 各种参数
-				
-					let info = uni.createSelectorQuery().select(".tabs");
-					info.boundingClientRect((tabData) => { //data - 各种参数
-						this.modalTop = navData.height + tabData.height
-						console.log(navData) // 获取元素宽度
-						console.log(tabData) // 获取元素宽度
-					}).exec()
-				}).exec()
-			}
-		})
-	},
-	onPullDownRefresh() {
-		let that = this;
-		this.param.pageNum = 1;
-		this.mockSubscribeListSubscribe();
-		setTimeout(function() {
-			uni.stopPullDownRefresh();
-		}, 500);
-	},
-	onReachBottom() {
-		console.log(this.total,'total');
-		console.log(this.recordList.length,'length')
-		if (this.recordList.length < this.total) {
-			this.param.pageNum++;
-			this.mockSubscribeListSubscribe();
-		}
-	},
-	onShow() {
-		
-		this.nowTime = +this.$method.timest();
-		// if(this.itemIndex !== '') {
-		// 	this.refreshByIndex();
-		// }
-		this.recordList = []
-		this.mockSubscribeListSubscribe();
-		
-	},
-	methods: {
-		mockApplyListApplyName() {
-			let param = JSON.parse(JSON.stringify(this.param));
-			if(param.endTime) {
-				param.endTime = this.$method.TimeTotimestamp(param.endTime)
-			}
-			
-			if(param.startTime) {
-				param.startTime = this.$method.TimeTotimestamp(param.startTime)
-			}
-			console.log(param,'param')
-			this.$api.mockApplyListApplyName(param).then((res) => {
-				this.listApplyName = res.data.rows;
-				console.log(this.listApplyName,'listApplyName')
-				this.param.applyName = "";
-				this.mockSubscribeListSubscribe();
-			});
-		},
-		reApply(item){
-			uni.redirectTo({
-				url:'/pages5/examAppointList/index'
-			})
-		},
-		report(item) {
-			uni.navigateTo({
-			  url:
-			    "/pages5/examReport/index?&examId=" +
-			    item.examId +
-			    "&id=" +
-			    item.recordId+
-					"&eachExamId="+item.eachExamId+
-					"&subscribeId="+item.subscribeId
-			});
-		},
-		doQuestion(item) {
-			if(item.canDo === 0) {
-				uni.showToast({
-					icon:'none',
-					msg:'请等待所有科目考试结束后再进入刷题'
-					
-				})
-				return;
-			}
-			
-			uni.navigateTo({
-				url:'../examBank/index?examId='+item.examId+'&eachExamId='+item.eachExamId+'&subscribeId='+item.subscribeId
-			})
-		},
-		goTest(item) {
-			if (item.mockActivity && item.mockActivity == 1) {
-				return false
-			}
-			let startTime = this.$method.TimeTotimestamp(this.$method.timestampToTime(item.applySiteExamTime) + ' ' + item.applySiteStartTime)
-			let canGo = (startTime-this.nowTime) <= (600) && (startTime-this.nowTime) >= (-(item.timeLimit * 60)  || 0)
-			
-			return !canGo
-		},
-		isStart(item) {
-			let startTime = this.$method.TimeTotimestamp(
-				this.$method.timestampToTime(item.applySiteExamTime) +
-					" " +
-					item.applySiteStartTime
-			);
-
-			return startTime - this.nowTime <= 600;
-		},
-		mockSubscribeListSubscribe() {
-			let param = JSON.parse(JSON.stringify(this.param))
-			if(param.endTime) {
-				param.endTime = this.$method.TimeTotimestamp(param.endTime)
-			}
-			
-			if(param.startTime) {
-				param.startTime = this.$method.TimeTotimestamp(param.startTime)
-			}
-			// mock/subscribe/listSubscribe
-			this.$api.mockSubscribeListSubscribe(param).then(res => {
-				
-				this.recordList.push(...res.data.rows)
-				this.total = res.data.total
-			})
-		},
-		refreshByIndex() {
-			let param = JSON.parse(JSON.stringify(this.param))
-			if(param.endTime) {
-				param.endTime = this.$method.TimeTotimestamp(param.endTime)
-			}
-			
-			if(param.startTime) {
-				param.startTime = this.$method.TimeTotimestamp(param.startTime)
-			}
-			param.pageNum = this.itemIndex+1;
-			param.pageSize =  1
-			this.$api.mockSubscribeListSubscribe(param).then(res => {
-				console.log('res.data.rows[0]', res.data.rows[0])
-				this.$set(this.recordList,this.itemIndex,res.data.rows[0])
-				this.itemIndex = ''
-			})
-		},
-		
-		goLive(item) {
-			let uuid = new Date().valueOf() + ""
-      		// buyCourse 是否购买课程:1是 0否
-			let encode = encodeURIComponent(config.WEBVIEW_URL+'pages/live/index?token='+uni.getStorageSync('token')+'&userInfo='+JSON.stringify(this.userInfo)+'&channelId='
-			+item.liveUrl+'&buyCourse=1'+'&ident='+uuid)
-			uni.navigateTo({
-				url:`../../pages/webview/index?url=`+encode
-			})
-		},
-		async goExamCount(item,index) {
-			if (item.mockActivity && item.mockActivity == 1) {
-				if (!(item.activityStartTime < this.nowTime)) {
-					return
-				}
-				await this.$http({
-					url: '/mock/apply/addMockTime',
-					method: 'post',
-					data: {
-						applyId: item.applyId,
-						duration: item.duration,
-						majorId: item.majorId,
-						subjectId: item.subjectId,
-						mockMajorSubjectId: item.mockMajorSubjectId
-					},
-				}).then((res) => {
-					if (res.data.code == 200) {
-						const { examTime, startTime, endTime, eachExamId, mockActivity} = res.data.data
-						let o_item = {
-							...item,
-							applySiteExamTime: examTime,
-							applySiteStartTime: startTime,
-							applySiteEndTime: endTime,
-							eachExamId: eachExamId,
-							mockActivity: mockActivity
-						}
-						// item.applySiteExamTime = examTime // 当前时间的时间戳
-						// item.applySiteStartTime = startTime
-						// item.applySiteEndTime = endTime
-						// item.eachExamId = eachExamId
-						this.toJump(o_item, index)
-					} else {
-						this.$u.toast(res.data.msg)
-						return
-					}
-					
-				})
-				
-			} else {
-				this.toJump(item, index)
-			
-			}
-		},
-		toJump(item, index) {
-			if(this.goTest(item)) {
-				uni.showToast({
-					icon:'none',
-					title:'不在考试时间'
-				})
-				return;
-			}
-
-			this.itemIndex = index;
-			uni.navigateTo({
-				url:'../examCount/index?start='+this.$method.TimeTotimestamp(this.$method.timestampToTime(item.applySiteExamTime) + ' ' + 
-				item.applySiteStartTime)+'&limit='+item.timeLimit+'&examId='+item.examId+'&eachExamId='+item.eachExamId+'&subscribeId='
-				+item.subscribeId+'&mockName='+item.applyName +'&examEndTime='+this.$method.TimeTotimestamp(this.$method.timestampToTime(item.applySiteExamTime) 
-				+ ' ' + item.applySiteEndTime)+'&mockActivity=' + item.mockActivity
-			})
-		},
-		
-		sort() {
-			
-		},
-		
-		appoint(item) {
-			this.appointModal = true;
-		},
-		tab(state) {
-			if(this.param.mockStatus == state) {
-				return;
-			}
-			this.recordList = [];
-			this.param.endTime = '';
-			this.param.startTime = '';
-			this.param.applyName = '';
-			this.param.pageNum = 1;
-			this.param.mockStatus = state;
-			this.mockSubscribeListSubscribe()
-		},
-		bindDateFromChange(e) {
-			this.param.startTime = e.detail.value
-			this.param.pageNum = 1;
-			this.param.applyName = '';
-			this.recordList = []
-			this.mockApplyListApplyName();
-		},
-		
-		bindDateToChange(e) {
-				this.param.endTime = e.detail.value
-				this.param.pageNum = 1;
-				this.param.applyName = '';
-				this.recordList = []
-				this.mockApplyListApplyName();
-		},
-		
-		bindTitleChange(e) {
-			if (this.listApplyName.length) {
-				let index = e.detail.value;
-				this.param.applyName = this.listApplyName[index].applyName
-				
-			} else {
-				this.param.applyName  =''
-			}
-			this.param.pageNum = 1;
-			this.recordList = []
-			this.mockSubscribeListSubscribe();
-		}
-	}
+  data() {
+    return {
+      showSort: false,
+      index: 0,
+      list: [],
+      list1: [],
+      recordList: [],
+      goodsData: {},
+      param: {
+        pageNum: 1,
+        pageSize: 10,
+        mockStatus: 0,
+        endTime: "",
+        startTime: "",
+        applyName: "",
+      },
+      nowTime: 0,
+      sysTime: Date.now(),
+      dateFrom: "",
+      dateTo: "",
+      isRepeat: false,
+      total: 0,
+      activeIndex: 0,
+      typeIndex: 0,
+      itemIndex: "",
+      modalTop: 0,
+      endDate: "",
+      titleName: 3,
+      listApplyName: [],
+    };
+  },
+  computed: {
+    ...mapGetters(["userInfo"]),
+  },
+  onLoad(option) {
+    this.param.mockStatus = option.state || 0;
+
+    this.endDate = this.$method
+      .timestampToTime(new Date().getTime() / 1000)
+      .replace(/-/g, "/");
+
+    // this.mockSubscribeListSubscribe();
+    uni.getSystemInfo({
+      success: (e) => {
+        let info = uni.createSelectorQuery().select(".nav");
+        info
+          .boundingClientRect((navData) => {
+            //data - 各种参数
+
+            let info = uni.createSelectorQuery().select(".tabs");
+            info
+              .boundingClientRect((tabData) => {
+                //data - 各种参数
+                this.modalTop = navData.height + tabData.height;
+                console.log(navData); // 获取元素宽度
+                console.log(tabData); // 获取元素宽度
+              })
+              .exec();
+          })
+          .exec();
+      },
+    });
+  },
+  onPullDownRefresh() {
+    let that = this;
+    this.param.pageNum = 1;
+    this.mockSubscribeListSubscribe();
+    setTimeout(function () {
+      uni.stopPullDownRefresh();
+    }, 500);
+  },
+  onReachBottom() {
+    console.log(this.total, "total");
+    console.log(this.recordList.length, "length");
+    if (this.recordList.length < this.total) {
+      this.param.pageNum++;
+      this.mockSubscribeListSubscribe();
+    }
+  },
+  onShow() {
+    this.nowTime = +this.$method.timest();
+    // if(this.itemIndex !== '') {
+    // 	this.refreshByIndex();
+    // }
+    this.recordList = [];
+    this.mockSubscribeListSubscribe();
+  },
+  methods: {
+    mockApplyListApplyName() {
+      let param = JSON.parse(JSON.stringify(this.param));
+      if (param.endTime) {
+        param.endTime = this.$method.TimeTotimestamp(param.endTime);
+      }
+
+      if (param.startTime) {
+        param.startTime = this.$method.TimeTotimestamp(param.startTime);
+      }
+      console.log(param, "param");
+      this.$api.mockApplyListApplyName(param).then((res) => {
+        this.listApplyName = res.data.rows;
+        console.log(this.listApplyName, "listApplyName");
+        this.param.applyName = "";
+        this.mockSubscribeListSubscribe();
+      });
+    },
+    reApply(item) {
+      uni.redirectTo({
+        url: "/pages5/examAppointList/index",
+      });
+    },
+    report(item) {
+      uni.navigateTo({
+        url:
+          "/pages5/examReport/index?&examId=" +
+          item.examId +
+          "&id=" +
+          item.recordId +
+          "&eachExamId=" +
+          item.eachExamId +
+          "&subscribeId=" +
+          item.subscribeId,
+      });
+    },
+    doQuestion(item) {
+      if (item.canDo === 0) {
+        uni.showToast({
+          icon: "none",
+          msg: "请等待所有科目考试结束后再进入刷题",
+        });
+        return;
+      }
+
+      uni.navigateTo({
+        url:
+          "../examBank/index?examId=" +
+          item.examId +
+          "&eachExamId=" +
+          item.eachExamId +
+          "&subscribeId=" +
+          item.subscribeId,
+      });
+    },
+    goTest(item) {
+      if (item.mockActivity && item.mockActivity == 1) {
+        return false;
+      }
+      let startTime = this.$method.TimeTotimestamp(
+        this.$method.timestampToTime(item.applySiteExamTime) +
+          " " +
+          item.applySiteStartTime
+      );
+      let canGo =
+        startTime - this.nowTime <= 600 &&
+        startTime - this.nowTime >= (-(item.timeLimit * 60) || 0);
+
+      return !canGo;
+    },
+    isStart(item) {
+      let startTime = this.$method.TimeTotimestamp(
+        this.$method.timestampToTime(item.applySiteExamTime) +
+          " " +
+          item.applySiteStartTime
+      );
+
+      return startTime - this.nowTime <= 600;
+    },
+    mockSubscribeListSubscribe() {
+      let param = JSON.parse(JSON.stringify(this.param));
+      if (param.endTime) {
+        param.endTime = this.$method.TimeTotimestamp(param.endTime);
+      }
+
+      if (param.startTime) {
+        param.startTime = this.$method.TimeTotimestamp(param.startTime);
+      }
+      // mock/subscribe/listSubscribe
+      this.$api.mockSubscribeListSubscribe(param).then((res) => {
+        this.recordList.push(...res.data.rows);
+        this.total = res.data.total;
+      });
+    },
+    refreshByIndex() {
+      let param = JSON.parse(JSON.stringify(this.param));
+      if (param.endTime) {
+        param.endTime = this.$method.TimeTotimestamp(param.endTime);
+      }
+
+      if (param.startTime) {
+        param.startTime = this.$method.TimeTotimestamp(param.startTime);
+      }
+      param.pageNum = this.itemIndex + 1;
+      param.pageSize = 1;
+      this.$api.mockSubscribeListSubscribe(param).then((res) => {
+        console.log("res.data.rows[0]", res.data.rows[0]);
+        this.$set(this.recordList, this.itemIndex, res.data.rows[0]);
+        this.itemIndex = "";
+      });
+    },
+
+    goLive(item) {
+      let uuid = new Date().valueOf() + "";
+      // buyCourse 是否购买课程:1是 0否
+      let encode = encodeURIComponent(
+        config.WEBVIEW_URL +
+          "pages/live/index?token=" +
+          uni.getStorageSync("token") +
+          "&userInfo=" +
+          JSON.stringify(this.userInfo) +
+          "&channelId=" +
+          item.liveUrl +
+          "&buyCourse=1" +
+          "&ident=" +
+          uuid
+      );
+      uni.navigateTo({
+        url: `../../pages/webview/index?url=` + encode,
+      });
+    },
+    async goExamCount(item, index) {
+      if (item.mockActivity && item.mockActivity == 1) {
+        if (!(item.activityStartTime < this.nowTime)) {
+          return;
+        }
+        await this.$http({
+          url: "/mock/apply/addMockTime",
+          method: "post",
+          data: {
+            applyId: item.applyId,
+            duration: item.duration,
+            majorId: item.majorId,
+            subjectId: item.subjectId,
+            mockMajorSubjectId: item.mockMajorSubjectId,
+          },
+        }).then((res) => {
+          if (res.data.code == 200) {
+            const { examTime, startTime, endTime, eachExamId, mockActivity } =
+              res.data.data;
+            let o_item = {
+              ...item,
+              applySiteExamTime: examTime,
+              applySiteStartTime: startTime,
+              applySiteEndTime: endTime,
+              eachExamId: eachExamId,
+              mockActivity: mockActivity,
+            };
+            // item.applySiteExamTime = examTime // 当前时间的时间戳
+            // item.applySiteStartTime = startTime
+            // item.applySiteEndTime = endTime
+            // item.eachExamId = eachExamId
+            this.toJump(o_item, index);
+          } else {
+            this.$u.toast(res.data.msg);
+            return;
+          }
+        });
+      } else {
+        this.toJump(item, index);
+      }
+    },
+    toJump(item, index) {
+        if (this.goTest(item)) {
+          uni.showToast({
+            icon: "none",
+            title: "不在考试时间",
+          });
+          return;
+        }
+      this.itemIndex = index;
+      uni.navigateTo({
+        url:
+          "../examCount/index?start=" +
+          this.$method.TimeTotimestamp(
+            this.$method.timestampToTime(item.applySiteExamTime) +
+              " " +
+              item.applySiteStartTime
+          ) +
+          "&limit=" +
+          item.timeLimit +
+          "&examId=" +
+          item.examId +
+          "&eachExamId=" +
+          item.eachExamId +
+          "&subscribeId=" +
+          item.subscribeId +
+          "&mockName=" +
+          item.applyName +
+          "&examEndTime=" +
+          this.$method.TimeTotimestamp(
+            this.$method.timestampToTime(item.applySiteExamTime) +
+              " " +
+              item.applySiteEndTime
+          ) +
+          "&mockActivity=" +
+          item.mockActivity +
+          "&goodsId=" +
+          (item.goodsId || "") +
+          "&orderGoodsId=" +
+          (item.orderGoodsId || ""),
+      });
+    },
+
+    sort() {},
+
+    appoint(item) {
+      this.appointModal = true;
+    },
+    tab(state) {
+      if (this.param.mockStatus == state) {
+        return;
+      }
+      this.recordList = [];
+      this.param.endTime = "";
+      this.param.startTime = "";
+      this.param.applyName = "";
+      this.param.pageNum = 1;
+      this.param.mockStatus = state;
+      this.mockSubscribeListSubscribe();
+    },
+    bindDateFromChange(e) {
+      this.param.startTime = e.detail.value;
+      this.param.pageNum = 1;
+      this.param.applyName = "";
+      this.recordList = [];
+      this.mockApplyListApplyName();
+    },
+
+    bindDateToChange(e) {
+      this.param.endTime = e.detail.value;
+      this.param.pageNum = 1;
+      this.param.applyName = "";
+      this.recordList = [];
+      this.mockApplyListApplyName();
+    },
+
+    bindTitleChange(e) {
+      if (this.listApplyName.length) {
+        let index = e.detail.value;
+        this.param.applyName = this.listApplyName[index].applyName;
+      } else {
+        this.param.applyName = "";
+      }
+      this.param.pageNum = 1;
+      this.recordList = [];
+      this.mockSubscribeListSubscribe();
+    },
+  },
 };
 </script>
 <style>
 page {
-	background: #eaeef1;
+  background: #eaeef1;
 }
 </style>
 <style lang="scss" scope>
-	.animals{
-		transition: all 0.3s;
-		transform: rotate(180deg);
-	}
+.animals {
+  transition: all 0.3s;
+  transform: rotate(180deg);
+}
 .tabs {
-	position: fixed;
-	left: 0;
-	width: 100%;
-	display: flex;
-	z-index: 10;
-	background: #ffffff;
-	padding:18rpx 0;
-	border-bottom:1px solid #eee;
-	.tab {
-		padding:0 18rpx;
-		flex: 1;
-		background: #ffffff;
-		font-size: 32rpx;
-		color: #999999;
-		text-align: center;
-		position:relative;
-		
-		&:nth-of-type(2) {
-			border-right:1px solid #EEEEEE;
-		}
-
-		&.active {
-			color: #333333;
-			
-			&::before{
-				content:'';
-				position:absolute;
-				width: 24px;
-				height: 4px;
-				background: #007AFF;
-				border-radius: 2px;
-				left:50%;
-				margin-left:-12px;
-				bottom:-18rpx;
-			}
-		}
-	}
-	
-	.sort {
-		width:160rpx;
-		text-align: center;
-		font-size: 32rpx;
-		font-weight: 500;
-		color: #999999;
-	}
+  position: fixed;
+  left: 0;
+  width: 100%;
+  display: flex;
+  z-index: 10;
+  background: #ffffff;
+  padding: 18rpx 0;
+  border-bottom: 1px solid #eee;
+  .tab {
+    padding: 0 18rpx;
+    flex: 1;
+    background: #ffffff;
+    font-size: 32rpx;
+    color: #999999;
+    text-align: center;
+    position: relative;
+
+    &:nth-of-type(2) {
+      border-right: 1px solid #eeeeee;
+    }
+
+    &.active {
+      color: #333333;
+
+      &::before {
+        content: "";
+        position: absolute;
+        width: 24px;
+        height: 4px;
+        background: #007aff;
+        border-radius: 2px;
+        left: 50%;
+        margin-left: -12px;
+        bottom: -18rpx;
+      }
+    }
+  }
+
+  .sort {
+    width: 160rpx;
+    text-align: center;
+    font-size: 32rpx;
+    font-weight: 500;
+    color: #999999;
+  }
 }
 
 .record {
-	margin-top:80rpx;
-	padding: 16rpx 16rpx;
-	.examList {
-		.main {
-			background: #ffffff;
-			border-radius: 16rpx;
-			margin: 20rpx 0;
-		}
-		.top {
-			height: 80rpx;
-			text-align: center;
-			line-height: 80rpx;
-			font-size: 30rpx;
-			color:#333333;
-			font-weight: bold;
-			border-bottom: 1px solid #eeeeee;
-		}
-		.item {
-			display: flex;
-			justify-content: space-between;
-			align-items: center;
-			margin-left: 31rpx;
-			height: 80rpx;
-			padding-right: 24rpx;
-			border-bottom: 1px solid #eeeeee;
-			font-size: 24rpx;
-			color: #666666;
-			.right {
-				font-size: 28rpx;
-			}
-		}
-		
-		.btn-wrap {
-			padding:24rpx 16rpx ;
-			border-bottom:1px solid #EEEEEE;
-			
-			.btn-line {
-				display: flex;
-				align-items: center;
-				justify-content: center;
-				flex-wrap: wrap;
-			}
-			
-			.text {
-				width:100%;
-				color:#F5222D;
-				font-size: 24rpx;
-				text-align: center;
-			}
-			
-			.text-half {
-				color:#666666;
-				font-size: 24rpx;
-				width:320rpx;
-				margin:8rpx;
-			}
-			
-			.btn {
-				margin:8rpx;
-				width: 528rpx;
-				height: 64rpx;
-				background: #007AFF;
-				border-radius: 16rpx;
-				text-align: center;
-				line-height: 64rpx;
-				color:#fff;
-				
-				&--half {
-					width:320rpx;
-				}
-				
-				
-				&.border {
-					background:#fff;
-					color:#007AFF;
-					border:1px solid #007AFF;
-				}
-				
-				
-				&.disabled {
-					color:#D9D9D9;
-					border-color:#D9D9D9;
-				}
-				
-				&.test-disabled {
-					color:#fff;
-					background:#D9D9D9;
-				}
-			}
-		}
-	}
-}
+  margin-top: 80rpx;
+  padding: 16rpx 16rpx;
+  .examList {
+    .main {
+      background: #ffffff;
+      border-radius: 16rpx;
+      margin: 20rpx 0;
+    }
+    .top {
+      height: 80rpx;
+      text-align: center;
+      line-height: 80rpx;
+      font-size: 30rpx;
+      color: #333333;
+      font-weight: bold;
+      border-bottom: 1px solid #eeeeee;
+    }
+    .item {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      margin-left: 31rpx;
+      height: 80rpx;
+      padding-right: 24rpx;
+      border-bottom: 1px solid #eeeeee;
+      font-size: 24rpx;
+      color: #666666;
+      .right {
+        font-size: 28rpx;
+      }
+    }
+
+    .btn-wrap {
+      padding: 24rpx 16rpx;
+      border-bottom: 1px solid #eeeeee;
+
+      .btn-line {
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-wrap: wrap;
+      }
+
+      .text {
+        width: 100%;
+        color: #f5222d;
+        font-size: 24rpx;
+        text-align: center;
+      }
+
+      .text-half {
+        color: #666666;
+        font-size: 24rpx;
+        width: 320rpx;
+        margin: 8rpx;
+      }
+
+      .btn {
+        margin: 8rpx;
+        width: 528rpx;
+        height: 64rpx;
+        background: #007aff;
+        border-radius: 16rpx;
+        text-align: center;
+        line-height: 64rpx;
+        color: #fff;
 
+        &--half {
+          width: 320rpx;
+        }
+
+        &.border {
+          background: #fff;
+          color: #007aff;
+          border: 1px solid #007aff;
+        }
+
+        &.disabled {
+          color: #d9d9d9;
+          border-color: #d9d9d9;
+        }
+
+        &.test-disabled {
+          color: #fff;
+          background: #d9d9d9;
+        }
+      }
+    }
+  }
+}
 
 .modal {
-	bottom:0;
-	z-index: 199999999;
-	position: fixed;
-	left: 0;
-	width: 100%;
-
-	.content {
-		overflow: hidden;
-		position: relative;
-		z-index: 10;
-		background: #fff;
-		padding: 20rpx 12rpx 16rpx;
-		
-		.item {
-			&__title {
-				padding:16rpx 0;
-				font-size: 28rpx;
-				color: #999999;
-			}
-			
-			&__box {
-				padding:0 16rpx;
-				display: flex;
-				width: 718rpx;
-				height: 80rpx;
-				background: #FFFFFF;
-				border: 1px solid #EEEEEE;
-				border-radius: 16rpx;
-				align-items: center;
-				
-				
-				.text {
-					flex:1;
-					display: flex;
-					align-items: center;
-				}
-			}
-		}
-	}
-
-	.modal_wrap {
-		position: absolute;
-		left: 0;
-		width: 100%;
-		top: 0;
-		height: 100%;
-		background: rgba(0, 0, 0, 0.3);
-	}
+  bottom: 0;
+  z-index: 199999999;
+  position: fixed;
+  left: 0;
+  width: 100%;
+
+  .content {
+    overflow: hidden;
+    position: relative;
+    z-index: 10;
+    background: #fff;
+    padding: 20rpx 12rpx 16rpx;
+
+    .item {
+      &__title {
+        padding: 16rpx 0;
+        font-size: 28rpx;
+        color: #999999;
+      }
+
+      &__box {
+        padding: 0 16rpx;
+        display: flex;
+        width: 718rpx;
+        height: 80rpx;
+        background: #ffffff;
+        border: 1px solid #eeeeee;
+        border-radius: 16rpx;
+        align-items: center;
+
+        .text {
+          flex: 1;
+          display: flex;
+          align-items: center;
+        }
+      }
+    }
+  }
+
+  .modal_wrap {
+    position: absolute;
+    left: 0;
+    width: 100%;
+    top: 0;
+    height: 100%;
+    background: rgba(0, 0, 0, 0.3);
+  }
 }
 
 .activesty {
-	background: #007aff !important;
-	color: #fff !important;
+  background: #007aff !important;
+  color: #fff !important;
 }
 .nodata {
-	text-align: center;
-    margin-top: 100rpx;
-    font-size: 32rpx;
-    color: #222;
+  text-align: center;
+  margin-top: 100rpx;
+  font-size: 32rpx;
+  color: #222;
 }
 </style>

+ 1 - 0
pages5/examReport/questionBankAllExplain.vue

@@ -827,6 +827,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

+ 1 - 0
pages5/examReport/questionBankWrongExplain.vue

@@ -843,6 +843,7 @@ export default {
 
   .flex_auto {
     flex: 1;
+    word-break: break-all;
   }
 }
 .activeTI {

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor