index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811
  1. <template>
  2. <view>
  3. <view class="status_bar"></view>
  4. <view class="" style="position: relative;top: 40px;">
  5. <!-- <view style="position: fixed;z-index: 100;">
  6. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="灌溉控制系统" right-icon="search"
  7. @clickRight="clickRight" size="16"></uni-nav-bar>
  8. <view class="inputs" :style="{'width':width+'rpx'}">
  9. <input type="text" value="" placeholder="请输入设备ID或设备名称" v-model="imports" @input="searchinp"
  10. class="inputbox" :clearable="false" />
  11. <u-icon name="search" size="40" class="icon" @click="search"></u-icon>
  12. </view>
  13. </view> -->
  14. <view style="position: fixed;z-index: 100;">
  15. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回"
  16. size="16">
  17. <view class="bases_search">
  18. <view class="bases_search_text" @click="search">
  19. <u-icon name="search" class="search"></u-icon>
  20. <input type="text" v-model="imports" placeholder="设备ID搜索" disabled @input="searchinp"/>
  21. </view>
  22. </view>
  23. </uni-nav-bar>
  24. </view>
  25. <image :src="'https://www.hnyfwlw.com:8006/bigdata_app/image/irrigate/1.png'" mode="" class="image">
  26. </image>
  27. <view class="loading" v-if="loadingtf">
  28. <image src="../../static/images/ajax-loader.gif" mode="" class="img"></image>
  29. </view>
  30. <view class="tab-box">
  31. <view v-for="(item,index) in equipArr" :key="item.type" v-if="item.tf"
  32. @click="tabClick(index,item.type)" :class="['tab-item',active==index?'active':'']">
  33. <text>{{item.name}}</text>
  34. <text class="bottom-line"></text>
  35. </view>
  36. </view>
  37. <view class="prevents">
  38. <view class="prevents_item" v-for="(item,index) in eqlistdata" :key="item.d_id" @click="eqdetails(item, index)">
  39. <view class="" v-if="side_type == 18">
  40. <image
  41. :src="item.device_status==1?'https://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png':'https://www.hnyfwlw.com:8006/bigdata_app/image/prevention/7.png'"
  42. mode="" class="prevents_item_img"></image>
  43. <view class="prevents_item_top">
  44. <p>设备名称:{{item.device_name}}</p>
  45. <view class="" style="display: flex;">
  46. <view class="" :style="{'margin-right': '10rpx','color':item.status2?'#00B075':'#f00'}">
  47. {{item.status2?"已启用":"已禁用"}}
  48. </view>
  49. <!-- <u-switch v-model="item.status2" size="35" activeColor="#00B075"
  50. style="margin-top: 10rpx;" inactiveColor="#f00"
  51. @change="switchchange2($event,item.d_id,index)">
  52. </u-switch> -->
  53. <switch @change="switchchange2($event,item.d_id,index)" v-if="$QueryPermission(256)" color="#00B075" :checked="item.status2" style="zoom:0.6" />
  54. </view>
  55. </view>
  56. <view class="prevents_item_bot">
  57. <view class="prevents_item_bot_item">
  58. <p>设备 ID:{{item.device_id}}</p>
  59. <p @click="newdata(item)" v-if="$QueryPermission(205)">数据查看</p>
  60. </view>
  61. <p style="color:#909696;height: 60rpx;line-height: 60rpx;">
  62. 设备状态:{{item.device_status==1?"在线":"离线"}}</p>
  63. <p style="color:#909696;height: 60rpx;line-height: 60rpx;">设备备注:{{item.device_notes}}
  64. <u-icon name="edit-pen" size="36" color="#00B075" @click="changeremark(item,index)">
  65. </u-icon>
  66. </p>
  67. <view class="prevents_item_bot_item">
  68. <p>地址:{{item.city}}</p>
  69. <u-icon name="map" size="40" color="#00B075"
  70. @click="selectaddress(item.city,item.device_name)"></u-icon>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="" v-if="side_type == 17">
  75. <image src="https://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png" mode=""
  76. class="prevents_item_img"></image>
  77. <view class="prevents_item_top">
  78. <p>设备名称:{{item.device_name}}</p>
  79. <view class="" style="display: flex;">
  80. <view class=""
  81. :style="{'margin-right': '10rpx','color':item.water_pump_switch2?'#00B075':'#f00'}">
  82. {{item.water_pump_switch2?"已开泵":"已关泵"}}
  83. </view>
  84. <!-- <u-switch v-model="item.water_pump_switch2" size="35" active-color="#00B075"
  85. inactive-color="#f00" style="margin-top: 10rpx;"
  86. @change="switchchange($event,item.device_id,index)">
  87. </u-switch> -->
  88. <switch @change="switchchange($event,item.d_id,index)" v-if="$QueryPermission(254)" color="#00B075" :checked="item.water_pump_switch2" style="zoom:0.6" />
  89. </view>
  90. </view>
  91. <view class="prevents_item_bot">
  92. <view class="prevents_item_bot_item">
  93. <p>设备 ID:{{item.device_id}}</p>
  94. <p @click="newdata(item)" v-if="item.water_pump_switch2">实时数据</p>
  95. </view>
  96. <p style="color:#909696;height: 60rpx;line-height: 60rpx;">
  97. 设备状态:{{item.device_status==1?"在线":"离线"}}</p>
  98. <p style="color:#909696;height: 60rpx;line-height: 60rpx;">设备备注:{{item.device_notes}}
  99. <u-icon name="edit-pen" size="36" color="#00B075" @click="changeremark(item,index)">
  100. </u-icon>
  101. </p>
  102. <view class="prevents_item_bot_item">
  103. <p>地址:{{item.city}}</p>
  104. <u-icon name="map" size="40" color="#00B075"
  105. @click="selectaddress(item.city,item.device_name)"></u-icon>
  106. </view>
  107. </view>
  108. </view>
  109. <view class="" v-if="side_type == 13 || side_type=='xph'">
  110. <image src="https://www.hnyfwlw.com:8006/bigdata_app/image/prevention/6.png" mode=""
  111. class="prevents_item_img"></image>
  112. <view class="prevents_item_top">
  113. <p>设备名称:{{item.device_name}}</p>
  114. </view>
  115. <view class="prevents_item_bot">
  116. <p>设备 ID:{{item.equip_id || item.device_id}}</p>
  117. <p>最新上报时间:{{item.uptime|timeFormat()}}</p>
  118. </view>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. <u-modal v-model="show" :showCancelButton="true" title="请设置开泵时间" @confirm="modalconfirm" @cancel="modalcancel">
  124. <view class="slot-content">
  125. <u-input v-model="timevalue" type="number" style="width: 80%;"/>
  126. <p style="font-size: 12px;">分钟</p>
  127. </view>
  128. </u-modal>
  129. <u-modal v-model="showremark" :showCancelButton="true" title="请填写设备备注" @confirm="modalconfirmremark"
  130. @cancel="modalcancelremark">
  131. <view class="slot-contentremark">
  132. <u-input v-model="timevalueremark" maxlength="12" />
  133. </view>
  134. </u-modal>
  135. <view class="top">
  136. <view class="backtop" @click="top" v-if="isTop">
  137. <image src="../../static/images/1.png" mode="" class="img0"></image>
  138. </view>
  139. </view>
  140. </view>
  141. </template>
  142. <script>
  143. import {
  144. Debounce
  145. } from "../../util/anitthro.js"
  146. export default {
  147. data() {
  148. return {
  149. page: 1,
  150. size: 10,
  151. eqlistdata: [],
  152. isTop: false,
  153. filtrateTF: false,
  154. device_status: "",
  155. width: 0, //顶部搜索栏宽度
  156. imports: "", //搜索设备id
  157. loadingtf: false,
  158. equipArr: [{
  159. name: '机井水电双控',
  160. type: 17, //5 环境监测 15 管式墒情
  161. list: [],
  162. pageIndex: 1,
  163. tf: false,
  164. }, {
  165. name: '水肥一体化(L)',
  166. type: 18, //5 环境监测 15 管式墒情
  167. list: [],
  168. pageIndex: 1,
  169. tf: false,
  170. }, {
  171. name: '水肥一体化(X)',
  172. type: 13, //5 环境监测 15 管式墒情
  173. list: [],
  174. pageIndex: 1,
  175. tf: false,
  176. }, {
  177. name: '水肥一体化',
  178. type: 'xph', //5 环境监测 15 管式墒情
  179. list: [],
  180. pageIndex: 1,
  181. tf: false,
  182. }, {
  183. name: '水肥一体化(X)',
  184. type: 13, //5 环境监测 15 管式墒情
  185. list: [],
  186. pageIndex: 1,
  187. tf: true,
  188. }, {
  189. name: '水肥一体化',
  190. type: 'xph', //5 环境监测 15 管式墒情
  191. list: [],
  192. pageIndex: 1,
  193. tf: true,
  194. }],
  195. active: 0, //tab选中的下标
  196. side_type: 17, //当前选中的设备类型
  197. show: false,
  198. timevalue: "",
  199. selindex: "", //选中的设备index
  200. selid: "", //选中的设备id
  201. showremark: false,
  202. timevalueremark: "",
  203. key: true
  204. }
  205. },
  206. methods: {
  207. async xphlist() {
  208. this.loadingtf = true
  209. const res = await this.$myRequest({
  210. url: '/api/api_gateway?method=xphsp.views.all_devices',
  211. data: {
  212. page: this.page,
  213. page_size: "10",
  214. device_id: this.imports,
  215. }
  216. })
  217. this.loadingtf = false
  218. this.eqlistdata = this.eqlistdata.concat(res.data)
  219. console.log(this.eqlistdata)
  220. },
  221. async eqlist() { //设备列表 水肥一体化 L
  222. this.loadingtf = true
  223. const res = await this.$myRequest({
  224. url: '/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_list',
  225. data: {
  226. page: this.page,
  227. page_size: 10,
  228. content: this.imports
  229. }
  230. })
  231. console.log(res)
  232. this.loadingtf = false
  233. for (var i = 0; i < res.data.length; i++) {
  234. res.data[i]["status2"] = res.data[i].status == 1 ? true : false
  235. }
  236. this.eqlistdata = this.eqlistdata.concat(res.data)
  237. },
  238. async tubulareqlist() { //水电双计
  239. this.loadingtf = true
  240. const res = await this.$myRequest({
  241. url: '/api/api_gateway?method=irrigation_system.hydropower.hydropower_list',
  242. data: {
  243. page: this.page,
  244. page_size: 10,
  245. content: this.imports
  246. }
  247. })
  248. console.log(res)
  249. this.loadingtf = false
  250. for (var i = 0; i < res.data.length; i++) {
  251. res.data[i]["water_pump_switch2"] = res.data[i].water_pump_switch == 1 ? true : false
  252. }
  253. this.eqlistdata = this.eqlistdata.concat(res.data)
  254. console.log(this.eqlistdata)
  255. },
  256. async sfeqlist() { //设备列表
  257. this.loadingtf = true
  258. const res = await this.$myRequest({
  259. url: '/api/api_gateway?method=weather.weather.sf_page',
  260. data: {
  261. page: this.page,
  262. page_size: "10",
  263. device_id: this.imports,
  264. }
  265. })
  266. this.loadingtf = false
  267. this.eqlistdata = this.eqlistdata.concat(res.ids)
  268. console.log(this.eqlistdata)
  269. },
  270. clickRight() {
  271. this.width = 600
  272. },
  273. clickLeft() {
  274. uni.switchTab({
  275. url: "../index/index"
  276. })
  277. },
  278. eqdetails(data, index) {
  279. if (this.side_type == 13) {
  280. uni.navigateTo({
  281. url: "../waterandfer/datails?shebei=" + JSON.stringify(data)
  282. })
  283. } else if(this.side_type == 'xph') {
  284. uni.navigateTo({
  285. url: "../waterandfernew/details?shebei=" + JSON.stringify(this.eqlistdata[index])
  286. })
  287. }
  288. },
  289. top() {
  290. uni.pageScrollTo({
  291. scrollTop: 0,
  292. duration: 500
  293. })
  294. },
  295. search() { //搜索按钮搜索
  296. // this.searchinp()
  297. console.log(111)
  298. uni.navigateTo({
  299. url:"./search?side_type="+this.side_type
  300. })
  301. },
  302. searchinp() { //自动搜索
  303. Debounce(() => {
  304. this.page = 1
  305. this.eqlistdata = []
  306. if (this.side_type == 18) {
  307. this.eqlist()
  308. } else if (this.side_type == 17) {
  309. this.tubulareqlist()
  310. } else if (this.side_type == 13) {
  311. this.sfeqlist()
  312. } else if (this.side_type == 'xph') {
  313. this.xphlist()
  314. }
  315. }, 1000)()
  316. },
  317. tabClick(index, type) {
  318. this.active = index
  319. this.side_type = type
  320. this.page = 1
  321. if (type == 18) {
  322. this.eqlistdata = []
  323. this.eqlist()
  324. } else if (type == 17) {
  325. this.eqlistdata = []
  326. this.tubulareqlist()
  327. } else if (type == 13) {
  328. this.eqlistdata = []
  329. this.sfeqlist()
  330. } else if (type == 'xph') {
  331. this.eqlistdata = []
  332. this.xphlist()
  333. }
  334. },
  335. timezhuan(time) {
  336. function fun(a) {
  337. return String(a).length == 1 ? '0' + a : a
  338. }
  339. let date = new Date(time * 1000)
  340. let y = date.getFullYear()
  341. let m = date.getMonth() + 1
  342. let d = date.getDate()
  343. let h = date.getHours()
  344. let min = date.getMinutes()
  345. let sec = date.getSeconds()
  346. return `${y}-${fun(m)}-${fun(d)} ${fun(h)}:${fun(min)}:${fun(sec)}`
  347. },
  348. newdata(item) {
  349. if (this.side_type == 17) {
  350. uni.navigateTo({
  351. url: "realtimedata?item=" + JSON.stringify(item)
  352. })
  353. } else {
  354. uni.navigateTo({
  355. url: "weathdata?item=" + JSON.stringify(item)
  356. })
  357. }
  358. },
  359. selectaddress(city, name) { //获取分布位置
  360. uni.request({
  361. type: "GET",
  362. url: "https://restapi.amap.com/v3/geocode/geo?address=" + city +
  363. "&key=78ce288400f4fc6d9458989875c833c2",
  364. dataType: "json",
  365. complete: ress => {
  366. console.log(ress)
  367. if (ress.data.status == 1) {
  368. // ress.data.geocodes[0].location
  369. uni.navigateTo({
  370. url: "./irrmap?lnglat=" + ress.data.geocodes[0].location +
  371. "&basename=" + name
  372. })
  373. } else {
  374. uni.showToast({
  375. title: "地址编译失败",
  376. icon: "none"
  377. })
  378. }
  379. }
  380. });
  381. },
  382. async pumpcontrol(en) { //水肥开关
  383. console.log(en)
  384. const res = await this.$myRequest({
  385. url: '/api/api_gateway?method=irrigation_system.hydropower.water_pump_control',
  386. data: {
  387. times: Math.floor(this.timevalue * 60),
  388. device_id: this.selid,
  389. status: en ? 1 : 0
  390. }
  391. })
  392. console.log(res)
  393. if (res.code == 200) {
  394. uni.showToast({
  395. title: "操作成功",
  396. icon: "none"
  397. })
  398. } else {
  399. uni.showToast({
  400. title: res.msg,
  401. icon: "none"
  402. })
  403. this.eqlistdata[this.selindex].water_pump_switch2 = !this.eqlistdata[this.selindex]
  404. .water_pump_switch2
  405. }
  406. this.timevalue = ""
  407. },
  408. switchchange(e, id, index) { //水肥 开关
  409. // console.log(e.detail.value)
  410. // console.log(this.eqlistdata[index].water_pump_switch2)
  411. this.eqlistdata[index].water_pump_switch2 = e.detail.value
  412. if (e.detail.value) {
  413. this.show = true
  414. this.selindex = index
  415. this.selid = id
  416. } else {
  417. this.selid = id
  418. this.pumpcontrol(false)
  419. }
  420. },
  421. async switchchange2(e, id, index) { //水电开关
  422. console.log(id)
  423. const res = await this.$myRequest({
  424. url: '/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_control',
  425. data: {
  426. device_ids: id,
  427. isopen: e ? 1 : 0
  428. }
  429. })
  430. console.log(res)
  431. if (res.info == "ok") {
  432. uni.showToast({
  433. title: "操作成功",
  434. icon: "none"
  435. })
  436. } else {
  437. uni.showToast({
  438. title: res.msg,
  439. icon: "none"
  440. })
  441. this.eqlistdata[index].status2 = !this.eqlistdata[index].status2
  442. }
  443. },
  444. modalcancel() { //水肥开关 确定
  445. this.eqlistdata[this.selindex].water_pump_switch2 = !this.eqlistdata[this.selindex].water_pump_switch2
  446. this.timevalue = ""
  447. },
  448. modalconfirm() { //水肥开关 取消
  449. this.show = true
  450. if (this.timevalue == "") {
  451. uni.showToast({
  452. title: "请输入开泵时间",
  453. icon: "none"
  454. })
  455. } else {
  456. this.show = false
  457. this.pumpcontrol(true)
  458. }
  459. },
  460. changeremark(item, index) { //修改备注
  461. this.timevalueremark = item.device_notes
  462. this.showremark = true
  463. this.selindex = index
  464. this.selid = item.device_id
  465. },
  466. modalcancelremark() { //修改备注 取消
  467. },
  468. modalconfirmremark() { //修改备注 确定
  469. this.showremark = true
  470. if (this.timevalueremark == "") {
  471. uni.showToast({
  472. title: "请输入设备备注",
  473. icon: "none"
  474. })
  475. } else {
  476. this.showremark = false
  477. this.setchangeremark()
  478. }
  479. },
  480. async setchangeremark() { //水肥开关
  481. const res = await this.$myRequest({
  482. url: '/api/api_gateway?method=irrigation_system.hydropower.water_pump_modify_device_notes',
  483. data: {
  484. device_id: this.selid,
  485. content: this.timevalueremark
  486. }
  487. })
  488. console.log(res)
  489. if (res) {
  490. uni.showToast({
  491. title: "操作成功",
  492. icon: "none"
  493. })
  494. this.eqlistdata[this.selindex].device_notes = this.timevalueremark
  495. }
  496. },
  497. },
  498. onLoad() {
  499. // this.tubulareqlist()
  500. uni.getStorage({
  501. key: "jurisdiction",
  502. success: (res) => {
  503. let items = JSON.parse(res.data).filter((item) => {
  504. return item.pur_id == 202
  505. })
  506. var itemarr = items[0].children
  507. console.log(itemarr)
  508. for (var i = 0; i < itemarr.length; i++) {
  509. switch (itemarr[i].pur_id) {
  510. case 203:
  511. this.equipArr[0].tf = true
  512. break
  513. case 204:
  514. this.equipArr[1].tf = true
  515. break
  516. case 195:
  517. this.equipArr[2].tf = true
  518. break;
  519. case 288:
  520. this.equipArr[3].tf = true
  521. break;
  522. }
  523. }
  524. for (var i = 0; i < this.equipArr.length; i++) {
  525. if (this.equipArr[i].tf) {
  526. if (i == 0) {
  527. this.tubulareqlist();
  528. } else if (i == 1) {
  529. this.eqlist();
  530. } else if (i == 2) {
  531. this.sfeqlist();
  532. } else {
  533. this.xphlist();
  534. }
  535. this.active = i
  536. this.side_type = this.equipArr[i].type
  537. break
  538. }
  539. }
  540. }
  541. })
  542. },
  543. onReachBottom() {
  544. this.page++
  545. // this.eqlist()
  546. if (this.side_type == 18) {
  547. this.eqlist()
  548. } else if (this.side_type == 17) {
  549. this.tubulareqlist()
  550. } else if (this.side_type == 13) {
  551. this.sfeqlist()
  552. } else if (this.side_type == 'xph') {
  553. this.xphlist()
  554. }
  555. },
  556. onPageScroll(e) { //nvue暂不支持滚动监听,可用bindingx代替
  557. if (e.scrollTop > 200) { //距离大于200时显示
  558. this.isTop = true
  559. } else { //距离小于200时隐藏
  560. this.isTop = false
  561. }
  562. },
  563. }
  564. </script>
  565. <style lang="scss">
  566. page {
  567. background: $uni-bg-color-grey;
  568. }
  569. .bases_search {
  570. width: 60%;
  571. background-color: #FFFFFF;
  572. position: absolute;
  573. top: 10rpx;
  574. left: 50%;
  575. margin-left: -33%;
  576. .bases_search_text {
  577. width: 90%;
  578. margin: 0 auto;
  579. background-color: #F8F8F8;
  580. height: 60rpx;
  581. border-radius: 30rpx;
  582. display: flex;
  583. line-height: 60rpx;
  584. .search {
  585. padding: 0 20rpx;
  586. font-size: 34rpx;
  587. }
  588. input {
  589. width: 80%;
  590. margin-top: 10rpx;
  591. font-size: 28rpx;
  592. }
  593. }
  594. }
  595. .inputs {
  596. height: 54rpx;
  597. background-color: #E4E4E4;
  598. border-radius: 27rpx;
  599. position: absolute;
  600. right: 20rpx;
  601. top: 20rpx;
  602. transition: width 0.5s;
  603. overflow: hidden;
  604. padding-top: 8rpx;
  605. box-sizing: border-box;
  606. .inputbox {
  607. width: 85%;
  608. text-indent: 1rem;
  609. font-size: 26rpx;
  610. }
  611. .icon {
  612. position: absolute;
  613. top: 8rpx;
  614. right: 26rpx;
  615. }
  616. }
  617. /deep/.uni-icons {
  618. font-size: 40rpx !important;
  619. }
  620. .image {
  621. position: fixed;
  622. top: 84px;
  623. width: 100%;
  624. height: 160rpx;
  625. z-index: 555;
  626. }
  627. .loading {
  628. position: fixed;
  629. top: 440px;
  630. width: 95%;
  631. left: 2.5%;
  632. text-align: center;
  633. z-index: 9;
  634. .img {
  635. width: 300rpx;
  636. height: 40rpx;
  637. }
  638. }
  639. .tab-box {
  640. position: fixed;
  641. top: 164px;
  642. display: flex;
  643. justify-content: space-around;
  644. font-size: 24rpx;
  645. line-height: 80rpx;
  646. background-color: #FFFFFF;
  647. width: 100%;
  648. z-index: 2;
  649. .tab-item {
  650. cursor: pointer;
  651. position: relative;
  652. }
  653. ;
  654. .tab-item.active {
  655. .bottom-line {
  656. bottom: 0;
  657. position: absolute;
  658. display: inline-block;
  659. width: 90rpx;
  660. height: 6rpx;
  661. left: 0;
  662. right: 0;
  663. margin: auto;
  664. background: $uni-color-success;
  665. }
  666. }
  667. }
  668. .prevents {
  669. width: 100%;
  670. position: absolute;
  671. top: 180px;
  672. .prevents_item {
  673. width: 95%;
  674. margin: 0 auto 30rpx;
  675. border-radius: 10rpx;
  676. box-shadow: 0 0 10rpx #bcb9ca;
  677. padding: 20rpx 40rpx 20rpx 80rpx;
  678. box-sizing: border-box;
  679. position: relative;
  680. background-color: #fff;
  681. .prevents_item_img {
  682. width: 30rpx;
  683. height: 50rpx;
  684. position: absolute;
  685. top: -4rpx;
  686. left: 30rpx;
  687. }
  688. .prevents_item_top {
  689. display: flex;
  690. justify-content: space-between;
  691. height: 60rpx;
  692. border-bottom: 2rpx solid #F4F4F4;
  693. line-height: 60rpx;
  694. font-size: 26rpx;
  695. .red {
  696. color: #ff0000;
  697. }
  698. .green {
  699. color: #7DBB91;
  700. }
  701. }
  702. .prevents_item_bot {
  703. margin-top: 20rpx;
  704. font-size: 26rpx;
  705. color: #BDBDBD;
  706. .prevents_item_bot_item {
  707. height: 60rpx;
  708. line-height: 60rpx;
  709. display: flex;
  710. justify-content: space-between;
  711. color: #909696;
  712. p:first-child {
  713. width: 80%;
  714. overflow: hidden; //溢出隐藏
  715. white-space: nowrap; //禁止换行
  716. text-overflow: ellipsis; //...
  717. }
  718. p:nth-child(2) {
  719. height: 45rpx;
  720. color: #00B075;
  721. border-bottom: 1px solid #00B075;
  722. }
  723. }
  724. .prevents_item_bot_sapn0 {
  725. color: #00B075;
  726. }
  727. .prevents_item_bot_sapn1 {
  728. color: #FF4747;
  729. }
  730. .prevents_item_bot_sapn2 {
  731. color: #FFAB00;
  732. }
  733. }
  734. }
  735. }
  736. .top {
  737. position: fixed;
  738. right: 10px;
  739. bottom: 40px;
  740. z-index: 100;
  741. image {
  742. width: 100rpx;
  743. height: 100rpx;
  744. }
  745. .backtop {
  746. display: flex;
  747. justify-content: flex-end;
  748. margin-bottom: 10rpx;
  749. }
  750. .more {
  751. display: flex;
  752. }
  753. .box {
  754. width: 80rpx;
  755. height: 80rpx;
  756. background-color: rgba(161, 161, 161, 0.45);
  757. border-radius: 50%;
  758. text-align: center;
  759. line-height: 80rpx;
  760. box-sizing: border-box;
  761. margin: 14rpx 10rpx 0 0;
  762. color: #fff;
  763. }
  764. }
  765. .slot-content {
  766. width: 60%;
  767. margin: 30rpx auto;
  768. display: flex;
  769. line-height: 70rpx;
  770. }
  771. .slot-contentremark {
  772. width: 70%;
  773. margin: 30rpx auto;
  774. display: flex;
  775. line-height: 70rpx;
  776. }
  777. </style>