Browse Source

登陆/ 首页/ 概览

luck 2 years ago
parent
commit
798d06a039
9 changed files with 669 additions and 156 deletions
  1. 49 17
      app.js
  2. 61 9
      pages/home/index.js
  3. 5 5
      pages/home/index.wxml
  4. 55 3
      pages/login/login.js
  5. 100 53
      pages/logistics/index.js
  6. 42 17
      pages/logistics/index.wxml
  7. 292 9
      pages/logistics/index.wxss
  8. 12 0
      project.private.config.json
  9. 53 43
      utils/api.js

+ 49 - 17
app.js

@@ -1,28 +1,60 @@
 // app.js
+var projectMode = 0;//0代表开发模式(本地环境),1代表测试模式(线上测试环境),2代表线上模式(正式运行环境)
+var info = wx.getSystemInfoSync();
+if (info.platform != "devtools" && projectMode == 0) { projectMode = 1 }
+var envVersion = `${__wxConfig.envVersion}`;//develop	开发版,trial	体验版,release	正式版
+if (envVersion == 'release') { projectMode = 2 }
 import api from './utils/api'
 App({
   onLaunch() {
-    // 展示本地存储能力
-    const logs = wx.getStorageSync('logs') || []
-    logs.unshift(Date.now())
-    wx.setStorageSync('logs', logs)
-
-    // 登录
-    wx.login({
-      success: res => {
-        // 发送 res.code 到后台换取 openId, sessionKey, unionId
-      }
-    })
-
-    // wx.setTabBarBadge({
-    //   index: 2,
-    //   text: '2'
+    //云开发
+    // wx.cloud.init({
+    //   traceUser: true,
     // })
 
+
+    wx.setStorageSync('islocation', false)
+    var that = this;
+
+    this.getLocation();
+
   },
   globalData: {
-    userInfo: null
+    userInfo: null,
+    btnInfo: null,
+    status: ['可下单', '服务中', '已满柜', '暂停服务'],
+    baseAppUrl: projectMode == 2 ? 'https://wash.nanodreamtech.com/' : (projectMode == 1 ? 'https://wash.nanodreamtech.com/' : 'http://192.168.4.23:8000/'),
+    location: "",
+    islocation: true
+  },
+  api: api,
+
+  getLocation(e) {
+    var that = this;
+    wx.getLocation({
+      success(res) {
+        console.log('开启后台定位', res)
+          console.log('location change', res)
+          that.globalData.location = res;
+          wx.setStorageSync('latitude', res.latitude)
+          wx.setStorageSync('longitude', res.longitude)
+         
+      },fail(res) {
+        console.log('开启后台定位失败', res)
+        that.globalData.islocation = false;
+        wx.setStorageSync('islocation', true)
+        wx.showLoading({
+          title: '请授权获取地址。',
+        })
+        setTimeout(function () {
+            wx.hideLoading();
+          }, 2000)
+        
+    
+      }
+    })
   },
-  api: api
 
 })
+
+

+ 61 - 9
pages/home/index.js

@@ -1,6 +1,6 @@
 // pages/tabber/home/index.js
 const api = require('../../utils/api');
