index.vue 10 KB

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