index.vue 30 KB

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