tanyanfei 4 years ago
parent
commit
fbb64dbadb

+ 1 - 1
app.json

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

+ 3 - 0
app.wxss

@@ -40,4 +40,7 @@ view,navigator{
   border-top-right-radius: 0;
   padding: 0;
   line-height: 48px;
+}
+image{
+  max-height: 100%;
 }

+ 1 - 1
pages/apply/apply.wxml

@@ -11,7 +11,7 @@
             <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 wx:if="{{item.order_status == 2||item.order_status == 3}}" 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>

+ 11 - 1
pages/intro/intro.js

@@ -24,10 +24,20 @@ Page({
         this.setData({
           data: res.data.data
         })
+        this.init()
       }
     })
   },
-
+  init:function(){
+    const query = wx.createSelectorQuery()
+    const that=this
+    query.select('#editor').context(function (res) {
+      res.context.setContents({
+         html: that.data.data.content
+        })
+      })
+      .exec()
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */

+ 2 - 1
pages/intro/intro.wxml

@@ -1,4 +1,5 @@
 <view class="content">
     <view class="title">{{data.title}}</view>
-    <view class="zw">{{data.content}}</view>
+    <editor read-only="{{true}}" id="editor"  class="ql-container">
+    </editor>
 </view>

+ 2 - 2
pages/mine/mine.wxml

@@ -6,12 +6,12 @@
     </view>
 </view>
 
-<view class="info">
+<navigator class="info" url="../user/user">
   <image class="icon" src="../../images/zl.png" mode="widthFix"></image>
   <view>我的资料</view>
   <text>实名认证信息</text>
   <image class="goto" src="../../images/back.png" mode="widthFix"></image>
-</view>
+</navigator>
 
 <navigator url='../download/download' class="info">
   <image class="icon" src="../../images/xz.png" mode="widthFix"></image>

+ 1 - 1
pages/online/online.wxml

@@ -36,7 +36,7 @@
         <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" style="color:#FF5E4E;" wx:if='{{item.status == 1}}'>未完成</view>
         <view class="check" wx:else><image src="../../images/gou.png" mode="widthFix"></image>已完成</view>
       </view>
   </navigator>

+ 13 - 3
pages/onlinePost/onlinePost.js

@@ -1,4 +1,6 @@
 // pages/onlinePost/onlinePost.js
+const app = getApp()
+const host = app.globalData.host;
 Page({
 
   /**
@@ -12,7 +14,15 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-
+    wx.request({
+      url: host + '/api/wx/sujectitem',
+      success: res => {
+        // let list = res.data.data.filter(item => item.name == options.name)
+        this.setData({
+          list: res.data.data
+        })
+      }
+    })
   },
   next:function(){
     this.setData({
@@ -20,9 +30,9 @@ Page({
     })
   },
   gotoForm:function(e){
-    let id=e.target.dataset.id
+    let id = e.target.dataset.id, name = e.target.dataset.name
     wx.navigateTo({
-      url: '../post/post?name='+id,
+      url: '../post/post?name='+name+'&&s_id='+id,
     })
   },
   /**

+ 6 - 6
pages/onlinePost/onlinePost.wxml

@@ -9,17 +9,17 @@
   </view>
   
   <view class="step step2" wx:if="{{step==2}}">
-    <view bindtap="gotoForm" data-id='特种作业'>
-        特种作业人员
-        <image src="../../images/type1.svg" mode="widthFix"></image>
+    <view wx:for="{{list}}" bindtap="gotoForm" data-id='{{item.id}}' data-name='{{item.name}}'>
+        {{item.name}}
+        <!-- <image src="../../images/type1.svg" mode="widthFix"></image> -->
     </view>
-    <view bindtap="gotoForm" data-id='安全生产'>
+    <!-- <view bindtap="gotoForm" data-id='负责人、安全生产管理人员'>
         负责人、安全生产管理人员
         <image src="../../images/type2.svg" mode="widthFix"></image>
     </view>
-    <view bindtap="gotoForm">
+    <view bindtap="gotoForm" data-id='其他安全生产培训'>
         其他安全生产培训
         <image src="../../images/type3.svg" mode="widthFix"></image>
-    </view>
+    </view> -->
   </view>
 </view>

+ 4 - 4
pages/post/post.js

@@ -58,17 +58,17 @@ Page({
           let list = res.data.data.filter(item => item.name == options.name)
           this.setData({
             categoryArray: list[0].children,
-            z_type: options.id
+            z_type: options.name
           })
         }
       })
       wx.request({
-        url: host + '/api/wx/class/list',
+        url: host + '/api/wx/class/list?subject_item0=' + options.s_id,
         method: 'GET',
         success: res => {
-          let list = res.data.data.filter(item => item.type == options.name)
+          // let list = res.data.data.filter(item => item.type == options.name)
           this.setData({
-            classList: list[0].classes
+            classList: res.data.data[0].classes
           })
         }
       })

+ 3 - 3
pages/upload/upload.wxml

@@ -9,7 +9,7 @@
   </view>
 
   <view class="item">
-      <image wx:if='{{idnoimg_face}}' data-id='2' bindtap="takePhoto" src="{{idnoimg_face}}" mode="widthFix"></image>
+      <image wx:if='{{idnoimg_back}}' data-id='2' bindtap="takePhoto" src="{{idnoimg_back}}" mode="widthFix"></image>
       <image wx:else data-id='2' bindtap="takePhoto" src="../../images/upload.png" mode="widthFix"></image>
       <view class="title">身份证反面照,务必保持清晰</view>
       <text>注意:拍完整不能斜着拍,和复印效果一样!</text>
@@ -17,7 +17,7 @@
   </view>
 
   <view class="item">
-      <image wx:if='{{idnoimg_face}}' data-id='3' bindtap="takePhoto" src="{{idnoimg_face}}" mode="widthFix"></image>
+      <image wx:if='{{halfbody_img}}' data-id='3' bindtap="takePhoto" src="{{halfbody_img}}" 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>
@@ -25,7 +25,7 @@
   </view>
 
   <view class="item">
-      <image wx:if='{{idnoimg_face}}' data-id='4' bindtap="takePhoto" src="{{idnoimg_face}}" mode="widthFix"></image>
+      <image wx:if='{{education_img}}' data-id='4' bindtap="takePhoto" src="{{education_img}}" mode="widthFix"></image>
       <image wx:else data-id='4' bindtap="takePhoto" src="../../images/upload.png" mode="widthFix"></image>
       <view class="title">毕业证书照或户口本个人现实学历页,务必保持清晰!</view>
       <text>注意:拍完整不能斜着拍,和复印效果一样!</text>

+ 189 - 0
pages/user/user.js

@@ -0,0 +1,189 @@
+// pages/user/user.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    sexArray: ["女","男"],    //性别
+    recordArray: ["小学", "初中", "高中", "大专", "本科", "硕士", "博士"], //学历
+    sex: 0,
+    record: 0,
+    show: false,
+    data:{
+
+    }
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.request({
+      url: host+'/api/wx/authinfo',
+      header: {
+        openid: app.globalData.openid
+      },
+      success:res=>{
+        let edu = this.data.recordArray.indexOf(res.data.data.education)
+        this.setData({
+          data:res.data.data,
+          sex:res.data.data.sex,
+          record:edu,
+          // name: res.data.data.name,
+          // idno: res.data.data.idno,
+          // phone: res.data.data.phone,
+          // company: res.data.data.company,
+        })
+        
+      }
+    })
+  },
+  inputChange:function(e){
+    var data=this.data.data
+    data[e.target.dataset.name] = e.detail.value
+    console.log(data)
+    this.setData({
+      data: data
+    })
+  },
+  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
+      })
+    };
+  },
+  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.showLoading({
+          title: '正在上传',
+        })
+        wx.uploadFile({
+          url: host + '/api/wx/uploadfile',
+          filePath: res.tempFilePaths[0],
+          name: 'file',
+          formData: {
+            'file': res.tempFilePaths[0]
+          },
+          success: res => {
+            wx.hideLoading()
+            var data = JSON.parse(res.data)
+            var _data = _this.data.data
+            console.log(_data)
+            if (id == 1) {  //正面
+              _data.idnoimg_face = data.data.url
+            }
+            if (id == 2) {  //反面
+              _data.idnoimg_back = data.data.url
+            }
+            if (id == 3) {  //半身照
+              _data.halfbody_img = data.data.url
+            }
+            if (id == 4) {  //学历照
+              _data.education_img = data.data.url
+            }
+            _this.setData({
+              data:_data
+            })
+          }
+        })
+      },
+    })
+  },
+  post:function(){
+      var data=this.data.data
+      data.sex=this.data.sex
+      data.education = this.data.recordArray[this.data.record]
+      wx.showLoading({
+        title: '',
+      })
+      wx.request({
+        url: host + '/api/wx/authinfo',
+        header: {
+          openid: app.globalData.openid
+        },
+        method:'PUT',
+        success: res => {
+          wx.showToast({
+            title: '提交成功',
+            icon: 'success',
+            duration: 2000
+          })
+        }
+      })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/user/user.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "实名认证"
+}

+ 79 - 0
pages/user/user.wxml

@@ -0,0 +1,79 @@
+<form wx:if="{{!id}}" catchsubmit="next">
+  <view class="item">
+      <label>姓名</label>
+      <input  bindinput="inputChange" data-name='name' value="{{data.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 bindinput="inputChange" data-name='idno'  value="{{data.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 bindinput="inputChange" data-name='phone'  value="{{data.phone}}" type="number" placeholder="请输入您的手机号"></input>
+  </view>
+
+  <view class="item">
+      <label>单位全称</label>
+      <input bindinput="inputChange" data-name='company'  value="{{data.company}}" placeholder="请输入您的单位名称"></input>
+  </view>
+
+</form>
+
+<view class="content">
+  <view class="item">
+      <image wx:if='{{data.idnoimg_face}}' data-id='1' bindtap="takePhoto" src="{{data.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='{{data.idnoimg_back}}' data-id='2' bindtap="takePhoto" src="{{data.idnoimg_back}}" 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='{{data.halfbody_img}}' data-id='3' bindtap="takePhoto" src="{{data.halfbody_img}}" 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='{{data.education_img}}' data-id='4' bindtap="takePhoto" src="{{data.education_img}}" 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>
+
+<view bindtap="post" class="post">提交资料</view>
+
+<view class="model {{show?'show':''}}" bindtap="hideImg">
+  <image src="../../images/upload.png" mode="widthFix"></image>
+</view>

+ 98 - 0
pages/user/user.wxss

@@ -0,0 +1,98 @@
+/* pages/user/user.wxss */
+page{
+  background: #F4F7F9;
+}
+form{
+  background: #fff;
+  /* margin-top: 12px; */
+  display: block;
+}
+form .item{
+  border-bottom: 1px solid #F2F3F4;
+  padding: 15px;
+  position: relative;
+}
+form .item label{
+  color: #222;
+  display: inline-block;
+  width: 60px;
+  vertical-align: middle;
+  text-align: right;
+}
+form .item input,form .item picker{
+  display: inline-block;
+  width: 70%;
+  border: none;
+  padding-left: 20px;
+  vertical-align: middle;
+}
+form .item image{
+  position: absolute;
+  right: 12px;
+  width: 16px;
+  top:20px;
+}
+
+.content{
+  background: #fff;
+  margin-top: 12px;
+  padding: 10px 12px;
+}
+.content .item{
+  padding:10px 200rpx;
+  position: relative;
+  padding-right: 0;
+}
+.content .item image{
+  width: 160rpx;
+  position: absolute;
+  left: 20rpx;
+  top: 0;
+  bottom: 0;
+  margin: auto;
+  
+}
+.content .title{
+  color: #333;
+}
+.content .item text{
+  color: #E85546;
+  font-size: 24rpx;
+}
+.tips{
+  color: #358BFF;
+  margin-top: 36rpx;
+}
+.post{
+  width: calc(100% - 24px);
+  height:96rpx;
+  background:rgba(53,139,255,1);
+  border-radius:4px;
+  color: #fff;
+  line-height: 96rpx;
+  margin: 20px auto;
+  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;
+}