wangxin 5 anos atrás
pai
commit
cd647433e6

BIN
.DS_Store


+ 3 - 2
app.js

@@ -1,13 +1,13 @@
 //app.js
 const utils = require('/utils/util.js').Utils; //载入模块
-const MyProxy = require('./utils/proxy.js').MyProxy;
+const MyWatch = require('./utils/watch.js').MyWatch;
 App({
 
   /**
    * 当小程序初始化完成时,会触发 onLaunch(全局只触发一次)
    */
   onLaunch: function() {
-    new MyProxy(wx, this.watchData)
+    new MyWatch(wx, this.watchData);
   },
   /**
    * 当小程序启动,或从后台进入前台显示,会触发 onShow
@@ -68,6 +68,7 @@ App({
   globalData: {
     userInfo: null,
     phone_zz: /1[0-9]{10}/,
+    webview:null
   },
   /**
    * 需要监测的全局变量

+ 2 - 0
app.json

@@ -12,6 +12,8 @@
     "pages/payment-records/payment-records",
     "pages/payment-records-detail/payment-records-detail",
     "pages/tax-certificate/tax-certificate",
+    "pages/common-setting/common-setting",
+    "pages/version/version",
     "pages/web-view/web-view"
   ],
   "window": {

+ 3 - 3
component/select-district/select-district.wxml

@@ -8,19 +8,19 @@
     <view class="district-content">
 
       <view class="province">
-        <view class="province-item {{item.provinceCode===province_id?'province-action':''}}" wx:for='{{province}}' wx:key='{{index}}' data-district="province" data-id="{{item.provinceCode}}" data-name="{{item.provinceName}}" bindtap="chooseDistrict">
+        <view class="province-item {{item.provinceCode===province_id?'province-action':''}}" wx:for='{{province}}' wx:key="index" data-district="province" data-id="{{item.provinceCode}}" data-name="{{item.provinceName}}" bindtap="chooseDistrict">
           <text>{{item.provinceName}}</text>
         </view>
       </view>
 
       <view class="city">
-        <view class="city-item {{item.cityCode===city_id?'city-action':''}}" wx:for='{{city}}' wx:key='{{index}}' data-district="city" data-id="{{item.cityCode}}" data-name="{{item.cityName}}" bindtap="chooseDistrict">
+        <view class="city-item {{item.cityCode===city_id?'city-action':''}}" wx:for='{{city}}' wx:key="index" data-district="city" data-id="{{item.cityCode}}" data-name="{{item.cityName}}" bindtap="chooseDistrict">
           <text>{{item.cityName}}</text>
         </view>
       </view>
 
       <view class="area">
-        <view class="area-item {{item.countryCode===area_id?'area-action':''}}" wx:for='{{area}}' wx:key='{{index}}' data-district="area" data-id="{{item.countryCode}}" data-name="{{item.countryName}}" bindtap="chooseDistrict">
+        <view class="area-item {{item.countryCode===area_id?'area-action':''}}" wx:for='{{area}}' wx:key="index" data-district="area" data-id="{{item.countryCode}}" data-name="{{item.countryName}}" bindtap="chooseDistrict">
           <text>{{item.countryName}}</text>
         </view>
       </view>

+ 2 - 2
config.js

@@ -1,9 +1,9 @@
 // 测试服
-const apiUrl = "https://hw.hap-job.com/happy-boot"
+// 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://www.dal-pay.com/happy-boot"
+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"//图片服务器地址
 

BIN
images/.DS_Store


BIN
images/icon/.DS_Store


BIN
images/icon/agreement-privacy.png


BIN
images/icon/common-setting.png


BIN
images/icon/version.png


+ 83 - 0
pages/common-setting/common-setting.js

@@ -0,0 +1,83 @@
+// pages/common-setting/common-setting.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    logout: false,
+    url: encodeURIComponent('http://www.hap-job.com/privicy.html')
+  },
+  showLogout() {
+    this.setData({
+      logout: !this.data.logout
+    })
+  },
+  logout() {
+    wx.clearStorage({
+      success: res => {
+        this.setData({
+          logout: false
+        })
+        wx.reLaunch({
+          url: '/pages/login/login',
+        })
+      }
+    })
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  }
+})

+ 4 - 0
pages/common-setting/common-setting.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "通用设置"
+}

+ 38 - 0
pages/common-setting/common-setting.wxml

@@ -0,0 +1,38 @@
+<!--pages/common-setting/common-setting.wxml-->
+<view class="container">
+  <!-- 个人信息 -->
+  <view class="cell-grounp">
+    <navigator class="cell" url="/pages/web-view/web-view?url={{url}}" hover-class="none">
+      <view class="content">
+        <image class="cell-pic" src="/images/icon/agreement-privacy.png"></image>
+        <text>用户协议与隐私政策</text>
+      </view>
+      <image src="/images/icon/right.png" class="right"></image>
+    </navigator>
+    <!-- <navigator class="cell" url="/pages/version/version" hover-class="none">
+      <view class="content">
+        <image class="cell-pic" src="/images/icon/version.png"></image>
+        <text>版本信息</text>
+      </view>
+      <image src="/images/icon/right.png" class="right"></image>
+    </navigator> -->
+  </view>
+  <view class="quit" bindtap="showLogout">
+    注销账户
+  </view>
+</view>
+<view class="cover" wx:if='{{logout}}'>
+
+  <view class="cover-content">
+
+    <view class="body">
+      注销账号是一个不可逆操作, 注销后会失去所有记录,请谨慎操作。
+    </view>
+    <view class="action">
+      <view class="cancel" bindtap="showLogout">取消</view>
+      <view class="confirm" bindtap="logout">确认</view>
+    </view>
+  </view>
+
+
+</view>

+ 98 - 0
pages/common-setting/common-setting.wxss

@@ -0,0 +1,98 @@
+/* pages/common-setting/common-setting.wxss */
+
+page {
+  background: #f5f5f5;
+}
+
+.cell-grounp {
+  margin-top: 20rpx;
+}
+
+.cell {
+  width: 750rpx;
+  height: 148rpx;
+  color: #31364c;
+  font-size: 28rpx;
+  background: #fff;
+  padding: 0 30rpx;
+  box-sizing: border-box;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: 2rpx;
+}
+
+.cell .content {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+
+.cell-pic {
+  width: 68rpx;
+  height: 68rpx;
+  margin-right: 30rpx;
+}
+
+.right {
+  width: 18rpx;
+  height: 30rpx;
+}
+
+.quit {
+  height: 100rpx;
+  font-size: 32rpx;
+  color: #31364c;
+  text-align: center;
+  line-height: 100rpx;
+  background: #fff;
+  margin-top: 20rpx;
+}
+
+.cover {
+  position: fixed;
+  left: 0;
+  top: 0;
+  height: 100%;
+  width: 100%;
+  background: rgba(0, 0, 0, 0.4);
+  display: flex;
+  align-items: center;
+  justify-content: center;
+}
+
+.cover-content {
+  width: 670rpx;
+  height: 384rpx;
+  background: #fff;
+  border-radius: 10rpx;
+  display: flex;
+  flex-direction: column;
+  justify-content: space-between;
+}
+
+.body {
+  color: #31364c;
+  font-size: 38rpx;
+  padding: 0 76rpx;
+  box-sizing: border-box;
+  margin-top: 62rpx;
+}
+
+.action {
+  height: 110rpx;
+  display: flex;
+  align-items: center;
+  border-top: 1rpx solid #cdcfd3;
+}
+
+.action view {
+  flex: 1;
+  line-height: 110rpx;
+  text-align: center;
+}
+
+.cancel {
+  color: #888a8e;
+  border-right: 1rpx solid #cdcfd3;
+}

+ 13 - 2
pages/detail/detail.js

@@ -102,6 +102,12 @@ Page({
             filePath: res.tempFilePath,
             success: res => {
               wx.hideLoading()
+            },
+            fail() {
+              wx.showToast({
+                icon: 'none',
+                title: '打开失败',
+              })
             }
           })
         }
@@ -129,14 +135,19 @@ Page({
         },
         success: res => {
           if (res.errcode === 0) {
-            wx.navigateTo({
+            wx.reLaunch({
               url: `/pages/web-view/web-view?url=${encodeURIComponent(res.data.url)}`,
+              success: res => {
+                app.globalData.webview = `/pages/my-order/my-order`;
+                // wx.setStorageSync('web_view', `/pages/my-order/my-order`)
+                // wx.setStorageSync('web_view', `/${this.route}?id=${this.data.hwOrderAPI.id}&&status=${this.data.status}`)
+              }
             })
           }
         }
       })
     }
-    if (contractType === 1) {
+    if (contractType === 1 || contractType === 0 ) {
       wx.kx_request({
         url: wx.kx_api.hwOrder.confirmOrder,
         type: 'post',

+ 1 - 1
pages/detail/detail.wxss

@@ -34,7 +34,7 @@ page {
 .money {
   color: #3243bd;
   font-size: 38rpx;
-  flex-basis: 490rpx;
+  flex-basis:275rpx;
   text-align: right;
 }
 

+ 23 - 5
pages/index/index.js

@@ -301,7 +301,7 @@ Page({
           list_length: true,
           offline: false
         })
-        this.doAnimation(false);
+        // this.doAnimation(false);
       }
     })
   },
@@ -320,6 +320,19 @@ Page({
       }
     })
   },
+  reload() {
+    // 获取需求列表
+    this.setData({
+      list: [],
+      pageNo: 1,
+      scrollTop: 0
+    }, _ => {
+      this.getList()
+    })
+    // 获取首页banner图
+    this.getBanner();
+    app.utils.getHwUserInfo();
+  },
   /**
    * 生命周期函数--监听页面加载
    */
@@ -330,10 +343,7 @@ Page({
           url: '/pages/success/success',
         })
       } else {
-        // 获取需求列表
-        this.getList();
-        // 获取首页banner图
-        this.getBanner();
+        this.reload();
         this.setData({
           show: false
         })
@@ -388,6 +398,14 @@ Page({
         fixTop: rect.top,
       })
     }).exec();
