This commit is contained in:
魏啾
2024-08-03 15:42:56 +08:00
3 changed files with 425 additions and 352 deletions

View File

@@ -52,14 +52,14 @@
<view class="title"> {{ listinfo.name }} </view>
<view class="list_item" v-for="(item,index) in listinfo.details" :key="item.id">
<view class="left">
<image class="img" :src="item.coverImg" mode="aspectFill"/>
<image class="img" :src="item.coverImg || item.productImg || ''" mode="aspectFill"/>
<view class="center">
<text class="center_title"> {{item.name}} </text>
<text class="type"> {{ item.skuName}} </text>
<text class="num"> X{{ item.totalNumber}} </text>
<text class="center_title"> {{item.name || item.productName || "" }} </text>
<text class="type"> {{ item.skuName || item.productSkuName || ""}} </text>
<text class="num"> X{{ item.totalNumber || item.num}} </text>
</view>
</view>
<view class="price"> {{ item.totalAmount}} </view>
<view class="price"> {{ item.totalAmount || item.priceAmount || 0}} </view>
</view>
<!-- <view class="favorable" v-for="(item,index) in favorable" :key="index">
<view class="favorable_left">
@@ -122,7 +122,7 @@
<view class="pay-info-wrap">
<view class="info-wrap flex-between">
<view class="close" @click="ispws = false">
<u-icon name="close" color="#999999" size="28"></u-icon>
<u-icon name="close" color="#999999" size="40"></u-icon>
</view>
<text class="title">请输入支付密码</text>
<view></view>
@@ -242,6 +242,9 @@
switch (msg.type) {
case 'createOrder':
this.listinfoid = msg.data.id
console.log(msg)
this.listinfo.details = msg.data.detailList;
this.listinfo.payAmount = msg.data.amount;
uni.$off('getMessage')
this.orderorderInfo(1)
break;
@@ -968,7 +971,7 @@
padding: 0;
box-sizing: border-box;
.info-wrap{
padding: 30rpx;
padding: 64rpx 30rpx 30rpx 30rpx;
box-sizing: border-box;
.title{
align-self: center;

File diff suppressed because it is too large Load Diff

View File

@@ -289,12 +289,12 @@
<view class="btn"
@click="shopAdd(specifications,specifications.indexa,specifications.indexb,'-',specifications.tagSnap == null ? '单规格':'')">
<u-icon name="minus-circle-fill" color="#E9AB7A" size="40"></u-icon>
<u-icon name="minus-circle-fill" color="#E9AB7A" size="50"></u-icon>
</view>
<text class="num">{{amountcartNumber}}</text>
<view class="btn"
@click="shopAdd(specifications,specifications.indexa,specifications.indexb,'+',specifications.tagSnap == null ? '单规格':'')">
<u-icon name="plus-circle-fill" color="#E9AB7A" size="40"></u-icon>
<u-icon name="plus-circle-fill" color="#E9AB7A" size="50"></u-icon>
</view>
</view>
</view>
@@ -393,6 +393,7 @@
this.fixedtrue = true
},
onShow() {
console.log(!uni.cache.get('token'))
if (!uni.cache.get('token')) {
uni.login({
provider: 'weixin',
@@ -506,18 +507,19 @@
* @param {Object} b
*/
shopAdd(item, index, index1, a, b) {
if (a == "+") {
if (this.skuNumber < this.skuSuit) {
this.amountcartNumber = this.amountcartNumber + (item.suit == 0 ? 1 : item.suit);
} else {
if ( a == "+" ){
if ( this.skuNumber < this.skuSuit && this.amountcartNumber < this.skuSuit) {
this.amountcartNumber = this.amountcartNumber + (this.skuSuit==0?1:this.skuSuit);
}else {
this.amountcartNumber++;
}
} else {
if (this.amountcartNumber > 0) {
console.log(item)
if (this.skuNumber < this.skuSuit) {
this.amountcartNumber = this.amountcartNumber - (item.suit == 0 ? 1 : item.suit);
if ( this.skuNumber < this.skuSuit && this.amountcartNumber <= this.skuSuit) {
this.amountcartNumber = this.amountcartNumber - (this.skuSuit==0?1:this.skuSuit);
} else {
this.amountcartNumber = this.amountcartNumber - 1;
}
@@ -721,7 +723,7 @@
this.addCart(params);
} else {
this.skuId = res.data.id;
this.skuNumber = res.data.number;
this.skuNumber = res.data.number||0;
this.skuSuit = res.data.suit;
this.showShopsku = true //打开弹框
}
@@ -785,9 +787,12 @@
case 'sku': // sku 数量 查询这个商品的价格和数量
break;
case 'order':
this.skuidname = []
this.showCart = false
this.cartLists = msg
this.cartLists_count = 0;
this.skuidname = [];
this.cartListsdatashow = false;
this.showCart = false;
this.cartLists = msg;
this.productqueryProduct() //list 数据
break;
case 'addCart': //初始化add
this.cartLists = msg