Bläddra i källkod

签到页面和调整页面

zaijin 2 år sedan
förälder
incheckning
39d4894239

+ 3 - 1
h5_web/common/apiurl.js

@@ -171,7 +171,9 @@ const apiurl = {
     // 获取个人总积分
     getIntegralTotalUrl: '/integral/total',
     // 修改在职状态
-    updatePositionStatusUrl: '/memberinfo/updateJobStatus'
+    updatePositionStatusUrl: '/memberinfo/updateJobStatus',
+		// 立即签到
+		signInNowUrl: '/adaptTrainOffline/userSign'
   },
   /**
    * 适应性培训

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

@@ -166,7 +166,8 @@ const install = (Vue, vm) => {
     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)
+    updatePositionStatusApi: (params = {}) => vm.$u.put(apiurl.mine.updatePositionStatusUrl, params),
+		signInNowApi: (params = {}) => vm.$u.post(apiurl.mine.signInNowUrl, params)
   };
 
   // 适应性培训

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

@@ -48,7 +48,7 @@ const install = (Vue, vm) => {
     } else {
       uni.showToast({
         title: res.msg,
-        icon: 'none',
+        icon: 'error',
         duration: 2000
       });
     }

+ 1 - 1
h5_web/components/clock-learn/index.vue

@@ -26,7 +26,7 @@
 				minutes: '',
 				seconds: '',
 				width: 0,
-				long: 60,
+				long: 80,
 				cross: false,
 				isshow: true,
 				isapm: false,

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

@@ -37,7 +37,7 @@
       <view></view>
     </view>
     <!-- 评论 -->
-    <view class="details-comment">
+    <!-- <view class="details-comment">
       <view class="details-comment-header">
         <view>课程评论</view>
         <view>共{{ total }}条评论</view>
@@ -80,7 +80,7 @@
         </view>
         <view class="details-comment-conent-button" @click="submitCommet">提交</view>
       </view>
-    </view>
+    </view> -->
     <u-toast ref="uToast" />
   </view>
 </template>
@@ -140,7 +140,7 @@ export default {
             this.$nextTick(() => {
               this.$refs['videoBox'].loadVideo(this.videoInfo);
             });
-            this.getCommentList();
+            // this.getCommentList();
           }
         });
     },

+ 7 - 5
h5_web/pages/mycode/mycode.vue

@@ -92,8 +92,8 @@
 							<u-form-item label="薪资范围:" prop="salaryRangeName" :required="true">
 								<u-input v-model="conditionForm.salaryRangeName" placeholder="请选择您的薪资范围" type="select" @click="salaryRangeClick"/>
 							</u-form-item>
-							<u-form-item label="求职意向:" prop="intention" :required="true">
-								<u-input v-model="conditionForm.intention" placeholder="请输入您的求职意向" type="textarea"/>
+							<u-form-item label="求职意向:" prop="jobIntention" :required="true">
+								<u-input v-model="conditionForm.jobIntention" placeholder="请输入您的求职意向" type="textarea"/>
 							</u-form-item>
 						</u-form>
 					</view>
@@ -132,7 +132,8 @@
 					conditionForm: {
 						jobStatus: '',
 						salaryRangeName: '',
-						salaryRange: ''
+						salaryRange: '',
+						jobIntention: ''
 					},
 					conditionFormRules: {
 						jobStatus: [
@@ -149,7 +150,7 @@
 								trigger: ['change', 'blur']
 							}
 						],
-						intention: [
+						jobIntention: [
 							{
 								required: true,
 								message: '请填写求职意向',
@@ -299,7 +300,8 @@
 						if (valid) {
 							const params = {
 								salaryRange: this.conditionForm.salaryRange,
-								jobStatus: this.conditionForm.jobStatus
+								jobStatus: this.conditionForm.jobStatus,
+								jobIntention: this.conditionForm.jobIntention
 							}
 							this.$u.api.mine.submitEmploymentCondition(params).then(res => {
 								if (res.code === 200) {

+ 3 - 1
h5_web/pages/offlineSignin/offlineSignin.scss

@@ -15,10 +15,12 @@
 			margin-top: 200rpx;
 			.sibd-date {
 				margin-top: 30rpx;
+				font-size: 20px;
+				font-weight: 500;
 			}
 		}
 		&-button {
-			margin-top: 100rpx;
+			margin-top: 150rpx;
 			.sign-in-btn {
 				margin-bottom: 40rpx;
 			}

+ 78 - 4
h5_web/pages/offlineSignin/offlineSignin.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="sign-in">
+	<view class="sign-in" v-loading="loading">
 		<view class="sign-in-box">
 			<view class="sign-in-box-divider"></view>
 			<view class="sign-in-box-datetime">
@@ -12,26 +12,100 @@
 				</view>
 			</view>
 			<view class="sign-in-box-button">
-				<u-button type="primary" class="sign-in-btn">立即签到</u-button>
-				<u-button type="info">签到记录</u-button>
+				<u-button type="primary" class="sign-in-btn" :loading="signLoading" @click="signImmediately">立即签到
+				</u-button>
+				<!-- <u-button type="info">签到记录</u-button> -->
 			</view>
 		</view>
+		<u-toast ref="uToast" />
 	</view>
 </template>
 
 <script>
-	import clockLearn from './../../components/clock-learn/index.vue'
+	import clockLearn from '@/components/clock-learn/index.vue'
 	export default {
 		components: {
 			clockLearn
 		},
 		data() {
 			return {
+				loading: false,
+				memberInfo: {},
+				signLoading: false,
+				id: undefined,
+				code: undefined
+			}
+		},
+		onLoad(page) {
+			const {
+				id,
+				code
+			} = page;
+			if (id && code) {
+				this.id = id;
+				this.code = code
+			} else {
+				uni.showToast({
+					title: '参数丢失,请重新扫码!',
+					duration: 2000,
+					icon: 'error'
+				});
 			}
 		},
 		onShow() {
+			this.getMemberInfo();
 		},
 		methods: {
+			/**
+			 * 获取用户信息
+			 */
+			getMemberInfo() {
+				this.loading = true;
+				this.$u.api
+					.getmemberinfo()
+					.then((res) => {
+						this.memberInfo = res?.data ?? {}
+						this.loading = false;
+					})
+					.catch(() => {
+						this.loading = false;
+					})
+			},
+			/**
+			 * 立即签到
+			 */
+			signImmediately() {
+				this.signLoading = true;
+				this.$u.api.mine.signInNowApi({
+						id: this.id
+					})
+					.then(res => {
+						if (res.code === 200) {
+							this.$refs.uToast.show({
+								title: res.msg || '签到成功!',
+								type: 'success',
+								duration: 3000
+							});
+							setTimeout(() => {
+								uni.switchTab({
+									url: '/pages/index/index'
+								})
+							}, 3000)
+						} else {
+							this.$refs.uToast.show({
+								title: '签到失败!' + res.msg,
+								type: 'error'
+							});
+							this.signLoading = false;
+						}
+					})
+					.catch(() => {
+						this.signLoading = false;
+					})
+			},
+			/**
+			 * 获取星期几
+			 */
 			getDateString() {
 				const weekList = ['星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
 					currentDate = new Date(),

+ 268 - 266
h5_web/pages/skillsTraining/courseDetailed/courseDetailed.vue

@@ -1,275 +1,277 @@
 <template>
-  <view class="details">
-    <u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }" :border-bottom="false"></u-navbar>
-    <!-- 视频 -->
-    <video-box ref="videoBox" v-if="isPlay" :videoUrl="videoInfo.videoUrl" @recordDuration="recordDuration"></video-box>
-    <!-- 介绍 -->
-    <view class="details-content">
-      <view class="details-content-title">{{ videoInfo.chapterName || '-' }}</view>
-      <view class="details-content-progress"
-        >本课程 共{{ info.amount || 0 }}课,已学完{{ info.finishCount || 0 }}课,共进度{{ info.finishPercent || 0 }}%</view
-      >
-      <view class="details-content-teacher">主讲老师:{{ info.presenter || '-' }}</view>
-      <view class="details-content-info">{{ videoInfo.chapterInfo || '-' }}</view>
-    </view>
+	<view class="details">
+		<u-navbar back-text="" title="" back-icon-color="#FFFFFF" :background="{ background: '#3D5D4C' }"
+			:border-bottom="false"></u-navbar>
+		<!-- 视频 -->
+		<video-box ref="videoBox" v-if="isPlay" :videoUrl="videoInfo.videoUrl" @recordDuration="recordDuration">
+		</video-box>
+		<!-- 介绍 -->
+		<view class="details-content">
+			<view class="details-content-title">{{ videoInfo.chapterName || '-' }}</view>
+			<view class="details-content-progress">本课程
+				共{{ info.amount || 0 }}课,已学完{{ info.finishCount || 0 }}课,共进度{{ info.finishPercent || 0 }}%</view>
+			<view class="details-content-teacher">主讲老师:{{ info.presenter || '-' }}</view>
+			<view class="details-content-info">{{ videoInfo.chapterInfo || '-' }}</view>
+		</view>
 
-    <!-- 课程章节 -->
-    <view class="details-classes">
-      <view class="details-classes-header">
-        <view>精选课程</view>
-        <view>
-          更多
-          <u-icon name="arrow-right" size="22" color="#A3A3A3" />
-        </view>
-      </view>
-      <view class="details-classes-list">
-        <view
-          class="details-classes-list-item"
-          v-for="(item, index) in info.chapterList"
-          :key="index"
-          :class="{ active: index === videoIndex }"
-          @click="classesClick(index)"
-        >
-          <view>{{ index + 1 }}</view>
-          <view>{{ item.flag === 2 ? '已学' : item.finishPercent + '%' }}</view>
-        </view>
-      </view>
-    </view>
-    <view class="details-line">
-      <view></view>
-    </view>
-    <!-- 评论 -->
-    <view class="details-comment">
-      <view class="details-comment-header">
-        <view>课程评论</view>
-        <view>共{{ total || 0 }}条评论</view>
-      </view>
-      <view class="details-comment-list">
-        <view class="details-comment-list-item" v-for="(item, index) in commentList" :key="index">
-          <view class="left">
-            <u-avatar :src="item.createByAvatar" size="96" mode="square"></u-avatar>
-          </view>
-          <view class="right">
-            <view>{{ item.createBy }}</view>
-            <view>
-              <u-rate :count="5" size="28" disabled="" active-color="#FFBC00" v-model="item.starLevel"> </u-rate>
-              <text>{{ item.createTime }}</text>
-            </view>
-            <view>{{ item.content }}</view>
-          </view>
-        </view>
-      </view>
-      <view class="details-comment-page" v-if="total">
-        <wyb-pagination :padding="0" :totalItems="total" :current="query.pageNum" @change="pageChange" />
-      </view>
-      <view class="details-comment-mine"><text>我的评论</text></view>
-      <view class="details-comment-conent">
-        <view class="details-comment-conent-star">
-          <u-rate :count="5" size="40" active-color="#FFBC00" v-model="form.starLevel"></u-rate>
-        </view>
-        <view class="details-comment-content-textarea">
-          <u-input
-            v-model="form.content"
-            placeholder="请输入您的评价"
-            type="textarea"
-            :custom-style="{ backgroundColor: '#F5F5F5', padding: '30rpx', borderRadius: '10rpx', minHeight: '280rpx' }"
-          >
-          </u-input>
-        </view>
-        <view class="details-comment-conent-button" @click="submitCommet">提交</view>
-      </view>
-    </view>
-    <u-toast ref="uToast" />
-  </view>
+		<!-- 课程章节 -->
+		<view class="details-classes">
+			<view class="details-classes-header">
+				<view>精选课程</view>
+				<view>
+					更多
+					<u-icon name="arrow-right" size="22" color="#A3A3A3" />
+				</view>
+			</view>
+			<view class="details-classes-list">
+				<view class="details-classes-list-item" v-for="(item, index) in info.chapterList" :key="index"
+					:class="{ active: index === videoIndex }" @click="classesClick(index)">
+					<view>{{ index + 1 }}</view>
+					<view>{{ item.flag === 2 ? '已学' : item.finishPercent + '%' }}</view>
+				</view>
+			</view>
+		</view>
+		<view class="details-line" v-if="info.isComments && Number(info.isComments) === 1">
+			<view></view>
+		</view>
+		<!-- 评论 -->
+		<view class="details-comment" v-if="info.isComments && Number(info.isComments) === 1">
+			<view class="details-comment-header">
+				<view>课程评论</view>
+				<view>共{{ total || 0 }}条评论</view>
+			</view>
+			<view class="details-comment-list">
+				<view class="details-comment-list-item" v-for="(item, index) in commentList" :key="index">
+					<view class="left">
+						<u-avatar :src="item.createByAvatar" size="96" mode="square"></u-avatar>
+					</view>
+					<view class="right">
+						<view>{{ item.createBy }}</view>
+						<view>
+							<u-rate :count="5" size="28" disabled="" active-color="#FFBC00" v-model="item.starLevel">
+							</u-rate>
+							<text>{{ item.createTime }}</text>
+						</view>
+						<view>{{ item.content }}</view>
+					</view>
+				</view>
+			</view>
+			<view class="details-comment-page" v-if="total">
+				<wyb-pagination :padding="0" :totalItems="total" :current="query.pageNum" @change="pageChange" />
+			</view>
+			<view class="details-comment-mine"><text>我的评论</text></view>
+			<view class="details-comment-conent">
+				<view class="details-comment-conent-star">
+					<u-rate :count="5" size="40" active-color="#FFBC00" v-model="form.starLevel"></u-rate>
+				</view>
+				<view class="details-comment-content-textarea">
+					<u-input v-model="form.content" placeholder="请输入您的评价" type="textarea"
+						:custom-style="{ backgroundColor: '#F5F5F5', padding: '30rpx', borderRadius: '10rpx', minHeight: '280rpx' }">
+					</u-input>
+				</view>
+				<view class="details-comment-conent-button" @click="submitCommet">提交</view>
+			</view>
+		</view>
+		<u-toast ref="uToast" />
+	</view>
 </template>
 
 <script>
-export default {
-  data() {
-    return {
-      info: {},
-      videoInfo: {},
-      videoIndex: 0,
-      classesId: '',
-      isPlay: true,
-      query: {
-        pageNum: 1,
-        pageSize: 5,
-        tabId: ''
-      },
-      total: 0,
-      commentList: [],
-      form: {
-        tabId: '',
-        starLevel: 0,
-        content: ''
-      },
-      isApply: 1
-    };
-  },
-  onLoad(page) {
-    if (page.id) {
-      this.getClassesDetails(page.id);
-      this.classesId = page.id;
-      this.query.tabId = this.classesId;
-      this.form.tabId = this.classesId;
-      this.isApply = page.isApply || 1;
-    }
-  },
-  beforeDestroy() {
-    this.$refs['videoBox'].recordDuration(this.videoIndex, false);
-  },
-  methods: {
-    /**
-     * 获取课程详情
-     * @param {Object} id
-     */
-    getClassesDetails(id) {
-      this.videoInfo.videoUrl = null;
-      this.$u.api.school
-        .getPackageCourseDetail({
-          id
-        })
-        .then((res) => {
-          if (res.code === 200) {
-            this.info = res.data;
-            this.videoInfo = res.data.chapterList[this.videoIndex];
-            this.query.pageNum = 1;
-            this.isPlay = true;
-            this.$nextTick(() => {
-              this.$refs['videoBox'].loadVideo(this.videoInfo);
-            });
-            this.getCommentList();
-          }
-        });
-    },
-    /**
-     * 课程章节点击
-     * @param {Object} index
-     */
-    classesClick(index) {
-      this.$refs['videoBox'].recordDuration(index, true);
-      this.videoIndex = index;
-      this.isPlay = false;
-    },
-    /**
-     * 描述
-     * @date 2022-10-19
-     * @param {any} obj
-     * @param {any} index
-     * @returns {any}
-     */
-    recordDuration(obj, index, refresh = true) {
-      if (Number(this.isApply) === 1) {
-        this.submitTimeLong(
-          { tabId: this.videoInfo.id, playDuration: obj.playDuration, currentDuration: obj.currentDuration, duration: obj.duration },
-          index || this.videoIndex,
-          refresh
-        );
-      } else {
-        if (refresh) {
-          this.videoInfo = this.info.chapterList[index];
-          this.getClassesDetails(this.classesId);
-        }
-      }
-    },
-    /**
-     * 提交课程时长
-     */
-    submitTimeLong({ tabId, playDuration, currentDuration, duration }, index, refresh) {
-      if (tabId) {
-        this.$u.api.training
-          .videoTimeLongApi({
-            tabId,
-            playDuration,
-            currentDuration,
-            duration
-          })
-          .then((res) => {
-            if (res.code === 200) {
-              this.videoInfo = this.info.chapterList[index];
-              if (refresh) {
-                this.$refs.uToast.show({
-                  title: '已记录章节时长!',
-                  type: 'success'
-                });
-                this.getClassesDetails(this.classesId);
-              }
-            } else {
-              this.$refs.uToast.show({
-                title: res.msg,
-                type: 'error'
-              });
-            }
-          });
-      }
-    },
-    /**
-     * 获取评论列表
-     */
-    getCommentList() {
-      if (this.query.tabId) {
-        this.$u.api.training.getClassesCommentApi(this.query).then((res) => {
-          if (res.code === 200) {
-            this.total = Number(res.total);
-            this.commentList = res.rows;
-          }
-        });
-      }
-    },
-    /**
-     * @param {Object} e 分页触发
-     */
-    pageChange(e) {
-      this.query.pageNum = e.current;
-      this.getCommentList();
-    },
-    /**
-     * 提交评论
-     */
-    submitCommet() {
-      if (this.form.tabId) {
-        if (this.form.starLevel && this.form.content) {
-          this.$u.api.training.addClassesCommentApi(this.form).then((res) => {
-            if (res.code === 200) {
-              this.$refs.uToast.show({
-                title: '评论成功!',
-                type: 'success'
-              });
-              this.form.content = '';
-              this.form.starLevel = 0;
-              this.getCommentList();
-            } else {
-              this.$refs.uToast.show({
-                title: res.msg,
-                type: 'error'
-              });
-            }
-          });
-        }
-        if (!this.form.starLevel) {
-          this.$refs.uToast.show({
-            title: '请选择星级',
-            type: 'warning'
-          });
-        }
-        if (!this.form.content) {
-          this.$refs.uToast.show({
-            title: '请输入评论内容',
-            type: 'warning'
-          });
-        }
-      } else {
-        this.$refs.uToast.show({
-          title: '未找到课程章节,无法提交评论!',
-          type: 'warning'
-        });
-      }
-    }
-  }
-};
+	export default {
+		data() {
+			return {
+				info: {},
+				videoInfo: {},
+				videoIndex: 0,
+				classesId: '',
+				isPlay: true,
+				query: {
+					pageNum: 1,
+					pageSize: 5,
+					tabId: ''
+				},
+				total: 0,
+				commentList: [],
+				form: {
+					tabId: '',
+					starLevel: 0,
+					content: ''
+				},
+				isApply: 1
+			};
+		},
+		onLoad(page) {
+			if (page.id) {
+				this.getClassesDetails(page.id);
+				this.classesId = page.id;
+				this.query.tabId = this.classesId;
+				this.form.tabId = this.classesId;
+				this.isApply = page.isApply || 1;
+			}
+		},
+		beforeDestroy() {
+			this.$refs['videoBox'].recordDuration(this.videoIndex, false);
+		},
+		methods: {
+			/**
+			 * 获取课程详情
+			 * @param {Object} id
+			 */
+			getClassesDetails(id) {
+				this.videoInfo.videoUrl = null;
+				this.$u.api.school
+					.getPackageCourseDetail({
+						id
+					})
+					.then((res) => {
+						if (res.code === 200) {
+							this.info = res.data;
+							this.videoInfo = res.data.chapterList[this.videoIndex];
+							this.query.pageNum = 1;
+							this.isPlay = true;
+							this.$nextTick(() => {
+								this.$refs['videoBox'].loadVideo(this.videoInfo);
+							});
+							if (res.data.isComments && Number(res.data.isComments) === 1) this.getCommentList();
+						}
+					});
+			},
+			/**
+			 * 课程章节点击
+			 * @param {Object} index
+			 */
+			classesClick(index) {
+				this.$refs['videoBox'].recordDuration(index, true);
+				this.videoIndex = index;
+				this.isPlay = false;
+			},
+			/**
+			 * 描述
+			 * @date 2022-10-19
+			 * @param {any} obj
+			 * @param {any} index
+			 * @returns {any}
+			 */
+			recordDuration(obj, index, refresh = true) {
+				if (Number(this.isApply) === 1) {
+					this.submitTimeLong({
+							tabId: this.videoInfo.id,
+							playDuration: obj.playDuration,
+							currentDuration: obj.currentDuration,
+							duration: obj.duration
+						},
+						index || this.videoIndex,
+						refresh
+					);
+				} else {
+					if (refresh) {
+						this.videoInfo = this.info.chapterList[index];
+						this.getClassesDetails(this.classesId);
+					}
+				}
+			},
+			/**
+			 * 提交课程时长
+			 */
+			submitTimeLong({
+				tabId,
+				playDuration,
+				currentDuration,
+				duration
+			}, index, refresh) {
+				if (tabId) {
+					this.$u.api.training
+						.videoTimeLongApi({
+							tabId,
+							playDuration,
+							currentDuration,
+							duration
+						})
+						.then((res) => {
+							if (res.code === 200) {
+								this.videoInfo = this.info.chapterList[index];
+								if (refresh) {
+									this.$refs.uToast.show({
+										title: '已记录章节时长!',
+										type: 'success'
+									});
+									this.getClassesDetails(this.classesId);
+								}
+							} else {
+								this.$refs.uToast.show({
+									title: res.msg,
+									type: 'error'
+								});
+							}
+						});
+				}
+			},
+			/**
+			 * 获取评论列表
+			 */
+			getCommentList() {
+				if (this.query.tabId) {
+					this.$u.api.training.getClassesCommentApi(this.query).then((res) => {
+						if (res.code === 200) {
+							this.total = Number(res.total);
+							this.commentList = res.rows;
+						}
+					});
+				}
+			},
+			/**
+			 * @param {Object} e 分页触发
+			 */
+			pageChange(e) {
+				this.query.pageNum = e.current;
+				this.getCommentList();
+			},
+			/**
+			 * 提交评论
+			 */
+			submitCommet() {
+				if (this.form.tabId) {
+					if (this.form.starLevel && this.form.content) {
+						this.$u.api.training.addClassesCommentApi(this.form).then((res) => {
+							if (res.code === 200) {
+								this.$refs.uToast.show({
+									title: '评论成功!',
+									type: 'success'
+								});
+								this.form.content = '';
+								this.form.starLevel = 0;
+								this.getCommentList();
+							} else {
+								this.$refs.uToast.show({
+									title: res.msg,
+									type: 'error'
+								});
+							}
+						});
+					}
+					if (!this.form.starLevel) {
+						this.$refs.uToast.show({
+							title: '请选择星级',
+							type: 'warning'
+						});
+					}
+					if (!this.form.content) {
+						this.$refs.uToast.show({
+							title: '请输入评论内容',
+							type: 'warning'
+						});
+					}
+				} else {
+					this.$refs.uToast.show({
+						title: '未找到课程章节,无法提交评论!',
+						type: 'warning'
+					});
+				}
+			}
+		}
+	};
 </script>
 
 <style lang="scss" scoped>
-@import './courseDetailed.scss';
+	@import './courseDetailed.scss';
 </style>