+    if (app.globalData.webview) {
+      wx.navigateTo({
+        url: app.globalData.webview,
+        success: res => {
+          app.globalData.webview = null
+        }
+      })
+    }
   },
 
   /**

+ 6 - 6
pages/index/index.wxml

@@ -12,7 +12,7 @@
     </view>
     <!-- 页面标题结束 -->
     <swiper class="swiper" indicator-dots indicator-color='#fff' indicator-active-color="#fff" autoplay='{{autoplay}}' circular='{{circular}}' interval='{{interval}}' duration='{{duration}}'>
-      <swiper-item wx:for='{{swiper}}' wx:key='{{index}}'>
+      <swiper-item wx:for='{{swiper}}' wx:key="index">
         <image src="{{item}}"></image>
       </swiper-item>
     </swiper>
@@ -38,10 +38,10 @@
         </view>
       </view>
       <view class="industry-list" hidden="{{condition!=='industry'}}">
-        <view class="industry-list-item  {{index===industry_index?'condition-list-item-action':''}}" wx:for='{{industryList}}' wx:key='{{index}}' bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
+        <view class="industry-list-item  {{index===industry_index?'condition-list-item-action':''}}" wx:for='{{industryList}}' wx:key="index" bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
       </view>
       <view class="price-list" hidden="{{condition!=='price'}}">
-        <view class="price-list-item  {{index===price_index?'condition-list-item-action':''}}" wx:for='{{priceList}}' wx:key='{{index}}' bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
+        <view class="price-list-item  {{index===price_index?'condition-list-item-action':''}}" wx:for='{{priceList}}' wx:key="index" bindtap="choose" data-index="{{index}}" data-id="{{item.id}}">{{item.name}}</view>
       </view>
     </view>
 
@@ -51,8 +51,8 @@
 
   <!-- 需求列表开始 -->
   <view class="list {{fixTop < scrollTop?'margin':''}} ">
-    <block wx:for='{{list}}' wx:key='{{index}}'>
-      <view class="list-item" wx:for='{{item}}' wx:key='{{index}}' data-id="{{item.id}}" bindtap="toDetail">
+    <block wx:for='{{list}}' wx:key="index">
+      <view class="list-item" wx:for='{{item}}' wx:key="index" data-id="{{item.id}}" bindtap="toDetail">
         <view class="top">
           <text class="name">{{item.name}}</text>
           <text class="payment">
@@ -82,7 +82,7 @@
       <view class="offline-content">
         <image src="/images/icon/offline.png"></image>
         <text>没有网络连接</text>
-        <view class="offline-btn" bindtap="getList">重新加载</view>
+        <view class="offline-btn" bindtap="reload">重新加载</view>
       </view>
     </view>
     <view class="loading" wx:if='{{loading}}'>

+ 1 - 1
pages/index/index.wxss

@@ -190,7 +190,7 @@ swiper-item image {
 .payment {
   color: #3243bd;
   font-size: 34rpx;
-  flex-basis: 490rpx;
+  flex-basis: 265rpx;
   text-align: right;
 }
 

+ 2 - 2
pages/login/login.wxml

@@ -7,11 +7,11 @@
   </view>
   <!-- 手机号 -->
   <view class="cell">
-    <input class="input" type="number" placeholder="请输入手机号码" catchinput="checkPhone" name='phone' maxlength="11" placeholder-style="color:#CDCFD3;font-size:30rpx;"></input>
+    <input class="input" type="number" placeholder="请输入手机号码" bindinput="checkPhone" name='phone' maxlength="11" placeholder-style="color:#CDCFD3;font-size:30rpx;"></input>
   </view>
   <!-- 短信验证码 -->
   <view class="cell">
-    <input class="input" type="number" placeholder="请输入短信验证码" catchinput="checkcode" name='code' placeholder-style="color:#CDCFD3;font-size:30rpx;"></input>
+    <input class="input" type="number" placeholder="请输入短信验证码" bindinput="checkcode" name='code' placeholder-style="color:#CDCFD3;font-size:30rpx;"></input>
     <view class="code {{color&&'color'}}" bindtap="getCode">{{code_message || '获取短信验证码'}}</view>
   </view>
   <!-- 注册协议 -->

+ 6 - 1
pages/my-apply/my-apply.js

@@ -55,7 +55,12 @@ Page({
    */
   onLoad: function(options) {
     // 获取报名列表
-    this.getList()
+    this.setData({
+      list: [],
+      pageNo: 1,
+    }, () => {
+      this.getList()
+    })
   },
 
   /**

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

@@ -2,8 +2,8 @@
 <wxs src="my-apply.wxs" module="tool" />
 <wxs src="../../app.wxs" module="getPriceForm" />
 <view class="container">
-  <block wx:for='{{list}}' wx:key='{{index}}'>
-    <view class="cell" data-id="{{item.hwRequirement.id}}" bindtap="toDetail" wx:for='{{item}}' wx:key='{{index}}'>
+  <block wx:for='{{list}}' wx:key="index">
+    <view class="cell" data-id="{{item.hwRequirement.id}}" bindtap="toDetail" wx:for='{{item}}' wx:key="index">
       <view class="info">
         <view class="name">{{item.hwRequirement.name}}</view>
         <view class="money">

+ 14 - 5
pages/my-order/my-order.js

@@ -59,15 +59,19 @@ Page({
         },
         success: res => {
           if (res.errcode === 0) {
-            wx.navigateTo({
-              url: `/pages/web-view/web-view?url=${res.data.url}`,
+            wx.reLaunch({
+              url: `/pages/web-view/web-view?url=${encodeURIComponent(res.data.url)}`,
+              success: res => {
+                app.globalData.webview = `/${this.route}`;
+                // wx.setStorageSync('web_view', `/${this.route}`)
+              }
             })
           }
         }
       })
     }
 
-    if (contracttype === 1) {
+    if (contracttype === 1 || contracttype === 0) {
       wx.kx_request({
         url: wx.kx_api.hwOrder.confirmOrder,
         type: 'post',
@@ -82,7 +86,7 @@ Page({
                 // 确认成功  更改页面订单状态
                 this.setData({
                   [`list[${parentindex}][${index}].status`]: 2,
-                  [`list[${parentindex}][${index}].serviceStage`]: 2,
+                  // [`list[${parentindex}][${index}].serviceStage`]: 2,
                 })
               }
             })
@@ -140,7 +144,12 @@ Page({
    */
   onShow: function() {
     // 获取订单列表
-    this.getList()
+    this.setData({
+      list: [],
+      pageNo: 1
+    }, _ => {
+      this.getList()
+    })
   },
 
   /**

+ 3 - 4
pages/my-order/my-order.wxml

@@ -4,9 +4,9 @@
 
 <view class="container">
 
-  <block wx:for='{{list}}' wx:for-index='key' wx:key='{{index}}'>
+  <block wx:for='{{list}}' wx:for-index='key' wx:key="index">
 
-    <view class="cell" data-id="{{item.id}}" data-status="{{item.status}}" bindtap="toDetail" wx:for='{{item}}' wx:key='{{index}}'>
+    <view class="cell" data-id="{{item.id}}" data-status="{{item.status}}" bindtap="toDetail" wx:for='{{item}}' wx:key="index">
       <view class="title">
         <view class="order-num">{{item.orderNumber}} ></view>
         <text class="status">{{tool.status(item.status,item.serviceStage)}}</text>
@@ -27,8 +27,7 @@
           </view>
         </view>
       </view>
-      <!-- wx:if='{{item.status === 0}}' -->
-      <view class="action" >
+      <view class="action" wx:if='{{item.status === 0}}'>
         <view class="contract" wx:if='{{item.workContract}}' data-contract="{{item.workContract}}" catchtap="checkContract">查看合同</view>
         <view class="order" data-id="{{item.id}}" data-parentIndex="{{key}}" data-index="{{index}}" data-contractType="{{item.contractType}}" catchtap="confirm">确认订单</view>
       </view>

+ 9 - 4
pages/payment-records/payment-records.js

@@ -44,8 +44,7 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function(options) {
-    // 获取支付明细列表
-    this.getList()
+
   },
 
   /**
@@ -59,7 +58,13 @@ Page({
    * 生命周期函数--监听页面显示
    */
   onShow: function() {
-
+    // 获取支付明细列表
+    this.setData({
+      list: [],
+      pageNo: 1,
+    }, _ => {
+      this.getList()
+    })
   },
 
   /**
@@ -84,7 +89,7 @@ Page({
       list: [],
       pageNo: 1,
     }, _ => {
-      this.getList(0)
+      this.getList()
     })
   },
 

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

@@ -2,7 +2,7 @@
 <wxs src="../../app.wxs" module='tool' />
 <view class="container">
   <block wx:for='{{list}}' wx:key='index'>
-    <navigator url="/pages/payment-records-detail/payment-records-detail?id={{item.id}}" class="cell" hover-class="none" wx:for='{{item}}' wx:key='{{index}}'>
+    <navigator url="/pages/payment-records-detail/payment-records-detail?id={{item.id}}" class="cell" hover-class="none" wx:for='{{item}}' wx:key="index">
       <view class="left">
         <text class="order-nums">{{item.orderNumber}}</text>
         <text class="time">{{item.createTime}}</text>

+ 8 - 4
pages/person/person.js

@@ -44,10 +44,14 @@ Page({
   onLoad: function(options) {
     if (wx.getStorageSync('userid')) {
       // 获取用户信息
-      app.utils.getHwUserInfo(this);
-      wx.$watch('userinfo', this, (data) => {
-        this.setData({
-          userinfo: data
+      this.setData({
+        userinfo: wx.getStorageSync('userinfo'),
+      }, _ => {
+        wx.$watch('userinfo', this, (data) => {
+         
+          this.setData({
+            userinfo: data
+          })
         })
       })
     } else {

+ 12 - 1
pages/person/person.wxml

@@ -9,7 +9,7 @@
     </view>
     <view class="name">{{userinfo.name}}</view>
     <view class="sign">
-      {{sign}}
+      {{userinfo.authenticationStatus===0?'未认证':userinfo.authenticationStatus===1?"已认证":"认证不通过"}}
     </view>
   </view>
   <!-- 个人信息 -->
@@ -47,6 +47,17 @@
       <image src="/images/icon/right.png" class="right"></image>
     </navigator>
   </view>
+
+
+  <!-- <view class="cell-grounp">
+    <navigator class="cell" url="/pages/common-setting/common-setting" hover-class="none">
+      <view class="content">
+        <image class="cell-pic" src="/images/icon/common-setting.png"></image>
+        <text>通用设置</text>
+      </view>
+      <image src="/images/icon/right.png" class="right"></image>
+    </navigator>
+  </view> -->
   <view class="quit" bindtap="quit">
     退出登录
   </view>

+ 90 - 0
pages/version/version.js

@@ -0,0 +1,90 @@
+// pages/version/version.js
+Page({
+
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    update: false
+  },
+  update() {
+    if (wx.getUpdateManager) {
+      const updateManager = wx.getUpdateManager();
+      updateManager.onCheckForUpdate(res => {
+        if (res.hasUpdate) {
+          updateManager.onUpdateReady(res => {
+            updateManager.applyUpdate()
+          })
+          updateManager.onUpdateFailed(res => {
+            wx.showModal({
+              title: '更新提示',
+              content: '请删除当前小程序,重新搜索进入',
+              showCancel: false,
+            })
+          })
+        }
+      })
+    } else {
+      wx.showModal({
+        title: '更新提示',
+        content: '请删除当前小程序,重新搜索进入',
+        showCancel: false,
+      })
+    }
+  },
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function(options) {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function() {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function() {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function() {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function() {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function() {
+
+  }
+})

+ 4 - 0
pages/version/version.json

@@ -0,0 +1,4 @@
+{
+  "navigationBarTitleText": "版本信息",
+  "usingComponents": {}
+}

+ 11 - 0
pages/version/version.wxml

@@ -0,0 +1,11 @@
+<!--pages/version/version.wxml-->
+<view class="container">
+
+  <view class="version-now">当前版本为 v 1.0.0</view>
+
+  <view class="message" wx:if='{{!update}}'>您已是最新版本</view>
+  <view wx:if='{{update}}' class="message">可升级至最新版本 v1.0.1</view>
+  <view class="button" bindtap="update" wx:if='{{update}}'>
+    <view>立即升级</view>
+  </view>
+</view>

+ 39 - 0
pages/version/version.wxss

@@ -0,0 +1,39 @@
+/* pages/version/version.wxss */
+
+.container {
+  color: #888a8e;
+  font-size: 32rpx;
+}
+
+.version-now {
+  text-align: center;
+  margin-top: 151rpx;
+}
+
+.message {
+  text-align: center;
+  margin-top: 50rpx;
+}
+
+.button {
+  width: 100%;
+  height: 127rpx;
+  background: #fff;
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  position: fixed;
+  left: 0;
+  bottom: 0;
+}
+
+.button view {
+  width: 690rpx;
+  height: 88rpx;
+  color: #fff;
+  font-size: 34rpx;
+  text-align: center;
+  line-height: 88rpx;
+  background: linear-gradient(135deg, rgba(85, 104, 240, 1) 0%, rgba(130, 59, 255, 1) 100%);
+  border-radius: 10rpx;
+}

+ 0 - 1
pages/web-view/web-view.js

@@ -7,7 +7,6 @@ Page({
   data: {
 
   },
-
   /**
    * 生命周期函数--监听页面加载
    */

+ 2 - 1
pages/web-view/web-view.wxml

@@ -1,2 +1,3 @@
 <!--pages/web-view/web-view.wxml-->
-<web-view src='{{url}}'></web-view>
+<web-view src='{{url}}' bindload='test'></web-view>
+<view>222</view>

+ 11 - 2
project.config.json

@@ -12,6 +12,8 @@
 		"newFeature": true,
 		"coverView": true,
 		"autoAudits": false,
+		"showShadowRootInWxmlPanel": true,
+		"scopeDataCheck": false,
 		"uglifyFileName": true,
 		"checkInvalidKey": true,
 		"checkSiteMap": true,
@@ -23,8 +25,8 @@
 		}
 	},
 	"compileType": "miniprogram",
-	"libVersion": "2.8.2",
-	"appid": "wx997164f2857c1a1d",
+	"libVersion": "1.7.4",
+	"appid": "wxb0f8f3f0de6e8f07",
 	"projectname": "Mina_B",
 	"debugOptions": {
 		"hidedInDevtools": []
@@ -153,6 +155,13 @@
 					"pathName": "pages/web-view/web-view",
 					"query": "",
 					"scene": null
+				},
+				{
+					"id": 14,
+					"name": "通用设置",
+					"pathName": "pages/common-setting/common-setting",
+					"query": "",
+					"scene": null
 				}
 			]
 		}

