Your Name vor 11 Monaten
Commit
b390b29f82
100 geänderte Dateien mit 2899 neuen und 0 gelöschten Zeilen
  1. 75 0
      app.js
  2. 64 0
      app.json
  3. 56 0
      app.wxss
  4. BIN
      images/addr.png
  5. BIN
      images/arrow-bottom.png
  6. BIN
      images/back.png
  7. BIN
      images/baoming-xz.jpg
  8. BIN
      images/baoming.png
  9. BIN
      images/bg-my.png
  10. 22 0
      images/danx.svg
  11. 22 0
      images/duox.svg
  12. BIN
      images/gou.png
  13. BIN
      images/logo.png
  14. BIN
      images/lou.png
  15. 22 0
      images/pd.svg
  16. BIN
      images/phone.png
  17. BIN
      images/play.png
  18. BIN
      images/score.png
  19. BIN
      images/shouye-xz.png
  20. BIN
      images/shouye.png
  21. BIN
      images/st.png
  22. BIN
      images/tt.png
  23. BIN
      images/tttz.png
  24. 51 0
      images/type1.svg
  25. 40 0
      images/type2.svg
  26. 50 0
      images/type3.svg
  27. BIN
      images/upload.png
  28. BIN
      images/wode-xz.png
  29. BIN
      images/wode.png
  30. BIN
      images/xiaoxi-xz.jpg
  31. BIN
      images/xiaoxi.png
  32. BIN
      images/xz.png
  33. BIN
      images/ysjt.png
  34. BIN
      images/zj.png
  35. BIN
      images/zj1.jpg
  36. BIN
      images/zj1_bk.jpg
  37. BIN
      images/zj2.jpg
  38. BIN
      images/zj3.jpg
  39. BIN
      images/zj3_bk.jpg
  40. BIN
      images/zj4.jpg
  41. BIN
      images/zj5.jpg
  42. BIN
      images/zj6.jpg
  43. BIN
      images/zj7.jpg
  44. BIN
      images/zj8.jpg
  45. BIN
      images/zl.png
  46. 1 0
      node_modules/.package_versions.json
  47. 176 0
      pages/apply/apply.js
  48. 3 0
      pages/apply/apply.json
  49. 73 0
      pages/apply/apply.wxml
  50. 86 0
      pages/apply/apply.wxss
  51. 79 0
      pages/article/article.js
  52. 3 0
      pages/article/article.json
  53. 4 0
      pages/article/article.wxml
  54. 9 0
      pages/article/article.wxss
  55. 88 0
      pages/articleList/articleList.js
  56. 3 0
      pages/articleList/articleList.json
  57. 8 0
      pages/articleList/articleList.wxml
  58. 9 0
      pages/articleList/articleList.wxss
  59. 93 0
      pages/classHour/classHour.js
  60. 3 0
      pages/classHour/classHour.json
  61. 3 0
      pages/classHour/classHour.wxml
  62. 7 0
      pages/classHour/classHour.wxss
  63. 92 0
      pages/download/download.js
  64. 3 0
      pages/download/download.json
  65. 5 0
      pages/download/download.wxml
  66. 28 0
      pages/download/download.wxss
  67. 106 0
      pages/index/index.js
  68. 3 0
      pages/index/index.json
  69. 85 0
      pages/index/index.wxml
  70. 171 0
      pages/index/index.wxss
  71. 116 0
      pages/intro/intro.js
  72. 3 0
      pages/intro/intro.json
  73. 33 0
      pages/intro/intro.wxml
  74. 27 0
      pages/intro/intro.wxss
  75. 118 0
      pages/message/message.js
  76. 3 0
      pages/message/message.json
  77. 6 0
      pages/message/message.wxml
  78. 20 0
      pages/message/message.wxss
  79. 66 0
      pages/mine/mine.js
  80. 3 0
      pages/mine/mine.json
  81. 41 0
      pages/mine/mine.wxml
  82. 57 0
      pages/mine/mine.wxss
  83. 66 0
      pages/mweb/mweb.js
  84. 3 0
      pages/mweb/mweb.json
  85. 4 0
      pages/mweb/mweb.wxml
  86. 1 0
      pages/mweb/mweb.wxss
  87. 82 0
      pages/myPapers/myPapers.js
  88. 3 0
      pages/myPapers/myPapers.json
  89. 7 0
      pages/myPapers/myPapers.wxml
  90. 15 0
      pages/myPapers/myPapers.wxss
  91. 147 0
      pages/online/online.js
  92. 3 0
      pages/online/online.json
  93. 34 0
      pages/online/online.wxml
  94. 159 0
      pages/online/online.wxss
  95. 99 0
      pages/onlinePost/onlinePost.js
  96. 3 0
      pages/onlinePost/onlinePost.json
  97. 19 0
      pages/onlinePost/onlinePost.wxml
  98. 63 0
      pages/onlinePost/onlinePost.wxss
  99. 155 0
      pages/pay/pay.js
  100. 0 0
      pages/pay/pay.json

+ 75 - 0
app.js

@@ -0,0 +1,75 @@
+//app.js
+App({
+  onLaunch: function () {
+    
+    this.getOpenid()
+    // 获取用户信息
+    // 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
+    //   }
+    // })
+  },
+  getOpenid:function(){
+    var openid;
+    var _this = this;
+    wx.getStorage({
+      key: 'openid',
+      success: function (res) {
+        openid = res.data
+        _this.globalData.openid = openid
+      },
+      fail: res => {
+        // 登录
+        wx.login({
+          success: res => {
+            console.log(res)
+            // 发送 res.code 到后台换取 openId, sessionKey, unionId
+            wx.request({
+              url: 'https://wxapi.yifeng2016.com/api/wx/openid',
+              method: 'GET',
+              data: {
+                code: res.code
+              },
+              success: res => {
+                if (res.data.data.openid) {
+                  _this.globalData.openid = res.data.data.openid
+                  wx.setStorage({
+                    key: 'openid',
+                    data: res.data.data.openid,
+                  })
+                }
+              }
+            })
+          }
+        })
+      }
+    })   
+  },
+  globalData: {
+    userInfo: null,
+    host:'https://wxapi.yifeng2016.com',
+    categoryArray:[],
+    openid:''
+  }
+})

