index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769
  1. <template>
  2. <view>
  3. <ujp-picker mode="selector" v-model="isswitchshow" :range="columns" range-key="label" :default-selector="columnsindex" @confirm="switchBtn" ></ujp-picker>
  4. <view class="userHead" :style="isswitch?'padding-top:40px':''" >
  5. <view class="userHead-img">
  6. <u-avatar src="../../assets/img/head.png" size="140"></u-avatar>
  7. </view>
  8. <view class="userHead-text">
  9. <h3>{{info.merchantAccountName}}</h3>
  10. <view class="userHead-text-position">
  11. <u-icon name="account-pin-box-fill" custom-prefix="custom-icon" color="#fff" size="32"></u-icon>
  12. <p>{{getPhone(info.phone)}}</p>
  13. <p
  14. v-if="isswitch" @click="isswitchshow=true"
  15. style="border: 1px solid rgba(255, 255, 255, 1);
  16. border-radius: 10px;
  17. padding: 0 10px;">
  18. <img src="../../assets/img/userswitch.svg" style="height: 32rpx;width: 32rpx;" alt="">
  19. 切换账号</p>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="userInfo" v-if="home">
  24. <template v-if="accountType">
  25. <view class="userInfo-head"><p>可提现金额<span v-if="info.accountType==3">(T+4)</span></p></view>
  26. <view class="userInfo-main">
  27. <h2>{{showNumJP(home.accountBalance)}}元
  28. <view class="withdraw" v-if="info.status&&(info.accountType!=3&&info.accountType!=1)" @click="gotoUrl('pagesFinance/user/withdrawal/withdrawRecord')" >
  29. 账户提现
  30. </view>
  31. <view class="withdraw" v-if="info.accountType==3" @click="gotoUrl('pagesFinance/user/withdrawal/cashoutList')" >
  32. 账户提现
  33. </view>
  34. </h2>
  35. <!-- <view class="userInfo-btn" >帐户提现</view> -->
  36. </view>
  37. <view class="userInfo-foot">
  38. <!-- <view class="userInfo-item">
  39. <p>今日收益</p>
  40. <h4>{{home.todayAmount}}</h4>
  41. </view> -->
  42. <view class="userInfo-item">
  43. <p>冻结金额(提现中)</p>
  44. <h4>{{showNumJP(home.waitingAmount)}}元</h4>
  45. </view>
  46. <view class="userInfo-item">
  47. <p>已提现</p>
  48. <h4>{{showNumJP(home.withdrawnAmount)}}元</h4>
  49. </view>
  50. </view>
  51. </template>
  52. <template v-for="(item,i ) in vipPlatformList" v-if="item.entAccountId">
  53. <view class="userInfo-head" style="margin-top: 20rpx;" :key="i+'a'" ><p>企业可充电金额
  54. <span v-if="vipPlatformList1.length>1">[{{item.name}}]</span>
  55. </p></view>
  56. <view class="userInfo-main" :key="i+'b'">
  57. <h2 :style="accountType?'font-size: 32rpx;':''">{{showNumJP(item.entAccountBalance)}}元</h2>
  58. <!-- <view class="userInfo-btn" >帐户提现</view> -->
  59. </view>
  60. </template>
  61. </view>
  62. <!-- 功能菜单 -->
  63. <view class="function-menu" >
  64. <view class="item" @click="gotoHousekeepManage()">
  65. <view class="item-icon">
  66. <img src="../../assets/img/antOutline-dashboard.svg" alt="">
  67. </view>
  68. <view class="item-name">
  69. 远程抄表
  70. </view>
  71. </view>
  72. <template v-if="accountType">
  73. <view class="item" @click="gotoUrl('pagesFinance/user/stationsList')" >
  74. <view class="item-icon">
  75. <img src="../../assets/img/riLine-user-settings-line.svg" alt="">
  76. </view>
  77. <view class="item-name">
  78. 我的充电桩
  79. </view>
  80. <view class="position" v-if="home&&home.deviceNumbers" >
  81. <view id="talkbubble" :style="home.deviceNumbers>=100?'padding: 2px 16rpx;':''" >{{home.deviceNumbers}}桩{{home.gunNumbers?home.gunNumbers+'枪':''}}</view>
  82. </view>
  83. </view>
  84. <view class="item" v-if="info.accountType==2" @click="gotoUrl('pagesFinance/user/withdrawal/businessList')">
  85. <view class="item-icon">
  86. <img src="../../assets/img/riLine-file-list-3-line.svg" alt="">
  87. </view>
  88. <view class="item-name">
  89. 收益核算
  90. </view>
  91. </view>
  92. <view class="item" v-if="info.accountType==3" @click="gotoUrl('pagesFinance/user/withdrawal/cashoutList')">
  93. <view class="item-icon"> <!--个人 -->
  94. <i data-v-7e5aa06e="" class="ri-todo-line"></i>
  95. </view>
  96. <view class="item-name">
  97. 提现记录
  98. </view>
  99. </view>
  100. <view class="item" v-else @click="gotoUrl('pagesFinance/user/withdrawal/withdrawRecord')">
  101. <view class="item-icon">
  102. <i data-v-7e5aa06e="" class="ri-todo-line"></i>
  103. </view>
  104. <view class="item-name">
  105. 提现记录
  106. </view>
  107. </view>
  108. <view class="item" @click="gotoUrl('pagesFinance/preengaged/preengaged')">
  109. <view class="item-icon">
  110. <i data-v-137d5072="" class="ri-map-pin-time-line"></i>
  111. </view>
  112. <view class="item-name">
  113. 我被预约
  114. </view>
  115. </view>
  116. <view class="item" @click="gotoUrl('pagesFinance/recordOfInvoice/recordOfInvoice')">
  117. <view class="item-icon">
  118. <i data-v-137d5072="" class="ri-ticket-line"></i>
  119. </view>
  120. <view class="item-name">
  121. 开票记录
  122. </view>
  123. </view>
  124. <view class="item" @click="gotoUrl('pagesFinance/user/stationsListLine')">
  125. <view class="item-icon">
  126. <i class="ri-webcam-line"></i>
  127. </view>
  128. <view class="item-name">
  129. 摄像头
  130. </view>
  131. </view>
  132. </template>
  133. <view class="item"
  134. v-for="(item,i) in vipPlatformList" :key="i" v-if="!item.entAccountId"
  135. @click="gotoUrl('pagesFinance/user/ownManagement?id='+item.id)" >
  136. <view class="item-icon">
  137. <i class="ri-folder-user-line"></i>
  138. </view>
  139. <view class="item-name">
  140. {{vipPlatformList.length==1?'车主管理':item.name}}
  141. </view>
  142. </view>
  143. <view class="item" @click="gotoUrl('pagesFinance/user/help')" v-if="false" >
  144. <view class="item-icon">
  145. <i data-v-137d5072="" class="ri-compass-3-line"></i>
  146. </view>
  147. <view class="item-name">
  148. 帮助中心
  149. </view>
  150. </view>
  151. <view class="item" @click="phone()" >
  152. <view class="item-icon">
  153. <i data-v-137d5072="" class="ri-customer-service-2-line"></i>
  154. </view>
  155. <view class="item-name">
  156. 联系客服
  157. </view>
  158. </view>
  159. <view class="item" @click="gotoUrl('pagesFinance/coupon/index?c=0')" v-if="info.accountType==1" >
  160. <view class="item-icon">
  161. <i data-v-137d5072="" class="ri-account-pin-box-line"></i>
  162. </view>
  163. <view class="item-name">
  164. 停车优惠劵
  165. </view>
  166. </view>
  167. </view>
  168. <view class="function-menu2" >
  169. <template v-for="(item,i ) in vipPlatformList" v-if="item.entAccountId" >
  170. <view style="padding-top: 6px;font-size: 15px;" :key="'d'+i" >{{item.name}}</view>
  171. <view class="function-menu3" :key="'c'+i" >
  172. <view class="item" :key="'b'+i"
  173. @click="gotoUrl('pagesFinance/accountType8/personmanage/index?id='+item.id+'&pid='+item.entAccountId)" >
  174. <view class="item-icon">
  175. <i class="ri-folder-user-line"></i>
  176. </view>
  177. <view class="item-name">
  178. 企业员工
  179. </view>
  180. </view>
  181. <view class="item" :key="'ac'+i"
  182. @click="gotoUrl('pagesFinance/accountType8/carmanage/index?id='+item.entAccountId)" >
  183. <view class="item-icon">
  184. <img src="../../assets/img/riLine-bus-line.svg" alt="">
  185. </view>
  186. <view class="item-name">
  187. 企业车辆
  188. </view>
  189. </view>
  190. <view class="item" v-if="item.entAccountId&&info.accountTopics!=2" :key="'a'+i"
  191. @click="gotoUrl('pagesFinance/accountType8/chagingrecord/index?id='+item.entAccountId)" >
  192. <view class="item-icon">
  193. <u-icon name="coupon" style=" margin-bottom: 4px;" size="24px"></u-icon>
  194. </view>
  195. <view class="item-name">
  196. 企业充电记录
  197. </view>
  198. </view>
  199. <view class="item" @click="gotoUrl('pagesFinance/MyInvoice/settlement?id='+item.entAccountId)">
  200. <view class="item-icon">
  201. <img src="../../assets/img/riLine-checkbox-multiple-line.svg" alt="">
  202. </view>
  203. <view class="item-name">
  204. 财务结算
  205. </view>
  206. </view>
  207. <view class="item" @click="gotoUrl('pagesFinance/MyInvoice/invoiceManagement?id='+item.entAccountId)">
  208. <view class="item-icon">
  209. <img src="../../assets/img/riLine-ticket-2-line.svg" alt="">
  210. </view>
  211. <view class="item-name">
  212. 企业开票
  213. </view>
  214. </view>
  215. </view>
  216. </template>
  217. </view>
  218. <button class="logout-btn" @click="logout">退出账号</button>
  219. <Tabbar :current="3" ref="tabbarMain" ></Tabbar>
  220. </view>
  221. </template>
  222. <script>
  223. import Tabbar from '@/components/TabbarFinance.vue'
  224. import * as API from '@/apis/finance.js'
  225. import {
  226. substrMb
  227. } from '@/utils'
  228. export default {
  229. data() {
  230. return {
  231. columns:[],
  232. isWithdrawal:false,
  233. isswitchshow:false,
  234. isswitch:false,
  235. tel:'400-8899-619',
  236. role:{},
  237. info:{},
  238. home:null,
  239. current: 0,
  240. vipPlatformList:[],
  241. vipPlatformList1:[],
  242. vipPlatformList2:[],
  243. columnsindex:[0],
  244. background:{
  245. background: 'none'
  246. },
  247. }
  248. },
  249. components: {
  250. Tabbar
  251. },
  252. computed:{
  253. accountType(){
  254. if(this.accountType8){
  255. return false
  256. }
  257. return true
  258. },
  259. accountType8(){
  260. if(this.info&&(this.info.accountTopics==2||this.info.accountTopics==3)){
  261. return true
  262. }else
  263. return false
  264. }
  265. },
  266. onLoad() {
  267. this.info=this.carhelp.getPersonInfo()
  268. if(process.env.NODE_ENV === "development"){
  269. this.isWithdrawal=true
  270. }
  271. },
  272. onReady() {
  273. //this.getHomePage()
  274. },
  275. onShow() {
  276. if(this.$refs.tabbarMain){
  277. this.$refs.tabbarMain.setcount();
  278. }
  279. this.query()
  280. this.getHomePage()
  281. },
  282. methods: {
  283. gotoHousekeepManage(){
  284. window.location.href='https://dgj.hbjp.com.cn/charging-prod/jp-housekeep-manage/#/'
  285. },
  286. switchBtn(e){
  287. var obj=this.columns[e[0]]
  288. uni.showLoading({
  289. title: "加载中",
  290. mask: true,
  291. })
  292. API.switchUser({
  293. newUserId:obj.value
  294. }).then((response) => {
  295. uni.hideLoading();
  296. this.query(true)
  297. }).catch(error => {
  298. uni.hideLoading();
  299. })
  300. //
  301. },
  302. query(bl){
  303. uni.showLoading({
  304. title: "加载中",
  305. mask: true,
  306. })
  307. API.findByOpenId({
  308. openId: this.carhelp.getOpenId(),
  309. }).then((response) => {
  310. //this.loginset(response)
  311. var token = response ? response.data.token : '';
  312. this.carhelp.setToken(token);
  313. this.carhelp.setPersonInfo(response.data.user);
  314. this.carhelp.setPersonInfoPlus(response.data)
  315. this.info=response.data.user
  316. this.isswitch=response.data.haveOtherUser;
  317. if(this.isswitch){
  318. this.allUserList()
  319. }
  320. if(bl){
  321. this.getHomePage()
  322. }
  323. if(this.$refs.tabbarMain){
  324. this.$refs.tabbarMain.relist();
  325. }
  326. uni.hideLoading();
  327. }).catch(error => {
  328. uni.hideLoading();
  329. })
  330. },
  331. allUserList(){
  332. API.allUserList({
  333. }).then((response) => {
  334. var list=response.data.allUserList;
  335. this.columns=[]
  336. for(var i in list){
  337. var obj=list[i]
  338. if(obj.isCurrentUser){
  339. this.columnsindex=[i]
  340. }
  341. this.columns.push({
  342. value:obj.id,
  343. label:obj.merchantAccountName
  344. })
  345. }
  346. }).catch(error => {
  347. uni.hideLoading();
  348. })
  349. },
  350. getPhone(phone){
  351. var backphone="";
  352. if(phone){
  353. backphone=substrMb(phone,0,3)+"****"+substrMb(phone,7,4)
  354. }
  355. return backphone;
  356. },
  357. showModel(){
  358. var bankCard="";
  359. var sss=""
  360. if(this.home.bankCard){
  361. bankCard=substrMb(this.home.bankCard,0,4)+"****"+substrMb(this.home.bankCard,this.home.bankCard.length-4,4)
  362. }
  363. var code=this.home.bank+":"+bankCard;
  364. if(this.home.bank==null&&this.home.bankCard==null){
  365. code="未绑定"
  366. }
  367. uni.showModal({
  368. showCancel:false,
  369. content:code,
  370. })
  371. },
  372. logoutApi(){
  373. uni.showLoading({
  374. title: "加载中",
  375. mask: true,
  376. })
  377. var data = {
  378. };
  379. API.logout(data).then((res) => {
  380. this.carhelp.setToken("");
  381. this.carhelp.set("merchantUser_token_tdate","")
  382. this.carhelp.setPersonInfo("");
  383. this.carhelp.setPersonInfoPlus("" )
  384. uni.reLaunch({
  385. url:"/pagesFinance/login/index?phone="+this.info.phone
  386. })
  387. }).catch(error => {
  388. uni.showToast({
  389. title: error
  390. })
  391. })
  392. },
  393. logout(){
  394. uni.showModal({
  395. title: '提示',
  396. content: '确认是否退出?',
  397. success: res=> {
  398. if (res.confirm) {
  399. //付钱 改为组件
  400. this.logoutApi();
  401. } else if (res.cancel) {
  402. console.log('用户点击取消');
  403. }
  404. }
  405. });
  406. },
  407. phone(){
  408. uni.makePhoneCall({
  409. phoneNumber:this.tel //仅为示例
  410. });
  411. },
  412. getHomePage(){
  413. uni.showLoading({
  414. title: "加载中",
  415. mask: true,
  416. })
  417. API.homePage().then((res) => {
  418. this.home = res.data
  419. if(res.data.vipPlatformList){
  420. this.vipPlatformList=res.data.vipPlatformList
  421. //this.vipPlatformList1
  422. this.vipPlatformList.forEach(item=>{
  423. if(item.entAccountId){
  424. this.vipPlatformList1.push(item)
  425. }else{
  426. this.vipPlatformList2.push(item)
  427. }
  428. })
  429. }
  430. uni.hideLoading()
  431. }).catch(error => {
  432. uni.showToast({
  433. title: error
  434. })
  435. })
  436. }
  437. }
  438. }
  439. </script>
  440. <style>
  441. page{
  442. background:url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
  443. background-size: 100%;
  444. }
  445. </style>
  446. <style lang="scss" scoped>
  447. .navbar-tit {
  448. color: #fff;
  449. font-size: 18px;
  450. text-align: right;
  451. width: 100%;
  452. padding-top: 3px;
  453. padding-right: 3px;
  454. }
  455. .userCell{
  456. background-color: #fff;
  457. border-radius: 8px;
  458. margin: 16px;
  459. .userCell-item{
  460. display: flex;
  461. justify-content: space-between;
  462. align-items: center;
  463. padding: 16px;
  464. .userCell-title{
  465. display: flex;
  466. align-items: center;
  467. p{
  468. margin-left: 8px;
  469. }
  470. }
  471. span{
  472. color:#999;
  473. }
  474. }
  475. }
  476. .userInfo{
  477. // background-color: #fff;
  478. background: linear-gradient(#fff2eb,#ffffff);
  479. margin: 16px;
  480. padding: 16px;
  481. border-radius: 8px;
  482. p{
  483. color:#637AA2;
  484. }
  485. .userInfo-main2{
  486. width: 100%;
  487. margin-top: 4px;
  488. align-items: center;
  489. h2{
  490. flex: 1;
  491. font-size: 44rpx;
  492. }
  493. }
  494. .userInfo-main{
  495. display: flex;
  496. justify-content: space-between;
  497. margin-top: 4px;
  498. align-items: center;
  499. h2{
  500. flex: 1;
  501. font-size: 64rpx;
  502. display: flex;
  503. justify-content: space-between;
  504. .withdraw{
  505. margin: auto 0;
  506. width: 80px;
  507. height:30px;
  508. line-height: 28px;
  509. border-radius: 20px;
  510. background-color: rgba(255, 133, 1, 100);
  511. color: rgba(255, 255, 255, 100);
  512. font-size: 14px;
  513. text-align: center;
  514. }
  515. }
  516. }
  517. .userInfo-btn{
  518. padding: 6px 10px;
  519. background-color: #FF8501;
  520. color:#fff;
  521. border-radius: 15px;
  522. }
  523. .userInfo-foot{
  524. display: flex;
  525. justify-content: space-between;
  526. margin-top: 12px;
  527. .userInfo-item{
  528. flex: 1;
  529. h4{
  530. font-size: 16px;
  531. margin-top: 4px;
  532. }
  533. }
  534. }
  535. }
  536. .userHead{
  537. display: flex;
  538. align-items: center;
  539. padding:40px 20px 0;
  540. .userHead-img{
  541. }
  542. .userHead-text{
  543. margin-left: 12px;
  544. h3{
  545. font-size: 24px;
  546. color:#fff;
  547. font-weight: normal;
  548. }
  549. .userHead-text-position{
  550. display: flex;
  551. align-items: center;
  552. margin-top: 5px;
  553. p{
  554. color:#fff;
  555. margin-left: 4px;
  556. }
  557. }
  558. }
  559. }
  560. .userData{
  561. background-color: #fff;
  562. margin: 16px;
  563. padding: 16px;
  564. border-radius: 8px;
  565. display: flex;
  566. }
  567. .userData-item{
  568. flex: 1;
  569. display: flex;
  570. flex-direction: column;
  571. align-items: center;
  572. justify-content:space-between;
  573. .userData-data{
  574. font-size: 24px;
  575. font-weight: bold;
  576. }
  577. .userData-name{
  578. font-size: 16px;
  579. }
  580. .userData-foot{
  581. margin-top: 4px;
  582. color:#637AA2;
  583. }
  584. }
  585. //功能菜单
  586. .function-menu{
  587. margin: 12px 16px;
  588. background-color: #fff;
  589. border-radius: 8px;
  590. padding: 0 13px;
  591. display: flex;
  592. flex-wrap: wrap;
  593. }
  594. //功能菜单
  595. .function-menu2{
  596. background-color: #fff;
  597. margin: 12px 16px;
  598. border-radius: 8px;
  599. padding: 0 13px;
  600. }
  601. .function-menu3{
  602. display: flex;
  603. flex-wrap: wrap;
  604. }
  605. @media screen and (max-width: 375px) {
  606. .item {
  607. width: 33% !important;
  608. }
  609. }
  610. .item{
  611. min-width: 25%;
  612. margin-top: 20px;
  613. margin-bottom: 11px;
  614. display: flex;
  615. flex-direction: column;
  616. align-items: center;
  617. color: rgba(119, 119, 119, 100);
  618. i{
  619. font-size: 24px
  620. }
  621. .item-name{
  622. font-size: 14px;
  623. margin-top: 8px;
  624. }
  625. }
  626. .logout-btn{
  627. background-color: #fff;
  628. margin: 12px 16px;
  629. border: 8px;
  630. color: rgba(238, 49, 56, 100);
  631. font-size: 16px;
  632. line-height: 40px;
  633. }
  634. .position {
  635. position: relative;
  636. top: -75px;
  637. //left: 24%;
  638. height: 0px;
  639. z-index: 999;
  640. }
  641. #talkbubble {
  642. position: absolute;
  643. top: 0;
  644. left: 0;
  645. padding: 1px 20rpx;
  646. line-height: 40rpx;
  647. font-size: 24rpx;
  648. color: #fff;
  649. background: red;
  650. position: relative;
  651. border-radius: 10px;
  652. text-align: center;
  653. }
  654. #talkbubble:before {
  655. content: "";
  656. position: absolute;
  657. top: 100%;
  658. right: 20%;
  659. border-top: 5px solid red;
  660. border-right: 5px solid transparent;
  661. border-left: 5px solid transparent;
  662. }
  663. </style>