selReservoir.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view class="selSupplier">
  3. <view class="supplier-ul">
  4. <view class="supplier-li" v-for="(item, index) in reservoir_list" :key="index" @click="changeData(item)">
  5. {{ item.reservoirName }}
  6. </view>
  7. </view>
  8. <u-loadmore :status="load_status" />
  9. </view>
  10. </template>
  11. <script>
  12. export default {
  13. data() {
  14. return {
  15. load_status: 'nomore',
  16. reservoir_list: []
  17. };
  18. },
  19. onLoad() {
  20. this.getListReservoir();
  21. },
  22. onPullDownRefresh() {
  23. this.getListReservoir();
  24. },
  25. methods: {
  26. changeData(item) {
  27. // 选择供应商返回上一页
  28. this._prePage().reservoirData = item;
  29. uni.navigateBack();
  30. },
  31. getListReservoir() {
  32. this.$u.api
  33. .getListReservoir()
  34. .then(res => {
  35. uni.stopPullDownRefresh();
  36. this.reservoir_list = res.data;
  37. })
  38. .catch(err => {
  39. uni.stopPullDownRefresh();
  40. });
  41. }
  42. }
  43. };
  44. </script>
  45. <style lang="scss" scoped>
  46. .supplier-ul {
  47. padding-bottom: 20rpx;
  48. .supplier-li {
  49. width: 702rpx;
  50. margin: 0 auto;
  51. background-color: #ffffff;
  52. border-radius: 10rpx;
  53. margin-top: 20rpx;
  54. font-weight: bold;
  55. line-height: 90rpx;
  56. padding: 0 30rpx;
  57. }
  58. }
  59. </style>