index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <template>
  2. <view>
  3. <u-navbar title="微营业厅" title-color="#fff" :is-back="false" :background="background" back-icon-color="#ffffff"></u-navbar>
  4. <!-- 账户充值 扣费记录 -->
  5. <view class="function2">
  6. <view class="companyName">
  7. <image class="img"
  8. src="@/assets/img/companyName.png" mode=""></image>
  9. <span :class="electricity.id?'fullName1':'fullName2'">
  10. {{personInfo.name}} </span>
  11. </view>
  12. <view class="titleElectricity" v-if="electricity.id">
  13. <span class="spanradius" :class="{
  14. normal:electricity.online
  15. }" ></span>
  16. {{electricity.online?'电表在线':'电表离线'}}</view>
  17. </view>
  18. <view class="function">
  19. <view class="item" @click="gotoUrl('/pages/recharge/accountRecharge')">
  20. <view class="icon">
  21. <image class="img" src="@/assets/img/iconPark-wallet.svg" mode=""></image>
  22. </view>
  23. <view class="text">
  24. <view class="title">
  25. 账户充值
  26. </view>
  27. <view class="infos">
  28. 余额 {{personInfo.balance}}元
  29. </view>
  30. </view>
  31. </view>
  32. <view class="item" @click="gotoUrl('/pages/deductionRecord/deductionRecord')">
  33. <view class="icon icon2">
  34. <image class="img" src="@/assets/img/iconPark-order.svg" mode=""></image>
  35. </view>
  36. <view class="text">
  37. <view class="title">
  38. 扣费记录
  39. </view>
  40. <view class="infos">
  41. 查看每日用电情况
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 管家服务 -->
  47. <view class="housekeeper-service">
  48. <view class="title">
  49. 管家服务
  50. </view>
  51. <view class="grid">
  52. <u-grid :col="4" :border="false">
  53. <u-grid-item @click="gotoUrl('/pages/meterManagement/meterManagement')" >
  54. <view class="icon icon10">
  55. <image class="img" src="@/assets/img/fas fa-plus-circle.svg" mode=""></image>
  56. </view>
  57. <view class="grid-text">电表管理
  58. </view>
  59. </u-grid-item>
  60. <u-grid-item @click="gotoUrl('/pages/recharge/rechargeRecord')" >
  61. <view class="icon icon1">
  62. <image class="img" src="@/assets/img/far fa-clock.svg" mode=""></image>
  63. </view>
  64. <view class="grid-text">充值记录
  65. </view>
  66. </u-grid-item>
  67. <u-grid-item @click="gotoUrl('/pages/billingRules/billingRules')" >
  68. <view class="icon icon2">
  69. <image class="img" src="@/assets/img/fas fa-file-alt.svg" mode=""></image>
  70. </view>
  71. <view class="grid-text">计费规则
  72. </view>
  73. </u-grid-item>
  74. <u-grid-item @click="gotoUrl('/pages/message/messageList?type=AA&typeName=账单提醒')">
  75. <view class="icon icon3">
  76. <image class="img" src="@/assets/img/antFill-account-book.svg" mode=""></image>
  77. <view class="dot" v-if="headlineBill.unReadtNum" >
  78. </view>
  79. </view>
  80. <view class="grid-text">账单提醒
  81. </view>
  82. </u-grid-item>
  83. <u-grid-item v-if="false" @click="gotoUrl('/pages/message/messageList?type=3&typeName=断电提醒')">
  84. <view class="icon icon9">
  85. <image class="img" src="@/assets/img/fas fa-exclamation-triangle.svg" mode=""></image>
  86. <view class="dot" v-if="unReadtNum(3)" >
  87. </view>
  88. </view>
  89. <view class="grid-text">断电提醒
  90. </view>
  91. </u-grid-item>
  92. <u-grid-item v-if="(electricity.id&&electricity.type!=6)"
  93. @click="gotoUrl('/pages/remoteControl/switchDetail?id='+electricity.id)">
  94. <view class="icon icon11">
  95. <image class="img" src="@/assets/img/antFill-control.svg" mode=""></image>
  96. </view>
  97. <view class="grid-text">智能监控
  98. </view>
  99. </u-grid-item>
  100. <u-grid-item v-else
  101. @click="gotoUrl('/pages/message/messageList?type=5&typeName=停电通知')">
  102. <view class="icon icon5">
  103. <image class="img" src="@/assets/img/antFill-notification.svg" mode=""></image>
  104. <view class="dot" v-if="unReadtNum(5)" >
  105. </view>
  106. </view>
  107. <view class="grid-text">停电通知
  108. </view>
  109. </u-grid-item>
  110. <u-grid-item @click="gotoUrl('/pages/message/messageList?type=4&typeName=故障警报')">
  111. <view class="icon icon6">
  112. <image class="img" src="@/assets/img/fas fa-exclamation-triangle.svg" mode=""></image>
  113. <view class="dot" v-if="unReadtNum(4)" >
  114. </view>
  115. </view>
  116. <view class="grid-text">故障警报
  117. </view>
  118. </u-grid-item>
  119. <u-grid-item @click="gotoUrl('/pages/mine/electronicMonitoring?id='+electricity.id)">
  120. <view class="icon icon7">
  121. <image class="img" src="@/assets/img/fas fa-chart-pie.svg" mode=""></image>
  122. </view>
  123. <view class="grid-text">用电监控
  124. </view>
  125. </u-grid-item>
  126. <u-grid-item v-if="false" @click="gotoUrl('/pages/mine/contactService')" >
  127. <view class="icon icon4">
  128. <image class="img" src="@/assets/img/if-support.svg" mode=""></image>
  129. </view>
  130. <view class="grid-text">客服热线
  131. </view>
  132. </u-grid-item>
  133. <u-grid-item v-if="false" @click="gotoUrl('/pages/billingRules/billingRules')">
  134. <view class="icon icon8">
  135. <image class="img" src="@/assets/img/fas fa-book.svg" mode=""></image>
  136. </view>
  137. <view class="grid-text">用电常识
  138. </view>
  139. </u-grid-item>
  140. <u-grid-item @click="gotoUrl('/pages/message/knowledgeList')">
  141. <view class="icon icon4">
  142. <image class="img" src="@/assets/img/if-book-alt.svg" mode=""></image>
  143. </view>
  144. <view class="grid-text">用电知识
  145. </view>
  146. </u-grid-item>
  147. </u-grid>
  148. </view>
  149. </view>
  150. <view class="cover">
  151. <view class="text">
  152. 预存余额 安心用电
  153. </view>
  154. </view>
  155. <u-modal v-model="openModalBl" @confirm="confirmPhone" confirm-text="拨打电话" confirm-color="#606266"
  156. :show-cancel-button="true" ref="uModal" :asyncClose="true" title="客服电话" content="400-8899-619"
  157. :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
  158. <u-divider border-color="#bbbbbb" half-width="80" style="margin-bottom: 60rpx;"
  159. @click="openModalBl=true"
  160. color="#777777">e家能源 服务热线 <text
  161. class="tel">400-8899-619</text></u-divider>
  162. <Tabbar :current="0" ref="tabbarMain" :prefetchNum="prefetchNum" ></Tabbar>
  163. </view>
  164. </template>
  165. <script>
  166. import * as API from '@/apis/pagejs/index.js'
  167. import * as API_message from '@/apis/pagejs/message.js'
  168. import * as API_Electricity from '@/apis/pagejs/tenantElectricityMeter.js'
  169. import Tabbar from '@/components/Tabbar.vue'
  170. export default {
  171. components: {
  172. Tabbar
  173. },
  174. data() {
  175. return {
  176. openModalBl:false,
  177. personInfo:{},
  178. background: {
  179. backgroundColor: '#3D86FF',
  180. },
  181. prefetchNum:0,
  182. headlineBill:{},
  183. messageList:[],
  184. electricity:{
  185. }
  186. }
  187. },
  188. onLoad() {
  189. },
  190. onShow(){
  191. this.homePage()
  192. this.prefetch()
  193. this.getElectricityMeterList()
  194. },
  195. methods: {
  196. getElectricityMeterList(){
  197. API_Electricity.electricityMeterList().then((response) => {
  198. var electricityMeterList=response.data.meterList
  199. if(electricityMeterList.length){
  200. for(var i in electricityMeterList){
  201. var obj=electricityMeterList[i];
  202. if(i==0){
  203. this.electricity=electricityMeterList[i]
  204. }
  205. if(this.electricity.type==6){
  206. this.electricity=electricityMeterList[i]
  207. }
  208. if(!electricityMeterList[i].online){
  209. this.electricity=electricityMeterList[i]
  210. }
  211. }
  212. }
  213. }).catch(error => {
  214. uni.showToast({
  215. title: error,
  216. icon: "none"
  217. })
  218. })
  219. },
  220. unReadtNum(num){
  221. for(var i in this.messageList){
  222. var item=this.messageList[i];
  223. if(item.typeId==num){
  224. return item.unReadtNum
  225. }
  226. }
  227. return 0
  228. },
  229. prefetch(){
  230. API_message.prefetch({
  231. }).then((response) => {
  232. this.prefetchNum=response.data
  233. this.getBillList()
  234. this.getMessageTypeList()
  235. }).catch(error => {
  236. //uni.hideLoading();
  237. uni.hideLoading();
  238. uni.showToast({
  239. icon: "none",
  240. title: error
  241. })
  242. })
  243. },
  244. getMessageTypeList(){
  245. API_message.messageTypeList().then((response) => {
  246. this.messageList=response.data.typeList;
  247. }).catch(error => {
  248. uni.hideLoading();
  249. uni.showToast({
  250. icon: "none",
  251. title: error
  252. })
  253. })
  254. },
  255. getBillList(){
  256. API_message.headlineBill().then((response) => {
  257. this.headlineBill=response.data;
  258. var num=response.data.unReadtNum;
  259. if (this.$refs.tabbarMain) {
  260. this.$refs.tabbarMain.setprefetchNum(this.prefetchNum+num);
  261. }
  262. }).catch(error => {
  263. uni.hideLoading();
  264. uni.showToast({
  265. icon: "none",
  266. title: error
  267. })
  268. })
  269. },
  270. confirmPhone() {
  271. this.openModalBl = false;
  272. uni.makePhoneCall({
  273. phoneNumber:"400-8899-619" //仅为示例
  274. });
  275. },
  276. homePage(){
  277. // uni.showLoading({
  278. // title: "加载中",
  279. // mask: true,
  280. // })
  281. API.homePage({
  282. }).then((response) => {
  283. //uni.hideLoading();
  284. this.personInfo=response.data.tenantInfo;
  285. //console.log(response.data.tenantInfo)
  286. }).catch(error => {
  287. //uni.hideLoading();
  288. uni.hideLoading();
  289. uni.showToast({
  290. icon: "none",
  291. title: error
  292. })
  293. })
  294. }
  295. }
  296. }
  297. </script>
  298. <style lang="scss" scoped>
  299. // 账户充值 扣费记录
  300. .function2 {
  301. display: flex;
  302. justify-content: space-between;
  303. align-items: center;
  304. background-color: #fff;
  305. padding: 26rpx 40rpx;
  306. border-bottom: 1px solid #F4F4F4;
  307. .companyName{
  308. display: flex;
  309. align-items: center;
  310. font-size: 36rpx;
  311. font-weight: bold;
  312. .img{
  313. min-width: 40rpx;
  314. width: 40rpx;
  315. height: 40rpx;
  316. }
  317. .fullName1{
  318. width: 490rpx;
  319. // white-space: pre;
  320. overflow: hidden;
  321. white-space: nowrap;
  322. text-overflow: ellipsis;
  323. }
  324. .fullName2{
  325. width: 630rpx;
  326. // white-space: pre;
  327. overflow: hidden;
  328. white-space: nowrap;
  329. text-overflow: ellipsis;
  330. }
  331. }
  332. .titleElectricity{
  333. white-space: pre;
  334. color:#333333 ;
  335. font-size: 28rpx;
  336. width: 140rpx;
  337. .spanradius{
  338. width: 20rpx;
  339. height: 20rpx;
  340. background-color: #FF7B00 ;
  341. color: #FF7B00 ;
  342. margin-right: 4rpx;
  343. border-radius: 50%; /* 将正方形变成圆形 */
  344. display: inline-block;
  345. }
  346. .normal{
  347. background-color: #00B962 ;
  348. color: #00B962 ;
  349. }
  350. }
  351. }
  352. .function {
  353. background-color: #fff;
  354. padding: 56rpx 40rpx;
  355. display: flex;
  356. justify-content: space-between;
  357. .item {
  358. display: flex;
  359. align-items: center;
  360. .icon {
  361. width: 96rpx;
  362. height: 96rpx;
  363. border-radius: 12px;
  364. background: linear-gradient(180deg, rgba(93, 155, 255, 1) 0%, rgba(0, 97, 255, 1) 100%);
  365. display: flex;
  366. align-items: center;
  367. justify-content: center;
  368. .img {
  369. width: 64rpx !important;
  370. height: 64rpx !important;
  371. }
  372. }
  373. .icon2 {
  374. background: linear-gradient(179.2deg, rgba(96, 213, 124, 1) -0.62%, rgba(0, 161, 39, 1) 97.92%);
  375. }
  376. .text {
  377. margin-left: 16rpx;
  378. .title {
  379. color: rgba(51, 51, 51, 1);
  380. font-size: 36rpx;
  381. font-weight: bold;
  382. }
  383. .infos {
  384. color: rgba(119, 119, 119, 1);
  385. font-size: 24rpx;
  386. margin-top: 8rpx;
  387. }
  388. }
  389. }
  390. }
  391. // 管家服务
  392. .housekeeper-service {
  393. background-color: #fff;
  394. margin-top: 24rpx;
  395. padding: 32rpx;
  396. .title {
  397. font-size: 36rpx;
  398. color: #333333;
  399. font-weight: bold;
  400. }
  401. .dot{
  402. width: 20rpx;
  403. height: 20rpx;
  404. border-radius:999px;
  405. background-color: rgba(255,0,0,1);
  406. position: absolute;
  407. top:24rpx;
  408. right:24rpx;
  409. }
  410. .grid-text {
  411. margin-top: 28rpx;
  412. color: rgba(51, 51, 51, 1);
  413. }
  414. .icon {
  415. width: 96rpx;
  416. height: 96rpx;
  417. border-radius: 24rpx;
  418. display: flex;
  419. align-items: center;
  420. justify-content: center;
  421. .img {
  422. width: 56rpx;
  423. height: 56rpx;
  424. }
  425. }
  426. .icon10 {
  427. background: linear-gradient(180.4deg, rgba(127,213,151,1) 2.1%,rgba(67,176,116,1) 101.21%);
  428. }
  429. .icon11 {
  430. background: linear-gradient(180.4deg, rgba(127,213,151,1) 2.1%,rgba(67,176,116,1) 101.21%);
  431. //background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);
  432. }
  433. .icon1 {
  434. background: linear-gradient(181.79deg, rgba(117, 213, 224, 1) -1.13%, rgba(53, 153, 203, 1) 94.2%);
  435. }
  436. .icon2 {
  437. background: linear-gradient(179.2deg, rgba(168, 178, 238, 1) 6.28%, rgba(123, 123, 240, 1) 96.94%);
  438. }
  439. .icon3 {
  440. background: linear-gradient(180deg, rgba(121, 172, 255, 1) 0%, rgba(57, 132, 255, 1) 100%);
  441. }
  442. .icon4 {
  443. background: linear-gradient(180.82deg, rgba(247, 186, 154, 1) 0.58%, rgba(255, 128, 158, 1) 97.52%);
  444. }
  445. .icon5 {
  446. background: linear-gradient(180.4deg, rgba(127, 213, 151, 1) 2.1%, rgba(67, 176, 116, 1) 101.21%);
  447. }
  448. .icon6 {
  449. background: linear-gradient(180.29deg, rgba(255, 214, 125, 1) 0.9%, rgba(255, 150, 0, 1) 100.4%);
  450. }
  451. .icon7 {
  452. background: linear-gradient(178.44deg, rgba(122, 232, 227, 1) 3.96%, rgba(57, 182, 182, 1) 100.6%);
  453. }
  454. .icon8 {
  455. background: linear-gradient(180.4deg, rgba(127, 213, 151, 1) 2.1%, rgba(67, 176, 116, 1) 101.21%);
  456. }
  457. .icon9 {
  458. background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);
  459. }
  460. }
  461. .cover {
  462. background: radial-gradient(at 100% 100%, rgba(194, 255, 216, 1) 3%, rgba(138, 182, 232, 1) 39%, rgba(82, 110, 248, 1) 100%);
  463. color: #ffffff;
  464. text-align: center;
  465. padding: 40rpx 0;
  466. margin: 24rpx 0;
  467. .text {
  468. font-size: 64rpx;
  469. // box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.2);
  470. text-align: center;
  471. }
  472. }
  473. .tel {
  474. color: #1677FF;
  475. margin-left: 16rpx;
  476. }
  477. </style>