goods-detail.ttml 12.3 KB
Newer Older
D
Devil 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
<view tt:if="{{goods != null}}" class="page">
  <!-- 轮播图片 -->
  <swiper
    indicator-dots="{{indicator_dots}}"
    indicator-color="{{indicator_color}}"
    indicator-active-color="{{indicator_active_color}}"
    autoplay="{{autoplay}}"
    circular="{{circular}}"
    class="goods-photo bg-white"
    tt:if="{{goods_photo.length > 0}}">
    <block tt:for="{{goods_photo}}" tt:key="key">
      <swiper-item>
        <image class="swiper-item wh-auto" bindtap="goods_photo_view_event" data-index="{{index}}" src="{{item.images}}" mode="aspectFit" bindtap="goods_photo_view_event" />
      </swiper-item>
    </block>
  </swiper>

  <!-- 视频 -->
  <block tt:if="{{goods.video.length > 0}}">
    <view tt: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 tt: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 tt: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-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>

  <!-- 限时秒杀 -->
D
devil 已提交
33
  <view tt:if="{{plugins_limitedtimediscount_is_valid == 1}}">
D
Devil 已提交
34 35 36 37
    <import src="/pages/lib/limitedtimediscount/goods-detail.ttml" />
    <template is="limitedtimediscount" data="{{plugins_limitedtimediscount_data: plugins_limitedtimediscount_data, plugins_limitedtimediscount_is_show_time: plugins_limitedtimediscount_is_show_time, plugins_limitedtimediscount_time_millisecond: plugins_limitedtimediscount_time_millisecond}}"></template>
  </view>

D
devil 已提交
38
  <!-- 基础信息 -->
D
Devil 已提交
39 40
  <view class="goods-base bg-white">
    <view class="goods-price single-text">
D
devil_gong 已提交
41 42 43 44 45
      <view class="goods-share tc">
        <button type="default" size="mini" open-type="share" hover-class="none">
          <image src="/images/goods-detail-share-icon.png" mode="scaleToFill" class="dis-block" />
          <view class="cr-888">分享</view>
        </button>
D
Devil 已提交
46 47
      </view>
      <text tt:if="{{(show_field_price_text || null) != null}}" class="price-icon">{{show_field_price_text}}</text>
D
devil 已提交
48 49
      <text class="sales-price">{{currency_symbol}}{{goods.price}}</text>
      <view tt:if="{{(goods.original_price || null) != null && goods.original_price != '0.00'}}" class="original-price">{{currency_symbol}}{{goods.original_price}}</view>
D
Devil 已提交
50
    </view>
D
devil 已提交
51
    <view class="base-grid br-t-dashed oh">
D
Devil 已提交
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
      <view class="fl tl">
        <text class="cr-888">累计销量</text>
        <text class="cr-main">{{goods.sales_count}}</text>
      </view>
      <view class="fl tc">
        <text class="cr-888">浏览次数</text>
        <text class="cr-main">{{goods.access_count}}</text>
      </view>
      <view class="fl tr">
        <navigator url="/pages/goods-comment/goods-comment?goods_id={{goods.id}}" hover-class="none">
          <text class="cr-888">累计评论</text>
          <text class="cr-main">{{goods.comments_count}}</text>
        </navigator>
      </view>
    </view>
  </view>

D
devil 已提交
69 70 71 72 73 74 75 76 77 78 79 80
  <!-- 商品基础参数 -->
  <view tt:if="{{(goods.parameters || null) != null && goods.parameters.base.length > 0}}" class="goods-parameters parameters-base br-t-dashed bg-white">
    <view class="content-item oh">
      <block tt:for="{{goods.parameters.base}}" tt:key="item">
        <view class="item single-text">
          <text class="name">{{item.name}}:</text>
          <text class="value">{{item.value}}</text>
        </view>
      </block>
    </view>
  </view>

D
Devil 已提交
81 82 83 84 85 86 87
  <!-- 优惠劵 -->
  <view tt:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.data.length > 0}}" class="coupon-container wh-auto spacing-mt bg-white">
    <scroll-view scroll-x="true">
      <block tt:for="{{plugins_coupon_data.data}}" tt:key="item">
        <view class="item bg-white {{item.is_operable == 0 ? 'item-disabled' : ''}}" style="border:1px solid {{item.bg_color_value}};">
          <view class="v-left fl">
            <view class="base single-text" style="color:{{item.bg_color_value}};">
D
devil 已提交
88
              <text tt:if="{{item.type == 0}}" class="symbol">{{currency_symbol}}</text>
