tanyanfei 4 years ago
parent
commit
500fe40791
100 changed files with 3334 additions and 0 deletions
  1. 0 0
      README.md
  2. 67 0
      app.js
  3. 56 0
      app.json
  4. 43 0
      app.wxss
  5. BIN
      images/arrow-bottom.png
  6. BIN
      images/back.png
  7. BIN
      images/baoming.png
  8. BIN
      images/bg-my.png
  9. BIN
      images/gou.png
  10. BIN
      images/logo.png
  11. BIN
      images/play.png
  12. BIN
      images/score.png
  13. BIN
      images/shouye-xz.png
  14. BIN
      images/shouye.png
  15. 51 0
      images/type1.svg
  16. 40 0
      images/type2.svg
  17. 50 0
      images/type3.svg
  18. BIN
      images/upload.png
  19. BIN
      images/wode-xz.png
  20. BIN
      images/wode.png
  21. BIN
      images/xiaoxi.png
  22. BIN
      images/下载.png
  23. 22 0
      images/判断.svg
  24. 22 0
      images/单选.svg
  25. BIN
      images/在线培训.png
  26. BIN
      images/在线报名.png
  27. BIN
      images/培训计划.png
  28. 22 0
      images/多选.svg
  29. BIN
      images/头条通知.png
  30. BIN
      images/机构介绍.png
  31. BIN
      images/考场介绍.png
  32. BIN
      images/联系我们.png
  33. BIN
      images/证件.png
  34. BIN
      images/试题.png
  35. BIN
      images/资料.png
  36. 90 0
      pages/apply/apply.js
  37. 3 0
      pages/apply/apply.json
  38. 24 0
      pages/apply/apply.wxml
  39. 67 0
      pages/apply/apply.wxss
  40. 79 0
      pages/article/article.js
  41. 3 0
      pages/article/article.json
  42. 4 0
      pages/article/article.wxml
  43. 9 0
      pages/article/article.wxss
  44. 83 0
      pages/download/download.js
  45. 3 0
      pages/download/download.json
  46. 3 0
      pages/download/download.wxml
  47. 15 0
      pages/download/download.wxss
  48. 70 0
      pages/index/index.js
  49. 3 0
      pages/index/index.json
  50. 71 0
      pages/index/index.wxml
  51. 105 0
      pages/index/index.wxss
  52. 79 0
      pages/intro/intro.js
  53. 3 0
      pages/intro/intro.json
  54. 4 0
      pages/intro/intro.wxml
  55. 9 0
      pages/intro/intro.wxss
  56. 66 0
      pages/message/message.js
  57. 3 0
      pages/message/message.json
  58. 11 0
      pages/message/message.wxml
  59. 20 0
      pages/message/message.wxss
  60. 66 0
      pages/mine/mine.js
  61. 3 0
      pages/mine/mine.json
  62. 35 0
      pages/mine/mine.wxml
  63. 56 0
      pages/mine/mine.wxss
  64. 66 0
      pages/myPapers/myPapers.js
  65. 3 0
      pages/myPapers/myPapers.json
  66. 6 0
      pages/myPapers/myPapers.wxml
  67. 15 0
      pages/myPapers/myPapers.wxss
  68. 96 0
      pages/online/online.js
  69. 3 0
      pages/online/online.json
  70. 55 0
      pages/online/online.wxml
  71. 145 0
      pages/online/online.wxss
  72. 76 0
      pages/onlinePost/onlinePost.js
  73. 3 0
      pages/onlinePost/onlinePost.json
  74. 25 0
      pages/onlinePost/onlinePost.wxml
  75. 53 0
      pages/onlinePost/onlinePost.wxss
  76. 120 0
      pages/plan/plan.js
  77. 3 0
      pages/plan/plan.json
  78. 38 0
      pages/plan/plan.wxml
  79. 59 0
      pages/plan/plan.wxss
  80. 283 0
      pages/post/post.js
  81. 3 0
      pages/post/post.json
  82. 138 0
      pages/post/post.wxml
  83. 63 0
      pages/post/post.wxss
  84. 66 0
      pages/showMsg/showMsg.js
  85. 3 0
      pages/showMsg/showMsg.json
  86. 4 0
      pages/showMsg/showMsg.wxml
  87. 13 0
      pages/showMsg/showMsg.wxss
  88. 156 0
      pages/subject/subject.js
  89. 3 0
      pages/subject/subject.json
  90. 29 0
      pages/subject/subject.wxml
  91. 64 0
      pages/subject/subject.wxss
  92. 193 0
      pages/upload/upload.js
  93. 3 0
      pages/upload/upload.json
  94. 41 0
      pages/upload/upload.wxml
  95. 66 0
      pages/upload/upload.wxss
  96. 72 0
      pages/video/video.js
  97. 3 0
      pages/video/video.json
  98. 1 0
      pages/video/video.wxml
  99. 4 0
      pages/video/video.wxss
  100. 0 0
      project.config.json

+ 0 - 0
README.md


+ 67 - 0
app.js

@@ -0,0 +1,67 @@
+//app.js
+App({
+  onLaunch: function () {
+    var openid;
+    var _this=this;
+    wx.getStorage({
+      key: 'openid',
+      success: function(res) {
+        openid=res.data
+        _this.globalData.openid = openid
+        if (!openid) {
+          // 登录
+          wx.login({
+            success: res => {
+              console.log(res)
+              // 发送 res.code 到后台换取 openId, sessionKey, unionId
+              wx.request({
+                url: 'https://www.scxjc.club/api/wx/openid',
+                method: 'GET',
+                data: {
+                  code: res.code
+                },
+                success: res => {
+                  wx.setStorage({
+                    key: 'openid',
+                    data: res.data.data.openid,
+                  })
+                }
+              })
+            }
+          })
+        }
+      },
+    })   
+    // 获取用户信息
+    wx.getSetting({
+      success: res => {
+        if (res.authSetting['scope.userInfo']) {
+          // 已经授权,可以直接调用 getUserInfo 获取头像昵称,不会弹框
+          wx.getUserInfo({
+            success: res => {
+              // 可以将 res 发送给后台解码出 unionId
+              this.globalData.userInfo = res.userInfo
+
+              // 由于 getUserInfo 是网络请求,可能会在 Page.onLoad 之后才返回
+              // 所以此处加入 callback 以防止这种情况
+              if (this.userInfoReadyCallback) {
+                this.userInfoReadyCallback(res)
+              }
+            }
+          })
+        }
+      }
+    })
+    // wx.request({
+    //   url:'https://www.scxjc.club/api/wx/sujectitem',
+    //   success: res => {
+    //     this.globalData.categoryArray = res.data.data
+    //   }
+    // })
+  },
+  globalData: {
+    userInfo: null,
+    host:'https://www.scxjc.club',
+    categoryArray:[]
+  }
+})

+ 56 - 0
app.json

@@ -0,0 +1,56 @@
+{
+  "pages":[ 
+    
+    "pages/index/index",
+    "pages/apply/apply",
+    "pages/online/online",
+    "pages/plan/plan",
+    "pages/post/post",
+    "pages/intro/intro",
+    "pages/upload/upload",
+    "pages/download/download",
+    "pages/article/article",
+    "pages/subject/subject",
+    "pages/myPapers/myPapers",
+    "pages/mine/mine",
+    "pages/message/message", 
+    "pages/video/video",
+    "pages/showMsg/showMsg",
+    "pages/onlinePost/onlinePost"
+    
+  
+  ],
+  "window":{
+    "backgroundTextStyle":"light",
+    "navigationBarBackgroundColor": "#fff",
+    "navigationBarTitleText": "安全培训",
+    "navigationBarTextStyle":"black"
+  },
+  "style": "v2",
+  "sitemapLocation": "sitemap.json",
+  "tabBar": {
+    "color": "#999999",
+    "selectedColor": "#358BFF",
+    "list": [{
+      "pagePath": "pages/index/index",
+      "text": "首页",
+      "iconPath": "images/shouye.png",
+      "selectedIconPath": "images/shouye-xz.png"
+    },{
+      "pagePath": "pages/apply/apply",
+      "text": "报名",
+      "iconPath": "images/baoming.png",
+      "selectedIconPath": "images/baoming.png"
+    },{
+      "pagePath": "pages/message/message",
+      "text": "消息",
+      "iconPath": "images/xiaoxi.png",
+      "selectedIconPath": "images/xiaoxi.png"
+    },{
+      "pagePath": "pages/mine/mine",
+      "text": "我的",
+      "iconPath": "images/wode.png",
+      "selectedIconPath": "images/wode-xz.png"
+    }]
+  }
+}

