商品详情图片缝隙,小程序适配icon价格展示

This commit is contained in:
gongfuxiang 2019-06-19 00:44:11 +08:00
parent 9b7ff621f9
commit 4efe3e5b43
8 changed files with 38 additions and 6 deletions

View File

@ -1309,7 +1309,7 @@ class GoodsService
{
return DataReturn('请填写有效的规格销售价格', -1);
}
if(empty($data[0][1]))
if(!isset($data[0][1]) || $data[0][1] < 0)
{
return DataReturn('请填写规格库存', -1);
}

View File

@ -195,4 +195,15 @@
}
.page {
padding-bottom: 100rpx;
}
/*
* 价格icon
*/
.price-icon {
background:#FF5722;
color:#fff;
padding:2px 5px;
line-height:20px;
border-radius:1px;
}

View File

@ -27,6 +27,7 @@
</view>
</view>
<view class="goods-price single-text">
<text a:if="{{(show_field_price_text || null) != null}}" class="price-icon">{{show_field_price_text}}</text>
<text class="sales-price">¥{{goods.price}}</text>
<text a:if="{{(goods.original_price || null) != null}}" class="original-price">¥{{goods.original_price}}</text>
<view class="cr-ccc sales">
@ -49,7 +50,7 @@
<text class="text-wrapper">详情</text>
</view>
<view a:for="{{goods_content_app}}" class="goods-detail-app bg-white">
<image a:if="{{(item.images || null) != null}}" onTap="goods_detail_images_view_event" data-value="{{item.images}}" class="wh-auto" src="{{item.images}}" mode="widthFix" />
<image a:if="{{(item.images || null) != null}}" onTap="goods_detail_images_view_event" data-value="{{item.images}}" class="wh-auto dis-block" src="{{item.images}}" mode="widthFix" />
<view a:if="{{(item.content || null) != null}}" class="content-items">
<view a:for="{{item.content}}" a:for-item="items">{{items}}</view>
</view>

View File

@ -28,6 +28,8 @@ Page({
goods_spec_base_original_price: 0,
goods_spec_base_inventory: 0,
goods_spec_base_images: '',
show_field_price_text: null,
},
onLoad(params) {
@ -93,7 +95,9 @@ Page({
goods_spec_base_price: data.goods.price,
goods_spec_base_original_price: data.goods.original_price,
goods_spec_base_inventory: data.goods.inventory,
goods_spec_base_images: data.goods.images
goods_spec_base_images: data.goods.images,
show_field_price_text: data.goods.show_field_price_text.replace(/<[^>]+>/g, "") || null,
});
// 不能选择规格处理

View File

@ -28,6 +28,8 @@ Page({
goods_spec_base_original_price: 0,
goods_spec_base_inventory: 0,
goods_spec_base_images: '',
show_field_price_text: null,
},
onLoad(params) {
@ -93,7 +95,9 @@ Page({
goods_spec_base_price: data.goods.price,
goods_spec_base_original_price: data.goods.original_price,
goods_spec_base_inventory: data.goods.inventory,
goods_spec_base_images: data.goods.images
goods_spec_base_images: data.goods.images,
show_field_price_text: data.goods.show_field_price_text.replace(/<[^>]+>/g, "") || null,
});
// 不能选择规格处理

View File

@ -27,6 +27,7 @@
</view>
</view>
<view class="goods-price single-text">
<text wx:if="{{(show_field_price_text || null) != null}}" class="price-icon">{{show_field_price_text}}</text>
<text class="sales-price">¥{{goods.price}}</text>
<text wx:if="{{(goods.original_price || null) != null}}" class="original-price">¥{{goods.original_price}}</text>
<view class="cr-ccc sales">
@ -49,7 +50,7 @@
<text class="text-wrapper">详情</text>
</view>
<view wx:for="{{goods_content_app}}" wx:key="key" class="goods-detail-app bg-white">
<image wx:if="{{(item.images || null) != null}}" bindtap="goods_detail_images_view_event" data-value="{{item.images}}" class="wh-auto" src="{{item.images}}" mode="widthFix" />
<image wx:if="{{(item.images || null) != null}}" bindtap="goods_detail_images_view_event" data-value="{{item.images}}" class="wh-auto dis-block" src="{{item.images}}" mode="widthFix" />
<view wx:if="{{(item.content || null) != null}}" class="content-items">
<view wx:for="{{item.content}}" wx:for-item="items">{{items}}</view>
</view>

View File

@ -202,4 +202,15 @@
}
.page {
padding-bottom: 100rpx;
}
/*
* 价格icon
*/
.price-icon {
background:#FF5722;
color:#fff;
padding:2px 5px;
line-height:20px;
border-radius:1px;
}

View File

@ -14,7 +14,6 @@ time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
font-family: arial,"Lantinghei SC","Microsoft Yahei";
font-style: normal;
}
@ -649,6 +648,7 @@ ul.am-dropdown-content > .am-active > a:focus,
max-width: 100px;
max-height: 45px;
padding: 5px;
line-height: 30px;
}
.shop-navigation .wap-logo img {
max-width: 100%;