代码更新
This commit is contained in:
@@ -2,15 +2,13 @@
|
||||
<view class="u-relative u-flex item">
|
||||
|
||||
<up-image :src="data.coverImg" mode="aspectFill" :width="img.width" :height="img.height"></up-image>
|
||||
<!-- <image lazy-load class="img" :src="data.coverImg" mode="aspectFill" :style="computedImgStyle()"></image> -->
|
||||
<view class="info u-flex u-row-between u-col-top u-flex-col">
|
||||
<view>
|
||||
<view>
|
||||
<text class="u-line-2">{{data.name}}
|
||||
</text>
|
||||
<text class="u-line-2">{{data.name}}</text>
|
||||
</view>
|
||||
<view class="u-font-32 font-bold u-m-t-16">
|
||||
¥{{data.price}}
|
||||
¥{{data.lowPrice}}
|
||||
</view>
|
||||
<template v-if="data.type=='weigh'">
|
||||
<view class="btnweigh">称重</view>
|
||||
@@ -18,7 +16,7 @@
|
||||
</view>
|
||||
<view class="u-flex">
|
||||
<template v-if="!isSellout">
|
||||
<template v-if="!data.isDan||data.groupType==1">
|
||||
<template v-if="data.type == 'sku'||data.groupType==1">
|
||||
<button class="btn" hover-class="btn-hover-class" @tap="emitEvent('chooseGuige')">选规格</button>
|
||||
</template>
|
||||
<template v-else>
|
||||
@@ -84,27 +82,23 @@
|
||||
}
|
||||
})
|
||||
|
||||
function computedImgStyle() {
|
||||
return {
|
||||
width: props.img.width,
|
||||
height: props.img.height
|
||||
}
|
||||
}
|
||||
|
||||
//判断是否是菜品
|
||||
/**
|
||||
* 判断是否是菜品
|
||||
*/
|
||||
function isGoods() {
|
||||
return props.data.hasOwnProperty('id')
|
||||
}
|
||||
|
||||
//判断商品是否售尽
|
||||
/**
|
||||
* 判断商品是否售尽
|
||||
*/
|
||||
const isSellout = computed(() => {
|
||||
const item = props.data
|
||||
if (!isGoods()) {
|
||||
return false
|
||||
}
|
||||
return (
|
||||
item.isPauseSale ||
|
||||
(item.typeEnum !== "sku" && item.isStock == 1 && item.stockNumber <= 0)
|
||||
item.isPauseSale || (item.type !== "sku" && item.isStock == 1 && item.stockNumber <= 0)
|
||||
);
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user