tanyanfei 4 years ago
parent
commit
28961d1ec1
3 changed files with 21 additions and 6 deletions
  1. 2 2
      app.json
  2. 15 0
      pages/online/online.js
  3. 4 4
      pages/online/online.wxml

+ 2 - 2
app.json

@@ -1,9 +1,9 @@
 {
   "pages":[ 
-    
+    "pages/online/online",
     "pages/index/index",
     "pages/user/user",
-    "pages/online/online",
+    
     "pages/plan/plan",
     "pages/pay/pay",
     "pages/apply/apply",

+ 15 - 0
pages/online/online.js

@@ -65,6 +65,21 @@ Page({
       }
     })
   },
+  genclasshour:function(){
+    wx.request({
+      url: host+'/api/wx/genclasshour',
+      method:'POST',
+      header: {
+        openid: app.globalData.openid
+      },
+      success:res=>{
+        wx.previewImage({
+          current: res.data.data.url, // 当前显示图片的http链接
+          urls: [res.data.data.url] // 需要预览的图片http链接列表
+        })
+      }
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 4 - 4
pages/online/online.wxml

@@ -19,15 +19,15 @@
 </view>
 
 <view  wx:if='{{tab==1}}' class="content">
-    <view class="test"  wx:for="{{papers}}" wx:key="*this">
+    <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>
         <view class="score" wx:if='{{item.status == 1}}'>
             <image  src="../../images/score.png" mode="widthFix"></image> <text>  {{item.mark}}分</text>
             <image src="../../images/gou.png" mode="widthFix"></image>  已完成
         </view> 
-        <navigator wx:else url="../subject/subject?id={{item.id}}">开始练习</navigator>
-    </view>
+        <navigator wx:else >开始练习</navigator>
+    </navigator>
 </view>
-<view style="position:fixed;bottom:20rpx;" wx:if="{{show}}" class="complete">已完成学习,立即生成学时证明</view>
+<view bindtap="genclasshour" style="position:fixed;bottom:20rpx;" wx:if="{{show}}" class="complete">已完成学习,立即生成学时证明</view>