modification.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 44px;">
  5. <view style="position: fixed;z-index: 100;">
  6. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" title="修改名称"></uni-nav-bar>
  7. </view>
  8. <view class="mod">
  9. <view class="mod_name">
  10. <p>设备名称</p>
  11. <input type="text" v-model="moddata.device_name" style="background-color: #FAFAFA;" />
  12. </view>
  13. <view class="mod_id">
  14. <p>设备ID</p>
  15. <input type="text" :value="moddata.imei" disabled />
  16. </view>
  17. <view class="mod_user">
  18. <p>适配用户</p>
  19. <input type="text" :value="moddata.real_name==''?'无':moddata.real_name" disabled />
  20. </view>
  21. <view class="mod_time">
  22. <p>设备添加时间</p>
  23. <input type="text" :value="moddata.addtime|timeFormat()" disabled />
  24. </view>
  25. <view class="sub" @click="btn">
  26. 提 交
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. moddata: []
  37. }
  38. },
  39. methods: {
  40. async eqlist() { //设备列表
  41. const res = await this.$myRequest({
  42. url: '/api/api_gateway?method=forecast.worm_lamp.revise_device',
  43. data: {
  44. device_id: this.moddata.device_id,
  45. device_name: this.moddata.device_name
  46. }
  47. })
  48. },
  49. btn() {
  50. this.eqlist()
  51. },
  52. clickLeft() {
  53. uni.switchTab({
  54. url: "./index"
  55. })
  56. }
  57. },
  58. onLoad(option) {
  59. this.moddata = JSON.parse(option.data)
  60. console.log(this.moddata)
  61. }
  62. }
  63. </script>
  64. <style lang="scss">
  65. .mod {
  66. width: 100%;
  67. position: absolute;
  68. top: 44px;
  69. height: 92vh;
  70. background-color: #FAFAFA;
  71. .mod_name,
  72. .mod_id,
  73. .mod_user,
  74. .mod_time {
  75. width: 90%;
  76. margin: 30rpx auto;
  77. display: flex;
  78. justify-content: space-between;
  79. background-color: #FFFFFF;
  80. padding: 20rpx 10rpx;
  81. color: #57C77A;
  82. line-height: 50rpx;
  83. input {
  84. text-align: right;
  85. font-size: 28rpx;
  86. padding: 10rpx;
  87. }
  88. }
  89. }
  90. .sub {
  91. width: 90%;
  92. margin: 30rpx auto;
  93. text-align: center;
  94. height: 70rpx;
  95. line-height: 70rpx;
  96. background-color: #57C77A;
  97. border-radius: 35rpx;
  98. color: #FFFFFF;
  99. }
  100. </style>