index.vue 34 KB

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