goods_info.wxml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <view class="container">
  2. <view class="pics">
  3. <swiper class="swiper_pics" autoplay="true" duration="1000" circular="true" indicator-dots="true"
  4. indicator-color="white" indicator-active-color="var(--themeColor)">
  5. <block wx:for="{{goods.pictures}}" wx:for-item="picture" wx:key="id">
  6. <swiper-item>
  7. <!-- 商品图片 -->
  8. <block wx:if="{{picture.picUrl!=null}}">
  9. <image class="pic" src="{{serverPrefix+picture.picUrl}}"></image>
  10. </block>
  11. </swiper-item>
  12. </block>
  13. </swiper>
  14. </view>
  15. <view class="introduce">
  16. <view class="goods">
  17. <view class="goods_price">
  18. <image src="/img/icon/icon_money.png"></image>
  19. <block>{{goods.price}}</block>
  20. </view>
  21. <view class="goods_name">
  22. {{goods.goodsName}}
  23. </view>
  24. <view class="goods_score">
  25. <view class="sale_num"><text>月售 {{goods.sales}} </text></view>
  26. <view class="like_num"><text decode="{{true}}"> &nbsp;评分 {{goods.score}}</text></view>
  27. </view>
  28. <view class="goods_info_options" bindtap="handleGoodsInfoShow">
  29. <block>请选择:</block>
  30. <block wx:for="{{goods.goodsOptions}}" wx:key="*this">
  31. {{item.optionName}}
  32. </block>
  33. <image class="toright" src="/img/icon/toright.png" ></image>
  34. </view>
  35. </view>
  36. <view class="title_bar">
  37. <view class="title {{0===currentTitleIdx?'select':''}}" bindtap="handleTitleTap" data-idx="0">
  38. <text>商品详情</text>
  39. </view>
  40. <view class="title {{1===currentTitleIdx?'select':''}}" bindtap="handleTitleTap" data-idx="1">
  41. <text>评价</text>
  42. </view>
  43. </view>
  44. <view class="info">
  45. <swiper class="info_swiper" current="{{currentTitleIdx}}" bindchange="handleSwiperChange">
  46. <swiper-item>
  47. <view class="goods_info">
  48. <view class="goods_item desc">
  49. <view class="title">
  50. <text>商品描述</text>
  51. </view>
  52. <view class="content">
  53. <text>{{goods.desc}}</text>
  54. </view>
  55. </view>
  56. <view wx:if="{{goods.ingredients!=null}}" class="goods_item Ingredients">
  57. <view class="title">
  58. <text class="title">原料</text>
  59. </view>
  60. <view class="content">
  61. <text class="content">{{goods.ingredients}}</text>
  62. </view>
  63. </view>
  64. <view wx:if="{{goods.weight!=null}}" class="goods_item size">
  65. <view class="title">
  66. <text class="title">分量</text>
  67. </view>
  68. <view class="content">
  69. <text class="content">{{goods.weight}}</text>
  70. </view>
  71. </view>
  72. <view wx:if="{{goods.taste!=null}}" class="goods_item taste">
  73. <view class="title">
  74. <text class="title">口味</text>
  75. </view>
  76. <view class="content">
  77. <text class="content">{{goods.taste}}</text>
  78. </view>
  79. </view>
  80. <view class="goods_item price_intro">
  81. <view class="title">
  82. <text class="title">价格说明</text>
  83. </view>
  84. <view class="content">
  85. <text class="content">?</text>
  86. </view>
  87. </view>
  88. </view>
  89. </swiper-item>
  90. <swiper-item>
  91. 评论页面待实现
  92. </swiper-item>
  93. </swiper>
  94. </view>
  95. </view>
  96. <view style="width: auto;height: 80rpx;"></view>
  97. </view>
  98. <view class="goods_info_add_cart" bindtap="handleGoodsInfoShow">
  99. <button class="btn">
  100. 加入购物车
  101. </button>
  102. </view>
  103. <view class="mask-layer" wx:if="{{goodsInfoShowState}}" catchtap="handleGoodsInfoHide">
  104. </view>
  105. <!-- 选规格弹出 -->
  106. <view class="select_view" wx:if="{{goodsInfoShowState}}" animation="{{animationData}}">
  107. <view class="selected_goods">
  108. <view class="selected_goods_img float-left">
  109. <!-- <image id="goods_info_img" src="{{staticUrl+goods.pictures[0].picUrl}}"></image> -->
  110. <!-- 商品图片判断 -->
  111. <block wx:if="{{goods.pictures[0].picUrl!=null}}">
  112. <image src="{{serverPrefix+goods.pictures[0].picUrl}}"></image>
  113. </block>
  114. </view>
  115. <view class="goods_info_item goods_name float-left">
  116. <text>{{goods.goodsName}}</text>
  117. </view>
  118. <view class="goods_info_item goods_desc float-left">
  119. <text>{{goods.desc}}</text>
  120. </view>
  121. <view class="goods_info_item selected_options float-left">
  122. <text id="selected_text">已选:{{selectedOptions.text}}</text>
  123. </view>
  124. <view class="goods_info_item goods_price float-left">
  125. <text>¥{{goods.price+selectedOptions.extra}}</text>
  126. </view>
  127. </view>
  128. <view class="select_goods_options">
  129. <view class="goods_num">
  130. <text id="gNum">数量</text>
  131. <view class="action">
  132. <view style="width: 40rpx;height: 40rpx;margin-right: 10rpx;">
  133. <image class="" src="/img/icon/reduce.png" bindtap="handleGoodsReduceTap"></image>
  134. </view>
  135. <text class=" ">{{goodsNum}}</text>
  136. <view style="width: 40rpx;height: 40rpx;margin-left: 10rpx;">
  137. <image class="" src="/img/icon/add.png" bindtap="handleGoodsAddTap"></image>
  138. </view>
  139. </view>
  140. </view>
  141. <scroll-view class="scroll_options" scroll-y="true">
  142. <view class="options" wx:for="{{goods.goodsOptions}}" wx:for-item="option" wx:for-index="index1" wx:key="id">
  143. <view class="option_title">
  144. <text>{{option.optionName}}</text>
  145. </view>
  146. <view class="option_item">
  147. <block wx:for="{{option.goodsOptionItems}}" wx:for-item="optionItem" wx:for-index="index2" wx:key="id">
  148. <view class="option_type type {{optionItem.selectedState ? 'selected' : ''}}" data-index1="{{index1}}" data-index2="{{index2}}" bindtap="handleSelectStateTap">
  149. {{optionItem.optionItem}}
  150. </view>
  151. </block>
  152. </view>
  153. </view>
  154. </scroll-view>
  155. </view>
  156. <view class="add_cart" bindtap="handleAdd2CartGoodsTap">
  157. <button class="btn">
  158. 加入购物车
  159. </button>
  160. </view>
  161. </view>