+ 43 - 0
app.wxss

@@ -0,0 +1,43 @@
+
+view,navigator{
+  box-sizing: border-box;
+  font-size: 28rpx;
+  color: #333;
+}
+
+.login{
+  position: fixed;
+  width: 100%;
+  height: 100vh;
+  z-index: 10;
+  background: rgba(0, 0, 0, .5);
+  left: 0;
+  top: 0;
+}
+.login view{
+  width: 80%;
+  background: #fff;
+  border-radius: 4px;
+  text-align: center;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  margin: auto;
+  height: 100px;
+}
+.login text{
+  display: block;
+  padding: 20px;
+}
+.login button{
+  width: 100% !important;
+  height: 48px;
+  color: #fff;
+  background-color: #fa5151;
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+  padding: 0;
+  line-height: 48px;
+}

BIN
images/arrow-bottom.png


BIN
images/back.png


BIN
images/baoming.png


BIN
images/bg-my.png


BIN
images/gou.png


BIN
images/logo.png


BIN
images/play.png


BIN
images/score.png


BIN
images/shouye-xz.png


BIN
images/shouye.png


File diff suppressed because it is too large
+ 51 - 0
images/type1.svg


File diff suppressed because it is too large
+ 40 - 0
images/type2.svg


File diff suppressed because it is too large
+ 50 - 0
images/type3.svg


BIN
images/upload.png


BIN
images/wode-xz.png


BIN
images/wode.png


BIN
images/xiaoxi.png


BIN
images/下载.png


File diff suppressed because it is too large
+ 22 - 0
images/判断.svg


File diff suppressed because it is too large
+ 22 - 0
images/单选.svg


BIN
images/在线培训.png


BIN
images/在线报名.png


BIN
images/培训计划.png


File diff suppressed because it is too large
+ 22 - 0
images/多选.svg


BIN
images/头条通知.png


BIN
images/机构介绍.png


BIN
images/考场介绍.png


BIN
images/联系我们.png


BIN
images/证件.png


BIN
images/试题.png


BIN
images/资料.png


+ 90 - 0
pages/apply/apply.js

