4 次代碼提交 f78a1663f8 ... 39656f8de0

作者 SHA1 備註 提交日期
  y595705120 39656f8de0 STUDY 2 月之前
  y595705120 f78a1663f8 Merge branch 'master' of http://git.ndjsxh.cn:10080/ndjsxh/study_wxapp 2 月之前
  y595705120 d12e645a1f 去除多余依赖 2 月之前
  y595705120 6bcad0526c 互踢 5 月之前

+ 1 - 7
app.js

@@ -57,9 +57,6 @@ App({
     let _this = this
     let openid = wx.getStorageSync('@openid');
     if( !openid ) {
-      wx.navigateTo({
-        url: `/pages/user/identify/index`,
-      })
       return
     }
     let param = {"openid": openid};
@@ -179,10 +176,7 @@ App({
     if( userInfo.openid ){
       console.log("@openid", userInfo.openid)
       wx.setStorageSync('@openid', userInfo.openid )
-      wx.setStorageSync('@user', userInfo )
-    }else{
-      wx.clearStorageSync("@openid")
-      wx.clearStorageSync("@user")
     }
+    wx.setStorageSync('@user', userInfo )
   }
 })

+ 13 - 7
app.json

@@ -2,20 +2,20 @@
   "pages": [
     "pages/index/index",
     "pages/train/orderTest/answer",
+    
     "pages/newExam/mockExam/index",
     "pages/exam/collection/index",
     "pages/newExam/home/index",
     "pages/my/index/index",
     "pages/exam/index/index",
     "pages/exam/home/index",
+    "pages/study/exam/index",
     "pages/user/identify/index",
-<<<<<<< HEAD
     "pages/study/course/index",
     "pages/study/index/index",
     "pages/study/sign/index",
     "pages/study/market/index",
-=======
->>>>>>> 6bcad0526cc12cd426186b6ef8155096e5462e6b
+    "pages/user/register/index",
     "pages/post/post",
     "pages/train/index/index",
     "pages/train/limitHome/index",
@@ -42,14 +42,20 @@
         "selectedIconPath": "/assets/tabBar/exam-select.png"
       },
       {
-        "pagePath": "pages/train/limit/index",
-        "text": "高频题库",
+        "pagePath": "pages/train/index/index",
+        "text": "岗前培训",
         "iconPath": "/assets/tabBar/record.png",
         "selectedIconPath": "/assets/tabBar/record-select.png"
       },
+      {
+        "pagePath": "pages/study/index/index",
+        "text": "继续教育",
+        "iconPath": "/assets/tabBar/study.png",
+        "selectedIconPath": "/assets/tabBar/study-select.png"
+      },
       {
         "pagePath": "pages/my/index/index",
-        "text": "个人中心",
+        "text": "我的",
         "iconPath": "/assets/tabBar/my.png",
         "selectedIconPath": "/assets/tabBar/my-select.png"
       }
@@ -57,7 +63,7 @@
   },
   "window": {
     "navigationBarBackgroundColor": "#ffffff",
-    "navigationBarTitleText": "相马君真题训练",
+    "navigationBarTitleText": "鸿锵在线教育",
     "navigationBarTextStyle": "black",
     "backgroundTextStyle": "dark"
   },

二進制
assets/null.jpg


+ 1 - 5
pages/exam/index/index.js

