fight-share-entry.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view class="fight-share-entry">
  3. <view class="row">
  4. <!-- 商品信息 -->
  5. <cm-order-prodcut :countVisible="false"></cm-order-prodcut>
  6. <view class="service">
  7. <view class="iconfont icon-wuyoushouhou"><text>无忧退货</text></view>
  8. <view class="iconfont icon-wuyoushouhou"><text>快速退款</text></view>
  9. <view class="iconfont icon-wuyoushouhou"><text>正品保证</text></view>
  10. </view>
  11. <view class="grid t0b48"></view>
  12. <view class="fight-tip">还差<text>1</text>人,赶快邀请好友来拼单吧!</view>
  13. <!-- 倒计时 -->
  14. <countdown-box></countdown-box>
  15. <!-- 操作 -->
  16. <view class="fight-control">
  17. <button class="btn type1" @click="handleClick">立即参团</button>
  18. </view>
  19. <view class="grid t48b48"></view>
  20. <!-- 拼单用户列表 -->
  21. <user-list></user-list>
  22. <view class="line"></view>
  23. <view class="goods-info">
  24. <image src="https://picsum.photos/100/100?random=3" class="cover"></image>
  25. <view class="title">肌本演绎360愉悦修护套组 PLUS 尊享版防晒修复 补水保湿</view>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import UserList from './components/user-list.vue'
  32. import CountdownBox from './components/countdown-box.vue'
  33. import CmOrderProdcut from '@/components/cm-module/cm-order-prodcut/cm-order-prodcut.vue'
  34. export default {
  35. components: {
  36. UserList,
  37. CountdownBox,
  38. CmOrderProdcut
  39. },
  40. computed: {
  41. },
  42. data() {
  43. return {}
  44. },
  45. onShareTimeline(e) {
  46. // 加密参数
  47. const shareData = {
  48. type: 4,
  49. inviteUserId: this.userId
  50. }
  51. // 加密
  52. const state_str = encodeURIComponent(this.$crypto.encrypt(shareData))
  53. return {
  54. title: '哈喽,赶快来参团吧!这件商品拼团买更便宜~~',
  55. path: `pages/tabBar/index/index?state_str=${state_str}`,
  56. imageUrl: 'https://picsum.photos/400/400?random=3'
  57. }
  58. },
  59. onShareAppMessage(e) {
  60. // 加密参数
  61. const shareData = {
  62. type: 4,
  63. inviteUserId: this.userId
  64. }
  65. // 加密
  66. const state_str = encodeURIComponent(this.$crypto.encrypt(shareData))
  67. return {
  68. title: '哈喽,赶快来参团吧!这件商品拼团买更便宜~~',
  69. path: `pages/tabBar/index/index?state_str=${state_str}`,
  70. imageUrl: 'https://picsum.photos/400/400?random=3'
  71. }
  72. },
  73. methods: {
  74. handleClick(type) {
  75. console.log('拼单')
  76. },
  77. }
  78. }
  79. </script>
  80. <style lang="scss" scoped>
  81. /* scss中可以用mixin来扩展 */
  82. @mixin ellipsis($line: 1) {
  83. overflow: hidden;
  84. text-overflow: ellipsis;
  85. display: -webkit-box;
  86. -webkit-line-clamp: $line;
  87. -webkit-box-orient: vertical;
  88. }
  89. .flex-center-box {
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. }
  94. .fight-share-entry {
  95. background: #f7f7f7;
  96. min-height: 100vh;
  97. .row {
  98. padding-top: 48rpx;
  99. background: #fff;
  100. overflow: hidden;
  101. }
  102. .service {
  103. display: flex;
  104. justify-content: space-around;
  105. align-items: center;
  106. color: #ff457b;
  107. width: 750rpx;
  108. height: 72rpx;
  109. padding: 0 24rpx;
  110. margin-top: 64rpx;
  111. background: #FFF8FD;
  112. opacity: 1;
  113. box-sizing: border-box;
  114. .iconfont {
  115. font-size: 24rpx;
  116. line-height: 24rpx;
  117. text {
  118. color: #FF457B;
  119. margin-left: 4rpx;
  120. }
  121. }
  122. }
  123. .fight-tip {
  124. @extend .flex-center-box;
  125. margin-top: 48rpx;
  126. margin-bottom: 32rpx;
  127. font-size: 30rpx;
  128. font-weight: 400;
  129. color: #333333;
  130. text {
  131. color: #ff457b;
  132. }
  133. }
  134. .fight-control {
  135. display: flex;
  136. justify-content: center;
  137. align-items: center;
  138. flex-direction: column;
  139. margin-top: 40rpx;
  140. margin-bottom: 48rpx;
  141. .link {
  142. margin-top: 24rpx;
  143. font-size: 26rpx;
  144. line-height: 38rpx;
  145. color: #999999;
  146. }
  147. .btn {
  148. @extend .flex-center-box;
  149. width: 600rpx;
  150. height: 90rpx;
  151. border-radius: 45rpx;
  152. box-sizing: border-box;
  153. font-size: 30rpx;
  154. &.type1 {
  155. color: #ffffff;
  156. background: linear-gradient(90deg, #fc32b4 0%, #f83c6c 100%);
  157. }
  158. &.type2 {
  159. margin-top: 24rpx;
  160. color: #ff457b;
  161. border: 1px solid #ff457b;
  162. }
  163. }
  164. }
  165. .grid {
  166. width: 750rpx;
  167. height: 20rpx;
  168. background: #f7f7f7;
  169. &.t48b48{
  170. margin-top: 48rpx;
  171. margin-bottom: 48rpx;
  172. }
  173. &.t0b48{
  174. margin-top: 0;
  175. margin-bottom: 48rpx;
  176. }
  177. }
  178. .line {
  179. width: 702px;
  180. height: 1px;
  181. margin: 32rpx auto 24rpx auto;
  182. background: #e1e1e1;
  183. }
  184. .goods-info {
  185. @extend .flex-center-box;
  186. padding: 0 24rpx 40rpx;
  187. .cover {
  188. width: 80rpx;
  189. height: 80rpx;
  190. background: eee;
  191. border: 1rpx solid #e1e1e1;
  192. border-radius: 8rpx;
  193. border: 50%;
  194. }
  195. .title {
  196. flex: 1;
  197. margin-left: 24rpx;
  198. word-break: break-word;
  199. font-size: 26rpx;
  200. line-height: 1.6;
  201. color: #333333;
  202. text-align: justify;
  203. @include ellipsis(2);
  204. }
  205. }
  206. }
  207. </style>