@@ -0,0 +1,90 @@
+// pages/apply/apply.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list:[]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      openid: app.globalData.openid
+    })
+    this.getData();
+  },
+  getData:function(){
+    wx.request({
+      url: host+'/api/wx/signup/list',
+      header:{
+        openid:this.data.openid
+      },
+      method:'GET',
+      success:res=>{
+          console.log(res.data)
+          let data=res.data.data
+          for(let i=0;i<data.length;i++){
+            data[i].subject_item_1 = data[i].subject_item.split('|')
+          }
+          this.setData({
+            list: data
+          })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/apply/apply.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "在线报名"
+}

+ 24 - 0
pages/apply/apply.wxml

@@ -0,0 +1,24 @@
+<view class="content">
+    <navigator class="list" wx:for="{{list}}" wx:key='*this' url="../post/post?id={{item.id}}">
+        <view class="status">
+        <text wx:if="{{item.order_status == 0}}">待审核</text> 
+        <text wx:if="{{item.order_status == 1}}">已审核立即支付</text> 
+        <text wx:if="{{item.order_status == 2}}">学习中</text> 
+        <text wx:if="{{item.order_status == 3}}">已完成</text> 
+        <text style="color:green;">{{item.train_type}}</text></view>
+        <view class="title">{{item.relaname}}   {{item.phone}}  <text>{{item.class_name}}({{item.ctime}})</text></view>
+        <view class="info">
+            <text>{{item.subject_item_1[0]}}</text>
+            <text decode="{{true}}">作业类别  &nbsp;&nbsp; {{item.subject_item_1[1]}}</text>
+            <text decode="{{true}}">准操项目  &nbsp;&nbsp;{{item.subject_item_1[2]}}</text>
+            <text style="color:#358BFF;" decode="{{true}}">学时情况  &nbsp;&nbsp;已学习{{item.class_hour_finished}}/{{item.class_hour}}学时</text>
+            <text style="color:#999;margin-top:12px;">{{item.ctime}}</text>
+        </view>
+        <navigator wx:if="{{item.order_status == 1}}" class="study">立即支付</navigator>
+        <navigator url="../online/online" wx:if="{{item.order_status == 2}}" class="study">立即学习</navigator>
+    </navigator>
+
+
+    <navigator url="../onlinePost/onlinePost" class="post">立即报名</navigator>
+</view>
+

+ 67 - 0
pages/apply/apply.wxss

@@ -0,0 +1,67 @@
+/* pages/apply/apply.wxss */
+page{
+  background: #F4F7F9;
+}
+.content{
+  padding: 12px;
+  padding-bottom: 60px;
+}
+.list{
+  background: #fff;
+  padding: 12px;
+  box-shadow:0px 2px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+  margin-bottom: 12px;
+  position: relative;
+}
+.title{
+  color: #222;
+  font-weight: 600;
+  font-size: 32rpx;
+  margin-bottom: 12px;
+}
+.title text{
+  display: block;
+  color: #358BFF;
+  font-size: 28rpx;
+  font-weight: 400;
+}
+.info text{
+  display: block;
+  color: #222;
+  line-height: 25px;
+}
+.status{
+  float: right;
+}
+.status text{
+  display: block;
+  color: #E85546;
+  text-align: right;
+}
+.study{
+  width:88px;
+  height:32px;
+  background:rgba(53,139,255,1);
+  border-radius:16px;
+  color: #fff;
+  text-align: center;
+  line-height: 32px;
+  position: absolute;
+  bottom: 12px;
+  right: 12px;
+}
+
+.post{
+  display: block;
+  height:48px;
+  background:rgba(53,139,255,1);
+  border-radius:4px;
+  color: #fff;
+  text-align: center;
+  line-height: 48px;
+  margin-top: 50px;
+  position: fixed;
+  bottom: 5px;
+  width: calc(100% - 24px);
+}

+ 79 - 0
pages/article/article.js

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

+ 3 - 0
pages/article/article.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 4 - 0
pages/article/article.wxml

@@ -0,0 +1,4 @@
+<view class="content">
+    <view class="title">{{data.title}}</view>
+    <view class="zw">{{data.content}}</view>
+</view>

+ 9 - 0
pages/article/article.wxss

@@ -0,0 +1,9 @@
+/* pages/article/article.wxss */
+.content{
+  padding: 12px;
+}
+.title{
+  font-size: 36rpx;
+  text-align: center;
+  margin-bottom: 12px;
+}

+ 83 - 0
pages/download/download.js

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

+ 3 - 0
pages/download/download.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "资料下载"
+}

+ 3 - 0
pages/download/download.wxml

@@ -0,0 +1,3 @@
+<view class="content">
+    <view wx:for="{{list}}" bindtap="open" data-src='{{item.url}}' class="list">{{item.name}}</view>
+</view>

+ 15 - 0
pages/download/download.wxss

@@ -0,0 +1,15 @@
+/* pages/download/download.wxss */
+page{
+  background: #F4F7F9;
+}
+.content{
+  padding: 12px;
+}
+.list{
+  background:rgba(255,255,255,1);
+  box-shadow:0px 2px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+  padding: 16px 12px;
+  margin-bottom: 12px;
+  font-size: 32rpx;
+}

+ 70 - 0
pages/index/index.js

@@ -0,0 +1,70 @@
+//index.js
+//获取应用实例
+const app = getApp()
+const host = app.globalData.host;
+Page({
+  data: {
+    act:6,
+    openid:'',
+    show:1,
+    data:[]
+  },
+  //事件处理函数
+  bindViewTap: function() {
+    wx.navigateTo({
+      url: '../logs/logs'
+    })
+  },
+  tabchange:function(e){
+    this.setData({
+      act: e.target.dataset.id
+    })
+  },
+  onLoad: function () {
+    this.getData()
+    this.setData({
+      openid: app.globalData.openid
+    })
+    wx.getStorage({
+      key: 'userInfo',
+      success: res=> {
+        if(res.data){
+          this.setData({show:0})
+        }
+      },
+    })
+  },
+  onGotUserInfo: function (e) {
+    wx.setStorage({
+      key: 'userInfo',
+      data: e.detail.userInfo,
+    })
+    wx.request({
+      url: host+'/api/wx/authinfo',
+      method:'POST',
+      data:{
+        nickname: e.detail.userInfo.nickName, 
+        avatar: e.detail.userInfo.avatarUrl, 
+        openid: this.data.openid, 
+      },
+      success:res=>{
+          console.log(res)
+          this.setData({
+            show:0
+          })
+      }
+    })
+  },
+  getData:function(){
+    wx.request({
+      url: host +'/api/wx/index',
+      method:'GET',
+      success:res=>{
+        console.log(res.data)
+        this.setData({
+          data:res.data.data
+        })
+      }
+    })
+  }
+})

+ 3 - 0
pages/index/index.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 71 - 0
pages/index/index.wxml

@@ -0,0 +1,71 @@
+<!--index.wxml-->
+<view class="top">
+  <view class="logo">
+    <image src="../../images/logo.png" mode="widthFix"></image>
+    <view>巴中逸沣安全培训</view>
+    <text>bazhongyifenganquanpeixun</text>
+  </view>
+  <block wx:for="{{data}}" wx:key='*this'>
+  <navigator class="part" wx:if="{{item.type == 'nav'}}" open-type="{{item.name == '在线报名'?'switchTab':'navigate'}}"  url="..{{item.path}}">
+    <view>{{item.name}}</view>
+    <text>{{item.name}}</text>
+    <image src="{{item.icon}}" mode="widthFix"></image>
+  </navigator>
+  </block>
+  <!-- <navigator  open-type="switchTab" class="part">
+    <view>机构介绍</view>
+    <text>机构介绍</text>
+    <image src="../../images/机构介绍.png" mode="widthFix"></image>
+  </navigator>
+  <navigator url="../apply/apply" open-type="switchTab" class="part">
+    <view>在线报名</view>
+    <text>在线报名</text>
+    <image src="../../images/在线报名.png" mode="widthFix"></image>
+  </navigator>
+  <navigator class="part">
+    <view>考场介绍</view>
+    <text>考场介绍</text>
+    <image src="../../images/考场介绍.png" mode="widthFix"></image>
+  </navigator>
+  <navigator class="part"  url="../online/online" >
+    <view>在线培训</view>
+    <text>在线培训</text>
+    <image src="../../images/在线培训.png" mode="widthFix"></image>
+  </navigator>
+  <navigator url="../plan/plan"  class="part">
+    <view>培训计划</view>
+    <text>培训计划</text>
+    <image src="../../images/培训计划.png" mode="widthFix"></image>
+  </navigator>
+  <navigator class="part">
+    <view>联系我们</view>
+    <text>联系我们</text>
+    <image src="../../images/联系我们.png" mode="widthFix"></image>
+  </navigator> -->
+  <view class="news">
+      <image src="../../images/头条通知.png" mode="widthFix"></image>
+      国家安全生产监督管理总局30号令
+  </view>
+</view>
+
+<view class="bottom">
+    <view class="tab">
+        <text wx:for="{{data}}" wx:key='*this' wx:if="{{item.type=='article'}}" bindtap='tabchange'
+         data-id='{{index}}' class="{{act==index ? 'active':''}}">{{item.name}}</text>
+        <!-- <text bindtap='tabchange' data-id='1' class="{{act==1 ? 'active':''}}">咨询文章</text> -->
+        <!-- <text bindtap='tabchange' data-id='2' class="{{act==2 ? 'active':''}}">咨询文章</text> -->
+    </view>
+    <view wx:for="{{data}}" wx:key='*this' wx:if="{{item.type=='article' && act == index}}" class="article">
+        <navigator url="../article/article?id={{list.id}}" class="list" wx:for="{{item.list}}" wx:for-item="list" wx:key='*this'>
+            <view>{{list.title}}</view>
+            <text>{{list.ctime}}</text>
+        </navigator>
+    </view>
+</view>
+
+<view class="login" wx:if='{{show}}'>
+    <view>
+        <text>获取用户信息(头像、昵称等)!</text>
+        <button bindgetuserinfo="onGotUserInfo" open-type="getUserInfo">确定</button>
+    </view>
+</view>

+ 105 - 0
pages/index/index.wxss

@@ -0,0 +1,105 @@
+/**index.wxss**/
+page{
+  background: #F4F7F9;
+}
+.top{
+  padding: 0 12px;
+  display: flex;
+  flex-wrap: wrap;
+  justify-content: space-between;
+}
+.logo{
+  /* height:200rpx; */
+  background:linear-gradient(90deg,rgba(75,153,255,1) 0%,rgba(91,61,255,1) 100%);
+  border-radius:6px;
+  position: relative;
+  padding: 48rpx 170rpx;
+  width: 100%;
+}
+.logo view{
+  font-size: 40rpx;
+  color: #fff;
+}
+.logo text{
+  color: #fff;
+  font-size: 24rpx;
+}
+.logo image{
+  width: 120rpx;
+  height: 120rpx;
+  position: absolute;
+  left: 15px;
+  top: 0;
+  bottom: 0;
+  margin: auto;
+}
+.part{
+  width: 49%;
+  background: #fff;
+  margin-top: 8px;
+  box-shadow:0px 4px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+  position: relative;
+  text-align: left;
+  padding: 15px;
+}
+.part image{
+  width: 80rpx;
+  max-height: 100%;
+  position: absolute;
+  right: 15px;
+  top:0;
+  bottom: 0;
+  margin: auto;
+}
+.part view{
+  color: #333333;
+  font-size: 32rpx;
+}
+.part text{
+  color: #999999;
+  font-size: 24rpx;
+}
+.news{
+  width: 100%;
+  padding: 10px 12px;
+  background: #fff;
+  margin-top: 12px;
+  box-shadow:0px 4px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+}
+.news image{
+  width: 53px;
+  max-height: 30px;
+}
+
+.bottom{
+  background: #fff;
+  margin-top: 12px;
+}
+.tab{
+  border-bottom: 1px solid #F2F3F4;
+  display: flex;
+}
+.tab text{
+  display:block;
+  width: 33.33%;
+  line-height: 44px;
+  text-align: center;
+  color: #999999;
+  font-size: 14px;
+}
+.tab .active{
+  color: #3566FF;
+  border-bottom: 2px solid #3566FF;
+  transition: all .3s linear;
+}
+
+.list{
+  border-bottom: 1px solid #F2F3F4;
+  padding: 15px;
+}
+.list text{
+  color: #999;
+  font-size: 24rpx;
+}

+ 79 - 0
pages/intro/intro.js

@@ -0,0 +1,79 @@
+// pages/intro/intro.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.request({
+      url: host + '/api/wx/article?id=' + options.id,
+      method: 'GET',
+      success: res => {
+        wx.setNavigationBarTitle({
+          title: res.data.data.title,
+        })
+        this.setData({
+          data: res.data.data
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/intro/intro.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 4 - 0
pages/intro/intro.wxml

@@ -0,0 +1,4 @@
+<view class="content">
+    <view class="title">{{data.title}}</view>
+    <view class="zw">{{data.content}}</view>
+</view>

+ 9 - 0
pages/intro/intro.wxss

@@ -0,0 +1,9 @@
+/* pages/intro/intro.wxss */
+.content{
+  padding: 12px;
+}
+.title{
+  font-size: 36rpx;
+  text-align: center;
+  margin-bottom: 12px;
+}

+ 66 - 0
pages/message/message.js

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

+ 3 - 0
pages/message/message.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "消息"
+}

+ 11 - 0
pages/message/message.wxml

@@ -0,0 +1,11 @@
+<view class="content">
+    <navigator url="../showMsg/showMsg" class="list">
+        <view>报名信息审核通过</view>
+        <text>你的报名信息已经审核通过,请尽快去缴费…</text>
+    </navigator>
+
+    <navigator class="list">
+        <view>报名信息审核通过</view>
+        <text>你的报名信息已经审核通过,请尽快去缴费…</text>
+    </navigator>
+</view>

+ 20 - 0
pages/message/message.wxss

@@ -0,0 +1,20 @@
+/* pages/message/message.wxss */
+page{
+  background: #F4F7F9;
+}
+.content{
+  padding: 12px;
+}
+.list{
+  background:rgba(255,255,255,1);
+  box-shadow:0px 2px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+  padding: 16px 12px;
+  margin-bottom: 12px;
+}
+.list view{
+  font-size: 32rpx;
+  color: #222;
+  font-weight: 600;
+  margin-bottom: 5px;
+}

+ 66 - 0
pages/mine/mine.js

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

+ 3 - 0
pages/mine/mine.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "我的"
+}

+ 35 - 0
pages/mine/mine.wxml

@@ -0,0 +1,35 @@
+<view class="bg">
+  <image src="../../images/bg-my.png" mode="widthFix"></image>
+    <view>
+      <view class='photo'><open-data  type="userAvatarUrl"></open-data></view>
+      <open-data class='nickname' type="userNickName"></open-data>
+    </view>
+</view>
+
+<view class="info">
+  <image class="icon" src="../../images/资料.png" mode="widthFix"></image>
+  <view>我的资料</view>
+  <text>实名认证信息</text>
+  <image class="goto" src="../../images/back.png" mode="widthFix"></image>
+</view>
+
+<navigator url='../download/download' class="info">
+  <image class="icon" src="../../images/下载.png" mode="widthFix"></image>
+  <view>资料下载</view>
+  <text>资料下载</text>
+  <image class="goto" src="../../images/back.png" mode="widthFix"></image>
+</navigator>
+
+<navigator url="../online/online" class="info">
+  <image class="icon" src="../../images/试题.png" mode="widthFix"></image>
+  <view>我的试题</view>
+  <text>我的试题</text>
+  <image class="goto" src="../../images/back.png" mode="widthFix"></image>
+</navigator>
+
+<navigator url="../myPapers/myPapers" class="info">
+  <image class="icon" src="../../images/证件.png" mode="widthFix"></image>
+  <view>我的证件</view>
+  <text>我的证件</text>
+  <image class="goto" src="../../images/back.png" mode="widthFix"></image>
+</navigator>

+ 56 - 0
pages/mine/mine.wxss

@@ -0,0 +1,56 @@
+/* pages/mine/mine.wxss */
+.bg{
+  position: relative;
+}
+.bg image{
+  width: 100%;
+}
+.bg>view{
+  width: 100%;
+  position: absolute;
+  top: 0;
+  left: 0;
+  text-align: center;
+}
+.photo{
+  width: 120rpx;
+  height: 120rpx;
+  border-radius: 100%;
+  display: block;
+  margin: 50rpx auto 10rpx;
+  overflow: hidden;
+}
+.nickname{
+  color: #fff;
+  font-size: 32rpx;
+}
+
+.info{
+  margin: 25px 0;
+  padding: 0 130rpx;
+  position: relative;
+}
+.info view{
+  color: #333;
+  font-size: 32rpx;
+}
+.info text{
+  color: #999;
+  font-size: 24rpx;
+}
+.icon{
+  width: 80rpx;
+  position: absolute;
+  left: 30rpx;
+  top: 0;
+  bottom: 0;
+  margin: auto;
+}
+.goto{
+  width: 48rpx;
+  position: absolute;
+  right: 30rpx;
+  top: 0;
+  bottom: 0;
+  margin: auto;
+}

+ 66 - 0
pages/myPapers/myPapers.js

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

+ 3 - 0
pages/myPapers/myPapers.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "我的证件"
+}

+ 6 - 0
pages/myPapers/myPapers.wxml

@@ -0,0 +1,6 @@
+<view class="content">
+    <navigator url="../showMsg/showMsg" class="list">国网查证</navigator>
+    <navigator class="list"> 电子证书 </navigator>
+    <navigator class="list"> 合格证查询 </navigator>
+    <navigator class="list"> 从业人员查询 </navigator>
+</view>

+ 15 - 0
pages/myPapers/myPapers.wxss

@@ -0,0 +1,15 @@
+/* pages/myPapers/myPapers.wxss */
+page{
+  background: #F4F7F9;
+}
+.content{
+  padding: 12px;
+}
+.list{
+  background:rgba(255,255,255,1);
+  box-shadow:0px 2px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+  padding: 16px 12px;
+  margin-bottom: 12px;
+  font-size: 32rpx;
+}

+ 96 - 0
pages/online/online.js

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

+ 3 - 0
pages/online/online.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "培训计划"
+}

+ 55 - 0
pages/online/online.wxml

@@ -0,0 +1,55 @@
+<view class="tab">
+    <text data-id='0' bindtap="tabChange" class="{{tab==0?'act':''}}">视频课程</text>
+    <text data-id='1' bindtap="tabChange" class="{{tab==1?'act':''}}">在线学习</text>
+</view>
+
+<!-- <view class="section">
+  <picker bindchange="bindPickerChange" value="{{index1}}" range="{{array1}}">
+    <view class="picker">
+      {{array1[index1]}}
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+    </view>
+  </picker>
+
+  <picker bindchange="bindPickerChange" value="{{index1}}" range="{{array1}}">
+    <view class="picker">
+      {{array1[index1]}}
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+    </view>
+  </picker>
+
+  <picker bindchange="bindPickerChange" value="{{index1}}" range="{{array1}}">
+    <view class="picker">
+      {{array1[index1]}}
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+    </view>
+  </picker>
+</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}}" class="list">
+      <view class="img">
+      <image  src="{{item.image}}" mode="scaleToFill"></image>
+      <image class="play" src="../../images/play.png" mode="widthFix"></image>
+      </view>
+      <view class="info">
+        <view class="title">{{item.title}}</view>
+        <view>{{item.class_hour}}学时</view>
+        <text>{{item.finished_time}}/{{item.total_time}}</text>
+        <view class="check" style="color:#FF5E4E;" wx:if='{{item.status == 0}}'>未完成</view>
+        <view class="check" wx:else><image src="../../images/gou.png" mode="widthFix"></image>已完成</view>
+      </view>
+  </navigator>
+</view>
+
+<view  wx:if='{{tab==1}}' class="content">
+    <view class="test"  wx:for="{{papers}}" wx:key="*this">
+        <view class="title">{{item.title}}</view>
+        <text>{{item.class_hour}}学时/{{item.full_mark}}分/{{item.time_limit}}分钟</text>
+        <view class="score" wx:if='{{item.status == 0}}'>
+            <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>
+</view>