@@ -12,7 +12,6 @@ Page({
     code_url:'',
     info:{},
     system: "",
-    isOpen: false,
     groups: [],
     pushPaper: [],
     timeLimitPaper: [],
@@ -28,7 +27,6 @@ Page({
     })
   },
   onShow: function(){
-    console.log("onshow")
     app.checkLogin( userInfo =>{
       this.setData({userInfo})
       // 已经实名认证
@@ -47,10 +45,8 @@ Page({
     let _this = this
     app.formPost('Exam.index', {}).then(res => {
       if (res.code === 200) {
-        let isOpen = res.data.groups && res.data.groups.length >0
         _this.setData({
-          groups: res.data.groups,
-          isOpen
+          groups: res.data.groups
         });
        cb&&cb() 
       }

+ 1 - 2
pages/exam/index/index.json

@@ -5,9 +5,8 @@
     "i-cell": "/component/iView/cell/index",
     "i-message": "/component/iView/message/index",
     "i-spin": "/component/iView/spin/index",
-    "i-avatar": "/component/iView/avatar/index",
     "i-icon": "/component/iView/icon/index"
   },
   "enablePullDownRefresh": true,
-  "navigationBarTitleText": "专项练习"
+  "navigationBarTitleText": "鸿锵在线教育-在线练习"
 }

+ 41 - 10
pages/exam/index/index.wxml

@@ -14,17 +14,48 @@
     </swiper>
   </view>
   <!-- <ad unit-id="adunit-21433e65243fe5ff"></ad> -->
-  <view>
-    <view class="p20 br20">
-      <i-cell-group>
-        <i-cell wx:for="{{groups}}" data-item="item" wx:key="id" title="{{item.name}}" 
-          is-link value="进入题库" i-class="mt20 p20 br20"
-          url="/pages/exam/home/index?groupId={{item.groupId}}" 
-          label="{{item.startAt}} 到 {{item.endAt}}" />
-      </i-cell-group>
+
+  <view wx:if="{{!userInfo.identify}}" >
+    <view style="text-align:center;margin:50rpx"> 
+      <text> 您未开通在线练习业务 </text>
     </view>
-    <view wx:if="{{!isOpen}}" class="tc m20 p20">
-      <text class="tc fc">还未开通题库</text>
+    <view style="text-align:center;margin:50rpx"> 
+      <text> 实名认证后,可获得试卷 </text>
     </view>
+  
+    <navigator class="mt50" url="/pages/user/identify/index" hover-class="navigator-hover" open-type="navigate" >
+      <button class="i-btn  i-btn-primary i-btn-square" > 实名认证 </button>
+    </navigator>
+  </view>
+
+  <view wx:else>
+    <i-panel>
+      <view class="cate-section">
+        <view wx:for="{{groups}}" wx:key="groupId" class="cate-item cate-item-3">
+          <button class="cate-item" wx:if="{{item.isBuy}}" bindtap="gotoExam" data-item="{{item}}">
+            <i-icon type="browse" size="40" color="#7595f1a0" />
+            <text>{{item.title}}</text>
+          </button>
+
+          <!-- <button class="cate-item" wx:else bindtap="startWxpay" data-id="{{item.groupId}}">
+            <i-icon type="lock" size="40" color="#e96900a0" />
+            <text>{{item.title}}</text>
+          </button> -->
+
+          <button class="cate-item" wx:else open-type="contact" session-from="weapp">
+            <i-icon type="lock" size="40" color="#e96900a0" />
+            <text>{{item.title}}</text>
+          </button>
+
+        </view>
+      </view>
+    </i-panel>
   </view>
+
+  <modal title="iOS端暂不支持虚拟支付业务" confirm-text="保存图片" hidden="{{!buyModel}}" no-cancel="true" bindconfirm="downloadFile">
+    <image src="{{info.code_url}}" mode="widthFix" style="width:100%"></image>
+    <view style="color:red;text-align:center;">
+      <text> IOS端暂不支持虚拟支付业务</text>
+    </view>
+  </modal>
 </view>

+ 0 - 8
pages/exam/index/index.wxss

@@ -32,12 +32,4 @@
 
 p{
   display: none;
-}
-
-.i-cell-text{
-  line-height: 32rpx;
-}
-
-.i-cell-desc{
-  line-height: 24rpx;
 }

+ 1 - 1
pages/index/index.json

@@ -8,5 +8,5 @@
     "i-icon": "/component/iView/icon/index"
   },
   "enablePullDownRefresh": true,
-  "navigationBarTitleText": "相马君新闻资讯"
+  "navigationBarTitleText": "鸿锵在线教育"
 }

+ 10 - 0
pages/index/index.wxml

@@ -17,6 +17,16 @@
   </view>
 </view>
 
+<!-- <ad unit-id="adunit-7cfbe6afa1f6b0d3"></ad> -->
+
+<!-- <view class="f-header m-t">
+  <image src="/assets/h1.png"></image>
+  <view class="tit-box">
+    <text class="tit">业务选择</text>
+    <text class="tit2">items</text>
+  </view>
+</view> -->
+
 <view>
   <i-cell-group>
       <i-cell wx:for="{{tableData}}" 

+ 4 - 1
pages/my/index/index.wxml

@@ -16,6 +16,9 @@
 
 <view>
   <i-cell-group i-class="my-group-margin">
+    <i-cell title="高频题库" is-link url="/pages/train/limit/index">
+      <i-icon type="like" slot="icon" size="20" />
+    </i-cell>
 
     <i-cell title="{{filter.phoneFormat(userInfo.phone)||'---'}}" >
       <i-icon type="mobilephone" slot="icon" size="20" />
@@ -55,7 +58,7 @@
   </i-cell-group>
 </view>
 
-<view class="copyright">相马君真题练习</view>
+<view class="copyright">宁德市建筑工程技术服务行业协会</view>
 
 <i-spin size="large" fix wx:if="{{ spinShow }}"></i-spin>
 <i-message id="message" />

+ 179 - 0
pages/study/course/index.js

@@ -0,0 +1,179 @@
+//index.js
+//获取应用实例
+const app = getApp()
+
+Page({
+  data: {
+    spinShow: false,
+    buyModel:false,
+    code_url:'',
+    system: "",
+    userInfo:{},
+    info:{},
+    onPlay: false,
+    item:{},
+    courseId:0,
+    mediaList: []
+  },
+  onLoad: function( options ){
+    let courseId = +options.courseId||35;
+    this.setData({courseId})
+    app.getSystemInfo( system=>{
+      this.setData({system})
+    })
+    // 
+  },
+  onShow: function(){
+    let courseId = this.data.courseId
+    app.checkLogin( userInfo =>{
+      this.setData({userInfo, from:0})
+      this.loadData( courseId )
+    })
+  },
+  loadData: function( courseId ) {
+    let param ={ courseId}
+    app.formPost('Study.GetWxCourseInfo', param).then(res => {
+      if( res.code == 200){
+        let {info, list} = res.data
+        wx.setNavigationBarTitle({
+          title: info.name
+        })
+        this.setData({info, mediaList: list})
+      }
+    })
+  },
+  onReady(res) {
+    this.videoContext = wx.createVideoContext('myVideo')
+  },
+  gotoExam(){
+    let courseId = this.data.courseId
+    wx.navigateTo({
+      url: `/pages/study/exam/index?courseId=${courseId}`,
+    })
+  },
+  recalcXs( ){
+    let medias = this.data.mediaList;
+    let info = this.data.info
+    let gxs = 0;
+    for( let i in medias){
+      if( medias[i].isFinish == 1){
+        gxs+= medias[i].xs
+      }
+    }
+    info.getXs = gxs
+    this.setData({info})
+  },
+  // 拖动快进
+  timeUpdate( e ){
+    let that = this;
+    let item = this.data.item
+    var position = item.position
+    var currentTime = parseInt(e.detail.currentTime)
+    if( currentTime - position < 1 || item.isFinish ){
+      return
+    }
+    // 
+    if( currentTime - position > 5 ){
+      let videoContext = wx.createVideoContext('myVideo');
+      videoContext.seek( position )
+      wx.showToast({
+        title: '未完整看完该视频,不能快进',
+        icon: 'none',
+        duration: 2000,
+      })
+      return;
+    }else{
+      item.position= currentTime
+    }
+    if( item.position - item.prev_tick > 4 || item.position == item.duration ){
+      item.prev_tick = item.position;
+      // 前一秒完成
+      if( item.prev_tick >= e.detail.duration ){
+        item.isFinish = 1
+      }
+      this.doTick( item )
+    }
+    that.setData({item})
+  },
+  doTick( item ){
+    let param = {
+      id: item.id,
+      isFinish: item.isFinish||0,
+      position: item.position,
+    }
+    let mediaList = this.data.mediaList;
+    app.formPost('study.tick', param).then( res => {
+      if( res.code == 200){
+        if( !res.data.skip ){
+          item.position = res.data.position;
+          return;
+        }
+        Object.assign( item, res.data )
+
+        mediaList[item.index] = item;
+        if( item.isFinish){
+          this.recalcXs()
+        }
+        this.setData( {item, mediaList} );
+      }
+    })
+  },
+  playMedia( e ){
+    let index = e.currentTarget.dataset.index;
+    let mediaList =  this.data.mediaList
+    let item = mediaList[index];
+    item.index = index;
+    item.prev_tick = item.position
+    wx.pageScrollTo({
+      scrollTop: 0,
+      duration: 1000
+   })
+    if( item.url ){
+      this.setData({onPlay: true, item})
+      return;
+    }
+    app.formPost('study.GetMedia', {id:item.id}).then( res => {
+      if( res.code == 200){
+        if( !res.data ) return
+        item.url = res.data
+        mediaList[index] = item;
+        this.setData({onPlay: true, item, mediaList})
+      }
+    });
+  },
+  doWxPay( data ){
+    let that = this
+    wx.requestPayment({
+      timeStamp: data.timeStamp,
+      nonceStr: data.nonceStr,
+      package: data.package, 
+      signType: data.signType,
+      paySign: data.paySign,
+      success: function (event) {
+        wx.showModal({
+          title: '支付成功',
+          showCancel: false,
+          content: '本次共支付费用¥'+(data.fee/100)+'元'+ `\n\n试卷更新可能延迟,请耐心等待`,
+          success(res) {
+            that.indexLoad()
+          }
+        })
+      }
+    })
+  },
+  startWxpay(e){
+    let groupId = +e.currentTarget.dataset.id
+    let system = this.data.system
+    app.formPost('User.PayExam', {groupId, system}).then(res => {
+      if (res.code === 200) {
+        if( res.data.payType=="free" ){
+          this.indexLoad()
+        }else if (res.data.payType=="qrcode"){
+          this.setData({info: res.data, buyModel:true})
+        }else{
+          this.doWxPay( res.data )
+        }
+      }
+    })
+  }
+})

+ 14 - 0
pages/study/course/index.json

@@ -0,0 +1,14 @@
+{
+  "usingComponents": {
+    "i-panel": "/component/iView/panel/index",
+    "i-cell-group": "/component/iView/cell-group/index",
+    "i-cell": "/component/iView/cell/index",
+    "i-message": "/component/iView/message/index",
+    "i-spin": "/component/iView/spin/index",
+    "i-icon": "/component/iView/icon/index",
+    "i-card": "/component/iView/card/index",
+    "i-avatar": "/component/iView/avatar/index"
+  },
+  "enablePullDownRefresh": true,
+  "navigationBarTitleText": "鸿鹄在线练习系统"
+}

+ 55 - 0
pages/study/course/index.wxml

@@ -0,0 +1,55 @@
+<wxs module="util" src="../../../wxs/util-fun.wxs"></wxs>
+<view>
+  <view>
+    <video id="myVideo" src="{{item.url}}" autoplay initial-time="{{item.position}}" show-fullscreen-btn
+      bindtimeupdate="timeUpdate" show-play-btn="false" show-screen-lock-button="true" object-fit="cover"
+      wx:if="{{onPlay}}"></video>
+    <image src="{{info.tb}}" mode="widthFix" style="width:100%;" wx:else />
+  </view>
+
+  <!-- <view class="tc p20 fs30">
+    <text>学时: {{info.getXs/10}}/{{info.totalXs/10}}</text>
+    <text style="margin-left:10rpx">最高分: {{info.score}}</text>
+  </view> -->
+
+  <view class="cate-section">
+
+    <view class="cate-item">
+      <i-avatar  size="40" color="#e96900a0"> {{info.getXs/10}} </i-avatar>
+      <text class="pt20">获得学时</text>
+    </view>
+
+    <view class="cate-item">
+      <i-avatar size="40" color="#e96900a0"> {{info.totalXs/10}} </i-avatar>
+      <text class="pt20">总学时</text>
+    </view>
+
+    <view class="cate-item">
+      <i-avatar  size="40" color="#e96900a0"> {{info.score}} </i-avatar>
+      <text class="pt20">最高分</text>
+    </view>
+
+    <view class="cate-item" bindtap="gotoExam">
+      <i-avatar  size="40" color="#e96900a0"> {{info.score>60?'是':'否'}} </i-avatar>
+      <text class="pt20">进入考试</text>
+    </view>
+  </view>
+
+  <view wx:for="{{mediaList}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="mt20">
+    <i-card title="{{item.name}}" bindtap="playMedia" data-index="{{index}}">
+      <view slot="content">视频学时: {{item.xs/10}}</view>
+      <view slot="footer">
+        学习进度:{{util.getPercent(item) }}%
+      </view>
+
+    </i-card>
+  </view>
+
+
+  <modal title="iOS端暂不支持虚拟支付业务" confirm-text="保存图片" hidden="{{!buyModel}}" no-cancel="true" bindconfirm="modalConfirm">
+    <image src="{{info.code_url}}" mode="widthFix" style="width:100%"></image>
+    <view style="color:red;text-align:center;">
+      <text> IOS端暂不支持虚拟支付业务</text>
+    </view>
+  </modal>
+</view>

+ 5 - 0
pages/study/course/index.wxss

@@ -0,0 +1,5 @@
+/**index.wxss**/
+
+#myVideo {
+  width: 100%;
+}

+ 141 - 0
pages/study/exam/index.js

@@ -0,0 +1,141 @@
+import {formatSeconds} from '../../../utils/util.js'
+let app = getApp()
+Page({
+  data: {
+    preList:["A","B","C", "D", "E", "F"],
+    userInfo: {},
+    modalShow: false,
+    timeOutShow: false,
+    remainTime: 0,
+    remainTimeStr: '',
+    index:0,
+    score:0,
+    useTime:0,
+    item: {index:0},
+    info: {},
+    list: [],
+  },
+  onLoad: function(options) {
+    let courseId = +options.courseId||36
+    app.checkLogin( userInfo =>{
+      this.setData({userInfo})
+      this.loadData( courseId )
+    })
+  },
+  loadData( courseId ){
+    let info = wx.getStorageSync('@examinfo')||{};
+    if( info && info.courseId == courseId){      
+      let index = info.index||0;
+      this.setData({info})
+      this.loadQuestion( index )
+      this.timeReduce()
+      return;
+    }
+    app.formPost('Course.startExam', {courseId}).then(res => {
+      if (res.code ==200) {
+        this.setData({info:res.data })
+        this.loadQuestion( 0 )
+        this.timeReduce()
+      }
+    })
+  },
+  selectquestion( e ){
+    let index = e.currentTarget.dataset.index
+    this.loadQuestion( index )
+  },
+  checkAnswer( e ){
+    let item = this.data.item;
+    let examId = this.data.index.examId;
+    if( !item.select ){
+      util.message("还未作答", 'error')
+      return;
+    }
+    let select = item.select;
+    if( item.type == 3) select = +select.join("");
+    let param = {id: item.id, examId, select}
+    app.formPost('Course.SubmitAnswer', param).then(res => {
+      this.nextAnswer( )
+    })
+  },
+  radioChange( e ){
+    let item = this.data.item
+    item.select = +e.detail.value;
+    console.log( "radioChange", item)
+    this.setData({item})
+    this.checkAnswer()
+  },
+  loadQuestion( index ) {
+    let item = this.data.info.answers[index];
+    item.index = index;
+    if( !item.title ){
+      app.formPost("course.loadAnswer", {id:item.id} ).then(res => {
+        if( res.code != 200) return;
+        Object.assign( item, res.data)
+        this.saveItem( item ) 
+      })
+    }else{
+      this.saveItem( item ) 
+    }
+  },
+  saveItem( item ){
+    let info = this.data.info;
+    info.index = item.index;
+    info.answers[ item.index] = item;
+    wx.setStorageSync('@examinfo', info)
+    console.log("item", item)
+    this.setData({item, info})
+  },
+  checkboxChange( e ){
+    let item = this.data.item
+    item.select = parseInt(e.detail.value.sort().join(''))
+    console.log( "radioChange", item)
+    this.setData({item})
+  },
+  nextAnswer(  ){
+    console.log( "next")
+    this.loadQuestion( this.data.info.index+1)
+  },
+  returnRecord(){
+    wx.navigateBack({
+      delta: 1,
+    })
+  },
+  dosubmit(e){
+    let examId = this.data.info.examId
+    app.formPost("course.FinishExam", {examId}).then(res => {
+      if (res.code == 200) {
+        let { score, useTime } = res.data;
+        this.setData({score, useTime, modalShow:true})
+        wx.setStorageSync('@examinfo', {})
+        if( this.data.timer) clearInterval(this.data.timer)
+      }
+    });
+  },
+  timeOut() {
+    clearInterval(this.data.timer)
+    this.setData({
+      timeOutShow: true
+    });
+  },
+
+  timeReduce() {
+    let _this = this
+    let  remainTime = this.data.info.duration + this.data.info.startTime - parseInt(Date.now()/1000)
+    this.setData({remainTime})
+    let timer = setInterval(function() {
+      let remainTime = _this.data.remainTime
+      if (remainTime <= 0) {
+        _this.timeOut()
+      } else {
+        _this.setData({
+          remainTime: remainTime - 1,
+          remainTimeStr: formatSeconds(remainTime),
+          doTime: _this.data.doTime + 1
+        });
+      }
+    }, 1000)
+    _this.setData({
+      timer: timer
+    });
+  }
+})

+ 14 - 0
pages/study/exam/index.json

@@ -0,0 +1,14 @@
+{
+  "usingComponents": {
+    "i-panel": "/component/iView/panel/index",
+    "i-cell-group": "/component/iView/cell-group/index",
+    "i-cell": "/component/iView/cell/index",
+    "i-input": "/component/iView/input/index",
+    "i-action-sheet": "/component/iView/action-sheet/index",
+    "i-modal": "/component/iView/modal/index",
+    "i-col": "/component/iView/col/index",
+    "i-row": "/component/iView/row/index"
+  },
+  "enablePullDownRefresh": false,
+  "navigationBarTitleText": "考试"
+}

+ 89 - 0
pages/study/exam/index.wxml

@@ -0,0 +1,89 @@
+<wxs module="filter" src="../../../wxs/exam-fun.wxs"></wxs>
+
+<view class="exam-page p10">
+
+	<view class="view-wrap">
+    <view class="exam-count-down">{{remainTimeStr}}</view>
+	</view>
+	<view class="view-wrap-hidden">
+	</view>
+	
+
+	<i-panel i-class="exam-panel-title" >
+		<i-cell-group i-class="exam-cell">
+			<!-- 单选题 -->
+			<i-cell wx:if="{{item.type==2}}">
+				<view>
+					<rich-text nodes="[单]{{item.title}}" />
+					<radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
+						<label class="radio" wx:for="{{preList}}" wx:for-item="answer" wx:key="anserIndex"
+							wx:if="{{item['answer'+(index+1)]}}">
+							<view class="radio-answer">
+								<radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}">
+									{{answer}}. {{item['answer'+(index+1)]}}
+								</radio>
+							</view>
+						</label>
+					</radio-group>
+				</view>
+			</i-cell>
+			<!-- 多选题 -->
+			<i-cell wx:if="{{item.type==3}}">
+				<view>
+					<text> [多]{{item.title}} </text>
+					<checkbox-group class="checkbox-answer" style="margin-top:10rpx" bindchange="checkboxChange">
+						<label class="checkbox" wx:for="{{preList}}" wx:key="index" wx:for-item="answer"
+							wx:if="{{item['answer'+(index+1)]}}">
+							<view class="checkbox-answer">
+								<checkbox color="#2d8cf0" value="{{index+1}}" checked="{{filter.isSelect( index+1, item.select)}}">
+									{{answer}}. {{item['answer'+(index+1)]}}
+								</checkbox>
+							</view>
+						</label>
+					</checkbox-group>
+				</view>
+			</i-cell>
+			<!-- 判断 -->
+			<i-cell wx:if="{{item.type==1}}">
+				<view>
+					<rich-text nodes="[判]{{item.title}}" />
+					<radio-group class="radio-answer" bindchange="radioChange" data-index="{{index}}">
+						<label class="radio" wx:for="{{2}}" wx:for-item="answer">
+							<view class="radio-answer">
+								<radio color="#2d8cf0" value="{{index+1}}" checked="{{item.select==index+1}}">
+									{{preList[index]}}. {{item['answer'+(index+1)]}}
+								</radio>
+							</view>
+						</label>
+					</radio-group>
+				</view>
+			</i-cell>
+		</i-cell-group>
+
+		<view class="tc">
+			<button  type="primary" size="mini" bindtap='nextAnswer'>下一题</button>
+			<button  type="primary" size="mini" bindtap='dosubmit' class="ml20">交卷</button>
+		</view>
+	</i-panel>
+</view>
+
+<view class="bg-white p20">
+	<i-row wx:for="{{10}}" wx:for-index="row">
+		<i-col  wx:for="{{5}}" wx:for-index="cell" style="float:left;width:20%;text-alignP:center">
+			<view class="item-select {{filter.isExamSelect( 5*row+cell, info)}} " 
+				bindtap="selectquestion" data-index="{{5*row+cell}}" > {{5*row+cell+1}} </view>
+		</i-col>
+	</i-row>
+</view>
+
+
+<i-modal title="考试结果" visible="{{modalShow}}" bind:ok="returnRecord" bind:cancel="returnRecord">
+	<view>我的战绩:{{score}} </view>
+</i-modal>
+
+<i-action-sheet visible="true" visible="{{timeOutShow}}" mask-closable="{{ false }}">
+	<view slot="header" style="padding: 16px">
+		<view class="exam-timeout-title">考试试卷结束,请提交试卷!</view>
+		<button class="i-btn  i-btn-primary i-btn-square"  bindtap='dosubmit'>提交</button>
+	</view>
+</i-action-sheet>

+ 88 - 0
pages/study/exam/index.wxss

@@ -0,0 +1,88 @@
+.exam-tab-view {
+  margin-top: 42px;
+}
+
+.view-wrap {
+  position: fixed;
+  width: 100%;
+  background: #fff6f6;
+  text-align: center;
+  height: 35px;
+  z-index: 999;
+}
+
+.exam-count-down {
+  font-size: 15px;
+  line-height: 35px;
+}
+
+.view-wrap-hidden {
+  height: 35px;
+}
+
+
+.xzs-load-more {
+  margin-top: 60px !important;
+}
+
+.exam-page {
+  background: white;
+}
+
+.question-answer-error {
+  background-color: #fef0f0;
+  border-color: #fde2e2;
+  color: #f56c6c;
+}
+
+.question-answer-right {
+  background-color: #f0f9eb;
+  border-color: #e1f3d8;
+  color: #67c23a;
+}
+
+.exam-clear {
+  clear: both;
+  margin-left: 20rpx;
+}
+.exam-extend-item {
+  padding: 4px;
+}
+
+.item-select{
+  padding: 10rpx !important;
+  margin: 20rpx;
+  margin-top: 10rpx;
+  text-align: center;
+  height: 50rpx;
+}
+
+.un-select{
+  width: 50rpx;
+  height: 50rpx;
+  
+  line-height: 50rpx;
+  border-radius: 100%;
+}
+
+.cur-select{
+  background: lightblue !important;
+  color:red;
+  width: 50rpx;
+  height: 50rpx;
+  font-size: 900;
+  line-height: 50rpx;
+  border-radius: 100%;
+}
+
+.is-select{
+  background: #dadada;
+  width: 50rpx;
+  height: 50rpx;
+  line-height: 50rpx;
+  border-radius: 100%;
+}
+
+.exam-cell{
+  min-height: 500rpx;
+}

+ 115 - 0
pages/study/index/index.js

@@ -0,0 +1,115 @@
+const app = getApp()
+Page({
+  data: {
+    spinShow: false,
+    buyModel:false,
+    code_url:'',
+    info:{},
+    system: "",
+    groups: [],
+    pushPaper: [],
+    timeLimitPaper: [],
+    userInfo:{},
+    from:0,
+    size: 10,
+    courseList: []
+  },
+  onLoad: function(){
+    let that = this
+    wx.getSystemInfo({
+      success: function(res) {
+        that.setData({system: res.system})
+      }
+    })
+  },
+  gotoCourse( e ){
+    let courseId = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `/pages/study/course/index?courseId=${courseId}`,
+    })
+  },
+  onShow: function () {
+    app.checkLogin( userInfo =>{
+      this.setData({userInfo, from:0})
+      this.indexLoad()
+    })
+  },
+  onPullDownRefresh() {
+    if (!this.loading) {
+      this.indexLoad( this.stopPullDownRefresh )
+    }
+  },
+  stopPullDownRefresh(){
+    wx.stopPullDownRefresh()
+  },
+  indexLoad: function( cb ) {
+    let param ={ 
+      from: this.data.from,
+      size: this.data.size,
+      type:'继续教育',
+    }
+    app.formPost('Study.GetWxCourseList', param).then(res => {
+      if (res.code === 200) {
+        this.setData({
+          from: res.data.from,
+          courseList: res.data.list,
+        });
+       cb&&cb() 
+      }
+    })
+  },
+  gotoExam:function( e ){
+    let groupId = e.currentTarget.dataset.id
+    wx.navigateTo({
+      url: `/pages/exam/do/index?id=${groupId}`
+    })
+  },
+  gotoCollection(){
+    wx.navigateTo({
+      url: '/pages/exam/collection/index',
+    })
+  },
+  doWxPay( data ){
+    let that = this
+    wx.requestPayment({
+      timeStamp: data.timeStamp,
+      nonceStr: data.nonceStr,
+      package: data.package, 
+      signType: data.signType,
+      paySign: data.paySign,
+      success: function (event) {
+        wx.showModal({
+          title: '支付成功',
+          showCancel: false,
+          content: '本次共支付费用¥'+(data.fee/100)+'元'+ `\n\n试卷更新可能延迟,请耐心等待`,
+          success(res) {
+            that.indexLoad()
+          }
+        })
+      }
+    })
+  },
+  startWxpay(e){
+    let groupId = +e.currentTarget.dataset.id
+    let system = this.data.system
+    app.formPost('User.PayExam', {groupId, system}).then(res => {
+      if (res.code === 200) {
+        if( res.data.payType=="free" ){
+          this.indexLoad()
+        }else if (res.data.payType=="qrcode"){
+          this.setData({info: res.data, buyModel:true})
+        }else{
+          this.doWxPay( res.data )
+        }
+      }
+    })
+  },
+  onShareAppMessage: function(){
+
+  },
+  gotoError: function(){
+    wx.navigateTo({
+      url: '/pages/exam/error/index',
+    })
+  }
+})

