cmb.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  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; width: 100%">
  6. <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" title="设备详情"></uni-nav-bar>
  7. </view>
  8. <view class="info">
  9. <view class="info_item">
  10. <image src="http://www.hnyfwlw.com:8006/bigdata_app/image/cb/onBg.png" mode="" class="bgi"></image>
  11. <p style="font-size: 32rpx" @click="copy(eqinfo.device_id)">
  12. 设备 ID:{{ eqinfo.device_id }}
  13. <image src="http://www.hnyfwlw.com:8006/bigdata_app/image/environment/fuzhi.png" mode=""
  14. class="tishi"></image>
  15. </p>
  16. <p>设备名称:{{ eqinfo.device_name || "无" }}</p>
  17. <p>
  18. 最近上报时间:<span v-if="eqinfo.uptime">{{
  19. eqinfo.uptime | timeFormat()
  20. }}</span><span v-else>{{ eqinfo.addtime | timeFormat() }}</span>
  21. </p>
  22. <p>地址:{{ eqinfo.location || "暂无地址" }}</p>
  23. </view>
  24. </view>
  25. <view class="control">
  26. <view class="control_item" v-if="kongtf" @click="control">
  27. <image :src="
  28. 'http://www.hnyfwlw.com:8006/bigdata_app' +
  29. '/image/environment/forecastResult.png'
  30. " mode=""></image>
  31. <p>预测结果</p>
  32. </view>
  33. </view>
  34. <view class="his_box" v-if="datatf">
  35. <view class="selecttimes" @click="tiemshow = !tiemshow">
  36. <view class="timesbox">
  37. <image
  38. :src="'http://www.hnyfwlw.com:8006/bigdata_app/image/prevention/1acfe2751c01d3786cdc49b83d7e505.png'"
  39. mode=""></image>
  40. <p>{{ timetab(begintime) }}</p>
  41. <p class="or">~</p>
  42. <p>{{ timetab(end) }}</p>
  43. <u-icon name="rili" custom-prefix="custom-icon" class="icon"></u-icon>
  44. </view>
  45. <u-calendar v-model="tiemshow" mode="range" @change="tiemchange"></u-calendar>
  46. </view>
  47. <view class="shuju_one">
  48. <view class="canvastishi" v-if="!canvastishiTF && !dataloadingtf">
  49. 暂无数据
  50. </view>
  51. <view class="canvastishi" v-if="dataloadingtf">
  52. <p class="dataloading">加载中</p>
  53. </view>
  54. <canvas v-show="!tiemshow" canvas-id="canvasColumnA" id="canvasColumnA" class="charts"
  55. @touchstart="touchLineA($event)" @touchmove="moveLineA($event)"
  56. @touchend="touchEndLineA($event)" disable-scroll="true" :style="{
  57. width: cWidth * pixelRatio + 'px',
  58. height: cHeight * pixelRatio + 'px',
  59. transform: 'scale(' + 1 / pixelRatio + ')',
  60. 'margin-left': (-cWidth * (pixelRatio - 1)) / 2 + 'px',
  61. 'margin-top': (-cHeight * (pixelRatio - 1)) / 2 + 'px',
  62. }"></canvas>
  63. <canvas v-show="!tiemshow" canvas-id="canvasColumnB" id="canvasColumnB" class="charts"
  64. @touchstart="touchLineB($event)" @touchmove="moveLineB($event)"
  65. @touchend="touchEndLineB($event)" disable-scroll="true" :style="{
  66. width: cWidth * pixelRatio + 'px',
  67. height: cHeight * pixelRatio + 'px',
  68. transform: 'scale(' + 1 / pixelRatio + ')',
  69. 'margin-left': (-cWidth * (pixelRatio - 1)) / 2 + 'px',
  70. 'margin-top': (-cHeight * (pixelRatio - 1)) / 2 + 'px',
  71. }"></canvas>
  72. </view>
  73. <view class="condition">
  74. <scroll-view scroll-top="0" scroll-x="true" class="scroll-X">
  75. <table class="table">
  76. <tr class="tr">
  77. <th class="th" v-for="(item, index) in tableHead" :key="'a' + index">
  78. {{ item }}
  79. </th>
  80. </tr>
  81. <tr class="tr" v-for="(items, indexs) in historylistdata" :key="'b' + indexs"
  82. v-if="!forbidden">
  83. <td class="td">{{ items.uploadTime | timeFormat() }}</td>
  84. <td class="td">{{ items.dianChiDianYa }}</td>
  85. <td class="td">{{ items.fiftyTuRangHanShuiLiang }}</td>
  86. <td class="td">{{ items.fiftyTuRangWenDu }}</td>
  87. <td class="td">{{ items.fiveTuRangHanShuiLiang }}</td>
  88. <td class="td">{{ items.fiveTuRangWenDu }}</td>
  89. <td class="td">{{ items.kongQiWenDu }}</td>
  90. <td class="td">{{ items.luDianWenDu }}</td>
  91. <td class="td">{{ items.riZhaoShiShu }}</td>
  92. <td class="td">{{ items.shiRunShiJian }}</td>
  93. <td class="td">{{ items.tenTuRangHanShuiLiang }}</td>
  94. <td class="td">{{ items.tenTuRangWenDu }}</td>
  95. <td class="td">{{ items.tianJiangYuLiang }}</td>
  96. <td class="td">{{ items.tuRangDaoDianLv }}</td>
  97. <td class="td">{{ items.twentyFiveTuRangHanShuiLiang }}</td>
  98. <td class="td">{{ items.twentyFiveTuRangWenDu }}</td>
  99. <td class="td">{{ items.twentyTuRangHanShuiLiang }}</td>
  100. <td class="td">{{ items.twentyTuRangWenDu }}</td>
  101. <td class="td">{{ items.xiangDuiShiDu }}</td>
  102. <td class="td">{{ items.xiaoShiJiangYuLiang }}</td>
  103. </tr>
  104. <tr class="tr" v-if="forbidden">
  105. <td class="td" v-for="item in 13">暂无数据</td>
  106. </tr>
  107. </table>
  108. </scroll-view>
  109. <view class="pagenumber">
  110. <button @click="prev">上一页</button>
  111. <view class="pagenumber_page"> 第 {{ page }} 页 </view>
  112. <view class="pagenumber_page"> 共 {{ pagesum }} 页 </view>
  113. <button @click="next">下一页</button>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </template>
  120. <script>
  121. import uCharts from "../../components/js_sdk/u-charts/u-charts/u-charts.js";
  122. var canvaColumnA = null;
  123. var canvaColumnB = null;
  124. export default {
  125. data() {
  126. return {
  127. basetype: "",
  128. kongtf: false,
  129. datatf: false,
  130. eqinfo: {},
  131. city: "河南省",
  132. tiemshow: false, //时间筛选弹框
  133. begintime: "", //开始时间
  134. end: "", //结束时间
  135. dataloadingtf: true,
  136. canvastishiTF: false,
  137. device_id: "", //设备ID
  138. tableHead: [
  139. "上报时间",
  140. "电池电压",
  141. "50cm土壤含水量",
  142. "50cm土壤温度",
  143. "5cm土壤含水量",
  144. "5cm土壤温度",
  145. "空气温度",
  146. "露点温度",
  147. "日照时数",
  148. "叶面湿润时间",
  149. "10cm土壤含水量",
  150. "10cm土壤温度",
  151. "天降雨量",
  152. "土壤导电率",
  153. "25cm土壤含水量",
  154. "25cm土壤温度",
  155. "20cm土壤含水量",
  156. "20cm土壤温度",
  157. "相对湿度",
  158. "时降雨量",
  159. ], //表格抬头
  160. forbidden: false,
  161. historylistdata: [], //历史数据
  162. pagesum: 1,
  163. page: 1,
  164. cWidth: "",
  165. cHeight: "",
  166. pixelRatio: 1,
  167. param: {
  168. dianChiDianYa: "电池电压",
  169. fiftyTuRangHanShuiLiang: "50cm土壤含水量",
  170. fiftyTuRangWenDu: "50cm土壤温度",
  171. fiveTuRangHanShuiLiang: "5cm土壤含水量",
  172. fiveTuRangWenDu: "5cm土壤温度",
  173. kongQiWenDu: "空气温度",
  174. luDianWenDu: "露点温度",
  175. riZhaoShiShu: "日照时数",
  176. shiRunShiJian: "叶面湿润时间",
  177. tenTuRangHanShuiLiang: "10cm土壤含水量",
  178. tenTuRangWenDu: "10cm土壤温度",
  179. tianJiangYuLiang: "天降雨量",
  180. tuRangDaoDianLv: "土壤导电率",
  181. twentyFiveTuRangHanShuiLiang: "25cm土壤含水量",
  182. twentyFiveTuRangWenDu: "25cm土壤温度",
  183. twentyTuRangHanShuiLiang: "20cm土壤含水量",
  184. twentyTuRangWenDu: "20cm土壤温度",
  185. xiangDuiShiDu: "相对湿度",
  186. xiaoShiJiangYuLiang: "小时降雨量",
  187. },
  188. color: [
  189. "#ff7b30",
  190. "#f93948",
  191. "#fb2ea4",
  192. "#bc59db",
  193. "#7457ec",
  194. "#307dfd",
  195. "#31bfff",
  196. "#46e9b1",
  197. "#19cd48",
  198. "#b2e409",
  199. "#f0f254",
  200. "#fed000",
  201. "#f06f14",
  202. "#a74040",
  203. "#90bb71",
  204. "#a07635",
  205. "#6502bd",
  206. "#048bbb",
  207. "#9ebb01",
  208. "#cc9202",
  209. "#ff8fa0",
  210. "#a3d55f",
  211. "#d9bedd",
  212. "#00a6b6",
  213. "#236093",
  214. "#009fff",
  215. "#ddc0a6",
  216. "#c4a6dd",
  217. "#dda6a6",
  218. "#779e33",
  219. "#a6ddb0",
  220. ],
  221. };
  222. },
  223. methods: {
  224. copy(item) {
  225. uni.setClipboardData({
  226. data: item,
  227. success: function() {
  228. console.log("success");
  229. },
  230. });
  231. },
  232. control() {
  233. //设备控制
  234. uni.navigateTo({
  235. url: "./forecastResult?id=" + this.eqinfo.device_id,
  236. });
  237. },
  238. tiemchange(e) {
  239. console.log(e);
  240. //切换时间
  241. // this.begintime = parseInt(+new Date(e.startDate) / 1000);
  242. this.begintime = parseInt(+new Date(`${e.startDate} 00:00:00`) / 1000);
  243. this.end = parseInt(+new Date(`${e.endDate} 00:00:00`) / 1000);
  244. this.histprydatas();
  245. this.getChartLine();
  246. },
  247. timetab(e) {
  248. //时间转换
  249. e = new Date(e * 1000);
  250. var year = e.getFullYear();
  251. var month =
  252. e.getMonth() + 1 < 10 ? "0" + (e.getMonth() + 1) : e.getMonth() + 1;
  253. var day = e.getDate() < 10 ? "0" + e.getDate() : e.getDate();
  254. var time = year + "/" + month + "/" + day;
  255. return time;
  256. },
  257. // 表格数据
  258. async histprydatas() {
  259. //表格历史数据
  260. const res = await this.$myRequest({
  261. url: "/api/api_gateway?method=wheat.wheat.wheat_data_list",
  262. data: {
  263. device_id: this.eqinfo.device_id,
  264. page: this.page,
  265. begin: this.begintime,
  266. end: this.end,
  267. },
  268. });
  269. this.pagesum = Math.ceil(res.nums / 10) || 1;
  270. if (this.pagesum > 0) {
  271. var dat = res.sta;
  272. this.historylistdata = [];
  273. for (var i = 0; i < dat.length; i++) {
  274. var item = eval("(" + dat[i] + ")");
  275. var obj = {};
  276. for (var i1 in item) {
  277. // if (i1 == "uploadTime") {
  278. // obj[i1] = this.formatTime(item[i1] * 1000);
  279. // } else {
  280. obj[i1] = item[i1];
  281. // }
  282. }
  283. this.historylistdata.push(obj);
  284. }
  285. } else {
  286. this.historylistdata = [];
  287. }
  288. },
  289. //获取折线图数据
  290. async getChartLine() {
  291. const res = await this.$myRequest({
  292. method: "POST",
  293. url: "/api/api_gateway?method=wheat.wheat.wheat_data",
  294. data: {
  295. device_id: this.eqinfo.device_id,
  296. begin: this.begintime,
  297. end: this.end,
  298. },
  299. });
  300. this.dataloadingtf = false;
  301. var dat = res;
  302. if (dat.length) {
  303. var regroupData = []; //重组数据
  304. var kindArr = []; //通道数组
  305. var time = [];
  306. var xtitle = [];
  307. for (var i = 0; i < dat.length; i++) {
  308. var item = eval("(" + dat[i] + ")");
  309. var tim = parseInt(item["uploadTime"]) * 1000;
  310. var times = new Date(tim);
  311. xtitle.unshift(
  312. times.getMonth() +
  313. 1 +
  314. "/" +
  315. times.getDate() +
  316. "-" +
  317. times.getHours() +
  318. ":" +
  319. times.getMinutes()
  320. );
  321. time.unshift(tim);
  322. for (var j in item) {
  323. var arr = "";
  324. if (j == "id" || j == "uploadTime") {
  325. continue;
  326. } else if (kindArr.indexOf(j) == "-1") {
  327. kindArr.push(j);
  328. regroupData.push({
  329. name: this.param[j],
  330. color: this.color[kindArr.length - 1],
  331. data: [],
  332. });
  333. // arr.push(tim);
  334. arr = parseFloat(item[j]);
  335. regroupData[kindArr.indexOf(j)].data.unshift(arr);
  336. } else {
  337. // arr.push(tim);
  338. // arr.push(parseFloat(item[j]));
  339. arr = parseFloat(item[j]);
  340. regroupData[kindArr.indexOf(j)].data.unshift(arr);
  341. }
  342. }
  343. }
  344. console.log(regroupData);
  345. // 分割折线图
  346. const regroupDataNum = Math.ceil(regroupData.length / 2);
  347. const options1 = regroupData.filter((v, i) => {
  348. return i < regroupDataNum;
  349. });
  350. const options2 = regroupData.filter((v, i) => {
  351. return i >= regroupDataNum;
  352. });
  353. console.log(options1, options1);
  354. this.showColumn("canvasColumnA", xtitle, options1);
  355. this.showColumn("canvasColumnB", xtitle, options2);
  356. this.canvastishiTF = true;
  357. } else {
  358. this.canvastishiTF = false;
  359. this.showColumn("canvasColumnA", xtitle, []);
  360. this.showColumn("canvasColumnB", xtitle, []);
  361. }
  362. },
  363. prev() {
  364. //上一页
  365. if (this.page > 1) {
  366. this.page--;
  367. this.histprydatas();
  368. }
  369. },
  370. next() {
  371. //下一页
  372. if (this.page < this.pagesum) {
  373. this.page++;
  374. this.histprydatas();
  375. }
  376. },
  377. clickLeft() {
  378. uni.navigateBack({
  379. delta: 1,
  380. });
  381. },
  382. showColumn(id, xtitle, xinfo) {
  383. console.log(id);
  384. var _self = this;
  385. if (id === "canvasColumnA") {
  386. canvaColumnA = new uCharts({
  387. canvasId: id,
  388. type: "line",
  389. legend: {
  390. position: "top",
  391. },
  392. fontSize: 11,
  393. background: "#FFFFFF",
  394. pixelRatio: 1,
  395. animation: true,
  396. dataLabel: false,
  397. categories: xtitle,
  398. series: xinfo,
  399. enableScroll: true, //开启图表拖拽功能
  400. xAxis: {
  401. disableGrid: true,
  402. type: "grid",
  403. gridType: "dash",
  404. itemCount: 4, //x轴单屏显示数据的数量,默认为5个
  405. scrollShow: true, //新增是否显示滚动条,默认false
  406. // scrollAlign: 'left', //滚动条初始位置
  407. scrollBackgroundColor: "#F7F7FF", //默认为 #EFEBEF
  408. scrollColor: "#DEE7F7", //默认为 #A6A6A6
  409. },
  410. yAxis: {},
  411. width: _self.cWidth * 1,
  412. height: _self.cHeight * 1,
  413. extra: {
  414. line: {
  415. type: "curve",
  416. },
  417. },
  418. });
  419. } else if (id === "canvasColumnB") {
  420. canvaColumnB = new uCharts({
  421. canvasId: id,
  422. type: "line",
  423. legend: {
  424. position: "top",
  425. },
  426. fontSize: 11,
  427. background: "#FFFFFF",
  428. pixelRatio: 1,
  429. animation: true,
  430. dataLabel: false,
  431. categories: xtitle,
  432. series: xinfo,
  433. enableScroll: true, //开启图表拖拽功能
  434. xAxis: {
  435. disableGrid: true,
  436. type: "grid",
  437. gridType: "dash",
  438. itemCount: 4, //x轴单屏显示数据的数量,默认为5个
  439. scrollShow: true, //新增是否显示滚动条,默认false
  440. // scrollAlign: 'left', //滚动条初始位置
  441. scrollBackgroundColor: "#F7F7FF", //默认为 #EFEBEF
  442. scrollColor: "#DEE7F7", //默认为 #A6A6A6
  443. },
  444. yAxis: {},
  445. width: _self.cWidth * 1,
  446. height: _self.cHeight * 1,
  447. extra: {
  448. line: {
  449. type: "curve",
  450. },
  451. },
  452. });
  453. }
  454. },
  455. touchLineA(e) {
  456. console.log(e);
  457. canvaColumnA.scrollStart(e);
  458. },
  459. moveLineA(e) {
  460. canvaColumnA.scroll(e);
  461. },
  462. touchEndLineA(e) {
  463. canvaColumnA.scrollEnd(e);
  464. //下面是toolTip事件,如果滚动后不需要显示,可不填写
  465. canvaColumnA.showToolTip(e, {
  466. format: function(item, category) {
  467. return category + " " + item.name + ":" + item.data;
  468. },
  469. });
  470. },
  471. touchLineB(e) {
  472. console.log(e);
  473. canvaColumnB.scrollStart(e);
  474. },
  475. moveLineB(e) {
  476. canvaColumnB.scroll(e);
  477. },
  478. touchEndLineB(e) {
  479. canvaColumnB.scrollEnd(e);
  480. //下面是toolTip事件,如果滚动后不需要显示,可不填写
  481. canvaColumnB.showToolTip(e, {
  482. format: function(item, category) {
  483. return category + " " + item.name + ":" + item.data;
  484. },
  485. });
  486. },
  487. },
  488. onLoad(option) {
  489. this.eqinfo = JSON.parse(option.shebei);
  490. this.basetype = this.eqinfo.type
  491. this.cWidth = uni.upx2px(650);
  492. this.cHeight = uni.upx2px(500);
  493. this.device_id = option.id;
  494. this.end = parseInt(+new Date() / 1000);
  495. this.begintime = parseInt(this.end - 24 * 60 * 60);
  496. this.histprydatas();
  497. this.getChartLine();
  498. if (this.basetype == 11) {
  499. this.kongtf = this.$QueryPermission(251)
  500. this.datatf = this.$QueryPermission(221)
  501. } else if (this.basetype == 19) {
  502. this.kongtf = this.$QueryPermission(252)
  503. this.datatf = this.$QueryPermission(222)
  504. } else if (this.basetype == 20) {
  505. this.kongtf = this.$QueryPermission(253)
  506. this.datatf = this.$QueryPermission(223)
  507. }
  508. },
  509. };
  510. </script>
  511. <style lang="scss">
  512. .info {
  513. width: 100%;
  514. position: absolute;
  515. top: 44px;
  516. .info_item {
  517. width: 90%;
  518. margin: 0 auto;
  519. height: 240rpx;
  520. padding: 40rpx 50rpx;
  521. position: relative;
  522. box-sizing: border-box;
  523. .bgi {
  524. width: 100%;
  525. height: 100%;
  526. position: absolute;
  527. top: 0;
  528. left: 0;
  529. z-index: -1;
  530. }
  531. p {
  532. font-size: 24rpx;
  533. color: #ffffff;
  534. margin-bottom: 10rpx;
  535. .tishi {
  536. width: 30rpx;
  537. height: 30rpx;
  538. margin: 0rpx 0 0 20rpx;
  539. }
  540. }
  541. }
  542. }
  543. .control {
  544. width: 90%;
  545. position: absolute;
  546. top: 360rpx;
  547. left: 5%;
  548. display: flex;
  549. text-align: center;
  550. // padding: 0 30rpx;
  551. box-sizing: border-box;
  552. .control_item {
  553. width: 128rpx;
  554. height: 120rpx;
  555. width: 20%;
  556. image {
  557. width: 70rpx;
  558. height: 70rpx;
  559. }
  560. p {
  561. font-size: 24rpx;
  562. }
  563. }
  564. }
  565. .his_box {
  566. width: 100%;
  567. top: 270px;
  568. position: relative;
  569. }
  570. .selecttimes {
  571. width: 90%;
  572. box-shadow: 0 0 10rpx #bcb9ca;
  573. padding: 10rpx 20rpx;
  574. box-sizing: border-box;
  575. margin: 0 auto;
  576. font-size: 28rpx;
  577. .timesbox {
  578. display: flex;
  579. justify-content: space-around;
  580. image {
  581. width: 30rpx;
  582. height: 30rpx;
  583. margin-top: 6rpx;
  584. }
  585. .icon {
  586. color: #949494;
  587. text-align: right;
  588. margin-left: 30rpx;
  589. }
  590. }
  591. /deep/.u-calendar__action {
  592. display: flex;
  593. justify-content: space-around;
  594. .u-calendar__action__text {
  595. line-height: 25px;
  596. }
  597. }
  598. }
  599. .shuju_one {
  600. width: 90%;
  601. margin: 20px auto;
  602. box-shadow: 0 0 10rpx #bcb9ca;
  603. padding-top: 20rpx;
  604. height: 1000rpx;
  605. .canvastishi {
  606. font-size: 32rpx;
  607. position: absolute;
  608. top: 50%;
  609. left: 50%;
  610. margin-left: -64rpx;
  611. margin-top: -21rpx;
  612. .dataloading:after {
  613. overflow: hidden;
  614. display: inline-block;
  615. vertical-align: bottom;
  616. animation: ellipsis 2s infinite;
  617. content: "\2026";
  618. }
  619. @keyframes ellipsis {
  620. from {
  621. width: 2px;
  622. }
  623. to {
  624. width: 15px;
  625. }
  626. }
  627. }
  628. }
  629. .condition {
  630. display: flex;
  631. flex-wrap: wrap;
  632. width: 90%;
  633. box-shadow: 0 0 10rpx #bcb9ca;
  634. margin: 0 auto 30rpx;
  635. .scroll-X {
  636. width: 95%;
  637. margin: 20rpx auto;
  638. .tr {
  639. display: flex;
  640. overflow: hidden;
  641. .th,
  642. .td {
  643. display: inline-block;
  644. padding: 5rpx;
  645. width: 300rpx;
  646. text-align: center;
  647. height: 52rpx;
  648. line-height: 52rpx;
  649. border: 2rpx solid #f1f1f1;
  650. }
  651. }
  652. .tr:nth-child(2n-1) {
  653. background-color: #f5fff8;
  654. }
  655. .tr:first-child {
  656. background-color: #57c878;
  657. color: #fff;
  658. }
  659. }
  660. .pagenumber {
  661. display: flex;
  662. margin: 20rpx auto;
  663. button {
  664. width: 150rpx;
  665. height: 50rpx;
  666. line-height: 50rpx;
  667. font-size: 26rpx;
  668. text-align: center;
  669. background-color: #57c878;
  670. color: #ffffff;
  671. }
  672. .pagenumber_page {
  673. width: 100rpx;
  674. height: 50rpx;
  675. line-height: 50rpx;
  676. font-size: 26rpx;
  677. text-align: center;
  678. }
  679. }
  680. }
  681. </style>