Commit b0368046 authored by zhengke's avatar zhengke

修改

parent 45d55ee3
<template>
<view
style="padding: 12px; padding-bottom: 0;width:100%;"
style="padding: 12px; padding-bottom: 0;width:100%;min-height:450rpx;"
:style="{
'background-color': goodsInfo.backgroundColor,
'background-image': goodsInfo.backgroundPicUrl,
......@@ -38,7 +38,7 @@
}}</view>
<view class="good-price-info">
<view class="price" :style="{'color':mainColor}">{{
goodsInfo.showGoodsPrice ? item.price : ""
goodsInfo.showGoodsPrice ? getPrice(item.price) : ""
}}</view>
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
<u-icon
......@@ -107,6 +107,19 @@ export default {
showSkuHandler(g){
this.sku=g
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];
}
},
};
......
......@@ -13,7 +13,7 @@
@change="changeHandler"
></u-tabs>
<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">
<search v-if="d.id == 'search'" :styleStr="d.data" :key="di"></search>
<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