wenjie 1 долоо хоног өмнө
parent
commit
28612b1210

+ 1 - 0
pages/category/category.wxml

@@ -108,6 +108,7 @@
         </view>
         </view>
       </view>
       </view>
       <scroll-view class="right-box"  scroll-y="true" 	enable-passive 	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll" bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
       <scroll-view class="right-box"  scroll-y="true" 	enable-passive 	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll" bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+        <view style="height:20px"></view>
         <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
         <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
           <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
           <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
           <view class="info">
           <view class="info">

+ 1 - 0
pages/category1/category.wxml

@@ -108,6 +108,7 @@
         </view>
         </view>
       </view>
       </view>
       <scroll-view class="right-box"  scroll-y="true" 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
       <scroll-view class="right-box"  scroll-y="true" 	enable-passive scroll-into-view="{{rightView}}"	upper-threshold="10" 	lower-threshold="10"  scroll-top="{{topHeight}}" bindscroll="scroll"bindscrolltoupper="scrollTop" bindscrolltolower="scrollBottom">
+        <view style="height:20px"></view>
         <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
         <view class="product-item" id="{{'test'+index}}" wx:for="{{productList}}">
           <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
           <image class="pic" src="{{item.pic}}" mode="" data-prodId="{{item.prodId}}" bind:tap="toProdPage" />
           <view class="info">
           <view class="info">

+ 18 - 5
pages/order-detail/order-detail.js

@@ -45,7 +45,8 @@ Page({
     estimatedTime: '',
     estimatedTime: '',
     estimatedTimeStr: '',
     estimatedTimeStr: '',
     sendInfo:null,//骑手信息
     sendInfo:null,//骑手信息
-    markers:[]
+    markers:[],
+    timer:null,//定时器
   },
   },
 
 
   /**
   /**
@@ -113,18 +114,30 @@ Page({
         
         
         wx.hideLoading();
         wx.hideLoading();
         if(res.status==40){//配送中再获取骑手位置
         if(res.status==40){//配送中再获取骑手位置
-          ths.getSenderPosition()
+          ths.startGetposition()
         }
         }
       }
       }
     };
     };
     http.request(params);
     http.request(params);
 
 
   },
   },
+  /**
+   * 
+   * 开始定时查询骑手位置
+   */
+  startGetposition(){
+   let timer =  setInterval(() => {//1分钟查询一次
+      this.getSenderPosition()
+    }, 60000);
+    this.setData({
+      timer
+    })
+  },
   /**
   /**
    * 获取骑手位置
    * 获取骑手位置
    */
    */
   getSenderPosition: function (e) {
   getSenderPosition: function (e) {
-    wx.showLoading();
+    // wx.showLoading();
     var ths = this;
     var ths = this;
     var params = {
     var params = {
       url: "/p/location/info",
       url: "/p/location/info",
@@ -133,7 +146,7 @@ Page({
         orderNumber:this.data.orderNumber //'1978351838923198464'
         orderNumber:this.data.orderNumber //'1978351838923198464'
       },
       },
       callBack: res => {
       callBack: res => {
-        wx.hideLoading();
+        // wx.hideLoading();
         console.log(res);
         console.log(res);
         if(res.code == 200&&res.data){
         if(res.code == 200&&res.data){
           let markers = [
           let markers = [
@@ -360,7 +373,7 @@ Page({
    * 生命周期函数--监听页面卸载
    * 生命周期函数--监听页面卸载
    */
    */
   onUnload() {
   onUnload() {
-
+    clearInterval(this.data.timer)
   },
   },
 
 
   /**
   /**

+ 16 - 16
pages/prod/prod.js

@@ -857,14 +857,14 @@ Page({
    */
    */
   addToCart: function (event) {
   addToCart: function (event) {
     if(this.data.totalStocks == 0) return
     if(this.data.totalStocks == 0) return
-    // let skuList = this.data.skuList[0]
-    // if (skuList.weight > 20000) {
-    //   wx.showToast({
-    //     title: "商品超过20kg,太重咯~",
-    //     icon: "none"
-    //   })
-    //   return;
-    // }
+    let skuList = this.data.skuList[0]
+    if (skuList.weight > 20000) {
+      wx.showToast({
+        title: "商品超过20kg,太重咯~",
+        icon: "none"
+      })
+      return;
+    }
     if(this.data.totalStocks<0){
     if(this.data.totalStocks<0){
       wx.showToast({
       wx.showToast({
         title: "该商品暂无库存~",
         title: "该商品暂无库存~",
@@ -925,14 +925,14 @@ Page({
    */
    */
   buyNow: function () {
   buyNow: function () {
     if(this.data.totalStocks == 0) return
     if(this.data.totalStocks == 0) return
-    // let skuList = this.data.skuList[0]
-    // if (skuList.weight > 20000) {
-    //   wx.showToast({
-    //     title: "商品超过20kg,太重咯~",
-    //     icon: "none"
-    //   })
-    //   return;
-    // }
+    let skuList = this.data.skuList[0]
+    if (skuList.weight > 20000) {
+      wx.showToast({
+        title: "商品超过20kg,太重咯~",
+        icon: "none"
+      })
+      return;
+    }
     if(this.data.totalStocks<0){
     if(this.data.totalStocks<0){
       wx.showToast({
       wx.showToast({
         title: "该商品暂无库存~",
         title: "该商品暂无库存~",