|
@@ -42,7 +42,7 @@
|
|
</div>
|
|
</div>
|
|
<van-empty v-if="shopCartInfo <= 0" />
|
|
<van-empty v-if="shopCartInfo <= 0" />
|
|
<div style="height: 7rem;"></div>
|
|
<div style="height: 7rem;"></div>
|
|
- <van-submit-bar :price="totalMoney" :disabled="basketIds.length <= 0" button-text="提交订单" @submit="onSubmit">
|
|
|
|
|
|
+ <van-submit-bar :price="totalMoney" button-text="提交订单" @submit="onSubmit">
|
|
<van-checkbox v-model="checked" @click="allProdSelected">全选</van-checkbox>
|
|
<van-checkbox v-model="checked" @click="allProdSelected">全选</van-checkbox>
|
|
<a class="clear-cart" v-show="basketIds.length > 0" @click="clearCart">清空</a>
|
|
<a class="clear-cart" v-show="basketIds.length > 0" @click="clearCart">清空</a>
|
|
</van-submit-bar>
|
|
</van-submit-bar>
|
|
@@ -86,45 +86,11 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
onSubmit() {
|
|
onSubmit() {
|
|
- // 标准的 B 2 C 模式
|
|
|
|
- // for ( let i = 0; i < this.shopCartInfo.length; i++ ) {
|
|
|
|
- // const shopCart = this.shopCartInfo[i].shopCartItemDiscounts
|
|
|
|
- // for ( let n = 0; n < shopCart.length; n++ ) {
|
|
|
|
- // const cart = shopCart[n].shopCartItems
|
|
|
|
- // for ( let j = 0 ; j < cart.length; j++ ) {
|
|
|
|
- // this.confirm.basketIds.push( cart[j].basketId )
|
|
|
|
- // this.confirm.orderItem = {
|
|
|
|
- // prodId: cart[j].prodId,
|
|
|
|
- // skuId: cart[j].skuId,
|
|
|
|
- // prodCount: cart[j].prodCount,
|
|
|
|
- // shopId: cart[j].shopId,
|
|
|
|
- // distributionCardNo: ""
|
|
|
|
- // }
|
|
|
|
- // this.confirm.addrId = this.defaultAddrId
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- for (let n = 0; n < this.basketIds.length; n++) {
|
|
|
|
- const cart = this.shopCartInfo[0].shopCartItemDiscounts[0].shopCartItems
|
|
|
|
-
|
|
|
|
- for (let j = 0; j < cart.length; j++) {
|
|
|
|
- if ( this.basketIds[n] !== cart[j].basketId ) {
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- this.confirm.basketIds.push(cart[j].basketId)
|
|
|
|
- this.confirm.orderItem = {
|
|
|
|
- prodId: cart[j].prodId,
|
|
|
|
- skuId: cart[j].skuId,
|
|
|
|
- prodCount: cart[j].prodCount,
|
|
|
|
- shopId: cart[j].shopId,
|
|
|
|
- distributionCardNo: ""
|
|
|
|
- }
|
|
|
|
- this.confirm.addrId = this.defaultAddrId
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
if ( this.basketIds.length <= 0 ) return ;
|
|
if ( this.basketIds.length <= 0 ) return ;
|
|
|
|
+ this.confirm.basketIds = this.basketIds
|
|
|
|
+ this.confirm.addrId = this.defaultAddrId
|
|
sessionStorage.setItem("confirm", JSON.stringify(this.confirm))
|
|
sessionStorage.setItem("confirm", JSON.stringify(this.confirm))
|
|
- //this.$router.push("/submitinfo")
|
|
|
|
|
|
+ this.$router.push("/submitinfo")
|
|
},
|
|
},
|
|
async init() {
|
|
async init() {
|
|
shopCartInfo({}).then(
|
|
shopCartInfo({}).then(
|