Commit b0368046 authored by zhengke's avatar zhengke

修改

parent 45d55ee3
<template> <template>
<view <view
style="padding: 12px; padding-bottom: 0;width:100%;" style="padding: 12px; padding-bottom: 0;width:100%;min-height:450rpx;"
:style="{ :style="{
'background-color': goodsInfo.backgroundColor, 'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl, 'background-image': goodsInfo.backgroundPicUrl,
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
}}</view> }}</view>
<view class="good-price-info"> <view class="good-price-info">
<view class="price" :style="{'color':mainColor}">{{ <view class="price" :style="{'color':mainColor}">{{
goodsInfo.showGoodsPrice ? item.price : "" goodsInfo.showGoodsPrice ? getPrice(item.price) : ""
}}</view> }}</view>
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)"> <view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
<u-icon <u-icon
...@@ -107,7 +107,20 @@ export default { ...@@ -107,7 +107,20 @@ export default {
showSkuHandler(g){ showSkuHandler(g){
this.sku=g this.sku=g
this.showSku=true this.showSku=true
} },
//格式化价格添加.00
getPrice(value){
var html,_val;
value =Number(value).toFixed(2);
if(value==0){
value=0;
return html = "¥0";
}else if(value.split('.')[1].substring(1)==0){
value = Number(value).toFixed(2);
}
_val = value.split('.');
return html = '¥'+_val[0]+'.'+_val[1];
}
}, },
}; };
</script> </script>
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
@change="changeHandler" @change="changeHandler"
></u-tabs> ></u-tabs>
<template v-for="(item, i) in myPageData.home_pages.navs"> <template v-for="(item, i) in myPageData.home_pages.navs">
<view :style="item.templateBg" :key="i" v-show="active == i"> <view :style="item.templateBg" :key="i" v-if="active == i">
<template v-for="(d, di) in item.template.data"> <template v-for="(d, di) in item.template.data">
<search v-if="d.id == 'search'" :styleStr="d.data" :key="di"></search> <search v-if="d.id == 'search'" :styleStr="d.data" :key="di"></search>
<swiper v-if="d.id == 'banner'" :swipers="d.data" :key="di"></swiper> <swiper v-if="d.id == 'banner'" :swipers="d.data" :key="di"></swiper>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment