sell.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="zaiui-sell-box" :class="show?'show':''">
  3. <view class="zaiui-bar-view-box">
  4. <!--小程序端的标题-->
  5. <!-- #ifdef MP -->
  6. <view class="text-center text-black zaiui-small-routine-title">卖二手</view>
  7. <!-- #endif -->
  8. <!--标题栏-->
  9. <view class="text-gray zaiui-bar-box">
  10. <text class="text-black text-lg">发布闲置</text>
  11. <text class="margin-left-sm">平台帮你卖 极速成交</text>
  12. <text class="cuIcon-close text-right close" @tap="closeTap"></text>
  13. </view>
  14. </view>
  15. <!--占位的-->
  16. <view class="zaiui-seat-height"></view>
  17. <!--中间内容区域-->
  18. <view class="zaiui-view-content">
  19. <type-list :list_data="typeListData" @listTap="typeListTap"></type-list>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import typeList from '@/components/zaiui-common/list/type-list';
  25. import _sell_data from '@/static/zaiui/data/sell.js'; //虚拟数据
  26. import _tool from '@/static/zaiui/util/tools.js'; //工具函数
  27. export default {
  28. name: 'sell',
  29. components: {
  30. typeList
  31. },
  32. data() {
  33. return {
  34. typeListData: [],
  35. }
  36. },
  37. props: {
  38. show: {
  39. type: Boolean,
  40. default: true
  41. },
  42. scrollY: {
  43. type: Number,
  44. default: 0
  45. },
  46. scrollBottom: {
  47. type: Number,
  48. default: 0
  49. }
  50. },
  51. watch: {
  52. scrollY() {
  53. //通知他妈的滚动了。
  54. this.setPageScroll(this.scrollY);
  55. },
  56. scrollBottom() {
  57. if(this.scrollBottom != 0) {
  58. //通知他妈的触底了
  59. this.setReachBottom();
  60. }
  61. },
  62. },
  63. created() {
  64. //加载虚拟数据
  65. this.typeListData = _sell_data.typeListData();
  66. },
  67. mounted() {
  68. _tool.setBarColor(true);
  69. uni.pageScrollTo({
  70. scrollTop: 0,
  71. duration: 0
  72. });
  73. },
  74. methods: {
  75. //页面被滚动
  76. setPageScroll(scrollTop) {
  77. //console.log(scrollTop);
  78. },
  79. //触底了
  80. setReachBottom() {
  81. console.log('触底了');
  82. },
  83. closeTap() {
  84. this.$emit('closeTap');
  85. },
  86. typeListTap(e) {
  87. console.log(e);
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .zaiui-sell-box {
  94. background: #FAFAFA;
  95. position: relative;
  96. min-height: 100vh;
  97. z-index: 999;
  98. width: 100%;
  99. display: none;
  100. .zaiui-bar-view-box {
  101. position: fixed;
  102. top: 0;
  103. width: 100%;
  104. z-index: 999;
  105. background: #FAFAFA;
  106. /* #ifndef MP */
  107. height: calc(var(--status-bar-height) + 99.99upx);
  108. /* #endif */
  109. /* #ifdef MP */
  110. height: calc(var(--status-bar-height) + 189.99upx);
  111. /* #endif */
  112. padding: var(--status-bar-height) 27.27upx 0 27.27upx;
  113. align-items: center;
  114. .zaiui-bar-box {
  115. position: relative;
  116. width: 100%;
  117. align-items: center;
  118. line-height: 99.99upx;
  119. .close {
  120. position: absolute;
  121. right: 27.27upx;
  122. font-size: 40upx;
  123. bottom: 9.09upx;
  124. }
  125. }
  126. }
  127. .zaiui-seat-height {
  128. width: 100%;
  129. /* #ifndef MP */
  130. height: calc(var(--status-bar-height) + 99.99upx);
  131. /* #endif */
  132. /* #ifdef MP */
  133. height: calc(var(--status-bar-height) + 199.99upx);
  134. /* #endif */
  135. }
  136. .zaiui-view-content {
  137. padding: 0 27.27upx 27.27upx;
  138. }
  139. }
  140. .zaiui-sell-box.show {
  141. display: block;
  142. }
  143. </style>