deviceControl.vue 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <template>
  2. <view class="device-detail">
  3. <view class="device-detail__header">
  4. <u-icon
  5. size="36"
  6. class="arrow-left"
  7. name="arrow-left"
  8. @click="handleBack"
  9. ></u-icon>
  10. {{ title }}
  11. </view>
  12. <view class="device-detail__body">
  13. <view class="tabs">
  14. <view class="tab-container">
  15. <view class="tab-item" :class="activeTab === 'pestAnalysis'?'active':''" @click="handleTabClick('pestAnalysis')">
  16. 管理员
  17. </view>
  18. <view class="tab-item" :class="activeTab === 'viewImage'?'active':''" @click="handleTabClick('viewImage')">
  19. 设置
  20. </view>
  21. </view>
  22. </view>
  23. <view class="device-detail-content" v-if="activeTab === 'pestAnalysis'">
  24. <view class="device-detail-item">
  25. <text class="device-detail-label">联网模块</text>
  26. <view class="device-detail-btn-container">
  27. <view class="device-detail-btn">升级</view>
  28. <view class="device-detail-btn">重启</view>
  29. <view class="device-detail-btn">MQTT配置</view>
  30. </view>
  31. </view>
  32. <view class="device-detail-item">
  33. <text class="device-detail-label">板子设置</text>
  34. <view class="device-detail-btn-container">
  35. <view class="device-detail-btn">查看原始IMEI</view>
  36. <view class="device-detail-btn">更改IMEI</view>
  37. </view>
  38. </view>
  39. <view class="device-detail-item">
  40. <text class="device-detail-label">强制操作</text>
  41. <view class="device-detail-btn-container">
  42. <view class="device-detail-btn force-btn">拍照</view>
  43. <view class="device-detail-btn force-btn">升级</view>
  44. <view class="device-detail-btn force-btn">重启</view>
  45. <view class="device-detail-btn force-btn">震动关闭</view>
  46. <view class="device-detail-btn force-btn">震动开启</view>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="device-detail-content" style="padding-bottom: 50rpx" v-if="activeTab === 'viewImage'">
  51. <view class="device-detail-viewImage">
  52. <text class="device-detail-label">联网模块</text>
  53. <u-switch v-model="checked" size="40" active-color="#0BBC58"></u-switch>
  54. </view>
  55. <view class="device-detail-viewImage">
  56. <text class="device-detail-label">定时模式</text>
  57. </view>
  58. <u-radio-group v-model="value" @change="radioGroupChange" active-color="#0BBC58">
  59. <u-radio
  60. :name="0"
  61. >光控
  62. </u-radio>
  63. <u-radio
  64. :name="1"
  65. >时控
  66. </u-radio>
  67. </u-radio-group>
  68. <view class="device-detail-viewImage">
  69. <text class="device-detail-label">落虫时间(min)</text>
  70. </view>
  71. <u-slider v-model="value" style="width:100%" max="100" active-color="#0BBC58"></u-slider>
  72. <view class="device-detail-viewImage">
  73. <text class="device-detail-label">加热时间(min)</text>
  74. </view>
  75. <u-slider v-model="value" style="width:100%" max="100" active-color="#0BBC58"></u-slider>
  76. <view class="device-detail-viewImage">
  77. <text class="device-detail-label">加热温度(℃)</text>
  78. </view>
  79. <u-slider v-model="value" style="width:100%" max="100" active-color="#0BBC58"></u-slider>
  80. <view class="device-detail-viewImage">
  81. <text class="device-detail-label">高温保护阀值(℃)</text>
  82. </view>
  83. <u-slider v-model="value" style="width:100%" max="100" active-color="#0BBC58"></u-slider>
  84. <view class="device-detail-viewImage">
  85. <text class="device-detail-label">低温保护阀值(℃)</text>
  86. </view>
  87. <u-slider v-model="value" style="width:100%" max="100" active-color="#0BBC58"></u-slider>
  88. <view class="device-detail-viewImage">
  89. <text class="device-detail-label">数据上传间隔(min)</text>
  90. </view>
  91. <u-slider v-model="value" style="width:100%;" max="100" active-color="#0BBC58"></u-slider>
  92. </view>
  93. </view>
  94. <view class="device-detail-btn-footer">
  95. <view class="device-detail-btn">保存</view>
  96. </view>
  97. </view>
  98. </template>
  99. <script>
  100. export default {
  101. data(){
  102. return {
  103. value: 10,
  104. imageList: [],
  105. deviceInfo: {},
  106. time: '',
  107. activeTab: 'pestAnalysis',
  108. title: '设置控制',
  109. deviceType: '',
  110. location: '',
  111. checked: false
  112. }
  113. },
  114. methods: {
  115. handleBack() {
  116. uni.navigateBack({
  117. delta: 1
  118. });
  119. },
  120. handleTabClick(tab) {
  121. this.activeTab = tab;
  122. }
  123. }
  124. }
  125. </script>
  126. <style scoped lang="scss">
  127. .device-detail {
  128. display: flex;
  129. width: 100%;
  130. height: calc(100vh - 112rpx);
  131. padding-top: 112rpx;
  132. flex-direction: column;
  133. align-items: center;
  134. background: linear-gradient(180deg, #ffffff00 0%, #F5F6FA 23.64%, #F5F6FA 100%), linear-gradient(102deg, #BFEADD 6.77%, #B8F1E7 40.15%, #B9EEF5 84.02%);
  135. .device-detail__header {
  136. width: 100%;
  137. font-size: 28rpx;
  138. color: #999;
  139. color: #042118;
  140. font-family: 'Source Han Sans CN VF';
  141. font-weight: 700;
  142. position: relative;
  143. text-align: center;
  144. .arrow-left {
  145. position: absolute;
  146. left: 32rpx;
  147. margin-right: 12rpx;
  148. }
  149. }
  150. .device-detail__body {
  151. width: calc(100% - 64rpx);
  152. margin: 0 auto;
  153. border-radius: 16rpx;
  154. overflow-x: hidden;
  155. overflow-y: auto;
  156. // 隐藏滚动条
  157. -ms-overflow-style: none;
  158. scrollbar-width: none;
  159. }
  160. .tabs {
  161. margin: 24rpx 0;
  162. border-radius: 16rpx;
  163. padding: 16rpx 0;
  164. padding-top: 0;
  165. .tab-container{
  166. display: flex;
  167. width: 100%;
  168. height: 88rpx;
  169. line-height: 88rpx;
  170. text-align: center;
  171. font-size: 28rpx;
  172. font-weight: 700;
  173. color: #042118;
  174. font-family: 'Source Han Sans CN VF';
  175. }
  176. .tab-item {
  177. margin-right: 40rpx;
  178. color:#999999;
  179. }
  180. .active{
  181. position: relative;
  182. color: #303133;
  183. text-align: center;
  184. font-family: "Source Han Sans CN VF";
  185. font-size: 28rpx;
  186. font-weight: 700;
  187. &::after {
  188. content: '';
  189. position: absolute;
  190. bottom: 10rpx;
  191. left: 50%;
  192. transform: translateX(-50%);
  193. width: 100%;
  194. height: 36rpx;
  195. border-bottom: 6rpx solid #303133;
  196. }
  197. }
  198. }
  199. .device-detail-content{
  200. display: flex;
  201. padding: 24rpx 32rpx;
  202. flex-direction: column;
  203. align-items: flex-start;
  204. gap: 20rpx;
  205. border-radius: 16rpx;
  206. background: #FFF;
  207. .device-detail-item{
  208. .device-detail-label{
  209. color: #303133;
  210. font-family: "Source Han Sans CN VF";
  211. font-size: 28rpx;
  212. font-weight: 400;
  213. }
  214. .device-detail-btn-container{
  215. display: flex;
  216. gap: 24rpx;
  217. margin-top: 12rpx;
  218. }
  219. .device-detail-btn{
  220. display: flex;
  221. padding: 10rpx 16rpx;
  222. justify-content: center;
  223. align-items: center;
  224. gap: 16rpx;
  225. border-radius: 16rpx;
  226. background: #0BBC58;
  227. color: #ffffff;
  228. font-family: "Source Han Sans CN VF";
  229. font-size: 24rpx;
  230. font-weight: 400;
  231. }
  232. .force-btn{
  233. background: #FB4E52;
  234. }
  235. }
  236. .device-detail-viewImage{
  237. width: 100%;
  238. display: flex;
  239. justify-content: space-between;
  240. align-items: center;
  241. padding-bottom: 20rpx;
  242. }
  243. }
  244. .device-detail-btn-footer{
  245. position: fixed;
  246. bottom: 0;
  247. left: 0;
  248. width: 100%;
  249. height: 112rpx;
  250. line-height: 112rpx;
  251. text-align: center;
  252. font-size: 28rpx;
  253. font-weight: 700;
  254. color: #042118;
  255. font-family: 'Source Han Sans CN VF';
  256. background: #ffffff;
  257. display: flex;
  258. justify-content: center;
  259. align-items: center;
  260. .device-detail-btn{
  261. display: flex;
  262. height: 80rpx;
  263. width: 90%;
  264. margin: 0 auto;
  265. padding: 0rpx 20rpx;
  266. justify-content: center;
  267. align-items: center;
  268. gap: 8rpx;
  269. border-radius: 16rpx;
  270. background:#0BBC58;
  271. color: #ffffff;
  272. text-align: center;
  273. font-family: "Source Han Sans CN VF";
  274. font-size: 14px;
  275. font-style: normal;
  276. font-weight: 500;
  277. }
  278. }
  279. }
  280. </style>