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

197 lines
4.2 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
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. this.$http(this.API.API_GOODS_LIST, {data: 1}).then(res => {
  79. console.log(res);
  80. }).catch(err => err);
  81. },
  82. methods: {
  83. change(index) {
  84. this.current = index;
  85. },
  86. },
  87. onReachBottom(){
  88. console.log("页面触底")
  89. },
  90. onPullDownRefresh(){
  91. console.log("下拉刷新");
  92. uni.stopPullDownRefresh()
  93. }
  94. }
  95. </script>
  96. <style lang="scss" scoped>
  97. .title {
  98. font-size: 28rpx;
  99. color: $u-content-color;
  100. }
  101. // tab
  102. .ctab{
  103. width: 100%;
  104. margin: 20rpx 0 0rpx 0rpx;
  105. padding: 0 22rpx;
  106. }
  107. // 商品列表
  108. .com{
  109. width: 100%;
  110. overflow: hidden;
  111. .list{
  112. border-radius: 10rpx;
  113. overflow: hidden;
  114. margin: 20rpx 32rpx;
  115. background-color: #FFFFFF;
  116. box-shadow:0 0 10px 5px #e5e5e5;
  117. align-items: flex-start;
  118. .left{
  119. overflow: hidden;
  120. image{
  121. width: 204rpx;
  122. height: 204rpx;
  123. margin: 20rpx;
  124. border-radius: 10rpx;
  125. }
  126. }
  127. .right{
  128. overflow: hidden;
  129. width: 64%;
  130. .title{
  131. margin: 18rpx 20rpx 0 0;
  132. color: #222222;
  133. font-size: 32rpx;
  134. }
  135. .tips{
  136. margin: 16rpx 0;
  137. overflow: hidden;
  138. .u-line-progress{
  139. width: 112rpx;
  140. overflow: hidden;
  141. margin-right:20rpx ;
  142. }
  143. .progress{
  144. color: #777777;
  145. font-size: 24rpx;
  146. }
  147. .bought{
  148. color: #777777;
  149. font-size: 24rpx;
  150. margin-right: 20rpx;
  151. }
  152. }
  153. .price{
  154. overflow: hidden;
  155. color:#FF0000;
  156. text{
  157. font-size: 48rpx;
  158. color:#FF0000;
  159. font-weight: 500;
  160. }
  161. text:nth-child(1){
  162. color: #FF0000;
  163. font-size: 28rpx;
  164. }
  165. text:nth-child(2){
  166. color: #FF0000;
  167. font-size: 48rpx;
  168. }
  169. text:nth-child(3){
  170. color: #FF0000;
  171. font-size: 28rpx;
  172. }
  173. text:nth-child(4){
  174. color: #777777;
  175. font-size: 28rpx;
  176. text-decoration:line-through;
  177. font-weight: 400;
  178. }
  179. button{
  180. width: 160rpx;
  181. height: 60rpx;
  182. background: #FE9903;
  183. border-radius: 15px;
  184. font-size: 24rpx;
  185. color: #FFFFFF;
  186. margin: 0rpx 20rpx 0rpx 20rpx;
  187. border: none;
  188. }
  189. }
  190. }
  191. }
  192. }
  193. </style>