commodity.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <view class="content">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  5. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index)">{{ item.text }}</view>
  6. </view>
  7. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
  8. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex">
  9. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  10. <!-- 空白页 -->
  11. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  12. <!-- 已上架 -->
  13. <view class="commodity-box">
  14. <view class="commodity">
  15. <view class="commodity-detail">
  16. <view class="commodity-img">
  17. <image src="../../static/user/ground.png" mode=""></image>
  18. </view>
  19. <view class="commodity-content">
  20. <view class="top">
  21. 满园春11111111111111111111111111111111111
  22. </view>
  23. <view class="bottom">
  24. <view class="price">
  25. <text class="text">¥</text>999
  26. </view>
  27. <view class="status">
  28. 已上架
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  35. <view class="input">
  36. 添加商品
  37. </view>
  38. </view>
  39. </scroll-view>
  40. </swiper-item>
  41. </swiper>
  42. </view>
  43. </template>
  44. <script>
  45. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  46. export default {
  47. data() {
  48. return {
  49. tabCurrentIndex: 0,
  50. navList: [{
  51. state: 0,
  52. text: '全部',
  53. orderList: [],
  54. page: 1, //当前页面
  55. limit: 10 //每次信息条数
  56. },
  57. {
  58. state: 0,
  59. text: '已上架',
  60. orderList: [],
  61. page: 1, //当前页面
  62. limit: 10 //每次信息条数
  63. },
  64. {
  65. state: 0,
  66. text: '已下架',
  67. orderList: [],
  68. page: 1, //当前页面
  69. limit: 10 //每次信息条数
  70. }
  71. ]
  72. };
  73. },
  74. methods: {
  75. //顶部tab点击
  76. tabClick(index) {
  77. this.tabCurrentIndex = index;
  78. },
  79. }
  80. }
  81. </script>
  82. <style lang="scss">
  83. page,
  84. .content {
  85. background: $page-color-base;
  86. height: 100%;
  87. }
  88. .swiper-box {
  89. height: calc(100% - 40px);
  90. }
  91. .list-scroll-content {
  92. height: 100%;
  93. }
  94. .commodity-box {
  95. width: 750rpx;
  96. margin: 20rpx 0;
  97. background-color: #FFFFFF;
  98. .commodity {
  99. .checkbox1 {
  100. font-size: 44rpx;
  101. line-height: 1;
  102. padding: 4rpx;
  103. color: $font-color-disabled;
  104. background: red;
  105. border-radius: 50rpx;
  106. }
  107. .commodity-detail {
  108. padding: 30rpx 0;
  109. display: flex;
  110. .commodity-img {
  111. margin: 0 30rpx;
  112. width: 147rpx;
  113. height: 146rpx;
  114. border-radius: 10rpx;
  115. image {
  116. width: 100%;
  117. height: 100%;
  118. }
  119. }
  120. .commodity-content {
  121. width: 500rpx;
  122. display: flex;
  123. flex-direction: column;
  124. justify-content: space-between;
  125. .top {
  126. white-space: nowrap;
  127. overflow: hidden;
  128. text-overflow: ellipsis;
  129. font-size: 28rpx;
  130. font-family: PingFangSC;
  131. font-weight: 500;
  132. color: #333333;
  133. }
  134. .bottom {
  135. display: flex;
  136. justify-content: space-between;
  137. align-items: center;
  138. .price {
  139. font-size: 36rpx;
  140. font-family: PingFang SC;
  141. font-weight: bold;
  142. color: #FD5B23;
  143. .text{
  144. font-size: 24rpx;
  145. font-family: PingFang SC;
  146. font-weight: bold;
  147. color: #FD5B23;
  148. }
  149. }
  150. .status {
  151. width: 80rpx;
  152. height: 34rpx;
  153. background: #FEE1D7;
  154. border-radius: 5rpx;
  155. font-size: 20rpx;
  156. font-family: PingFangSC;
  157. font-weight: 500;
  158. color: #FD5B23;
  159. }
  160. }
  161. }
  162. }
  163. }
  164. .input{
  165. margin: 30rpx;
  166. text-align: center;
  167. position: absolute;
  168. bottom: 0;
  169. width: 674rpx;
  170. height: 88rpx;
  171. background: #52C696;
  172. border-radius: 44rpx;
  173. font-size: 36rpx;
  174. font-family: PingFang SC;
  175. font-weight: 500;
  176. line-height: 88rpx;
  177. color: #FFFFFF;
  178. }
  179. }
  180. .navbar {
  181. display: flex;
  182. height: 40px;
  183. padding: 0 5px;
  184. background: #fff;
  185. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  186. position: relative;
  187. z-index: 10;
  188. .nav-item {
  189. flex: 1;
  190. display: flex;
  191. justify-content: center;
  192. align-items: center;
  193. height: 100%;
  194. font-size: 12px;
  195. color: $font-color-dark;
  196. position: relative;
  197. &.current {
  198. color: $base-color;
  199. &:after {
  200. content: '';
  201. position: absolute;
  202. left: 50%;
  203. bottom: 0;
  204. transform: translateX(-50%);
  205. width: 44px;
  206. height: 0;
  207. border-bottom: 2px solid $base-color;
  208. }
  209. }
  210. }
  211. }
  212. </style>