暂时去掉登录时候client参数,会引发account唯一索引错误

This commit is contained in:
2025-05-13 14:44:56 +08:00
parent a079f9d9fe
commit 1b6971407d
34 changed files with 1980 additions and 207 deletions

View File

@ -114,6 +114,11 @@ var _default = {
}
});
},
// 选择单个商品
changOneSelect: function changOneSelect(cartId, selected) {
selected = !selected;
this.changeCartSelectFun([cartId], selected);
},
// 更改全选状态
changeAllSelect: function changeAllSelect() {
var isSelectedAll = this.isSelectedAll,
@ -147,17 +152,22 @@ var _default = {
});
}
});
console.log("this.cartList>>>", goods);
if (goods.length == 0) return this.$toast({
title: "您还没有选择商品哦"
});
uni.navigateTo({
url: "/pages/confirm_order/confirm_order?data=" + encodeURIComponent(JSON.stringify({
goods: goods,
type: "cart"
}))
});
// uni.navigateTo({
// url: "/pages/confirm_order/confirm_order?data=" +
// encodeURIComponent(
// JSON.stringify({
// goods,
// type: "cart",
// })
// ),
// });
}
}),
computed: _objectSpread(_objectSpread({}, (0, _vuex.mapGetters)(["cartNum"])), {}, {
nullSelect: function nullSelect() {
var index = this.cartLists.findIndex(function (item) {

View File

@ -1 +1 @@
<view class="shop-cart"><view class="u-m-32"><block wx:if="{{$root.g0>0}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="u-text-right nr" bindtap="__e">{{!isEdit?'编辑':'完成'}}</view></block><block wx:for="{{cartLists}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="u-m-t-40"><view class="bg-white br16 u-p-24 row"><view class="select checkbox"><checkbox class="checkbox" type="circle" value="{{item.cart_id+''}}" checked="{{item.selected==1}}" data-event-opts="{{[['tap',[['changOneSelect',['$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index,'selected']]]]]]]}}" bindtap="__e"></checkbox></view><view class="row flex1 u-col-top"><view><u-image vue-id="{{'9fac4ca8-1-'+index}}" src="{{item.img}}" width="160" height="160" border-radius="8" bind:__l="__l"></u-image></view><view class="u-m-l-16"><navigator url="{{'/pages/shop/shop?id='+item.goods_id}}" hover-class="none"><view class="u-line-2">{{item.name}}</view></navigator><view class="sm text-999 u-m-t-8 attr u-text-center u-p-l-16 u-p-r-16 u-p-6-8 u-p-b-8"><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text></view><view class="u-m-t-16 row-between"><view class="primary"><price-format vue-id="{{'9fac4ca8-2-'+index}}" price="{{item.price}}" subscriptSize="{{22}}" firstSize="{{34}}" secondSize="{{26}}" bind:__l="__l"></price-format></view><view><block wx:if="{{!isEdit}}"><view><u-number-box vue-id="{{'9fac4ca8-3-'+index}}" disabled="{{item.cart_status!=0}}" value="{{item.goods_num}}" min="{{1}}" max="{{item.item_stock}}" data-event-opts="{{[['^change',[['countChange',['$event','$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index]]]]]]]}}" bind:change="__e" bind:__l="__l"></u-number-box></view></block><block wx:if="{{isEdit}}"><view data-event-opts="{{[['tap',[['deleteCartGoods',['$0'],[[['cartLists','',index,'cart_id']]]]]]]}}" catchtap="__e"><u-icon vue-id="{{'9fac4ca8-4-'+index}}" name="trash" size="32" color="#999" bind:__l="__l"></u-icon></view></block></view></view></view></view></view></view></block><block wx:if="{{!(cartType!=2)}}"><view hidden="{{!(!(cartType!=2))}}" class="cart-null column-center mb20" style="padding:80rpx 0 50rpx;"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}"></image><view class="muted mb20">购物车暂无任何商品~</view></view></block></view><block wx:if="{{!isLogin}}"><view class="login column-center u-m-t-80"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}" width="1200" height="1200" mode="aspectFill"></image><view class="muted mt20">登录后才能查看购物车哦</view><navigator class="mt20 br60 row-center btn text-default" url="/pages/login/login" hover-class="none"><text>去登录</text></navigator></view></block><block wx:if="{{!(cartType!=1)}}"><view class="fixed footer bg-white w-full row-between u-col-center px32"><view><checkbox-group data-event-opts="{{[['change',[['changeAllSelect',['$event']]]]]}}" class="row checkbox" bindchange="__e"><checkbox id="checkAll" value="all" checked="{{isSelectedAll}}"></checkbox><label class="ml10" for="checkAll">全选</label></checkbox-group></view><view class="row"><view class="row-center"><view>合计:</view><view class="primary u-m-l-8" style="margin-top:-8rpx;"><price-format vue-id="9fac4ca8-5" price="{{totalPrice}}" subscriptSize="{{32}}" firstSize="{{40}}" secondSize="{{32}}" bind:__l="__l"></price-format></view></view><view class="u-m-l-24"><u-button vue-id="9fac4ca8-6" hover-class="none" customStyle="{{({width:'228rpx',height:'80rpx',backgroundColor:themeColor,color:'#fff',border:'none',padding:'16rpx 0',borderRadius:'64rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['mpLogin']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">结算</u-button></view></view></view></block></view>
<view class="shop-cart"><view class="u-m-32"><block wx:if="{{$root.g0>0}}"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="u-text-right nr" bindtap="__e">{{!isEdit?'编辑':'完成'}}</view></block><block wx:for="{{cartLists}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="u-m-t-40"><view class="bg-white br16 u-p-24 row"><view class="select checkbox"><checkbox class="checkbox" type="circle" value="{{item.cart_id+''}}" checked="{{item.selected==1}}" data-event-opts="{{[['tap',[['changOneSelect',['$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index,'selected']]]]]]]}}" bindtap="__e"></checkbox></view><view class="row flex1 u-col-top"><view><u-image vue-id="{{'9fac4ca8-1-'+index}}" src="{{item.img}}" width="160" height="160" border-radius="8" bind:__l="__l"></u-image></view><view class="u-m-l-16"><navigator url="{{'/pages/shop/shop?id='+item.goods_id}}" hover-class="none"><view class="u-line-2">{{item.name}}</view></navigator><view class="sm text-999 u-m-t-8 attr u-text-center u-p-l-16 u-p-r-16 u-p-6-8 u-p-b-8"><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text><text class="u-m-l-8 u-m-r-8">|</text><text>味浓芳香</text></view><view class="u-m-t-16 row-between"><view class="primary"><price-format vue-id="{{'9fac4ca8-2-'+index}}" price="{{item.price}}" subscriptSize="{{22}}" firstSize="{{34}}" secondSize="{{26}}" bind:__l="__l"></price-format></view><view><block wx:if="{{!isEdit}}"><view><u-number-box vue-id="{{'9fac4ca8-3-'+index}}" disabled="{{item.cart_status!=0}}" value="{{item.goods_num}}" min="{{1}}" max="{{item.item_stock}}" data-event-opts="{{[['^change',[['countChange',['$event','$0','$1'],[[['cartLists','',index,'cart_id']],[['cartLists','',index]]]]]]]}}" bind:change="__e" bind:__l="__l"></u-number-box></view></block><block wx:if="{{isEdit}}"><view data-event-opts="{{[['tap',[['deleteCartGoods',['$0'],[[['cartLists','',index,'cart_id']]]]]]]}}" catchtap="__e"><u-icon vue-id="{{'9fac4ca8-4-'+index}}" name="trash" size="32" color="#999" bind:__l="__l"></u-icon></view></block></view></view></view></view></view></view></block><block wx:if="{{!(cartType!=2)}}"><view hidden="{{!(!(cartType!=2))}}" class="cart-null column-center mb20" style="padding:80rpx 0 50rpx;"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}"></image><view class="muted mb20">购物车暂无任何商品~</view></view></block></view><block wx:if="{{!isLogin}}"><view class="login column-center u-m-t-80"><image class="img-null" src="{{cloudPath+'img/cart_null.png'}}" width="1200" height="1200" mode="aspectFill"></image><view class="muted mt20">登录后才能查看购物车哦</view><navigator class="mt20 br60 row-center btn text-default" url="/pages/login/login" hover-class="none"><text>去登录</text></navigator></view></block><block wx:if="{{!(cartType!=1)}}"><view class="fixed footer bg-white w-full row-between u-col-center px32"><view><checkbox-group data-event-opts="{{[['change',[['changeAllSelect',['$event']]]]]}}" class="row checkbox" bindchange="__e"><checkbox id="checkAll" value="all" checked="{{isSelectedAll}}"></checkbox><label class="ml10" for="checkAll">全选</label></checkbox-group></view><view class="row"><view class="row-center"><view>合计:</view><view class="primary u-m-l-8" style="margin-top:-8rpx;"><price-format vue-id="9fac4ca8-5" price="{{totalPrice}}" subscriptSize="{{32}}" firstSize="{{40}}" secondSize="{{32}}" bind:__l="__l"></price-format></view></view><view class="u-m-l-24"><u-button vue-id="9fac4ca8-6" hover-class="none" customStyle="{{({width:'228rpx',height:'80rpx',backgroundColor:themeColor,color:'#fff',border:'none',padding:'16rpx 0',borderRadius:'64rpx'})}}" hair-line="{{false}}" data-event-opts="{{[['^click',[['goToConfirm']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">结算</u-button></view></view></view></block></view>