-
+const app=getApp();
 Page({
 
     /**
@@ -39,16 +39,44 @@ Page({
                 url:"/pages/serah/index",
                 tit:'搜索运单'
             },
-        ]
+        ],
+        userinfo:"",
+
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-        // api.getBanner().then(res=>{
-        //     console.log(res);
-        // })
+        var that=this;
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/UserInfo", {
+            appid: wx.getAppBaseInfo().host.appId
+          }, "post").then(function (res) {
+            console.log(res);
+            if (res.code == 200) {
+                wx.showLoading({
+                    title: '请重新登录',
+                  })
+                  setTimeout(function () {
+                    wx.hideLoading();
+                   
+                    wx.reLaunch({
+                      url: '/pages/login/login',
+                    })
+                  }, 1000);
+                  
+            } else {
+              wx.hideLoading();
+              wx.removeStorageSync('token')
+              that.setdata({
+                    userinfo:res.message.data
+              })
+              
+            }
+          }).catch(function (err) {
+              
+            console.log(222);
+          })
       
     },
     toUrl(e){
@@ -59,10 +87,34 @@ Page({
         })
     },
     loginOut(){
-        wx.removeStorageSync('token')
-        wx.reLaunch({
-          url: '/pages/login/login',
-        })
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/logout", {
+            appid: wx.getAppBaseInfo().host.appId
+          }, "post").then(function (res) {
+            wx.showLoading({
+              title: '退出中',
+            })
+            console.log(res);
+            if (res.code != 200) {
+           
+                wx.showLoading({
+                    title: '失败请重试',
+                  })
+                  setTimeout(function () {
+                    wx.hideLoading();
+                  }, 1000);
+            } else {
+              wx.hideLoading();
+              wx.removeStorageSync('token')
+              wx.reLaunch({
+                url: '/pages/login/login',
+              })
+            }
+          }).catch(function (err) {
+              
+            console.log(222);
+          })
+     
+       
     }
 
 })

+ 5 - 5
pages/home/index.wxml

@@ -3,8 +3,8 @@
         <view class="le flex">
             <image src="/image/home/user.png" class="user m-right-20"></image>
             <view class="message">
-                <view class="name">大黄</view>
-                <view class="work">物流员 北京一号线</view>
+                <view class="name">{{userinfo.name}}</view>
+                <view class="work">{{userinfo.user_type}} 北京一号线</view>
             </view>
         </view>
         <view class="lr flex ">
@@ -17,15 +17,15 @@
 
     <view class="bottom flex ju-b m-top-40">
         <view class="item flex ju-c">
-            <view class="num">18</view>
+            <view class="num">{{userinfo.wait_num}}</view>
             <view class="tips">前端待收</view>
         </view>
         <view class="item  flex ju-c">
-            <view class="num">18</view>
+            <view class="num">{{userinfo.factory_num}}</view>
             <view class="tips">送至工厂</view>
         </view>
         <view class="item  flex ju-c">
-            <view class="num">18</view>
+            <view class="num">{{userinfo.network_num}}</view>
             <view class="tips">送至网点</view>
         </view>
     </view>

+ 55 - 3
pages/login/login.js

@@ -1,4 +1,5 @@
 // pages/login/login.js
+const app=getApp();
 Page({
 
     /**
@@ -59,9 +60,60 @@ Page({
         })
     },
     login() {
-        console.log(this.data.form);
-        wx.setStorageSync('token', "测试值")
-        wx.navigateTo({
+       var that=this;
+      var phone=this.data.form.phone
+      var password=this.data.form.password
+       if(!phone){
+        wx.showLoading({
+            title: '手机号必填',
+          })
+          setTimeout(function () {
+            wx.hideLoading();
+         
+          }, 1000);
+          return false;
+       }
+       if(!password){
+        wx.showLoading({
+            title: '密码必填',
+          })
+          setTimeout(function () {
+            wx.hideLoading();
+           
+          }, 1000);
+          return false;
+       }
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/login", {
+            phone:this.data.form.phone,
+            password: this.data.form.password,
+            appid: wx.getAppBaseInfo().host.appId
+          }, "post").then(function (res) {
+            wx.showLoading({
+              title: '登录中',
+            })
+            console.log(res);
+            if (res.code != 200) {
+           
+                wx.showLoading({
+                    title: '登录失败',
+                  })
+                  setTimeout(function () {
+                    wx.hideLoading();
+                  }, 2000);
+            } else {
+              wx.hideLoading();
+              wx.setStorageSync('token', res.message.token);
+              wx.navigateTo({
+              
+                url: '/pages/home/index',
+            })
+            }
+          }).catch(function (err) {
+              
+            console.log(222);
+          })
+
+          wx.navigateTo({
               
             url: '/pages/home/index',
         })

+ 100 - 53
pages/logistics/index.js

@@ -6,59 +6,100 @@ Page({
      */
     data: {
         selectInfo: {},
-        logolist:[
+        logolist: [
             {
-            name:'创星汇科技园45栋门前',
-            id:0
-        },      {
-            name:'创星汇科技园45栋门前',
-            id:1
-        },      {
-            name:'创星汇科技园45栋门前',
-            id:2
-        },      {
-            name:'创星汇科技园45栋门前',
-            id:3
-        },      {
-            name:'创星汇科技园45栋门前',
-            id:5
-        },      {
-            name:'创星汇科技园45栋门前',
-            id:6
-        }, {
-            name:'创星汇科技园45栋门前',
-            id:7
-        }, {
-            name:'创星汇科技园45栋门前',
-            id:8
-        }, {
-            name:'创星汇科技园45栋门前',
-            id:9
-        }, {
-            name:'创星汇科技园45栋门前',
-            id:10
-        },
-    ],
-    state:"",
-    detashow:false,
+                title: '创星汇科技园45栋门前', 
+                isp: 1,
+                id: 0
+            }, {
+                title: '创星汇科技园45栋门前', 
+                isp: 0,
+                id: 1
+            }, {
+                title: '创星汇科技园45栋门前', 
+                isp: 1,
+                id: 2
+            }, {
+                title: '创星汇科技园45栋门前', 
+                isp: 0,
+                id: 3
+            }, {
+                title: '创星汇科技园45栋门前', 
+                isp:0,
+                id: 5
+            }, {
+                title: '创星汇科技园45栋门前', 
+                isp: 0,
+                id: 6
+            }, {
+                title: '创星汇科技园45栋门前', 
+                isp: 0,
+                id: 7
+            }, {
+                title: '创星汇科技园45栋门前', 
+                isp: 1,
+                id: 8
+            }, {
+                title: '创星汇科技园45栋门前',
+                id: 9,
+                isp: 1,
+            }, {
+                title: '创星汇科技园45栋门前',
+                id: 10,
+                isp: 1
+            },
+        ],
+        state: "",
+        detashow: 2,
     },
 
     /**
      * 生命周期函数--监听页面加载
      */
     onLoad: function (options) {
-        class Select {
-            in = 1
-            getSelet(){
-                console.log(2);
-                return 10
+
+
+
+    },
+
+    DevicesList(city_id, title, sort) {
+        var that = this;
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/DevicesList", {
+            lng: wx.getStorageSync('latitude'),
+            lat: wx.getStorageSync('longitude'),
+            city_id: city_id,
+            title: title,
+            sort: sort
+        }, "post").then(function (res) {
+            console.log(res);
+            if (res.code == 200) {
+                wx.showLoading({
+                    title: '请重新登录',
+                })
+                setTimeout(function () {
+                    wx.hideLoading();
+
+                    wx.reLaunch({
+                        url: '/pages/home/index',
+                    })
+                }, 1000);
+
+            } else {
+                wx.hideLoading();
+
+                that.setdata({
+                    userinfo: res.message.data
+                })
+
             }
-        }
+        }).catch(function (err) {
 
-        var b = new Select();
-        console.log(b.getSelet());
+            console.log(222);
+        })
     },
 
