add.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="appWrapper">
  3. <form action="" v-if="type==2">
  4. <view class="form-item margin-top">
  5. <view class="title">
  6. <text class="necessary">*</text>
  7. 设备编号:
  8. </view>
  9. <input name="input"></input>
  10. </view>
  11. <view class="form-item">
  12. <view class="title">设备名称:</view>
  13. <input name="input"></input>
  14. </view>
  15. <view class="form-item">
  16. <view class="title">安装位置:</view>
  17. <input name="input"></input>
  18. </view>
  19. <view class="form-item">
  20. <view class="title">所属楼层:</view>
  21. <select name="" id="">
  22. <option value="">楼层一</option>
  23. <option value="">楼层一</option>
  24. <option value="">楼层一</option>
  25. </select>
  26. </view>
  27. <view class="form-item">
  28. <view class="title">站点:</view>
  29. <select name="" id="">
  30. <option value="">站点一</option>
  31. <option value="">站点一</option>
  32. <option value="">站点一</option>
  33. </select>
  34. </view>
  35. <view class="form-item">
  36. <view class="title">设备类型:</view>
  37. <select name="" id="">
  38. <option value="">智慧用电</option>
  39. <option value="">视频监控</option>
  40. </select>
  41. </view>
  42. <view class="btn-area submitBottomBtn padding-lr-sm">
  43. <button class="bg-blue round margin-top">提 交 </button>
  44. </view>
  45. </form>
  46. <form action="" v-else>
  47. <view class="form-item margin-top">
  48. <view class="title">
  49. <text class="necessary">*</text>
  50. 用户名称:
  51. </view>
  52. <input name="input"></input>
  53. </view>
  54. <view class="form-item">
  55. <view class="title">地址:</view>
  56. <input name="input"></input>
  57. </view>
  58. <view class="form-item">
  59. <view class="title">经度:</view>
  60. <input name="input"></input>
  61. </view>
  62. <view class="form-item">
  63. <view class="title">维度:</view>
  64. <input name="input"></input>
  65. </view>
  66. <view class="form-item">
  67. <view class="title">联系人:</view>
  68. <input name="input"></input>
  69. </view>
  70. <view class="form-item">
  71. <view class="title">手机号码:</view>
  72. <input name="input"></input>
  73. </view>
  74. <view class="btn-area submitBottomBtn padding-lr-sm">
  75. <button class="bg-blue round margin-top">提 交 </button>
  76. </view>
  77. </form>
  78. </view>
  79. </template>
  80. <script>
  81. export default {
  82. data() {
  83. return {
  84. index: -1,
  85. picker: ['楼层一', '楼层二', '楼层三'],
  86. type: '0'
  87. }
  88. },
  89. onLoad: function(option) {
  90. console.log(option.type); //打印出上个页面传递的参数。
  91. this.type = option.type;
  92. if (option.type == 1) {
  93. uni.setNavigationBarTitle({
  94. title: '站点新增'
  95. });
  96. } else {
  97. uni.setNavigationBarTitle({
  98. title: '设备新增'
  99. });
  100. }
  101. },
  102. methods: {
  103. PickerChange(e) {
  104. this.index = e.detail.value
  105. },
  106. }
  107. }
  108. </script>
  109. <style lang="scss">
  110. .cu-form-group {
  111. border-top: 0;
  112. }
  113. input,
  114. select,
  115. option {
  116. line-height: 70rpx;
  117. padding: 0 20rpx;
  118. height: 70rpx;
  119. border: 1px solid #EDEDED;
  120. // width:500rpx!important;
  121. background-color: #fff;
  122. box-sizing: border-box;
  123. appearance: none;
  124. -moz-appearance: none;
  125. -webkit-appearance: none;
  126. color: #999;
  127. }
  128. select:focus,
  129. select:active,
  130. select:hover {
  131. outline: none;
  132. }
  133. select {
  134. background: url(../../static/arrow.png) no-repeat scroll 98% center;
  135. background-size: 6%;
  136. }
  137. .form-item {
  138. padding: 0 40rpx;
  139. display: flex;
  140. align-items: center;
  141. margin-bottom: 20rpx;
  142. .title {
  143. width: 170rpx;
  144. position: relative;
  145. .necessary {
  146. color: red;
  147. display: inline-block;
  148. position: absolute;
  149. top: -2rpx;
  150. left: -20rpx;
  151. font-size: 40rpx;
  152. }
  153. }
  154. input,
  155. select {
  156. width: 500rpx;
  157. font-size: 28rpx;
  158. }
  159. }
  160. </style>