فهرست منبع

1.feat:新增二建继教功能提示弹窗,2.fix:根据二建提示需求,新增、修改学习列表提示

xiexaing 1 سال پیش
والد
کامیت
7a6d5b68d9
5فایلهای تغییر یافته به همراه377 افزوده شده و 206 حذف شده
  1. 206 194
      common/httpList/login.js
  2. 77 1
      pages/index/index.vue
  3. 74 10
      pages/learn/index.vue
  4. 18 0
      pages3/polyv/detail.vue
  5. 2 1
      pages4/login/login.vue

+ 206 - 194
common/httpList/login.js

@@ -1,199 +1,211 @@
-import { myRequest } from "../request.js";
+import {
+	myRequest
+} from "../request.js";
 import store from "@/store/index.js";
 export default {
-  //我的列表数据
-  getinfoAttached(data) {
-    return myRequest({
-      url: "/app/user/infoAttached",
-      method: "get",
-      data: data,
-    });
-  },
-  //登录
-  login(data) {
-    return myRequest({
-      url: "/login",
-      // url: '/testLogin',
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  //登录用户信息
-  getInfo(data) {
-    return myRequest({
-      url: "/app/user/getInfo",
-      method: "get",
-      data: data,
-    });
-  },
-  /**
-   * @param {Object} data
-   * 微信登录
-   */
-  wxLogin(data) {
-    return myRequest({
-      url: "/app/common/bindLogin",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
+	//我的列表数据
+	getinfoAttached(data) {
+		return myRequest({
+			url: "/app/user/infoAttached",
+			method: "get",
+			data: data,
+		});
+	},
+	//登录
+	login(data) {
+		return myRequest({
+			url: "/login",
+			// url: '/testLogin',
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	//登录用户信息
+	getInfo(data) {
+		return myRequest({
+			url: "/app/user/getInfo",
+			method: "get",
+			data: data,
+		});
+	},
+	/**
+	 * @param {Object} data
+	 * 微信登录
+	 */
+	wxLogin(data) {
+		return myRequest({
+			url: "/app/common/bindLogin",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
 
-  //刷新令牌
-  refreshToken(data) {
-    return myRequest({
-      url: "/refreshToken/" + data,
-      method: "get",
-      noToken: true,
-    });
-  },
-  //查询等级列表
-  gradelist(data) {
-    return myRequest({
-      url: "/grade/list",
-      method: "get",
-      data: data,
-    });
-  },
-  refreshUserInfo() {
-    this.getInfo().then((resdata) => {
-      if (resdata.data.code == 200) {
-        store.commit("updateUserInfo", { userInfo: resdata.data.data });
-      }
-    });
-  },
-  //注册短信
-  registerSms(data) {
-    return myRequest({
-      url: "/app/common/sms/register",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  //获取重新绑定手机短信
-  bindNewSms(data) {
-    return myRequest({
-      url: "/app/common/sms/bindNew",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
+	//刷新令牌
+	refreshToken(data) {
+		return myRequest({
+			url: "/refreshToken/" + data,
+			method: "get",
+			noToken: true,
+		});
+	},
+	//查询等级列表
+	gradelist(data) {
+		return myRequest({
+			url: "/grade/list",
+			method: "get",
+			data: data,
+		});
+	},
+	refreshUserInfo() {
+		this.getInfo().then((resdata) => {
+			if (resdata.data.code == 200) {
+				store.commit("updateUserInfo", {
+					userInfo: resdata.data.data
+				});
+			}
+		});
+	},
+	//注册短信
+	registerSms(data) {
+		return myRequest({
+			url: "/app/common/sms/register",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	//获取重新绑定手机短信
+	bindNewSms(data) {
+		return myRequest({
+			url: "/app/common/sms/bindNew",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
 
-  //重新绑定手机
-  bindNewTel(data) {
-    return myRequest({
-      url: "/app/user/bindNewTel",
-      method: "post",
-      data: data,
-    });
-  },
+	//重新绑定手机
+	bindNewTel(data) {
+		return myRequest({
+			url: "/app/user/bindNewTel",
+			method: "post",
+			data: data,
+		});
+	},
 
-  //注册用户
-  registerUser(data) {
-    return myRequest({
-      url: "/app/common/register_small",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  //登录短信
-  loginSms(data) {
-    return myRequest({
-      url: "/app/common/sms/login",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  //忘记短信
-  forgetSms(data) {
-    return myRequest({
-      url: "/app/common/sms/forget",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  //忘记用户
-  forgetUser(data) {
-    return myRequest({
-      url: "/app/common/register_forget",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  //短信登录用户
-  smsLogin(data) {
-    return myRequest({
-      url: "/app/common/sms_login",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  //账号登录用户
-  accountLogin(data) {
-    return myRequest({
-      url: "/app/common/account_login",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  skipLogin(data) {
-    return myRequest({
-      url: "/app/common/telphone_login",
-      method: "post",
-      data: data,
-      noToken: true,
-    });
-  },
-  // 三级等保是否需要验证码
-  getDualAuth(data) {
-    return myRequest({
-      url: "/app/common/dual_auth",
-      method: "get",
-      data: data,
-      noToken: true,
-    });
-  },
-  //绑定身份证号信息
-  bindId(data) {
-    return myRequest({
-      url: "/app/user/bind_idcard",
-      method: "post",
-      data: data,
-    });
-  },
-  // 小程序校验PC登录二维码
-  scanLoginCheck(data) {
-    return myRequest({
-      url: "/scan_login_check",
-      method: "post",
-      data: data,
-    });
-  },
-  // 小程序已扫码
-  scanhasCode(data) {
-    return myRequest({
-      url: "/scan_code",
-      method: "get",
-      data: data,
-      noToken: true,
-    });
-  },
-  // 移动端配置参数
-  mobileConfig(data) {
-    return myRequest({
-      url: "/app/common/base/home/list",
-      method: "get",
-      data: data,
-      noToken: true,
-    });
-  },
-};
+	//注册用户
+	registerUser(data) {
+		return myRequest({
+			url: "/app/common/register_small",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	//登录短信
+	loginSms(data) {
+		return myRequest({
+			url: "/app/common/sms/login",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	//忘记短信
+	forgetSms(data) {
+		return myRequest({
+			url: "/app/common/sms/forget",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	//忘记用户
+	forgetUser(data) {
+		return myRequest({
+			url: "/app/common/register_forget",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	//短信登录用户
+	smsLogin(data) {
+		return myRequest({
+			url: "/app/common/sms_login",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	//账号登录用户
+	accountLogin(data) {
+		return myRequest({
+			url: "/app/common/account_login",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	skipLogin(data) {
+		return myRequest({
+			url: "/app/common/telphone_login",
+			method: "post",
+			data: data,
+			noToken: true,
+		});
+	},
+	// 三级等保是否需要验证码
+	getDualAuth(data) {
+		return myRequest({
+			url: "/app/common/dual_auth",
+			method: "get",
+			data: data,
+			noToken: true,
+		});
+	},
+	//绑定身份证号信息
+	bindId(data) {
+		return myRequest({
+			url: "/app/user/bind_idcard",
+			method: "post",
+			data: data,
+		});
+	},
+	// 小程序校验PC登录二维码
+	scanLoginCheck(data) {
+		return myRequest({
+			url: "/scan_login_check",
+			method: "post",
+			data: data,
+		});
+	},
+	// 小程序已扫码
+	scanhasCode(data) {
+		return myRequest({
+			url: "/scan_code",
+			method: "get",
+			data: data,
+			noToken: true,
+		});
+	},
+	// 移动端配置参数
+	mobileConfig(data) {
+		return myRequest({
+			url: "/app/common/base/home/list",
+			method: "get",
+			data: data,
+			noToken: true,
+		});
+	},
+	// 检查是否有二建班级10天过期
+	checkTenClassGradeUser(params) {
+		return myRequest({
+			url: '/grade/grade/checkTenClassGradeUser',
+			method: 'get',
+			params: params
+		})
+	},
+};

+ 77 - 1
pages/index/index.vue

@@ -174,8 +174,35 @@
 					<u-icon name="close" class="icon-close" @click="closeOff"></u-icon>
 				</view>
 			</view>
+
 		</view>
 		<!-- #endif -->
+		<u-popup v-model="checkDialogVisible" mode="center" :mask-close-able="false" border-radius="15" width="500">
+			<view style="padding: 20rpx; max-height: 500px">
+				<div style="color: #000; display: flex">
+					<div>
+						<u-icon name="error-circle-fill" style="color: #f59a23; margin: 8rpx 5rpx 0 0"></u-icon>
+					</div>
+					<div>
+						尊敬的用户:您购买的课程
+						<span v-for="item, index in checkTwoClassList" :key="index">
+							【{{ item.gradeName }}】班级有效期还剩 {{
+				                $method.GetRTime(item.classEndTime) > 0
+				                  ? $method.GetRTime(item.classEndTime)
+				                  : 0
+				                }}天,请在
+							{{
+				                  $method.timestampToTime(item.classEndTime, true, true)
+				                }}前完成学习及考试,到期未完成学时清零,需重新学习。<br>
+						</span>
+					</div>
+				</div>
+				<div style="margin-left: 30rpx;">
+					<u-button class="checkBtn" type="primary" size="medium" @click="goLearnPage">进入学习</u-button>
+					<u-button class="checkBtn" plain size="medium" @click="checkDialogVisible = false">取 消</u-button>
+				</div>
+			</view>
+		</u-popup>
 		<!-- tabbar -->
 		<myTabbar :backTopBtn="backTopBtn"></myTabbar>
 	</view>
@@ -189,6 +216,8 @@
 	export default {
 		data() {
 			return {
+				checkDialogVisible: false, // 检查是否有二建班级10天过期
+				checkTwoClassList: [], // 检查是否有二建班级10天过期
 				backTopBtn: false,
 				currentCourse: 0,
 				currentBank: 0,
@@ -385,6 +414,10 @@
 			};
 		},
 		async onLoad(option) {
+			if (option.show === '1') {
+				console.log(option, '--------show---------')
+				this.checkTenClassGradeUser()
+			}
 			let self = this
 			uni.hideTabBar();
 			// #ifdef H5
@@ -639,7 +672,44 @@
 				uni.switchTab({
 					url: '/pages/course/index'
 				});
-			}
+			},
+			// 检查是否有二建班级15天过期
+			checkTenClassGradeUser() {
+				this.$api
+					.checkTenClassGradeUser()
+					.then((res) => {
+						console.log(res, 'res')
+						if (res.data.code == 200) {
+							if (res.data.data && res.data.data.length > 0) {
+								let ary = uni.getStorageSync("loaclCheckClass") || []
+								let orderGoodsIds = []
+								if (ary && ary.length > 0) {
+									ary.forEach(i => {
+										if (i.userId == this.userInfo.userId) {
+											orderGoodsIds = i.orderGoodsIds || []
+										}
+									})
+									this.checkTwoClassList = res.data.data.filter(i => orderGoodsIds.indexOf(i
+										.orderGoodsId) == -1)
+								} else {
+									this.checkTwoClassList = res.data.data
+								}
+								this.checkDialogVisible = true;
+								if (!this.checkTwoClassList.length) this.checkDialogVisible = false;
+							}
+						}
+					})
+					.catch(() => {
+						this.checkDialogVisible = false;
+					});
+			},
+			// 跳转学习页面
+			goLearnPage() {
+				uni.switchTab({
+					url: "/pages/learn/index",
+				});
+				this.checkDialogVisible = false;
+			},
 		},
 	};
 </script>
@@ -650,6 +720,12 @@
 	}
 </style>
 <style lang="scss" scoped>
+	.checkBtn {
+		display: inline;
+		padding: 10rpx 20rpx;
+		margin-right: 15rpx;
+	}
+
 	.noGoods {
 		padding: 20rpx;
 		background-color: #fff;

+ 74 - 10
pages/learn/index.vue

@@ -156,7 +156,7 @@
                   }}
 								</text>
 							</view>
-							<view>
+							<view v-if="item.educationName != '继续教育'">
 								<text>学习服务:</text>
 								<text>
 									{{
@@ -164,20 +164,26 @@
                   }}至{{
                     $method.formDate(item.serviceEndTime, "yyyy/mm/dd")
                   }}</text>
+								<!-- 关于二建继教提示 -->
+								<text class="eb"
+									v-if="item.serviceEndTime && $method.GetRTime(item.serviceEndTime) <= 15">
+									(剩余{{ $method.GetRTime(item.serviceEndTime) > 0 ? $method.GetRTime(item.serviceEndTime): 0 }}天)
+								</text>
 							</view>
-							<view>
+							<view v-if="item.educationName != '考前培训'">
 								<text>班级状态:</text>
 								<text>
 									{{ classStatusCompt(item, sysTime) }}
 								</text>
 							</view>
-							<view>
+							<view v-if="item.educationName != '考前培训'">
 								<text>班级有效:</text>
 								<template v-if="item.classEndTime">
 									<text>
 										{{ $method.formDate(item.classEndTime, "yyyy/mm/dd") }}
 									</text>
-									<text class="eb">(剩余{{
+									<text class="eb"
+										v-if="item.classEndTime && $method.GetRTime(item.classEndTime) <= 15">(剩余{{
                       $method.GetRTime(item.classEndTime) > 0
                         ? $method.GetRTime(item.classEndTime)
                         : 0
@@ -245,7 +251,7 @@
 							">
 								推送失败原因:{{item.pushFailReason || '请先完善个人信息'}}
 							</div>
-							<div v-if="
+							<!-- <div v-if="
                   (item.periodStatus == 0 || item.periodStatus == -1)
                 ">
 								<span v-if="$method.GetRTime(item.classEndTime) >= 0">
@@ -272,6 +278,46 @@
 				    : $method.GetRTime(item.serviceEndTime)
 				}}天。
 								</span>
+							</div> -->
+							<!-- 关于二建继教提示 -->
+							<div v-if="
+							  (item.periodStatus == 0 || item.periodStatus == -1) 
+							">
+								<span
+									v-if="$method.GetRTime(item.classEndTime) >= 0 && $method.GetRTime(item.classEndTime) <= 15 && item.educationName != '考前培训'">
+									温馨提示:您当前的课程班级有效期还剩
+									{{ $method.GetRTime(item.classEndTime) > 0 ? $method.GetRTime(item.classEndTime): 0  }}
+									天,
+									请在{{ $method.timestampToTime(item.classEndTime, false) }}
+									前完成学习及考试,到期未完成学时将清零,需重新学习。
+								</span>
+								<span
+									v-if="$method.GetRTime(item.serviceEndTime) >= 0 && $method.GetRTime(item.serviceEndTime) <= 15 && item.educationName != '继续教育'">
+									温馨提示:您当前的课程学习服务期还剩
+									{{ $method.GetRTime(item.serviceEndTime) > 0 ? $method.GetRTime(item.serviceEndTime): 0  }}
+									天,
+									请在{{ $method.timestampToTime(item.serviceEndTime, false) }}
+									前完成学习,避免课程过期作废,无法学习给您带来不便。
+								</span>
+							</div>
+							<div v-if="isTwoEducation(item)">
+								<span v-if="item.sevenPushReason === '培训周期时间未到'">
+									温馨提示:您{{item.orderYear}}年公路工程专业培训周期还没到,请在{{ $method.timestampToTime(item.sevenPushDate) }}后再进行继教。
+								</span>
+								<span v-if="item.sevenPushReason === '无相关专业专书'">
+									温馨提示:您当前的课程{{item.orderYear}}年公路工程专业,未能匹配到可继教证书,可前往住建证书官网查询。
+									<span style="color: #2f9aff; cursor: pointer"
+										@click="goPage('https://rcgz.mohurd.gov.cn/Login/NetworkingSearch?type=2', 2) ">
+										复制官网链接
+									</span>
+								</span>
+								<span v-if="item.sevenPushReason === '无需2024继续教育'">
+									温馨提示:您{{item.orderYear}}年公路工程专业已完成继教,无需重复继教,可前往住建证书官网查询。
+									<span style="color: #2f9aff; cursor: pointer"
+										@click="copy('https://rcgz.mohurd.gov.cn/Login/NetworkingSearch?type=2', 2)">
+										复制官网链接
+									</span>
+								</span>
 							</div>
 							<div v-if="
                   item.gradeStatus == 1 &&
@@ -290,11 +336,18 @@
 							<div v-if="item.serviceEndTime && item.serviceEndTime < sysTime">
 								温馨提示:学习服务期已截至,如有疑问请联系:{{ eduPhone }}
 							</div>
-							<div v-if="item.periodStatus === 2 && !sevenFunc(item)">
+							<!-- 关于二建继教通过提示 -->
+							<div v-if="item.periodStatus === 1 && isTwoEducation(item)">
+								温馨提示:您的学时{{ $method.timestampToTime(item.periodTime) }}机构已审核通过,
+								需等待信息中心约15个工作日复审通过后即可获得继续教育学时,届时请前往信息中心官网查看学时及申请证书延期。
+								<span style="color: #2f9aff; cursor: pointer;"
+									@click="goPage('http://gdzczx.gdcic.net/', 2)"> 复制官网链接 </span>
+							</div>
+							<!-- 						<div v-if="item.periodStatus === 2 && !sevenFunc(item)">
 								温馨提示:您已完成本课程所有学时学习,我校将对学时进行审核,审核及推送时长预估15个工作日,如有疑问请联系:{{
                   eduPhone
                 }},学时查询网址:http://gdzczx.gdcic.net
-							</div>
+							</div> -->
 							<!-- <div v-if="item.periodStatus === 1 && !sevenFunc(item)">
 								温馨提示:您的班级学习初审已通过,待广东省建设信息中心归集学时,归集完成即为完成本次继续教育学习。归集学时需约10-15个工作日,具体以广东省建设执业资格注册服务平台的“继续教育学时查询”公布学时记录为准,学时查询网址:http://gdzczx.gdcic.net
 							</div> -->
@@ -566,10 +619,11 @@
 					examNum,
 					periodPlush,
 					studyStatus,
+					educationName
 				}) => {
 					let text = "";
 					let color = "";
-					if (periodStatus === -1) {
+					if (periodStatus === -1 || educationName == '考前培训') {
 						let index = 0;
 						if (studyStatus == 1) {
 							index = 0;
@@ -580,10 +634,11 @@
 						}
 						text = ["未开始", "学习中", "已学完"][index];
 						color = ["#EB5757", "#498AFE", "#498AFE"][index];
-					} else {
+					} else if (educationName != '考前培训') {
+						// "学时审核通过" ——> 初审通过
 						text = [
 							"审核不通过",
-							periodPlush > 0 ? "初审完成" : "学时审核通过",
+							periodPlush > 0 ? "初审完成" : "初审通过",
 							"待审核",
 							"初审完成",
 						][periodStatus];
@@ -615,6 +670,15 @@
 					return str;
 				};
 			},
+			// 二建继教提示判断
+			isTwoEducation() {
+				return function(item) {
+					return (
+						item.educationName + item.businessName + item.projectName ===
+						"继续教育二级建造师"
+					);
+				}
+			},
 		},
 		async onLoad(options) {
 			uni.hideTabBar();

+ 18 - 0
pages3/polyv/detail.vue

@@ -347,6 +347,7 @@
 				return;
 			}
 			this.option = option;
+
 			let {
 				skipPort,
 				id,
@@ -376,6 +377,7 @@
 				lockAction();
 				this.lockTimer = setInterval(lockAction, 10000);
 			}
+			this.saveLoaclCheckClass()
 			// 公众号模板消息的数据埋点
 			informId && this.clickOfficial(informId);
 			this.init();
@@ -428,6 +430,22 @@
 		mounted() {},
 		methods: {
 			...mapMutations(["updateChapterOpen", "updateLiveLast"]),
+			// 进行学习后,保存标识,用于检查是否二建15天提示弹窗弹出
+			saveLoaclCheckClass() {
+				let ary = uni.getStorageSync("loaclCheckClass") || []
+				let userFindIndex = ary.findIndex(i => i.userId == this.userInfo.userId)
+				if (userFindIndex !== -1) {
+					if (!ary[userFindIndex].orderGoodsIds.includes(this.orderGoodsId)) {
+						ary[userFindIndex].orderGoodsIds.push(this.orderGoodsId)
+					}
+				} else {
+					ary.push({
+						userId: this.userInfo.userId,
+						orderGoodsIds: [this.orderGoodsId]
+					})
+				}
+				uni.setStorageSync("loaclCheckClass", ary)
+			},
 			async init() {
 				// #ifdef MP-WEIXIN
 				this.isAllowSeek = "no";

+ 2 - 1
pages4/login/login.vue

@@ -538,6 +538,7 @@ hF6WiNlWfQTVoF1rhwIDAQAB
 								userId: resdata.data.data.userId,
 							});
 						}
+						//
 						if (!this.isBack) {
 							let goPath = "";
 							if (types == "wxlogin" || types == "smslogin") {
@@ -560,7 +561,7 @@ hF6WiNlWfQTVoF1rhwIDAQAB
 								console.log("登录后跳转");
 								uni.removeStorageSync("h5_code");
 								uni.reLaunch({
-									url: "/pages/index/index",
+									url: "/pages/index/index?show=1",
 								});
 								types == "wxlogin" &&
 									this.$method.setUuid(new Date().valueOf() + "");