6
0
Fork 0

修改样式

hui.zhou
H 2022-07-27 10:07:28 +08:00
parent ee5a00e867
commit 7b1cc19c89
2 changed files with 17 additions and 4 deletions

View File

@ -3,10 +3,18 @@
<u-image class="flex-none" width="190" height="190" border-radius="10" :src="goods.cover" :lazy-load="true"> <u-image class="flex-none" width="190" height="190" border-radius="10" :src="goods.cover" :lazy-load="true">
</u-image> </u-image>
<view class="flex-1 ml-15rpx"> <view class="flex-1 ml-15rpx">
<view class="line-1 w-full text-txBase">{{goods.name}}</view> <view class="flex justify-between">
<view class="price-text flex-1 text-txBase text-md mt-30rpx">{{goods.sell_price}}</view> <view class=" flex-1 flex-none">
<view class="line-1 w-full text-txBase">{{goods.name}}</view>
<view class="price-text flex-1 text-txBase text-md mt-30rpx">{{goods.sell_price}}</view>
</view>
<view class="flex-1 w-0 line-1 ml-20rpx text-right ">
{{ specs.join(' ')}}
</view>
</view>
<view class="flex items-center justify-between mt-30rpx flex-1"> <view class="flex items-center justify-between mt-30rpx flex-1">
<view class="text-txBase text-md price-text">{{goods.vip_price}} vip</view> <view class="text-txBase text-md price-text">{{goods.vip_price}} vip</view>
<view v-if="isAdd" class="bg-hex-ef4444 text-center px-20rpx py-8rpx text-white rounded-10rpx" @click="add"></view> <view v-if="isAdd" class="bg-hex-ef4444 text-center px-20rpx py-8rpx text-white rounded-10rpx" @click="add"></view>
<view v-else> <view v-else>
<u-number-box :min="1" v-model="goods.num" @change="valChange"> <u-number-box :min="1" v-model="goods.num" @change="valChange">
@ -28,6 +36,11 @@
default:()=>{} default:()=>{}
} }
}, },
computed:{
specs(){
return this.goods?.specs??[]
}
},
methods:{ methods:{
// //
add(){ add(){

View File

@ -95,14 +95,14 @@
const total = this.chooseList.reduce((pr, cu) => { const total = this.chooseList.reduce((pr, cu) => {
return pr + cu.sell_price * cu.num return pr + cu.sell_price * cu.num
}, 0) }, 0)
return total return total.toFixed(2)
}, },
// //
vipPrice() { vipPrice() {
const total = this.chooseList.reduce((pr, cu) => { const total = this.chooseList.reduce((pr, cu) => {
return pr + cu.vip_price * cu.num return pr + cu.vip_price * cu.num
}, 0) }, 0)
return total return total.toFixed(2)
}, },
goodsList(){ goodsList(){
return this.list?.map(e=>{ return this.list?.map(e=>{