+ 13 - 0
pages/study/index/index.json

@@ -0,0 +1,13 @@
+{
+  "usingComponents": {
+    "i-panel": "/component/iView/panel/index",
+    "i-cell-group": "/component/iView/cell-group/index",
+    "i-cell": "/component/iView/cell/index",
+    "i-message": "/component/iView/message/index",
+    "i-spin": "/component/iView/spin/index",
+    "i-icon": "/component/iView/icon/index",
+    "i-card": "/component/iView/card/index"
+  },
+  "enablePullDownRefresh": true,
+  "navigationBarTitleText": "鸿锵在线教育-继续教育"
+}

+ 81 - 0
pages/study/index/index.wxml

@@ -0,0 +1,81 @@
+<wxs module="enumItem" src="../../../wxs/enumItem.wxs"></wxs>
+<view>
+  <view>
+    <swiper indicator-dots="false" autoplay="true" interval="5000" duration="1000">
+      <swiper-item>
+        <image src="/assets/carousel/1.png" class="slide-image" />
+      </swiper-item>
+      <swiper-item>
+        <image src="/assets/carousel/2.png" class="slide-image" />
+      </swiper-item>
+      <swiper-item>
+        <image src="/assets/carousel/3.png" class="slide-image" />
+      </swiper-item>
+      <swiper-item>
+        <image src="/assets/carousel/4.png" class="slide-image" />
+      </swiper-item>
+    </swiper>
+  </view>
+
+  <view wx:if="{{!userInfo.identify}}">
+    <view style="text-align:center;margin:50rpx">
+      <text> 您未开通在线练习业务 </text>
+    </view>
+    <view style="text-align:center;margin:50rpx">
+      <text> 实名认证后,可获得试卷 </text>
+    </view>
+
+    <navigator class="mt50" url="/pages/user/identify/index" hover-class="navigator-hover" open-type="navigate">
+      <button class="i-btn  i-btn-primary i-btn-square"> 实名认证 </button>
+    </navigator>
+  </view>
+
+  <view  wx:else>
+    <!-- 导航 -->
+    <view class="cate-section">
+
+      <navigator class="cate-item"  url="/pages/study/sign/index" >
+        <i-icon type="flag" size="40" color="#e96900a0" />
+        <text>学时证明</text>
+      </navigator>
+
+      <navigator class="cate-item"  url="/pages/study/market/index?type=施工现场专业人员" >
+        <i-icon type="shop_fill" size="40" color="#e96900a0" />
+        <text>所有课程</text>
+      </navigator>
+
+    </view>
+
+    <!-- 视频列表 -->
+    <view class="guess-section">
+      <block wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
+        <view class="guess-item">
+          <view class="image-wrapper item-img">
+            <image src="{{item.tb}}" mode="aspectFill"> </image>
+            <view class="circle" bindtap="gotoCourse" data-id="{{item.courseId}}">
+              <view class="circle_inner_play"></view>
+            </view>
+          </view>
+          <text class="title clamp">
+            【{{item.nd}}】 {{item.name}}
+          </text>
+          <view class="info">
+            <text class="price" wx:if="{{item.canBuy}}">
+              价格:{{"¥"+item.fee/100}}
+            </text>
+            <text class="xs">
+              学时:{{item.totalXs/10}}
+            </text>
+          </view>
+        </view>
+      </block>
+    </view>
+  </view>
+
+  <modal title="iOS端暂不支持虚拟支付业务" confirm-text="保存图片" hidden="{{!buyModel}}" no-cancel="true" bindconfirm="modalConfirm">
+    <image src="{{info.code_url}}" mode="widthFix" style="width:100%"></image>
+    <view style="color:red;text-align:center;">
+      <text> IOS端暂不支持虚拟支付业务</text>
+    </view>
+  </modal>
+</view>

