index.vue 22 KB

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