index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. <template>
  2. <view>
  3. <view class="userHead">
  4. <view class="userHead-img">
  5. <u-avatar src="../../assets/img/head.png" size="140"></u-avatar>
  6. </view>
  7. <view class="userHead-text">
  8. <h3>{{info.merchantAccountName}}</h3>
  9. <view class="userHead-text-position">
  10. <u-icon name="account-pin-box-fill" custom-prefix="custom-icon" color="#fff" size="32"></u-icon>
  11. <p>{{getPhone(info.phone)}}</p>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="userData" v-if="home">
  16. <view class="userData-item">
  17. <view class="userData-data">{{home.deviceNumbers}}台</view>
  18. <view class="userData-foot" @click="gotoUrl('pagesFinance/user/stationsList')" >我的设备<span style="color: #307af6; margin-left: 5px;">查看</span></view>
  19. </view>
  20. <u-line color="#d9e0ec" length="60" direction="col" margin="10px"/>
  21. <view class="userData-item">
  22. <view class="userData-name">银行账户</view>
  23. <view class="userData-foot" v-if="!home.bank" >未绑定</view>
  24. <view class="userData-foot" v-if="home.bank" @click="showModel" >提现账户<span style="color: #307af6; margin-left: 5px;">查看</span></view>
  25. </view>
  26. </view>
  27. <view class="userInfo" v-if="home">
  28. <view class="userInfo-head"><p>可提现金额</p></view>
  29. <view class="userInfo-main">
  30. <h2>{{home.accountBalance.toFixed(2)}}元
  31. <view class="withdraw" v-if="info.status" @click="gotoUrl('pagesFinance/user/applicationForWithdrawal')" >
  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>{{home.waitingAmount.toFixed(2)}}元</h4>
  45. </view>
  46. <view class="userInfo-item">
  47. <p>已提现</p>
  48. <h4>{{home.withdrawnAmount.toFixed(2)}}元</h4>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 功能菜单 -->
  53. <view class="function-menu">
  54. <view class="item" @click="gotoUrl('pagesFinance/user/withdrawRecord')">
  55. <view class="item-icon">
  56. <i data-v-7e5aa06e="" class="ri-todo-line"></i>
  57. </view>
  58. <view class="item-name">
  59. 提现记录
  60. </view>
  61. </view>
  62. <view class="item" @click="gotoUrl('pagesFinance/preengaged/preengaged')">
  63. <view class="item-icon">
  64. <i data-v-137d5072="" class="ri-map-pin-time-line"></i>
  65. </view>
  66. <view class="item-name">
  67. 我被预约
  68. </view>
  69. </view>
  70. <view class="item" @click="gotoUrl('pagesFinance/recordOfInvoice/recordOfInvoice')">
  71. <view class="item-icon">
  72. <i data-v-137d5072="" class="ri-ticket-line"></i>
  73. </view>
  74. <view class="item-name">
  75. 开票记录
  76. </view>
  77. </view>
  78. <view class="item" @click="gotoUrl('pagesFinance/user/stationsListLine')">
  79. <view class="item-icon">
  80. <i class="ri-webcam-line"></i>
  81. </view>
  82. <view class="item-name">
  83. 摄像头
  84. </view>
  85. </view>
  86. <view class="item"
  87. v-for="(item,i) in vipPlatformList" :key="i"
  88. @click="gotoUrl('pagesFinance/user/ownManagement?id='+item.id)" >
  89. <view class="item-icon">
  90. <i class="ri-folder-user-line"></i>
  91. </view>
  92. <view class="item-name">
  93. {{vipPlatformList.length==1?'车主管理':item.name}}
  94. </view>
  95. </view>
  96. <view class="item" @click="gotoUrl('pagesFinance/user/help')" v-if="false" >
  97. <view class="item-icon">
  98. <i data-v-137d5072="" class="ri-compass-3-line"></i>
  99. </view>
  100. <view class="item-name">
  101. 帮助中心
  102. </view>
  103. </view>
  104. <view class="item" @click="phone()" >
  105. <view class="item-icon">
  106. <i data-v-137d5072="" class="ri-customer-service-2-line"></i>
  107. </view>
  108. <view class="item-name">
  109. 联系客服
  110. </view>
  111. </view>
  112. <view class="item" @click="gotoUrl('pagesFinance/user/about')" v-if="false" >
  113. <view class="item-icon">
  114. <i data-v-137d5072="" class="ri-account-pin-box-line"></i>
  115. </view>
  116. <view class="item-name">
  117. 关于我们
  118. </view>
  119. </view>
  120. </view>
  121. <button class="logout-btn" @click="logout">退出账号</button>
  122. <!-- <view class="userCell">
  123. <view class="userCell-item" @click="gotoUrl('pagesFinance/preengaged/preengaged')">
  124. <view class="userCell-title">
  125. <img src="@/assets/img/booked.png" style="height:36rpx;width: 36rpx ;" >
  126. <p>我被预约</p>
  127. </view>
  128. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  129. </view>
  130. <view class="userCell-item" @click="gotoUrl('pagesFinance/user/withdrawRecord')">
  131. <view class="userCell-title">
  132. <u-icon name="refund-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
  133. <p>提现记录</p>
  134. </view>
  135. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  136. </view>
  137. <view class="userCell-item" @click="gotoUrl('pagesFinance/recordOfInvoice/recordOfInvoice')">
  138. <view class="userCell-title">
  139. <img src="@/assets/img/riFill-todo-fill.png" style="height:36rpx;width: 36rpx ;" >
  140. <p>开票申请记录</p>
  141. </view>
  142. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  143. </view>
  144. <view class="userCell-item" v-if="info.allowShare" @click="gotoUrl('pagesFinance/user/stationsListLine')">
  145. <view class="userCell-title">
  146. <svg style="height:36rpx;width: 36rpx ;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
  147. <path fill="none" d="M0 0h24v24H0z"/><path fill="#9EAAC6" d="M11 21v-1.07A7.002 7.002 0 0 1 5 13V8a7 7 0 1 1 14 0v5a7.002 7.002 0 0 1-6 6.93V21h4v2H7v-2h4zm1-12a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm0 2a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></svg>
  148. <p>我的摄像头</p>
  149. </view>
  150. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  151. </view>
  152. <view class="userCell-item" @click="gotoUrl('pagesFinance/user/help')" >
  153. <view class="userCell-title">
  154. <u-icon name="question-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
  155. <p>帮助中心</p>
  156. </view>
  157. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  158. </view>
  159. <view class="userCell-item" @click="phone()" >
  160. <view class="userCell-title">
  161. <u-icon name="customer-service-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
  162. <p>联系客服</p>
  163. </view>
  164. <span>{{tel}}</span>
  165. </view>
  166. <!-- <view class="userCell-item" @click="gotoUrl('pagesFinance/user/about')">
  167. <view class="userCell-title">
  168. <u-icon name="information-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
  169. <p>关于小鹏管家</p>
  170. </view>
  171. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  172. </view> -->
  173. <!-- <view class="userCell-item" @click="logout" >
  174. <view class="userCell-title">
  175. <u-icon name="logout-box-r-fill" custom-prefix="custom-icon" color="#9EAAC6" size="36"></u-icon>
  176. <p>帐号登出</p>
  177. </view>
  178. <u-icon name="arrow-right-s-line" custom-prefix="custom-icon" color="#B3B3B3" size="32"></u-icon>
  179. </view>
  180. </view> -->
  181. <Tabbar :current="3" ref="tabbarMain"></Tabbar>
  182. </view>
  183. </template>
  184. <script>
  185. import Tabbar from '@/components/TabbarFinance.vue'
  186. import * as API from '@/apis/finance.js'
  187. import {
  188. substrMb
  189. } from '@/utils'
  190. export default {
  191. data() {
  192. return {
  193. tel:'400-8899-619',
  194. role:{},
  195. info:{},
  196. home:null,
  197. current: 0,
  198. vipPlatformList:[],
  199. background:{
  200. background: 'none'
  201. },
  202. }
  203. },
  204. components: {
  205. Tabbar
  206. },
  207. onLoad() {
  208. this.info=this.carhelp.getPersonInfo("merchantUser")
  209. console.log(this.info)
  210. },
  211. onReady() {
  212. this.getHomePage()
  213. },
  214. onShow() {
  215. if(this.$refs.tabbarMain){
  216. this.$refs.tabbarMain.setcount(3);
  217. }
  218. this.query()
  219. this.getHomePage()
  220. },
  221. methods: {
  222. query(){
  223. uni.showLoading({
  224. title: "加载中",
  225. mask: true,
  226. })
  227. API.findByOpenId({
  228. openId: this.carhelp.getOpenId(),
  229. }).then((response) => {
  230. //this.loginset(response)
  231. var token = response ? response.data.token : '';
  232. this.carhelp.setToken(token,"merchantUser");
  233. this.carhelp.setPersonInfo(response.data.user,"merchantUser");
  234. this.carhelp.setPersonInfoPlus(response.data, "merchantUser")
  235. this.info=response.data.user
  236. uni.hideLoading();
  237. }).catch(error => {
  238. uni.hideLoading();
  239. })
  240. },
  241. getPhone(phone){
  242. var backphone="";
  243. if(phone){
  244. backphone=substrMb(phone,0,3)+"****"+substrMb(phone,7,4)
  245. }
  246. return backphone;
  247. },
  248. showModel(){
  249. var bankCard="";
  250. var sss=""
  251. if(this.home.bankCard){
  252. bankCard=substrMb(this.home.bankCard,0,4)+"****"+substrMb(this.home.bankCard,this.home.bankCard.length-4,4)
  253. }
  254. var code=this.home.bank+":"+bankCard;
  255. if(this.home.bank==null&&this.home.bankCard==null){
  256. code="未绑定"
  257. }
  258. uni.showModal({
  259. showCancel:false,
  260. content:code,
  261. })
  262. },
  263. logoutApi(){
  264. uni.showLoading({
  265. title: "加载中",
  266. mask: true,
  267. })
  268. var data = {
  269. };
  270. API.logout(data).then((res) => {
  271. this.carhelp.setToken("","merchantUser");
  272. this.carhelp.set("merchantUser_token_tdate","")
  273. this.carhelp.setPersonInfo("","merchantUser");
  274. this.carhelp.setPersonInfoPlus("" ,"merchantUser" )
  275. uni.reLaunch({
  276. url:"/pagesFinance/login/index?phone="+this.info.phone
  277. })
  278. }).catch(error => {
  279. uni.showToast({
  280. title: error
  281. })
  282. })
  283. },
  284. logout(){
  285. uni.showModal({
  286. title: '提示',
  287. content: '确认是否退出?',
  288. success: res=> {
  289. if (res.confirm) {
  290. //付钱 改为组件
  291. this.logoutApi();
  292. } else if (res.cancel) {
  293. console.log('用户点击取消');
  294. }
  295. }
  296. });
  297. },
  298. phone(){
  299. uni.makePhoneCall({
  300. phoneNumber:this.tel //仅为示例
  301. });
  302. },
  303. getHomePage(){
  304. uni.showLoading({
  305. title: "加载中",
  306. mask: true,
  307. })
  308. API.homePage().then((res) => {
  309. this.home = res.data
  310. if(res.data.vipPlatformList){
  311. this.vipPlatformList=res.data.vipPlatformList
  312. }
  313. uni.hideLoading()
  314. }).catch(error => {
  315. uni.showToast({
  316. title: error
  317. })
  318. })
  319. }
  320. }
  321. }
  322. </script>
  323. <style>
  324. page{
  325. background:url(../../assets/img/index_header_bg.png) no-repeat top center #f7f7f7;
  326. background-size: 100%;
  327. }
  328. </style>
  329. <style lang="scss" scoped>
  330. .userCell{
  331. background-color: #fff;
  332. border-radius: 8px;
  333. margin: 16px;
  334. .userCell-item{
  335. display: flex;
  336. justify-content: space-between;
  337. align-items: center;
  338. padding: 16px;
  339. .userCell-title{
  340. display: flex;
  341. align-items: center;
  342. p{
  343. margin-left: 8px;
  344. }
  345. }
  346. span{
  347. color:#999;
  348. }
  349. }
  350. }
  351. .userInfo{
  352. // background-color: #fff;
  353. background: linear-gradient(#fff2eb,#ffffff);
  354. margin: 16px;
  355. padding: 16px;
  356. border-radius: 8px;
  357. p{
  358. color:#637AA2;
  359. }
  360. .userInfo-main{
  361. display: flex;
  362. justify-content: space-between;
  363. margin-top: 4px;
  364. align-items: center;
  365. h2{
  366. flex: 1;
  367. font-size: 32px;
  368. display: flex;
  369. justify-content: space-between;
  370. .withdraw{
  371. margin: auto 0;
  372. width: 80px;
  373. height:30px;
  374. line-height: 28px;
  375. border-radius: 20px;
  376. background-color: rgba(255, 133, 1, 100);
  377. color: rgba(255, 255, 255, 100);
  378. font-size: 14px;
  379. text-align: center;
  380. }
  381. }
  382. }
  383. .userInfo-btn{
  384. padding: 6px 10px;
  385. background-color: #FF8501;
  386. color:#fff;
  387. border-radius: 15px;
  388. }
  389. .userInfo-foot{
  390. display: flex;
  391. justify-content: space-between;
  392. margin-top: 12px;
  393. .userInfo-item{
  394. flex: 1;
  395. h4{
  396. font-size: 16px;
  397. margin-top: 4px;
  398. }
  399. }
  400. }
  401. }
  402. .userHead{
  403. display: flex;
  404. align-items: center;
  405. padding:40px 20px 0;
  406. .userHead-img{
  407. }
  408. .userHead-text{
  409. margin-left: 12px;
  410. h3{
  411. font-size: 24px;
  412. color:#fff;
  413. font-weight: normal;
  414. }
  415. .userHead-text-position{
  416. display: flex;
  417. align-items: center;
  418. margin-top: 5px;
  419. p{
  420. color:#fff;
  421. margin-left: 4px;
  422. }
  423. }
  424. }
  425. }
  426. .userData{
  427. background-color: #fff;
  428. margin: 16px;
  429. padding: 16px;
  430. border-radius: 8px;
  431. display: flex;
  432. }
  433. .userData-item{
  434. flex: 1;
  435. display: flex;
  436. flex-direction: column;
  437. align-items: center;
  438. justify-content:space-between;
  439. .userData-data{
  440. font-size: 24px;
  441. font-weight: bold;
  442. }
  443. .userData-name{
  444. font-size: 16px;
  445. }
  446. .userData-foot{
  447. margin-top: 4px;
  448. color:#637AA2;
  449. }
  450. }
  451. //功能菜单
  452. .function-menu{
  453. margin: 12px 16px;
  454. background-color: #fff;
  455. border-radius: 8px;
  456. padding: 0 13px;
  457. display: flex;
  458. flex-wrap: wrap;
  459. }
  460. @media screen and (max-width: 375px) {
  461. .item {
  462. width: 33% !important;
  463. }
  464. }
  465. .item{
  466. width: 25%;
  467. margin-top: 20px;
  468. margin-bottom: 11px;
  469. display: flex;
  470. flex-direction: column;
  471. align-items: center;
  472. color: rgba(119, 119, 119, 100);
  473. i{
  474. font-size: 24px
  475. }
  476. .item-name{
  477. font-size: 16px;
  478. margin-top: 8px;
  479. }
  480. }
  481. .logout-btn{
  482. background-color: #fff;
  483. margin: 12px 16px;
  484. border: 8px;
  485. color: rgba(238, 49, 56, 100);
  486. font-size: 16px;
  487. line-height: 40px;
  488. }
  489. </style>