+ 142 - 0
pages/study/index/index.wxss

@@ -0,0 +1,142 @@
+/**index.wxss**/
+
+.caption-wrap {
+  background-color: white;
+  margin-top: 15px;
+}
+
+.caption-title {
+  background-color: #f7f7f7;
+  display: block;
+  margin-left: 5px;
+}
+
+.index-collapse {
+  font-size: 14px;
+  line-height: 24px;
+}
+
+.index-collapse-item {
+  padding: 8px 15px !important;
+  border: 0px !important;
+}
+
+
+
+.index-cell {
+  padding: 5px 15px !important;
+}
+
+/* 
+  列表展示 
+*/
+.guess-section {
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-flex-wrap: wrap;
+  -ms-flex-wrap: wrap;
+  flex-wrap: wrap;
+  padding: 20rpx; 
+  background: #fff;
+}
+
+.guess-section .guess-item {
+  margin-top: 40rpx;
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-box-orient: vertical;
+  -webkit-box-direction: normal;
+  -webkit-flex-direction: column;
+  -ms-flex-direction: column;
+  flex-direction: column;
+  width: 48%;
+  border-radius: 80rpx;
+  padding-bottom: 40rpx;
+}
+
+.guess-section .guess-item:nth-child(2n+1) {
+  margin-right: 4%;
+}
+
+.guess-section .image-wrapper {
+  width: 100%;
+  height: 210rpx;
+  border-radius: 3px;
+  overflow: hidden;
+}
+
+.guess-section .image-wrapper image {
+  width: 100%;
+  height: 100%;
+  opacity: 1;
+}
+
+.guess-section .title {
+  font-size: 26rpx;
+  color: #303133;
+  font-weight: 700;
+}
+
+.guess-section .info {
+  padding: 0rpx 20rpx;
+  float: left;
+  margin-left: 0rpx;
+}
+
+.guess-section .info .price {
+  font-size: 26rpx;
+  float: left;
+}
+
+.guess-section .info .xs {
+  font-size: 26rpx;
+  margin-left: 20rpx;
+  float: left;
+}
+
+
+.item-img{
+  height: 388rpx;
+  position: relative;
+}
+
+.circle {
+  border-radius: 50px;
+  height: 50px;
+  position: absolute;
+  width: 50px;
+  z-index: 9998;
+  color: #fff;
+  background: #000;
+  opacity: 0.6;
+  left: 50%;
+  margin-left: -50rpx;
+  text-align: center;
+  margin-top: -160rpx;
+}
+
+.circle_inner_play {
+  content: "";
+  display: block;
+  width: 0;
+  height: 0;
+  border-style: solid;
+  border-width: 10px 0 10px 20px;
+  border-color: transparent transparent transparent #fff;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  margin: -10px 0 0 -7px;
+}
+
+
+
+
+
+
+
+

