浏览代码

修改轮播

空白格 3 年之前
父节点
当前提交
6763d372d8

+ 3 - 1
h5_web/common/apiurl.js

@@ -222,7 +222,9 @@ const apiurl = {
 		// 添加证书
 		addCertificateUrl: '/certificate',
 		// 删除证书
-		deleteCertificateUrl: '/certificate/'
+		deleteCertificateUrl: '/certificate/',
+		// 查询学生是否报过名
+		queryIsAttendedClassUrl: '/learnpackage/queryIsAttendedClass'
 	}
 }
 

+ 2 - 1
h5_web/common/config.js

@@ -5,7 +5,8 @@ const config = {
 	baseUrl: 'https://wx.hw.hongweisoft.com/veterans/app' ,// 201服务器地址
 	// baseUrl: 'https://veterwebpro.hw.hongweisoft.com/veterans-prod-api/app' ,// 正式服务器地址
 	uploadUrl: 'https://wx.hw.hongweisoft.com/veterans/file/upload/single/minio', // 上传地址
-	timChatUrl: 'http://172.16.90.126:8081/#/pages/login/login', // 退役军人聊天TIM
+	timChatUrl: 'https://veterhchat.hw.hongweisoft.com/#/pages/login/login', // 线上退役军人聊天TIM
+	// timChatUrl: 'http://172.16.90.126:8081/#/pages/login/login', // 本地聊天TIM
 	version: '1.0.2'
 }
 export {

+ 2 - 1
h5_web/common/http.api.js

@@ -193,7 +193,8 @@ const install = (Vue, vm) => {
 		getMyTrainingDetailsApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getMyTrainingDetailsUrl + params.id, params),
 		getCertificateListApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getCertificateListUrl + params.id, params),
 		addCertificateApi: (params = {}) => vm.$u.post(apiurl.skillTraining.addCertificateUrl, params),
-		deleteCertificateApi: (params = {}) => vm.$u.delete(apiurl.skillTraining.deleteCertificateUrl + params.id, params)
+		deleteCertificateApi: (params = {}) => vm.$u.delete(apiurl.skillTraining.deleteCertificateUrl + params.id, params),
+		queryIsAttendedClassApi: (params = {}) => vm.$u.get(apiurl.skillTraining.queryIsAttendedClassUrl, params)
 	}
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {

+ 6 - 1
h5_web/common/http.interceptor.js

@@ -71,7 +71,12 @@ const install = (Vue, vm) => {
         return;
       }
 
-    } else return res;
+    } else if (res.code == 400) {
+			uni.showToast({
+				title: res.msg,
+				icon: 'error'
+			})
+		}
   }
 }
 

+ 5 - 3
h5_web/pages/bannerDetails/bannerDetails.vue

