Ver código fonte

0908版本 加上字体控制

ssfg 4 anos atrás
pai
commit
4f5a7dd782

+ 5 - 1
app.wxss

@@ -1,4 +1,5 @@
 /**app.wxss**/
+@import "./fonts/SourceHanSansCN-Medium.wxss";
 .container {
   width: 100%;
   margin-top: 20rpx;
@@ -7,5 +8,8 @@
   justify-content: space-between;
   box-sizing: border-box;
   position: relative;
+  /* font-family: "宋体" */
 } 
-
+page{
+  font-family: "SourceHanSansCN-Medium"
+}

Diferenças do arquivo suprimidas por serem muito extensas
+ 11 - 0
fonts/SourceHanSansCN-Medium.wxss


+ 36 - 55
pages/dbDetails/dbDetails.js

@@ -99,16 +99,16 @@ Page({
     })
     if (netStatus != 'wifi' && !this.data.isAgree) {
       this.data.videoContext.pause()
-        this.setData({
-          showChange: false
-        })
+      this.setData({
+        showChange: false
+      })
     }
     wx.onNetworkStatusChange((res) => {
       if (this.data.networkType == "wifi" && res.networkType != "wifi" && !this.data.isAgree) {
         this.data.videoContext.pause()
-          this.setData({
-            showChange: false
-          })
+        this.setData({
+          showChange: false
+        })
       }
     })
   },
