index.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392
  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. font-size: 24rpx;
  908. color: rgba(16, 16, 16, 1);
  909. }
  910. .rightText2{
  911. opacity: 0.7;
  912. color: rgba(0, 0, 0, 1);
  913. font-size: 20rpx;
  914. }
  915. }
  916. }
  917. .userinfo2 {
  918. padding: 40rpx 0 32rpx 32rpx;
  919. }
  920. // 卡包入口
  921. .my-infos{
  922. display: flex;
  923. align-items: center;
  924. justify-content: space-between;
  925. padding: 0 96rpx;
  926. margin: 40rpx 0;
  927. .line{
  928. height: 56rpx;
  929. width: 1px;
  930. background-color: rgba(224, 224, 224, 1);
  931. }
  932. .item{
  933. text-align: center;
  934. .item-value{
  935. color: rgba(51, 51, 51, 1);
  936. font-size: 40rpx;
  937. font-weight: bold;
  938. }
  939. .item-title{
  940. color: rgba(85, 85, 85, 1);
  941. margin-top: 8rpx;
  942. }
  943. }
  944. /deep/.uicon-arrow-right{
  945. margin-left: 4rpx;
  946. }
  947. }
  948. // 卡片
  949. .card {
  950. background: linear-gradient(#405473, #536D96);
  951. border-radius: 8px;
  952. width: 91.4%;
  953. margin: 8rpx auto 0;
  954. padding: 24rpx 24rpx;
  955. .cardspan{
  956. margin-left: 48rpx;
  957. font-size: 24rpx;
  958. line-height:40rpx;
  959. color: rgba(255, 255, 255, 100);
  960. }
  961. .card2 {
  962. display: flex;
  963. justify-content: space-between;
  964. .title {
  965. line-height: 72rpx;
  966. color: rgba(255, 255, 255, 100);
  967. font-size: 36rpx;
  968. .img {
  969. display: inline-block;
  970. // width: 48rpx;
  971. // height: 48rpx;
  972. vertical-align: middle;
  973. margin-right: 8rpx;
  974. img {
  975. width: 40rpx;
  976. height: 40rpx;
  977. }
  978. }
  979. }
  980. .view {
  981. line-height: 72rpx;
  982. color: rgba(208, 214, 226, 100);
  983. font-size: 36rpx;
  984. }
  985. .view2 {
  986. line-height: 144rpx !important;
  987. }
  988. }
  989. }
  990. // 立即开通
  991. .openlogin {
  992. border: 1px solid rgba(187, 226, 189, 1);
  993. background: #F4FFF3 ;
  994. width: 91.4%;
  995. padding: 30rpx 24rpx 24rpx 24rpx;
  996. margin: 8rpx auto 0;
  997. margin-bottom: 10px;
  998. display: flex;
  999. justify-content: space-between;
  1000. border-radius: 8px;
  1001. .title {
  1002. line-height: 72rpx;
  1003. color: #101010;
  1004. font-size: 36rpx;
  1005. .img {
  1006. display: inline-block;
  1007. // width: 48rpx;
  1008. // height: 48rpx;
  1009. vertical-align: middle;
  1010. margin-right: 8rpx;
  1011. img {
  1012. width: 40rpx;
  1013. height: 40rpx;
  1014. }
  1015. }
  1016. }
  1017. .open-btn {
  1018. margin: auto;
  1019. padding-left: 12px;
  1020. padding-right: 4px;
  1021. line-height: 28px;
  1022. height: 32px;
  1023. // text-align: center;
  1024. color: #ffffff;
  1025. border-radius: 10px;
  1026. background: linear-gradient(to right,#34BC58 , #00A39A );
  1027. .iconfont {
  1028. margin-left: 0px;
  1029. }
  1030. }
  1031. }
  1032. // 立即开通
  1033. .open,.opened {
  1034. background: linear-gradient(#4A4C62, #2C3145);
  1035. width: 91.4%;
  1036. padding: 30rpx 24rpx 24rpx 24rpx;
  1037. margin: 8rpx auto 0;
  1038. display: flex;
  1039. justify-content: space-between;
  1040. border-radius: 8px;
  1041. .title {
  1042. line-height: 72rpx;
  1043. color: #E1C082;
  1044. font-size: 36rpx;
  1045. .img {
  1046. display: inline-block;
  1047. vertical-align: middle;
  1048. margin-right: 8rpx;
  1049. img {
  1050. width: 40rpx;
  1051. height: 40rpx;
  1052. }
  1053. }
  1054. }
  1055. .open-btn {
  1056. padding-left: 28rpx;
  1057. padding-right: 8rpx;
  1058. line-height: 76rpx;
  1059. // text-align: center;
  1060. font-size: 32rpx;
  1061. border-radius: 100rpx;
  1062. background: linear-gradient(to right,#F0E1C6, #ECC194);
  1063. .iconfont {
  1064. margin-left: 0px;
  1065. }
  1066. }
  1067. .date{
  1068. color: #d1b37a;
  1069. line-height: 24px;
  1070. font-size: 32rpx;
  1071. .iconfont{
  1072. color: #867668
  1073. }
  1074. }
  1075. }
  1076. // 余额
  1077. .balance {
  1078. background-color: #fff;
  1079. width: 91.4%;
  1080. margin: 12px auto;
  1081. padding: 16px ;
  1082. display: flex;
  1083. // justify-content: space-between;
  1084. justify-content: space-around;
  1085. border-radius: 8px;
  1086. .item {
  1087. text-align: center;
  1088. .num {
  1089. line-height: 28px;
  1090. color: rgba(51, 51, 51, 100);
  1091. font-size: 24px;
  1092. position: relative;
  1093. .new {
  1094. width: 40px;
  1095. line-height: 20px;
  1096. border-radius: 24px 24px 24px 0px;
  1097. background-color: rgba(255, 94, 0, 100);
  1098. color: rgba(255, 255, 255, 100);
  1099. font-size: 12px;
  1100. text-align: center;
  1101. position: absolute;
  1102. bottom: 20px;
  1103. left: 36px;
  1104. }
  1105. }
  1106. .name {
  1107. height: 16px;
  1108. color: rgba(134, 134, 134, 100);
  1109. font-size: 14px;
  1110. margin-top: 4px;
  1111. .userData-foot-look {
  1112. color: #00B962;
  1113. }
  1114. }
  1115. }
  1116. }
  1117. }
  1118. // 优惠
  1119. .discounts {
  1120. width: 91.4%;
  1121. //height: 80px;
  1122. margin: 0 auto;
  1123. border-radius: 8px;
  1124. overflow: hidden;
  1125. img {
  1126. width: 100%;
  1127. height: 80px;
  1128. }
  1129. }
  1130. // 菜单
  1131. .menu {
  1132. background-color: #fff;
  1133. width: 91.4%;
  1134. margin: 24rpx auto 0;
  1135. padding: 0 24rpx 18rpx 24rpx;
  1136. border-radius: 8px;
  1137. display: flex;
  1138. flex-wrap: wrap;
  1139. .item {
  1140. width: 25%;
  1141. margin-top: 40rpx;
  1142. margin-bottom: 22rpx;
  1143. display: flex;
  1144. flex-direction: column;
  1145. align-items: center;
  1146. color: rgba(119, 119, 119, 100);
  1147. i {
  1148. font-size: 24px
  1149. }
  1150. .item-name {
  1151. font-size: 14px;
  1152. margin-top: 8px;
  1153. }
  1154. }
  1155. }
  1156. .shema {
  1157. width: 70%;
  1158. padding-bottom: 20px;
  1159. border-radius: 16px;
  1160. background-color: #fff;
  1161. position: fixed;
  1162. top: 100px;
  1163. left: 0;
  1164. right: 0;
  1165. margin: 0 auto;
  1166. z-index: 9999;
  1167. .title {
  1168. height: 33px;
  1169. color: rgba(16, 16, 16, 100);
  1170. font-size: 24px;
  1171. text-align: center;
  1172. padding: 16px 0;
  1173. }
  1174. .u-radio-group {
  1175. margin: 16px 5vw;
  1176. }
  1177. /deep/.u-radio {
  1178. width: 60vw !important;
  1179. padding: 24px 24px 40px;
  1180. line-height: 20px;
  1181. border-radius: 16px;
  1182. text-align: center;
  1183. border: #101010 1px solid;
  1184. margin-top: 12px;
  1185. }
  1186. /deep/ .u-radio__label {
  1187. text-align: left;
  1188. height: 24px;
  1189. // color: rgba(0, 185, 98, 100);
  1190. font-size: 24px;
  1191. }
  1192. p {
  1193. height: 22px;
  1194. color: rgba(102, 102, 102, 100);
  1195. font-size: 14px;
  1196. margin-top: 12px;
  1197. white-space: nowrap
  1198. }
  1199. .hint {
  1200. text-align: center;
  1201. }
  1202. .btn-box {
  1203. margin-top: 20px;
  1204. .choice-btn {
  1205. width: 80%;
  1206. }
  1207. }
  1208. }
  1209. .wrap {
  1210. display: flex;
  1211. align-items: center;
  1212. justify-content: center;
  1213. height: 100%;
  1214. }
  1215. </style>