Commit b67b562e5210f063f20dfeb6407d80c52e64f5a3

Authored by 夏洋涛
1 parent 6a7e9871
Exists in master

feat:课程接口修改

@@ -22,6 +22,7 @@ Vue.prototype.baseUrl = 'https://proxy.shunzhi.net'; @@ -22,6 +22,7 @@ Vue.prototype.baseUrl = 'https://proxy.shunzhi.net';
22 // Vue.prototype.yanxueUrl = 'https://www.zlyanxue.cn'; 22 // Vue.prototype.yanxueUrl = 'https://www.zlyanxue.cn';
23 // Vue.prototype.yanxueUrl = 'https://zlyx.shunzhi.net'; 23 // Vue.prototype.yanxueUrl = 'https://zlyx.shunzhi.net';
24 Vue.prototype.yanxueUrl = 'https://ocp.sxsedu.net/sxyx/api'; 24 Vue.prototype.yanxueUrl = 'https://ocp.sxsedu.net/sxyx/api';
  25 +Vue.prototype.yanxueUrlNew = 'https://ocp.sxsedu.net/szsh/yx';
25 Vue.prototype.kqUrl = 'https://proxy.shunzhi.net/achieve' 26 Vue.prototype.kqUrl = 'https://proxy.shunzhi.net/achieve'
26 27
27 Vue.prototype.TestUnionId = 'oJPmPuLaAx2x2DaRGfCFeYuLWzLU' //夏 28 Vue.prototype.TestUnionId = 'oJPmPuLaAx2x2DaRGfCFeYuLWzLU' //夏
src/views/Service/CourseBaseList/SelectionCourse.vue
@@ -2,17 +2,14 @@ @@ -2,17 +2,14 @@
2 <template> 2 <template>
3 <div id="SelectionCourse"> 3 <div id="SelectionCourse">
4 <van-search v-model="searchValue" placeholder="请输入课程关键词" @search="reloadData" /> 4 <van-search v-model="searchValue" placeholder="请输入课程关键词" @search="reloadData" />
5 - <van-tabs v-model="active" @click="tabChange"> 5 + <!-- <van-tabs v-model="active" @click="tabChange">
6 <van-tab :title="item.text" v-for="(item, index) in typeOption" :key="index"></van-tab> 6 <van-tab :title="item.text" v-for="(item, index) in typeOption" :key="index"></van-tab>
  7 + </van-tabs> -->
  8 + <van-tabs v-model="provinceActive" :ellipsis="false" ref="tabs" color="#4092FF" @change="provinceTabChange">
  9 + <van-tab :title="item.label" v-for="(item, index) in provinceTabList" :key="index"> </van-tab>
7 </van-tabs> 10 </van-tabs>
8 - <van-list  
9 - v-if="CourseData.length > 0"  
10 - v-model="loading"  
11 - :finished="finished"  
12 - finished-text="没有更多了"  
13 - :immediate-check="false"  
14 - @load="getCourseData"  
15 - > 11 + <van-list v-if="CourseData.length > 0" v-model="loading" :finished="finished" finished-text="没有更多了"
  12 + :immediate-check="false" @load="getCourseData">
