Commit 3d831121 authored by zhengke's avatar zhengke

修改商品页

parent 5723292a
This diff is collapsed.
......@@ -46,7 +46,7 @@
</div>
<div class="good-price-info">
<span class="price" :style="{ color: mainColor }">{{
goodsInfo.showGoodsPrice ? item.price : ""
goodsInfo.showGoodsPrice ? getPrice(item.price) : ""
}}</span>
<span class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
<u-icon
......
......@@ -43,7 +43,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">
<u-icon
......
......@@ -43,7 +43,7 @@
</div>
<div 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
......
......@@ -109,18 +109,18 @@ export default {
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];
}
// 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>
......
......@@ -40,9 +40,9 @@
</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">
<view class="buy" v-if="goodsInfo.showBuyBtn" @click.stop="showSkuHandler(item)">
<u-icon
name="cart-o"
size="40"
......@@ -78,17 +78,22 @@
</view>
</view>
</view>
<view style="color:rgba(0,0,0,0);font-size:12px;">0</view>
<good-sku v-if="showSku" :option-type="2" borderRadius="20" v-model="showSku" :good="sku"></good-sku>
</view>
</template>
<script>
import goodSku from '../goods/goodsku'
export default {
components:{
goodSku
},
props: ["goodList", "goodsInfo"],
data() {
return {
mainColor: "",
activeKey: 0,
showSku:false,
sku:{}
};
},
created() {
......@@ -98,6 +103,10 @@ export default {
openGood(e) {
console.log(e);
},
showSkuHandler(g){
this.sku=g
this.showSku=true
},
},
};
</script>
......
......@@ -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">
<u-icon
......
......@@ -44,9 +44,9 @@ export default {
'content-type': "application/json"
},
data: {
"MallBaseId": 1,
"TenantId": 1,
"OpenId": this.GetOpenId().OpenId,
MallBaseId: 1,
TenantId: 1,
OpenId: this.GetOpenId().OpenId,
UserId:this.GetOpenId().UserId,
MiniAppId: this.GetMiniAppId(),
msg: param.data
......@@ -97,6 +97,11 @@ export default {
return str;
}
}
//价格返回.00
Vue.prototype.getPrice = function(val){
val =Number(val).toFixed(2);
return val
}
Vue.prototype.apiheader = function() {
return {
......
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