+ 145 - 0
pages/online/online.wxss

@@ -0,0 +1,145 @@
+/* pages/online/online.wxss */
+page{
+  background: #F4F7F9;
+}
+.content{
+  min-height: 90vh;
+  background: #fff;
+}
+.tab{
+  background: #fff;
+  display: flex;
+  margin-bottom: 12px;
+}
+.tab text{
+  width: 50%;
+  text-align: center;
+  color: #333;
+  line-height: 90rpx;
+  position: relative;
+}
+.tab .act{
+  color: #358BFF;
+  transition: all .3s linear;
+}
+.act::after{
+  content: '';
+  width:24px;
+  height:2px;
+  background:rgba(53,139,255,1);
+  border-radius:2px;
+  position: absolute;
+  left: 0;
+  right: 0;
+  bottom: 5px;
+  margin: auto;
+}
+
+.list{
+  background: #fff;
+  display: flex;
+  padding: 12px;
+}
+.img{
+  width: 35%;
+  border-radius: 4px;
+  overflow: hidden;
+  background: #f5f5f5;
+  position: relative;
+}
+.img image{
+  width: 100%;
+  height: 60px;
+}
+.img .play{
+  width: 48rpx;
+  height: 48rpx;
+  position: absolute;
+  left: 0;
+  top: 0;
+  bottom: 0;
+  right: 0;
+  margin: auto;
+}
+.info{
+  width: 65%;
+  padding-left: 20rpx;
+  position: relative;
+}
+.info view{
+  font-size: 24rpx;
+  color: #333;
+}
+.info .title{
+  font-size: 28rpx;
+  margin-bottom: 10px;
+}
+.info text{
+  font-size: 24rpx;
+  color: #999;
+}
+.info .check{
+  position: absolute;
+  right: 0;
+  bottom: 0;
+  color: #28C06B;
+  font-size: 24rpx;
+}
+.check image{
+  width: 32rpx;
+  position: relative;
+  top: 3px;
+  left: -3px;
+}
+.info .not{
+  color: #FF5E4E;
+}
+
+.test{
+  padding: 12px;
+  border-bottom: 1px solid #F9F9F9;
+}
+.test text{
+  color: #999;
+  font-size: 24rpx;
+}
+.test navigator{
+  float: right;
+  width:64px;
+  height:21px;
+  background:rgba(53,139,255,1);
+  border-radius:16px;
+  line-height: 21px;
+  text-align: center;
+  color: #fff;
+  font-size: 24rpx;
+  
+  position: relative;
+  top: -2px;
+}
+.score{
+  float: right;
+  color: #28C06B;
+  font-size: 24rpx;
+}
+.score image{
+  width: 32rpx;
+  margin-left: 20rpx;
+  position: relative;
+  top: 2px;
+}
+.score text{
+  color: #358BFF;
+  font-size: 28rpx;
+  margin-right: 10px;
+}
+
+.section{
+  display: flex;
+  justify-content: space-between;
+  padding: 12px;
+  background: #fff;
+}
+.section image{
+  width: 32rpx;
+}

