bindlog.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view class="body">
  3. <view class="content">
  4. <u-toast ref="uToast" />
  5. <view>
  6. <!-- <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltolower="lower" lower-threshold="100" >
  7. </scroll-view> -->
  8. <view class="paddingOder">
  9. <view class="model" v-for="(item,index) in noticeList" :key=index>
  10. <ul>
  11. <li>
  12. <view class="Number">
  13. <p
  14. style="width: 1vw; height: 1vw; background-color: blue; border-radius: 50%; margin-top: 2vw; margin-right: 2vw;">
  15. </p>
  16. <p>品牌:</p>
  17. <p style="margin-left: 2vw;">{{item.model}}</p>
  18. </view>
  19. <view class="playOder">
  20. <p
  21. style="width: 1vw; height: 1vw; background-color: red; border-radius: 50%; margin-top: 2vw; margin-right: 2vw;">
  22. </p>
  23. <p>姓名:</p>
  24. <p style="margin-left: 2vw;">{{item.name}}</p>
  25. </view>
  26. <view class="playOder">
  27. <p
  28. style="width: 1vw; height: 1vw; background-color: red; border-radius: 50%; margin-top: 2vw; margin-right: 2vw;">
  29. </p>
  30. <p>电话:</p>
  31. <p style="margin-left: 2vw; ">{{item.tel}}</p>
  32. </view>
  33. <view class="playOder">
  34. <p
  35. style="width: 1vw; height: 1vw; background-color: green; border-radius: 50%; margin-top: 2vw; margin-right: 2vw;">
  36. </p>
  37. <p>车牌:</p>
  38. <p style="margin-left: 2vw; color: red;">{{item.number}}</p>
  39. </view>
  40. </li>
  41. <li :style="{backgroundColor:item.has_orders==true? 'red' : 'grey' }"
  42. @click="maintenanceLog(item)"> {{ item.has_orders==true? '维修记录' : '暂无记录' }} </li>
  43. </ul>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="button" @click="submit">添加绑定</view>
  49. </view>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. trailerKeyboardShow: true,
  56. control: false,
  57. scrollTop: 0,
  58. token: '',
  59. noticeList: [],
  60. page: 1,
  61. totals: '',
  62. pageSize: '',
  63. status: 1
  64. }
  65. },
  66. onLoad() {
  67. this.getNoticeLists()
  68. },
  69. methods: {
  70. submit(){
  71. uni.navigateTo({
  72. url:'/pages/userInfo/bindCar'
  73. })
  74. },
  75. maintenanceLog(item) {
  76. if (item.has_orders == true) {
  77. uni.navigateTo({
  78. url: '/pages/userInfo/maintenanceList?id=' + item.id
  79. })
  80. }
  81. },
  82. getNoticeLists() {
  83. this.$api.getBindCar(res => {
  84. if (res.code == 0) {
  85. this.noticeList = res.data
  86. } else {
  87. this.errorToast(res.msg)
  88. }
  89. })
  90. },
  91. errorToast(msg) {
  92. this.$refs.uToast.show({
  93. title: msg,
  94. type: 'error',
  95. duration: 2000
  96. })
  97. },
  98. },
  99. }
  100. </script>
  101. <style scoped lang="scss">
  102. .body {
  103. width: 100vw;
  104. height: 99vh;
  105. box-sizing: border-box;
  106. padding: 0 2vw;
  107. background-color: #fafafa;
  108. }
  109. .button {
  110. position: fixed;
  111. width: 85vw;
  112. height: 10vw;
  113. margin-top: 10vw;
  114. background-color: red;
  115. line-height: 10vw;
  116. border-radius: 5vw;
  117. color: white;
  118. text-align: center;
  119. margin-left: 5vw;
  120. bottom: 3vw;
  121. }
  122. .paddingOder {
  123. width: 96vw;
  124. height: 93vh;
  125. background-color: #fafafa;
  126. border-radius: 8px;
  127. overflow-y: auto;
  128. .model {
  129. width: 96vw;
  130. height: 25vw;
  131. box-sizing: border-box;
  132. padding: 0 3vw;
  133. background-color: white;
  134. border-radius: 20px;
  135. margin-top: 2vw;
  136. ul {
  137. display: flex;
  138. justify-content: space-between;
  139. align-items: center;
  140. li {
  141. .Number {
  142. font-size: 0.8rem;
  143. display: flex;
  144. margin-top: 1vw;
  145. }
  146. .playOder {
  147. display: flex;
  148. font-size: 0.75rem;
  149. margin-top: 1vw;
  150. color: #808080;
  151. }
  152. }
  153. li:nth-child(2) {
  154. width: 20vw;
  155. height: 8vw;
  156. line-height: 20vw;
  157. text-align: center;
  158. line-height: 8vw;
  159. border-radius: 5px;
  160. color: white;
  161. }
  162. }
  163. }
  164. }
  165. </style>