+
+
     /**
      * 生命周期函数--监听页面初次渲染完成
      */
@@ -73,25 +114,31 @@ Page({
         // query.exec()
     },
     //点击变色 显示按钮
-    seled:function(e){
+    seled: function (e) {
         this.setData({
             state: e.currentTarget.dataset.key,
-          });
-      
+            detashow: 2,
+        });
+
+
+
     },
-    deta:function(){
-        
-        if(this.data.detashow){
+    deta: function () {
+        this.setData({
+            detashow: 0,
+        });
+        return false;
+        if (this.data.detashow) {
             this.setData({
                 detashow: false,
-              });
-        }else{
+            });
+        } else {
             this.setData({
                 detashow: true,
-              });
+            });
         }
-       
-       
+
+
     }
 
 })

+ 42 - 17
pages/logistics/index.wxml

@@ -39,34 +39,22 @@
       </view> -->
 
       <view class="box6 " wx:for="{{logolist}}" bindtap="seled" data-key='{{index}}'>
-        <text lines=" 1" class="paragraph1  {{state==index?'infoBox1':''}}" data-id="{{item.id}}">{{item.name}}</text>
+        <text lines=" 1" class="paragraph1  {{item.isp?'infoBox1':''}}" data-id="{{item.id}}">{{item.title}}</text>
+        <view class="new" wx:if="{{item.isp}}">NEW</view>
       </view>
 
     </view>
-
-
-
-
-    <view class="wrap9">
-      <view class="outer7">
-        <image src="https://636c-cloud1-7g2wlwzh596f43b6-1306306616.tcb.qcloud.la/ic_xiajiantou%402x.png?sign=a9480eb1654afc81b755e285bc89c97c&t=1645151800" class="label3"></image>
-      </view>
-      <view class="outer8">
-        <text lines="1" class="info2">必读说明</text>
-      </view>
-      <text lines="1" decode="true" class="infoBox10">1、新有单柜子标记(仅限按最新订单排序时):<br />当一个柜子从无单变有单时,高亮显示并排列到第一位。<br />2、附近100米有单柜子详情:<br />如果当前手机定位位置附近存在有单柜子,则此卡片自动弹出,并在卡片中展示距离最近的2组柜子,并展示以下信息:<br />&nbsp;&nbsp;&nbsp;(1)柜子名称<br />&nbsp;&nbsp;&nbsp;(2)柜子编号<br />&nbsp;&nbsp;&nbsp;(3)柜子当前距离,单位为米<br />&nbsp;&nbsp;&nbsp;(4)此柜当前待取单数<br />&nbsp;&nbsp;&nbsp;(5)此柜当前待送单数<br />3、点击&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;按钮,卡片展示选中单一柜子信息<br />4、当卡片因定位自动展开时,可点击向下箭头折叠</text>
-    </view>
   </view>
   <!-- <view class="outer9"></view>
   <view class="outer10"></view> -->
