groupShare.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <view :class="[AppTheme]" v-if="data">
  3. <div id="shareit" v-if="show" @click="position">
  4. <image :src="settingFile.root_img+'/static/app/imgs/mine/share.png'" mode=""></image>
  5. </div>
  6. <view class="time">
  7. <u-count-down :time="data.group.rtime > timestamp ? data.group.rtime - timestamp : 0" font-size="28">
  8. </u-count-down>
  9. </view>
  10. <view class="message" v-if="group.status == 0">
  11. 还差
  12. <span style="color: #FF0000;">{{ group.left }}</span>
  13. 人,赶紧邀请好友来参团吧~
  14. </view>
  15. <view class="message" v-else-if="group.status == 1">恭喜您,拼团成功,我们将尽快为您发货~</view>
  16. <view class="message" v-else>很遗憾,拼团失败~K</view>
  17. <view class="box_button bg-linear-gradient" v-if="group.status == 0" @click="position">立即参团</view>
  18. <view class="box_button bg-linear-gradient" @click="goback">回到首页</view>
  19. <view class="my_team">
  20. <view class="member captain">
  21. <span class="bg-primary">团长</span>
  22. <image :src="data.vip.headimgurl" mode=""></image>
  23. </view>
  24. <view class="member" v-if="data.member" v-for="item in data.member" :key="item.headimgurl">
  25. <image :src="item.headimgurl" mode=""></image>
  26. </view>
  27. <view class="member" v-if="data.group.left != 0">
  28. <image :src="settingFile.root_img+'/static/app/cart/6.png'" mode=""></image>
  29. </view>
  30. </view>
  31. <u-cell-group class="cell">
  32. <u-cell class="cellitem" title="商品名" :value="data.cache.name"></u-cell>
  33. <u-cell title="参团时间" :value="$u.timeFormat(data.activity.time, 'yyyy/mm/dd hh:MM')"></u-cell>
  34. <u-cell title="拼团须知" value="好友参团·人满发货·人不满退款"></u-cell>
  35. </u-cell-group>
  36. </view>
  37. </template>
  38. <script>
  39. import mall from '@/api/mall/index.js';
  40. export default {
  41. data() {
  42. return {
  43. primary:this.$theme.primary,
  44. data: '',
  45. group: '',
  46. timestamp: '',
  47. settingFile: getApp().globalData.siteinfo,
  48. show: false,
  49. option: ''
  50. };
  51. },
  52. onShow() {
  53. },
  54. onLoad(options) {
  55. this.option = options;
  56. this.$bindid.getbindid(options, this.$store);
  57. this.timestamp = Date.parse(new Date()) / 1000;
  58. this.getting(options.id);
  59. },
  60. methods: {
  61. //回到首页
  62. goback() {
  63. uni.switchTab({
  64. url: "/pages/mall/mall"
  65. })
  66. },
  67. getting(id) {
  68. /* 这里先写死*/
  69. let data = {
  70. id
  71. };
  72. mall.groupShare(data).then(res => {
  73. if (res.status == 200) {
  74. this.data = res.data;
  75. this.group = res.data.group;
  76. }
  77. });
  78. },
  79. position() {
  80. this.show = !this.show;
  81. }
  82. }
  83. };
  84. </script>
  85. <style lang="scss">
  86. page {
  87. background-color: #fff;
  88. }
  89. #shareit {
  90. position: fixed;
  91. z-index: 999999;
  92. top: 0;
  93. left: 0;
  94. width: 100%;
  95. height: 100%;
  96. background-color: rgba(0, 0, 0, 0.5);
  97. image {
  98. margin-left: 50rpx;
  99. }
  100. }
  101. .time {
  102. width: 200rpx;
  103. height: 45rpx;
  104. margin: 50rpx auto 0;
  105. padding: 5rpx 20rpx;
  106. background: #eee;
  107. font-size: 24rpx;
  108. }
  109. .message {
  110. margin: 80rpx 0;
  111. text-align: center;
  112. font-size: 30rpx;
  113. }
  114. .box_button {
  115. margin: 20rpx auto 0;
  116. width: 400rpx;
  117. text-align: center;
  118. color: #fff;
  119. border-radius: 30rpx;
  120. line-height: 2;
  121. }
  122. .my_team {
  123. height: 200rpx;
  124. display: flex;
  125. justify-content: center;
  126. align-items: center;
  127. margin-top: 50rpx;
  128. .member {
  129. margin: 0 10rpx;
  130. width: 120rpx;
  131. height: 120rpx;
  132. position: relative;
  133. image {
  134. border-radius: 100%;
  135. width: 100%;
  136. height: 100%;
  137. }
  138. }
  139. .captain {
  140. span {
  141. position: absolute;
  142. font-size: 24rpx;
  143. border-radius: 30rpx;
  144. padding: 0 10rpx;
  145. border: 4rpx solid #fff;
  146. line-height: 1.4;
  147. color: #666;
  148. z-index: 10;
  149. }
  150. }
  151. }
  152. .cell {
  153. margin-top: 50rpx;
  154. width: 100%;
  155. .cellitem{
  156. width: 100%;
  157. text-overflow: ellipsis;
  158. overflow: hidden;
  159. white-space: nowrap;
  160. }
  161. }
  162. </style>