+ 1 - 3
utils/config_api.js

@@ -3,7 +3,5 @@ module.exports = {
     '/api/hwuser/getAuthCode', //获取验证码
     '/api/hwuser/phoneLogin', //手机号登陆
   ],
-  no_openid: [
-    '/api/hwUser/banner'
-  ]
+  no_openid: []
 }

+ 51 - 36
utils/util.js

@@ -126,8 +126,10 @@ class Utils {
       wx.getNetworkType({
         success: function(res) {
           if (res.networkType === 'none') {
+            wx.$emit('offline', true)
             reslove('offline')
           } else {
+            wx.$emit('offline', false)
             reslove(res.networkType)
           }
         },
@@ -144,6 +146,20 @@ class Utils {
     @status 是否携带userID
   */
   async request(options) {
+    /**
+     * 检测网络状况 并判断是否发起请求
+     * 当无网络时传入 offline 并提示无网络
+     */
+    const networkType = await this.getNetworkType();
+    if (networkType === 'offline') {
+      wx.showToast({
+        icon: 'none',
+        title: '网络未连接',
+      })
+      options.success && options.success(networkType)
+      return this.getNetworkType()
+    }
+
     /* 拼接接口地址 */
     if (this.getDataType(options.url) !== 'String') {
       throw new Error('接口路径格式错误')
@@ -186,36 +202,22 @@ class Utils {
     //   }
     // }
 
-    /**
-     * 检测网络状况 并判断是否发起请求
-     * 当无网络时传入 offline 并提示无网络
-     */
-    const networkType = await this.getNetworkType();
-    if (networkType === 'offline') {
-      wx.showToast({
-        icon: 'none',
-        title: '网络未连接',
-      })
-      wx.$emit('offline', true)
-      options.success && options.success(networkType)
-      return this.getNetworkType()
+    /**根据判断写入openid */
+    // if (!options.no_openid) {
+    //   options.data.openid = await this.getOpenid();
+    // }
+
+    /* 根据dont_login判断是否需要登录 */
+    if (options.dont_login) {
+      return this._request(options);
     } else {
-      /**根据判断写入openid */
-      // if (!options.no_openid) {
-      //   options.data.openid = await this.getOpenid();
-      // }
-      /* 根据dont_login判断是否需要登录 */
-      if (options.dont_login) {
-        return this._request(options);
+      /* 设置userID和usertoken */
+      let _options = await this.getUserId(options);
+      /** 当user_id与user_token不全时 提示登陆重新获取 */
+      if (_options.data.user_id && _options.data.user_token) {
+        return this._request(_options);
       } else {
-        /* 设置userID和usertoken */
-        let _options = await this.getUserId(options);
-        /** 当user_id与user_token不全时 提示登陆重新获取 */
-        if (_options.data.user_id && _options.data.user_token) {
-          return this._request(_options);
-        } else {
-          this._doLogin();
-        }
+        this._doLogin();
       }
     }
   }
@@ -243,8 +245,6 @@ class Utils {
         dataType: opt.dataType,
         responseType: opt.responseType,
         success: function(res) {
-          // 设置网络状态
-          wx.$emit('offline', false)
           // 判断是否含有成功方法并执行
           if (opt.success && typeof opt.success === 'function') {
             if (res.statusCode === 200) {
@@ -353,7 +353,14 @@ class Utils {
       user_id: wx.getStorageSync('userid'),
       user_token: wx.getStorageSync('usertoken'),
       ...options.formData
-    }
+    };
+    !this._loading && wx.showLoading({
+      mask: true,
+      title: '上传中...',
+      success: () => {
+        this._loading = true
+      }
+    })
     return new Promise((reslove, reject) => {
       if (_type === "Array") {
         const _arr = [];
@@ -372,6 +379,11 @@ class Utils {
                 if (data.errcode === 0) {
                   _arr.push(data.data);
                   if (_len === key) {
+                    wx.hideLoading({
+                      success: () => {
+                        this._loading = false;
+                      }
+                    })
                     reslove(_arr)
                   }
                 }
@@ -401,11 +413,14 @@ class Utils {
     wx.kx_request({
       url: wx.kx_api.hwUser.getHwUserInfo,
       success: res => {
-        //成功后存入缓存
-        wx.setStorageSync('userinfo', res.data.hwUser);
-        that.setData({
-          userinfo: res.data.hwUser
-        })
+        if (res.data) {
+          //成功后存入缓存
+          wx.setStorageSync('userinfo', res.data.hwUser);
+          // 判断是否提交页面数据
+          that && that.setData({
+            userinfo: res.data.hwUser
+          })
+        }
       }
     })
   }

+ 19 - 11
utils/proxy.js

@@ -1,4 +1,4 @@
-class MyProxy {
+class MyWatch {
   constructor(that, watchData) {
     //  watch函数回调集合
     that.$_watchCallBack = {}
@@ -6,8 +6,8 @@ class MyProxy {
     that.$watch = this.$watch;
     that.$emit = this.$emit;
     that.$get = this.$get;
-    that.$Behavior = this.$_behavior();
-    that.$_proxy = this.$_proxy;
+    that.$behavior = this.$behavior();
+    that.$_watch = this.$_watch;
     that.$_remove = this.$_remove;
     that.$_autoRemove = this.$_autoRemove;
     // 设置监听对象
@@ -23,17 +23,21 @@ class MyProxy {
   }
 
   /**
-   * 设置代理
-   * @obj {Object} 将要代理的对象
+   * 设置监听
+   * @obj {Object} 将要监听的对象
    * @callbackArray {Array} 回调函数集合
    * 
    */
-  $_proxy(key, value) {
+  $_watch(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))
+    if (typeof _oldValue === 'object' && typeof value === 'object') {
+      this.$_watchCallBack[key] && this.$_watchCallBack[key].map(val => val && val.cb && val.cb.call(val.page, value, _oldValue))
+    } else {
+      _oldValue !== value && this.$_watchCallBack[key] && this.$_watchCallBack[key].map(val => val && val.cb && val.cb.call(val.page, value, _oldValue))
+    }
   }
   /**
    * 提交值
@@ -42,7 +46,11 @@ class MyProxy {
    * @callback {function}  执行之后完成回调
    */
   $emit(key, value, callback) {
-    this.$_proxy(key, value);
+    // 不可传值为function、null、undefined以及NaN
+    if (typeof value === 'function' || typeof value === 'undefined' || value === null || Number.isNaN(value)) {
+      throw new Error(`${value}为非法参数传值`)
+    }
+    this.$_watch(key, value);
     callback && callback()
   }
   /**
@@ -119,7 +127,7 @@ class MyProxy {
       };
       return page;
     } else {
-      // 自定义组件暂时没想到什么办法
+      // 自定义组件使用behaviors移除 将监听字段赋值给$$_watch
       page.$$_watch = key;
       return page;
     }
@@ -127,7 +135,7 @@ class MyProxy {
   /**
    * 组件Behavior方法 需自行引入组件的behaviors
    */
-  $_behavior() {
+  $behavior() {
     return Behavior({
       detached() {
         let key = this.$$_watch;
@@ -140,5 +148,5 @@ class MyProxy {
 }
 
 module.exports = {
-  MyProxy: MyProxy
+  MyWatch: MyWatch
 }