+ 64 - 0
app.json

@@ -0,0 +1,64 @@
+{
+  "pages": [
+    "pages/index/index",
+    "pages/mine/mine",
+    "pages/classHour/classHour",
+    "pages/onlinePost/onlinePost",
+    "pages/web/web",
+    "pages/user/user",
+    "pages/online/online",
+    "pages/plan/plan",
+    "pages/pay/pay",
+    "pages/intro/intro",
+    "pages/apply/apply",
+    "pages/post/post",
+    "pages/upload/upload",
+    "pages/download/download",
+    "pages/article/article",
+    "pages/subject/subject",
+    "pages/myPapers/myPapers",
+    "pages/message/message",
+    "pages/video/video",
+    "pages/showMsg/showMsg",
+    "pages/articleList/articleList",
+    "pages/mweb/mweb"
+  ],
+  "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-xz.jpg"
+      },
+      {
+        "pagePath": "pages/message/message",
+        "text": "消息",
+        "iconPath": "images/xiaoxi.png",
+        "selectedIconPath": "images/xiaoxi-xz.jpg"
+      },
+      {
+        "pagePath": "pages/mine/mine",
+        "text": "我的",
+        "iconPath": "images/wode.png",
+        "selectedIconPath": "images/wode-xz.png"
+      }
+    ]
+  }
+}

+ 56 - 0
app.wxss

@@ -0,0 +1,56 @@
+
+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: 150px;
+  padding-top: 20px;
+}
+.login .xx{
+  display: block;
+  padding: 0px 20px 20px;
+}
+.login button{
+  width: 100% !important;
+  height: 48px;
+  color: #fff;
+  background-color: #358BFF;
+  border-top-left-radius: 0;
+  border-top-right-radius: 0;
+  padding: 0;
+  line-height: 48px;
+}
+image{
+  max-height: 100%;
+}
+.login image{
+  width: 100rpx;
+  height: 100rpx;
+}
+.slogen{
+  position: relative;
+  top: -20px;
+  padding-left: 5px;
+}

BIN
images/addr.png


BIN
images/arrow-bottom.png


BIN
images/back.png


BIN
images/baoming-xz.jpg


BIN
images/baoming.png


BIN
images/bg-my.png


Datei-Diff unterdrückt, da er zu groß ist
+ 22 - 0
images/danx.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 22 - 0
images/duox.svg


BIN
images/gou.png


BIN
images/logo.png


BIN
images/lou.png


Datei-Diff unterdrückt, da er zu groß ist
+ 22 - 0
images/pd.svg


BIN
images/phone.png


BIN
images/play.png


BIN
images/score.png


BIN
images/shouye-xz.png


BIN
images/shouye.png


BIN
images/st.png


BIN
images/tt.png


BIN
images/tttz.png


Datei-Diff unterdrückt, da er zu groß ist
+ 51 - 0
images/type1.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 40 - 0
images/type2.svg


Datei-Diff unterdrückt, da er zu groß ist
+ 50 - 0
images/type3.svg


BIN
images/upload.png


BIN
images/wode-xz.png


BIN
images/wode.png


BIN
images/xiaoxi-xz.jpg


BIN
images/xiaoxi.png


BIN
images/xz.png


BIN
images/ysjt.png


BIN
images/zj.png


BIN
images/zj1.jpg


BIN
images/zj1_bk.jpg


BIN
images/zj2.jpg


BIN
images/zj3.jpg


BIN
images/zj3_bk.jpg


BIN
images/zj4.jpg


BIN
images/zj5.jpg


BIN
images/zj6.jpg


BIN
images/zj7.jpg


BIN
images/zj8.jpg


BIN
images/zl.png


+ 1 - 0
node_modules/.package_versions.json

@@ -0,0 +1 @@
+{}

+ 176 - 0
pages/apply/apply.js

