index.vue 30 KB

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