myGroup.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="container">
  3. <tui-tabs :top="0" :tabs="tabs" isFixed :currentTab="currentTab" selectedColor="#E41F19" sliderBgColor="#E41F19" @change="change" itemWidth="25%"></tui-tabs>
  4. <view class="tui-order-list">
  5. <view class="tui-order-item" v-for="(model, orderIndex) in 4" :key="orderIndex" @tap="detail">
  6. <tui-list-cell :hover="false" :lineLeft="false">
  7. <view class="tui-goods-title">
  8. <view v-if="currentTab != 1">2020-09-01 03:01 {{ currentTab == 3 ? '已结束' : '已开团' }}</view>
  9. <view v-else class="tui-flex">
  10. <text>距离结束剩余</text>
  11. <tui-countdown :time="3800" scale colonColor="#EB0909" borderColor="#EB0909" color="#EB0909"></tui-countdown>
  12. </view>
  13. <view class="tui-order-status">{{ statusArr[currentTab] }}</view>
  14. </view>
  15. </tui-list-cell>
  16. <tui-list-cell padding="0" :hover="false">
  17. <view class="tui-goods-item">
  18. <image src="/static/images/mall/product/4.jpg" class="tui-goods-img"></image>
  19. <view class="tui-goods-center">
  20. <view class="tui-goods-name">欧莱雅(LOREAL)奇焕光彩粉嫩透亮修颜霜 30ml(欧莱雅彩妆 BB霜 粉BB 遮瑕疵 隔离)</view>
  21. <view class="tui-goods-attr">黑色,50ml</view>
  22. </view>
  23. <view class="tui-price-right">
  24. <view>¥298.00</view>
  25. <view>x2</view>
  26. </view>
  27. </view>
  28. </tui-list-cell>
  29. <tui-list-cell :hover="false" unlined>
  30. <view class="tui-goods-price">
  31. <view>共2件商品 合计:</view>
  32. <view class="tui-size-24">¥</view>
  33. <view class="tui-price-large">596</view>
  34. <view class="tui-size-24">.00</view>
  35. </view>
  36. </tui-list-cell>
  37. <view class="tui-order-btn">
  38. <tui-button type="danger" plain width="152rpx" height="52rpx" :size="26" shape="circle" v-if="currentTab == 1">邀请好友</tui-button>
  39. <tui-button type="black" plain width="152rpx" height="52rpx" :size="26" shape="circle" v-else>拼团详情</tui-button>
  40. </view>
  41. </view>
  42. </view>
  43. <tui-divider width="60%" gradual>没有更多了</tui-divider>
  44. </view>
  45. </template>
  46. <script>
  47. //实际项目中,根据实际列表拼团状态来判断显示
  48. export default {
  49. data() {
  50. return {
  51. tabs: [
  52. {
  53. name: '全部'
  54. },
  55. {
  56. name: '拼团中'
  57. },
  58. {
  59. name: '拼团成功'
  60. },
  61. {
  62. name: '拼团失败'
  63. }
  64. ],
  65. currentTab: 0,
  66. statusArr: ['拼团成功', '待分享,差一人', '拼团成功', '拼团失败,已退款']
  67. };
  68. },
  69. methods: {
  70. change(e) {
  71. this.currentTab = e.index;
  72. },
  73. detail() {
  74. let status = this.currentTab == 0 ? 2 : this.currentTab;
  75. this.tui.href(`/pagesA/my/myGroup/myGroupDetail?status=${status}`);
  76. }
  77. },
  78. /**
  79. * 页面相关事件处理函数--监听用户下拉动作
  80. */
  81. onPullDownRefresh: function() {
  82. setTimeout(() => {
  83. uni.stopPullDownRefresh()
  84. }, 200);
  85. },
  86. };
  87. </script>
  88. <style>
  89. .tui-order-list {
  90. width: 100%;
  91. padding: 0 25rpx;
  92. margin-top: 80rpx;
  93. box-sizing: border-box;
  94. }
  95. .tui-order-item {
  96. margin-top: 20rpx;
  97. border-radius: 12rpx;
  98. box-shadow: 0 5rpx 10rpx 0 rgba(0, 0, 0, 0.06);
  99. overflow: hidden;
  100. }
  101. .tui-goods-title {
  102. width: 100%;
  103. font-size: 28rpx;
  104. display: flex;
  105. align-items: center;
  106. justify-content: space-between;
  107. }
  108. .tui-flex {
  109. display: flex;
  110. align-items: center;
  111. }
  112. .tui-flex text {
  113. padding-right: 12rpx;
  114. }
  115. .tui-order-status {
  116. color: #eb0909;
  117. font-size: 26rpx;
  118. }
  119. .tui-goods-item {
  120. width: 100%;
  121. padding: 20rpx 30rpx;
  122. box-sizing: border-box;
  123. display: flex;
  124. justify-content: space-between;
  125. }
  126. .tui-goods-img {
  127. width: 180rpx;
  128. height: 180rpx;
  129. display: block;
  130. flex-shrink: 0;
  131. }
  132. .tui-goods-center {
  133. flex: 1;
  134. padding: 20rpx 8rpx;
  135. box-sizing: border-box;
  136. }
  137. .tui-goods-name {
  138. max-width: 310rpx;
  139. word-break: break-all;
  140. overflow: hidden;
  141. text-overflow: ellipsis;
  142. display: -webkit-box;
  143. -webkit-box-orient: vertical;
  144. -webkit-line-clamp: 2;
  145. font-size: 26rpx;
  146. line-height: 32rpx;
  147. }
  148. .tui-goods-attr {
  149. font-size: 22rpx;
  150. color: #888888;
  151. line-height: 32rpx;
  152. padding-top: 20rpx;
  153. word-break: break-all;
  154. overflow: hidden;
  155. text-overflow: ellipsis;
  156. display: -webkit-box;
  157. -webkit-box-orient: vertical;
  158. -webkit-line-clamp: 2;
  159. }
  160. .tui-price-right {
  161. text-align: right;
  162. font-size: 24rpx;
  163. color: #888888;
  164. line-height: 30rpx;
  165. padding-top: 20rpx;
  166. }
  167. .tui-color-red {
  168. color: #e41f19;
  169. padding-right: 30rpx;
  170. }
  171. .tui-goods-price {
  172. width: 100%;
  173. display: flex;
  174. align-items: flex-end;
  175. justify-content: flex-end;
  176. font-size: 24rpx;
  177. }
  178. .tui-size-24 {
  179. font-size: 24rpx;
  180. line-height: 24rpx;
  181. }
  182. .tui-price-large {
  183. font-size: 32rpx;
  184. line-height: 30rpx;
  185. font-weight: 500;
  186. }
  187. .tui-order-btn {
  188. width: 100%;
  189. display: flex;
  190. align-items: center;
  191. justify-content: flex-end;
  192. background: #fff;
  193. padding: 10rpx 30rpx 20rpx;
  194. box-sizing: border-box;
  195. }
  196. </style>