Your Name преди 3 месеца
родител
ревизия
a7b111e687
променени са 9 файла, в които са добавени 81 реда и са изтрити 12 реда
  1. 1 1
      app.js
  2. 0 1
      pages/apply/apply.js
  3. 53 2
      pages/index/index.js
  4. 1 1
      pages/index/index.wxml
  5. 9 4
      pages/message/message.js
  6. 6 2
      pages/message/message.wxml
  7. 6 0
      pages/message/message.wxss
  8. 1 1
      pages/online/online.wxml
  9. 4 0
      pages/subject/subject.wxss

+ 1 - 1
app.js

@@ -71,5 +71,5 @@ App({
     host:'https://wxapi.yifeng2016.com',
     categoryArray:[],
     openid:''
-  }
+  },
 })

+ 0 - 1
pages/apply/apply.js

@@ -109,7 +109,6 @@ Page({
     })
   },
   downloadInvoice:function(e){
-    console.log(e,2222222222222222)
     wx.downloadFile({
       url: 'url',
       success: function(res) {

+ 53 - 2
pages/index/index.js

@@ -30,6 +30,8 @@ Page({
     this.setData({
       openid: app.globalData.openid
     })
+    console.log(this.data.openid)
+    this.getNotice()
     wx.getStorage({
       key: 'userInfo',
       success: res=> {
@@ -38,8 +40,6 @@ Page({
         }
       },
     })
-
-
     var animation = wx.createAnimation({
       duration: 1000,
       timingFunction: 'ease',
@@ -102,5 +102,56 @@ Page({
         })
       }
     })
+  },
+  getNotice:function(){
+    wx.showLoading({
+      title: '',
+    })
+    wx.request({
+      url: host+'/api/wx/notice',
+      header: {
+        openid: this.data.openid
+      },
+      success:res=>{
+        if (res.statusCode == 403) {
+          this.save()
+        } else {
+          this.setData({
+            list:res.data.data.list
+          })
+          if(res.data.data.new > 0){
+            wx.setTabBarBadge({
+              index: 2,
+              text: String(res.data.data.new)
+            });
+          }
+        }
+      }
+    })
+  },
+  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();
+          }
+        })
+      },
+    })
   }
 })

+ 1 - 1
pages/index/index.wxml

@@ -13,7 +13,7 @@
       </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}}">
+  <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> -->

+ 9 - 4
pages/message/message.js

@@ -30,12 +30,19 @@ Page({
       },
       success:res=>{
         wx.hideLoading()
+        console.log(res,3333333333333)
         if (res.statusCode == 403) {
           this.save()
         } else {
           this.setData({
-            list:res.data.data
+            list:res.data.data.list
           })
+          if(res.data.data.new > 0){
+            wx.setTabBarBadge({
+              index: 2,
+              text: String(res.data.data.new)
+            });
+          }
         }
       }
     })
@@ -60,12 +67,10 @@ Page({
           success: res => {
             wx.hideLoading()
             _this.getData();
-
           }
         })
       },
     })
-
   },
   /**
    * 生命周期函数--监听页面初次渲染完成
@@ -78,7 +83,7 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
-
+    this.getData()
   },
 
   /**

+ 6 - 2
pages/message/message.wxml

@@ -1,6 +1,10 @@
 <view class="content">
     <navigator wx:for="{{list}}" class="list">
-        <view>{{item.title}}</view>
-        <text>{{item.content}}</text>
+        <view>
+            {{item.title}}
+            <view class="newflag"></view>
+        </view>
+        <text style="display:block;">{{item.content}}</text>
+        <text>{{item.ctime}}</text>
     </navigator>
 </view>

+ 6 - 0
pages/message/message.wxss

@@ -17,4 +17,10 @@ page{
   color: #222;
   font-weight: 600;
   margin-bottom: 5px;
+}
+.newflag{
+  width:15rpx;
+  height:15rpx;
+  border-radius:15rpx;
+  background:red;
 }

+ 1 - 1
pages/online/online.wxml

@@ -41,7 +41,7 @@
         </view>
     </navigator>
 </view>
-<navigator url="../clocklist/clocklist?id={{signup_id}}" style="position:fixed;bottom:100rpx;background-color: rgba(53,139,255,1);" wx:if="{{show&&signup_id}}"
+<navigator url="../clocklist/clocklist?id={{signup_id}}" style="position:fixed;bottom:110rpx;background-color: rgba(53,139,255,1);" wx:if="{{show&&signup_id}}"
  class="complete">查看打卡记录</navigator>
 
 <view bindtap="genclasshour" style="position:fixed;bottom:20rpx;" wx:if="{{show&&signup_id}}" class="complete">已完成学习,立即生成学时证明</view>

+ 4 - 0
pages/subject/subject.wxss

@@ -40,12 +40,16 @@
   overflow-y: auto;
   width: 100%;
 }
+.content view{
+  font-size:32rpx;
+}
 .num{
   margin: 12px 0;
   color: #000;
   font-weight: 600;
   line-height: 50rpx;
   display: flex;
+  font-size:32rpx;
 }
 .num image{
   width: 38px;