From 519f4a8687b963754534dfa2a8a7d70c72685582 Mon Sep 17 00:00:00 2001 From: Lee-1203 <342694918@qq.com> Date: Mon, 7 Mar 2022 19:31:43 +0800 Subject: [PATCH] =?UTF-8?q?h5=E7=AB=AF=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/favicon.ico | Bin 4286 -> 3007 bytes src/App.vue | 69 +- src/main.js | 40 +- src/views/consultant/edit.vue | 1409 ++++++++++++-------------- src/views/consultant/list.vue | 8 +- src/views/index/index.vue | 1 + src/views/login.vue | 18 +- src/views/login/verification.vue | 23 +- src/views/user/feedback/index.vue | 24 +- src/views/user/info/index.vue | 17 +- src/views/user/information/index.vue | 38 +- src/views/user/ucenter/index.vue | 46 +- 12 files changed, 853 insertions(+), 840 deletions(-) diff --git a/public/favicon.ico b/public/favicon.ico index df36fcfb72584e00488330b560ebcf34a41c64c2..c9374a4ba192adffceefde1f7835a50293355763 100644 GIT binary patch literal 3007 zcmaJ@X*g7UAEuZrNy@Ht49PlcmKnx2Gj+U%35edO7fIs znNmtgQ3_=*MAoRR@93$X_ru$JuIrrta^3g++wKqN1Ywtrl!UT`kdTm+oh^Z5B+!zWohQg8ha6|M?7#e{9em-D9G&UswO~hIM zj3qc>z(HIt3k`*ag@r-FkPs$25DG`3P*4~Gia_WK5c-@52G>7apTSZ8rGTSy$ZQ&m zOJg#CRYm`O%up@{EXeeq66mbovJB48HVGOA4fkh3;SktrNxy(jPX8ZDr~gKCxJ2r| z`TkE~j#~ta3MEoG%uqI2Ft`Bq)le)nmQD5NGTClSX2`ED5`vgqCMSr=054C843;5a#a~M zw1VwKVy%$BxHu*`lul)Ee{m`Qa`AuUuG)dl5=6#P*|dXHiZz=_2Y!@|ru{h=t3T@f zTv&S*uSm>4qDy*wyxmt+x%39!0~K>wMmL!5`=`rpmsP*xA4ve zPg;oF8@c828svYm8pJa%09jii0r;Cw@?gGIgnpw}yz4@S<@Brp6@I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Eu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S diff --git a/src/App.vue b/src/App.vue index 3045371..0e235c7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -6,7 +6,18 @@ diff --git a/src/main.js b/src/main.js index e84745f..ab712c9 100644 --- a/src/main.js +++ b/src/main.js @@ -8,23 +8,33 @@ import router from './router' Vue.prototype.host = 'https://ypzy.emingren.com' Vue.prototype.HOME = '/api' - +// 添加请求拦截器具 axios.interceptors.request.use(config => { - if (config.url!="/api/api/user/login-by-Phone"&&config.url!="/api/api/common/send-sms-captcha") { - if (!localStorage.userData) { - router.replace('/login'); - return config - }else{ - config.headers.Authorization = "Bearer "+JSON.parse(localStorage.userData).token - } - } - - - - return config + if (config.url != "/api/api/user/login-by-Phone" && config.url != "/api/api/common/send-sms-captcha") { + if (!localStorage.userData) { + router.replace('/login'); + return config + } else { + config.headers.Authorization = "Bearer " + JSON.parse(localStorage.userData).token + } + } + return config }) + +// 添加响应拦截器 +// axios.interceptors.response.use(response => { +// // console.log(response); +// let res = {} +// res.status = response.status +// res.data = response.data +// return res; +// }, function(err) { +// return Promise.reject(err) +// }); + + Vue.use(VueAxios, axios) new Vue({ - router, - render: h => h(App) + router, + render: h => h(App) }).$mount('#app') diff --git a/src/views/consultant/edit.vue b/src/views/consultant/edit.vue index 7fe7241..614e157 100644 --- a/src/views/consultant/edit.vue +++ b/src/views/consultant/edit.vue @@ -1,787 +1,670 @@ \ No newline at end of file + diff --git a/src/views/consultant/list.vue b/src/views/consultant/list.vue index c15b1fa..df088d4 100644 --- a/src/views/consultant/list.vue +++ b/src/views/consultant/list.vue @@ -256,9 +256,7 @@ diff --git a/src/views/index/index.vue b/src/views/index/index.vue index 091ee11..312b06c 100644 --- a/src/views/index/index.vue +++ b/src/views/index/index.vue @@ -150,6 +150,7 @@ this.isScroll = true; window.addEventListener("scroll", this.eventScrollTop); this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount; + console.log(this.consult_amount,3636) }, mounted() { this.getBanner(); diff --git a/src/views/login.vue b/src/views/login.vue index 3eff505..b32867e 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -70,8 +70,8 @@
- -
+

