zaijin 2 years ago
parent
commit
d13321a0b6
36 changed files with 3284 additions and 4251 deletions
  1. 19 19
      h5_web/App.vue
  2. 0 3
      h5_web/README.md
  3. 228 231
      h5_web/common/apiurl.js
  4. 18 25
      h5_web/common/config.js
  5. 235 235
      h5_web/common/http.api.js
  6. 31 33
      h5_web/common/http.interceptor.js
  7. 52 56
      h5_web/components/judge-auth/judge-auth.vue
  8. 36 42
      h5_web/main.js
  9. 26 29
      h5_web/package.json
  10. 664 646
      h5_web/pages.json
  11. 189 182
      h5_web/pages/basicTraining/basicTraining.vue
  12. 0 88
      h5_web/pages/basicTraining/basicTrainingDetails/basicTrainingDetails.vue
  13. 20 18
      h5_web/pages/entrepreneurshipGuidelines/previewPdf/previewPdf.vue
  14. 0 40
      h5_web/pages/entrepreneurshipGuidelines/previewPdf/previewPdf2.vue
  15. 409 392
      h5_web/pages/evaluationIntention/evaluationIntention.vue
  16. 171 163
      h5_web/pages/mine/mine.vue
  17. 8 1
      h5_web/pages/mine/skillsTraining/skillsTraining.scss
  18. 111 90
      h5_web/pages/mine/skillsTraining/skillsTraining.vue
  19. 181 163
      h5_web/pages/mine/skillsTraining/skillsTrainingDetails/skillsTrainingDetails.vue
  20. 177 164
      h5_web/pages/policyInfo/policyInfo.vue
  21. 0 115
      h5_web/pages/skillsTraining/skillsTraining - 副本.scss
  22. 0 283
      h5_web/pages/skillsTraining/skillsTraining - 副本.vue
  23. 244 229
      h5_web/pages/skillsTraining/skillsTraining.vue
  24. 0 116
      h5_web/pages/upgrade1/upgrade.scss
  25. 0 233
      h5_web/pages/upgrade1/upgrade.vue
  26. BIN
      h5_web/static/favicon.ico
  27. 21 22
      h5_web/store/$u.mixin.js
  28. 52 54
      h5_web/store/index.js
  29. 15 14
      h5_web/tabbarconfig.js
  30. 23 2
      h5_web/template.h5.html
  31. 5 5
      h5_web/utils/filter.js
  32. 29 30
      h5_web/utils/getUrlParams.js
  33. 0 44
      h5_web/utils/pay.js
  34. 0 175
      h5_web/utils/wxapi.js
  35. 306 296
      h5_web/uview-ui/components/u-navbar/u-navbar.vue
  36. 14 13
      h5_web/vue.config.js

+ 19 - 19
h5_web/App.vue

@@ -1,24 +1,24 @@
 <script>
-	export default {
-		onLaunch: function() {
-			// console.log('App Launch')
-		},
-		onShow: function() {
-			// console.log('App Show')
-		},
-		onHide: function() {
-			// console.log('App Hide')
-		}
-	}
+export default {
+  onLaunch: function () {
+    // console.log('App Launch')
+  },
+  onShow: function () {
+    // console.log('App Show')
+  },
+  onHide: function () {
+    // console.log('App Hide')
+  }
+};
 </script>
 
 <style lang="scss">
-	@import '@/static/css/quill.bubble.scss';
-	@import '@/static/css/quill.snow.scss';
-	@import '@/static/css/quill.core.scss';
-	/*每个页面公共css */
-	@import "uview-ui/index.scss";
-	#achievement .u-form-item--right__content__slot {
-		display: block;
-	}
+@import '@/static/css/quill.bubble.scss';
+@import '@/static/css/quill.snow.scss';
+@import '@/static/css/quill.core.scss';
+/*每个页面公共css */
+@import 'uview-ui/index.scss';
+#achievement .u-form-item--right__content__slot {
+  display: block;
+}
 </style>

+ 0 - 3
h5_web/README.md

@@ -3,6 +3,3 @@
 #### 需安装uView
 ##### npm install uview-ui
 
-#### 集成微信支付api (不需要可以删除)
-
-#####  有比较好或者使用的h5组件可以引入

+ 228 - 231
h5_web/common/apiurl.js

@@ -2,242 +2,239 @@
 	接口统一管理
 */
 const apiurl = {
-	// 手机登录验证码
-	phoneLoginCodeUrl: '/auth/sendSmsCode',
-	// 退出登录
-	logoutUrl: '/auth/logout',
-	// 手机登录验证码验证
-	phoneLoginAuthUrl: '/auth/verifyCode',
-	// 获取系统信息
-	getSystermsApi: '/systerms/getByType/',
-	// 新闻详情
-	newsDetailsUrl: '/sec/article/door/info',
-	// 政策法规详情
-	policyNewsDetailsUrl: '/policy/article/door/info',
-	// 提交申请材料 认证
-	veteEducUrl: '/veteEduc',
-	//认证状态查询
-	veteEducCheckUrl: '/veteEduc/check',
-	// 我的详细信息
-	memberinfoUrl: '/memberinfo',
-	// 政策法规列表
-	policyNewsListUrl: '/policy/article/door/list',
-	// 枚举值key查询
-	dictdataUrl: '/sys/dictdata',
-	// 适应性培训课程列表
-	adaptTrainOnlineUrl: '/adaptTrainOnline/list',
-	// 适应性培训课程详情
-	adaptTrainOnlineDetailsUrl: '/adaptTrainOnline/',
-	// 适应性培训学习进度
-	adaptTrainOnlineRateUrl: '/adaptTrainOnline/study',
-	// 上传适应性培训视频播放情况
-	upAdaptTrainOnlineInfoUrl: '/adaptTrainOnline/duration',
-	// 适应性培训线下内容
-	adaptTrainOfflineUrl: '/adaptTrainOffline/new/offline',
-	// 查询线下培训详情
-	adaptTrainIdOfflineUrl: '/adaptTrainOffline/',
-	// 页面点击统计
-	analysisUrl: '/sys/analysis',
-	// 线下培训签到
-	signOfflineUrl: '/adaptTrainOffline/sign',
-	// 根据身份证号读取信息
-	getIdInfoUrl: '/veteEduc/idcard/',
-	// 合作学校分页数据
-	getSchoolListUrl: '/school/list',
-	// 修改用户信息
-	modifyUserInfoUrl: '/memberinfo',
+  // 手机登录验证码
+  phoneLoginCodeUrl: '/auth/sendSmsCode',
+  // 退出登录
+  logoutUrl: '/auth/logout',
+  // 手机登录验证码验证
+  phoneLoginAuthUrl: '/auth/verifyCode',
+  // 获取系统信息
+  getSystermsApi: '/systerms/getByType/',
+  // 新闻详情
+  newsDetailsUrl: '/sec/article/door/info',
+  // 政策法规详情
+  policyNewsDetailsUrl: '/policy/article/door/info',
+  // 提交申请材料 认证
+  veteEducUrl: '/veteEduc',
+  //认证状态查询
+  veteEducCheckUrl: '/veteEduc/check',
+  // 我的详细信息
+  memberinfoUrl: '/memberinfo',
+  // 政策法规列表
+  policyNewsListUrl: '/policy/article/door/list',
+  // 枚举值key查询
+  dictdataUrl: '/sys/dictdata',
+  // 适应性培训课程列表
+  adaptTrainOnlineUrl: '/adaptTrainOnline/list',
+  // 适应性培训课程详情
+  adaptTrainOnlineDetailsUrl: '/adaptTrainOnline/',
+  // 适应性培训学习进度
+  adaptTrainOnlineRateUrl: '/adaptTrainOnline/study',
+  // 上传适应性培训视频播放情况
+  upAdaptTrainOnlineInfoUrl: '/adaptTrainOnline/duration',
+  // 适应性培训线下内容
+  adaptTrainOfflineUrl: '/adaptTrainOffline/new/offline',
+  // 查询线下培训详情
+  adaptTrainIdOfflineUrl: '/adaptTrainOffline/',
+  // 页面点击统计
+  analysisUrl: '/sys/analysis',
+  // 线下培训签到
+  signOfflineUrl: '/adaptTrainOffline/sign',
+  // 根据身份证号读取信息
+  getIdInfoUrl: '/veteEduc/idcard/',
+  // 合作学校分页数据
+  getSchoolListUrl: '/school/list',
+  // 修改用户信息
+  modifyUserInfoUrl: '/memberinfo',
 
-	// 查看技能包更多课程
-	getMoreCourseListUrl: '/learncourse/list/',
+  // 查看技能包更多课程
+  getMoreCourseListUrl: '/learncourse/list/',
 
-	/**
-	 * 首页模块
-	 */
-	index: {
-		// 获取消息未读条数
-		getUnreadInfoNumUrl: '/notice/countUnread',
-		// 首页轮播
-		indexBannerListUrl: '/sysadv/list',
-		// 获取首页三条最新消息
-		getNewestInfoUrl: '/notice/queryNewest',
-		// 首页新闻列表
-		getIndexNewsListUrl: '/sec/article/door/list',
-	},
-	/**
-	 * 通知消息模块
-	 */
-	notice: {
-		// 查询每类通知未读的条数
-		getClassifyUnreadNumUrl: '/notice/classifyUnreadCount',
-		// 获取各种类型消息
-		getNoticeListByTypeUrl: '/notice/list/',
-		// 获取通知详情
-		getNoticeDetailsUrl: '/notice/getDetail/'
-	},
+  /**
+   * 首页模块
+   */
+  index: {
+    // 获取消息未读条数
+    getUnreadInfoNumUrl: '/notice/countUnread',
+    // 首页轮播
+    indexBannerListUrl: '/sysadv/list',
+    // 获取首页三条最新消息
+    getNewestInfoUrl: '/notice/queryNewest',
+    // 首页新闻列表
+    getIndexNewsListUrl: '/sec/article/door/list'
+  },
+  /**
+   * 通知消息模块
+   */
+  notice: {
+    // 查询每类通知未读的条数
+    getClassifyUnreadNumUrl: '/notice/classifyUnreadCount',
+    // 获取各种类型消息
+    getNoticeListByTypeUrl: '/notice/list/',
+    // 获取通知详情
+    getNoticeDetailsUrl: '/notice/getDetail/'
+  },
 
-	// 学院模块
-	school: {
-		// 合作学校分页数据
-		getSchoolListUrl: '/school/list',
-		// 合作学校数据(无分页)
-		getListUrl: '/school/selectList',
-		// 获取学院详情
-		getSchoolDetailsUrl: '/school/getDetail/',
-		// 获取专业详情
-		getProfessonDetailsUrl: '/school/getProfessonDetail/',
-		// 获取学院专业包
-		getProfessonUrl: '/learnpackage/list/',
-		// 获取学院专业包详情
-		getLearnpackageDetailsUrl: '/learnpackage/getDetail/',
-		// 获取学院专业包课程详情
-		getPackageCourseDetailsUrl: '/learncourse/getDetail/',
-		// 获取学院招生就业详情
-		getSchoolIntroductionUrl: '/school/selectIntro/'
+  // 学院模块
+  school: {
+    // 合作学校分页数据
+    getSchoolListUrl: '/school/list',
+    // 合作学校数据(无分页)
+    getListUrl: '/school/selectList',
+    // 获取学院详情
+    getSchoolDetailsUrl: '/school/getDetail/',
+    // 获取专业详情
+    getProfessonDetailsUrl: '/school/getProfessonDetail/',
+    // 获取学院专业包
+    getProfessonUrl: '/learnpackage/list/',
+    // 获取学院专业包详情
+    getLearnpackageDetailsUrl: '/learnpackage/getDetail/',
+    // 获取学院专业包课程详情
+    getPackageCourseDetailsUrl: '/learncourse/getDetail/',
+    // 获取学院招生就业详情
+    getSchoolIntroductionUrl: '/school/selectIntro/'
+  },
 
-	},
+  // 公司模块
+  company: {
+    // 公司列表
+    getCompanyListUrl: '/company/list',
+    // 公司详情
+    getCompanyDetailsUrl: '/company/getDetail/',
+    // 岗位列表
+    getCompanyPostListUrl: '/companypost/list/',
+    // 岗位详情
+    getPostDetailsUrl: '/companypost/getDetail/',
+    // 投递简历
+    deliveryResumeUrl: '/delivery/add',
+    // 判断是否已投递
+    judgeIsSubmitUrl: '/delivery/queryIsDelivered/'
+  },
 
-	// 公司模块
-	company: {
-		// 公司列表
-		getCompanyListUrl: '/company/list',
-		// 公司详情
-		getCompanyDetailsUrl: '/company/getDetail/',
-		// 岗位列表
-		getCompanyPostListUrl: '/companypost/list/',
-		// 岗位详情
-		getPostDetailsUrl: '/companypost/getDetail/',
-		// 投递简历
-		deliveryResumeUrl: '/delivery/add',
-		// 判断是否已投递
-		judgeIsSubmitUrl: '/delivery/queryIsDelivered/'
-	},
+  /**
+   * 政策资讯模块
+   */
+  policyInfo: {
+    // 政策资讯列表
+    getPolicyInfoListUrl: '/policy/article/door/list',
+    // 政策资讯详情
+    getPolicyInfoDetailsUrl: '/policy/article/door/info'
+  },
 
-	/**
-	 * 政策资讯模块
-	 */
-	policyInfo: {
-		// 政策资讯列表
-		getPolicyInfoListUrl: '/policy/article/door/list',
-		// 政策资讯详情
-		getPolicyInfoDetailsUrl: '/policy/article/door/info'
-	},
+  // 我的投递
+  delivery: {
+    deliveryListUrl: '/delivery/myDeliveredList'
+  },
 
-	// 我的投递
-	delivery: {
-		deliveryListUrl: '/delivery/myDeliveredList'
-	},
+  /**
+   * 招聘就业模块
+   */
+  recruitment: {
+    // 企业推荐列表
+    getRecommendListUrl: '/company/queryRecommendList',
+    // 招聘就业岗位列表
+    getRecruitmentJobListUrl: '/companypost/pageList',
+    // 岗位详情
+    getJobDetailsUrl: '/companypost/getDetail'
+  },
+  /**
+   * 我的面试
+   */
+  interview: {
+    // 我的面试列表
+    getInterviewListUrl: '/delivery/myInterviewList',
+    // 修改面试状态
+    changeInterviewStateUrl: '/delivery/updateStatus'
+  },
+  /**
+   * 我的简历
+   */
+  resume: {
+    // 保存求职意向
+    submitJobIntentionUrl: '/memberinfo/saveJobIntention',
+    // 保存自我评价
+    submitSelfAssessmentUrl: '/memberinfo/saveSelfAssessment'
+  },
+  /**
+   * 我的评价
+   */
+  evaluation: {
+    // 获取我的评价列表
+    getEvaluationListUrl: ''
+  },
+  /**
+   * 我的
+   */
+  mine: {
+    // 提交就业情况
+    employmentConditionUrl: '/employmentcollect',
+    // 查询积分统计
+    totalCountUrl: '/integral/count',
+    // 积分列表
+    integralListUrl: '/integral/list',
+    // 获取个人统计(技能培训,学习时长,获得面试)
+    getCountResultUrl: '/memberinfo/getCountResult',
+    // 获取个人总积分
+    getIntegralTotalUrl: '/integral/total',
+    // 修改在职状态
+    updatePositionStatusUrl: '/memberinfo/updateJobStatus'
+  },
+  /**
+   * 适应性培训
+   */
+  training: {
+    // 获取线上课程列表
+    getOnlineListurl: '/adaptTrainOnline/queryList',
+    // 课程状态
+    getOnlineStatusUrl: '/adaptTrainOnline/queryStatus',
+    // 课程详情
+    getOnlineDetailsUrl: '/adaptTrainOnline/',
+    // 保存课程播放时长
+    videoTimeLongUrl: '/record/duration',
+    // 获取课程评论
+    getClassesCommentUrl: '/coursecomment',
+    // 添加评论
+    addClassesCommentUrl: '/coursecomment',
+    // 线下课程
+    getOfflineListUrl: '/adaptTrainOffline/queryList',
+    // 获取线下课程详情
+    getOfflineDetailsUrl: '/adaptTrainOffline/getDetail/'
+  },
+  /**
+   * 技能培训模块接口
+   */
+  skillTraining: {
+    // 查询技术包列表
+    getPackageListUrl: '/learnpackage/skillList',
+    // 报名
+    signUpClassUrl: '/learnmember',
+    // 查询技能包详情
+    getPackageDetailsUrl: '/learnpackage/getSkillDetail/',
+    // 获取报班通知列表
+    getClassNoticeUrl: '/learnpackage/classNoticeList',
+    // 获取个人技能培训统计
+    getTrainingTotalUrl: '/learnpackage/count',
+    // 检验是否已经报过该技能包
+    isApplyTrainingUrl: '/learnmember/isApply/',
+    // 我的技能培训列表
+    getMyTrainingListUrl: '/learnmember/myTrainList/',
+    // 获取我的技能培训详情
+    getMyTrainingDetailsUrl: '/learnmember/myTrainDetail/',
+    // 获取证书列表
+    getCertificateListUrl: '/certificate/list/',
+    // 添加证书
+    addCertificateUrl: '/certificate',
+    // 删除证书
+    deleteCertificateUrl: '/certificate/',
+    // 查询学生是否报过名
+    queryIsAttendedClassUrl: '/learnpackage/queryIsAttendedClass'
+  },
+  // 创业
+  entrepreneurship: {
+    addEntrepreneurshipUrl: '/guidance',
+    getEntrepreneurshipListUrl: '/guidance',
+    getEntrepreneurshipDetailsUrl: '/guidance/getDetail/'
+  }
+};
 
-	/**
-	 * 招聘就业模块
-	 */
-	recruitment: {
-		// 企业推荐列表
-		getRecommendListUrl: '/company/queryRecommendList',
-		// 招聘就业岗位列表
-		getRecruitmentJobListUrl: '/companypost/pageList',
-		// 岗位详情
-		getJobDetailsUrl: '/companypost/getDetail'
-	},
-	/**
-	 * 我的面试
-	 */
-	interview: {
-		// 我的面试列表
-		getInterviewListUrl: '/delivery/myInterviewList',
-		// 修改面试状态
-		changeInterviewStateUrl: '/delivery/updateStatus'
-	},
-	/**
-	 * 我的简历
-	 */
-	resume: {
-		// 保存求职意向
-		submitJobIntentionUrl: '/memberinfo/saveJobIntention',
-		// 保存自我评价
-		submitSelfAssessmentUrl: '/memberinfo/saveSelfAssessment'
-	},
-	/**
-	 * 我的评价
-	 */
-	evaluation: {
-		// 获取我的评价列表
-		getEvaluationListUrl: ''
-	},
-	/**
-	 * 我的
-	 */
-	mine: {
-		// 提交就业情况
-		employmentConditionUrl: '/employmentcollect',
-		// 查询积分统计
-		totalCountUrl: '/integral/count',
-		// 积分列表
-		integralListUrl: '/integral/list',
-		// 获取个人统计(技能培训,学习时长,获得面试)
-		getCountResultUrl: '/memberinfo/getCountResult',
-		// 获取个人总积分
-		getIntegralTotalUrl: '/integral/total',
-		// 修改在职状态
-		updatePositionStatusUrl: '/memberinfo/updateJobStatus'
-	},
-	/**
-	 * 适应性培训
-	 */
-	training: {
-		// 获取线上课程列表
-		getOnlineListurl: '/adaptTrainOnline/queryList',
-		// 课程状态
-		getOnlineStatusUrl: '/adaptTrainOnline/queryStatus',
-		// 课程详情
-		getOnlineDetailsUrl: '/adaptTrainOnline/',
-		// 保存课程播放时长
-		videoTimeLongUrl: '/record/duration',
-		// 获取课程评论
-		getClassesCommentUrl: '/coursecomment',
-		// 添加评论
-		addClassesCommentUrl: '/coursecomment',
-		// 线下课程
-		getOfflineListUrl: '/adaptTrainOffline/queryList',
-		// 获取线下课程详情
-		getOfflineDetailsUrl: '/adaptTrainOffline/getDetail/'
-	},
-	/**
-	 * 技能培训模块接口
-	 */
-	skillTraining: {
-		// 查询技术包列表
-		getPackageListUrl: '/learnpackage/skillList',
-		// 报名
-		signUpClassUrl: '/learnmember',
-		// 查询技能包详情
-		getPackageDetailsUrl: '/learnpackage/getSkillDetail/',
-		// 获取报班通知列表
-		getClassNoticeUrl: '/learnpackage/classNoticeList',
-		// 获取个人技能培训统计
-		getTrainingTotalUrl: '/learnpackage/count',
-		// 检验是否已经报过该技能包
-		isApplyTrainingUrl: '/learnmember/isApply/',
-		// 我的技能培训列表
-		getMyTrainingListUrl: '/learnmember/myTrainList/',
-		// 获取我的技能培训详情
-		getMyTrainingDetailsUrl: '/learnmember/myTrainDetail/',
-		// 获取证书列表
-		getCertificateListUrl: '/certificate/list/',
-		// 添加证书
-		addCertificateUrl: '/certificate',
-		// 删除证书
-		deleteCertificateUrl: '/certificate/',
-		// 查询学生是否报过名
-		queryIsAttendedClassUrl: '/learnpackage/queryIsAttendedClass'
-	},
-	// 创业
-	entrepreneurship: {
-		addEntrepreneurshipUrl: '/guidance',
-		getEntrepreneurshipListUrl: '/guidance',
-		getEntrepreneurshipDetailsUrl: '/guidance/getDetail/'
-	}
-}
-
-export {
-	apiurl
-}
+export { apiurl };

+ 18 - 25
h5_web/common/config.js

@@ -1,31 +1,24 @@
 /**
- * 配置通用 
+ * 配置通用
  */
-// const baseUrl = 'https://wx.hw.hongweisoft.com/veterans' // 测试环境地址
-// const baseUrl = 'http://api.veterans.hongweisoft.com' // 正式环境地址
-const node_dev = process.env.H_NODE_ENV
-let {
-	baseUrl,
-	timChatUrl,
-	viewInterviewUrl
-} = {
-	baseUrl: 'https://wx.hw.hongweisoft.com/veterans', // 默认测试
-	timChatUrl: 'https://veterh5.hw.hongweisoft.com/chat/pages/login/login', // 默认测试
-	viewInterviewUrl: 'https://veterhwebchat.hw.hongweisoft.com/#/' // 默认测试
-}
+const node_dev = process.env.H_NODE_ENV;
+let { baseUrl, timChatUrl, viewInterviewUrl } = {
+  baseUrl: 'https://wx.hw.hongweisoft.com/veterans', // 默认测试
+  timChatUrl: 'https://veterh5.hw.hongweisoft.com/chat/pages/login/login', // 默认测试
+  viewInterviewUrl: 'https://veterhwebchat.hw.hongweisoft.com/#/' // 默认测试
+};
 console.log(node_dev);
 if (node_dev) {
-	baseUrl = process.env.H_BASE_URL
-	timChatUrl = process.env.H_TIM_CHAT_URL
-	viewInterviewUrl = process.env.H_VIDEO_CHAT_URL
+  baseUrl = process.env.H_BASE_URL;
+  timChatUrl = process.env.H_TIM_CHAT_URL;
+  viewInterviewUrl = process.env.H_VIDEO_CHAT_URL;
 }
 const config = {
-	baseUrl: `${baseUrl}/app`,
-	uploadUrl: `${baseUrl}/file/upload/single/minio`,
-	timChatUrl,
-	viewInterviewUrl,
-	version: '1.0.2'
-}
-export {
-	config
-}
+  baseUrl: `${baseUrl}/app`,
+  uploadUrl: `${baseUrl}/file/upload/single/minio`,
+  timChatUrl,
+  viewInterviewUrl,
+	previewPdfUrl: 'https://view.xdocin.com/view',
+  version: '1.0.2'
+};
+export { config };

+ 235 - 235
h5_web/common/http.api.js

