From 022b8bc83589ef0f57d7df5e4933f5647ac977be Mon Sep 17 00:00:00 2001 From: zhouwentao <1577701412@qq.com> Date: Mon, 20 May 2024 16:16:56 +0800 Subject: [PATCH] updates --- common/js/commonTool.js | 39 + common/js/jumpTool.js | 24 + components/my-top-button.vue | 34 - pages/zyb/article/detail.vue | 134 ++ pages/zyb/article/list.vue | 255 +++ pages/zyb/article/list2.vue | 253 +++ pages/zyb/fillVolunteer/aiAuto.vue | 344 ++-- pages/zyb/fillVolunteer/detail.vue | 717 +++++--- pages/zyb/fillVolunteer/index.vue | 769 +++++--- pages/zyb/fillVolunteer/mockList.vue | 1557 +++++++++++++++++ pages/zyb/fillVolunteer/my-detail.vue | 938 ++++++++++ pages/zyb/fillVolunteer/my.vue | 50 +- pages/zyb/fillVolunteer/old-detail.vue | 985 +++++++++++ pages/zyb/fuwenben/index.vue | 21 + pages/zyb/historyScoreControlLine/data.js | 82 - .../historyScoreControlLine/index-copu.vue | 162 ++ pages/zyb/historyScoreControlLine/index.vue | 144 +- pages/zyb/home.vue | 769 ++++++-- pages/zyb/login.vue | 416 ++++- pages/zyb/major/detail.vue | 279 +-- pages/zyb/major/list.vue | 13 + pages/zyb/npee/index.vue | 106 +- pages/zyb/npee/schoolNpee.vue | 241 +++ pages/zyb/npee/schoolNpeeDetail.vue | 144 ++ pages/zyb/order/detail.vue | 146 ++ pages/zyb/order/list.vue | 175 ++ pages/zyb/other/admissionsInformation.uvue | 15 - pages/zyb/other/admissionsInformation.vue | 40 - pages/zyb/other/calculateInvestment.vue | 176 +- pages/zyb/other/checkRanking.vue | 6 +- pages/zyb/other/commonProblem.vue | 12 +- pages/zyb/other/feedback.vue | 230 +++ pages/zyb/other/updateLogs.vue | 5 +- pages/zyb/other/useHelp.vue | 2 +- pages/zyb/other/volunteerCardDesc.vue | 8 +- pages/zyb/other/yifenyiduan.vue | 3 - pages/zyb/qrcodeLogin.vue | 290 +++ pages/zyb/school/detail.vue | 429 +++-- pages/zyb/school/list.vue | 135 +- pages/zyb/score/edit.vue | 493 ++++-- pages/zyb/settings.vue | 4 +- pages/zyb/testCultural/detail.vue | 118 +- pages/zyb/testCultural/index.vue | 133 +- pages/zyb/user/bindPhone.vue | 186 ++ pages/zyb/user/detail.vue | 10 +- pages/zyb/user/index.vue | 304 +++- pages/zyb/vip/cardamom.vue | 29 +- pages/zyb/vip/checkoutCounter.vue | 139 +- pages/zyb/vip/index-bak.vue | 425 +++++ pages/zyb/vip/index.vue | 337 +++- static/home_background.png | Bin 0 -> 134133 bytes static/icons/add_orange.png | Bin 0 -> 1780 bytes static/icons/avatar.png | Bin 0 -> 3209 bytes static/icons/boshi.png | Bin 0 -> 3050 bytes static/icons/clonse.png | Bin 0 -> 1030 bytes static/icons/delete.png | Bin 0 -> 908 bytes static/icons/duigou_orange.png | Bin 0 -> 1143 bytes static/icons/edit.png | Bin 0 -> 1661 bytes static/icons/gif/detail.gif | Bin 0 -> 2026 bytes static/icons/gif/icons8-calendar.gif | Bin 0 -> 5498 bytes static/icons/gif/icons8-cards.gif | Bin 0 -> 8519 bytes static/icons/gif/icons8-cooperate.gif | Bin 0 -> 6107 bytes static/icons/gif/icons8-customer-service.gif | Bin 0 -> 5633 bytes static/icons/gif/icons8-doubt.gif | Bin 0 -> 5837 bytes static/icons/gif/icons8-loading-heart.gif | Bin 0 -> 3409 bytes static/icons/gif/icons8-man.gif | Bin 0 -> 4745 bytes static/icons/gif/icons8-order.gif | Bin 0 -> 2964 bytes static/icons/gif/icons8-wotuishi-settings.gif | Bin 0 -> 4960 bytes .../glyph/icons-arrow-down-orange-90.png | Bin 0 -> 481 bytes .../icons/glyph/icons-arrow-up-orange-90.png | Bin 0 -> 471 bytes static/icons/icons8-home-active.png | Bin 0 -> 1140 bytes static/icons/icons8-home.png | Bin 0 -> 861 bytes static/icons/icons8-menu.png | Bin 0 -> 131 bytes static/icons/icons8-notepad-active.png | Bin 0 -> 976 bytes static/icons/icons8-notepad.png | Bin 0 -> 752 bytes static/icons/icons8-select-96.png | Bin 0 -> 2041 bytes static/icons/icons8-woman-active.png | Bin 0 -> 1660 bytes static/icons/icons8-woman.png | Bin 0 -> 1180 bytes static/icons/move.png | Bin 0 -> 641 bytes static/icons/oneByOne.2bad329.png | Bin 0 -> 351704 bytes static/icons/options/cewenhua.png | Bin 0 -> 11469 bytes static/icons/options/chaweici.png | Bin 0 -> 1185 bytes static/icons/options/chayuanxiao.png | Bin 0 -> 944 bytes static/icons/options/chazhuanye.png | Bin 0 -> 9112 bytes static/icons/options/dataLevelUp.png | Bin 0 -> 730 bytes static/icons/options/gupiao.png | Bin 0 -> 707 bytes static/icons/options/message.png | Bin 0 -> 681 bytes static/icons/options/shengkongxian.png | Bin 0 -> 1132 bytes static/icons/options/suantoudang.png | Bin 0 -> 1183 bytes static/icons/options/tongji.png | Bin 0 -> 6720 bytes static/icons/options/zhaoshengzhangcheng.png | Bin 0 -> 1200 bytes static/icons/options/zhuanhuan.png | Bin 0 -> 10244 bytes static/icons/search.png | Bin 0 -> 2107 bytes static/icons/select_blue.png | Bin 0 -> 344 bytes static/icons/shoucang-active.png | Bin 0 -> 1490 bytes static/icons/shoucang.png | Bin 0 -> 1434 bytes static/icons/shu.png | Bin 0 -> 2674 bytes static/icons/success.png | Bin 0 -> 2299 bytes static/icons/wechat.png | Bin 0 -> 2341 bytes uni_modules/mp-html/README.md | 193 ++ uni_modules/mp-html/changelog.md | 138 ++ .../mp-html/components/mp-html/mp-html.vue | 498 ++++++ .../mp-html/components/mp-html/node/node.vue | 579 ++++++ .../mp-html/components/mp-html/parser.js | 1372 +++++++++++++++ uni_modules/mp-html/package.json | 76 + .../static/app-plus/mp-html/js/handler.js | 1 + .../app-plus/mp-html/js/uni.webview.min.js | 1 + .../static/app-plus/mp-html/local.html | 1 + 108 files changed, 13265 insertions(+), 1920 deletions(-) create mode 100644 common/js/commonTool.js create mode 100644 common/js/jumpTool.js delete mode 100644 components/my-top-button.vue create mode 100644 pages/zyb/article/detail.vue create mode 100644 pages/zyb/article/list.vue create mode 100644 pages/zyb/article/list2.vue create mode 100644 pages/zyb/fillVolunteer/mockList.vue create mode 100644 pages/zyb/fillVolunteer/my-detail.vue create mode 100644 pages/zyb/fillVolunteer/old-detail.vue create mode 100644 pages/zyb/fuwenben/index.vue delete mode 100644 pages/zyb/historyScoreControlLine/data.js create mode 100644 pages/zyb/historyScoreControlLine/index-copu.vue create mode 100644 pages/zyb/npee/schoolNpee.vue create mode 100644 pages/zyb/npee/schoolNpeeDetail.vue create mode 100644 pages/zyb/order/detail.vue create mode 100644 pages/zyb/order/list.vue delete mode 100644 pages/zyb/other/admissionsInformation.uvue create mode 100644 pages/zyb/other/feedback.vue create mode 100644 pages/zyb/qrcodeLogin.vue create mode 100644 pages/zyb/user/bindPhone.vue create mode 100644 pages/zyb/vip/index-bak.vue create mode 100644 static/home_background.png create mode 100644 static/icons/add_orange.png create mode 100644 static/icons/avatar.png create mode 100644 static/icons/boshi.png create mode 100644 static/icons/clonse.png create mode 100644 static/icons/delete.png create mode 100644 static/icons/duigou_orange.png create mode 100644 static/icons/edit.png create mode 100644 static/icons/gif/detail.gif create mode 100644 static/icons/gif/icons8-calendar.gif create mode 100644 static/icons/gif/icons8-cards.gif create mode 100644 static/icons/gif/icons8-cooperate.gif create mode 100644 static/icons/gif/icons8-customer-service.gif create mode 100644 static/icons/gif/icons8-doubt.gif create mode 100644 static/icons/gif/icons8-loading-heart.gif create mode 100644 static/icons/gif/icons8-man.gif create mode 100644 static/icons/gif/icons8-order.gif create mode 100644 static/icons/gif/icons8-wotuishi-settings.gif create mode 100644 static/icons/glyph/icons-arrow-down-orange-90.png create mode 100644 static/icons/glyph/icons-arrow-up-orange-90.png create mode 100644 static/icons/icons8-home-active.png create mode 100644 static/icons/icons8-home.png create mode 100644 static/icons/icons8-menu.png create mode 100644 static/icons/icons8-notepad-active.png create mode 100644 static/icons/icons8-notepad.png create mode 100644 static/icons/icons8-select-96.png create mode 100644 static/icons/icons8-woman-active.png create mode 100644 static/icons/icons8-woman.png create mode 100644 static/icons/move.png create mode 100644 static/icons/oneByOne.2bad329.png create mode 100644 static/icons/options/cewenhua.png create mode 100644 static/icons/options/chaweici.png create mode 100644 static/icons/options/chayuanxiao.png create mode 100644 static/icons/options/chazhuanye.png create mode 100644 static/icons/options/dataLevelUp.png create mode 100644 static/icons/options/gupiao.png create mode 100644 static/icons/options/message.png create mode 100644 static/icons/options/shengkongxian.png create mode 100644 static/icons/options/suantoudang.png create mode 100644 static/icons/options/tongji.png create mode 100644 static/icons/options/zhaoshengzhangcheng.png create mode 100644 static/icons/options/zhuanhuan.png create mode 100644 static/icons/search.png create mode 100644 static/icons/select_blue.png create mode 100644 static/icons/shoucang-active.png create mode 100644 static/icons/shoucang.png create mode 100644 static/icons/shu.png create mode 100644 static/icons/success.png create mode 100644 static/icons/wechat.png create mode 100644 uni_modules/mp-html/README.md create mode 100644 uni_modules/mp-html/changelog.md create mode 100644 uni_modules/mp-html/components/mp-html/mp-html.vue create mode 100644 uni_modules/mp-html/components/mp-html/node/node.vue create mode 100644 uni_modules/mp-html/components/mp-html/parser.js create mode 100644 uni_modules/mp-html/package.json create mode 100644 uni_modules/mp-html/static/app-plus/mp-html/js/handler.js create mode 100644 uni_modules/mp-html/static/app-plus/mp-html/js/uni.webview.min.js create mode 100644 uni_modules/mp-html/static/app-plus/mp-html/local.html diff --git a/common/js/commonTool.js b/common/js/commonTool.js new file mode 100644 index 0000000..517ddda --- /dev/null +++ b/common/js/commonTool.js @@ -0,0 +1,39 @@ +import Request from '@/common/request' +import ApiConstant from '../ApiConstant' +let request = new Request() +export default { + //调试vip信息 + checkVipInfo(e){ + if (e && e.skuCode) { + e.vipFlag = true + uni.setStorageSync('vipInfo',e) + }else{ + uni.setStorageSync('vipInfo',{vipFlag:false}) + } + }, + //刷新vip信息 + reloadVipInfo() { + request.get(ApiConstant.VIP.vipInfo,{},{showLoad:false}).then(r => { + console.log(r) + if (r.success) { + this.checkVipInfo(r.result) + } + }).catch(err => { + }).finally(() => { + }); + }, + //格式化处理 + dateFormatYYYYMMDD(time) { + let date = new Date(time.replace(/-/g,'/')); + let year = date.getFullYear(); + // 在日期格式中,月份是从0开始的,因此要加0,使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05 + let month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1; + let day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate(); + let hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours(); + let minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); + let seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds(); + // 拼接 + // return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; + return year + "-" + month + "-" + day; + }, +} diff --git a/common/js/jumpTool.js b/common/js/jumpTool.js new file mode 100644 index 0000000..3cc0917 --- /dev/null +++ b/common/js/jumpTool.js @@ -0,0 +1,24 @@ +export default{ + /*打开某个页面*/ + goto(e) { + uni.navigateTo({ + url: e + }) + }, + goLogin(){ + this.goto('/pages/zyb/login') + }, + goArticleDetail(e){ + this.goto('/pages/zyb/article/detail?articleId='+e.id) + }, + /*打开成绩修改界面*/ + openScoreEdit() { + this.goto('/pages/zyb/score/edit') + }, + openVip() { + this.goto('/pages/zyb/vip/index') + }, + openFeedback(){ + this.goto('/pages/zyb/other/feedback') + } +} diff --git a/components/my-top-button.vue b/components/my-top-button.vue deleted file mode 100644 index 452578b..0000000 --- a/components/my-top-button.vue +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - diff --git a/pages/zyb/article/detail.vue b/pages/zyb/article/detail.vue new file mode 100644 index 0000000..f4c1a91 --- /dev/null +++ b/pages/zyb/article/detail.vue @@ -0,0 +1,134 @@ + + + + + diff --git a/pages/zyb/article/list.vue b/pages/zyb/article/list.vue new file mode 100644 index 0000000..1e194ad --- /dev/null +++ b/pages/zyb/article/list.vue @@ -0,0 +1,255 @@ + + + + + diff --git a/pages/zyb/article/list2.vue b/pages/zyb/article/list2.vue new file mode 100644 index 0000000..96c2a30 --- /dev/null +++ b/pages/zyb/article/list2.vue @@ -0,0 +1,253 @@ + + + + + diff --git a/pages/zyb/fillVolunteer/aiAuto.vue b/pages/zyb/fillVolunteer/aiAuto.vue index 6a87524..2592cf8 100644 --- a/pages/zyb/fillVolunteer/aiAuto.vue +++ b/pages/zyb/fillVolunteer/aiAuto.vue @@ -19,7 +19,8 @@ export default { }, data() { return { - avatar: 'http://files.yitisheng.vip/yitisheng.png', + vipInfo: {}, + avatar: ImagesConstant.systemIcon, code: '', max: 9999, min: 1, @@ -32,20 +33,7 @@ export default { majorBatch: {}, ///专业列表 majorCodeArray: [], - majorArray: [ - {majorCode: '130201', majorName: '音乐表演'}, - {majorCode: '130202', majorName: '音乐学'}, - {majorCode: '130203', majorName: '作曲与作曲技术理论'}, - {majorCode: '130204', majorName: '舞蹈表演'}, - {majorCode: '130205', majorName: '舞蹈学'}, - {majorCode: '130206', majorName: '舞蹈编导'}, - {majorCode: '130207', majorName: '舞蹈教育'}, - {majorCode: '130208', majorName: '航空服务艺术与管理'}, - {majorCode: '130209', majorName: '流行音乐'}, - {majorCode: '130210', majorName: '音乐治疗'}, - {majorCode: '130211', majorName: '流行舞蹈'}, - {majorCode: '130212', majorName: '音乐教育'}, - ],//专业列表 + majorArray: [],//专业列表 majorVisible: false, ///偏好类型 schoolNatureSelectArray: [], @@ -55,35 +43,7 @@ export default { provinceSelectArray: [], provinceArray: StaticConstant.provinceAllList, provinceVisible: false, - scoreInfo: { - batch: "本科A段", - chineseScore: 0, - cognitioPolyclinic: "理科", - createBy: "1757686194965893121", - createTime: "2024-02-29 11:41:11", - culturalScore: 405, - educationalLevel: "2", - englishScore: 0, - fzby: 0, - id: "1763046730696069122", - isVip: 0, - professionalCategory: "音乐类", - professionalCategoryChildren: "音乐表演器乐,音乐教育", - professionalCategoryChildrenList: ['音乐表演器乐', '音乐教育'], - professionalScore: 200, - province: "河南", - ranking: 0, - state: "1", - subjects: null, - type: "2", - updateBy: null, - updateTime: null, - xjysby: 0, - xjysdy: 0, - yybyqy: 240, - yybysy: 11, - yyjy: 240 - }, + scoreInfo: {}, userInfo: {}, listFlag: false, recommendMajor: {}, @@ -95,7 +55,7 @@ export default { {label: '我喜欢的院校类型', value: 1}, {label: '我喜欢的地域', value: 2} ], - tabs: ['提前批', '本科A段', '本科B段', '高职高专'] + tabs: ['本科批', '高职高专'] } }, methods: { @@ -167,7 +127,7 @@ export default { save() { console.log(this.recommendMajor) let that = this - if (!this.userInfo.vipFlag) { + if (!this.vipInfo || !stringIsNotEmpty(this.vipInfo.vipLevel) || this.vipInfo.vipLevel < 2) { uni.showModal({ title: 'VIP专享', // 提示文字 @@ -207,7 +167,7 @@ export default { } let batch = this.batchArray[this.batchIndex].value this.currentTab = batch - this.scrollLeft =(batch === '本科B段' || batch === '高职高专')?600:0; + this.scrollLeft = (batch === '本科B段' || batch === '高职高专') ? 600 : 0; //获取填报信息 request.get(ApiConstant.Major.aiAuto, { batch: batch, @@ -305,28 +265,31 @@ export default { //遍历专业志愿,组合成保存对象 for (let j = 0; j < recommendMajorElement.length; j++) { let r = recommendMajorElement[j] - let vr = {majorCode: r.majorCode, schoolCode: r.schoolCode, enrollmentCode: r.enrollmentCode,batch:batch, - enrollProbability:r.enrollProbability,studentConvertedScore:r.studentConvertedScore} + let vr = { + majorCode: r.majorCode, schoolCode: r.schoolCode, enrollmentCode: r.enrollmentCode, batch: batch, + enrollProbability: r.enrollProbability, studentConvertedScore: r.studentConvertedScore + } volunteerRecordList.push(vr) } } let saveVolunteer = { - scoreId:this.scoreInfo.id, - category:this.scoreInfo.cognitioPolyclinic, - volunteerName:this.volunteerName, - volunteerRecordList:volunteerRecordList + scoreId: this.scoreInfo.id, + category: this.scoreInfo.cognitioPolyclinic, + volunteerName: this.volunteerName, + volunteerRecordList: volunteerRecordList } request.post(ApiConstant.Volunteer.saveAs, saveVolunteer).then(r => { console.log(r) if (r.success) { + request.getUserScore() setTimeout(function () { uni.showToast({title: '保存成功', icon: "none"}); //回到首页 uni.switchTab({ - url: '/pages/zyb/fillVolunteer/my' + url: '/pages/zyb/fillVolunteer/detail' }); }, 500) - }else{ + } else { setTimeout(function () { uni.showToast({title: r.message, icon: "none"}); }, 500) @@ -334,30 +297,30 @@ export default { }).catch(err => { }).finally(() => { }); - } + }, }, onShow() { }, onLoad() { this.userInfo = uni.getStorageSync('userInfo') let scoreInfo = uni.getStorageSync('scoreInfo') + this.vipInfo = uni.getStorageSync('vipInfo') this.scoreInfo = scoreInfo console.log(scoreInfo) //判断专业 let batchArray = [] - if (scoreInfo.professionalCategory === '体育') { + if (scoreInfo.professionalCategory === '体育类') { + console.log('qvq') if (scoreInfo.batch === '本科') { batchArray.push({label: '体育类本科批', value: '本科'}) } batchArray.push({label: '体育类专科批', value: '高职高专'}) } else { - if (scoreInfo.batch === '本科A段') { - batchArray.push({label: '艺术类本科提前批', value: '提前批'}, { - label: '艺术本科A段', - value: '本科A段' - }, {label: '艺术本科B段', value: '本科B段'}) - } else if (scoreInfo.batch === '本科B段') { - batchArray.push({label: '艺术本科B段', value: '本科B段'}) + if (scoreInfo.batch === '本科A段' || scoreInfo.batch === '本科B段') { + batchArray.push({ + label: '艺术类本科批', + value: '本科' + }) } batchArray.push({label: '艺术类专科批', value: '高职高专'}) } @@ -374,12 +337,16 @@ export default { @@ -839,6 +1171,10 @@ export default { background-color: white !important; } +:deep(.common-page-head) { + padding: 10rpx !important; +} + /*重置 uni-data-picker样式*/ :deep(.uni-data-tree) { .placeholder { @@ -868,7 +1204,7 @@ export default { .text-list { - margin-top: 30rpx; + margin-top: 15rpx; margin-bottom: 10rpx; .t { @@ -1064,11 +1400,6 @@ export default { padding: 15rpx 10rpx !important; } -:deep(.wei-dropdown-menu-bar) { - box-shadow: none !important; -} - - /*圆环进度条内字体 start*/ .progressBox { position: relative; @@ -1124,11 +1455,12 @@ export default { padding: 30rpx; margin: 10rpx 0; /*院校标签*/ - .tags{ + .tags { display: flex; flex-direction: row; flex-wrap: wrap; } + .tags .tag { margin-top: 10rpx; margin-right: 10px; @@ -1142,6 +1474,32 @@ export default { } } +//其他专业按钮 +.otherMajorBtn { + color: #f96543; + border: 1rpx solid #f96543; + padding: 10rpx 10rpx; + text-align: center; +} + +.volunteer-item-active { + background-color: #fef4f4; +} + + +.volunteerIndexs { + color: #f96543; + background-color: #fef3ec; + border: 1rpx solid #f96543; + padding: 10rpx 10rpx; +} + +.saveVolunteer { + color: #f96543; + border: 1rpx solid #f96543; + padding: 10rpx 10rpx; +} + /*推荐志愿列表 end*/ :deep(.uni-noticebar) { @@ -1154,6 +1512,7 @@ export default { display: none; /* 先将元素隐藏 */ transition: 0.5s; } + .topc { position: fixed; right: 10rpx; @@ -1164,5 +1523,13 @@ export default { height: 40px; line-height: 40px; } + /* 回到顶部 end*/ + +scroll-view ::-webkit-scrollbar { + width: 0; + height: 0; + background-color: transparent; +} + diff --git a/pages/zyb/fillVolunteer/mockList.vue b/pages/zyb/fillVolunteer/mockList.vue new file mode 100644 index 0000000..a0d12bb --- /dev/null +++ b/pages/zyb/fillVolunteer/mockList.vue @@ -0,0 +1,1557 @@ + + + + + diff --git a/pages/zyb/fillVolunteer/my-detail.vue b/pages/zyb/fillVolunteer/my-detail.vue new file mode 100644 index 0000000..3fe90bf --- /dev/null +++ b/pages/zyb/fillVolunteer/my-detail.vue @@ -0,0 +1,938 @@ + + + + + + diff --git a/pages/zyb/fillVolunteer/my.vue b/pages/zyb/fillVolunteer/my.vue index b4e36a1..8919be5 100644 --- a/pages/zyb/fillVolunteer/my.vue +++ b/pages/zyb/fillVolunteer/my.vue @@ -4,10 +4,12 @@ import ApiConstant from "@/common/ApiConstant"; import Request from '@/common/request' import {formatTime} from "@/common/util"; import ImagesConstant from "@/common/ImagesConstant"; +import View from "../../component/view/view.vue"; let request = new Request() export default { name: "fillVolunteer-list", + components: {View}, computed: { ImagesConstant() { return ImagesConstant @@ -35,7 +37,7 @@ export default { }); }, /*点击新增志愿*/ - clickAdd(){ + clickAdd() { let that = this uni.showLoading({ title: '创建志愿表' @@ -44,7 +46,7 @@ export default { if (res.success) { setTimeout(function () { uni.hideLoading(); - }, 1000) + }, 800) setTimeout(function () { that.getVolunteerList(); }, 1000) @@ -59,10 +61,11 @@ export default { }); }, clickEdit(e) { - console.log('编辑') - console.log(e) + let scoreInfo = uni.getStorageSync('scoreInfo') + let that = this + console.log(scoreInfo) uni.navigateTo({ - url: 'detail?volunteerId=' + e + url: '/pages/zyb/fillVolunteer/my-detail?volunteerId=' + e }) }, clickDelete(e) { @@ -106,13 +109,16 @@ export default { //下载 uni.showToast({title: '目前仅支持PC端下载', icon: "none"}); }, - formatDate(date) { - console.log(date) - let newDate = new Date(date); - let year = newDate.getFullYear(); - let month = String(newDate.getMonth() + 1).padStart(2, '0'); - let day = String(newDate.getDate()).padStart(2, '0'); - return year + '-' + month + '-' + day; + formatDate(dateString) { + // 将日期字符串转换为Date对象 + var date = new Date(dateString.replace(/-/g,'/')); + // 格式化为 "yyyy/MM/dd HH:mm:ss" 格式 + return date.getFullYear() + "/" + + ("0" + (date.getMonth() + 1)).slice(-2) + "/" + + ("0" + date.getDate()).slice(-2) + " " + + ("0" + date.getHours()).slice(-2) + ":" + + ("0" + date.getMinutes()).slice(-2) + ":" + + ("0" + date.getSeconds()).slice(-2); } }, } @@ -120,18 +126,20 @@ export default { + + diff --git a/pages/zyb/fuwenben/index.vue b/pages/zyb/fuwenben/index.vue new file mode 100644 index 0000000..0ca3bec --- /dev/null +++ b/pages/zyb/fuwenben/index.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/pages/zyb/historyScoreControlLine/data.js b/pages/zyb/historyScoreControlLine/data.js deleted file mode 100644 index 08305d2..0000000 --- a/pages/zyb/historyScoreControlLine/data.js +++ /dev/null @@ -1,82 +0,0 @@ -export const menuData = [ - { - name: 'year', title: '年份', options: [ - {label: "2023", value: "2023"}, - {label: "2022", value: "2022"}, - {label: "2021", value: "2021"} - ] - }, - { - name: 'professionalCategory', title: '专业类别', options: [ - {label: "音乐类", value: "音乐类"}, - {label: "国际标准舞类", value: "国际标准舞类"}, - {label: "播音与主持类", value: "播音与主持类"}, - {label: "表演类", value: "表演类"}, - {label: "编导制作类", value: "编导制作类"}, - {label: "书法类", value: "书法类"}, - {label: "艺术舞蹈类", value: "艺术舞蹈类"}, - {label: "美术类", value: "美术类"}, - {label: "体育类", value: "体育类"}, - ] - }, - { - name: 'category', title: '文理分科', options: [ - {label: "文科", value: "文科"}, - {label: "理科", value: "理科"}, - ] - }, -] - -export const menuData1 = [ - { - name: 'city', title: '城市', treeSelect: true, popupHeight: null, options: [ - {label: "全部", value: null, children: [{label: '全部', value: null}]}, - { - label: "湖南省", value: "1", - children: [ - {label: "全部", value: 35}, - {label: "长沙市", tip: 10, value: "1_1"}, - {label: "岳阳市", tip: 20, value: "1_2"}, - {label: "永州市", tip: 22, value: "1_4"}, - {label: "衡阳市", tip: 22, value: "1_5"}, - {label: "益阳市", tip: 22, value: "1_6"}, - {label: "张家界", tip: 22, value: "1_7"}, - ], - }, - { - label: "广东省", value: "2", - children: [ - {label: "全部", value: null}, - {label: "广州市", value: "2_1"}, - {label: "惠州市", value: "2_2"}, - {label: "中山市", value: "2_3"}, - ], - }, - { - label: "浙江省", value: "3", - children: [ - {label: "全部", value: null}, - {label: "杭州市", value: "3_1"}, - {label: "宁波市", value: "3_2"}, - {label: "温州市", value: "3_3"}, - ], - }, - ] - }, - { - name: 'status', title: '状态', options: [ - {label: "全部状态", value: null}, - {label: "待付款", value: "1"}, - {label: "待发货", value: "2"}, - {label: "待收货", value: "3"}, - {label: "待评价", value: "4"} - ] - }, - { - name: 'sort', title: '排序', options: [ - {label: "默认排序", value: null}, - {label: "销量排序", value: "1"}, - {label: "好评排序", value: "2"}, - ] - } -] diff --git a/pages/zyb/historyScoreControlLine/index-copu.vue b/pages/zyb/historyScoreControlLine/index-copu.vue new file mode 100644 index 0000000..ac87a04 --- /dev/null +++ b/pages/zyb/historyScoreControlLine/index-copu.vue @@ -0,0 +1,162 @@ + + + + + + diff --git a/pages/zyb/historyScoreControlLine/index.vue b/pages/zyb/historyScoreControlLine/index.vue index 2fb9dc7..e22820b 100644 --- a/pages/zyb/historyScoreControlLine/index.vue +++ b/pages/zyb/historyScoreControlLine/index.vue @@ -5,17 +5,22 @@ import ApiConstant from "@/common/ApiConstant"; import Request from '@/common/request' import {onMounted} from "vue"; import StaticConstant from "@/common/StaticConstant"; +import View from "../../component/view/view.vue"; let request = new Request() const dataList = ref() +const userScoreInfo = ref() const scoreUpdate = ref() function getHistoryList() { let that = this let scoreInfo = uni.getStorageSync('scoreInfo') + userScoreInfo.value = scoreInfo let data = { professionalCategory: '美术与设计类', category: '文科' } + console.log(userScoreInfo.value) + if (scoreInfo && scoreInfo.professionalCategory) { data.professionalCategory = scoreInfo.professionalCategory } @@ -54,57 +59,64 @@ onMounted(() => { diff --git a/pages/zyb/home.vue b/pages/zyb/home.vue index 0e0fa56..b0646d4 100644 --- a/pages/zyb/home.vue +++ b/pages/zyb/home.vue @@ -3,181 +3,582 @@ import StaticConstant from "@/common/StaticConstant"; import ImagesConstant from "@/common/ImagesConstant"; import ApiConstant from "@/common/ApiConstant"; import Request from "@/common/request"; +import JumpTool from "@/common/js/jumpTool"; +import jumpTool from "@/common/js/jumpTool"; let request = new Request() export default { name: "home", components: {}, computed: { + jumpTool() { + return jumpTool + }, StaticConstant() { return StaticConstant } }, data() { return { - scoreInfo: { - province: '河南',//省份 - cognitioPolyclinic: '',//科类 - professionalCategory: '',//报考方向 - culturalScore: '',//文化分 - professionalScore: '',//统考分 - }, + userStatus: false, + scoreInfo: null, zyNum: null,//专业数量 defaultIcon: ImagesConstant.defaultIcon,//默认图片 - tjlb: { + fillVolunteer: { + all: null,//全部 kcj: null,//冲刺推荐 jwt: null,//较稳妥 kbd: null//可保底 }, options: StaticConstant.HomeOptions, + statusList: [{status: 'noMore'}, {status: 'noMore'},], + statusTypes: StaticConstant.loadStatusTypes, + contentText: StaticConstant.loadContentText, + + admissionsRegulationsList: [],//招生章程 + //底部tab切换 + scrollLeft: 0, + topFlag: false, + //{id: 1, name: '招生章程', list: [], current: 1, pageSie: 5}, + tabs: [{id: 2, name: '高考动态', current: 1, pageSie: 5, list: []}, { + id: 3, + name: '校内资讯', current: 1, pageSie: 5, + list: [] + }], + currentTab: 0, } }, onShow() { - let score = uni.getStorageSync('scoreInfo') - let fillVolunteer = uni.getStorageSync('fillVolunteer') - if (score !== undefined && score !== null) { - this.scoreInfo = score - if (!fillVolunteer || !fillVolunteer.all) { - this.getRecommendMajorCount() - fillVolunteer = uni.getStorageSync('fillVolunteer') + //进入页面后,判断是否登录了 + let userInfo = uni.getStorageSync('userInfo') + if (userInfo) { + this.userStatus = true + //判断缓存中是否有成绩信息 + this.scoreInfo = uni.getStorageSync('scoreInfo') + //缓存中是否有推荐院校数量 + this.fillVolunteer = uni.getStorageSync('fillVolunteer') + if (!this.fillVolunteer || this.fillVolunteer === '' || !this.scoreInfo || this.scoreInfo === '') { + this.getUserScore() } } - - if (fillVolunteer) { - this.zyNum = fillVolunteer.all - this.tjlb.kcj = fillVolunteer.kcj - this.tjlb.jwt = fillVolunteer.jwt - this.tjlb.kbd = fillVolunteer.kbd + }, + onLoad() { + this.getAdmissionsRegulationsList() + }, + onReachBottom() { + this.loadMore() + }, + onPageScroll(e) { //根据距离顶部距离是否显示回到顶部按钮 + //当距离大于600时显示回到顶部按钮,//当距离小于600时隐藏回到顶部按钮 + this.topFlag = e.scrollTop > 600; + }, + onShareAppMessage() { + return { + title: StaticConstant.systemName, //分享标题 + path: "/pages/zyb/home" + } + }, + // 分享到微信朋友圈 + onShareTimeline(res) { + return { + title: StaticConstant.systemName, //分享标题 + path: "/pages/zyb/home" } }, methods: { - goto(url) { - uni.navigateTo({ - url: url - }) - }, /*点击 操作菜单*/ optionItemChange(e) { + console.log('1111') if (this.options && this.options[e.detail.index].url) { - this.goto(this.options[e.detail.index].url) + if (this.options[e.detail.index].title !== '艺考考研' && this.options[e.detail.index].title !== '招生章程') { + if (this.checkUserScore()) { + JumpTool.goto(this.options[e.detail.index].url) + } + } else { + JumpTool.goto(this.options[e.detail.index].url) + } } }, - getRecommendMajorCount() { - request.get(ApiConstant.Major.recommendMajorCount, {}).then(res => { + /*判断用户是否登录*/ + checkUserStatus() { + if (!this.userStatus) { + JumpTool.goLogin() + return false + } + }, + /*判断用户的分数信息*/ + checkUserScore() { + //判断登录状态 + this.checkUserStatus() + if (!this.scoreInfo) { + JumpTool.openScoreEdit() + return false + } else { + return true + } + }, + onClickEditUserScore() { + JumpTool.openScoreEdit() + }, + /*点击AI一键填报*/ + onClickAi() { + if (this.checkUserScore()) { + JumpTool.goto('/pages/zyb/fillVolunteer/aiAuto') + } + + }, + /*点击模拟填报*/ + onClickMn() { + if (this.checkUserScore()) { + //JumpTool.goto('/pages/zyb/fillVolunteer/index') + JumpTool.goto('/pages/zyb/fillVolunteer/mockList') + } + }, + /*获取用户的分数信息*/ + getUserScore() { + request.get(ApiConstant.Score.getScore, {}).then(res => { if (res.success) { - let result = res.result - //将数据存入 缓存 - let fillVolunteer = { - all: result.allNumber, - kcj: result.kcj, - jwt: result.jwt, - nlq: result.nan, - kbd: result.kbd + if (res.result) { + //接口返回了成绩 + if (res.result.scoreInfo) { + uni.setStorageSync('scoreInfo', res.result.scoreInfo) + this.scoreInfo = res.result.scoreInfo + } + //从成绩中提取 可报院校专业数量 + if (res.result.fillVolunteer) { + uni.setStorageSync('fillVolunteer', res.result.fillVolunteer) + this.fillVolunteer = res.result.fillVolunteer + } + if (res.result.volunteer) { + uni.setStorageSync('volunteer', res.result.volunteer) + this.volunteer = res.result.volunteer + } } - uni.setStorageSync('fillVolunteer', fillVolunteer) + } else { + //有异常 } }).catch(err => { }).finally(() => { }); }, + /*招生章程*/ + getAdmissionsRegulationsList() { + this.setStatus('loading') + let params = { + type: this.tabs[this.currentTab].id, + pageNum: this.tabs[this.currentTab].current, + pageSize: 5 + } + request.get(ApiConstant.Article.articlePage, params).then(res => { + console.log(res) + if (res.success) { + this.tabs[this.currentTab].current = res.result.current + this.tabs[this.currentTab].pages = res.result.pages + //追加到列表数据中 + this.tabs[this.currentTab].list = [...this.tabs[this.currentTab].list, ...res.result.records] + if (res.result.current >= res.result.pages) { + this.setStatus('noMore') + } else { + this.setStatus('more') + } + } else { + } + }).catch(err => { + }).finally(() => { + }); + }, + setStatus(status) { + this.statusList[this.currentTab].status = status + }, + loadMore() { + if (this.statusList[this.currentTab].status === 'noMore') { + return; + } + console.log('加载中') + this.tabs[this.currentTab].current++; + this.getAdmissionsRegulationsList() + }, + /*回到顶部*/ + clickTop() { + uni.pageScrollTo({ + scrollTop: 0, + duration: 300 + }); + }, + swichMenu(id) { + this.currentTab = id + + this.title = '' + this.tabs[this.currentTab].current = 1 + this.tabs[this.currentTab].list = [] + this.getAdmissionsRegulationsList() + + console.log(id) + //this.tabCurrent = 'tabNum'+ id + // 滑动swiper后,每个选项距离其父元素最左侧的距离 + this.scrollLeft = 0; + for (let i = 0; i < id; i++) { + this.scrollLeft += 60 + console.log(this.scrollLeft, 60, id) + } + }, } } diff --git a/pages/zyb/login.vue b/pages/zyb/login.vue index 4711e15..e1917f7 100644 --- a/pages/zyb/login.vue +++ b/pages/zyb/login.vue @@ -4,6 +4,9 @@ import ApiConstant from "@/common/ApiConstant"; import Request from '@/common/request' import StaticConstant from "@/common/StaticConstant"; +import commonTool from "../../common/js/commonTool"; +import {stringIsNotEmpty} from "../../common/util"; + let request = new Request() export default { name: "home", @@ -16,16 +19,95 @@ export default { data() { return { checkFlag: false, - isTick: true + showType: 1, + formData: { + userName: '', + password: '', + password2:'' + }, + isTick: true, + showFlag:false } }, onReady() { - + }, + onShow(){ + // #ifdef MP-TOUTIAO + this.dyLogin() + // #endif + // #ifdef MP-WEIXIN + this.showFlag =true + // #endif }, methods: { - login(rrrr) { + //其他设备下线提示 + otherSystemMessage(r){ + if (r.result.loginState && r.result.loginState === 'more') { + uni.showToast({ + title: '其他设备已下线,请稍等', + icon: 'none' + }) + } + }, + //刷新到首页 + reloadHome(){ + setTimeout(function () { + wx.reLaunch({ + url: '/pages/zyb/home', + }) + }, 500) + }, + //抖音登录 + dyLogin(){ + //今日头条用户信息授权 + let that = this + uni.login({ + provider: 'toutiao', + success: function(loginRes) { + console.log(loginRes); + request.post(ApiConstant.User.dyLogin, { + code: loginRes.code, + anonymousCode: loginRes.anonymousCode, + }).then(r => { + console.log('请求登录', r) + if (r.success) { + console.log(r) + that.otherSystemMessage(r) + //token + uni.setStorageSync('token', r.result.token) + //用户信息 + if (r.result.userInfo) { + uni.setStorageSync('userInfo', r.result.userInfo) + } + //vip信息 + commonTool.checkVipInfo(r.result.vipInfo) + //重新打开首页 + that.reloadHome() + } else { + uni.showToast({ + title: r.message, + icon: 'none' + }) + } + }).catch(err => { + }).finally(() => { + }); + } + }); + }, + getPhoneNumber(e) { + console.log(e.detail.errMsg); + console.log(e.detail.iv); + console.log(e.detail.encryptedData); + if (!this.checkFlag) { + uni.showToast({ + title: '请阅读后同意《艺体志愿宝用户协议》', + icon: 'none' + }) + return + } var sessionKey = '' - if (rrrr && rrrr.detail && rrrr.detail.code) { + if (e && e.detail && e.detail.code) { //选择授权 uni.login({ success: (res) => { @@ -34,19 +116,24 @@ export default { let code = res.code request.post(ApiConstant.User.wxLogin, { code: code, - encryptedData: rrrr.detail.encryptedData, - iv: rrrr.detail.iv + encryptedData: e.detail.encryptedData, + iv: e.detail.iv }).then(r => { console.log('请求登录', r) if (r.success) { console.log(r) + this.otherSystemMessage(r) + //token uni.setStorageSync('token', r.result.token) - uni.setStorageSync('userInfo', r.result.userInfo) - //uni.setStorageSync('scoreInfo',r.result.scoreInfo) - //跳转到首页 - wx.reLaunch({ - url: '/pages/zyb/home', - }) + //用户信息 + if (r.result.userInfo) { + uni.setStorageSync('userInfo', r.result.userInfo) + } + + //vip信息 + commonTool.checkVipInfo(r.result.vipInfo) + //重新打开首页 + this.reloadHome() } else { uni.showToast({ title: '微信授权登录失败', @@ -70,71 +157,119 @@ export default { }) return } - console.log(rrrr) + console.log(e) }, - getPhoneNumber(r) { - console.log('微信授权登录', r.detail) - if (r.detail.userInfo) { + //密码登录 + pwdLogin() { + if (!stringIsNotEmpty(this.formData.userName)) { uni.showToast({ - title: '授权成功' + title: '请输入用户名', + icon: 'none' }) - } else { - // console.log('微信授权失败') + return + } + if (!stringIsNotEmpty(this.formData.password)) { uni.showToast({ - title: '授权失败,请同意授权', + title: '请输入密码', icon: 'none' }) return } - let encryptedData = r.detail.encryptedData - let iv = r.detail.iv - // 获取code - uni.getUserProfile({ - desc: 'Wexin', // 这个参数是必须的 - success: res => { - console.log(res) - }, - fail: err => { - console.log(err) - } - }) - - uni.login({ - success: (res) => { - console.log('获取code', res) - if (res.code) { - let code = res.code - apiLogin({ - code: code, - loginType: '0', - encryptedData: encryptedData, - iv: iv - }).then(res => { - console.log('请求登录', res) - const data = res[1]['data']; - if (data.code === 200) { - // 保存token - uni.setStorageSync('token', data.data) - // 判断跳转页面方法 - - } else { - console.log('微信授权登录失败') - uni.showToast({ - title: '微信授权登录失败', - icon: 'none' - }) - return - } - }); - } else { - uni.showModal({ - title: '未获取到code' - }) - return + request.post(ApiConstant.User.login, { + username: this.formData.userName, + password: this.formData.password + }).then(r => { + if (r.success) { + console.log(r) + this.otherSystemMessage(r) + //token + uni.setStorageSync('token', r.result.token) + //用户信息 + if (r.result.userInfo) { + uni.setStorageSync('userInfo', r.result.userInfo) } + //vip信息 + commonTool.checkVipInfo(r.result.vipInfo) + //重新打开首页 + this.reloadHome() + } else { + uni.showToast({ + title: r.message, + icon: 'none' + }) } + }).catch(err => { + }).finally(() => { }); + + }, + register(){ + if (!stringIsNotEmpty(this.formData.userName)) { + uni.showToast({ + title: '请输入手机号码', + icon: 'none' + }) + return + } + let phoneNumberPattern = /^1[3-9]\d{9}$/; + let isValidPhoneNumber = phoneNumberPattern.test(this.formData.userName); + if (!isValidPhoneNumber) { + uni.showToast({ + title: '手机号码格式不正确', + icon: 'none' + }) + return + } + if (!stringIsNotEmpty(this.formData.password)) { + uni.showToast({ + title: '请输入密码', + icon: 'none' + }) + return + } + if (this.formData.password!==this.formData.password2) { + uni.showToast({ + title: '两次密码不一致', + icon: 'none' + }) + return + } + request.post(ApiConstant.User.register, { + username: this.formData.userName, + password: this.formData.password + }).then(r => { + if (r.success) { + console.log(r) + setTimeout(function () { + uni.showToast({ + title: '注册成功', + icon: 'none' + }) + }, 100) + //token + uni.setStorageSync('token', r.result.token) + //用户信息 + if (r.result.userInfo) { + uni.setStorageSync('userInfo', r.result.userInfo) + } + //vip信息 + commonTool.checkVipInfo(r.result.vipInfo) + //重新打开首页 + this.reloadHome() + + } else { + uni.showToast({ + title: r.message, + icon: 'none' + }) + } + }).catch(err => { + }).finally(() => { + }); + }, + //显示密码输入框 + showPwdInput() { }, gotoMianze() { uni.navigateTo({ @@ -163,7 +298,7 @@ export default { - - diff --git a/pages/zyb/school/list.vue b/pages/zyb/school/list.vue index 8a39465..0b7ff3b 100644 --- a/pages/zyb/school/list.vue +++ b/pages/zyb/school/list.vue @@ -3,13 +3,11 @@ import StaticConstant from "@/common/StaticConstant"; import ApiConstant from "@/common/ApiConstant"; import Request from '@/common/request' import ImagesConstant from "@/common/ImagesConstant"; -import MyTopButton from "@/components/my-top-button.vue"; import {arrayIsNotEmpty, yearAbridge} from "@/common/util"; let request = new Request() export default { name: "school-list", - components: {MyTopButton}, computed: { ImagesConstant() { return ImagesConstant @@ -26,6 +24,7 @@ export default { selectForm: { addressList: [], institutionTypeList: [], + schoolType: "", tagsList: [], schoolNatureList: [] }, @@ -52,11 +51,10 @@ export default { title: "算投档", icon: ImagesConstant.std, url: "/pages/zyb/other/calculateInvestment" - }, + } ], - userInfo: { - vipFlag: true,//是否是vip - }, + userInfo: {}, + vipInfo: {}, topFlag: false, nowProvince: { status: 'more', @@ -83,13 +81,27 @@ export default { onLoad() { this.getSchoolList() this.userInfo = uni.getStorageSync('userInfo') + this.vipInfo = uni.getStorageSync('vipInfo') }, - onReachBottom(){ + onReachBottom() { console.log("已经滚动到底部了") - if (this.userInfo.vipFlag) { + if (this.vipInfo && this.vipInfo.vipFlag) { this.loadMore() } }, + onShareAppMessage() { + return { + title: '查院校', //分享标题 + path: "/pages/zyb/school/list" + } + }, + // 分享到微信朋友圈 + onShareTimeline(res) { + return { + title: '查院校', //分享标题 + path: "/pages/zyb/school/list" + } + }, methods: { yearAbridge, search(res) { @@ -113,6 +125,8 @@ export default { if (this.selectForm.tagsList === null) { this.selectForm.tagsList = [] } + } else if (e.children[i].title === '院校层次') { + this.selectForm.schoolType = e.children[i].value } else if (e.children[i].title === '办学类型') { this.selectForm.schoolNatureList = e.children[i].value if (this.selectForm.schoolNatureList === null) { @@ -167,15 +181,15 @@ export default { if (arrayIsNotEmpty(this.selectForm.schoolNatureList)) { schoolNatureStrs = this.selectForm.schoolNatureList.join(",") } - request.get(ApiConstant.School.searchSchoolList, { schoolName: this.schoolName, province: province, institutionType: institutionType, tagsStrs: tagsStrs, schoolNatureStrs: schoolNatureStrs, + schoolType: this.selectForm.schoolType, pageNum: this.nowProvince.current, pageSize: this.nowProvince.size - }).then(r => { + }, {showLoad: false}).then(r => { console.log(r) if (r.success) { this.nowProvince.current = r.result.current @@ -194,8 +208,8 @@ export default { }).finally(() => { }); }, - searchSchoolClick() { + this.checkVip() this.nowProvince.current = 1 this.nowProvince.schoolList = [] this.nowProvince.total = 0 @@ -224,6 +238,18 @@ export default { duration: 300 }); }, + + /*判断vip*/ + checkVip() { + if (!this.vipInfo || !this.vipInfo.vipFlag) { + uni.showToast({ + title: '开通VIP无限次查询', + duration: 1000, + icon: "none" + }); + return + } + } }, onPageScroll(e) { //根据距离顶部距离是否显示回到顶部按钮 //当距离大于600时显示回到顶部按钮,//当距离小于600时隐藏回到顶部按钮 @@ -251,20 +277,20 @@ export default { + style="height: 90rpx;width: 90rpx;"/> {{ item.title }} - + @@ -274,7 +300,8 @@ export default { - + @@ -300,35 +327,57 @@ export default { - - - - - 统考 + + + + + {{ item.kslx }} - - + + + + 23年省内计划录取: + {{ item.jhs }}人 - - - 23年省内计划录取: - {{ item.jhs }}人 + + + + + + {{ item.kslx }} + + + + + {{ yearAbridge(item.zdfYear) }}年录取最低分: + {{ item.zdf }}分 + + + + + {{item.luquYear}}年省内计划录取: + {{ item.jhs }}人 - + - + + + @@ -360,7 +409,7 @@ export default { /*院校列表*/ .school-list { - padding: 10rpx 20rpx; + padding: 10rpx 10rpx; .school-item { margin-bottom: 10rpx; @@ -503,4 +552,20 @@ export default { } /* 回到顶部 end*/ +.tk-color { + color: #7568e9 !important; +} + +.xk-color { + color: #f96543 !important; +} + +.tk-background { + background-color: #eaecff; + +} + +.xk-background { + background-color: #fef4f4; +} diff --git a/pages/zyb/score/edit.vue b/pages/zyb/score/edit.vue index f641875..a180952 100644 --- a/pages/zyb/score/edit.vue +++ b/pages/zyb/score/edit.vue @@ -16,17 +16,26 @@ export default { data() { return { saveScoreInfo: {}, + useCount:0, + residueCount: 0, + vipInfo: {}, + oldScoreInfo: {}, scoreInfo: { id: '', province: '河南',//省份 - cognitioPolyclinic: '理科',//科类 + cognitioPolyclinic: '文科',//科类 professionalCategory: '',//报考方向 culturalScore: '',//文化分 professionalScore: '',//统考分 chineseScore: '', englishScore: '' }, - provinceArray: [{name: "河南"}],// + formRuleFlag: false,//表单是否校验成功 + provinceArray: [{ + name: '河南', + text: "河南", + value: "河南", + },],// cognitioPolyclinicArray: StaticConstant.categoryList,//文理分科 //=========================================================== professionalCategoryArray: StaticConstant.professionalCategoryList,//专业类别大类array @@ -38,30 +47,46 @@ export default { } }, onShow() { + this.getEditScoreCount() this.getUserScore() + this.vipInfo = uni.getStorageSync('vipInfo') }, methods: { + stringIsNotEmpty() { + return stringIsNotEmpty + }, //获取用户的分数信息 getUserScore() { - request.get(ApiConstant.Score.getScore, {}).then(res => { + let scoreInfo = uni.getStorageSync('scoreInfo') + this.oldScoreInfo = uni.getStorageSync('scoreInfo') + if (scoreInfo) { + this.scoreInfo = scoreInfo + //设置 报考方向 选择 + let professionalCategory = this.scoreInfo.professionalCategory + for (let i = 0; i < this.professionalCategoryArray.length; i++) { + if (this.professionalCategoryArray[i].value === professionalCategory) { + this.professionalCategoryScoreMax = this.professionalCategoryArray[i].scoreMax + this.professionalCategoryIndex = i + } + } + let professionalCategoryChildren = this.scoreInfo.professionalCategoryChildren + if (professionalCategoryChildren !== undefined && professionalCategoryChildren !== '') { + this.pCategoryChildrenList = professionalCategoryChildren.split(',') + } + } + }, + //获取用户可更改分数次数 + getEditScoreCount() { + request.get(ApiConstant.Score.todayOfEditScoreCount, {}, {showLoad: false}).then(res => { if (res.success) { - this.scoreInfo = res.result - //设置 报考方向 选择 - let professionalCategory = this.scoreInfo.professionalCategory - for (let i = 0; i < this.professionalCategoryArray.length; i++) { - if (this.professionalCategoryArray[i].value === professionalCategory) { - this.professionalCategoryScoreMax = this.professionalCategoryArray[i].scoreMax - this.professionalCategoryIndex = i - } - } - let professionalCategoryChildren = this.scoreInfo.professionalCategoryChildren - if (professionalCategoryChildren !== undefined && professionalCategoryChildren !== '') { - this.pCategoryChildrenList = professionalCategoryChildren.split(',') - } + console.log(res) + this.useCount = res.result.useCount + this.residueCount = res.result.residueCount } }).catch(err => { }).finally(() => { }); + }, //保存用户的分数信息 saveScore() { @@ -78,57 +103,99 @@ export default { ...this.saveScoreInfo }).then(res => { if (res.success) { - uni.setStorageSync('scoreInfo', this.saveScoreInfo) + let scoreInfo = res.result + request.getUserScore() + /*uni.removeStorageSync('scoreInfo')//清除之前的成绩缓存 + uni.setStorageSync('scoreInfo', scoreInfo) uni.removeStorageSync('fillVolunteer')//清除可报志愿数量 - this.getRecommendMajorCount() + //全部推荐数量 + let all = parseInt(scoreInfo.kcjNum) + parseInt(scoreInfo.jwtNum) + parseInt(scoreInfo.kbdNum); + //+parseInt(scoreInfo.nlqNum) + let fillVolunteer = {jwt: scoreInfo.jwtNum, kbd: scoreInfo.kbdNum, kcj: scoreInfo.kcjNum, allNumber: all} + uni.setStorageSync('fillVolunteer', fillVolunteer)*/ + setTimeout(() => { + uni.reLaunch({ + url: '/pages/zyb/home' + }) + }, 800) } }).catch(err => { }).finally(() => { }); }, - getRecommendMajorCount() { - request.get(ApiConstant.Major.recommendMajorCount, {}).then(res => { - if (res.success) { - let result = res.result - //将数据存入 缓存 - let fillVolunteer = { - all: result.allNumber, - kcj: result.kcj, - jwt: result.jwt, - nlq: result.nan, - kbd: result.kbd + checkForm() { + //省份 + if (!this.scoreInfo.province) { + this.formRuleFlag = false + return; + } + //专业类别 + if (!this.professionalCategoryArray[this.professionalCategoryIndex]) { + this.formRuleFlag = false + return + } + //子级专业分数 + if (arrayIsNotEmpty(this.pCategoryChildrenList)) { + for (let i = 0; i < this.pCategoryChildrenList.length; i++) { + let name = this.pCategoryChildrenList[i] + //获取字节专业的属性,判断参数是否合格 + let key = this.checkChildrenNameToKey(name) + let value = this.scoreInfo[key] + + if (value === undefined || value === '') { + this.formRuleFlag = false + return + } + let score = parseInt(value) + if (typeof (score) !== 'number') { + this.formRuleFlag = false + return } - uni.setStorageSync('fillVolunteer', fillVolunteer) } - }).catch(err => { - }).finally(() => { - setTimeout(function () { - uni.showToast({title: '保存成功', icon: "none"}); - //回到首页 - uni.switchTab({ - url: '/pages/zyb/home' - }); - }, 500) - }); + } + //选考科目 + if (!this.scoreInfo.cognitioPolyclinic) { + this.formRuleFlag = false + return + } + //统考成绩 + if (this.professionalCategoryArray[this.professionalCategoryIndex].value !== '表演类' && !this.scoreInfo.professionalScore) { + this.formRuleFlag = false + return + } + //文化成绩 + if (!this.scoreInfo.culturalScore) { + this.formRuleFlag = false + return + } + this.formRuleFlag = true }, //选择考区 bindPicker_provinceChange: function (e) { console.log('考区picker发送选择改变,携带值为:' + e) this.scoreInfo.province = this.provinceArray[e.detail.value].name + this.checkForm() }, //选择科目 - bindPicker_cognitioPolyclinicChange: function (e) { - console.log('科目picker发送选择改变,携带值为:' + e.detail.value) - this.scoreInfo.cognitioPolyclinic = this.cognitioPolyclinicArray[e.detail.value].name - }, - //选择报考方向 - bindPicker_professionalCategoryChange: function (e) { - console.log('报考方向picker发送选择改变,携带值为:' + e.detail.value) - this.scoreInfo.professionalCategory = this.professionalCategoryArray[e.detail.value].value + switchKelei(e) { + this.scoreInfo.cognitioPolyclinic = e.name + this.checkForm() }, formSubmit: function (e) { let that = this console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value)) + //高考省份 + if (!stringIsNotEmpty(this.scoreInfo.province)) { + uni.showToast({title: '请选择高考省份', icon: "none"}); + return; + } + //选择科目(文理分科) + console.log(this.scoreInfo.cognitioPolyclinic) + if (!stringIsNotEmpty(this.scoreInfo.cognitioPolyclinic)) { + uni.showToast({title: '请选择选考科目', icon: "none"}); + return; + } + //判断 输入分数 // 子级专业类别 if (arrayIsNotEmpty(this.pCategoryChildrenList)) { @@ -153,6 +220,12 @@ export default { } this.scoreInfo[key] = score } + this.scoreInfo.yybysy = this.scoreInfo.yybysy ? this.scoreInfo.yybysy : 0 + this.scoreInfo.yybyqy = this.scoreInfo.yybyqy ? this.scoreInfo.yybyqy : 0 + this.scoreInfo.yyjy = this.scoreInfo.yyjy ? this.scoreInfo.yyjy : 0 + this.scoreInfo.fzby = this.scoreInfo.fzby ? this.scoreInfo.fzby : 0 + this.scoreInfo.xjysdy = this.scoreInfo.xjysdy ? this.scoreInfo.xjysdy : 0 + this.scoreInfo.xjysby = this.scoreInfo.xjysby ? this.scoreInfo.xjysby : 0 } else { this.scoreInfo.yybysy = 0 this.scoreInfo.yybyqy = 0 @@ -163,26 +236,38 @@ export default { } //判断统考成绩 let professionalScore = parseInt(this.scoreInfo.professionalScore) - console.log('professionalScore:' + professionalScore) - if (isNaN(professionalScore) || professionalScore < 0 || professionalScore > this.professionalCategoryScoreMax) { - if (this.professionalCategoryArray[this.professionalCategoryIndex].label === '音乐类') { - uni.showToast({title: '请输入主项成绩', icon: "none"}); - } else { - uni.showToast({title: '统考成绩请输入0~' + this.professionalCategoryScoreMax + '之间', icon: "none"}); + if(this.professionalCategoryArray[this.professionalCategoryIndex].value !=='表演类'){ + console.log('professionalScore:' + professionalScore) + if (isNaN(professionalScore) || professionalScore < 0 || professionalScore > this.professionalCategoryScoreMax) { + if (this.professionalCategoryIndex && this.professionalCategoryArray[this.professionalCategoryIndex].label === '音乐类') { + uni.showToast({title: '请输入主项成绩', icon: "none"}); + } else { + if (this.professionalCategoryScoreMax) { + uni.showToast({title: '统考成绩请输入0~' + this.professionalCategoryScoreMax + '之间', icon: "none"}); + } else { + uni.showToast({title: '请输入统考成绩', icon: "none"}); + } + + } + return; } - return; } //文化成绩 let culturalScore = parseInt(this.scoreInfo.culturalScore) - if (isNaN(professionalScore) || culturalScore < 0 || culturalScore > 750) { + if (isNaN(culturalScore) || culturalScore < 0 || culturalScore > 750) { uni.showToast({title: '文化分请输入0~750之间', icon: "none"}); return; } this.scoreInfo.professionalScore = parseInt(this.scoreInfo.professionalScore) this.scoreInfo.culturalScore = culturalScore + + let title = '文化成绩:' + this.scoreInfo.culturalScore + if (this.scoreInfo.professionalCategory !== '表演类') { + title += " " + (this.scoreInfo.professionalScore ? (this.pCategoryChildrenList && this.pCategoryChildrenList.length > 0 ? '主项成绩:' : '统考成绩:') + this.scoreInfo.professionalScore : "") + } uni.showModal({ title: '确认高考成绩', - content: '文化成绩:' + this.scoreInfo.culturalScore + " " + (this.scoreInfo.professionalScore ? (this.pCategoryChildrenList && this.pCategoryChildrenList.length > 0 ? '主项成绩:' : '统考成绩:') + this.scoreInfo.professionalScore : ""), + content: title, confirmText: '确定', cancelText: '取消', success: function (res) { @@ -196,7 +281,10 @@ export default { console.log('清空数据') }, onProfessionalCategory() { - this.professionalCategoryVisible = true; + //其他用户只能改一次专业类别 + if (this.vipInfo.vipLevel === 9 || this.oldScoreInfo === null || !stringIsNotEmpty(this.oldScoreInfo.professionalCategory)) { + this.professionalCategoryVisible = true; + } }, onProfessionalCategoryClose() { //如果 当前选择的包括方向 有子级 @@ -209,6 +297,7 @@ export default { } console.log('关闭') this.professionalCategoryVisible = false + this.checkForm() }, onProfessionalCategoryOpen() { console.log('打开') @@ -225,11 +314,13 @@ export default { this.professionalCategoryVisible = false } this.pCategoryChildrenList = [] + this.checkForm() }, /*选择 子类*/ professionalCategoryChildrenChange(e) { console.log(e) this.pCategoryChildrenList = e.detail.value + this.checkForm() }, checkChildrenNameToKey(e) { if (e === '音乐表演声乐') { @@ -251,114 +342,171 @@ export default {