Commit 3d831121 authored by zhengke's avatar zhengke

修改商品页

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