index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <view class="picking-task-page">
  3. <u-navbar height="40px" title="拣货任务" bgColor="#F0F6FB" autoBack placeholder>
  4. <view class="u-nav-slot btn-right" slot="right" @click="stashClick">
  5. <view class="cang-name">{{cangName}}</view>
  6. <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
  7. </view>
  8. </u-navbar>
  9. <view class="container_main">
  10. <u-sticky :offsetTop="offsetTop" bgColor="#F0F6FB">
  11. <view class="search-box">
  12. <u-search placeholder="请输入单据编号" bgColor="#fff" shape="square" v-model="searchKey" :showAction="false"></u-search>
  13. <view class="flex_box">
  14. <view class="scan-text">扫描单据二维码</view>
  15. <view class="scan-icon">
  16. <image src="@/static/image/scan-icon.png" mode=""></image>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="type-box flex_box">
  21. <view class="type-item">
  22. <view class="type-val">{{type1}}</view>
  23. <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
  24. </view>
  25. <view class="type-item">
  26. <view class="type-val">{{type2}}</view>
  27. <u-icon name="arrow-down-fill" color="#999999" size="12"></u-icon>
  28. </view>
  29. </view>
  30. </u-sticky>
  31. <view class="task-cont">
  32. <block v-for="item in 10" :key="">
  33. <task-item></task-item>
  34. </block>
  35. </view>
  36. </view>
  37. <!-- 中心仓弹窗 -->
  38. <u-picker :show="stashShow" :defaultIndex="defaultIndex" :columns="columnsList" @confirm="pickerConfirm" @cancel="stashShow= false"></u-picker>
  39. </view>
  40. </template>
  41. <script>
  42. import taskItem from '@/components/task-item/task-item.vue'
  43. export default{
  44. components:{
  45. taskItem
  46. },
  47. data() {
  48. return {
  49. offsetTop:0,
  50. cangName:'鹏越中心仓',
  51. searchKey:'',
  52. type1:'全部',
  53. type2:'月份',
  54. stashShow:false,
  55. columnsList:[],
  56. stashColumns:[
  57. ['鹏越中心仓','美团中心仓']
  58. ],
  59. defaultIndex:[],
  60. pickType:0,//1.中心仓
  61. }
  62. },
  63. onLoad() {
  64. let systemInfo = uni.getSystemInfoSync();
  65. let statusBarHeight = systemInfo.statusBarHeight;
  66. this.offsetTop = statusBarHeight + 40
  67. console.log('状态栏的高度是:' + statusBarHeight + 'px');
  68. },
  69. methods:{
  70. stashClick() {
  71. this.pickType = 1
  72. this.columnsList = this.stashColumns
  73. this.defaultIndex = this.getDefaultIndex(this.cangName)
  74. this.stashShow = true
  75. },
  76. pickerConfirm(val) {
  77. if(this.pickType == 1) {
  78. this.cangName = val.value[0]
  79. }
  80. this.stashShow = false
  81. },
  82. // 获取picker默认index
  83. getDefaultIndex(val) {
  84. let arr = []
  85. let index = this.columnsList[0].findIndex(item=>item == val)
  86. arr = [index]
  87. return arr
  88. }
  89. }
  90. }
  91. </script>
  92. <style lang="scss" scoped>
  93. .btn-right {
  94. display: flex;
  95. align-items: center;
  96. .cang-name {
  97. color: #0256FF;
  98. text-align: center;
  99. font-family: "PingFang SC";
  100. font-size: 28rpx;
  101. font-weight: 600;
  102. margin-right: 10rpx;
  103. }
  104. }
  105. .picking-task-page {
  106. min-height: 100vh;
  107. background: #F0F6FB;
  108. .container_main {
  109. .search-box {
  110. display: flex;
  111. align-items: center;
  112. padding: 0 32rpx;
  113. .scan-text {
  114. color: #333;
  115. font-family: "PingFang SC";
  116. font-size: 24rpx;
  117. font-weight: 400;
  118. margin-right: 20rpx;
  119. margin-left: 30rpx;
  120. }
  121. .scan-icon {
  122. width: 36rpx;
  123. height: 36rpx;
  124. background-color: #fff;
  125. border-radius: 50%;
  126. display: flex;
  127. align-items: center;
  128. justify-content: center;
  129. image {
  130. width: 24rpx;
  131. height: 24rpx;
  132. }
  133. }
  134. }
  135. .type-box {
  136. .type-item {
  137. width: 50%;
  138. height: 88rpx;
  139. display: flex;
  140. align-items: center;
  141. justify-content: center;
  142. .type-val {
  143. color: #000;
  144. font-family: "PingFang SC";
  145. font-size: 28rpx;
  146. font-weight: 400;
  147. margin-right: 10rpx;
  148. }
  149. }
  150. }
  151. .task-cont {
  152. padding: 0 24rpx;
  153. }
  154. }
  155. }
  156. </style>