微信小店联盟带货小程序

detail.wxml 6.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <view class="container">
  2. <!-- 加载中 -->
  3. <view class="loading" wx:if="{{loading}}">
  4. <image class="loading-icon" src="/static/icons/loading.gif"></image>
  5. </view>
  6. <block wx:else>
  7. <!-- 轮播图模块 -->
  8. <swiper class="swiper-box" indicator-dots="true" autoplay="true" interval="3000" duration="500" circular="true">
  9. <swiper-item wx:for="{{goods.images}}" wx:key="index">
  10. <image src="{{item}}" mode="aspectFill" class="slide-image" />
  11. </swiper-item>
  12. </swiper>
  13. <!-- 商品信息模块 -->
  14. <view class="goods-info">
  15. <view class="price-section">
  16. <view class="price-wrapper">
  17. <text class="current-price">¥{{goods.price}}</text>
  18. <text class="original-price">¥{{goods.marketPrice}}</text>
  19. </view>
  20. <view class="commission-wrapper">
  21. <image src="/static/icons/commission.png" class="commission-icon" />
  22. <text class="commission-text">{{goods.commission}}元</text>
  23. </view>
  24. </view>
  25. <view class="title-section">
  26. <view class="title-wrap">
  27. <text class="goods-title">{{goods.title}}</text>
  28. <view class="sales-badge">{{goods.sales}}+人已购</view>
  29. </view>
  30. <view class="goods-tags">
  31. <view class="tag-item" wx:for="{{goods.tags}}" wx:key="index">
  32. <text>{{item}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 热门推荐 -->
  38. <view class="hot-recommendations">
  39. <view class="section-title">
  40. <text class="title-text">热门推荐</text>
  41. </view>
  42. <swiper class="recommendations-swiper"
  43. circular="true"
  44. autoplay="true"
  45. interval="3000"
  46. duration="500"
  47. previous-margin="30rpx"
  48. next-margin="30rpx"
  49. display-multiple-items="2.2">
  50. <swiper-item wx:for="{{hotRecommendations}}" wx:key="id" class="recommendation-item">
  51. <view class="recommendation-card" bindtap="navigateToGoods" data-id="{{item.id}}">
  52. <view class="recommendation-image-wrap">
  53. <image class="recommendation-image" src="{{item.image}}" mode="aspectFill"/>
  54. <view class="recommendation-tag" wx:if="{{item.tag}}">{{item.tag}}</view>
  55. </view>
  56. <view class="recommendation-info">
  57. <view class="recommendation-title-wrap">
  58. <text class="recommendation-title">{{item.title}}</text>
  59. </view>
  60. <view class="recommendation-price-row">
  61. <view class="price-wrap">
  62. <text class="currency">¥</text>
  63. <text class="price">{{item.price}}</text>
  64. </view>
  65. <view class="sales-wrap">
  66. <text class="sales">{{item.sales}}+人已购</text>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </swiper-item>
  72. </swiper>
  73. </view>
  74. <!-- 商品详情模块 -->
  75. <view class="goods-detail">
  76. <view class="detail-title">
  77. <text class="title-text">商品详情</text>
  78. </view>
  79. <view class="detail-content">
  80. <image wx:for="{{goods.detailImages}}" wx:key="index"
  81. src="{{item}}" mode="widthFix" class="detail-image" />
  82. </view>
  83. </view>
  84. </block>
  85. <!-- 底部按钮 -->
  86. <view class="bottom-bar">
  87. <view class="collect-btn {{isFavorite ? 'collected' : ''}}" bindtap="toggleFavorite">
  88. <image src="{{isFavorite ? '/static/icons/collected.png' : '/static/icons/collect.png'}}" />
  89. <text>{{isFavorite ? '已收藏' : '收藏'}}</text>
  90. </view>
  91. <button class="share-poster-btn" bindtap="generatePoster">
  92. <view class="btn-content">
  93. <image src="/static/icons/poster.png" class="btn-icon"/>
  94. <text class="btn-text">生成海报</text>
  95. </view>
  96. </button>
  97. <button class="share-btn" open-type="share">
  98. <view class="share-content">
  99. <text class="share-text">分 享</text>
  100. <text class="commission-text">赚{{goods.commission}}元</text>
  101. </view>
  102. </button>
  103. </view>
  104. <!-- 返回顶部按钮 -->
  105. <view class="back-to-top" bindtap="scrollToTop" wx:if="{{showBackToTop}}">
  106. <image src="/static/icons/top.png" class="top-icon"/>
  107. </view>
  108. <!-- 分享选项弹窗 -->
  109. <view class="share-popup" wx:if="{{showShare}}">
  110. <view class="share-mask" bindtap="hideSharePanel"></view>
  111. <view class="share-panel">
  112. <view class="share-options">
  113. <view class="share-option" bindtap="generatePoster">
  114. <image src="/static/icons/poster.png" />
  115. <text>生成海报</text>
  116. </view>
  117. <button class="share-option" open-type="share">
  118. <image src="/static/icons/wechat.png" />
  119. <text>分享给好友</text>
  120. </button>
  121. </view>
  122. <view class="cancel-btn" bindtap="hideSharePanel">取消</view>
  123. </view>
  124. </view>
  125. <!-- 海报模态框 -->
  126. <view class="poster-modal" wx:if="{{showPosterModal}}">
  127. <view class="modal-mask" bindtap="closePosterModal"></view>
  128. <view class="modal-content">
  129. <view class="modal-header">
  130. <text class="modal-title">选择模板</text>
  131. <view class="close-btn" bindtap="closePosterModal">
  132. <image src="/static/icons/close.png" mode="aspectFit" class="close-icon"/>
  133. </view>
  134. </view>
  135. <scroll-view scroll-y class="template-scroll">
  136. <view class="template-list">
  137. <view class="template-item {{currentTemplate === item.id ? 'active' : ''}}"
  138. wx:for="{{posterTemplates}}"
  139. wx:key="id"
  140. bindtap="switchTemplate"
  141. data-template-id="{{item.id}}">
  142. <view class="template-preview-wrap">
  143. <image class="template-preview" src="{{item.preview}}" mode="aspectFill"/>
  144. <view class="template-selected" wx:if="{{currentTemplate === item.id}}">
  145. <image src="/static/icons/selected.png" mode="aspectFit" class="selected-icon"/>
  146. </view>
  147. </view>
  148. <view class="template-info">
  149. <text class="template-name">{{item.name}}</text>
  150. <text class="template-desc">{{item.desc}}</text>
  151. </view>
  152. </view>
  153. </view>
  154. </scroll-view>
  155. <view class="modal-footer">
  156. <button class="confirm-btn" bindtap="confirmGeneratePoster">
  157. <text>生成海报</text>
  158. </button>
  159. </view>
  160. </view>
  161. </view>
  162. <!-- 海报预览 -->
  163. <view class="poster-preview" wx:if="{{showPoster}}">
  164. <view class="preview-mask" bindtap="closePosterPreview"></view>
  165. <view class="preview-content">
  166. <view class="preview-header">
  167. <view class="close-preview-btn" bindtap="closePosterPreview">×</view>
  168. </view>
  169. <image class="poster-image" src="{{posterUrl}}" mode="widthFix"/>
  170. <view class="preview-footer">
  171. <button class="save-btn" bindtap="savePoster">保存到相册</button>
  172. </view>
  173. </view>
  174. </view>
  175. </view>