|
|
@ -20,6 +20,12 @@ |
|
|
|
<!-- 购物车商品列表 --> |
|
|
|
<!-- 购物车商品列表 --> |
|
|
|
<view v-if="list.length" class="cart-list"> |
|
|
|
<view v-if="list.length" class="cart-list"> |
|
|
|
<view class="cart-item" v-for="(item, index) in list" :key="index"> |
|
|
|
<view class="cart-item" v-for="(item, index) in list" :key="index"> |
|
|
|
|
|
|
|
<view v-if="storeVersion == 1 && item.goods.merchant_id > 0 && item.goods.merchant" class="merchant-name" @click="toShop(item)"> |
|
|
|
|
|
|
|
<image :src="item.goods.merchant.logoImage && item.goods.merchant.logoImage[0].external_url" mode="aspectFill"></image> |
|
|
|
|
|
|
|
<text>{{ '123456789' || item.goods.merchant.shop_name }}</text> |
|
|
|
|
|
|
|
<image src="@/static/arrow-right.png" mode="aspectFill"></image> |
|
|
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
<view> |
|
|
|
<view class="item-radio" @click="handleCheckItem(item.id)"> |
|
|
|
<view class="item-radio" @click="handleCheckItem(item.id)"> |
|
|
|
<u-checkbox :modelValue="inArray(item.id, checkedIds)" shape="circle" |
|
|
|
<u-checkbox :modelValue="inArray(item.id, checkedIds)" shape="circle" |
|
|
|
:activeColor="appTheme.mainBg" /> |
|
|
|
:activeColor="appTheme.mainBg" /> |
|
|
@ -52,6 +58,7 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
<!-- 购物车数据为空 --> |
|
|
|
<!-- 购物车数据为空 --> |
|
|
|
<empty v-if="!list.length" :isLoading="isLoading" :custom-style="{ padding: '180rpx 50rpx' }" |
|
|
|
<empty v-if="!list.length" :isLoading="isLoading" :custom-style="{ padding: '180rpx 50rpx' }" |
|
|
|
tips="您的购物车是空的, 快去逛逛吧"> |
|
|
|
tips="您的购物车是空的, 快去逛逛吧"> |
|
|
@ -240,6 +247,13 @@ |
|
|
|
totalPrice: '0.00' |
|
|
|
totalPrice: '0.00' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
computed: { |
|
|
|
|
|
|
|
storeVersion() { |
|
|
|
|
|
|
|
const version = uni.getStorageSync('storeVersion') == 1 ? 1 : 0; |
|
|
|
|
|
|
|
console.log(version); |
|
|
|
|
|
|
|
return version; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
// 监听选中的商品 |
|
|
|
// 监听选中的商品 |
|
|
|
checkedIds: { |
|
|
|
checkedIds: { |
|
|
@ -449,7 +463,13 @@ |
|
|
|
app.getCartList() |
|
|
|
app.getCartList() |
|
|
|
app.handleToggleMode() |
|
|
|
app.handleToggleMode() |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
toShop(item) { |
|
|
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
|
|
url: `/pages/shopList/shopPage?id=${item.goods.merchant_id}`, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -633,10 +653,34 @@ |
|
|
|
.cart-item { |
|
|
|
.cart-item { |
|
|
|
background: #fff; |
|
|
|
background: #fff; |
|
|
|
border-radius: 12rpx; |
|
|
|
border-radius: 12rpx; |
|
|
|
display: flex; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
padding: 30rpx 16rpx; |
|
|
|
padding: 30rpx 16rpx; |
|
|
|
margin-bottom: 24rpx; |
|
|
|
margin-bottom: 24rpx; |
|
|
|
|
|
|
|
.merchant-name { |
|
|
|
|
|
|
|
font-size: 30rpx; |
|
|
|
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
font-weight: bold; |
|
|
|
|
|
|
|
>text { |
|
|
|
|
|
|
|
overflow: hidden; |
|
|
|
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
|
|
|
white-space: nowrap; |
|
|
|
|
|
|
|
max-width: calc(100% - 73rpx); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
>image { |
|
|
|
|
|
|
|
margin-left: 10rpx; |
|
|
|
|
|
|
|
width: 13rpx; |
|
|
|
|
|
|
|
height: 24rpx; |
|
|
|
|
|
|
|
flex-shrink: 0; |
|
|
|
|
|
|
|
&:first-child { |
|
|
|
|
|
|
|
width: 40rpx; |
|
|
|
|
|
|
|
height: 40rpx; |
|
|
|
|
|
|
|
margin-right: 10rpx; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
>view { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.item-radio { |
|
|
|
.item-radio { |
|
|
|
width: 56rpx; |
|
|
|
width: 56rpx; |
|
|
|