Arrivalnotice.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template><page-meta :root-font-size="fontSize+'px'"></page-meta>
  2. <member-base :show="false"><view style="position: absolute;top:0;right:0;left:0;bottom:0" class="scroll-view-wrapper div container member-arrivalnotice">
  3. <view class="div common-header-wrap">
  4. <view class="status-holder"></view>
  5. <view :style="'height:'+navHeight+'px'"></view>
  6. <view class="common-header-holder"></view>
  7. <view class="common-header-fixed">
  8. <title-header />
  9. <uni-nav-bar title="到货通知" class="common-header" left-icon="back" @clickLeft="goBack()">
  10. </uni-nav-bar>
  11. </view>
  12. </view>
  13. <view class="scroll-view div" style="position:relative">
  14. <scroll-view style="position: absolute;top:0;right:0;left:0;bottom:0" class="div" @scrolltolower="loadMore" scroll-y="true">
  15. <view class='div item-wrapper' v-if="arrivalnotice_list && arrivalnotice_list.length">
  16. <view class='div item-list' v-for="(item, index) in arrivalnotice_list" :key='index' @click="onDelete(item.arrivalnotice_id)">
  17. <view class="div info" @click="goGoods(item.goods_id)">
  18. <view class="div title" >{{ item.goods_name }}</view>
  19. <view class="div time">{{ $moment.unix(item.arrivalnotice_addtime).format('YYYY.MM.DD') }}</view>
  20. </view>
  21. <view class="div right" :class="item.arrivalnotice_state==2?'number':'diture'">{{ item.arrivalnotice_state==2?'已通知':'未通知' }}</view>
  22. </view>
  23. </view>
  24. <empty-record v-else-if="arrivalnotice_list && !arrivalnotice_list.length"></empty-record>
  25. </scroll-view>
  26. </view>
  27. </view>
  28. </member-base>
  29. </template>
  30. <script>
  31. import {getFontSize} from '@/util/common'
  32. import TitleHeader from '../../TitleHeader'
  33. import { urlencode } from '@/util/common'
  34. import MemberBase from '../MemberBase'
  35. import { getArrivalnoticeList, delArrivalnotice } from '../../../api/memberArrivalnotice'
  36. import EmptyRecord from '../../EmptyRecord'
  37. export default {
  38. components:{
  39. TitleHeader,
  40. MemberBase,
  41. EmptyRecord
  42. },
  43. computed:{
  44. fontSize(){
  45. return getFontSize()
  46. },
  47. },
  48. data(){
  49. return {
  50. navHeight: 0,
  51. params: { 'page': 0, 'per_page': 10 },
  52. loading: false, // 是否加载更多
  53. isMore: true, // 是否有更多
  54. wrapperHeight: 0,
  55. arrivalnotice_list: false
  56. }
  57. },
  58. created () {
  59. this.loadMore()
  60. },
  61. mounted(){
  62. // #ifdef MP-WEIXIN
  63. this.navHeight = uni.getMenuButtonBoundingClientRect().top
  64. // #endif
  65. this.wrapperHeight = uni.getSystemInfoSync().windowHeight - 130
  66. },
  67. methods:{
  68. goBack () {
  69. uni.navigateBack({delta:1})
  70. },
  71. loadMore () {
  72. this.loading = true
  73. this.params.page = ++this.params.page
  74. if (this.isMore) {
  75. this.loading = false
  76. this.getArrivalnoticeList(true)
  77. }
  78. },
  79. getArrivalnoticeList () {
  80. uni.showLoading({ title: '加载中' })
  81. getArrivalnoticeList(this.params).then(res => {
  82. uni.hideLoading()
  83. if (res.result.hasmore) {
  84. this.isMore = true
  85. } else {
  86. this.isMore = false
  87. }
  88. let temp = res.result.arrivalnotice_list
  89. if (temp) {
  90. if (!this.arrivalnotice_list) {
  91. this.arrivalnotice_list = temp
  92. } else {
  93. this.arrivalnotice_list = this.arrivalnotice_list.concat(temp)
  94. }
  95. }
  96. }).catch(function (error) {
  97. uni.hideLoading()
  98. uni.showToast({icon:'none',title: error.message})
  99. })
  100. },
  101. reload () {
  102. this.params = { 'page': 0, 'per_page': 10 }
  103. this.loading = false
  104. this.isMore = true
  105. this.arrivalnotice_list = false
  106. this.loadMore()
  107. },
  108. goGoods (goods_id) {
  109. uni.navigateTo({ url: '/pages/home/goodsdetail/Goodsdetail'+'?'+urlencode( { 'goods_id': goods_id } )})
  110. }
  111. }
  112. }
  113. </script>
  114. <style scoped lang="scss">
  115. .scroll-view-wrapper{display: flex;flex-direction: column;}
  116. .scroll-view{flex:1}
  117. .container {
  118. height: 100%;
  119. display: flex;
  120. position: relative;
  121. flex-direction: column;
  122. justify-content: flex-start;
  123. align-items: stretch;
  124. }
  125. .header {
  126. border-bottom: 1px solid #e8eaed;
  127. }
  128. .item-wrapper {
  129. flex: 1;
  130. display: flex;
  131. flex-direction: column;
  132. justify-content: flex-start;
  133. align-items: stretch;
  134. .item-list {
  135. background-color: #fff;
  136. border-bottom: 1px solid #e8eaed;
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. padding: 0.55rem 0.75rem;
  141. .right{width:2.5rem;}
  142. .info {
  143. flex:1;
  144. .title {
  145. font-size:$subFontSize;
  146. color: #333;
  147. }
  148. .time {
  149. font-size:$fontSize;
  150. color: #999;
  151. margin-top:0.25rem;
  152. }
  153. }
  154. .number {
  155. font-size:$h2;
  156. color:$primaryColor;
  157. }
  158. .diture {
  159. font-size:$h2;
  160. color: rgba(102, 102, 102, 1);
  161. }
  162. }
  163. }
  164. </style>