charge.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351
  1. <template>
  2. <view>
  3. <ujp-navbar title="开始充电" :is-back="isback">
  4. <view class="exchange " slot="right" @click="showmodal2=true">充电说明</view>
  5. </ujp-navbar>
  6. <view class="carImg" v-if="personInfo&&personInfo.userType!=2">
  7. <img @click="gotoLogin" src="@/assets/img/gologin/img.png">
  8. </view>
  9. <view v-else>
  10. <!-- 优惠 -->
  11. <view class="discounts" style="padding:0 36rpx;" v-if="bannerList.length">
  12. <u-swiper bg-color="#fff" mode="none" :img-mode="'scaleToFill'" height="160" :list="bannerList"
  13. @click="clickBanner" :name="'picUrl'">
  14. </u-swiper>
  15. </view>
  16. </view>
  17. <view class="recharge">
  18. <view class="title">
  19. <view class="left lefttitle">
  20. 请选择支付方式和充电金额
  21. </view>
  22. <!-- <view class="to-recharge" @click="show=true,recordId='',otherNum_f='',fee=0">
  23. 去充值
  24. </view> -->
  25. </view>
  26. <view class="card" @click="payValue=0" :class="{
  27. cardselect:payValue==0,
  28. cardno:payValue!=0
  29. }">
  30. <view class="cardgo">
  31. <view class="cardinfo">
  32. <img src="@/assets/img/riFill-check-fill.svg" alt="">
  33. </view>
  34. </view>
  35. <view class="title">先付后退</view>
  36. <p>充电结束后,余额自动退还;不享受<span style="color:#ff3d00;">会员充电折扣、平台各类优惠券</span>等福利</p>
  37. <view class="rechargeMain" v-show="payValue==0">
  38. <view class="recharge-item" @click="moneyActiveClass_n=(item.id)"
  39. :class="moneyActiveClass_n == item.id ? 'active' : ''" v-for="(item,index) in moneyListN"
  40. :key="item.id">
  41. {{item.name}}
  42. </view>
  43. </view>
  44. </view>
  45. <view class="card" @click="paySelectMethod(paySelectMethodValue)" :class="{
  46. cardselect:payValue==1||payValue==4,
  47. cardno:!(payValue==1||payValue==4)
  48. }">
  49. <view class="cardgo">
  50. <view class="cardinfo">
  51. <img src="@/assets/img/riFill-check-fill.svg" alt="">
  52. </view>
  53. </view>
  54. <view class="title">会员账户余额充电</view>
  55. <p v-show="!chargingFundsBl&&!(payValue==1||payValue==4)">当前余额{{user.balance>0?user.balance.toFixed(2):'0.00'}}元
  56. <span @click="paySelectShow()" style="color:#00B962;margin-left: 20px; ">去充值></span>
  57. </p>
  58. <p v-show="(payValue==1||payValue==4)">
  59. {{chargingFundsBl?'优先使用付款方式':'账户余额'}}
  60. <span v-if="!chargingFundsBl" style=" color: #ec4530;margin-left: 8rpx;"> {{user.balance>0?user.balance.toFixed(2):'0.00'}}元</span>
  61. <span @click="paySelectShow()" style="color:#00B962;margin-left: 20px; ">去充值></span>
  62. </p>
  63. <view class="rechargeBalance" v-if="chargingFundsBl" >
  64. <view class="rechargeBalanceItem">账户余额 <span style=" color: #ec4530;margin-left: 8rpx;">{{user.balance>0?user.balance.toFixed(2):'0.00'}}元</span></view>
  65. <view class="rechargeBalanceItem" v-if="chargingFundsBl">|</view>
  66. <view class="rechargeBalanceItem" v-if="chargingFundsBl" >充电金<span style=" color: #ec4530;margin-left: 8rpx;">{{user.chargingFunds>0?user.chargingFunds.toFixed(2):'0.00'}}元</span></view>
  67. </view>
  68. <view class="rechargeMain" v-if="chargingFundsBl" v-show="payValue==1||payValue==4">
  69. <view
  70. class=" recharge-item " @click="paySelectMethodValue=1" :class="payValue == 1? 'active' : ''" >
  71. 账户余额
  72. </view>
  73. <view
  74. class=" recharge-item " @click="paySelectMethodValue=4" :class="payValue == 4? 'active' : ''">
  75. 充电金
  76. </view>
  77. </view>
  78. <p v-if="chargingFundsBl" v-show="(payValue==1||payValue==4)" >充电时长</p>
  79. <view class="rechargeMain" v-show="payValue==1||payValue==4">
  80. <view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''"
  81. class=" recharge-item ">
  82. 充满自停
  83. </view>
  84. <view class="recharge-item" @click="moneyClick(item.id)"
  85. :class="!otherNum&&moneyActiveClass == item.id ? 'active' : ''"
  86. v-for="(item,index) in moneyList" :key="item.id">
  87. {{item.name}}元
  88. </view>
  89. <view class="recharge-item recharge-item2" :class="otherNum ? 'active' : ''" style="
  90. padding: 1px 0px;">
  91. <ujp-input v-model="otherNum" @input="ckInput" @focus="focus" type="digit" placeholder="其他金额" />
  92. </view>
  93. </view>
  94. </view>
  95. <view class="card" v-for="(companyItem,i) in companyList" :key="i" @click="paySelectMethod(2,companyItem)"
  96. :class="{
  97. cardselect:(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id),
  98. cardno:!(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)
  99. }">
  100. <view class="cardgo">
  101. <view class="cardinfo">
  102. <img src="@/assets/img/riFill-check-fill.svg" alt="">
  103. </view>
  104. </view>
  105. <view class="title">{{companyItem.enterpriseAccount.entName}}账户余额充电</view>
  106. <p>余额{{companyItem.enterpriseAccount.totalAmount>0?companyItem.enterpriseAccount.totalAmount.toFixed(2):'0.00'}}元
  107. <span
  108. v-show="(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)"
  109. @click="companyCarSelectBl=true"
  110. style="color:#00B962;margin-left: 40rpx; ">{{companyPaySelect.car?companyPaySelect.car+'(更换)':'选择充电车辆>'}}</span>
  111. <span style="margin-left: 40rpx; "
  112. v-show="(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)"></span>
  113. </p>
  114. <view class="rechargeMain"
  115. v-show="(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)">
  116. <view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''"
  117. class=" recharge-item ">
  118. 充满自停
  119. </view>
  120. <view class="recharge-item recharge-item2" :class="otherNum ? 'active' : ''" style="
  121. padding: 1px 0px;">
  122. <ujp-input v-model="otherNum" @input="ckInput" @focus="focus" type="digit" placeholder="其他金额" />
  123. </view>
  124. </view>
  125. </view>
  126. <!-- 优惠券2 -->
  127. <view v-if="personInfo.userType == '1'&&0" class="greyTips" >
  128. 车主注册会员可享受至少5%优惠,并可快速进入会员注册页面
  129. </view>
  130. <!-- 入场车辆 -->
  131. <view class="member" :class="{
  132. 'cost-explain2':!submitForm.carNumber
  133. }">
  134. <view class="actively ">
  135. 入场车辆
  136. </view>
  137. <view class="type" @click="carDet()" >
  138. {{submitForm.carNumber?submitForm.carNumber:'填车牌号可减免部分停车费用'}}
  139. <img v-if="!submitForm.carNumber" src="@/assets/static/img/riLine-edit-box-line2.svg" alt="">
  140. </view>
  141. </view>
  142. <view class="member">
  143. <view class="actively">
  144. 优惠券
  145. </view>
  146. <view class="right" v-if="payValue=='0'">
  147. 先付后退不享受会员优惠活动
  148. </view>
  149. <view class="right" v-else-if="payValue=='4'">
  150. 充电金不享受会员优惠活动
  151. </view>
  152. <view class="right" v-else-if="payValue=='2'">
  153. 企业单位用户不可使用优惠券
  154. </view>
  155. <view class="right" @click="chooseCoupons" v-else-if="selectObj.id">
  156. {{selectObj.threshold == 0 ? '无门槛' : '满'+selectObj.threshold.toFixed(2)+'元可用'}},
  157. <span class="price"
  158. v-if="selectObj.classify == '1'||selectObj.classify == '3'">抵扣{{selectObj.value.toFixed(2)}}元</span>
  159. <span class="price" v-if="selectObj.classify == '2'">
  160. <template v-if="selectObj.value==0">
  161. 服务费全免
  162. </template>
  163. <template v-else>
  164. 服务费{{selectObj.value}}折
  165. </template>
  166. </span>
  167. <view class="iconfont">&#xe600;</view>
  168. </view>
  169. <view class="right" @click="chooseCoupons" v-else-if="listlength">
  170. 未选择,剩余{{listlength}}张优惠券
  171. <view class="iconfont">&#xe600;</view>
  172. </view>
  173. <view class="right" @click="chooseCoupons" v-else>
  174. 无优惠券
  175. <view class="iconfont">&#xe600;</view>
  176. </view>
  177. </view>
  178. <!-- 会员活动 -->
  179. <view class="member">
  180. <view class="actively ">
  181. 会员活动
  182. </view>
  183. <view class="type" v-if="payValue=='0'">
  184. 先付后退不享受会员优惠活动
  185. </view>
  186. <view class="type" v-else-if="payValue=='4'">
  187. 充电金不享受会员优惠活动
  188. </view>
  189. <view class="type" v-else-if="payValue=='2'">
  190. 企业单位用户不享受会员优惠活动
  191. </view>
  192. <template v-else-if="userCardBool">
  193. <view class="type" v-if="!vin" style="color: red;">
  194. vin码不一致
  195. </view>
  196. <view class="type" v-else-if="canUse">
  197. <template v-if="userCard.cardType==4">
  198. {{userCard.cardName}}
  199. {{userCard.monthlyRentName}}
  200. </template>
  201. <template v-else>
  202. {{userCard.classify==1?'折扣卡':''}}
  203. {{userCard.classify==2?'服务费'+(userCard.serviceFeeDiscountRate/10)+'折卡':''}}
  204. </template>
  205. </view>
  206. <view class="type" style="color: red;" v-else>
  207. 此充电站不支持折扣卡
  208. </view>
  209. </template>
  210. <template v-else>
  211. <view class="type" style="color:#999999" @click="gotoUrl('pages/discountCard/productDetails')">
  212. 未使用服务费6折卡<view class="iconfont">&#xe600;</view>
  213. </view>
  214. </template>
  215. </view>
  216. <view v-if="(cardList.length||userCard)&&(payValue=='1')" class="cardListView">
  217. <view class="cardListItemTitle" v-if="cardList.length>1" >点击切换其他卡</view>
  218. <view class="cardListItem card" v-for="(item,i) in cardList"
  219. :key="i" :class="{
  220. cardselect:userCard&&userCard.id==item.id,
  221. cardno:(!userCard||userCard.id!=item.id)
  222. }" @click="userCardBtn(item)" >
  223. <view class="cardgo">
  224. <view class="cardinfo">
  225. <img src="@/assets/img/riFill-check-fill.svg" alt="">
  226. </view>
  227. </view>
  228. <view class="cardListName" >
  229. {{item.cardName}}
  230. </view>
  231. <view class="cardListText" v-if="item.classify==1" >
  232. <view>充电服务费全免</view>
  233. <view>
  234. {{thisendTime(item.endTime)}}到期
  235. </view>
  236. </view>
  237. <view class="cardListText" v-if="item.classify==2" >
  238. <view v-if="item.chargeDegreeLimit">
  239. 已用{{item.chargedDegree?item.chargedDegree.toFixed(0):0.00}}度 / 共{{item.chargeDegreeLimit}}度
  240. </view>
  241. <view v-if="item.chargeDegreeLimit==0&&item.saveInformation">
  242. 已用{{item.saveInformation.num}}次 /
  243. 共省{{item.saveInformation.saveMoney}}元
  244. </view>
  245. <view>
  246. {{thisendTime(item.endTime)}}到期
  247. </view>
  248. </view>
  249. </view>
  250. <p>点击可<span style="color:red">取消</span>使用<span style="color:#00b962">“服务费折扣卡”</span></p>
  251. </view>
  252. </view>
  253. <view class="botton">
  254. <view style=" display: flex;
  255. justify-content: center;">
  256. <u-checkbox-group >
  257. <u-checkbox
  258. active-color="green" shape="circle"
  259. v-model="contractSignTime"
  260. >我已阅读并同意</u-checkbox><span style="color: rgba(0, 185, 98, 1);" @click="gotoUrl('pages/article/details?code=YHXY')">《优电联盟用户使用协议》</span>
  261. </u-checkbox-group>
  262. </view>
  263. <button class="bottonBtn" @click="submit">开始充电</button>
  264. </view>
  265. <u-modal v-model="showmodal2" confirm-text="知道了" title="充电说明">
  266. <view style="padding: 10px;font-size: 32rpx;">
  267. 1.最终结算金额将以实际充入电量为准;<br />
  268. 2.充满自停模式需要您的余额不低于10元才可充电;<br />
  269. 3.充电金额请输入1元~500元的整数。实际充电金额与所选金额会略有出入(一般误差约几分钱);<br />
  270. 4.完成充电后,在满足条件的情况下,优惠券自动抵扣;提前结束充电则不使用优惠券并返还至您的卡包。<br />
  271. 5.先付后退模式,无法享受平台会员的服务费折扣、优惠券等优惠活动。<br />
  272. </view>
  273. </u-modal>
  274. <!-- <view class="but-box" style="margin-bottom: 20px;">
  275. <u-button
  276. style=" background-color: rgba(0, 185, 98, 100);
  277. color: rgba(255, 255, 255, 100);
  278. font-size: 16px;
  279. text-align: center;"
  280. @click="submit" shape="circle">开始充电</u-button>
  281. </view> -->
  282. <u-modal v-model="showmodal" :show-cancel-button="true" title="余额不足" confirm-text="前往充值"
  283. content="账户余额不足,充值成功后开始充电" @confirm="show=true"></u-modal>
  284. <u-popup v-model="companyCarSelectBl" :closeable="true" mode="bottom" border-radius="30">
  285. <view class="indexData5content">
  286. <view class="contentTitle">
  287. 选择充电车辆
  288. </view>
  289. <view
  290. v-if="companyPaySelect&&(companyPaySelect.carList&&companyPaySelect.carList.length==0||companyPaySelect.carList==null)"
  291. style=" text-align: center;">
  292. <img src="@/assets/static/img/暂无数据-缺省页.png" alt="">
  293. <p class="oldTextjp2">未分配车辆,请联系管理员</p>
  294. </view>
  295. <scroll-view v-else scroll-y="true" style="height: 520rpx;">
  296. <view style="padding-bottom: 30rpx;">
  297. <u-radio-group v-model="companyPaySelect.car" size="42">
  298. <view class="contentbody">
  299. <view v-for="(item,index) in companyPaySelect.carList"
  300. @click="companyPaySelect.car=(item.carNum),companyCarSelectBl = false;"
  301. class="contentItem" :key="index">
  302. <view class="span1">{{item.carNum}}</view>
  303. <view class="span2">
  304. <span v-show="!item.vin" style="color:#fff">aaa</span>
  305. <img v-show="item.vin" style="vertical-align: bottom;" width="20"
  306. src="@/assets/img/riLine-link-m.png" />
  307. <span v-show="item.vin" style="color:#999999 ">已关联Vin码</span>
  308. </view>
  309. <view class="span3">
  310. <u-radio style=" overflow: inherit;"
  311. @change="companyPaySelect.car=(item.carNum),companyCarSelectBl = false;"
  312. :name="item.carNum">
  313. <span style="color:#fff">.</span>
  314. </u-radio>
  315. </view>
  316. </view>
  317. </view>
  318. </u-radio-group>
  319. </view>
  320. </scroll-view>
  321. </view>
  322. </u-popup>
  323. <!-- 弹窗2 -->
  324. <!-- 弹窗 -->
  325. <template>
  326. <view>
  327. <u-popup v-model="show" mode="bottom">
  328. <view class="recharge recharge2" style="padding-bottom: 0;">
  329. <view class="title lefttitle ">选择充值金额
  330. <span class=" rightspan">当前余额
  331. <span style="color: red;">{{user.balance>0?user.balance.toFixed(2):'0.00'}}元</span>
  332. </span>
  333. </view>
  334. <view class="rechargeMain">
  335. <template v-for="(item,index) in moneyList_f">
  336. <view class="tip-box" v-if="index==4&&userChargingAmountObj.type">
  337. <template v-if="userChargingAmountObj.type==1">
  338. 新用户参与充值送折扣卡活动推荐充值<span>1000元</span>,预计可省 <span> 133元</span>。
  339. </template>
  340. <template v-else-if="userChargingAmountObj.type==2">
  341. 按您每月充电花费,半年将超<span>{{userChargingAmountObj.money}}元</span>,参与充值送折扣卡活动推荐充值 <span>{{userChargingAmountMethod(userChargingAmountObj).num1}}元</span>,预计可省 <span>{{userChargingAmountMethod(userChargingAmountObj).num3}}元</span>。
  342. </template>
  343. <template v-else>
  344. 近半年您已花费<span>{{userChargingAmountObj.money}}元</span>充电,参与充值送折扣卡活动推荐充值 <span> {{userChargingAmountMethod(userChargingAmountObj).num1}}元</span>,预计可省 <span> {{userChargingAmountMethod(userChargingAmountObj).num3}}元</span>。
  345. </template>
  346. </view>
  347. <view class="recharge-item"
  348. :class="{
  349. active:otherNum_f==item.rechargeAmount||moneyActiveClass_f == item.id ,
  350. 'recharge-item-rk':item.amountRemark
  351. }"
  352. :key="item.id" @click="moneyClick_f(item.id,item)">
  353. {{item.amountDesc?item.amountDesc:item.rechargeAmount+'元'}}
  354. <view class="item-rk" v-if="item.amountRemark">送<span class="item-rk-span" >{{item.amountRemarkNum}}</span>折卡</view>
  355. </view>
  356. </template>
  357. <p style=" font-size: 14px;" v-show="selectItem.amountRemark">
  358. 充值满
  359. <span style="color: #ff8600;">{{selectItem.amountDesc}}</span>立送服务费<span style="color: #ff8600;">{{selectItem.amountRemarkNum}}折半年卡</span>1张(<span style="color: #ff8600;">有效期180天,不限充电度数</span>)<span v-if="selectItem.amountRemarkSf">和{{selectItem.amountRemarkSf}}身份</span>,可省约<span style="color: #ff8600;">{{userChargingAmountMethod({
  360. money:selectItem.rechargeAmount
  361. }).num3}}元</span>。活动所充金额仅用于支付本平台充电费用(含电费和服务费),不可转赠、提现、退款,
  362. <span style="color: #ff8600;margin-left: 16px;" @click="gotoUrl('pages/temporary/activity20250501?source=99')">点击查看活动详情</span>
  363. </p>
  364. </view>
  365. <p class="oldTextjp2" oldstyle="font-size:16px">其他充值金额</p>
  366. <view style="margin-bottom: 32px;">
  367. <view :class="otherNum_f&&selectItem.rechargeAmount!=otherNum_f? 'active' : ''" class="recharge-input self-stop"
  368. style="height: 100%;width: 100%;margin-bottom: 8px;">
  369. <ujp-input v-model="otherNum_f" @input="ckInput_f" @focus="focus" type="digit"
  370. :border="true" />
  371. </view>
  372. <view style="color: rgba(153, 153, 153, 100);
  373. font-size: 12px;
  374. text-align: left;
  375. font-family: AlibabaPuHui-regular;"><span style="color:red">*</span>金额范围为1元-500元</view>
  376. </view>
  377. <view class="recharge-btn transactionClass" style="margin-top: 60px;">
  378. <view>
  379. <u-checkbox-group>
  380. <u-checkbox
  381. active-color="green" v-model="checked" shape="circle"></u-checkbox>
  382. </u-checkbox-group>
  383. 我已阅读并同意<span @click="gotoUrl('pages/article/details?code=CZXY')"
  384. style="color:#00B962">《充值协议》</span>
  385. </view>
  386. <u-button class="success-btn" shape="circle" type="success" @click="rechargeNow"
  387. style="margin-top: 12px;margin-bottom: 16px;">
  388. <span>微信充值</span>
  389. </u-button>
  390. </view>
  391. </view>
  392. </u-popup>
  393. </view>
  394. </template>
  395. <u-modal v-model="contractSignTimeBl"
  396. :show-confirm-button="true" :show-title="false" :show-cancel-button="true" confirm-color="rgba(0, 185, 98, 1)"
  397. cancel-text="放弃充电" confirm-text="同意并充电" @confirm="contractSignTimeSubmit()"
  398. >
  399. <view class="slot-content" style="padding:40rpx; text-align: center;margin-top: 10rpx;">
  400. 我已阅读并同意<br/>
  401. <span style="color: rgba(0, 185, 98, 1);" @click="gotoUrl('pages/article/details?code=YHXY')">《优电联盟用户使用协议》</span>
  402. </view>
  403. </u-modal>
  404. <uMessage ref="uMessage" :stationId="stationId" :deviceNo="submitForm.deviceNo" :channelNo="submitForm.channelNo" ></uMessage>
  405. <quickRegistration v-if="personInfo.userType == '1'" @login="loginMethod" :carNum="carNumber" ></quickRegistration>
  406. </view>
  407. </template>
  408. <script>
  409. import uMessage from '@/components/UMessage.vue'
  410. import * as API from '@/apis/chargeProcess.js'
  411. import * as API_index from '@/apis/index.js'
  412. import * as userApi from '@/apis/user.js'
  413. import * as newsApi from '@/apis/news.js'
  414. import * as API_finance from '@/apis/finance.js'
  415. import {
  416. wxPayJs
  417. } from '@/utils/wxpay'
  418. import {
  419. newDate,daysDistance
  420. } from '@/utils'
  421. import * as Pay from '@/apis/weixin.js'
  422. // import { contentStore } from 'core/core.model'
  423. import quickRegistration from '@/components/QuickRegistration.vue'
  424. export default {
  425. components: {
  426. quickRegistration,uMessage
  427. },
  428. data() {
  429. return {
  430. userChargingAmountObj:{
  431. },
  432. fee: 0,
  433. recordId: "",
  434. show2: false,
  435. stationId: "",
  436. elderMode: false,
  437. isback: true,
  438. show: false,
  439. moneyActiveClass_n: "50",
  440. moneyActiveClass: "-1",
  441. moneyActiveClass_f: "-1",
  442. contractSignTime:"",
  443. contractSignTimeBl:false,
  444. detail: {},
  445. couponsuse: '',
  446. showmodal: false,
  447. showmodal2: false,
  448. //提交信息
  449. //提交信息
  450. submitForm_f: {
  451. //paytype:'YE',
  452. },
  453. submitForm: {
  454. deviceNo: '',
  455. channelNo: '',
  456. carNumber: '',
  457. chargeStrategy: 2,
  458. amount: 0
  459. //paytype:'YE',
  460. },
  461. uuid: 0,
  462. user: {},
  463. companyCarSelectBl: false,
  464. companyList: [
  465. ],
  466. companyPaySelect: {
  467. id: "",
  468. car: "aaa"
  469. },
  470. otherNum_f: '',
  471. otherNum: '',
  472. moneyList_f: [],
  473. paySelect: true,
  474. payName: "",
  475. payValueTemp: 0,
  476. payValue: 0,
  477. payList: [{
  478. name: "先付后退",
  479. tips: "游客不享受平台优惠活动",
  480. value: "1",
  481. select: false,
  482. }, {
  483. name: "个人账户支付",
  484. tips: "可使用折扣卡、优惠券、折扣卷等",
  485. value: "2",
  486. select: false,
  487. }, {
  488. name: "单位账户支付",
  489. tips: "账户余额:99999元",
  490. value: "3",
  491. select: false,
  492. }, {
  493. name: "充电金",
  494. tips: "账户余额:99999元",
  495. value: "4",
  496. select: false,
  497. }, {
  498. name: "充电金",
  499. tips: "账户余额:99999元",
  500. value: "4",
  501. select: false,
  502. }],
  503. moneyList: [
  504. {
  505. id: '10',
  506. name: '10'
  507. },
  508. {
  509. id: '20',
  510. name: '20'
  511. },
  512. {
  513. id: '50',
  514. name: '50'
  515. },
  516. {
  517. id: '100',
  518. name: '100'
  519. },
  520. ],
  521. moneyListN: [{
  522. id: '10',
  523. name: '10元'
  524. },
  525. {
  526. id: '20',
  527. name: '20元'
  528. },
  529. {
  530. id: '50',
  531. name: '50元'
  532. }
  533. ],
  534. userCard: null,
  535. canUse: false,
  536. selectObj: {},
  537. value: "",
  538. // 优惠券
  539. listlength: 0,
  540. vin: true,
  541. bannerList: [],
  542. checked: true,
  543. selectItem: {},
  544. personInfo: {},
  545. carNumber: "",
  546. show3: false,
  547. cardList:[],
  548. startMode:"",
  549. paySelectMethodValue:1,
  550. chargingFundsBl:false,
  551. id:""
  552. }
  553. },
  554. computed: {
  555. userCardBool() {
  556. if (this.userCard) {
  557. var date = new Date().getTime()
  558. var reg = new RegExp('-', 'gi')
  559. var str = this.userCard.endTime;
  560. //console.log(str.replace(reg,'/'))
  561. var date2 = new Date(str.replace(reg, '/')).getTime();
  562. if (date < date2) {
  563. return true;
  564. }
  565. }
  566. return false
  567. }
  568. },
  569. onLoad(op) {
  570. if(op.startMode){
  571. this.startMode=op.startMode
  572. }
  573. if(op.id){
  574. this.id=op.id
  575. }
  576. this.uuid = new Date().getTime();
  577. this.stationId = op.stationId;
  578. if (op.deviceNo) {
  579. this.submitForm.deviceNo = op.deviceNo;
  580. this.submitForm.channelNo = op.gun;
  581. this.carNumber = op.carNumber;
  582. this.submitForm.carNumber = op.carNumber;
  583. this.carhelp.setGunIdCharge(this.submitForm);
  584. }
  585. if (op.vin == 'no') {
  586. this.vin = false;
  587. }
  588. if (op.isback) {
  589. this.isback = false;
  590. }
  591. this.useCoupon()
  592. var couponsuse = "充电结束后满足金额即可生效,提前结束充电则优惠券不生效并返回"
  593. // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  594. if (couponsuse) {
  595. this.couponsuse = couponsuse
  596. }
  597. this.init()
  598. },
  599. onReady() {
  600. this.getBannerInfo("charge-start")
  601. this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
  602. if (this.elderMode)
  603. this.theme('elder')
  604. else
  605. this.theme('standard')
  606. this.loginMethod()
  607. //this.uMessageShow()
  608. },
  609. onShow() {
  610. this.personInfo = this.carhelp.getPersonInfo()
  611. var obj = this.carhelp.get("chooseCoupons");
  612. if (obj) {
  613. if (obj.uuid == this.uuid) {
  614. this.selectObj = obj.selectObj;
  615. }
  616. }
  617. this.getHomePage()
  618. },
  619. methods: {
  620. uMessageShow(){
  621. this.$refs.uMessage.bShow()
  622. },
  623. userCardBtn(item){
  624. if(this.userCard&&this.userCard.id==item.id){
  625. this.userCard=null
  626. uni.showToast({
  627. title: "已经取消选中"
  628. })
  629. }else{
  630. this.userCard=item
  631. }
  632. },
  633. carDet(t) {
  634. if(this.submitForm.carNumber){
  635. return
  636. }
  637. this.onShowRole = true
  638. var url="/pages/user/car/carDet?jpcode=jp_team51_charge_id:A_" + this.id
  639. uni.navigateTo({
  640. url: url
  641. })
  642. },
  643. loginMethod(form){
  644. this.personInfo = this.carhelp.getPersonInfo()
  645. // if(plus){
  646. // this.userCard=plus.userCard;
  647. // }
  648. if (this.personInfo && this.personInfo.userType == "1") {
  649. this.show3 = true
  650. }
  651. this.personInfo = this.carhelp.getPersonInfo()
  652. if (this.personInfo.userType == "1") {
  653. this.payValueTemp = 0;
  654. this.payValue = 0;
  655. } else {
  656. this.payValueTemp = 1;
  657. var payValueDefault = this.carhelp.get("payValueDefault");
  658. if(this.user&&this.user.chargingFunds>0){
  659. payValueDefault="4"
  660. }
  661. this.payValue = 1;
  662. if (payValueDefault == "1" || payValueDefault == "0") {
  663. this.payValue = payValueDefault;
  664. }
  665. if (payValueDefault == "1" || payValueDefault == "4") {
  666. this.paySelectMethodValue = payValueDefault;
  667. this.payValue = payValueDefault;
  668. }
  669. if(payValueDefault==4){
  670. this.chargingFundsBl=true;
  671. }
  672. }
  673. this.payName = this.payList[this.payValue].name;
  674. this.useCoupon()
  675. if(form){
  676. this.submitForm.carNumber=form.carNumber
  677. }
  678. },
  679. thisdaysDistance(endTime){
  680. var date=new Date()
  681. var date2=newDate(endTime);
  682. return daysDistance(date,date2)
  683. },
  684. getChargeList() {
  685. uni.showLoading({
  686. title: "加载中",
  687. mask: true,
  688. })
  689. API_index.personCardList({
  690. }).then((res) => {
  691. uni.hideLoading();
  692. this.cardList=res.data.cardList
  693. }).catch(error => {
  694. uni.showToast({
  695. title: error,
  696. icon: "none"
  697. })
  698. })
  699. },
  700. gotoLogin() {
  701. this.onShowRole = true
  702. if (false) {
  703. } else {
  704. uni.navigateTo({
  705. url: "/pages/login/login?jpcode=jp_team51_charge_id:A_" + this.submitForm.deviceNo
  706. })
  707. }
  708. },
  709. paySelectShow() {
  710. if (this.personInfo.userType == "1") {
  711. } else {
  712. this.show = true;
  713. this.recordId = '';
  714. // this.otherNum_f = '';
  715. //this.fee = 0
  716. }
  717. },
  718. //companyPaySelect
  719. paySelectCompany() {
  720. },
  721. paySelectMethod(value, company) {
  722. console.log(value)
  723. if (this.personInfo.userType == "1") {
  724. uni.showToast({
  725. title: "游客模式只支持“先付后退”"
  726. })
  727. } else {
  728. this.payValue = value
  729. if (value == 2) {
  730. this.companyPaySelect = company
  731. if (company.carList && company.carList.length == 1) {
  732. //this.companyPaySelect=entRegList[0]
  733. this.companyPaySelect.car = company.carList[0].carNum;
  734. }
  735. }
  736. this.$forceUpdate()
  737. }
  738. },
  739. moneyClick_f(id, item) {
  740. this.otherNum_f = item.rechargeAmount;
  741. this.moneyActiveClass_f = id;
  742. if (item) {
  743. this.selectItem = item;
  744. // if(item.imgUrl){
  745. // this.selectImg=item
  746. // }
  747. }
  748. },
  749. rechargeNow2() {
  750. //先付后退
  751. this.submitForm_f = {};
  752. var fee = 0;
  753. this.submitForm_f.amount = this.fee;
  754. uni.showLoading({
  755. title: "加载中",
  756. mask: true,
  757. })
  758. if (this.recordId) {
  759. this.submitForm_f.recordId = this.recordId
  760. }
  761. //(this.submitForm)
  762. this.wxpy()
  763. },
  764. rechargeNow() {
  765. if (!this.checked) {
  766. uni.showToast({
  767. title: "请同意《充值协议》后进行充值"
  768. })
  769. return
  770. }
  771. if(!this.otherNum_f){
  772. uni.showToast({
  773. title:"请选择充值金额"
  774. })
  775. return
  776. }
  777. this.submitForm_f = {};
  778. var fee = 0;
  779. if (this.moneyActiveClass_f) {
  780. this.submitForm_f.chargingMarketingId = this.selectItem.id;
  781. fee = this.selectItem.rechargeAmount
  782. } else {
  783. this.submitForm_f.amount = this.otherNum_f
  784. fee = this.otherNum_f
  785. }
  786. if (this.fee) {
  787. var thisfee = this.fee
  788. if (this.fee > parseFloat(fee)) {
  789. uni.showToast({
  790. title: `最少充值${thisfee}元才能启动充电`
  791. })
  792. return
  793. }
  794. }
  795. uni.showLoading({
  796. title: "加载中",
  797. mask: true,
  798. })
  799. if (this.recordId) {
  800. this.submitForm_f.recordId = this.recordId
  801. }
  802. //(this.submitForm)
  803. this.wxpy()
  804. },
  805. wxpy() {
  806. var obj = {
  807. ...this.submitForm_f
  808. }
  809. if (obj.amount) {
  810. for (var i in this.moneyList_f) {
  811. var item = this.moneyList_f[i]
  812. if (item.rechargeAmount == obj.amount) {
  813. delete obj.amount;
  814. obj.chargingMarketingId = item.id
  815. break
  816. }
  817. }
  818. }
  819. Pay.wxpay(obj).then((response) => {
  820. if (!response.result) {
  821. uni.showToast({
  822. title: response.message
  823. })
  824. return
  825. }
  826. var data = response.data
  827. uni.hideLoading()
  828. //("Pay+"+new Date().getTime())
  829. wxPayJs(data);
  830. }).catch(error => {
  831. uni.showToast({
  832. title: error
  833. })
  834. })
  835. },
  836. focus() {
  837. console.log(0)
  838. uni.pageScrollTo({
  839. scrollTop: 999999,
  840. duration: 0
  841. })
  842. },
  843. init() {
  844. var data = {
  845. type: 2,
  846. };
  847. API_finance.marketingData(data).then((res) => {
  848. this.moneyList_f = res.data.chargingMarketingList
  849. if (this.moneyList_f.length > 0) {
  850. this.selectItem = this.moneyList_f[0];
  851. this.moneyActiveClass_f = this.moneyList_f[0].id
  852. //(this.moneyActiveClass)
  853. this.moneyClick_f( this.moneyList_f[0].id,this.moneyList_f[0])
  854. }
  855. for(var i in this.moneyList_f){
  856. var item =this.moneyList_f[i]
  857. console.log(item.rechargeAmount)
  858. if(item.rechargeAmount==100){
  859. // this.selectItem = this.moneyList[i];
  860. // this.moneyActiveClass = this.moneyList[i].id
  861. this.moneyClick_f(item.id,item)
  862. }
  863. if(item.amountRemark&&item.marketingCardList.length){
  864. var mk=item.marketingCardList[0]
  865. item.amountRemarkNum=mk.serviceFeeDiscountRate/10
  866. item.amountRemarkHtml=item.amountRemark.substring(item.amountRemark.indexOf('折'))
  867. item.amountRemarkSf=mk.giftMemberLevelStr
  868. }
  869. }
  870. var list = res.data.priceList
  871. if (list.length) {
  872. this.moneyListN = [];
  873. for (var i in list) {
  874. this.moneyListN.push({
  875. id: list[i],
  876. name: list[i] + "元"
  877. })
  878. }
  879. this.moneyActiveClass_n = list[0]
  880. }
  881. this.init1()
  882. }).catch(error => {
  883. uni.showToast({
  884. title: error
  885. })
  886. })
  887. },
  888. init1() {
  889. API_index.userChargingAmount().then((res) => {
  890. this.userChargingAmountObj = res.data
  891. //this.userChargingAmountObj.type=1
  892. }).catch(error => {
  893. })
  894. },
  895. clickBanner(index) {
  896. var mod = this.bannerList[index]
  897. if (mod.linkUrl.indexOf('http') == 0) {
  898. window.location = mod.linkUrl;
  899. } else if (mod.linkUrl.indexOf('#/') == 0) {
  900. if (mod.linkUrl.indexOf("?") == -1) {
  901. mod.linkUrl += '?';
  902. }
  903. //window.location=mod.linkUrl;
  904. var url = mod.linkUrl.split("#")[1]
  905. //window.location = mod.clickUrl;
  906. uni.navigateTo({
  907. url: url
  908. })
  909. } else if (mod.linkUrl == '#' || mod.linkUrl == '') {
  910. } else {
  911. uni.navigateTo({
  912. url: mod.linkUrl
  913. })
  914. }
  915. },
  916. getBannerInfo(code) {
  917. newsApi.getBannerInfo(code).then((res) => {
  918. this.bannerList = res.data;
  919. // document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 300px;"
  920. }).catch(error => {
  921. uni.showToast({
  922. title: error,
  923. icon: "none"
  924. })
  925. })
  926. },
  927. getPile() {
  928. },
  929. theme(type) {
  930. if (type == 'elder') {
  931. document.getElementsByTagName('body')[0].setAttribute('data-theme', type);
  932. } else {
  933. document.getElementsByTagName('body')[0].setAttribute('data-theme', type);
  934. }
  935. },
  936. chooseCoupons() {
  937. this.submitInit()
  938. this.gotoUrl('pages/user/coupon/chooseCoupons?uuid=' + this.uuid + "&amount=" + this.submitForm.amount +
  939. "&stationId=" + this.stationId)
  940. },
  941. ckInput_f(text) {
  942. if (text.indexOf('.') > 0) {
  943. var k = text.split(".")[1]
  944. if (k.length >= 3) {
  945. this.$nextTick(() => {
  946. text = parseFloat(text).toFixed(2);
  947. this.otherNum_f = text
  948. })
  949. }
  950. }
  951. var t = Number(text);
  952. if (t < 1) {
  953. this.$nextTick(() => {
  954. this.otherNum_f = '';
  955. })
  956. }
  957. if (t > 500) {
  958. this.$nextTick(() => {
  959. this.otherNum_f = 500;
  960. })
  961. }
  962. this.moneyActiveClass_f=''
  963. for(var i in this.moneyList_f){
  964. var item=this.moneyList_f[i]
  965. if(this.otherNum_f==item.rechargeAmount){
  966. this.moneyClick_f(item.id,item)
  967. }
  968. }
  969. },
  970. ckInput(text) {
  971. if (text.indexOf('.') > 0) {
  972. this.$nextTick(() => {
  973. this.otherNum = text.substring(0, text.indexOf('.'))
  974. uni.showToast({
  975. title: "请输入正整数"
  976. })
  977. })
  978. }
  979. var t = Number(text);
  980. if (t < 1) {
  981. this.$nextTick(() => {
  982. this.otherNum = '';
  983. })
  984. }
  985. if (t > 500) {
  986. this.$nextTick(() => {
  987. this.otherNum = 500;
  988. })
  989. }
  990. this.selectJudge();
  991. },
  992. moneyClick(index) {
  993. this.otherNum = ''
  994. this.moneyActiveClass = index;
  995. this.selectJudge();
  996. },
  997. selectJudge() {
  998. this.submitInit()
  999. if (this.submitForm.amount == 0) {
  1000. return
  1001. }
  1002. if (this.selectObj.id && this.selectObj.threshold > this.submitForm.amount) {
  1003. uni.showToast({
  1004. title: "请重新选择优惠券"
  1005. })
  1006. this.selectObj = {}
  1007. }
  1008. },
  1009. radioChange(e) {},
  1010. confirm() {
  1011. ////(JSON.stringify(this.submitForm))
  1012. if (this.payValue == 1) {
  1013. if (this.selectObj.id) {
  1014. this.submitForm.userCouponId = this.selectObj.id
  1015. }
  1016. if (this.userCardBool && this.canUse && this.vin) {
  1017. this.submitForm.userCardId = this.userCard.id
  1018. }
  1019. } else {
  1020. this.submitForm.userCouponId = ""
  1021. this.submitForm.userCardId = ""
  1022. }
  1023. if (this.payValue == 2) {
  1024. if (!this.companyPaySelect.car) {
  1025. uni.showToast({
  1026. title: '请选择充车辆'
  1027. })
  1028. return
  1029. }
  1030. this.submitForm.vipUserId = this.companyPaySelect.vipUser.id;
  1031. this.submitForm.carNumber = this.companyPaySelect.car;
  1032. } else {
  1033. this.submitForm.carNumber = this.carNumber;
  1034. this.submitForm.vipUserId = ""
  1035. }
  1036. uni.showLoading({
  1037. title: "加载中",
  1038. mask: true,
  1039. })
  1040. this.carhelp.set("payValueDefault", this.payValue);
  1041. if (this.payValue == 2) {
  1042. this.carhelp.set("payValueDefault3", {
  1043. carNumber: this.companyPaySelect.car,
  1044. companyId: this.companyPaySelect.enterpriseAccount.id,
  1045. });
  1046. }
  1047. if(this.startMode){
  1048. this.submitForm.startMode=this.startMode; //判断充电入口
  1049. }
  1050. //this.submitForm.deviceNo = this.detail.deviceNo;
  1051. API.startCarCharging(this.submitForm).then((res) => {
  1052. //(JSON.stringify(this.res))
  1053. if(res.data.status == "4"){
  1054. this.uMessageShow()
  1055. }else if (res.data.status == "5") {
  1056. uni.hideLoading()
  1057. if (this.submitForm.payType == "1") {
  1058. this.recordId = res.data.recordId;
  1059. this.fee = res.data.fee;
  1060. this.rechargeNow2() //先付后退
  1061. } else {
  1062. if (this.payValue == 2) {
  1063. uni.showToast({
  1064. title: "余额不足,请联系企业单位人员"
  1065. })
  1066. } else {
  1067. this.showmodal = true;
  1068. this.recordId = res.data.recordId;
  1069. var fee = res.data.fee;
  1070. this.fee = (fee - this.user.balance).toFixed(2);
  1071. this.otherNum_f = this.fee;
  1072. }
  1073. }
  1074. } else {
  1075. this.gotoUrl("pages/searchPile/chargeProcess/dcCharging?id=" + res.data.recordId);
  1076. }
  1077. }).catch((error)=> {
  1078. uni.hideLoading()
  1079. if (error == '用户账户余额不足!') {
  1080. } else {
  1081. uni.showToast({
  1082. title: error
  1083. })
  1084. }
  1085. })
  1086. },
  1087. thisendTime(endTime){
  1088. if(endTime){
  1089. var reg=new RegExp('-','gi')
  1090. var str=endTime.substring(0,10).replace(reg,'.')
  1091. return str
  1092. }
  1093. return ''
  1094. },
  1095. getHomePage() {
  1096. uni.showLoading({
  1097. title: "加载中",
  1098. mask: true,
  1099. })
  1100. API.userCard({
  1101. stationId: this.stationId
  1102. }).then((res) => {
  1103. this.userCard = res.data.regUserCard
  1104. this.canUse = res.data.canUse
  1105. //this.user = res.data
  1106. API.personalCenter({
  1107. stationId: this.stationId
  1108. }).then((res2) => {
  1109. this.user = res2.data
  1110. this.contractSignTime=res2.data.regUser.contractSignTime
  1111. if(this.user.chargingFunds){
  1112. this.chargingFundsBl=true;
  1113. }
  1114. var entRegList = res2.data.entRegList;
  1115. this.companyList = []
  1116. for (var i in entRegList) {
  1117. var item = entRegList[i]
  1118. if (item.enterpriseAccount) {
  1119. this.companyList.push(item)
  1120. }
  1121. }
  1122. this.isReady = true;
  1123. uni.hideLoading()
  1124. var payValueDefault = this.carhelp.get("payValueDefault");
  1125. if (payValueDefault == "2") {
  1126. var payValueDefault3 = this.carhelp.get("payValueDefault3");
  1127. for (var i in this.companyList) {
  1128. var item = this.companyList[i]
  1129. if (item.enterpriseAccount.id == payValueDefault3.companyId) {
  1130. this.companyPaySelect = item;
  1131. for (var j in item.carList) {
  1132. var car = item.carList[j]
  1133. if (car.carNum == payValueDefault3.carNumber) {
  1134. this.companyPaySelect.car = payValueDefault3.carNumber;
  1135. this.payValue = payValueDefault;
  1136. }
  1137. }
  1138. }
  1139. }
  1140. }
  1141. this.getChargeList()
  1142. this.loginMethod()
  1143. }).catch(error => {
  1144. uni.showToast({
  1145. title: error
  1146. })
  1147. })
  1148. }).catch(error => {
  1149. uni.showToast({
  1150. title: error
  1151. })
  1152. })
  1153. },
  1154. useCoupon() {
  1155. var obj = {
  1156. status: 0,
  1157. stationId: this.stationId,
  1158. hideCardCoupon: 1
  1159. }
  1160. if (this.userCardBool) {
  1161. obj.userCardId = this.userCard.id
  1162. }
  1163. userApi.couponList(obj).then((res) => {
  1164. this.listlength = res.data.recordsTotal;
  1165. }).catch(error => {
  1166. uni.showToast({
  1167. title: error
  1168. })
  1169. })
  1170. },
  1171. submitInit() {
  1172. if (this.moneyActiveClass == -1 && !this.otherNum) {
  1173. this.submitForm.chargeStrategy = 0;
  1174. this.submitForm.amount = 0
  1175. } else {
  1176. this.submitForm.chargeStrategy = 2;
  1177. if (this.otherNum) {
  1178. this.submitForm.amount = this.otherNum
  1179. } else {
  1180. this.submitForm.amount = this.moneyActiveClass
  1181. }
  1182. }
  1183. },
  1184. contractSignTimeSubmit(){
  1185. this.contractSignTime=true;
  1186. this.submit()
  1187. },
  1188. updateContractSignTime(){
  1189. if(this.user&&this.user.regUser&&!this.user.regUser.contractSignTime){
  1190. API.updateContractSignTime({
  1191. openId:this.carhelp.getOpenId()
  1192. }).then((res) => {
  1193. }).catch(error => {
  1194. uni.showToast({
  1195. title: error
  1196. })
  1197. })
  1198. }
  1199. },
  1200. submit() {
  1201. if(!this.contractSignTime){
  1202. this.contractSignTimeBl=true;
  1203. return
  1204. }
  1205. if (!this.submitForm.channelNo) {
  1206. uni.showToast({
  1207. title: '请先选择充电通道'
  1208. })
  1209. return
  1210. }
  1211. this.submitForm.payType = this.payList[this.payValue].value;
  1212. if (this.submitForm.payType == "1") {
  1213. this.submitForm.amount = this.moneyActiveClass_n
  1214. this.submitForm.chargeStrategy = 2;
  1215. } else {
  1216. this.submitInit()
  1217. }
  1218. this.updateContractSignTime()
  1219. this.confirm()
  1220. },
  1221. }
  1222. }
  1223. </script>
  1224. <style>
  1225. page {
  1226. background-color: #fff;
  1227. }
  1228. </style>
  1229. <style lang="scss" scoped>
  1230. .exchange {
  1231. margin-right: 32rpx;
  1232. color: rgba(119, 119, 119, 100);
  1233. //font-size: 24rpx;
  1234. font-size: 32rpx;
  1235. //margin-right: 6rpx;
  1236. }
  1237. .rightspan {
  1238. float: right;
  1239. }
  1240. .indexData5content {
  1241. padding: 40rpx 40rpx;
  1242. .contentTitle {
  1243. color: #333333;
  1244. font-size: 40rpx;
  1245. font-weight: bold;
  1246. margin-bottom: 16rpx;
  1247. }
  1248. .contentbody {
  1249. width: 100%;
  1250. display: block;
  1251. .contentItem {
  1252. border-bottom: 1px solid #ededed;
  1253. padding: 12rpx 0;
  1254. font-size: 32rpx;
  1255. display: flex;
  1256. width: 100%;
  1257. .span1 {
  1258. padding-top: 8rpx;
  1259. width: 50%;
  1260. }
  1261. .span2 {
  1262. padding-top: 8rpx;
  1263. width: 35%;
  1264. }
  1265. .span3 {
  1266. padding-top: 8rpx;
  1267. padding-left: 8rpx;
  1268. width: 10%;
  1269. }
  1270. }
  1271. }
  1272. }
  1273. .textinfo {
  1274. padding: 40rpx;
  1275. font-size: 24rpx !important;
  1276. color: #999999;
  1277. p {
  1278. font-size: 32rpx !important;
  1279. color: #101010;
  1280. font-weight: bold;
  1281. }
  1282. }
  1283. .lefttitle {
  1284. font-weight: bold;
  1285. font-size: 32rpx
  1286. }
  1287. @import "@/_theme.scss";
  1288. .listlength {
  1289. float: right;
  1290. padding-right: 20rpx;
  1291. }
  1292. ::v-deep .u-drawer-content {
  1293. border-radius: 10px 10px 0 0
  1294. }
  1295. ::v-deep .u-radio-group {
  1296. width: 100%;
  1297. }
  1298. ::v-deep .u-radio {
  1299. position: relative;
  1300. }
  1301. ::v-deep .u-radio__icon-wrap {
  1302. position: absolute;
  1303. right: 0;
  1304. }
  1305. .recharge-item2 {
  1306. @include themeify {
  1307. font-size: themed('font-size2') !important;
  1308. }
  1309. /* font-size: 14px !important;*/
  1310. color: #999999;
  1311. }
  1312. .paySelect {
  1313. padding: 32rpx;
  1314. .title {
  1315. font-size: 40rpx
  1316. }
  1317. p {
  1318. width: 100%;
  1319. span {
  1320. color: #666;
  1321. }
  1322. .u-radio__label {
  1323. color: #333333;
  1324. }
  1325. .u-radio {
  1326. width: 100% !important;
  1327. ;
  1328. }
  1329. color: #333333;
  1330. margin-top: 16rpx;
  1331. font-size:32rpx;
  1332. }
  1333. }
  1334. .recharge {
  1335. padding: 32rpx;
  1336. padding-bottom: 250rpx;
  1337. .title {
  1338. @include themeify {
  1339. font-size: themed('font-size3');
  1340. }
  1341. /* font-size: 16px;*/
  1342. position: relative;
  1343. }
  1344. p {
  1345. color: #666;
  1346. margin-top: 4px;
  1347. }
  1348. .self-stop.active {
  1349. background-color: #EFFFF7;
  1350. border-color: #00B962;
  1351. color: #00B962;
  1352. }
  1353. .rechargeMain {
  1354. display: flex;
  1355. flex-wrap: wrap;
  1356. // justify-content: space-between;
  1357. margin-top: 24rpx;
  1358. margin-bottom: 10rpx;
  1359. .recharge-item {
  1360. .u-input {
  1361. text-align: center !important;
  1362. }
  1363. width: 31%;
  1364. border: 1px solid #e3e3e3;
  1365. padding: 20rpx 0;
  1366. border-radius: 4px;
  1367. text-align: center;
  1368. margin-bottom: 20rpx;
  1369. position: relative;
  1370. margin-left: 10rpx;
  1371. @include themeify {
  1372. font-size: themed('font-size3');
  1373. }
  1374. /* font-size: 16px;*/
  1375. }
  1376. .active {
  1377. background-color: #EFFFF7;
  1378. border-color: #00B962;
  1379. color: #00B962;
  1380. }
  1381. }
  1382. .self-stop {
  1383. width: 105px;
  1384. /* height: 48px;
  1385. line-height: 48px;*/
  1386. border-radius: 4px;
  1387. color: #101010;
  1388. @include themeify {
  1389. font-size: themed('font-size3');
  1390. // height: themed('font-size19');
  1391. // line-height: themed('font-size19')
  1392. }
  1393. /* font-size: 16px;*/
  1394. text-align: center;
  1395. font-family: Arial;
  1396. border: 1px solid rgba(227, 227, 227, 100);
  1397. margin-top: 12px;
  1398. }
  1399. }
  1400. .recharge2 {
  1401. padding: 32rpx;
  1402. padding-bottom: 250rpx;
  1403. .title {
  1404. @include themeify {
  1405. font-size: themed('font-size3');
  1406. }
  1407. /* font-size: 16px;*/
  1408. position: relative;
  1409. }
  1410. p {
  1411. color: #666;
  1412. margin-top: 4px;
  1413. }
  1414. .self-stop.active {
  1415. background-color: #EFFFF7;
  1416. border-color: #00B962;
  1417. color: #00B962;
  1418. }
  1419. .rechargeMain {
  1420. display: flex;
  1421. flex-wrap: wrap;
  1422. // justify-content: space-between;
  1423. margin-top: 24rpx;
  1424. margin-bottom: 10rpx;
  1425. .recharge-item {
  1426. .u-input {
  1427. text-align: center !important;
  1428. }
  1429. width: 23%;
  1430. border: 1px solid #e3e3e3;
  1431. padding: 20rpx 0;
  1432. border-radius: 4px;
  1433. text-align: center;
  1434. margin-bottom: 20rpx;
  1435. position: relative;
  1436. margin-left: 10rpx;
  1437. @include themeify {
  1438. font-size: themed('font-size3');
  1439. }
  1440. /* font-size: 16px;*/
  1441. }
  1442. .recharge-item-rk{
  1443. width: 23%;
  1444. padding-bottom: 0;
  1445. padding-top: 10rpx;
  1446. .item-rk{
  1447. //margin-top: 10rpx;
  1448. padding: 8rpx 0;
  1449. //background-color: rgba(232, 232, 232, 1);
  1450. color: rgba(51, 51, 51, 1);
  1451. font-size: 24rpx;
  1452. }
  1453. .item-rk-span{
  1454. margin:0 4px ;
  1455. color: #ec4530;
  1456. }
  1457. }
  1458. .active {
  1459. background-color: #EFFFF7;
  1460. border-color: #00B962;
  1461. color: #00B962;
  1462. .item-rk{
  1463. //background-color: #53B56B;
  1464. color:#53B56B
  1465. }
  1466. .item-rk-span{
  1467. color: #53B56B
  1468. }
  1469. }
  1470. }
  1471. .self-stop {
  1472. width: 105px;
  1473. /* height: 48px;
  1474. line-height: 48px;*/
  1475. border-radius: 4px;
  1476. color: #101010;
  1477. @include themeify {
  1478. font-size: themed('font-size3');
  1479. // height: themed('font-size19');
  1480. // line-height: themed('font-size19')
  1481. }
  1482. /* font-size: 16px;*/
  1483. text-align: center;
  1484. font-family: Arial;
  1485. border: 1px solid rgba(227, 227, 227, 100);
  1486. margin-top: 12px;
  1487. }
  1488. }
  1489. .recharge-input {
  1490. margin-top: 8px;
  1491. margin-bottom: 32px;
  1492. }
  1493. .recharge-radio {
  1494. margin-top: 10px;
  1495. .recharge-radio-item {
  1496. display: flex;
  1497. align-items: center;
  1498. }
  1499. .recharge-radio-name {
  1500. margin-left: 8px;
  1501. }
  1502. }
  1503. .but-box {
  1504. width: 89.3%;
  1505. height: 44px;
  1506. margin: 0 auto;
  1507. position: fixed;
  1508. bottom: 0;
  1509. right: 0;
  1510. left: 0;
  1511. }
  1512. //优惠券
  1513. .discounts {
  1514. margin-top: 10px;
  1515. width: 100%;
  1516. .title {
  1517. width: 100%;
  1518. .title-1 {
  1519. /* height: 22px;*/
  1520. color: rgba(16, 16, 16, 100);
  1521. @include themeify {
  1522. font-size: themed('font-size3');
  1523. height: themed('font-size6');
  1524. }
  1525. /* font-size: 16px;*/
  1526. }
  1527. .title-2 {
  1528. margin-left: 4px;
  1529. @include themeify {
  1530. font-size: themed('font-size2');
  1531. line-height: themed('font-size5');
  1532. }
  1533. /* font-size: 14px;
  1534. line-height: 20px;*/
  1535. }
  1536. .title-3 {
  1537. float: right;
  1538. @include themeify {
  1539. font-size: themed('font-size3');
  1540. line-height: themed('font-size5');
  1541. }
  1542. /* height: 19px;
  1543. font-size: 16px;*/
  1544. }
  1545. }
  1546. .select {
  1547. position: relative;
  1548. ::v-deep .u-radio {
  1549. padding: 36rpx 32rpx;
  1550. margin-top: 12px;
  1551. width: 100%;
  1552. height: 48px;
  1553. border-radius: 4px;
  1554. background-color: rgba(255, 255, 255, 100);
  1555. text-align: center;
  1556. border: 1px solid rgba(227, 227, 227, 100);
  1557. position: relative;
  1558. }
  1559. // ::v-deep .u-radio:nth-child(3) {
  1560. //
  1561. // }
  1562. ::v-deep .u-radio__icon-wrap {
  1563. left: 32rpx;
  1564. background-color: #fff;
  1565. }
  1566. ::v-deep .u-radio__label {
  1567. margin-left: 40px;
  1568. }
  1569. }
  1570. .explain {
  1571. width: 64px;
  1572. /* height: 24px;
  1573. line-height: 24px;*/
  1574. position: absolute;
  1575. top: 10px;
  1576. right: 12px;
  1577. border-radius: 4px;
  1578. background-color: rgba(255, 255, 255, 100);
  1579. text-align: center;
  1580. border: 1px solid rgba(227, 227, 227, 100);
  1581. color: rgba(0, 185, 98, 100);
  1582. /* font-size: 12px;*/
  1583. @include themeify {
  1584. font-size: themed('font-size1');
  1585. line-height: themed('font-size7');
  1586. height: themed('font-size7');
  1587. }
  1588. }
  1589. }
  1590. // 优惠券2
  1591. .discounts2 {
  1592. margin-top: 10px;
  1593. width: 100%;
  1594. display: flex;
  1595. justify-content: space-between;
  1596. .left {
  1597. /* width: 70px;*/
  1598. // height: 20px;
  1599. color: rgba(16, 16, 16, 100);
  1600. /* font-size: 20px;*/
  1601. @include themeify {
  1602. width: 160rpx;
  1603. font-size: 40rpx;
  1604. }
  1605. }
  1606. .right {
  1607. /*
  1608. height: 16px;
  1609. line-height: 28px;*/
  1610. color: rgba(255, 61, 0, 100);
  1611. @include themeify {
  1612. font-size: themed('font-size3');
  1613. height: themed('font-size3');
  1614. line-height: themed('font-size9');
  1615. }
  1616. /* font-size: 16px;*/
  1617. text-align: right;
  1618. display: flex;
  1619. }
  1620. .iconfont {
  1621. @include themeify {
  1622. font-size: themed('font-size7');
  1623. line-height: themed('font-size10');
  1624. }
  1625. /* line-height: 29px;*/
  1626. text-align: center;
  1627. color: #b3b3b3;
  1628. /* font-size: 24px;*/
  1629. }
  1630. }
  1631. // 会员活动
  1632. .member {
  1633. margin-top: 24rpx;
  1634. display: flex;
  1635. justify-content: space-between;
  1636. flex-wrap: wrap;
  1637. align-items: center;
  1638. .actively {
  1639. color: rgba(119, 119, 119, 1);
  1640. font-size: 36rpx;
  1641. }
  1642. .type,
  1643. .right {
  1644. color: rgba(16, 18, 18, 100);
  1645. font-size: 36rpx;
  1646. //line-height: 28px;
  1647. padding-right: 10px;
  1648. display: flex;
  1649. align-items: center;
  1650. }
  1651. .iconfont {
  1652. @include themeify {
  1653. font-size: themed('font-size7');
  1654. line-height: themed('font-size10');
  1655. }
  1656. /* line-height: 29px;*/
  1657. text-align: center;
  1658. color: #b3b3b3;
  1659. /* font-size: 24px;*/
  1660. }
  1661. }
  1662. // 尾部
  1663. .botton {
  1664. border: 1px solid rgba(242, 242, 242, 1);
  1665. background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 1) 100%);
  1666. position: fixed;
  1667. //background: #fff;
  1668. width: 100%;
  1669. padding: 24rpx 40rpx;
  1670. line-height: 88rpx;
  1671. bottom: 0;
  1672. left: 0;
  1673. z-index: 999;
  1674. //padding: 0px 32rpx 32rpx;
  1675. padding-bottom: 12px;
  1676. button {
  1677. display: flex;
  1678. align-items: center;
  1679. justify-content: center;
  1680. //width: 45.8%;
  1681. // background-color: black;
  1682. // color: #fff;
  1683. // background-color: rgba(255, 255, 255, 1);
  1684. // color: rgba(0, 185, 98, 1);
  1685. background-color: rgba(0, 185, 98, 100);
  1686. color: rgba(255, 255, 255, 100);
  1687. height: 88rpx;
  1688. border-radius: 50px;
  1689. font-size: 32rpx;
  1690. }
  1691. }
  1692. .couponsuse {
  1693. color: rgba(153, 153, 153, 100);
  1694. margin-top: 10px;
  1695. font-size: 14px;
  1696. text-align: left;
  1697. font-family: AlibabaPuHui-regular;
  1698. }
  1699. .to-recharge {
  1700. padding: 0 16px;
  1701. line-height: 36px;
  1702. border-radius: 50px 0px 0px 50px;
  1703. background: linear-gradient(#FF9000, #FFB700);
  1704. color: rgba(255, 255, 255, 100);
  1705. font-size: 16px;
  1706. text-align: center;
  1707. position: absolute;
  1708. right: -16px;
  1709. top: 0;
  1710. }
  1711. // ::v-deep .u-checkbox__icon-wrap--checked {
  1712. // background-color: #2979ff !important;
  1713. // border-color: #2979ff !important;
  1714. // }
  1715. .amount {
  1716. // width: 41.9%;
  1717. height: 16px;
  1718. line-height: 15px;
  1719. border-radius: 0px 4px 0px 4px;
  1720. background-color: #ec4530; //rgba(0, 185, 98, 100)
  1721. color: rgba(255, 255, 255, 100);
  1722. font-size: 10px;
  1723. text-align: center;
  1724. position: absolute;
  1725. top: 0;
  1726. right: 0;
  1727. }
  1728. .card {
  1729. overflow: hidden;
  1730. padding: 10px;
  1731. margin-top: 10px;
  1732. .title {
  1733. font-weight: bold;
  1734. }
  1735. }
  1736. .cardselect {
  1737. border-radius: 8px;
  1738. border: 2px solid rgba(0, 185, 98, 1);
  1739. .title {
  1740. color: #00B962;
  1741. font-weight: bold;
  1742. }
  1743. .cardgo {
  1744. position: relative;
  1745. .cardinfo {
  1746. background-color: #00b962;
  1747. width: 64rpx;
  1748. height: 64rpx;
  1749. position: absolute;
  1750. top: -12px;
  1751. right: -12px;
  1752. border-radius: 0 0 0 8px;
  1753. img {
  1754. width: 64rpx;
  1755. }
  1756. }
  1757. }
  1758. }
  1759. .cardno {
  1760. border: 2px solid rgba(204, 204, 204, 1);
  1761. border-radius: 8px;
  1762. .title {
  1763. font-weight: bold;
  1764. }
  1765. .cardgo {
  1766. position: relative;
  1767. .cardinfo {
  1768. background-color: rgba(204, 204, 204, 1);
  1769. width: 64rpx;
  1770. height: 64rpx;
  1771. position: absolute;
  1772. top: -12px;
  1773. right: -12px;
  1774. border-radius: 0 0 0 8px;
  1775. img {
  1776. width: 64rpx;
  1777. }
  1778. }
  1779. }
  1780. }
  1781. .classtable {
  1782. margin: 40rpx 40rpx;
  1783. .td1 {
  1784. width: 50rpx;
  1785. padding: 12rpx 0;
  1786. text-align: center;
  1787. img {
  1788. width: 48rpx;
  1789. height: 48rpx;
  1790. }
  1791. font-size: 10px;
  1792. }
  1793. .td2 {
  1794. padding-left: 16rpx;
  1795. font-size: 12px;
  1796. line-height: 24px;
  1797. .dian {
  1798. padding: 0 10rpx
  1799. }
  1800. }
  1801. }
  1802. .carImg {
  1803. margin: 0 40rpx;
  1804. img {
  1805. width: 100%;
  1806. }
  1807. }
  1808. .cardListView{
  1809. .cardListItemTitle{
  1810. color: #777777;
  1811. font-size: 36rpx;
  1812. }
  1813. .cardListItem{
  1814. // margin:5px 4px;
  1815. //border: 1px solid ;
  1816. border: 2px solid #cccccc;
  1817. // border: 2px solid #cccccc;
  1818. // border-radius: 8px;
  1819. // padding: 3px;
  1820. border-radius: 6px;
  1821. .cardListName{
  1822. font-size: 34rpx;
  1823. }
  1824. .cardListText{
  1825. font-size: 24rpx;
  1826. display:flex;
  1827. justify-content: space-between;
  1828. }
  1829. }
  1830. .cardselect{
  1831. border: 2px solid #00b962;
  1832. background-color: #fff ;
  1833. color: #00b962;
  1834. }
  1835. }
  1836. .rechargeBalance{
  1837. display: flex;
  1838. .rechargeBalanceItem{
  1839. margin-right: 6px;
  1840. color: #666;
  1841. }
  1842. }
  1843. .greyTips{
  1844. background-color: #cccccc;
  1845. // color: #00b962;
  1846. font-weight: bold;
  1847. padding: 30rpx;
  1848. margin-top: 20rpx;
  1849. border-radius: 8px;
  1850. }
  1851. .cost-explain2{
  1852. .type{
  1853. color: #FF3D00;
  1854. }
  1855. }
  1856. .tip-box {
  1857. position: relative;
  1858. background-color: #FEF8E9;
  1859. border: 1px solid #f5a623;
  1860. border-radius: 8px;
  1861. padding: 10px 15px;
  1862. color: #333;
  1863. width: 400px;
  1864. margin-bottom: 36rpx;
  1865. }
  1866. .tip-box::before,
  1867. .tip-box::after {
  1868. content: "";
  1869. position: absolute;
  1870. top: 100%;
  1871. left: 20px;
  1872. border-left: 10px solid transparent;
  1873. border-right: 10px solid transparent;
  1874. }
  1875. .tip-box::before {
  1876. border-top: 10px solid #f5a623; /* 与提示框边框颜色一致 */
  1877. margin-top: 1px;
  1878. }
  1879. .tip-box::after {
  1880. border-top: 10px solid #FEF8E9; /* 白色填充 */
  1881. margin-top: 0;
  1882. transform: translateY(-1px);
  1883. }
  1884. .tip-box span {
  1885. color: #ec4530;
  1886. font-weight: bold;
  1887. }
  1888. </style>