{{ tipsMsg }}

+
确认
@@ -84,6 +84,7 @@ data() { return { isScrollTop: false, + tipsMsg: '', mode: 1, //登录方式 openAgreement: false, //阅读协议弹窗 isAgreement: true, //阅读协议状态 @@ -128,14 +129,14 @@ // 手机号登录 phoneLogin() { let that = this; - var reg_tel = - /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; + var reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/; if (this.phoneNumber == "") { - alert("请填写您的手机号码!"); - + this.openPhoneTips = true; + this.tipsMsg = '请填写您的手机号码!' return false; } else if (!reg_tel.test(this.phoneNumber)) { - alert("请正确填写您的手机号码!"); + this.openPhoneTips = true; + this.tipsMsg = '请正确填写您的手机号码!' return false; } this.axios @@ -202,4 +203,7 @@ diff --git a/src/views/login/verification.vue b/src/views/login/verification.vue index c547c2f..c643324 100644 --- a/src/views/login/verification.vue +++ b/src/views/login/verification.vue @@ -62,6 +62,7 @@ created() { this.isScroll = true; window.addEventListener("scroll", this.eventScrollTop); + this.phoneData = this.$route.query.phone const TIME_COUNT = 60; if (!this.timer) { @@ -100,10 +101,15 @@ sms_code: this.value, }) .then(function(res) { + console.log(res.data,252525) localStorage.userData = JSON.stringify(res.data.data); if (res.data.code == 0) { that.getUserData(); - that.goPages(); + if(res.data.data.userType == 1){ + that.$router.push('/consultant'); + }else{ + that.$router.push('/index'); + } } else { window.alert(res.msg); } @@ -113,21 +119,6 @@ }); }, - // 跳转页面 - goPages(){ - this.userType = (JSON.parse(localStorage.getItem("centerUserData"))).type; - console.log(this.userType,2525) - if(this.userType == 1){ - this.$router.push({ - path: "/consultant", - }); - }else{ - this.$router.push({ - path: "/index", - }); - } - }, - handleSubmit() { this.$emit("input", this.value); }, diff --git a/src/views/user/feedback/index.vue b/src/views/user/feedback/index.vue index 2a63027..b9340d1 100644 --- a/src/views/user/feedback/index.vue +++ b/src/views/user/feedback/index.vue @@ -13,6 +13,12 @@
提交
+ + +
+
+

{{toastText}}

+
@@ -23,6 +29,8 @@ return { isScrollTop: false, content: "", + isToast: false, + toastText: '' }; }, created() { @@ -34,6 +42,11 @@ methods: { btnFeedback() { if (this.content == "") { + this.toastText = '反馈内容不能为空', + this.isToast = true, + setTimeout(()=> { + this.isToast = false + }, 1000) return; } this.axios @@ -43,10 +56,15 @@ }, ) .then(function(res) { - window.alert(res.data.msg) + this.toastText = res.data.msg, + this.isToast = true, + setTimeout(()=> { + this.isToast = false + }, 1000) + this.$router.push('/ucenter'); }) - .catch(function(error) { - console.log(error); + .catch(function(err) { + window.alert(err.data.msg) }); }, // 滚动改变样式 diff --git a/src/views/user/info/index.vue b/src/views/user/info/index.vue index ffa81dd..a546f8d 100644 --- a/src/views/user/info/index.vue +++ b/src/views/user/info/index.vue @@ -24,6 +24,11 @@
提交
+ +
+
+

{{toastText}}

+
@@ -35,7 +40,9 @@ isScrollTop: false, myAvatar: '', nickName:'', - userDataAll:[] + userDataAll:[], + isToast:false, + toastText:'' }; }, created() { @@ -81,8 +88,12 @@ }) .then(function(res) { that.getUserData(); - that.$router.push('/ucenter'); - console.log(res) + that.toastText = res.data.msg, + that.isToast = true, + setTimeout(()=> { + that.isToast = false; + that.$router.push('/ucenter'); + }, 1000) }); }, diff --git a/src/views/user/information/index.vue b/src/views/user/information/index.vue index 8040294..ea118ff 100644 --- a/src/views/user/information/index.vue +++ b/src/views/user/information/index.vue @@ -125,6 +125,12 @@ + + +
+
+

