charge.vue 51 KB

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