index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  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 @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>
  141. </view>
  142. </view>
  143. <view class="cover">
  144. <view class="text">
  145. 预存余额 安心用电
  146. </view>
  147. </view>
  148. <u-modal v-model="openModalBl" @confirm="confirmPhone" confirm-text="拨打电话" confirm-color="#606266"
  149. :show-cancel-button="true" ref="uModal" :asyncClose="true" title="客服电话" content="400-8899-619"
  150. :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
  151. <u-divider border-color="#bbbbbb" half-width="80" style="margin-bottom: 60rpx;"
  152. @click="openModalBl=true"
  153. color="#777777">荆鹏电管家 服务热线 <text
  154. class="tel">400-8899-619</text></u-divider>
  155. <Tabbar :current="0" ref="tabbarMain" :prefetchNum="prefetchNum" ></Tabbar>
  156. </view>
  157. </template>
  158. <script>
  159. import * as API from '@/apis/pagejs/index.js'
  160. import * as API_message from '@/apis/pagejs/message.js'
  161. import * as API_Electricity from '@/apis/pagejs/tenantElectricityMeter.js'
  162. import Tabbar from '@/components/Tabbar.vue'
  163. export default {
  164. components: {
  165. Tabbar
  166. },
  167. data() {
  168. return {
  169. openModalBl:false,
  170. personInfo:{},
  171. background: {
  172. backgroundColor: '#3D86FF',
  173. },
  174. prefetchNum:0,
  175. headlineBill:{},
  176. messageList:[],
  177. electricity:{
  178. }
  179. }
  180. },
  181. onLoad() {
  182. },
  183. onShow(){
  184. this.homePage()
  185. this.prefetch()
  186. this.getElectricityMeterList()
  187. },
  188. methods: {
  189. getElectricityMeterList(){
  190. API_Electricity.electricityMeterList().then((response) => {
  191. var electricityMeterList=response.data.meterList
  192. if(electricityMeterList.length){
  193. for(var i in electricityMeterList){
  194. var obj=electricityMeterList[i];
  195. if(i==0){
  196. this.electricity=electricityMeterList[i]
  197. }
  198. if(this.electricity.type==6){
  199. this.electricity=electricityMeterList[i]
  200. }
  201. if(!electricityMeterList[i].online){
  202. this.electricity=electricityMeterList[i]
  203. }
  204. }
  205. }
  206. }).catch(error => {
  207. uni.showToast({
  208. title: error,
  209. icon: "none"
  210. })
  211. })
  212. },
  213. unReadtNum(num){
  214. for(var i in this.messageList){
  215. var item=this.messageList[i];
  216. if(item.typeId==num){
  217. return item.unReadtNum
  218. }
  219. }
  220. return 0
  221. },
  222. prefetch(){
  223. API_message.prefetch({
  224. }).then((response) => {
  225. this.prefetchNum=response.data
  226. this.getBillList()
  227. this.getMessageTypeList()
  228. }).catch(error => {
  229. //uni.hideLoading();
  230. uni.hideLoading();
  231. uni.showToast({
  232. icon: "none",
  233. title: error
  234. })
  235. })
  236. },
  237. getMessageTypeList(){
  238. API_message.messageTypeList().then((response) => {
  239. this.messageList=response.data.typeList;
  240. }).catch(error => {
  241. uni.hideLoading();
  242. uni.showToast({
  243. icon: "none",
  244. title: error
  245. })
  246. })
  247. },
  248. getBillList(){
  249. API_message.headlineBill().then((response) => {
  250. this.headlineBill=response.data;
  251. var num=response.data.unReadtNum;
  252. if (this.$refs.tabbarMain) {
  253. this.$refs.tabbarMain.setprefetchNum(this.prefetchNum+num);
  254. }
  255. }).catch(error => {
  256. uni.hideLoading();
  257. uni.showToast({
  258. icon: "none",
  259. title: error
  260. })
  261. })
  262. },
  263. confirmPhone() {
  264. this.openModalBl = false;
  265. uni.makePhoneCall({
  266. phoneNumber:"400-8899-619" //仅为示例
  267. });
  268. },
  269. homePage(){
  270. // uni.showLoading({
  271. // title: "加载中",
  272. // mask: true,
  273. // })
  274. API.homePage({
  275. }).then((response) => {
  276. //uni.hideLoading();
  277. this.personInfo=response.data.tenantInfo;
  278. //console.log(response.data.tenantInfo)
  279. }).catch(error => {
  280. //uni.hideLoading();
  281. uni.hideLoading();
  282. uni.showToast({
  283. icon: "none",
  284. title: error
  285. })
  286. })
  287. }
  288. }
  289. }
  290. </script>
  291. <style lang="scss" scoped>
  292. // 账户充值 扣费记录
  293. .function2 {
  294. display: flex;
  295. justify-content: space-between;
  296. align-items: center;
  297. background-color: #fff;
  298. padding: 26rpx 40rpx;
  299. border-bottom: 1px solid #F4F4F4;
  300. .companyName{
  301. display: flex;
  302. align-items: center;
  303. font-size: 36rpx;
  304. font-weight: bold;
  305. .img{
  306. min-width: 40rpx;
  307. width: 40rpx;
  308. height: 40rpx;
  309. }
  310. .fullName1{
  311. width: 490rpx;
  312. // white-space: pre;
  313. overflow: hidden;
  314. white-space: nowrap;
  315. text-overflow: ellipsis;
  316. }
  317. .fullName2{
  318. width: 630rpx;
  319. // white-space: pre;
  320. overflow: hidden;
  321. white-space: nowrap;
  322. text-overflow: ellipsis;
  323. }
  324. }
  325. .titleElectricity{
  326. white-space: pre;
  327. color:#333333 ;
  328. font-size: 28rpx;
  329. width: 140rpx;
  330. .spanradius{
  331. width: 20rpx;
  332. height: 20rpx;
  333. background-color: #FF7B00 ;
  334. color: #FF7B00 ;
  335. margin-right: 4rpx;
  336. border-radius: 50%; /* 将正方形变成圆形 */
  337. display: inline-block;
  338. }
  339. .normal{
  340. background-color: #00B962 ;
  341. color: #00B962 ;
  342. }
  343. }
  344. }
  345. .function {
  346. background-color: #fff;
  347. padding: 56rpx 40rpx;
  348. display: flex;
  349. justify-content: space-between;
  350. .item {
  351. display: flex;
  352. align-items: center;
  353. .icon {
  354. width: 96rpx;
  355. height: 96rpx;
  356. border-radius: 12px;
  357. background: linear-gradient(180deg, rgba(93, 155, 255, 1) 0%, rgba(0, 97, 255, 1) 100%);
  358. display: flex;
  359. align-items: center;
  360. justify-content: center;
  361. .img {
  362. width: 64rpx !important;
  363. height: 64rpx !important;
  364. }
  365. }
  366. .icon2 {
  367. background: linear-gradient(179.2deg, rgba(96, 213, 124, 1) -0.62%, rgba(0, 161, 39, 1) 97.92%);
  368. }
  369. .text {
  370. margin-left: 16rpx;
  371. .title {
  372. color: rgba(51, 51, 51, 1);
  373. font-size: 36rpx;
  374. font-weight: bold;
  375. }
  376. .infos {
  377. color: rgba(119, 119, 119, 1);
  378. font-size: 24rpx;
  379. margin-top: 8rpx;
  380. }
  381. }
  382. }
  383. }
  384. // 管家服务
  385. .housekeeper-service {
  386. background-color: #fff;
  387. margin-top: 24rpx;
  388. padding: 32rpx;
  389. .title {
  390. font-size: 36rpx;
  391. color: #333333;
  392. font-weight: bold;
  393. }
  394. .dot{
  395. width: 20rpx;
  396. height: 20rpx;
  397. border-radius:999px;
  398. background-color: rgba(255,0,0,1);
  399. position: absolute;
  400. top:24rpx;
  401. right:24rpx;
  402. }
  403. .grid-text {
  404. margin-top: 28rpx;
  405. color: rgba(51, 51, 51, 1);
  406. }
  407. .icon {
  408. width: 96rpx;
  409. height: 96rpx;
  410. border-radius: 24rpx;
  411. display: flex;
  412. align-items: center;
  413. justify-content: center;
  414. .img {
  415. width: 56rpx;
  416. height: 56rpx;
  417. }
  418. }
  419. .icon10 {
  420. background: linear-gradient(180.4deg, rgba(127,213,151,1) 2.1%,rgba(67,176,116,1) 101.21%);
  421. }
  422. .icon11 {
  423. background: linear-gradient(180.4deg, rgba(127,213,151,1) 2.1%,rgba(67,176,116,1) 101.21%);
  424. //background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);
  425. }
  426. .icon1 {
  427. background: linear-gradient(181.79deg, rgba(117, 213, 224, 1) -1.13%, rgba(53, 153, 203, 1) 94.2%);
  428. }
  429. .icon2 {
  430. background: linear-gradient(179.2deg, rgba(168, 178, 238, 1) 6.28%, rgba(123, 123, 240, 1) 96.94%);
  431. }
  432. .icon3 {
  433. background: linear-gradient(180deg, rgba(121, 172, 255, 1) 0%, rgba(57, 132, 255, 1) 100%);
  434. }
  435. .icon4 {
  436. background: linear-gradient(180.82deg, rgba(247, 186, 154, 1) 0.58%, rgba(255, 128, 158, 1) 97.52%);
  437. }
  438. .icon5 {
  439. background: linear-gradient(180.4deg, rgba(127, 213, 151, 1) 2.1%, rgba(67, 176, 116, 1) 101.21%);
  440. }
  441. .icon6 {
  442. background: linear-gradient(180.29deg, rgba(255, 214, 125, 1) 0.9%, rgba(255, 150, 0, 1) 100.4%);
  443. }
  444. .icon7 {
  445. background: linear-gradient(178.44deg, rgba(122, 232, 227, 1) 3.96%, rgba(57, 182, 182, 1) 100.6%);
  446. }
  447. .icon8 {
  448. background: linear-gradient(180.4deg, rgba(127, 213, 151, 1) 2.1%, rgba(67, 176, 116, 1) 101.21%);
  449. }
  450. .icon9 {
  451. background: linear-gradient(180.29deg, rgba(255,124,112,1) 0.9%,rgba(255,79,63,1) 100.4%);
  452. }
  453. }
  454. .cover {
  455. background: radial-gradient(at 100% 100%, rgba(194, 255, 216, 1) 3%, rgba(138, 182, 232, 1) 39%, rgba(82, 110, 248, 1) 100%);
  456. color: #ffffff;
  457. text-align: center;
  458. padding: 40rpx 0;
  459. margin: 24rpx 0;
  460. .text {
  461. font-size: 64rpx;
  462. // box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.2);
  463. text-align: center;
  464. }
  465. }
  466. .tel {
  467. color: #1677FF;
  468. margin-left: 16rpx;
  469. }
  470. </style>