D
Devil 已提交
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
              <text class="price">{{item.discount_value}}</text>
              <text class="unit">{{item.type_unit}}</text>
            </view>
            <view tt:if="{{(item.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.use_limit_type_name}}</view>
            <view tt:if="{{(item.desc || null) != null}}" class="desc cr-888 single-text">{{item.desc}}</view>
          </view>
          <view class="v-right fr" bindtap="coupon_receive_event" data-index="{{index}}" data-value="{{item.id}}" style="background:{{item.bg_color_value}};">
            <text class="circle"></text>
            <text>{{item.is_operable_name}}</text>
          </view>
        </view>
      </block>
    </scroll-view>
  </view>

D
devil 已提交
104 105 106 107 108
  <!-- 商品详情参数 -->
  <view tt:if="{{(goods.parameters || null) != null && goods.parameters.detail.length > 0}}" class="goods-parameters spacing-mt bg-white">
    <view class="spacing-nav-title">
      <text class="line"></text>
      <text class="text-wrapper">商品参数</text>
D
Devil 已提交
109
    </view>
D
devil 已提交
110 111 112 113 114 115 116 117 118
    <view class="content-item oh">
      <block tt:for="{{goods.parameters.detail}}" tt:key="item">
        <view class="item single-text">
          <text class="name">{{item.name}}:</text>
          <text class="value">{{item.value}}</text>
        </view>
      </block>
    </view>
  </view>
D
Devil 已提交
119 120

  <!-- 商品详情 -->
D
devil 已提交
121
  <view class="goods-detail spacing-mt bg-white">
D
Devil 已提交
122 123
    <view class="spacing-nav-title">
      <text class="line"></text>
D
devil 已提交
124
      <text class="text-wrapper">商品详情</text>
D
Devil 已提交
125
    </view>
D
devil 已提交
126 127 128 129
    <view class="spacing">
      <!-- 是否详情展示相册 -->
      <block tt:if="{{common_is_goods_detail_show_photo == 1 && goods_photo.length > 0}}">
        <view tt:for="{{goods_photo}}" tt:key="key" class="goods-detail-photo">
D
Devil 已提交
130
          <image tt: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" />
D
devil 已提交
131 132 133 134 135
        </view>
      </block>
      <!-- web详情 -->
      <view tt:if="{{common_app_is_use_mobile_detail == 0}}">
        <rich-text nodes="{{goods.content_web || ''}}"></rich-text>
D
Devil 已提交
136
      </view>
D
devil 已提交
137 138 139 140 141 142 143 144 145 146
      <!-- 手机独立详情 -->
      <block tt:if="{{common_app_is_use_mobile_detail == 1 && goods_content_app.length > 0}}">
        <view tt:for="{{goods_content_app}}" tt:key="key" class="goods-detail-app">
            <image tt: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 tt:if="{{(item.content || null) != null}}" class="content-items">
              <view tt:for="{{item.content}}" tt:for-item="items">{{items}}</view>
            </view>
        </view>
      </block>
    </view>
D
Devil 已提交
147 148 149 150 151 152 153 154
  </view>

  <!-- 底线 -->
  <import src="/pages/common/bottom_line.ttml" />
  <template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>

  <!-- 底部操作 -->
  <view class="goods-buy-nav wh-auto bg-white">
D
devil 已提交
155
    <view class="shop fl tc br-t" bindtap="shop_event">
D
Devil 已提交
156 157 158
      <image src="/images/goods-detail-home-icon.png" mode="scaleToFill" />
      <text class="dis-block cr-888">首页</text>
    </view>
D
devil 已提交
159
    <view class="collect fl tc br-t" bindtap="goods_favor_event">
D
Devil 已提交
160 161 162
      <image src="{{goods_favor_icon}}" mode="scaleToFill" />
      <text class="dis-block cr-888">{{goods_favor_text}}</text>
    </view>
D
devil 已提交
163
    <view class="fr {{(common_site_type == 1 || ((is_goods_site_type_consistent || 0) != 1 && common_site_type != 1)) ? 'buy-nav-submit-full' : ''}}">
D
devil_gong 已提交
164
      <!-- 站点模式 1 展示型 -->
D
devil_gong 已提交
165
      <block tt:if="{{common_site_type == 1}}">
D
devil_gong 已提交
166 167 168
        <button class="bg-main fl" type="default" bindtap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
      </block>

D
devil_gong 已提交
169
      <!-- 销售型,自提点,虚拟销售 -->
D
devil_gong 已提交
170
      <block tt:else>
