charge.vue 49 KB

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