@@ -0,0 +1,176 @@
+// pages/apply/apply.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    list:[],
+    show:1
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.showLoading({
+      title: '',
+    })
+    this.setData({
+      openid: app.globalData.openid
+    })
+    this.getData();
+    wx.getStorage({
+      key: 'userInfo',
+      success: res=> {
+        if(res.data){
+          this.setData({show:0})
+        }
+      },
+    })
+  },
+  getData:function(){
+    wx.request({
+      url: host+'/api/wx/signup/list',
+      header:{
+        openid:this.data.openid
+      },
+      method:'GET',
+      success:res=>{
+        if (res.statusCode == 403){
+          this.save()
+        }else{
+          wx.hideLoading()
+          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
+          })
+        }
+      }
+    })
+  },
+  save: function () {
+    var _this = this
+    wx.showLoading({
+      title: '正在登录',
+    })
+    wx.getStorage({
+      key: 'userInfo',
+      success: function (res) {
+        console.log(res)
+        wx.request({
+          url: host + '/api/wx/auth',
+          method: 'POST',
+          data: {
+            nickname: res.data.nickName,
+            avatar: res.data.avatarUrl,
+            openid: app.globalData.openid,
+          },
+          success: res => {
+            wx.hideLoading()
+            _this.getData();
+
+          }
+        })
+      },
+    })
+
+  },
+  pay:function(e){
+    wx.navigateTo({
+      url: '../pay/pay?id='+e.target.dataset.id,
+    })
+  },
+  onGotUserInfo: function (e) {
+    wx.setStorage({
+      key: 'userInfo',
+      data: e.detail.userInfo,
+    })
+    console.log(app.globalData.openid)
+    wx.request({
+      url: host+'/api/wx/auth',
+      method:'POST',
+      data:{
+        nickname: e.detail.userInfo.nickName, 
+        avatar: e.detail.userInfo.avatarUrl, 
+        openid: app.globalData.openid, 
+      },
+      success:res=>{
+          console.log(res)
+          this.setData({
+            show:0
+          })
+      }
+    })
+  },
+  downloadInvoice:function(e){
+    console.log(e,2222222222222222)
+    wx.downloadFile({
+      url: 'url',
+      success: function(res) {
+        const tempFilePath = res.tempFilePath
+        wx.saveFile({
+          tempFilePath: tempFilePath,
+          success: function(res) {
+            const savedFilePath = res.savedFilePath
+            console.log('下载并保存文件成功,保存路径为:', savedFilePath)
+          }
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.getData();
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+    this.getData();
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/apply/apply.json

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

+ 73 - 0
pages/apply/apply.wxml

@@ -0,0 +1,73 @@
+<view class="content">
+<block  wx:for="{{list}}" style="position:relative;">
+    <navigator class="list" wx:key='*this' open-type="navigateTo" wx:if='{{item.order_status<2}}'
+     url="../post/post?type=2&&id={{item.id}}&s_name={{item.subject_item}}">
+        <view class="status">
+        <text wx:if="{{item.order_status == -1}}">待提交资料</text> 
+        <text wx:if="{{item.order_status == 0}}">审核中</text> 
+        <text wx:if="{{item.order_status == -2}}">审核未通过</text> 
+        <text wx:if="{{item.order_status == 1}}">已审核,待付款</text> 
+        <text wx:if="{{item.order_status == 2}}">已付款,待培训</text> 
+        <text wx:if="{{item.order_status == 7}}">考试完成</text> 
+        <text wx:if="{{item.order_status == 3}}">已培训,待考试</text> 
+        <text style="color:green;">{{item.train_type}}</text></view>
+        <view class="title">{{item.name}}   {{item.phone}}  
+          <text wx:if="{{item.class_name}}">{{item.class_name}}</text>
+          <text class="signup_count" wx:if="{{item.class_name}}">计划{{item.signup_limit}}人/已报名{{item.signup_count}}人</text>
+        </view>
+        <view class="info">
+            <text>{{item.subject_item_1[0]}}</text>
+            <text decode="{{true}}">作业类别  &nbsp;&nbsp; {{item.subject_item_1[1]}}</text>
+            <text wx:if='{{item.subject_item_1[0]=="特种作业人员"}}' decode="{{true}}">准操项目  &nbsp;&nbsp;{{item.subject_item_1[2]}}</text>
+            <text wx:if='{{item.subject_item_1[0]=="特种设备培训"}}' decode="{{true}}">项目代码  &nbsp;&nbsp;{{item.subject_item_1[2]}}</text>
+            <text wx:if='{{item.subject_item_1[0]!="特种作业人员" && item.subject_item_1[0]!="特种设备培训"}}' decode="{{true}}">资格类型  &nbsp;&nbsp;{{item.subject_item_1[2]}}</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>
+        <view  data-id='{{item.id}}' catchtap="pay" wx:if="{{item.order_status == 1}}" class="study">立即支付</view>
+        <navigator url="../online/online" wx:if="{{item.order_status == 2}}" class="study">立即学习</navigator>
+    </navigator>
+    <navigator class="list" wx:key='*this' open-type="navigateTo" wx:else>
+        <view class="status">
+         <text wx:if="{{item.order_status == -1}}">待提交资料</text> 
+        <text wx:if="{{item.order_status == 0}}">审核中</text> 
+        <text wx:if="{{item.order_status == -2}}">审核未通过</text> 
+        <text wx:if="{{item.order_status == 1}}">已审核,待付款</text> 
+        <text wx:if="{{item.order_status == 2}}">已付款,待培训</text> 
+        <text wx:if="{{item.order_status == 7}}">考试完成</text> 
+        <text wx:if="{{item.order_status == 3}}">已培训,待考试</text> 
+        <text style="color:green;">{{item.train_type}}</text></view>
+        <view class="title">{{item.name}}   {{item.phone}}  
+          <text>{{item.class_name}}</text>
+          <text class="signup_count" wx:if="{{item.class_name}}">计划{{item.signup_limit}}人/已报名{{item.signup_count}}人</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 wx:if='{{item.subject_item_1[0]=="特种作业人员"}}' decode="{{true}}">准操项目  &nbsp;&nbsp;{{item.subject_item_1[2]}}</text>
+            <text wx:if='{{item.subject_item_1[0]=="特种设备培训"}}' decode="{{true}}">项目代码  &nbsp;&nbsp;{{item.subject_item_1[2]}}</text>
+            <text wx:if='{{item.subject_item_1[0]!="特种作业人员" && item.subject_item_1[0]!="特种设备培训"}}' decode="{{true}}">资格类型  &nbsp;&nbsp;{{item.subject_item_1[2]}}</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>
+        <view  data-id='{{item.id}}' catchtap="pay" wx:if="{{item.order_status == 1}}" class="study">立即支付</view>
+        <navigator url="../online/online?id={{item.id}}" wx:if="{{item.order_status == 2}}" class="study">立即学习</navigator>
+    </navigator>
+    <!-- <view bindtap="downloadInvoice" class="downloadInvoice">点击下载电子发票</view> -->
+</block>
+<view class="nope" wx:if="{{list.length==0}}">暂无报名信息...</view>
+    <navigator url="../onlinePost/onlinePost" class="post">立即报名</navigator>
+</view>
+
+<view class="login" wx:if='{{show}}'>
+    <view>
+        <view>
+          <image src="../../images/logo.png" mode="widthFix"></image>
+          <text class="slogen">巴中逸沣安全培训</text>
+        </view>
+        <text class="xx">申请获取您的用户信息(头像、昵称等)</text>
+        <button bindgetuserinfo="onGotUserInfo" open-type="getUserInfo">确定</button>
+    </view>
+</view>
+

+ 86 - 0
pages/apply/apply.wxss

@@ -0,0 +1,86 @@
+/* pages/apply/apply.wxss */
+page{
+  background: #F4F7F9;
+}
+.nope{
+  text-align: center;
+  color: #999;
+  font-size: 36rpx;
+  padding: 20px 0;
+}
+.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;
+}
+.title .signup_count{
+  color: #E85546;
+  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);
+}
+
+.downloadInvoice{
+  /* position:absolute; */
+  /* bottom:15px;
+  right:10px; */
+  color:#358BFF;
+  margin-bottom:10px;
+}

+ 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;
+}

+ 88 - 0
pages/articleList/articleList.js

@@ -0,0 +1,88 @@
+// pages/articleList/articleList.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    data:[],
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    this.getData();
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  },
+  getData:function(){
+    wx.request({
+      url: host +'/api/wx/article/list',
+      method:'GET',
+      success:res=>{
+        wx.hideLoading()
+        let data=res.data.data;
+        this.setData({
+          data:res.data.data
+        })
+      },
+      fail:res=>{
+        wx.showToast({
+          title: '服务器开小差啦!',
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    })
+  }
+})

+ 3 - 0
pages/articleList/articleList.json

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

+ 8 - 0
pages/articleList/articleList.wxml

@@ -0,0 +1,8 @@
+<!--pages/articleList/articleList.wxml-->
+<!-- <text>pages/articleList/articleList.wxml</text> -->
+<view wx:for="{{data}}" wx:key='*this' class="article">
+    <navigator url="../intro/intro?id={{item.id}}&type=1" class="list">
+        <view>{{item.title}}</view>
+        <text>{{item.ctime}}</text>
+    </navigator>
+</view>

+ 9 - 0
pages/articleList/articleList.wxss

@@ -0,0 +1,9 @@
+/* pages/articleList/articleList.wxss */
+.list{
+  border-bottom: 1px solid #F2F3F4;
+  padding: 15px;
+}
+.list text{
+  color: #999;
+  font-size: 24rpx;
+}

+ 93 - 0
pages/classHour/classHour.js

@@ -0,0 +1,93 @@
+// pages/classHour/classHour.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    imgs:[]
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.showLoading({
+      title: 'test',
+    })
+    wx.request({
+      url: host + '/api/wx/classhourcard',
+      header: {
+        openid: app.globalData.openid
+      },
+      success: res => {     
+        wx.hideLoading()
+        let data = res.data.data, urls = []
+        for (let i = 0; i < data.length; i++) {
+          urls.push(data[i].url)
+        }
+        console.log(urls,33333333333)
+        this.setData({
+          imgs: urls
+        })
+        
+      }
+    })
+  },
+  preview:function(e){
+    wx.previewImage({
+      current: e.target.dataset.url, // 当前显示图片的http链接
+      urls: this.data.imgs // 需要预览的图片http链接列表
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/classHour/classHour.json

@@ -0,0 +1,3 @@
+{
+  "navigationBarTitleText": "学时证明"
+}

+ 3 - 0
pages/classHour/classHour.wxml

@@ -0,0 +1,3 @@
+<view>
+  <image wx:for="{{imgs}}" bindtap="preview" data-url='{{item}}' mode="widthFix" src="{{item}}"></image>
+</view>

+ 7 - 0
pages/classHour/classHour.wxss

@@ -0,0 +1,7 @@
+/* pages/classHour/classHour.wxss */
+view{
+  padding: 10px;
+}
+image{
+  width: 100%;
+}

+ 92 - 0
pages/download/download.js

@@ -0,0 +1,92 @@
+// 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.downloadFile({
+      url: e.target.dataset.src,
+      success: function (res) {
+        const filePath = res.tempFilePath
+        wx.openDocument({
+          filePath: filePath,
+          success: function (res) {
+            console.log('打开文档成功')
+          }
+        })
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  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": "资料下载"
+}

+ 5 - 0
pages/download/download.wxml

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

+ 28 - 0
pages/download/download.wxss

@@ -0,0 +1,28 @@
+/* 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;
+}
+.list text{
+  width:88px;
+  height:32px;
+  background:rgba(53,139,255,1);
+  border-radius:16px;
+  text-align: center;
+  line-height: 32px;
+  float: right;
+  color: #fff;
+  font-size: 28rpx;
+  position: relative;
+  top: -2px;
+}

+ 106 - 0
pages/index/index.js

@@ -0,0 +1,106 @@
+//index.js
+//获取应用实例
+const app = getApp()
+const host = app.globalData.host;
+Page({
+  data: {
+    act:6,
+    openid:'',
+    show:0,
+    data:[],
+    news: ['国家安全生产监督管理总局30号令'],
+    animationData:{}
+  },
+  //事件处理函数
+  bindViewTap: function() {
+    wx.navigateTo({
+      url: '../logs/logs'
+    })
+  },
+  tabchange:function(e){
+    this.setData({
+      act: e.target.dataset.id
+    })
+  },
+  onLoad: function () {
+    wx.showLoading({
+      title: '',
+    })
+    this.getData()
+    this.setData({
+      openid: app.globalData.openid
+    })
+    wx.getStorage({
+      key: 'userInfo',
+      success: res=> {
+        if(res.data){
+          this.setData({show:0})
+        }
+      },
+    })
+
+
+    var animation = wx.createAnimation({
+      duration: 1000,
+      timingFunction: 'ease',
+    })
+
+    this.animation = animation
+
+    animation.translateX(100).step()
+
+    this.setData({
+      animationData: animation.export()
+    })
+  },
+  // onGotUserInfo: function (e) {
+  //   wx.setStorage({
+  //     key: 'userInfo',
+  //     data: e.detail.userInfo,
+  //   })
+  //   console.log(app.globalData.openid)
+  //   wx.request({
+  //     url: host+'/api/wx/auth',
+  //     method:'POST',
+  //     data:{
+  //       nickname: e.detail.userInfo.nickName, 
+  //       avatar: e.detail.userInfo.avatarUrl, 
+  //       openid: app.globalData.openid, 
+  //     },
+  //     success:res=>{
+  //         console.log(res)
+  //         this.setData({
+  //           show:0
+  //         })
+  //     }
+  //   })
+  // },
+  getData:function(){
+    wx.request({
+      url: host +'/api/wx/index',
+      method:'GET',
+      success:res=>{
+        wx.hideLoading()
+        let data=res.data.data;
+        this.setData({
+          data:res.data.data
+        })
+        for(let i=0;i<data.length;i++){
+            if(data[i].type=='notice'){
+              this.setData({
+                news:data[i].list
+              })
+              break;
+            }
+        }
+      },
+      fail:res=>{
+        wx.showToast({
+          title: '服务器开小差啦!',
+          icon: 'none',
+          duration: 2000
+        })
+      }
+    })
+  }
+})

+ 3 - 0
pages/index/index.json

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

+ 85 - 0
pages/index/index.wxml

@@ -0,0 +1,85 @@
+<!--index.wxml-->
+<view class="top">
+  <view class="logo">
+    <image src="../../images/logo.png" ></image>
+    <view>巴中逸沣安全培训</view>
+    <text>BA ZHONG YIFENG SAFETY TRAINING</text>
+  </view>
+  <view wx:if="{{data.length>0}}" class="marquee_container" style="--marqueeWidth--:-12em">
+    <view class="zd"></view>
+    <image src="../../images/tt.png" mode="widthFix"></image>
+      <view class="marquee_text">
+        <navigator url="../intro/intro?id={{item.id}}&type=1" wx:for="{{news}}">{{item.title}}</navigator>
+      </view>
+  </view>
+  <block wx:for="{{data}}" wx:key='*this'>
+  <navigator class="part" wx:if="{{item.type == 'nav'}}" open-type="{{item.name == '在线报名'||item.name=='立即报名'?'switchTab':'navigate'}}"  url="..{{item.path}}">
+    <view style="font-weight:bold;">{{item.name}}</view>
+    <text style="color:#358BFF;">{{item.desc}}</text>
+    <!-- <image src="{{item.icon}}" mode="widthFix"></image> -->
+    <image src="../../images/ysjt.png" 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/tt.png" mode="widthFix"></image>
+      <text wx:for="{{news}}">{{item}}</text> -->
+  <!-- </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>
+    </view>
+    <view wx:for="{{data}}" wx:key='*this' wx:if="{{item.type=='article' && act == index}}" class="article">
+        <navigator url="../intro/intro?id={{list.id}}&type=1" class="list" wx:for="{{item.list}}" wx:for-item="list" wx:key='*this'>
+            <view>{{list.title}}</view>
+            <text>{{list.ctime}}</text>
+        </navigator>
+    </view> -->
+    <view class="friendlyLink">
+      友情链接: <navigator open-type="navigate" url="../../pages/mweb/mweb" style="color:#358BFF;display:inline-block;">巴中逸沣安全培训官网</navigator>
+      <!-- <a href="https://wxapi.yifeng2016.com" style="color:#358BFF;">巴中逸沣安全培训官网</a> -->
+    </view>
+</view>
+
+<view class="login" wx:if='{{show}}'>
+    <view>
+        <view>
+          <image src="../../images/logo.png" mode="widthFix"></image>
+          <text class="slogen">巴中逸沣安全培训</text>
+        </view>
+        <text class="xx">申请获取您的用户信息(头像、昵称等)</text>
+        <button bindgetuserinfo="onGotUserInfo" open-type="getUserInfo">确定</button>
+    </view>
+</view>

+ 171 - 0
pages/index/index.wxss

@@ -0,0 +1,171 @@
+/**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: 58rpx 58rpx 0rpx 170rpx;
+  width: 100%;
+  height: 220rpx;
+}
+.logo view{
+  font-family: cursive;
+  font-weight: bold;
+  font-size: 46rpx;
+  color: #fff;
+}
+.logo text{
+  color: #fff;
+  font-size: 24rpx;
+}
+.logo image{
+  width: 120rpx;
+  max-height: 120rpx;
+  position: absolute;
+  left: 15px;
+  top: 0;
+  bottom: 0;
+  margin: auto;
+}
+.part{
+  width: 100%;
+  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: 100rpx; */
+  width:64rpx;
+  max-height: 100%;
+  position: absolute;
+  right: 15px;
+  top:0;
+  bottom: 0;
+  margin: auto;
+}
+.part view{
+  color: #333333;
+  font-size: 34rpx;
+  font-family: 'Microsoft YaHei';
+  font-weight: 500;
+}
+.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;
+  white-space: nowrap;
+  overflow: hidden;
+}
+.news text{
+  padding-left: 20px;
+}
+.marquee_container image{
+  width: 53px;
+  max-height: 30px;
+  position: absolute;
+  left: 10px;
+  top: 15px;
+}
+
+.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;
+}
+
+/*首页跑马灯效果*/
+@keyframes around {
+  from {
+   margin-left: 90%;
+  }
+  to {
+   /* var接受传入的变量 */
+   margin-left: var(--marqueeWidth--);
+  }
+ }
+ .zd{
+   width: 80px;
+   height: 100%;
+   position: absolute;
+   left: 0;
+   top: 0;
+   background: #fff;
+
+ }
+ 
+.marquee_container{
+  width: 100%;
+  background: #fff;
+  margin-top: 12px;
+  box-shadow:0px 4px 12px 0px rgba(0,0,0,0.08);
+  border-radius:4px;
+  padding: 10px 12px;
+  position: relative;
+  overflow: hidden;
+}
+.marquee_container:hover{
+  /* 不起作用 */
+  animation-play-state: paused;
+}
+.marquee_text{
+  color:#333;
+  font-size: 28rpx;
+  display: inline-block;
+  white-space: nowrap;
+  animation-name: around;
+  animation-duration: 10s;  /*过渡时间*/
+  animation-iteration-count: infinite;
+  animation-timing-function:linear;
+}
+.marquee_text navigator{
+  margin-right: 200px;
+}
+.friendlyLink{
+  padding:15px;
+  /* margin:15px; */
+}

+ 116 - 0
pages/intro/intro.js

@@ -0,0 +1,116 @@
+// pages/intro/intro.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    datas:{
+      imgs:[]
+    },
+    type:1
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if(options.type){
+      this.setData({
+        type:1
+      })
+    }else{
+      this.setData({
+        type: 0
+      })
+    }
+    
+    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
+        })
+        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()
+  },
+  openMap:function(){
+    var lon = parseFloat(this.data.data.point.split(',')[0]),
+      lat = parseFloat(this.data.data.point.split(',')[1]);
+    wx.openLocation({//​使用微信内置地图查看位置。
+      latitude: lat,//要去的纬度-地址
+      longitude: lon,
+      'name': '巴中逸沣安全培训'
+    })
+  },
+  phone:function(){
+    wx.makePhoneCall({
+      phoneNumber: this.data.data.phone //仅为示例,并非真实的电话号码
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  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": {}
+}

+ 33 - 0
pages/intro/intro.wxml

@@ -0,0 +1,33 @@
+<block wx:if="{{!type}}">
+      <swiper indicator-dots="true"  autoplay="{{true}}" interval="3000" duration="500" style="height:550rpx;width:100%;">
+        <block wx:for="{{data.imgs}}" wx:key="*this">
+          <swiper-item>
+            <view class="swiper-item">
+              <image src="{{item}}" mode="widthFix"></image>
+            </view>
+          </swiper-item>
+        </block>
+      </swiper>
+      <view class="content link">
+          <view>
+              {{data.title}}
+               <image src="../../images/lou.png" mode="widthFix"></image>
+          </view>
+          <view wx:if="{{data.phone}}" bindtap="phone">
+              {{data.phone}}
+              <image src="../../images/phone.png" mode="widthFix"></image>
+          </view>
+          <view wx:if="{{data.address}}" bindtap="openMap">
+              {{data.address}}
+              <image src="../../images/addr.png" mode="widthFix"></image>
+          </view>
+      </view>
+      <editor style="height:calc(100vh - 300px);padding: 0px 10px;" read-only="{{true}}" id="editor"  class="ql-container">
+    </editor>
+</block>
+<view wx:else class="content">
+    <!-- <view class="title">{{data.title}}</view> -->
+    
+    <editor style="height:100vh;margin-top:10px;" read-only="{{true}}" id="editor"  class="ql-container">
+    </editor>
+</view>

+ 27 - 0
pages/intro/intro.wxss

@@ -0,0 +1,27 @@
+/* pages/intro/intro.wxss */
+.content{
+  padding: 12px;
+}
+.title{
+  font-size: 36rpx;
+  text-align: center;
+  margin-bottom: 12px;
+}
+.swiper-item{
+  width: 100%;
+}
+.swiper-item image{
+  width: 100%;
+}
+
+.link view{
+  font-size: 34rpx;
+  padding: 15px 0;
+  font-weight: bold;
+  border-bottom: 1px solid #F2F3F4;
+
+}
+.link image{
+  float: right;
+  width: 40rpx;
+}

+ 118 - 0
pages/message/message.js

@@ -0,0 +1,118 @@
+// pages/message/message.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.showLoading({
+      title: '',
+    })
+    this.setData({
+      openid: app.globalData.openid
+    })
+    this.getData()
+  },  
+  getData:function(){
+    wx.request({
+      url: host+'/api/wx/notice',
+      header: {
+        openid: this.data.openid
+      },
+      success:res=>{
+        wx.hideLoading()
+        if (res.statusCode == 403) {
+          this.save()
+        } else {
+          this.setData({
+            list:res.data.data
+          })
+        }
+      }
+    })
+  },
+  save: function () {
+    var _this = this
+    wx.showLoading({
+      title: '正在登录',
+    })
+    wx.getStorage({
+      key: 'userInfo',
+      success: function (res) {
+        console.log(res)
+        wx.request({
+          url: host + '/api/wx/auth',
+          method: 'POST',
+          data: {
+            nickname: res.data.nickName,
+            avatar: res.data.avatarUrl,
+            openid: app.globalData.openid,
+          },
+          success: res => {
+            wx.hideLoading()
+            _this.getData();
+
+          }
+        })
+      },
+    })
+
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  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": "消息"
+}