{{toastText}}

+
@@ -134,7 +140,10 @@ data() { return { isScrollTop: false, - + + isToast: false, //是否显示提示框 + toastText:'', //提示内容 + addrArray: [], //城市名称列表 addrData: [], //考籍列表 addrIndex: 0, @@ -333,7 +342,11 @@ .subject_radio_group_list[0].indexOf(item) > -1) if (limitSubid != -1 && date != -1) { // 待提交科目数组id存在限制科目的id - console.log('选择科目冲突'); + this.toastText = '选择科目冲突', + this.isToast = true, + setTimeout(()=> { + this.isToast = false + }, 1000) } else { // 待提交科目数组id不存在限制科目的id this.subjectArray[index].isActive = !this.subjectArray[index].isActive; @@ -355,12 +368,15 @@ this.temporaryCode.splice(existSubid, 1); this.subjectArray[existsubIndex].isActive = false; } else { - console.log('提示框:xxxx'); + this.toastText = '最多选择'+this.addrData[this.addrIndex].subject_max+'科', + this.isToast = true, + setTimeout(()=> { + this.isToast = false + }, 1000) } } } else { // 单选 - // 清空暂存编号 this.temporaryCode = []; // 取消所有选中项 @@ -383,8 +399,18 @@ // 获取考生信息 setStudentInfo() { let that = this; - if (that.temporaryCode.length != that.addrData[that.addrIndex].subject_max) { - console.log('弹框提示,必须选择多少个科目'); + if(that.studentName == ''){ + this.toastText = '姓名不能为空', + this.isToast = true, + setTimeout(()=> { + this.isToast = false + }, 1000) + }else if (that.temporaryCode.length != that.addrData[that.addrIndex].subject_max) { + this.toastText = '必须选择'+this.addrData[this.addrIndex].subject_max+'科', + this.isToast = true, + setTimeout(()=> { + this.isToast = false + }, 1000) } else { let that = this; this.axios diff --git a/src/views/user/ucenter/index.vue b/src/views/user/ucenter/index.vue index 759cb0e..1b7dd2c 100644 --- a/src/views/user/ucenter/index.vue +++ b/src/views/user/ucenter/index.vue @@ -18,15 +18,15 @@ -
+
- 立即使用 - 立即领取 -

有效期:2022.2.1-2022.2.15

+ 立即使用 + 立即领取 +

有效期:{{startTime}}-{{endTime}}

-
+
  • @@ -57,7 +57,7 @@

    我的报告

-
    +
    • {{item.title}}

      {{item.done_at}} @@ -80,9 +80,10 @@ centerUserData: { mobile: "", }, + isExpire: false, //是否失效 + consult_amount: 0, reportData: [], isScrollTop: false, - isReceive: 1, //是否领取咨询机会 isUse: 0, //是否使用 isOpen: false, userData: { @@ -108,6 +109,9 @@ update_time: "", user_code: "", }, + student_first_complete:'' ,//领取咨询卡时间 + startTime: '', //有效期开始时间 + endTime: '', //有效期结束 }; }, created() { @@ -115,8 +119,13 @@ window.addEventListener("scroll", this.eventScrollTop); this.getUserData(); this.getevaluationList() + this.consult_amount = (JSON.parse(localStorage.getItem("centerUserData"))).consult_amount; + }, + mounted() { + this.getDate(); }, methods: { + // 获取报告列表 getevaluationList() { let that = this @@ -132,9 +141,9 @@ // 判断跳转方式 toPage() { - if (this.isReceive == 1) { + if (this.consult_amount == 1) { this.$router.push("/expert"); - } else if (this.isReceive == 0) { + } else if (this.consult_amount == 0) { this.$router.push("/information"); } else { return false; @@ -165,6 +174,25 @@ }); }, + // 获取有效时期 + getDate() { + let starTime = (JSON.parse(localStorage.getItem("centerUserData"))).student.student_first_complete; + let date = new Date(starTime.replace(/-/g, '/')); + this.startTime = date.getFullYear()+"."+(date.getMonth()+1)+"."+date.getDate(); //有效期开始时间 + + let date1 = new Date(starTime.replace(/-/g, '/')); + date1.setDate(date.getDate()+7); + this.endTime = date1.getFullYear()+"."+(date1.getMonth()+1)+"."+date1.getDate(); //有效期结束时间 + + // 获取当前时间 + let date2 = new Date(); + if(date1.setDate(date.getDate()+7) <= date2.setDate(date.getDate())){ + this.isExpire = true; + } + }, + + + // 退出登录 outLogin(){ localStorage.clear();