邪性 3 år sedan
förälder
incheckning
d058ddb6ee
61 ändrade filer med 917 tillägg och 193 borttagningar
  1. 13 6
      app.js
  2. 3 3
      app.json
  3. 7 2
      components/l-container/index.js
  4. 4 1
      components/l-container/index.json
  5. 6 5
      components/l-container/index.wxml
  6. 4 0
      components/l-form/index.js
  7. 1 1
      components/l-form/index.wxml
  8. 39 0
      components/l-noticebar/index.js
  9. 6 0
      components/l-noticebar/index.json
  10. 11 0
      components/l-noticebar/index.less
  11. 9 0
      components/l-noticebar/index.wxml
  12. 9 0
      components/l-noticebar/index.wxss
  13. 1 1
      components/l-overlay/index.wxml
  14. 7 3
      pages/adddata/adddata.js
  15. 3 1
      pages/adddata/adddata.json
  16. 4 0
      pages/adddata/adddata.less
  17. 15 11
      pages/adddata/adddata.wxml
  18. 4 0
      pages/adddata/adddata.wxss
  19. 1 1
      pages/addinput/addinput.wxml
  20. 82 0
      pages/balance/balance.js
  21. 4 0
      pages/balance/balance.json
  22. 24 0
      pages/balance/balance.less
  23. 14 0
      pages/balance/balance.wxml
  24. 24 0
      pages/balance/balance.wxss
  25. 2 2
      pages/detail/detail.js
  26. 2 0
      pages/detail/detail.less
  27. 8 2
      pages/detail/detail.wxml
  28. 4 0
      pages/detail/detail.wxss
  29. 87 0
      pages/detailed/detailed.js
  30. 6 0
      pages/detailed/detailed.json
  31. 28 0
      pages/detailed/detailed.less
  32. 14 0
      pages/detailed/detailed.wxml
  33. 30 0
      pages/detailed/detailed.wxss
  34. 79 0
      pages/hot/hot.js
  35. 3 0
      pages/hot/hot.json
  36. 17 0
      pages/hot/hot.less
  37. 12 0
      pages/hot/hot.wxml
  38. 22 0
      pages/hot/hot.wxss
  39. 54 1
      pages/index/index.js
  40. 1 0
      pages/index/index.json
  41. 2 1
      pages/index/index.wxml
  42. 59 8
      pages/leave/leave.js
  43. 3 1
      pages/leave/leave.json
  44. 15 6
      pages/leave/leave.less
  45. 8 6
      pages/leave/leave.wxml
  46. 8 6
      pages/leave/leave.wxss
  47. 43 45
      pages/leaveadd/leaveadd.js
  48. 5 1
      pages/leaveadd/leaveadd.json
  49. 14 17
      pages/leaveadd/leaveadd.less
  50. 16 17
      pages/leaveadd/leaveadd.wxml
  51. 14 17
      pages/leaveadd/leaveadd.wxss
  52. 5 12
      pages/login/login.js
  53. 1 1
      pages/login/login.wxml
  54. 21 2
      pages/order/order.js
  55. 1 1
      pages/order/order.wxml
  56. 1 4
      pages/pay/pay.js
  57. 6 1
      pages/pay/pay.less
  58. 4 3
      pages/pay/pay.wxml
  59. 6 1
      pages/pay/pay.wxss
  60. 1 1
      pages/sgin/sgin.wxml
  61. 20 2
      project.private.config.json

+ 13 - 6
app.js

