Your Name 3 months ago
parent
commit
a7b111e687

+ 1 - 1
app.js

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

+ 0 - 1
pages/apply/apply.js

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

+ 53 - 2
pages/index/index.js

@@ -30,6 +30,8 @@ Page({
     this.setData({
     this.setData({
       openid: app.globalData.openid
       openid: app.globalData.openid
     })
     })
+    console.log(this.data.openid)
+    this.getNotice()
     wx.getStorage({
     wx.getStorage({
       key: 'userInfo',
       key: 'userInfo',
       success: res=> {
       success: res=> {
@@ -38,8 +40,6 @@ Page({
         }
         }
       },
       },
     })
     })
-
-
     var animation = wx.createAnimation({
     var animation = wx.createAnimation({
       duration: 1000,
       duration: 1000,
       timingFunction: 'ease',
       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>
   </view>
   </view>
   <block wx:for="{{data}}" wx:key='*this'>
   <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>
     <view style="font-weight:bold;">{{item.name}}</view>
     <text style="color:#358BFF;">{{item.desc}}</text>
     <text style="color:#358BFF;">{{item.desc}}</text>
     <!-- <image src="{{item.icon}}" mode="widthFix"></image> -->
     <!-- <image src="{{item.icon}}" mode="widthFix"></image> -->

+ 9 - 4
pages/message/message.js

@@ -30,12 +30,19 @@ Page({
       },
       },
       success:res=>{
       success:res=>{
         wx.hideLoading()
         wx.hideLoading()
+        console.log(res,3333333333333)
         if (res.statusCode == 403) {
         if (res.statusCode == 403) {
           this.save()
           this.save()
         } else {
         } else {
           this.setData({
           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 => {
           success: res => {
             wx.hideLoading()
             wx.hideLoading()
             _this.getData();
             _this.getData();
-
           }
           }
         })
         })
       },
       },
     })
     })
-
   },
   },
   /**
   /**
    * 生命周期函数--监听页面初次渲染完成
    * 生命周期函数--监听页面初次渲染完成
@@ -78,7 +83,7 @@ Page({
    * 生命周期函数--监听页面显示
    * 生命周期函数--监听页面显示
    */
    */
   onShow: function () {
   onShow: function () {
-
+    this.getData()
   },
   },
 
 
   /**
   /**

+ 6 - 2
pages/message/message.wxml

@@ -1,6 +1,10 @@
 <view class="content">
 <view class="content">
     <navigator wx:for="{{list}}" class="list">
     <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>
     </navigator>
 </view>
 </view>

+ 6 - 0
pages/message/message.wxss

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

+ 1 - 1
pages/online/online.wxml

@@ -41,7 +41,7 @@
         </view>
         </view>
     </navigator>
     </navigator>
 </view>
 </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>
  class="complete">查看打卡记录</navigator>
 
 
 <view bindtap="genclasshour" style="position:fixed;bottom:20rpx;" wx:if="{{show&&signup_id}}" class="complete">已完成学习,立即生成学时证明</view>
 <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;
   overflow-y: auto;
   width: 100%;
   width: 100%;
 }
 }
+.content view{
+  font-size:32rpx;
+}
 .num{
 .num{
   margin: 12px 0;
   margin: 12px 0;
   color: #000;
   color: #000;
   font-weight: 600;
   font-weight: 600;
   line-height: 50rpx;
   line-height: 50rpx;
   display: flex;
   display: flex;
+  font-size:32rpx;
 }
 }
 .num image{
 .num image{
   width: 38px;
   width: 38px;