charge.vue 49 KB

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