index.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <template>
  2. <view class="information">
  3. <!-- header -->
  4. <cu-custom bgColor="bg-gradual-blue" isBack><view slot="content">设备信息</view></cu-custom>
  5. <!-- section -->
  6. <view v-for="(item, index) in value.value" :key="index" class="bg-white padding-top-sm radius margin-lr margin-top">
  7. <view class="padding-sm">
  8. <view class="padding-bottom-sm text-black text-bold ">{{ item.name }}:{{ item.tel }}</view>
  9. <view class="padding-bottom-sm text-black text-bold ">车型:{{ item.car }}</view>
  10. <view class="text-black text-bold ">车牌号:{{ item.code }}</view>
  11. </view>
  12. <button style="border-radius: 0 0 6rpx 6rpx;" @click="onClick(item)" class="cu-btn block bg-green padding-tb-sm">换绑</button>
  13. </view>
  14. <van-empty v-if="value.value.length == 0 && value.no_more" description="暂无设备" />
  15. <view v-else :class="!value.no_more && value.pageCount <= value.totalPage ? 'cu-load bg-grey loading margin-top' : 'cu-load bg-grey over margin-top'"></view>
  16. <!-- footer -->
  17. <view class="footer">
  18. <view class="footer-concent cu-bar tabbar bg-white">
  19. <view class="action text-green"></view>
  20. <view class="action text-gray"></view>
  21. <view class="action text-gray add-action">
  22. <button @click="addClick" class="cu-btn cuIcon-add bg-green shadow"></button>
  23. 添加
  24. </view>
  25. <view class="action text-gray"></view>
  26. <view class="action text-gray"></view>
  27. </view>
  28. </view>
  29. <!-- 功能工具 -->
  30. <van-dialog id="van-dialog" />
  31. </view>
  32. </template>
  33. <script>
  34. import Dialog from '@/wxcomponents/vant/dist/dialog/dialog';
  35. export default {
  36. data() {
  37. return {
  38. value: {
  39. no_more: false, //没有更多
  40. pageCount: 1,
  41. totalPage: 1,
  42. value: [
  43. {
  44. name: '姓名',
  45. tel: '电话',
  46. car: '车型',
  47. code: '车牌号'
  48. },
  49. {
  50. name: '姓名',
  51. tel: '电话',
  52. car: '车型',
  53. code: '车牌号'
  54. }
  55. ]
  56. }
  57. };
  58. },
  59. onLoad() {},
  60. methods: {
  61. // 换绑
  62. onClick(item){
  63. Dialog.confirm({title:"提示",message:"确定换绑该设备?"}).then(()=>console.log(item)).catch(()=>false)
  64. },
  65. // 添加设备
  66. addClick(){
  67. uni.navigateTo({
  68. url:"/pages/binding/index"
  69. })
  70. }
  71. }
  72. };
  73. </script>
  74. <style lang="scss" scoped>
  75. .information{
  76. .footer{
  77. height: calc(150rpx + env(safe-area-inset-bottom));
  78. .footer-concent{
  79. position: fixed;
  80. z-index: 9999;
  81. bottom: 0;left: 0;width: 100%;
  82. }
  83. }
  84. }
  85. </style>