index.vue 31 KB

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