@@ -10,18 +10,20 @@
 	export default {
 		data() {
 			return {
-				dom: ''
+				dom: '',
+				type: 0
 			}
 		},
 		onLoad(page) {
 			if (page.id) {
-				this.getDetails(page.id)
+				this.getDetails(page.id);
+				this.type = page.type
 			}
 		},
 		methods: {
 			// 获取详情
 			getDetails(id) {
-				this.$u.api.indexApi.indexBannerListApi().then(res => {
+				this.$u.api.indexApi.indexBannerListApi({ type: this.type }).then(res => {
 						if (res.code === 200) {
 							const list = res.data
 							list.forEach(item => {

+ 3 - 3
h5_web/pages/basicTraining/onlineTrainingDetails/onlineTrainingDetails.vue

@@ -187,7 +187,7 @@
 						this.playedTime = Number(res.data.chapterList[this.videoIndex].playDuration)
 						this.query.tabId = res.data.chapterList[this.videoIndex].id
 						this.form.tabId = res.data.chapterList[this.videoIndex].id
-						this.query.pageNum = res.data.page;
+						this.query.pageNum = 1;
 						this.isPaly = true
 						this.getCommentList();
 					}
@@ -295,8 +295,8 @@
 			getCommentList() {
 				this.$u.api.training.getClassesCommentApi(this.query).then(res => {
 					if (res.code === 200) {
-						this.total = Number(res.data.total);
-						this.commentList = res.data.rows
+						this.total = Number(res.total);
+						this.commentList = res.rows
 					}
 				})
 			},

+ 5 - 4
h5_web/pages/index/index.vue

@@ -18,8 +18,8 @@
 					</view>
 				</view>
 				<view class="index-header-banner">
-					<u-swiper :list="bannerList" name="bannerUrl" border-radius="16" mode="round" height="440"
-						img-mode="scaleToFill" @click="swiperClick" bg-color="transparent"/>
+					<u-swiper :list="bannerList" name="bannerUrl" border-radius="0" mode="round" height="440"
+						img-mode="scaleToFill" @click="swiperClick"/>
 				</view>
 			</view>
 		</view>
@@ -200,7 +200,7 @@
 			 * 获取轮播广告
 			 */
 			getBannerList() {
-				this.$u.api.indexApi.indexBannerListApi().then(res => {
+				this.$u.api.indexApi.indexBannerListApi({ type: 0 }).then(res => {
 					if (res?.code === 200) {
 						this.bannerList = res.data.map(item => {
 							return {
@@ -228,7 +228,8 @@
 					this.$u.route({
 						url: 'pages/bannerDetails/bannerDetails',
 						params: {
-							id: this.bannerList[index].id
+							id: this.bannerList[index].id,
+							type: 0
 						}
 					})
 				}

+ 1 - 1
h5_web/pages/mine/skillsTraining/skillsTrainingDetails/skillsTrainingDetails.vue

@@ -154,7 +154,7 @@
 			 */
 			teacherInteract(item) {
 				let url =
-					`${this.config.timChatUrl}?userID=${this.vuex_user.userId}&title=教师互动&permission=1&type=retire&classId=${item.id}`
+					`${this.config.timChatUrl}?userID=${this.vuex_user.userId}&title=教师互动&permission=1&type=retire&classId=${item.classId}`
 				this.$u.route({
 					url: '/pages/webView/webView',
 					params: {

+ 4 - 3
h5_web/pages/policyInfo/policyInfo.vue

@@ -7,7 +7,7 @@
 	<view class="policyInfo">
 		<z-paging ref="policyInfoPaging" v-model="policyInfoList" @query="policyInfoQueryList">
 			<view class="policyInfo-banner" slot="top">
-				<u-swiper :list="bannerList" name="bannerUrl" border-radius="0" mode="round" height="372"
+				<u-swiper v-if="bannerList.length" :list="bannerList" name="bannerUrl" border-radius="0" mode="round" height="372"
 					img-mode="scaleToFill" @click="swiperClick" @change="swiperChange"></u-swiper>
 			</view>
 
@@ -85,7 +85,7 @@
 				});
 			},
 			getBannerList() {
-				this.$u.api.indexApi.indexBannerListApi().then(res => {
+				this.$u.api.indexApi.indexBannerListApi({ type: 2 }).then(res => {
 					if (!res) return;
 					this.bannerList = res?.data || [];
 				})
@@ -101,7 +101,8 @@
 					this.$u.route({
 						url: 'pages/bannerDetails/bannerDetails',
 						params: {
-							id: this.bannerList[index].id
+							id: this.bannerList[index].id,
+							type: 2
 						}
 					});
 				}

+ 17 - 10
h5_web/pages/recruitment/recruitment.vue

@@ -12,8 +12,8 @@
 
 			<!-- ###################################-- 轮播图 -- ################################### -->
 			<view class="recruitment-banner" slot="top">
-				<u-swiper :list="bannerList" name="bannerUrl" border-radius="0" mode="round" height="440"
-					img-mode="scaleToFill" @click="swiperClick"></u-swiper>
+				<u-swiper v-if="bannerList.length" :list="bannerList" name="bannerUrl" border-radius="0" mode="round"
+					height="440" img-mode="scaleToFill" @click="swiperClick"></u-swiper>
 			</view>
 
 			<!-- ###################################-- 请输入您关键词 -- ################################### -->
@@ -44,7 +44,7 @@
 										:data-id="recommendItem.id" :data-index="index">
 										<view class="img">
 											<u-image :src="recommendItem.logoUrl" mode="aspectFill" width="140"
-												height="140" border-radius="10"/>
+												height="140" border-radius="10" />
 										</view>
 										<view class="subject">{{recommendItem.companyName}}</view>
 										<view class="post u-text-center">
@@ -76,12 +76,14 @@
 				<view class="recruitment-dataarea-card" v-for="(item,index) in recruitmentJobList"
 					:key="'recruitmentJobList' + index" @tap="tapDataAreaCard(item)">
 					<view class="dataarea-card-left">
-						<u-image :src="item.companyLogoUrl" mode="aspectFill" width="120" height="120" border-radius="10"/>
+						<u-image :src="item.companyLogoUrl" mode="aspectFill" width="120" height="120"
+							border-radius="10" />
 					</view>
 					<view class="dataarea-card-content">
 						<view class="dataarea-content-left">
 							<view>{{item.postName}}</view>
-							<view class="content">{{ item.areaName }}|经验{{ item.workYear }}年|{{ getEducationBg(item.educationBg) }}</view>
+							<view class="content">
+								{{ item.areaName }}|经验{{ item.workYear }}年|{{ getEducationBg(item.educationBg) }}</view>
 							<view>{{item.companyName}}</view>
 						</view>
 						<view class="dataarea-content-right">
@@ -132,9 +134,11 @@
 			/**
 			 * 获取文化程度类别
 			 */
-			getVeteDegrEduc(){
-				this.$u.api.getDictdataUrl({key:'degr_educ'}).then(res=>{
-					if(res.code == 200){						
+			getVeteDegrEduc() {
+				this.$u.api.getDictdataUrl({
+					key: 'degr_educ'
+				}).then(res => {
+					if (res.code == 200) {
 						this.degrEducList = res.data.map(item => {
 							return {
 								...item,
@@ -167,7 +171,9 @@
 				});
 			},
 			getBannerList() {
-				this.$u.api.indexApi.indexBannerListApi().then(res => {
+				this.$u.api.indexApi.indexBannerListApi({
+					type: 1
+				}).then(res => {
 					if (res?.code === 200) {
 						this.bannerList = res.data;
 					}
@@ -184,7 +190,8 @@
 					this.$u.route({
 						url: 'pages/bannerDetails/bannerDetails',
 						params: {
-							id: this.bannerList[index].id
+							id: this.bannerList[index].id,
+							type: 1
 						}
 					})
 				}

+ 3 - 3
h5_web/pages/skillsTraining/courseDetailed/courseDetailed.vue

@@ -188,7 +188,7 @@
 						this.playedTime = Number(res.data.chapterList[this.videoIndex].playDuration)
 						this.query.tabId = res.data.chapterList[this.videoIndex].id
 						this.form.tabId = res.data.chapterList[this.videoIndex].id
-						this.query.pageNum = res.data.page;
+						this.query.pageNum = 1;
 						this.isPlay = true
 						this.getCommentList();
 					}
@@ -299,8 +299,8 @@
 				if (this.query.tabId) {
 					this.$u.api.training.getClassesCommentApi(this.query).then(res => {
 						if (res.code === 200) {
-							this.total = Number(res.data.total);
-							this.commentList = res.data.rows
+							this.total = Number(res.total);
+							this.commentList = res.rows
 						}
 					})
 				}

+ 34 - 3
h5_web/pages/skillsTraining/skillsTraining.vue

@@ -4,10 +4,12 @@
 
 		<!-- banner -->
 		<view class="training-banner">
-			<image src="../../static/img/banner-skillsTraining.png" mode="aspectFill"></image>
+			<u-swiper v-if="bannerList.length" :list="bannerList" name="bannerUrl" border-radius="0" mode="round" height="440"
+				img-mode="scaleToFill"></u-swiper>
+			<image v-else src="../../static/img/banner-skillsTraining.png" mode="aspectFill"></image>
 		</view>
 
-		<view class="training-total" @click="jumpPage('/pages/mine/skillsTraining/skillsTraining')">
+		<view class="training-total" @click="jumpPage('/pages/mine/skillsTraining/skillsTraining')" v-if="isAddClass">
 			<view class="training-total-left">
 				<view>我的技能培训</view>
 				<view>学习时长:{{ skillTotal.learnTime }}小时</view>
@@ -16,6 +18,11 @@
 				<u-icon name="arrow-right" size="44" color="#fff"></u-icon>
 			</view>
 		</view>
+		<view class="training-total" v-else>
+			<view class="training-total-left">
+				<view>您还未报班</view>
+			</view>
+		</view>
 
 		<!-- 报班通知 -->
 		<view class="training-notice">
@@ -80,15 +87,39 @@
 			return {
 				enrollList: [],
 				packageList: [],
-				skillTotal: {}
+				skillTotal: {},
+				isAddClass: false,
+				bannerList: []
 			}
 		},
 		onShow() {
 			this.getPackageList();
 			this.getClassNoticeList();
 			this.getTrainingTotal();
+			this.queryIsAttendedClass();
+			this.getBannerList();
 		},
 		methods: {
+			getBannerList() {
+				this.$u.api.indexApi.indexBannerListApi({ type: 4 }).then(res => {
+					if (res?.code === 200) {
+						this.bannerList = res.data;
+					}
+				})
+			},
+			/**
+			 * 查询是否报过班
+			 */
+			queryIsAttendedClass() {
+				this.$u.api.skillTraining.queryIsAttendedClassApi().then(res => {
+					if (res.code === 200) {
+						console.log(res)
+						if (res.data > 0) {
+							this.isAddClass = true
+						}
+					}
+				})
+			},
 			/**
 			 * 获取技能包列表
 			 */