Commit 68da6ea2744c8e5444fb430e6aec70ab5ce1edcc

Authored by 夏洋涛
1 parent f02585ec
Exists in master

feat: 接口对接

src/https/api.js
@@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
1 -import {  
2 - get,  
3 - post  
4 -} from '../https/index';  
5 -  
6 -const obj = {  
7 - GetSysAreaList: p => get('/h5/MyVoluntary/GetSysAreaList', p),//获取地区列表  
8 - getMsg: p => post('/sxh/wx/getMsg', p),//绑定手机号用到的验证码  
9 -}  
10 -  
11 -export default obj;  
src/https/index.js
@@ -1,100 +0,0 @@ @@ -1,100 +0,0 @@
1 -import Axios from 'axios';  
2 -import QS from 'qs';  
3 -  
4 -let httpUrl = ''; //正式  
5 -if (process.env.NODE_ENV === "development") {  
6 - // httpUrl = 'http://192.168.1.95:9901';  
7 - httpUrl = 'https://proxy.shunzhi.net';  
8 -} else {  
9 - httpUrl = 'https://proxy.shunzhi.net';  
10 -}  
11 -  
12 -var instance = Axios.create({  
13 - timeout: 60000  
14 -});  
15 -// instance.defaults.baseURL = 'https://proxy.shunzhi.net:51314/'; //正式  
16 -instance.defaults.baseURL = httpUrl; //测试  
17 -instance.defaults.timeout = 60000;  
18 -instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';  
19 -// 请求拦截器  
20 -// instance.interceptors.request.use(  
21 -// config => {  
22 -// // 每次发送请求之前判断vuex中是否存在token  
23 -// // 如果存在,则统一在http请求的header都加上token,这样后台根据token判断你的登录情况  
24 -// // 即使本地存在token,也有可能token是过期的,所以在响应拦截器中要对返回状态进行判断  
25 -// console.log(config)  
26 -// // const token = common.getCookie('SXH_token');  
27 -// // token && (config.headers.Authorization = token);  
28 -// return config;  
29 -// },  
30 -// error => {  
31 -// return Promise.error(error);  
32 -// })  
33 -// // 响应拦截器  
34 -  
35 -instance.interceptors.response.use(  
36 - response => {  
37 - console.log(response.data.message)  
38 - if (response.data.message === '登录已过期') {  
39 - let prevPage = sessionStorage.getItem('prePage');  
40 - if (prevPage == 'center') {//个人中心授权过期  
41 - location.href = httpUrl + '/wx/index/toPersonalNoLogin';  
42 - } else if (prevPage == 'college') {//高考季授权过期(目前无token,暂时无用)  
43 - location.href = httpUrl + '/wx/index/subscribe';  
44 - } else if (prevPage == 'lecture') {//公益讲座授权过期  
45 - location.href = httpUrl + '/wx/index/live';  
46 - }else{  
47 - location.href = httpUrl + '/wx/index/auth';  
48 - }  
49 - sessionStorage.removeItem('openId')  
50 - }  
51 - // 如果返回的状态码为200,说明接口请求成功,可以正常拿到数据  
52 - // 否则的话抛出错误  
53 - if (response.status === 200) {  
54 - return Promise.resolve(response);  
55 - } else {  
56 - return Promise.reject(response);  
57 - }  
58 - },  
59 - // 服务器状态码不是2开头的的情况  
60 - // 这里可以跟你们的后台开发人员协商好统一的错误状态码  
61 - // 然后根据返回的状态码进行一些操作,例如登录过期提示,错误提示等等  
62 - // 下面列举几个常见的操作,其他需求可自行扩展  
63 - error => {  
64 - return Promise.reject(error.response);  
65 - }  
66 -);  
67 -  
68 -export function get (url, params) {  
69 - return new Promise((resolve, reject) => {  
70 - let tokenValue = sessionStorage.getItem('tokenValue')  
71 - instance.get(url, {  
72 - params: params,  
73 - headers: { 'sztoken': tokenValue }  
74 - }).then(res => {  
75 - resolve(res.data);  
76 - }).catch(err => {  
77 - reject(err.data)  
78 - })  
79 - });  
80 -}  
81 -  
82 -export function post (url, params, type) {  
83 - var ndata = type == 'json' ? JSON.stringify(params) : QS.stringify(params);  
84 - if (type == 'json') {  
85 - instance.defaults.headers.post['Content-Type'] = 'application/json;charset=UTF-8';  
86 - } else {  
87 - instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';  
88 - }  
89 - return new Promise((resolve, reject) => {  
90 - let tokenValue = sessionStorage.getItem('tokenValue')  
91 - instance.post(url, ndata, {  
92 - headers: { 'sztoken': tokenValue }  
93 - }).then(res => {  
94 - resolve(res.data);  
95 - })  
96 - .catch(err => {  
97 - reject(err.data)  
98 - })  
99 - });  
100 -}  
@@ -3,9 +3,6 @@ import { Popup, Toast, Picker, Tag, Tab, Tabs, Area, Search, Swipe, SwipeItem, C @@ -3,9 +3,6 @@ import { Popup, Toast, Picker, Tag, Tab, Tabs, Area, Search, Swipe, SwipeItem, C
3 import App from './App.vue' 3 import App from './App.vue'
4 import router from './router' 4 import router from './router'
5 import store from './store' 5 import store from './store'
6 -import http from './https/api'  
7 -Vue.prototype.proxyUrl = 'https://proxy.shunzhi.net';  
8 -Vue.prototype.yanxueUrl = 'https://yanxue.myjxt.com';  
9 6
10 import Moment from 'moment' 7 import Moment from 'moment'
11 Vue.prototype.Moment = Moment; 8 Vue.prototype.Moment = Moment;
@@ -19,7 +16,6 @@ Vue.prototype.mgop = mgop; @@ -19,7 +16,6 @@ Vue.prototype.mgop = mgop;
19 import common from './common/index' 16 import common from './common/index'
20 Vue.prototype.common = common; 17 Vue.prototype.common = common;
21 18
22 -Vue.prototype.http = http;  
23 Vue 19 Vue
24 .use(Popup) 20 .use(Popup)
25 .use(Picker) 21 .use(Picker)
src/router/index.js
@@ -13,8 +13,6 @@ import evaluateBase from '@/views/Service/evaluateBase.vue' //基地评价 @@ -13,8 +13,6 @@ import evaluateBase from '@/views/Service/evaluateBase.vue' //基地评价
13 import evaluateDetail from '@/views/Service/evaluateDetail.vue' //评价详情 13 import evaluateDetail from '@/views/Service/evaluateDetail.vue' //评价详情
14 14
15 import ServiceKQ from '@/views/Service/ServiceKQ.vue' //柯桥研学 15 import ServiceKQ from '@/views/Service/ServiceKQ.vue' //柯桥研学
16 -import LoginPublic from '@/views/Service/LoginPublic.vue'  
17 -import ServiceCardBoxPublic from '@/views/Service/CardBoxPublic.vue'  
18 16
19 import CardBoxXST from '@/views/Service/CardBoxXST.vue' 17 import CardBoxXST from '@/views/Service/CardBoxXST.vue'
20 import CardCourseList from '@/views/Service/CardCourseList.vue' //优惠券对应商品列表 18 import CardCourseList from '@/views/Service/CardCourseList.vue' //优惠券对应商品列表
@@ -50,14 +48,6 @@ const routes = [{ @@ -50,14 +48,6 @@ const routes = [{
50 title: '个人中心(柯桥研学)' 48 title: '个人中心(柯桥研学)'
51 } 49 }
52 }, 50 },
53 - {  
54 - path: '/login_public',  
55 - name: 'LoginPublic',  
56 - component: LoginPublic,  
57 - meta: {  
58 - title: '绑定手机号'  
59 - }  
60 - },  
61 51
62 { 52 {
63 path: '/abroad_detail', 53 path: '/abroad_detail',
@@ -93,14 +83,6 @@ const routes = [{ @@ -93,14 +83,6 @@ const routes = [{
93 } 83 }
94 }, 84 },
95 { 85 {
96 - path: '/card_box_public',  
97 - name: 'ServiceCardBoxPublic',  
98 - component: ServiceCardBoxPublic,  
99 - meta: {  
100 - title: '我的优惠券'  
101 - }  
102 - },  
103 - {  
104 path: '/CardBoxXST', 86 path: '/CardBoxXST',
105 name: 'CardBoxXST', 87 name: 'CardBoxXST',
106 component: CardBoxXST, 88 component: CardBoxXST,
src/views/Home/MyClassList.vue
@@ -78,15 +78,30 @@ export default { @@ -78,15 +78,30 @@ export default {
78 this.$toast.loading({ 78 this.$toast.loading({
79 message: '请求中...', 79 message: '请求中...',
80 }); 80 });
81 - this.yxAxios.get(`${this.yanxueUrl}/api/BaseManage/AddSign?userId=${this.selectedContact.travelerNum}&baseId=${this.baseId}`).then((res) => {  
82 - this.$toast.success('打卡签到成功');  
83 - console.log(res.data)  
84 - // alert('打卡签到成功:',JSON.stringify(res))  
85 - setTimeout(() => {  
86 - let publicName = sessionStorage.getItem('publicName');  
87 - this.$router.push({ name: 'Home' + publicName })  
88 - }, 1000)  
89 - }) 81 + this.mgop({
  82 + api: 'mgop.sz.hswsy.GetStudyBaseDetail', // 必须
  83 + host: 'https://mapi.zjzwfw.gov.cn/',
  84 + dataType: 'JSON',
  85 + type: 'GET',
  86 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  87 + headers: {
  88 + // 'isTestUrl': '1'
  89 + },
  90 + data: {
  91 + "userId": this.selectedContact.travelerNum,
  92 + "baseId": this.baseId
  93 + },
  94 + onSuccess: res => {
  95 + this.$toast.success('打卡签到成功');
  96 + setTimeout(() => {
  97 + let publicName = sessionStorage.getItem('publicName');
  98 + this.$router.push({ name: 'Home' + publicName })
  99 + }, 1000)
  100 + },
  101 + onFail: err => {
  102 + console.log('err', err)
  103 + }
  104 + });
90 }, 105 },
91 // 获取基地信息 106 // 获取基地信息
92 GetStudyBaseDetail (baseId) { 107 GetStudyBaseDetail (baseId) {
src/views/Home/YanxueInfo.vue
@@ -31,18 +31,34 @@ export default { @@ -31,18 +31,34 @@ export default {
31 methods: { 31 methods: {
32 getbind () { 32 getbind () {
33 if (this.userNum == '' || this.codeNum == '') { 33 if (this.userNum == '' || this.codeNum == '') {
34 - return this.$toast('请先填写完整信息!'); 34 + this.$toast('请先填写完整信息!');
  35 + return ;
35 } 36 }
36 - this.yxAxios.get(this.proxyUrl + '/prod/user/info/bingStudyCode?userNum=' + this.userNum + '&code=' + this.codeNum)  
37 - .then((res) => {  
38 - console.log('接口返回', res.data)  
39 - if (res.data.code == '200') { 37 + this.mgop({
  38 + api: 'mgop.sz.hswsy.bingStudyCode', // 必须
  39 + host: 'https://mapi.zjzwfw.gov.cn/',
  40 + dataType: 'JSON',
  41 + type: 'GET',
  42 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  43 + headers: {
  44 + // 'isTestUrl': '1'
  45 + },
  46 + data: {
  47 + "userNum": this.userNum,
  48 + "code": this.codeNum,
  49 + },
  50 + onSuccess: res => {
  51 + if (res.data.code == '200') {
40 this.$toast('操作成功'); 52 this.$toast('操作成功');
41 this.$router.push({ name: 'YanxueCode' }) 53 this.$router.push({ name: 'YanxueCode' })
42 } else { 54 } else {
43 this.$toast('操作失败:' + res.data.message); 55 this.$toast('操作失败:' + res.data.message);
44 } 56 }
45 - }) 57 + },
  58 + onFail: err => {
  59 + console.log('err', err)
  60 + }
  61 + });
46 }, 62 },
47 //扫一扫 63 //扫一扫
48 saoYiSao () { 64 saoYiSao () {
src/views/Home/component/AddChildPopupGroup.vue
@@ -159,10 +159,20 @@ export default { @@ -159,10 +159,20 @@ export default {
159 duration: 0, 159 duration: 0,
160 forbidClick: true 160 forbidClick: true
161 }) 161 })
162 - this.http.getMsg({  
163 - phone: this.phone  
164 - }).then((res) => {  
165 - this.$toast.clear() 162 + this.mgop({
  163 + api: 'mgop.sz.hswsy.getMsg', // 必须
  164 + host: 'https://mapi.zjzwfw.gov.cn/',
  165 + dataType: 'JSON',
  166 + type: 'POST',
  167 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  168 + headers: {
  169 + // 'isTestUrl': '1'
  170 + },
  171 + data: {
  172 + "phone": this.phone
  173 + },
  174 + onSuccess: res => {
  175 + this.$toast.clear()
166 if (res.success) { 176 if (res.success) {
167 let i = 60; 177 let i = 60;
168 codeInterval = setInterval(() => { 178 codeInterval = setInterval(() => {
@@ -177,7 +187,11 @@ export default { @@ -177,7 +187,11 @@ export default {
177 } else { 187 } else {
178 this.$toast.fail(res.message) 188 this.$toast.fail(res.message)
179 } 189 }
180 - }) 190 + },
  191 + onFail: err => {
  192 + console.log('err', err)
  193 + }
  194 + });
181 }, 195 },
182 // 获取手机号白名单信息 196 // 获取手机号白名单信息
183 checkPhoneAndCode () { 197 checkPhoneAndCode () {
@@ -198,30 +212,43 @@ export default { @@ -198,30 +212,43 @@ export default {
198 duration: 0, 212 duration: 0,
199 forbidClick: true 213 forbidClick: true
200 }) 214 })
201 -  
202 - this.yxAxios.post(`${this.proxyUrl}/prod/user/info/checkPhoneAndCode`, {  
203 - "code": this.code,  
204 - "phone": this.phone,  
205 - "unionId": sessionStorage.getItem('centerNo')  
206 - }).then((res) => {  
207 - this.$toast.clear()  
208 - if (res.data.code == 200) {  
209 - if (res.data.data.length == 0) {  
210 - // 白名单无用户  
211 - this.step = 3;  
212 - } else {  
213 - // 白名单有用户  
214 - let claimChildList = res.data.data  
215 - for (let i in claimChildList) {  
216 - claimChildList[i].checked = false 215 + this.mgop({
  216 + api: 'mgop.sz.hswsy.checkPhoneAndCode', // 必须
  217 + host: 'https://mapi.zjzwfw.gov.cn/',
  218 + dataType: 'JSON',
  219 + type: 'POST',
  220 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  221 + headers: {
  222 + // 'isTestUrl': '1'
  223 + },
  224 + data: {
  225 + "code": this.code,
  226 + "phone": this.phone,
  227 + "unionId": sessionStorage.getItem('centerNo')
  228 + },
  229 + onSuccess: res => {
  230 + this.$toast.clear()
  231 + if (res.data.code == 200) {
  232 + if (res.data.data.length == 0) {
  233 + // 白名单无用户
  234 + this.step = 3;
  235 + } else {
  236 + // 白名单有用户
  237 + let claimChildList = res.data.data
  238 + for (let i in claimChildList) {
  239 + claimChildList[i].checked = false
  240 + }
  241 + this.claimChildList = claimChildList
  242 + this.step = 2;
217 } 243 }
218 - this.claimChildList = claimChildList  
219 - this.step = 2; 244 + } else {
  245 + this.$toast.fail(res.data?.message)
220 } 246 }
221 - } else {  
222 - this.$toast.fail(res.data?.message) 247 + },
  248 + onFail: err => {
  249 + console.log('err', err)
223 } 250 }
224 - }) 251 + });
225 }, 252 },
226 253
227 254
src/views/Service/AbroadDetail.vue
@@ -236,62 +236,11 @@ export default { @@ -236,62 +236,11 @@ export default {
236 }, 236 },
237 mounted () { 237 mounted () {
238 sessionStorage.removeItem('useCard') 238 sessionStorage.removeItem('useCard')
239 -  
240 this.courseId = this.$route.query.courseId; 239 this.courseId = this.$route.query.courseId;
241 - let publicName = this.$route.query.publicName || sessionStorage.getItem('publicName');  
242 - if (publicName) {  
243 - sessionStorage.setItem('publicName', publicName)  
244 - this.publicName = publicName  
245 - if (publicName == "XST") {  
246 - this.appId = 'wx1c630c8773c482f1'  
247 - } else if (publicName == "SXYX") {  
248 - this.appId = 'wx1305e88d2bc74073'  
249 - } else if (publicName == "KQ") {  
250 - this.appId = 'wx1305e88d2bc74073'  
251 - }  
252 - }else{  
253 - this.$toast.fail('请通过正确的途径访问')  
254 - return;  
255 - }  
256 - sessionStorage.setItem('prePage', 'ServiceAbroadDetail');  
257 - sessionStorage.setItem('prePageQuery', JSON.stringify({ courseId: this.courseId, publicName: this.publicName }));  
258 - if (process.env.NODE_ENV === "production" && this.common.isWeiXin()) {  
259 - let openId = sessionStorage.getItem('openId' + this.publicName);  
260 - if (!openId) {  
261 - this.$router.push({ name: 'Authorize' + this.publicName })  
262 - return;  
263 - }  
264 - this.unionId = sessionStorage.getItem('unionId');  
265 - this.getUserInfo()  
266 - } else {  
267 - this.unionId = 'oJPmPuLaAx2x2DaRGfCFeYuLWzLU';  
268 - this.getUserInfo()  
269 - } 240 + this.centerNo = sessionStorage.getItem('centerNo')
270 this.GetCourseDetail(); 241 this.GetCourseDetail();
271 }, 242 },
272 methods: { 243 methods: {
273 - // 获取用户信息  
274 - getUserInfo () {  
275 - let userInfo = sessionStorage.getItem('userInfo');  
276 - let unionId = sessionStorage.getItem('unionId');  
277 - if (userInfo) {  
278 - userInfo = JSON.parse(userInfo)  
279 - this.centerNo = userInfo.centerNo  
280 - } else {  
281 - this.$toast.loading({  
282 - message: '加载中...',  
283 - duration: 0,  
284 - forbidClick: true  
285 - })  
286 - this.yxAxios.get(`${this.proxyUrl}/prod/api/wx/${this.appId}/getUserInfo?unionId=${unionId}`).then((res) => {  
287 - this.$toast.clear()  
288 - if (res.data.code == 200) {  
289 - this.centerNo = res.data.data.centerNo  
290 - sessionStorage.setItem('userInfo', JSON.stringify(res.data.data))  
291 - }  
292 - })  
293 - }  
294 - },  
295 // 展开关闭院校简介 244 // 展开关闭院校简介
296 extend_btn () { 245 extend_btn () {
297 this.isOpen = !this.isOpen; 246 this.isOpen = !this.isOpen;
@@ -350,11 +299,20 @@ export default { @@ -350,11 +299,20 @@ export default {
350 duration: 0, 299 duration: 0,
351 forbidClick: true, 300 forbidClick: true,
352 }); 301 });
353 - this.yxAxios  
354 - .get(  
355 - `${this.yanxueUrl}/api/StudiesWap/GetCourseDetail?id=${this.courseId}&cs=绍兴市`  
356 - )  
357 - .then((res) => { 302 + this.mgop({
  303 + api: 'mgop.sz.hswsy.GetCourseDetail', // 必须
  304 + host: 'https://mapi.zjzwfw.gov.cn/',
  305 + dataType: 'JSON',
  306 + type: 'POST',
  307 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  308 + headers: {
  309 + // 'isTestUrl': '1'
  310 + },
  311 + data: {
  312 + "id":this.courseId,
  313 + "cs": "绍兴市",
  314 + },
  315 + onSuccess: res => {
358 this.$toast.clear(); 316 this.$toast.clear();
359 if (res.data.data && res.data.data.id !== 0) { 317 if (res.data.data && res.data.data.id !== 0) {
360 let detailData = res.data.data; 318 let detailData = res.data.data;
@@ -393,17 +351,28 @@ export default { @@ -393,17 +351,28 @@ export default {
393 } 351 }
394 this.$toast.fail(message) 352 this.$toast.fail(message)
395 } 353 }
396 - }); 354 + },
  355 + onFail: err => {
  356 + console.log('err', err)
  357 + }
  358 + });
397 }, 359 },
398 //获取商品可使用优惠券 360 //获取商品可使用优惠券
399 getOrderCoupon () { 361 getOrderCoupon () {
400 - this.yxAxios  
401 - .post(`${this.proxyUrl}/prod/api/coupon/orderCoupon`, {  
402 - proId: this.detailData.id,  
403 - userId: this.centerNo,  
404 - })  
405 - .then((res) => {  
406 - // console.log(res.data.data) 362 + this.mgop({
  363 + api: 'mgop.sz.hswsy.orderCoupon', // 必须
  364 + host: 'https://mapi.zjzwfw.gov.cn/',
  365 + dataType: 'JSON',
  366 + type: 'POST',
  367 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  368 + headers: {
  369 + // 'isTestUrl': '1'
  370 + },
  371 + data: {
  372 + "proId": this.detailData.id,
  373 + "userId": this.centerNo,
  374 + },
  375 + onSuccess: res => {
407 if (res.data.data) { 376 if (res.data.data) {
408 if (res.data.data.has.length > 0) { 377 if (res.data.data.has.length > 0) {
409 this.proCoupon = res.data.data.has 378 this.proCoupon = res.data.data.has
@@ -416,7 +385,11 @@ export default { @@ -416,7 +385,11 @@ export default {
416 } 385 }
417 } 386 }
418 } 387 }
419 - }); 388 + },
  389 + onFail: err => {
  390 + console.log('err', err)
  391 + }
  392 + });
420 }, 393 },
421 // 设置默认选中的优惠券 394 // 设置默认选中的优惠券
422 chooseDefaultUseCard (has) { 395 chooseDefaultUseCard (has) {
@@ -438,31 +411,47 @@ export default { @@ -438,31 +411,47 @@ export default {
438 }, 411 },
439 // 获取评价 412 // 获取评价
440 getEvaluationSummary () { 413 getEvaluationSummary () {
441 - this.yxAxios  
442 - .get(  
443 - `${this.yanxueUrl}/api/StudiesWap/Evaluation/Summary?courseId=${this.courseId}`)  
444 - .then((res) => {  
445 - console.log(res.data.data); 414 + this.mgop({
  415 + api: 'mgop.sz.hswsy.EvaluationSummary', // 必须
  416 + host: 'https://mapi.zjzwfw.gov.cn/',
  417 + dataType: 'JSON',
  418 + type: 'GET',
  419 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  420 + headers: {
  421 + // 'isTestUrl': '1'
  422 + },
  423 + data: {
  424 + "courseId": this.courseId,
  425 + },
  426 + onSuccess: res => {
446 if (res.data.data) { 427 if (res.data.data) {
447 this.evaluationData = res.data.data 428 this.evaluationData = res.data.data
448 } 429 }
449 - }); 430 + },
  431 + onFail: err => {
  432 + console.log('err', err)
  433 + }
  434 + });
450 }, 435 },
451 // 获取套餐列表 436 // 获取套餐列表
452 getPackageData () { 437 getPackageData () {
453 let startDate = this.Moment().format("YYYY-MM-DD"); 438 let startDate = this.Moment().format("YYYY-MM-DD");
454 let endDate = this.Moment().add(60, "days").format("YYYY-MM-DD"); 439 let endDate = this.Moment().add(60, "days").format("YYYY-MM-DD");
455 - this.yxAxios  
456 - .post(  
457 - `${this.yanxueUrl}/api/Product/DateComboBindList/ByTime/List`,  
458 - {  
459 - productId: this.detailData.id,  
460 - startDate: startDate,  
461 - endDate: endDate,  
462 - }  
463 - )  
464 - .then((res) => {  
465 - console.log(res.data.data); 440 + this.mgop({
  441 + api: 'mgop.sz.hswsy.DateComboBindList', // 必须
  442 + host: 'https://mapi.zjzwfw.gov.cn/',
  443 + dataType: 'JSON',
  444 + type: 'GET',
  445 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  446 + headers: {
  447 + // 'isTestUrl': '1'
  448 + },
  449 + data: {
  450 + "productId": this.detailData.id,
  451 + "startDate": startDate,
  452 + "endDate": endDate,
  453 + },
  454 + onSuccess: res => {
466 if (res.data.data) { 455 if (res.data.data) {
467 let allPackage = res.data.data; 456 let allPackage = res.data.data;
468 let usefulPackage = []; 457 let usefulPackage = [];
@@ -479,7 +468,11 @@ export default { @@ -479,7 +468,11 @@ export default {
479 ); 468 );
480 this.setPackageArr(); 469 this.setPackageArr();
481 } 470 }
482 - }); 471 + },
  472 + onFail: err => {
  473 + console.log('err', err)
  474 + }
  475 + });
483 }, 476 },
484 // 设置套餐价格 477 // 设置套餐价格
485 setPackageArr () { 478 setPackageArr () {
@@ -522,14 +515,27 @@ export default { @@ -522,14 +515,27 @@ export default {
522 }, 515 },
523 // 获取单个基地 516 // 获取单个基地
524 GetOneBase (baseId) { 517 GetOneBase (baseId) {
525 - this.yxAxios  
526 - .get(`${this.yanxueUrl}/api/Manage/GetOneBase?id=${baseId}`)  
527 - .then((res) => {  
528 - // console.log(res.data.data) 518 + this.mgop({
  519 + api: 'mgop.sz.hswsy.GetOneBase', // 必须
  520 + host: 'https://mapi.zjzwfw.gov.cn/',
  521 + dataType: 'JSON',
  522 + type: 'GET',
  523 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  524 + headers: {
  525 + // 'isTestUrl': '1'
  526 + },
  527 + data: {
  528 + "id": baseId,
  529 + },
  530 + onSuccess: res => {
529 if (res.data.data) { 531 if (res.data.data) {
530 this.baseData = res.data.data; 532 this.baseData = res.data.data;
531 } 533 }
532 - }); 534 + },
  535 + onFail: err => {
  536 + console.log('err', err)
  537 + }
  538 + });
533 }, 539 },
534 // 设置第几天的课程表 540 // 设置第几天的课程表
535 getWeekCard (index) { 541 getWeekCard (index) {
src/views/Service/AbroadEvaluate.vue
@@ -60,17 +60,33 @@ export default { @@ -60,17 +60,33 @@ export default {
60 }, 60 },
61 methods: { 61 methods: {
62 getEvaluationList (courseId) { 62 getEvaluationList (courseId) {
63 - this.yxAxios.get(`${this.yanxueUrl}/api/StudiesWap/Evaluation/List?courseId=${courseId}`).then((res) => {  
64 - this.$toast.clear();  
65 - if (res.data.status == 1) {  
66 - let list = res.data.data?.evaluationList;  
67 - for (let i in list) {  
68 - list[i].intime = this.Moment(list[i].intime).format("YYYY.MM.DD"); 63 + this.mgop({
  64 + api: 'mgop.sz.hswsy.EvaluationList', // 必须
  65 + host: 'https://mapi.zjzwfw.gov.cn/',
  66 + dataType: 'JSON',
  67 + type: 'GET',
  68 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  69 + headers: {
  70 + // 'isTestUrl': '1'
  71 + },
  72 + data: {
  73 + "courseId": courseId,
  74 + },
  75 + onSuccess: res => {
  76 + this.$toast.clear();
  77 + if (res.data.status == 1) {
  78 + let list = res.data.data?.evaluationList;
  79 + for (let i in list) {
  80 + list[i].intime = this.Moment(list[i].intime).format("YYYY.MM.DD");
  81 + }
  82 + this.list = list;
  83 + this.score = res.data.data?.shopScore
69 } 84 }
70 - this.list = list;  
71 - this.score = res.data.data?.shopScore 85 + },
  86 + onFail: err => {
  87 + console.log('err', err)
72 } 88 }
73 - }) 89 + });
74 }, 90 },
75 // 预览图片 91 // 预览图片
76 previewImg (url) { 92 previewImg (url) {
src/views/Service/CardBoxPublic.vue
@@ -1,164 +0,0 @@ @@ -1,164 +0,0 @@
1 -<template>  
2 - <div id="cardBox">  
3 - <div class="card_item" v-for="(item,index) in cardList" :key="index" @click="handleCard(index)">  
4 - <div class="left">  
5 - <div class="top">  
6 - <img v-if="item.img" :src="item.img" alt="">  
7 - <p class="title">仅该商品可用:<span>{{item.title}}</span></p>  
8 - </div>  
9 - <p class="end_time">有效期至:{{item.useEndTime}}</p>  
10 - </div>  
11 - <div class="right">  
12 - <p class="discount" :class="item.couponState==1?'':'disable'"><span>¥</span>{{item.couponPrice}}</p>  
13 - <p class="usenow" v-if="item.couponState==1">立即使用</p>  
14 - <p class="usenow disable" v-else>{{item.couponState==2?'已使用':'已过期'}}</p>  
15 - </div>  
16 - </div>  
17 - <van-empty v-if="cardList.length==0" description="暂无优惠券" />  
18 -  
19 - </div>  
20 -</template>  
21 -<script>  
22 -export default {  
23 - name: 'ServiceCardBoxPublic',  
24 - data () {  
25 - return {  
26 - cardList: [],  
27 - publicName: '',  
28 - unionId: ''  
29 - }  
30 - },  
31 - mounted () {  
32 - let publicName = this.$route.query.publicName || sessionStorage.getItem('publicName');  
33 - if (publicName) {  
34 - sessionStorage.setItem('publicName', publicName)  
35 - this.publicName = publicName  
36 - }  
37 - if (process.env.NODE_ENV === "production"&&this.common.isWeiXin()) {  
38 - let openId = sessionStorage.getItem('openId' + this.publicName);  
39 - if (!openId) {  
40 - sessionStorage.setItem('prePage', 'ServiceCardBoxPublic');  
41 - this.$router.push({ name: 'Authorize' + this.publicName })  
42 - return;  
43 - }  
44 - this.unionId = sessionStorage.getItem('unionId');  
45 - } else {  
46 - this.unionId = 'oJPmPuLaAx2x2DaRGfCFeYuLWzLU';  
47 - }  
48 -  
49 - this.$nextTick(() => {  
50 - this.getAllCard()  
51 - })  
52 - },  
53 - methods: {  
54 - // 获取所有优惠券  
55 - getAllCard () {  
56 - this.yxAxios.post(`${this.proxyUrl}/prod/api/coupon/list`, {  
57 - userId: this.unionId,  
58 - state: '',//状态 1-正常 2-已使用 3-已过期 不传为全部,  
59 - pageNum: '1',  
60 - pageSize: '999'  
61 - }).then((res) => {  
62 - if (res.data.rows) {  
63 - let cardList = res.data.rows  
64 - for (let i in cardList) {  
65 - cardList[i].useEndTime = this.Moment(cardList[i].useEndTime.replace(/\-/g, "/")).format("YYYY-MM-DD")  
66 - }  
67 - this.cardList = cardList  
68 - }  
69 - else {  
70 - this.$toast.fail(res.data.message);  
71 - }  
72 - })  
73 - },  
74 - handleCard (index) {  
75 - if (this.cardList[index].couponState == 1) {  
76 - this.$router.push({ name: 'ServiceAbroadDetail', query: { courseId: 499 } })  
77 - }  
78 - },  
79 - }  
80 -}  
81 -</script>  
82 -<style lang="scss" scoped>  
83 -#cardBox {  
84 - width: 100%;  
85 - min-height: 100%;  
86 - background: rgb(246, 246, 250);  
87 - overflow: hidden;  
88 - .card_item {  
89 - width: 726px;  
90 - height: 216px;  
91 - background: url("../../assets/service/card.png");  
92 - background-size: 100%;  
93 - margin: 0 auto;  
94 - margin-top: 20px;  
95 - position: relative;  
96 - p {  
97 - width: 100%;  
98 - margin: 0;  
99 - }  
100 - .left {  
101 - display: inline-block;  
102 - width: 68%;  
103 - height: 100%;  
104 - vertical-align: top;  
105 - box-sizing: border-box;  
106 - padding: 24px 40px;  
107 - padding-right: 0;  
108 - .top {  
109 - display: flex;  
110 - img {  
111 - width: 66px;  
112 - height: 66px;  
113 - background: #d8d8d8;  
114 - border-radius: 6px;  
115 - }  
116 - .title {  
117 - font-size: 24px;  
118 - font-weight: bold;  
119 - margin-left: 10px;  
120 - word-break: break-all;  
121 - span {  
122 - color: #7f5316;  
123 - }  
124 - }  
125 - }  
126 - }  
127 - .right {  
128 - width: 32%;  
129 - height: 100%;  
130 - display: inline-flex;  
131 - align-content: center;  
132 - flex-wrap: wrap;  
133 - position: relative;  
134 - }  
135 - .end_time {  
136 - font-size: 24px;  
137 - color: #999;  
138 - left: 40px;  
139 - position: absolute;  
140 - bottom: 30px;  
141 - }  
142 - .discount {  
143 - text-align: center;  
144 - font-size: 60px;  
145 - font-weight: bold;  
146 - span {  
147 - font-size: 24px;  
148 - }  
149 - &.disable {  
150 - color: #999;  
151 - }  
152 - }  
153 - .usenow {  
154 - font-size: 32px;  
155 - text-align: center;  
156 - font-weight: bold;  
157 - margin-top: 10px;  
158 - &.disable {  
159 - color: #999;  
160 - }  
161 - }  
162 - }  
163 -}  
164 -</style>  
165 \ No newline at end of file 0 \ No newline at end of file
src/views/Service/CardCourseList.vue
@@ -67,7 +67,38 @@ export default { @@ -67,7 +67,38 @@ export default {
67 duration: 0, 67 duration: 0,
68 forbidClick: true, 68 forbidClick: true,
69 }); 69 });
70 - this.yxAxios.post(`${this.yanxueUrl}/api/StudiesWap/CourseList/ByIdList`, this.proId.split(',')).then((res) => { 70 + // this.mgop({
  71 + // api: 'mgop.sz.hswsy.CourseListByIdList', // 必须
  72 + // host: 'https://mapi.zjzwfw.gov.cn/',
  73 + // dataType: 'JSON',
  74 + // type: 'POST',
  75 + // appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  76 + // headers: {
  77 + // // 'isTestUrl': '1'
  78 + // },
  79 + // data: {idList:["1502","1524","1551","1570","1572"]},
  80 + // onSuccess: res => {
  81 + // this.$toast.clear();
  82 + // let proList = res.data.data;
  83 + // for (let i in proList) {
  84 + // proList[i].course_labels = proList[i].course_labels?.split(',');
  85 + // proList[i].coverUrl = proList[i]?.coverList[0]?.cover_url
  86 + // if (proList[i].startDate) {
  87 + // proList[i].week = this.formatWeek(this.Moment(proList[i].startDate).format('d'));
  88 + // proList[i].startDate = this.Moment(proList[i].startDate).format('YYYY.M.D');
  89 + // proList[i].endDate = this.Moment(proList[i].endDate).format('YYYY.M.D');
  90 + // }
  91 + // }
  92 + // console.log(proList)
  93 + // this.proList = proList
  94 + // },
  95 + // onFail: err => {
  96 + // console.log('err', err)
  97 + // }
  98 + // });
  99 + this.yxAxios.post(`https://yanxue.myjxt.com/api/StudiesWap/CourseList/ByIdList`, {
  100 + idList:this.proId
  101 + }).then((res) => {
71 this.$toast.clear(); 102 this.$toast.clear();
72 let proList = res.data.data; 103 let proList = res.data.data;
73 for (let i in proList) { 104 for (let i in proList) {
@@ -90,15 +121,23 @@ export default { @@ -90,15 +121,23 @@ export default {
90 //领取优惠券 121 //领取优惠券
91 reCard () { 122 reCard () {
92 if (this.geted) return; 123 if (this.geted) return;
93 - this.yxAxios.post(`${this.proxyUrl}/prod/api/coupon/get`, {  
94 - unionId: this.unionId,  
95 - "proId": this.proId,  
96 - "proName": this.proName,  
97 - "pic": this.pics,  
98 - couponId: this.cardId,  
99 - })  
100 - .then((res) => {  
101 - // console.log(res.data) 124 + this.mgop({
  125 + api: 'mgop.sz.hswsy.CouponGet', // 必须
  126 + host: 'https://mapi.zjzwfw.gov.cn/',
  127 + dataType: 'JSON',
  128 + type: 'POST',
  129 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  130 + headers: {
  131 + // 'isTestUrl': '1'
  132 + },
  133 + data: {
  134 + "unionId": sessionStorage.getItem('centerNo'),
  135 + "proId": this.proId,
  136 + "proName": this.proName,
  137 + "pic": this.pics,
  138 + "couponId": this.cardId,
  139 + },
  140 + onSuccess: res => {
102 if (res.data.code == 200) { 141 if (res.data.code == 200) {
103 sessionStorage.setItem('cardCousreGeted', true) 142 sessionStorage.setItem('cardCousreGeted', true)
104 this.geted = true; 143 this.geted = true;
@@ -106,7 +145,11 @@ export default { @@ -106,7 +145,11 @@ export default {
106 } else { 145 } else {
107 this.$toast.fail(res.data.message); 146 this.$toast.fail(res.data.message);
108 } 147 }
109 - }) 148 + },
  149 + onFail: err => {
  150 + console.log('err', err)
  151 + }
  152 + });
110 153
111 }, 154 },
112 onConfirm (item) { 155 onConfirm (item) {
src/views/Service/CardSelect.vue
@@ -31,18 +31,9 @@ export default { @@ -31,18 +31,9 @@ export default {
31 return { 31 return {
32 cardList: [], 32 cardList: [],
33 selectIndex: -1, 33 selectIndex: -1,
34 - unionId: ''  
35 } 34 }
36 }, 35 },
37 mounted () { 36 mounted () {
38 - if (process.env.NODE_ENV === "production"&&this.common.isWeiXin()) {  
39 - this.unionId = sessionStorage.getItem('unionId');  
40 - } else {  
41 - this.unionId = 'oJPmPuLaAx2x2DaRGfCFeYuLWzLU';  
42 - }  
43 - // this.$nextTick(() => {  
44 - // this.getOrderCoupon()  
45 - // })  
46 let cardList = sessionStorage.getItem('proCoupon') 37 let cardList = sessionStorage.getItem('proCoupon')
47 if (cardList) { 38 if (cardList) {
48 this.cardList = JSON.parse(cardList) 39 this.cardList = JSON.parse(cardList)
src/views/Service/CheckOrder.vue
@@ -65,7 +65,6 @@ export default { @@ -65,7 +65,6 @@ export default {
65 showCourseData: '',//当前课程的信息 65 showCourseData: '',//当前课程的信息
66 selectCombo: '',//已选择的套餐 66 selectCombo: '',//已选择的套餐
67 publicName: '', 67 publicName: '',
68 - openId: '',//支付用  
69 userInfo: '',//支付用 68 userInfo: '',//支付用
70 appId: '', 69 appId: '',
71 selectedContactArr: [],//选择的出行人 70 selectedContactArr: [],//选择的出行人
@@ -84,18 +83,6 @@ export default { @@ -84,18 +83,6 @@ export default {
84 this.appId = 'wx1305e88d2bc74073' 83 this.appId = 'wx1305e88d2bc74073'
85 } 84 }
86 } 85 }
87 - let openId = sessionStorage.getItem('openId' + this.publicName);  
88 -  
89 - if (process.env.NODE_ENV === "production"&&this.common.isWeiXin()) {  
90 - if (!openId) {  
91 - sessionStorage.setItem('prePage', 'ServiceCheckOrder');  
92 - this.$router.push({ name: 'Authorize' + this.publicName })  
93 - return;  
94 - } else {  
95 - this.openId = openId;  
96 - }  
97 - }  
98 -  
99 let userInfo = sessionStorage.getItem('userInfo'); 86 let userInfo = sessionStorage.getItem('userInfo');
100 if (userInfo) { 87 if (userInfo) {
101 this.userInfo = JSON.parse(userInfo); 88 this.userInfo = JSON.parse(userInfo);
@@ -168,32 +155,37 @@ export default { @@ -168,32 +155,37 @@ export default {
168 this.$toast.fail('请先阅读并同意用户协议'); 155 this.$toast.fail('请先阅读并同意用户协议');
169 return; 156 return;
170 } 157 }
171 - this.yxAxios.post(`${this.yanxueUrl}/api/Manage/AddOrderPay`, {  
172 - courseId: this.showCourseData.id,  
173 - payway: 2,  
174 - paymoney: this.paymoney,//时段个数*单价*人数-优惠券  
175 - userId: this.userInfo?.centerNo,//升学汇和其他端接口字段不同  
176 - orderCount: this.count,//人数  
177 - orderTime: this.date,//时段集合 2018-10-15  
178 - comboId: this.selectCombo.id,  
179 - dateBindComboId: this.selectCombo.dateBindComboId,  
180 - unionId: this.userInfo?.centerNo,  
181 - // unionId: this.userInfo?.unionId,  
182 - price: this.selectCombo.actualPrice * 1000 * this.count / 1000,//商品减掉优惠券之前的价格  
183 - travelNum: this.selectedContact,//出行人编号  
184 - couponId: this.useCard?.id || 0,  
185 - appId:this.appId  
186 - }).then(res => {  
187 - console.log(res.data)  
188 - if (res.data.data) { 158 + this.mgop({
  159 + api: 'mgop.sz.hswsy.AddOrderPay', // 必须
  160 + host: 'https://mapi.zjzwfw.gov.cn/',
  161 + dataType: 'JSON',
  162 + type: 'POST',
  163 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  164 + headers: {
  165 + // 'isTestUrl': '1'
  166 + },
  167 + data: {
  168 + "courseId": this.showCourseData.id,
  169 + "payway": 2,
  170 + "paymoney": this.paymoney,//时段个数*单价*人数-优惠券
  171 + "userId": this.userInfo?.centerNo,//升学汇和其他端接口字段不同
  172 + "orderCount": this.count,//人数
  173 + "orderTime": this.date,//时段集合 2018-10-15
  174 + "comboId": this.selectCombo.id,
  175 + "dateBindComboId": this.selectCombo.dateBindComboId,
  176 + "unionId": this.userInfo?.centerNo,
  177 + "price": this.selectCombo.actualPrice * 1000 * this.count / 1000,//商品减掉优惠券之前的价格
  178 + "travelNum": this.selectedContact,//出行人编号
  179 + "couponId": this.useCard?.id || 0,
  180 + "appId": this.appId
  181 + },
  182 + onSuccess: res => {
  183 + if (res.data.data) {
189 if (this.paymoney == 0) { 184 if (this.paymoney == 0) {
190 // 使用后移除优惠券,防止返回继续使用 185 // 使用后移除优惠券,防止返回继续使用
191 sessionStorage.removeItem('useCard') 186 sessionStorage.removeItem('useCard')
192 - if (this.publicName == 'SXYX' || this.publicName == 'XST' || this.publicName == 'KQ') {  
193 this.$router.push({ name: 'ServiceOrderXST', query: { active: 1, showChatGroupUrl: 1 } }) 187 this.$router.push({ name: 'ServiceOrderXST', query: { active: 1, showChatGroupUrl: 1 } })
194 - } else {  
195 - this.$router.push({ name: 'ServiceOrderPublic' })  
196 - } 188 +
197 } else { 189 } else {
198 // 使用后移除优惠券,防止返回继续使用 190 // 使用后移除优惠券,防止返回继续使用
199 sessionStorage.removeItem('useCard') 191 sessionStorage.removeItem('useCard')
@@ -204,29 +196,26 @@ export default { @@ -204,29 +196,26 @@ export default {
204 this.$toast.fail(res.data?.result); 196 this.$toast.fail(res.data?.result);
205 } 197 }
206 198
207 - }) 199 + },
  200 + onFail: err => {
  201 + console.log('err', err)
  202 + }
  203 + });
208 }, 204 },
209 openPay (data) { 205 openPay (data) {
210 let that = this; 206 let that = this;
211 - if (!this.openId) {  
212 - this.$toast.fail('没有获取到当前用户信息,请通过正确的渠道访问');  
213 - return;  
214 - }  
215 - console.log('openId =', this.openId)  
216 - 207 + alert('支付')
  208 + return;
  209 +
217 Axios({ 210 Axios({
218 - // url: this.proxyUrl + '/sxh/order/orderCenter',  
219 211
220 - url: this.proxyUrl + '/prod/api/wx/pay/' + this.appId + '/1614900216', 212 + url: 'https://proxy.shunzhi.net/prod/api/wx/pay/' + this.appId + '/1614900216',
221 method: 'post', 213 method: 'post',
222 - // headers: { 'Content-Type': 'application/x-www-form-urlencoded' },  
223 headers: { 'Content-Type': 'application/json;charset=UTF-8' }, 214 headers: { 'Content-Type': 'application/json;charset=UTF-8' },
224 - // data: Qs.stringify({  
225 data: { 215 data: {
226 - notify_url: `${this.yanxueUrl}/api/Manage/WxBackInfo`,  
227 - body: this.showCourseData.course_name+'_'+this.date, 216 + notify_url: `https://yanxue.myjxt.com/api/Manage/WxBackInfo`,
  217 + body: this.showCourseData.course_name + '_' + this.date,
228 openId: this.openId, //'oHHbojor4C_gR96lxxFUeYTrY0Uc' 218 openId: this.openId, //'oHHbojor4C_gR96lxxFUeYTrY0Uc'
229 - // openId: 'oQTiTjhDkusbSi-rgJ5nMey3IsPw', //'oHHbojor4C_gR96lxxFUeYTrY0Uc'  
230 outTradeNo: data.trade_no, //订单号 219 outTradeNo: data.trade_no, //订单号
231 productId: this.showCourseData.id, //商品id 220 productId: this.showCourseData.id, //商品id
232 totalFee: this.paymoney * 100, //钱 221 totalFee: this.paymoney * 100, //钱
src/views/Service/DatePackage.vue
@@ -95,23 +95,55 @@ export default { @@ -95,23 +95,55 @@ export default {
95 // 获取库存 95 // 获取库存
96 GetOrderPayCount () { 96 GetOrderPayCount () {
97 let showCourseData = JSON.parse(sessionStorage.getItem('showCourseData')) 97 let showCourseData = JSON.parse(sessionStorage.getItem('showCourseData'))
98 - this.yxAxios.get(`${this.yanxueUrl}/api/Product/OrderPayCount/ByBindId?productId=${showCourseData.id}&startDate=${this.date}`).then((res) => {  
99 - if (res.data) { 98 + this.mgop({
  99 + api: 'mgop.sz.hswsy.OrderPayCount', // 必须
  100 + host: 'https://mapi.zjzwfw.gov.cn/',
  101 + dataType: 'JSON',
  102 + type: 'GET',
  103 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  104 + headers: {
  105 + // 'isTestUrl': '1'
  106 + },
  107 + data: {
  108 + "productId": showCourseData.id,
  109 + "startDate": this.date,
  110 + },
  111 + onSuccess: res => {
  112 + if (res.data.data) {
100 this.numOne = res.data.data 113 this.numOne = res.data.data
101 - // console.log(this.numOne) 114 + }
  115 + },
  116 + onFail: err => {
  117 + console.log('err', err)
102 } 118 }
103 - }) 119 + });
104 }, 120 },
105 // 获取库存第二个参数 121 // 获取库存第二个参数
106 getSurplusComboCount (bindId) { 122 getSurplusComboCount (bindId) {
107 let showCourseData = JSON.parse(sessionStorage.getItem('showCourseData')) 123 let showCourseData = JSON.parse(sessionStorage.getItem('showCourseData'))
108 - this.yxAxios.get(`${this.yanxueUrl}/api/Product/SurplusComboCount/ByBindId?bindId=${bindId}&productId=${showCourseData.id}&startDate=${this.date}`).then((res) => {  
109 - if (res.data) { 124 + this.mgop({
  125 + api: 'mgop.sz.hswsy.SurplusComboCount', // 必须
  126 + host: 'https://mapi.zjzwfw.gov.cn/',
  127 + dataType: 'JSON',
  128 + type: 'GET',
  129 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  130 + headers: {
  131 + // 'isTestUrl': '1'
  132 + },
  133 + data: {
  134 + "bindId": bindId,
  135 + "productId": showCourseData.id,
  136 + "startDate": this.date,
  137 + },
  138 + onSuccess: res => {
  139 + if (res.data.data) {
110 this.numSecond = res.data.data 140 this.numSecond = res.data.data
111 - // console.log(this.numSecond) 141 + }
  142 + },
  143 + onFail: err => {
  144 + console.log('err', err)
112 } 145 }
113 - })  
114 - 146 + });
115 }, 147 },
116 // 选择排期 148 // 选择排期
117 choosePeriod (index) { 149 choosePeriod (index) {
src/views/Service/EditContact.vue
@@ -90,15 +90,29 @@ export default { @@ -90,15 +90,29 @@ export default {
90 duration: 0, 90 duration: 0,
91 forbidClick: true 91 forbidClick: true
92 }) 92 })
93 - this.yxAxios.post(`${this.proxyUrl}/prod/user/info/addContacts`, postData).then((res) => {  
94 - this.$toast.clear()  
95 - if (res.data.code == 200) {  
96 - this.$toast.success('完善成功')  
97 - this.$router.back()  
98 - } else {  
99 - this.$toast.fail(res.message) 93 + this.mgop({
  94 + api: 'mgop.sz.hswsy.addContacts', // 必须
  95 + host: 'https://mapi.zjzwfw.gov.cn/',
  96 + dataType: 'JSON',
  97 + type: 'GET',
  98 + appKey: 'fuxgnukl+2001895516+edccpx', // 必须
  99 + headers: {
  100 + // 'isTestUrl': '1'
  101 + },
  102 + data: postData,
  103 + onSuccess: res => {
  104 + this.$toast.clear()
  105 + if (res.data.code == 200) {
  106 + this.$toast.success('完善成功')
  107 + this.$router.back()
  108 + } else {
  109 + this.$toast.fail(res.message)
  110 + }
  111 + },
  112 + onFail: err => {
  113 + console.log('err', err)
100 } 114 }
101 - }) 115 + });
102 }, 116 },
103 checkPhone (phone) { 117 checkPhone (phone) {
104 if ((/^1[3456789]\d{9}$/.test(phone))) { 118 if ((/^1[3456789]\d{9}$/.test(phone))) {
src/views/Service/LoginPublic.vue
@@ -1,234 +0,0 @@ @@ -1,234 +0,0 @@
1 -<template>  
2 - <div id="login">  
3 - <img class="bg" src="@/assets/login_bg.png" alt="">  
4 - <div class="box">  
5 - <p class="login_title">绑定手机号</p>  
6 - <div class="item">  
7 - <p class="title">手机号</p>  
8 - <div class="flex">  
9 - <input class="code phone" type="tel" maxlength="11" v-model="phone" placeholder="请输入您的手机号">  
10 - <span class="getcode" @click="getCode">{{codeText}}</span>  
11 - </div>  
12 - </div>  
13 - <div class="item">  
14 - <p class="title">验证码</p>  
15 - <input class="code" type="text" v-model="code" placeholder="请输入验证码">  
16 - </div>  
17 - <button class="submit" @click="submitOperator">立即绑定</button>  
18 - </div>  
19 - </div>  
20 -</template>  
21 -<script>  
22 -var codeInterval;  
23 -export default {  
24 - name: 'LoginPublic',  
25 - data () {  
26 - return {  
27 - code: '',  
28 - phone: '',  
29 -  
30 - codeText: '获取验证码',//获取验证码按钮文字  
31 - appId: '',  
32 - unionId: '',  
33 - openId: '',  
34 - prefectId: '',  
35 - publicName: '',//SXYX绍兴研学 XST学事通  
36 - }  
37 - },  
38 - mounted () {  
39 - let publicName = this.$route.query.publicName || sessionStorage.getItem('publicName');  
40 - if (publicName == 'SXYX') {  
41 - this.appId = 'wx1305e88d2bc74073'  
42 - } else if (publicName == 'XST') {  
43 - this.appId = 'wx1c630c8773c482f1'  
44 - } else if (publicName == 'KQ') {  
45 - this.appId = 'wx1305e88d2bc74073'  
46 - }  
47 - this.openId = sessionStorage.getItem('openId' + publicName);  
48 - this.unionId = sessionStorage.getItem('unionId');  
49 - if (process.env.NODE_ENV === "production"&&this.common.isWeiXin()) {  
50 - if (!this.openId) {  
51 - this.$router.push({ name: 'Authorize' + publicName })  
52 - }  
53 - }  
54 -  
55 - },  
56 - methods: {  
57 - getCode () {  
58 - if (this.codeText != '获取验证码') return;  
59 - if (!this.phone) {  
60 - this.$toast('请输入手机号')  
61 - return;  
62 - }  
63 - if (!this.checkPhone(this.phone)) {  
64 - this.$toast('请输入正确的手机号')  
65 - return;  
66 - }  
67 - this.$toast.loading({  
68 - message: '加载中',  
69 - duration: 0,  
70 - forbidClick: true  
71 - })  
72 - this.yxAxios.post(`${this.proxyUrl}/prod/api/wx/${this.appId}/getMsg?phone=${this.phone}`).then((res) => {  
73 - this.$toast.clear()  
74 - if (res.data.code == 200) {  
75 - let i = 60;  
76 - codeInterval = setInterval(() => {  
77 - if (i == 0) {  
78 - this.codeText = `获取验证码`;  
79 - clearInterval(codeInterval);  
80 - return;  
81 - }  
82 - this.codeText = `重试(${i})`;  
83 - i--  
84 - }, 1000)  
85 - } else {  
86 - this.$toast.fail(res.data.message)  
87 - }  
88 - })  
89 - },  
90 - submitOperator () {  
91 - if (!this.phone) {  
92 - this.$toast('请输入手机号')  
93 - return;  
94 - }  
95 - if (!this.checkPhone(this.phone)) {  
96 - this.$toast('请输入正确的手机号')  
97 - return;  
98 - }  
99 - if (!this.code) {  
100 - this.$toast('请输入验证码')  
101 - return;  
102 - }  
103 - this.$toast.loading({  
104 - message: '加载中',  
105 - duration: 0,  
106 - forbidClick: true  
107 - })  
108 - this.yxAxios.post(`${this.proxyUrl}/prod/api/wx/${this.appId}/checkPhoneAndCode`, {  
109 - phone: this.phone,  
110 - code: this.code,  
111 - unionId: this.unionId,  
112 - openId: this.openId  
113 - }).then((res) => {  
114 - this.$toast.clear()  
115 - if (res.data.code == 200) {  
116 - this.getUserInfo()  
117 - } else {  
118 - this.$toast.fail(res.data.message)  
119 - }  
120 - })  
121 - },  
122 - checkPhone (phone) {  
123 - if ((/^1[3456789]\d{9}$/.test(phone))) {  
124 - return true  
125 - } else {  
126 - return false  
127 - }  
128 - },  
129 - complete () {  
130 - this.getUserInfo()  
131 - },  
132 - // 获取用户信息  
133 - getUserInfo () {  
134 - this.$toast.loading({  
135 - message: '加载中...',  
136 - duration: 0,  
137 - forbidClick: true  
138 - })  
139 - this.yxAxios.get(`${this.proxyUrl}/prod/api/wx/${this.appId}/getUserInfo?unionId=${this.unionId}`).then((res) => {  
140 - this.$toast.clear()  
141 - if (res.data.code == 200) {  
142 - sessionStorage.setItem('userInfo', JSON.stringify(res.data.data))  
143 - let prePage = sessionStorage.getItem('prePage');  
144 - let prePageQuery = sessionStorage.getItem('prePageQuery');  
145 - if (prePage) {  
146 - this.$router.push({ name: prePage, query: JSON.parse(prePageQuery) })  
147 - }  
148 - } else {  
149 - this.$toast.fail(res.data.message)  
150 - }  
151 - })  
152 - },  
153 - },  
154 - destroyed () {  
155 - clearInterval(codeInterval);  
156 - }  
157 -}  
158 -</script>  
159 -<style lang="scss" scoped>  
160 -#login {  
161 - .bg {  
162 - width: 100%;  
163 - }  
164 - .login_title {  
165 - font-size: 36px;  
166 - font-weight: bold;  
167 - text-align: center;  
168 - color: #000;  
169 - padding-bottom: 40px;  
170 - }  
171 - .box {  
172 - width: 702px;  
173 - height: 540px;  
174 - background: linear-gradient(  
175 - 180deg,  
176 - rgba(251, 251, 251, 0.99) 0%,  
177 - #ffffff 100%  
178 - );  
179 - box-shadow: 0px 4px 12px 0px rgba(87, 214, 255, 0.2);  
180 - border-radius: 20px;  
181 - position: absolute;  
182 - top: 240px;  
183 - left: 24px;  
184 - box-sizing: border-box;  
185 - padding: 40px;  
186 - .item {  
187 - border-bottom: 1px solid #e2e2e2;  
188 - margin-bottom: 30px;  
189 - }  
190 - .title {  
191 - font-size: 34px;  
192 - font-weight: bold;  
193 - margin-bottom: 28px;  
194 - }  
195 - .flex {  
196 - display: flex;  
197 - align-items: center;  
198 - justify-content: space-between;  
199 - margin-bottom: 22px;  
200 - }  
201 - .code {  
202 - border: 0;  
203 - background: transparent;  
204 - font-size: 28px;  
205 - margin-bottom: 32px;  
206 - width: 100%;  
207 - }  
208 - .phone {  
209 - width: 50%;  
210 - margin: 0;  
211 - }  
212 - .getcode {  
213 - color: #5789ff;  
214 - font-size: 28px;  
215 - padding: 10px;  
216 - }  
217 - .submit {  
218 - width: 622px;  
219 - height: 88px;  
220 - background: linear-gradient(137deg, #83b2ff 0%, #3c80ef 100%);  
221 - box-shadow: 0px 4px 8px 0px rgba(87, 169, 255, 0.5);  
222 - border-radius: 44px;  
223 - border: 0;  
224 - font-size: 34px;  
225 - color: #ffffff;  
226 - margin: 0 auto;  
227 - display: block;  
228 - }  
229 - }  
230 -}  
231 -.prefect_pop {  
232 - background: transparent;  
233 -}  
234 -</style>  
235 \ No newline at end of file 0 \ No newline at end of file
src/views/Service/ServiceBaseKQ.vue
@@ -368,7 +368,24 @@ export default { @@ -368,7 +368,24 @@ export default {
368 }, 368 },
369 // 我的优惠券 369 // 我的优惠券
370 handleMyCard () { 370 handleMyCard () {
371 - this.$router.push({ name: 'ServiceCardBoxPublic' }) 371 + let isLogin = this.checkLogin()
  372 + if (!isLogin) return;
  373 + const publicName = sessionStorage.getItem('publicName')
  374 + // this.$toast('暂未开放,敬请期待!');
  375 + this.$router.push({ name: 'CardBoxXST', query: { active: 1, publicName: publicName } })
  376 + },
  377 + // 判断是否已登录
  378 + checkLogin () {
  379 + if (process.env.NODE_ENV != "production") return true;
  380 + const userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
  381 + if (!userInfo?.phone) {
  382 + const publicName = sessionStorage.getItem('publicName')
  383 + sessionStorage.setItem('prePage', 'Service' + publicName);
  384 + sessionStorage.setItem('prePageQuery', JSON.stringify({ showTab: this.$route.query.showTab }));
  385 + this.$router.push({ name: 'LoginPublic', query: { publicName: publicName } })
  386 + return false;
  387 + }
  388 + return true;
372 }, 389 },
373 formatWeek (week) { 390 formatWeek (week) {
374 return week == 1 ? '周一' : week == 2 ? '周二' : week == 3 ? '周三' : week == 4 ? '周四' : week == 5 ? '周五' : week == 6 ? '周六' : week == 0 ? '周日' : ''; 391 return week == 1 ? '周一' : week == 2 ? '周二' : week == 3 ? '周三' : week == 4 ? '周四' : week == 5 ? '周五' : week == 6 ? '周六' : week == 0 ? '周日' : '';
src/views/Service/evaluatePubilc.vue
@@ -45,7 +45,6 @@ @@ -45,7 +45,6 @@
45 </template> 45 </template>
46 46
47 <script> 47 <script>
48 -import yxAxios from '@/https/yxAxios'  
49 import { imgCut } from 'vue-imgcut' 48 import { imgCut } from 'vue-imgcut'
50 export default { 49 export default {
51 data () { 50 data () {