boatList.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="page" :style="{'min-height':(h)+'px','padding-top':mt+'px'}">
  3. <c-nav-bar title="船只管理"></c-nav-bar>
  4. <view class="list">
  5. <view class="item" v-for="(i,index) in data" :key="index" >
  6. <div>
  7. <div style="font-size: 32rpx;font-weight: bold;">{{i.boatName}}</div>
  8. <div style="font-size: 24rpx;font-weight: normal;margin-top: 12rpx;">
  9. {{i.boatNo}} {{i.capacity}}座
  10. </div>
  11. </div>
  12. <div style="position: absolute;right: 20rpx;top: 20rpx;font-size: 24rpx;">
  13. <div style="color: #007BFF;" v-if="i.sailFlag==0">在港</div>
  14. <div style="color: #28A745;" v-if="i.sailFlag==1">已出航</div>
  15. </div>
  16. <div v-if="i.sailFlag==1" @click="back(i.boatNo)" style="font-size: 32rpx;position: absolute;right: 20rpx;bottom: 20rpx;background-color: #007A69;color: #fff;padding: 6rpx 24rpx;border-radius: 12rpx;">回港</div>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. date: new Date().Format('yyyy-MM-dd'),
  26. show: false,
  27. data: [],
  28. }
  29. },
  30. onLoad() {
  31. this.getList();
  32. },
  33. methods: {
  34. back(no){
  35. this.$api.get(`/scenic/api/boat/boatSailBack/${uni.getStorageSync('merchantId')}/${no}`).then(res=>{
  36. if(res.data.code==0){
  37. if(res.data.msg == 'success'){
  38. this.$showToast('操作成功')
  39. this.getList()
  40. }
  41. }else{
  42. this.$showToast(res.data.msg)
  43. }
  44. })
  45. },
  46. jj(){
  47. uni.navigateTo({
  48. url:'/pagesHouse/Verification/success'
  49. })
  50. },
  51. dd(){
  52. uni.navigateTo({
  53. url:'/pagesHouse/Verification/record'
  54. })
  55. },
  56. getList(){
  57. this.$api.get('/scenic/api/boat/page?page=1&limit=999&merchantId='+ uni.getStorageSync('merchantId')).then(res=>{
  58. if(res.data.code==0){
  59. console.log(res)
  60. this.data=res.data.data.list;
  61. }
  62. })
  63. },
  64. check(item) {
  65. // #ifdef APP-PLUS
  66. uni.navigateTo({
  67. url: '/pagesHouse/Verification/checkApp?=&boatNo='+item.BOAT_NO
  68. })
  69. // #endif
  70. // #ifdef MP-WEIXIN
  71. uni.navigateTo({
  72. url: '/pagesHouse/Verification/check?=&boatNo='+item.BOAT_NO
  73. })
  74. // #endif
  75. }
  76. }
  77. }
  78. </script>
  79. <style lang="less" scoped>
  80. .page {
  81. background: #F5F8FA;
  82. padding-bottom: 40rpx;
  83. box-sizing: border-box;
  84. }
  85. .list {
  86. box-sizing: border-box;
  87. padding: 30rpx 30rpx 0;
  88. .item {
  89. height: 160rpx;
  90. display: flex;
  91. justify-content: space-between;
  92. padding: 0 24rpx;
  93. background-color: #fff;
  94. align-items: center;
  95. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  96. margin-bottom: 20rpx;
  97. border-radius: 16rpx;
  98. position: relative;
  99. text {
  100. &:first-child {
  101. font-size: 54rpx;
  102. font-weight: bold;
  103. color: #111;
  104. }
  105. &:last-child {
  106. display: inline-block;
  107. width: 168rpx;
  108. height: 88rpx;
  109. line-height: 88rpx;
  110. text-align: center;
  111. background-color: #007A69;
  112. color: #fff;
  113. font-size: 32rpx;
  114. border-radius: 44rpx;
  115. }
  116. }
  117. }
  118. }
  119. </style>