@@ -70,10 +70,16 @@ App({
     // 定义tabber
     tabber: {
       tabberlist: [{
-        name: '首页',
+        name: '我要订餐',
         url: "/pages/index/index", //对应路径
-        icon: "home-o",//不自定义图片,使用vant的图标
-      }, {
+        icon: "hot-o",//不自定义图片,使用vant的图标
+      },
+      {
+        name: '请假管理',
+        url: "/pages/leave/leave", //对应路径
+        icon: "todo-list-o",//不自定义图片,使用vant的图标
+      },
+      {
         name: "我的",
         url: "/pages/login/login",
         src: "",
@@ -94,6 +100,8 @@ App({
     useraddress: {
       id: null
     },
+    // 广告
+    hot: true,
     // 全局请求方法
     axios ({ url: _url = '', token: _token = true, method: _method = 'post', data: _data = {}, success: _success = () => { }, complete: _complete = () => { } }) {
       let globalurl = "http://192.168.2.45:8887", error = (data) => {
@@ -102,7 +110,7 @@ App({
           icon: "warn-o"
         })
       };
-      globalurl = "https://lsr.zzly.vip";
+      // globalurl = "https://lsr.zzly.vip";
       let header_token = {};
       if (_token) header_token = { 'Authorization': !wx.getStorageSync('token') ? '' : wx.getStorageSync('token') };
       return new Promise(resolve => {
@@ -134,8 +142,7 @@ App({
     // 用户登录状态
     token () {
       let state = wx.getStorageSync('token');
-      if (!!state) return true;
-      return false
+      return !!state;
     }
   }
 })

+ 3 - 3
app.json

@@ -1,6 +1,9 @@
 {
   "pages": [
     "pages/index/index",
+    "pages/balance/balance",
+    "pages/detailed/detailed",
+    "pages/hot/hot",
     "pages/leaveadd/leaveadd",
     "pages/leave/leave",
     "pages/order/order",
@@ -14,14 +17,11 @@
   "window": {
     "backgroundTextStyle": "dark",
     "navigationBarBackgroundColor": "#fff",
-    "navigationBarTitleText": "Weixin",
     "navigationBarTextStyle": "black",
     "navigationStyle": "custom"
   },
   "usingComponents": {
     "l-container": "./components/l-container",
-    "l-overlay": "./components/l-overlay",
-    "l-notify": "./components/l-notify",
     "l-share": "./components/l-share",
     "van-button": "@vant/weapp/button/index",
     "van-image": "@vant/weapp/image/index",

+ 7 - 2
components/l-container/index.js

@@ -1,9 +1,13 @@
 
 // components/l-nav-bar/index.js
 const app = getApp();
+var time = null;
 Component({
+  options: {
+    multipleSlots: true
+  },
   attached () { this._init(); this.dom() },
-  detached: function () { },
+  detached: function () { clearTimeout(time) },
   pageLifetimes: { show () { this._init(), this.tong(); this.dom(); } },
   /**
    * 组件的属性列表
@@ -54,6 +58,7 @@ Component({
     //tabber 跳转事件
     TabberSuccess (event) {
       let { detail } = event;
+      if (detail == this.data.active) return false;
       let { tabberlist } = this.data;
       wx.redirectTo({
         url: tabberlist[detail]["url"],
@@ -86,7 +91,7 @@ Component({
           show: true,
           type: 'loading'
         })
-        const time = setInterval(() => {
+        time = setInterval(() => {
           if (!!app.globalData.codeSession) {
             clearInterval(time)
             wx.lxd.HideOverlay();

+ 4 - 1
components/l-container/index.json

@@ -1,9 +1,12 @@
 {
   "component": true,
   "usingComponents": {
+    "van-transition": "@vant/weapp/transition/index",
     "van-dialog": "@vant/weapp/dialog/index",
     "van-nav-bar": "@vant/weapp/nav-bar/index",
     "van-tabbar": "@vant/weapp/tabbar/index",
-    "van-tabbar-item": "@vant/weapp/tabbar-item/index"
+    "van-tabbar-item": "@vant/weapp/tabbar-item/index",
+    "l-overlay": "../l-overlay",
+    "l-notify": "../l-notify"
   }
 }

+ 6 - 5
components/l-container/index.wxml

@@ -5,15 +5,16 @@
 <!-- 分享栏 -->
 <l-share />
 <!-- 导航栏 -->
-<van-nav-bar custom-class="custom {{bgc ? 'nav-custom1':'nav-custom'}}" bind:click-left="NavSuccess" fixed="{{fixed}}"
-  title-class="nav-title" title="{{title}}">
+<van-nav-bar z-index="100" custom-class="custom {{bgc ? 'nav-custom1':'nav-custom'}}" bind:click-left="NavSuccess"
+  fixed="{{fixed}}" title-class="nav-title" title="{{title}}">
   <van-icon wx:if='{{back}}' size="24" name="arrow-left" slot="left" />
 </van-nav-bar>
 <view style="margin-top: {{MarginTop}}px;" class="container">
-  <slot />
+  <slot name="container" />
 </view>
-<van-tabbar inactive-color="{{inactiveColor}}" active-color="{{activeColor}}" wx:if="{{tabber}}"
-  bind:change="TabberSuccess" active="{{ active }}" bind:change="TabberSuccess">
+<!-- tabber栏 -->
+<van-tabbar z-index="100" inactive-color="{{inactiveColor}}" active-color="{{activeColor}}" wx:if="{{tabber}}"
+  active="{{ active }}" bind:change="TabberSuccess">
   <block wx:for="{{tabberlist}}" wx:key="index">
     <van-tabbar-item wx:if="{{!item.activesrc}}" info="{{item.info}}" icon="{{item.icon}}">{{item.name}}
     </van-tabbar-item>

+ 4 - 0
components/l-form/index.js

@@ -120,6 +120,7 @@ Component({
     },
     // 保存
     submit () {
+      if (!!this.data.submitlock) return false;
       let { formData } = this.data,
         lock = [], i = 0 //提交锁
         ;
@@ -160,6 +161,9 @@ Component({
         })
         return false;
       }
+      this.setData({
+        submitlock: true
+      })
       this.data.Success(formData);
     },
   }

+ 1 - 1
components/l-form/index.wxml

@@ -46,7 +46,7 @@
         error-message="{{item.err ? item.errmsg : ''}}" />
     </block>
     <view class="button">
-      <van-button round block type="info" bindtap="submit">提交</van-button>
+      <van-button disabled="{{submitlock}}" round block type="info" bindtap="submit">提交</van-button>
     </view>
   </van-cell-group>
   <!-- 多列联动选择器 -->

+ 39 - 0
components/l-noticebar/index.js

@@ -0,0 +1,39 @@
+// components/l-noticebar/index.js
+Component({
+  attached () { this._init(); },
+  pageLifetimes: { show () { this._init() } },
+  properties: {
+
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    active: 0,
+    time: 8000,
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    _init () {
+      wx.lxd = wx.lxd || {}, wx.lxd.NoticeBar = e => {
+        e.datalist = e.datalist.map((item, index) => {
+          index == 0 ? item["active"] = true : item["active"] = false;
+          return item;
+        })
+        this.setData({
+          ...e
+        })
+      }
+    },
+    success (e) {
+      let { datalist } = this.data, { index } = e.currentTarget.dataset;
+      wx.navigateTo({
+        url: datalist[index]["url"],
+      })
+    }
+  }
+})

+ 6 - 0
components/l-noticebar/index.json

@@ -0,0 +1,6 @@
+{
+  "component": true,
+  "usingComponents": {
+    "van-notice-bar": "@vant/weapp/notice-bar/index"
+  }
+}

+ 11 - 0
components/l-noticebar/index.less

@@ -0,0 +1,11 @@
+/* components/l-noticebar/index.wxss */
+// #fffbe8
+.noticebar{
+  .flex{
+    display: flex;
+    justify-content: flex-start;align-items: center;
+  }
+  .item{
+    margin-right: 100rpx;
+  }
+}

+ 9 - 0
components/l-noticebar/index.wxml

@@ -0,0 +1,9 @@
+<view wx:if="{{datalist.length!=0}}" class="noticebar">
+  <van-notice-bar scrollable="true" left-icon="volume-o">
+    <view class="flex">
+      <view wx:for="{{datalist}}" wx:key="index" bindtap="success" data-index="{{index}}" class="item">
+        {{index+1}}、{{item.name}}
+      </view>
+    </view>
+  </van-notice-bar>
+</view>

+ 9 - 0
components/l-noticebar/index.wxss

@@ -0,0 +1,9 @@
+/* components/l-noticebar/index.wxss */
+.noticebar .flex {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+}
+.noticebar .item {
+  margin-right: 100rpx;
+}

+ 1 - 1
components/l-overlay/index.wxml

@@ -1,4 +1,4 @@
-<van-overlay show="{{ show }}" bind:click="{{hide ? 'hidefunc' : ''}}">
+<van-overlay z-index="5" show="{{ show }}" bind:click="{{hide ? 'hidefunc' : ''}}">
   <!-- loading类型 -->
   <view class="wrapper">
     <view wx:if="{{type=='loading'}}" class="loading">

+ 7 - 3
pages/adddata/adddata.js

@@ -59,12 +59,15 @@ Page({
   },
   // 删除
   Del (e) {
-    let { item } = e.currentTarget.dataset, that = this;
+    let { index } = e.currentTarget.dataset, { datalist } = this.data, that = this;
     axios({
       method: 'delete',
-      url: `/option/student/${item.id}/`,
+      url: `/option/student/${datalist[index]["id"]}/`,
       success (res) {
-        that.AdddataRequest();
+        datalist.splice(index, 1);
+        that.setData({
+          datalist
+        })
       }
     })
   },
@@ -118,6 +121,7 @@ Page({
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
+
     this.AdddataRequest();
   },
 

+ 3 - 1
pages/adddata/adddata.json

@@ -2,6 +2,8 @@
   "enablePullDownRefresh": true,
   "usingComponents": {
     "van-tag": "@vant/weapp/tag/index",
-    "van-icon": "@vant/weapp/icon/index"
+    "van-empty": "@vant/weapp/empty/index",
+    "van-radio": "@vant/weapp/radio/index",
+    "van-radio-group": "@vant/weapp/radio-group/index"
   }
 }

+ 4 - 0
pages/adddata/adddata.less

@@ -9,6 +9,10 @@
       align-items: center;
       padding: 20rpx 0;
       border-bottom: 1rpx solid #e6e6e6;
+      .radio{
+        justify-content: center;
+        padding-left: 20rpx;
+      }
       .flex-left{
         .left-h1{
           font-weight: 600;

+ 15 - 11
pages/adddata/adddata.wxml

@@ -1,20 +1,24 @@
 <l-container>
-  <view class="globstyle adddata">
+  <view slot="container" class="globstyle adddata">
     <!-- 自定义 -->
     <!-- 列表 -->
     <view class="adddata-data">
-      <view bindtap="Back" data-item="{{item}}" wx:for="{{datalist}}" wx:key="index" class="item-flex">
-        <view class="flex-left">
-          <view class="left-h1">{{item.name}} {{item.tel}} <van-tag wx:if="{{item.lock}}" round type="danger">默认
-            </van-tag>
+      <van-radio-group>
+        <view wx:for="{{datalist}}" wx:key="index" class="item-flex">
+          <van-radio wx:if="{{source}}" data-item="{{item}}" bindtap="Back" name='{{index}}' custom-class="radio" />
+          <view class="flex-left">
+            <view class="left-h1">{{item.name}} {{item.tel}} <van-tag wx:if="{{item.lock}}" round type="danger">默认
+              </van-tag>
+            </view>
+            <view class="left-h2">{{item.address}}</view>
+          </view>
+          <view class="flex-right">
+            <van-icon catchtap="Update" data-item="{{item}}" size="25" class="right-icon" name="edit" />
+            <van-icon catchtap="Del" data-index="{{index}}" size="25" class="right-icon" name="delete-o" />
           </view>
-          <view class="left-h2">{{item.address}}</view>
-        </view>
-        <view class="flex-right">
-          <van-icon catchtap="Update" data-item="{{item}}" size="25" class="right-icon" name="edit" />
-          <van-icon catchtap="Del" data-item="{{item}}" size="25" class="right-icon" name="delete-o" />
         </view>
-      </view>
+      </van-radio-group>
+      <van-empty wx:if="{{datalist.length==0}}" description="暂无学生信息" />
     </view>
     <!-- 新增  -->
     <view class="adddata-button">

+ 4 - 0
pages/adddata/adddata.wxss

@@ -10,6 +10,10 @@
   padding: 20rpx 0;
   border-bottom: 1rpx solid #e6e6e6;
 }
+.adddata .adddata-data .item-flex .radio {
+  justify-content: center;
+  padding-left: 20rpx;
+}
 .adddata .adddata-data .item-flex .flex-left .left-h1 {
   font-weight: 600;
 }

+ 1 - 1
pages/addinput/addinput.wxml

@@ -1,5 +1,5 @@
 <l-container>
-  <view class="globstyle addinput">
+  <view slot="container" class="globstyle addinput">
     <!-- 自定义 -->
     <l-form formData="{{formData}}" />
   </view>

+ 82 - 0
pages/balance/balance.js

@@ -0,0 +1,82 @@
+const app = getApp();
+const { axios } = app.globalData;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+  success () {
+    wx.navigateTo({
+      url: '/pages/detailed/detailed',
+    })
+  },
+  // 请求余额
+  Request () {
+    let that = this;
+    axios({
+      url: '/option/balance/',
+      method: 'get',
+      success (res) {
+        let { data } = res.data;
+        that.setData({
+          ...data[0]
+        })
+        wx.stopPullDownRefresh()
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.lxd.Ctr({
+      // nav
+      title: "我的余额", //标题
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.Request();
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+    this.Request();
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+})

+ 4 - 0
pages/balance/balance.json

@@ -0,0 +1,4 @@
+{
+  "enablePullDownRefresh": true,
+  "usingComponents": {}
+}

+ 24 - 0
pages/balance/balance.less

@@ -0,0 +1,24 @@
+.balance{
+  padding: 10rpx 20rpx;
+  .card{
+    background-color: #fff;
+    border-radius: 20rpx;
+    padding: 20rpx 10rpx;
+    text-align: center;
+    .title{
+      font-weight: 600;
+      color: #777;
+    }
+    .icon{
+      margin: 20rpx 0;
+      font-size: 50px;
+      color:gold;
+    }
+    .price{
+      font-weight: 600;
+    }
+    .btn{
+      margin-top: 50rpx;
+    }
+  }
+}

+ 14 - 0
pages/balance/balance.wxml

@@ -0,0 +1,14 @@
+<l-container>
+  <view slot="container" class="globstyle balance">
+    <view class="card">
+      <view class="title">可用余额</view>
+      <view class="icon">
+        <van-icon name="gold-coin" />
+      </view>
+      <view class="price">¥{{balance}}</view>
+      <view class="btn">
+        <van-button bind:click="success" round type="primary" block>明细</van-button>
+      </view>
+    </view>
+  </view>
+</l-container>

+ 24 - 0
pages/balance/balance.wxss

@@ -0,0 +1,24 @@
+.balance {
+  padding: 10rpx 20rpx;
+}
+.balance .card {
+  background-color: #fff;
+  border-radius: 20rpx;
+  padding: 20rpx 10rpx;
+  text-align: center;
+}
+.balance .card .title {
+  font-weight: 600;
+  color: #777;
+}
+.balance .card .icon {
+  margin: 20rpx 0;
+  font-size: 50px;
+  color: gold;
+}
+.balance .card .price {
+  font-weight: 600;
+}
+.balance .card .btn {
+  margin-top: 50rpx;
+}

+ 2 - 2
pages/detail/detail.js

@@ -43,9 +43,9 @@ Page({
       url: `/commodity/wx_commodity_detail/${id}/`,
       method: "get",
       success (res) {
-        let { amount: price, detail_images: detaillist, introduce: desc, main_image: img, name } = res.data.data;
+        let { amount, price, days, detail_images: detaillist, introduce: desc, main_image: img, name } = res.data.data;
         shopdetail = {
-          name, price, detaillist, desc, img
+          name, price, detaillist, desc, img, amount, days
         };
         that.setData({
           shopdetail

+ 2 - 0
pages/detail/detail.less

@@ -8,6 +8,7 @@
   }
   .detail-shop-detail{
     .value{font-size: 36rpx; color: #f03;font-weight: 600;}
+    .days{font-size: 12px;}
     .detail-flex{
       display: flex;
       .detail-name{
@@ -17,6 +18,7 @@
     }
     .detail-text{
       text-align: justify;
+      color: #f03;
     }
   }
   .detail-shop-detailimg{

+ 8 - 2
pages/detail/detail.wxml

@@ -1,5 +1,5 @@
 <l-container>
-  <view class="globstyle detail">
+  <view slot="container" class="globstyle detail">
     <!-- 自定义内容 -->
     <!-- 商品展示 -->
     <view class="detail-shop-img">
@@ -7,10 +7,16 @@
     </view>
     <!-- 商品数据 -->
     <view class="detail-shop-detail">
-      <van-cell use-label-slot value-class="value" value="¥{{shopdetail.price}}" border="{{ false }}">
+      <van-cell use-label-slot border="{{ false }}">
         <view class="detail-flex" slot="title">
           <view class="detail-name">{{shopdetail.name}}</view>
         </view>
+        <view class="newlabel">
+          <view class="value">¥{{shopdetail.amount}}</view>
+          <view class="days">{{shopdetail.price}}元
+            <van-icon name="cross" />{{shopdetail.days}}天
+          </view>
+        </view>
       </van-cell>
       <van-cell use-label-slot>
         <view class="detail-text" slot="label">{{shopdetail.desc}}</view>

+ 4 - 0
pages/detail/detail.wxss

@@ -9,6 +9,9 @@
   color: #f03;
   font-weight: 600;
 }
+.detail .detail-shop-detail .days {
+  font-size: 12px;
+}
 .detail .detail-shop-detail .detail-flex {
   display: flex;
 }
@@ -18,6 +21,7 @@
 }
 .detail .detail-shop-detail .detail-text {
   text-align: justify;
+  color: #f03;
 }
 .detail .detail-shop-detailimg {
   margin-top: 20rpx;

+ 87 - 0
pages/detailed/detailed.js

@@ -0,0 +1,87 @@
+// pages/detailed/detailed.js
+const app = getApp();
+const { axios } = app.globalData;
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    datalist: []
+  },
+  // 请求明细
+  totalPage: 1,
+  currentPage: 1,
+  Request () {
+    if (this.totalPage < this.currentPage) return false;
+    let { datalist } = this.data, that = this;
+    axios({
+      url: '/option/balance_log/',
+      method: 'get',
+      success (res) {
+        console.log(res)
+        let { data } = res.data;
+        datalist = [...datalist, ...data];
+        that.currentPage++;
+        that.setData({
+          datalist
+        })
+        wx.stopPullDownRefresh();
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    wx.lxd.Ctr({
+      // nav
+      title: "账单明细", //标题
+    })
+  },
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+    this.Request();
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+    this.currentPage = 1;
+    this.totalPage = 1;
+    this.setData({ datalist: [] })
+    this.Request();
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+    this.Request();
+  },
+
+})

+ 6 - 0
pages/detailed/detailed.json

@@ -0,0 +1,6 @@
+{
+  "enablePullDownRefresh": true,
+  "usingComponents": {
+    "van-empty": "@vant/weapp/empty/index"
+  }
+}

+ 28 - 0
pages/detailed/detailed.less

@@ -0,0 +1,28 @@
+/* pages/detailed/detailed.wxss */
+.detailed{
+  padding: 10rpx 20rpx;
+   .container{
+     background-color: #fff;
+     padding: 20rpx;
+     border-radius: 20rpx;
+     .item{
+       padding: 20rpx 0;
+       border-bottom: 1px solid #eee;
+       .flex{
+         display: flex;justify-content: space-between;align-items: center;
+         margin-bottom: 10rpx;
+         .right{
+           font-weight: 600;
+         }
+       }
+       .detail{
+         font-size: 14px;
+         color: #777;
+         text-align: justify;
+       }
+     }
+     &>.item:last-child{
+       border: 0;
+     }
+   }
+}

+ 14 - 0
pages/detailed/detailed.wxml

@@ -0,0 +1,14 @@
+<l-container>
+  <view slot="container" class="globstyle detailed">
+    <view wx:if="{{datalist.length!=0}}" class="container">
+      <view wx:for="{{datalist}}" wx:key="index" class="item">
+        <view class="flex">
+          <view class="left">{{item.create_time_f}}</view>
+          <view class="right">{{item.amount}}</view>
+        </view>
+        <view class="detail">{{item.description}}</view>
+      </view>
+    </view>
+    <van-empty wx:if="{{datalist.length==0}}" description="暂无账单明细" />
+  </view>
+</l-container>

+ 30 - 0
pages/detailed/detailed.wxss

@@ -0,0 +1,30 @@
+/* pages/detailed/detailed.wxss */
+.detailed {
+  padding: 10rpx 20rpx;
+}
+.detailed .container {
+  background-color: #fff;
+  padding: 20rpx;
+  border-radius: 20rpx;
+}
+.detailed .container .item {
+  padding: 20rpx 0;
+  border-bottom: 1px solid #eee;
+}
+.detailed .container .item .flex {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  margin-bottom: 10rpx;
+}
+.detailed .container .item .flex .right {
+  font-weight: 600;
+}
+.detailed .container .item .detail {
+  font-size: 14px;
+  color: #777;
+  text-align: justify;
+}
+.detailed .container > .item:last-child {
+  border: 0;
+}

+ 79 - 0
pages/hot/hot.js

@@ -0,0 +1,79 @@
+// pages/hot/hot.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    let { data } = options;
+    data = JSON.parse(data);
+    this.setData({ ...data });
+    wx.lxd.Ctr({
+      // nav
+      title: "通知", //标题
+      back: true,//返回按钮,tabber必须false(除非会改)
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  onShareAppMessage: function () {
+    return {
+      title: this.data.hot.title,
+      path: `/pages/hot/hot?data=${JSON.stringify({ hot: this.data.hot })}`
+    }
+  },
+  onShareTimeline: function (res) {
+    return {
+      title: this.data.hot.title,
+      query: `data=${JSON.stringify({ hot: this.data.hot })}`
+    }
+  }
+})

+ 3 - 0
pages/hot/hot.json

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

+ 17 - 0
pages/hot/hot.less

@@ -0,0 +1,17 @@
+/* pages/hot/hot.wxss */
+.hot{
+  .container{
+    background-color: #fff;
+    padding: 20rpx;
+    .title{font-weight: 600;text-align: center;}
+    .time{padding-bottom: 20rpx;text-align: center;color: #777;}
+    .content{
+      text-indent: 30px;
+      text-align: justify;
+    }
+    .end{
+      padding-top: 30rpx;
+      text-align: end;
+    }
+  }
+}

+ 12 - 0
pages/hot/hot.wxml

@@ -0,0 +1,12 @@
+<l-container>
+  <view slot="container" class="globstyle hot">
+    <view class="container">
+      <view class="title">{{hot.title}}</view>
+      <view class="time">{{hot.create_time}}</view>
+      <view class="content">{{hot.content}}</view>
+      <view class="end">
+        <view class="user">{{hot.create_user_text}}</view>
+      </view>
+    </view>
+  </view>
+</l-container>

+ 22 - 0
pages/hot/hot.wxss

@@ -0,0 +1,22 @@
+/* pages/hot/hot.wxss */
+.hot .container {
+  background-color: #fff;
+  padding: 20rpx;
+}
+.hot .container .title {
+  font-weight: 600;
+  text-align: center;
+}
+.hot .container .time {
+  padding-bottom: 20rpx;
+  text-align: center;
+  color: #777;
+}
+.hot .container .content {
+  text-indent: 30px;
+  text-align: justify;
+}
+.hot .container .end {
+  padding-top: 30rpx;
+  text-align: end;
+}

+ 54 - 1
pages/index/index.js

@@ -6,6 +6,8 @@ Page({
   data: {
     // 商品列表
     shoplist: [],
+    // 广告
+    datalist: []
   },
   // 点击商品查看详情
   ShopSuccess (e) {
@@ -14,6 +16,35 @@ Page({
       url: `/pages/detail/detail?data=${JSON.stringify({ id })}`,
     })
   },
+  // 请求广告
+  hotrequest () {
+    let that = this;
+    axios({
+      url: '/notices/wx_notices/',
+      method: 'get',
+      success (res) {
+        let { data } = res.data, datalist = [];
+        data.forEach(item => {
+          datalist.push({
+            name: item.title,
+            url: `/pages/hot/hot?data=${JSON.stringify({ hot: item })}`
+          })
+        })
+        that.setData({
+          datalist
+        })
+      }
+    }).then(res => {
+      wx.lxd.NoticeBar({
+        datalist: that.data.datalist
+      })
+      if (app.globalData.hot) {
+        this.hot();
+        app.globalData.hot = false;
+      }
+    })
+
+  },
   //加载商品数据 模拟5条
   PageCount: 1,//总页数
   Page: 1,//当前页数
@@ -47,19 +78,41 @@ Page({
       }
     })
   },
+  // 广告
+  hot () {
+    let { datalist } = this.data;
+    if (datalist.length == 0) return false;
+    wx.showModal({
+      title: '通知',
+      content: datalist[0]['name'],
+      confirmText: '查看',
+      success (res) {
+        if (res.confirm) {
+          wx.navigateTo({
+            url: datalist[0]["url"],
+          })
+        }
+      }
+    })
+  },
   onLoad () {
     wx.lxd.Ctr({
       // nav
-      title: "首页", //标题
+      title: "我要订餐", //标题
       back: false,//返回按钮,tabber必须false(除非会改)
       bgc: false,//使用更改后的颜色;配合json使用
       // tabber
       tabber: true, // 显示
       active: 0,//活动值
     })
+    this.hotrequest();
+  },
+  onReady: function () {
+
   },
   onShow () {
     this.ShopRequest();
+
   },
 
   /**

+ 1 - 0
pages/index/index.json

@@ -1,6 +1,7 @@
 {
   "enablePullDownRefresh": true,
   "usingComponents": {
+    "l-noticebar": "../../components/l-noticebar",
     "van-card": "@vant/weapp/card/index",
     "van-empty": "@vant/weapp/empty/index"
   }

+ 2 - 1
pages/index/index.wxml

@@ -1,5 +1,6 @@
 <l-container>
-  <view class="globstyle index">
+  <view slot="container" class="globstyle index">
+    <l-noticebar />
     <van-card custom-class="card" lazy-load='true' bindtap="ShopSuccess" data-id="{{item.id}}" desc-class="card-desc"
       wx:for="{{shoplist}}" wx:key="index" tag="{{item.tag}}" thumb="{{item.imgurl}}" title="{{item.title}}"
       desc="{{item.desc}}" price="{{item.price}}" num="{{item.num}}" />

+ 59 - 8
pages/leave/leave.js

@@ -7,15 +7,19 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    notice: "",
+    datalist: []
   },
   // 请求管理数据
+  totalPage: 1,
+  currentPage: 1,
   AdddataRequest () {
+    if (this.currentPage > this.totalResult) return false;
     let that = this;
     axios({
       url: "/order/student_leave/", method: 'get', success (res) {
-        console.log(res)
-        let { data } = res.data, datalist = [];
+        let { data, totalPage } = res.data, datalist = that.data.datalist;
+        that.totalPage = totalPage;
         data.forEach(item => {
           let { student_text: name, id } = item;
           datalist.push({
@@ -30,16 +34,20 @@ Page({
         that.setData({
           datalist
         })
+        that.currentPage++;
         wx.stopPullDownRefresh();
       }
     })
   },
   // 删除
   Del (e) {
-    let { item } = e.currentTarget.dataset, that = this;
+    let { index } = e.currentTarget.dataset, that = this, { datalist } = this.data;
     axios({
-      url: `/order/student_leave/${item.id}/`, method: 'delete', success (res) {
-        that.AdddataRequest();
+      url: `/order/student_leave/${datalist[index].id}/`, method: 'delete', success (res) {
+        datalist.splice(index, 1)
+        that.setData({
+          datalist
+        })
       }
     })
   },
@@ -50,15 +58,34 @@ Page({
     wx.lxd.Ctr({
       // nav
       title: "请假管理", //标题
-      back: true,//返回按钮,tabber必须false(除非会改)
+      back: false,
+      tabber: true,
+      active: 1,//活动值
     });
   },
   // 新增
   Add () {
+    if (!this.state) {
+      this.login();
+      return false;
+    }
     wx.navigateTo({
       url: '/pages/leaveadd/leaveadd',
     })
   },
+  login () {
+    wx.showModal({
+      title: '提示',
+      content: '请先登录!',
+      success (res) {
+        if (res.confirm) {
+          wx.navigateTo({
+            url: '/pages/sgin/sgin',
+          })
+        }
+      }
+    })
+  },
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -70,6 +97,17 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function () {
+    let { token, user } = app.globalData;
+    this.state = token();
+    if (!this.state) {
+      this.login();
+      return false;
+    }
+    this.totalResult = 1; this.currentPage = 1;
+    this.setData({
+      datalist: [],
+      notice: `请假截止时间:请假日期的前一天${user.lead_hour}:00`
+    })
     this.AdddataRequest()
   },
 
@@ -85,12 +123,21 @@ Page({
    */
   onUnload: function () {
 
+
   },
 
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */
   onPullDownRefresh: function () {
+    if (!this.state) {
+      this.login();
+      return false;
+    }
+    this.totalResult = 1; this.currentPage = 1;
+    this.setData({
+      datalist: []
+    })
     this.AdddataRequest()
   },
 
@@ -98,7 +145,11 @@ Page({
    * 页面上拉触底事件的处理函数
    */
   onReachBottom: function () {
-
+    if (!this.state) {
+      this.login();
+      return false;
+    }
+    this.AdddataRequest()
   },
 
 })

+ 3 - 1
pages/leave/leave.json

@@ -2,6 +2,8 @@
   "enablePullDownRefresh": true,
   "usingComponents": {
     "van-tag": "@vant/weapp/tag/index",
-    "van-icon": "@vant/weapp/icon/index"
+    "van-icon": "@vant/weapp/icon/index",
+    "van-empty": "@vant/weapp/empty/index",
+    "van-notice-bar": "@vant/weapp/notice-bar/index"
   }
 }

+ 15 - 6
pages/leave/leave.less

@@ -14,10 +14,17 @@
           font-weight: 600;
         }
         .left-h2{
+          .txt{
+            color: #f03;
+          }
           max-width: 85vw;
-          overflow: hidden;
-          text-overflow:ellipsis;
-          white-space: nowrap;
+          // overflow: hidden;
+          // .h-item{
+          //   width: 100%;
+          //   overflow: hidden;
+          //   text-overflow:ellipsis;
+          //   white-space: nowrap;
+          // }
         }
       }
       .flex-right{
@@ -30,9 +37,11 @@
   }
   .adddata-button{
     position: fixed;
-    bottom: 0;
-    width: 100%;
+    bottom: 100px;
     box-sizing: border-box;
-    padding: 10rpx 20rpx;
+    padding: 10rpx 30rpx 10rpx 20rpx;
+    background-color: #f03;
+    color: #fff;
+    right: 0;
   }
 }

+ 8 - 6
pages/leave/leave.wxml

@@ -1,27 +1,29 @@
 <l-container>
-  <view class="globstyle leave">
+  <view slot="container" class="globstyle leave">
     <!-- 自定义 -->
+    <van-notice-bar scrollable left-icon="volume-o" text="{{notice}}" />
     <!-- 列表 -->
     <view class="adddata-data">
-      <view bindtap="Back" data-item="{{item}}" wx:for="{{datalist}}" wx:key="index" class="item-flex">
+      <view wx:for="{{datalist}}" wx:key="index" class="item-flex">
         <view class="flex-left">
           <view class="left-h1">{{item.name}} {{item.tel}} <van-tag wx:if="{{item.lock}}" round type="danger">默认
             </van-tag>
           </view>
           <view class="left-h2">
             <view class="h-item">申请时间:{{item.createdata}}</view>
-            <view class="h-item">请假日期:{{item.enddata}}</view>
+            <view class="h-item">请假日期:<text class="txt">{{item.enddata}}</text></view>
             <view class="h-item">请假内容:{{item.data}}</view>
           </view>
         </view>
         <view class="flex-right">
-          <van-icon catchtap="Del" data-item="{{item}}" size="25" class="right-icon" name="delete-o" />
+          <van-icon catchtap="Del" data-index="{{index}}" size="25" class="right-icon" name="delete-o" />
         </view>
       </view>
+      <van-empty wx:if="{{datalist.length==0}}" description="暂无请假记录" />
     </view>
     <!-- 新增  -->
-    <view class="adddata-button">
-      <van-button bind:click="Add" round type="danger" block>新增</van-button>
+    <view bindtap="Add" class="adddata-button">
+      申请
     </view>
   </view>
 </l-container>

+ 8 - 6
pages/leave/leave.wxss

@@ -15,9 +15,9 @@
 }
 .leave .adddata-data .item-flex .flex-left .left-h2 {
   max-width: 85vw;
-  overflow: hidden;
-  text-overflow: ellipsis;
-  white-space: nowrap;
+}
+.leave .adddata-data .item-flex .flex-left .left-h2 .txt {
+  color: #f03;
 }
 .leave .adddata-data .item-flex .flex-right .right-icon {
   display: block;
@@ -25,8 +25,10 @@
 }
 .leave .adddata-button {
   position: fixed;
-  bottom: 0;
-  width: 100%;
+  bottom: 100px;
   box-sizing: border-box;
-  padding: 10rpx 20rpx;
+  padding: 10rpx 30rpx 10rpx 20rpx;
+  background-color: #f03;
+  color: #fff;
+  right: 0;
 }

+ 43 - 45
pages/leaveadd/leaveadd.js

@@ -7,9 +7,19 @@ Page({
    * 页面的初始数据
    */
   data: {
-
+    active: 0,
+    submitobj: {},
+    orderarr: []
+  },
+  // 挑选
+  CheckboxonChange (e) {
+    let { id } = e.currentTarget.dataset;
+    let { submitobj } = this.data;
+    submitobj[id] = e.detail;
+    this.setData({
+      submitobj
+    })
   },
-
   /**
    * 生命周期函数--监听页面加载
    */
@@ -26,21 +36,10 @@ Page({
       url: `/pages/adddata/adddata?data=${JSON.stringify({ source: 'leaveadd' })}`,
     })
   },
-  // 选择日期
-  choosedata (e) {
-    let { datas } = this.data, { index } = e.currentTarget.dataset;
-    datas[index][2] = !datas[index][2] ? true : false;
-    this.setData({ datas })
-  },
-  // 选择类别
-  choosetype (e) {
-    let { type } = this.data, { index } = e.currentTarget.dataset;
-    type[index]["lock"] = !type[index]["lock"] ? true : false;
-    this.setData({ type });
-  },
   // 提交
   submit () {
-    let { useraddress, datas, type } = this.data;
+    if (!!this.data.submitlock) return false;
+    let { useraddress, submitobj } = this.data;
     if (!useraddress.id) {
       wx.showToast({
         title: '请选择学生',
@@ -48,35 +47,21 @@ Page({
       })
       return false;
     }
-    let arr = [], brr = [];
-    datas.forEach(item => {
-      item[2] ? arr.push(item[0]) : '';
-    })
-    if (arr.length <= 0) {
-      wx.showToast({
-        title: '请选择日期',
-        icon: "error"
-      })
-      return false;
-    }
-    type.forEach(item => {
-      item['lock'] ? brr.push(item["id"]) : '';
-    })
-    if (brr.length <= 0) {
+    delete submitobj["key"];
+    if (submitobj == {}) {
       wx.showToast({
-        title: '请选择内容',
+        title: '请选择请假日期',
         icon: "error"
       })
       return false;
     }
-    console.log(arr)
+    this.setData({ submitlock: true })
     axios({
       url: '/order/student_leave/',
       method: 'post',
       data: {
         student: useraddress.id,
-        leave_dates: JSON.stringify(arr),
-        order_ids: JSON.stringify(brr)
+        leave_dates: JSON.stringify(submitobj),
       },
       success (res) {
         wx.navigateBack({
@@ -98,22 +83,33 @@ Page({
   onShow: function () {
     let { useraddress } = app.globalData, datas = [], type = [], that = this;
     if (!useraddress.id) {
-      useraddress["name"] = "请选择学生"
+      useraddress["name"] = ""
     } else {
       axios({
         url: `/order/student_leave/get_info/?student=${useraddress.id}`,
         method: "get",
         success (res) {
-          let { data } = res.data, { lead_dates, orders } = data;
+          let { data } = res.data, { lead_dates, orders } = data, datas = {}, orderarr = [], submitobj = {};
           type = orders;
-          datas = lead_dates.map(item => {
-            item = item.replace(/\(/, '?');
-            item = item.replace(/\)/, '?');
-            item = item.split("?").splice(0, 2);
-            return item;
+          for (let key in lead_dates) {
+            let arr = [];
+            submitobj["key"] = [];
+            Array.from(lead_dates[key]).forEach(item => {
+              item = item.replace(/\(/, '?');
+              item = item.replace(/\)/, '?');
+              item = item.split("?").splice(0, 2);
+              arr.push(item);
+            })
+            datas[key] = arr;
+          }
+          orders.forEach(item => {
+            orderarr.push({
+              id: item.id,
+              name: item.name,
+              list: datas[item.id]
+            })
           })
-          console.log(type)
-          that.setData({ datas, type })
+          that.setData({ orderarr, submitobj })
         }
       })
     }
@@ -124,14 +120,16 @@ Page({
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
-
+    this.setData({
+      orderarr: []
+    })
   },
 
   /**
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    app.globalData.useraddress = {};
   },
 
   /**

+ 5 - 1
pages/leaveadd/leaveadd.json

@@ -1,5 +1,9 @@
 {
   "usingComponents": {
-    "van-cell": "@vant/weapp/cell/index"
+    "van-cell": "@vant/weapp/cell/index",
+    "van-tab": "@vant/weapp/tab/index",
+    "van-tabs": "@vant/weapp/tabs/index",
+    "van-checkbox": "@vant/weapp/checkbox/index",
+    "van-checkbox-group": "@vant/weapp/checkbox-group/index"
   }
 }

+ 14 - 17
pages/leaveadd/leaveadd.less

@@ -1,5 +1,10 @@
 /* pages/leaveadd/leaveadd.wxss */
 .leaveadd{
+  .red{
+    font-weight: 600;
+    padding: 20rpx 0;
+    color: #f03;
+  }
   .user-address{
     .user-address-h1{
       font-weight: 600;
@@ -12,25 +17,17 @@
     }
   }
   .flex{
-    display: flex;
-    justify-content: start;
-    align-items: center;
-    flex-wrap: wrap;
+    background-color: #fff;
+    padding: 20rpx;
     .item{
-      margin: 10rpx 20rpx;
-      padding: 5rpx 15rpx;
-      color: black;
-      border: 1rpx solid #eee;
-    }
-    .block{
-      background-color: #1989fa;
-      color: #fff;
-      border-radius: 10rpx;
-      border:0;
+      margin: 30rpx ;
     }
   }
-  .button{
-    margin-top: 50rpx;
-    padding: 20rpx;
+  .btn{
+    position: fixed;
+    width: 100%;
+    bottom: 0;
+    box-sizing: border-box;
+    padding: 10rpx 50rpx ;
   }
 }

+ 16 - 17
pages/leaveadd/leaveadd.wxml

@@ -1,9 +1,10 @@
 <l-container>
-  <view class="globstyle  leaveadd">
+  <view slot="container" class="gloabstyle leaveadd">
     <!-- 自定义 -->
     <!-- 收货方 -->
     <van-cell bind:click="ChooseAddress" center is-link>
       <view class="user-address" slot="title">
+        <view wx:if="{{!useraddress.id}}" class="red">请选择学生</view>
         <view class="user-address-h1">{{useraddress.name}} {{useraddress.tel}}</view>
         <view class="user-address-h2">
           <van-tag wx:if="{{useraddress.lock}}" round type="danger">默认</van-tag>
@@ -11,22 +12,20 @@
         </view>
       </view>
     </van-cell>
-    <!-- 选择日期 -->
-    <van-cell title="选择日期" use-label-slot>
-      <view class="flex" slot="label">
-        <view bindtap="choosedata" data-index="{{index}}" wx:for="{{datas}}" wx:key="index"
-          class="item {{item[2] ? 'block' : ''}}">{{item[0]}} {{item[1]}}</view>
-      </view>
-    </van-cell>
-    <!-- 选择类别 -->
-    <van-cell title="选择内容" use-label-slot>
-      <view class="flex" slot="label">
-        <view bindtap="choosetype" data-index="{{index}}" wx:for="{{type}}" wx:key="index"
-          class="item {{item['lock'] ? 'block' : ''}}">{{item.name}}</view>
-      </view>
-    </van-cell>
-    <view class="button">
-      <van-button round block type="info" bindtap="submit">提交</van-button>
+    <!-- 标签栏 -->
+    <van-tabs wx:if="{{orderarr.length!=0}}" active="{{active}}" z-index="1">
+      <van-tab wx:for="{{orderarr}}" wx:key="index" name="{{index}}" title="{{item.name}}">
+        <van-checkbox-group value='{{submitobj[item.id]}}' data-id="{{item.id}}" bind:change="CheckboxonChange">
+          <view class="flex">
+            <view wx:for="{{item.list}}" wx:for-item="it" wx:for-index="in" wx:key="in" class="item">
+              <van-checkbox name="{{it[0]}}">{{it[0]}} {{it[1]}}</van-checkbox>
+            </view>
+          </view>
+        </van-checkbox-group>
+      </van-tab>
+    </van-tabs>
+    <view class="btn">
+      <van-button round bind:click="submit" type="primary" block>提交</van-button>
     </view>
   </view>
 </l-container>

+ 14 - 17
pages/leaveadd/leaveadd.wxss

@@ -1,4 +1,9 @@
 /* pages/leaveadd/leaveadd.wxss */
+.leaveadd .red {
+  font-weight: 600;
+  padding: 20rpx 0;
+  color: #f03;
+}
 .leaveadd .user-address .user-address-h1 {
   font-weight: 600;
 }
@@ -9,24 +14,16 @@
   white-space: nowrap;
 }
 .leaveadd .flex {
-  display: flex;
-  justify-content: start;
-  align-items: center;
-  flex-wrap: wrap;
+  background-color: #fff;
+  padding: 20rpx;
 }
 .leaveadd .flex .item {
-  margin: 10rpx 20rpx;
-  padding: 5rpx 15rpx;
-  color: black;
-  border: 1rpx solid #eee;
+  margin: 30rpx ;
 }
-.leaveadd .flex .block {
-  background-color: #1989fa;
-  color: #fff;
-  border-radius: 10rpx;
-  border: 0;
-}
-.leaveadd .button {
-  margin-top: 50rpx;
-  padding: 20rpx;
+.leaveadd .btn {
+  position: fixed;
+  width: 100%;
+  bottom: 0;
+  box-sizing: border-box;
+  padding: 10rpx 50rpx ;
 }

+ 5 - 12
pages/login/login.js

@@ -16,16 +16,16 @@ Page({
         }
       },
       {
-        title: "学生管理", icon: "friends", require: true, success () {
+        title: "我的余额", icon: "balance-list", require: true, success () {
           wx.navigateTo({
-            url: `/pages/adddata/adddata`,
+            url: `/pages/balance/balance`,
           })
         }
       },
       {
-        title: "请假管理", icon: "column", require: true, success () {
+        title: "学生管理", icon: "friends", require: true, success () {
           wx.navigateTo({
-            url: `/pages/leave/leave`,
+            url: `/pages/adddata/adddata`,
           })
         }
       },
@@ -57,7 +57,7 @@ Page({
       bgc: true,//使用更改后的颜色
       // tabber
       tabber: true,//显示
-      active: 1,//活动值
+      active: 2,//活动值
     })
   },
   // 登录页面
@@ -155,11 +155,4 @@ Page({
   onReachBottom: function () {
 
   },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function () {
-
-  }
 })

+ 1 - 1
pages/login/login.wxml

@@ -1,5 +1,5 @@
 <l-container>
-  <view class="globstyle login">
+  <view slot="container" class="globstyle login">
     <!-- 自定义 -->
     <!-- 背景板 -->
     <view class="login-bg"></view>

+ 21 - 2
pages/order/order.js

@@ -13,7 +13,7 @@ Page({
   // 付款
   pay (e) {
     let { item } = e.currentTarget.dataset, obj = {}, id = null, shopdetail = {};
-    let { appid, user } = app.globalData, { openid } = user;
+    let { appid, user } = app.globalData, { openid } = user, that = this;
     axios({
       url: `/order/${item.id}/pay_order/`,
       method: 'post',
@@ -34,7 +34,26 @@ Page({
               type: 'success',
               icon: "certificate"
             })
-            this.orderRequest()
+            let { active } = that.data;
+            that.orderlist[active]["totalPage"] = 1;
+            that.orderlist[active]["currentPage"] = 1;
+            that.setData({
+              orderlist: [[], [], [], []],
+            })
+            that.orderlist = [{
+              totalPage: 1,
+              currentPage: 1,
+            }, {
+              totalPage: 1,
+              currentPage: 1,
+            }, {
+              totalPage: 1,
+              currentPage: 1,
+            }, {
+              totalPage: 1,
+              currentPage: 1,
+            }],
+              that.orderRequest()
           },
           fail: function () {
             wx.lxd.Notify({

+ 1 - 1
pages/order/order.wxml

@@ -1,5 +1,5 @@
 <l-container>
-  <view class="globstyle order">
+  <view slot="container" class="globstyle order">
     <van-tabs nav-class="nav" bind:click="tabs" active="{{ active }}">
       <van-tab title="全部">
         <view wx:for="{{orderlist[0]}}" wx:key="index" class="item">

+ 1 - 4
pages/pay/pay.js

@@ -102,9 +102,6 @@ Page({
    */
   onShow: function () {
     let { useraddress } = app.globalData;
-    if (!useraddress.id) {
-      useraddress["name"] = "请选择学生"
-    }
     this.setData({ useraddress })
   },
 
@@ -119,7 +116,7 @@ Page({
    * 生命周期函数--监听页面卸载
    */
   onUnload: function () {
-
+    app.globalData.useraddress = {};
   },
 
   /**

+ 6 - 1
pages/pay/pay.less

@@ -3,6 +3,11 @@
   .title{
     font-weight: 600;
   }
+  .red{
+    font-weight: 600;
+    padding: 20rpx;
+    color: #f03;
+  }
   .user-address{
     .user-address-h1{
       font-weight: 600;
@@ -26,7 +31,7 @@
         height: 200rpx;
         white-space:nowrap;
         .img{
-          height: 100%;
+          height: 90%;
           display: inline-block;
           padding: 10rpx;
         }

+ 4 - 3
pages/pay/pay.wxml

@@ -1,9 +1,10 @@
 <l-container>
-  <view class="globstyle pay">
+  <view slot="container" class="globstyle pay">
     <!-- 自定义 -->
     <!-- 收货方 -->
     <van-cell bind:click="ChooseAddress" center is-link>
       <view class="user-address" slot="title">
+        <view wx:if="{{!useraddress.id}}" class="red">请选择学生</view>
         <view class="user-address-h1">{{useraddress.name}} {{useraddress.tel}}</view>
         <view class="user-address-h2">
           <van-tag wx:if="{{useraddress.lock}}" round type="danger">默认</van-tag>
@@ -47,7 +48,7 @@
       </van-radio-group>
     </view>
     <!-- 提交支付 -->
-    <van-submit-bar disabled="{{disabled}}" loading="{{loadding}}" price="{{ shopdetail.price*100 }}" button-text="提交订单"
-      bind:submit="onSubmit" />
+    <van-submit-bar disabled="{{disabled}}" loading="{{loadding}}" price="{{ shopdetail.amount*100 }}"
+      button-text="提交订单" bind:submit="onSubmit" />
   </view>
 </l-container>

+ 6 - 1
pages/pay/pay.wxss

@@ -2,6 +2,11 @@
 .pay .title {
   font-weight: 600;
 }
+.pay .red {
+  font-weight: 600;
+  padding: 20rpx;
+  color: #f03;
+}
 .pay .user-address .user-address-h1 {
   font-weight: 600;
 }
@@ -26,7 +31,7 @@
   white-space: nowrap;
 }
 .pay .pay-list .container .scroll .img {
-  height: 100%;
+  height: 90%;
   display: inline-block;
   padding: 10rpx;
 }

+ 1 - 1
pages/sgin/sgin.wxml

@@ -1,5 +1,5 @@
 <l-container>
-  <view class="globstyle sgin">
+  <view slot="container" class="globstyle sgin">
     <!-- 自定义 -->
     <view class="img">
       <open-data type="userAvatarUrl"></open-data>

+ 20 - 2
project.private.config.json

@@ -21,13 +21,13 @@
         {
           "name": "商品详情",
           "pathName": "pages/detail/detail",
-          "query": "data={\"id\":1}",
+          "query": "data={\"id\":3}",
           "scene": null
         },
         {
           "name": "支付页面",
           "pathName": "pages/pay/pay",
-          "query": "data={\"id\":1}",
+          "query": "data={\"id\":3}",
           "scene": null
         },
         {
@@ -65,6 +65,24 @@
           "pathName": "pages/leaveadd/leaveadd",
           "query": "",
           "scene": null
+        },
+        {
+          "name": "通知",
+          "pathName": "pages/hot/hot",
+          "query": "data={\"hot\":{\"id\":2,\"create_user_text\":\"admin\",\"content\":\"请各位家长,在2021-09-05前,把学生餐费交给学校。\",\"title\":\"9月份缴费通知\",\"create_time\":\"2021-09-03 09:50:31\",\"end_time\":\"2021-09-05\",\"create_user\":1}}",
+          "scene": null
+        },
+        {
+          "name": "账单明细",
+          "pathName": "pages/detailed/detailed",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "我的余额",
+          "pathName": "pages/balance/balance",
+          "query": "",
+          "scene": null
         }
       ]
     }