index.vue 25 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145
  1. <template>
  2. <view>
  3. <view class="header">
  4. <!-- 用户信息 -->
  5. <view class="userinfo" :class="{
  6. userinfo2:personInfo&&personInfo.userType==2
  7. }">
  8. <view class="infos" @click="toData" >
  9. <view class="head-portrait" >
  10. <u-avatar :src="userId ? headImg : '../../assets/img/head.png'" size="96"></u-avatar>
  11. </view>
  12. <view class="username" v-if="personInfo&&personInfo.userType==1" >
  13. <view class="name" style="font-size: 56rpx; width: 360rpx;line-height: 100rpx;">
  14. 游客模式
  15. </view>
  16. </view>
  17. <view class="" v-if="personInfo&&personInfo.userType==1" >
  18. </view>
  19. <view class="username" v-else >
  20. <view class="name" :style="elderStatus ? 'font-size: 28px;' : ''">
  21. {{userId ? nickName : '登录 / 注册'}}
  22. </view>
  23. <view class="change" :style="elderStatus ? 'font-size: 16px;' : ''">
  24. {{userId ? '点击修改个人信息' : '登录后享受更多优惠及服务'}}
  25. </view>
  26. </view>
  27. </view>
  28. <view class="right" v-if="personInfo&&personInfo.userType==2" >
  29. <img src="@/assets/img/9-4/联盟会员.svg" v-if="personInfo.memberLevel==1||personInfo.memberLevel==null" >
  30. <img src="@/assets/img/9-4/黄金会员.svg" v-if="personInfo.memberLevel==2" >
  31. <img src="@/assets/img/9-4/铂金会员.svg" v-if="personInfo.memberLevel==3" >
  32. <view class="rightText rightTextA" v-if="personInfo.memberLevel==1||personInfo.memberLevel==null">
  33. <view class="rightText1">{{personInfo.memberLevelStr}}</view>
  34. <view class="rightText2">可购买6折卡</view>
  35. </view>
  36. <view class="rightText rightTextB" v-if="personInfo.memberLevel==2">
  37. <view class="rightText1">{{personInfo.memberLevelStr}}</view>
  38. <view class="rightText2">可购买月卡</view>
  39. </view>
  40. <view class="rightText rightTextC" v-if="personInfo.memberLevel==3">
  41. <view class="rightText1">{{personInfo.memberLevelStr}}</view>
  42. <view class="rightText2">可购买月卡</view>
  43. </view>
  44. </view>
  45. </view>
  46. <!-- 卡包入口 -->
  47. <view class="my-infos" v-if="(personInfo&&personInfo.userType==2)">
  48. <view class="item">
  49. <view class="item-value">
  50. {{personAccount.availableAmount != null ? personAccount.availableAmount.toFixed(2) : '0.00'}}
  51. </view>
  52. <view class="item-title" @click="toBalance">
  53. 余额<u-icon name="arrow-right" color="#B8BDC4" size="2"></u-icon>
  54. </view>
  55. </view>
  56. <view class="line">
  57. </view>
  58. <view class="item ">
  59. <view class="item-value">
  60. {{businessVipList.length+ ( userId&&userCardBool?1:0)}}
  61. </view>
  62. <view class="item-title" @click="gotoUrl('pages/cardBag/cardBag')" >
  63. 会员卡<u-icon name="arrow-right" color="#B8BDC4" size="2"></u-icon>
  64. </view>
  65. </view>
  66. <view class="line">
  67. </view>
  68. <view class="item">
  69. <view class="item-value">
  70. {{personAccount.couponAmount}}
  71. </view>
  72. <view class="item-title" @click="toMyCoupon">
  73. 优惠券<u-icon name="arrow-right" color="#B8BDC4" size="2"></u-icon>
  74. </view>
  75. </view>
  76. </view>
  77. <!-- 卡片 -->
  78. <view v-for="(item,i) in businessVipList" :key="i" v-if="false"
  79. @click="gotoUrl('pages/user/company-vip?id='+item.platform)"
  80. class="card" >
  81. <view class="card2">
  82. <view class="title">
  83. <text class="img">
  84. <img src="../../assets/img/riFill-building-fill@4x.png" alt="">
  85. </text>
  86. {{item.platformN}}
  87. </view>
  88. <view class="view" >
  89. 查看<text class="iconfont">&#xe600;</text>
  90. </view>
  91. </view>
  92. <view class="cardspan" v-if="item.entAccountEnabled&&item.enterpriseAccount!=null">
  93. 企业余额:{{item.enterpriseAccount.totalAmount?item.enterpriseAccount.totalAmount.toFixed(2):'0.00'}}元
  94. </view>
  95. </view>
  96. <view v-if="personInfo&&personInfo.userType==1" >
  97. </view>
  98. <!-- 立即开通 -->
  99. <!-- <view class="open" v-else-if="false&&userId&&!userCardBool">
  100. <view class="title">
  101. <text class="img">
  102. <img src="../../assets/img/antFill-crown@3x.png" alt="">
  103. </text>充电月卡
  104. </view>
  105. <view class="open-btn" @click="gotoUrl('pages/monthlyCardActivity/monthlyCardBuy')">
  106. 立即开通
  107. <text class="iconfont">&#xe632;</text>
  108. </view>
  109. </view> -->
  110. <!-- 开通后 -->
  111. <!-- <view class="opened" v-if="false&&userId&&userCardBool" @click="gotoUrl('pages/monthlyCardActivity/monthlyCardBuy')">
  112. <view class="title">
  113. <text class="img">
  114. <img src="../../assets/img/antFill-crown@3x.png" alt="">
  115. </text>充电月卡
  116. </view>
  117. <view class="date">
  118. {{userCard.endTime?userCard.endTime.slice(0,10):''}}到期
  119. <text class="iconfont">&#xe600;</text>
  120. </view>
  121. </view> -->
  122. <!-- 可用余额 -->
  123. <view class="balance" v-if="false&&(personInfo&&personInfo.userType==2)" >
  124. <view class="item" @click="toBalance">
  125. <view class="num oldTextjp" oldstyle="font-size: 28px;">
  126. {{personAccount.availableAmount != null ? personAccount.availableAmount.toFixed(2) : '0.00'}}<span style="font-size: 16px;">元</span>
  127. </view>
  128. <view class="name" :style="elderStatus ? 'font-size: 16px;' : ''">
  129. 可用余额{{" "}}
  130. <span class="userData-foot-look">查看</span>
  131. </view>
  132. </view>
  133. <view class="item" @click="toMyCoupon">
  134. <view class="num oldTextjp" oldstyle="font-size: 28px;">
  135. {{personAccount.couponNum}}<span style="font-size: 16px; margin-right: 4px;">张</span>
  136. <!-- <text class="new">新券</text> -->
  137. <span style="font-size: 16px;">共</span>{{personAccount.couponAmount}}<span style="font-size: 16px;">元</span>
  138. </view>
  139. <view class="name" :style="elderStatus ? 'font-size: 16px;' : ''">
  140. 优惠券{{" "}}
  141. <span class="userData-foot-look">查看</span>
  142. </view>
  143. </view>
  144. <!-- <view class="item">
  145. <view class="num oldTextjp" oldstyle="font-size: 28px;">
  146. 0
  147. </view>
  148. <view class="name" :style="elderStatus ? 'font-size: 16px;' : ''">
  149. 积分{{" "}}
  150. <span class="userData-foot-look">查看</span>
  151. </view>
  152. </view> -->
  153. </view>
  154. </view>
  155. <view class="carImg" v-if="!personInfo||personInfo&&personInfo.userType!=2" >
  156. <img @click="toData" src="@/assets/img/gologin/img.png">
  157. </view>
  158. <!-- 优惠 -->
  159. <view class="discounts" v-else >
  160. <u-swiper bg-color="#fff" :img-mode="'scaleToFill'" height="160" :list="bannerList" mode="none" @click="clickBanner"
  161. :name="'picUrl'">
  162. </u-swiper>
  163. </view>
  164. <!-- 菜单 -->
  165. <view class="menu">
  166. <view class="item" @click="chargingRecord">
  167. <view class="item-icon">
  168. <img src="@/assets/img/gologin/img3.svg">
  169. </view>
  170. <view class="item-name " oldstyle="font-size: 16px;">
  171. 充电记录
  172. </view>
  173. </view>
  174. <view class="item" @click="myAppointment">
  175. <view class="item-icon">
  176. <img src="@/assets/img/gologin/img4.svg">
  177. </view>
  178. <view class="item-name " oldstyle="font-size: 16px;">
  179. 我的预约
  180. </view>
  181. </view>
  182. <view class="item" @click="toInvoice">
  183. <view class="item-icon">
  184. <img src="@/assets/img/gologin/img1.svg">
  185. </view>
  186. <view class="item-name " oldstyle="font-size: 16px;">
  187. 我的发票
  188. </view>
  189. </view>
  190. <view class="item" @click="toMyorder">
  191. <view class="item-icon">
  192. <img src="@/assets/img/gologin/img6.svg">
  193. </view>
  194. <view class="item-name " oldstyle="font-size: 16px;">
  195. 我的订单
  196. </view>
  197. </view>
  198. </view>
  199. <!-- 菜单 -->
  200. <view class="menu" style="margin-bottom:60px ;">
  201. <view class="item" @click="gotoUrl('pages/service/service')">
  202. <view class="item-icon">
  203. <i class="ri-customer-service-2-line"></i>
  204. </view>
  205. <view class="item-name " oldstyle="font-size: 16px;">
  206. 联系客服
  207. </view>
  208. </view>
  209. <view class="item" @click="feedback">
  210. <view class="item-icon">
  211. <i class="ri-feedback-line"></i>
  212. </view>
  213. <view class="item-name " oldstyle="font-size: 16px;">
  214. 意见反馈
  215. </view>
  216. </view>
  217. <view class="item" @click="gotoUrl('pages/user/help')">
  218. <view class="item-icon">
  219. <i class="ri-compass-3-line"></i>
  220. </view>
  221. <view class="item-name " oldstyle="font-size: 16px;">
  222. 操作指南
  223. </view>
  224. </view>
  225. <view class="item" @click="gotoUrl('pages/user/about')">
  226. <view class="item-icon">
  227. <i class="ri-account-pin-box-line"></i>
  228. </view>
  229. <view class="item-name " oldstyle="font-size: 16px;">
  230. 关于我们
  231. </view>
  232. </view>
  233. <!-- <view class="item">
  234. <view class="item-icon">
  235. <i class="ri-tools-line"></i>
  236. </view>
  237. <view class="item-name oldTextjp" oldstyle="font-size: 16px;">
  238. 我要报修
  239. </view>
  240. </view> -->
  241. <view class="item" @click="toFreeInstallation">
  242. <view class="item-icon">
  243. <i class="ri-file-add-line"></i>
  244. </view>
  245. <view class="item-name " oldstyle="font-size: 16px;">
  246. 免费安桩
  247. </view>
  248. </view>
  249. <view class="item" @click="toJoin">
  250. <view class="item-icon">
  251. <i class="ri-service-line"></i>
  252. </view>
  253. <view class="item-name " oldstyle="font-size: 16px;">
  254. 我要加盟
  255. </view>
  256. </view>
  257. <view class="item" @click="setUp">
  258. <view class="item-icon" style="line-height: 52rpx;">
  259. <u-icon name="setting" size="24px" ></u-icon>
  260. </view>
  261. <view class="item-name " oldstyle="font-size: 16px;">
  262. 设置
  263. </view>
  264. </view>
  265. <!-- <view class="item">
  266. <view class="item-icon">
  267. <i class="ri-shield-user-line"></i>
  268. </view>
  269. <view class="item-name oldTextjp" oldstyle="font-size: 16px;">
  270. 实名认证
  271. </view>
  272. </view> -->
  273. </view>
  274. <Tabbar :current="3" ref="tabbarMain" :elderStatus="elderStatus"></Tabbar>
  275. </view>
  276. </template>
  277. <script>
  278. import * as API from '@/apis/index.js'
  279. import * as userApi from '@/apis/user.js'
  280. import * as loginApi from '@/apis/login.js'
  281. import * as WxJsApi from '@/utils/wxJsApi.js'
  282. import Tabbar from '@/components/Tabbar.vue'
  283. import * as newsApi from '@/apis/news.js'
  284. import {
  285. newDate
  286. } from '@/utils'
  287. export default {
  288. components: {
  289. Tabbar
  290. },
  291. data() {
  292. return {
  293. userCard:null,
  294. recordsTotal: 0,
  295. myCouponList: [],
  296. elderStatus: false,
  297. personAccount: {},
  298. userId: '',
  299. headImg: '',
  300. nickName: '',
  301. userPhone: '',
  302. personInfo:{},
  303. show: false,
  304. title: '联系客服',
  305. content: '400-8899-619',
  306. confirmText: '拨打电话',
  307. bannerList:[],
  308. businessVipList:[],
  309. background:{
  310. background: 'none'
  311. },
  312. }
  313. },
  314. onShow() {
  315. if(this.bannerList.length==0){
  316. this.getBannerInfo("userinfo")
  317. }
  318. this.personInfo=this.carhelp.getPersonInfo()
  319. if(this.carhelp.getPersonInfo()) {
  320. this.userId = this.carhelp.getPersonInfo().id;
  321. this.getCarPersonAccount();
  322. this.getUserInfo();
  323. //this.getCouponList();
  324. }
  325. if(this.$refs.tabbarMain){
  326. this.$refs.tabbarMain.setcount(3);
  327. }
  328. if(this.carhelp.get("getElderModeClass") == "长辈模式") {
  329. this.elderStatus = true;
  330. } else {
  331. this.elderStatus = false;
  332. }
  333. },
  334. computed:{
  335. userCardBool(){
  336. if(this.userCard){
  337. var date=new Date().getTime()
  338. var reg=new RegExp('-','gi')
  339. var str=this.userCard.endTime;
  340. //console.log(str.replace(reg,'/'))
  341. var date2=newDate(str).getTime();
  342. if(date<date2){
  343. return true;
  344. }
  345. }
  346. return false
  347. }
  348. },
  349. onReady() {
  350. if(this.bannerList.length==0){
  351. this.getBannerInfo("userinfo")
  352. }
  353. WxJsApi.getWxConfig(['getLocation', 'addEventListener', 'scanQRCode']).then((res) => {
  354. // //(res)
  355. }).catch(error => {
  356. //(error)
  357. })
  358. var consumerPhone=this.carhelp.getConfig().consumerPhone
  359. // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  360. if(consumerPhone){
  361. this.content=consumerPhone
  362. }
  363. },
  364. methods: {
  365. personalCenter(){
  366. API.personalCenter().then((res2) => {
  367. var entRegList=res2.data.entRegList;
  368. for(var i in this.businessVipList){
  369. var item1=this.businessVipList[i]
  370. for(var j in entRegList){
  371. var item2=entRegList[j].vipUser;
  372. if(item1.id==item2.id){
  373. item1.enterpriseAccount=entRegList[j].enterpriseAccount
  374. }
  375. }
  376. }
  377. this.$forceUpdate()
  378. }).catch(error => {
  379. uni.showToast({
  380. title: error
  381. })
  382. })
  383. },
  384. clickBanner(index){
  385. var mod= this.bannerList[index]
  386. if(mod.linkUrl.indexOf('http')==0){
  387. window.location=mod.linkUrl;
  388. }
  389. else if(mod.linkUrl.indexOf('#/')==0){
  390. if(mod.linkUrl.indexOf("?")==-1){
  391. mod.linkUrl+='?';
  392. }
  393. //window.location=mod.linkUrl;
  394. var url=mod.linkUrl.split("#")[1]
  395. //window.location = mod.clickUrl;
  396. uni.navigateTo({
  397. url: url
  398. })
  399. }
  400. else if(mod.linkUrl=='#'||mod.linkUrl==''){
  401. }
  402. else{
  403. uni.navigateTo({
  404. url:mod.linkUrl
  405. })
  406. }
  407. },
  408. getBannerInfo(code){
  409. uni.showLoading({
  410. title: "加载中",
  411. mask: true,
  412. })
  413. newsApi.getBannerInfo(code).then((res) => {
  414. uni.hideLoading();
  415. this.bannerList =res.data;
  416. // document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 300px;"
  417. }).catch(error => {
  418. uni.showToast({
  419. title: error,icon: "none"
  420. })
  421. })
  422. },
  423. getCouponList() {
  424. uni.showLoading({
  425. title: "加载中",
  426. mask: true,
  427. })
  428. userApi.couponList({
  429. status: '0'
  430. }).then((res) => {
  431. uni.hideLoading();
  432. this.myCouponList = res.data.data;
  433. this.recordsTotal = res.data.recordsTotal;
  434. }).catch(error => {
  435. uni.showToast({
  436. title: error,
  437. icon: "none"
  438. })
  439. })
  440. },
  441. //微信扫二维码
  442. getScanCode() {
  443. if (this.userId) {
  444. WxJsApi.scanQRCode(1).then(res => {
  445. if(res) {
  446. API.scanCode(res).then((response) => {
  447. }).catch(error => {
  448. uni.showToast({
  449. title: error,
  450. icon: "none"
  451. })
  452. })
  453. }
  454. }).catch(error => {
  455. })
  456. } else {
  457. uni.navigateTo({
  458. url: '/pages/login/login'
  459. })
  460. }
  461. },
  462. toMyorder(){
  463. if (this.userId) {
  464. uni.navigateTo({
  465. url: '/pages/discountCard/myOrder'
  466. })
  467. } else {
  468. uni.navigateTo({
  469. url: '/pages/login/login'
  470. })
  471. }
  472. },
  473. toInvoice(){
  474. if (this.userId) {
  475. uni.navigateTo({
  476. url: '/pages/MyInvoice/invoiceManagement'
  477. })
  478. } else {
  479. uni.navigateTo({
  480. url: '/pages/login/login'
  481. })
  482. }
  483. },
  484. chargingRecord() {
  485. if (this.userId) {
  486. uni.navigateTo({
  487. url: '/pages/record/index'
  488. })
  489. } else {
  490. uni.navigateTo({
  491. url: '/pages/login/login'
  492. })
  493. }
  494. },
  495. toSearchPile() {
  496. uni.navigateTo({
  497. url: '/pages/searchPile/searchPile'
  498. })
  499. },
  500. getUserInfo() {
  501. uni.showLoading({
  502. title: "加载中",
  503. mask: true,
  504. })
  505. loginApi.findByOpenId({
  506. openId: this.carhelp.getOpenId()
  507. }).then((res) => {
  508. uni.hideLoading();
  509. this.businessVipList=res.data.businessVipList;
  510. // if(this.businessVipList.length){
  511. // var b=false;
  512. // for(var i in this.businessVipList){
  513. // var item=this.businessVipList[i];
  514. // if(item.entAccountEnabled){
  515. // b=true
  516. // }
  517. // }
  518. // if(b){
  519. // //this.personalCenter()
  520. // }
  521. // }
  522. this.headImg = res.data.regUser.headImg;
  523. this.nickName = res.data.regUser.nickName;
  524. this.userCard=res.data.userCard;
  525. var phone = res.data.regUser.phone;
  526. if(phone){
  527. var phone1 = phone.slice(0,3);
  528. var phone2 = phone.slice(-4);
  529. this.userPhone = phone1 + '****' + phone2;
  530. }
  531. if (res.code == 200&&res.result) {
  532. var token = res ? res.data.token : '';
  533. this.personInfo=res.data.regUser
  534. this.carhelp.setPersonInfo(res.data.regUser );
  535. this.carhelp.setToken(token);
  536. this.carhelp.setPersonInfoPlus(res.data);
  537. console.log("setPersonInfoPlus")
  538. }
  539. }).catch(error => {
  540. this.carhelp.logoff()
  541. uni.showToast({
  542. title: error,
  543. icon: "none"
  544. })
  545. })
  546. },
  547. toData() {
  548. if(this.personInfo&&this.personInfo.userType==1){
  549. uni.navigateTo({
  550. url: '/pages/login/login'
  551. })
  552. }else if(this.userId) {
  553. uni.navigateTo({
  554. url: '/pages/user/dataSet'
  555. })
  556. } else {
  557. uni.navigateTo({
  558. url: '/pages/login/login'
  559. })
  560. }
  561. },
  562. toBalance() {
  563. if(this.userId) {
  564. uni.navigateTo({
  565. url: '/pages/user/finance/balance'
  566. })
  567. } else {
  568. uni.navigateTo({
  569. url: '/pages/login/login'
  570. })
  571. }
  572. },
  573. toMyCoupon() {
  574. if(this.userId) {
  575. uni.navigateTo({
  576. url: '/pages/user/coupon/myCoupon'
  577. })
  578. } else {
  579. uni.navigateTo({
  580. url: '/pages/login/login'
  581. })
  582. }
  583. },
  584. toRecharge() {
  585. if(this.userId) {
  586. if(this.personInfo.userType==1){
  587. uni.showToast({
  588. title:"游客模式只支持“先付后退”"
  589. })
  590. }else{
  591. uni.navigateTo({
  592. url: '/pages/user/finance/recharge'
  593. })
  594. }
  595. } else {
  596. uni.navigateTo({
  597. url: '/pages/login/login'
  598. })
  599. }
  600. },
  601. carManage() {
  602. if(this.userId) {
  603. } else {
  604. uni.navigateTo({
  605. url: '/pages/login/login'
  606. })
  607. }
  608. },
  609. myAppointment() {
  610. if(this.userId) {
  611. uni.navigateTo({
  612. url: '/pages/user/myReservation/myReservation'
  613. })
  614. } else {
  615. uni.navigateTo({
  616. url: '/pages/login/login'
  617. })
  618. }
  619. },
  620. toFreeInstallation() {
  621. if(this.userId) {
  622. uni.navigateTo({
  623. url: '/pages/user/freeInstallment?isback=1'
  624. })
  625. } else {
  626. uni.navigateTo({
  627. url: '/pages/login/login'
  628. })
  629. }
  630. },
  631. toJoin() {
  632. if(this.userId) {
  633. uni.navigateTo({
  634. url: '/pages/user/toJoin?isback=1'
  635. })
  636. } else {
  637. uni.navigateTo({
  638. url: '/pages/login/login'
  639. })
  640. }
  641. },
  642. feedback() {
  643. if(this.userId) {
  644. uni.navigateTo({
  645. url: '/pages/user/message'
  646. })
  647. } else {
  648. uni.navigateTo({
  649. url: '/pages/login/login'
  650. })
  651. }
  652. },
  653. setUp() {
  654. if(this.userId) {
  655. uni.navigateTo({
  656. url: '/pages/user/setting'
  657. })
  658. } else {
  659. uni.navigateTo({
  660. url: '/pages/login/login'
  661. })
  662. }
  663. },
  664. openModal() {
  665. this.show = true;
  666. },
  667. confirmPhone(){
  668. this.show = false;
  669. uni.makePhoneCall({
  670. phoneNumber:this.content //仅为示例
  671. });
  672. },
  673. getCarPersonAccount() {
  674. uni.showLoading({
  675. title: "加载中",
  676. mask: true,
  677. })
  678. userApi.carPersonAccount().then((res) => {
  679. uni.hideLoading();
  680. this.personAccount = res.data;
  681. }).catch(error => {
  682. uni.showToast({
  683. title: error,
  684. icon: "none"
  685. })
  686. })
  687. }
  688. }
  689. }
  690. </script>
  691. <style>
  692. page{
  693. background-size: 100%;
  694. }
  695. </style>
  696. <style lang="scss" scoped>
  697. .carImg{
  698. margin: 0 40rpx;
  699. img{
  700. width: 100%;
  701. }
  702. }
  703. .btnuserType1{
  704. width: 160rpx;
  705. height: 64rpx;
  706. line-height: 60rpx;
  707. border-radius: 50px;
  708. background-color: rgba(0, 185, 98, 1);
  709. color: #fff;
  710. font-size: 28rpx;
  711. text-align: center;
  712. font-family: -apple-system;
  713. margin-top: 20rpx;
  714. }
  715. .header {
  716. background: linear-gradient(#D6EEDC, #F6F8F8);
  717. .userinfo {
  718. display: flex;
  719. justify-content: space-between;
  720. padding: 40rpx 32rpx 32rpx 32rpx;
  721. .infos {
  722. display: flex;
  723. }
  724. .head-portrait {
  725. width: 48px;
  726. height: 48px;
  727. img {
  728. width: 100%;
  729. height: 100%;
  730. }
  731. }
  732. .username {
  733. margin-left: 8px;
  734. .name {
  735. color: rgba(51, 51, 51, 100);
  736. font-size: 40rpx;
  737. line-height: 48rpx;
  738. }
  739. .change {
  740. color: rgba(166, 180, 173, 100);
  741. line-height: 14px;
  742. margin-top: 8px;
  743. }
  744. }
  745. .right {
  746. display: flex;
  747. align-items: center;
  748. img{
  749. width: 96rpx;
  750. height: 96rpx;
  751. position: relative;
  752. left: 48rpx;
  753. }
  754. .rightText{
  755. padding-left: 28rpx;
  756. display: flex;
  757. align-items: center;
  758. flex-wrap: wrap;
  759. justify-content: space-evenly;
  760. align-content: center;
  761. width: 188rpx;
  762. height: 72rpx;
  763. text-align: center;
  764. //padding:12rpx 0;
  765. }
  766. .rightTextA{
  767. background: linear-gradient(134.91deg, rgba(220,232,255,1) 29.61%,rgba(176,202,255,1) 99.85%);
  768. }
  769. .rightTextB{
  770. background: linear-gradient(134.91deg, rgba(255,241,187,1) 29.61%,rgba(255,215,63,1) 99.85%);
  771. }
  772. .rightTextC{
  773. background: linear-gradient(134.91deg, rgba(229,234,255,1) 21.58%,rgba(180,176,255,1) 98.85%);
  774. }
  775. .rightText1{
  776. font-size: 24rpx;
  777. }
  778. .rightText2{
  779. opacity: 0.7;
  780. color: rgba(0, 0, 0, 1);
  781. font-size: 20rpx;
  782. }
  783. }
  784. }
  785. .userinfo2 {
  786. padding: 40rpx 0 32rpx 32rpx;
  787. }
  788. // 卡包入口
  789. .my-infos{
  790. display: flex;
  791. align-items: center;
  792. justify-content: space-between;
  793. padding: 0 96rpx;
  794. margin: 40rpx 0;
  795. .line{
  796. height: 56rpx;
  797. width: 1px;
  798. background-color: rgba(224, 224, 224, 1);
  799. }
  800. .item{
  801. text-align: center;
  802. .item-value{
  803. color: rgba(51, 51, 51, 1);
  804. font-size: 40rpx;
  805. font-weight: bold;
  806. }
  807. .item-title{
  808. color: rgba(85, 85, 85, 1);
  809. margin-top: 8rpx;
  810. }
  811. }
  812. /deep/.uicon-arrow-right{
  813. margin-left: 4rpx;
  814. }
  815. }
  816. // 卡片
  817. .card {
  818. background: linear-gradient(#405473, #536D96);
  819. border-radius: 8px;
  820. width: 91.4%;
  821. margin: 8rpx auto 0;
  822. padding: 24rpx 24rpx;
  823. .cardspan{
  824. margin-left: 48rpx;
  825. font-size: 24rpx;
  826. line-height:40rpx;
  827. color: rgba(255, 255, 255, 100);
  828. }
  829. .card2 {
  830. display: flex;
  831. justify-content: space-between;
  832. .title {
  833. line-height: 72rpx;
  834. color: rgba(255, 255, 255, 100);
  835. font-size: 36rpx;
  836. .img {
  837. display: inline-block;
  838. // width: 48rpx;
  839. // height: 48rpx;
  840. vertical-align: middle;
  841. margin-right: 8rpx;
  842. img {
  843. width: 40rpx;
  844. height: 40rpx;
  845. }
  846. }
  847. }
  848. .view {
  849. line-height: 72rpx;
  850. color: rgba(208, 214, 226, 100);
  851. font-size: 36rpx;
  852. }
  853. .view2 {
  854. line-height: 144rpx !important;
  855. }
  856. }
  857. }
  858. // 立即开通
  859. .openlogin {
  860. border: 1px solid rgba(187, 226, 189, 1);
  861. background: #F4FFF3 ;
  862. width: 91.4%;
  863. padding: 30rpx 24rpx 24rpx 24rpx;
  864. margin: 8rpx auto 0;
  865. margin-bottom: 10px;
  866. display: flex;
  867. justify-content: space-between;
  868. border-radius: 8px;
  869. .title {
  870. line-height: 72rpx;
  871. color: #101010;
  872. font-size: 36rpx;
  873. .img {
  874. display: inline-block;
  875. // width: 48rpx;
  876. // height: 48rpx;
  877. vertical-align: middle;
  878. margin-right: 8rpx;
  879. img {
  880. width: 40rpx;
  881. height: 40rpx;
  882. }
  883. }
  884. }
  885. .open-btn {
  886. margin: auto;
  887. padding-left: 12px;
  888. padding-right: 4px;
  889. line-height: 28px;
  890. height: 32px;
  891. // text-align: center;
  892. color: #ffffff;
  893. border-radius: 10px;
  894. background: linear-gradient(to right,#34BC58 , #00A39A );
  895. .iconfont {
  896. margin-left: 0px;
  897. }
  898. }
  899. }
  900. // 立即开通
  901. .open,.opened {
  902. background: linear-gradient(#4A4C62, #2C3145);
  903. width: 91.4%;
  904. padding: 30rpx 24rpx 24rpx 24rpx;
  905. margin: 8rpx auto 0;
  906. display: flex;
  907. justify-content: space-between;
  908. border-radius: 8px;
  909. .title {
  910. line-height: 72rpx;
  911. color: #E1C082;
  912. font-size: 36rpx;
  913. .img {
  914. display: inline-block;
  915. vertical-align: middle;
  916. margin-right: 8rpx;
  917. img {
  918. width: 40rpx;
  919. height: 40rpx;
  920. }
  921. }
  922. }
  923. .open-btn {
  924. padding-left: 28rpx;
  925. padding-right: 8rpx;
  926. line-height: 76rpx;
  927. // text-align: center;
  928. font-size: 32rpx;
  929. border-radius: 100rpx;
  930. background: linear-gradient(to right,#F0E1C6, #ECC194);
  931. .iconfont {
  932. margin-left: 0px;
  933. }
  934. }
  935. .date{
  936. color: #d1b37a;
  937. line-height: 24px;
  938. font-size: 32rpx;
  939. .iconfont{
  940. color: #867668
  941. }
  942. }
  943. }
  944. // 余额
  945. .balance {
  946. background-color: #fff;
  947. width: 91.4%;
  948. margin: 12px auto;
  949. padding: 16px ;
  950. display: flex;
  951. // justify-content: space-between;
  952. justify-content: space-around;
  953. border-radius: 8px;
  954. .item {
  955. text-align: center;
  956. .num {
  957. line-height: 28px;
  958. color: rgba(51, 51, 51, 100);
  959. font-size: 24px;
  960. position: relative;
  961. .new {
  962. width: 40px;
  963. line-height: 20px;
  964. border-radius: 24px 24px 24px 0px;
  965. background-color: rgba(255, 94, 0, 100);
  966. color: rgba(255, 255, 255, 100);
  967. font-size: 12px;
  968. text-align: center;
  969. position: absolute;
  970. bottom: 20px;
  971. left: 36px;
  972. }
  973. }
  974. .name {
  975. height: 16px;
  976. color: rgba(134, 134, 134, 100);
  977. font-size: 14px;
  978. margin-top: 4px;
  979. .userData-foot-look {
  980. color: #00B962;
  981. }
  982. }
  983. }
  984. }
  985. }
  986. // 优惠
  987. .discounts {
  988. width: 91.4%;
  989. //height: 80px;
  990. margin: 0 auto;
  991. border-radius: 8px;
  992. overflow: hidden;
  993. img {
  994. width: 100%;
  995. height: 80px;
  996. }
  997. }
  998. // 菜单
  999. .menu {
  1000. background-color: #fff;
  1001. width: 91.4%;
  1002. margin: 24rpx auto 0;
  1003. padding: 0 24rpx 18rpx 24rpx;
  1004. border-radius: 8px;
  1005. display: flex;
  1006. flex-wrap: wrap;
  1007. .item {
  1008. width: 25%;
  1009. margin-top: 40rpx;
  1010. margin-bottom: 22rpx;
  1011. display: flex;
  1012. flex-direction: column;
  1013. align-items: center;
  1014. color: rgba(119, 119, 119, 100);
  1015. i {
  1016. font-size: 24px
  1017. }
  1018. .item-name {
  1019. font-size: 14px;
  1020. margin-top: 8px;
  1021. }
  1022. }
  1023. }
  1024. </style>