@@ -1,251 +1,251 @@
-import {
-	apiurl
-} from "./apiurl.js"
+import { apiurl } from './apiurl.js';
 
 // 此处第二个参数vm,就是我们在页面使用的this,你可以通过vm获取vuex等操作,更多内容详见uView对拦截器的介绍部分:
 const install = (Vue, vm) => {
-	let getPhoneLoginCode = (params = {}) => vm.$u.post(apiurl.phoneLoginCodeUrl, params);
-	let logoutApi = (params = {}) => vm.$u.delete(apiurl.logoutUrl, params);
-	let phoneLoginAuth = (params = {}) => vm.$u.post(apiurl.phoneLoginAuthUrl, {
-		code: params.code
-	}, {
-		Authorization: `Bearer ${params.accessToken}`,
-		user_id: params.userId
-	});
-	// 获取自定义富文本内容: 0-包月须知 1-用户服务条款 2-隐私权政策信息 3-收费标准 4-退款温馨提示
-	let getSysterms = (params = {}) => vm.$u.get(apiurl.getSystermsApi + params.termsType);
-	// 新闻详情
-	let getNewsDetails = (params = {}) => vm.$u.get(apiurl.newsDetailsUrl, params);
-	// 政策法规详情
-	let getPolicyNewsDetails = (params = {}) => vm.$u.get(apiurl.policyNewsDetailsUrl, params);
-	// 军人认证
-	let veteEduc = (params = {}) => vm.$u.post(apiurl.veteEducUrl, params);
-	// 认证状态查询
-	let getVeteEducCheck = (params = {}) => vm.$u.get(apiurl.veteEducCheckUrl, params);
-	//我的认证申请
-	let getVeteEducData = (params = {}) => vm.$u.get(apiurl.veteEducUrl, params);
-	// 我的详细信息
-	let getmemberinfo = (params = {}) => vm.$u.get(apiurl.memberinfoUrl, params);
-	// 首页新闻列表
-	let getpolicyNewsList = (params = {}) => vm.$u.get(apiurl.policyNewsListUrl, params);
-	// 枚举值key查询 key 新闻类型 news_type, 政策法规 policy_type 人员属性 vete_attribute
-	let getDictdataUrl = (params = {}) => vm.$u.get(apiurl.dictdataUrl, params);
-	// 适应性培训课程列表
-	let getAdaptTrainOnline = (params = {}) => vm.$u.get(apiurl.adaptTrainOnlineUrl, params);
-	// 适应性培训课程详情
-	let getAdaptTrainOnlineDetails = (params = {}) => vm.$u.get(apiurl.adaptTrainOnlineDetailsUrl + params.id);
-	// 适应性培训学习进度
-	let getAdaptTrainOnlineRate = (params = {}) => vm.$u.post(apiurl.adaptTrainOnlineRateUrl, params);
-	// 上传适应性培训视频播放情况
-	let upAdaptTrainOnlineInfo = (params = {}) => vm.$u.post(apiurl.upAdaptTrainOnlineInfoUrl, params);
-	// 适应性培训线下内容
-	let getAdaptTrainOffline = (params = {}) => vm.$u.get(apiurl.adaptTrainOfflineUrl, params);
-	// 查询线下培训详情
-	let getAdaptTrainIdOffline = (params = {}) => vm.$u.get(apiurl.adaptTrainIdOfflineUrl + params.id);
-	// 页面点击统计
-	let postAnalysis = (params = {}) => vm.$u.post(apiurl.analysisUrl, params);
-	// 线下培训签到
-	let postSignOffline = (params = {}) => vm.$u.post(apiurl.signOfflineUrl, params);
-	// 根据身份证号读取信息
-	let getIdInfo = (params = {}) => vm.$u.get(apiurl.getIdInfoUrl + params.id);
-	// 获取学院分页数据
-	let getSchoolList = (params = {}) => vm.$u.get(apiurl.getSchoolListUrl, params)
-	// 修改用户信息
-	let modifyUserInfo = (params = {}) => vm.$u.put(apiurl.modifyUserInfoUrl, params)
-	
-	let getMoreCourseListApi = (params = {}) => vm.$u.get(apiurl.getMoreCourseListUrl + params.id, params)
-	/**
-	 * 首页模块
-	 */
-	let indexApi = {
-		// 获取消息未读条数
-		getUnreadInfoNumApi: (params = {}) => vm.$u.get(apiurl.index.getUnreadInfoNumUrl, params),
-		// 获取轮播
-		indexBannerListApi: (params = {}) => vm.$u.get(apiurl.index.indexBannerListUrl, params),
-		// 获取最新三条消息
-		getNewestInfoApi: (params = {}) => vm.$u.get(apiurl.index.getNewestInfoUrl, params),
-		// 首页新闻列表
-		getIndexNewsListApi: (params = {}) => vm.$u.get(apiurl.index.getIndexNewsListUrl, params)
-	};
+  let getPhoneLoginCode = (params = {}) => vm.$u.post(apiurl.phoneLoginCodeUrl, params);
+  let logoutApi = (params = {}) => vm.$u.delete(apiurl.logoutUrl, params);
+  let phoneLoginAuth = (params = {}) =>
+    vm.$u.post(
+      apiurl.phoneLoginAuthUrl,
+      {
+        code: params.code
+      },
+      {
+        Authorization: `Bearer ${params.accessToken}`,
+        user_id: params.userId
+      }
+    );
+  // 获取自定义富文本内容: 0-包月须知 1-用户服务条款 2-隐私权政策信息 3-收费标准 4-退款温馨提示
+  let getSysterms = (params = {}) => vm.$u.get(apiurl.getSystermsApi + params.termsType);
+  // 新闻详情
+  let getNewsDetails = (params = {}) => vm.$u.get(apiurl.newsDetailsUrl, params);
+  // 政策法规详情
+  let getPolicyNewsDetails = (params = {}) => vm.$u.get(apiurl.policyNewsDetailsUrl, params);
+  // 军人认证
+  let veteEduc = (params = {}) => vm.$u.post(apiurl.veteEducUrl, params);
+  // 认证状态查询
+  let getVeteEducCheck = (params = {}) => vm.$u.get(apiurl.veteEducCheckUrl, params);
+  //我的认证申请
+  let getVeteEducData = (params = {}) => vm.$u.get(apiurl.veteEducUrl, params);
+  // 我的详细信息
+  let getmemberinfo = (params = {}) => vm.$u.get(apiurl.memberinfoUrl, params);
+  // 首页新闻列表
+  let getpolicyNewsList = (params = {}) => vm.$u.get(apiurl.policyNewsListUrl, params);
+  // 枚举值key查询 key 新闻类型 news_type, 政策法规 policy_type 人员属性 vete_attribute
+  let getDictdataUrl = (params = {}) => vm.$u.get(apiurl.dictdataUrl, params);
+  // 适应性培训课程列表
+  let getAdaptTrainOnline = (params = {}) => vm.$u.get(apiurl.adaptTrainOnlineUrl, params);
+  // 适应性培训课程详情
+  let getAdaptTrainOnlineDetails = (params = {}) => vm.$u.get(apiurl.adaptTrainOnlineDetailsUrl + params.id);
+  // 适应性培训学习进度
+  let getAdaptTrainOnlineRate = (params = {}) => vm.$u.post(apiurl.adaptTrainOnlineRateUrl, params);
+  // 上传适应性培训视频播放情况
+  let upAdaptTrainOnlineInfo = (params = {}) => vm.$u.post(apiurl.upAdaptTrainOnlineInfoUrl, params);
+  // 适应性培训线下内容
+  let getAdaptTrainOffline = (params = {}) => vm.$u.get(apiurl.adaptTrainOfflineUrl, params);
+  // 查询线下培训详情
+  let getAdaptTrainIdOffline = (params = {}) => vm.$u.get(apiurl.adaptTrainIdOfflineUrl + params.id);
+  // 页面点击统计
+  let postAnalysis = (params = {}) => vm.$u.post(apiurl.analysisUrl, params);
+  // 线下培训签到
+  let postSignOffline = (params = {}) => vm.$u.post(apiurl.signOfflineUrl, params);
+  // 根据身份证号读取信息
+  let getIdInfo = (params = {}) => vm.$u.get(apiurl.getIdInfoUrl + params.id);
+  // 获取学院分页数据
+  let getSchoolList = (params = {}) => vm.$u.get(apiurl.getSchoolListUrl, params);
+  // 修改用户信息
+  let modifyUserInfo = (params = {}) => vm.$u.put(apiurl.modifyUserInfoUrl, params);
 
-	/**
-	 * 通知消息模块
-	 */
-	let noticeApi = {
-		// 查询每类通知未读的条数
-		getClassifyUnreadNumApi: (params = {}) => vm.$u.get(apiurl.notice.getClassifyUnreadNumUrl, params),
-		// 获取各种类型消息
-		getNoticeListByTypeApi: (params = {}) => vm.$u.get(apiurl.notice.getNoticeListByTypeUrl + params.type,
-			params),
-		// 获取通知消息详情
-		getNoticeDetailsApi: (params = {}) => vm.$u.get(apiurl.notice.getNoticeDetailsUrl + params.id, params)
-	};
+  let getMoreCourseListApi = (params = {}) => vm.$u.get(apiurl.getMoreCourseListUrl + params.id, params);
+  /**
+   * 首页模块
+   */
+  let indexApi = {
+    // 获取消息未读条数
+    getUnreadInfoNumApi: (params = {}) => vm.$u.get(apiurl.index.getUnreadInfoNumUrl, params),
+    // 获取轮播
+    indexBannerListApi: (params = {}) => vm.$u.get(apiurl.index.indexBannerListUrl, params),
+    // 获取最新三条消息
+    getNewestInfoApi: (params = {}) => vm.$u.get(apiurl.index.getNewestInfoUrl, params),
+    // 首页新闻列表
+    getIndexNewsListApi: (params = {}) => vm.$u.get(apiurl.index.getIndexNewsListUrl, params)
+  };
 
-	// 学院模块
-	let school = {
-		// 获取学院分页数据
-		getSchoolList: (params = {}) => vm.$u.get(apiurl.school.getSchoolListUrl, params),
-		// 不带分页列表
-		getList: (params = {}) => vm.$u.get(apiurl.school.getListUrl, params),
-		// 通过学院id获取详情
-		getSchoolDetails: (params = {}) => vm.$u.get(apiurl.school.getSchoolDetailsUrl + params.id),
-		// 通过专业id获取专业详情
-		getProfessonDetails: (params = {}) => vm.$u.get(apiurl.school.getProfessonDetailsUrl + params.id),
-		// 通过学院id获取专业
-		getProfesson: (params = {}) => vm.$u.get(apiurl.school.getProfessonUrl + params.id),
-		// 获取学院专业包详情
-		getLearnpackageDetails: (params = {}) => vm.$u.get(apiurl.school.getLearnpackageDetailsUrl + params.id),
-		// 获取学院专业包课程详情
-		getPackageCourseDetail: (params = {}) => vm.$u.get(apiurl.school.getPackageCourseDetailsUrl + params
-			.id),
-		// 获取学校招生详情
-		getSchoolIntroduction: (params = {}) => vm.$u.get(apiurl.school.getSchoolIntroductionUrl + params.id)
-	};
+  /**
+   * 通知消息模块
+   */
+  let noticeApi = {
+    // 查询每类通知未读的条数
+    getClassifyUnreadNumApi: (params = {}) => vm.$u.get(apiurl.notice.getClassifyUnreadNumUrl, params),
+    // 获取各种类型消息
+    getNoticeListByTypeApi: (params = {}) => vm.$u.get(apiurl.notice.getNoticeListByTypeUrl + params.type, params),
+    // 获取通知消息详情
+    getNoticeDetailsApi: (params = {}) => vm.$u.get(apiurl.notice.getNoticeDetailsUrl + params.id, params)
+  };
 
-	// 公司模块
-	let company = {
-		// 获取公司列表
-		getCompanyList: (params = {}) => vm.$u.get(apiurl.company.getCompanyListUrl, params),
-		// 获取公司详情
-		getCompanyDetails: (params = {}) => vm.$u.get(apiurl.company.getCompanyDetailsUrl + params.id),
-		// 获取岗位列表
-		getCompanyPostList: (params = {}) => vm.$u.get(apiurl.company.getCompanyPostListUrl + params.id,
-			params),
-		// 获取岗位详情
-		getPostDetails: (params = {}) => vm.$u.get(apiurl.company.getPostDetailsUrl + params.id),
-		// 投递简历
-		deliveryResume: (params = {}) => vm.$u.post(apiurl.company.deliveryResumeUrl, params),
-		// 判断是否已投递
-		judgeIsSubmit: (params = {}) => vm.$u.get(apiurl.company.judgeIsSubmitUrl + params.id)
-	};
+  // 学院模块
+  let school = {
+    // 获取学院分页数据
+    getSchoolList: (params = {}) => vm.$u.get(apiurl.school.getSchoolListUrl, params),
+    // 不带分页列表
+    getList: (params = {}) => vm.$u.get(apiurl.school.getListUrl, params),
+    // 通过学院id获取详情
+    getSchoolDetails: (params = {}) => vm.$u.get(apiurl.school.getSchoolDetailsUrl + params.id),
+    // 通过专业id获取专业详情
+    getProfessonDetails: (params = {}) => vm.$u.get(apiurl.school.getProfessonDetailsUrl + params.id),
+    // 通过学院id获取专业
+    getProfesson: (params = {}) => vm.$u.get(apiurl.school.getProfessonUrl + params.id),
+    // 获取学院专业包详情
+    getLearnpackageDetails: (params = {}) => vm.$u.get(apiurl.school.getLearnpackageDetailsUrl + params.id),
+    // 获取学院专业包课程详情
+    getPackageCourseDetail: (params = {}) => vm.$u.get(apiurl.school.getPackageCourseDetailsUrl + params.id),
+    // 获取学校招生详情
+    getSchoolIntroduction: (params = {}) => vm.$u.get(apiurl.school.getSchoolIntroductionUrl + params.id)
+  };
 
-	// 政策资讯模块
-	let policyInfo = {
-		// 政策资讯列表
-		getPolicyInfoList: (params = {}) => vm.$u.get(apiurl.policyInfo.getPolicyInfoListUrl, params),
-		// 政策资讯详情
-		getPolicyInfoDetails: (params = {}) => vm.$u.get(apiurl.policyInfo.getPolicyInfoDetailsUrl, params)
-	};
+  // 公司模块
+  let company = {
+    // 获取公司列表
+    getCompanyList: (params = {}) => vm.$u.get(apiurl.company.getCompanyListUrl, params),
+    // 获取公司详情
+    getCompanyDetails: (params = {}) => vm.$u.get(apiurl.company.getCompanyDetailsUrl + params.id),
+    // 获取岗位列表
+    getCompanyPostList: (params = {}) => vm.$u.get(apiurl.company.getCompanyPostListUrl + params.id, params),
+    // 获取岗位详情
+    getPostDetails: (params = {}) => vm.$u.get(apiurl.company.getPostDetailsUrl + params.id),
+    // 投递简历
+    deliveryResume: (params = {}) => vm.$u.post(apiurl.company.deliveryResumeUrl, params),
+    // 判断是否已投递
+    judgeIsSubmit: (params = {}) => vm.$u.get(apiurl.company.judgeIsSubmitUrl + params.id)
+  };
 
-	// 招聘就业模块
-	let recruitment = {
-		// 企业推荐列表
-		getRecommendList: (params = {}) => vm.$u.get(apiurl.recruitment.getRecommendListUrl, params),
-		// 招聘就业岗位列表
-		getRecruitmentJobList: (params = {}) => vm.$u.get(apiurl.recruitment.getRecruitmentJobListUrl, params),
-		// 岗位详情
-		getJobDetails: (params = {}) => vm.$u.get(apiurl.recruitment.getJobDetailsUrl + params.id)
-	};
+  // 政策资讯模块
+  let policyInfo = {
+    // 政策资讯列表
+    getPolicyInfoList: (params = {}) => vm.$u.get(apiurl.policyInfo.getPolicyInfoListUrl, params),
+    // 政策资讯详情
+    getPolicyInfoDetails: (params = {}) => vm.$u.get(apiurl.policyInfo.getPolicyInfoDetailsUrl, params)
+  };
 
-	// 我的投递
-	let delivery = {
-		getDeliveryList: (params = {}) => vm.$u.get(apiurl.delivery.deliveryListUrl, params)
-	};
+  // 招聘就业模块
+  let recruitment = {
+    // 企业推荐列表
+    getRecommendList: (params = {}) => vm.$u.get(apiurl.recruitment.getRecommendListUrl, params),
+    // 招聘就业岗位列表
+    getRecruitmentJobList: (params = {}) => vm.$u.get(apiurl.recruitment.getRecruitmentJobListUrl, params),
+    // 岗位详情
+    getJobDetails: (params = {}) => vm.$u.get(apiurl.recruitment.getJobDetailsUrl + params.id)
+  };
 
-	// 我的面试
-	let interview = {
-		getInterviewList: (params = {}) => vm.$u.get(apiurl.interview.getInterviewListUrl, params),
-		changeInterviewStateApi: (params = {}) => vm.$u.put(apiurl.interview.changeInterviewStateUrl, params)
-	};
+  // 我的投递
+  let delivery = {
+    getDeliveryList: (params = {}) => vm.$u.get(apiurl.delivery.deliveryListUrl, params)
+  };
 
-	// 我的简历
-	let resume = {
-		submitJobIntention: (params = {}) => vm.$u.put(apiurl.resume.submitJobIntentionUrl, params),
-		submitSelfAssessment: (params = {}) => vm.$u.put(apiurl.resume.submitSelfAssessmentUrl, params)
-	}
+  // 我的面试
+  let interview = {
+    getInterviewList: (params = {}) => vm.$u.get(apiurl.interview.getInterviewListUrl, params),
+    changeInterviewStateApi: (params = {}) => vm.$u.put(apiurl.interview.changeInterviewStateUrl, params)
+  };
 
-	// 我的评价
-	let evaluation = {
-		getEvaluationList: (params = {}) => vm.$u.get(apiurl.evaluation.getEvaluationListUrl, params)
-	}
+  // 我的简历
+  let resume = {
+    submitJobIntention: (params = {}) => vm.$u.put(apiurl.resume.submitJobIntentionUrl, params),
+    submitSelfAssessment: (params = {}) => vm.$u.put(apiurl.resume.submitSelfAssessmentUrl, params)
+  };
 
-	// 我的
-	let mine = {
-		submitEmploymentCondition: (params = {}) => vm.$u.post(apiurl.mine.employmentConditionUrl, params),
-		totalCount: (params = {}) => vm.$u.get(apiurl.mine.totalCountUrl, params),
-		integralList: (params = {}) => vm.$u.get(apiurl.mine.integralListUrl, params),
-		getCountResulApi: (params = {}) => vm.$u.get(apiurl.mine.getCountResultUrl, params),
-		getIntegralTotalApi: (params = {}) => vm.$u.get(apiurl.mine.getIntegralTotalUrl, params),
-		updatePositionStatusApi: (params = {}) => vm.$u.put(apiurl.mine.updatePositionStatusUrl, params)
-	}
+  // 我的评价
+  let evaluation = {
+    getEvaluationList: (params = {}) => vm.$u.get(apiurl.evaluation.getEvaluationListUrl, params)
+  };
 
-	// 适应性培训
-	let training = {
-		// 获取线上培训列表
-		getOnlineListApi: (params = {}) => vm.$u.get(apiurl.training.getOnlineListurl, params),
-		getOnlineStatusApi: (params = {}) => vm.$u.get(apiurl.training.getOnlineStatusUrl, params),
-		getOnlineDetailsApi: (params = {}) => vm.$u.get(apiurl.training.getOnlineDetailsUrl + params.id),
-		videoTimeLongApi: (params = {}) => vm.$u.post(apiurl.training.videoTimeLongUrl, params),
-		getClassesCommentApi: (params = {}) => vm.$u.get(apiurl.training.getClassesCommentUrl, params),
-		addClassesCommentApi: (params = {}) => vm.$u.post(apiurl.training.addClassesCommentUrl, params),
-		getOfflineListApi: (params = {}) => vm.$u.get(apiurl.training.getOfflineListUrl, params),
-		getOfflineDetailsApi: (params = {}) => vm.$u.get(apiurl.training.getOfflineDetailsUrl + params.id)
-	}
-	/**
-	 * 技能培训
-	 */
-	let skillTraining = {
-		getSkillPackageListApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getPackageListUrl, params),
-		signUpClassApi: (params = {}) => vm.$u.post(apiurl.skillTraining.signUpClassUrl, params),
-		getPackageDetailApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getPackageDetailsUrl + params.id),
-		getClassNoticeApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getClassNoticeUrl, params),
-		getTrainingTotalApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getTrainingTotalUrl, params),
-		isApplyTrainingApi: (params = {}) => vm.$u.get(apiurl.skillTraining.isApplyTrainingUrl + params.id),
-		getMyTrainingListApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getMyTrainingListUrl + params.type, params),
-		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),
-		queryIsAttendedClassApi: (params = {}) => vm.$u.get(apiurl.skillTraining.queryIsAttendedClassUrl, params)
-	}
-	let entrepreneurship = {
-		addEntrepreneurshipApi: (params = {}) => vm.$u.post(apiurl.entrepreneurship.addEntrepreneurshipUrl, params),
-		getEntrepreneurshipListApi: (params = {}) => vm.$u.get(apiurl.entrepreneurship.getEntrepreneurshipListUrl, params),
-		getEntrepreneurshipDetailsApi: (params = {}) => vm.$u.get(apiurl.entrepreneurship.getEntrepreneurshipDetailsUrl + params.id)
-	}
-	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
-	vm.$u.api = {
-		getPhoneLoginCode,
-		logoutApi,
-		phoneLoginAuth,
-		getSysterms,
-		getNewsDetails,
-		veteEduc,
-		getVeteEducCheck,
-		getmemberinfo,
-		getpolicyNewsList,
-		getVeteEducData,
-		getPolicyNewsDetails,
-		getDictdataUrl,
-		getAdaptTrainOnline,
-		getAdaptTrainOnlineDetails,
-		getAdaptTrainOnlineRate,
-		upAdaptTrainOnlineInfo,
-		getAdaptTrainOffline,
-		postAnalysis,
-		postSignOffline,
-		getAdaptTrainIdOffline,
-		getIdInfo,
-		getMoreCourseListApi,
-		getSchoolList,
-		indexApi,
-		noticeApi,
-		school,
-		company,
-		policyInfo,
-		delivery,
-		recruitment,
-		interview,
-		resume,
-		modifyUserInfo,
-		evaluation,
-		mine,
-		training,
-		skillTraining,
-		entrepreneurship
-	};
-}
+  // 我的
+  let mine = {
+    submitEmploymentCondition: (params = {}) => vm.$u.post(apiurl.mine.employmentConditionUrl, params),
+    totalCount: (params = {}) => vm.$u.get(apiurl.mine.totalCountUrl, params),
+    integralList: (params = {}) => vm.$u.get(apiurl.mine.integralListUrl, params),
+    getCountResulApi: (params = {}) => vm.$u.get(apiurl.mine.getCountResultUrl, params),
+    getIntegralTotalApi: (params = {}) => vm.$u.get(apiurl.mine.getIntegralTotalUrl, params),
+    updatePositionStatusApi: (params = {}) => vm.$u.put(apiurl.mine.updatePositionStatusUrl, params)
+  };
+
+  // 适应性培训
+  let training = {
+    // 获取线上培训列表
+    getOnlineListApi: (params = {}) => vm.$u.get(apiurl.training.getOnlineListurl, params),
+    getOnlineStatusApi: (params = {}) => vm.$u.get(apiurl.training.getOnlineStatusUrl, params),
+    getOnlineDetailsApi: (params = {}) => vm.$u.get(apiurl.training.getOnlineDetailsUrl + params.id),
+    videoTimeLongApi: (params = {}) => vm.$u.post(apiurl.training.videoTimeLongUrl, params),
+    getClassesCommentApi: (params = {}) => vm.$u.get(apiurl.training.getClassesCommentUrl, params),
+    addClassesCommentApi: (params = {}) => vm.$u.post(apiurl.training.addClassesCommentUrl, params),
+    getOfflineListApi: (params = {}) => vm.$u.get(apiurl.training.getOfflineListUrl, params),
+    getOfflineDetailsApi: (params = {}) => vm.$u.get(apiurl.training.getOfflineDetailsUrl + params.id)
+  };
+  /**
+   * 技能培训
+   */
+  let skillTraining = {
+    getSkillPackageListApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getPackageListUrl, params),
+    signUpClassApi: (params = {}) => vm.$u.post(apiurl.skillTraining.signUpClassUrl, params),
+    getPackageDetailApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getPackageDetailsUrl + params.id),
+    getClassNoticeApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getClassNoticeUrl, params),
+    getTrainingTotalApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getTrainingTotalUrl, params),
+    isApplyTrainingApi: (params = {}) => vm.$u.get(apiurl.skillTraining.isApplyTrainingUrl + params.id),
+    getMyTrainingListApi: (params = {}) => vm.$u.get(apiurl.skillTraining.getMyTrainingListUrl + params.type, params),
+    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),
+    queryIsAttendedClassApi: (params = {}) => vm.$u.get(apiurl.skillTraining.queryIsAttendedClassUrl, params)
+  };
+  let entrepreneurship = {
+    addEntrepreneurshipApi: (params = {}) => vm.$u.post(apiurl.entrepreneurship.addEntrepreneurshipUrl, params),
+    getEntrepreneurshipListApi: (params = {}) => vm.$u.get(apiurl.entrepreneurship.getEntrepreneurshipListUrl, params),
+    getEntrepreneurshipDetailsApi: (params = {}) => vm.$u.get(apiurl.entrepreneurship.getEntrepreneurshipDetailsUrl + params.id)
+  };
+  // 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
+  vm.$u.api = {
+    getPhoneLoginCode,
+    logoutApi,
+    phoneLoginAuth,
+    getSysterms,
+    getNewsDetails,
+    veteEduc,
+    getVeteEducCheck,
+    getmemberinfo,
+    getpolicyNewsList,
+    getVeteEducData,
+    getPolicyNewsDetails,
+    getDictdataUrl,
+    getAdaptTrainOnline,
+    getAdaptTrainOnlineDetails,
+    getAdaptTrainOnlineRate,
+    upAdaptTrainOnlineInfo,
+    getAdaptTrainOffline,
+    postAnalysis,
+    postSignOffline,
+    getAdaptTrainIdOffline,
+    getIdInfo,
+    getMoreCourseListApi,
+    getSchoolList,
+    indexApi,
+    noticeApi,
+    school,
+    company,
+    policyInfo,
+    delivery,
+    recruitment,
+    interview,
+    resume,
+    modifyUserInfo,
+    evaluation,
+    mine,
+    training,
+    skillTraining,
+    entrepreneurship
+  };
+};
 
 export default {
-	install
-}
+  install
+};

+ 31 - 33
h5_web/common/http.interceptor.js

@@ -1,63 +1,61 @@
-import {
-  config
-} from '@/common/config.js';
-import store from '../store/index.js'
+import { config } from '@/common/config.js';
+import store from '@/store/index.js';
 
 // 这里的vm,就是我们在vue文件里面的this,所以我们能在这里获取vuex的变量,比如存放在里面的token
 // 同时,我们也可以在此使用getApp().globalData,如果你把token放在getApp().globalData的话,也是可以使用的
 const install = (Vue, vm) => {
   Vue.prototype.$u.http.setConfig({
     baseUrl: config.baseUrl,
-		// 设置为json,返回后会对数据进行一次JSON.parse()
-		dataType: 'json',
-		showLoading: true, // 是否显示请求中的loading
-		loadingText: '请求中...', // 请求loading中的文字提示
-		loadingTime: 500, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
-		originalData: false, // 是否在拦截器中返回服务端的原始数据
-		loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
-		// 配置请求头信息
-		header: {
-			'content-type': 'application/json;charset=UTF-8'
-		}
+    // 设置为json,返回后会对数据进行一次JSON.parse()
+    dataType: 'json',
+    showLoading: true, // 是否显示请求中的loading
+    loadingText: '请求中...', // 请求loading中的文字提示
+    loadingTime: 1000, // 在此时间内,请求还没回来的话,就显示加载中动画,单位ms
+    originalData: false, // 是否在拦截器中返回服务端的原始数据
+    loadingMask: true, // 展示loading的时候,是否给一个透明的蒙层,防止触摸穿透
+    // 配置请求头信息
+    header: {
+      'content-type': 'application/json;charset=UTF-8'
+    }
   });
   // 请求拦截,配置Token等参数
   Vue.prototype.$u.http.interceptor.request = (config) => {
-
     if (vm.vuex_token) {
       config.header.Authorization = `Bearer ${vm.vuex_token}`;
     }
     // url加时间戳
-    config.url = config.url + '?t=' + Date.now()
+    config.url = config.url + '?t=' + Date.now();
     let noTokenList = ['/wechat/h5/user', '/client/auth/verifyCode'];
     if (noTokenList.includes(config.url)) config.header.noToken = true;
     return config;
-  }
+  };
   // 响应拦截,判断状态码是否通过
   Vue.prototype.$u.http.interceptor.response = (res) => {
     if (res.code == 200) {
       return res;
-    } else if (res.msg == "令牌不能为空" || res.code == 401) {
-      const backUrl = location.href
-      const loginUrl = 'phoneLogin'
-      if (backUrl.indexOf(loginUrl) > 0) {} else {
-        localStorage.setItem('backUrl', location.href)
+    } else if (res.msg == '令牌不能为空' || res.code == 401) {
+      const backUrl = location.href;
+      const loginUrl = 'phoneLogin';
+      if (backUrl.indexOf(loginUrl) > 0) {
+      } else {
+        localStorage.setItem('backUrl', location.href);
         store.state.vuex_hasLogin = false;
         alert('还未登录,即将跳转登录');
         uni.navigateTo({
-          url: "/pages/phoneLogin/phoneLogin"
+          url: '/pages/phoneLogin/phoneLogin'
         });
         return;
       }
     } else {
-			uni.showToast({
-				title: res.msg,
-				icon: 'none',
-				duration: 2000
-			})
-		}
-  }
-}
+      uni.showToast({
+        title: res.msg,
+        icon: 'none',
+        duration: 2000
+      });
+    }
+  };
+};
 
 export default {
   install
-}
+};

+ 52 - 56
h5_web/components/judge-auth/judge-auth.vue

@@ -1,13 +1,7 @@
 <template>
   <view class="">
-  	<u-modal
-  	  v-model="show"
-  	  :content="content"
-  	  :show-cancel-button="true"
-  	  @cancel="cancel"
-  	  @confirm="confirm"
-  	></u-modal>
-		<u-toast ref="uToast" />
+    <u-modal v-model="show" :content="content" :show-cancel-button="true" @cancel="cancel" @confirm="confirm"></u-modal>
+    <u-toast ref="uToast" />
   </view>
 </template>
 
