作者 朱振飞

1212

@@ -30,6 +30,7 @@ Page({ @@ -30,6 +30,7 @@ Page({
30 num_change(e) { 30 num_change(e) {
31 let that = this 31 let that = this
32 let num = Number(e.currentTarget.dataset.num) 32 let num = Number(e.currentTarget.dataset.num)
  33 + console.log(num)
33 let type = e.currentTarget.dataset.type 34 let type = e.currentTarget.dataset.type
34 let index = e.currentTarget.dataset.index 35 let index = e.currentTarget.dataset.index
35 let id = e.currentTarget.dataset.id 36 let id = e.currentTarget.dataset.id
@@ -40,7 +41,7 @@ Page({ @@ -40,7 +41,7 @@ Page({
40 num++ 41 num++
41 } else { 42 } else {
42 num-- 43 num--
43 - if (num < 1) { 44 + if (num < 0) {
44 return 45 return
45 } 46 }
46 } 47 }
@@ -42,9 +42,9 @@ @@ -42,9 +42,9 @@
42 42
43 <!-- 数量操作 --> 43 <!-- 数量操作 -->
44 <view class="num_box"> 44 <view class="num_box">
45 - <image class="num_btn" src="/images/reduce.png" data-check='{{item.check}}' data-index="{{index}}" data-id="{{item.id}}" data-type="0" data-num="{{item.num?item.num:1}}" catchtap="num_change" />  
46 - <text>{{item.num?item.num:1}}</text>  
47 - <image class="num_btn" src="/images/add.png" data-check='{{item.check}}' data-index="{{index}}" data-id="{{item.id}}" data-type="1" data-num="{{item.num?item.num:1}}" catchtap="num_change" /> 45 + <image class="num_btn" src="/images/reduce.png" data-check='{{item.check}}' wx:if="{{item.num}}" data-index="{{index}}" data-id="{{item.id}}" data-type="0" data-num="{{item.num?item.num:0}}" catchtap="num_change" />
  46 + <text wx:if="{{item.num}}" >{{item.num?item.num:0}}</text>
  47 + <image class="num_btn" src="/images/add.png" data-check='{{item.check}}' data-index="{{index}}" data-id="{{item.id}}" data-type="1" data-num="{{item.num?item.num:0}}" catchtap="num_change" />
48 </view> 48 </view>
49 </view> 49 </view>
50 </view> 50 </view>
@@ -464,7 +464,7 @@ page { @@ -464,7 +464,7 @@ page {
464 box-sizing: border-box; 464 box-sizing: border-box;
465 display: flex; 465 display: flex;
466 align-items: center; 466 align-items: center;
467 - justify-content: space-between; 467 + justify-content: flex-end;
468 } 468 }
469 469
470 .num_box .num_btn { 470 .num_box .num_btn {
@@ -72,13 +72,9 @@ Page({ @@ -72,13 +72,9 @@ Page({
72 success(res) { 72 success(res) {
73 if (res.confirm) { 73 if (res.confirm) {
74 console.log('用户点击确定') 74 console.log('用户点击确定')
75 - wx.switchTab({  
76 - url: '/pages/shop_cart/shop_cart', 75 + wx.redirectTo({
  76 + url: '/packageA/pages/shop_cart/shop_cart',
77 }) 77 })
78 -  
79 -  
80 - } else if (res.cancel) {  
81 -  
82 } 78 }
83 } 79 }
84 }) 80 })
@@ -12,6 +12,8 @@ Page({ @@ -12,6 +12,8 @@ Page({
12 token:'', 12 token:'',
13 login_new:'', 13 login_new:'',
14 selected: 2, 14 selected: 2,
  15 + isiphonex: false,
  16 + bottom:100,
15 itemMenu:[{ 17 itemMenu:[{
16         pagePath: "/packageA/pages/index/index", 18         pagePath: "/packageA/pages/index/index",
17         text: "商品", 19         text: "商品",
@@ -235,7 +237,11 @@ submit(){ @@ -235,7 +237,11 @@ submit(){
235 * 生命周期函数--监听页面加载 237 * 生命周期函数--监听页面加载
236 */ 238 */
237 onLoad: function(options) { 239 onLoad: function(options) {
238 - 240 + let res = wx.getSystemInfoSync();
  241 + console.log(res)
  242 + this.setData({
  243 + bottom:res.model.indexOf('iPhone X')>-1?'172':'100'
  244 + })
239 }, 245 },
240 246
241 /** 247 /**
@@ -9,11 +9,11 @@ @@ -9,11 +9,11 @@
9 9
10 <block wx:else> 10 <block wx:else>
11 <view class="content"> 11 <view class="content">
12 - <shop_item list="{{list}}" wx:if="{{list.length>0}}" type="1" check_num="{{check_num}}" bindcheck_type="check_type" bindchange_num="change_num" binddelete_shop="delete_shop" /> 12 + <shop_item list="{{list}}" wx:if='{{list.length>0}}' type="1" check_num="{{check_num}}" bindcheck_type="check_type" bindchange_num="change_num" binddelete_shop="delete_shop" />
13 <view class="empty" wx:else>暂无更多数据</view> 13 <view class="empty" wx:else>暂无更多数据</view>
14 </view> 14 </view>
15 15
16 - <view class="footer" wx:if="{{list.length>0}}"> 16 + <view class="footer" style="bottom:{{bottom}}rpx" wx:if="{{list.length>0}}">
17 <view class="check_box" bindtap="check_all"> 17 <view class="check_box" bindtap="check_all">
18 <image class="check" src="{{checkAll?'/images/check@.png':'/images/check.png'}}" /> 18 <image class="check" src="{{checkAll?'/images/check@.png':'/images/check.png'}}" />
19 <text>全选</text> 19 <text>全选</text>