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