+ 76 - 0
pages/onlinePost/onlinePost.js

@@ -0,0 +1,76 @@
+// pages/onlinePost/onlinePost.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    step:1
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+  next:function(){
+    this.setData({
+      step:2
+    })
+  },
+  gotoForm:function(e){
+    let id=e.target.dataset.id
+    wx.navigateTo({
+      url: '../post/post?id='+id,
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/onlinePost/onlinePost.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "在线报名"
+}

File diff suppressed because it is too large
+ 25 - 0
pages/onlinePost/onlinePost.wxml


+ 53 - 0
pages/onlinePost/onlinePost.wxss

@@ -0,0 +1,53 @@
+/* pages/onlinePost/onlinePost.wxss */
+page{
+  background: #F4F7F9;
+}
+.content{
+  
+  margin: 12px 0;
+}
+.step{
+  padding: 12px;
+}
+.step1{
+  line-height: 25px;
+  min-height: 80vh;
+  background: #fff;
+  padding: 12px;
+}
+.step1 view{
+  font-size: 32rpx;
+  font-weight: 600;
+  text-align: center;
+  margin-bottom: 12px;
+}
+.step .btn{
+  width:100%;
+  height:48px;
+  background:rgba(53,139,255,1);
+  border-radius:4px;
+  display: block;
+  line-height: 48px;
+  text-align: center;
+  color: #fff;  
+  margin-top: 20px;
+}
+
+.step2 view{
+  height: 110px;
+  line-height: 110px;
+  padding: 0 20px;
+  background:rgba(255,255,255,1);
+  border-radius:7px;
+  margin-bottom: 20px;
+  position: relative;
+  font-weight: 600;
+}
+.step2 image{
+  width: 100px;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  right: 20px;
+  margin: auto;
+}

+ 120 - 0
pages/plan/plan.js

@@ -0,0 +1,120 @@
+// pages/plan/plan.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+  data: {
+    array1:['特种作业'],
+    array2: [],
+    array3: [],
+    index1:-1,
+    index2: -1,
+    index3: -1,
+    list:[]
+  },
+  onLoad: function (options) {
+    this.getData()
+    wx.request({
+      url: host + '/api/wx/sujectitem',
+      success: res => {
+        this.setData({
+          array1: res.data.data
+        })
+      }
+    })
+  },
+  bindPickerChange:function(e){   
+    if (e.target.dataset.id == 1) {
+      let list = this.data.array1[e.detail.value].children
+      console.log(list)
+      this.setData({
+        index1: e.detail.value,
+        array2:list,
+        array3:[],
+        index2:-1,
+        index3: -1
+      })
+    };
+    if (e.target.dataset.id == 2) {
+      let list = this.data.array2[e.detail.value].children
+      this.setData({
+        index2: e.detail.value,
+        array3: list,
+        index3: -1
+      })
+    };
+    if (e.target.dataset.id == 3) {
+      this.setData({
+        index3: e.detail.value
+      })
+    };
+    this.getData();
+  },
+  getData:function(){
+    var parm={}
+    if (this.data.index1>=0){
+      parm.subject_item0 = this.data.array1[this.data.index1].name
+    }
+    if (this.data.index2 >= 0) {
+      parm.subject_item1 = this.data.array2[this.data.index2].name
+    }
+    if (this.data.index3 >= 0) {
+      parm.subject_item2 = this.data.array3[this.data.index3].name
+    }  
+    wx.request({
+      url: host+'/api/wx/class/list',
+      method:'GET',
+      data: parm,
+      success:res=>{
+        this.setData({
+          list:res.data.data
+        })
+      }
+    })
+  },
+
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/plan/plan.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "安全培训计划"
+}

+ 38 - 0
pages/plan/plan.wxml

@@ -0,0 +1,38 @@
+<view class="section">
+  <picker data-id='1' bindchange="bindPickerChange" value="{{index1}}" range="{{array1}}" range-key="name">
+    <view class="picker">
+    <text wx:if="{{index1<0}}">请选择</text>
+      {{array1[index1].name}}
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+    </view>
+  </picker>
+
+  <picker data-id='2' bindchange="bindPickerChange" value="{{index2}}" range="{{array2}}" range-key="name">
+    <view class="picker">
+    <text wx:if="{{index2<0}}">请选择</text>
+      {{array2[index2].name}}
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+    </view>
+  </picker>
+
+  <picker data-id='3' bindchange="bindPickerChange" value="{{index3}}" range="{{array3}}" range-key="name">
+    <view class="picker">
+    <text wx:if="{{index3<0}}">请选择</text>
+      {{array3[index3].name}}
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+    </view>
+  </picker>
+</view>
+
+<view class="content">
+  <view class="list" wx:for="{{list}}" wx:key="*this">
+      <view class="title">{{item.type}}培训班</view>
+      <view class="kc" wx:for="{{item.classes}}" wx:for-item="class" wx:key="*this">
+          <text>{{class.class_time}}<text class="price">¥{{class.price}}</text></text>
+          <text decode="{{true}}">开班时间&nbsp;&nbsp;&nbsp;{{class.class_time}}  </text>
+          <text decode="{{true}}">开班人数&nbsp;&nbsp;&nbsp;{{class.thresh_count}}</text>
+          <text decode="{{true}}">&nbsp;&nbsp;&nbsp;已报名&nbsp;&nbsp;&nbsp;{{class.signuped_count}}</text>
+          <navigator url="../post/post?class_id={{class.id}}&price={{class.price}}"  class="apply">报名</navigator>
+      </view>
+  </view>
+</view>

+ 59 - 0
pages/plan/plan.wxss

@@ -0,0 +1,59 @@
+/* pages/plan/plan.wxss */
+page{
+  background: #F4F7F9;
+}
+.section{
+  display: flex;
+  justify-content: space-between;
+  padding: 12px;
+  background: #fff;
+}
+.section image{
+  width: 32rpx;
+}
+
+.content{
+  padding: 12px;
+}
+.list{
+  background: #fff;
+  box-shadow:0px 2px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+  margin-bottom: 12px;
+  
+}
+.title{
+  color: #222;
+  font-size: 32rpx;
+  padding: 12px;
+  font-weight: 600;
+  border-bottom: 1px solid #F2F3F4;
+}
+.kc{
+  color: #222;
+  font-size: 28rpx;
+  border-bottom: 1px solid #F2F3F4;
+  padding: 12px;
+  position: relative;
+}
+.kc>text{
+  display: block;
+  line-height: 23px;
+}
+.price{
+  float: right;
+  color: #E85546;
+  font-size: 28rpx;
+}
+.apply{
+  width:88px;
+  height:32px;
+  background:rgba(53,139,255,1);
+  border-radius:16px;
+  position: absolute;
+  text-align: center;
+  color: #fff;
+  right: 12px;
+  bottom: 12px;
+  line-height: 32px;
+}

+ 283 - 0
pages/post/post.js