+ 127 - 0
pages/study/market/index.js

@@ -0,0 +1,127 @@
+//index.js
+//获取应用实例
+const app = getApp()
+
+Page({
+  data: {
+    spinShow: false,
+    buyModel:false,
+    code_url:'',
+    info:{},
+    system: "",
+    userInfo:{},
+    from:0,
+    size: 10,
+    type: '',
+    courseList: []
+  },
+  onLoad: function( options ){
+    let type= options.type||''
+    this.setData({type})
+    let that = this
+    wx.getSystemInfo({
+      success: function(res) {
+        that.setData({system: res.system})
+      }
+    })
+    wx.setNavigationBarTitle({
+      title: type+'-课程购买'
+    })
+  },
+  gotoCourse( e ){
+    let courseId = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `/pages/study/course/index?courseId=${courseId}`,
+    })
+  },
+  onShow: function () {
+    app.checkLogin( userInfo =>{
+      this.setData({userInfo, from:0})
+      this.indexLoad()
+    })
+  },
+  onPullDownRefresh() {
+    if (!this.loading) {
+      this.setData({from:0, courseList:[]})
+      this.indexLoad( this.stopPullDownRefresh )
+    }
+  },
+  onReachBottom() {
+    if (!this.loading && this.data.from > -1) {
+      this.indexLoad(  )
+    }
+  },
+  stopPullDownRefresh(){
+    wx.stopPullDownRefresh()
+  },
+  indexLoad: function( cb ) {
+    let param ={ 
+      from: this.data.from,
+      size: this.data.size,
+      type: this.data.type,
+    }
+    let courseList = this.data.courseList;
+    app.formPost('Study.getWxCourseMarket', param).then(res => {
+      if (res.code === 200) {
+        if( param.from == 0){
+          courseList = [];
+        }
+        this.setData({
+          from: res.data.from,
+          courseList: courseList.concat(res.data.list),
+        });
+       cb&&cb() 
+      }
+    })
+  },
+  downloadFile: function(){
+    let url = this.data.info.code_url
+    util.downloadFile( url, res=>{
+      this.setData({buyModel:false, code_url:''})
+    } )
+  },
+  doWxPay( data ){
+    let that = this
+    wx.requestPayment({
+      timeStamp: data.timeStamp,
+      nonceStr: data.nonceStr,
+      package: data.package, 
+      signType: data.signType,
+      paySign: data.paySign,
+      success: function (event) {
+        wx.showModal({
+          title: '支付成功',
+          showCancel: false,
+          content: '本次共支付费用¥'+(data.fee/100)+'元'+ `\n\n试卷更新可能延迟,请耐心等待`,
+          success(res) {
+            that.indexLoad()
+          }
+        })
+      }
+    })
+  },
+  startWxpay(e){
+    let courseId = +e.currentTarget.dataset.id
+    let system = this.data.system
+    app.formPost('User.PayCourse', {courseId, system}).then(res => {
+      if (res.code === 200) {
+        if( res.data.payType=="free" ){
+          this.indexLoad()
+        }else if (res.data.payType=="qrcode"){
+          this.setData({info: res.data, buyModel:true})
+        }else{
+          this.doWxPay( res.data )
+        }
+      }
+    })
+  },
+
+  onShareAppMessage: function(){
+
+  },
+  gotoError: function(){
+    wx.navigateTo({
+      url: '/pages/exam/error/index',
+    })
+  }
+})

