index.vue 21 KB

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