tanyanfei 4 år sedan
förälder
incheckning
9976117f3e

+ 11 - 2
pages/download/download.js

@@ -27,8 +27,17 @@ Page({
     })
   },
   open:function(e){
-    wx.openDocument({
-      filePath: e.target.dataset.src,
+    wx.downloadFile({
+      url: e.target.dataset.src,
+      success: function (res) {
+        const filePath = res.tempFilePath
+        wx.openDocument({
+          filePath: filePath,
+          success: function (res) {
+            console.log('打开文档成功')
+          }
+        })
+      }
     })
   },
 

+ 3 - 1
pages/download/download.wxml

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

+ 13 - 0
pages/download/download.wxss

@@ -12,4 +12,17 @@ page{
   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;
 }

+ 1 - 0
pages/mine/mine.wxss

@@ -4,6 +4,7 @@
 }
 .bg image{
   width: 100%;
+  max-height: 200px;
 }
 .bg>view{
   width: 100%;

+ 5 - 0
pages/online/online.js

@@ -22,6 +22,11 @@ Page({
     this.setData({
       openid: app.globalData.openid
     })
+    if(options.tab){
+      this.setData({
+        tab: options.tab
+      })
+    }
     this.getData();
   },
   tabChange:function(e){

+ 1 - 1
pages/online/online.wxml

@@ -46,7 +46,7 @@
     <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}}'>
+        <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> 

+ 21 - 1
pages/post/post.js

@@ -38,7 +38,27 @@ Page({
     this.setData({
       type: options.type
     })
-    var sub_list=[]
+    var sub_list=[],user={}
+    wx.request({
+      url: host + '/api/wx/authinfo',
+      header: {
+        openid: app.globalData.openid
+      },
+      success: res => {
+        user = res.data.data
+        console.log(user)
+        if(options.type != 2){
+            this.setData({
+              name:user.name,
+              company: user.company,
+              phone:user.phone,
+              idno: user.idno,
+              sex:user.sex==1?0:1,
+              record: this.data.recordArray.indexOf(user.education),
+            })
+        }
+      }
+    })
     wx.request({
       url: host + '/api/wx/sujectitem',
       success: res => {

+ 6 - 6
pages/post/post.wxml

@@ -1,7 +1,7 @@
 <form wx:if="{{type != 2}}" catchsubmit="next">
   <view class="item">
       <label>姓名</label>
-      <input  name='name' placeholder="请输入您的姓名"></input>
+      <input value="{{name}}" name='name' placeholder="请输入您的姓名"></input>
   </view>
 
   <view class="item">
@@ -16,7 +16,7 @@
 
   <view class="item">
       <label>身份证</label>
-      <input name='idno' type="idcard" placeholder="请输入您的身份证"></input>
+      <input value="{{idno}}" name='idno' type="idcard" placeholder="请输入您的身份证"></input>
   </view>
 
   <view class="item">
@@ -31,12 +31,12 @@
 
   <view class="item">
       <label>手机号</label>
-      <input name='phone' type="number" placeholder="请输入您的手机号"></input>
+      <input value="{{phone}}"  name='phone' type="number" placeholder="请输入您的手机号"></input>
   </view>
 
   <view class="item">
       <label>单位全称</label>
-      <input name='company' placeholder="请输入您的单位名称"></input>
+      <input  value="{{company}}" name='company' placeholder="请输入您的单位名称"></input>
   </view>
 
   <view class="item" wx:if="{{type != 3}}">
@@ -108,7 +108,7 @@
       <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
   </view>
 
-  <view class="item">
+  <view class="item" wx:if="{{receive==1}}">
       <label>所在地区</label>
       <picker name='area' data-name='area' value="{{area}}"  mode="region" bindchange="pickerChange">
         <view class="picker">
@@ -247,7 +247,7 @@
       <image src="../../images/arrow-bottom.png" mode="widthFix"></image>
   </view>
 
-  <view class="item">
+  <view class="item" wx:if="{{receive==1}}">
       <label>所在地区</label>
       <picker name='area' data-name='area' value="{{area}}"  mode="region" bindchange="pickerChange">
         <view class="picker">

+ 2 - 2
pages/subject/subject.js

@@ -98,13 +98,13 @@ Page({
               console.log(res.data)
               if (res.data.status == 'suc') {
                 wx.showModal({
-                  title: res.data.data.mark+'分',
+                  title: res.data.data.score+'分',
                   content: '您本次考试得分',
                   showCancel: false,
                   success(res) {
                     if (res.confirm) {
                       wx.navigateTo({
-                        url: '../online/online',
+                        url: '../online/online?tab=1',
                       })
                     }
                   }

+ 2 - 7
pages/user/user.js

@@ -31,13 +31,8 @@ Page({
         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,
-        })
-        
+          record:edu
+        })   
       }
     })
   },