+ 13 - 0
pages/study/market/index.json

@@ -0,0 +1,13 @@
+{
+  "usingComponents": {
+    "i-panel": "/component/iView/panel/index",
+    "i-cell-group": "/component/iView/cell-group/index",
+    "i-cell": "/component/iView/cell/index",
+    "i-message": "/component/iView/message/index",
+    "i-spin": "/component/iView/spin/index",
+    "i-icon": "/component/iView/icon/index",
+    "i-card": "/component/iView/card/index"
+  },
+  "enablePullDownRefresh": true,
+  "navigationBarTitleText": "鸿鹄在线练习系统"
+}

+ 63 - 0
pages/study/market/index.wxml

@@ -0,0 +1,63 @@
+<wxs module="enumItem" src="../../../wxs/enumItem.wxs"></wxs>
+<view>
+  <view wx:if="{{!userInfo.identify}}">
+    <view style="text-align:center;margin:50rpx">
+      <text> 您未开通在线练习业务 </text>
+    </view>
+    <view style="text-align:center;margin:50rpx">
+      <text> 实名认证后,可获得试卷 </text>
+    </view>
+
+    <navigator class="mt50" url="/pages/user/identify/index" hover-class="navigator-hover" open-type="navigate">
+      <button class="i-btn  i-btn-primary i-btn-square"> 实名认证 </button>
+    </navigator>
+  </view>
+
+  <view  wx:else>
+    <!-- 视频列表 -->
+    <view class="guess-section">
+      <block wx:for="{{courseList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
+        <view class="guess-item">
+          <view class="image-wrapper item-img">
+            <image src="{{item.tb}}" mode="aspectFill"> </image>
+            <view class="circle" bindtap="gotoCourse" data-id="{{item.courseId}}" wx:if="{{item.isPay}}">
+              <view class="circle_inner_play"></view>
+            </view>
+
+            <view class="circle" bindtap="startWxpay" data-id="{{item.courseId}}" wx:else>
+              <i-icon type="lock" size="50" color="red" />
+            </view>
+
+          </view>
+          <text class="title clamp">
+            【{{item.nd}}】 {{item.name}}
+          </text>
+          <view class="info">
+            <text class="price" wx:if="{{item.canBuy}}">
+              价格:{{"¥"+item.fee/100}}
+            </text>
+
+            <text class="xs">
+              学时:{{item.totalXs/10}}
+            </text>
+
+            <button class="contact" open-type="contact" session-from="weapp" wx:if="{{!item.canBuy}}">
+              联系我们
+            </button>
+          </view>
+        </view>
+      </block>
+    </view>
+
+    <view wx:if="{{from==-1}}"  class="m20">
+      <view class="padding tc">没有更多了</view>
+    </view>
+  </view>
+    
+  <modal title="iOS端暂不支持虚拟支付业务" confirm-text="保存图片" hidden="{{!buyModel}}" no-cancel="true" bindconfirm="downloadFile">
+    <image src="{{info.code_url}}" mode="widthFix" style="width:100%"></image>
+    <view style="color:red;text-align:center;">
+      <text> IOS端暂不支持虚拟支付业务</text>
+    </view>
+  </modal>
+</view>

