微信小程序优化
parent
6b7b3b1109
commit
e3a6a45f5c
|
|
@ -60,8 +60,8 @@ App({
|
|||
|
||||
// 请求地址
|
||||
// request_url: "{{request_url}}",
|
||||
// request_url: 'http://tp5-dev.com/',
|
||||
request_url: 'https://test.shopxo.net/',
|
||||
request_url: 'http://tp5-dev.com/',
|
||||
//request_url: 'https://test.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"pages": ["pages/goods-detail/goods-detail",
|
||||
"pages": [
|
||||
"pages/index/index",
|
||||
"pages/goods-category/goods-category",
|
||||
"pages/cart/cart",
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
"pages/login/login",
|
||||
"pages/paytips/paytips",
|
||||
"pages/goods-search/goods-search",
|
||||
|
||||
"pages/goods-detail/goods-detail",
|
||||
"pages/goods-attribute/goods-attribute",
|
||||
"pages/buy/buy",
|
||||
"pages/user-address/user-address",
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.5 KiB |
|
|
@ -32,10 +32,11 @@ Page({
|
|||
show_field_price_text: null,
|
||||
|
||||
goods_video_is_autoplay: false,
|
||||
is_use_mobile_detail: 1,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
params['goods_id']=2;
|
||||
//params['goods_id']=2;
|
||||
this.setData({params: params});
|
||||
this.init();
|
||||
},
|
||||
|
|
@ -85,7 +86,7 @@ Page({
|
|||
autoplay: (data.goods.photo.length > 1),
|
||||
goods_photo: data.goods.photo,
|
||||
goods_specifications_choose: data.goods.specifications.choose || [],
|
||||
goods_content_app: data.goods.content_app,
|
||||
goods_content_app: data.goods.content_app || [],
|
||||
temp_buy_number: data.goods.buy_min_number || 1,
|
||||
goods_favor_text: (data.goods.is_favor == 1) ? '已收藏' : '收藏',
|
||||
goods_favor_icon: '/images/goods-detail-favor-icon-' + data.goods.is_favor+'.png',
|
||||
|
|
@ -100,6 +101,7 @@ Page({
|
|||
goods_spec_base_images: data.goods.images,
|
||||
|
||||
show_field_price_text: (data.goods.show_field_price_text == '销售价') ? null : (data.goods.show_field_price_text.replace(/<[^>]+>/g, "") || null),
|
||||
is_use_mobile_detail: data.is_use_mobile_detail || 0,
|
||||
});
|
||||
|
||||
// 不能选择规格处理
|
||||
|
|
|
|||
|
|
@ -16,13 +16,15 @@
|
|||
</swiper>
|
||||
|
||||
<!-- 视频 -->
|
||||
<view wx:if="{{goods_video_is_autoplay}}" class="goods-video">
|
||||
<video src="{{goods.video}}" autoplay="{{goods_video_is_autoplay}}" show-center-play-btn="{{true}}" controls="{{false}}" show-play-btn="{{false}}" enable-progress-gesture="{{false}}" show-fullscreen-btn="{{false}}"></video>
|
||||
</view>
|
||||
<view class="goods-video-submit">
|
||||
<text wx:if="{{!goods_video_is_autoplay}}" class="goods-video-play" bindtap="goods_video_play_event" type="primary">视频</text>
|
||||
<text wx:if="{{goods_video_is_autoplay}}" class="goods-video-close" bindtap="goods_video_close_event">关闭</text>
|
||||
</view>
|
||||
<block wx:if="{{goods.video.length > 0}}">
|
||||
<view wx:if="{{goods_video_is_autoplay}}" class="goods-video">
|
||||
<video src="{{goods.video}}" autoplay="{{goods_video_is_autoplay}}" show-center-play-btn="{{true}}" controls="{{false}}" show-play-btn="{{false}}" enable-progress-gesture="{{false}}" show-fullscreen-btn="{{false}}"></video>
|
||||
</view>
|
||||
<view class="goods-video-submit">
|
||||
<image wx:if="{{!goods_video_is_autoplay}}" class="goods-video-play" bindtap="goods_video_play_event" src="/images/goods-detail-video-play.png" mode="aspectFit"></image>
|
||||
<image wx:if="{{goods_video_is_autoplay}}" class="goods-video-close" bindtap="goods_video_close_event" src="/images/goods-detail-video-close.png" mode="aspectFit"></image>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<!-- 基础信息 -->
|
||||
<view class="goods-base bg-white">
|
||||
|
|
@ -53,17 +55,22 @@
|
|||
</view> -->
|
||||
|
||||
<!-- 商品详情 -->
|
||||
<view wx:if="{{goods_content_app.length > 0}}" class="goods-detail spacing">
|
||||
<view class="goods-detail spacing">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="line"></text>
|
||||
<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 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>
|
||||
<!-- web详情 -->
|
||||
<rich-text wx:if="{{is_use_mobile_detail == 0}}" nodes="{{goods.content_web || ''}}"></rich-text>
|
||||
<!-- 手机独立详情 -->
|
||||
<block wx:if="{{is_use_mobile_detail == 1 && goods_content_app.length > 0}}">
|
||||
<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 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>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 底线 -->
|
||||
|
|
|
|||
|
|
@ -233,22 +233,10 @@
|
|||
.goods-video-submit {
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
top: calc(65vh - 80rpx);
|
||||
top: calc(65vh - 110rpx);
|
||||
z-index: 2;
|
||||
}
|
||||
.goods-video-submit text {
|
||||
height: 56rpx;
|
||||
line-height: 56rpx !important;
|
||||
font-size: 24rpx;
|
||||
padding: 5rpx 20rpx;
|
||||
border-radius: 6rpx;
|
||||
background: #fff;
|
||||
}
|
||||
.goods-video-play {
|
||||
border: 1px solid #10a54a;
|
||||
color: #10a54a;
|
||||
}
|
||||
.goods-video-close {
|
||||
border: 1px solid #eee;
|
||||
color: #cb5757;
|
||||
}
|
||||
.goods-video-submit image {
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
}
|
||||
Loading…
Reference in New Issue