Browse Source

修改BUG

kaileyhao 2 years ago
parent
commit
122345d424

+ 3 - 1
app.json

@@ -1,6 +1,7 @@
 {
   "pages": [
     "pages/mapIndex/mapIndex",
+    "pages/editBlood/index",
     "pages/recoderList/index",
     "pages/coupon/index",
     "pages/person/index",
@@ -27,5 +28,6 @@
     "navigationBarBackgroundColor": "#fff",
     "navigationBarTitleText": "糖化缘分漂流",
     "navigationBarTextStyle": "black"
-  }
+  },
+  "sitemapLocation": "sitemap.json"
 }

+ 1 - 1
pages/bind/bind.wxml

@@ -35,7 +35,7 @@
   <view class='img' style='margin-top:-10rpx;'>
     <image style='width:400rpx;height:400rpx;' bindtap="previewImage" src='{{imageSrc}}'></image>
   </view>
-  <view class='title' style='line-height:40rpx;font-size:24rpx;'>点击长按二维码,保存相册,微信扫一扫识别,下载糖糖圈,绑定糖化漂流小程序,即可参与抽奖</view>
+  <view class='title' style='line-height:40rpx;font-size:24rpx;'>点击长按二维码,保存相册,微信扫一扫识别,下载糖糖圈,绑定糖化漂流小程序</view>
 </view>
 
 

+ 147 - 0
pages/editBlood/index.js

@@ -0,0 +1,147 @@
+// pages/register/index.js
+import { $wuxToptips } from '../../dist/index'
+var app = getApp();
+
+Page({
+  /**
+   * 页面的初始数据
+   */
+  data: {
+    userToken: "",
+    localDomin: app.globalData.localDomin, 
+    value:"",
+    reservation_no:""
+  },
+
+  bindTel: function (e) {
+    var that = this;
+    that.setData({
+      value: e.detail.value,
+    })
+
+  },
+
+
+  //提交糖化修改
+  submitBind:function(){
+    var that=this
+    if (that.data.value==""){
+      $wuxToptips().show({
+        icon: 'cancel',
+        hidden: false,
+        text: "请输入您的糖化值",
+        duration: 1500,
+        success() { },
+      })
+      return false;
+    }
+
+    wx.request({
+      method: "post",
+      url: app.globalData.localHref + '/ThApi/Service/modifyThValue.html',
+      data: {
+        token: that.data.userToken,
+        reservation_no: that.data.reservation_no,
+        new_value: that.data.value
+      },
+      header: {
+        "Content-Type": "application/x-www-form-urlencoded"
+      },
+      success: function (res) {
+        console.log(res)
+        if (res.data.retCode == 1) {
+          wx.showModal({
+            content: "修改成功,点击确定返回",
+            showCancel: false,
+            success: function (res) {
+              wx.navigateBack({})
+            }
+          });
+         
+
+        } else {
+          wx.showModal({
+            content: res.data.msg,
+            showCancel: false,
+            success: function (res) {
+
+            }
+          });
+        }
+      },
+      fail: function (err) {
+        console.log(err)
+      }
+    });
+
+  },
+
+
+  /**
+   * 生命周期函数--监听页面加载
+   */
+  onLoad: function (options) {
+    console.log(options)
+    var that=this;
+    that.setData({
+      userToken: wx.getStorageSync('userToken'),      //获取token缓存
+      value: options.new_value,
+      reservation_no: options.reservation_no
+    })
+    
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+    return {
+      title: app.globalData.title,
+      desc: app.globalData.desc,
+      path: app.globalData.path,
+      imageUrl: app.globalData.imageUrl,
+    }
+  }
+})

+ 7 - 0
pages/editBlood/index.json

@@ -0,0 +1,7 @@
+{
+  "navigationBarTitleText": "糖化修改",
+  "usingComponents": {
+    "wux-button": "../../dist/button/index",
+    "wux-toptips": "../../dist/toptips/index"
+  }
+}

+ 20 - 0
pages/editBlood/index.wxml

