时空网前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

195 lines
4.1 KiB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
  1. <template>
  2. <view class="lf-row-center lf-flex-column">
  3. <view class="ctab">
  4. <u-tabs :list="tab_list" :is-scroll="true" :show-bar="false" :current="current" @change="change"></u-tabs>
  5. </view>
  6. <view class="com" v-for="(tab, tabIndex) in tab_list" v-if="tabIndex == current" :key="tabIndex">
  7. <view class="lf-row-between list" v-for="(item, index) in tab.list" :key="index">
  8. <view class="left">
  9. <image src="../../static/tu.png" mode=""></image>
  10. </view>
  11. <view class="right">
  12. <view class="lf-line-2 title">网红辣椒棒 魔鬼辣椒挑战全 网第一辣 网红优惠季网红辣椒棒 魔鬼辣椒挑战全 网第一辣 网红优惠季</view>
  13. <view class="lf-row-between tips">
  14. <view class="u-line-progress">
  15. <u-line-progress :percent="25" height="20" :striped="true" active-color="#FE9903" :show-percent="false" inactive-color="#F5F5F5"></u-line-progress>
  16. </view>
  17. <text class="progress">已抢25%</text>
  18. <text class="bought">2.4万人已购买</text>
  19. </view>
  20. <view class="lf-row-between price">
  21. <text></text><text>19</text>.<text>90</text>
  22. <text>39.00</text>
  23. <button>立即抢购</button>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- 加载 -->
  28. <view class="loading-more">
  29. <text v-if="tab.list.length" :class="{'loading-more-text': tab.loadingClass}">{{ tab.loadingText }}</text>
  30. <my-nocontent v-else></my-nocontent>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. let shared = {
  39. loadingClass: false,
  40. loadingText: '没有更多数据啦~',
  41. page: 1,
  42. isPage: true
  43. }
  44. return {
  45. tab_list: [{
  46. name: '推荐',
  47. list: [1, 2, 3],
  48. ...shared
  49. }, {
  50. name: '每日必抢',
  51. list: [],
  52. ...shared
  53. }, {
  54. name: '生活用品',
  55. list: [1],
  56. ...shared
  57. },{
  58. name: '家政服务',
  59. list: [],
  60. ...shared
  61. },{
  62. name: '美食部落',
  63. list: [],
  64. ...shared
  65. },{
  66. name: '奶茶夏日',
  67. list: [],
  68. ...shared
  69. },{
  70. name: '奶茶夏日',
  71. list: [],
  72. ...shared
  73. }],
  74. current: 0, // tab下表
  75. }
  76. },
  77. onLoad() {
  78. },
  79. methods: {
  80. change(index) {
  81. this.current = index;
  82. },
  83. },
  84. onReachBottom(){
  85. console.log("页面触底")
  86. },
  87. onPullDownRefresh(){
  88. console.log("下拉刷新");
  89. uni.stopPullDownRefresh()
  90. }
  91. }
  92. </script>
  93. <style lang="scss" scoped>
  94. .title {
  95. font-size: 28rpx;
  96. color: $u-content-color;
  97. }
  98. // tab
  99. .ctab{
  100. width: 100%;
  101. margin: 20rpx 0 0rpx 0rpx;
  102. padding: 0 22rpx;
  103. }
  104. // 商品列表
  105. .com{
  106. width: 100%;
  107. overflow: hidden;
  108. .list{
  109. border-radius: 10rpx;
  110. overflow: hidden;
  111. margin: 20rpx 32rpx;
  112. background-color: #FFFFFF;
  113. box-shadow:0 0 10px 5px #e5e5e5;
  114. align-items: flex-start;
  115. .left{
  116. overflow: hidden;
  117. image{
  118. width: 204rpx;
  119. height: 204rpx;
  120. margin: 20rpx;
  121. border-radius: 10rpx;
  122. }
  123. }
  124. .right{
  125. overflow: hidden;
  126. width: 64%;
  127. .title{
  128. margin: 18rpx 20rpx 0 0;
  129. color: #222222;
  130. font-size: 32rpx;
  131. }
  132. .tips{
  133. margin: 16rpx 0;
  134. overflow: hidden;
  135. .u-line-progress{
  136. width: 112rpx;
  137. overflow: hidden;
  138. margin-right:20rpx ;
  139. }
  140. .progress{
  141. color: #777777;
  142. font-size: 24rpx;
  143. }
  144. .bought{
  145. color: #777777;
  146. font-size: 24rpx;
  147. margin-right: 20rpx;
  148. }
  149. }
  150. .price{
  151. overflow: hidden;
  152. color:#FF0000;
  153. text{
  154. font-size: 48rpx;
  155. color:#FF0000;
  156. font-weight: 500;
  157. }
  158. text:nth-child(1){
  159. color: #FF0000;
  160. font-size: 28rpx;
  161. }
  162. text:nth-child(2){
  163. color: #FF0000;
  164. font-size: 48rpx;
  165. }
  166. text:nth-child(3){
  167. color: #FF0000;
  168. font-size: 28rpx;
  169. }
  170. text:nth-child(4){
  171. color: #777777;
  172. font-size: 28rpx;
  173. text-decoration:line-through;
  174. font-weight: 400;
  175. }
  176. button{
  177. width: 160rpx;
  178. height: 60rpx;
  179. background: #FE9903;
  180. border-radius: 15px;
  181. font-size: 24rpx;
  182. color: #FFFFFF;
  183. margin: 0rpx 20rpx 0rpx 20rpx;
  184. border: none;
  185. }
  186. }
  187. }
  188. }
  189. }
  190. </style>