+ 6 - 0
pages/message/message.wxml

@@ -0,0 +1,6 @@
+<view class="content">
+    <navigator wx:for="{{list}}" class="list">
+        <view>{{item.title}}</view>
+        <text>{{item.content}}</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": "我的"
+}

+ 41 - 0
pages/mine/mine.wxml

@@ -0,0 +1,41 @@
+<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>
+
+<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>
+</navigator>
+
+<navigator url='../download/download' class="info">
+  <image class="icon" src="../../images/xz.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/st.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/zj.png" mode="widthFix"></image>
+  <view>我的证件</view>
+  <text>我的证件</text>
+  <image class="goto" src="../../images/back.png" mode="widthFix"></image>
+</navigator>
+<navigator url="../classHour/classHour" class="info">
+  <image class="icon" src="../../images/zj.png" mode="widthFix"></image>
+  <view>学时证明</view>
+  <text>学时证明</text>
+  <image class="goto" src="../../images/back.png" mode="widthFix"></image>
+</navigator>

+ 57 - 0
pages/mine/mine.wxss

@@ -0,0 +1,57 @@
+/* pages/mine/mine.wxss */
+.bg{
+  position: relative;
+}
+.bg image{
+  width: 100%;
+  max-height: 200px;
+}
+.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/mweb/mweb.js

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

