zhashaonan 6 năm trước cách đây
mục cha
commit
fb1dcad561
41 tập tin đã thay đổi với 590 bổ sung549 xóa
  1. BIN
      image/bonusTips/bonus_bg.png
  2. BIN
      image/bonusTips/bonus_dialog_bg.png
  3. BIN
      image/bonusTips/close.png
  4. BIN
      image/bonusTips/enter_bg.png
  5. BIN
      image/empty_cart.png
  6. BIN
      image/empty_order.png
  7. BIN
      image/finger.png
  8. BIN
      image/tabbar/index.png
  9. BIN
      image/tabbar/person.png
  10. BIN
      image/tabbar/selected_index.png
  11. BIN
      image/tabbar/selected_person.png
  12. BIN
      image/tabbar/selected_shopcart.png
  13. BIN
      image/tabbar/shopcart.png
  14. 1 1
      pages/components/auth/auth.wxss
  15. 56 35
      pages/components/blockItem/blockItem.js
  16. 48 0
      pages/components/bonusTips/bonusTips.js
  17. 4 0
      pages/components/bonusTips/bonusTips.json
  18. 20 0
      pages/components/bonusTips/bonusTips.wxml
  19. 117 0
      pages/components/bonusTips/bonusTips.wxss
  20. 1 1
      pages/components/template/loadAnimation/loadAnimation.wxss
  21. 25 18
      pages/handOutBonus/handOutBonus.js
  22. 8 16
      pages/handOutBonus/handOutBonus.wxml
  23. 19 1
      pages/handOutBonus/handOutBonus.wxss
  24. 0 332
      pages/handOutBonus/handOutBonus2.js
  25. 38 6
      pages/index/index.js
  26. 2 1
      pages/index/index.json
  27. 3 1
      pages/index/index.wxml
  28. 8 1
      pages/index/index.wxss
  29. 3 1
      pages/order_tabs/orderTabs.wxml
  30. 16 0
      pages/order_tabs/orderTabs.wxss
  31. 28 12
      pages/person/person.js
  32. 2 1
      pages/person/person.json
  33. 1 0
      pages/person/person.wxml
  34. 0 1
      pages/shareBonus/shareBonus.js
  35. 25 6
      pages/shopCart/shopCart.js
  36. 2 1
      pages/shopCart/shopCart.json
  37. 105 99
      pages/shopCart/shopCart.wxml
  38. 17 14
      pages/shopCart/shopCart.wxss
  39. 0 1
      pages/special/special.js
  40. 26 0
      utils/bonusUp.js
  41. 15 0
      utils/util.js

BIN
image/bonusTips/bonus_bg.png


BIN
image/bonusTips/bonus_dialog_bg.png


BIN
image/bonusTips/close.png


BIN
image/bonusTips/enter_bg.png


BIN
image/empty_cart.png


BIN
image/empty_order.png


BIN
image/finger.png


BIN
image/tabbar/index.png


BIN
image/tabbar/person.png


BIN
image/tabbar/selected_index.png


BIN
image/tabbar/selected_person.png


BIN
image/tabbar/selected_shopcart.png


BIN
image/tabbar/shopcart.png


+ 1 - 1
pages/components/auth/auth.wxss

@@ -5,7 +5,7 @@
   right: 0;
   top: 0;
   bottom: 0;
-  z-index: 9999;
+  z-index: 999;
   padding-top: 100rpx;
   box-sizing: border-box;
   background: #fff;

+ 56 - 35
pages/components/blockItem/blockItem.js

@@ -1,53 +1,49 @@
 // pages/components/blockItem/blockItem.js
