charge.vue 52 KB

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