port.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <view>
  3. <uni-table border stripe emptyText="暂无更多数据" min-width='250px' >
  4. <uni-tr>
  5. <uni-th align="center" width="80">港口</uni-th>
  6. <uni-th align="center" width="100">价格</uni-th>
  7. <uni-th align="center" width="50">水分</uni-th>
  8. <uni-th align="center" width="50">容重</uni-th>
  9. </uni-tr>
  10. <uni-tr v-for="(item, index) in portInfo" >
  11. <uni-td align="center">{{item.port+"("+item.northSouth+")"}}</uni-td>
  12. <uni-td align="center">{{item.price+"("+item.newOld+")"}}</uni-td>
  13. <uni-td align="center">{{item.waterContent}}</uni-td>
  14. <uni-td align="center">{{item.bulkDensity}}</uni-td>
  15. </uni-tr>
  16. </uni-table>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {
  23. portInfo:[]
  24. }
  25. },
  26. onLoad(){
  27. this.loadData()
  28. },
  29. onPullDownRefresh() {
  30. this.loadData()
  31. },
  32. methods: {
  33. loadData(){
  34. uni.showLoading({
  35. title: '正在加载',
  36. mask:true
  37. })
  38. var that = this
  39. that.$api.request('port', 'getNewsInfo', failres => {
  40. that.$api.msg(failres.errmsg)
  41. uni.hideLoading()
  42. uni.stopPullDownRefresh()
  43. }).then(res => {
  44. this.portInfo = res.data
  45. uni.hideLoading()
  46. uni.stopPullDownRefresh()
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style>
  53. </style>