index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  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" active-color="#00B075"
  39. 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" active-color="#00B075"
  73. 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'">
  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. ],
  189. active: 0, //tab选中的下标
  190. side_type: 17, //当前选中的设备类型
  191. show: false,
  192. timevalue: "",
  193. selindex: "", //选中的设备index
  194. selid: "", //选中的设备id
  195. showremark: false,
  196. timevalueremark: ""
  197. }
  198. },
  199. methods: {
  200. async zslist() {
  201. this.loadingtf = true
  202. const res = await this.$myRequest({
  203. url: '/api/v2/iot/device/sf/zsrf/list/',
  204. data: {
  205. pageNum: this.page,
  206. pageSize: "10",
  207. devQuery: this.imports,//模糊搜索
  208. }
  209. })
  210. console.log(res,'详情')
  211. this.loadingtf = false
  212. this.eqlistdata = this.eqlistdata.concat(res)
  213. console.log(this.eqlistdata)
  214. },
  215. async xphlist() {
  216. this.loadingtf = true
  217. const res = await this.$myRequest({
  218. url: '/api/api_gateway?method=xphsp.views.all_devices',
  219. data: {
  220. page: this.page,
  221. page_size: "10",
  222. device_id: this.imports,
  223. }
  224. })
  225. this.loadingtf = false
  226. this.eqlistdata = this.eqlistdata.concat(res.data)
  227. console.log(this.eqlistdata)
  228. },
  229. async eqlist() { //设备列表 水肥一体化 L
  230. this.loadingtf = true
  231. const res = await this.$myRequest({
  232. url: '/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_list',
  233. data: {
  234. page: this.page,
  235. page_size: 10,
  236. content: this.imports
  237. }
  238. })
  239. console.log(res)
  240. this.loadingtf = false
  241. for (var i = 0; i < res.data.length; i++) {
  242. res.data[i]["status2"] = res.data[i].status == 1 ? true : false
  243. }
  244. this.eqlistdata = this.eqlistdata.concat(res.data)
  245. },
  246. async tubulareqlist() { //水电双计
  247. this.loadingtf = true
  248. const res = await this.$myRequest({
  249. url: '/api/api_gateway?method=irrigation_system.hydropower.hydropower_list',
  250. data: {
  251. page: this.page,
  252. page_size: 10,
  253. content: this.imports
  254. }
  255. })
  256. console.log(res)
  257. this.loadingtf = false
  258. for (var i = 0; i < res.data.length; i++) {
  259. res.data[i]["water_pump_switch2"] = res.data[i].water_pump_switch == 1 ? true : false
  260. }
  261. this.eqlistdata = this.eqlistdata.concat(res.data)
  262. // console.log(res)
  263. },
  264. async sfeqlist() { //设备列表
  265. this.loadingtf = true
  266. const res = await this.$myRequest({
  267. url: '/api/api_gateway?method=weather.weather.sf_page',
  268. data: {
  269. page: this.page,
  270. page_size: "10",
  271. device_id: this.imports,
  272. }
  273. })
  274. this.loadingtf = false
  275. this.eqlistdata = this.eqlistdata.concat(res.ids)
  276. console.log(this.eqlistdata)
  277. },
  278. clickRight() {
  279. this.width = 600
  280. },
  281. clickLeft() {
  282. uni.switchTab({
  283. url: "../index/index"
  284. })
  285. },
  286. eqdetails(data) {
  287. if (this.side_type == 13) {
  288. uni.navigateTo({
  289. url: "../waterandfer/datails?shebei=" + JSON.stringify(data)
  290. })
  291. } else if(this.side_type == 'xph') {
  292. uni.navigateTo({
  293. url: "../waterandfernew/details?shebei=" + JSON.stringify(data)
  294. })
  295. }else if(this.side_type == 'zs') {
  296. uni.navigateTo({
  297. url: "../waterandferZS/details?shebei=" + JSON.stringify(data)
  298. })
  299. }
  300. },
  301. top() {
  302. uni.pageScrollTo({
  303. scrollTop: 0,
  304. duration: 500
  305. })
  306. },
  307. search() { //搜索按钮搜索
  308. this.searchinp()
  309. },
  310. searchinp() { //自动搜索
  311. Debounce(() => {
  312. this.page = 1
  313. this.eqlistdata = []
  314. if (this.side_type == 18) {
  315. this.eqlist()
  316. } else if (this.side_type == 17) {
  317. this.tubulareqlist()
  318. } else if (this.side_type == 13) {
  319. this.sfeqlist()
  320. } else if (this.side_type == 'xph') {
  321. this.xphlist()
  322. }else if (this.side_type == 'zs') {
  323. this.zslist()
  324. }
  325. }, 1000)()
  326. },
  327. tabClick(index, type) {
  328. this.active = index
  329. this.side_type = type
  330. this.page = 1
  331. if (type == 18) {
  332. this.eqlistdata = []
  333. this.eqlist()
  334. } else if (type == 17) {
  335. this.eqlistdata = []
  336. this.tubulareqlist()
  337. } else if (type == 13) {
  338. this.eqlistdata = []
  339. this.sfeqlist()
  340. } else if (type == 'xph') {
  341. this.eqlistdata = []
  342. this.xphlist()
  343. } else if (type == 'zs') {
  344. this.eqlistdata = []
  345. this.zslist()
  346. }
  347. },
  348. timezhuan(time) {
  349. function fun(a) {
  350. return String(a).length == 1 ? '0' + a : a
  351. }
  352. let date = new Date(time * 1000)
  353. let y = date.getFullYear()
  354. let m = date.getMonth() + 1
  355. let d = date.getDate()
  356. let h = date.getHours()
  357. let min = date.getMinutes()
  358. let sec = date.getSeconds()
  359. return `${y}-${fun(m)}-${fun(d)} ${fun(h)}:${fun(min)}:${fun(sec)}`
  360. },
  361. newdata(item) {
  362. if (this.side_type == 17) {
  363. uni.navigateTo({
  364. url: "realtimedata?item=" + JSON.stringify(item)
  365. })
  366. } else {
  367. uni.navigateTo({
  368. url: "weathdata?item=" + JSON.stringify(item)
  369. })
  370. }
  371. },
  372. selectaddress(city, name) { //获取分布位置
  373. uni.request({
  374. type: "GET",
  375. url: "https://restapi.amap.com/v3/geocode/geo?address=" + city +
  376. "&key=78ce288400f4fc6d9458989875c833c2",
  377. dataType: "json",
  378. complete: ress => {
  379. console.log(ress)
  380. if (ress.data.status == 1) {
  381. // ress.data.geocodes[0].location
  382. uni.navigateTo({
  383. url: "./irrmap?lnglat=" + ress.data.geocodes[0].location +
  384. "&basename=" + name
  385. })
  386. } else {
  387. uni.showToast({
  388. title: "地址编译失败",
  389. icon: "none"
  390. })
  391. }
  392. }
  393. });
  394. },
  395. async pumpcontrol(en) { //水肥开关
  396. console.log(en)
  397. const res = await this.$myRequest({
  398. url: '/api/api_gateway?method=irrigation_system.hydropower.water_pump_control',
  399. data: {
  400. times: Math.floor(this.timevalue * 60),
  401. device_id: this.selid,
  402. status: en ? 1 : 0
  403. }
  404. })
  405. console.log(res)
  406. if (res.code == 200) {
  407. uni.showToast({
  408. title: "操作成功",
  409. icon: "none"
  410. })
  411. } else {
  412. uni.showToast({
  413. title: res.msg,
  414. icon: "none"
  415. })
  416. this.eqlistdata[this.selindex].water_pump_switch2 = !this.eqlistdata[this.selindex]
  417. .water_pump_switch2
  418. }
  419. this.timevalue = ""
  420. },
  421. switchchange(e, id, index) { //水肥 开关
  422. console.log(e)
  423. if (e) {
  424. this.show = true
  425. this.selindex = index
  426. this.selid = id
  427. } else {
  428. this.selid = id
  429. this.pumpcontrol(false)
  430. }
  431. },
  432. async switchchange2(e, id, index) { //水电开关
  433. console.log(id)
  434. const res = await this.$myRequest({
  435. url: '/api/api_gateway?method=irrigation_system.waterfertilizer.water_fertilizer_control',
  436. data: {
  437. device_ids: id,
  438. isopen: e ? 1 : 0
  439. }
  440. })
  441. console.log(res)
  442. if (res.info == "ok") {
  443. uni.showToast({
  444. title: "操作成功",
  445. icon: "none"
  446. })
  447. } else {
  448. uni.showToast({
  449. title: res.msg,
  450. icon: "none"
  451. })
  452. this.eqlistdata[index].status2 = !this.eqlistdata[index].status2
  453. }
  454. },
  455. modalcancel() { //水肥开关 确定
  456. this.eqlistdata[this.selindex].water_pump_switch2 = !this.eqlistdata[this.selindex].water_pump_switch2
  457. this.timevalue = ""
  458. },
  459. modalconfirm() { //水肥开关 取消
  460. this.show = true
  461. if (this.timevalue == "") {
  462. uni.showToast({
  463. title: "请输入开泵时间",
  464. icon: "none"
  465. })
  466. } else {
  467. this.show = false
  468. this.pumpcontrol(true)
  469. }
  470. },
  471. changeremark(item, index) { //修改备注
  472. this.timevalueremark = item.device_notes
  473. this.showremark = true
  474. this.selindex = index
  475. this.selid = item.device_id
  476. },
  477. modalcancelremark() { //修改备注 取消
  478. },
  479. modalconfirmremark() { //修改备注 确定
  480. this.showremark = true
  481. if (this.timevalueremark == "") {
  482. uni.showToast({
  483. title: "请输入设备备注",
  484. icon: "none"
  485. })
  486. } else {
  487. this.showremark = false
  488. this.setchangeremark()
  489. }
  490. },
  491. async setchangeremark() { //水肥开关
  492. const res = await this.$myRequest({
  493. url: '/api/api_gateway?method=irrigation_system.hydropower.water_pump_modify_device_notes',
  494. data: {
  495. device_id: this.selid,
  496. content: this.timevalueremark
  497. }
  498. })
  499. console.log(res)
  500. if (res) {
  501. uni.showToast({
  502. title: "操作成功",
  503. icon: "none"
  504. })
  505. this.eqlistdata[this.selindex].device_notes = this.timevalueremark
  506. }
  507. },
  508. },
  509. onLoad() {
  510. // this.tubulareqlist()
  511. uni.getStorage({
  512. key: "jurisdiction",
  513. success: (res) => {
  514. let items = JSON.parse(res.data).filter((item) => {
  515. return item.pur_id == 202
  516. })
  517. var itemarr = items[0].children
  518. console.log(itemarr)
  519. for (var i = 0; i < itemarr.length; i++) {
  520. switch (itemarr[i].pur_id) {
  521. case 204:
  522. this.equipArr[0].tf = true
  523. break
  524. case 203:
  525. this.equipArr[1].tf = true
  526. break
  527. case 195:
  528. this.equipArr[2].tf = true
  529. break;
  530. case 288:
  531. this.equipArr[3].tf = true
  532. break;
  533. case 400:
  534. this.equipArr[4].tf = true
  535. break;
  536. // case 398:
  537. // this.equipArr[5].tf = true
  538. // break;
  539. }
  540. }
  541. for (var i = 0; i < this.equipArr.length; i++) {
  542. if (this.equipArr[i].tf) {
  543. if (i == 0) {
  544. this.tubulareqlist();
  545. } else if (i == 1) {
  546. this.eqlist();
  547. } else if (i == 2) {
  548. this.sfeqlist();
  549. } else if(i == 3) {
  550. this.xphlist();
  551. }else if(i == 4){
  552. this.zslist()
  553. }
  554. this.active = i
  555. this.side_type = this.equipArr[i].type
  556. break
  557. }
  558. }
  559. }
  560. })
  561. },
  562. onReachBottom() {
  563. this.page++
  564. // this.eqlist()
  565. if (this.side_type == 18) {
  566. this.eqlist()
  567. } else if (this.side_type == 17) {
  568. this.tubulareqlist()
  569. } else if (this.side_type == 13) {
  570. this.sfeqlist()
  571. } else if (this.side_type == 'xph') {
  572. this.xphlist()
  573. }else if (this.side_type == 'zs') {
  574. this.zslist()
  575. }
  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>