index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <view class="pages" :style="{'min-height':h+'px','padding-top':(mt)+'px'}">
  3. <c-nav-bar title="商品管理"></c-nav-bar>
  4. <view class="tb">
  5. <view class="tabs">
  6. <view v-for="(item,index) in tabList" :key="index" @tap="changeTab1(index)">
  7. <text :class="index==current?'active':''">{{item.name}}</text>
  8. </view>
  9. </view>
  10. </view>
  11. <view class="mainContain">
  12. <view class="nodata" v-if='dataList.length==0'>
  13. <NoData></NoData>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import TopTabs from '@/components/TopTabs/topTabs.vue';
  20. // import NoData from '../../components/NoData/index.vue';
  21. export default {
  22. components: {
  23. TopTabs,
  24. // NoData
  25. },
  26. data() {
  27. return {
  28. h: uni.getSystemInfoSync().windowHeight,
  29. mt: uni.getSystemInfoSync().statusBarHeight + 44,
  30. current: 0,
  31. tabList: [{
  32. name: '出售中'
  33. },
  34. {
  35. name: '待上架'
  36. },
  37. ],
  38. }
  39. },
  40. onLoad(option) {
  41. console.log(option);
  42. },
  43. methods: {
  44. changeTab1(item, index) {
  45. console.log(item, index);
  46. this.current = index;
  47. },
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .pages {
  53. background: #F9FAFC;
  54. box-sizing: border-box;
  55. .tb {
  56. width: 100%;
  57. top: 0;
  58. left: 0;
  59. z-index: 999;
  60. .searchBoxParent {
  61. width: 100%;
  62. background: #fff;
  63. padding: 20rpx 24rpx 6rpx;
  64. box-sizing: border-box;
  65. .searchBox {
  66. width: 100%;
  67. background-color: #fff;
  68. }
  69. }
  70. .tabs {
  71. background: #fff;
  72. padding: 26rpx 0;
  73. display: flex;
  74. align-items: center;
  75. width: 100%;
  76. &>view {
  77. width: 25%;
  78. font-size: 28rpx;
  79. font-family: PingFangSC-Regular, PingFang SC;
  80. font-weight: 400;
  81. color: black;
  82. line-height: 40rpx;
  83. position: relative;
  84. text-align: center;
  85. }
  86. .active {
  87. font-size: 32rpx;
  88. font-family: PingFang-SC-Bold, PingFang-SC;
  89. font-weight: bold;
  90. color: black;
  91. line-height: 45rpx;
  92. }
  93. .active::after {
  94. position: absolute;
  95. content: '';
  96. width: 50rpx;
  97. height: 8rpx;
  98. background: #007A69;
  99. bottom: -26rpx;
  100. left: 60%;
  101. margin-left: -42rpx;
  102. }
  103. }
  104. }
  105. .green {}
  106. .mainContain {
  107. display: flex;
  108. flex-direction: column;
  109. padding: 0 20rpx;
  110. .nodata {
  111. background: white;
  112. }
  113. .card {
  114. background: #fff;
  115. border-radius: 16rpx;
  116. margin: 20rpx 0;
  117. padding: 20rpx;
  118. .header {
  119. display: flex;
  120. justify-content: space-between;
  121. border-bottom: 1px #f3f3f3 solid;
  122. padding: 20rpx;
  123. .red {
  124. color: indianred;
  125. }
  126. .green {
  127. color: #999999;
  128. }
  129. .blue {
  130. color: #1372FF;
  131. }
  132. .grey {
  133. color: #4C5F76;
  134. }
  135. .orange {
  136. color: #FF9100;
  137. }
  138. }
  139. .mainContent {
  140. // border-bottom: 1px #f3f3f3 solid;
  141. display: flex;
  142. padding: 20rpx 0;
  143. // justify-content: space-evenly;
  144. .image {
  145. background-repeat: no-repeat;
  146. background-size: cover;
  147. width: 198rpx;
  148. height: 180rpx;
  149. border-radius: 16rpx;
  150. }
  151. .middle {
  152. padding-top: 16rpx;
  153. color: #777777;
  154. // display: flex;
  155. // flex-direction: column;
  156. // justify-content: space-between;
  157. margin-left: 25rpx;
  158. width: 100%;
  159. .title {
  160. font-weight: 700;
  161. font-size: 32rpx;
  162. color: black;
  163. }
  164. .info {
  165. padding-top: 30rpx;
  166. color: #777777;
  167. // display: flex;
  168. // flex-direction: column;
  169. &>span {
  170. margin-top: 10rpx;
  171. }
  172. }
  173. }
  174. .price {
  175. color: red;
  176. text-align: center;
  177. height: 100%;
  178. align-items: center;
  179. align-self: center;
  180. font-size: 29rpx;
  181. font-weight: 700;
  182. }
  183. }
  184. .bottom {
  185. // padding: 30rpx 20rpx;
  186. display: flex;
  187. justify-content: flex-end;
  188. .detail {
  189. // border: 1rpx solid darkgrey;
  190. border-radius: 16rpx;
  191. color: darkgrey;
  192. padding: 13rpx 34rpx;
  193. background-color: #F6F6F6;
  194. font-size: 26rpx;
  195. color: #333333;
  196. font-weight: Regular;
  197. }
  198. .del {
  199. border-radius: 16rpx;
  200. color: darkgrey;
  201. padding: 13rpx 34rpx;
  202. background-color: #007A69;
  203. font-size: 26rpx;
  204. color: #fff;
  205. font-weight: Regular;
  206. }
  207. }
  208. }
  209. }
  210. }
  211. </style>