diff --git a/.hbuilderx/launch.json b/.hbuilderx/launch.json index 582561b..ee5be77 100644 --- a/.hbuilderx/launch.json +++ b/.hbuilderx/launch.json @@ -10,6 +10,10 @@ { "launchtype" : "local" }, + "mp-weixin" : + { + "launchtype" : "local" + }, "type" : "uniCloud" } ] diff --git a/components/columnChart/columnChart.vue b/components/columnChart/columnChart.vue new file mode 100644 index 0000000..bdd9cbc --- /dev/null +++ b/components/columnChart/columnChart.vue @@ -0,0 +1,176 @@ + + + + + \ No newline at end of file diff --git a/components/columnChart/gaugeChart.vue b/components/columnChart/gaugeChart.vue new file mode 100644 index 0000000..fae2508 --- /dev/null +++ b/components/columnChart/gaugeChart.vue @@ -0,0 +1,122 @@ + + + + + \ No newline at end of file diff --git a/config/api.js b/config/api.js index c10e699..94d8df2 100644 --- a/config/api.js +++ b/config/api.js @@ -48,6 +48,8 @@ export const logOut = (data={}) => http.post('member/auth/logout', data, {custom export const findQuestionList = (data) => http.post('questionWrong/findQuestionList', data,) // 我的学习--天数、错题、收藏、考试记录、合格率 export const mystudy = (carType) => http.get(`mystudy/mystudy-${carType}`, ) + // 模拟考试或者仿真考试统计 + export const examStatistics = (data) => http.get(`mystudy/${data.examType}-examStatistics-${data.stepType}-${data.carType}`, ) // 模拟考试科目1或者4考试首页 @@ -63,8 +65,11 @@ export const logOut = (data={}) => http.post('member/auth/logout', data, {custom // 模拟考试次数、通过率 export const idexExam = (data) => http.get(`idex/exam-${data.stepType}-${data.carType}`, ) // 获取行政区划下拉树列表 - export const treeSelect = (carType) => http.get(`/idex/treeSelect`, ) - + export const treeSelect = (carType) => http.get(`idex/treeSelect`, ) + // 会员等级 + export const memberGradelist = (carType) => http.get(`vip/memberGradelist-${carType}`, ) + // 会员VIP之声 + export const memberVoicePage = (data) => http.post(`vip/memberVoicePage`, data,) diff --git a/config/request.js b/config/request.js index 75fb3dd..190f371 100644 --- a/config/request.js +++ b/config/request.js @@ -6,6 +6,9 @@ let { H5_API, WX_API,httpPrefix } = setObj // import md5 from 'js-md5' let secretKey = '22d90e09d1374f0f9e4accd07d333e55' +import { loginApi, } from '@/config/api.js' + +let num = 0 // 此vm参数为页面的实例,可以通过它引用vuex中的变量 @@ -51,7 +54,26 @@ let secretKey = '22d90e09d1374f0f9e4accd07d333e55' if(data.code==401) { console.log('报401的接口') console.log(response.config.url) - return uni.$u.toast('登录异常请退出重进') + // return false + if(num) return uni.$u.toast('登录异常,请回题库重进') + num ++ + let loginInfo = uni.getStorageSync('loginInfo') + const res = await loginApi({ + "type": loginInfo.type, + "username": loginInfo.phone, + }) + res.data.phone = loginInfo.phone + res.data.type = loginInfo.type + uni.setStorageSync('loginInfo', res.data); + // num = 0 + let obj = response.config + let method = obj.method.toLowerCase() + if(method=='get') { + return uni.$u.http[method](obj.url, {params: obj.params}) + }else{ + return uni.$u.http[method](obj.url, obj.data ) + } + } // 自定义参数 diff --git a/config/site.config.js b/config/site.config.js index 3ad1b72..0f46f2c 100644 --- a/config/site.config.js +++ b/config/site.config.js @@ -1,11 +1,13 @@ const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM || 'h5'; // localIp = false let obj = { + // H5_API: VUE_APP_PLATFORM === 'h5' ? 'http://question.ywxcw.cn' : '',//h5 H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理 - WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://www.lyjppt.com/',//非代理地址 不要忘记加/ + WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://question.ywxcw.cn/',//非代理地址 不要忘记加/ website: 'http://192.168.1.37', httpPrefix: 'api/', - mapKey: 'IDZBZ-L5GCZ-EQXXA-ZR5K4-JTSXH-IQBLO', + // httpPrefix: 'questionapi/', + mapKey: 'P3EBZ-N2G3W-2X4RO-3YFCD-UBAV6-VCBYG', // 支付测试地址 // preUrl: 'https://u8wbs.zyebank.cn/cem_ysb_u6/index.html', // const preUrl = 'https://u8wbs.zyebank.cn/cem_ysb_u8/index.html' @@ -16,4 +18,4 @@ let obj = { export default obj // http://123.6.232.1:8099/测试地址 // http://192.168.1.43:8318/本地地址 -//http://www.lyjppt.com/正式地址 +//http://question.ywxcw.cn/questionapi/正式地址 diff --git a/index.html b/index.html index c3ff205..b40c8cb 100644 --- a/index.html +++ b/index.html @@ -16,5 +16,16 @@
+ + + + diff --git a/main.js b/main.js index 285aa1f..89d68af 100644 --- a/main.js +++ b/main.js @@ -3,6 +3,7 @@ import uviewPlus from '@/uni_modules/uview-plus' import request from './config/request.js' import { goPage, noDoFn } from '@/utils/utils.js' import {setupStore} from '@/store'; +import './uniWebview.js' // // #ifndef VUE3 // import Vue from 'vue' diff --git a/manifest.json b/manifest.json index 2a4727d..42caf01 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { - "name" : "questionbankvue3", + "name" : "理论学习", "appid" : "__UNI__445D057", "description" : "", "versionName" : "1.0.0", @@ -69,33 +69,33 @@ "enable" : false }, "vueVersion" : "3", - "h5" : { - "devServer" : { - "port" : 90, - "disableHostCheck" : true, - "proxy" : { - "/api" : { - "target" : "http://192.168.1.229:8081/", - // "target" : "http://192.168.1.40:8099/", - "changeOrigin" : true, - "secure" : true, - "pathRewrite" : { - "^/api" : "" - } - } - }, - "https" : false - }, - "router" : { - "mode" : "hash", - "base" : "/h5" - }, - "sdkConfigs" : { - "maps" : { - "qqmap" : { - "key" : "NRWBZ-TKRWV-CSAPH-5PFDS-J4HT6-IWF4O" - } - } - } - } + "h5" : { + "devServer" : { + "port" : 90, + "disableHostCheck" : true, + "proxy" : { + "/api" : { + "target" : "http://192.168.1.202:8081/", + // "target" : "http://question.ywxcw.cn/", + "changeOrigin" : true, + "secure" : true, + "pathRewrite" : { + "^/api" : "" + } + } + }, + "https" : false + }, + "router" : { + "mode" : "hash", + "base" : "/h5" + }, + "sdkConfigs" : { + "maps" : { + "qqmap" : { + "key" : "P3EBZ-N2G3W-2X4RO-3YFCD-UBAV6-VCBYG" + } + } + } + } } diff --git a/pages.json b/pages.json index 67f9ec6..6d19cc0 100644 --- a/pages.json +++ b/pages.json @@ -135,7 +135,7 @@ "path": "theoryStudy/theoryStudy", "style": { "navigationBarTitleText": "理论学习", - "enablePullDownRefresh": false, + "enablePullDownRefresh": true, "backgroundTextStyle": "dark" , "navigationStyle": "custom" } diff --git a/pages/exercises/brushQuestions/brushQuestions.vue b/pages/exercises/brushQuestions/brushQuestions.vue index 6f0343b..17357cf 100644 --- a/pages/exercises/brushQuestions/brushQuestions.vue +++ b/pages/exercises/brushQuestions/brushQuestions.vue @@ -94,7 +94,7 @@ - + 答题卡 @@ -132,6 +132,7 @@ \ No newline at end of file diff --git a/pages/exercises/myStudy/myStudy.vue b/pages/exercises/myStudy/myStudy.vue index 8528ac1..8ef7991 100644 --- a/pages/exercises/myStudy/myStudy.vue +++ b/pages/exercises/myStudy/myStudy.vue @@ -31,43 +31,17 @@ - - - 刷题进度 - - 曲线 - 明细 - - - 近30次科目一模拟考试成绩 - - 图表 - 按住可左右滑动查看更多成绩 - - - - - 考试成绩 - 考试用时 - 考试时间 - - - 90分 - 10分30秒 - 2024-8-28 - - - - + + - + @@ -75,9 +49,12 @@ @@ -232,72 +244,7 @@ } } } - - .tip { - font-size: 24rpx; - color: #ccc; - padding: 10rpx 0 30rpx; - } - .tips { - width: 360rpx; - height: 48rpx; - background: #DCE7FF; - border-radius: 24rpx; - font-size: 24rpx; - color: $themC; - text-align: center; - line-height: 48rpx; - margin-top: 30rpx; - } - .chartTab { - display: flex; - justify-content: space-between; - .btn_row { - display: flex; - width: 170rpx; - height: 44rpx; - border-radius: 8rpx; - overflow: hidden; - border: 1px solid $themC; - .btn.bg { - background: #3776FF; - color: #fff; - } - - .btn { - color: $themC; - text-align: center; - font-size: 28rpx; - flex: 1; - } - } - } - .tables { - width: 100%; - .fristTab.li { - background: #F4F4F4; - border-radius: 8rpx 8rpx 0 0; - .item { - color: $themC; - } - } - - .li { - height: 76rpx; - line-height: 76rpx; - border-bottom: 1rpx solid #F4F4F4; - display: flex; - .item { - text-align: center; - flex: 1; - font-size: 28rpx; - } - } - } } - .btnE { - width: 240rpx; - margin: 30rpx auto 60rpx auto; - } + \ No newline at end of file diff --git a/pages/exercises/theoryStudy/theoryStudy.vue b/pages/exercises/theoryStudy/theoryStudy.vue index 8c51d47..222ebb7 100644 --- a/pages/exercises/theoryStudy/theoryStudy.vue +++ b/pages/exercises/theoryStudy/theoryStudy.vue @@ -26,7 +26,7 @@ - + @@ -34,19 +34,19 @@ - + 顺序练习 {{adCount.orderAlready }} / {{ adCount.orderTotal }} - + 精选试题 {{adCount.siftAlready }}/{{ adCount.siftTotal }} - + @@ -104,6 +104,12 @@ url:'/pages/exercises/webView/webView' }) } + + import { + onPullDownRefresh, + onShow + } from "@dcloudio/uni-app" + const currentTab = ref(1) const dotsStyles = ref({ backgroundColor: '#E8E9EC', @@ -125,7 +131,7 @@ {name: '错题收藏', icon: new URL('@/static/images/theory/theoryIcon8.png', import.meta.url).href, url: '/pages/exercises/wrongQuestion/wrongQuestion'}, {name: '仿真考试', icon: new URL('@/static/images/theory/theoryIcon10.png', import.meta.url).href, url: '/pages/exercises/beforeExam/beforeExam'}, {name: '我的学习', icon: new URL('@/static/images/theory/theoryIcon12.png', import.meta.url).href, url: '/pages/exercises/myStudy/myStudy'}, - {name: '考前密卷', icon: new URL('@/static/images/theory/theoryIcon11.png', import.meta.url).href, url: '/pages/exercises/brushQuestions/brushQuestions'}, + {name: '考前密卷', icon: new URL('@/static/images/theory/theoryIcon11.png', import.meta.url).href, url: '/pages/vip/vipEntry/vipEntry'}, ]) const bottomItem = ref([ @@ -134,15 +140,27 @@ {name: '考试流程', icon: new URL('@/static/images/theory/theoryIcon4.png', import.meta.url).href, url: ''}, {name: '注意事项', icon: new URL('@/static/images/theory/theoryIcon5.png', import.meta.url).href, url: ''}, ]) - + function goPage(item) { + let arr = ['密卷'] + if(arr.includes(item.name)) { + return uni.$u.toast('正在开发,敬请期待') + } + if(item.name=='精选试题') { + goAndSetCar({type: 'sift', value: '1'}) + return + } + uni.navigateTo({ + url: item.url + }) + } function changeTab(num) { currentTab.value = num usecarStore.setCar('stepType', num) upDataFn() } // 顺序练题 - function goAndSetCar() { - usecarStore.setCar('types', '2') + function goAndSetCar(item) { + usecarStore.setCar(item.type, item.value) uni.navigateTo({ url: '/pages/exercises/brushQuestions/brushQuestions' }) @@ -164,14 +182,19 @@ questbanktypeFn() async function upDataFn() { - uni.showLoading({ - title: '正在加载...' - }) - await indexNotice() - await indexAd() - await indexAdCountFn() - await idexExamFn() - uni.hideLoading() + try{ + uni.showLoading({ + title: '正在加载...' + }) + await indexNotice() + await indexAd() + await indexAdCountFn() + await idexExamFn() + uni.hideLoading() + }catch(e){ + uni.hideLoading() + } + } // 消息请求 @@ -196,11 +219,9 @@ // 统计多少题目 let adCount = ref({}) async function indexAdCountFn() { - console.log(usecarStore.carInfo, '好烦') const {data:res} = await indexAdCount({subject: usecarStore.carInfo.stepType, carType: usecarStore.carInfo.carType, city: usecarStore.carInfo.city}) adCount.value = res } - indexAdCountFn() // 模拟考试通过率 let examInfo = ref({}) @@ -209,6 +230,13 @@ examInfo.value = res } idexExamFn() + onShow(()=>{ + indexAdCountFn() + }) + onPullDownRefresh(()=>{ + upDataFn() + uni.stopPullDownRefresh() + }) diff --git a/pages/exercises/webView/webView.vue b/pages/exercises/webView/webView.vue index 72c2be1..b80bc87 100644 --- a/pages/exercises/webView/webView.vue +++ b/pages/exercises/webView/webView.vue @@ -1,6 +1,6 @@ @@ -12,7 +12,14 @@ } import carStore from '@/store/modules/car.js' let usecarStore = carStore() + + function handerMessage(res) { + console.log('监听到了') + let item = res.detail.data[0] + console.log(res) + console.log(item) + } - \ No newline at end of file diff --git a/pages/exercises/wrongQuestion/wrongQuestion.vue b/pages/exercises/wrongQuestion/wrongQuestion.vue index f1383f8..d762ee0 100644 --- a/pages/exercises/wrongQuestion/wrongQuestion.vue +++ b/pages/exercises/wrongQuestion/wrongQuestion.vue @@ -13,14 +13,14 @@ 我的{{ currentNav==2?'收藏':'错题'}} - + 全部{{ currentNav==2?'收藏':'错题'}} {{ countInfo.allCount}} - - + + {{ currentNav==2?'今日收藏': '高频错题'}} @@ -79,6 +79,7 @@ // let switchValue = ref(false) function subMenuClick(item) { + if(!item.total) return uni.$u.toast('暂无题目') usecarStore.setCar('chapter', item.param) uni.navigateTo({ url: '/pages/exercises/brushQuestions/wrongQuestions?wrong=' +currentNav.value @@ -87,6 +88,8 @@ function changeNav(val) { currentNav.value = val + countInfo.value = {} + subMenu.value = [] myWrongQuestionFn() questionSubmenuFn() } @@ -152,6 +155,13 @@ }) } + + function goPage(url, num) { + if(!num) return uni.$u.toast('暂无题目') + uni.navigateTo({ + url + }) + }