16 <ServiceListSecond :list="CourseData" :courseTypeLableId="typeOption[active].id"></ServiceListSecond> 13 <ServiceListSecond :list="CourseData" :courseTypeLableId="typeOption[active].id"></ServiceListSecond>
17 </van-list> 14 </van-list>
18 <van-empty v-if="finished && CourseData.length == 0" :image="require('@/assets/empty.png')" description="暂无活动" /> 15 <van-empty v-if="finished && CourseData.length == 0" :image="require('@/assets/empty.png')" description="暂无活动" />
@@ -23,7 +20,7 @@ @@ -23,7 +20,7 @@
23 <script> 20 <script>
24 import ServiceListSecond from '@/views/Service/component/ServiceListSecond.vue' 21 import ServiceListSecond from '@/views/Service/component/ServiceListSecond.vue'
25 export default { 22 export default {
26 - data() { 23 + data () {
27 return { 24 return {
28 pageLoading: true, 25 pageLoading: true,
29 pageSize: 10, 26 pageSize: 10,
@@ -35,9 +32,19 @@ export default { @@ -35,9 +32,19 @@ export default {
35 CourseData: [], 32 CourseData: [],
36 typeOption: [], 33 typeOption: [],
37 active: 0, 34 active: 0,
  35 + provinceTabList: [
  36 + { label: '推荐', text: '', value: 0, id: '' },
  37 + { label: '越城', text: '越城区', value: 2, id: '' },
  38 + { label: '柯桥', text: '柯桥区', value: 1, id: '' },
  39 + { label: '上虞', text: '上虞区', value: 4, id: '' },
  40 + { label: '诸暨', text: '诸暨市', value: 3, id: '' },
  41 + { label: '嵊州', text: '嵊州市', value: 5, id: '' },
  42 + { label: '新昌', text: '新昌县', value: 5, id: '' },
  43 + ],
  44 + provinceActive: 0,
38 } 45 }
39 }, 46 },
40 - mounted() { 47 + mounted () {
41 let userInfo = localStorage.getItem('userInfo') 48 let userInfo = localStorage.getItem('userInfo')
42 if (userInfo) { 49 if (userInfo) {
43 userInfo = JSON.parse(userInfo) 50 userInfo = JSON.parse(userInfo)
@@ -49,18 +56,18 @@ export default { @@ -49,18 +56,18 @@ export default {
49 }, 56 },
50 methods: { 57 methods: {
51 // 下拉刷新 58 // 下拉刷新
52 - onRefresh() { 59 + onRefresh () {
53 this.pageNum = 1 60 this.pageNum = 1
54 this.reloadData() 61 this.reloadData()
55 }, 62 },
56 - reloadData() { 63 + reloadData () {
57 console.log('reloadData') 64 console.log('reloadData')
58 this.pageNum = 1 65 this.pageNum = 1
59 this.CourseData = [] 66 this.CourseData = []
60 this.getCourseData() 67 this.getCourseData()
61 }, 68 },
62 // 精选活动 69 // 精选活动
63 - getCourseData() { 70 + getCourseData () {
64 if (this.pageNum == 1) { 71 if (this.pageNum == 1) {
65 this.$toast.loading({ 72 this.$toast.loading({
66 message: '加载中...', 73 message: '加载中...',
@@ -77,35 +84,41 @@ export default { @@ -77,35 +84,41 @@ export default {
77 let startPrice = '-1', 84 let startPrice = '-1',
78 endPrice = '-1' 85 endPrice = '-1'
79 this.yxAxios 86 this.yxAxios
80 - .post(`${this.yanxueUrl}/api/SchoolManage/SchoolCourseListV2`, {  
81 - labelIdList: labelIdList,  
82 - ageType: 0, //适应对象  
83 - days: 0, //线路天数  
84 - isSelfSupport: null, //是否支持定制  
85 - // "provinceName":provinceName,//省份  
86 - // "cityName":cityName,//城市  
87 - areaName: areaName, //区  
88 - startPrice: startPrice,  
89 - endPrice: endPrice,  
90 - courseName: this.searchValue,  
91 - stype:1,  
92 - pageIndex: this.pageNum, 87 + .post(`${this.yanxueUrlNew}/course/getCourseByArea`, {
  88 + page: this.pageNum,
93 pageSize: this.pageSize, 89 pageSize: this.pageSize,
  90 + provinceName: '浙江省',
  91 + cityName: '绍兴市',
  92 + areaName: this.provinceTabList[this.provinceActive].text,
94 }) 93 })
  94 + // .post(`${this.yanxueUrl}/api/SchoolManage/SchoolCourseListV2`, {
  95 + // labelIdList: labelIdList,
  96 + // ageType: 0, //适应对象
  97 + // days: 0, //线路天数
  98 + // isSelfSupport: null, //是否支持定制
  99 + // // "provinceName":provinceName,//省份
  100 + // // "cityName":cityName,//城市
  101 + // areaName: areaName, //区
  102 + // startPrice: startPrice,
  103 + // endPrice: endPrice,
  104 + // courseName: this.searchValue,
  105 + // stype:1,
  106 + // pageIndex: this.pageNum,
  107 + // pageSize: this.pageSize,
  108 + // })
95 .then((res) => { 109 .then((res) => {
96 this.$toast.clear() 110 this.$toast.clear()
97 - if (res.data.status == 1) {  
98 - let data = res.data.data 111 + if (res.data.code == 200) {
99 this.loading = false 112 this.loading = false
100 - let CourseData = data.data 113 + let CourseData = res.data.rows || []
101 console.log('活动数据:', CourseData) 114 console.log('活动数据:', CourseData)
102 - if (this.pageSize * this.pageNum >= data.count) { 115 + if (this.pageSize * this.pageNum >= res.data.total) {
103 this.finished = true 116 this.finished = true
104 } else { 117 } else {
105 this.pageNum++ 118 this.pageNum++
106 } 119 }
107 for (let i in CourseData) { 120 for (let i in CourseData) {
108 - CourseData[i].course_labels = CourseData[i].course_labels?.split(',') 121 + CourseData[i].courseLabels = CourseData[i].courseLabels?.split(',')
109 if (CourseData[i].startDate) { 122 if (CourseData[i].startDate) {
110 CourseData[i].week = this.formatWeek(this.Moment(CourseData[i].startDate).format('d')) 123 CourseData[i].week = this.formatWeek(this.Moment(CourseData[i].startDate).format('d'))
111 CourseData[i].startDate = this.Moment(CourseData[i].startDate).format('YYYY.M.D') 124 CourseData[i].startDate = this.Moment(CourseData[i].startDate).format('YYYY.M.D')
@@ -115,12 +128,12 @@ export default { @@ -115,12 +128,12 @@ export default {
115 this.CourseData = this.CourseData.concat(CourseData) 128 this.CourseData = this.CourseData.concat(CourseData)
116 } else { 129 } else {
117 this.finished = true 130 this.finished = true
118 - this.$toast(res.data.message || res.data.result) 131 + this.$toast(res.data.msg)
119 } 132 }
120 }) 133 })
121 }, 134 },
122 // 获取研学类型 135 // 获取研学类型
123 - getType() { 136 + getType () {
124 // this.yxAxios.post(`http://121.40.30.78:9000/StudyLabelDetail/List`, { 137 // this.yxAxios.post(`http://121.40.30.78:9000/StudyLabelDetail/List`, {
125 this.yxAxios 138 this.yxAxios
126 .post(`${this.yanxueUrl}/StudyLabelDetail/List`, { 139 .post(`${this.yanxueUrl}/StudyLabelDetail/List`, {
@@ -152,28 +165,33 @@ export default { @@ -152,28 +165,33 @@ export default {
152 }, 165 },
153 166
154 // 返回顶部 167 // 返回顶部
155 - backTop() { 168 + backTop () {
156 document.getElementById('SelectionCourse').scrollIntoView() 169 document.getElementById('SelectionCourse').scrollIntoView()
157 }, 170 },
158 // 格式化星期 171 // 格式化星期
159 - formatWeek(week) { 172 + formatWeek (week) {
160 return week == 1 173 return week == 1
161 ? '周一' 174 ? '周一'
162 : week == 2 175 : week == 2
163 - ? '周二'  
164 - : week == 3  
165 - ? '周三'  
166 - : week == 4  
167 - ? '周四'  
168 - : week == 5  
169 - ? '周五'  
170 - : week == 6  
171 - ? '周六'  
172 - : week == 0  
173 - ? '周日'  
174 - : '' 176 + ? '周二'
  177 + : week == 3
  178 + ? '周三'
  179 + : week == 4
  180 + ? '周四'
  181 + : week == 5
  182 + ? '周五'
  183 + : week == 6
  184 + ? '周六'
  185 + : week == 0
  186 + ? '周日'
  187 + : ''
  188 + },
  189 + // 改变地区
  190 + provinceTabChange () {
  191 + this.CourseData = []
  192 + this.getCourseData()
175 }, 193 },
176 - tabChange() { 194 + tabChange () {
177 this.pageNum = 1 195 this.pageNum = 1
178 this.CourseData = [] 196 this.CourseData = []
179 this.getCourseData() 197 this.getCourseData()
@@ -190,24 +208,29 @@ export default { @@ -190,24 +208,29 @@ export default {
190 min-height: 100%; 208 min-height: 100%;
191 background: #fff; 209 background: #fff;
192 padding-bottom: 40px; 210 padding-bottom: 40px;
  211 +
193 .drop_down_box { 212 .drop_down_box {
194 display: flex; 213 display: flex;
195 justify-content: space-between; 214 justify-content: space-between;
196 align-items: center; 215 align-items: center;
  216 +
197 .filter { 217 .filter {
198 flex-shrink: 0; 218 flex-shrink: 0;
199 font-size: 28px; 219 font-size: 28px;
200 padding: 0 30px; 220 padding: 0 30px;
201 } 221 }
202 } 222 }
  223 +
203 .characteristic_label { 224 .characteristic_label {
204 white-space: nowrap; 225 white-space: nowrap;
205 overflow-x: auto; 226 overflow-x: auto;
206 padding: 0 30px; 227 padding: 0 30px;
207 padding-top: 20px; 228 padding-top: 20px;
  229 +
208 &::-webkit-scrollbar { 230 &::-webkit-scrollbar {
209 display: none; 231 display: none;
210 } 232 }
  233 +
211 span { 234 span {
212 display: inline-block; 235 display: inline-block;
213 padding: 10px; 236 padding: 10px;
@@ -216,6 +239,7 @@ export default { @@ -216,6 +239,7 @@ export default {
216 border-radius: 8px; 239 border-radius: 8px;
217 border: 1px solid #f5f6fa; 240 border: 1px solid #f5f6fa;
218 margin-right: 12px; 241 margin-right: 12px;
  242 +
219 &.active { 243 &.active {
220 background: #ebf4ff; 244 background: #ebf4ff;
221 color: #1373ea; 245 color: #1373ea;
@@ -223,11 +247,13 @@ export default { @@ -223,11 +247,13 @@ export default {
223 } 247 }
224 } 248 }
225 } 249 }
  250 +
226 .page_loading { 251 .page_loading {
227 font-size: 24px; 252 font-size: 24px;
228 text-align: center; 253 text-align: center;
229 padding-top: 40px; 254 padding-top: 40px;
230 } 255 }
  256 +
231 .backtop { 257 .backtop {
232 position: fixed; 258 position: fixed;
233 bottom: 100px; 259 bottom: 100px;
@@ -237,6 +263,7 @@ export default { @@ -237,6 +263,7 @@ export default {
237 border-radius: 10px; 263 border-radius: 10px;
238 padding: 10px; 264 padding: 10px;
239 } 265 }
  266 +
240 // .van-tab { 267 // .van-tab {
241 // font-size: 32px; 268 // font-size: 32px;
242 // } 269 // }
src/views/Service/component/ServiceListSecond.vue
@@ -6,8 +6,8 @@ @@ -6,8 +6,8 @@
6 <!-- <div class="uni_item_mini" :key="index" @click="handleUniDetail(item)" v-if="index<=3"> --> 6 <!-- <div class="uni_item_mini" :key="index" @click="handleUniDetail(item)" v-if="index<=3"> -->
7 <div class="uni_item_mini" :key="index" @click="handleUniDetail(item)"> 7 <div class="uni_item_mini" :key="index" @click="handleUniDetail(item)">
8 <div class="img_box" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }"> 8 <div class="img_box" :style="{ backgroundImage: 'url(' + item.coverUrl + ')' }">
9 - <div class="bottom" v-if="item.cityAddress || item.areaAddress">  
10 - <span class="count">{{ item.read_count }} 人查看</span> 9 + <div class="bottom">
  10 + <span class="count" v-if="item.readCount">{{ item.readCount }} 人查看</span>
11 </div> 11 </div>
12 </div> 12 </div>
13 <div class="content"> 13 <div class="content">
@@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
16 <van-icon name="location" /> {{ item.cityAddress }}{{ item.cityAddress && item.areaAddress ? '·' : '' }}{{ item.areaAddress }} 16 <van-icon name="location" /> {{ item.cityAddress }}{{ item.cityAddress && item.areaAddress ? '·' : '' }}{{ item.areaAddress }}
17 </p> 17 </p>
18 <!-- <div class="tag_box"> 18 <!-- <div class="tag_box">
19 - <template v-for="(tag, index2) in item.course_labels"> 19 + <template v-for="(tag, index2) in item.courseLabels">
20 <span class="tag" v-if="tag" :key="index2">{{ tag }}</span> 20 <span class="tag" v-if="tag" :key="index2">{{ tag }}</span>
21 </template> 21 </template>
22 </div> --> 22 </div> -->