Commit d4165af327ae22b734623dd731fcd83e64cb220d
1 parent
1cefbb34
Exists in
master
feat:测试数据删除
Showing
4 changed files
with
765 additions
and
138 deletions
Show diff stats
src/views/Home.vue
... | ... | @@ -109,7 +109,7 @@ import Background from '../components/Background.vue' |
109 | 109 | import AllLoveGo from '../components/AllLoveGo.vue' |
110 | 110 | import AboutDes from './aboutDes.vue' |
111 | 111 | import './home.scss' |
112 | -const userData = require('@/views/data.json') | |
112 | +// const userData = require('@/views/data.json') | |
113 | 113 | export default { |
114 | 114 | components: { |
115 | 115 | CourseList, |
... | ... | @@ -244,13 +244,11 @@ export default { |
244 | 244 | window.location.href = `https://puser.zjzwfw.gov.cn/sso/alipay.do?action=ssoLogin&servicecode=8301b7fe71594245b97560ff841db1f2` |
245 | 245 | } else { |
246 | 246 | // alert('非浙里办渠道访问,显示测试用户数据') |
247 | - console.log('非浙里办渠道访问,显示测试用户数据', userData) | |
248 | - this.centerNo = '2022031508525674030748540013076' | |
249 | - localStorage.setItem('centerNo', '2022031508525674030748540013076') | |
250 | - localStorage.setItem('centerNoTime', new Date().getTime()) | |
251 | - let userInfo = JSON.stringify(userData) | |
252 | - localStorage.setItem('userInfo', userInfo) | |
253 | - this.getUserInfo() | |
247 | + // console.log('非浙里办渠道访问,显示测试用户数据', userData) | |
248 | + // localStorage.setItem('centerNoTime', new Date().getTime()) | |
249 | + // let userInfo = JSON.stringify(userData) | |
250 | + // localStorage.setItem('userInfo', userInfo) | |
251 | + // this.getUserInfo() | |
254 | 252 | } |
255 | 253 | } |
256 | 254 | }, | ... | ... |
src/views/data.json
... | ... | @@ -1,130 +0,0 @@ |
1 | -{ | |
2 | - "nickName": null, | |
3 | - "travelerName": "夏洋涛", | |
4 | - "phone": "17858500169", | |
5 | - "centerNo": "2022031508525674030748540013076", | |
6 | - "idCard": "330881199606054935", | |
7 | - "thirdSource": 1, | |
8 | - "unionId": "oJPmPuLaAx2x2DaRGfCFeYuLWzLU", | |
9 | - "userState": null, | |
10 | - "userType": 2, | |
11 | - "gender": 1, | |
12 | - "isMember": 2, | |
13 | - "subUsers": [{ | |
14 | - "id": 49238, | |
15 | - "travelerName": "xia", | |
16 | - "travelerIdCard": "330881199606054935", | |
17 | - "travelerNum": "2022042515320607668704830046683", | |
18 | - "travelerMobile": "17858500169", | |
19 | - "travelerType": 0, | |
20 | - "enrollYear": "2016", | |
21 | - "age": null, | |
22 | - "gender": 1, | |
23 | - "channelCode": null, | |
24 | - "unionId": null, | |
25 | - "province": "浙江省", | |
26 | - "city": "温州市", | |
27 | - "area": "瓯海区", | |
28 | - "schoolName": "温州市第二十一中学", | |
29 | - "gradeName": "1班", | |
30 | - "className": "1班", | |
31 | - "whiteFlag": 1, | |
32 | - "studyCode": null, | |
33 | - "userState": 1, | |
34 | - "userType": 1, | |
35 | - "memberId": null, | |
36 | - "bingMobile": "17858500169", | |
37 | - "isBing": 1, | |
38 | - "ssoId": null, | |
39 | - "sex": null, | |
40 | - "pass": null, | |
41 | - "syncTime": "2022-04-25T15:32:06.250+08:00", | |
42 | - "updateTime": "2022-04-28T11:09:57.667+08:00" | |
43 | - }, { | |
44 | - "id": 52229, | |
45 | - "travelerName": "林淡", | |
46 | - "travelerIdCard": "331081198803306735", | |
47 | - "travelerNum": "2022050615163709304353550045179", | |
48 | - "travelerMobile": "15168313607", | |
49 | - "travelerType": null, | |
50 | - "enrollYear": null, | |
51 | - "age": null, | |
52 | - "gender": 1, | |
53 | - "channelCode": null, | |
54 | - "unionId": null, | |
55 | - "province": null, | |
56 | - "city": null, | |
57 | - "area": null, | |
58 | - "schoolName": null, | |
59 | - "gradeName": null, | |
60 | - "className": null, | |
61 | - "whiteFlag": null, | |
62 | - "studyCode": null, | |
63 | - "userState": 1, | |
64 | - "userType": 2, | |
65 | - "memberId": null, | |
66 | - "bingMobile": "13989547857,17858500169", | |
67 | - "isBing": 1, | |
68 | - "ssoId": null, | |
69 | - "sex": null, | |
70 | - "pass": null, | |
71 | - "syncTime": "2022-05-06T15:16:37.933+08:00", | |
72 | - "updateTime": "2022-05-06T15:23:51.297+08:00" | |
73 | - }, { | |
74 | - "id": 52230, | |
75 | - "travelerName": "林珈逸", | |
76 | - "travelerIdCard": "330602201507040021", | |
77 | - "travelerNum": "2022050615244927688271930045180", | |
78 | - "travelerMobile": "15168313607", | |
79 | - "travelerType": 1, | |
80 | - "enrollYear": "2021", | |
81 | - "age": null, | |
82 | - "gender": 2, | |
83 | - "channelCode": null, | |
84 | - "unionId": null, | |
85 | - "province": "浙江省", | |
86 | - "city": "绍兴市", | |
87 | - "area": "越城区", | |
88 | - "schoolName": "绍兴市塔山中心小学", | |
89 | - "gradeName": "3班", | |
90 | - "className": "3班", | |
91 | - "whiteFlag": null, | |
92 | - "studyCode": null, | |
93 | - "userState": 1, | |
94 | - "userType": 1, | |
95 | - "memberId": null, | |
96 | - "bingMobile": "17858500169,13989547857", | |
97 | - "isBing": 1, | |
98 | - "ssoId": null, | |
99 | - "sex": null, | |
100 | - "pass": null, | |
101 | - "syncTime": "2022-05-06T15:24:49.563+08:00", | |
102 | - "updateTime": "2022-07-09T12:20:29.790+08:00" | |
103 | - }], | |
104 | - "schoolNames": [{ | |
105 | - "schoolId": 7, | |
106 | - "schoolName": "绍兴市塔山中心小学", | |
107 | - "province": null, | |
108 | - "city": null, | |
109 | - "area": null | |
110 | - }, { | |
111 | - "schoolId": 4804, | |
112 | - "schoolName": "绍兴市建功中学", | |
113 | - "province": null, | |
114 | - "city": null, | |
115 | - "area": null | |
116 | - }, { | |
117 | - "schoolId": 355, | |
118 | - "schoolName": "绍兴蕺山外国语学校", | |
119 | - "province": null, | |
120 | - "city": null, | |
121 | - "area": null | |
122 | - }, { | |
123 | - "schoolId": 188, | |
124 | - "schoolName": "温州市第二十一中学", | |
125 | - "province": null, | |
126 | - "city": null, | |
127 | - "area": null | |
128 | - }], | |
129 | - "auth": false | |
130 | -} | |
131 | 0 | \ No newline at end of file |
... | ... | @@ -0,0 +1,629 @@ |
1 | +<template> | |
2 | + <div class="home"> | |
3 | + <div class="tieshi" v-if="tieshi"> | |
4 | + <van-icon @click="tieshi = false" name="clear" /> | |
5 | + <router-link to="/Tips"> | |
6 | + <img src="../assets/ts_icon.png" alt="" /> | |
7 | + </router-link> | |
8 | + </div> | |
9 | + <div class="swipe"> | |
10 | + <img class="logo" src="../assets/logo.png" alt="logo" /> | |
11 | + <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white" v-if="swipeImgs"> | |
12 | + <van-swipe-item v-for="(image, index) in swipeImgs" :key="index"> | |
13 | + <img :src="image.imgUrl" @click="goBannerDetail(index)" /> | |
14 | + </van-swipe-item> | |
15 | + </van-swipe> | |
16 | + </div> | |
17 | + <div class="content"> | |
18 | + <van-search | |
19 | + v-model="searchValue" | |
20 | + :placeholder="placeholder" | |
21 | + @focus="placeholder = ''" | |
22 | + @blur="placeholder = '搜索馆关键字、活动、研学旅行'" | |
23 | + shape="round" | |
24 | + @search="onSearch()" | |
25 | + /> | |
26 | + <div class="type_box"> | |
27 | + <div @click="handleCourseMore()"> | |
28 | + <img src="@/assets/service/homeicon1.png" alt="" /> | |
29 | + <p>研学课程</p> | |
30 | + </div> | |
31 | + <!-- <div @click="handleBaseMore()"> | |
32 | + <img src="@/assets/service/homeicon2.png" alt="" /> | |
33 | + <p>研学基地</p> | |
34 | + </div> --> | |
35 | + <div @click="handleHot()"> | |
36 | + <img src="@/assets/service/homeicon3.png" alt="" /> | |
37 | + <p>热门榜单</p> | |
38 | + </div> | |
39 | + <div @click="handleNewMore()"> | |
40 | + <img src="@/assets/service/homeicon4.png" alt="" /> | |
41 | + <p>官方资讯</p> | |
42 | + </div> | |
43 | + <!-- <div @click="handleTeacher()"> | |
44 | + <img src="@/assets/service/homeicon5.png" alt="" /> | |
45 | + <p>研学导师</p> | |
46 | + </div> --> | |
47 | + </div> | |
48 | + <div class="infomation_box"> | |
49 | + <img class="news" src="@/assets/service/news.png" @click="handleNewMore()" alt="" /> | |
50 | + <div class="line"></div> | |
51 | + <van-swipe vertical class="new-swipe" :autoplay="5000" :show-indicators="false"> | |
52 | + <van-swipe-item v-for="(item, index) in NewList" :key="index"> | |
53 | + <p class="new_item" @click="handleNewDetail(item)">{{ item.title }}</p> | |
54 | + </van-swipe-item> | |
55 | + </van-swipe> | |
56 | + </div> | |
57 | + <!-- 精选课程 --> | |
58 | + <div class="qxy_box"> | |
59 | + <div class="qyx_title"> | |
60 | + <div class="title">精选课程</div> | |
61 | + <div @click="handleCourseMore()"> | |
62 | + <span class="more">更多</span> | |
63 | + <van-icon class="more_icon" name="arrow" /> | |
64 | + </div> | |
65 | + </div> | |
66 | + <CourseList v-if="!loadingCourse" :list="CustomerCourseList"></CourseList> | |
67 | + <van-empty v-else :image="require('@/assets/empty.png')" description="加载中..." /> | |
68 | + </div> | |
69 | + <!-- 研学基地 --> | |
70 | + <div class="qxy_box"> | |
71 | + <div class="qyx_title"> | |
72 | + <div class="title">研选基地</div> | |
73 | + <div @click="handleBaseMore()"> | |
74 | + <span class="more">更多</span> | |
75 | + <van-icon class="more_icon" name="arrow" /> | |
76 | + </div> | |
77 | + </div> | |
78 | + <van-tabs v-model="provinceActive" :ellipsis="false" ref="tabs" color="#4092FF" @change="provinceTabChange"> | |
79 | + <van-tab :title="item.label" v-for="(item, index) in provinceTabList" :key="index"> </van-tab> | |
80 | + </van-tabs> | |
81 | + <BaseList v-if="!loadingBase" :list="BaseList"></BaseList> | |
82 | + <van-empty v-else :image="require('@/assets/empty.png')" description="加载中..." /> | |
83 | + </div> | |
84 | + <!-- 研学游记 --> | |
85 | + <div class="qxy_box"> | |
86 | + <div class="qyx_title"> | |
87 | + <div class="title">研学游记</div> | |
88 | + <div @click="handleStoryMore()"> | |
89 | + <span class="more">更多</span> | |
90 | + <van-icon class="more_icon" name="arrow" /> | |
91 | + </div> | |
92 | + </div> | |
93 | + <StoryList v-if="!loadingStory" :list="StoryList"></StoryList> | |
94 | + <van-empty v-else :image="require('@/assets/empty.png')" description="加载中..." /> | |
95 | + </div> | |
96 | + <about-des></about-des> | |
97 | + <Tabbar active="service"></Tabbar> | |
98 | + <div :is="background"></div> | |
99 | + </div> | |
100 | + </div> | |
101 | +</template> | |
102 | + | |
103 | +<script> | |
104 | +import CourseList from '@/views/Service/component/c_CourseList.vue' | |
105 | +import BaseList from '@/views/Service/component/c_BaseList.vue' | |
106 | +import StoryList from '@/views/GrowUp/c_StoryList.vue' | |
107 | +import Tabbar from '@/components/c_Tabbar.vue' | |
108 | +import Background from '../components/Background.vue' | |
109 | +import AllLoveGo from '../components/AllLoveGo.vue' | |
110 | +import AboutDes from './aboutDes.vue' | |
111 | +import './home.scss' | |
112 | +// const userData = require('@/views/data.json') | |
113 | +export default { | |
114 | + components: { | |
115 | + CourseList, | |
116 | + BaseList, | |
117 | + StoryList, | |
118 | + Tabbar, | |
119 | + Background, | |
120 | + AllLoveGo, | |
121 | + AboutDes, | |
122 | + }, | |
123 | + data() { | |
124 | + return { | |
125 | + placeholder: '搜索馆关键字、活动、研学旅行', | |
126 | + tieshi: true, | |
127 | + navActive: 1, | |
128 | + swipeImgs: '', | |
129 | + StudyBaseList: '', | |
130 | + AreaList: [], | |
131 | + areaActive: 0, | |
132 | + recommendList: [], | |
133 | + recommendPage: 1, | |
134 | + recommendCount: 0, | |
135 | + CourseTypeList: '', | |
136 | + tabActive: 0, | |
137 | + tabBodyList: [], | |
138 | + tabBodyPage: 1, | |
139 | + tabBodyCount: 0, | |
140 | + background: '', | |
141 | + selectCity: false, | |
142 | + cityList: [], | |
143 | + | |
144 | + userInfo: '', | |
145 | + searchValue: '', | |
146 | + loadingCourse: true, | |
147 | + loadingBase: true, | |
148 | + loadingStory: true, | |
149 | + NewList: [], //资讯列表 | |
150 | + CustomerCourseList: [], //精选活动 | |
151 | + BaseList: [], //基地列表 | |
152 | + StoryList: [], //游记列表 | |
153 | + provinceTabList: [ | |
154 | + { label: '推荐', text: '', value: 0, id: '' }, | |
155 | + { label: '越城', text: '越城区', value: 2, id: '' }, | |
156 | + { label: '柯桥', text: '柯桥区', value: 1, id: '' }, | |
157 | + { label: '上虞', text: '上虞区', value: 4, id: '' }, | |
158 | + { label: '诸暨', text: '诸暨区', value: 3, id: '' }, | |
159 | + { label: '嵊州', text: '嵊州区', value: 5, id: '' }, | |
160 | + { label: '新昌', text: '新昌区', value: 5, id: '' }, | |
161 | + ], | |
162 | + provinceActive: 0, | |
163 | + } | |
164 | + }, | |
165 | + mounted() { | |
166 | + ZWJSBridge.onReady(() => { | |
167 | + ZWJSBridge.setTitle({ | |
168 | + title: '绍兴研学', | |
169 | + }) | |
170 | + }) | |
171 | + this.checkAuth() | |
172 | + //二次回退 | |
173 | + const sUserAgent = window.navigator.userAgent.toLowerCase() | |
174 | + const bIsAlipayMini = sUserAgent.indexOf('miniprogram') > -1 && sUserAgent.indexOf('alipay') > -1 | |
175 | + if (bIsAlipayMini) { | |
176 | + console.log('我来自支付宝,popstate') | |
177 | + window.addEventListener('popstate', this.listenerPopstate, true) | |
178 | + } else { | |
179 | + console.log('我来自浙里办,popstate') | |
180 | + window.addEventListener('popstate', this.listenerPopstate, true) | |
181 | + } | |
182 | + this.GetNewList() // 获取资讯 | |
183 | + this.GetBannerList() | |
184 | + this.getCustomerCourseList() //精选活动 | |
185 | + this.GetBaseList() //研学基地 | |
186 | + this.GetStoryList() //研学游记 | |
187 | + }, | |
188 | + //销毁监听 | |
189 | + destroyed() { | |
190 | + console.log('销毁支付宝监听') | |
191 | + window.removeEventListener('popstate', this.listenerPopstate, true) | |
192 | + }, | |
193 | + methods: { | |
194 | + //支付宝二次回退方法,addEventListener和removeEventListener一定要调用方法,不然无效 | |
195 | + listenerPopstate() { | |
196 | + ZWJSBridge.close() | |
197 | + }, | |
198 | + maidian() { | |
199 | + if (this.centerNo) { | |
200 | + this.$zwlogPvGlobal({ loadTime: new Date() }) | |
201 | + this.$nextTick(() => { | |
202 | + this.$zwlogPvGlobal({ responseTime: new Date() }) | |
203 | + }) | |
204 | + } | |
205 | + }, | |
206 | + checkAuth() { | |
207 | + let centerNo = localStorage.getItem('centerNo') | |
208 | + let centerNoTime = localStorage.getItem('centerNoTime') | |
209 | + let nowTime = new Date().getTime() | |
210 | + // alert(centerNo+'-'+nowTime + '-' + centerNoTime + '=' + (nowTime - centerNoTime)) | |
211 | + // 超过10分钟重新授权获取 | |
212 | + if (!centerNoTime || nowTime - centerNoTime > 600000) { | |
213 | + centerNo = '' | |
214 | + } | |
215 | + let ticket = this.common.getUrlParam('ticket') //浙里办app访问 | |
216 | + let ticketId = this.common.getUrlParam('ticketId') //浙里办微信小程序访问 | |
217 | + if (centerNo) { | |
218 | + // ZWJSBridge.alert({ | |
219 | + // message: '有中台编号:' + centerNo, | |
220 | + // }) | |
221 | + this.centerNo = centerNo | |
222 | + this.maidian() | |
223 | + this.getUserInfo() | |
224 | + } else if (ticket && ticket.indexOf('debug') == -1) { | |
225 | + // ZWJSBridge.alert({ | |
226 | + // message: '有ticket:' + ticket, | |
227 | + // }) | |
228 | + this.getCenterByTicket(ticket) | |
229 | + } else if (ticketId && ticketId.indexOf('debug') == -1) { | |
230 | + // ZWJSBridge.alert({ | |
231 | + // message: '有ticketId:' + ticketId, | |
232 | + // }) | |
233 | + this.getCenterByTicketId(ticketId) | |
234 | + localStorage.setItem('isWechat', 1) | |
235 | + } else { | |
236 | + const sUserAgent = window.navigator.userAgent.toLowerCase() | |
237 | + const dtdreamweb = sUserAgent.indexOf('dtdreamweb') > -1 | |
238 | + const miniprogram = sUserAgent.indexOf('miniprogram') > -1 && sUserAgent.indexOf('alipay') > -1 | |
239 | + if (dtdreamweb) { | |
240 | + // alert('浙里办') | |
241 | + window.location.href = `https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=8301b7fe71594245b97560ff841db1f2` | |
242 | + } else if (miniprogram) { | |
243 | + // alert('支付宝') | |
244 | + window.location.href = `https://puser.zjzwfw.gov.cn/sso/alipay.do?action=ssoLogin&servicecode=8301b7fe71594245b97560ff841db1f2` | |
245 | + } else { | |
246 | + // alert('非浙里办渠道访问,显示测试用户数据') | |
247 | + console.log('非浙里办渠道访问,显示测试用户数据', userData) | |
248 | + // this.centerNo = '2022031508525674030748540013076' | |
249 | + // localStorage.setItem('centerNo', '2022031508525674030748540013076') | |
250 | + localStorage.setItem('centerNoTime', new Date().getTime()) | |
251 | + let userInfo = JSON.stringify(userData) | |
252 | + localStorage.setItem('userInfo', userInfo) | |
253 | + this.getUserInfo() | |
254 | + } | |
255 | + } | |
256 | + }, | |
257 | + // 通过ticket获取centerNo | |
258 | + getCenterByTicket(ticket) { | |
259 | + this.yxAxios.get(`${this.proxyUrl}/api/third/getCenterNoSxPrivate?ticket=${ticket}`).then((res) => { | |
260 | + console.log('通过ticket获取centerNo成功:', res) | |
261 | + if (res.data.code == 200) { | |
262 | + this.centerNo = res.data.message | |
263 | + this.maidian() | |
264 | + localStorage.setItem('centerNo', res.data.message) | |
265 | + let nowTime = new Date().getTime() | |
266 | + localStorage.setItem('centerNoTime', nowTime) | |
267 | + this.getUserInfo() | |
268 | + } else { | |
269 | + this.reLoad() | |
270 | + } | |
271 | + }) | |
272 | + }, | |
273 | + // 通过ticketId获取centerNo | |
274 | + getCenterByTicketId(ticketId) { | |
275 | + this.yxAxios.get(`${this.proxyUrl}/api/third/getCenterNoSxPrivate?ticket=${ticketId}`).then((res) => { | |
276 | + console.log('通过ticket获取centerNo成功:', res) | |
277 | + if (res.data.code == 200) { | |
278 | + this.centerNo = res.data.message | |
279 | + this.maidian() | |
280 | + localStorage.setItem('centerNo', res.data.message) | |
281 | + let nowTime = new Date().getTime() | |
282 | + localStorage.setItem('centerNoTime', nowTime) | |
283 | + this.getUserInfo() | |
284 | + } else { | |
285 | + this.reLoad() | |
286 | + } | |
287 | + }) | |
288 | + }, | |
289 | + reLoad() { | |
290 | + console.log('reload') | |
291 | + const sUserAgent = window.navigator.userAgent.toLowerCase() | |
292 | + const dtdreamweb = sUserAgent.indexOf('dtdreamweb') > -1 | |
293 | + const miniprogram = sUserAgent.indexOf('miniprogram') > -1 && sUserAgent.indexOf('alipay') > -1 | |
294 | + if (localStorage.getItem('reloadCount') == 2) { | |
295 | + localStorage.setItem('reloadCount', 1) | |
296 | + ZWJSBridge.confirm({ | |
297 | + title: '警告', | |
298 | + buttonLabels: ['重新载入'], | |
299 | + message: '用户身份验证失败,请重新加载', | |
300 | + }).then((res) => { | |
301 | + if (dtdreamweb) { | |
302 | + // alert('浙里办') | |
303 | + window.location.href = `https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=8301b7fe71594245b97560ff841db1f2` | |
304 | + } else if (miniprogram) { | |
305 | + // alert('支付宝') | |
306 | + window.location.href = `https://puser.zjzwfw.gov.cn/sso/alipay.do?action=ssoLogin&servicecode=8301b7fe71594245b97560ff841db1f2` | |
307 | + } | |
308 | + }) | |
309 | + } else { | |
310 | + localStorage.setItem('reloadCount', 2) | |
311 | + if (dtdreamweb) { | |
312 | + // alert('浙里办') | |
313 | + window.location.href = `https://puser.zjzwfw.gov.cn/sso/mobile.do?action=oauth&scope=1&servicecode=8301b7fe71594245b97560ff841db1f2` | |
314 | + } else if (miniprogram) { | |
315 | + // alert('支付宝') | |
316 | + window.location.href = `https://puser.zjzwfw.gov.cn/sso/alipay.do?action=ssoLogin&servicecode=8301b7fe71594245b97560ff841db1f2` | |
317 | + } | |
318 | + } | |
319 | + }, | |
320 | + // 获取用户信息 | |
321 | + getUserInfo() { | |
322 | + this.yxAxios.get(`${this.proxyUrl}/user/info/getPortalUserByNum?userNum=${localStorage.getItem('centerNo')}`).then((res) => { | |
323 | + console.log('获取用户信息getPortalUserByNum:', res) | |
324 | + if (res.data.code == 200) { | |
325 | + localStorage.setItem('userInfo', JSON.stringify(res.data.data.userInfo)) | |
326 | + this.userInfo = res.data.data.userInfo | |
327 | + } | |
328 | + }) | |
329 | + }, | |
330 | + // 获取资讯 | |
331 | + GetNewList() { | |
332 | + this.yxAxios.post(`${this.proxyUrl}/manage/info/content/listWithNoContent`, { pageNum: 1, pageSize: 5 }).then((res) => { | |
333 | + let NewList = res.data.rows | |
334 | + console.log('资讯列表:', NewList) | |
335 | + | |
336 | + this.NewList = NewList | |
337 | + }) | |
338 | + }, | |
339 | + // 精选课程 | |
340 | + getCustomerCourseList() { | |
341 | + this.yxAxios | |
342 | + .post(`${this.yanxueUrl}/api/SchoolManage/SchoolCourseListV2`, { | |
343 | + labelIdList: [], | |
344 | + ageType: 0, //适应对象 | |
345 | + days: 0, //线路天数 | |
346 | + isSelfSupport: '', //是否支持定制 | |
347 | + provinceName: '', //省份 | |
348 | + cityName: '', //城市 | |
349 | + // areaName: areaName, //区 | |
350 | + startPrice: -1, | |
351 | + endPrice: -1, | |
352 | + stype: 1, | |
353 | + pageIndex: 1, | |
354 | + pageSize: 4, | |
355 | + }) | |
356 | + .then((res) => { | |
357 | + let CustomerCourseList = res.data.data.data | |
358 | + console.log('精选课程:', CustomerCourseList) | |
359 | + for (let i in CustomerCourseList) { | |
360 | + CustomerCourseList[i].course_labels = CustomerCourseList[i].course_labels?.split(',') | |
361 | + if (CustomerCourseList[i].startDate) { | |
362 | + CustomerCourseList[i].week = this.formatWeek(this.Moment(CustomerCourseList[i].startDate).format('d')) | |
363 | + CustomerCourseList[i].startDate = this.Moment(CustomerCourseList[i].startDate).format('YYYY.M.D') | |
364 | + CustomerCourseList[i].endDate = this.Moment(CustomerCourseList[i].endDate).format('YYYY.M.D') | |
365 | + } | |
366 | + } | |
367 | + this.CustomerCourseList = CustomerCourseList | |
368 | + this.loadingCourse = false | |
369 | + }) | |
370 | + }, | |
371 | + // 获取研学基地 | |
372 | + GetBaseList() { | |
373 | + this.yxAxios | |
374 | + .post(`${this.yanxueUrl}/api/SchoolManage/SchoolStudyBaseList`, { | |
375 | + provinceName: '浙江省', | |
376 | + cityName: '绍兴市', | |
377 | + areaName: this.provinceTabList[this.provinceActive].text, | |
378 | + levelName: '', | |
379 | + type: 0, | |
380 | + StartPeopleCount: '-1', | |
381 | + EndPeopleCount: '-1', | |
382 | + stype: 0, | |
383 | + pageIndex: 1, | |
384 | + pageSize: 6, | |
385 | + }) | |
386 | + .then((res) => { | |
387 | + let BaseList = res.data.data.data | |
388 | + console.log('基地列表:', BaseList) | |
389 | + | |
390 | + for (let i in BaseList) { | |
391 | + BaseList[i].baseLabel = BaseList[i].baseLabel?.split(',') | |
392 | + } | |
393 | + this.BaseList = BaseList | |
394 | + this.loadingBase = false | |
395 | + }) | |
396 | + }, | |
397 | + | |
398 | + // 改变地区 | |
399 | + provinceTabChange() { | |
400 | + this.BaseList = [] | |
401 | + this.GetBaseList() | |
402 | + }, | |
403 | + // 获取研学游记 | |
404 | + GetStoryList() { | |
405 | + this.yxAxios.get(`${this.yanxueUrl}/api/StudiesWap/GetMyStoryList?pageIndex=1&pageSize=6`).then((res) => { | |
406 | + let StoryList = res.data.data.items | |
407 | + console.log('游记列表:', StoryList) | |
408 | + | |
409 | + this.StoryList = StoryList | |
410 | + this.loadingStory = false | |
411 | + }) | |
412 | + }, | |
413 | + | |
414 | + handleNewDetail(item) { | |
415 | + if (item.linkUrl) { | |
416 | + this.yxAxios.post(`${this.proxyUrl}/manage/info/content/addReadNum`, { id: item.id }).then((res) => { | |
417 | + if (res.data.code == 200) { | |
418 | + location.href = item.linkUrl | |
419 | + } else { | |
420 | + this.$toast.fail(res.data.message) | |
421 | + } | |
422 | + }) | |
423 | + } else { | |
424 | + this.$router.push({ name: 'ArticleDetail', query: { id: item.id } }) | |
425 | + } | |
426 | + }, | |
427 | + // 点击研学导师 | |
428 | + handleTeacher() { | |
429 | + this.$router.push({ name: 'Teacher' }) | |
430 | + }, | |
431 | + // 热门榜单 | |
432 | + handleHot() { | |
433 | + this.$router.push({ name: 'RankingList' }) | |
434 | + }, | |
435 | + // 点击资讯更多 | |
436 | + handleNewMore() { | |
437 | + this.$router.push({ name: 'Article' }) | |
438 | + }, | |
439 | + // 点击精选课程更多 | |
440 | + handleCourseMore() { | |
441 | + this.$router.push({ name: 'SelectionCourse' }) | |
442 | + }, | |
443 | + // 点击研学基地更多 | |
444 | + handleBaseMore() { | |
445 | + this.$router.push({ name: 'SelectionBase' }) | |
446 | + }, | |
447 | + // 点击研学游记更多 | |
448 | + handleStoryMore() { | |
449 | + this.$router.push({ name: 'StoryList' }) | |
450 | + }, | |
451 | + goBannerDetail(index) { | |
452 | + // var t = this.swipeImgs[index].type | |
453 | + // if (t == 1) { | |
454 | + // window.location.href = this.swipeImgs[index].linkUrl | |
455 | + // } else { | |
456 | + // this.$router.push({ | |
457 | + // path: '/BannerDetail', | |
458 | + // query: { id: this.swipeImgs[index].id }, | |
459 | + // }) | |
460 | + // } | |
461 | + }, | |
462 | + | |
463 | + GetBannerList() { | |
464 | + this.http | |
465 | + .GetBannerList({ | |
466 | + city: this.projectCity, | |
467 | + }) | |
468 | + .then((res) => { | |
469 | + if (res.status == 1) { | |
470 | + this.swipeImgs = res.data | |
471 | + } | |
472 | + }) | |
473 | + }, | |
474 | + onSearch() { | |
475 | + if (this.searchValue != '') { | |
476 | + this.$router.push({ name: 'SearchResult', query: { search: this.searchValue } }) | |
477 | + } else { | |
478 | + this.$toast('请输入搜索内容') | |
479 | + } | |
480 | + }, | |
481 | + | |
482 | + // 获取用户信息 | |
483 | + // getUserInfo() { | |
484 | + // let userInfo = sessionStorage.getItem('userInfo') | |
485 | + // if (userInfo) { | |
486 | + // this.userInfo = JSON.parse(userInfo) | |
487 | + | |
488 | + // this.showData = true | |
489 | + // this.GetStoryList() | |
490 | + // } else { | |
491 | + // this.$toast.loading({ | |
492 | + // message: '加载中...', | |
493 | + // duration: 0, | |
494 | + // forbidClick: true, | |
495 | + // }) | |
496 | + // this.yxAxios.get(`${this.proxyUrl}/api/wx/wx1305e88d2bc74073/getUserInfo?unionId=${this.unionId}`).then((res) => { | |
497 | + // this.$toast.clear() | |
498 | + // if (res.data.data) { | |
499 | + // this.showData = true | |
500 | + // this.userInfo = res.data.data | |
501 | + // this.GetStoryList() | |
502 | + // sessionStorage.setItem('userInfo', JSON.stringify(res.data.data)) | |
503 | + // } else { | |
504 | + // console.log('getUserInfo失败') | |
505 | + // this.showData = true | |
506 | + // } | |
507 | + // }) | |
508 | + // } | |
509 | + // }, | |
510 | + formatWeek(week) { | |
511 | + return week == 1 | |
512 | + ? '周一' | |
513 | + : week == 2 | |
514 | + ? '周二' | |
515 | + : week == 3 | |
516 | + ? '周三' | |
517 | + : week == 4 | |
518 | + ? '周四' | |
519 | + : week == 5 | |
520 | + ? '周五' | |
521 | + : week == 6 | |
522 | + ? '周六' | |
523 | + : week == 0 | |
524 | + ? '周日' | |
525 | + : '' | |
526 | + }, | |
527 | + }, | |
528 | +} | |
529 | +</script> | |
530 | +<style lang="stylus" scoped> | |
531 | +.bottomText { | |
532 | + text-align: center; | |
533 | + font-size: 1.2rem; | |
534 | + color: #ccc; | |
535 | + | |
536 | + p { | |
537 | + margin: 0; | |
538 | + } | |
539 | +} | |
540 | + | |
541 | +.home { | |
542 | +.tieshi{ | |
543 | + position: fixed; | |
544 | + right: 20px; | |
545 | + bottom: 25%; | |
546 | + z-index: 1000; | |
547 | + padding: 20px 20px 0 0; | |
548 | + i{ | |
549 | + position: absolute; | |
550 | + top: 0; | |
551 | + right: 0; | |
552 | + font-size: 3.6rem; | |
553 | + z-index: 100; | |
554 | + color: #c2c2c2; | |
555 | + } | |
556 | + img{ | |
557 | + width :160px; | |
558 | + } | |
559 | + } | |
560 | + .swipe { | |
561 | + position: relative; | |
562 | + | |
563 | + .logo { | |
564 | + width: 25%; | |
565 | + position: absolute; | |
566 | + top: 20px; | |
567 | + left: 20px; | |
568 | + z-index: 100; | |
569 | + } | |
570 | + | |
571 | + .scan { | |
572 | + position: absolute; | |
573 | + right: 20px; | |
574 | + top: 20px; | |
575 | + z-index: 100; | |
576 | + color: white; | |
577 | + font-size: 2.6rem; | |
578 | + | |
579 | + .tishi { | |
580 | + position: absolute; | |
581 | + left: -90px; | |
582 | + bottom: -30px; | |
583 | + width: 112px; | |
584 | + } | |
585 | + } | |
586 | + | |
587 | + img { | |
588 | + width: 100%; | |
589 | + } | |
590 | + } | |
591 | + | |
592 | + | |
593 | +} | |
594 | +</style> | |
595 | +<style lang="scss"> | |
596 | +// 长辈版 | |
597 | +.elder { | |
598 | + .home .infomation_box .new_item { | |
599 | + font-size: 36px; | |
600 | + } | |
601 | + .home .type_box p { | |
602 | + font-size: 34px; | |
603 | + } | |
604 | + .home .qxy_box .qyx_title { | |
605 | + .title { | |
606 | + font-size: 44px; | |
607 | + } | |
608 | + .more { | |
609 | + font-size: 38px; | |
610 | + } | |
611 | + } | |
612 | + .abroad .uni_item_mini { | |
613 | + .course_content { | |
614 | + .title { | |
615 | + font-size: 36px; | |
616 | + } | |
617 | + .des { | |
618 | + font-size: 34px; | |
619 | + } | |
620 | + } | |
621 | + .img_box .bottom { | |
622 | + font-size: 32px; | |
623 | + } | |
624 | + } | |
625 | + .van-tab { | |
626 | + font-size: 36px; | |
627 | + } | |
628 | +} | |
629 | +</style> | ... | ... |
... | ... | @@ -0,0 +1,130 @@ |
1 | +{ | |
2 | + "nickName": null, | |
3 | + "travelerName": "夏洋涛", | |
4 | + "phone": "17858500169", | |
5 | + "centerNo": "2022031508525674030748540013076", | |
6 | + "idCard": "330881199606054935", | |
7 | + "thirdSource": 1, | |
8 | + "unionId": "oJPmPuLaAx2x2DaRGfCFeYuLWzLU", | |
9 | + "userState": null, | |
10 | + "userType": 2, | |
11 | + "gender": 1, | |
12 | + "isMember": 2, | |
13 | + "subUsers": [{ | |
14 | + "id": 49238, | |
15 | + "travelerName": "xia", | |
16 | + "travelerIdCard": "330881199606054935", | |
17 | + "travelerNum": "2022042515320607668704830046683", | |
18 | + "travelerMobile": "17858500169", | |
19 | + "travelerType": 0, | |
20 | + "enrollYear": "2016", | |
21 | + "age": null, | |
22 | + "gender": 1, | |
23 | + "channelCode": null, | |
24 | + "unionId": null, | |
25 | + "province": "浙江省", | |
26 | + "city": "温州市", | |
27 | + "area": "瓯海区", | |
28 | + "schoolName": "温州市第二十一中学", | |
29 | + "gradeName": "1班", | |
30 | + "className": "1班", | |
31 | + "whiteFlag": 1, | |
32 | + "studyCode": null, | |
33 | + "userState": 1, | |
34 | + "userType": 1, | |
35 | + "memberId": null, | |
36 | + "bingMobile": "17858500169", | |
37 | + "isBing": 1, | |
38 | + "ssoId": null, | |
39 | + "sex": null, | |
40 | + "pass": null, | |
41 | + "syncTime": "2022-04-25T15:32:06.250+08:00", | |
42 | + "updateTime": "2022-04-28T11:09:57.667+08:00" | |
43 | + }, { | |
44 | + "id": 52229, | |
45 | + "travelerName": "林淡", | |
46 | + "travelerIdCard": "331081198803306735", | |
47 | + "travelerNum": "2022050615163709304353550045179", | |
48 | + "travelerMobile": "15168313607", | |
49 | + "travelerType": null, | |
50 | + "enrollYear": null, | |
51 | + "age": null, | |
52 | + "gender": 1, | |
53 | + "channelCode": null, | |
54 | + "unionId": null, | |
55 | + "province": null, | |
56 | + "city": null, | |
57 | + "area": null, | |
58 | + "schoolName": null, | |
59 | + "gradeName": null, | |
60 | + "className": null, | |
61 | + "whiteFlag": null, | |
62 | + "studyCode": null, | |
63 | + "userState": 1, | |
64 | + "userType": 2, | |
65 | + "memberId": null, | |
66 | + "bingMobile": "13989547857,17858500169", | |
67 | + "isBing": 1, | |
68 | + "ssoId": null, | |
69 | + "sex": null, | |
70 | + "pass": null, | |
71 | + "syncTime": "2022-05-06T15:16:37.933+08:00", | |
72 | + "updateTime": "2022-05-06T15:23:51.297+08:00" | |
73 | + }, { | |
74 | + "id": 52230, | |
75 | + "travelerName": "林珈逸", | |
76 | + "travelerIdCard": "330602201507040021", | |
77 | + "travelerNum": "2022050615244927688271930045180", | |
78 | + "travelerMobile": "15168313607", | |
79 | + "travelerType": 1, | |
80 | + "enrollYear": "2021", | |
81 | + "age": null, | |
82 | + "gender": 2, | |
83 | + "channelCode": null, | |
84 | + "unionId": null, | |
85 | + "province": "浙江省", | |
86 | + "city": "绍兴市", | |
87 | + "area": "越城区", | |
88 | + "schoolName": "绍兴市塔山中心小学", | |
89 | + "gradeName": "3班", | |
90 | + "className": "3班", | |
91 | + "whiteFlag": null, | |
92 | + "studyCode": null, | |
93 | + "userState": 1, | |
94 | + "userType": 1, | |
95 | + "memberId": null, | |
96 | + "bingMobile": "17858500169,13989547857", | |
97 | + "isBing": 1, | |
98 | + "ssoId": null, | |
99 | + "sex": null, | |
100 | + "pass": null, | |
101 | + "syncTime": "2022-05-06T15:24:49.563+08:00", | |
102 | + "updateTime": "2022-07-09T12:20:29.790+08:00" | |
103 | + }], | |
104 | + "schoolNames": [{ | |
105 | + "schoolId": 7, | |
106 | + "schoolName": "绍兴市塔山中心小学", | |
107 | + "province": null, | |
108 | + "city": null, | |
109 | + "area": null | |
110 | + }, { | |
111 | + "schoolId": 4804, | |
112 | + "schoolName": "绍兴市建功中学", | |
113 | + "province": null, | |
114 | + "city": null, | |
115 | + "area": null | |
116 | + }, { | |
117 | + "schoolId": 355, | |
118 | + "schoolName": "绍兴蕺山外国语学校", | |
119 | + "province": null, | |
120 | + "city": null, | |
121 | + "area": null | |
122 | + }, { | |
123 | + "schoolId": 188, | |
124 | + "schoolName": "温州市第二十一中学", | |
125 | + "province": null, | |
126 | + "city": null, | |
127 | + "area": null | |
128 | + }], | |
129 | + "auth": false | |
130 | +} | |
0 | 131 | \ No newline at end of file | ... | ... |