-  <view class="outer11" style="{{detashow==false ? 'top: 723rpx;':''}}">
+  <view class="outer11" wx:if="{{detashow==1}}">
     <view class="bd1">
       <view class="wrap10" bindtap="deta">
         <text lines="1" class="word6">附近100米有单网点详情</text>
         <view class="mod3"></view>
       </view>
       <view class="wrap11"></view>
-      <view style="height: 436rpx;">
+      <view style="padding-bottom: 80rpx;">
         <view class="wrap12">
           <view class="group7">
             <text lines="1" class="info3">当代卡梅尔小镇</text>
@@ -101,4 +89,41 @@
       </view>
     </view>
   </view>
-</view>
+
+  <view class="alert6" wx:if="{{detashow==2}}">
+    <view class="alert2">
+      <view class="alert3">
+        <text lines="1" class="alert7">创星汇科技园创星汇科技园</text>
+        <view class="mod3" bindtap="deta"></view>
+      </view>
+      <view class="alert14"></view>
+      <text lines="1" decode="true" class="alert8">曾于今日&nbsp;16:44:00&nbsp;到访</text>
+      <view class="alert9">
+        <view class="section22-0">
+          <view class="groupalert1-0">
+            <view class="section23-0"><image style="width: 30rpx;height: 30rpx;" src="/image/icon/icon_fanhui@2x.png"></image></view>
+            <text lines="1" class="txt40-0">返回</text>
+          </view>
+        </view>
+        <view class="section22-1">
+          <view class="groupalert1-1">
+            <text lines="1" class="info30-1">导航</text>
+            <text lines="1" class="txt40-1">700m</text>
+          </view>
+        </view>
+        <view class="section22-2">
+          <view class="groupalert1-2">
+            <text lines="1" class="info30-2">待取</text>
+            <text lines="1" class="txt40-2">05</text>
+          </view>
+        </view>
+        <view class="section22-3">
+          <view class="groupalert1-3">
+            <text lines="1" class="info30-3">待送</text>
+            <text lines="1" class="txt40-3">01</text>
+          </view>
+        </view>
+      </view>
+    </view>
+  </view>
+  </view>

+ 292 - 9
pages/logistics/index.wxss

@@ -1,6 +1,7 @@
 .page {
   position: relative;
   width: 750rpx;
+  height: 1206rpx;
   background-color: rgba(246,246,246,1);
   overflow: hidden;
   display: flex;
@@ -251,6 +252,17 @@
   width: 187rpx;
   justify-content: center;
 }
