index.vue 32 KB

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