index.vue 11 KB

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