+.new{
+  border-radius: 2px;
+  width: 54rpx;
+  height: 30rpx;
+  background: #F5A623;
+  color: #fff;
+  font-size: 20rpx;
+  margin-left: 70%;
+  margin-top: auto;
+  text-align: center;
+}
 .outer3 {
   width: 142rpx;
   height: 28rpx;
@@ -277,7 +289,6 @@
 }
 .wrap4 {
   width: 710rpx;
-  height: 290rpx;
   display: flex;
   flex-wrap: wrap;
   flex-direction: row;
@@ -320,6 +331,7 @@
   width: 224rpx;
   align-items: center;
   margin: 10rpx 0;
+  padding-bottom: 4rpx;
 }
 .paragraph1 {
   width: 192rpx;
@@ -670,7 +682,6 @@
 }
 .wrap9 {
   z-index: 112;
-  background-color: rgba(74,144,226,1);
   margin-top: 418rpx;
   width: 750rpx;
   position: relative;
@@ -749,18 +760,15 @@
   flex-direction: column;
 }
 .outer11 {
-  z-index: 78;
-  /* height: 436rpx; */
-  border-radius: NaNrpx;
+ 
+height: 436rpx; 
+  border-radius: 24px 24px 0px 0px;
   background-color: rgba(255,255,255,1);
   box-shadow: 0px -10px 20px 0px rgba(0,0,0,0.06);
   display: flex;
   flex-direction: column;
-  padding-top: 40rpx;
+  padding-top: 129rpx;
   width: 750rpx;
-  position: absolute;
-  left: 0rpx;
-  top: 256rpx;
 }
 .bd1 {
   width: 750rpx;
@@ -1032,4 +1040,279 @@
   width: 40rpx;
   height: 40rpx;
   margin: 14rpx 0 0 32rpx;
+}
+/*选中弹出*/
+.alert6 {
+  z-index: 73;
+  height: 469rpx;
+  border-radius: 24px 24px 0px 0px;
+  background-color: rgba(255,255,255,1);
+  box-shadow: 0px -10px 20px 0px rgba(0,0,0,0.06);
+  display: flex;
+  flex-direction: column;
+  padding-top: 40rpx;
+  width: 750rpx;
+  margin-top: 47rpx;
+}
+.alert2 {
+  width: 750rpx;
+  height: 348rpx;
+  display: flex;
+  flex-direction: column;
+}
+.alert3 {
+  width: 690rpx;
+  height: 30rpx;
+  margin-left: 30rpx;
+  flex-direction: row;
+  display: flex;
+  justify-content: space-between;
+}
+.alert7 {
+  width: 360rpx;
+  height: 30rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 30rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  /* line-height: 30rpx; */
+  text-align: left;
+}
+
+.alert14 {
+  width: 750rpx;
+  height: 1rpx;
+  background-color: rgba(237,237,237,1);
+  margin-top: 40rpx;
+  display: flex;
+  flex-direction: column;
+}
+.alert8 {
+  width: 255rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(153,153,153,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: left;
+  margin: 40rpx 0 0 248rpx;
+}
+.alert9 {
+  width: 690rpx;
+  height: 148rpx;
+  flex-direction: row;
+  display: flex;
+  justify-content: space-between;
+  margin: 65rpx 0 0 30rpx;
+}
+.section22-0 {
+  height: 148rpx;
+  border-radius: 8rpx;
+  border: 1px solid rgba(228,228,228,1);
+  background-color: rgba(255,255,255,1);
+  margin-right: 30rpx;
+  display: flex;
+  flex-direction: column;
+  padding-top: 35rpx;
+  width: 150rpx;
+  align-items: center;
+}
+.groupalert1-0 {
+  z-index: auto;
+  position: relative;
+  width: 48rpx;
+  height: 72rpx;
+  display: flex;
+  flex-direction: column;
+}
+.section23-0 {
+  z-index: 80;
+  position: absolute;
+  left: 10rpx;
+  top: 0rpx;
+  width: 28rpx;
+  height: 28rpx;
+  display: flex;
+  flex-direction: column;
+}
+.txt40-0 {
+  z-index: 81;
+  position: static;
+  left: 81rpx;
+  top: 1222rpx;
+  width: 73rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: left;
+  margin-top: 48rpx;
+}
+.section22-1 {
+  height: 148rpx;
+  border-radius: 8rpx;
+  border: 1px solid rgba(228,228,228,1);
+  background-color: rgba(255,255,255,1);
+  margin-right: 30rpx;
+  display: flex;
+  flex-direction: column;
+  padding-top: 35rpx;
+  width: 150rpx;
+  align-items: center;
+}
+.groupalert1-1 {
+  z-index: auto;
+  position: relative;
+  width: 48rpx;
+  height: 72rpx;
+  display: flex;
+  flex-direction: column;
+}
+.info30-1 {
+  z-index: 84;
+  position: absolute;
+  left: 0rpx;
+  top: 4rpx;
+  width: 48rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: center;
+}
+.txt40-1 {
+  z-index: 81;
+  position: static;
+  left: 81rpx;
+  top: 1222rpx;
+  width: 73rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: left;
+  margin-top: 48rpx;
+}
+.section22-2 {
+  height: 148rpx;
+  border-radius: 8rpx;
+  border: 1px solid rgba(228,228,228,1);
+  background-color: rgba(255,255,255,1);
+  margin-right: 30rpx;
+  display: flex;
+  flex-direction: column;
+  padding-top: 35rpx;
+  width: 150rpx;
+  align-items: center;
+}
+.groupalert1-2 {
+  z-index: auto;
+  position: relative;
+  width: 48rpx;
+  height: 72rpx;
+  display: flex;
+  flex-direction: column;
+}
+.info30-2 {
+  z-index: 84;
+  position: absolute;
+  left: 0rpx;
+  top: 4rpx;
+  width: 48rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: center;
+}
+.txt40-2 {
+  z-index: 81;
+  position: static;
+  left: 81rpx;
+  top: 1222rpx;
+  width: 73rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: left;
+  margin-top: 48rpx;
+}
+.section22-3 {
+  height: 148rpx;
+  border-radius: 8rpx;
+  border: 1px solid rgba(228,228,228,1);
+  background-color: rgba(255,255,255,1);
+  margin-right: 30rpx;
+  display: flex;
+  flex-direction: column;
+  padding-top: 35rpx;
+  width: 150rpx;
+  align-items: center;
+}
+.groupalert1-3 {
+  z-index: auto;
+  position: relative;
+  width: 48rpx;
+  height: 72rpx;
+  display: flex;
+  flex-direction: column;
+}
+.info30-3 {
+  z-index: 84;
+  position: absolute;
+  left: 0rpx;
+  top: 4rpx;
+  width: 48rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: center;
+}
+.txt40-3 {
+  z-index: 81;
+  position: static;
+  left: 81rpx;
+  top: 1222rpx;
+  width: 73rpx;
+  height: 24rpx;
+  display: block;
+  overflow-wrap: break-word;
+  color: rgba(51,51,51,1);
+  font-size: 24rpx;
+  font-family: PingFangSC-Regular;
+  white-space: nowrap;
+  line-height: 24rpx;
+  text-align: left;
+  margin-top: 48rpx;
 }

+ 12 - 0
project.private.config.json

@@ -83,6 +83,18 @@
           "pathName": "pages/signFor/record",
           "query": "",
           "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/home/index",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "",
+          "pathName": "pages/logistics/index",
+          "query": "",
+          "scene": null
         }
       ]
     }