@@ -17,8 +11,8 @@ export default {
   data() {
     return {
       show: false,
-			content: '你还没有认证,该功能需要认证后才能使用!',
-			auditStatus: null
+      content: '你还没有认证,该功能需要认证后才能使用!',
+      auditStatus: null
     };
   },
   methods: {
@@ -26,45 +20,48 @@ export default {
      * @param {Object} bool
      */
     modalShow(url) {
-			this.$u.api.getmemberinfo().then(res => {
-				if (res.code === 200){
-					this.$u.vuex('vuex_memberInfo', res.data);
-					if (res.data.auditStatus || res.data.auditStatus === 0) {
-						this.auditStatus = Number(res.data.auditStatus)
-					}
-					switch (Number(res.data.auditStatus)){
-						case 0:
-							this.content = '您的认证正在审核中,该功能需要认证后才能使用!'
-							this.show = true
-							break;
-						case 1:
-							this.content = '您的认证未通过,,该功能需要认证后才能使用!'
-							this.show = true
-							break;
-						case 2:
-							this.$emit('adoptAuth', url)
-							break;
-						case 3:
-							this.content = '您的认证已被撤销,该功能需要认证后才能使用!'
-							this.show = true
-							break;
-						case 9:
-							this.content = '您还未进行认证,该功能需要认证后才能使用!'
-							this.show = true
-							break;
-					}
-				} else {
-					this.$refs.uToast.show({
-						title: res.msg,
-						type: 'error'
-					})
-				}
-			}).catch(err => {
-				this.$refs.uToast.show({
-					title: err.msg,
-					type: 'error'
-				})
-			})
+      this.$u.api
+        .getmemberinfo()
+        .then((res) => {
+          if (res.code === 200) {
+            this.$u.vuex('vuex_memberInfo', res.data);
+            if (res.data.auditStatus || res.data.auditStatus === 0) {
+              this.auditStatus = Number(res.data.auditStatus);
+            }
+            switch (Number(res.data.auditStatus)) {
+              case 0:
+                this.content = '您的认证正在审核中,该功能需要认证后才能使用!';
+                this.show = true;
+                break;
+              case 1:
+                this.content = '您的认证未通过,,该功能需要认证后才能使用!';
+                this.show = true;
+                break;
+              case 2:
+                this.$emit('adoptAuth', url);
+                break;
+              case 3:
+                this.content = '您的认证已被撤销,该功能需要认证后才能使用!';
+                this.show = true;
+                break;
+              case 9:
+                this.content = '您还未进行认证,该功能需要认证后才能使用!';
+                this.show = true;
+                break;
+            }
+          } else {
+            this.$refs.uToast.show({
+              title: res.msg,
+              type: 'error'
+            });
+          }
+        })
+        .catch((err) => {
+          this.$refs.uToast.show({
+            title: err.msg,
+            type: 'error'
+          });
+        });
     },
     /**
      * 取消
@@ -75,15 +72,14 @@ export default {
      */
     confirm() {
       this.show = false;
-			if (this.auditStatus === 1 || this.auditStatus === 3 || this.auditStatus === 9) {
-				uni.navigateTo({
-				  url: '/pages/applyEducationCode/applyEducationCode'
-				});
-			}
+      if (this.auditStatus === 1 || this.auditStatus === 3 || this.auditStatus === 9) {
+        uni.navigateTo({
+          url: '/pages/applyEducationCode/applyEducationCode'
+        });
+      }
     }
   }
 };
 </script>
 
-<style>
-</style>
+<style></style>

+ 36 - 42
h5_web/main.js

@@ -1,42 +1,36 @@
-import Vue from 'vue'
-import App from './App'
-
-Vue.config.productionTip = false
-import { config } from './common/config'
-Vue.prototype.config = config;
-
-import './utils/filter' 
-
-App.mpType = 'app'
-
-// 引入全局uView
-import uView from 'uview-ui'
-Vue.use(uView);
-
-// 此处为演示vuex使用,非uView的功能部分
-import store from '@/store';
-
-// 引入uView提供的对vuex的简写法文件
-let vuexStore = require('@/store/$u.mixin.js');
-Vue.mixin(vuexStore);
-
-import $wxApi from "@/utils/wxapi.js";
Vue.prototype.$wxApi = $wxApi;

//微信支付封装
import $pay from "@/utils/pay.js";
Vue.prototype.$pay = $pay;
-
-// jsonp
-// import { VueJsonp } from 'vue-jsonp'
-// Vue.use(VueJsonp);
-
-const app = new Vue({
-	store,
-    ...App
-});
-
-// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
-import httpInterceptor from '@/common/http.interceptor.js';
-Vue.use(httpInterceptor, app);
-
-// http接口API抽离,免于写url或者一些固定的参数
-import httpApi from '@/common/http.api.js';
-Vue.use(httpApi, app);
-
-app.$mount()
+import Vue from 'vue';
+import App from './App';
+
+Vue.config.productionTip = false;
+import { config } from './common/config';
+Vue.prototype.config = config;
+
+import './utils/filter';
+
+App.mpType = 'app';
+
+// 引入全局uView
+import uView from 'uview-ui';
+Vue.use(uView);
+
+// 此处为演示vuex使用,非uView的功能部分
+import store from '@/store';
+
+// 引入uView提供的对vuex的简写法文件
+let vuexStore = require('@/store/$u.mixin.js');
+Vue.mixin(vuexStore);
+
+const app = new Vue({
+  store,
+  ...App
+});
+
+// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
+import httpInterceptor from '@/common/http.interceptor.js';
+Vue.use(httpInterceptor, app);
+
+// http接口API抽离,免于写url或者一些固定的参数
+import httpApi from '@/common/http.api.js';
+Vue.use(httpApi, app);
+
+app.$mount();

+ 26 - 29
h5_web/package.json

@@ -1,31 +1,28 @@
 {
-	"dependencies": {
-		"xgplayer": "^2.31.6"
-	},
-	"uni-app": {
-		"scripts": {
-			"build:test": {
-				"title": "build:test",
-				"env": {
-					"UNI_PLATFORM": "h5",
-					"H_NODE_ENV": "development",
-					"H_BASE_URL": "https://wx.hw.hongweisoft.com/veterans",
-					"H_TIM_CHAT_URL": "https://veterh5.hw.hongweisoft.com/chat/pages/login/login",
-					"H_VIDEO_CHAT_URL": "https://veterhwebchat.hw.hongweisoft.com/#/",
-					"DESCRIBE": "测试环境"
-				}
-			},
-			"build:pro": {
-				"title": "build:pro",
-				"env": {
-					"UNI_PLATFORM": "h5",
-					"H_NODE_ENV": "production",
-					"H_BASE_URL": "http://api.veterans.hongweisoft.com",
-					"H_TIM_CHAT_URL": "http://mobile.veterans.hongweisoft.com/chat/pages/login/login",
-					"H_VIDEO_CHAT_URL": "https://chat.veterans.hongweisoft.com/#/",
-					"DESCRIBE": "正式环境"
-				}
-			}
-		}
-	}
+  "uni-app": {
+    "scripts": {
+      "build:test": {
+        "title": "build:test",
+        "env": {
+          "UNI_PLATFORM": "h5",
+          "H_NODE_ENV": "development",
+          "H_BASE_URL": "https://wx.hw.hongweisoft.com/veterans",
+          "H_TIM_CHAT_URL": "https://veterh5.hw.hongweisoft.com/chat/pages/login/login",
+          "H_VIDEO_CHAT_URL": "https://veterhwebchat.hw.hongweisoft.com/#/",
+          "DESCRIBE": "测试环境"
+        }
+      },
+      "build:pro": {
+        "title": "build:pro",
+        "env": {
+          "UNI_PLATFORM": "h5",
+          "H_NODE_ENV": "production",
+          "H_BASE_URL": "http://api.veterans.hongweisoft.com",
+          "H_TIM_CHAT_URL": "http://mobile.veterans.hongweisoft.com/chat/pages/login/login",
+          "H_VIDEO_CHAT_URL": "https://chat.veterans.hongweisoft.com/#/",
+          "DESCRIBE": "正式环境"
+        }
+      }
+    }
+  }
 }

File diff suppressed because it is too large
+ 664 - 646
h5_web/pages.json


+ 189 - 182
h5_web/pages/basicTraining/basicTraining.vue

@@ -1,189 +1,196 @@
 <template>
-	<view class="training">
-		<u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
-		<image class="bg" src="../../static/img/basic-training-bg.png" mode="widthFix"></image>
-		<view class="tab">
-			<view class="tab-bg">
-				<view class="tab-list">
-					<view class="tab-item" v-for="(item, index) in tabs" :key="index" :class="{'active': tabIndex === index}" @click="tabChange(index)">{{ item.name }}</view>
-				</view>
-				
-				<view class="training-data" v-if="tabIndex === 0">
-					<view class="training-data-item">
-						<view>已看课程</view>
-						<view><text>{{ online.play }}</text>个</view>
-					</view>
-					<view class="training-data-item">
-						<view>还需观看</view>
-						<view><text style="color: #FF7E00;">{{ online.playNot }}</text>个</view>
-					</view>
-				</view>
-				<view class="training-offline" v-if="tabIndex === 1">
-					<view>未参加线下培训</view>
-					<view>(注:必须参加线下培训才能通过适应性培训)</view>
-				</view>
-			</view>
-		</view>
-		
-		<!-- 适应性培训 -->
-		<view class="training-adaptability mt26" v-if="tabIndex === 0">
-			<view class="training-adaptability-title">线上课程</view>
-		</view>
-		<view class="training-adaptability" v-if="tabIndex === 0">
-			<view class="training-adaptability-list">
-				<view class="training-adaptability-list-item"
-				v-for="(item, index) in list"
-				:key="index"
-				@click="recordBrowseTotal(item)"
-				>
-					<view class="left">
-						<u-image :src="item.titleImg" width="198" height="144" border-radius="10"></u-image>
-					</view>
-					<view class="right">
-						<view>{{ item.adaptName }}</view>
-						<view>共{{ item.amount }}节课,已学完{{ item.finishCount }}节课,学习进度{{ item.finishPercent ? item.finishPercent : 0 }}%</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		
-		<!-- 线下培训 -->
-		<view class="training-offline1" v-if="tabIndex === 1">
-			<view class="training-offline1-title">
-				线下培训
-			</view>
-			<view class="training-offline1-list">
-				<view class="training-offline1-list-item" v-for="(item, index) in offLineList" :key="index" @click="recordBrowseTotal(item, 1)">
-					<view class="bottom">
-						<view>{{ item.adaptName }}</view>
-					</view>
-					<view class="top">
-						<view>{{ item.adaptAddress }}</view>
-						<view>{{ item.createTime }}</view>
-					</view>
-				</view>
-			</view>
-		</view>
-		<view class="study-status" v-if="tabIndex === 0">学习状态:{{ online.status === 0 ? '未完成' : '已完成' }}</view>
-		<view class="study-status" v-if="tabIndex === 1">学习状态:{{ offlineStatus === 0 ? '未完成' : '已完成'}}</view>
-		<u-toast ref="uToast" />
-		<judge-auth ref="judgeAuth" @adoptAuth="adoptAuth"/>
-	</view>
+  <view class="training">
+    <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
+    <image class="bg" src="../../static/img/basic-training-bg.png" mode="widthFix"></image>
+    <view class="tab">
+      <view class="tab-bg">
+        <view class="tab-list">
+          <view class="tab-item" v-for="(item, index) in tabs" :key="index" :class="{ active: tabIndex === index }" @click="tabChange(index)">{{
+            item.name
+          }}</view>
+        </view>
+
+        <view class="training-data" v-if="tabIndex === 0">
+          <view class="training-data-item">
+            <view>已看课程</view>
+            <view
+              ><text>{{ online.play }}</text
+              >个</view
+            >
+          </view>
+          <view class="training-data-item">
+            <view>还需观看</view>
+            <view
+              ><text style="color: #ff7e00">{{ online.playNot }}</text
+              >个</view
+            >
+          </view>
+        </view>
+        <view class="training-offline" v-if="tabIndex === 1">
+          <view>未参加线下培训</view>
+          <view>(注:必须参加线下培训才能通过适应性培训)</view>
+        </view>
+      </view>
+    </view>
+
+    <!-- 适应性培训 -->
+    <view class="training-adaptability mt26" v-if="tabIndex === 0">
+      <view class="training-adaptability-title">线上课程</view>
+    </view>
+    <view class="training-adaptability" v-if="tabIndex === 0">
+      <view class="training-adaptability-list" v-if="list.length">
+        <view class="training-adaptability-list-item" v-for="(item, index) in list" :key="index" @click="recordBrowseTotal(item)">
+          <view class="left">
+            <u-image :src="item.titleImg" width="198" height="144" border-radius="10"></u-image>
+          </view>
+          <view class="right">
+            <view>{{ item.adaptName }}</view>
+            <view>共{{ item.amount }}节课,已学完{{ item.finishCount }}节课,学习进度{{ item.finishPercent ? item.finishPercent : 0 }}%</view>
+          </view>
+        </view>
+      </view>
+      <view v-else>
+        <u-empty text="暂无线上课程" mode="list"></u-empty>
+      </view>
+    </view>
+
+    <!-- 线下培训 -->
+    <view class="training-offline1" v-if="tabIndex === 1">
+      <view class="training-offline1-title"> 线下培训 </view>
+      <view class="training-offline1-list" v-if="offLineList.length">
+        <view class="training-offline1-list-item" v-for="(item, index) in offLineList" :key="index" @click="recordBrowseTotal(item, 1)">
+          <view class="bottom">
+            <view>{{ item.adaptName }}</view>
+          </view>
+          <view class="top">
+            <view>{{ item.adaptAddress }}</view>
+            <view>{{ item.createTime }}</view>
+          </view>
+        </view>
+      </view>
+      <view v-else>
+        <u-empty text="暂无线下培训" mode="list"></u-empty>
+      </view>
+    </view>
+    <view class="study-status" v-if="tabIndex === 0">学习状态:{{ online.status === 0 ? '未完成' : '已完成' }}</view>
+    <view class="study-status" v-if="tabIndex === 1">学习状态:{{ offlineStatus === 0 ? '未完成' : '已完成' }}</view>
+    <u-toast ref="uToast" />
+    <judge-auth ref="judgeAuth" @adoptAuth="adoptAuth" />
+  </view>
 </template>
 
 <script>
-	export default{
-		data(){
-			return{
-				tabs: [
-					{ name: '适应性培训' },
-					{ name:'线下培训' },
-				],
-				tabIndex: 0,
-				list: [],
-				online: {
-					status: 0,
-					play: 0,
-					playNot: 0
-				},
-				offlineStatus: 0,
-				offLineList: []
-			}
-		},
-		onShow() {
-			this.getOnlineList(1, 200000);
-			this.getOnlineStatus();
-			this.getOfflineList()
-		},
-		methods:{
-			// 切换菜单
-			tabChange(index) {
-				this.tabIndex = index;
-			},
-			/**
-			 * 获取在线课程
-			 * @param {Object} pageNum
-			 * @param {Object} pageSize
-			 */
-			getOnlineList(pageNum, pageSize) {
-				this.$u.api.training.getOnlineListApi({pageNum, pageSize}).then(res => {
-					if (res.code === 200) {
-						this.list = res.rows
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				})
-			},
-			/**
-			 * 获取在线课程学习状态
-			 */
-			getOnlineStatus() {
-				this.$u.api.training.getOnlineStatusApi().then(res => {
-					if (res.code === 200) {
-						this.online.status = res.data.status
-						this.online.play = res.data.play
-						this.online.playNot = res.data.playNot
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				})
-			},
-			getOfflineList() {
-				this.$u.api.training.getOfflineListApi({
-					pageNum: 1,
-					paheSize: 3000
-				}).then(res => {
-					console.log(res)
-					if (res.code === 200) {
-						this.offLineList = res.rows
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				})
-			},
-			jumpPage(url, params) {
-				this.$u.route({
-					url: url,
-					params: params
-				})
-			},
-			adoptAuth(item) {
-				this.jumpPage('/pages/basicTraining/onlineTrainingDetails/onlineTrainingDetails', { id: item.id })
-			},
-			/**
-			 * 适应性培训关注度统计
-			 * @param {Object} item
-			 */
-			recordBrowseTotal(item, type) {
-				const query = {
-					platform: '1', // 平台:1-H5 2-APP 3-小程序 4-PC端
-					pages: location.href,//页面路径
-					btnName: '查看课程详情',//按钮名称
-					btnEvent: '1',//按钮事件: 1-点击 2-长按 3-滑动
-					ipAddress: '',//IP地址
-					typeName: '适应性培训关注度',//类型名称 例:学校关注度 、适应性考试等
-					typeCode: 'SYXPXGZD',// 类型编码 例:类型名称首字母缩写(XXGZD)
-					categoryName: item.adaptName,//类别名称 例:XX学校,SS考试
-				}
-				this.$u.api.postAnalysis(query).then(res => {
-					if (type === 1) {
-						this.jumpPage('pages/basicTraining/offlineTrainingDetails/offlineTrainingDetails', { id: item.id })
-					} else {
-						this.$refs['judgeAuth'].modalShow(item)
-					}
-				})
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      tabs: [{ name: '适应性培训' }, { name: '线下培训' }],
+      tabIndex: 0,
+      list: [],
+      online: {
+        status: 0,
+        play: 0,
+        playNot: 0
+      },
+      offlineStatus: 0,
+      offLineList: []
+    };
+  },
+  onShow() {
+    this.getOnlineList(1, 200000);
+    this.getOnlineStatus();
+    this.getOfflineList();
+  },
+  methods: {
+    // 切换菜单
+    tabChange(index) {
+      this.tabIndex = index;
+    },
+    /**
+     * 获取在线课程
+     * @param {Object} pageNum
+     * @param {Object} pageSize
+     */
+    getOnlineList(pageNum, pageSize) {
+      this.$u.api.training.getOnlineListApi({ pageNum, pageSize }).then((res) => {
+        if (res.code === 200) {
+          this.list = res.rows;
+        } else {
+          this.$refs.uToast.show({
+            title: res.msg,
+            type: 'error'
+          });
+        }
+      });
+    },
+    /**
+     * 获取在线课程学习状态
+     */
+    getOnlineStatus() {
+      this.$u.api.training.getOnlineStatusApi().then((res) => {
+        if (res.code === 200) {
+          this.online.status = res.data.status;
+          this.online.play = res.data.play;
+          this.online.playNot = res.data.playNot;
+        } else {
+          this.$refs.uToast.show({
+            title: res.msg,
+            type: 'error'
+          });
+        }
+      });
+    },
+    getOfflineList() {
+      this.$u.api.training
+        .getOfflineListApi({
+          pageNum: 1,
+          paheSize: 3000
+        })
+        .then((res) => {
+          console.log(res);
+          if (res.code === 200) {
+            this.offLineList = res.rows;
+          } else {
+            this.$refs.uToast.show({
+              title: res.msg,
+              type: 'error'
+            });
+          }
+        });
+    },
+    jumpPage(url, params) {
+      this.$u.route({
+        url: url,
+        params: params
+      });
+    },
+    adoptAuth(item) {
+      this.jumpPage('/pages/basicTraining/onlineTrainingDetails/onlineTrainingDetails', { id: item.id });
+    },
+    /**
+     * 适应性培训关注度统计
+     * @param {Object} item
+     */
+    recordBrowseTotal(item, type) {
+      const query = {
+        platform: '1', // 平台:1-H5 2-APP 3-小程序 4-PC端
+        pages: location.href, //页面路径
+        btnName: '查看课程详情', //按钮名称
+        btnEvent: '1', //按钮事件: 1-点击 2-长按 3-滑动
+        ipAddress: '', //IP地址
+        typeName: '适应性培训关注度', //类型名称 例:学校关注度 、适应性考试等
+        typeCode: 'SYXPXGZD', // 类型编码 例:类型名称首字母缩写(XXGZD)
+        categoryName: item.adaptName //类别名称 例:XX学校,SS考试
+      };
+      this.$u.api.postAnalysis(query).then((res) => {
+        if (type === 1) {
+          this.jumpPage('pages/basicTraining/offlineTrainingDetails/offlineTrainingDetails', { id: item.id });
+        } else {
+          this.$refs['judgeAuth'].modalShow(item);
+        }
+      });
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 0 - 88
h5_web/pages/basicTraining/basicTrainingDetails/basicTrainingDetails.vue

@@ -1,88 +0,0 @@
-<template>
-	<view>
-		<!-- <video id="vid"><source :src="details.videoUrl"></video> -->
-		<!-- <video width="320" height="240" controls="controls" preload="auto">
-		  <source src="static/img/11111.mp4" type="video/mp4">
-		您的浏览器不支持Video标签。
-		</video> -->
-		<!-- <video @timeupdate="updateTime" @canplay="getDuration" ref="video111" :src="details.videoUrl" controls="controls" preload="auto"></video> -->
-		<view id="player" style="width: 100%;"></view>
-		<u-parse :html="details.content" class="f-padding"></u-parse>
-	</view>
-</template>
-
-<script>
-	import Player from 'xgplayer';
-	
-	export default{
-		data(){
-			return{
-				id:'',
-				content:'',
-				details:{},
-				duration:'',
-			}
-		},
-		onLoad(page){
-			console.log(page)
-			this.id = page.id;
-			this.getAdaptTrainOnlineDetails(this.id);
-		},
-		onShow(){
-			
-		},
-		methods:{
-			getAdaptTrainOnlineDetails(id){
-				this.$u.api.getAdaptTrainOnlineDetails({id:id}).then(res=>{
-					this.details = res.data;
-					let player = new Player({
-					  id: 'player',
-					  autoplay: false,
-					  playsinline: true,
-					  url: this.details.videoUrl,
-					  screenShot: true,
-					  fluid: true,
-					  videoInit: true,
-					  enableVideoDbltouch: true,
-					});
-					player.once('ended',()=>{
-						this.upAdaptTrainOnlineInfo();
-					});
-					player.once('canplay',(e)=>{
-						console.log('canplay',player.duration)
-						this.duration = player.duration;
-					});
-					player.on('timeupdate',()=>{
-						let that = this;
-						// console.log('that',that);
-						// console.log('currentTime',player.currentTime);
-						// // setInterval(that.aaa+=1,1000)
-						// console.log('that.aaa',that.aaa);
-					  //事件名称可以在上述查询
-					});
-					console.log('getAdaptTrainOnline',JSON.parse(JSON.stringify(res)));
-				})
-			},
-			upAdaptTrainOnlineInfo(){
-				let params ={
-					tabId:this.details.id,
-					adaptName:this.details.adaptName,
-					url:this.details.videoUrl,
-					type:this.details.videoType,
-					duration:this.duration,
-					playDuration:this.duration,
-				}
-				this.$u.api.upAdaptTrainOnlineInfo(params).then(res=>{
-					this.rate = res.data;
-					console.log('upAdaptTrainOnlineInfo',JSON.parse(JSON.stringify(res)));
-				})
-			},
-			
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	#player{margin-bottom: 24rpx;}
-	// @import  './basicTrainingDetails.scss'
-</style>

+ 20 - 18
h5_web/pages/entrepreneurshipGuidelines/previewPdf/previewPdf.vue

@@ -1,25 +1,27 @@
 <template>
-	<view>
-		<web-view :src="pdfUrl"></web-view>
-	</view>
+  <view>
+    <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
+    <web-view class="web-view" :src="pdfUrl"></web-view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				pdfUrl: ''
-			}
-		},
-		onLoad(page) {
-			if (page.fileUrl) {
-				this.pdfUrl = 'https://www.gjtool.cn/pdfh5/pdf.html?file=' + page.fileUrl
-			}
-		},
-		methods: {}
-	}
+export default {
+  data() {
+    return {
+      pdfUrl: ''
+    };
+  },
+  onLoad(page) {
+    if (page.fileUrl) {
+      this.pdfUrl = `${this.config.previewPdfUrl}?src=${page.fileUrl}`;
+    }
+  }
+};
 </script>
 
-<style>
-
+<style lang="scss" scoped>
+.web-view {
+  top: 44px;
+}
 </style>

+ 0 - 40
h5_web/pages/entrepreneurshipGuidelines/previewPdf/previewPdf2.vue

@@ -1,40 +0,0 @@
-<template>
-	<view class="pdf-container">
-		<view id="demo"></view>
-	</view>
-</template>
-<script>
-	import Pdfh5 from "pdfh5";
-	export default {
-		name: 'App',
-		data() {
-			return {
-				pdfh5: null,
-				pdfUrl: ''
-			};
-		},
-		onLoad(page) {
-			if (page.fileUrl) {
-				this.pdfUrl = page.fileUrl
-			}
-		},
-		mounted() {
-			//实例化
-			this.pdfh5 = new Pdfh5("#demo", {
-				pdfurl: this.pdfUrl
-			});
-			//监听完成事件
-			this.pdfh5.on("complete", function(status, msg, time) {
-				console.log("状态:" + status + ",信息:" + msg + ",耗时:" + time + "毫秒,总页数:" + this.totalNum)
-			})
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import "./pdfh5.css";
-	.pdf-container {
-		width: 100%;
-		min-height: calc(100vh - 88rpx);
-	}
-</style>

+ 409 - 392
h5_web/pages/evaluationIntention/evaluationIntention.vue

@@ -1,42 +1,44 @@
 <!-- 自我评价和求职意向 -->
 <template>
-	<view class="evaluate-intention">
-		
-		<!-- 导航栏 -->
-		<u-navbar class="evaluate-intention-bar" back-text="" title="" :background="{backgroundColor: '#3D5D4C'}" title-color="#fff" back-icon-color="#fff">
-		</u-navbar>
-		
-		<view class="evaluate-intention-explain">
-			<view>继续完善加分项</view>
-			<view>据平台数据显示,完善后,被HR查看几率更高</view>
-		</view>
-		
-		<!-- tab页 -->
-		<view class="evaluate-intention-tabs">
-			<view
-				class="evaluate-intention-tabs-item"
-				v-for="(item, index) in list"
-				:key="index"
-				:class="{'evaluate-intention-tabs-active': tabCur === index}"
-				@click="tabCur = index"
-			>
-				{{ item.name }}
-			</view>
-		</view>
-		
-		<!-- 工作意向 -->
-		<view class="evaluate-intention-intention" v-if="tabCur === 0">
-			<u-form
-				:model="intentionForm"
-				ref="intentionForm"
-				label-position="top"
-			>
-				<u-form-item label="工作城市" prop="cityName" required>
-					<u-input v-model="intentionForm.workCity" type="select" @click="workCityClick" placeholder="请选择工作城市"/>
-					<!-- <u-select v-model="cityShow" :list="cityList" @confirm="cityConfirm"></u-select> -->
-					<city-select-unlimited v-if="cityShow" v-model="cityShow" :default-region="defaultRegion" @city-change="cityConfirm"/>
-				</u-form-item>
-				<!-- <u-form-item label="期望职位" prop="position" required>
+  <view class="evaluate-intention">
+    <!-- 导航栏 -->
+    <u-navbar
+      class="evaluate-intention-bar"
+      back-text=""
+      title=""
+      :background="{ backgroundColor: '#3D5D4C' }"
+      title-color="#fff"
+      back-icon-color="#fff"
+    >
+    </u-navbar>
+
+    <view class="evaluate-intention-explain">
+      <view>继续完善加分项</view>
+      <view>据平台数据显示,完善后,被HR查看几率更高</view>
+    </view>
+
+    <!-- tab页 -->
+    <view class="evaluate-intention-tabs">
+      <view
+        class="evaluate-intention-tabs-item"
+        v-for="(item, index) in list"
+        :key="index"
+        :class="{ 'evaluate-intention-tabs-active': tabCur === index }"
+        @click="tabCur = index"
+      >
+        {{ item.name }}
+      </view>
+    </view>
+
+    <!-- 工作意向 -->
+    <view class="evaluate-intention-intention" v-if="tabCur === 0">
+      <u-form :model="intentionForm" ref="intentionForm" label-position="top">
+        <u-form-item label="工作城市" prop="cityName" required>
+          <u-input v-model="intentionForm.workCity" type="select" @click="workCityClick" placeholder="请选择工作城市" />
+          <!-- <u-select v-model="cityShow" :list="cityList" @confirm="cityConfirm"></u-select> -->
+          <city-select-unlimited v-if="cityShow" v-model="cityShow" :default-region="defaultRegion" @city-change="cityConfirm" />
+        </u-form-item>
+        <!-- <u-form-item label="期望职位" prop="position" required>
 					<u-input v-model="intentionForm.position" type="select" @click="positionShow = true" placeholder="请选择期望职位"/>
 					<u-select v-model="positionShow" :list="positionList" @confirm="positionConfirm"></u-select>
 				</u-form-item>
@@ -44,365 +46,380 @@
 					<u-input v-model="intentionForm.industry" type="select" @click="industryShow = true" placeholder="请选择期望行业"/>
 					<u-select v-model="industryShow" :list="industryList" @confirm="industryConfirm"></u-select>
 				</u-form-item> -->
-				<u-form-item label="最低薪资要求(k)" prop="expectedLowestSalary" required>
-					<u-input v-model="intentionForm.expectedLowestSalary" type="select" @click="lowestsalaryShow = true" placeholder="请选择薪资要求"/>
-					<u-select v-model="lowestsalaryShow" :list="salaryList" @confirm="salaryLowestConfirm" :default-value="[Number(intentionForm.expectedLowestSalary) - 1]"></u-select>
-				</u-form-item>
-				<u-form-item label="最高薪资要求(k)" prop="expectedHighestSalary" required>
-					<u-input v-model="intentionForm.expectedHighestSalary" type="select" @click="highestSalaryShow = true" placeholder="请选择薪资要求"/>
-					<u-select v-model="highestSalaryShow" :list="salaryList" @confirm="salaryHighestConfirm" :default-value="[Number(intentionForm.expectedHighestSalary) - 1]"></u-select>
-				</u-form-item>
-			</u-form>
-			<view class="evaluate-intention-intention-submit">
-				<u-button type="primary" class="btn" @click="submitIntention">开始找工作</u-button>
-			</view>
-			<view class="evaluate-intention-intention-explain">去完善项目经历,让更多HR看到你</view>
-		</view>
-		
-		<!-- 自我评价 -->
-		<view class="evaluate-intention-evaluate" v-else-if="tabCur === 1">
-			<u-form
-				:model="evaluateForm"
-				ref="evaluateForm"
-				label-position="top"
-			>
-				<u-form-item label="自我评价">
-					<u-input
-						v-model="evaluateForm.content"
-						type="textarea"
-						:border="true"
-						:height="150"
-						:auto-height="true"
-					/>
-				</u-form-item>
-			</u-form>
-			<view class="evaluate-intention-evaluate-submit">
-				<u-button type="primary" class="btn" @click="submitEvaluation">提交</u-button>
-			</view>
-		</view>
-		<u-toast ref="uToast" />
-	</view>
+        <u-form-item label="最低薪资要求(k)" prop="expectedLowestSalary" required>
+          <u-input v-model="intentionForm.expectedLowestSalary" type="select" @click="lowestsalaryShow = true" placeholder="请选择薪资要求" />
+          <u-select
+            v-model="lowestsalaryShow"
+            :list="salaryList"
+            @confirm="salaryLowestConfirm"
+            :default-value="[Number(intentionForm.expectedLowestSalary) - 1]"
+          ></u-select>
+        </u-form-item>
+        <u-form-item label="最高薪资要求(k)" prop="expectedHighestSalary" required>
+          <u-input v-model="intentionForm.expectedHighestSalary" type="select" @click="highestSalaryShow = true" placeholder="请选择薪资要求" />
+          <u-select
+            v-model="highestSalaryShow"
+            :list="salaryList"
+            @confirm="salaryHighestConfirm"
+            :default-value="[Number(intentionForm.expectedHighestSalary) - 1]"
+          ></u-select>
+        </u-form-item>
+      </u-form>
+      <view class="evaluate-intention-intention-submit">
+        <u-button type="primary" class="btn" @click="submitIntention">开始找工作</u-button>
+      </view>
+      <view class="evaluate-intention-intention-explain">去完善项目经历,让更多HR看到你</view>
+    </view>
+
+    <!-- 自我评价 -->
+    <view class="evaluate-intention-evaluate" v-else-if="tabCur === 1">
+      <u-form :model="evaluateForm" ref="evaluateForm" label-position="top">
+        <u-form-item label="自我评价">
+          <u-input v-model="evaluateForm.content" type="textarea" :border="true" :height="150" :auto-height="true" />
+        </u-form-item>
+      </u-form>
+      <view class="evaluate-intention-evaluate-submit">
+        <u-button type="primary" class="btn" @click="submitEvaluation">提交</u-button>
+      </view>
+    </view>
+    <u-toast ref="uToast" />
+  </view>
 </template>
 
 <script>
-	import { industry } from './industry.js';
-	import citySelectUnlimited from '../../uview-ui/components/u-city-select-unlimited/u-city-select-unlimited.vue'
-	export default {
-		components: {
-			citySelectUnlimited
-		},
-		data() {
-			return {
-				list: [
-					{
-						name: '期望薪资'
-					},
-					{
-						name: '自我评价'
-					}
-				],
-				tabCur: 0,
-				intentionForm: {
-					provinceName: '',
-					provinceId: '',
-					cityName: '',
-					cityId: '',
-					areaName : '',
-					areaId: '',
-					// position: '',
-					// positionId: '',
-					// industry: '',
-					// industryId: '',
-					expectedLowestSalary: '',
-					expectedHighestSalary: '',
-					workCity: ''
-				},
-				defaultRegion: [],
-				intentionRules: {
-					cityName: [
-						{ 
-							required: true, 
-							message: '请选择您的工作城市', 
-							trigger: ['change','blur']
-						}
-					],
-					// position: [
-					// 	{
-					// 		required: true, 
-					// 		message: '请选择您的期望职位', 
-					// 		trigger: ['change', 'blur']
-					// 	}
-					// ],
-					// industry: [
-					// 	{
-					// 		required: true, 
-					// 		message: '请选择您的期望行业', 
-					// 		trigger: ['change', 'blur']
-					// 	}
-					// ],
-					expectedLowestSalary: [
-						{
-							required: true,
-							message: '请选择您的最低薪资要求', 
-							trigger: ['change', 'blur']
-						}
-					],
-					expectedHighestSalary: [
-						{
-							required: true,
-							message: '请选择您的最高薪资要求', 
-							trigger: ['change', 'blur']
-						},
-						{
-							validator: (rule, value, callback) => {
-								return Number(value) >= Number(this.intentionForm.expectedLowestSalary);
-							},
-							message: '最高薪资要求不能小于最低薪资要求',
-							trigger: ['change', 'blur']
-						}
-					]
-				},
-				// 城市下拉显示
-				cityShow: false,
-				// 职位下拉显示
-				positionShow: false,
-				// 职位列表
-				positionList: [
-					{
-						value: 1,
-						label: '保安'
-					},
-					{
-						value: 2,
-						label: '服务员'
-					},
-					{
-						value: 3,
-						label: '消防员'
-					}
-				],
-				// 行业下拉显示
-				industryShow: false,
-				// 行业列表
-				industryList: industry,
-				// 薪资下拉显示
-				highestSalaryShow: false,
-				lowestsalaryShow: false,
-				// 薪资列表
-				salaryList: [],
-				// 自我评价
-				evaluateForm: {
-					content: ''
-				}
-			}
-		},
-		onLoad(page) {
-			this.getMemberinfo()
-			if (page.tabCur) {
-				this.tabCur = Number(page.tabCur)
-			}
-			// 设置薪资范围
-			let numList = []
-			for(let i = 1; i < 51; i++) {
-				const obj = {
-					value: String(i),
-					label: String(i)
-				}
-				numList.push(obj)
-			}
-			this.salaryList = numList
-		},
-		// 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
-		onReady() {
-			if (this.tabCur === 0) {
-				this.$refs.intentionForm.setRules(this.intentionRules);
-			}
-		},
-		methods: {
-			/**
-			 * 获取用户基本信息
-			 */
-			getMemberinfo(){
-				this.$u.api.getmemberinfo().then(res => {
-					if (res.code === 200){
-						const data = res.data;
-						this.evaluateForm.content = data.selfAssessment
-						// this.intentionForm.position = res.data.expectedPost
-						// this.intentionForm.industry = res.data.expectedIndustry
-						this.intentionForm.expectedLowestSalary = data.expectedLowestSalary ? String(data.expectedLowestSalary) : ''
-						this.intentionForm.expectedHighestSalary = data.expectedHighestSalary ? String(data.expectedHighestSalary) : ''
-						if (data.provinceName) {
-							this.intentionForm.workCity = data.provinceName + '-' + data.cityName + '-' + data.areaName
-						}
-						this.intentionForm.provinceId = data.provinceId
-						this.intentionForm.provinceName = data.provinceName
-						this.intentionForm.cityId = data.cityId
-						this.intentionForm.cityName = data.cityName
-						this.intentionForm.areaId = data.areaId
-						this.intentionForm.areaName = data.areaName
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				}).catch(err => {
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error'
-					})
-				})
-			},
-			/**
-			 * 城市下拉
-			 * @param { Object } item
-			 */
-			cityConfirm(item) {
-				this.intentionForm.provinceName = item.province.label;
-				this.intentionForm.provinceId = item.province.value;
-				this.intentionForm.cityName = item.city.label;
-				this.intentionForm.cityId = item.city.value;
-				this.intentionForm.areaName  = item.area.label;
-				this.intentionForm.areaId = item.area.value;
-				this.intentionForm.workCity = item.province.label + '-' + item.city.label + '-' + item.area.label
-			},
-			/**
-			 * 职位下拉
-			 * @param {Object} item
-			 */
-			positionConfirm(item) {
-				this.intentionForm.position = item[0].label
-				this.intentionForm.positionId = item[0].value
-			},
-			/**
-			 * 行业下拉
-			 * @param {Object} item
-			 */
-			industryConfirm(item) {
-				this.intentionForm.industry = item[0].label
-				this.intentionForm.industryId = item[0].value
-			},
-			/**
-			 * 最低薪资下拉
-			 * @param {Object} item
-			 */
-			salaryLowestConfirm(item) {
-				this.intentionForm.expectedLowestSalary = item[0].label
-			},
-			/**
-			 * 最高薪资下拉
-			 * @param {Object} item
-			 */
-			salaryHighestConfirm(item) {
-				this.intentionForm.expectedHighestSalary = item[0].label
-			},
-			/**
-			 * 跳转到指定页面
-			 */
-			jumpPage(url) {
-				this.$u.route(url)
-			},
-			/**
-			 * 提交求职意向
-			 */
-			submitIntention() {
-				this.$refs.intentionForm.validate(valid => {
-					if (valid) {
-						const form = {
-							...this.intentionForm
-						}
-						uni.showLoading({
-							title: '数据提交中,请等待'
-						})
-						this.$u.api.resume.submitJobIntention({
-							provinceName: form.provinceName,
-							provinceId: form.provinceId,
-							cityName: form.cityName,
-							cityId: form.cityId,
-							areaName : form.areaName ,
-							areaId: form.areaId,
-							expectedLowestSalary: form.expectedLowestSalary,
-							expectedHighestSalary: form.expectedHighestSalary
-						}).then(res => {
-							if (res.code === 200) {
-								this.$refs.uToast.show({
-									title: '更新成功',
-									type: 'success'
-								})
-								setTimeout(() => {
-									uni.hideLoading()
-									this.jumpPage('/pages/myResume/myResume');
-								}, 300)
-							} else {
-								uni.hideLoading();
-								this.$refs.uToast.show({
-									title: res.msg,
-									type: 'error'
-								})
-							}
-						}).catch(() => {
-							uni.hideLoading();
-							this.$refs.uToast.show({
-								title: '系统异常',
-								type: 'error'
-							})
-						})
-					}
-				})
-			},
-			/**
-			 * 提交自我评价
-			 */
-			submitEvaluation() {
-				if (this.evaluateForm.content) {
-					uni.showLoading({
-						title: '数据提交中,请等待'
-					})
-					this.$u.api.resume.submitSelfAssessment({
-						selfAssessment: this.evaluateForm.content
-					}).then(res => {
-						if (res.code === 200) {
-							this.$refs.uToast.show({
-								title: '更新成功',
-								type: 'success'
-							})
-							setTimeout(() => {
-								uni.hideLoading()
-								this.jumpPage('/pages/myResume/myResume');
-							}, 300)
-						} else {
-							uni.hideLoading();
-							this.$refs.uToast.show({
-								title: res.msg,
-								type: 'error'
-							})
-						}
-					}).catch(() => {
-						uni.hideLoading();
-						this.$refs.uToast.show({
-							title: '系统异常',
-							type: 'error'
-						})
-					})
-				} else {
-					uni.hideLoading()
-					this.$refs.uToast.show({
-						title: '请输入自我评价',
-						type: 'warning'
-					})
-				}
-			},
-			/**
-			 * 城市下拉
-			 */
-			workCityClick() {
-				this.defaultRegion = [this.intentionForm.provinceName, this.intentionForm.cityName, this.intentionForm.areaName ]
-				this.cityShow = true;
-			}
-		}
-	}
+import { industry } from './industry.js';
+import citySelectUnlimited from '../../uview-ui/components/u-city-select-unlimited/u-city-select-unlimited.vue';
+export default {
+  components: {
+    citySelectUnlimited
+  },
+  data() {
+    return {
+      list: [
+        {
+          name: '期望薪资'
+        },
+        {
+          name: '自我评价'
+        }
+      ],
+      tabCur: 0,
+      intentionForm: {
+        provinceName: '',
+        provinceId: '',
+        cityName: '',
+        cityId: '',
+        areaName: '',
+        areaId: '',
+        // position: '',
+        // positionId: '',
+        // industry: '',
+        // industryId: '',
+        expectedLowestSalary: '',
+        expectedHighestSalary: '',
+        workCity: ''
+      },
+      defaultRegion: [],
+      intentionRules: {
+        cityName: [
+          {
+            required: true,
+            message: '请选择您的工作城市',
+            trigger: ['change', 'blur']
+          }
+        ],
+        // position: [
+        // 	{
+        // 		required: true,
+        // 		message: '请选择您的期望职位',
+        // 		trigger: ['change', 'blur']
+        // 	}
+        // ],
+        // industry: [
+        // 	{
+        // 		required: true,
+        // 		message: '请选择您的期望行业',
+        // 		trigger: ['change', 'blur']
+        // 	}
+        // ],
+        expectedLowestSalary: [
+          {
+            required: true,
+            message: '请选择您的最低薪资要求',
+            trigger: ['change', 'blur']
+          }
+        ],
+        expectedHighestSalary: [
+          {
+            required: true,
+            message: '请选择您的最高薪资要求',
+            trigger: ['change', 'blur']
+          },
+          {
+            validator: (rule, value, callback) => {
+              return Number(value) >= Number(this.intentionForm.expectedLowestSalary);
+            },
+            message: '最高薪资要求不能小于最低薪资要求',
+            trigger: ['change', 'blur']
+          }
+        ]
+      },
+      // 城市下拉显示
+      cityShow: false,
+      // 职位下拉显示
+      positionShow: false,
+      // 职位列表
+      positionList: [
+        {
+          value: 1,
+          label: '保安'
+        },
+        {
+          value: 2,
+          label: '服务员'
+        },
+        {
+          value: 3,
+          label: '消防员'
+        }
+      ],
+      // 行业下拉显示
+      industryShow: false,
+      // 行业列表
+      industryList: industry,
+      // 薪资下拉显示
+      highestSalaryShow: false,
+      lowestsalaryShow: false,
+      // 薪资列表
+      salaryList: [],
+      // 自我评价
+      evaluateForm: {
+        content: ''
+      }
+    };
+  },
+  onLoad(page) {
+    this.getMemberinfo();
+    if (page.tabCur) {
+      this.tabCur = Number(page.tabCur);
+    }
+    // 设置薪资范围
+    let numList = [];
+    for (let i = 1; i < 51; i++) {
+      const obj = {
+        value: String(i),
+        label: String(i)
+      };
+      numList.push(obj);
+    }
+    this.salaryList = numList;
+  },
+  // 必须要在onReady生命周期,因为onLoad生命周期组件可能尚未创建完毕
+  onReady() {
+    if (this.tabCur === 0) {
+      this.$refs.intentionForm.setRules(this.intentionRules);
+    }
+  },
+  methods: {
+    /**
+     * 获取用户基本信息
+     */
+    getMemberinfo() {
+      this.$u.api
+        .getmemberinfo()
+        .then((res) => {
+          if (res.code === 200) {
+            const data = res.data;
+            this.evaluateForm.content = data.selfAssessment;
+            // this.intentionForm.position = res.data.expectedPost
+            // this.intentionForm.industry = res.data.expectedIndustry
+            this.intentionForm.expectedLowestSalary = data.expectedLowestSalary ? String(data.expectedLowestSalary) : '';
+            this.intentionForm.expectedHighestSalary = data.expectedHighestSalary ? String(data.expectedHighestSalary) : '';
+            if (data.provinceName) {
+              this.intentionForm.workCity = data.provinceName + '-' + data.cityName + '-' + data.areaName;
+            }
+            this.intentionForm.provinceId = data.provinceId;
+            this.intentionForm.provinceName = data.provinceName;
+            this.intentionForm.cityId = data.cityId;
+            this.intentionForm.cityName = data.cityName;
+            this.intentionForm.areaId = data.areaId;
+            this.intentionForm.areaName = data.areaName;
+          } else {
+            this.$refs.uToast.show({
+              title: res.msg,
+              type: 'error'
+            });
+          }
+        })
+        .catch((err) => {
+          this.$refs.uToast.show({
+            title: err.msg,
+            type: 'error'
+          });
+        });
+    },
+    /**
+     * 城市下拉
+     * @param { Object } item
+     */
+    cityConfirm(item) {
+      this.intentionForm.provinceName = item.province.label;
+      this.intentionForm.provinceId = item.province.value;
+      this.intentionForm.cityName = item.city.label;
+      this.intentionForm.cityId = item.city.value;
+      this.intentionForm.areaName = item.area.label;
+      this.intentionForm.areaId = item.area.value;
+      this.intentionForm.workCity = item.province.label + '-' + item.city.label + '-' + item.area.label;
+    },
+    /**
+     * 职位下拉
+     * @param {Object} item
+     */
+    positionConfirm(item) {
+      this.intentionForm.position = item[0].label;
+      this.intentionForm.positionId = item[0].value;
+    },
+    /**
+     * 行业下拉
+     * @param {Object} item
+     */
+    industryConfirm(item) {
+      this.intentionForm.industry = item[0].label;
+      this.intentionForm.industryId = item[0].value;
+    },
+    /**
+     * 最低薪资下拉
+     * @param {Object} item
+     */
+    salaryLowestConfirm(item) {
+      this.intentionForm.expectedLowestSalary = item[0].label;
+    },
+    /**
+     * 最高薪资下拉
+     * @param {Object} item
+     */
+    salaryHighestConfirm(item) {
+      this.intentionForm.expectedHighestSalary = item[0].label;
+    },
+    /**
+     * 跳转到指定页面
+     */
+    jumpPage(url, type) {
+      if (type === 'redirectTo') {
+        uni.redirectTo({
+          url
+        });
+      } else {
+        this.$u.route(url);
+      }
+    },
+    /**
+     * 提交求职意向
+     */
+    submitIntention() {
+      this.$refs.intentionForm.validate((valid) => {
+        if (valid) {
+          const form = {
+            ...this.intentionForm
+          };
+          uni.showLoading({
+            title: '数据提交中,请等待'
+          });
+          this.$u.api.resume
+            .submitJobIntention({
+              provinceName: form.provinceName,
+              provinceId: form.provinceId,
+              cityName: form.cityName,
+              cityId: form.cityId,
+              areaName: form.areaName,
+              areaId: form.areaId,
+              expectedLowestSalary: form.expectedLowestSalary,
+              expectedHighestSalary: form.expectedHighestSalary
+            })
+            .then((res) => {
+              if (res.code === 200) {
+                this.$refs.uToast.show({
+                  title: '更新成功',
+                  type: 'success'
+                });
+                setTimeout(() => {
+                  uni.hideLoading();
+                  this.jumpPage('/pages/myResume/myResume', 'redirectTo');
+                }, 300);
+              } else {
+                uni.hideLoading();
+                this.$refs.uToast.show({
+                  title: res.msg,
+                  type: 'error'
+                });
+              }
+            })
+            .catch(() => {
+              uni.hideLoading();
+              this.$refs.uToast.show({
+                title: '系统异常',
+                type: 'error'
+              });
+            });
+        }
+      });
+    },
+    /**
+     * 提交自我评价
+     */
+    submitEvaluation() {
+      if (this.evaluateForm.content) {
+        uni.showLoading({
+          title: '数据提交中,请等待'
+        });
+        this.$u.api.resume
+          .submitSelfAssessment({
+            selfAssessment: this.evaluateForm.content
+          })
+          .then((res) => {
+            if (res.code === 200) {
+              this.$refs.uToast.show({
+                title: '更新成功',
+                type: 'success'
+              });
+              setTimeout(() => {
+                uni.hideLoading();
+                this.jumpPage('/pages/myResume/myResume', 'redirectTo');
+              }, 300);
+            } else {
+              uni.hideLoading();
+              this.$refs.uToast.show({
+                title: res.msg,
+                type: 'error'
+              });
+            }
+          })
+          .catch(() => {
+            uni.hideLoading();
+            this.$refs.uToast.show({
+              title: '系统异常',
+              type: 'error'
+            });
+          });
+      } else {
+        uni.hideLoading();
+        this.$refs.uToast.show({
+          title: '请输入自我评价',
+          type: 'warning'
+        });
+      }
+    },
+    /**
+     * 城市下拉
+     */
+    workCityClick() {
+      this.defaultRegion = [this.intentionForm.provinceName, this.intentionForm.cityName, this.intentionForm.areaName];
+      this.cityShow = true;
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-@import './evaluationIntention.scss'
+@import './evaluationIntention.scss';
 </style>

+ 171 - 163
h5_web/pages/mine/mine.vue

@@ -1,94 +1,99 @@
 <!-- 我的 -->
 <template>
-	<view class="mine">
-		
-		<!-- 背景 -->
-		<view class="mine-bg"></view>
-		
-		<!-- 个人信息 -->
-		<view class="mine-info">
-			
-			<!-- 头像和积分 -->
-			<view class="mine-info-header">
-				<view class="mine-info-header-left">
-					<view class="avatar" @click="jumpPage('/pages/personalModify/personalModify')">
-						<u-avatar :src="memberinfo.avatar" mode="circle" size="130"/>
-					</view>
-					<view class="name">{{ memberinfo.name }}</view>
-				</view>
-				<view class="mine-info-header-right" @click="jumpPage('/pages/progressiveIntegral/progressiveIntegral')">
-					<view>进步<br/>积分</view>
-					<view>{{ integral || 0 }}</view>
-					<u-icon name="arrow-right" color="#fff" size="30"/>
-				</view>
-			</view>
-			
-			<!-- 认证 -->
-			<view class="mine-info-authentication">
-				<view class="mine-info-authentication-item">
-					<view>退役军人</view>
-					<view v-if="memberinfo.auditStatus === 0" class="no-certified">认证中</view>
-					<view v-else-if="memberinfo.auditStatus === 2" class="had certified">已认证</view>
-					<view class="no-certified" v-else @click="jumpPage('/pages/applyEducationCode/applyEducationCode')">未认证</view>
-				</view>
-				<view class="mine-info-authentication-item">
-					<view>适应性培训</view>
-					<view v-if="memberinfo.adaptTrainIsPass === 1" class="had passed">已通过</view>
-					<view @click="jumpPage('/pages/basicTraining/basicTraining')" class="no-certified" v-else>未通过</view>
-				</view>
-			</view>
-			
-			<!-- 个人获得 -->
-			<view class="mine-info-gain">
-				<view class="mine-info-gain-item">
-					<view>{{ countData.classCount || 0 }}<text>个</text></view>
-					<view>技能培训</view>
-				</view>
-				<view class="mine-info-gain-item">
-					<view>{{ countData.learnTime ? (Number(countData.learnTime) / 3600).toFixed(2) : 0 }}<text>小时</text></view>
-					<view>学习时长</view>
-				</view>
-				<view class="mine-info-gain-item">
-					<view>{{ countData.interviewTimes || 0 }}<text>次</text></view>
-					<view>获得面试</view>
-				</view>
-			</view>
-			
-			<!-- 单元格 -->
-			<view class="mine-info-cell1">
-				<u-cell-group :border="false">
-					<u-cell-item title="我的简历" @click="jumpPage('/pages/myResume/myResume')">
-						<u-image class="cell-icon jianli" width="34" height="33" slot="icon" src="../../static/img/jianlitongguo.png" mode="aspectFit"></u-image>
-					</u-cell-item>
-					<u-cell-item title="我的投递" @click="jumpPage('/pages/myDelivery/myDelivery')">
-						<u-image class="cell-icon toudi" slot="icon" width="34" height="40" src="../../static/img/toudimoren.png" mode="aspectFit"></u-image>
-					</u-cell-item>
-					<u-cell-item title="我的面试" @click="jumpPage('/pages/myInterview/myInterview')">
-						<u-image class="cell-icon mianshi" width="34" height="40" slot="icon" src="../../static/img/mianshi-houxuanren.png" mode="aspectFit"></u-image>
-					</u-cell-item>
-				</u-cell-group>
-			</view>
-			<!-- 单元格 -->
-			<view class="mine-info-cell1">
-				<u-cell-group :border="false">
-					<u-cell-item title="我的技能培训" @click="jumpPage('/pages/mine/skillsTraining/skillsTraining')">
-						<u-image class="cell-icon peixun" width="34" height="40" slot="icon" src="../../static/img/jinengx.png" mode="aspectFit"></u-image>
-					</u-cell-item>
-					<u-cell-item title="我的评价" @click="jumpPage('/pages/inbuild/inbuild')">
-						<u-image class="cell-icon pingjia" width="34" height="40" slot="icon" src="../../static/img/pingjia.png" mode="aspectFit"></u-image>
-					</u-cell-item>
-				</u-cell-group>
-			</view>
-			
-			<!-- 单元格 -->
-			<view class="mine-info-cell1">
-				<u-cell-group :border="false">
-					<u-cell-item title="设置" @click="jumpPage('/pages/setting/setting')">
-						<u-image class="cell-icon shezhi" width="34" height="40" slot="icon" src="../../static/img/shezhi.png" mode="aspectFit"></u-image>
-					</u-cell-item>
-				</u-cell-group>
-			</view>
-		</view>
+  <view class="mine">
+    <!-- 背景 -->
+    <view class="mine-bg"></view>
+
+    <!-- 个人信息 -->
+    <view class="mine-info">
+      <!-- 头像和积分 -->
+      <view class="mine-info-header">
+        <view class="mine-info-header-left">
+          <view class="avatar" @click="jumpPage('/pages/personalModify/personalModify')">
+            <u-avatar :src="memberinfo.avatar" mode="circle" size="130" />
+          </view>
+          <view class="name">{{ memberinfo.name }}</view>
+        </view>
+        <view class="mine-info-header-right" @click="jumpPage('/pages/progressiveIntegral/progressiveIntegral')">
+          <view>进步<br />积分</view>
+          <view>{{ integral || 0 }}</view>
+          <u-icon name="arrow-right" color="#fff" size="30" />
+        </view>
+      </view>
+
+      <!-- 认证 -->
+      <view class="mine-info-authentication">
+        <view class="mine-info-authentication-item">
+          <view>退役军人</view>
+          <view v-if="memberinfo.auditStatus === 0" class="no-certified">认证中</view>
+          <view v-else-if="memberinfo.auditStatus === 2" class="had certified">已认证</view>
+          <view class="no-certified" v-else @click="jumpPage('/pages/applyEducationCode/applyEducationCode')">未认证</view>
+        </view>
+        <view class="mine-info-authentication-item">
+          <view>适应性培训</view>
+          <view v-if="memberinfo.adaptTrainIsPass === 1" class="had passed">已通过</view>
+          <view @click="jumpPage('/pages/basicTraining/basicTraining')" class="no-certified" v-else>未通过</view>
+        </view>
+      </view>
+
+      <!-- 个人获得 -->
+      <view class="mine-info-gain">
+        <view class="mine-info-gain-item">
+          <view>{{ countData.classCount || 0 }}<text>个</text></view>
+          <view>技能培训</view>
+        </view>
+        <view class="mine-info-gain-item">
+          <view>{{ countData.learnTime ? (Number(countData.learnTime) / 3600).toFixed(2) : 0 }}<text>小时</text></view>
+          <view>学习时长</view>
+        </view>
+        <view class="mine-info-gain-item">
+          <view>{{ countData.interviewTimes || 0 }}<text>次</text></view>
+          <view>获得面试</view>
+        </view>
+      </view>
+
+      <!-- 单元格 -->
+      <view class="mine-info-cell1">
+        <u-cell-group :border="false">
+          <u-cell-item title="我的简历" @click="jumpPage('/pages/myResume/myResume')">
+            <u-image class="cell-icon jianli" width="34" height="33" slot="icon" src="../../static/img/jianlitongguo.png" mode="aspectFit"></u-image>
+          </u-cell-item>
+          <u-cell-item title="我的投递" @click="jumpPage('/pages/myDelivery/myDelivery')">
+            <u-image class="cell-icon toudi" slot="icon" width="34" height="40" src="../../static/img/toudimoren.png" mode="aspectFit"></u-image>
+          </u-cell-item>
+          <u-cell-item title="我的面试" @click="jumpPage('/pages/myInterview/myInterview')">
+            <u-image
+              class="cell-icon mianshi"
+              width="34"
+              height="40"
+              slot="icon"
+              src="../../static/img/mianshi-houxuanren.png"
+              mode="aspectFit"
+            ></u-image>
+          </u-cell-item>
+        </u-cell-group>
+      </view>
+      <!-- 单元格 -->
+      <view class="mine-info-cell1">
+        <u-cell-group :border="false">
+          <u-cell-item title="我的技能培训" @click="jumpPage('/pages/mine/skillsTraining/skillsTraining')">
+            <u-image class="cell-icon peixun" width="34" height="40" slot="icon" src="../../static/img/jinengx.png" mode="aspectFit"></u-image>
+          </u-cell-item>
+          <u-cell-item title="我的评价" @click="jumpPage('/pages/inbuild/inbuild')">
+            <u-image class="cell-icon pingjia" width="34" height="40" slot="icon" src="../../static/img/pingjia.png" mode="aspectFit"></u-image>
+          </u-cell-item>
+        </u-cell-group>
+      </view>
+
+      <!-- 单元格 -->
+      <view class="mine-info-cell1">
+        <u-cell-group :border="false">
+          <u-cell-item title="设置" @click="jumpPage('/pages/setting/setting')">
+            <u-image class="cell-icon shezhi" width="34" height="40" slot="icon" src="../../static/img/shezhi.png" mode="aspectFit"></u-image>
+          </u-cell-item>
+        </u-cell-group>
+      </view>
+    </view>
     <!-- ########################## -- 底部导航栏 -- ################################ -->
     <u-tabbar
       :list="tabbarConfig.tabbarList"
@@ -98,84 +103,87 @@
       :active-color="tabbarConfig.activeColor"
       :mid-button-size="tabbarConfig.midButtonSize"
     ></u-tabbar>
-		<u-toast ref="uToast" />
-	</view>
+    <u-toast ref="uToast" />
+  </view>
 </template>
 
 <script>
-  import tabbarconfig from 'tabbarconfig.js';
-  
-	export default {
-		name: 'Mine',
-		data() {
-			return {
-        tabbarConfig: tabbarconfig,
-				veteEducStatus: '',
-				memberinfo: '',
-				countData: '',
-				integral: 0
-			}
-		},
-		onShow() {
-			this.getMemberinfo()
-			this.getCountResul()
-			this.getIntegralTotal()
-		},
-		methods: {
-			/**
-			 * 获取个人总积分
-			 */
-			getIntegralTotal() {
-				this.$u.api.mine.getIntegralTotalApi().then(res => {
-					// console.log('用户统计信息:', res.data)
-					if (res.code === 200) {
-						this.integral = res.data
-					}
-				})
-			},
-			/**
-			 * 获取用户统计信息
-			 */
-			getCountResul() {
-				this.$u.api.mine.getCountResulApi().then(res => {
-					// console.log('用户统计信息:', res.data)
-					if (res.code === 200) {
-						this.countData = res.data
-					}
-				})
-			},
-			/**
-			 * 获取用户基本信息
-			 */
-			getMemberinfo(){
-				this.$u.api.getmemberinfo().then(res => {
-					console.log('用户基本信息:', res.data)
-					if (res.code === 200){
-						this.memberinfo = res.data;
-						this.$u.vuex('vuex_memberInfo', res.data);
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				}).catch(err => {
-					this.$refs.uToast.show({
-						title: err.msg,
-						type: 'error'
-					})
-				})
-			},
-			/**
-			 * 跳转到指定页面
-			 */
-			jumpPage(url) {
-				this.$u.route(url)
-			}
-		}
-	}
+import tabbarconfig from 'tabbarconfig.js';
+
+export default {
+  name: 'Mine',
+  data() {
+    return {
+      tabbarConfig: tabbarconfig,
+      veteEducStatus: '',
+      memberinfo: '',
+      countData: '',
+      integral: 0
+    };
+  },
+  onShow() {
+    this.getMemberinfo();
+    this.getCountResul();
+    this.getIntegralTotal();
+  },
+  methods: {
+    /**
+     * 获取个人总积分
+     */
+    getIntegralTotal() {
+      this.$u.api.mine.getIntegralTotalApi().then((res) => {
+        // console.log('用户统计信息:', res.data)
+        if (res.code === 200) {
+          this.integral = res.data;
+        }
+      });
+    },
+    /**
+     * 获取用户统计信息
+     */
+    getCountResul() {
+      this.$u.api.mine.getCountResulApi().then((res) => {
+        // console.log('用户统计信息:', res.data)
+        if (res.code === 200) {
+          this.countData = res.data;
+        }
+      });
+    },
+    /**
+     * 获取用户基本信息
+     */
+    getMemberinfo() {
+      this.$u.api
+        .getmemberinfo()
+        .then((res) => {
+          console.log('用户基本信息:', res.data);
+          if (res.code === 200) {
+            this.memberinfo = res.data;
+            this.$u.vuex('vuex_memberInfo', res.data);
+          } else {
+            this.$refs.uToast.show({
+              title: res.msg,
+              type: 'error'
+            });
+          }
+        })
+        .catch((err) => {
+          this.$refs.uToast.show({
+            title: err.msg,
+            type: 'error'
+          });
+        });
+    },
+    /**
+     * 跳转到指定页面
+     */
+    jumpPage(url) {
+      this.$u.route(url);
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	@import './mine.scss';
+@import './mine.scss';
 </style>

+ 8 - 1
h5_web/pages/mine/skillsTraining/skillsTraining.scss

@@ -18,6 +18,7 @@ page {
 			padding: 36rpx 32rpx;
 			display: flex;
 			align-items: center;
+			margin-bottom: 15px;
 			
 			.left {
 				margin-right: 22rpx;
@@ -29,7 +30,13 @@ page {
 				color: #3E3E3E;
 				font-size: 28rpx;
 				line-height: 45rpx;
-				width: 100%;
+				width: calc(100% - 248rpx);
+				.wrap {
+					width: 100%;
+					overflow: hidden;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+				}
 				.name {
 					color: #3E3E3E;
 					font-size: 36rpx;

+ 111 - 90
h5_web/pages/mine/skillsTraining/skillsTraining.vue

@@ -1,98 +1,119 @@
 <!-- 我的技能培训 -->
 <template>
-	<view class="training">
-		<u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
-		<z-paging
-			ref="paging"
-			v-model="trainingList"
-			@query="queryList"
-		>
-			<!-- 选项卡 -->
-			<view class="training-tab" slot="top">
-				<u-tabs :list="tabList" :is-scroll="true" :current="current" @change="tabChange" bg-color="#f2f2f2" inactive-color="#000000" active-color="#709078" :bold="false" bar-width="40" bar-height="6" :active-item-style="{color: '#000000'}"></u-tabs>
-			</view>
-			
-			<!-- 列表 -->
-			<view class="training-list">
-				<view class="training-list-item" v-for="(item, index) in trainingList" :key="index" @click="jumpPage('/pages/mine/skillsTraining/skillsTrainingDetails/skillsTrainingDetails', { id: item.id })">
-					<view class="left">
-						<u-image :src="item.img" mode="aspectFill" width="204" height="220" border-radius="10"></u-image>
-					</view>
-					<view class="right">
-						<view class="name">{{ item.name }}</view>
-						<view class="school">培训学校:{{ item.schoolName }}</view>
-						<view class="flex">
-							<view class="rate">
-								难度<u-rate :count="5" v-model="item.difficult" inactive-color="#EF651F" active-color="#EF651F" disabled size="30" gutter="6"></u-rate>
-							</view>
-							<!-- <view>报名人数:{{ item.people }}</view> -->
-						</view>
-						<view>开始时间:{{ item.applyTime }}</view>
-						<view>培训周期:{{ item.cycle }}个月</view>
-					</view>
-				</view>
-			</view>
-		</z-paging>
-	</view>
+  <view class="training">
+    <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
+    <z-paging ref="paging" v-model="trainingList" @query="queryList">
+      <!-- 选项卡 -->
+      <view class="training-tab" slot="top">
+        <u-tabs
+          :list="tabList"
+          :is-scroll="true"
+          :current="current"
+          @change="tabChange"
+          bg-color="#f2f2f2"
+          inactive-color="#000000"
+          active-color="#709078"
+          :bold="false"
+          bar-width="40"
+          bar-height="6"
+          :active-item-style="{ color: '#000000' }"
+        ></u-tabs>
+      </view>
+
+      <!-- 列表 -->
+      <view class="training-list">
+        <view
+          class="training-list-item"
+          v-for="(item, index) in trainingList"
+          :key="index"
+          @click="jumpPage('/pages/mine/skillsTraining/skillsTrainingDetails/skillsTrainingDetails', { id: item.id })"
+        >
+          <view class="left">
+            <u-image :src="item.img" mode="aspectFill" width="204" height="220" border-radius="10"></u-image>
+          </view>
+          <view class="right">
+            <view class="name wrap">{{ item.name || '-' }}</view>
+            <view class="school wrap">培训学校:{{ item.schoolName || '-' }}</view>
+            <view class="flex wrap">
+              <view class="rate">
+                难度<u-rate
+                  :count="5"
+                  v-model="item.difficult"
+                  inactive-color="#EF651F"
+                  active-color="#EF651F"
+                  disabled
+                  size="30"
+                  gutter="6"
+                ></u-rate>
+              </view>
+              <!-- <view>报名人数:{{ item.people }}</view> -->
+            </view>
+            <view class="wrap">开始时间:{{ item.applyTime || '-' }}</view>
+            <view class="wrap">培训周期:{{ item.cycle || '-' }}个月</view>
+          </view>
+        </view>
+      </view>
+    </z-paging>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				current: 0,
-				
-				tabList: [
-					{ value: 1, name: '培训中' },
-					{ value: 0, name: '已报名' }
-				],
-				trainingList: []
-			}
-		},
-		methods: {
-			/**
-			 * tab切换
-			 * @param { Number } cur
-			 */
-			tabChange(cur) {
-				this.current = cur
-				this.getList(1, 10, this.tabList[cur].value);
-			},
-			/**
-			 * 下拉分页组件触发
-			 * @param {Number} pageNum
-			 * @param {Number} pageSize
-			 */
-			queryList(pageNum, pageSize) {
-				this.getList(pageNum, pageSize, this.tabList[this.current].value);
-			},
-			/**
-			 * 获取列表
-			 * @param {Object} pageNum
-			 * @param {Object} pageSize
-			 */
-			getList(pageNum, pageSize, type) {
-				this.$u.api.skillTraining.getMyTrainingListApi({ pageNum, pageSize, type }).then(res => {
-					if (res.code === 200) {
-						this.$refs.paging.complete(res.rows);
-					} else {
-						this.$refs.paging.complete([]);
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				})
-			},
-			/**
-			 * @param {Object} url
-			 * @param {Object} params
-			 */
-			jumpPage(url, params) {
-				this.$u.route({ url, params })
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      current: 0,
+
+      tabList: [
+        { value: 1, name: '培训中' },
+        { value: 0, name: '已报名' }
+      ],
+      trainingList: []
+    };
+  },
+  methods: {
+    /**
+     * tab切换
+     * @param { Number } cur
+     */
+    tabChange(cur) {
+      this.current = cur;
+      this.getList(1, 10, this.tabList[cur].value);
+    },
+    /**
+     * 下拉分页组件触发
+     * @param {Number} pageNum
+     * @param {Number} pageSize
+     */
+    queryList(pageNum, pageSize) {
+      this.getList(pageNum, pageSize, this.tabList[this.current].value);
+    },
+    /**
+     * 获取列表
+     * @param {Object} pageNum
+     * @param {Object} pageSize
+     */
+    getList(pageNum, pageSize, type) {
+      this.$u.api.skillTraining.getMyTrainingListApi({ pageNum, pageSize, type }).then((res) => {
+        if (res.code === 200) {
+          this.$refs.paging.complete(res.rows);
+        } else {
+          this.$refs.paging.complete([]);
+          this.$refs.uToast.show({
+            title: res.msg,
+            type: 'error'
+          });
+        }
+      });
+    },
+    /**
+     * @param {Object} url
+     * @param {Object} params
+     */
+    jumpPage(url, params) {
+      this.$u.route({ url, params });
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 181 - 163
h5_web/pages/mine/skillsTraining/skillsTrainingDetails/skillsTrainingDetails.vue

@@ -1,172 +1,190 @@
 <!-- 我的技能培训详情  -->
 <template>
-	<view class="details">
-		<u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
-		<!-- 背景 -->
-		<view class="details-bg">
-			<view class="details-bg-1"></view>
-			<view class="details-bg-2"></view>
-		</view>
-		<!-- 内容 -->
-		<view class="details-content">
-			<view class="details-content-title">
-				<view class="left">
-					<u-image :src="details.img" width="204"
-						height="220" border-radius="10"></u-image>
-					<view class="left-weekly">培训周期:{{ details.cycle }}个月</view>
-				</view>
-				<view class="right">
-					<view class="name">
-						<!-- <view class="tip">汽修</view> -->
-						<view class="professional">{{ details.name }}</view>
-					</view>
-					<view class="class" v-if="details.className"><text>{{ details.className }}</text>{{ details.openingTime }}</view>
-					<view>培训学校:{{ details.schoolName }}</view>
-					<view>培训导师:{{ details.teacherName }}</view>
-					<view class="hardly">
-						难度<u-rate :count="5" v-model="details.difficult" size="30" active-color="#EF651F"
-							inactive-color="#EF651F" disabled></u-rate>
-					</view>
-					<view class="hardly">报名人数:10/20</view>
-				</view>
-			</view>
-			<view class="details-content-course">
-				<view class="details-content-course-btn">
-					<view class="item" @click="jumpPage('/pages/skillsTraining/achievementCertificate/achievementCertificate', { id: details.id })">
-						<view>
-							<u-image src="../../../../static/img/certificate-icon.png" mode="aspectFill" width="40" height="50"></u-image>
-						</view>
-						<view class="name">成绩与证书</view>
-						<view>
-							<u-icon name="arrow-right" size="20"></u-icon>
-						</view>
-					</view>
-					<view class="item" @click="teacherInteract(details)">
-						<view>
-							<u-image src="../../../../static/img/interaction-icon.png" mode="aspectFill" width="46" height="46"></u-image>
-						</view>
-						<view class="name">教师互动</view>
-						<view>
-							<u-icon name="arrow-right" size="20"></u-icon>
-						</view>
-					</view>
-				</view>
-				<view class="details-content-course-progress">
-					<view class="title">总学习进度 ({{ details.finishPercent || 0 }}%)</view>
-					<view>
-						<u-line-progress active-color="#709078" inactive-color="#ECECEC" :percent="details.finishPercent || 0" height="18" :show-percent="false"></u-line-progress>
-					</view>
-				</view>
-				<view class="details-content-course-tab">
-					<view :class="{'active': tabCur === 1}" @click="tabCur = 1">线上课程</view>
-					<view :class="{'active': tabCur === 2}" @click="tabCur = 2">线下实训</view>
-				</view>
-				<!-- 线上课程 -->
-				<view class="details-content-course-online" v-if="tabCur === 1">
-					<view class="online-list" v-if="details.onLineCourselist && details.onLineCourselist.length">
-						<view class="online-list-item" v-for="(item, index) in details.onLineCourselist" :key="index" @click="jumpPage('pages/skillsTraining/courseDetailed/courseDetailed', { id: item.id })">
-							<view class="left">
-								<u-image :src="item.img" mode="aspectFill" width="204" height="132" border-radius="10"></u-image>
-							</view>
-							<view class="right">
-								<view>{{ item.name }}</view>
-								<view>{{` 共${item.amount || 0}课,已学完${item.finishCount || 0},学习进度${item.finishPercent || 0}% `}}</view>
-							</view>
-						</view>
-					</view>
-					<view class="no-data" v-else>
-						<u-empty text="暂无线上课程" mode="list"></u-empty>
-					</view>
-				</view>
-				<!-- 线下课程 -->
-				<view class="details-content-course-offline" v-if="tabCur === 2">
-					<!-- <view class="notice">请于2021.10.12 9:00到贵州职业技术学院参加汽修车检线下实训</view> -->
-					<view class="offline-list" v-if="details.offLineCourselist && details.offLineCourselist.length">
-						<view class="offline-list-item" v-for="(item, index) in details.offLineCourselist" :key="index">
-							<view class="left">
-								<u-image :src="item.img" mode="aspectFill" width="204" height="132" border-radius="10"></u-image>
-							</view>
-							<view class="right">
-								<view>{{ item.name }}</view>
-								<view>{{ item.date }}</view>
-								<view>{{ item.address }}</view>
-							</view>
-						</view>
-					</view>
-					<view class="no-data" v-else>
-						<u-empty text="暂无线下课程" mode="list"></u-empty>
-					</view>
-				</view>
-			</view>
-		</view>
-		<u-toast ref="uToast" />
-	</view>
+  <view class="details">
+    <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
+    <!-- 背景 -->
+    <view class="details-bg">
+      <view class="details-bg-1"></view>
+      <view class="details-bg-2"></view>
+    </view>
+    <!-- 内容 -->
+    <view class="details-content">
+      <view class="details-content-title">
+        <view class="left">
+          <u-image :src="details.img" width="204" height="220" border-radius="10"></u-image>
+          <view class="left-weekly">培训周期:{{ details.cycle }}个月</view>
+        </view>
+        <view class="right">
+          <view class="name">
+            <!-- <view class="tip">汽修</view> -->
+            <view class="professional">{{ details.name }}</view>
+          </view>
+          <view class="class" v-if="details.className"
+            ><text>{{ details.className }}</text
+            >{{ details.openingTime }}</view
+          >
+          <view>培训学校:{{ details.schoolName }}</view>
+          <view>培训导师:{{ details.teacherName }}</view>
+          <view class="hardly">
+            难度<u-rate :count="5" v-model="details.difficult" size="30" active-color="#EF651F" inactive-color="#EF651F" disabled></u-rate>
+          </view>
+          <view class="hardly">报名人数:10/20</view>
+        </view>
+      </view>
+      <view class="details-content-course">
+        <view class="details-content-course-btn">
+          <view class="item" @click="jumpPage('/pages/skillsTraining/achievementCertificate/achievementCertificate', { id: details.id })">
+            <view>
+              <u-image src="../../../../static/img/certificate-icon.png" mode="aspectFill" width="40" height="50"></u-image>
+            </view>
+            <view class="name">成绩与证书</view>
+            <view>
+              <u-icon name="arrow-right" size="20"></u-icon>
+            </view>
+          </view>
+          <view class="item" @click="teacherInteract(details)">
+            <view>
+              <u-image src="../../../../static/img/interaction-icon.png" mode="aspectFill" width="46" height="46"></u-image>
+            </view>
+            <view class="name">教师互动</view>
+            <view>
+              <u-icon name="arrow-right" size="20"></u-icon>
+            </view>
+          </view>
+        </view>
+        <view class="details-content-course-progress">
+          <view class="title">总学习进度 ({{ details.finishPercent || 0 }}%)</view>
+          <view>
+            <u-line-progress
+              active-color="#709078"
+              inactive-color="#ECECEC"
+              :percent="details.finishPercent || 0"
+              height="18"
+              :show-percent="false"
+            ></u-line-progress>
+          </view>
+        </view>
+        <view class="details-content-course-tab">
+          <view :class="{ active: tabCur === 1 }" @click="tabCur = 1">线上课程</view>
+          <view :class="{ active: tabCur === 2 }" @click="tabCur = 2">线下实训</view>
+        </view>
+        <!-- 线上课程 -->
+        <view class="details-content-course-online" v-if="tabCur === 1">
+          <view class="online-list" v-if="details.onLineCourselist && details.onLineCourselist.length">
+            <view
+              class="online-list-item"
+              v-for="(item, index) in details.onLineCourselist"
+              :key="index"
+              @click="jumpPage('pages/skillsTraining/courseDetailed/courseDetailed', { id: item.id })"
+            >
+              <view class="left">
+                <u-image :src="item.img" mode="aspectFill" width="204" height="132" border-radius="10"></u-image>
+              </view>
+              <view class="right">
+                <view>{{ item.name }}</view>
+                <view>{{ ` 共${item.amount || 0}课,已学完${item.finishCount || 0},学习进度${item.finishPercent || 0}% ` }}</view>
+              </view>
+            </view>
+          </view>
+          <view class="no-data" v-else>
+            <u-empty text="暂无线上课程" mode="list"></u-empty>
+          </view>
+        </view>
+        <!-- 线下课程 -->
+        <view class="details-content-course-offline" v-if="tabCur === 2">
+          <!-- <view class="notice">请于2021.10.12 9:00到贵州职业技术学院参加汽修车检线下实训</view> -->
+          <view class="offline-list" v-if="details.offLineCourselist && details.offLineCourselist.length">
+            <view class="offline-list-item" v-for="(item, index) in details.offLineCourselist" :key="index">
+              <view class="left">
+                <u-image :src="item.img" mode="aspectFill" width="204" height="132" border-radius="10"></u-image>
+              </view>
+              <view class="right">
+                <view>{{ item.name }}</view>
+                <view>{{ item.date }}</view>
+                <view>{{ item.address }}</view>
+              </view>
+            </view>
+          </view>
+          <view class="no-data" v-else>
+            <u-empty text="暂无线下课程" mode="list"></u-empty>
+          </view>
+        </view>
+      </view>
+    </view>
+    <u-toast ref="uToast" />
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				id: '',
-				details: {},
-				onlineList: [],
-				tabCur: 1
-			}
-		},
-		onLoad(page) {
-			if (page.id) {
-				this.id = page.id
-			}
-		},
-		onShow() {
-			this.getDetails(this.id);
-		},
-		methods: {
-			/**
-			 * 获取我的技能培训详情
-			 * @param {Object} id
-			 */
-			getDetails(id) {
-				this.$u.api.skillTraining.getMyTrainingDetailsApi({ id }).then(res => {
-					if (res.code === 200) {
-						this.details = res.data
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				})
-			},
-			/**
-			 * 跳转到指定页面
-			 * @param {Object} url
-			 * @param {Object} params
-			 */
-			jumpPage(url, params) {
-				this.$u.route({
-					url,
-					params
-				})
-			},
-			/**
-			 * 教师互动
-			 * @param {Object} item
-			 */
-			teacherInteract(item) {
-				let url =
-					`${this.config.timChatUrl}?userID=${this.vuex_user.userId}&title=教师互动&permission=1&type=retire&classId=${item.classId}`
-				this.$u.route({
-					url: '/pages/webView/webView',
-					params: {
-						url: encodeURIComponent(url)
-					}
-				})
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      id: '',
+      details: {},
+      onlineList: [],
+      tabCur: 1
+    };
+  },
+  onLoad(page) {
+    if (page.id) {
+      this.id = page.id;
+    }
+  },
+  onShow() {
+    this.getDetails(this.id);
+  },
+  methods: {
+    /**
+     * 获取我的技能培训详情
+     * @param {Object} id
+     */
+    getDetails(id) {
+      this.$u.api.skillTraining.getMyTrainingDetailsApi({ id }).then((res) => {
+        if (res.code === 200) {
+          this.details = res.data;
+        } else {
+          this.$refs.uToast.show({
+            title: res.msg,
+            type: 'error'
+          });
+        }
+      });
+    },
+    /**
+     * 跳转到指定页面
+     * @param {Object} url
+     * @param {Object} params
+     */
+    jumpPage(url, params) {
+      this.$u.route({
+        url,
+        params
+      });
+    },
+    /**
+     * 教师互动
+     * @param {Object} item
+     */
+    teacherInteract(item) {
+      if (item.classId) {
+        let url = `${this.config.timChatUrl}?userID=${this.vuex_user.userId || this.vuex_user.id}&title=教师互动&permission=1&type=retire&classId=${item.classId}`;
+        this.$u.route({
+          url: '/pages/webView/webView',
+          params: {
+            url: encodeURIComponent(url)
+          }
+        });
+      } else {
+				this.$refs.uToast.show({
+					title: '该课程暂无教师!',
+					type: 'warning'
+				});
+      }
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	@import './skillsTrainingDetails.scss';
+@import './skillsTrainingDetails.scss';
 </style>

+ 177 - 164
h5_web/pages/policyInfo/policyInfo.vue

@@ -4,178 +4,191 @@
 -->
 
 <template>
-	<view class="policyInfo">
-		<z-paging ref="policyInfoPaging" v-model="policyInfoList" @query="policyInfoQueryList">
-			<u-navbar slot="top" back-text="" title="" back-icon-color="#FFFFFF" :background="{background: '#3D5D4C' }"
-				:border-bottom="false">
-			</u-navbar>
-			<view class="policyInfo-banner" slot="top">
-				<u-swiper :list="bannerList" name="bannerUrl" border-radius="0"
-					:mode="bannerList.length > 1 ? 'round' : 'none'" height="300" img-mode="scaleToFill"
-					@click="swiperClick" @change="swiperChange"></u-swiper>
-			</view>
+  <view class="policyInfo">
+    <z-paging ref="policyInfoPaging" v-model="policyInfoList" @query="policyInfoQueryList">
+      <u-navbar slot="top" back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"> </u-navbar>
+      <view class="policyInfo-banner" slot="top">
+        <u-swiper
+          :list="bannerList"
+          name="bannerUrl"
+          border-radius="0"
+          :mode="bannerList.length > 1 ? 'round' : 'none'"
+          height="300"
+          img-mode="scaleToFill"
+          @click="swiperClick"
+          @change="swiperChange"
+        ></u-swiper>
+      </view>
 
-			<view class="policyInfo-title" slot="top">
-				<view>{{ policyInfoTitle }}</view>
-			</view>
+      <view class="policyInfo-title" slot="top">
+        <view>{{ policyInfoTitle }}</view>
+      </view>
 
-			<!-- u-tabs-swiper -->
-			<view class="policyInfo-tabsswiper" slot="top">
-				<u-tabs bg-color="transparent" :list="tabsList" name="label" :is-scroll="true" :current="tabCurrent"
-					font-size="30" @change="tabsChange" />
-			</view>
+      <!-- u-tabs-swiper -->
+      <view class="policyInfo-tabsswiper" slot="top">
+        <u-tabs bg-color="transparent" :list="tabsList" name="label" :is-scroll="true" :current="tabCurrent" font-size="30" @change="tabsChange" />
+      </view>
 
-			<view class="policyInfo-list">
-				<view class="list-container" v-for="(item, index) in policyInfoList" :key="index + 'policyInfoList'"
-					@click="$u.route('/pages/policyInfo/policyInfoDetails',{artId:item.artId})">
-					<view class="item">
-						<view class="title">{{item.artTitle}}</view>
-						<view class="item-image">
-							<u-image :src="item.artImage" mode="aspectFill" class="image" width="128" height="102"
-								border-radius="10" />
-						</view>
-					</view>
-				</view>
-			</view>
-		</z-paging>
+      <view class="policyInfo-list">
+        <view
+          class="list-container"
+          v-for="(item, index) in policyInfoList"
+          :key="index + 'policyInfoList'"
+          @click="$u.route('/pages/policyInfo/policyInfoDetails', { artId: item.artId })"
+        >
+          <view class="item">
+            <view class="title">{{ item.artTitle }}</view>
+            <view class="item-image">
+              <u-image :src="item.artImage" mode="aspectFill" class="image" width="128" height="102" border-radius="10" />
+            </view>
+          </view>
+        </view>
+      </view>
+    </z-paging>
 
-		<view class="policybtn">
-			<view class="policybtn-container">
-				<view class="policybtn-content">
-					<view>
-						<u-button type="primary" @click="policySubmitBtnClick" class="policysubmitbtn">政策咨询</u-button>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
+    <view class="policybtn">
+      <view class="policybtn-container">
+        <view class="policybtn-content">
+          <view>
+            <u-button type="primary" @click="policySubmitBtnClick" class="policysubmitbtn">政策咨询</u-button>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				bannerList: [],
-				policyInfoTitle: '中华人民共和国英雄烈士保护法',
-				// 政策资讯列表
-				policyInfoList: [],
-				tabsList: [],
-				tabCurrent: 0
-			}
-		},
-		onLoad() {
-			this.getPolicyType();
-		},
-		onShow() {
-			this.getBannerList();
-		},
-		methods: {
-			/**
-			 * 获取政策资讯类别
-			 */
-			getPolicyType() {
-				this.$u.api.getDictdataUrl({
-					key: 'policy_type'
-				}).then(res => {
-					if (res.code == 200) {
-						this.tabsList = res.data;
-						this.getList(1, 10);
-					} else {
-						uni.showToast({
-							icon: 'none',
-							title: res.msg
-						});
-					}
-				});
-			},
-			getBannerList() {
-				this.$u.api.indexApi.indexBannerListApi({
-					type: 2
-				}).then(res => {
-					if (!res) return;
-					this.bannerList = res?.data || [];
-				})
-			},
-			// 轮播图点击
-			swiperClick(index) {
-				if (this.bannerList[index].jumpUrl) {
-					let url = this.bannerList[index].jumpUrl.split('#')[1];
-					this.$u.route({
-						url: url,
-					});
-				} else {
-					this.$u.route({
-						url: 'pages/bannerDetails/bannerDetails',
-						params: {
-							id: this.bannerList[index].id,
-							type: 2
-						}
-					});
-				}
-			},
-			swiperChange(index) {
-				// this.policyInfoTitle = this.bannerList[index]?.name || '';
-			},
-			/**
-			 * 获取列表
-			 * @param { Number } pageNum
-			 * @param { Number } pageSize
-			 * @param { Number } artCategoryId
-			 */
-			getList(pageNum, pageSize) {
-				this.$u.api.policyInfo.getPolicyInfoList({
-					pageNum,
-					pageSize,
-					artCategoryId: this.tabsList[this.tabCurrent].text
-				}).then(res => {
-					if (res.code === 200) {
-						this.$refs.policyInfoPaging.complete(res.rows || []);
-					} else {
-						uni.showToast({
-							icon: 'none',
-							title: res.msg
-						});
-						this.$refs.policyInfoPaging.complete(false);
-					}
-				}).catch(err => {
-					uni.showToast({
-						title: '系统异常!',
-						type: 'error'
-					});
-					this.$refs.policyInfoPaging.complete(false);
-				});
-			},
-			// tab栏切换
-			tabsChange(index) {
-				this.tabCurrent = index;
-				this.$refs.policyInfoPaging.reload(true);
-				// this.getList(1, 10, this.tabsList[index]?.text);
-			},
-			/**
-			 * 列表加载触发
-			 */
-			policyInfoQueryList(pageNo, pageSize) {
-				if (this.tabsList.length > 0) {
-					this.getList(pageNo, pageSize);
-				}
-			},
-			/**
-			 * 政策咨询
-			 */
-			policySubmitBtnClick() {
-				let url =
-					`${this.config.timChatUrl}?userID=${this.vuex_user.userId}&title=政策咨询&permission=1&type=retire`
-				this.$u.route({
-					url: '/pages/webView/webView',
-					params: {
-						url: encodeURIComponent(url)
-					}
-				})
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      bannerList: [],
+      policyInfoTitle: '中华人民共和国英雄烈士保护法',
+      // 政策资讯列表
+      policyInfoList: [],
+      tabsList: [],
+      tabCurrent: 0
+    };
+  },
+  onLoad() {
+    this.getPolicyType();
+  },
+  onShow() {
+    this.getBannerList();
+  },
+  methods: {
+    /**
+     * 获取政策资讯类别
+     */
+    getPolicyType() {
+      this.$u.api
+        .getDictdataUrl({
+          key: 'policy_type'
+        })
+        .then((res) => {
+          if (res.code == 200) {
+            this.tabsList = res.data;
+            this.getList(1, 10);
+          } else {
+            uni.showToast({
+              icon: 'none',
+              title: res.msg
+            });
+          }
+        });
+    },
+    getBannerList() {
+      this.$u.api.indexApi
+        .indexBannerListApi({
+          type: 2
+        })
+        .then((res) => {
+          if (!res) return;
+          this.bannerList = res?.data || [];
+        });
+    },
+    // 轮播图点击
+    swiperClick(index) {
+      if (this.bannerList[index].jumpUrl) {
+        let url = this.bannerList[index].jumpUrl.split('#')[1];
+        this.$u.route({
+          url: url
+        });
+      } else {
+        this.$u.route({
+          url: 'pages/bannerDetails/bannerDetails',
+          params: {
+            id: this.bannerList[index].id,
+            type: 2
+          }
+        });
+      }
+    },
+    swiperChange(index) {
+      // this.policyInfoTitle = this.bannerList[index]?.name || '';
+    },
+    /**
+     * 获取列表
+     * @param { Number } pageNum
+     * @param { Number } pageSize
+     * @param { Number } artCategoryId
+     */
+    getList(pageNum, pageSize) {
+      this.$u.api.policyInfo
+        .getPolicyInfoList({
+          pageNum,
+          pageSize,
+          artCategoryId: this.tabsList[this.tabCurrent].text
+        })
+        .then((res) => {
+          if (res.code === 200) {
+            this.$refs.policyInfoPaging.complete(res.rows || []);
+          } else {
+            uni.showToast({
+              icon: 'none',
+              title: res.msg
+            });
+            this.$refs.policyInfoPaging.complete(false);
+          }
+        })
+        .catch((err) => {
+          uni.showToast({
+            title: '系统异常!',
+            type: 'error'
+          });
+          this.$refs.policyInfoPaging.complete(false);
+        });
+    },
+    // tab栏切换
+    tabsChange(index) {
+      this.tabCurrent = index;
+      this.$refs.policyInfoPaging.reload(true);
+      // this.getList(1, 10, this.tabsList[index]?.text);
+    },
+    /**
+     * 列表加载触发
+     */
+    policyInfoQueryList(pageNo, pageSize) {
+      if (this.tabsList.length > 0) {
+        this.getList(pageNo, pageSize);
+      }
+    },
+    /**
+     * 政策咨询
+     */
+    policySubmitBtnClick() {
+      let url = `${this.config.timChatUrl}?userID=${this.vuex_user.userId || this.vuex_user.id}&title=政策咨询&permission=1&type=retire`;
+      this.$u.route({
+        url: '/pages/webView/webView',
+        params: {
+          url: encodeURIComponent(url)
+        }
+      });
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	@import './scss/policyInfo.scss'
+@import './scss/policyInfo.scss';
 </style>

+ 0 - 115
h5_web/pages/skillsTraining/skillsTraining - 副本.scss

@@ -1,115 +0,0 @@
-.banner{
-	width: 100%;
-	margin-bottom: 24rpx;
-}
-.iconNav{
-	.iconNav-item{
-		width: 25%;
-		margin: 24rpx 0;
-		text-align: center;
-		.iconNav-item-img{width: 98rpx;height: 98rpx;}
-	}
-	&.no-head{
-		.card-head{display: none;}
-		/deep/ .u-card__head{padding: 0!important;}
-		/deep/ .u-card__body{padding-top: 0!important;}
-	}
-}
-.skill-list{
-	.u-body-item{
-		width: 48%;
-		height: 320rpx;
-		border-radius: 8rpx;
-		overflow: hidden;
-		position: relative;
-		margin-bottom: 24rpx;
-		image{width: 100%;height: 100%;}
-		.text{
-			position: absolute;
-			left: 24rpx;
-			right: 24rpx;
-			bottom: 24rpx;
-			z-index: 6;
-			color: #d8d8d8;
-			.name{font-size: 30rpx;}
-		}
-		&::after{
-			content: '';
-			width: 100%;
-			height: 100rpx;
-			position: absolute;
-			left: 0;
-			bottom: 0;
-			background: linear-gradient(0deg,#000,rgba(255,255,255,0));
-			z-index: 5;
-		}
-	}
-}
-.school-list{
-	.school-logo-wrap{
-		margin-bottom: 48rpx;
-		.school-logo{
-			width: 100rpx;
-			height: 100rpx;
-			border-radius: 50%;
-			opacity: 0.5;
-			&.active{
-				opacity: 1;
-			}
-		}
-	}
-	.name{
-		margin-bottom: 24rpx;
-		.text{
-			font-weight: bold;
-		}
-	}
-}
-.support{
-	.big-news{
-		height: 400rpx;
-		position: relative;
-		margin-bottom: 24rpx;
-		image{width: 100%;height: 100%;}
-		.text{
-			position: absolute;
-			left: 0;
-			right: 0;
-			bottom: 0;
-			padding: 24rpx;
-			color: #fff;
-			background: rgba(0,0,0,.5);
-			z-index: 6;
-			.name{font-size: 35rpx;}
-		}
-	}
-	.u-body-item{
-		.u-body-item-title{
-			margin-bottom: 15rpx;
-		}
-		.foot{
-			font-size: 24rpx;
-			color: #ddd;
-			.time{
-				margin-left: 24rpx;
-			}
-		}
-	}
-	.u-card-wrap {
-		background-color: $u-bg-color;
-		padding: 1px;
-	}
-	.u-body-item {
-		// font-size: 32rpx;
-		color: #333;
-		padding: 20rpx 10rpx;
-	}
-		
-	.u-body-item image {
-		width: 120rpx;
-		flex: 0 0 120rpx;
-		height: 120rpx;
-		border-radius: 8rpx;
-		margin-left: 12rpx;
-	}
-}

+ 0 - 283
h5_web/pages/skillsTraining/skillsTraining - 副本.vue

@@ -1,283 +0,0 @@
-<template>
-	<view>
-		<image class="banner" src="../../static/img/banner-skillsTraining.png" mode="scaleToFill"></image>
-		<view class="statistics u-flex u-row-between f-padding f-mb">
-			<view class="statistics-item u-flex">我的学习时长:206小时</view>
-			<view class="statistics-item u-flex">我的考试通过数:32</view>
-		</view>
-		<u-card class="iconNav no-head" :border="false" :head-border-bottom="false" :foot-border-top="false" :full="true" border-radius="0">
-			<view class="card-head" slot="head">
-				<view class="card-head-title">综合服务</view>
-			</view>
-			<view class="iconNav-body u-flex u-flex-wrap u-row-left" slot="body">
-				<view class="iconNav-item" @click="openPage('pages/inbuild/inbuild')">
-					<image class="iconNav-item-img" src="../../static/img/index-service-01.png" mode="aspectFill"></image>
-					<view class="iconNav-item-text">网络课程</view>
-				</view>
-				<view class="iconNav-item" @click="openPage('pages/inbuild/inbuild')" >
-					<image class="iconNav-item-img" src="../../static/img/index-service-02.png" mode="aspectFill"></image>
-					<view class="iconNav-item-text">线下实训</view>
-				</view>
-				<view class="iconNav-item" @click="openPage('pages/inbuild/inbuild')" >
-					<image class="iconNav-item-img" src="../../static/img/index-service-03.png" mode="aspectFill"></image>
-					<view class="iconNav-item-text">参加考试</view>
-				</view>
-				<view class="iconNav-item" @click="openPage('pages/inbuild/inbuild')" >
-					<image class="iconNav-item-img" src="../../static/img/index-service-04.png" mode="aspectFill"></image>
-					<view class="iconNav-item-text">我的班级</view>
-				</view>
-			</view>
-		</u-card>
-		<u-search class="search f-padding" placeholder="搜索课程" v-model="keyword" @focus="selectShow = true" @search="search" @custom="search" ></u-search>
-		<u-select v-model="selectShow"  mode="mutil-column-auto" :list="selectList" @confirm="selectConfirm"></u-select>
-		
-		<u-card class="skill-list"
-		:body-style="{'padding-bottom':'0'}"
-		:border="false" 
-		:foot-border-top="false" 
-		:full="true" border-radius="0">
-			<view class="card-head" slot="head">
-				<view class="card-head-title">技能包</view>
-			</view>
-			<view class="news-list-body u-flex u-row-between u-flex-wrap" slot="body">
-				<u-nodata notice="暂无新闻" v-if="skillList.length==0"></u-nodata>
-				<view v-for="(item,index) in skillList" 
-				@click="skillClick(item)"
-				:key="item.artId" 
-				class="u-body-item">
-					<image :src="item.img" mode="scaleToFill"></image>
-					<view class="text">
-						<view class="name">{{item.name}}</view>
-						<view class="school">{{item.school}}</view>
-					</view>
-				</view>
-			</view>
-		</u-card>
-		
-		<u-card class="school-list"
-		:body-style="{'margin-bottom':'0','padding-bottom':'0'}"
-		:border="false" 
-		:foot-border-top="false" 
-		:full="true" border-radius="0">
-			<view class="card-head u-flex u-row-between" slot="head">
-				<view class="card-head-title">合作院校</view>
-				<view class="right" @click="openPage('pages/schools/schools')">
-					查看更多
-					<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
-				</view>
-			</view>
-			<view class="school-list-body" slot="body">
-				<u-nodata notice="暂无合作院校" v-if="schoolList.length==0"></u-nodata>
-				<view class="school-logo-wrap u-flex u-row-between">
-					<image 
-					@click="schoolToggle(index)"
-					:class="{active:schoolActive==index}"
-					class="school-logo" 
-					v-for="(item,index) in schoolList" :key="item.id" 
-					:src="item.schoolLogoUrl" 
-					mode="aspectFit"></image>
-				</view>
-				<view class="name u-flex u-row-between" @click="schoolClick(schoolList[schoolActive])">
-					<view class="text">{{schoolList[schoolActive].schoolName}}</view>
-					<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
-				</view>
-				<view class="content">
-					{{schoolList[schoolActive].detatil}}
-				</view>
-			</view>
-		</u-card>
-		<u-card class="support"
-		:body-style="{'margin-bottom':'24rpx'}"
-		:border="false" 
-		:foot-border-top="false" 
-		:full="true" border-radius="0">
-			<view class="card-head u-flex u-row-between" slot="head">
-				<view class="card-head-title">政策支持</view>
-			</view>
-			<view class="support-body" slot="body">
-				<u-nodata notice="暂无新闻" v-if="schoolList.length==0"></u-nodata>
-				<view class="big-news" @click="$u.route('/pages/newsDetails/newsDetails',{artId:bigNews.artId})">
-					<image :src="bigNews.artImage" mode="aspectFill"></image>
-					<view class="text">{{bigNews.artTitle}}</view>
-				</view>
-				<view v-for="(item,index) in newsList"
-				@click="$u.route('/pages/newsDetails/newsDetails',{artId:item.artId})"
-				:key="item.artId" 
-				class="u-body-item u-flex u-border-bottom u-col-between u-row-between">
-					<view class="news-text">
-						<view class="u-body-item-title u-line-2">{{item.artTitle}}</view>
-						<view class="foot u-flex">
-							<view class="">{{item.artCategoryName}}</view>
-							<view class="time">{{$u.timeFormat(item.createTime.replace(/-/g, '/'), 'mm月dd日 hh时MM分')}}</view>
-						</view>
-					</view>
-					<image :src="item.artImage" mode="aspectFill"></image>
-				</view>
-			</view>
-		</u-card>
-	</view>
-</template>
-<script>
-	import mock from "../../static/js/mock.js";
-	export default{
-		data(){
-			return{
-				schoolActive:0,
-				keyword:'',
-				selectShow:false,
-				newsList:[],
-				bigNews:[],
-				skillList:mock.skillList,
-				schoolList:[],
-				selectList:[
-					{
-						value: 1,
-						label: '贵州交通职业技术学院',
-						children: [
-							{
-								value: 2,
-								label: '技术1'
-							},
-							{
-								value: 5,
-								label: '技术2'
-							}
-						]
-					},
-					{
-						value: 8,
-						label: '贵州医学院',
-						children: [
-							{
-								value: 9,
-								label: '技术3'
-							}
-						]
-					}
-				],
-			}
-		},
-		onLoad(){
-			this.getNewsList();
-			this.getSchoolList();
-		},
-		onShow(){
-			
-		},
-		methods:{
-			getSchoolList(){
-				this.$u.api.getSchoolList({pageNum:1,pageSize:5}).then(res=>{
-					if(res.code ==200){
-						this.schoolList = res.rows
-					}else{
-						uni.showToast({
-							icon:'none',
-							title:res.msg
-						})
-					}
-				})
-			},
-			openPage(path,msg) {
-			  this.$u.route({
-			    url: path,
-				params:{
-					msg:msg
-				}
-			  })
-			},
-			getNewsList(){
-				let params ={
-					artCategoryId:2,
-					pageNum:1,
-					pageSize:10
-				}
-				this.$u.api.indexApi.getIndexNewsListApi(params)
-				.then(res=>{
-					this.newsList = res.rows;
-					this.bigNews = this.newsList[0];
-					this.newsList.shift();
-					console.log('this.newsList', this.newsList)
-					// console.log('newsList',JSON.parse(JSON.stringify(res.rows)));
-				})
-			},
-			selectConfirm(e){
-				console.log('selectConfirm',e);
-				this.keyword = e[0].label +' ' + e[1].label
-			},
-			search(e){
-				this.$u.route({
-					url: 'pages/index/index',
-					type:'switchTab'
-				});
-				console.log('selectConfirm',e)
-			},
-			schoolToggle(index){
-				this.schoolActive = index;
-				console.log('schoolToggle index',index)
-			},
-			skillClick(item){
-				console.log('item',item);
-				let analysisParams ={
-					platform:'1',//平台:1-H5 2-APP 3-小程序 4-PC端
-					pages:location.href,//页面路径
-					btnName:'',//按钮名称
-					btnEvent:'1',//按钮事件: 1-点击 2-长按 3-滑动
-					ipAddress:'',//IP地址
-					typeName:'技能培训关注度',//类型名称 例:学校关注度 、适应性考试等
-					typeCode:'',//类型编码 例:类型名称首字母缩写(XXGZD)
-					categoryName:item.name,//类别名称 例:XX学校,SS考试
-				};
-				// uni.request({
-				//     url:'/apis/cityjson?ie=utf-8',
-				// 	method:'GET',
-				// 	success: (res) => {
-				// 		// console.log('this',this);
-				//         const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
-				// 		let ip = reg.exec(res.data);
-				// 		analysisParams.ipAddress = ip[0];
-				// 		console.log('analysisParams',analysisParams);
-				// 	}
-				// });
-				this.$u.api.postAnalysis(analysisParams).then(res=>{
-					console.log('res',res);
-				});
-				this.$u.route({
-					url: '/pages/inbuild/inbuild',
-					params: {
-						msg: '',
-						artId:item.artId
-					}
-				});
-			},
-			schoolClick(item){
-				console.log('schoolClick item',item);
-				let analysisParams ={
-					platform:'1',//平台:1-H5 2-APP 3-小程序 4-PC端
-					pages:location.href,//页面路径
-					btnName:'',//按钮名称
-					btnEvent:'1',//按钮事件: 1-点击 2-长按 3-滑动
-					ipAddress:'',//IP地址
-					typeName:'学校关注度',//类型名称 例:学校关注度 、适应性考试等
-					typeCode:'',//类型编码 例:类型名称首字母缩写(XXGZD)
-					categoryName:item.schoolName,//类别名称 例:XX学校,SS考试
-				};
-				this.$u.api.postAnalysis(analysisParams).then(res=>{
-					console.log('res',res);
-					if(res.code == 200){
-						location.href = item.schoolUrl
-					}else{
-						uni.showToast({
-							icon:'none',
-							title:res.msg
-						})
-					}
-				});
-			}
-			
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import  './skillsTraining.scss'
-</style>

+ 244 - 229
h5_web/pages/skillsTraining/skillsTraining.vue

@@ -1,247 +1,262 @@
 <!-- 技能培训 -->
 <template>
-	<view class="training">
-		<u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }"
-			:border-bottom="false"></u-navbar>
-		<!-- banner -->
-		<view class="training-banner">
-			<u-swiper v-if="bannerList.length" :list="bannerList" name="bannerUrl" border-radius="0" mode="round"
-				height="380" img-mode="scaleToFill" :mode="bannerList.length > 1 ? 'round' : 'none'"></u-swiper>
-			<image v-else src="../../static/img/banner-skillsTraining.png" mode="aspectFill"></image>
-		</view>
+  <view class="training">
+    <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
+    <!-- banner -->
+    <view class="training-banner">
+      <u-swiper
+        v-if="bannerList.length"
+        :list="bannerList"
+        name="bannerUrl"
+        border-radius="0"
+        mode="round"
+        height="380"
+        img-mode="scaleToFill"
+        :mode="bannerList.length > 1 ? 'round' : 'none'"
+      ></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')" v-if="isAddClass">
-			<view class="training-total-left">
-				<view>我的技能培训</view>
-				<view>学习时长:{{ skillTotal.learnTime ? (Number(skillTotal.learnTime) / 3600).toFixed(2) : 0 }}小时</view>
-			</view>
-			<view class="training-total-right">
-				<u-icon name="arrow-right" size="44" color="#666"></u-icon>
-			</view>
-		</view>
-		<view class="training-total" v-else>
-			<view class="training-total-left">
-				<view>您还未报班</view>
-			</view>
-		</view>
+    <view class="training-total" @click="jumpPage('/pages/mine/skillsTraining/skillsTraining')" v-if="isAddClass">
+      <view class="training-total-left">
+        <view>我的技能培训</view>
+        <view>学习时长:{{ skillTotal.learnTime ? (Number(skillTotal.learnTime) / 3600).toFixed(2) : 0 }}小时</view>
+      </view>
+      <view class="training-total-right">
+        <u-icon name="arrow-right" size="44" color="#666"></u-icon>
+      </view>
+    </view>
+    <view class="training-total" v-else>
+      <view class="training-total-left">
+        <view>您还未报班</view>
+      </view>
+    </view>
 
-		<!-- 报班通知 -->
-		<view class="training-notice">
-			<template v-if="enrollList.length">
-				<view class="training-notice-title">
-					<view>报班通知</view>
-					<view @click="jumpPage('pages/skillsTraining/registrationNotice/registrationNotice')">
-						<text>更多</text>
-						<u-icon name="arrow-right"></u-icon>
-					</view>
-				</view>
-				<view class="training-notice-content">
-					<swiper class="swiper" :indicator-dots="true" :autoplay="false" :interval="1000" :duration="500"
-						indicator-color="#D8D8D8" indicator-active-color="#D8D8D8">
-						<swiper-item v-for="(item, index) in enrollList" :key="index">
-							<view class="swiper-item">
-								<view class="left">
-									<u-image :src="item.img" mode="aspectFill" border-radius="10" height="220"
-										width="204">
-										<view slot="error">
-											<u-image src="../../static/img/no-image.png" width="204" height="220"
-												border-radius="10" mode="aspectFill" />
-										</view>
-									</u-image>
-								</view>
-								<view class="right">
-									<view class="item">{{ item.name }}</view>
-									<view class="item">{{ item.schoolName }}</view>
-									<!-- <view class="item">
+    <!-- 报班通知 -->
+    <view class="training-notice">
+      <template v-if="enrollList.length">
+        <view class="training-notice-title">
+          <view>报班通知</view>
+          <view @click="jumpPage('pages/skillsTraining/registrationNotice/registrationNotice')">
+            <text>更多</text>
+            <u-icon name="arrow-right"></u-icon>
+          </view>
+        </view>
+        <view class="training-notice-content">
+          <swiper
+            class="swiper"
+            :indicator-dots="true"
+            :autoplay="false"
+            :interval="1000"
+            :duration="500"
+            indicator-color="#D8D8D8"
+            indicator-active-color="#D8D8D8"
+          >
+            <swiper-item v-for="(item, index) in enrollList" :key="index">
+              <view class="swiper-item">
+                <view class="left">
+                  <u-image :src="item.img" mode="aspectFill" border-radius="10" height="220" width="204">
+                    <view slot="error">
+                      <u-image src="../../static/img/no-image.png" width="204" height="220" border-radius="10" mode="aspectFill" />
+                    </view>
+                  </u-image>
+                </view>
+                <view class="right">
+                  <view class="item">{{ item.name }}</view>
+                  <view class="item">{{ item.schoolName }}</view>
+                  <!-- <view class="item">
 										<u-parse :html="item.description"></u-parse>
 									</view> -->
-									<view class="btn" @click="signUp(item)">报名</view>
-								</view>
-							</view>
-						</swiper-item>
-					</swiper>
-				</view>
-			</template>
-		</view>
+                  <view class="btn" @click="signUp(item)">报名</view>
+                </view>
+              </view>
+            </swiper-item>
+          </swiper>
+        </view>
+      </template>
+    </view>
 
-		<!-- 技能包 -->
-		<view class="training-package">
-			<view class="training-package-title">
-				<view>技能包</view>
-				<!-- <view>
+    <!-- 技能包 -->
+    <view class="training-package">
+      <view class="training-package-title">
+        <view>技能包</view>
+        <!-- <view>
 					<text>更多</text>
 					<u-icon name="arrow-right"></u-icon>
 				</view> -->
-			</view>
-			<view class="training-package-list">
-				<view class="training-package-list-item" v-for="(item, index) in packageList" :key="index"
-					@click="recordBrowseTotal(item)">
-					<view class="border-1">
-						<u-image :src="item.img" mode="aspectFill" border-radius="10" height="180" width="294">
-							<view slot="error">
-								<u-image src="../../static/img/no-image.png" height="190" width="300" border-radius="10"
-									mode="aspectFill" />
-							</view>
-						</u-image>
-					</view>
-					<view>{{ item.name }}</view>
-					<view>{{ item.schoolName }}</view>
-				</view>
-			</view>
-		</view>
+      </view>
+      <view class="training-package-list">
+        <view class="training-package-list-item" v-for="(item, index) in packageList" :key="index" @click="recordBrowseTotal(item)">
+          <view class="border-1">
+            <u-image :src="item.img" mode="aspectFill" border-radius="10" height="180" width="294">
+              <view slot="error">
+                <u-image src="../../static/img/no-image.png" height="190" width="300" border-radius="10" mode="aspectFill" />
+              </view>
+            </u-image>
+          </view>
+          <view>{{ item.name }}</view>
+          <view>{{ item.schoolName }}</view>
+        </view>
+      </view>
+    </view>
 
-		<!-- 问题咨询 -->
-		<view class="training-bottom" @click="questionAsk">问题咨询</view>
-		<u-toast ref="uToast" />
-		<judge-auth ref="judgeAuth" @adoptAuth="adoptAuth" />
-	</view>
+    <!-- 问题咨询 -->
+    <view class="training-bottom" @click="questionAsk">问题咨询</view>
+    <u-toast ref="uToast" />
+    <judge-auth ref="judgeAuth" @adoptAuth="adoptAuth" />
+  </view>
 </template>
 
 <script>
-	export default {
-		data() {
-			return {
-				enrollList: [],
-				packageList: [],
-				skillTotal: {},
-				isAddClass: false,
-				bannerList: []
-			}
-		},
-		onShow() {
-			this.getPackageList();
-			this.getClassNoticeList();
-			this.getTrainingTotal();
-			this.queryIsAttendedClass();
-			this.getBannerList();
-		},
-		methods: {
-			getBannerList() {
-				this.$u.api.indexApi.indexBannerListApi({
-					type: 3
-				}).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
-						}
-					}
-				})
-			},
-			/**
-			 * 获取技能包列表
-			 */
-			getPackageList() {
-				this.$u.api.skillTraining.getSkillPackageListApi().then(res => {
-					if (res.code === 200) {
-						this.packageList = res.rows
-					}
-				})
-			},
-			/**
-			 * 获取报班通知列表
-			 */
-			getClassNoticeList() {
-				this.$u.api.skillTraining.getClassNoticeApi({
-					pageNum: 1,
-					pageSize: 5
-				}).then(res => {
-					if (res.code === 200) {
-						this.enrollList = res.rows;
-					}
-				})
-			},
-			/**
-			 * 获取个人技能培训统计
-			 */
-			getTrainingTotal() {
-				this.$u.api.skillTraining.getTrainingTotalApi().then(res => {
-					if (res.code === 200) {
-						this.skillTotal = res.data
-					}
-				})
-			},
-			/**
-			 * 适应性培训关注度统计
-			 * @param {Object} item
-			 */
-			recordBrowseTotal(item) {
-				const query = {
-					platform: '1', // 平台:1-H5 2-APP 3-小程序 4-PC端
-					pages: location.href, // 页面路径
-					btnName: '查看技能包详情', // 按钮名称
-					btnEvent: '1', //按钮事件: 1-点击 2-长按 3-滑动
-					ipAddress: '', //IP地址
-					typeName: '技能培训关注度', //类型名称 例:学校关注度 、适应性考试等
-					typeCode: 'JNPXGZD', // 类型编码 例:类型名称首字母缩写(XXGZD)
-					categoryName: item.name, //类别名称 例:XX学校,SS考试
-				}
-				this.$u.api.postAnalysis(query).then(res => {
-					this.jumpPage('/pages/skillsTraining/skillsPackage/skillsPackage', {
-						id: item.id,
-						schoolName: item.schoolName
-					})
-				})
-			},
-			/**
-			 * 跳转到指定页面
-			 * @param { String } url
-			 * @param {Object} parmas
-			 */
-			jumpPage(url, params) {
-				this.$u.route({
-					url,
-					params
-				})
-			},
-			/**
-			 * 报名
-			 * @param {Object} item
-			 */
-			signUp(item) {
-				this.$refs['judgeAuth'].modalShow(item)
-			},
-			adoptAuth(item) {
-				this.$u.api.skillTraining.signUpClassApi({
-					packageId: item.id
-				}).then(res => {
-					if (res.code === 200) {
-						this.jumpPage('/pages/skillsTraining/submitSuccess/submitSuccess');
-					} else {
-						this.$refs.uToast.show({
-							title: res.msg,
-							type: 'error'
-						})
-					}
-				})
-			},
-			/**
-			 * 问题咨询
-			 */
-			questionAsk() {
-				let url =
-					`${this.config.timChatUrl}?userID=${this.vuex_user.userId}&title=问题咨询&permission=2&type=retire`
-				this.$u.route({
-					url: '/pages/webView/webView',
-					params: {
-						url: encodeURIComponent(url)
-					}
-				})
-			}
-		}
-	}
+export default {
+  data() {
+    return {
+      enrollList: [],
+      packageList: [],
+      skillTotal: {},
+      isAddClass: false,
+      bannerList: []
+    };
+  },
+  onShow() {
+    this.getPackageList();
+    this.getClassNoticeList();
+    this.getTrainingTotal();
+    this.queryIsAttendedClass();
+    this.getBannerList();
+  },
+  methods: {
+    getBannerList() {
+      this.$u.api.indexApi
+        .indexBannerListApi({
+          type: 3
+        })
+        .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;
+          }
+        }
+      });
+    },
+    /**
+     * 获取技能包列表
+     */
+    getPackageList() {
+      this.$u.api.skillTraining.getSkillPackageListApi().then((res) => {
+        if (res.code === 200) {
+          this.packageList = res.rows;
+        }
+      });
+    },
+    /**
+     * 获取报班通知列表
+     */
+    getClassNoticeList() {
+      this.$u.api.skillTraining
+        .getClassNoticeApi({
+          pageNum: 1,
+          pageSize: 5
+        })
+        .then((res) => {
+          if (res.code === 200) {
+            this.enrollList = res.rows;
+          }
+        });
+    },
+    /**
+     * 获取个人技能培训统计
+     */
+    getTrainingTotal() {
+      this.$u.api.skillTraining.getTrainingTotalApi().then((res) => {
+        if (res.code === 200) {
+          this.skillTotal = res.data;
+        }
+      });
+    },
+    /**
+     * 适应性培训关注度统计
+     * @param {Object} item
+     */
+    recordBrowseTotal(item) {
+      const query = {
+        platform: '1', // 平台:1-H5 2-APP 3-小程序 4-PC端
+        pages: location.href, // 页面路径
+        btnName: '查看技能包详情', // 按钮名称
+        btnEvent: '1', //按钮事件: 1-点击 2-长按 3-滑动
+        ipAddress: '', //IP地址
+        typeName: '技能培训关注度', //类型名称 例:学校关注度 、适应性考试等
+        typeCode: 'JNPXGZD', // 类型编码 例:类型名称首字母缩写(XXGZD)
+        categoryName: item.name //类别名称 例:XX学校,SS考试
+      };
+      this.$u.api.postAnalysis(query).then((res) => {
+        this.jumpPage('/pages/skillsTraining/skillsPackage/skillsPackage', {
+          id: item.id,
+          schoolName: item.schoolName
+        });
+      });
+    },
+    /**
+     * 跳转到指定页面
+     * @param { String } url
+     * @param {Object} parmas
+     */
+    jumpPage(url, params) {
+      this.$u.route({
+        url,
+        params
+      });
+    },
+    /**
+     * 报名
+     * @param {Object} item
+     */
+    signUp(item) {
+      this.$refs['judgeAuth'].modalShow(item);
+    },
+    adoptAuth(item) {
+      this.$u.api.skillTraining
+        .signUpClassApi({
+          packageId: item.id
+        })
+        .then((res) => {
+          if (res.code === 200) {
+            this.jumpPage('/pages/skillsTraining/submitSuccess/submitSuccess');
+          } else {
+            this.$refs.uToast.show({
+              title: res.msg,
+              type: 'error'
+            });
+          }
+        });
+    },
+    /**
+     * 问题咨询
+     */
+    questionAsk() {
+      let url = `${this.config.timChatUrl}?userID=${this.vuex_user.userId}&title=问题咨询&permission=2&type=retire`;
+      this.$u.route({
+        url: '/pages/webView/webView',
+        params: {
+          url: encodeURIComponent(url)
+        }
+      });
+    }
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-	@import './skillsTraining.scss';
+@import './skillsTraining.scss';
 </style>

+ 0 - 116
h5_web/pages/upgrade1/upgrade.scss

@@ -1,116 +0,0 @@
-.banner{
-	width: 100%;
-	height: 600rpx;
-	margin-bottom: 24rpx;
-}
-.iconNav{
-	.iconNav-item{
-		width: 25%;
-		margin: 24rpx 0 0;
-		text-align: center;
-		.iconNav-item-img{width: 98rpx;height: 98rpx;}
-	}
-	&.no-head{
-		.card-head{display: none;}
-		/deep/ .u-card__head{padding: 0!important;}
-		/deep/ .u-card__body{padding-top: 0!important;}
-	}
-}
-.skill-list{
-	.u-body-item{
-		width: 48%;
-		height: 320rpx;
-		border-radius: 8rpx;
-		overflow: hidden;
-		position: relative;
-		margin-bottom: 24rpx;
-		image{width: 100%;height: 100%;}
-		.text{
-			position: absolute;
-			left: 24rpx;
-			right: 24rpx;
-			bottom: 24rpx;
-			z-index: 6;
-			color: #d8d8d8;
-			.name{font-size: 30rpx;}
-		}
-		&::after{
-			content: '';
-			width: 100%;
-			height: 100rpx;
-			position: absolute;
-			left: 0;
-			bottom: 0;
-			background: linear-gradient(0deg,#000,rgba(255,255,255,0));
-			z-index: 5;
-		}
-	}
-}
-.school-list{
-	.school-logo-wrap{
-		margin-bottom: 48rpx;
-		.school-logo{
-			width: 100rpx;
-			height: 100rpx;
-			border-radius: 50%;
-			opacity: 0.5;
-			&.active{
-				opacity: 1;
-			}
-		}
-	}
-	.name{
-		margin-bottom: 24rpx;
-		.text{
-			font-weight: bold;
-		}
-	}
-}
-.support{
-	.big-news{
-		height: 400rpx;
-		position: relative;
-		margin-bottom: 24rpx;
-		image{width: 100%;height: 100%;}
-		.text{
-			position: absolute;
-			left: 0;
-			right: 0;
-			bottom: 0;
-			padding: 24rpx;
-			color: #fff;
-			background: rgba(0,0,0,.5);
-			z-index: 6;
-			.name{font-size: 35rpx;}
-		}
-	}
-	.u-body-item{
-		.u-body-item-title{
-			margin-bottom: 15rpx;
-		}
-		.foot{
-			font-size: 24rpx;
-			color: #ddd;
-			.time{
-				margin-left: 24rpx;
-			}
-		}
-	}
-	.u-card-wrap {
-		background-color: $u-bg-color;
-		padding: 1px;
-	}
-	.u-body-item {
-		// font-size: 32rpx;
-		color: #333;
-		padding: 20rpx 10rpx;
-	}
-		
-	.u-body-item image {
-		width: 120rpx;
-		flex: 0 0 120rpx;
-		height: 120rpx;
-		border-radius: 8rpx;
-		margin-left: 12rpx;
-	}
-}

+ 0 - 233
h5_web/pages/upgrade1/upgrade.vue

@@ -1,233 +0,0 @@
-<template>
-	<view>
-		<image class="banner" src="../../static/img/banner-upgrade.png" mode="scaleToFill"></image>
-		<u-card class="skill-list" margin="0 30rpx" :body-style="{'padding-bottom':'0'}" :border="false"
-			:foot-border-top="false" :full="true" border-radius="0">
-			<view class="card-head" slot="head">
-				<view class="card-head-title">热门专业</view>
-			</view>
-			<view class="news-list-body u-flex u-row-between u-flex-wrap" slot="body">
-				<u-nodata notice="暂无热门专业" v-if="majorList.length==0"></u-nodata>
-				<view v-for="(item,index) in majorList" @click="skillClick(item)" :key="item.artId" class="u-body-item">
-					<image :src="item.img" mode="scaleToFill"></image>
-					<view class="text">
-						<view class="name">{{item.name}}</view>
-						<view class="school">{{item.school}}</view>
-					</view>
-				</view>
-			</view>
-		</u-card>
-
-		<u-card class="school-list" :body-style="{'margin-bottom':'0','padding-bottom':'0'}" :border="false"
-			:foot-border-top="false" :full="true" border-radius="0">
-			<view class="card-head u-flex u-row-between" slot="head">
-				<view class="card-head-title">合作院校</view>
-				<view class="right" @click="openPage('pages/schools/schools')">
-					查看更多
-					<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
-				</view>
-			</view>
-			<view class="school-list-body" slot="body">
-				<u-nodata notice="暂无合作院校" v-if="schoolList.length==0"></u-nodata>
-				<view class="school-logo-wrap u-flex u-row-between">
-					<image @click="schoolToggle(index)" :class="{active:schoolActive==index}" class="school-logo"
-						v-for="(item,index) in schoolList" :key="item.id" :src="item.schoolLogoUrl" mode="aspectFit">
-					</image>
-				</view>
-				<view class="name u-flex u-row-between" @click="schoolClick(schoolList[schoolActive])">
-					<!-- <view class="text">{{schoolList[schoolActive].schoolName}}</view> -->
-					<u-icon name="arrow-right" color="#969799" size="28"></u-icon>
-				</view>
-				<view class="content">
-					<!-- {{schoolList[schoolActive].detatil}} -->
-				</view>
-			</view>
-		</u-card>
-		<u-card class="support" :body-style="{'margin-bottom':'24rpx'}" :border="false" :foot-border-top="false"
-			:full="true" border-radius="0">
-			<view class="card-head u-flex u-row-between" slot="head">
-				<view class="card-head-title">政策支持</view>
-			</view>
-			<view class="support-body" slot="body">
-				<u-nodata notice="暂无新闻" v-if="schoolList.length==0"></u-nodata>
-				<view class="big-news" @click="$u.route('/pages/newsDetails/newsDetails',{artId:bigNews.artId})">
-					<image :src="bigNews.artImage" mode="aspectFill"></image>
-					<view class="text">{{bigNews.artTitle}}</view>
-				</view>
-				<view v-for="(item,index) in newsList"
-					@click="$u.route('/pages/newsDetails/newsDetails',{artId:item.artId})" :key="item.artId"
-					class="u-body-item u-flex u-border-bottom u-col-between u-row-between">
-					<view class="news-text">
-						<view class="u-body-item-title u-line-2">{{item.artTitle}}</view>
-						<view class="foot u-flex">
-							<view class="">{{item.artCategoryName}}</view>
-							<view class="time">{{$u.timeFormat(item.createTime.replace(/-/g, '/'), 'mm月dd日 hh时MM分')}}
-							</view>
-						</view>
-					</view>
-					<image :src="item.artImage" mode="aspectFill"></image>
-				</view>
-			</view>
-		</u-card>
-	</view>
-</template>
-
-<script>
-	import mock from "../../static/js/mock.js";
-	export default {
-		data() {
-			return {
-				schoolActive: 0,
-				keyword: '',
-				selectShow: false,
-				newsList: [],
-				bigNews: [],
-				majorList: mock.majorList,
-				schoolList: [],
-				selectList: [{
-						value: 1,
-						label: '贵州交通职业技术学院',
-						children: [{
-								value: 2,
-								label: '技术1'
-							},
-							{
-								value: 5,
-								label: '技术2'
-							}
-						]
-					},
-					{
-						value: 8,
-						label: '贵州医学院',
-						children: [{
-							value: 9,
-							label: '技术3'
-						}]
-					}
-				],
-			}
-		},
-		// onLoad() {
-		// 	this.getNewsList();
-		// 	this.getSchoolList();
-		// },
-		onShow() {
-
-		},
-		methods: {
-			getSchoolList() {
-				this.$u.api.getSchoolList({
-					pageNum: 1,
-					pageSize: 5
-				}).then(res => {
-					if (res.code == 200) {
-						this.schoolList = res.rows
-					} else {
-						uni.showToast({
-							icon: 'none',
-							title: res.msg
-						})
-					}
-				})
-			},
-			openPage(path, msg) {
-				this.$u.route({
-					url: path,
-					params: {
-						msg: msg
-					}
-				})
-			},
-			getNewsList() {
-				let params = {
-					artCategoryId: 2,
-					pageNum: 1,
-					pageSize: 10
-				}
-				this.$u.api.indexApi.getIndexNewsListApi(params)
-					.then(res => {
-						this.newsList = res.rows;
-						this.bigNews = this.newsList[0];
-						this.newsList.shift();
-						console.log('this.newsList', this.newsList)
-						// console.log('newsList',JSON.parse(JSON.stringify(res.rows)));
-					})
-			},
-			selectConfirm(e) {
-				console.log('selectConfirm', e);
-				this.keyword = e[0].label + ' ' + e[1].label
-			},
-			search(e) {
-				console.log('selectConfirm', e)
-			},
-			schoolToggle(index) {
-				this.schoolActive = index;
-				console.log('schoolToggle index', index);
-			},
-			skillClick(item) {
-				console.log('item', item);
-				let analysisParams = {
-					platform: '1', //平台:1-H5 2-APP 3-小程序 4-PC端
-					pages: location.href, //页面路径
-					btnName: '', //按钮名称
-					btnEvent: '1', //按钮事件: 1-点击 2-长按 3-滑动
-					ipAddress: '', //IP地址
-					typeName: '学历提升关注度', //类型名称 例:学校关注度 、适应性考试等
-					typeCode: '', //类型编码 例:类型名称首字母缩写(XXGZD)
-					categoryName: item.name, //类别名称 例:XX学校,SS考试
-				};
-				uni.request({
-					url: '/apis/cityjson?ie=utf-8',
-					method: 'GET',
-					success: (res) => {
-						// console.log('this',this);
-						const reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
-						let ip = reg.exec(res.data);
-						analysisParams.ipAddress = ip[0];
-						console.log('analysisParams', analysisParams);
-					}
-				});
-				this.$u.api.postAnalysis(analysisParams).then(res => {
-					console.log('res', res);
-				});
-				this.$u.route({
-					url: '/pages/inbuild/inbuild',
-					params: {
-						msg: '热门专业',
-						artId: item.artId
-					}
-				});
-			},
-			schoolClick(item) {
-				console.log('schoolClick item', item);
-				let analysisParams = {
-					platform: '1', //平台:1-H5 2-APP 3-小程序 4-PC端
-					pages: location.href, //页面路径
-					btnName: '', //按钮名称
-					btnEvent: '1', //按钮事件: 1-点击 2-长按 3-滑动
-					ipAddress: '', //IP地址
-					typeName: '学校关注度', //类型名称 例:学校关注度 、适应性考试等
-					typeCode: '', //类型编码 例:类型名称首字母缩写(XXGZD)
-					categoryName: item.schoolName, //类别名称 例:XX学校,SS考试
-				};
-				this.$u.api.postAnalysis(analysisParams).then(res => {
-					console.log('res', res);
-					if (res.code == 200) {
-						location.href = item.schoolUrl
-					} else {
-						uni.showToast({
-							icon: 'none',
-							title: res.msg
-						})
-					}
-				});
-			}
-
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	@import './upgrade.scss'
-</style>

BIN
h5_web/static/favicon.ico


+ 21 - 22
h5_web/store/$u.mixin.js

@@ -1,27 +1,26 @@
-import { mapState } from 'vuex'
-import store from "@/store"
+import { mapState } from 'vuex';
+import store from '@/store';
 
 // 尝试将用户在根目录中的store/index.js的vuex的state变量,全部加载到全局变量中
 let $uStoreKey = [];
-try{
-	$uStoreKey = store.state ? Object.keys(store.state) : [];
-}catch(e){
-	
-}
+try {
+  $uStoreKey = store.state ? Object.keys(store.state) : [];
+} catch (e) {}
 
 module.exports = {
-	beforeCreate() {
-		// 将vuex方法挂在到$u中
-		// 使用方法为:如果要修改vuex的state中的user.name变量为"史诗" => this.$u.vuex('user.name', '史诗')
-		// 如果要修改vuex的state的version变量为1.0.1 => this.$u.vuex('version', '1.0.1')
-		this.$u.vuex = (name, value) => {
-			this.$store.commit('$uStore', {
-				name,value
-			})
-		}
-	},
-	computed: {
-		// 将vuex的state中的所有变量,解构到全局混入的mixin中
-		...mapState($uStoreKey)
-	}
-}
+  beforeCreate() {
+    // 将vuex方法挂在到$u中
+    // 使用方法为:如果要修改vuex的state中的user.name变量为"史诗" => this.$u.vuex('user.name', '史诗')
+    // 如果要修改vuex的state的version变量为1.0.1 => this.$u.vuex('version', '1.0.1')
+    this.$u.vuex = (name, value) => {
+      this.$store.commit('$uStore', {
+        name,
+        value
+      });
+    };
+  },
+  computed: {
+    // 将vuex的state中的所有变量,解构到全局混入的mixin中
+    ...mapState($uStoreKey)
+  }
+};

+ 52 - 54
h5_web/store/index.js

@@ -1,64 +1,62 @@
-import Vue from 'vue'
-import Vuex from 'vuex'
-Vue.use(Vuex)
+import Vue from 'vue';
+import Vuex from 'vuex';
+Vue.use(Vuex);
 
 let lifeData = {};
 
-try{
-	// 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
-	lifeData = uni.getStorageSync('lifeData');
-}catch(e){
-	
-}
+try {
+  // 尝试获取本地是否存在lifeData变量,第一次启动APP时是不存在的
+  lifeData = uni.getStorageSync('lifeData');
+} catch (e) {}
 
 // 需要永久存储,且下次APP启动需要取出的,在state中的变量名
 
-let saveStateKeys = ['vuex_user', 'vuex_token','vuex_hasLogin', 'vuex_memberInfo'];
+let saveStateKeys = ['vuex_user', 'vuex_token', 'vuex_hasLogin', 'vuex_memberInfo'];
 
 // 保存变量到本地存储中
-const saveLifeData = function(key, value){
-	// 判断变量名是否在需要存储的数组中
-	if(saveStateKeys.indexOf(key) != -1) {
-		// 获取本地存储的lifeData对象,将变量添加到对象中
-		let tmp = uni.getStorageSync('lifeData');
-		// 第一次打开APP,不存在lifeData变量,故放一个{}空对象
-		tmp = tmp ? tmp : {};
-		tmp[key] = value;
-		// 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
-		uni.setStorageSync('lifeData', tmp);
-	}
-}
+const saveLifeData = function (key, value) {
+  // 判断变量名是否在需要存储的数组中
+  if (saveStateKeys.indexOf(key) != -1) {
+    // 获取本地存储的lifeData对象,将变量添加到对象中
+    let tmp = uni.getStorageSync('lifeData');
+    // 第一次打开APP,不存在lifeData变量,故放一个{}空对象
+    tmp = tmp ? tmp : {};
+    tmp[key] = value;
+    // 执行这一步后,所有需要存储的变量,都挂载在本地的lifeData对象中
+    uni.setStorageSync('lifeData', tmp);
+  }
+};
 const store = new Vuex.Store({
-	state: {
-		// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
-		// 加上vuex_前缀,是防止变量名冲突,也让人一目了然
-		vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
-		vuex_hasLogin:lifeData.vuex_hasLogin?lifeData.vuex_hasLogin:false,
-		vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
-		vuex_memberInfo: lifeData.vuex_memberInfo ? lifeData.vuex_memberInfo : {}
-	},
-	mutations: {
-		$uStore(state, payload) {
-			// 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
-			let nameArr = payload.name.split('.');
-			let saveKey = '';
-			let len = nameArr.length;
-			if(len >= 2) {
-				let obj = state[nameArr[0]];
-				for(let i = 1; i < len - 1; i ++) {
-					obj = obj[nameArr[i]];
-				}
-				obj[nameArr[len - 1]] = payload.value;
-				saveKey = nameArr[0];
-			} else {
-				// 单层级变量,在state就是一个普通变量的情况
-				state[payload.name] = payload.value;
-				saveKey = payload.name;
-			}
-			// 保存变量到本地,见顶部函数定义
-			saveLifeData(saveKey, state[saveKey])
-		}
-	}
-})
+  state: {
+    // 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量
+    // 加上vuex_前缀,是防止变量名冲突,也让人一目了然
+    vuex_user: lifeData.vuex_user ? lifeData.vuex_user : {},
+    vuex_hasLogin: lifeData.vuex_hasLogin ? lifeData.vuex_hasLogin : false,
+    vuex_token: lifeData.vuex_token ? lifeData.vuex_token : '',
+    vuex_memberInfo: lifeData.vuex_memberInfo ? lifeData.vuex_memberInfo : {}
+  },
+  mutations: {
+    $uStore(state, payload) {
+      // 判断是否多层级调用,state中为对象存在的情况,诸如user.info.score = 1
+      let nameArr = payload.name.split('.');
+      let saveKey = '';
+      let len = nameArr.length;
+      if (len >= 2) {
+        let obj = state[nameArr[0]];
+        for (let i = 1; i < len - 1; i++) {
+          obj = obj[nameArr[i]];
+        }
+        obj[nameArr[len - 1]] = payload.value;
+        saveKey = nameArr[0];
+      } else {
+        // 单层级变量,在state就是一个普通变量的情况
+        state[payload.name] = payload.value;
+        saveKey = payload.name;
+      }
+      // 保存变量到本地,见顶部函数定义
+      saveLifeData(saveKey, state[saveKey]);
+    }
+  }
+});
 
-export default store
+export default store;

+ 15 - 14
h5_web/tabbarconfig.js

@@ -1,26 +1,27 @@
 module.exports = {
   // 底部导航栏列表数据
-  tabbarList: [{
-      pagePath: "/pages/index/index",
-      iconPath: "/static/icons/index-gray.png",
-      selectedIconPath: "/static/icons/index.png",
+  tabbarList: [
+    {
+      pagePath: '/pages/index/index',
+      iconPath: '/static/icons/index-gray.png',
+      selectedIconPath: '/static/icons/index.png',
       text: '首页',
-      customIcon: false,
+      customIcon: false
     },
     {
-      pagePath: "/pages/mycode/mycode",
-      iconPath: "/static/icons/midbutton-gray.png",
-      selectedIconPath: "/static/icons/midbutton.png",
+      pagePath: '/pages/mycode/mycode',
+      iconPath: '/static/icons/midbutton-gray.png',
+      selectedIconPath: '/static/icons/midbutton.png',
       text: '退役军人码',
       midButton: true,
-      customIcon: false,
+      customIcon: false
     },
     {
-      pagePath: "/pages/mine/mine",
-      iconPath: "/static/icons/mine-gray.png",
-      selectedIconPath: "/static/icons/mine.png",
+      pagePath: '/pages/mine/mine',
+      iconPath: '/static/icons/mine-gray.png',
+      selectedIconPath: '/static/icons/mine.png',
       text: '我的',
-      customIcon: false,
+      customIcon: false
     }
   ],
   height: '53px',
@@ -28,4 +29,4 @@ module.exports = {
   inactiveColor: '#909399',
   activeColor: '#303133',
   midButtonSize: 80
-}
+};

+ 23 - 2
h5_web/template.h5.html

@@ -1,5 +1,6 @@
 <!DOCTYPE html>
 <html lang="zh-CN">
+
 	<head>
 		<meta charset="utf-8">
 		<meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -9,16 +10,36 @@
 			<%= htmlWebpackPlugin.options.title %>
 		</title>
 		<script>
-			document.addEventListener('DOMContentLoaded', function() {
+			document.addEventListener('DOMContentLoaded', function () {
 				document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
 			})
+			window.addEventListener(
+				"error",
+				function (e) {
+					var jsLoadedErrorReload = window.sessionStorage.getItem(
+						"jsLoadedErrorReload" // 跳转的标识,存入sessionStorage。用于不可控情况下,防止一直满足条件,触发死循环性的跳转页面
+					);
+					const fileReg = /\/js\/((chunk-vendors)|(app))\.[a-zA-Z0-9]+/;
+					const filename = e.filename || e.target.src || "";
+					if (jsLoadedErrorReload !== "true" && filename.match(fileReg)) {
+						window.sessionStorage.setItem("jsLoadedErrorReload", true); // 满足条件则,存入标识
+						let url = window.location.href;
+						const timeStr = `timeStr=${Date.now()}`;
+						url = /\?/.test(url) ? url + "&" + timeStr : url + "?" + timeStr;
+						window.location.replace(url); // 跳转时添加了时间戳
+					}
+				},
+				true
+			);
 		</script>
 		<link rel="stylesheet" href="<%= BASE_URL %>static/index.css" />
 	</head>
+
 	<body>
 		<noscript>
 			<strong>本站点必须要开启JavaScript才能运行</strong>
 		</noscript>
 		<div id="app"></div>
 	</body>
-</html>
+
+</html>

+ 5 - 5
h5_web/utils/filter.js

@@ -1,9 +1,9 @@
 /**
  * 公共方法的封装
-  */
-import Vue from 'vue'
+ */
+import Vue from 'vue';
 
 // 链接加时间戳
-Vue.filter("timestamp", function(link) {	
-	return link + '?t=' + new Date().getTime();
-});
+Vue.filter('timestamp', function (link) {
+  return link + '?t=' + new Date().getTime();
+});

+ 29 - 30
h5_web/utils/getUrlParams.js

@@ -6,35 +6,34 @@ let locationLocaturl = window.location.search;
 let openId = getUrlParams(locationLocaturl,"openId");
 */
 function getUrlParams(url, fkey) {
-	if (decodeURIComponent(url).indexOf('?') > -1) {
-		var result = [];
-		var urlParamsArr = decodeURIComponent(url).split('?');
-		urlParamsArr.shift();
-		let newUrlParamsArr = urlParamsArr.join('&').split('&');
-		for (var i = 0; i < newUrlParamsArr.length; i++) {
-			var paramKey = newUrlParamsArr[i].split('=')[0];
-			var paramValue = newUrlParamsArr[i].split('=')[1];
-			result.push({
-				key: paramKey,
-				value: paramValue
-			});
-		}
-		
-		if(fkey){
-			let keyArr = result.find(function(result) {
-				return result.key === fkey;
-			});
-			if (!!keyArr) {
-				let fkeyValue = keyArr.value;
-				return fkeyValue;
-			}else{
-				return false;
-			}
-			
-		}else{
-			return result;
-		}
-	}
+  if (decodeURIComponent(url).indexOf('?') > -1) {
+    var result = [];
+    var urlParamsArr = decodeURIComponent(url).split('?');
+    urlParamsArr.shift();
+    let newUrlParamsArr = urlParamsArr.join('&').split('&');
+    for (var i = 0; i < newUrlParamsArr.length; i++) {
+      var paramKey = newUrlParamsArr[i].split('=')[0];
+      var paramValue = newUrlParamsArr[i].split('=')[1];
+      result.push({
+        key: paramKey,
+        value: paramValue
+      });
+    }
+
+    if (fkey) {
+      let keyArr = result.find(function (result) {
+        return result.key === fkey;
+      });
+      if (!!keyArr) {
+        let fkeyValue = keyArr.value;
+        return fkeyValue;
+      } else {
+        return false;
+      }
+    } else {
+      return result;
+    }
+  }
 }
 
-export default getUrlParams
+export default getUrlParams;

+ 0 - 44
h5_web/utils/pay.js

@@ -1,44 +0,0 @@
-/**
- * 支付
- */
-import Vue from "vue";
-//#ifdef H5
-import $wxApi from "./wxapi.js";
-//#endif
-
-import $http from "uview-ui/libs/request"
-
-export default {
-	//微信支付
-	wechatPay(obj = {}) {
-		uni.showLoading({
-			title: '支付中'
-		});
-		return new Promise(r => {
-			// 支付接口对应自己的url
-			$http.post('url', obj)
-				.then(res=>{
-					//#ifdef H5
-					$wxApi.JSAPI(res.data.wx).then(r);
-					//#endif
-					this.payError(res);
-				}).catch(err =>{
-					console.log('pay err',err);
-				})
-		});
-	},
-	// 支付错误处理
-	payError(res){
-		uni.hideLoading();
-		if(res.code == 623){
-			setTimeout(i=>{
-				new Vue().$api.goto("/xx/xx");
-			}, 2000);
-			uni.showToast({
-				title: res.msg + "即将跳转到xx页",
-				icon: "none",
-				duration: 2000
-			});
-		}
-	}
-}

+ 0 - 175
h5_web/utils/wxapi.js

@@ -1,175 +0,0 @@
-//引入微信jssdk
-const wx = require('@/static/js/jweixin-1.4.0.js')
-
-//配置注册url
-const url = '';
-
-//http方法
-import $http from "uview-ui/libs/request"
-
-//系统域名url
-const href = location.href.split('#')[0];
-
-import { config } from '@/common/config'
-
-//系统域名url
-export default {
-	...wx,
-	isOk: false,
-	async config() {
-		wx.config({
-			debug: false,
-			jsApiList: [
-				"updateAppMessageShareData",
-				"updateTimelineShareData",
-				"onMenuShareTimeline",
-				"onMenuShareAppMessage",
-				"onMenuShareQQ",
-				"onMenuShareWeibo",
-				"onMenuShareQZone",
-				"startRecord",
-				"stopRecord",
-				"onVoiceRecordEnd",
-				"playVoice",
-				"pauseVoice",
-				"stopVoice",
-				"onVoicePlayEnd",
-				"uploadVoice",
-				"downloadVoice",
-				"chooseImage",
-				"previewImage",
-				"uploadImage",
-				"downloadImage",
-				"translateVoice",
-				"getNetworkType",
-				"openLocation",
-				"getLocation",
-				"hideOptionMenu",
-				"showOptionMenu",
-				"hideMenuItems",
-				"showMenuItems",
-				"hideAllNonBaseMenuItem",
-				"showAllNonBaseMenuItem",
-				"closeWindow",
-				"scanQRCode",
-				"chooseWXPay",
-				"openProductSpecificView",
-				"addCard",
-				"chooseCard",
-				"openCard"
-			],
-			...(await $http.get(url,{url:href})).data,
-			// ...(await uni.request(url,{url:href})).retBody,
-		});
-		wx.ready(e => {
-			this.isOk = true;
-			// this.hideMenu();
-		});
-		wx.error(e => {
-			console.log("wxapi初始化失败")
-			this.isOk = false;
-		});
-	},
-	hideMenu() {
-		wx.hideAllNonBaseMenuItem();
-		wx.hideMenuItems({		
-		    menuList: [
-				"menuItem:share:appMessage",
-				"menuItem:profile",
-				"menuItem:addContact",
-				"menuItem:dayMode",
-				"menuItem:nightMode",
-				"menuItem:share:timeline",
-				"menuItem:favorite"				
-			] // 要隐藏的菜单项,只能隐藏“传播类”和“保护类”按钮,所有menu项见附录3		
-		});
-	},
-	showMenu() {
-		wx.showMenuItems({
-			menuList: [
-				"menuItem:share:appMessage",
-				"menuItem:profile",
-				"menuItem:addContact",
-				"menuItem:dayMode",
-				"menuItem:nightMode",
-				"menuItem:share:timeline",
-				"menuItem:favorite"
-			] // 要显示的菜单项,所有menu项见附录3
-		});
-	},
-	/**
-	 * 分享配置
-	 * @param {Object} info
-	 */
-	share(data = {}, info = {}) {
-		//添加链接时间戳
-		// data.v = new Date().getTime();
-		// console.log("shareData",data)
-		// let search = [];
-		// for (const [key, value] of Object.entries(data)) {
-		// 	// search.push(`${key}=${encodeURIComponent(value)}`);
-		// 	search.push(`${key}=${value}`);
-		// }
-		// search = "?" + search.join("&");
-		
-		let afterEndUrl = config.afterEndUrl;
-		// let afterEndUrl = 'http://tanhui.hongweisoft.com/api/wechat/h5/authorize?returnUrl='
-		// let afterEndUrl = 'http://gzhjt.gzsdzth.com/api/wechat/h5/authorize?returnUrl='
-		
-		let fullUrl = afterEndUrl + location.href.split('?')[0] + '?togetherId=' + data.togetherId + '/#/' + data.routeUrl
-		const shareInfo = {
-			title: data.nickname + '邀请你参与贵州省单株碳汇精准扶贫',
-			link: fullUrl,
-			desc: "购碳扶贫,你我同行",
-			imgUrl: href + "/static/logo.png",
-			trigger(res) {},
-			success(res) {},
-			cancel(res) {},
-			fail(res) {},
-			...info
-		};
-		console.log('shareInfo',shareInfo,'fullUrl',fullUrl)
-		//自定义“分享给朋友”及“分享到QQ”按钮的分享内容(1.4.0)
-		wx.updateAppMessageShareData(shareInfo);
-		//自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容(1.4.0)
-		wx.updateTimelineShareData(shareInfo);
-	},
-	//拉起微信浏览器端支付
-	JSAPI(res) {
-		return new Promise(r => {
-			wx.chooseWXPay({
-				"timestamp": res.timeStamp, //时间戳,自1970年以来的秒数     
-				"nonceStr": res.nonceStr, //随机串     
-				"package": res.packageValue,
-				"signType": res.signType, //微信签名方式:     
-				"paySign": res.paySign, //微信签名 
-				success() {
-					r({
-						code: 0,
-						msg: "成功"
-					});
-				},
-				cancel() {
-					r({
-						code: 1,
-						msg: "取消"
-					});
-				},
-				fail(err) {
-					console.log('支付失败',err.errMsg.split(':')[1]);
-					r({
-						code: 2,
-						msg: err.errMsg.split(':')[1]
-					});
-				},
-				// 无论失败成功都会执行
-				complete(e) {
-					// e.errMsg三种状态 1.chooseWXPay:ok 支付成功 2: chooseWXPay:cancel 支付取消 3:chooseWXPay:fail 支付失败
-					if (e.errMsg === 'chooseWXPay:ok') {
-						window.location.reload()
-					}
-				}
-			});
-		});
-	}
-}

+ 306 - 296
h5_web/uview-ui/components/u-navbar/u-navbar.vue

@@ -1,315 +1,325 @@
 <template>
-	<view class="">
-		<view class="u-navbar" :style="[navbarStyle]" :class="{ 'u-navbar-fixed': isFixed, 'u-border-bottom': borderBottom }">
-			<view class="u-status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
-			<view class="u-navbar-inner" :style="[navbarInnerStyle]">
-				<view class="u-back-wrap" v-if="isBack" @tap="goBack">
-					<view class="u-icon-wrap">
-						<u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
-					</view>
-					<view class="u-icon-wrap u-back-text u-line-1" v-if="backText" :style="[backTextStyle]">{{ backText }}</view>
-				</view>
-				<view class="u-navbar-content-title" v-if="title" :style="[titleStyle]">
-					<view
-					    class="u-title u-line-1"
-					    :style="{
-							color: titleColor,
-							fontSize: titleSize + 'rpx',
-							fontWeight: titleBold ? 'bold' : 'normal'
-						}">
-						{{ title }}
-					</view>
-				</view>
-				<view class="u-slot-content">
-					<slot></slot>
-				</view>
-				<view class="u-slot-right">
-					<slot name="right"></slot>
-				</view>
-			</view>
-		</view>
-		<!-- 解决fixed定位后导航栏塌陷的问题 -->
-		<view class="u-navbar-placeholder" v-if="isFixed && !immersive" :style="{ width: '100%', height: Number(navbarHeight) + statusBarHeight + 'px' }"></view>
-	</view>
+  <view class="">
+    <view class="u-navbar" :style="[navbarStyle]" :class="{ 'u-navbar-fixed': isFixed, 'u-border-bottom': borderBottom }">
+      <view class="u-status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
+      <view class="u-navbar-inner" :style="[navbarInnerStyle]">
+        <view class="u-back-wrap" v-if="isBack" @tap="goBack">
+          <view class="u-icon-wrap">
+            <u-icon :name="backIconName" :color="backIconColor" :size="backIconSize"></u-icon>
+          </view>
+          <view class="u-icon-wrap u-back-text u-line-1" v-if="backText" :style="[backTextStyle]">{{ backText }}</view>
+        </view>
+        <view class="u-navbar-content-title" v-if="title" :style="[titleStyle]">
+          <view
+            class="u-title u-line-1"
+            :style="{
+              color: titleColor,
+              fontSize: titleSize + 'rpx',
+              fontWeight: titleBold ? 'bold' : 'normal'
+            }"
+          >
+            {{ title }}
+          </view>
+        </view>
+        <view class="u-slot-content">
+          <slot></slot>
+        </view>
+        <view class="u-slot-right">
+          <slot name="right"></slot>
+        </view>
+      </view>
+    </view>
+    <!-- 解决fixed定位后导航栏塌陷的问题 -->
+    <view
+      class="u-navbar-placeholder"
+      v-if="isFixed && !immersive"
+      :style="{ width: '100%', height: Number(navbarHeight) + statusBarHeight + 'px' }"
+    ></view>
+  </view>
 </template>
 
 <script>
-	// 获取系统状态栏的高度
-	let systemInfo = uni.getSystemInfoSync();
-	let menuButtonInfo = {};
-	// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
-	// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
-	menuButtonInfo = uni.getMenuButtonBoundingClientRect();
-	// #endif
-	/**
-	 * navbar 自定义导航栏
-	 * @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uniapp自带的导航栏。
-	 * @tutorial https://www.uviewui.com/components/navbar.html
-	 * @property {String Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上),注意这里的单位是px(默认44)
-	 * @property {String} back-icon-color 左边返回图标的颜色(默认#606266)
-	 * @property {String} back-icon-name 左边返回图标的名称,只能为uView自带的图标(默认arrow-left)
-	 * @property {String Number} back-icon-size 左边返回图标的大小,单位rpx(默认30)
-	 * @property {String} back-text 返回图标右边的辅助提示文字
-	 * @property {Object} back-text-style 返回图标右边的辅助提示文字的样式,对象形式(默认{ color: '#606266' })
-	 * @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
-	 * @property {String Number} title-width 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位rpx(默认250)
-	 * @property {String} title-color 标题的颜色(默认#606266)
-	 * @property {String Number} title-size 导航栏标题字体大小,单位rpx(默认32)
-	 * @property {Function} custom-back 自定义返回逻辑方法
-	 * @property {String Number} z-index 固定在顶部时的z-index值(默认980)
-	 * @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字(默认true)
-	 * @property {Object} background 导航栏背景设置,见官网说明(默认{ background: '#ffffff' })
-	 * @property {Boolean} is-fixed 导航栏是否固定在顶部(默认true)
-	 * @property {Boolean} immersive 沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效(默认false)
-	 * @property {Boolean} border-bottom 导航栏底部是否显示下边框,如定义了较深的背景颜色,可取消此值(默认true)
-	 * @example <u-navbar back-text="返回" title="剑未配妥,出门已是江湖"></u-navbar>
-	 */
-	export default {
-		name: "u-navbar",
-		props: {
-			// 导航栏高度,单位px,非rpx
-			height: {
-				type: [String, Number],
-				default: ''
-			},
-			// 返回箭头的颜色
-			backIconColor: {
-				type: String,
-				default: '#606266'
-			},
-			// 左边返回的图标
-			backIconName: {
-				type: String,
-				default: 'nav-back'
-			},
-			// 左边返回图标的大小,rpx
-			backIconSize: {
-				type: [String, Number],
-				default: '44'
-			},
-			// 返回的文字提示
-			backText: {
-				type: String,
-				default: ''
-			},
-			// 返回的文字的 样式
-			backTextStyle: {
-				type: Object,
-				default () {
-					return {
-						color: '#606266'
-					}
-				}
-			},
-			// 导航栏标题
-			title: {
-				type: String,
-				default: ''
-			},
-			// 标题的宽度,如果需要自定义右侧内容,且右侧内容很多时,可能需要减少这个宽度,单位rpx
-			titleWidth: {
-				type: [String, Number],
-				default: '250'
-			},
-			// 标题的颜色
-			titleColor: {
-				type: String,
-				default: '#606266'
-			},
-			// 标题字体是否加粗
-			titleBold: {
-				type: Boolean,
-				default: false
-			},
-			// 标题的字体大小
-			titleSize: {
-				type: [String, Number],
-				default: 32
-			},
-			isBack: {
-				type: [Boolean, String],
-				default: true
-			},
-			// 对象形式,因为用户可能定义一个纯色,或者线性渐变的颜色
-			background: {
-				type: Object,
-				default () {
-					return {
-						background: '#ffffff'
-					}
-				}
-			},
-			// 导航栏是否固定在顶部
-			isFixed: {
-				type: Boolean,
-				default: true
-			},
-			// 是否沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效
-			immersive: {
-				type: Boolean,
-				default: false
-			},
-			// 是否显示导航栏的下边框
-			borderBottom: {
-				type: Boolean,
-				default: true
-			},
-			zIndex: {
-				type: [String, Number],
-				default: ''
-			},
-			// 自定义返回逻辑
-			customBack: {
-				type: Function,
-				default: null
-			}
-		},
-		data() {
-			return {
-				menuButtonInfo: menuButtonInfo,
-				statusBarHeight: systemInfo.statusBarHeight
-			};
-		},
-		computed: {
-			// 导航栏内部盒子的样式
-			navbarInnerStyle() {
-				let style = {};
-				// 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
-				style.height = this.navbarHeight + 'px';
-				// // 如果是各家小程序,导航栏内部的宽度需要减少右边胶囊的宽度
-				// #ifdef MP
-				let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
-				style.marginRight = rightButtonWidth + 'px';
-				// #endif
-				return style;
-			},
-			// 整个导航栏的样式
-			navbarStyle() {
-				let style = {};
-				style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.navbar;
-				// 合并用户传递的背景色对象
-				Object.assign(style, this.background);
-				return style;
-			},
-			// 导航中间的标题的样式
-			titleStyle() {
-				let style = {};
-				// #ifndef MP
-				style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
-				style.right = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
-				// #endif
-				// #ifdef MP
-				// 此处是为了让标题显示区域即使在小程序有右侧胶囊的情况下也能处于屏幕的中间,是通过绝对定位实现的
-				let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
-				style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
-				style.right = rightButtonWidth - (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + rightButtonWidth +
-					'px';
-				// #endif
-				style.width = uni.upx2px(this.titleWidth) + 'px';
-				return style;
-			},
-			// 转换字符数值为真正的数值
-			navbarHeight() {
-				// #ifdef APP-PLUS || H5
-				return this.height ? this.height : 44;
-				// #endif
-				// #ifdef MP
-				// 小程序特别处理,让导航栏高度 = 胶囊高度 + 两倍胶囊顶部与状态栏底部的距离之差(相当于同时获得了导航栏底部与胶囊底部的距离)
-				// 此方法有缺陷,暂不用(会导致少了几个px),采用直接固定值的方式
-				// return menuButtonInfo.height + (menuButtonInfo.top - this.statusBarHeight) * 2;//导航高度
-				let height = systemInfo.platform == 'ios' ? 44 : 48;
-				return this.height ? this.height : height;
-				// #endif
-			}
-		},
-		created() {},
-		methods: {
-			goBack() {
-				// 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
-				if (typeof this.customBack === 'function') {
-					// 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
-					// 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
-					this.customBack.bind(this.$u.$parent.call(this))();
-				} else {
-					uni.navigateBack();
-				}
-			}
-		}
-	};
+// 获取系统状态栏的高度
+let systemInfo = uni.getSystemInfoSync();
+let menuButtonInfo = {};
+// 如果是小程序,获取右上角胶囊的尺寸信息,避免导航栏右侧内容与胶囊重叠(支付宝小程序非本API,尚未兼容)
+// #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
+menuButtonInfo = uni.getMenuButtonBoundingClientRect();
+// #endif
+/**
+ * navbar 自定义导航栏
+ * @description 此组件一般用于在特殊情况下,需要自定义导航栏的时候用到,一般建议使用uniapp自带的导航栏。
+ * @tutorial https://www.uviewui.com/components/navbar.html
+ * @property {String Number} height 导航栏高度(不包括状态栏高度在内,内部自动加上),注意这里的单位是px(默认44)
+ * @property {String} back-icon-color 左边返回图标的颜色(默认#606266)
+ * @property {String} back-icon-name 左边返回图标的名称,只能为uView自带的图标(默认arrow-left)
+ * @property {String Number} back-icon-size 左边返回图标的大小,单位rpx(默认30)
+ * @property {String} back-text 返回图标右边的辅助提示文字
+ * @property {Object} back-text-style 返回图标右边的辅助提示文字的样式,对象形式(默认{ color: '#606266' })
+ * @property {String} title 导航栏标题,如设置为空字符,将会隐藏标题占位区域
+ * @property {String Number} title-width 导航栏标题的最大宽度,内容超出会以省略号隐藏,单位rpx(默认250)
+ * @property {String} title-color 标题的颜色(默认#606266)
+ * @property {String Number} title-size 导航栏标题字体大小,单位rpx(默认32)
+ * @property {Function} custom-back 自定义返回逻辑方法
+ * @property {String Number} z-index 固定在顶部时的z-index值(默认980)
+ * @property {Boolean} is-back 是否显示导航栏左边返回图标和辅助文字(默认true)
+ * @property {Object} background 导航栏背景设置,见官网说明(默认{ background: '#ffffff' })
+ * @property {Boolean} is-fixed 导航栏是否固定在顶部(默认true)
+ * @property {Boolean} immersive 沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效(默认false)
+ * @property {Boolean} border-bottom 导航栏底部是否显示下边框,如定义了较深的背景颜色,可取消此值(默认true)
+ * @example <u-navbar back-text="返回" title="剑未配妥,出门已是江湖"></u-navbar>
+ */
+export default {
+  name: 'u-navbar',
+  props: {
+    // 导航栏高度,单位px,非rpx
+    height: {
+      type: [String, Number],
+      default: ''
+    },
+    // 返回箭头的颜色
+    backIconColor: {
+      type: String,
+      default: '#606266'
+    },
+    // 左边返回的图标
+    backIconName: {
+      type: String,
+      default: 'nav-back'
+    },
+    // 左边返回图标的大小,rpx
+    backIconSize: {
+      type: [String, Number],
+      default: '44'
+    },
+    // 返回的文字提示
+    backText: {
+      type: String,
+      default: ''
+    },
+    // 返回的文字的 样式
+    backTextStyle: {
+      type: Object,
+      default() {
+        return {
+          color: '#606266'
+        };
+      }
+    },
+    // 导航栏标题
+    title: {
+      type: String,
+      default: ''
+    },
+    // 标题的宽度,如果需要自定义右侧内容,且右侧内容很多时,可能需要减少这个宽度,单位rpx
+    titleWidth: {
+      type: [String, Number],
+      default: '250'
+    },
+    // 标题的颜色
+    titleColor: {
+      type: String,
+      default: '#606266'
+    },
+    // 标题字体是否加粗
+    titleBold: {
+      type: Boolean,
+      default: false
+    },
+    // 标题的字体大小
+    titleSize: {
+      type: [String, Number],
+      default: 32
+    },
+    isBack: {
+      type: [Boolean, String],
+      default: true
+    },
+    // 对象形式,因为用户可能定义一个纯色,或者线性渐变的颜色
+    background: {
+      type: Object,
+      default() {
+        return {
+          background: '#ffffff'
+        };
+      }
+    },
+    // 导航栏是否固定在顶部
+    isFixed: {
+      type: Boolean,
+      default: true
+    },
+    // 是否沉浸式,允许fixed定位后导航栏塌陷,仅fixed定位下生效
+    immersive: {
+      type: Boolean,
+      default: false
+    },
+    // 是否显示导航栏的下边框
+    borderBottom: {
+      type: Boolean,
+      default: true
+    },
+    zIndex: {
+      type: [String, Number],
+      default: ''
+    },
+    // 自定义返回逻辑
+    customBack: {
+      type: Function,
+      default: null
+    }
+  },
+  data() {
+    return {
+      menuButtonInfo: menuButtonInfo,
+      statusBarHeight: systemInfo.statusBarHeight
+    };
+  },
+  computed: {
+    // 导航栏内部盒子的样式
+    navbarInnerStyle() {
+      let style = {};
+      // 导航栏宽度,如果在小程序下,导航栏宽度为胶囊的左边到屏幕左边的距离
+      style.height = this.navbarHeight + 'px';
+      // // 如果是各家小程序,导航栏内部的宽度需要减少右边胶囊的宽度
+      // #ifdef MP
+      let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
+      style.marginRight = rightButtonWidth + 'px';
+      // #endif
+      return style;
+    },
+    // 整个导航栏的样式
+    navbarStyle() {
+      let style = {};
+      style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.navbar;
+      // 合并用户传递的背景色对象
+      Object.assign(style, this.background);
+      return style;
+    },
+    // 导航中间的标题的样式
+    titleStyle() {
+      let style = {};
+      // #ifndef MP
+      style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
+      style.right = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
+      // #endif
+      // #ifdef MP
+      // 此处是为了让标题显示区域即使在小程序有右侧胶囊的情况下也能处于屏幕的中间,是通过绝对定位实现的
+      let rightButtonWidth = systemInfo.windowWidth - menuButtonInfo.left;
+      style.left = (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + 'px';
+      style.right = rightButtonWidth - (systemInfo.windowWidth - uni.upx2px(this.titleWidth)) / 2 + rightButtonWidth + 'px';
+      // #endif
+      style.width = uni.upx2px(this.titleWidth) + 'px';
+      return style;
+    },
+    // 转换字符数值为真正的数值
+    navbarHeight() {
+      // #ifdef APP-PLUS || H5
+      return this.height ? this.height : 44;
+      // #endif
+      // #ifdef MP
+      // 小程序特别处理,让导航栏高度 = 胶囊高度 + 两倍胶囊顶部与状态栏底部的距离之差(相当于同时获得了导航栏底部与胶囊底部的距离)
+      // 此方法有缺陷,暂不用(会导致少了几个px),采用直接固定值的方式
+      // return menuButtonInfo.height + (menuButtonInfo.top - this.statusBarHeight) * 2;//导航高度
+      let height = systemInfo.platform == 'ios' ? 44 : 48;
+      return this.height ? this.height : height;
+      // #endif
+    }
+  },
+  created() {},
+  methods: {
+    goBack() {
+      // 如果自定义了点击返回按钮的函数,则执行,否则执行返回逻辑
+      if (typeof this.customBack === 'function') {
+        // 在微信,支付宝等环境(H5正常),会导致父组件定义的customBack()函数体中的this变成子组件的this
+        // 通过bind()方法,绑定父组件的this,让this.customBack()的this为父组件的上下文
+        this.customBack.bind(this.$u.$parent.call(this))();
+      } else {
+        if (getCurrentPages().length > 1) {
+          uni.navigateBack();
+        } else {
+          uni.switchTab({
+            url: '/pages/index/index'
+          });
+        }
+      }
+    }
+  }
+};
 </script>
 
 <style scoped lang="scss">
-	@import "../../libs/css/style.components.scss";
+@import '../../libs/css/style.components.scss';
 
-	.u-navbar {
-		width: 100%;
-	}
+.u-navbar {
+  width: 100%;
+}
 
-	.u-navbar-fixed {
-		position: fixed;
-		left: 0;
-		right: 0;
-		top: 0;
-		z-index: 991;
-	}
+.u-navbar-fixed {
+  position: fixed;
+  left: 0;
+  right: 0;
+  top: 0;
+  z-index: 991;
+}
 
-	.u-status-bar {
-		width: 100%;
-	}
+.u-status-bar {
+  width: 100%;
+}
 
-	.u-navbar-inner {
-		@include vue-flex;
-		justify-content: space-between;
-		position: relative;
-		align-items: center;
-	}
+.u-navbar-inner {
+  @include vue-flex;
+  justify-content: space-between;
+  position: relative;
+  align-items: center;
+}
 
-	.u-back-wrap {
-		@include vue-flex;
-		align-items: center;
-		flex: 1;
-		flex-grow: 0;
-		padding: 14rpx 14rpx 14rpx 24rpx;
-	}
+.u-back-wrap {
+  @include vue-flex;
+  align-items: center;
+  flex: 1;
+  flex-grow: 0;
+  padding: 14rpx 14rpx 14rpx 24rpx;
+}
 
-	.u-back-text {
-		padding-left: 4rpx;
-		font-size: 30rpx;
-	}
+.u-back-text {
+  padding-left: 4rpx;
+  font-size: 30rpx;
+}
 
-	.u-navbar-content-title {
-		@include vue-flex;
-		align-items: center;
-		justify-content: center;
-		flex: 1;
-		position: absolute;
-		left: 0;
-		right: 0;
-		height: 60rpx;
-		text-align: center;
-		flex-shrink: 0;
-	}
+.u-navbar-content-title {
+  @include vue-flex;
+  align-items: center;
+  justify-content: center;
+  flex: 1;
+  position: absolute;
+  left: 0;
+  right: 0;
+  height: 60rpx;
+  text-align: center;
+  flex-shrink: 0;
+}
 
-	.u-navbar-centent-slot {
-		flex: 1;
-	}
+.u-navbar-centent-slot {
+  flex: 1;
+}
 
-	.u-title {
-		line-height: 60rpx;
-		font-size: 32rpx;
-		flex: 1;
-	}
+.u-title {
+  line-height: 60rpx;
+  font-size: 32rpx;
+  flex: 1;
+}
 
-	.u-navbar-right {
-		flex: 1;
-		@include vue-flex;
-		align-items: center;
-		justify-content: flex-end;
-	}
+.u-navbar-right {
+  flex: 1;
+  @include vue-flex;
+  align-items: center;
+  justify-content: flex-end;
+}
 
-	.u-slot-content {
-		flex: 1;
-		@include vue-flex;
-		align-items: center;
-	}
+.u-slot-content {
+  flex: 1;
+  @include vue-flex;
+  align-items: center;
+}
 </style>

+ 14 - 13
h5_web/vue.config.js

@@ -1,14 +1,15 @@
 module.exports = {
-	devServer: {
-		proxy: { //配置跨域
-			'/apis': {
-				target: 'http://api.veterans.hongweisoft.com/api', //搜狐的域名
-				ws: false,
-				changOrigin: true, //允许跨域
-				pathRewrite: {
-					'^/apis': '' //请求的时候使用这个api就可以
-				}
-			}
-		}
-	},
-}
+  devServer: {
+    proxy: {
+      //配置跨域
+      '/apis': {
+        target: 'http://api.veterans.hongweisoft.com/api', //搜狐的域名
+        ws: false,
+        changOrigin: true, //允许跨域
+        pathRewrite: {
+          '^/apis': '' //请求的时候使用这个api就可以
+        }
+      }
+    }
+  }
+};