+ 3 - 0
pages/mweb/mweb.json

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

+ 4 - 0
pages/mweb/mweb.wxml

@@ -0,0 +1,4 @@
+<!--pages/mweb/mweb.wxml-->
+<view>
+  <web-view src="https://www.yifeng2016.com"></web-view>
+</view>

+ 1 - 0
pages/mweb/mweb.wxss

@@ -0,0 +1 @@
+/* pages/mweb/mweb.wxss */

+ 82 - 0
pages/myPapers/myPapers.js

@@ -0,0 +1,82 @@
+// pages/myPapers/myPapers.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+
+  },
+  preview:function(){
+    wx.request({
+      url: host+'/api/wx/classhourcard',
+      success:res=>{
+        let data=res.data.data,urls=[]
+        for(let i=0;i<data.length;i++){
+          urls.push(data[i].url)
+        }
+        wx.previewImage({
+          current: urls[0], // 当前显示图片的http链接
+          urls: urls // 需要预览的图片http链接列表
+        })
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  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": "我的证件"
+}

+ 7 - 0
pages/myPapers/myPapers.wxml

@@ -0,0 +1,7 @@
+<view class="content">
+    <navigator url="../web/web?url=http://cx.mem.gov.cn/" class="list">国网查证</navigator>
+    <navigator url="../web/web?url=http://wxcx.mem.gov.cn/certsearchweb/#/Register" class="list"> 电子证书 </navigator>
+    <navigator url="../web/web?url=http://cx.ks.scaqjg.com/QuerySys/QueryManager.aspx" class="list"> 合格证查询 </navigator>
+    <navigator url="../web/web?url=http://cy.scaqda.com/query/cy/CardQuery.aspx" class="list"> 从业人员查询 </navigator>
+    <!-- <view bindtap="preview" class="list" class="list">学时证明 </view> -->
+</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;
+}

+ 147 - 0
pages/online/online.js

@@ -0,0 +1,147 @@
+// pages/online/online.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    tab:1,
+    array1: ['特种作业'],
+    index1: 0,
+    papers:[],
+    videos:[],
+    show:0,
+    video_ids: [],
+    paper_ids: []
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    if (options.id){
+      this.setData({
+        signup_id: options.id
+      })
+    }
+    this.setData({
+      openid: app.globalData.openid
+    })
+    if(options.tab){
+      this.setData({
+        tab: options.tab
+      })
+    }
+    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=>{
+        
+        let video = res.data.data.videos, papers = res.data.data.papers;
+        let flag1=1,flag=1;
+        var video_ids=[],paper_ids=[]
+        for(let i=0;i<video.length;i++){
+          video_ids.push(video[i].id)
+          if (!video[i].status){
+            flag1=0
+          }
+        };
+        for (let i = 0; i < papers.length; i++) {
+          paper_ids.push(papers[i].id)
+          if (!papers[i].status) {
+            flag2 = 0
+          }
+        };
+        this.setData({
+          papers: papers,
+          videos: video,
+          show: flag1 || flag2,
+          paper_ids: paper_ids,
+          video_ids: video_ids
+        })
+      }
+    })
+  },
+  genclasshour:function(){
+    wx.request({
+      url: host+'/api/wx/genclasshour',
+      method:'POST',
+      header: {
+        openid: app.globalData.openid
+      },
+      data:{
+        video_ids: this.data.video_ids,
+        paper_ids: this.data.paper_ids,
+        signup_id: this.data.signup_id
+      },  
+      success:res=>{
+        wx.previewImage({
+          current: res.data.data.url, // 当前显示图片的http链接
+          urls: [res.data.data.url] // 需要预览的图片http链接列表
+        })
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  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": "在线培训"
+}

+ 34 - 0
pages/online/online.wxml

@@ -0,0 +1,34 @@
+<view class="tab">
+    <text data-id='1' bindtap="tabChange" class="{{tab==1?'act':''}}">在线学习</text>
+    <text data-id='0' bindtap="tabChange" class="{{tab==0?'act':''}}">视频课程</text>
+</view>
+<view wx:if='{{tab==0}}' class="content">
+  <navigator wx:for="{{videos}}" wx:key="*this" url="../video/video?title={{item.title}}&&url={{item.url}}&&time={{item.finished_time}}&id={{item.id}}" class="list">
+      <view class="img">
+      <image  src="{{item.image}}" mode="scaleToFill"></image>
+      <image class="play" src="../../images/play.png" mode="widthFix"></image>
+      </view>
+      <view class="info">
+        <view class="title">{{item.title}}</view>
+        <view style="opacity:0;"> {{item.class_hour}}学时 </view>
+        <text>{{item.class_hour}}学时</text>
+        <!-- <text>{{item.finished_time}}/{{item.total_time}}</text> -->
+        <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>
+</view>
+
+<view  wx:if='{{tab==1}}' class="content">
+    <navigator  class="test"  wx:for="{{papers}}" wx:key="*this" url="../subject/subject?id={{item.id}}">
+        <view class="title">{{item.title}}</view>
+        <text>{{item.class_hour}}学时/{{item.full_mark}}分/{{item.time_limit}}分钟</text>
+        <view class="score" wx:if='{{item.status == 1}}'>
+            <image  src="../../images/score.png" mode="widthFix"></image> <text>  {{item.mark}}分</text>
+            <image src="../../images/gou.png" mode="widthFix"></image>  已完成
+        </view> 
+        <navigator wx:else >开始练习</navigator>
+    </navigator>
+</view>
+<view bindtap="genclasshour" style="position:fixed;bottom:20rpx;" wx:if="{{show&&signup_id}}" class="complete">已完成学习,立即生成学时证明</view>
+

+ 159 - 0
pages/online/online.wxss

@@ -0,0 +1,159 @@
+/* pages/online/online.wxss */
+page{
+  background: #F4F7F9;
+}
+
+.content{
+  min-height: 90vh;
+  background: #fff;
+  padding-bottom: 50px;
+}
+.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;
+}
+
+.complete{
+  width: calc(100% - 24px);
+  line-height: 38px;
+  color: #fff;
+  text-align: center;
+  position: fixed;
+  left: 12px;
+  bottom: 10px;
+  background: #07c160;
+  border-radius: 4px;
+}

Datei-Diff unterdrückt, da er zu groß ist
+ 99 - 0
pages/onlinePost/onlinePost.js


+ 3 - 0
pages/onlinePost/onlinePost.json

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

+ 19 - 0
pages/onlinePost/onlinePost.wxml

@@ -0,0 +1,19 @@
+<view class="content">
+<!-- 第一步 -->
+  <view class="step" wx:if="{{step==1}}">
+    <view class="step1">
+        <!-- <view>报名须知</view> -->
+        <editor style="height:100%;" read-only="{{true}}" id="editor"  class="ql-container"> </editor>
+    </view>
+    <text bindtap="next" class="btn">已详细阅读,下一步</text>
+  </view>
+  
+  <view class="step step2" wx:if="{{step==2}}">
+    <view class='item' wx:for="{{list}}" wx:key="item.id" bindtap="gotoForm" data-id='{{item.id}}' data-name='{{item.name}}'>
+        <view class="item-title">{{item.name}}</view>
+       <view class="item-text" style="color:#358BFF;">{{item.intro}}</view>
+        <!-- <image src="../../images/type1.svg" mode="widthFix"></image> -->
+    </view>
+
+  </view>
+</view>

+ 63 - 0
pages/onlinePost/onlinePost.wxss

@@ -0,0 +1,63 @@
+/* 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;
+  height: 80vh;
+  overflow:scroll;
+}
+
+.step1 view{
+  font-size: 30rpx;
+  font-weight: 600;
+  text-align: center;
+  margin-bottom: 12rpx;
+}
+.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;
+  font-size:34rpx;
+}
+
+.step2 .item{
+  height: 80px;
+  /* line-height: 80px; */
+  padding: 0 20px;
+  background:rgba(255,255,255,1);
+  border-radius:7rpx;
+  margin-bottom: 20px;
+  position: relative;
+  display: flex;
+  flex-direction: column;
+  justify-content: center;
+}
+.step2 .item .item-title{
+  font-size:32rpx;
+  font-weight:bold;
+}
+.step2 image{
+  width: 100px;
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  right: 20px;
+  margin: auto;
+}

+ 155 - 0
pages/pay/pay.js

@@ -0,0 +1,155 @@
+// pages/pay/pay.js
+import md5 from '../../utils/md5.js';//支付页面引入md5.js
+const app = getApp()
+const host = app.globalData.host;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    accountArray: ["不需要","个人发票", "公司发票"],    
+    accountTypeArray: ["纸质发票"], 
+    account:0,
+    account_type:0,
+    data:{}
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    
+      wx.request({
+        url: host + '/api/wx/signup',
+        method: 'GET',
+        data: { id: options.id },
+        success:res=>{
+          this.setData({
+            data:res.data.data
+          })
+        }
+      })
+  },
+  pickerChange:function(e){
+    if (e.target.dataset.name == 'account') {
+      this.setData({
+        account: e.detail.value
+      })
+    };
+    if (e.target.dataset.name == 'account_type') {
+      this.setData({
+        account_type: e.detail.value
+      })
+    };
+  },
+  pay:function(e){
+    
+    // console.log(e.detail.value)
+    var data = this.data.data, form = e.detail.value;
+    if (this.data.account == 2){
+      if (!form.bill_name){
+          wx.showToast({
+            title: '请输入公司全称',
+            icon: 'none',
+            duration: 2000
+          })
+          return false
+        }
+      if (!form.bill_no) {
+        wx.showToast({
+          title: '请输入税号',
+          icon: 'none',
+          duration: 2000
+        })
+        return false
+      }
+    }
+    wx.showLoading({
+      title: '正在提交...',
+    })
+    wx.request({
+      url: host+'/api/wx/signup/pay',
+      method:'POST',
+      header: {
+        openid: app.globalData.openid
+      },
+      data:{
+        total_fee: data.price,
+        signup_id:data.id,
+        bill_type: Number(this.data.account)+1,
+        bill_no: form.bill_no,
+        bill_mat:1,
+        bill_name: form.bill_name
+      },
+      success:res=>{
+        console.log(res.data.data)
+          wx.hideLoading()
+        var timestamp = Math.round(new Date().getTime() / 1000).toString();
+        var paySign = md5('appId=' + res.data.data.appid + '&nonceStr=' + res.data.data.nonce_str + '&package=prepay_id=' + res.data.data.prepay_id + '&signType=MD5&timeStamp=' + timestamp + '&key=' + res.data.data.key).toUpperCase();
+        console.log(paySign)
+          wx.requestPayment({
+            timeStamp: timestamp,
+            nonceStr: res.data.data.nonce_str,
+            package: 'prepay_id=' + res.data.data.prepay_id,
+            signType: 'MD5',
+            paySign: paySign,
+            success(res) { 
+              wx.switchTab({
+                url: '/pages/apply/apply'
+              });
+            },
+            fail(res) { console.log(res)}
+          })
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 0 - 0
pages/pay/pay.json


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.