+ 53 - 43
utils/api.js

@@ -1,47 +1,57 @@
 // api接口请求封装
-console.log(wx.getStorageSync('token'), 'token');
 
 var useApi = (url, data = {}, method = "get") => {
-
-    return new Promise((resolve, reject) => {
-        wx.request({
-            url: `http://192.168.4.12:8080${url}`,
-            data,
-            method,
-            // header: {
-            //     token: wx.getStorageSync('token') || '',
-            //     'content-type': 'application/json',
-            // },
-            dataType: 'json', // 添加这个配置
-            success(res) {
-                // wx.hideLoading()
-
-                resolve(res)
-            },
-            fail(err) {
-                // wx.hideLoading()
-                wx.showToast({
-                    title: '加载失败',
-                    icon: 'none'
-                })
-                reject(err)
-            },
-            complete() {
-                wx.hideLoading({ //因为showToast、hideLoading不能同时使用
-                    fail() { }
-                })
-            }
-        })
+    var that=this;
+    var requrestTask=wx.request
+    wx.showLoading({
+        title: '数据加载中...',
     })
-}
-
-
-function getInfo(data) {
-    return useApi('/getInfo', data)
-}
-
-
-module.exports = {
-    useApi,
-    getInfo,
-}
+        return new Promise((resolve, reject) => {
+            requrestTask ({
+                url: `${url}`, // 云端正式服
+                data,
+                method,
+                header: {
+                    'Authorization': 'Bearer '+wx.getStorageSync('token') || '',
+                    'content-type': 'application/json',
+                },
+                dataType: 'json', // 添加这个配置
+                success(res) {
+                    resolve(res.data)
+                    
+                },
+                fail(err) {
+                    // wx.hideLoading()
+                    wx.showToast({
+                        title: '加载失败',
+                        icon: 'none'
+                    })
+                    reject(err)
+                },
+                complete() {
+                    wx.hideLoading(333)
+                    wx.hideLoading({ //因为showToast、hideLoading不能同时使用
+                        fail() {}
+                    })
+                }
+            }).onHeadersReceived(res=>{
+              if(res && res.header && res.header.Authorization) {
+                console.log("获取requestTask",res)
+                wx.setStorageSync("token", res.header.Authorization);
+              }
+            })
+    
+        })
+        
+    }
+    
+    
+    module.exports = {
+        useApi,
+        getBanner(data) {
+            console.log(1);
+            return useApi('', data)
+    
+        },
+    
+    }