购物车总价修改

This commit is contained in:
THK3121 2023-09-12 10:07:27 +08:00
parent da17f1ac7f
commit 99ef4d1da6
3 changed files with 24 additions and 11 deletions

View File

@ -88,13 +88,14 @@
<swiper :autoplay="false" :active-class="activeClass" :interval="3000" class="swiper" <swiper :autoplay="false" :active-class="activeClass" :interval="3000" class="swiper"
:circular="true" previous-margin='280rpx' next-margin='280rpx' :current="current" :circular="true" previous-margin='280rpx' next-margin='280rpx' :current="current"
@change="test"> @change="test">
<swiper-item v-for="(item,index) in cloudList" :class="{active_swiper:index==current}"> <!-- :class="{active_swiper:index==current}" -->
<swiper-item v-for="(item,index) in cloudList" :key="index">
<u--image :showLoading="true" :src="item.background" width="175.23rpx" <u--image :showLoading="true" :src="item.background" width="175.23rpx"
height="175.23rpx"></u--image> height="175.23rpx"></u--image>
</swiper-item> </swiper-item>
</swiper> </swiper>
</view> </view>
<!-- 商品列表 -->
<transition name="fade"> <transition name="fade">
<view class="content"> <view class="content">
<view class="content_sift" :style="{position:pocls,top:(headtop+16)+'px'}" v-if="!showtit"> <view class="content_sift" :style="{position:pocls,top:(headtop+16)+'px'}" v-if="!showtit">
@ -150,7 +151,7 @@
<!-- <u-loadmore :status="status" /> --> <!-- <u-loadmore :status="status" /> -->
</view> </view>
</view> </view>
<!-- -->
<view v-else> <view v-else>
<view class="empty"> <view class="empty">
<view class="info"> <view class="info">
@ -159,7 +160,7 @@
</view> </view>
</view> </view>
</view> </view>
<!-- 购物车 -->
<view class="card" :style="`bottom:${appInfo.bottom}px`" <view class="card" :style="`bottom:${appInfo.bottom}px`"
@click="navgo('/pages/order_addcart/order_addcart')"> @click="navgo('/pages/order_addcart/order_addcart')">
<view class="left"> <view class="left">
@ -194,7 +195,6 @@
<!-- 组件 --> <!-- 组件 -->
<view<u-popup mode="right" :show="showPop" @close="showPop=false" @open="showPop=true"> <view<u-popup mode="right" :show="showPop" @close="showPop=false" @open="showPop=true">
<view class="pop"> <view class="pop">
<!-- <text>出淤泥而不染濯清涟而不妖</text> -->
<view style="height: var(--status-bar-height);"></view> <view style="height: var(--status-bar-height);"></view>
<view class="pop_head" style="display: flex;"> <view class="pop_head" style="display: flex;">
<u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx" <u--image :showLoading="true" src="/static/images/LHYC/PFH.png" width="50.82rpx"
@ -381,6 +381,7 @@
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
this.getCloundShop() this.getCloundShop()
this.getList() this.getList()
this.cartFn()
}, },
// onReachBottom() { // onReachBottom() {
// console.log("daidi") // console.log("daidi")
@ -389,9 +390,16 @@
methods: { methods: {
cartFn() { cartFn() {
getCartList().then(res => { getCartList().then(res => {
console.log(res)
this.totalMoney = 0
this.cartList = res.data.list this.cartList = res.data.list
this.cartList[0].list.forEach(e => { this.cartList.forEach(e => {
this.totalMoney = this.totalMoney + Number(e.productAttr.price) * e.cart_num this.totalMoney += e.list[0].cart_num * e.list[0].productAttr.price
// console.log(e.list[0].cart_num, e.list[0].productAttr.price)
// return
// console.log(e.list[0].cart_num, e.productAttr[0].price)
// this.totalMoney = this.totalMoney + Number(e.productAttr.price) * e.cart_num
// console.log(e.productAttr.price, e.cart_num)
}) })
}) })
getCartCounts().then(res => { getCartCounts().then(res => {

View File

@ -26,7 +26,8 @@
<u--image :showLoading="true" src="/static/images/LHYC/FH.png" width="50.82rpx" <u--image :showLoading="true" src="/static/images/LHYC/FH.png" width="50.82rpx"
height="50.82rpx" @click='goBack'></u--image> height="50.82rpx" @click='goBack'></u--image>
<view class="head_tit"> <view class="head_tit">
{{town}}里海云仓 <!-- {{town}}里海云仓 -->
{{a}}
</view> </view>
</view> </view>
<view class="head_r" @click="showPop=true"> <view class="head_r" @click="showPop=true">
@ -273,6 +274,7 @@
data() { data() {
let src = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/13'; let src = 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/13';
return { return {
a: "",
trnList: [], trnList: [],
act_cart: false, act_cart: false,
appInfo: {}, appInfo: {},
@ -467,6 +469,9 @@
}, },
addcart(i) { addcart(i) {
let that = this let that = this
console.log((this.$refs.jia[i]))
this.a = this.$refs.jia[i]
return
uni.createSelectorQuery().in(this).select(`.act_class${i}`).boundingClientRect(data1 => { uni.createSelectorQuery().in(this).select(`.act_class${i}`).boundingClientRect(data1 => {
that.trnList[i].left = this.cartTagInfo.left - data1.left + 'px'; that.trnList[i].left = this.cartTagInfo.left - data1.left + 'px';
that.trnList[i].bottom = this.cartTagInfo.top - data1.top + 'px'; that.trnList[i].bottom = this.cartTagInfo.top - data1.top + 'px';

View File

@ -1218,9 +1218,9 @@
padding: 0 30rpx; padding: 0 30rpx;
box-sizing: border-box; box-sizing: border-box;
border-top: 1px solid #eee; border-top: 1px solid #eee;
bottom: 98rpx; bottom: 40px;
bottom: calc(98rpx + constant(safe-area-inset-bottom)); /// IOS<11.2/ bottom: calc(40px + constant(safe-area-inset-bottom)); /// IOS<11.2/
bottom: calc(98rpx + env(safe-area-inset-bottom)); /// IOS>11.2/ bottom: calc(40px + env(safe-area-inset-bottom)); /// IOS>11.2/
} }
.shoppingCart .footer.on { .shoppingCart .footer.on {