index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view class="content">
  3. <image class="logo" src="/static/post-bg.png"></image>
  4. <view class="share-box">
  5. <view>分销商分享给好友,好友购买产品成功后即可获</view>
  6. <view>得分享奖励</view>
  7. <view>单笔最高可赚¥200.00</view>
  8. <view>快去分享吧</view>
  9. <button type="default" open-type="share">分享</button>
  10. </view>
  11. <view class="share-box" style="height: 200upx;margin-top: 2%;" @longpress="copyCode">
  12. <view>长按复制框内整段文字,打开 [手淘] 即可购买</view>
  13. <view>¥kSfsDfrtrEjt¥</view>
  14. <button type="default" @click="copyCode">一键复制</button>
  15. </view>
  16. <view class="product-title">推荐产品</view>
  17. <view class="recommend-box">
  18. <view class="product-box" v-for="item in productList" :key="item.id" @click="goDetail">
  19. <image :src="item.imgUrl"></image>
  20. <view class="detail-box">
  21. <view>{{item.productTitle}}</view>
  22. <view style="color: #999;">¥{{item.price}}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. title: 'Hello',
  33. productList:[
  34. {
  35. id:'1',
  36. imgUrl:'/static/bed-bg.png',
  37. productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
  38. price:'13999'
  39. },
  40. {
  41. id:'2',
  42. imgUrl:'/static/bed2-bg.png',
  43. productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
  44. price:'15999'
  45. },
  46. {
  47. id:'3',
  48. imgUrl:'/static/bed-bg.png',
  49. productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
  50. price:'16999'
  51. },
  52. {
  53. id:'4',
  54. imgUrl:'/static/bed2-bg.png',
  55. productTitle:'甜蜜瑞士系列床垫 卧室独立袋弹簧 护脊静音软硬适…',
  56. price:'18999'
  57. }
  58. ]
  59. }
  60. },
  61. onLoad() {
  62. },
  63. onShareAppMessage() {
  64. console.log(111);
  65. return {
  66. title: '分销小助手',
  67. path:'/pages/index/index?inviteId=' + '111'
  68. }
  69. },
  70. methods: {
  71. goDetail(){
  72. uni.navigateTo({
  73. url: '/pages/index/detailPage/index',
  74. success: res => {},
  75. fail: () => {},
  76. complete: () => {}
  77. });
  78. },
  79. copyCode(){
  80. uni.setClipboardData({
  81. data:'xxx',
  82. success() {
  83. uni.showToast({
  84. icon:'none',
  85. title:'复制成功'
  86. })
  87. }
  88. })
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. .content {
  95. display: flex;
  96. flex-direction: column;
  97. align-items: center;
  98. justify-content: center;
  99. }
  100. .logo {
  101. height: 400px;
  102. width: 100%;
  103. margin-bottom: 30upx;
  104. }
  105. .share-box {
  106. display: flex;
  107. flex-direction: column;
  108. justify-content: center;
  109. align-items: center;
  110. width: 80%;
  111. height: 300upx;
  112. border: 1px dashed red;
  113. background: #fff;
  114. font-size: 28rpx;
  115. padding: 5px;
  116. }
  117. .share-box button {
  118. width: 300rpx;
  119. height: 70rpx;
  120. line-height: 70rpx;
  121. margin-top: 2%;
  122. background-color: #27BCEF;
  123. color: #fff;
  124. }
  125. .title {
  126. font-size: 36upx;
  127. color: #8f8f94;
  128. }
  129. .product-title {
  130. margin-left: -75%;
  131. margin-top: 5%;
  132. margin-bottom: 1%;
  133. }
  134. .recommend-box {
  135. display: flex;
  136. flex-direction: column;
  137. justify-content: center;
  138. align-items: center;
  139. }
  140. .product-box {
  141. width: 90%;
  142. height: 200rpx;
  143. padding: 20rpx;
  144. display: flex;
  145. align-items: center;
  146. background-color: #fff;
  147. border-radius:10px;
  148. margin-bottom: 2%;
  149. }
  150. .product-box image {
  151. width: 420rpx;
  152. height: 180rpx;
  153. margin-right: 5%;
  154. }
  155. .detail-box {
  156. display: flex;
  157. flex-direction: column;
  158. justify-content: space-between;
  159. font-size: 30rpx;
  160. height: 190rpx;
  161. }
  162. </style>