@@ -0,0 +1,283 @@
+// pages/post/post.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    sexArray: ["男","女"],    //性别
+    recordArray: ["小学", "初中", "高中", "大专", "本科","硕士","博士"], //学历
+    categoryArray: [{ label: '电工', id: 0 }, { label: '水工', id: 1 }], //作业类别
+    subjectArray: [{name:'请选择'}],    //准操项目
+    trainArray: [{ name: '新办', intro: '第一次取证;或者以前取证了没有按规定的时间复审、换证' }, 
+    { name: '复审', intro: '已取证;复审日期一天都不超最好提前3个月' }, 
+    { name: '换证', intro: '有效期满提前三个月' }],    //培训类型
+    receiveArray: ['自取','邮寄(将产生邮寄费用)'],    //领取类型
+    sex:0,
+    record:0,
+    category:-1,
+    subject:-1,
+    train:-1,
+    receive:0,
+    area: ['四川省', '成都市', '锦江区'],
+    time:'2020-01-01',
+    price:'0.00',
+    classList:[],
+    class_:-1,
+    class_id:0
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if(options.id){
+        wx.request({
+          url: host+'/api/wx/signup',
+          method:'GET',
+          data:{id:options.id},
+          success:res=>{
+            console.log(res.data)
+          }
+        })
+    }
+    if(options.class_id){
+      this.setData({
+        class_id: options.class_id,
+        price: options.price
+      })
+    }else{
+      wx.request({
+        url: host + '/api/wx/sujectitem',
+        success: res => {
+          let list = res.data.data.filter(item => item.name == options.id)
+          this.setData({
+            categoryArray: list[0].children,
+            z_type: options.id
+          })
+        }
+      })
+      wx.request({
+        url: host + '/api/wx/class/list',
+        method: 'GET',
+        success: res => {
+          let list = res.data.data.filter(item => item.type == options.id)
+          this.setData({
+            classList: list[0].classes
+          })
+        }
+      })
+    }
+      
+      
+  },
+  pickerChange:function(e){
+    if(e.target.dataset.name == 'sex'){
+      this.setData({
+        sex: e.detail.value
+      })
+    };
+    if (e.target.dataset.name == 'record') {
+      this.setData({
+        record: e.detail.value
+      })
+    };
+    if (e.target.dataset.name == 'category') {
+      let list = this.data.categoryArray[e.detail.value].children
+      this.setData({
+        category: e.detail.value,
+        subjectArray: list,
+        subject:-1,
+        train:-1
+      })
+    };
+    if (e.target.dataset.name == 'subject') {
+      this.setData({
+        subject: e.detail.value,
+        train: -1
+      })
+    };
+    if (e.target.dataset.name == 'time') {
+      this.setData({
+        time: e.detail.value
+      })
+    };
+    if (e.target.dataset.name == 'train') {
+      var price=this.data.price
+      if(!this.data.class_id && this.data.category>=0 && this.data.subject>=0){
+        if (e.detail.value == 0){
+          price = this.data.categoryArray[this.data.category].price_new
+        }
+        if (e.detail.value == 1) {
+          price = this.data.categoryArray[this.data.category].price_re
+        }
+        if (e.detail.value == 2) {
+          price = this.data.categoryArray[this.data.category].price_change
+        }
+      }
+      this.setData({
+        train: e.detail.value,
+        price: price
+      })
+    };
+    if (e.target.dataset.name == 'area') {
+      this.setData({
+        area: e.detail.value
+      })      
+    };
+    if (e.target.dataset.name == 'receive') {
+      this.setData({
+        receive: e.detail.value
+      })
+    };
+    if (e.target.dataset.name == 'class_') {
+      this.setData({
+        class_: e.detail.value
+      })
+    };
+    
+  },
+  next:function(e){
+    var formData = e.detail.value,data=this.data
+    if (formData.name == '') {
+      wx.showToast({
+        title: '姓名不能为空!',
+        icon: 'none',
+        duration: 2000
+      })
+      return false
+    }
+    if (formData.idno == '') {
+      wx.showToast({
+        title: '身份证不能为空!',
+        icon: 'none',
+        duration: 2000
+      })
+      return false
+    }
+    if (formData.phone == '') {
+      wx.showToast({
+        title: '手机号不能为空!',
+        icon: 'none',
+        duration: 2000
+      })
+      return false
+    }
+    if(!this.data.class_id){
+      if (this.data.category == -1) {
+        wx.showToast({
+          title: '请选择作业类别',
+          icon: 'none',
+          duration: 2000
+        })
+        return false
+      }
+      if (this.data.subject == -1) {
+        wx.showToast({
+          title: '请选择准操项目或资格类型',
+          icon: 'none',
+          duration: 2000
+        })
+        return false
+      }
+      if (this.data.train == -1) {
+        wx.showToast({
+          title: '请选择培训类型',
+          icon: 'none',
+          duration: 2000
+        })
+        return false
+      }
+      if (this.data.class_ == -1) {
+        wx.showToast({
+          title: '请选择班级',
+          icon: 'none',
+          duration: 2000
+        })
+        return false
+      }
+    }
+    if (!this.data.class_id) {
+      formData.subject_item = data.z_type+"|"+data.categoryArray[data.category].name+"|"+data.subjectArray[data.subject].name
+      formData.subject_id = data.subjectArray[data.subject].id    
+      formData.sex=data.sexArray[data.sex]
+      formData.education = data.recordArray[data.record]
+      formData.receive_card = data.receiveArray[data.receive]
+      formData.class_id = data.classList[data.class_].id
+    }else{
+      formData.class_id = this.data.class_id
+    }
+    formData.train_type = data.trainArray[data.train].name
+    formData.price=this.data.price
+    formData.area=this.data.area.join('')
+    wx.showLoading({
+      title: '',
+    })
+    wx.request({
+      url: host + '/api/wx/signup',
+      method: 'POST',
+      header: {
+        openid: this.data.openid
+      },
+      data: formData,
+      success: res => {
+        wx.hideLoading()
+        wx.navigateTo({
+          url: '../upload/upload?id='+res.data.data.id,
+        })
+      }
+    })
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/post/post.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "在线培训"
+}

+ 138 - 0
pages/post/post.wxml