+ 151 - 0
pages/study/market/index.wxss

@@ -0,0 +1,151 @@
+/**index.wxss**/
+
+.caption-wrap {
+  background-color: white;
+  margin-top: 15px;
+}
+
+.caption-title {
+  background-color: #f7f7f7;
+  display: block;
+  margin-left: 5px;
+}
+
+.index-collapse {
+  font-size: 14px;
+  line-height: 24px;
+}
+
+.index-collapse-item {
+  padding: 8px 15px !important;
+  border: 0px !important;
+}
+
+.slide-image {
+  width: 100%;
+  height: 150px;
+}
+
+.index-cell {
+  padding: 5px 15px !important;
+}
+
+/* 
+  列表展示 
+*/
+.guess-section {
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-flex-wrap: wrap;
+  -ms-flex-wrap: wrap;
+  flex-wrap: wrap;
+  padding: 20rpx; 
+  background: #fff;
+}
+
+.guess-section .guess-item {
+  margin-top: 40rpx;
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-box-orient: vertical;
+  -webkit-box-direction: normal;
+  -webkit-flex-direction: column;
+  -ms-flex-direction: column;
+  flex-direction: column;
+  width: 48%;
+  border-radius: 80rpx;
+  padding-bottom: 40rpx;
+}
+
+.guess-section .guess-item:nth-child(2n+1) {
+  margin-right: 4%;
+}
+
+.guess-section .image-wrapper {
+  width: 100%;
+  height: 210rpx;
+  border-radius: 3px;
+  overflow: hidden;
+}
+
+.guess-section .image-wrapper image {
+  width: 100%;
+  height: 100%;
+  opacity: 1;
+}
+
+.guess-section .title {
+  font-size: 26rpx;
+  color: #303133;
+  font-weight: 700;
+}
+
+.guess-section .info {
+  padding: 0rpx 20rpx;
+  float: left;
+  margin-left: 0rpx;
+}
+
+.guess-section .info .price {
+  font-size: 26rpx;
+  float: left;
+}
+
+.guess-section .info .contact {
+  font-size: 26rpx;
+  float: right;
+  padding:0;
+  background: #fff;
+  margin-top:20rpx;
+}
+
+.guess-section .info .xs {
+  font-size: 26rpx;
+  margin-left: 20rpx;
+  float: left;
+}
+
+
+.item-img{
+  height: 388rpx;
+  position: relative;
+}
+
+.circle {
+  border-radius: 50px;
+  height: 50px;
+  position: absolute;
+  width: 50px;
+  z-index: 10;
+  color: #fff;
+  background: #000;
+  opacity: 0.6;
+  left: 50%;
+  margin-left: -50rpx;
+  text-align: center;
+  margin-top: -160rpx;
+}
+
+.circle_inner_play {
+  content: "";
+  display: block;
+  width: 0;
+  height: 0;
+  border-style: solid;
+  border-width: 10px 0 10px 20px;
+  border-color: transparent transparent transparent #fff;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  margin: -10px 0 0 -7px;
+}
+
+
+
+
+
+

+ 65 - 0
pages/study/sign/index.js

@@ -0,0 +1,65 @@
+
+const app = getApp()
+const {ossUrl} = require("../../../utils/util.js")
+Page({
+  data: {
+    userInfo:{},
+    signModel: false,
+    from: 0,
+    size: 20,
+    form:{},
+    list: []
+  },
+  onLoad: function( options ){
+    app.checkLogin( userInfo =>{
+      this.setData({userInfo})
+      this.loadData( )
+    })
+  },
+  preview( e){
+    let url = e.currentTarget.dataset.url;
+    this.doPreview( url );
+  },
+  doPreview( url ){
+    let nurl = ossUrl+ url.split("#")[1]
+    wx.previewImage({
+      urls: [nurl],
+    })
+  },
+  makeSign( e) {
+    let index = +e.currentTarget.dataset.index;
+    let item = this.data.list[index];
+    item.index = index
+    let form = Object.assign( {}, item)
+    form.temp = item
+    this.setData({form,signModel:true})
+  },
+  cancelPrint(){
+    this.setData({signModel:false});
+  },
+  printCert(e){
+    let param = {
+      id: +this.data.form.id, 
+      rzCode: this.data.form.rzCode
+    }
+    app.formPost('Cert.printCert', param).then(res => {
+      if( res.code == 200){
+        let { url } = res.data;
+        if( url )this.doPreview( url )
+      }
+    })
+  },
+  updateRzcode(e){
+    this.setData({ "form.rzCode": e.detail.detail.value})
+  },
+  loadData: function(  ) {
+    let param ={ from: this.data.from, size: this.data.size }
+    app.formPost('Cert.GetCertList', param).then(res => {
+      if( res.code == 200){
+        let { from, list} = res.data
+        this.setData({from,list})
+      }
+    })
+  }
+
+})

+ 10 - 0
pages/study/sign/index.json

@@ -0,0 +1,10 @@
+{
+  "usingComponents": {
+    "i-icon": "/component/iView/icon/index",
+    "i-card": "/component/iView/card/index",
+    "i-input": "/component/iView/input/index",
+    "i-button": "/component/iView/button/index"
+  },
+  "enablePullDownRefresh": true,
+  "navigationBarTitleText": "学时证明"
+}

+ 33 - 0
pages/study/sign/index.wxml

@@ -0,0 +1,33 @@
+<view>
+
+  <view wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index" class="mt20">
+    <i-card title="{{item.name}}" data-index="{{index}}" i-class="pt30">
+      <view slot="content">证书类型: {{item.type}}</view>
+      <view slot="content" class="mt20">课程学时: {{item.totalXs/10}}</view>
+      <view slot="content" class="mt20">学习时间: {{item.startDate}} 到 {{item.endDate}}</view>
+      <view slot="content" class="mt20">
+        证书编号:{{item.rzCode}}
+      </view>
+
+      <view slot="content" class="mt20 flex tc">
+        <i-button inline type="primary" wx:if="{{item.signUrl}}" bindtap="preview" data-url="{{item.signUrl}}">查看证明
+        </i-button>
+        <i-button inline type="primary" wx:else bindtap="makeSign" data-index="{{index}}" >生成证明</i-button>
+      </view>
+    </i-card>
+  </view>
+
+  <view wx:if="{{from==-1}}" class="m20">
+    <view class="padding tc">没有更多了</view>
+  </view>
+</view>
+
+<modal title="打印学时证明"  hidden="{{!signModel}}" 
+  cancel-text="取消" 
+  bindcancel="cancelPrint"
+  confirm-text="生成证明"
+  bindconfirm="printCert" >
+  <i-panel title="">
+   <i-input title="证书编号" value="{{form.rzCode}}" name="rzCode" bind:change="updateRzcode"> </i-input>
+  </i-panel>
+</modal>

