时空网前端
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.

199 lines
4.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 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. <!-- 回到顶部 -->
  33. <u-back-top :scroll-top="pageScrollTop"></u-back-top>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. let shared = {
  41. loadingClass: false,
  42. loadingText: '没有更多数据啦~',
  43. page: 1,
  44. isPage: true
  45. }
  46. return {
  47. tab_list: [{
  48. name: '推荐',
  49. list: [1, 2, 3, 4,5,6,7,8],
  50. ...shared
  51. }, {
  52. name: '每日必抢',
  53. list: [],
  54. ...shared
  55. }, {
  56. name: '生活用品',
  57. list: [1],
  58. ...shared
  59. },{
  60. name: '家政服务',
  61. list: [],
  62. ...shared
  63. },{
  64. name: '美食部落',
  65. list: [],
  66. ...shared
  67. },{
  68. name: '奶茶夏日',
  69. list: [],
  70. ...shared
  71. },{
  72. name: '奶茶夏日',
  73. list: [],
  74. ...shared
  75. }],
  76. current: 0, // tab下表
  77. }
  78. },
  79. onLoad() {
  80. this.$http(this.API.API_GOODS_LIST, {data: 1}).then(res => {
  81. console.log(res);
  82. }).catch(err => err);
  83. },
  84. methods: {
  85. change(index) {
  86. this.current = index;
  87. },
  88. },
  89. onReachBottom(){
  90. console.log("页面触底")
  91. },
  92. onPullDownRefresh(){
  93. console.log("下拉刷新");
  94. uni.stopPullDownRefresh()
  95. }
  96. }
  97. </script>
  98. <style lang="scss" scoped>
  99. .title {
  100. font-size: 28rpx;
  101. color: $u-content-color;
  102. }
  103. // tab
  104. .ctab{
  105. width: 100%;
  106. margin: 20rpx 0 0rpx 0rpx;
  107. padding: 0 22rpx;
  108. }
  109. // 商品列表
  110. .com{
  111. width: 100%;
  112. overflow: hidden;
  113. .list{
  114. border-radius: 10rpx;
  115. overflow: hidden;
  116. margin: 20rpx 32rpx;
  117. background-color: #FFFFFF;
  118. box-shadow:0 0 10px 5px #e5e5e5;
  119. align-items: flex-start;
  120. .left{
  121. overflow: hidden;
  122. image{
  123. width: 204rpx;
  124. height: 204rpx;
  125. margin: 20rpx;
  126. border-radius: 10rpx;
  127. }
  128. }
  129. .right{
  130. overflow: hidden;
  131. width: 64%;
  132. .title{
  133. margin: 18rpx 20rpx 0 0;
  134. color: #222222;
  135. font-size: 32rpx;
  136. }
  137. .tips{
  138. margin: 16rpx 0;
  139. overflow: hidden;
  140. .u-line-progress{
  141. width: 112rpx;
  142. overflow: hidden;
  143. margin-right:20rpx ;
  144. }
  145. .progress{
  146. color: #777777;
  147. font-size: 24rpx;
  148. }
  149. .bought{
  150. color: #777777;
  151. font-size: 24rpx;
  152. margin-right: 20rpx;
  153. }
  154. }
  155. .price{
  156. overflow: hidden;
  157. color:#FF0000;
  158. text{
  159. font-size: 48rpx;
  160. color:#FF0000;
  161. font-weight: 500;
  162. }
  163. text:nth-child(1){
  164. color: #FF0000;
  165. font-size: 28rpx;
  166. }
  167. text:nth-child(2){
  168. color: #FF0000;
  169. font-size: 48rpx;
  170. }
  171. text:nth-child(3){
  172. color: #FF0000;
  173. font-size: 28rpx;
  174. }
  175. text:nth-child(4){
  176. color: #777777;
  177. font-size: 28rpx;
  178. text-decoration:line-through;
  179. font-weight: 400;
  180. }
  181. button{
  182. width: 160rpx;
  183. height: 60rpx;
  184. background: #FE9903;
  185. border-radius: 15px;
  186. font-size: 24rpx;
  187. color: #FFFFFF;
  188. margin: 0rpx 20rpx 0rpx 20rpx;
  189. border: none;
  190. }
  191. }
  192. }
  193. }
  194. }
  195. </style>