@@ -0,0 +1,138 @@
+<form catchsubmit="next">
+  <view class="item">
+      <label>姓名</label>
+      <input  name='name' placeholder="请输入您的姓名"></input>
+  </view>
+
+  <view class="item">
+      <label>性别</label>
+      <picker name='sex' data-name='sex' bindchange="pickerChange" value="{{sex}}" range="{{sexArray}}">
+        <view class="picker">
+          {{sexArray[sex]}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+  </view>
+
+  <view class="item">
+      <label>身份证</label>
+      <input name='idno' type="idcard" placeholder="请输入您的身份证"></input>
+  </view>
+
+  <view class="item">
+      <label>文化程度</label>
+      <picker name='education' data-name='record'  bindchange="pickerChange" value="{{record}}" range="{{recordArray}}">
+        <view class="picker">
+          {{recordArray[record]}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+  </view>
+
+  <view class="item">
+      <label>手机号</label>
+      <input name='phone' type="number" placeholder="请输入您的手机号"></input>
+  </view>
+
+  <view class="item">
+      <label>单位全称</label>
+      <input name='company' placeholder="请输入您的单位名称"></input>
+  </view>
+
+  <view class="item" wx:if="{{!class_id}}">
+      <label>作业类别</label>
+      <picker  data-name='category'  bindchange="pickerChange" value="{{category}}" range="{{categoryArray}}" range-key="name">
+        <view class="picker">
+          <text wx:if="{{category<0}}">请选择</text>
+          {{categoryArray[category].name}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+
+      <view wx:if="{{category>=0}}" class="intro">{{categoryArray[category].intro}}</view>
+  </view>
+
+  <view class="item" wx:if="{{!class_id}}">
+      <label wx:if="{{z_type == '特种作业'}}">准操项目</label>
+      <label wx:else>资格类型</label>
+      <picker  data-name='subject'  bindchange="pickerChange" value="{{subject}}" range="{{subjectArray}}" range-key="name">
+        <view class="picker">
+        <text wx:if="{{subject<0}}">请选择</text>
+          {{subjectArray[subject].name}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+      <view wx:if="{{subject>=0}}" class="intro">{{subjectArray[subject].intro}}</view>
+  </view>
+
+  <view class="item">
+      <label>培训类型</label>
+      <picker name='train_type' data-name='train'  bindchange="pickerChange" value="{{train}}" range="{{trainArray}}" range-key="name">
+        <view class="picker">
+        <text wx:if="{{train<0}}">请选择</text>
+          {{trainArray[train].name}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+      <view wx:if="{{train>=0}}" class="intro">{{trainArray[train].intro}}</view>
+  </view>
+
+  <view class="item" wx:if="{{!class_id}}">
+      <label>班级</label>
+      <picker  data-name='class_'  bindchange="pickerChange" value="{{class_}}" range="{{classList}}" range-key="class_name">
+        <view class="picker">
+        <text wx:if="{{class_<0}}">请选择</text>
+          {{classList[class_].class_name}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+  </view>
+
+  <!-- <view class="item">
+      <label>培训时间</label>
+      <picker name='time' data-name='time' value="{{time}}"  mode="date" bindchange="pickerChange">
+        <view class="picker">
+          {{time}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+  </view> -->
+
+  <view class="item">
+      <label>领取方式</label>
+      <picker name='receive_card' data-name='receive'  bindchange="pickerChange" value="{{receive}}" range="{{receiveArray}}">
+        <view class="picker">
+          {{receiveArray[receive]}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+  </view>
+
+  <view class="item">
+      <label>所在地区</label>
+      <picker name='area' data-name='area' value="{{area}}"  mode="region" bindchange="pickerChange">
+        <view class="picker">
+          {{area[0]}}{{area[1]}}{{area[2]}}
+        </view>
+      </picker>
+      <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
+  </view>
+  <view class="item" wx:if="{{receive==1}}">
+      <label>详细地址</label>
+      <input name='address' placeholder="请输入您的详细地址"></input>
+  </view>
+
+  <view class="item">
+      <label>备注</label>
+      <input name='remark' placeholder="请输入您的备注"></input>
+  </view>
+
+  <view class="fee">
+    <label>培训费用</label>¥{{price}}
+  </view>
+  <view class="fee">
+    <label>审核后需支付费用</label>¥{{price}}
+  </view>
+
+  <view class="post"><button formType="submit">下一步,上传资料</button></view>
+</form>

+ 63 - 0
pages/post/post.wxss

@@ -0,0 +1,63 @@
+/* pages/post/post.wxss */
+page{
+  background: #F4F7F9;
+}
+form{
+  background: #fff;
+  margin-top: 12px;
+  display: block;
+}
+.item{
+  border-bottom: 1px solid #F2F3F4;
+  padding: 15px;
+  position: relative;
+}
+.item label{
+  color: #222;
+  display: inline-block;
+  width: 60px;
+  vertical-align: middle;
+  text-align: right;
+}
+.item input,.item picker{
+  display: inline-block;
+  width: 70%;
+  border: none;
+  padding-left: 20px;
+  vertical-align: middle;
+}
+.item image{
+  position: absolute;
+  right: 12px;
+  width: 16px;
+  top:20px;
+}
+
+.fee{
+  text-align: right;
+  color: #E85546;
+  margin-top:10px;
+  padding: 0 12px;
+}
+.fee label{
+  color: #222;
+  margin-right: 20px;
+}
+
+.post{
+  padding:20px 12px;
+}
+.post button{
+  width: 100% !important;
+  height:96rpx;
+  background:rgba(53,139,255,1);
+  border-radius:4px;
+  color: #fff;
+  line-height: 96rpx;
+  padding: 0;
+}
+.intro{
+  margin-top: 12px;
+  color: #358BFF;
+  font-size: 24rpx;
+}

+ 66 - 0
pages/showMsg/showMsg.js

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

+ 3 - 0
pages/showMsg/showMsg.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "消息"
+}

+ 4 - 0
pages/showMsg/showMsg.wxml

@@ -0,0 +1,4 @@
+<view class="title">报名信息审核通过</view>
+<view class="content">
+  你的报名信息已经审核通过,请尽快去缴费…你的报名信息已经审核通过,请尽快去缴费…你的报名信息已经审核通过,请尽快去缴费…
+</view>

+ 13 - 0
pages/showMsg/showMsg.wxss

@@ -0,0 +1,13 @@
+/* pages/showMsg/showMsg.wxss */
+.title{
+  padding: 12px;
+  font-size: 32rpx;
+  color: #222;
+  font-weight: 600;
+  margin-bottom: 10px;
+  text-align: center;
+}
+.content{
+  line-height: 25px;
+  padding: 12px;
+}

+ 156 - 0
pages/subject/subject.js

@@ -0,0 +1,156 @@
+// pages/subject/subject.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    data:{},
+    idx:1,
+    ans:[],
+    id:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+      wx.request({
+        url: host+'/api/wx/paper/info',
+        data: { id: options.id},
+        method:'GET',
+        success:res=>{
+          this.setData({
+            data:res.data.data,
+            id:options.id
+          })
+          this.countDown(res.data.data.time_limit)
+        }
+      })
+  },
+  countDown:function(time){
+    var m=time-1,s=59,_this=this;
+    var down=setInterval(function(){
+        s--
+        if(s==0 && m>0){
+          m--;
+          s=59
+        }
+        if(s==0 && m == 0){
+          clearInterval(down)
+          _this.post();
+        }
+        _this.setData({
+          time:m+"分"+s+"秒"
+        })
+    },1000)
+  },
+  answer:function(e){
+    let id = e.target.dataset.id, value = e.detail.value
+    let ans = this.data.ans
+    let old=ans.filter(item=>item.id == id)
+    if (old.length>0){
+      for (let i = 0; i < ans.length; i++) {
+        if (ans[i].id == id) {
+          ans[i].answer = e.detail.value
+        }
+      }
+    }else{
+      ans.push({
+        id:id,
+        answer:value
+      })
+    }
+    this.setData({
+      ans:ans
+    })
+    
+  },
+  next:function(){
+    const idx=this.data.idx+1
+    this.setData({
+      idx:idx
+    })
+  },
+  prev: function () {
+    const idx = this.data.idx - 1
+    this.setData({
+      idx: idx
+    })
+  },
+  post:function(){
+      wx.request({
+        url: host+'/api/wx/postpaper',
+        data:{
+          paper_id:this.data.id,
+          questions:this.data.ans
+        },
+        method:'POST',
+        success:res=>{
+          console.log(res.data)
+          if(res.data.status == 'suc'){
+            wx.showToast({
+              title: '提交成功',
+              icon: 'success',
+              duration: 2000
+            })
+            setTimeout(function () {
+              wx.navigateTo({
+                url: '../online/online',
+              })
+            }, 2000)
+          }
+        }
+      })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/subject/subject.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "开始做题"
+}

+ 29 - 0
pages/subject/subject.wxml

@@ -0,0 +1,29 @@
+<view class="top">
+  满分{{data.full_mark}}分/{{data.time_limit}}分钟
+  <text bindtap="post">交卷</text>
+  <view class="count">倒计时 {{time}}</view>
+</view>
+<!-- 判断 -->
+<view class="content" wx:for="{{data.questions}}"  wx:if="{{idx == index+1}}">
+    <view class="num">{{index+1}}、
+    <image wx:if="{{item.type == 1}}" src="../../images/单选.svg" mode="widthFix"></image>
+    <image wx:if="{{item.type == 2}}" src="../../images/多选.svg" mode="widthFix"></image>
+    <image wx:if="{{item.type == 3}}" src="../../images/判断.svg" mode="widthFix"></image>
+    </view>
+    <view class="ques">  {{item.title}}  </view>
+    <view class="ans">
+        <checkbox-group wx:if="{{item.type == 2}}" bindchange='answer' data-id='{{item.id}}'>
+            <view wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this">
+            <checkbox color="#358BFF" value="{{opt[0]}}">{{opt}}</checkbox></view>
+        </checkbox-group>
+        <radio-group wx:else bindchange='answer' data-id='{{item.id}}'>
+            <view wx:for="{{item.options}}" wx:for-item="opt" wx:key="*this">
+            <radio color="#358BFF" value="{{opt[0]}}">{{opt}}</radio></view>
+        </radio-group>
+    </view>
+</view> 
+
+<view class="btn">
+    <text class="{{idx<=1?'hide':''}}" bindtap="prev">上一题</text>
+    <text class="{{idx>=data.questions.length?'hide':''}}" bindtap="next">下一题</text>
+</view>

+ 64 - 0
pages/subject/subject.wxss

@@ -0,0 +1,64 @@
+/* pages/subject/subject.wxss */
+.top{
+  padding: 12px;
+}
+.top text{
+  width:60px;
+  height:28px;
+  border-radius:16px;
+  border:1px solid rgba(153,153,153,1);
+  text-align: center;
+  line-height: 28px;
+  float: right;
+  position: relative;
+  top: -3px;
+}
+.count{
+  position: absolute;
+  top: 55px;
+  right: 12px;
+  color: #358BFF;
+  text-align: right;
+}
+.content{
+  padding: 0 12px;
+  transition: all .3s linear;
+}
+.num{
+  margin: 12px 0;
+}
+.num image{
+  width: 38px;
+  position: relative;
+  top: 2px;
+}
+.ques{
+  margin-bottom: 120rpx;
+}
+.ans view{
+  margin-bottom: 24px;
+  padding-left: 10px;
+}
+
+.btn{
+  position: fixed;
+  width: 100%;
+  left: 0;
+  z-index: 9;
+  bottom: 80rpx;
+  display: flex;
+  justify-content: space-between;
+  padding: 0 24px;
+}
+.btn text{
+  width:100px;
+  height:40px;
+  background:rgba(212,230,255,1);
+  border-radius:31px;
+  display: block;
+  text-align: center;
+  line-height: 40px;
+}
+.btn .hide{
+  visibility: hidden;
+}

+ 193 - 0
pages/upload/upload.js

@@ -0,0 +1,193 @@
+// pages/upload/upload.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    show:false,
+    idnoimg_face: "", //正面照
+    idnoimg_back: "", //反面照
+    halfbody_img: "", //半身照
+    education_img: "", //学历照
+    id:''
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.setData({
+      id:JSON.parse(options.id),
+      openid: app.globalData.openid
+    })
+  },
+  post:function(){
+    var formData ={}
+    formData.id=this.data.id
+    
+    formData.idnoimg_face = this.data.idnoimg_face
+    formData.idnoimg_back = this.data.idnoimg_back
+    formData.halfbody_img = this.data.halfbody_img
+    formData.education_img = this.data.education_img
+    if (formData.idnoimg_face == '') {
+      wx.showToast({
+        title: '正面照不存在!',
+        icon: 'none',
+        duration: 2000
+      })
+      return false
+    }
+    if (formData.idnoimg_back == '') {
+      wx.showToast({
+        title: '反面照不存在!',
+        icon: 'none',
+        duration: 2000
+      })
+      return false
+    }
+    if (formData.halfbody_img == '') {
+      wx.showToast({
+        title: '半身照不存在!',
+        icon: 'none',
+        duration: 2000
+      })
+      return false
+    }
+    if (formData.education_img == '') {
+      wx.showToast({
+        title: '学历照不存在!',
+        icon: 'none',
+        duration: 2000
+      })
+      return false
+    }
+    wx.request({
+      url: host+'/api/wx/signup',
+      method:'PUT',
+      header: {
+        openid: this.data.openid
+      },
+      data: formData,
+      success:res=>{
+        if(res.data.status == 'suc'){
+          wx.showToast({
+            title: '提交成功',
+            icon: 'success',
+            duration: 2000
+          })
+          setTimeout(function(){
+              wx.switchTab({
+                url: '../apply/apply',
+              })
+          },2000)
+        }
+      }
+    })
+  },
+  showImg:function(e){
+    this.setData({
+      show:true
+    })
+    if (e.target.dataset.name == 0){
+
+    }
+  },
+  hideImg: function (e) {
+    this.setData({
+      show: false
+    })
+  },
+  takePhoto:function(e){
+    let id=e.target.dataset.id
+    var _this=this
+    wx.chooseImage({
+      count:1,
+      success: function(res) {
+        console.log(res.tempFilePaths[0])
+        wx.uploadFile({
+          url: host+'/api/wx/uploadfile',
+          filePath: res.tempFilePaths[0],
+          name: 'file',
+          formData: {
+            'file': res.tempFilePaths[0]
+          },
+          success:res=>{
+            var data=JSON.parse(res.data)
+            console.log(data)
+            if(id == 1){  //正面
+              _this.setData({
+                idnoimg_face: data.data.url
+              })
+            }
+            if (id == 2) {  //反面
+              _this.setData({
+                idnoimg_back: data.data.url
+              })
+            }
+            if (id == 3) {  //半身照
+              _this.setData({
+                halfbody_img: data.data.url
+              })
+            }
+            if (id == 4) {  //学历照
+              _this.setData({
+                education_img: data.data.url
+              })
+            }
+          }
+        })
+      },
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/upload/upload.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "上传证件资料"
+}

+ 41 - 0
pages/upload/upload.wxml

@@ -0,0 +1,41 @@
+<view class="content">
+<!-- <camera device-position="front" flash="off" frame-size='medium'></camera> -->
+  <view class="item">
+      <image wx:if='{{idnoimg_face}}' data-id='1' bindtap="takePhoto" src="{{idnoimg_face}}" mode="widthFix"></image>
+      <image wx:else data-id='1' bindtap="takePhoto" src="../../images/upload.png" mode="widthFix"></image>
+      <view class="title">身份证正面照,务必保持清晰</view>
+      <text>注意:拍完整不能斜着拍,和复印效果一样!</text>
+      <view data-id='0' bindtap="showImg" class="tips">点击查看参考图片</view>
+  </view>
+
+  <view class="item">
+      <image wx:if='{{idnoimg_face}}' data-id='2' bindtap="takePhoto" src="{{idnoimg_face}}" mode="widthFix"></image>
+      <image wx:else data-id='2' bindtap="takePhoto" src="../../images/upload.png" mode="widthFix"></image>
+      <view class="title">身份证反面照,务必保持清晰</view>
+      <text>注意:拍完整不能斜着拍,和复印效果一样!</text>
+      <view data-id='1' bindtap="showImg" class="tips">点击查看参考图片</view>
+  </view>
+
+  <view class="item">
+      <image wx:if='{{idnoimg_face}}' data-id='3' bindtap="takePhoto" src="{{idnoimg_face}}" mode="widthFix"></image>
+      <image wx:else data-id='3' bindtap="takePhoto" src="../../images/upload.png" mode="widthFix"></image>
+      <view class="title">上半身照,务必保持清晰</view>
+      <text>注意:头像大小与1寸照片相近,纯色背景,不能穿红色衣服!</text>
+      <view data-id='2' bindtap="showImg" class="tips" style="margin:0;">点击查看参考图片</view>
+  </view>
+
+  <view class="item">
+      <image wx:if='{{idnoimg_face}}' data-id='4' bindtap="takePhoto" src="{{idnoimg_face}}" mode="widthFix"></image>
+      <image wx:else data-id='4' bindtap="takePhoto" src="../../images/upload.png" mode="widthFix"></image>
+      <view class="title">毕业证书照或户口本个人现实学历页,务必保持清晰!</view>
+      <text>注意:拍完整不能斜着拍,和复印效果一样!</text>
+      <view data-id='3' bindtap="showImg" class="tips" style="margin:0;">点击查看参考图片</view>
+  </view>
+
+  <view bindtap="post" class="post">提交资料</view>
+</view>
+
+
+<view class="model {{show?'show':''}}" bindtap="hideImg">
+  <image src="../../images/upload.png" mode="widthFix"></image>
+</view>

+ 66 - 0
pages/upload/upload.wxss

@@ -0,0 +1,66 @@
+/* pages/upload/upload.wxss */
+page{
+  background: #F4F7F9;
+}
+.content{
+  background: #fff;
+  margin-top: 12px;
+  padding: 10px 12px;
+}
+.item{
+  padding:10px 200rpx;
+  position: relative;
+  padding-right: 0;
+}
+.item image{
+  width: 160rpx;
+  position: absolute;
+  left: 20rpx;
+  top: 0;
+  bottom: 0;
+  margin: auto;
+}
+.title{
+  color: #333;
+}
+.item text{
+  color: #E85546;
+  font-size: 24rpx;
+}
+.tips{
+  color: #358BFF;
+  margin-top: 36rpx;
+}
+.post{
+  width: 100%;
+  height:96rpx;
+  background:rgba(53,139,255,1);
+  border-radius:4px;
+  color: #fff;
+  line-height: 96rpx;
+  margin-top: 130rpx;
+  text-align: center;
+}
+
+.model{
+  position: fixed;
+  z-index: 9;
+  background: rgba(0,0,0,.5);
+  width: 100%;
+  height: 100vh;
+  top: 0;
+  left: 0;
+  display: none;
+}
+.show{
+  display: block;
+}
+.model image{
+  width: 80%;
+  position: absolute;
+  top:0;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  margin: auto;
+}

+ 72 - 0
pages/video/video.js

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

+ 3 - 0
pages/video/video.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "视频课程"
+}

+ 1 - 0
pages/video/video.wxml

@@ -0,0 +1 @@
+<video src='{{url}}' title="{{title}}" initial-time='{{time}}'></video>

+ 4 - 0
pages/video/video.wxss

@@ -0,0 +1,4 @@
+/* pages/video/video.wxss */
+video{
+  width: 100%;
+}

+ 0 - 0
project.config.json


Some files were not shown because too many files changed in this diff