智慧画屏客户端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

170 lines
4.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <view class="main_container">
  3. <Header></Header>
  4. <view class="login-bind">
  5. <view class="bind">
  6. <text class="bind-title">设备信息</text>
  7. <form @submit="bindSubmit">
  8. <view class="uni-form-item uni-column">
  9. <view class="title">设备账号</view>
  10. <input class="uni-input" v-model="account" name="account" type="text" placeholder="设备账号" disabled />
  11. </view>
  12. <view class="uni-form-item uni-column">
  13. <view class="title">设备名称</view>
  14. <input class="uni-input" v-model="device_name" name="name" placeholder="设备名称" />
  15. </view>
  16. <view class="uni-form-item uni-column" @tap="radioDirection = !radioDirection">
  17. <view class="bind-radio-label" >
  18. <view class="title" >选择设备方向</view>
  19. <image class="select_img" src="@/static/images/bind-select.png"></image>
  20. </view>
  21. <view v-show="radioDirection" class="device_radio">
  22. <radio-group name="device_direction">
  23. <label class="radio"><radio value="1" checked="true" />竖屏</label>
  24. <label class="radio"><radio value="2" />横屏</label>
  25. </radio-group>
  26. </view>
  27. </view>
  28. <view class="uni-btn-v"><button class="uni-login-btn" form-type="submit">授权绑定</button></view>
  29. </form>
  30. </view>
  31. </view>
  32. <view class="login_bg"></view>
  33. </view>
  34. </template>
  35. <script>
  36. import Header from '@/pages/header.vue';
  37. export default {
  38. name:'DeviceBind',
  39. components: {
  40. Header
  41. },
  42. data() {
  43. return {
  44. account: '13476289682',
  45. radioDirection: false,
  46. device_name: ''
  47. };
  48. },
  49. mounted(){
  50. const res = uni.getSystemInfoSync();
  51. console.log('model',res.model); // 设备型号
  52. console.log('version',res.version); // 引擎版本号
  53. console.log('platform',res.platform); // 客户端平台
  54. console.log('deviceId',res.deviceId); // 设备ID
  55. this.device_name = res.model
  56. // this.account = this.account.slice(-8)
  57. },
  58. methods: {
  59. bindSubmit: function(e){
  60. // console.log(this.account.substring(this.account.length-8, this.account.length))
  61. // console.log(this.account.slice(-8))
  62. if(!this.device_name){
  63. uni.showToast({
  64. title: '请填写设备名称',
  65. icon: 'none'
  66. })
  67. return;
  68. }
  69. var formdata = e.detail.value;
  70. uni.navigateTo({
  71. url: '../show/show'
  72. });
  73. console.log('bindform发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value));
  74. }
  75. }
  76. };
  77. </script>
  78. <style scoped>
  79. .bind-title{
  80. display: block;
  81. margin-bottom: 37.5rpx;
  82. font-size: 37.5rpx;
  83. font-weight: bold;
  84. color: #333;
  85. text-align: center;
  86. }
  87. .bind .uni-form-item{
  88. position: relative;
  89. display: flex;
  90. justify-content: space-between;
  91. width: 409.72rpx;
  92. height: 86.11rpx;
  93. padding: 0 55.55rpx;
  94. line-height: 86.11rpx;
  95. margin-bottom: 27.77rpx;
  96. font-size: 27.77rpx;
  97. background-color: #f6f6f6;
  98. border-radius: 86.11rpx;
  99. }
  100. .bind .uni-form-item .title{
  101. min-width: 138.88rpx;
  102. }
  103. .bind-radio-label{
  104. display: flex;
  105. justify-content: space-between;
  106. width: 100%;
  107. }
  108. .bind .uni-input{
  109. width: auto;
  110. height: 86.11rpx;
  111. font-size: 27.77rpx;
  112. }
  113. .select_img{
  114. display: block;
  115. width: 21.52rpx;
  116. height: 13.88rpx;
  117. margin-top: 36.8rpx;
  118. }
  119. .device_radio{
  120. position: absolute;
  121. bottom: -145.83rpx;
  122. left: 0;
  123. z-index: 99;
  124. }
  125. .device_radio uni-radio-group{
  126. width: 520.83rpx;
  127. height: 145.83rpx;
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. font-size: 25rpx;
  132. background-color: #FFFFFF;
  133. border-radius: 13.88rpx;
  134. box-shadow: 0 0 24rpx 2rpx rgba(0, 0, 0, 0.15);
  135. }
  136. .device_radio .radio {
  137. width: 50%;
  138. text-align: center;
  139. }
  140. .device_radio .radio /deep/ uni-radio{
  141. margin-right: 20.83rpx;
  142. }
  143. .device_radio /deep/ uni-radio .uni-radio-input{
  144. width: 27.77rpx;
  145. height: 27.77rpx;
  146. margin-top: -4.16rpx;
  147. background: url(~@/static/images/an-wx.png) no-repeat left top;
  148. background-size: 100% 100%;
  149. border: none;
  150. }
  151. .device_radio /deep/ uni-radio .uni-radio-input.uni-radio-input-checked{
  152. background: none !important;
  153. border: none !important;
  154. }
  155. .device_radio /deep/ uni-radio .uni-radio-input.uni-radio-input-checked:before{
  156. content: "";
  157. width: 27.77rpx;
  158. height: 27.77rpx;
  159. background: url(~@/static/images/an-xz.png) no-repeat left top;
  160. background-size: 100% 100%;
  161. transform: translate(-50%,-50%) scale(1);
  162. }
  163. .uni-input /deep/ .uni-input-input:disabled{
  164. color: #999999;
  165. }
  166. </style>