+ 1 - 0
pages/study/sign/index.wxss

@@ -0,0 +1 @@
+/* pages/study/sign/index.wxss */

+ 1 - 1
pages/train/limit/index.json

@@ -8,5 +8,5 @@
     "i-icon": "/component/iView/icon/index"
   },
   "enablePullDownRefresh": true,
-  "navigationBarTitleText": "高频题库"
+  "navigationBarTitleText": "鸿锵在线教育-高频题库"
 }

+ 0 - 1
pages/train/orderTest/answer.wxml

@@ -10,7 +10,6 @@
   </view>
 
   <i-panel i-class="exam-panel-title">
-
     <i-cell-group i-class="exam-cell">
       <!-- 单选题 -->
       <i-cell wx:if="{{info.type ==2}}">

+ 1 - 1
pages/train/orderTest/answer.wxss

@@ -28,7 +28,7 @@
 }
 
 .exam-panel-title {
-  margin-top: 30px;
+  margin-top: 35px;
 }
 
 .exam-radio-item-label {

+ 7 - 1
pages/user/identify/index.js

@@ -18,6 +18,12 @@ Page({
       cardBackImg:""
     }
   },
+  onShow: function () {
+    app.checkLogin( studyUser =>{
+      console.log("userInfo", studyUser)
+      this.setData({studyUser})
+    })
+  },
   wxLogin(){
     let that = this
     wx.login({
@@ -62,7 +68,7 @@ Page({
       if( res.code == 200 ){
         let studyUser= res.data
         app.setUserInfo( studyUser )
-        util.showSuccess("登入成功")
+        util.showSuccess("实名认证成功")
         this.setData({studyUser})
       }else{
         util.showMsg( res.msg  )

+ 16 - 36
pages/user/identify/index.wxml

@@ -1,53 +1,33 @@
-<<<<<<< HEAD
-<camera device-position="back" flash="auto" binderror="errorCamara" id="myCamera" wx:if="{{showcamara}}"
-  style="width: 100%; height:100vh;">
-  <cover-view class="mcover-view" style='width: 100%; height:100%; top:45%' wx:if="{{!hidden}}">
-    <cover-image class="dialog-body wh70" style='right:45%' src="/assets/loading.gif" />
-  </cover-view>
-  <cover-view class="mcover-bar" wx:if="{{hidden}}">
-    <cover-view class="mcover-view">
-      <cover-view>
-        <cover-image class="dialog-body circle wh60" src="/assets/img_gallery.png" bindtap="chooseImg" />
-      </cover-view>
-      <cover-view class="dialog-body camara" bindtap="takePhoto">
-        <cover-view class="camara-1"></cover-view>
-      </cover-view>
 
-      <cover-view>
-        <cover-image class="dialog-body circle wh60" src="/assets/img_close.png" bindtap="goBack" />
-      </cover-view>
-    </cover-view>
-  </cover-view>
-</camera>
-
-<scroll-view scroll-y="true" wx:else class="scroll-view">
+<scroll-view scroll-y="true" class="scroll-view">
   <view class="identify-box" style="height:300rpx;">
-
   </view>
 
-=======
-<scroll-view scroll-y="true" class="scroll-view">
-  <view class="identify-box" style="height:240rpx;" > </view>
->>>>>>> 6bcad0526cc12cd426186b6ef8155096e5462e6b
   <view class="p20 ">
     <view class="info-title">绑定用户信息</view>
-    <form class="p20" bindsubmit="doIdentify">
-      <i-input  value="{{ studyUser.nickname }}" name="nickname"  title="*输入名字" class="mt20" maxlength="100" />
-      <i-input value="{{ studyUser.cardId }}"  name="cardId" title="*输入账号" class="mt20" maxlength="18"  />
+    <i-panel class="m20 p20" wx:if="{{info.identify}}">
+      <i-input value="{{ studyUser.nickname }}" error title="*真实姓名" class="mt20" disable />
+      <i-input value="{{ studyUser.cardId }}" error title="*身份号码" class="mt20" disable />
+      <i-input value="{{ studyUser.phone }}" error title="*联系方式" class="mt20" disable />
+    </i-panel>
+
+    <form wx:else class="p20" bindsubmit="doIdentify">
+      <i-input  value="{{ studyUser.nickname }}" name="nickname"  title="*真实姓名" class="mt20" maxlength="100" />
+      <i-input value="{{ studyUser.cardId }}"  name="cardId" title="*身份号码" class="mt20" maxlength="18"  />
       <i-input value="{{ studyUser.phone }}"  name="phone" title="*联系方式" class="mt20" type="number" maxlength="11"/>
-      <button class="i-btn  i-btn-primary i-btn-square" form-type="submit">绑定微信</button>
+
+      <button wx:if="{{!!studyUser.identify}}" class="i-btn  i-btn-square" type="text">已经实名认证</button>
+      <button wx:else class="i-btn  i-btn-primary i-btn-square" form-type="submit">实名认证</button>
     </form>
   </view>
   
   <view class="tc">
     <view>
-      <text style="color:red">姓名、账号、联系方式三者一致才能绑定微信</text>
+      <text style="color:red">姓名、身份证、联系方式三者一致才能对接部证书</text>
     </view>
-
-    <view style="margin-top: 30rpx;">
-      <text> 已经绑定的可以快捷登入 </text>
+    <view>
+      <text> 已经实名认证的可以快捷登入 </text>
     </view>
-
     <button class="mt20" type="primary"  bindtap="wxLogin"  size="mini">
       快捷登入
     </button>

+ 66 - 0
pages/user/register/index.js

@@ -0,0 +1,66 @@
+// pages/user/register/index.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage() {
+
+  }
+})

+ 2 - 0
pages/user/register/index.wxml

@@ -0,0 +1,2 @@
+<!--pages/user/register/index.wxml-->
+<text>pages/user/register/index.wxml</text>

+ 2 - 2
project.config.json

@@ -48,8 +48,8 @@
   },
   "compileType": "miniprogram",
   "libVersion": "2.30.2",
-  "appid": "wx1f476e5586130093",
-  "projectname": "xmj",
+  "appid": "wx701d6e0be4d00ae7",
+  "projectname": "ndjsxh",
   "simulatorType": "wechat",
   "simulatorPluginLibVersion": {},
   "editorSetting": {

+ 1 - 1
sitemap.json

@@ -1,5 +1,5 @@
 {
-  "desc": "相马君真题练习",
+  "desc": "鸿锵在线教育",
   "rules": [{
   "action": "allow",
   "page": "*"

+ 1 - 1
utils/util.js

@@ -1,5 +1,5 @@
 // const baseUrl = "http://127.0.0.1:8000/"
-const baseUrl = "https://xmj.hqedust.com:18443/"
+const baseUrl = "https://edu.ndjsxh.cn:8443/"
 const ossUrl = "https://sm-sign.oss-cn-shanghai.aliyuncs.com/cert/"
 const md5 = require('./md5.js');
 

+ 9 - 0
wxs/util-fun.wxs

@@ -0,0 +1,9 @@
+var filter = {
+  getPercent: function(item){
+    if( item.isFinish) return 100;
+    return parseInt(item.position*10000/item.duration)/100;
+  }
+}
+module.exports = {
+  getPercent: filter.getPercent
+}