+const getTypeSn = require('./../../../utils/util.js').getTypeSn;
 Component({
   /**
    * 组件的属性列表
    */
   properties: {
     item_data: {
-      type:Object
+      type: Object
     },
-    summery:{
-      type:Array
+    summery: {
+      type: Array
     },
-    special_datas:{
-      type:Object,
-      value:{}
+    special_datas: {
+      type: Object,
+      value: {}
     },
-    block_type:{
-      type:String,
-      value:""
-    } 
+    block_type: {
+      type: String,
+      value: ""
+    }
   },
 
   ready() {
-
-    if (!this.properties.special_datas || !(this.properties.special_datas).hasOwnProperty('fcodes')){
+    if (!this.properties.special_datas || !(this.properties.special_datas).hasOwnProperty('fcodes')) {
       return;
     }
-
-
-
-
     const fcodes = this.properties.special_datas.fcodes;
     const goods_id = this.properties.item_data.data;
     const summery = this.properties.summery;
     let fcode = {};
     for (let item of summery) {
-      if (item.goods_id == goods_id){
+      if (item.goods_id == goods_id) {
         this.setData({
-          goods:item
+          goods: item
         })
         break;
       }
     }
-    for (let item of fcodes){
+    for (let item of fcodes) {
       if (item.goods_id == goods_id) {
-        fcode = item; 
+        fcode = item;
         break;
       }
     }
-    fcode.usable_time = (function(time){
+    fcode.usable_time = (function (time) {
       let date = new Date(time * 1000);
       let year = date.getFullYear();
       let month = date.getMonth() + 1;
@@ -55,7 +51,7 @@ Component({
       return `${year}.${month}.${day}`;
     })(fcode.usable_time);
 
-    fcode.state = (function(state){
+    fcode.state = (function (state) {
       let bgColor = '';
       let title = '';
       switch (state) {
@@ -82,7 +78,7 @@ Component({
       }
     })(fcode.state);
     this.setData({
-      fcode:fcode
+      fcode: fcode
     })
   },
 
@@ -90,7 +86,7 @@ Component({
    * 组件的初始数据
    */
   data: {
-    imgShow:false,
+    imgShow: false,
     goods: {},
     fcode: {}
   },
@@ -99,32 +95,57 @@ Component({
    * 组件的方法列表
    */
   methods: {
-    navigator(e){
+    navigator(e) {
       const type = e.target.dataset.type || e.currentTarget.dataset.type;
       const target_data = e.target.dataset.target || e.currentTarget.dataset.target;
       const title = e.target.dataset.title || e.currentTarget.dataset.title;
-      if(!type)return;
-      switch(type){
-        case "url":{
+      if (!type) return;
+      switch (type) {
+        case "url": {
           let attr = encodeURIComponent(`${target_data}`);
+          // let type_sn = ''
+          // if (target_data.indexOf('type_sn') != -1) {
+          //   let arr = target_data.split('&')
+
+          //   arr.some(item => {
+          //     if (item.indexOf('type_sn') != -1) {
+          //       type_sn = item.split('=')[1]
+          //       return true
+          //     }
+          //   })
+          //   if (type_sn) {
+          //     wx.navigateTo({
+          //       url: `/pages/shareBonus/shareBonus?type_sn=${type_sn}`
+          //     })
+          //     break;
+          //   }
+          // }
+
+          let type_sn = getTypeSn(target_data)
+          if (type_sn) {
+            wx.navigateTo({
+              url: `/pages/shareBonus/shareBonus?type_sn=${type_sn}`
+            })
+            break;
+          }
           wx.navigateTo({
-            url: '/pages/webView/webView?url='+attr
+            url: '/pages/webView/webView?url=' + attr
           })
           break;
         }
-        case "special":{
+        case "special": {
           wx.navigateTo({
             url: `/pages/special/special?special_id=${target_data}&title=${title}`
           })
           break;
         }
-        case "goods":{
+        case "goods": {
           wx.navigateTo({
             url: `/pages/details/details?goods_id=${target_data}&title=商品详情`
           })
           break;
         }
-        case "brand":{
+        case "brand": {
           wx.navigateTo({
             url: `/pages/brand/brand?brand_id=${target_data}&title=${title}`
           })
@@ -137,13 +158,13 @@ Component({
           break;
         }
         default: {
-          console.log(type+'类型找不到');
+          console.log(type + '类型找不到');
         }
       }
     },
-    load(e){
+    load(e) {
       this.setData({
-        imgShow:true
+        imgShow: true
       });
     }
   }

+ 48 - 0
pages/components/bonusTips/bonusTips.js

@@ -0,0 +1,48 @@
+// pages/components/bonusTips/bonusTips.js
+Component({
+  /**
+   * 组件的属性列表
+   */
+  properties: {
+    tipsDatas: {
+      type:Object
+    }
+  },
+
+  /**
+   * 组件的初始数据
+   */
+  data: {
+
+  },
+
+  /**
+   * 组件的方法列表
+   */
+  methods: {
+    myCatchTouch() {
+      return 
+    },
+    seeBonus() {
+      this.close()
+      let { btn_type } = this.properties.tipsDatas
+      if (btn_type == 'detail') {
+        let { type_sn } = this.properties.tipsDatas
+        wx.navigateTo({
+          url: `/pages/shareBonus/shareBonus?type_sn=${type_sn}`
+        })
+      }
+      else if (btn_type == 'send') {
+        wx.navigateTo({
+          url: `/pages/handOutBonus/handOutBonus`
+        })
+      }
+
+      
+      
+    },
+    close() {
+      this.triggerEvent('closeTips')
+    }
+  }
+})

+ 4 - 0
pages/components/bonusTips/bonusTips.json

@@ -0,0 +1,4 @@
+{
+  "component": true,
+  "usingComponents": {}
+}

+ 20 - 0
pages/components/bonusTips/bonusTips.wxml

@@ -0,0 +1,20 @@
+<!--pages/components/bonusTips/bonusTips.wxml-->
+<view>
+  <view class="bg_container" catchtouchmove="myCatchTouch">
+    <view class="bg"></view>
+    <view class="content animation">
+      <image class="close_tips" catchtap="close" src="../../../image/bonusTips/close.png"></image>
+      <image class="common_bg" src="../../../image/bonusTips/bonus_dialog_bg.png"></image>
+      <view class="bonus_dialog_title common_position one_line_hidden">{{tipsDatas['title']}}</view>
+      <view class="bonus_dialog_subtitle common_position one_line_hidden">{{tipsDatas['sub_title']}}</view>
+      <view class="bonus_bg common_position">
+          <image class="common_bg" src="../../../image/bonusTips/bonus_bg.png"></image>
+          <view class="bonus_total common_position">{{tipsDatas['total_amount']}}<text class="f30 ml5">元</text></view>
+      </view>
+      <view class="enter_bg common_position">
+          <image class="common_bg" src="../../../image/bonusTips/enter_bg.png"></image>
+          <view class="see_bonus common_position" catchtap="seeBonus">{{tipsDatas['btn_title']}}</view>
+      </view>
+    </view>
+  </view>
+</view>

+ 117 - 0
pages/components/bonusTips/bonusTips.wxss

@@ -0,0 +1,117 @@
+/* pages/components/bonusTips/bonusTips.wxss */
+.bg_container {
+  position: fixed;
+  left: 0;
+  right: 0;
+  top: 0;
+  bottom: 0;
+  max-width: 750rpx;
+  margin: auto;
+  z-index: 1000;
+}
+.bg {
+  position: relative;
+  z-index: 1;
+  width: 100%;
+  height: 100%;
+  background: rgba(0, 0, 0, .6);
+}
+.content {
+  position: absolute;
+  z-index: 2;
+  left: 50%;
+  top: 50%;
+  margin-left: -245rpx;
+  margin-top: -315rpx;
+  width: 490rpx;
+  height: 630rpx;
+  padding-top:228rpx;
+  box-sizing: border-box;
+  opacity: 0;
+  transform: translate3d(0, -1000rpx, 0);
+}
+.content.animation {
+  animation: bonus_move .7s ease-in-out .5s forwards;
+  
+}
+.common_bg {
+  position: absolute;
+  z-index: 2;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+}
+.common_position {
+  position: relative;
+  z-index: 3;
+}
+.bonus_dialog_title {
+  font-weight: bold;
+  font-size: 36rpx;
+  color: #FFDB6B;
+  text-align: center;
+  line-height: 50rpx;
+}
+.bonus_dialog_subtitle {
+  margin-top: 5rpx;
+  line-height: 42rpx;
+  font-size: 30rpx;
+  color: #FFDB6B;
+  text-align: center;
+}
+.bonus_bg {
+  width: 352rpx;
+  height: 132rpx;
+  margin: 35rpx auto 20rpx;
+}
+.see_bonus, .bonus_total {
+  display: flex;
+  align-items: center;
+  justify-content: center;
+  width: 100%;
+  height: 100%;
+  color: #E73636;
+  font-weight: bold;
+}
+.bonus_total {
+  font-size: 60rpx;
+}
+.see_bonus {
+  font-size: 30rpx;
+}
+.enter_bg {
+  width: 340rpx;
+  height: 76rpx;
+  margin: auto;
+}
+.f30 {
+  font-size: 30rpx;
+}
+.ml5 {
+  margin-left: 5rpx;
+}
+.close_tips {
+  position: absolute;
+  right: -26rpx;
+  top: -32rpx;
+  z-index: 5;
+  width: 64rpx;
+  height: 64rpx;
+}
+
+@keyframes bonus_move {
+  0% {
+    opacity: 0;
+    transform: translate3d(0, -1000rpx, 0);
+  }
+  100% {
+    opacity: 1;
+    transform: translate3d(0, 0, 0);
+  }
+}
+.one_line_hidden {
+  white-space: nowrap;
+  text-overflow: ellipsis;
+  overflow: hidden;
+}

+ 1 - 1
pages/components/template/loadAnimation/loadAnimation.wxss

@@ -20,7 +20,7 @@
   right: 0;
   top: 0;
   bottom: 0;
-  z-index: 9999;
+  z-index: 998;
   background: #fff;
   
 }

+ 25 - 18
pages/handOutBonus/handOutBonus.js

@@ -10,6 +10,7 @@ Page({
   data: {
     bonusType: 'pin',
     canShare: false,
+    btnFlag: false,
     datas: {},
     total: 0,
     count: 0,
@@ -101,11 +102,14 @@ Page({
           })
           return
         }
-        let tempArr = currentValue.split('.')
-        if (tempArr[1].length > 2) {
-          tempArr[1] = tempArr[1].substring(0, tempArr[1].length - 1)
+        let secondIndex = currentValue.substring(index + 1).indexOf('.')
+        if (secondIndex != -1) {
+          currentValue = currentValue.substring(0, index + 1)
+        }
+
+        if (currentValue.length - index - 1 > 2) {
+          currentValue = currentValue.substring(0, index + 1 + 2)
         }
-        currentValue = tempArr[0] + '.' + tempArr[1] || 0
       }
       if (currentValue[0] == 0 && currentValue[1] != '.') {
         currentValue = currentValue.substring(1) || 0
@@ -129,9 +133,17 @@ Page({
     let flag = true
     if (this.data.bonusType == 'pin') {
       flag = this.checkTotal(money)
-      this.setData({
-        total: money
-      })
+      if (!count) {
+        this.setData({
+          total: 0
+        })
+      }
+      else {
+        this.setData({
+          total: money
+        })
+      }
+      
     }
     else {
       let bonus = count * money
@@ -152,9 +164,13 @@ Page({
         flag = false
       }
     }
+   
     if (!count || !money) {
       flag = false
     }
+    this.setData({
+      btnFlag: flag
+    })
     return flag
   },
   checkTotal(money) {
@@ -181,7 +197,6 @@ Page({
     if (!flag){
       return
     }
-
     this.shareBonus()
   },
   shareBonus() {
@@ -257,12 +272,6 @@ Page({
     str = str.replace(/\s+/g, "")
     return str
   },
-  testBonus() {
-    wx.navigateTo({
-      url: '/pages/shareBonus/shareBonus?type_sn=23641538992987220059'
-    });
-  },
-
   /**
    * 生命周期函数--监听页面初次渲染完成
    */
@@ -311,6 +320,7 @@ Page({
   onShareAppMessage: function (res) {
     let self = this
     if (res.from == "button") {
+      this.getDatas()
       this.setData({
         canShare: false
       })
@@ -319,10 +329,7 @@ Page({
       return {
         title,
         imageUrl: imageUrl,
-        path: `/${path}`,
-        complete: function(res) {
-          self.getDatas() 
-        }
+        path: `/${path}`
       }
     }
 

+ 8 - 16
pages/handOutBonus/handOutBonus.wxml

@@ -5,7 +5,7 @@
   <view class="balance_cell mt20">
     <view>红包个数</view>
     <view class="right_cell">
-      <input class="balance_input" bindinput="bindKeyInput" data-type="count" type="number" maxlength="3" placeholder="填写个数" value="{{tempCount}}"/>
+      <input class="balance_input" bindinput="bindKeyInput" data-type="count" type="number" maxlength="4" placeholder="填写个数" value="{{tempCount}}"/>
       <view>个</view>
     </view>
   </view>
@@ -23,9 +23,9 @@
     </view>
   </view>
 
-  <view class="bonus_cell_type" wx:if="{{bonusType == 'pin'}}" catchtap="secBonusType" data-type="fixed">每人抽到的金额随机,<text
-      class="col1e5992">改为普通红包</text></view>
-  <view class="bonus_cell_type" catchtap="secBonusType" data-type="pin" wx:else>群里每人收到固定金额,<text class="col1e5992">改为拼手气红包</text></view>
+  <view class="bonus_cell_type" wx:if="{{bonusType == 'pin'}}">每人抽到的金额随机,<text
+      class="col1e5992" catchtap="secBonusType" data-type="fixed">改为普通红包</text></view>
+  <view class="bonus_cell_type" wx:else>群里每人收到固定金额,<text class="col1e5992" catchtap="secBonusType" data-type="pin">改为拼手气红包</text></view>
 
 
   <view class="balance_cell mt20" style="min-height: 112rpx;height: auto;">
@@ -36,24 +36,16 @@
   </view>
 
   <view class="bonus_total">¥<text class="ml10">{{total}}</text></view>
-  <view class="fixed_box">
-    <view class="f24">未领取的红包,将于24小时后发起退款</view>
-    <view class="wx_share_box" catchtap="checkBonus">
-      <image src="../../image/share.png" class="validate_share"></image>
-    </view>
-  </view>
-
-  <!-- <view class="wx_share_box" catchtap="testBonus">         
-      <image class="wx_share" src="../../image/person/shareView_wx.png"></image>
-      <view class="f24">测试领取红包</view>
-    </view> -->
+  <view class="share_btn {{btnFlag ? 'can_share' : ''}}" catchtap="checkBonus">发红包</view>
+  <view class="f24 mb20 text_center">未领取的红包,将于24小时后发起退款</view>
+ 
 
   <view class="real_share_box {{canShare?'show_popup':''}}" catchtap="close"> </view>
   <view class="real_share_bg {{canShare?'show_animation':''}}">
     <view class="wx_share_box"> 
       <button open-type="share" class="wx_share_btn"></button>
       <image class="wx_share" src="../../image/person/shareView_wx.png"></image>
-      <view class="f24">微信</view>
+      <view class="f24 col666">微信</view>
     </view>
   </view>
 

+ 19 - 1
pages/handOutBonus/handOutBonus.wxss

@@ -71,7 +71,7 @@
 .wx_share_box {
   position: relative;
   width: 160rpx;
-  margin: 60rpx auto 20rpx;
+  margin: auto;
 }
 .wx_share_btn {
   position: absolute;
@@ -105,7 +105,10 @@
   z-index: 501;
   left: 0;
   bottom: 0;
+  display: flex;
+  align-items: center;
   width: 100%;
+  height: 200rpx;
   background: #fff;
   text-align: center;
   transition: all 0.3s;
@@ -115,3 +118,18 @@
   -webkit-transform: translateY(0);
   transform: translateY(0);
 }
+.share_btn {
+  margin: 50rpx auto;
+  width: 350rpx;
+  height: 78rpx;
+  line-height: 80rpx;
+  background: #DCDCDC;
+  border-radius: 6rpx;
+  font-size: 34rpx;
+  color: #fff;
+  text-align: center;
+  letter-spacing: 0.5px;
+}
+.share_btn.can_share{
+  background: #2b2b2b;
+}

+ 0 - 332
pages/handOutBonus/handOutBonus2.js

@@ -1,332 +0,0 @@
-// pages/handOutBonus/handOutBonus.js
-const getReq = require('./../../config.js').getReq;
-const app = getApp();
-import recordSource from '../../utils/recordSource';
-Page({
-
-  /**
-   * 页面的初始数据
-   */
-  data: {
-    bonusType: 'pin',
-    canShare: false,
-    datas: {},
-    total: 0,
-    count: 0,
-    money: 0,
-    tempCount: '',
-    tempMoney: '',
-    sendFlag: false,
-    calcFlag: true,
-    path: '',
-    img_url: '',    
-    title: '',
-    tempBless: '',
-    bless: '',
-    userInfo: app.globalData.userInfo
-  },
-
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onLoad: function (options) {
-    if (app.globalData.userInfo) {
-      this.getDatas()      
-      this.setData({
-        userInfo: app.globalData.userInfo
-      })
-    }
-  },
-  getAuth(e) {
-    let { userInfo } = e.detail
-    if (userInfo) {
-      this.getDatas()      
-      this.setData({
-        userInfo: app.globalData.userInfo
-      })
-    }
-  },
-
-  getDatas() {
-    let params = {
-      act: 'member_bonus',
-      op: 'predepositex'
-    }
-    getReq(params, res => {
-      if (res.code == 200) {
-        let { datas } = res
-        let tempBless = datas['send_bless']
-        this.setData({
-          datas,
-          tempBless
-        })
-      }
-    })
-  },
-  calcTotal(count, money) {
-    if (count && money && this.data.bonusType == 'pin') {
-      let single = money / count
-      if (single < 0.01) {
-        wx.showToast({
-          icon: 'none',
-          title: '单个红包金额小于0.01!',
-          duration: 2000
-        })
-        this.setData({
-          calcFlag: false
-        })
-        return false
-      }
-    }
-    if (this.data.bonusType == 'pin') {
-      let calcFlag = this.checkTotal(money)
-      this.setData({
-        total: money,
-        calcFlag
-      })
-    }
-    else {
-      let bonus = count * money
-      let total = parseInt(bonus * 100 + 0.5) / 100
-      let calcFlag = this.checkTotal(total)
-      this.setData({
-        total,
-        calcFlag
-      })
-    }
-  },
-  checkTotal(money) {
-    return money < this.data.datas['usable']
-  },
-  bindKeyInput(e) {
-    let { type } = e.currentTarget.dataset
-    let value = e.detail.value
-    let flag = this.checkInput(type, value)
-    if (!flag) {
-      return
-    }
-    this.setData({
-      sendFlag: true
-    })
-  },
-  checkInput(type, value) {
-    if (type == 'count') {
-      if (value[0] == 0) {
-        this.setData({
-          tempCount: ''
-        })
-        return false
-      }
-      else if (value > 500) {
-        let tempCount = value.substring(0, value.length - 1)
-        this.setData({
-          tempCount,
-          count: tempCount
-        })
-        wx.showToast({
-          icon: 'none',
-          title: '一次最多发送红包500个',
-          duration: 2000
-        })
-        this.calcTotal(tempCount || 0, this.data.money || 0)
-      }
-      else {
-        this.setData({
-          count: value
-        })
-        this.calcTotal(value || 0, this.data.money || 0)
-      }
-    }
-    else if (type == 'money') {
-      if (value.indexOf('.') != -1) {
-        let tempArr = value.split('.')
-        if (tempArr[1].length > 2) {
-          tempArr[1] = tempArr[1].substring(0, tempArr[1].length - 1)
-        }
-        value = tempArr[0] + '.' + tempArr[1] || 0
-        this.setData({
-          tempMoney: value,
-          money: parseFloat(value)
-        })
-        this.calcTotal(this.data.count || 0, parseFloat(value) || 0)
-      }
-      else if (value > this.data.datas['usable']) {
-        let tempMoney = value.substring(0, value.length - 1)
-        this.setData({
-          tempMoney: tempMoney,
-          money: parseFloat(tempMoney)
-        })
-        this.calcTotal(this.data.count || 0, parseFloat(tempMoney) || 0)
-        wx.showToast({
-          icon: 'none',
-          title: '不能大于可分享的最大金额!',
-          duration: 2000
-        })
-        return false
-      }
-      else {
-        this.setData({
-          money: parseFloat(value)
-        })
-        this.calcTotal(this.data.count || 0, parseFloat(value) || 0)
-      }
-    }
-    return true
-  },
-  secBonusType(e) {
-    let { type } = e.currentTarget.dataset
-    this.setData({
-      bonusType: type,
-    })
-    this.calcTotal(this.data.count || 0, this.data.money || 0)
-  },
-  checkBonus() {
-    if (!this.data.sendFlag || !this.data.calcFlag) {
-      return
-    }
-    this.shareBonus()
-  },
-  shareBonus() {
-    let params = {
-      act: 'member_bonus',
-      op: 'make',
-      bonus_rate: this.data.datas['share_bonus_rate'][0]['rate'],
-      total_num: this.data.count,
-      type_bless: this.data.bless || this.data.datas['send_bless']
-    }
-
-    if (this.data.bonusType == "pin") {
-      let data = {
-        total_amount: this.data.money,
-        send_type: 1
-      }
-      params = Object.assign({}, params, data)
-    }
-    else {
-      let data = {
-        fixed_money: this.data.money,
-        send_type: 2
-      }
-      params = Object.assign({}, params, data)
-    }
-    getReq(params, res => {
-      if (res.code == 200) {
-        let { title, path } = res.datas
-        this.setData({
-          canShare: true,
-          title,
-          path
-        })
-      }
-      else {
-        wx.showToast({
-          icon: 'none',
-          title: res.message,
-          duration: 2000
-        })
-        return false
-      }
-    })
-  },
-  close() {
-    this.setData({
-      canShare: false
-    })
-  },
-  blessFocus(e) {
-    let { value } = e.detail
-    if (value == this.data.datas['send_bless']) {
-       this.setData({
-        tempBless: ''
-       })
-    }
-  },
-  blessBlur(e) {
-    let { value } = e.detail
-    if(!this.trim(value)) {
-      this.setData({
-        tempBless: this.data.datas['send_bless']
-       })
-    }
-  },                        
-  blessInput(e) {
-    let { value } = e.detail
-    this.setData({
-      bless: value
-     })
-  },
-  trim(str) {
-    str = str.replace(/\s+/g, "")
-    return str
-  },
-  testBonus() {
-    wx.navigateTo({
-      url: '/pages/shareBonus/shareBonus?type_sn=23641538992987220059'
-    });
-  },
-
-  /**
-   * 生命周期函数--监听页面初次渲染完成
-   */
-  onReady: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面显示
-   */
-  onShow: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面隐藏
-   */
-  onHide: function () {
-
-  },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
-  /**
-   * 页面相关事件处理函数--监听用户下拉动作
-   */
-  onPullDownRefresh: function () {
-
-  },
-
-  /**
-   * 页面上拉触底事件的处理函数
-   */
-  onReachBottom: function () {
-
-  },
-
-  /**
-   * 用户点击右上角分享
-   */
-  onShareAppMessage: function (res) {
-    let self = this
-    if (res.from == "button") {
-      this.setData({
-        canShare: false
-      })
-      let imageUrl = '../../image/share_bonus.png'
-      let { title, path } = this.data
-      return {
-        title,
-        imageUrl: imageUrl,
-        path: `/${path}`,
-        complete: function(res) {
-          self.getDatas() 
-        }
-      }
-    }
-
-  }
-})

+ 38 - 6
pages/index/index.js

@@ -1,7 +1,8 @@
 let app = getApp();
 import recordSource from '../../utils/recordSource';
+import bonusUp from '../../utils/bonusUp';
 const getReq = require('./../../config.js').getReq;
-
+const getTypeSn = require('./../../utils/util.js').getTypeSn;
 Page({
   data: {
     tabs: [],
@@ -12,18 +13,43 @@ Page({
     isScroll: false,
     isSendProp: false,
     firstLoad: true,
-    fromSource: ''
+    fromSource: '',
+    tipsFlag: false,
+    tipsDatas: null,
+    daliy_bonus: ''
   },
 
   onShow: function () {
+    this.closeTips()
     if (!this.data.firstLoad) {
       app.setFromSource(this.data.fromSource)
     }
+    if (app.globalData.userInfo) {
+      setTimeout(() => {
+        bonusUp((tipsFlag, tipsDatas) => {
+          this.setData({
+            tipsFlag,
+            tipsDatas
+          })
+        })
+      }, 0);
+    }
   },
 
   onLoad: function () {
     this.req_tabs(); // old
-    // this.getDatas(1383)
+    // this.getDatas(0)
+  },
+  freeBonus() {
+    if (this.data.daliy_bonus) {
+      let type_sn = getTypeSn(this.data.daliy_bonus)
+      if (type_sn) {
+        wx.navigateTo({
+          url: `/pages/shareBonus/shareBonus?type_sn=${type_sn}`
+        })
+        return
+      }
+    }
   },
   getDatas(special_id) {
     let fromSource = recordSource(app, 'act=special&op=index&special_id=0&page=10&curpage=1&client_type=mini')
@@ -65,7 +91,8 @@ Page({
       if (res.code == 200) {
         self.getDatas(res.datas.tabs[0].special_id);
         self.setData({
-          tabs: res.datas.tabs
+          tabs: res.datas.tabs,
+          daliy_bonus: res.datas.daliy_bonus
         });
       }
     })
@@ -79,6 +106,12 @@ Page({
     });
     this.getDatas(e.detail.item.special_id)
   },
+  closeTips() {
+    this.setData({
+      tipsFlag: false,
+      tipsDatas: null
+    })
+  },
   onPageScroll(e) {
     clearTimeout(this.showTop);
     this.showTop = setTimeout(() => {
@@ -111,7 +144,7 @@ Page({
     if (this.data.isSendProp) {
       return;
     }
-   
+
     let surplus_special_num = this.data.surplus_special.length;
     if (surplus_special_num > 0) {
       wx.showLoading({
@@ -137,6 +170,5 @@ Page({
     else {
       return;
     }
-    
   }
 })

+ 2 - 1
pages/index/index.json

@@ -2,6 +2,7 @@
   "usingComponents": {
     "tabs" : "../components/blocks/tabs/tabs",
     "blockList" : "../components/blockList/blockList",
-    "searchBox": "../components/blocks/search/search"   
+    "searchBox": "../components/blocks/search/search" ,
+    "bonusTips": "../components/bonusTips/bonusTips"   
   }
 }

+ 3 - 1
pages/index/index.wxml

@@ -1,10 +1,12 @@
 <!--index.wxml-->
-<view>
+<view style="max-width: 750rpx;margin: auto;overflow-x: hidden;">
+  <bonusTips wx:if="{{tipsFlag}}" tipsDatas="{{tipsDatas}}" bind:closeTips="closeTips"></bonusTips>
   <view style="height: 140rpx;overflow: hidden;background:#2b2b2b;">
       <searchBox></searchBox>
       <tabs tabs="{{tabs}}" bind:myevent="onMyEvent"></tabs>
   </view>
   <!-- <view class='clear_fixed'></view>  -->
   <blockList prop_special="{{prop_special}}" summery="{{summery}}" special_datas="{{special_datas}}"> </blockList>
+  <image class="free_bonus" wx:if="{{daliy_bonus}}" catchtap="freeBonus" src="../../image/finger.png"></image>
   <image bindtap='backTop' style="display:{{isScroll?'block':'none'}}" mode='widthFix' class='back_top_btn' src='../../image/back_top.png'></image> 
 </view>

+ 8 - 1
pages/index/index.wxss

@@ -21,5 +21,12 @@
 }
 .clear_fixed {
   height: 140rpx;
-  /* height: 100rpx; */
+}
+.free_bonus {
+  position: fixed;
+  z-index: 99;
+  right: 0;
+  bottom: 300rpx;
+  width: 64rpx;
+  height: 64rpx;
 }

+ 3 - 1
pages/order_tabs/orderTabs.wxml

@@ -45,5 +45,7 @@
   </block>    
 </view>
 <view class='empty_order' wx:if="{{orders.length <= 0 && loading == false}}">
-  <text>您不存在{{tabs_title}}的订单</text>
+  <image class="empty_order_icon" src="../../image/empty_order.png"></image>
+  <view class="emoty_order_title">您还没有相关的订单</view>
+  <view class="emoty_order_subtitle">可以去看看有哪些想买的</view>
 </view>

+ 16 - 0
pages/order_tabs/orderTabs.wxss

@@ -115,4 +115,20 @@
   display: block;
   height: 300rpx;
   line-height: 300rpx;
+}
+.empty_order_icon {
+  width: 523rpx;
+  height: 300rpx;
+  margin: 120rpx auto 50rpx;
+}
+.emoty_order_title {
+  font-size: 36rpx;
+  font-weight: bold;
+  color: #333;
+  text-align: center;
+}
+.emoty_order_subtitle {
+  font-size: 24rpx;
+  color: #666;
+  text-align: center;
 }

+ 28 - 12
pages/person/person.js

@@ -1,7 +1,9 @@
 // pages/person/person.js
 const app = getApp();
-import recordSource from '../../utils/recordSource'
+import recordSource from '../../utils/recordSource';
 const getReq = require('./../../config.js').getReq;
+import bonusUp from '../../utils/bonusUp';
+
 Page({
 
   /**
@@ -23,7 +25,9 @@ Page({
     bonus_total: 0,
     fromSource: '',
     firstLoad: true,
-    userInfo: app.globalData.userInfo
+    userInfo: app.globalData.userInfo,
+    tipsFlag: false,
+    tipsDatas: null
   },
 
   /**
@@ -61,6 +65,7 @@ Page({
     }
   },
   onShow: function () {
+    this.closeTips()
     if(!app.globalData.userInfo) {
       return;
     }
@@ -77,8 +82,6 @@ Page({
     const userInfo = app.globalData.userInfo || null;
     const nickName = userInfo.nickName || '';
     const avatarUrl = userInfo.avatarUrl || '../../image/mine_logo_icon.png';
-
-
     let self = this
     getReq({
       act: 'cart',
@@ -143,6 +146,21 @@ Page({
         }
       }
     })
+    this.getBonusTotal()
+    setTimeout(() => {
+      bonusUp((tipsFlag, tipsDatas) => {
+        if (tipsFlag) {
+          this.getBonusTotal()
+        }
+        this.setData({
+          tipsFlag,
+          tipsDatas
+        })
+      })
+    }, 0);
+  },
+  getBonusTotal() {
+    let self = this
     getReq({
       act: 'member_bonus',
       op: 'predepositex'
@@ -161,20 +179,18 @@ Page({
       url: `/pages/shareBonus/shareBonus?type_sn=58841537878020836581`
     })
   },
+  closeTips() {
+    this.setData({
+      tipsFlag: false,
+      tipsDatas: null
+    })
+  },
   /**
    * 生命周期函数--监听页面隐藏
    */
   onHide: function () {
 
   },
-
-  /**
-   * 生命周期函数--监听页面卸载
-   */
-  onUnload: function () {
-
-  },
-
   /**
    * 页面相关事件处理函数--监听用户下拉动作
    */

+ 2 - 1
pages/person/person.json

@@ -1,6 +1,7 @@
 {
     "navigationBarTitleText": "我",
     "usingComponents": {
-      "auth": "../components/auth/auth"
+      "auth": "../components/auth/auth",
+      "bonusTips": "../components/bonusTips/bonusTips"  
     }
 }

+ 1 - 0
pages/person/person.wxml

@@ -1,5 +1,6 @@
 <view>
   <auth wx:if="{{!userInfo}}" bind:getAuth="getAuth"></auth>
+  <bonusTips wx:if="{{tipsFlag}}" tipsDatas="{{tipsDatas}}" bind:closeTips="closeTips"></bonusTips>
   <view class="person_header">
     <view class="card">
       <image class="card_bg" src="../../image/person/card_bg.png"></image>

+ 0 - 1
pages/shareBonus/shareBonus.js

@@ -83,7 +83,6 @@ Page({
     let self = this
     getReq(params, function (res) {
       if (res.code == 200) {
-        console.log('res:', res)
         let { type_info, bonus_state } = res.datas
         if (bonus_state == 'unstart') {
           // bonus_state: unstart 活动未开始

+ 25 - 6
pages/shopCart/shopCart.js

@@ -1,6 +1,7 @@
 const getReq = require('./../../config.js').getReq
 import Bundle from '../../utils/Bundle'
 import recordSource from '../../utils/recordSource'
+import bonusUp from '../../utils/bonusUp';
 let app = getApp()
 Page({
   data: {
@@ -19,7 +20,9 @@ Page({
     summery: [],
     canShow: false,
     fromSource: '',
-    firstLoad: true
+    firstLoad: true,
+    tipsFlag: false,
+    tipsDatas: null
   },
   onLoad: function () {
 
@@ -38,11 +41,22 @@ Page({
       curpage: 0,
       special_datas: {},
       prop_special: [],
-      summery: []
+      summery: [],
+      tipsFlag: false,
+      tipsDatas: null
     });
     this.req_datas();
     this.getFavorite()
-
+    if (app.globalData.userInfo) {
+      setTimeout(() => {
+        bonusUp((tipsFlag, tipsDatas) => {
+          this.setData({
+            tipsFlag,
+            tipsDatas
+          })
+        })
+      }, 0);
+    }
   },
   getFavorite() {
     let self = this
@@ -91,8 +105,6 @@ Page({
     else {
       app.setFromSource(this.data.fromSource)
     }
-
-
     getReq({
       act: 'cart',
       op: 'list',
@@ -110,7 +122,8 @@ Page({
         if (cart_list.length <= 0) {
           self.setData({
             free_info: free_info || self.data.free_info,
-            loadAnimation: false
+            loadAnimation: false,
+            canShow: true
           });
           return;
         }
@@ -356,5 +369,11 @@ Page({
     wx.navigateTo({
       url: `/pages/details/details?goods_id=${goods_id}&title=商品详情`
     })
+  },
+  closeTips() {
+    this.setData({
+      tipsFlag: false,
+      tipsDatas: null
+    })
   }
 })

+ 2 - 1
pages/shopCart/shopCart.json

@@ -1,6 +1,7 @@
 {
   "navigationBarTitleText": "购物车",
   "usingComponents": {
-    "blockList" : "../components/blockList/blockList"
+    "blockList" : "../components/blockList/blockList",
+    "bonusTips": "../components/bonusTips/bonusTips"
   }
 }

+ 105 - 99
pages/shopCart/shopCart.wxml

@@ -1,25 +1,72 @@
 <import src="../components/template/loadAnimation/loadAnimation.wxml" />
-<template is="shopcartLoad" wx:if="{{loadAnimation}}" />
-
-<view style='background:#fff;' wx:if="{{summary.length <= 0}}">
-  <view class='flex_center'>
-    <image style='width:200rpx;' mode='widthFix' src='../../image/empty_cart.png'></image>
-  </view>
-  <view class='flex_center'>
-    <text style='font-size:26rpx;color:#a1a1a1;'>您的购物车没有商品哦!</text>
-  </view>
-  <view class='flex_center'>
-    <button size='mini' bindtap='skip_index' style='margin:20rpx 0;background: #2b2b2b;' type='warn'>去逛逛</button>
+<view style="background: #fff;">
+  <template is="shopcartLoad" wx:if="{{loadAnimation}}" />
+  <bonusTips wx:if="{{tipsFlag}}" tipsDatas="{{tipsDatas}}" bind:closeTips="closeTips"></bonusTips>
+  <view wx:if="{{summary.length <= 0}}">
+    <view class='flex_center'>
+      <image class="empty_cart_icon" src='../../image/empty_cart.png'></image>
+    </view>
+    <view class='flex_center mt20'>
+      <text style='font-size:26rpx;color:#a1a1a1;'>购物车空空如也~</text>
+    </view>
+    <view class='flex_center'>
+      <button size='mini' bindtap='skip_index' style='margin:20rpx 0;background: #2b2b2b;' type='warn'>去逛逛</button>
+    </view>
   </view>
-</view>
-<view class='cart_list'>
-  <block wx:for="{{cart_list}}" wx:for-index="cart_index" wx:key="cart_index">
-    <!-- 套餐情况下循环 -->
-    <block wx:if="{{item['bl_id'] > 0}}">
-      <view class="mb20">
-        <view class="bundl_title"><text class="bundle_tip">搭配套装</text> {{item['bl_name']}}</view>
-        <view class='cart_item'>
-          <icon class='cancal_btn' type="cancel" size="22" color="#333" bindtap='cancal_cart' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"></icon>
+  <view class='cart_list'>
+    <block wx:for="{{cart_list}}" wx:for-index="cart_index" wx:key="cart_index">
+      <!-- 套餐情况下循环 -->
+      <block wx:if="{{item['bl_id'] > 0}}">
+        <view class="mb20">
+          <view class="bundl_title"><text class="bundle_tip">搭配套装</text> {{item['bl_name']}}</view>
+          <view class='cart_item'>
+            <icon class='cancal_btn' type="cancel" size="22" color="#333" bindtap='cancal_cart' data-goodsid="{{item['goods_id']}}"
+              data-cartid="{{item['cart_id']}}"></icon>
+            <view class='check_btn' data-goodsid="{{item['goods_id']}}" bindtap='goods_checked' data-cartid="{{item['cart_id']}}">
+              <block wx:if="{{item['checked']}}">
+                <icon type="success" size="21" color="#333"></icon>
+              </block>
+              <block wx:else>
+                <view class="icon_empty"></view>
+              </block>
+            </view>
+
+            <view>
+              <view class="align_center mb20" wx:for="{{item['goods']}}" wx:for-index="bl_index" wx:for-item="bl_item"
+                wx:key="bl_index">
+                <view class='goods_image' catchtap="toDetails" data-goodsid="{{bl_item['goods_id']}}">
+                  <image mode='scaleToFill' src="{{bl_item['goods_summary']['goods_image_url']}}"></image>
+                </view>
+                <view class='goods_content' catchtap="toDetails" data-goodsid="{{bl_item['goods_id']}}">
+                  <view class='goods_name one_line_hidden'>{{bl_item['goods_summary']['goods_mobile_name']}}</view>
+                  <view class='goods_spec one_line_hidden'>{{bl_item['goods_summary']['goods_spec']}}</view>
+                  <view class='goods_price'>
+                    <text class="bonus_price"><text class="f24">¥</text>{{bl_item['bl_goods_price']}}</text>
+                    <text class="original_price line-through ml10">天猫价{{bl_item['goods_summary']['goods_price']}}</text>
+                  </view>
+                </view>
+              </view>
+            </view>
+            <view class='num_handle align_center'>
+              <text class='handle_btn' bindtap='goods_num_handle' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"
+                data-function='minus' data-num="{{item['goods_num']}}">-</text>
+              <block>
+                <text class='num'>{{item['goods_num']}}</text>
+              </block>
+              <text class='handle_btn' bindtap='goods_num_handle' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"
+                data-function='add' data-num="{{item['goods_num']}}">+</text>
+            </view>
+          </view>
+          <view class="bundle_price"><text>套装价:</text><text class="ft_bold col333">¥{{item['bl_price']}}</text> <text
+              class="line-through col666 ml10 f20">天猫价{{item['totalPrice']}}</text></view>
+        </view>
+      </block>
+
+      <!-- 非套餐情况下循环 -->
+      <block wx:if="{{item['bl_id'] == 0}}">
+        <view class='cart_item mb20'>
+          <icon class='cancal_btn' type="cancel" size="22" color="#333" bindtap='cancal_cart' data-goodsid="{{item['goods_id']}}"
+            data-cartid="{{item['cart_id']}}"></icon>
           <view class='check_btn' data-goodsid="{{item['goods_id']}}" bindtap='goods_checked' data-cartid="{{item['cart_id']}}">
             <block wx:if="{{item['checked']}}">
               <icon type="success" size="21" color="#333"></icon>
@@ -28,23 +75,19 @@
               <view class="icon_empty"></view>
             </block>
           </view>
-
-          <view>
-            <view class="align_center mb20" wx:for="{{item['goods']}}" wx:for-index="bl_index" wx:for-item="bl_item" wx:key="bl_index">
-              <view class='goods_image' catchtap="toDetails" data-goodsid="{{bl_item['goods_id']}}">
-                <image mode='scaleToFill' src="{{bl_item['goods_summary']['goods_image_url']}}"></image>
-              </view>
-              <view class='goods_content' catchtap="toDetails" data-goodsid="{{bl_item['goods_id']}}">
-                <view class='goods_name one_line_hidden'>{{bl_item['goods_summary']['goods_mobile_name']}}</view>
-                <view class='goods_spec one_line_hidden'>{{bl_item['goods_summary']['goods_spec']}}</view>
-                <view class='goods_price'>
-                  <text class="bonus_price"><text class="f24">¥</text>{{bl_item['bl_goods_price']}}</text>
-                  <text class="original_price line-through ml10">天猫价{{bl_item['goods_summary']['goods_price']}}</text>
-                </view>
-              </view>
+          <view class='goods_image' catchtap="toDetails" data-goodsid="{{item['goods_id']}}">
+            <image mode='scaleToFill' src="{{item['goods_summary']['goods_image_url']}}"></image>
+          </view>
+          <view class='goods_content' catchtap="toDetails" data-goodsid="{{item['goods_id']}}">
+            <view class='goods_name one_line_hidden'>{{item['goods_summary']['goods_mobile_name']}}</view>
+            <view class='goods_spec one_line_hidden'>{{item['goods_summary']['goods_spec']}}</view>
+            <view class='goods_price'>
+              <text class="bonus_price" wx:if="{{item['goods_summary']['act_type'] == 0}}"><text class="f24">¥</text>{{item['goods_summary']['bonus_price']}}</text>
+              <text class="bonus_price" wx:if="{{item['goods_summary']['act_type'] == 2}}"><text class="f24">¥</text>{{item['goods_summary']['goods_promotion_price']}}</text>
+              <text class="original_price line-through ml10">天猫价{{item['goods_summary']['goods_price']}}</text>
             </view>
           </view>
-          <view class='num_handle align_center'>
+          <view class='num_handle default_num_handle'>
             <text class='handle_btn' bindtap='goods_num_handle' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"
               data-function='minus' data-num="{{item['goods_num']}}">-</text>
             <block>
@@ -54,79 +97,42 @@
               data-function='add' data-num="{{item['goods_num']}}">+</text>
           </view>
         </view>
-        <view class="bundle_price"><text>套装价:</text><text class="ft_bold col333">¥{{item['bl_price']}}</text> <text class="line-through col666 ml10 f20">天猫价{{item['totalPrice']}}</text></view>
-      </view>
-    </block>
-
-    <!-- 非套餐情况下循环 -->
-    <block wx:if="{{item['bl_id'] == 0}}">
-      <view class='cart_item mb20'>
-        <icon class='cancal_btn' type="cancel" size="22" color="#333" bindtap='cancal_cart' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"></icon>
-        <view class='check_btn' data-goodsid="{{item['goods_id']}}" bindtap='goods_checked' data-cartid="{{item['cart_id']}}">
-          <block wx:if="{{item['checked']}}">
-            <icon type="success" size="21" color="#333"></icon>
-          </block>
-          <block wx:else>
-            <view class="icon_empty"></view>
-          </block>
-        </view>
-        <view class='goods_image' catchtap="toDetails" data-goodsid="{{item['goods_id']}}">
-          <image mode='scaleToFill' src="{{item['goods_summary']['goods_image_url']}}"></image>
-        </view>
-        <view class='goods_content' catchtap="toDetails" data-goodsid="{{item['goods_id']}}">
-          <view class='goods_name one_line_hidden'>{{item['goods_summary']['goods_mobile_name']}}</view>
-          <view class='goods_spec one_line_hidden'>{{item['goods_summary']['goods_spec']}}</view>
-          <view class='goods_price'>
-            <text class="bonus_price" wx:if="{{item['goods_summary']['act_type'] == 0}}"><text class="f24">¥</text>{{item['goods_summary']['bonus_price']}}</text>
-            <text class="bonus_price" wx:if="{{item['goods_summary']['act_type'] == 2}}"><text class="f24">¥</text>{{item['goods_summary']['goods_promotion_price']}}</text>
-            <text class="original_price line-through ml10">天猫价{{item['goods_summary']['goods_price']}}</text>
-          </view>
-        </view>
-        <view class='num_handle default_num_handle'>
-          <text class='handle_btn' bindtap='goods_num_handle' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"
-            data-function='minus' data-num="{{item['goods_num']}}">-</text>
-          <block>
-            <text class='num'>{{item['goods_num']}}</text>
-          </block>
-          <text class='handle_btn' bindtap='goods_num_handle' data-goodsid="{{item['goods_id']}}" data-cartid="{{item['cart_id']}}"
-            data-function='add' data-num="{{item['goods_num']}}">+</text>
-        </view>
-      </view>
 
+      </block>
     </block>
-  </block>
-
-</view>
 
-<!-- 猜你喜欢 -->
-<block wx:if="{{canShow}}">
-  <view wx:if="{{prop_special.length}}" class="mt30 mb10">
-    <view class="text_center l_height42 f30 col333">-猜你喜欢-</view>
-    <blockList prop_special="{{prop_special}}" summery="{{summery}}" special_datas="{{special_datas}}"> </blockList>
   </view>
-</block>
 
+  <!-- 猜你喜欢 -->
+  <block wx:if="{{canShow}}">
+    <view wx:if="{{prop_special.length}}" class="mt30 mb10">
+      <!-- <view class="text_center l_height42 f30 col333">-猜你喜欢-</view> -->
+      <blockList prop_special="{{prop_special}}" summery="{{summery}}" special_datas="{{special_datas}}"> </blockList>
+    </view>
+  </block>
 
 
-<view class='clear_fixed'></view>
 
-<view class="handle_fixed">
-  <view class="all_check_btn" bindtap='all_checked'>
-    <block wx:if="{{all_checked}}">
-      <icon type="success" size="21" color="#333" style='margin-right:22rpx;position:relative;top:7rpx;'></icon>
-    </block>
-    <block wx:else>
-      <view class="icon_empty" style='position:relative;bottom:5rpx;'></view>
-    </block>
-    <text>全选</text>
-  </view>
-  <view style='float:right'>
-    <view class='cope'>
-      <text class='bonus_price'>应付:¥{{allPrice}}</text>
-      <text class="original_price line-through ml10 mr10">¥{{allGoodsPrice}}</text>
+  <view class='clear_fixed'></view>
+
+  <view class="handle_fixed">
+    <view class="all_check_btn" bindtap='all_checked'>
+      <block wx:if="{{all_checked}}">
+        <icon type="success" size="21" color="#333" style='margin-right:22rpx;position:relative;top:7rpx;'></icon>
+      </block>
+      <block wx:else>
+        <view class="icon_empty" style='position:relative;bottom:5rpx;'></view>
+      </block>
+      <text>全选</text>
     </view>
-    <view class='settlement_btn' bindtap='settlement'>
-      <text>结算</text>
+    <view style='float:right'>
+      <view class='cope'>
+        <text class='bonus_price'>应付:¥{{allPrice}}</text>
+        <text class="original_price line-through ml10 mr10">¥{{allGoodsPrice}}</text>
+      </view>
+      <view class='settlement_btn' bindtap='settlement'>
+        <text>结算</text>
+      </view>
     </view>
   </view>
 </view>

+ 17 - 14
pages/shopCart/shopCart.wxss

@@ -72,6 +72,7 @@
 .goods_content .goods_price{
   position: absolute;
   left: 0;
+  min-width: 300rpx;
   bottom: 0;
 }
 .icon_empty {
@@ -146,27 +147,23 @@
   bottom: 38rpx;
   right: 10rpx;
   font-size: 0;
-  /* border: 1px solid #CFCFCF; */
-  /* border-radius: 6rpx; */
 }
 .num_handle.default_num_handle {
   bottom: 20rpx;
 }
 .handle_btn {
-    color: #999;
-    display: inline-block;
-    /* vertical-align: middle; */
-    width: 60rpx;
-    text-align: center;
-    font-size: 40rpx;
+  color: #999;
+  display: inline-block;
+  width: 60rpx;
+  text-align: center;
+  font-size: 40rpx;
 }
 .num {
-    font-size: 40rpx;
-    display: inline-block;
-    /* vertical-align: middle; */
-    width: 40rpx;
-    text-align: center;
-    color: #333;
+  font-size: 30rpx;
+  display: inline-block;
+  width: 40rpx;
+  text-align: center;
+  color: #333;
 }
 .clear_fixed {
   height: 88rpx;
@@ -201,4 +198,10 @@
   background: #fff;
   line-height: 42rpx;
   font-size: 24rpx;
+}
+.empty_cart_icon {
+  display: block;
+  margin: 120rpx auto 0;
+  width: 193rpx;
+  height: 179rpx;
 }

+ 0 - 1
pages/special/special.js

@@ -40,7 +40,6 @@ Page({
       from: fromSource
     }, function (res) {
       if (res.code == 200) {
-        console.log('special:', res);
         self.setData({
           special_datas: res.datas,
           summery: res.datas.summary,

+ 26 - 0
utils/bonusUp.js

@@ -0,0 +1,26 @@
+
+const getReq = require('../config.js').getReq
+
+function bonusUp(callback) {
+  let params = {
+    act: 'member_bonus',
+    op: 'topup'
+  }
+  getReq(params, res => {
+    if (res.code == 200) {
+      let { datas } = res
+      let { count, total_amount } = datas 
+      if (count > 0) {
+        callback(true, datas)
+      }     
+      else {
+        callback(false, null)
+      } 
+    }
+    else {
+      callback(false, null)
+    }
+  })
+}
+
+export default bonusUp

+ 15 - 0
utils/util.js

@@ -14,6 +14,21 @@ const formatNumber = n => {
   return n[1] ? n : '0' + n
 }
 
+const getTypeSn = url => {
+  let type_sn = ''
+  if (url.indexOf('type_sn') != -1 && url.indexOf('bonusex') != -1) {
+    let arr = url.split('&')
+    arr.some(item => {
+      if (item.indexOf('type_sn') != -1) {
+        type_sn = item.split('=')[1]
+        return true
+      }
+    })
+  }
+  return type_sn
+}
+
 module.exports = {
+  getTypeSn: getTypeSn,
   formatTime: formatTime
 }