فهرست منبع

修复点击发送短信未获取到数据时倒计时可能不运行的情况 修复首页数据获取不及时显示网络不好的问题 修改订单列表服务期数显示 新增全局状态管理

wangxin 6 سال پیش
والد
کامیت
d91aad76e4

BIN
.DS_Store


+ 1 - 0
.gitignore

@@ -0,0 +1 @@
+.DS_Store

+ 16 - 4
app.js

@@ -1,14 +1,14 @@
 //app.js
 const utils = require('/utils/util.js').Utils; //载入模块
+const MyProxy = require('./utils/proxy.js').MyProxy;
 App({
 
   /**
    * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
    */
   onLaunch: function() {
-
+    new MyProxy(wx, this.watchData)
   },
-
   /**
    * 当小程序启动,或从后台进入前台显示,会触发 onShow
    */
@@ -20,7 +20,7 @@ App({
           updateManager.onUpdateReady(res => {
             wx.showModal({
               title: '更新提示',
-              content: '新版本上线了,重启应用更新!',
+              content: '新版本上线了,请点击确定按钮更新!',
               showCancel: false,
               success: res => {
                 if (res.confirm) {
@@ -58,9 +58,21 @@ App({
   onError: function(msg) {
 
   },
+  /**
+   * 工具类
+   */
   utils: new utils(wx),
+  /**
+   * 全局变量集合
+   */
   globalData: {
     userInfo: null,
-    phone_zz: /1[0-9]{10}/
+    phone_zz: /1[0-9]{10}/,
+  },
+  /**
+   * 需要监测的全局变量
+   */
+  watchData: {
+    offline: false
   },
 })

+ 1 - 1
component/select-district/select-district.js

@@ -29,7 +29,7 @@ Component({
     city_name: '不限市',
     area_name: '不限区域',
   },
-  ready() {
+  attached() {
     let province = this.data.district.map(val => ({
       "provinceCode": val.provinceCode,
       "provinceName": val.provinceName,

+ 6 - 6
config.js

@@ -1,15 +1,15 @@
 // 测试服
-const apiUrl = "https://hw.hap-job.com/happy-boot"
-const imgServerUrl = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
-const imgServerUrl_new = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
+// const apiUrl = "https://hw.hap-job.com/happy-boot"
+// const imgServerUrl = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
+// const imgServerUrl_new = "https://hpjobtest.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
 // 正式服
-// const apiUrl = "https://web.hap-job.com/happyjob"
+const apiUrl = "https://www.dal-pay.com/happy-boot"
 // const imgServerUrl = "https://happyjob.oss-cn-shanghai.aliyuncs.com/uploadfiles/mina"//图片服务器地址
 // const imgServerUrl_new = "https://happyjob.oss-cn-shanghai.aliyuncs.com"//图片服务器地址
 
 
 module.exports = {
   apiUrl,
-  imgServerUrl,
-  imgServerUrl_new
+  // imgServerUrl,
+  // imgServerUrl_new
 }

BIN
images/.DS_Store


BIN
images/update.png


+ 25 - 31
pages/detail/detail.js

@@ -17,6 +17,7 @@ Page({
     },
     status: 0, //按钮状态 1 我要报名 2 已确认订单 3 订单待确认、订单进行中
     show: true,
+    // btn_message: ''
   },
   /**
    * 需求报名
@@ -111,37 +112,28 @@ Page({
    * 前台报名需求后  后台生成订单   需前台手动确定订单
    */
   buttonSubmit() {
-    let _type = app.utils.getDataType(this.data.hwOrderAPI.contractType)
-    if (_type !== 'Null') {
-      wx.kx_request({
-        url: wx.kx_api.hwOrder.confirmOrder,
-        type: 'post',
-        data: {
-          orderId: this.data.hwOrderAPI.id
-        },
-        success: res => {
-          if (res.errcode === 0) {
-            wx.showToast({
-              title: '订单已确认',
-              success: res => {
-                // 确认成功后 更改按钮状态
-                const hwOrderAPI = this.data.hwOrderAPI;
-                hwOrderAPI.status = 2;
-                this.setData({
-                  hwOrderAPI
-                })
-              }
-            })
-          }
+    wx.kx_request({
+      url: wx.kx_api.hwOrder.confirmOrder,
+      type: 'post',
+      data: {
+        orderId: this.data.hwOrderAPI.id
+      },
+      success: res => {
+        if (res.errcode === 0) {
+          wx.showToast({
+            title: '订单已确认',
+            success: res => {
+              // 确认成功后 更改按钮状态
+              const hwOrderAPI = this.data.hwOrderAPI;
+              hwOrderAPI.status = 2;
+              this.setData({
+                hwOrderAPI
+              })
+            }
+          })
         }
-      })
-    } else {
-      wx.showModal({
-        title: '提示',
-        content: '平台正在拟合同,请耐心等待平台上传后确认',
-        showCancel: false
-      })
-    }
+      }
+    })
   },
   /**
    * 控制cover层的显示与隐藏
@@ -173,9 +165,11 @@ Page({
             },
             success: res => {
               if (res.errcode === 0) {
+                console.log(res.data.hwOrderAPI.serviceStage)
                 this.setData({
                   ...res.data.hwRequirementAPI,
-                  hwOrderAPI: res.data.hwOrderAPI
+                  hwOrderAPI: res.data.hwOrderAPI,
+                  // btn_message: res.data.hwOrderAPI.status === 2 && res.data.hwOrderAPI.serviceStage ? `第${res.data.hwOrderAPI.serviceStage}期服务中` : this.data.message[res.data.hwOrderAPI.status]
                 })
               }
             }

+ 2 - 3
pages/detail/detail.wxml

@@ -7,7 +7,7 @@
     <view class="info">
       <view class="name">{{name}}</view>
       <view class="money">
-        <text>{{app.getPriceForm(price)}}</text>
+        <text>{{price}}</text>
         <text class="month" wx:if='{{settlementMethod===1 }}'>*{{stage || 0}}期</text>
         <text class="month" wx:if='{{settlementMethod===0 }}'>*1次</text>
       </view>
@@ -15,8 +15,7 @@
     <view class="bottom">
       <view class="time">
         <image src="/images/icon/time.png"></image>
-        <text>{{app.formatTime(expiryDate,'.','',true)}}</text>
-        <!-- - {{app.formatTime(expiryDate,'.','',true)}} -->
+        <text>{{expiryDate}}</text>
       </view>
       <view class="job-nums">
         <image src="/images/icon/jobs.png"></image>

+ 23 - 19
pages/index/index.js

@@ -218,7 +218,6 @@ Page({
     const fixTop = this.data.fixTop;
     const scrollTop = this.data.scrollTop;
     if (fixTop > scrollTop) {
-      console.log(status)
       this.setData({
         transition: status
       })
@@ -267,11 +266,11 @@ Page({
       },
       success: res => {
         // 如果没有网络  展示网络故障界面
-        if (res === 'offline') {
-          this.doAnimation(false);
+        if (res === 'offline' && this.data.list.length === 0) {
           this.setData({
             offline: true,
             loading: false,
+            list_length: false
           })
         }
         if (res.errcode === 0) {
@@ -279,7 +278,8 @@ Page({
             // this.doAnimation(false);
             this.setData({
               loading: false,
-              list_length: true
+              list_length: true,
+              offline: false
             })
             return
           }
@@ -297,8 +297,9 @@ Page({
       },
       fail: res => {
         this.setData({
-          offline: true,
           loading: false,
+          list_length: true,
+          offline: false
         })
         this.doAnimation(false);
       },
@@ -327,13 +328,19 @@ Page({
    */
   onLoad: function(options) {
     if (wx.getStorageSync('userid')) {
-      // 获取需求列表
-      this.getList();
-      // 获取首页banner图
-      this.getBanner();
-      this.setData({
-        show: false
-      })
+      if (wx.getStorageSync('userinfo').registerFrom === 0) {
+        wx.reLaunch({
+          url: '/pages/success/success',
+        })
+      } else {
+        // 获取需求列表
+        this.getList();
+        // 获取首页banner图
+        this.getBanner();
+        this.setData({
+          show: false
+        })
+      }
     } else {
       wx.redirectTo({
         url: '/pages/login/login',
@@ -370,13 +377,11 @@ Page({
       duration: 600,
       timingFunction: 'ease',
     })
-    let self = this;
-    wx.createSelectorQuery().select('.choose-area').boundingClientRect(function(rect) {
-      console.log(rect)
-      self.setData({
+    wx.createSelectorQuery().select('.choose-area').boundingClientRect((rect) => {
+      this.setData({
         fixTop: rect.top,
       })
-    }).exec()
+    }).exec();
   },
 
   /**
@@ -429,9 +434,8 @@ Page({
 
   },
   onPageScroll: function(res) {
-    let self = this;
     let top = res.scrollTop;
-    self.setData({
+    this.setData({
       scrollTop: top
     });
   }

+ 3 - 3
pages/index/index.wxml

@@ -62,8 +62,7 @@
       </view>
       <view class="midden">
         <text class="company">{{item.companyName}}</text>
-        <text class="time">{{tool.formatTime(item.expiryDate,'.','',true)}}</text>
-        <!-- - {{tool.formatTime(item.expiryDate,'.','',true)}} -->
+        <text class="time">{{tool.formatTime(item.createTime,'.','',true)}}</text>
       </view>
       <view class="bottom">
         <view class="bottom-item">
@@ -103,4 +102,5 @@
 <view class="cover" animation='{{cover_animation}}'>
   <select-district bind:colose='coloseDistrict' bind:submit='saveDistrict' />
 </view>
-<!-- 蒙层  地区选择结束 -->
+<!-- 蒙层  地区选择结束 -->
+

+ 4 - 3
pages/index/index.wxss

@@ -20,15 +20,16 @@ page {
 }
 
 .block-title {
+  width: 100%;
   color: #31364c;
   font-size: 38rpx;
-  padding: 0 15rpx 15rpx 15rpx;
+  padding: 15rpx;
   background: #fff;
   box-sizing: border-box;
+  border-top: 1rpx solid #f7f7f7;
   display: flex;
   align-items: center;
   justify-content: space-between;
-  width: 100%;
 }
 
 .block-title image {
@@ -282,7 +283,7 @@ swiper-item image {
 }
 
 .transition {
-  top: -412rpx;
+  top: -413rpx;
 }
 
 .choose-area-content.nofixed {

+ 45 - 28
pages/login/login.js

@@ -1,7 +1,7 @@
 // pages/login/login.js
 const app = getApp();
 const speed = 1000;
-const time = 61;
+const time = 60;
 const interval = 200;
 let phoneInter = false;
 let codeInter = false;
@@ -30,14 +30,31 @@ Page({
    */
   getCode(e) {
     if (this.data.time === time) {
-      let _time = this.data.time;
-      _time--;
       if (app.globalData.phone_zz.test(this.data.phone)) {
-        this.setData({
-          code_message: `重新发送(${_time}s)`,
-          color: true,
-          time: _time
-        })
+        this.setInter = setInterval(_ => {
+          let _time = this.data.time;
+          _time--;
+          if (_time > 0) {
+            this.setData({
+              code_message: `重新发送(${_time}s)`,
+              color: true,
+              time: _time
+            })
+          } else {
+            clearInterval(this.setInter);
+            this.setData({
+              code_message: `重新发送`,
+              color: false,
+              time
+            });
+            !this.data.tmp_code && wx.showModal({
+              title: '提示',
+              content: '发送失败,请稍后重试',
+              showCancel: false,
+            })
+          }
+        }, speed)
+
         wx.kx_request({
           url: wx.kx_api.hwuser.getAuthCode,
           data: {
@@ -45,29 +62,24 @@ Page({
           },
           success: res => {
             if (res.errcode === 0) {
-              this.setInter = setInterval(_ => {
-                let _time = this.data.time;
-                if (_time > 0) {
-                  _time--;
-                  this.setData({
-                    code_message: `重新发送(${_time}s)`,
-                    color: true,
-                    time: _time
-                  })
-                } else {
-                  clearInterval(this.setInter)
-                  this.setData({
-                    code_message: `重新发送`,
-                    color: false,
-                    time
-                  })
-                }
-              }, speed)
+              this.setData({
+                tmp_code: res.data.code
+              })
             }
           },
           fail: res => {
-            this.setData({
-              time,
+            clearInterval(this.setInter);
+            wx.showModal({
+              title: '提示',
+              content: '发送失败,请稍后重试',
+              showCancel: false,
+              success: () => {
+                this.setData({
+                  code_message: `重新发送`,
+                  color: false,
+                  time
+                })
+              }
             })
           }
         }, false)
@@ -181,6 +193,11 @@ Page({
    */
   onLoad: function(options) {
     this.options = options;
+    wx.$watch('offline', this, (value) => {
+      if (value) {
+        clearInterval(this.setInter)
+      }
+    })
   },
 
   /**

+ 1 - 1
pages/my-apply/my-apply.wxml

@@ -6,7 +6,7 @@
     <view class="info">
       <view class="name">{{item.hwRequirement.name}}</view>
       <view class="money">
-        <text>{{getPriceForm.getPriceForm(item.hwRequirement.price)}}</text>
+        <text>{{item.hwRequirement.price}}</text>
         <text class="month" wx:if='{{item.hwRequirement.settlementMethod===1 }}'>*{{item.hwRequirement.stage}}期</text>
         <text class="month" wx:if='{{item.hwRequirement.settlementMethod===0 }}'>*1次</text>
       </view>

+ 22 - 31
pages/my-order/my-order.js

@@ -48,38 +48,29 @@ Page({
   confirm(e) {
     const id = e.currentTarget.dataset.id;
     const index = e.currentTarget.dataset.index;
-    const contract_type = e.currentTarget.dataset.contracttype;
-    let _type = app.utils.getDataType(contract_type);
-    if (_type !== "Null") {
-      wx.kx_request({
-        url: wx.kx_api.hwOrder.confirmOrder,
-        type: 'post',
-        data: {
-          orderId: id
-        },
-        success: res => {
-          if (res.errcode === 0) {
-            wx.showToast({
-              title: '订单已确认',
-              success: res => {
-                // 确认成功  更改页面订单状态
-                const list = this.data.list;
-                list[index].status = 2
-                this.setData({
-                  list
-                })
-              }
-            })
-          }
+    wx.kx_request({
+      url: wx.kx_api.hwOrder.confirmOrder,
+      type: 'post',
+      data: {
+        orderId: id
+      },
+      success: res => {
+        if (res.errcode === 0) {
+          wx.showToast({
+            title: '订单已确认',
+            success: res => {
+              // 确认成功  更改页面订单状态
+              const list = this.data.list;
+              list[index].status = 2;
+              list[index].serviceStage = 1;
+              this.setData({
+                list
+              })
+            }
+          })
         }
-      })
-    } else {
-      wx.showModal({
-        title: '提示',
-        content: '平台正在拟合同,请耐心等待平台上传后确认',
-        showCancel: false
-      })
-    }
+      }
+    })
   },
   /**
    * 获取订单列表

+ 2 - 2
pages/my-order/my-order.wxml

@@ -7,13 +7,13 @@
   <view class="cell" data-id="{{item.id}}" data-status="{{item.status}}" bindtap="toDetail" wx:for='{{list}}' wx:key='{{index}}'>
     <view class="title">
       <view class="order-num">{{item.orderNumber}} ></view>
-      <text class="status">{{tool.status(item.status)}}</text>
+      <text class="status">{{tool.status(item.status,item.serviceStage)}}</text>
     </view>
     <view class="content">
       <view class="info">
         <view class="name {{(item.status === 1||item.status === 3)&&'close'}}">{{item.hwRequirement.name}}</view>
         <view class="money {{(item.status === 1||item.status === 3)&&'close'}}">
-          <text>{{getPriceForm.getPriceForm(item.hwRequirement.price)}}</text>
+          <text>{{item.hwRequirement.price}}</text>
           <text class="month" wx:if='{{item.hwRequirement.settlementMethod===1 }}'>*{{item.hwRequirement.stage}}期</text>
           <text class="month" wx:if='{{item.hwRequirement.settlementMethod===0 }}'>*1次</text>
         </view>

+ 4 - 2
pages/my-order/my-order.wxs

@@ -1,5 +1,5 @@
 // 根据状态获取值
-function status(status) {
+function status(status, serviceStage) {
   var json = {
     '0': '待确认',
     '1': '订单关闭',
@@ -7,7 +7,9 @@ function status(status) {
     '3': '订单中止',
     '4': '订单完成'
   };
-
+  if (status === 2 && serviceStage) {
+    return '第' + serviceStage + '期服务中'
+  }
   return json[status.toString()]
 }
 

+ 1 - 1
pages/payment-records-detail/payment-records-detail.wxml

@@ -6,7 +6,7 @@
       <text>收款金额</text>
     </view>
     <view class="right">
-      <text>{{tool.formatMoney(payment)}}</text>
+      <text>{{tool.formatMoney(netPayment)}}</text>
     </view>
   </view>
 

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 18 - 21
pages/service_agreement/service_agreement.wxml


+ 1 - 1
pages/success/success.js

@@ -47,7 +47,7 @@ Page({
           wx.redirectTo({
             url: '/pages/login/login',
           })
-        }, 1200)
+        }, 2000)
       })
     }
   },

+ 5 - 4
project.config.json

@@ -23,8 +23,8 @@
 		}
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.8.2",
-	"appid": "wx997164f2857c1a1d",
+	"libVersion": "2.8.3",
+	"appid": "wxb0f8f3f0de6e8f07",
 	"projectname": "Mina_B",
 	"debugOptions": {
 		"hidedInDevtools": []
@@ -54,7 +54,7 @@
 			"list": []
 		},
 		"miniprogram": {
-			"current": 1,
+			"current": -1,
 			"list": [
 				{
 					"id": 0,
@@ -127,7 +127,7 @@
 					"scene": null
 				},
 				{
-					"id": -1,
+					"id": 10,
 					"name": "pages/index/index",
 					"pathName": "pages/index/index",
 					"query": "",
@@ -144,6 +144,7 @@
 					"id": -1,
 					"name": "注册协议",
 					"pathName": "pages/service_agreement/service_agreement",
+					"query": "",
 					"scene": null
 				}
 			]

+ 144 - 0
utils/proxy.js

@@ -0,0 +1,144 @@
+class MyProxy {
+  constructor(that, watchData) {
+    //  watch函数回调集合
+    that.$_watchCallBack = {}
+    // 绑定到指定对象
+    that.$watch = this.$watch;
+    that.$emit = this.$emit;
+    that.$get = this.$get;
+    that.$Behavior = this.$_behavior();
+    that.$_proxy = this.$_proxy;
+    that.$_remove = this.$_remove;
+    that.$_autoRemove = this.$_autoRemove;
+    // 设置监听对象
+    this._setWatchData(that, watchData);
+  }
+  /**
+   * 设置被监听的对象
+   * @that {Object} this对象
+   * @watchData {object} 被监听的对象
+   */
+  _setWatchData(that, watchData) {
+    that.$watchData = watchData || {}
+  }
+
+  /**
+   * 设置代理
+   * @obj {Object} 将要代理的对象
+   * @callbackArray {Array} 回调函数集合
+   * 
+   */
+  $_proxy(key, value) {
+    const obj = this.$watchData;
+    let _oldValue = obj[key];
+    obj[key] = value;
+    // 确认回调函数存在 循环执行回调数组的方法集合
+    this.$_watchCallBack[key] && this.$_watchCallBack[key].map(val => val && val.cb && val.cb.call(val.page, value, _oldValue))
+  }
+  /**
+   * 提交值
+   * @key {String} 提交的键值
+   * @value {any}  提交的值
+   * @callback {function}  执行之后完成回调
+   */
+  $emit(key, value, callback) {
+    this.$_proxy(key, value);
+    callback && callback()
+  }
+  /**
+   * 获取值
+   * @key {String} 获取的键值
+   * @callback {function} 获取之后执行回调函数
+   */
+  $get(key, callback) {
+    callback && callback(this.$watchData[key]);
+    return this.$watchData[key]
+  }
+  /**
+   * 添加watch方法
+   * @key {String} 要观察的键值
+   * @page {Object} 需监听的页面
+   * @callback {function} 需要执行的回调函数
+   * 
+   */
+  $watch(key, page, callback) {
+    // 首先检测 $_watchCallBack 中对应的值是否存在  如果存在就推入方法
+    this.$_watchCallBack = Object.assign({}, this.$_watchCallBack, {
+      [key]: this.$_watchCallBack[key] || []
+    });
+    // 判断页面是否存入过该方法  若存入过则更改回调方法  否则推入函数
+    let _index = this.$_watchCallBack[key].findIndex(val => val.name === page.__wxExparserNodeId__);
+    if (_index === -1) {
+      console.info(`${page.is} watch=>`, key)
+      // 添加自动移除的方法
+      page = this.$_autoRemove(key, page)
+      // 推入新的监听事件
+      this.$_watchCallBack[key].push({
+        name: page.__wxExparserNodeId__,
+        page,
+        cb: callback
+      })
+    } else {
+      // 存在则改写回调函数
+      this.$_watchCallBack[key][_index].cb = callback;
+    }
+  }
+  /**
+   * 移除监听事件
+   * @key {String} 需要移除监听的键值 
+   * @page {Object} 需移除监听的页面
+   * @callback {function} 移除监听完成的回调函数
+   */
+  $_remove(key, page, callback) {
+    // 获取索引
+    let _index = this.$_watchCallBack[key].findIndex(val => val.name === page.__wxExparserNodeId__);
+    if (_index !== -1) {
+      // 移除监听
+      let _item = this.$_watchCallBack[key].splice(_index, 1);
+      if (_item) {
+        // console.log('remove', key, page)
+        // 确认函数存在  执行回调函数
+        callback && callback.call(page)
+      }
+    }
+  }
+  /**
+   * 自动移除监听
+   * @key {String} 移除的键值
+   * @page {Object} 移除的页面
+   */
+  $_autoRemove(key, page) {
+    // 如果是页面则重载onUnload 函数
+    if (page.route) {
+      let _onUnload = page.onUnload;
+      page.onUnload = () => {
+        this.$_remove(key, page, () => {
+          console.info(`${page.is} remove=>`, key)
+          _onUnload()
+        })
+      };
+      return page;
+    } else {
+      // 自定义组件暂时没想到什么办法
+      page.$$_watch = key;
+      return page;
+    }
+  }
+  /**
+   * 
+   */
+  $_behavior() {
+    return Behavior({
+      detached() {
+        let key = this.$$_watch;
+        wx.$_remove(this.$$_watch, this, () => {
+          console.info(`${this.is} remove=>`, key)
+        })
+      },
+    })
+  }
+}
+
+module.exports = {
+  MyProxy: MyProxy
+}

+ 14 - 10
utils/util.js

@@ -125,9 +125,6 @@ class Utils {
     /* 设置URL */
     options.url = this.getUrl(options.url);
 
-    /* 设置userID和usertoken */
-    let _options = this.getUserId(options);
-
     /* 消除空值字段 */
     // for (let key in options.data) {
     //   if (options.data[key] === undefined || options.data[key] === '') {
@@ -147,6 +144,7 @@ class Utils {
             icon: 'none',
             title: '网络未连接',
           })
+          wx.$emit('offline', true)
           options.success && options.success('offline')
           return
         }
@@ -162,9 +160,11 @@ class Utils {
           //     this._request(data);
           //   });
           // }
+          /* 设置userID和usertoken */
+          let _options = this.getUserId(options);
           this._request(_options);
         } else {
-          this._request(_options);
+          this._request(options);
         }
       }
     })
@@ -194,6 +194,8 @@ class Utils {
         success: function(res) {
           console.log('请求参数=>', opt);
           console.log('服务器响应结果=>', res.statusCode, res.data);
+          // 设置网络状态
+          wx.$emit('offline', false)
           // 判断是否含有成功方法并执行
           if (opt.success && typeof opt.success === 'function') {
             if (res.statusCode === 200) {
@@ -217,9 +219,10 @@ class Utils {
               }
             } else {
               opt.success && opt.success('offline')
-              wx.showToast({
-                icon: 'none',
-                title: '网络异常,请检查后重试',
+              wx.showModal({
+                title: '提示',
+                content: '网络异常,请检查后重试',
+                showCancel: false
               })
             }
           }
@@ -230,9 +233,10 @@ class Utils {
             opt.success && opt.success('offline')
             opt.fail(res.data);
             reject(res.data);
-            wx.showToast({
-              icon: 'none',
-              title: '网络异常,请检查后重试',
+            wx.showModal({
+              title: '提示',
+              content: '网络异常,请检查后重试',
+              showCancel: false
             })
           }
         },