diff --git a/src/https/api.js b/src/https/api.js deleted file mode 100644 index 3f09f50..0000000 --- a/src/https/api.js +++ /dev/null @@ -1,11 +0,0 @@ -import { - get, - post -} from '../https/index'; - -const obj = { - GetSysAreaList: p => get('/h5/MyVoluntary/GetSysAreaList', p),//获取地区列表 - getMsg: p => post('/sxh/wx/getMsg', p),//绑定手机号用到的验证码 -} - -export default obj; diff --git a/src/https/index.js b/src/https/index.js deleted file mode 100644 index 12b2d7a..0000000 --- a/src/https/index.js +++ /dev/null @@ -1,100 +0,0 @@ -import Axios from 'axios'; -import QS from 'qs'; - -let httpUrl = ''; //正式 -if (process.env.NODE_ENV === "development") { - // httpUrl = 'http://192.168.1.95:9901'; - httpUrl = 'https://proxy.shunzhi.net'; -} else { - httpUrl = 'https://proxy.shunzhi.net'; -} - -var instance = Axios.create({ - timeout: 60000 -}); -// instance.defaults.baseURL = 'https://proxy.shunzhi.net:51314/'; //正式 -instance.defaults.baseURL = httpUrl; //测试 -instance.defaults.timeout = 60000; -instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; -// 请求拦截器 -// instance.interceptors.request.use( -// config => { -// // 每次发送请求之前判断vuex中是否存在token -// // 如果存在,则统一在http请求的header都加上token,这样后台根据token判断你的登录情况 -// // 即使本地存在token,也有可能token是过期的,所以在响应拦截器中要对返回状态进行判断 -// console.log(config) -// // const token = common.getCookie('SXH_token'); -// // token && (config.headers.Authorization = token); -// return config; -// }, -// error => { -// return Promise.error(error); -// }) -// // 响应拦截器 - -instance.interceptors.response.use( - response => { - console.log(response.data.message) - if (response.data.message === '登录已过期') { - let prevPage = sessionStorage.getItem('prePage'); - if (prevPage == 'center') {//个人中心授权过期 - location.href = httpUrl + '/wx/index/toPersonalNoLogin'; - } else if (prevPage == 'college') {//高考季授权过期(目前无token,暂时无用) - location.href = httpUrl + '/wx/index/subscribe'; - } else if (prevPage == 'lecture') {//公益讲座授权过期 - location.href = httpUrl + '/wx/index/live'; - }else{ - location.href = httpUrl + '/wx/index/auth'; - } - sessionStorage.removeItem('openId') - } - // 如果返回的状态码为200,说明接口请求成功,可以正常拿到数据 - // 否则的话抛出错误 - if (response.status === 200) { - return Promise.resolve(response); - } else { - return Promise.reject(response); - } - }, - // 服务器状态码不是2开头的的情况 - // 这里可以跟你们的后台开发人员协商好统一的错误状态码 - // 然后根据返回的状态码进行一些操作,例如登录过期提示,错误提示等等 - // 下面列举几个常见的操作,其他需求可自行扩展 - error => { - return Promise.reject(error.response); - } -); - -export function get (url, params) { - return new Promise((resolve, reject) => { - let tokenValue = sessionStorage.getItem('tokenValue') - instance.get(url, { - params: params, - headers: { 'sztoken': tokenValue } - }).then(res => { - resolve(res.data); - }).catch(err => { - reject(err.data) - }) - }); -} - -export function post (url, params, type) { - var ndata = type == 'json' ? JSON.stringify(params) : QS.stringify(params); - if (type == 'json') { - instance.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8'; - } else { - instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; - } - return new Promise((resolve, reject) => { - let tokenValue = sessionStorage.getItem('tokenValue') - instance.post(url, ndata, { - headers: { 'sztoken': tokenValue } - }).then(res => { - resolve(res.data); - }) - .catch(err => { - reject(err.data) - }) - }); -} diff --git a/src/main.js b/src/main.js index cc8fe97..56e9910 100644 --- a/src/main.js +++ b/src/main.js @@ -3,9 +3,6 @@ import { Popup, Toast, Picker, Tag, Tab, Tabs, Area, Search, Swipe, SwipeItem, C import App from './App.vue' import router from './router' import store from './store' -import http from './https/api' -Vue.prototype.proxyUrl = 'https://proxy.shunzhi.net'; -Vue.prototype.yanxueUrl = 'https://yanxue.myjxt.com'; import Moment from 'moment' Vue.prototype.Moment = Moment; @@ -19,7 +16,6 @@ Vue.prototype.mgop = mgop; import common from './common/index' Vue.prototype.common = common; -Vue.prototype.http = http; Vue .use(Popup) .use(Picker) diff --git a/src/router/index.js b/src/router/index.js index e21729c..38ab9b1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -13,8 +13,6 @@ import evaluateBase from '@/views/Service/evaluateBase.vue' //基地评价 import evaluateDetail from '@/views/Service/evaluateDetail.vue' //评价详情 import ServiceKQ from '@/views/Service/ServiceKQ.vue' //柯桥研学 -import LoginPublic from '@/views/Service/LoginPublic.vue' -import ServiceCardBoxPublic from '@/views/Service/CardBoxPublic.vue' import CardBoxXST from '@/views/Service/CardBoxXST.vue' import CardCourseList from '@/views/Service/CardCourseList.vue' //优惠券对应商品列表 @@ -50,14 +48,6 @@ const routes = [{ title: '个人中心(柯桥研学)' } }, - { - path: '/login_public', - name: 'LoginPublic', - component: LoginPublic, - meta: { - title: '绑定手机号' - } - }, { path: '/abroad_detail', @@ -93,14 +83,6 @@ const routes = [{ } }, { - path: '/card_box_public', - name: 'ServiceCardBoxPublic', - component: ServiceCardBoxPublic, - meta: { - title: '我的优惠券' - } - }, - { path: '/CardBoxXST', name: 'CardBoxXST', component: CardBoxXST, diff --git a/src/views/Home/MyClassList.vue b/src/views/Home/MyClassList.vue index f070d69..fe5f3d8 100644 --- a/src/views/Home/MyClassList.vue +++ b/src/views/Home/MyClassList.vue @@ -78,15 +78,30 @@ export default { this.$toast.loading({ message: '请求中...', }); - this.yxAxios.get(`${this.yanxueUrl}/api/BaseManage/AddSign?userId=${this.selectedContact.travelerNum}&baseId=${this.baseId}`).then((res) => { - this.$toast.success('打卡签到成功'); - console.log(res.data) - // alert('打卡签到成功:',JSON.stringify(res)) - setTimeout(() => { - let publicName = sessionStorage.getItem('publicName'); - this.$router.push({ name: 'Home' + publicName }) - }, 1000) - }) + this.mgop({ + api: 'mgop.sz.hswsy.GetStudyBaseDetail', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "userId": this.selectedContact.travelerNum, + "baseId": this.baseId + }, + onSuccess: res => { + this.$toast.success('打卡签到成功'); + setTimeout(() => { + let publicName = sessionStorage.getItem('publicName'); + this.$router.push({ name: 'Home' + publicName }) + }, 1000) + }, + onFail: err => { + console.log('err', err) + } + }); }, // 获取基地信息 GetStudyBaseDetail (baseId) { diff --git a/src/views/Home/YanxueInfo.vue b/src/views/Home/YanxueInfo.vue index 22a216d..c849430 100644 --- a/src/views/Home/YanxueInfo.vue +++ b/src/views/Home/YanxueInfo.vue @@ -31,18 +31,34 @@ export default { methods: { getbind () { if (this.userNum == '' || this.codeNum == '') { - return this.$toast('请先填写完整信息!'); + this.$toast('请先填写完整信息!'); + return ; } - this.yxAxios.get(this.proxyUrl + '/prod/user/info/bingStudyCode?userNum=' + this.userNum + '&code=' + this.codeNum) - .then((res) => { - console.log('接口返回', res.data) - if (res.data.code == '200') { + this.mgop({ + api: 'mgop.sz.hswsy.bingStudyCode', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "userNum": this.userNum, + "code": this.codeNum, + }, + onSuccess: res => { + if (res.data.code == '200') { this.$toast('操作成功'); this.$router.push({ name: 'YanxueCode' }) } else { this.$toast('操作失败:' + res.data.message); } - }) + }, + onFail: err => { + console.log('err', err) + } + }); }, //扫一扫 saoYiSao () { diff --git a/src/views/Home/component/AddChildPopupGroup.vue b/src/views/Home/component/AddChildPopupGroup.vue index 57a4b1e..8e11289 100644 --- a/src/views/Home/component/AddChildPopupGroup.vue +++ b/src/views/Home/component/AddChildPopupGroup.vue @@ -159,10 +159,20 @@ export default { duration: 0, forbidClick: true }) - this.http.getMsg({ - phone: this.phone - }).then((res) => { - this.$toast.clear() + this.mgop({ + api: 'mgop.sz.hswsy.getMsg', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'POST', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "phone": this.phone + }, + onSuccess: res => { + this.$toast.clear() if (res.success) { let i = 60; codeInterval = setInterval(() => { @@ -177,7 +187,11 @@ export default { } else { this.$toast.fail(res.message) } - }) + }, + onFail: err => { + console.log('err', err) + } + }); }, // 获取手机号白名单信息 checkPhoneAndCode () { @@ -198,30 +212,43 @@ export default { duration: 0, forbidClick: true }) - - this.yxAxios.post(`${this.proxyUrl}/prod/user/info/checkPhoneAndCode`, { - "code": this.code, - "phone": this.phone, - "unionId": sessionStorage.getItem('centerNo') - }).then((res) => { - this.$toast.clear() - if (res.data.code == 200) { - if (res.data.data.length == 0) { - // 白名单无用户 - this.step = 3; - } else { - // 白名单有用户 - let claimChildList = res.data.data - for (let i in claimChildList) { - claimChildList[i].checked = false + this.mgop({ + api: 'mgop.sz.hswsy.checkPhoneAndCode', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'POST', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "code": this.code, + "phone": this.phone, + "unionId": sessionStorage.getItem('centerNo') + }, + onSuccess: res => { + this.$toast.clear() + if (res.data.code == 200) { + if (res.data.data.length == 0) { + // 白名单无用户 + this.step = 3; + } else { + // 白名单有用户 + let claimChildList = res.data.data + for (let i in claimChildList) { + claimChildList[i].checked = false + } + this.claimChildList = claimChildList + this.step = 2; } - this.claimChildList = claimChildList - this.step = 2; + } else { + this.$toast.fail(res.data?.message) } - } else { - this.$toast.fail(res.data?.message) + }, + onFail: err => { + console.log('err', err) } - }) + }); }, diff --git a/src/views/Service/AbroadDetail.vue b/src/views/Service/AbroadDetail.vue index e23f6c7..03722a7 100644 --- a/src/views/Service/AbroadDetail.vue +++ b/src/views/Service/AbroadDetail.vue @@ -236,62 +236,11 @@ export default { }, mounted () { sessionStorage.removeItem('useCard') - this.courseId = this.$route.query.courseId; - let publicName = this.$route.query.publicName || sessionStorage.getItem('publicName'); - if (publicName) { - sessionStorage.setItem('publicName', publicName) - this.publicName = publicName - if (publicName == "XST") { - this.appId = 'wx1c630c8773c482f1' - } else if (publicName == "SXYX") { - this.appId = 'wx1305e88d2bc74073' - } else if (publicName == "KQ") { - this.appId = 'wx1305e88d2bc74073' - } - }else{ - this.$toast.fail('请通过正确的途径访问') - return; - } - sessionStorage.setItem('prePage', 'ServiceAbroadDetail'); - sessionStorage.setItem('prePageQuery', JSON.stringify({ courseId: this.courseId, publicName: this.publicName })); - if (process.env.NODE_ENV === "production" && this.common.isWeiXin()) { - let openId = sessionStorage.getItem('openId' + this.publicName); - if (!openId) { - this.$router.push({ name: 'Authorize' + this.publicName }) - return; - } - this.unionId = sessionStorage.getItem('unionId'); - this.getUserInfo() - } else { - this.unionId = 'oJPmPuLaAx2x2DaRGfCFeYuLWzLU'; - this.getUserInfo() - } + this.centerNo = sessionStorage.getItem('centerNo') this.GetCourseDetail(); }, methods: { - // 获取用户信息 - getUserInfo () { - let userInfo = sessionStorage.getItem('userInfo'); - let unionId = sessionStorage.getItem('unionId'); - if (userInfo) { - userInfo = JSON.parse(userInfo) - this.centerNo = userInfo.centerNo - } else { - this.$toast.loading({ - message: '加载中...', - duration: 0, - forbidClick: true - }) - this.yxAxios.get(`${this.proxyUrl}/prod/api/wx/${this.appId}/getUserInfo?unionId=${unionId}`).then((res) => { - this.$toast.clear() - if (res.data.code == 200) { - this.centerNo = res.data.data.centerNo - sessionStorage.setItem('userInfo', JSON.stringify(res.data.data)) - } - }) - } - }, // 展开关闭院校简介 extend_btn () { this.isOpen = !this.isOpen; @@ -350,11 +299,20 @@ export default { duration: 0, forbidClick: true, }); - this.yxAxios - .get( - `${this.yanxueUrl}/api/StudiesWap/GetCourseDetail?id=${this.courseId}&cs=绍兴市` - ) - .then((res) => { + this.mgop({ + api: 'mgop.sz.hswsy.GetCourseDetail', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'POST', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "id":this.courseId, + "cs": "绍兴市", + }, + onSuccess: res => { this.$toast.clear(); if (res.data.data && res.data.data.id !== 0) { let detailData = res.data.data; @@ -393,17 +351,28 @@ export default { } this.$toast.fail(message) } - }); + }, + onFail: err => { + console.log('err', err) + } + }); }, //获取商品可使用优惠券 getOrderCoupon () { - this.yxAxios - .post(`${this.proxyUrl}/prod/api/coupon/orderCoupon`, { - proId: this.detailData.id, - userId: this.centerNo, - }) - .then((res) => { - // console.log(res.data.data) + this.mgop({ + api: 'mgop.sz.hswsy.orderCoupon', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'POST', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "proId": this.detailData.id, + "userId": this.centerNo, + }, + onSuccess: res => { if (res.data.data) { if (res.data.data.has.length > 0) { this.proCoupon = res.data.data.has @@ -416,7 +385,11 @@ export default { } } } - }); + }, + onFail: err => { + console.log('err', err) + } + }); }, // 设置默认选中的优惠券 chooseDefaultUseCard (has) { @@ -438,31 +411,47 @@ export default { }, // 获取评价 getEvaluationSummary () { - this.yxAxios - .get( - `${this.yanxueUrl}/api/StudiesWap/Evaluation/Summary?courseId=${this.courseId}`) - .then((res) => { - console.log(res.data.data); + this.mgop({ + api: 'mgop.sz.hswsy.EvaluationSummary', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "courseId": this.courseId, + }, + onSuccess: res => { if (res.data.data) { this.evaluationData = res.data.data } - }); + }, + onFail: err => { + console.log('err', err) + } + }); }, // 获取套餐列表 getPackageData () { let startDate = this.Moment().format("YYYY-MM-DD"); let endDate = this.Moment().add(60, "days").format("YYYY-MM-DD"); - this.yxAxios - .post( - `${this.yanxueUrl}/api/Product/DateComboBindList/ByTime/List`, - { - productId: this.detailData.id, - startDate: startDate, - endDate: endDate, - } - ) - .then((res) => { - console.log(res.data.data); + this.mgop({ + api: 'mgop.sz.hswsy.DateComboBindList', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "productId": this.detailData.id, + "startDate": startDate, + "endDate": endDate, + }, + onSuccess: res => { if (res.data.data) { let allPackage = res.data.data; let usefulPackage = []; @@ -479,7 +468,11 @@ export default { ); this.setPackageArr(); } - }); + }, + onFail: err => { + console.log('err', err) + } + }); }, // 设置套餐价格 setPackageArr () { @@ -522,14 +515,27 @@ export default { }, // 获取单个基地 GetOneBase (baseId) { - this.yxAxios - .get(`${this.yanxueUrl}/api/Manage/GetOneBase?id=${baseId}`) - .then((res) => { - // console.log(res.data.data) + this.mgop({ + api: 'mgop.sz.hswsy.GetOneBase', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "id": baseId, + }, + onSuccess: res => { if (res.data.data) { this.baseData = res.data.data; } - }); + }, + onFail: err => { + console.log('err', err) + } + }); }, // 设置第几天的课程表 getWeekCard (index) { diff --git a/src/views/Service/AbroadEvaluate.vue b/src/views/Service/AbroadEvaluate.vue index 6bb00c7..b9e3482 100644 --- a/src/views/Service/AbroadEvaluate.vue +++ b/src/views/Service/AbroadEvaluate.vue @@ -60,17 +60,33 @@ export default { }, methods: { getEvaluationList (courseId) { - this.yxAxios.get(`${this.yanxueUrl}/api/StudiesWap/Evaluation/List?courseId=${courseId}`).then((res) => { - this.$toast.clear(); - if (res.data.status == 1) { - let list = res.data.data?.evaluationList; - for (let i in list) { - list[i].intime = this.Moment(list[i].intime).format("YYYY.MM.DD"); + this.mgop({ + api: 'mgop.sz.hswsy.EvaluationList', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "courseId": courseId, + }, + onSuccess: res => { + this.$toast.clear(); + if (res.data.status == 1) { + let list = res.data.data?.evaluationList; + for (let i in list) { + list[i].intime = this.Moment(list[i].intime).format("YYYY.MM.DD"); + } + this.list = list; + this.score = res.data.data?.shopScore } - this.list = list; - this.score = res.data.data?.shopScore + }, + onFail: err => { + console.log('err', err) } - }) + }); }, // 预览图片 previewImg (url) { diff --git a/src/views/Service/CardBoxPublic.vue b/src/views/Service/CardBoxPublic.vue deleted file mode 100644 index ce9c696..0000000 --- a/src/views/Service/CardBoxPublic.vue +++ /dev/null @@ -1,164 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/Service/CardCourseList.vue b/src/views/Service/CardCourseList.vue index 9176319..786be45 100644 --- a/src/views/Service/CardCourseList.vue +++ b/src/views/Service/CardCourseList.vue @@ -67,7 +67,38 @@ export default { duration: 0, forbidClick: true, }); - this.yxAxios.post(`${this.yanxueUrl}/api/StudiesWap/CourseList/ByIdList`, this.proId.split(',')).then((res) => { + // this.mgop({ + // api: 'mgop.sz.hswsy.CourseListByIdList', // 必须 + // host: 'https://mapi.zjzwfw.gov.cn/', + // dataType: 'JSON', + // type: 'POST', + // appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + // headers: { + // // 'isTestUrl': '1' + // }, + // data: {idList:["1502","1524","1551","1570","1572"]}, + // onSuccess: res => { + // this.$toast.clear(); + // let proList = res.data.data; + // for (let i in proList) { + // proList[i].course_labels = proList[i].course_labels?.split(','); + // proList[i].coverUrl = proList[i]?.coverList[0]?.cover_url + // if (proList[i].startDate) { + // proList[i].week = this.formatWeek(this.Moment(proList[i].startDate).format('d')); + // proList[i].startDate = this.Moment(proList[i].startDate).format('YYYY.M.D'); + // proList[i].endDate = this.Moment(proList[i].endDate).format('YYYY.M.D'); + // } + // } + // console.log(proList) + // this.proList = proList + // }, + // onFail: err => { + // console.log('err', err) + // } + // }); + this.yxAxios.post(`https://yanxue.myjxt.com/api/StudiesWap/CourseList/ByIdList`, { + idList:this.proId + }).then((res) => { this.$toast.clear(); let proList = res.data.data; for (let i in proList) { @@ -90,15 +121,23 @@ export default { //领取优惠券 reCard () { if (this.geted) return; - this.yxAxios.post(`${this.proxyUrl}/prod/api/coupon/get`, { - unionId: this.unionId, - "proId": this.proId, - "proName": this.proName, - "pic": this.pics, - couponId: this.cardId, - }) - .then((res) => { - // console.log(res.data) + this.mgop({ + api: 'mgop.sz.hswsy.CouponGet', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'POST', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "unionId": sessionStorage.getItem('centerNo'), + "proId": this.proId, + "proName": this.proName, + "pic": this.pics, + "couponId": this.cardId, + }, + onSuccess: res => { if (res.data.code == 200) { sessionStorage.setItem('cardCousreGeted', true) this.geted = true; @@ -106,7 +145,11 @@ export default { } else { this.$toast.fail(res.data.message); } - }) + }, + onFail: err => { + console.log('err', err) + } + }); }, onConfirm (item) { diff --git a/src/views/Service/CardSelect.vue b/src/views/Service/CardSelect.vue index 49aa6be..b6c273e 100644 --- a/src/views/Service/CardSelect.vue +++ b/src/views/Service/CardSelect.vue @@ -31,18 +31,9 @@ export default { return { cardList: [], selectIndex: -1, - unionId: '' } }, mounted () { - if (process.env.NODE_ENV === "production"&&this.common.isWeiXin()) { - this.unionId = sessionStorage.getItem('unionId'); - } else { - this.unionId = 'oJPmPuLaAx2x2DaRGfCFeYuLWzLU'; - } - // this.$nextTick(() => { - // this.getOrderCoupon() - // }) let cardList = sessionStorage.getItem('proCoupon') if (cardList) { this.cardList = JSON.parse(cardList) diff --git a/src/views/Service/CheckOrder.vue b/src/views/Service/CheckOrder.vue index 949cfb0..99e95e3 100644 --- a/src/views/Service/CheckOrder.vue +++ b/src/views/Service/CheckOrder.vue @@ -65,7 +65,6 @@ export default { showCourseData: '',//当前课程的信息 selectCombo: '',//已选择的套餐 publicName: '', - openId: '',//支付用 userInfo: '',//支付用 appId: '', selectedContactArr: [],//选择的出行人 @@ -84,18 +83,6 @@ export default { this.appId = 'wx1305e88d2bc74073' } } - let openId = sessionStorage.getItem('openId' + this.publicName); - - if (process.env.NODE_ENV === "production"&&this.common.isWeiXin()) { - if (!openId) { - sessionStorage.setItem('prePage', 'ServiceCheckOrder'); - this.$router.push({ name: 'Authorize' + this.publicName }) - return; - } else { - this.openId = openId; - } - } - let userInfo = sessionStorage.getItem('userInfo'); if (userInfo) { this.userInfo = JSON.parse(userInfo); @@ -168,32 +155,37 @@ export default { this.$toast.fail('请先阅读并同意用户协议'); return; } - this.yxAxios.post(`${this.yanxueUrl}/api/Manage/AddOrderPay`, { - courseId: this.showCourseData.id, - payway: 2, - paymoney: this.paymoney,//时段个数*单价*人数-优惠券 - userId: this.userInfo?.centerNo,//升学汇和其他端接口字段不同 - orderCount: this.count,//人数 - orderTime: this.date,//时段集合 2018-10-15 - comboId: this.selectCombo.id, - dateBindComboId: this.selectCombo.dateBindComboId, - unionId: this.userInfo?.centerNo, - // unionId: this.userInfo?.unionId, - price: this.selectCombo.actualPrice * 1000 * this.count / 1000,//商品减掉优惠券之前的价格 - travelNum: this.selectedContact,//出行人编号 - couponId: this.useCard?.id || 0, - appId:this.appId - }).then(res => { - console.log(res.data) - if (res.data.data) { + this.mgop({ + api: 'mgop.sz.hswsy.AddOrderPay', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'POST', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "courseId": this.showCourseData.id, + "payway": 2, + "paymoney": this.paymoney,//时段个数*单价*人数-优惠券 + "userId": this.userInfo?.centerNo,//升学汇和其他端接口字段不同 + "orderCount": this.count,//人数 + "orderTime": this.date,//时段集合 2018-10-15 + "comboId": this.selectCombo.id, + "dateBindComboId": this.selectCombo.dateBindComboId, + "unionId": this.userInfo?.centerNo, + "price": this.selectCombo.actualPrice * 1000 * this.count / 1000,//商品减掉优惠券之前的价格 + "travelNum": this.selectedContact,//出行人编号 + "couponId": this.useCard?.id || 0, + "appId": this.appId + }, + onSuccess: res => { + if (res.data.data) { if (this.paymoney == 0) { // 使用后移除优惠券,防止返回继续使用 sessionStorage.removeItem('useCard') - if (this.publicName == 'SXYX' || this.publicName == 'XST' || this.publicName == 'KQ') { this.$router.push({ name: 'ServiceOrderXST', query: { active: 1, showChatGroupUrl: 1 } }) - } else { - this.$router.push({ name: 'ServiceOrderPublic' }) - } + } else { // 使用后移除优惠券,防止返回继续使用 sessionStorage.removeItem('useCard') @@ -204,29 +196,26 @@ export default { this.$toast.fail(res.data?.result); } - }) + }, + onFail: err => { + console.log('err', err) + } + }); }, openPay (data) { let that = this; - if (!this.openId) { - this.$toast.fail('没有获取到当前用户信息,请通过正确的渠道访问'); - return; - } - console.log('openId =', this.openId) - + alert('支付') + return; + Axios({ - // url: this.proxyUrl + '/sxh/order/orderCenter', - url: this.proxyUrl + '/prod/api/wx/pay/' + this.appId + '/1614900216', + url: 'https://proxy.shunzhi.net/prod/api/wx/pay/' + this.appId + '/1614900216', method: 'post', - // headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, headers: { 'Content-Type': 'application/json;charset=UTF-8' }, - // data: Qs.stringify({ data: { - notify_url: `${this.yanxueUrl}/api/Manage/WxBackInfo`, - body: this.showCourseData.course_name+'_'+this.date, + notify_url: `https://yanxue.myjxt.com/api/Manage/WxBackInfo`, + body: this.showCourseData.course_name + '_' + this.date, openId: this.openId, //'oHHbojor4C_gR96lxxFUeYTrY0Uc' - // openId: 'oQTiTjhDkusbSi-rgJ5nMey3IsPw', //'oHHbojor4C_gR96lxxFUeYTrY0Uc' outTradeNo: data.trade_no, //订单号 productId: this.showCourseData.id, //商品id totalFee: this.paymoney * 100, //钱 diff --git a/src/views/Service/DatePackage.vue b/src/views/Service/DatePackage.vue index 857a24e..d145ede 100644 --- a/src/views/Service/DatePackage.vue +++ b/src/views/Service/DatePackage.vue @@ -95,23 +95,55 @@ export default { // 获取库存 GetOrderPayCount () { let showCourseData = JSON.parse(sessionStorage.getItem('showCourseData')) - this.yxAxios.get(`${this.yanxueUrl}/api/Product/OrderPayCount/ByBindId?productId=${showCourseData.id}&startDate=${this.date}`).then((res) => { - if (res.data) { + this.mgop({ + api: 'mgop.sz.hswsy.OrderPayCount', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "productId": showCourseData.id, + "startDate": this.date, + }, + onSuccess: res => { + if (res.data.data) { this.numOne = res.data.data - // console.log(this.numOne) + } + }, + onFail: err => { + console.log('err', err) } - }) + }); }, // 获取库存第二个参数 getSurplusComboCount (bindId) { let showCourseData = JSON.parse(sessionStorage.getItem('showCourseData')) - this.yxAxios.get(`${this.yanxueUrl}/api/Product/SurplusComboCount/ByBindId?bindId=${bindId}&productId=${showCourseData.id}&startDate=${this.date}`).then((res) => { - if (res.data) { + this.mgop({ + api: 'mgop.sz.hswsy.SurplusComboCount', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: { + "bindId": bindId, + "productId": showCourseData.id, + "startDate": this.date, + }, + onSuccess: res => { + if (res.data.data) { this.numSecond = res.data.data - // console.log(this.numSecond) + } + }, + onFail: err => { + console.log('err', err) } - }) - + }); }, // 选择排期 choosePeriod (index) { diff --git a/src/views/Service/EditContact.vue b/src/views/Service/EditContact.vue index 43dd243..51d0baf 100644 --- a/src/views/Service/EditContact.vue +++ b/src/views/Service/EditContact.vue @@ -90,15 +90,29 @@ export default { duration: 0, forbidClick: true }) - this.yxAxios.post(`${this.proxyUrl}/prod/user/info/addContacts`, postData).then((res) => { - this.$toast.clear() - if (res.data.code == 200) { - this.$toast.success('完善成功') - this.$router.back() - } else { - this.$toast.fail(res.message) + this.mgop({ + api: 'mgop.sz.hswsy.addContacts', // 必须 + host: 'https://mapi.zjzwfw.gov.cn/', + dataType: 'JSON', + type: 'GET', + appKey: 'fuxgnukl+2001895516+edccpx', // 必须 + headers: { + // 'isTestUrl': '1' + }, + data: postData, + onSuccess: res => { + this.$toast.clear() + if (res.data.code == 200) { + this.$toast.success('完善成功') + this.$router.back() + } else { + this.$toast.fail(res.message) + } + }, + onFail: err => { + console.log('err', err) } - }) + }); }, checkPhone (phone) { if ((/^1[3456789]\d{9}$/.test(phone))) { diff --git a/src/views/Service/LoginPublic.vue b/src/views/Service/LoginPublic.vue deleted file mode 100644 index eec1456..0000000 --- a/src/views/Service/LoginPublic.vue +++ /dev/null @@ -1,234 +0,0 @@ - - - \ No newline at end of file diff --git a/src/views/Service/ServiceBaseKQ.vue b/src/views/Service/ServiceBaseKQ.vue index eb6efb4..83a03a3 100644 --- a/src/views/Service/ServiceBaseKQ.vue +++ b/src/views/Service/ServiceBaseKQ.vue @@ -368,7 +368,24 @@ export default { }, // 我的优惠券 handleMyCard () { - this.$router.push({ name: 'ServiceCardBoxPublic' }) + let isLogin = this.checkLogin() + if (!isLogin) return; + const publicName = sessionStorage.getItem('publicName') + // this.$toast('暂未开放,敬请期待!'); + this.$router.push({ name: 'CardBoxXST', query: { active: 1, publicName: publicName } }) + }, + // 判断是否已登录 + checkLogin () { + if (process.env.NODE_ENV != "production") return true; + const userInfo = JSON.parse(sessionStorage.getItem('userInfo')) + if (!userInfo?.phone) { + const publicName = sessionStorage.getItem('publicName') + sessionStorage.setItem('prePage', 'Service' + publicName); + sessionStorage.setItem('prePageQuery', JSON.stringify({ showTab: this.$route.query.showTab })); + this.$router.push({ name: 'LoginPublic', query: { publicName: publicName } }) + return false; + } + return true; }, formatWeek (week) { return week == 1 ? '周一' : week == 2 ? '周二' : week == 3 ? '周三' : week == 4 ? '周四' : week == 5 ? '周五' : week == 6 ? '周六' : week == 0 ? '周日' : ''; diff --git a/src/views/Service/evaluatePubilc.vue b/src/views/Service/evaluatePubilc.vue index 724b998..c024e74 100644 --- a/src/views/Service/evaluatePubilc.vue +++ b/src/views/Service/evaluatePubilc.vue @@ -45,7 +45,6 @@