作者 朱振飞

1212

... ... @@ -30,6 +30,7 @@ Page({
num_change(e) {
let that = this
let num = Number(e.currentTarget.dataset.num)
console.log(num)
let type = e.currentTarget.dataset.type
let index = e.currentTarget.dataset.index
let id = e.currentTarget.dataset.id
... ... @@ -40,7 +41,7 @@ Page({
num++
} else {
num--
if (num < 1) {
if (num < 0) {
return
}
}
... ...
... ... @@ -42,9 +42,9 @@
<!-- 数量操作 -->
<view class="num_box">
<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" />
<text>{{item.num?item.num:1}}</text>
<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" />
<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" />
<text wx:if="{{item.num}}" >{{item.num?item.num:0}}</text>
<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" />
</view>
</view>
</view>
... ...
... ... @@ -464,7 +464,7 @@ page {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
justify-content: flex-end;
}
.num_box .num_btn {
... ...
... ... @@ -72,14 +72,10 @@ Page({
success(res) {
if (res.confirm) {
console.log('用户点击确定')
wx.switchTab({
url: '/pages/shop_cart/shop_cart',
wx.redirectTo({
url: '/packageA/pages/shop_cart/shop_cart',
})
} else if (res.cancel) {
}
}
}
})
... ...
... ... @@ -12,6 +12,8 @@ Page({
token:'',
login_new:'',
selected: 2,
isiphonex: false,
bottom:100,
itemMenu:[{
        pagePath: "/packageA/pages/index/index",
        text: "商品",
... ... @@ -235,7 +237,11 @@ submit(){
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let res = wx.getSystemInfoSync();
console.log(res)
this.setData({
bottom:res.model.indexOf('iPhone X')>-1?'172':'100'
})
},
/**
... ...
... ... @@ -9,11 +9,11 @@
<block wx:else>
<view class="content">
<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" />
<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" />
<view class="empty" wx:else>暂无更多数据</view>
</view>
<view class="footer" wx:if="{{list.length>0}}">
<view class="footer" style="bottom:{{bottom}}rpx" wx:if="{{list.length>0}}">
<view class="check_box" bindtap="check_all">
<image class="check" src="{{checkAll?'/images/check@.png':'/images/check.png'}}" />
<text>全选</text>
... ...