地址修改 购物车修改

This commit is contained in:
@fawn-nine
2024-07-02 14:44:24 +08:00
parent 327e96d7cd
commit 5b3f61e90a
7 changed files with 17 additions and 15 deletions

View File

@@ -20,7 +20,7 @@
<view v-for="(item, index) in argee" :key="index" style="font-size: 32rpx;">
<radio class="agreeRadio" :value="item.id" :checked="item.id == radioValue"
color="#258feb" @click="radioCheck(index)"></radio>
默认收地址
默认收地址
</view>
</radio-group>
</view>

View File

@@ -128,7 +128,7 @@ import { mapState } from "vuex";
export default {
components: {
courseDescription, //课程说明
editAddress, //编辑收地址
editAddress, //编辑收地址
},
props: ["backState", "type"],
data() {

View File

@@ -206,12 +206,13 @@
},
// 加入到购物车
isAddLink(item) {
console.log('传入购物车',item);
// 统计商品信息
let data = {
"userId": this.userInfo.id,
"productId": item.productId,
"productAmount": this.productAmount,
"price": item.price
"productAmount": 1,
"price": item.activityPrice && item.activityPrice != 0 ? item.activityPrice : item.price
}
// 判断列表是否为空
if (this.cartList.length > 0) {
@@ -284,6 +285,7 @@
},
oprate(data) {
console.log(data, '得到的内容')
if (data.name == 'buy') {
this.buy(data.item)
} else if (data.name == 'gouwuche') {

View File

@@ -318,8 +318,8 @@
let data = {
"userId": this.userInfo.id,
"productId": item.productId,
"productAmount": this.productAmount,
"price": item.price
"productAmount": 1,
"price": item.activityPrice && item.activityPrice != 0 ? item.activityPrice : item.price
}
// 判断列表是否为空
if (this.cartList.length > 0) {

View File

@@ -717,8 +717,8 @@
let data = {
"userId": this.userInfo.id,
"productId": item.productId,
"productAmount": this.productAmount,
"price": item.price
"productAmount": 1,
"price": item.activityPrice && item.activityPrice != 0 ? item.activityPrice : item.price
}
// 判断列表是否为空
if (this.cartList.length > 0) {

View File

@@ -40,7 +40,7 @@
</view>
<view class="normal_box" v-else>
<view class="normal_box_top">
<view class="curriulum_title">请添加收地址 </view>
<view class="curriulum_title">请添加收地址 </view>
</view>
</view>
<view class="right">

View File

@@ -1,16 +1,16 @@
<template>
<view>
<z-nav-bar backState="2000" title="购物车">
<view class="curseSet" slot="right" @click="manaCart = !manaCart" style="margin-right: 10px;">
<!-- <view class="curseSet" slot="right" @click="manaCart = !manaCart" style="margin-right: 10px;">
<text v-show="!manaCart">管理</text>
<text v-show="manaCart">完成</text>
</view>
</view> -->
</z-nav-bar>
</z-nav-bar>
<view class="shopCarContent">
<scroll-view scroll-y="true">
<view class="cartItem" v-for="(item,index) in cartList" :key="index">
<view class="select" v-show="manaCart">
<view class="select" >
<checkbox :checked="item.checked" @click="checkboxGroupChange(index,item)"
class="round checkedItem" />
</view>
@@ -22,7 +22,7 @@
<text>{{item.productName}}</text>
</view>
<view class="itemPrice">
<text v-if="item.activityPrice && item.activityPrice > 0">{{item.activityPrice*item.productAmount}}</text>
<text v-if="item.activityPrice && item.activityPrice > 0">-{{item.activityPrice*item.productAmount}}</text>
<text v-else>{{item.price*item.productAmount}}</text>
<u-number-box v-model="item.productAmount" @change="valChange($event,item)" :input-width="50"
:input-height="20" :min="1" :max="item.productStock" integer @overlimit='overlimit'></u-number-box>
@@ -125,7 +125,7 @@
// }
this.isCartDelShow = this.all
this.total()
this.manaCart = this.all
// this.manaCart = this.all
} else {
this.all = false
@@ -230,7 +230,7 @@
this.totalPrice = 0
this.getCartList()
uni.hideLoading()
this.manaCart = false
// this.manaCart = false
})
} else {
console.log('cancel') //点击取消之后执行的代码