D
devil 已提交
171
        <button tt:if="{{(is_goods_site_type_consistent || 0) == 1}}" class="bg-warning fl" type="default" bindtap="cart_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">加入购物车</button>
D
devil_gong 已提交
172 173
        <button class="bg-main fl" type="default" bindtap="buy_submit_event" hover-class="none" disabled="{{nav_submit_is_disabled}}">{{nav_submit_text}}</button>
      </block>
D
Devil 已提交
174 175 176 177 178 179 180 181 182 183 184 185 186
    </view>
  </view>

  <!-- 购买弹层 -->
  <component-popup prop-show="{{popup_status}}" prop-position="bottom" bindonclose="popup_close_event">
    <view class="goods-popup bg-white">
      <view class="close fr oh">
        <view class="fr" catchtap="popup_close_event">
          <icon type="clear" size="20" />
        </view>
      </view>
      <!-- 规格基础信息 -->
      <view class="goods-popup-base oh br-b">
D
devil 已提交
187
        <image src="{{goods_spec_base_images}}" mode="scaleToFill" class="br" bindtap="goods_detail_images_view_event" data-value="{{goods_spec_base_images}}" />
D
Devil 已提交
188 189
        <view class="goods-popup-base-content">
          <view class="goods-price">
D
devil 已提交
190 191
            <view class="sales-price">{{currency_symbol}}{{goods_spec_base_price}}</view>
            <view tt:if="{{(goods_spec_base_original_price || null) != null && goods_spec_base_original_price > 0}}" class="original-price">{{currency_symbol}}{{goods_spec_base_original_price}}</view>
D
Devil 已提交
192 193 194 195 196 197 198 199 200 201
          </view>
          <view class="inventory">
            <text class="cr-888">库存</text>
            <text class="cr-666">{{goods_spec_base_inventory}}</text>
            <text class="cr-888">{{goods.inventory_unit}}</text>
          </view>
        </view>
      </view>

      <view class="goods-popup-content">
D
devil 已提交
202 203
        <!-- 商品规格 -->
        <view tt:if="{{goods_specifications_choose.length > 0}}" class="goods-spec-choose">
D
Devil 已提交
204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
          <view tt:for="{{goods_specifications_choose}}" tt:key="key" tt:for-index="key" class="item br-b">
            <view class="title">{{item.name}}</view>
            <view tt:if="{{item.value.length > 0}}" class="spec">
              <block tt:for="{{item.value}}" tt:key="key" tt:for-index="keys" tt:for-item="items">
                <button catchtap="goods_specifications_event" data-key="{{key}}" data-keys="{{keys}}" type="default" size="mini" hover-class="none" class="{{items.is_active}} {{items.is_dont}} {{items.is_disabled}}">
                  <image tt:if="{{(items.images || null) != null}}" src="{{items.images}}" mode="scaleToFill" />
                  {{items.name}}
                </button>
              </block>
            </view>
          </view>
        </view>

        <!-- 购买数量 -->
        <view class="goods-buy-number oh">
          <view class="title fl">购买数量</view>
          <view class="number-content tc oh">
            <view bindtap="goods_buy_number_event" class="number-submit tc cr-888 fl" data-type="0">-</view>
            <input bindblur="goods_buy_number_blur" class="tc cr-888 fl" type="number" value="{{temp_buy_number}}" />
            <view bindtap="goods_buy_number_event" class="number-submit tc cr-888 fl" data-type="1">+</view>
          </view>
        </view>
      </view>
      <button class="goods-popup-submit bg-main" type="default" catchtap="goods_buy_confirm_event" hover-class="none">确定</button>
    </view>
  </component-popup>
</view>

<view tt:if="{{goods == null}}">
    <import src="/pages/common/nodata.ttml" />
    <template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>

D
devil 已提交
237 238 239 240 241 242
<!-- 在线客服 -->
<view tt:if="{{common_app_is_online_service == 1}}">
  <import src="/pages/lib/online-service/content.ttml" />
  <template is="online_service"></template>
</view>

D
Devil 已提交
243 244 245 246 247 248 249 250
<!-- 购物车 -->
<navigator url="/pages/cart/cart" open-type="switchTab" hover-class="none">
  <view class="common-quick-nav quick-nav-cart">
    <view class="badge-icon">
      <component-badge prop-number="{{quick_nav_cart_count}}"></component-badge>
    </view>
    <image src="/images/default-cart-icon.png" class="dis-block"></image>
  </view>
D
devil 已提交
251 252 253 254
</navigator>

<!-- 快捷导航 -->
<component-quick-nav></component-quick-nav>