微信小店联盟带货小程序

index.wxml 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <!--pages/goods/list/index.wxml-->
  2. <view class="container">
  3. <!-- 自定义授权弹窗 -->
  4. <view class="custom-modal" wx:if="{{showAuthModal}}">
  5. <view class="modal-mask" bindtap="hideAuthModal"></view>
  6. <view class="modal-content" catchtap="preventTap">
  7. <!-- 未授权状态 -->
  8. <block wx:if="{{bindStatus === 0}}">
  9. <view class="modal-icons">
  10. <image class="icon-left" src="{{iconZhihu}}" mode="aspectFit" />
  11. <view class="icon-arrow">
  12. <text class="arrow-text">⟷</text>
  13. </view>
  14. <image class="icon-right" src="{{iconUser}}" mode="aspectFit" />
  15. </view>
  16. <view class="modal-title">您还未授权成为推客</view>
  17. <view class="modal-subtitle">购买/分享商品无收益</view>
  18. <view class="modal-btn-wrap">
  19. <button class="auth-btn" bindtap="onAuthClick">去授权拿收益</button>
  20. </view>
  21. <view class="no-commission-wrapper">
  22. <store-product
  23. appid="{{currentShopAppid}}"
  24. product-id="{{currentProductId}}"
  25. product-promotion-link="{{productPromotionLink}}"
  26. custom-content="{{true}}"
  27. bind:entererror="onStoreProductEnterError"
  28. open-page="product-detail"
  29. >
  30. <view class="modal-cancel" data-appid="{{currentShopAppid}}" data-product-id="{{currentProductId}}">不要收益,去购买</view>
  31. </store-product>
  32. </view>
  33. </block>
  34. <!-- 已授权状态 -->
  35. <block wx:else>
  36. <view class="product-modal">
  37. <!-- 流程说明 -->
  38. <view class="process-flow">
  39. <view class="flow-steps">
  40. <view class="flow-step">
  41. <text class="step-number">01</text>
  42. <view class="step-text">
  43. <text>购买/分享</text>
  44. <text>商品</text>
  45. </view>
  46. </view>
  47. <view class="flow-arrow">→</view>
  48. <view class="flow-step">
  49. <text class="step-number">02</text>
  50. <view class="step-text">
  51. <text>返回小程序</text>
  52. </view>
  53. </view>
  54. <view class="flow-arrow">→</view>
  55. <view class="flow-step">
  56. <text class="step-number">03</text>
  57. <view class="step-text">
  58. <text>我的订单</text>
  59. <text>查看收益</text>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="flow-tip">提示:微信小店页点击右上角"..."可分享商品</view>
  64. </view>
  65. <!-- 商品信息 -->
  66. <view class="product-info-wrapper">
  67. <store-product
  68. appid="{{currentShopAppid}}"
  69. product-id="{{currentProductId}}"
  70. product-promotion-link="{{productPromotionLink}}"
  71. custom-content="{{true}}"
  72. bind:entererror="onStoreProductEnterError"
  73. open-page="product-detail"
  74. >
  75. <view class="product-info">
  76. <image class="product-image" src="{{currentProduct.image}}" mode="aspectFill"></image>
  77. <view class="product-detail">
  78. <view class="product-title">{{currentProduct.name}}</view>
  79. <view class="price-info">
  80. <view class="current-price">
  81. <text class="price-symbol">¥</text>
  82. <text class="price-value">{{currentProduct.price}}</text>
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. </store-product>
  88. </view>
  89. <!-- 按钮区域 -->
  90. <view class="action-buttons">
  91. <view class="share-btn" bindtap="onShareProduct">
  92. <view class="btn-content">
  93. <text class="amount">¥{{currentProduct.estimatedReturn}}</text>
  94. <text class="label">分享得</text>
  95. </view>
  96. </view>
  97. <view class="buy-btn" bindtap="onBuyProduct">
  98. <view class="btn-content-wrapper">
  99. <store-product
  100. appid="{{currentShopAppid}}"
  101. product-id="{{currentProductId}}"
  102. product-promotion-link="{{productPromotionLink}}"
  103. custom-content="{{true}}"
  104. bind:entererror="onStoreProductEnterError"
  105. open-page="product-detail"
  106. >
  107. <view class="btn-content">
  108. <text class="amount">¥{{currentProduct.estimatedReturn}}</text>
  109. <text class="label">购买/送礼返</text>
  110. </view>
  111. </store-product>
  112. </view>
  113. </view>
  114. </view>
  115. </view>
  116. </block>
  117. </view>
  118. </view>
  119. <!-- 商品列表 -->
  120. <scroll-view
  121. scroll-y
  122. class="goods-list"
  123. bindscrolltolower="onReachBottom"
  124. enable-back-to-top
  125. >
  126. <view class="goods-item"
  127. wx:for="{{goodsList}}"
  128. wx:key="id"
  129. bindtap="navigateToDetail"
  130. data-goods-id="{{item.goods_id}}"
  131. >
  132. <image class="goods-image" src="{{item.head_img_list[0]}}" mode="aspectFill" lazy-load></image>
  133. <view class="goods-content">
  134. <view class="goods-title">{{item.title}}</view>
  135. <view class="goods-subtitle" wx:if="{{item.sub_title}}">{{item.sub_title}}</view>
  136. <view class="goods-info">
  137. <view class="price-wrap">
  138. <text class="price-symbol">¥</text>
  139. <text class="price">{{item.sale_price}}</text>
  140. </view>
  141. <view class="commission-wrap">
  142. <text class="commission-label">预估返</text>
  143. <text class="commission-amount">¥{{item.total_commission_amount}}</text>
  144. </view>
  145. </view>
  146. </view>
  147. </view>
  148. <!-- 加载更多 -->
  149. <view class="loading-more" wx:if="{{loading}}">
  150. <view class="loading-icon"></view>
  151. <text>加载中...</text>
  152. </view>
  153. <view class="no-more" wx:if="{{!hasMore && goodsList.length > 0}}">
  154. <text>没有更多了</text>
  155. </view>
  156. </scroll-view>
  157. <!-- 空状态 -->
  158. <view class="empty-state" wx:if="{{goodsList.length === 0 && !loading}}">
  159. <icon type="info" size="64" color="#CCCCCC"/>
  160. <text>暂无相关商品</text>
  161. </view>
  162. <!-- 海报预览弹窗 -->
  163. <view class="poster-modal" wx:if="{{showPosterModal}}" bindtap="closePosterModal">
  164. <view class="poster-content">
  165. <image class="poster-image" src="{{posterUrl}}" mode="widthFix" bindload="onPosterImageLoad"></image>
  166. </view>
  167. </view>
  168. <!-- 海报画布(隐藏) -->
  169. <canvas canvas-id="posterCanvas" style="width: 750px; height: 1500px; position: fixed; left: -9999px;"></canvas>
  170. </view>