tanyanfei пре 3 месеци
родитељ
комит
35fdb225cb

+ 4 - 1
app.json

@@ -1,16 +1,19 @@
 {
   "pages": [
     "pages/index/index",
+    "pages/apply/apply",
+    
     "pages/mine/mine",
     "pages/classHour/classHour",
     "pages/onlinePost/onlinePost",
     "pages/web/web",
     "pages/user/user",
     "pages/online/online",
+    "pages/clocklist/clocklist",
     "pages/plan/plan",
     "pages/pay/pay",
     "pages/intro/intro",
-    "pages/apply/apply",
+    
     "pages/post/post",
     "pages/upload/upload",
     "pages/download/download",

+ 1 - 1
pages/apply/apply.wxml

@@ -52,7 +52,7 @@
             <text style="color:#999;margin-top:12px;">{{item.ctime}}</text>
         </view>
         <view  data-id='{{item.id}}' catchtap="pay" wx:if="{{item.order_status == 1}}" class="study">立即支付</view>
-        <navigator url="../online/online?id={{item.id}}" wx:if="{{item.order_status == 2}}" class="study">立即学习</navigator>
+        <navigator url="../online/online?id={{item.id}}&class_id={{item.class_id}}" wx:if="{{item.order_status == 2}}" class="study">立即学习</navigator>
     </navigator>
     <!-- <view bindtap="downloadInvoice" class="downloadInvoice">点击下载电子发票</view> -->
 </block>

+ 91 - 0
pages/clocklist/clocklist.js

@@ -0,0 +1,91 @@
+// pages/clocklist/clocklist.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+    this.setData({
+      openid: app.globalData.openid
+    })
+    // options.id='64596'
+    wx.request({
+      url: host+'/api/wx/clockin/list',
+      method:'GET',
+      header: {
+        openid: this.data.openid
+      },
+      data:{
+        order_id:options.id
+      },
+      success:res=>{
+          this.setData({
+            list:res.data.data
+          })
+      }
+    })
+  },
+  preview(e){
+    wx.previewImage({
+      urls: [e.target.dataset.url],
+      current:e.target.dataset.url
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 3 - 0
pages/clocklist/clocklist.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "打卡记录"
+}

+ 6 - 0
pages/clocklist/clocklist.wxml

@@ -0,0 +1,6 @@
+<view wx:for="{{list}}">
+  <image bindtap="preview" data-url='{{item.img}}' mode="widthFix" src="{{item.img}}"></image>
+  <text>打卡时间:{{item.ctime}}</text>
+</view>
+
+<view wx:if="{{list.length<=0}}" style="text-align: center;">暂无打卡记录</view>

+ 12 - 0
pages/clocklist/clocklist.wxss

@@ -0,0 +1,12 @@
+/* pages/clocklist/clocklist.wxss */
+view{
+  padding: 20rpx;
+}
+image{
+  width: 100%;
+  border-radius: 10rpx;
+}
+text{
+  display: block;
+  margin-top: 20rpx;
+}

+ 79 - 2
pages/online/online.js

@@ -1,6 +1,7 @@
 // pages/online/online.js
 const app = getApp()
 const host = app.globalData.host;
+
 Page({
 
   /**
@@ -14,7 +15,9 @@ Page({
     videos:[],
     show:0,
     video_ids: [],
-    paper_ids: []
+    paper_ids: [],
+    array1:['特种作业'],
+    index1:0
   },
 
   /**
@@ -23,7 +26,8 @@ Page({
   onLoad: function (options) {
     if (options.id){
       this.setData({
-        signup_id: options.id
+        signup_id: options.id,
+        class_id: options.class_id
       })
     }
     this.setData({
@@ -35,12 +39,85 @@ Page({
       })
     }
     this.getData();
+    this.getClockStatus()
   },
   tabChange:function(e){
     this.setData({
       tab:e.target.dataset.id
     })
   },
+  getClockStatus:function(){
+    var that=this
+    wx.request({
+      url: host+'/api/wx/clockin/status',
+      method:'GET',
+      header: {
+        openid: this.data.openid
+      },
+      data:{
+        class_id:this.data.class_id,
+        order_id:this.data.signup_id
+      },
+      success:res=>{
+        if(!res.data.data){
+          wx.showModal({
+            title: '提示',
+            content: '你今天尚未打开,请拍照打卡!',
+            showCancel:false,
+            confirmText:'立即打卡',
+            success (res) {
+              wx.chooseMedia({
+                count: 1,
+                mediaType: ['image'],
+                sourceType: ['album', 'camera'],
+                camera: 'back',
+                success(res) {
+                  wx.showLoading({
+                    title: '正在打卡...',
+                  })
+                  wx.uploadFile({
+                      url: host+'/api/wx/uploadfile',
+                      filePath: res.tempFiles[0].tempFilePath,
+                      name: 'file',
+                      formData: {
+                        'file': res.tempFiles[0].tempFilePath
+                      },
+                      success:res=>{
+                        var data=JSON.parse(res.data)
+                        that.setData({
+                          img:data.data.url
+                        })
+                        that.getClock()
+                      }
+                    })
+                }
+              })
+            }
+          })
+        }
+      }
+    })
+  },
+  getClock:function(){
+    wx.request({
+      url: host+'/api/wx/clockin',
+      method:'POST',
+      header: {
+        openid: this.data.openid
+      },
+      data:{
+        class_id:this.data.class_id,
+        order_id:this.data.signup_id,
+        img:this.data.img
+      },
+      success:res=>{
+        wx.hideLoading()
+        wx.showToast({
+          title: '打卡成功',
+        })
+      }
+    })
+  },
   getData:function(){
     wx.request({
       url: host+'/api/wx/training/list',

+ 11 - 0
pages/online/online.wxml

@@ -3,6 +3,7 @@
     <text data-id='0' bindtap="tabChange" class="{{tab==0?'act':''}}">视频课程</text>
 </view>
 <view wx:if='{{tab==0}}' class="content">
+ 
   <navigator wx:for="{{videos}}" wx:key="*this" url="../video/video?title={{item.title}}&&url={{item.url}}&&time={{item.finished_time}}&id={{item.id}}" class="list">
       <view class="img">
       <image  src="{{item.image}}" mode="scaleToFill"></image>
@@ -20,6 +21,13 @@
 </view>
 
 <view  wx:if='{{tab==1}}' class="content">
+  <!-- <view class="picker_view">
+    <picker bindchange="bindPickerChange" value="{{index1}}" range="{{array1}}">
+      <view class="picker">
+        {{array1[index1]}} <image mode="widthFix" src="../../images/arrow-bottom.png"></image>
+      </view>
+    </picker>
+  </view> -->
     <navigator  class="test"  wx:for="{{papers}}" wx:key="*this" url="../subject/subject?id={{item.id}}">
         <view class="title">{{item.title}}</view>
         <text>{{item.class_hour}}学时/{{item.full_mark}}分/{{item.time_limit}}分钟</text>
@@ -30,5 +38,8 @@
         <navigator wx:else >开始练习</navigator>
     </navigator>
 </view>
+<navigator url="../clocklist/clocklist?id={{signup_id}}" style="position:fixed;bottom:100rpx;background-color: rgba(53,139,255,1);" wx:if="{{show&&signup_id}}"
+ class="complete">查看打卡记录</navigator>
+
 <view bindtap="genclasshour" style="position:fixed;bottom:20rpx;" wx:if="{{show&&signup_id}}" class="complete">已完成学习,立即生成学时证明</view>
 

+ 16 - 2
pages/online/online.wxss

@@ -1,4 +1,4 @@
-/* pages/online/online.wxss */
+  /* pages/online/online.wxss */
 page{
   background: #F4F7F9;
 }
@@ -7,6 +7,7 @@ page{
   min-height: 90vh;
   background: #fff;
   padding-bottom: 50px;
+  padding-top: 20rpx;
 }
 .tab{
   background: #fff;
@@ -156,4 +157,17 @@ page{
   bottom: 10px;
   background: #07c160;
   border-radius: 4px;
-}
+}
+
+.picker image{
+  width: 30rpx;
+  position: relative;
+  top: 5rpx;
+}
+.picker_view{
+  display: flex;
+}
+.picker_view picker{
+  width: 25%;
+  text-align: center;
+}

+ 50 - 54
project.config.json

@@ -1,56 +1,52 @@
 {
-	"description": "项目配置文件",
-	"packOptions": {
-		"ignore": []
-	},
-	"setting": {
-		"urlCheck": true,
-		"es6": true,
-		"postcss": true,
-		"preloadBackgroundData": false,
-		"minified": true,
-		"newFeature": true,
-		"coverView": true,
-		"autoAudits": false,
-		"showShadowRootInWxmlPanel": true,
-		"scopeDataCheck": false,
-		"checkInvalidKey": true,
-		"checkSiteMap": true,
-		"uploadWithSourceMap": true,
-		"babelSetting": {
-			"ignore": [],
-			"disablePlugins": [],
-			"outputPath": ""
-		},
-		"useCompilerModule": false,
-		"userConfirmedUseCompilerModuleSwitch": false
-	},
-	"compileType": "miniprogram",
-	"libVersion": "2.11.0",
-	"appid": "wxd417822087cf4573",
-	"projectname": "yifeng",
-	"debugOptions": {
-		"hidedInDevtools": []
-	},
-	"isGameTourist": false,
-	"simulatorType": "wechat",
-	"simulatorPluginLibVersion": {},
-	"condition": {
-		"search": {
-			"current": -1,
-			"list": []
-		},
-		"conversation": {
-			"current": -1,
-			"list": []
-		},
-		"game": {
-			"currentL": -1,
-			"list": []
-		},
-		"miniprogram": {
-			"current": -1,
-			"list": []
-		}
-	}
+  "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
+  "packOptions": {
+    "ignore": [],
+    "include": []
+  },
+  "setting": {
+    "urlCheck": true,
+    "es6": true,
+    "postcss": true,
+    "preloadBackgroundData": false,
+    "minified": true,
+    "newFeature": true,
+    "coverView": true,
+    "autoAudits": false,
+    "showShadowRootInWxmlPanel": true,
+    "scopeDataCheck": false,
+    "checkInvalidKey": true,
+    "checkSiteMap": true,
+    "uploadWithSourceMap": true,
+    "babelSetting": {
+      "ignore": [],
+      "disablePlugins": [],
+      "outputPath": ""
+    },
+    "useCompilerModule": false,
+    "userConfirmedUseCompilerModuleSwitch": false,
+    "lazyloadPlaceholderEnable": false,
+    "uglifyFileName": false,
+    "enhance": true,
+    "useMultiFrameRuntime": true,
+    "packNpmManually": false,
+    "packNpmRelationList": [],
+    "minifyWXSS": true,
+    "useStaticServer": true,
+    "showES6CompileOption": false,
+    "disableUseStrict": false,
+    "useCompilerPlugins": false,
+    "minifyWXML": true
+  },
+  "compileType": "miniprogram",
+  "libVersion": "2.11.0",
+  "appid": "wxd417822087cf4573",
+  "projectname": "yifeng",
+  "simulatorType": "wechat",
+  "simulatorPluginLibVersion": {},
+  "condition": {},
+  "editorSetting": {
+    "tabIndent": "insertSpaces",
+    "tabSize": 2
+  }
 }

+ 7 - 0
project.private.config.json

@@ -0,0 +1,7 @@
+{
+  "projectname": "yifeng",
+  "setting": {
+    "compileHotReLoad": true
+  },
+  "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html"
+}

Разлика између датотеке није приказан због своје велике величине
+ 2 - 0
utils/hls.js@latest