index.vue 21 KB

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