@@ -192,7 +192,6 @@ Page({
   timeUpdate: function (e) {
     let _this = this;
     let currentTime = parseInt(e.detail.currentTime) //当前播放秒数
-    console.log(currentTime)
     if (currentTime != 0 && currentTime % 300 == 0) {
       if (currentTime != this.data.spanTime) {
         this.setData({
@@ -205,20 +204,22 @@ Page({
     let studyTime = 'studyLog.studyTime'
     //实时给页面的学习记录赋值
     let jump_time = parseInt(_this.data.video_real_time); //定义跳转的时间
-    if (this.data.studyLog.isStudyDone != 1) {
+    if (_this.data.studyLog.isDone != 1) {
       if (currentTime > jump_time && currentTime - jump_time > 3 && currentTime > _this.data.playVideoDuration) {
         _this.data.videoContext.seek(_this.data.playVideoDuration)
-        this.setData({
+        if (_this.data.video_real_time > 0) {
+          wx.showToast({
+            title: '该视频不可以快进哦!',
+            icon: 'none',
+            duration: 2000,
+          })
+        }
+        _this.setData({
           video_real_time: _this.data.playVideoDuration, //实时播放进度
         })
-        wx.showToast({
-          title: '该视频不可以快进哦!',
-          icon: 'none',
-          duration: 2000,
-        })
       }
       if (currentTime > jump_time && currentTime - jump_time < 3 && currentTime > _this.data.playVideoDuration) {
-        this.setData({
+        _this.setData({
           playVideoDuration: currentTime,
           [studyTime]: currentTime
         })
@@ -264,9 +265,6 @@ Page({
   },
   onUnload() {
     let _this = this;
-    console.log(_this.data.studyLog.isDone, typeof (_this.data.studyLog.isDone))
-    console.log(_this.data.studyLog.studyTime)
-    console.log(_this.data.playVideoDuration)
     if (_this.data.studyLog.isDone != '1') {
       if (this.data.video_real_time > this.data.courseTime / 1000 - 10) {
         let isDone = 'studyLog.isDone'
@@ -275,31 +273,21 @@ Page({
         })
       }
     }
-    // clearInterval(_this.data.intervalCtx)
     if (_this.data.classInfo.id != -1) {
-      let stydyrecord = _this.data.playVideoDuration;
-      if (stydyrecord == null) {
-        stydyrecord == 0
-      }
-      if (_this.data.studyLog.studyTime > stydyrecord) {
-        wx.request({
-          method: "post",
-          url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
-          data: {
-            studyLog: _this.data.studyLog
-          },
-          success: (e) => {
-            console.log(e, "我修改进度成功了")
-          }
-        })
-      }
+      wx.request({
+        method: "post",
+        url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
+        data: {
+          studyLog: _this.data.studyLog
+        },
+        success: (e) => {
+          console.log(e, "我修改进度成功了")
+        }
+      })
     }
   },
   onHide() {
     let _this = this;
-    console.log(_this.data.studyLog.isDone)
-    console.log(_this.data.studyLog.studyTime)
-    console.log(_this.data.playVideoDuration)
     if (_this.data.studyLog.isDone != '1') {
       if (this.data.video_real_time > this.data.courseTime / 1000 - 10) {
         let isDone = 'studyLog.isDone'
@@ -308,24 +296,17 @@ Page({
         })
       }
     }
-    // clearInterval(_this.data.intervalCtx)
     if (_this.data.classInfo.id != -1) {
-      let stydyrecord = _this.data.playVideoDuration;
-      if (stydyrecord == null) {
-        stydyrecord == 0
-      }
-      if (_this.data.studyLog.studyTime > stydyrecord) {
-        wx.request({
-          method: "post",
-          url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
-          data: {
-            studyLog: _this.data.studyLog
-          },
-          success: (e) => {
-            console.log(e, "我修改进度成功了")
-          }
-        })
-      }
+      wx.request({
+        method: "post",
+        url: app.globalData.publicUrl + '/wx/course/updateStudyLog',
+        data: {
+          studyLog: _this.data.studyLog
+        },
+        success: (e) => {
+          console.log(e, "我修改进度成功了")
+        }
+      })
     }
   },
   // 获取当前网络状态

+ 1 - 1
pages/dbDetails/dbDetails.wxml

@@ -2,7 +2,7 @@
 	<video style="z-index:1" src="{{url}}" initial-time="{{playVideoDuration}}" bindplay="bindplay" bindpause="bindpause" enable-auto-rotation="true" binderror="videoErrorCallback" bindtimeupdate="timeUpdate" bindfullscreenchange="fullScreenChange" show-play-btn="ture" show-mute-btn="true" controls bindended="chechEndStatus" id="myVideo">
 		<view hidden="{{showWW}}">
 			<image class="{{fullScreen?'rsww1':'rsww'}}" src="https://oss-sz2-1254259530.cos.ap-beijing.myqcloud.com/%E4%BA%BA%E5%8F%82%E5%A8%83%E5%A8%83.png" bindtap="startbf"></image>
-			<view class="{{fullScreen?'text1':'text'}}" style="z-index:9999" bindtap="startbf">学习累了么?不要溜号呦,点我继续学习吧!</view>
+			<view class="{{fullScreen?'text1':'text'}}" bindtap="startbf">学习累了么?不要溜号呦,点我继续学习吧!</view>
 		</view>
 		<!-- <view hidden="{{showChange}}">
 			<image src="https://bucketnj1-1254259530.cos.ap-nanjing.myqcloud.com/netChange.png" class="{{fullScreen?'change_box1':'change_box'}}"></image>

+ 4 - 4
pages/dbDetails/dbDetails.wxss

@@ -142,8 +142,8 @@
 }
 .btn2 {
   width: 200rpx;
-  height: 57rpx;
-  line-height: 57rpx;
+  height: 50rpx;
+  line-height: 50rpx;
   border-radius: 40rpx;
   font-size: 29rpx;
   font-weight: 600;
@@ -197,7 +197,7 @@
   line-height: 40rpx;
   overflow: auto;
   white-space: normal;
-  z-index: 999;
+  z-index: 3;
 }
 .text1{
   color: #000;
@@ -210,7 +210,7 @@
   line-height: 40rpx;
   overflow: auto;
   white-space: normal;
-  z-index: 999;
+  z-index: 3;
 }
 page {
   background-color: #f2f2f2;

+ 13 - 11
pages/myClass/myClass.js

@@ -858,23 +858,25 @@ Page({
     this.setData({
       myCanvasId: this.data.myCanvasId + 1
     })
-    let str = this.data.studentName + "同志于" + this.data.classInfo.beginDate + " 至 " + this.data.classInfo.endDate + "参加学习完成规定培训内容。"
-    let str1 = '准予结业,特发此证。'
-    let strArr = [];
-    let a = str.slice(0, 17);
-    let b = str.slice(17, 36);
-    let c = str.slice(36, 56);
-    strArr.push(a, b, c);
+    let str = this.data.studentName + "同志:"
+    let str1 = "于" + this.data.classInfo.beginDate + "至" + this.data.classInfo.endDate + "参加学习" + this.data.classInfo.clasName + "完成规定培训内容。准予结业,特发此证。"
+    let strArr1 = [];
+    let a = str1.slice(0, 22);
+    let b = str1.slice(22, 37);
+    let c = str1.slice(37, 52);
+    let d = str1.slice(52, 67);
+    strArr1.push(a, b, c, d);
     const ctx = wx.createCanvasContext(this.data.myCanvasId);
     ctx.drawImage(this.data.byzsbj, 0, 0, 300, 415); //里面的参数无非就是图片放置的位置即图片的横纵坐标,图片的宽高
     ctx.setFillStyle("#000");
-    ctx.setFontSize(16); //字大小
+    ctx.setFontSize(15); //字大小
+    ctx.font = 'normal bold 15px sans-serif'
     ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
     let leftPositionAarr = [60, 30, 30, 30]
-    for (let i = 0; i < strArr.length; i++) {
-      ctx.fillText(strArr[i], leftPositionAarr[i], 160 + i * 30);
+    ctx.fillText(str, 30, 160);
+    for (let i = 0; i < strArr1.length; i++) {
+      ctx.fillText(strArr1[i], leftPositionAarr[i], 190 + i * 30);
     }
-    ctx.fillText(str1, 60, 250);
     ctx.draw();
     wx.hideLoading();
     this.setData({

+ 3 - 3
pages/myClass/myClass.wxml

@@ -53,7 +53,7 @@
 		<view class="layout_text2" wx:else>去填写</view>
 	</view>
 	<view class="introuduce">
-		<view bindtap="toAdd1">学院介绍</view>|
+		<view bindtap="toAdd1" class="one">学院介绍</view>|
 		<view bindtap="toAdd2">学员名单</view>|
 		<view bindtap="toAdd3">项目组名单</view>
 	</view>
@@ -108,8 +108,8 @@
 		<view class="lq_btn" bindtap="lq">领取结业证</view>
 		<view class="pz">注:领取结业证需完成所有课程</view>
 	</view>
-	<view wx:if="{{ showzs }}" style="position:fixed;bottom:0;height:100vh;width:100%;background-color:rgba(13,13,13,0.7)">
-		<canvas canvas-id="{{myCanvasId}}" style="width:300px;height:415px;margin:100rpx auto 30rpx auto"></canvas>
+	<view wx:if="{{ showzs }}" catchtouchmove='true' style="position:fixed;bottom:0;height:100vh;width:100%;background-color:rgba(13,13,13,0.7)">
+		<canvas canvas-id="{{myCanvasId}}" style="width:300px;height:415px;margin:100rpx auto 30rpx auto;"></canvas>
 		<button bindtap="saveZs" size="mini" type="default" style="color:#000;font-size:14px;margin-left:200rpx;">保存证书</button>
 		<button bindtap="onClose1" size="mini" type="default" style="color:#000;font-size:14px;margin-left:20rpx;">关闭证书</button>
 	</view>

+ 7 - 1
pages/myClass/myClass.wxss

@@ -1,3 +1,7 @@
+/* @import "../../fonts/SourceHanSansCN-Medium.wxss";
+page{
+  font-family: "SourceHanSansCN-Medium"
+} */
 .nr_box {
   width: 670rpx;
   height: 90vh;
@@ -5,7 +9,9 @@
   text-align: left;
   position: relative;
 }
-
+.one{
+  font-family: fantasy;
+}
 .title {
   margin-left: 245rpx;
   padding-top: 30rpx;

+ 13 - 11
pages/myMission/myMission.js

@@ -715,23 +715,25 @@ Page({
     this.setData({
       myCanvasId: this.data.myCanvasId + 1
     })
-    let str = this.data.studentName + "同志于" + this.data.classInfo.beginDate + " 至 " + this.data.classInfo.endDate + "参加学习完成规定培训内容。"
-    let str1 = '准予结业,特发此证。'
-    let strArr = [];
-    let a = str.slice(0, 17);
-    let b = str.slice(17, 36);
-    let c = str.slice(36, 56);
-    strArr.push(a, b, c);
+    let str = this.data.studentName + "同志:"
+    let str1 = "于" + this.data.classInfo.beginDate + "至" + this.data.classInfo.endDate + "参加学习" + this.data.classInfo.clasName + "完成规定培训内容。准予结业,特发此证。"
+    let strArr1 = [];
+    let a = str1.slice(0, 22);
+    let b = str1.slice(22, 37);
+    let c = str1.slice(37, 52);
+    let d = str1.slice(52, 67);
+    strArr1.push(a, b, c, d);
     const ctx = wx.createCanvasContext(this.data.myCanvasId);
     ctx.drawImage(this.data.byzsbj, 0, 0, 300, 415); //里面的参数无非就是图片放置的位置即图片的横纵坐标,图片的宽高
     ctx.setFillStyle("#000");
-    ctx.setFontSize(16); //字大小
+    ctx.setFontSize(15); //字大小
+    ctx.font = 'normal bold 15px sans-serif'
     ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
     let leftPositionAarr = [60, 30, 30, 30]
-    for (let i = 0; i < strArr.length; i++) {
-      ctx.fillText(strArr[i], leftPositionAarr[i], 160 + i * 30);
+    ctx.fillText(str, 30, 160);
+    for (let i = 0; i < strArr1.length; i++) {
+      ctx.fillText(strArr1[i], leftPositionAarr[i], 190 + i * 30);
     }
-    ctx.fillText(str1, 60, 250);
     ctx.draw();
     wx.hideLoading();
     this.setData({

+ 1 - 1
pages/myMission/myMission.wxml

@@ -103,7 +103,7 @@
 		<view class="lq_btn" bindtap="lq">领取结业证</view>
 		<view class="pz">注:领取结业证需完成所有课程</view>
 	</view>
-	<view wx:if="{{ showzs }}" style="position:fixed;bottom:0;height:100vh;width:100%;background-color:rgba(13,13,13,0.7)">
+	<view wx:if="{{ showzs }}" catchtouchmove='true' style="position:fixed;bottom:0;height:100vh;width:100%;background-color:rgba(13,13,13,0.7)">
 		<canvas canvas-id="{{myCanvasId}}" style="width:300px;height:415px;margin:100rpx auto 30rpx auto"></canvas>
 		<button bindtap="saveZs" size="mini" type="default" style="color:#000;font-size:14px;margin-left:200rpx;">保存证书</button>
 		<button bindtap="onClose1" size="mini" type="default" style="color:#000;font-size:14px;margin-left:20rpx;">关闭证书</button>

+ 2 - 2
utils/util.js

@@ -1,6 +1,6 @@
 const globalData = {
-  publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
-  // publicUrl: 'https://sqpx.jiaxintech.com'//正式地址
+  // publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
+  publicUrl: 'https://sqpx.jiaxintech.com'//正式地址
   // publicUrl:'http://10.16.10.139'//ly
   // publicUrl:'http://10.16.4.19:80'//hyb
   //  publicUrl:'http://10.16.4.26:80'//zxq