index.vue 31 KB

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