@@ -0,0 +1,20 @@
+<!--pages/register/index.wxml-->
+<view style='width:750rpx;height:15rpx;backGround-color:#eee'></view>
+
+<view class='title'>糖化仅一次修改机会,请确认正确</view>
+<view class='tel'>
+  <view class='telImg left' style='background: transparent url("{{localDomin}}/wechatProgram/images/editIcon.png") no-repeat center;background-size: 70%'></view>
+  <view class='left'>
+    <input class='userTel' placeholder='输入糖化值' type='digit' bindinput="bindTel" value='{{value}}'></input>
+  </view>
+</view>
+
+
+
+
+<!-- <view class='register' bindtap='register'>没有账号,去注册?</view> -->
+
+<view class='submit' bindtap='submitBind'>提交</view>
+
+
+<wux-toptips id="wux-toptips" />

+ 18 - 0
pages/editBlood/index.wxss

@@ -0,0 +1,18 @@
+/* pages/register/index.wxss */
+page{background-color: #fff}
+.right{float: right}
+.title{margin: auto; width: 570rpx;height: 120rpx;line-height: 120rpx; text-align: center; font-size:30rpx;color:#959595}
+.tel{margin: auto; width: 570rpx;height: 70rpx;border:1rpx solid #c0c0c0;border-radius: 10rpx;}
+.telImg{width: 70rpx;height: 70rpx;}
+.userTel{width: 500rpx;height: 70rpx;font-size: 30rpx; color: #333;}
+
+.yzm{margin: auto; margin-top: 35rpx; width: 570rpx;}
+.userYzm{width: 375rpx;height: 70rpx;border:1rpx solid #c0c0c0;border-radius: 10rpx;}
+.inputYzm{margin-left: 25rpx; width: 350rpx;height: 70rpx;font-size: 30rpx; color: #333;}
+.getYzm,.getTimer{width: 160rpx;height: 68rpx;font-size: 26rpx; color: #04a6fa; text-align: center;line-height: 68rpx; border:1rpx solid #04a6fa;border-radius: 10rpx;}
+
+.submit{margin: auto; margin-top: 50rpx; width: 570rpx;height: 90rpx; line-height: 90rpx; color: #fff; letter-spacing: 5rpx; font-size: 32rpx; text-align: center;background-color: #04a6fa; border-radius: 10rpx; }
+
+.register{margin: auto; margin-top: 20rpx; width: 570rpx;text-align: right; font-size: 28rpx; color:#c0c0c0 }
+
+.img{width: 750rpx;text-align: center}

+ 18 - 3
pages/mapIndex/mapIndex.js

@@ -1,4 +1,7 @@
 // pages/mapIndex/mapIndex.js
+import { $wuxSelect } from '../../dist/index'
+import { $wuxDialog } from '../../dist/index'
+import { $wuxToptips } from '../../dist/index'
 var app = getApp();
 var QQMapWX = require('../../utils/qqmap-wx-jssdk.js');
 var qqmapsdk;
@@ -393,13 +396,25 @@ Page({
         url: '../send/send?reservation_no=' + e.currentTarget.dataset.id + ' & device_send_status=' + this.data.appointmentInfo[0].device_send_status,
         
       })
-    } else if (this.data.appointmentInfo[0].device_send_status > 4){
+    } else{
       wx.navigateTo({
         url: '../express/index?reservation_no=' + e.currentTarget.dataset.id
       })
     }
     
   },
+
+  //修改糖化
+  editBlood:function(e){
+    console.log(e)
+    var hba1c=e.currentTarget.dataset.hba1c;
+    var reservation_no = e.currentTarget.dataset.reservation_no;
+    console.log(hba1c, reservation_no)
+    wx.navigateTo({
+      url: '../editBlood/index?reservation_no=' + reservation_no + '&new_value=' + hba1c,
+    })
+  },
+
   //操作指南
   lookStudy:function(){
     
@@ -549,11 +564,11 @@ Page({
         if (res.data.retCode==1){
           app.globalData.ttqBind = res.data.data.ttq_account;  //赋值全局绑定信息
 
-          if (res.data.data.reservation[0].next_reservation.avatar_url==undefined){
+          if (res.data.data.reservation.length && res.data.data.reservation[0].next_reservation.avatar_url==undefined){
             that.setData({
               havePeople: false
             })
-            console.log(res.data.data.reservation[0], 'reservation[0]')
+            
           }
 
           if (res.data.data.ttq_account==""){

+ 9 - 2
pages/mapIndex/mapIndex.json

@@ -1,4 +1,11 @@
 {
-  "usingComponents": {}
-  
+  "navigationBarTitleText": "糖化缘分漂流",
+  "usingComponents": {
+    "wux-cell-group": "../../dist/cell-group/index",
+    "wux-cell": "../../dist/cell/index",
+    "wux-select": "../../dist/select/index",
+    "wux-button": "../../dist/button/index",
+    "wux-dialog": "../../dist/dialog/index",
+    "wux-toptips": "../../dist/toptips/index"
+  }
 }

+ 11 - 9
pages/mapIndex/mapIndex.wxml

@@ -150,23 +150,23 @@
   <cover-view wx:if="{{appointmentSlingShow}}" class='glucoseContant' style='height:300rpx;'>
     <!-- 设备展示 -->
     <cover-view class='' wx:for="{{appointmentInfo}}" wx:key="item" wx:for-index="index">
-      <cover-view class='equimentList' style='padding:0rpx; height:270rpx;'>
+      <cover-view class='equimentList' style='padding:0rpx; height:280rpx;'>
 
-        <cover-image class='equimentListTopRight' style='z-index:99; left:530rpx; top:40rpx; width:116rpx;height:86rpx' src='{{localDomin}}/wechatProgram/images/checkPosition.png?1' bindtap='clickPosition' data-lat="{{item.addr_lat}}" data-lng="{{item.addr_lng}}"></cover-image>
+        <cover-image class='equimentListTopRight' style='z-index:99; left:430rpx; top:40rpx; width:116rpx;height:86rpx' src='{{localDomin}}/wechatProgram/images/checkPosition.png?1' catchtap='clickPosition' data-lat="{{item.addr_lat}}" data-lng="{{item.addr_lng}}"></cover-image>
         <cover-view class='equimentListIcon' style='left:660rpx; top:130rpx;' bindtap='orderDesc' data-orderId="{{item.reservation_no}}">
           <cover-image style='width:15rpx;height:30rpx' src='{{localDomin}}/wechatProgram/images/arrowRight.png'> </cover-image>
         </cover-view>
 
         <cover-view class='clickBtn'>
-          <cover-view wx:if="{{item.disabled_cancel==0}}" class='appointmentBtn' bindtap='appointmentBtn' data-id="{{item.reservation_no}}">取消预订</cover-view>
-          <cover-view wx:elif="{{item.device_send_status==2&&item.test_strip_send_status==2}}" class='appointmentBtn' bindtap='lookStudy' data-id="{{item.reservation_no}}">操作指南</cover-view>
-          <cover-view wx:elif="{{item.device_send_status==3}}" style='font-size:24rpx;' class='appointmentBtn'  bindtap='sendDeliver' data-id="{{item.reservation_no}}" data-device_send_status="{{item.device_send_status}}">寄设备给下家</cover-view>
-          <cover-view wx:else style='font-size:24rpx;' class='appointmentBtn'  bindtap='lookDeliver' data-id="{{item.reservation_no}}">查看快递信息</cover-view>
+          <cover-view wx:if="{{item.disabled_cancel==0}}" class='appointmentBtn' catchtap='appointmentBtn' data-id="{{item.reservation_no}}">取消预订</cover-view>
+          <cover-view wx:elif="{{item.device_send_status==2&&item.test_strip_send_status==2}}" class='appointmentBtn' catchtap='lookStudy' data-id="{{item.reservation_no}}">操作指南</cover-view>
+          <cover-view wx:elif="{{item.device_send_status==3}}" style='font-size:20rpx;' class='appointmentBtn'  catchtap='sendDeliver' data-id="{{item.reservation_no}}" data-device_send_status="{{item.device_send_status}}">寄设备给下家</cover-view>
+          <cover-view wx:else style='font-size:20rpx;' class='appointmentBtn'  catchtap='lookDeliver' data-id="{{item.reservation_no}}">查看物流信息</cover-view>
         
         </cover-view>
 
 
-        <cover-view class='equimentListLeft left' bindtap='orderDesc' data-orderId="{{item.reservation_no}}">
+        <cover-view class='equimentListLeft left' catchtap='orderDesc' data-orderId="{{item.reservation_no}}">
           <cover-view style="margin-top:15rpx;">
             <cover-view style='width:140rpx;' class='equimentListTitle left'>漂流编号:</cover-view>
             <cover-view style='width:350rpx;' class='equimentListTxt left'>{{item.reservation_no}}</cover-view>
@@ -181,11 +181,11 @@
           </cover-view>
           <cover-view>
             <cover-view style='width:140rpx;' class='equimentListTitle left'>漂流状态:</cover-view>
-            <cover-view style='margin-top:20rpx; width:350rpx;line-height:30rpx;' class='equimentListTxt left'>{{item.reservation_tips}}</cover-view>
+            <cover-view style='margin-top:17rpx; width:350rpx;line-height:30rpx;' class='equimentListTxt left'>{{item.reservation_tips}} <cover-view wx:if="{{item.hba1c>0&&item.hba1c_update_times<1}}" data-reservation_no="{{item.reservation_no}}" data-hba1c="{{item.hba1c}}" class="left" style="width:140rpx; color:#04a6fa" catchtap='editBlood'>修改糖化</cover-view></cover-view>
           </cover-view>
         </cover-view>
 
-        <cover-view class='equimentListRight right' bindtap='orderDesc' data-orderId="{{item.reservation_no}}">
+        <cover-view class='equimentListRight right' catchtap='orderDesc' data-orderId="{{item.reservation_no}}">
           
           
         </cover-view>
@@ -353,5 +353,7 @@
 
 </view>
 
+<wux-dialog id="wux-dialog" />
+<wux-dialog id="wux-dialog--alert" />
 
 

+ 2 - 2
pages/mapIndex/mapIndex.wxss

@@ -14,7 +14,7 @@
 .bottleIco{position: absolute; top: 180rpx; left: 0rpx; width: 750rpx;height: 120rpx;}
 .bottleIco cover-image{width: 80rpx;height: 80rpx;}
 .bottleIco cover-view{text-align: center}
-.bottleTxt{width: 80rpx; line-height: 40rpx;font-size: 20rpx;}
+.bottleTxt{margin-left: -10rpx; width: 100rpx; line-height: 40rpx;font-size: 20rpx;}
 
 .positionUser{position: absolute;left: 50%;bottom:50%;margin-left: -30rpx;margin-top: -30rpx; width: 60rpx;height: 60rpx;}
 
@@ -68,7 +68,7 @@
 
 .equimentListIcon{position: absolute;z-index: 99;left: 620rpx;top:90rpx; width: 30rpx;height: 30rpx;}
 
-.split{clear:both;width:500rpx;height:1rpx;background-color:#eee}
+.split{ clear:both;width:500rpx;height:1rpx;background-color:#eee}
 .equimentTime{margin: auto; width: 630rpx;line-height: 80rpx;font-size:26rpx;color:#333333 }
 
 .equimentListLeft{margin-left: 15rpx; width:490rpx;height: 270rpx;}

+ 39 - 0
pages/orderInfo/index.js

@@ -143,7 +143,22 @@ Page({
     })
   },
 
+  scrollKey:function(){
+    var query = wx.createSelectorQuery();
+    query.select('#contant').boundingClientRect()
+    query.exec(function (res) {
+      //console.log(res);
+      console.log(res[0].height);
+      wx.pageScrollTo({
+        scrollTop: res[0].height,
+        duration: 0,
+      })
+    })
+  },
+
   messageWish:function(e){  //祝福语
+    //获取容器高度滚动事件
+    
     this.setData({
       wishs: e.detail.value
     })
@@ -292,6 +307,16 @@ Page({
                   })
 
                 }
+              }else{
+                wx.showModal({
+                  content: res.data.msg,
+                  showCancel: false,
+                  success: function (res) {
+                    if (res.confirm) {
+                     
+                    }
+                  }
+                });
               }
             },
             fail: function (err) {
@@ -417,6 +442,13 @@ Page({
     var that=this;
     //判断是否有普通可以使用
     if (that.data.couponArray.length < 1) {
+      $wuxToptips().show({
+        icon: 'cancel',
+        hidden: false,
+        text: "当前没有可使用的优惠券~",
+        duration: 1500,
+        success() { },
+      });
       return false;
     }
     that.setData({
@@ -494,6 +526,13 @@ Page({
     var that = this;
     //判断是否有免押券可以使用
     if (that.data.pressureCouponArray.length < 1) {
+      $wuxToptips().show({
+        icon: 'cancel',
+        hidden: false,
+        text: "当前没有可使用的免押券~",
+        duration: 1500,
+        success() { },
+      });
       return false;
     }
     that.setData({

+ 5 - 3
pages/orderInfo/index.wxml

@@ -1,4 +1,6 @@
 <!--pages/orderInfo/index.wxml-->
+<view id='contant'>
+
 <view style='width:750rpx;height:10rpx;'></view>
 <view class='contantInfo'>
   <view class='contantInfoLeft left'>
@@ -62,7 +64,7 @@
       <view style='font-size:28rpx; font-weight:bold'>漂流寄语</view>
       <view>下家糖友将看到您的祝福</view>
     </view>
-    <textarea wx:if="{{texearShow}}" placeholder='请输入您的寄语(10个字以上)' value='{{wishs}}' bindinput="messageWish">
+    <textarea wx:if="{{texearShow}}" style='color:#757575' placeholder='请输入您的寄语(10个字以上)' value='{{wishs}}' bindfocus="scrollKey" bindinput="messageWish">
     
     </textarea>
   </view>
@@ -123,7 +125,7 @@
 
 
   <view class='submit' bindtap='submit'>
-    确预定
+    确预定
   </view>
 
 
@@ -167,7 +169,7 @@
 <view wx:if="{{tableIndex==3}}">
   <video src='{{src}}' initial-time="0" controls="true"  style='margin-top:15rpx; width:750rpx;'></video>
 </view>
-
+</view>
 <wux-toptips id="wux-toptips" />
 <wux-select id="wux-select2"/>
 <wux-select id="wux-select3"/>

+ 2 - 72
pages/recoderList/index.js

@@ -27,79 +27,9 @@ Page({
     var that=this;
     var orderNo = e.currentTarget.dataset.order;
     var orderValue = e.currentTarget.dataset.value;
-
-    $wuxDialog().prompt({
-      resetOnClose: true,
-      title: '请修改糖化值',
-      content: '',
-      fieldtype: 'text',
-      password: '',
-      defaultText: orderValue,
-      placeholder: '',
-      maxlength: 100,
-      onConfirm(e, response) {
-        //const content = response.length > 8 ? `输入成功: ${response}` : `请输入正确的快递单号`
-        console.log(response)
-        if (response==""){
-          $wuxToptips().show({
-            icon: 'cancel',
-            hidden: false,
-            text: "修改值不能为空",
-            duration: 1500,
-            success() { },
-          })
-          return false;
-        }
-
-        wx.request({
-          method: "post",
-          url: app.globalData.localHref + '/ThApi/Service/modifyThValue.html',
-          data: {
-            token: that.data.userToken,
-            reservation_no: orderNo,
-            new_value: response
-          },
-          header: {
-            "Content-Type": "application/x-www-form-urlencoded"
-          },
-          success: function (res) {
-            console.log(res)
-            if (res.data.retCode == 1) {
-              for (var i = 0; i < that.data.recordArray.length ; i++){
-                if (that.data.recordArray[i]["reservation_no"] == orderNo){
-                  console.log(that.data.recordArray[i].hba1c, that.data.recordArray[i].hba1c_update_times)
-                  that.setData({
-                    [`recordArray[${i}].hba1c`]: response ,
-                    [`recordArray[${i}].hba1c_update_times`]: parseInt(that.data.recordArray[i]["hba1c_update_times"])+1 ,
-                  })                  
-                }
-              }
-              console.log(that.data.recordArray)
-              $wuxToptips().success({
-                hidden: false,
-                text: '恭喜你,修改成功',
-                duration: 1500,
-                success() { },
-              })
-            } else {
-              wx.showModal({
-                content: res.data.msg,
-                showCancel: false,
-                success: function (res) {
-
-                }
-              });
-            }
-          },
-          fail: function (err) {
-            console.log(err)
-          }
-        });
-
-      },
+    wx.navigateTo({
+      url: '../editBlood/index?reservation_no=' + orderNo + '&new_value=' + orderValue,
     })
-
-
   },
   orderClick:function(e){
     console.log(e)

+ 7 - 0
sitemap.json

@@ -0,0 +1,7 @@
+{
+  "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
+  "rules": [{
+  "action": "allow",
+  "page": "*"
+  }]
+}