123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779 |
- <template>
- <view>
- <ujp-navbar title="开始充电" :is-back="isback" >
- <view class="exchange " slot="right" @click="showmodal2=true">充电说明</view>
- </ujp-navbar>
-
- <view class="carImg" v-if="personInfo&&personInfo.userType!=2" >
- <img @click="gotoLogin" src="@/assets/img/gologin/img.png">
-
- </view>
- <view v-else>
- <!-- 优惠 -->
- <view class="discounts" style="padding:0 36rpx;" v-if="bannerList.length">
- <u-swiper bg-color="#fff" mode="none" :img-mode="'scaleToFill'" height="160" :list="bannerList" @click="clickBanner"
- :name="'picUrl'">
- </u-swiper>
- </view>
- </view>
-
-
-
- <view class="recharge" >
-
-
- <view class="title">
- <view class="left lefttitle">
- 请选择支付方式和充电金额
- </view>
- <!-- <view class="to-recharge" @click="show=true,recordId='',otherNum_f='',fee=0">
- 去充值
- </view> -->
- </view>
- <view class="card"
- @click="payValue=0"
- :class="{
- cardselect:payValue==0,
- cardno:payValue!=0
- }">
- <view class="cardgo" >
- <view class="cardinfo">
- <img
- src="@/assets/img/riFill-check-fill.svg" alt="">
-
- </view>
- </view>
- <view class="title">先付后退</view>
- <p>充电结束后,余额自动退还;不享受<span style="color:#ff3d00;">会员充电折扣、平台各类优惠券</span>等福利</p>
- <view class="rechargeMain" v-show="payValue==0">
-
- <view class="recharge-item" @click="moneyActiveClass_n=(item.id)"
- :class="moneyActiveClass_n == item.id ? 'active' : ''" v-for="(item,index) in moneyListN"
- :key="item.id">
- {{item.name}}
- </view>
-
-
- </view>
-
- </view>
-
-
-
- <view class="card"
- @click="paySelectMethod(1)"
- :class="{
- cardselect:payValue==1,
- cardno:payValue!=1
- }">
- <view class="cardgo" >
- <view class="cardinfo">
-
- <img
- src="@/assets/img/riFill-check-fill.svg" alt="">
-
- </view>
- </view>
- <view class="title">会员账户余额充电</view>
-
- <p>当前余额{{user.balance>0?user.balance.toFixed(2):'0.00'}}元
- <span
- @click="paySelectShow()"
- style="color:#00B962;margin-left: 20px; ">去充值></span>
-
- </p>
- <view class="rechargeMain" v-show="payValue==1">
- <view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''" class=" recharge-item ">
- 充满自停
- </view>
- <view class="recharge-item" @click="moneyClick(item.id)"
- :class="!otherNum&&moneyActiveClass == item.id ? 'active' : ''" v-for="(item,index) in moneyList"
- :key="item.id">
- {{item.name}}元
- </view>
- <view class="recharge-item recharge-item2" :class="otherNum ? 'active' : ''" style="
- padding: 1px 0px;">
- <ujp-input v-model="otherNum" @input="ckInput" @focus="focus" type="digit" placeholder="其他金额" />
-
- </view>
-
- </view>
-
- </view>
-
-
- <view class="card" v-for="(companyItem,i) in companyList" :key="i"
- @click="paySelectMethod(2,companyItem)"
- :class="{
- cardselect:(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id),
- cardno:!(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)
- }">
- <view class="cardgo" >
- <view class="cardinfo">
-
- <img
- src="@/assets/img/riFill-check-fill.svg" alt="">
-
- </view>
- </view>
- <view class="title">{{companyItem.enterpriseAccount.entName}}账户余额充电</view>
-
- <p>余额{{companyItem.enterpriseAccount.totalAmount>0?companyItem.enterpriseAccount.totalAmount.toFixed(2):'0.00'}}元
- <span v-show="(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)"
- @click="companyCarSelectBl=true"
- style="color:#00B962;margin-left: 40rpx; ">{{companyPaySelect.car?companyPaySelect.car+'(更换)':'选择充电车辆>'}}</span>
-
- <span style="margin-left: 40rpx; "
-
- v-show="(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)" ></span>
-
- </p>
- <view class="rechargeMain" v-show="(payValue==2&&companyItem.enterpriseAccount.id==companyPaySelect.enterpriseAccount.id)" >
- <view @click="moneyClick(-1)" :class="!otherNum&&moneyActiveClass == -1? 'active' : ''" class=" recharge-item ">
- 充满自停
- </view>
-
- <view class="recharge-item recharge-item2" :class="otherNum ? 'active' : ''" style="
- padding: 1px 0px;">
- <ujp-input v-model="otherNum" @input="ckInput" @focus="focus" type="digit" placeholder="其他金额" />
-
- </view>
-
- </view>
-
- </view>
- <!-- 优惠券2 -->
-
-
- <view class="member">
- <view class="actively">
- 优惠券
- </view>
-
- <view class="right" v-if="payValue=='0'">
- 先付后退不享受会员优惠活动
-
- </view>
- <view class="right" v-else-if="payValue=='2'">
- 企业单位用户不可使用优惠券
- </view>
- <view class="right" @click="chooseCoupons" v-else-if="selectObj.id">
- {{selectObj.threshold == 0 ? '无门槛' : '满'+selectObj.threshold.toFixed(2)+'元可用'}},
-
- <span class="price" v-if="selectObj.classify == '1'||selectObj.classify == '3'">抵扣{{selectObj.value.toFixed(2)}}元</span>
- <span class="price" v-if="selectObj.classify == '2'">服务费{{selectObj.value}}折</span>
-
- <view class="iconfont"></view>
- </view>
- <view class="right" @click="chooseCoupons" v-else-if="listlength">
- 未选择,剩余{{listlength}}张优惠券
- <view class="iconfont"></view>
- </view>
- <view class="right" @click="chooseCoupons" v-else>
- 无优惠券
- <view class="iconfont"></view>
- </view>
-
- </view>
-
-
- <!-- 会员活动 -->
- <view class="member" >
- <view class="actively ">
- 会员活动
- </view>
- <view class="type" v-if="payValue=='0'">
- 先付后退不享受会员优惠活动
-
- </view>
- <view class="type" v-else-if="payValue=='2'">
- 企业单位用户不享受会员优惠活动
- </view>
-
- <template v-else-if="userCardBool" >
-
- <view class="type" v-if="!vin" style="color: red;" >
- vin码不一致
- </view>
- <view class="type" v-else-if="canUse">
- {{userCard.classify==1?'折扣卡':''}}
- {{userCard.classify==2?'服务费6折卡':''}}
- </view>
- <view class="type" style="color: red;" v-else>
- 此充电站不支持{{userCard.classify==1?'折扣卡':''}}
- {{userCard.classify==2?'服务费6折卡':''}}
- </view>
- </template>
- <template v-else >
- <view class="type" style="color:#999999" @click="gotoUrl('pages/discountCard/productDetails')" >
- 尚未购买服务费6折卡<view class="iconfont"></view>
- </view>
- </template>
-
- </view>
-
-
- </view>
- <view class="botton">
- <button class="bottonBtn"
- @click="submit"
- >开始充电</button>
-
- </view>
-
- <u-modal v-model="showmodal2"
- confirm-text="知道了"
- title="充电说明" >
-
-
- <view style="padding: 10px;font-size: 32rpx;">
- 1.最终结算金额将以实际充入电量为准;<br/>
- 2.充满自停模式需要您的余额不低于10元才可充电;<br/>
- 3.充电金额请输入1元~500元的整数。实际充电金额与所选金额会略有出入(一般误差约几分钱);<br/>
- 4.完成充电后,在满足条件的情况下,优惠券自动抵扣;提前结束充电则不使用优惠券并返还至您的卡包。<br/>
-
- 5.先付后退模式,无法享受平台会员的服务费折扣、优惠券等优惠活动。<br/>
- </view>
-
-
- </u-modal>
-
-
-
- <!-- <view class="but-box" style="margin-bottom: 20px;">
- <u-button
- style=" background-color: rgba(0, 185, 98, 100);
- color: rgba(255, 255, 255, 100);
- font-size: 16px;
- text-align: center;"
-
- @click="submit" shape="circle">开始充电</u-button>
- </view> -->
-
-
-
- <u-modal v-model="showmodal"
- :show-cancel-button="true"
- title="余额不足" confirm-text="前往充值"
- content="账户余额不足,充值成功后开始充电" @confirm="show=true"></u-modal>
- <u-popup
- v-model="companyCarSelectBl" :closeable="true"
- mode="bottom" border-radius="30" >
-
- <view class="indexData5content">
- <view class="contentTitle">
- 选择充电车辆
- </view>
- <view v-if="companyPaySelect&&(companyPaySelect.carList&&companyPaySelect.carList.length==0||companyPaySelect.carList==null)" style=" text-align: center;" >
- <img src="static/img/暂无数据-缺省页.png" alt="">
- <p class="oldTextjp2" >未分配车辆,请联系管理员</p>
- </view>
- <scroll-view v-else scroll-y="true" style="height: 520rpx;">
-
- <view style="padding-bottom: 30rpx;" >
- <u-radio-group v-model="companyPaySelect.car" size="42">
- <view class="contentbody">
- <view v-for="(item,index) in companyPaySelect.carList"
- @click="companyPaySelect.car=(item.carNum),companyCarSelectBl = false;"
- class="contentItem" :key="index" >
- <view class="span1">{{item.carNum}}</view>
- <view class="span2" >
- <span v-show="!item.vin" style="color:#fff" >aaa</span>
- <img v-show="item.vin" style="vertical-align: bottom;" width="20" src="@/assets/img/riLine-link-m.png"/>
- <span v-show="item.vin" style="color:#999999 " >已关联Vin码</span>
-
- </view>
-
- <view class="span3">
-
- <u-radio style=" overflow: inherit;"
- @change="companyPaySelect.car=(item.carNum),companyCarSelectBl = false;" :name="item.carNum">
- <span style="color:#fff">.</span>
- </u-radio>
- </view>
- </view>
- </view>
- </u-radio-group>
- </view>
-
- </scroll-view>
-
- </view>
-
- </u-popup>
- <!-- 弹窗2 -->
- <template >
- <view >
- <u-popup v-model="paySelect" mode="bottom" >
- <view class="paySelect">
- <view class="title lefttitle " >选择支付方式</view>
- <u-radio-group v-model="payValueTemp">
- <p >
- <u-radio
- name="0"
- active-color="#2979f6" shape="circle" size="48">
- <p >{{payList[0].name}}<span>({{payList[0].tips}})</span> </p>
- </u-radio>
- </p>
- <p v-if="personInfo&&personInfo.userType=='2'" >
- <u-radio
- name="1"
-
- active-color="#2979f6" shape="circle" size="48">
- <p >{{payList[1].name}}<span>({{payList[1].tips}})</span> </p>
- </u-radio>
- </p>
- <p v-if="false" >
- <u-radio
- name="2"
- active-color="#2979f6" shape="circle" size="48">
- <p >{{payList[2].name}}<span>(其他充值金额)</span> </p>
-
- </u-radio>
- </p>
- </u-radio-group>
- </view>
-
- <view class="recharge" style="padding-bottom: 0;">
-
-
- <view class="recharge-btn transactionClass" style="margin-top: 60px;">
-
-
- <u-button
- class="success-btn" @click="paySelectMethod(1)"
- shape="circle" type="success" style="margin-top: 12px;margin-bottom: 16px;">
- <span>确定</span>
- </u-button>
- </view>
- </view>
- </u-popup>
-
- </view>
- </template>
- <!-- 弹窗 -->
- <template >
- <view >
- <u-popup v-model="show" mode="bottom" >
- <view class="recharge" style="padding-bottom: 0;">
- <view class="title lefttitle " >选择充值金额
- <span class=" rightspan" >当前余额
- <span style="color: red;" >{{user.balance>0?user.balance.toFixed(2):'0.00'}}元</span>
- </span>
- </view>
- <p style="color: red; font-size: 28rpx;" v-show="selectItem.amountRemark">{{selectItem.amountRemark}}代金券,退余额时将扣除已使用的优惠券金额</p>
-
- <view class="rechargeMain">
- <view class="recharge-item" :class="!otherNum_f&&moneyActiveClass_f == item.id ? 'active' : ''"
- v-for="(item,index) in moneyList_f" :key="item.id" @click="moneyClick_f(item.id,item)">
- {{item.amountDesc?item.amountDesc:item.rechargeAmount+'元'}}
- <view class="amount" v-if="item.amountRemark">{{item.amountRemark}}</view>
- </view>
-
- </view>
- <p class="oldTextjp2" oldstyle="font-size:16px">其他充值金额</p>
- <view style="margin-bottom: 32px;">
-
- <view
-
- :class="otherNum_f? 'active' : ''"
- class="recharge-input self-stop" style="height: 100%;width: 100%;margin-bottom: 8px;">
- <ujp-input v-model="otherNum_f" @input="ckInput_f" @focus="focus" type="digit" :border="true" />
-
-
- </view>
- <view style="color: rgba(153, 153, 153, 100);
- font-size: 12px;
- text-align: left;
- font-family: AlibabaPuHui-regular;"><span style="color:red">*</span>金额范围为1元-500元</view>
-
- </view>
-
- <view class="recharge-btn transactionClass" style="margin-top: 60px;">
- <view >
- <u-checkbox-group>
- <u-checkbox active-color="green" v-model="checked" shape="circle"></u-checkbox>
- </u-checkbox-group>
- 我已阅读并同意<span @click="gotoUrl('pages/article/details?code=CZXY')" style="color:#00B962" >《充值协议》</span>
-
- </view>
-
- <u-button
- class="success-btn"
- shape="circle" type="success" @click="rechargeNow" style="margin-top: 12px;margin-bottom: 16px;">
- <span>微信充值</span>
- </u-button>
- </view>
- </view>
- </u-popup>
-
- </view>
- </template>
- </view>
- </template>
- <script>
- import * as API from '@/apis/chargeProcess.js'
- import * as userApi from '@/apis/user.js'
- import * as newsApi from '@/apis/news.js'
- import * as API_finance from '@/apis/finance.js'
- import {
- wxPayJs
- } from '@/utils/wxpay'
- import * as Pay from '@/apis/weixin.js'
-
-
- export default {
- data() {
- return {
- fee:0,
- recordId:"",
- show2:false,
- stationId:"",
- elderMode:false,
- isback:true,
- show: false,
- moneyActiveClass_n: "50",
- moneyActiveClass: "-1",
- moneyActiveClass_f: "-1",
- detail: {},
- couponsuse:'',
- showmodal:false,
- showmodal2:false,
- //提交信息
- //提交信息
- submitForm_f: {
-
- //paytype:'YE',
- },
- submitForm: {
- deviceNo: '',
- channelNo: '',
- carNumber: '',
- chargeStrategy: 2,
- amount: 0
- //paytype:'YE',
- },
- uuid:0,
- user: {},
- companyCarSelectBl:false,
- companyList:[
-
- ],
- companyPaySelect:{
- id:"",
- car:"aaa"
- },
- otherNum_f: '',
- otherNum: '',
- moneyList_f:[],
- paySelect:false,
- payName:"",
- payValueTemp:0,
- payValue:0,
- payList:[{
- name:"先付后退",
- tips:"游客不享受平台优惠活动",
- value:"1",
- select:false,
- },{
- name:"个人账户支付",
- tips:"可使用折扣卡、优惠券、折扣卷等",
- value:"2",
- select:false,
- },{
- name:"单位账户支付",
- tips:"账户余额:99999元",
- value:"3",
- select:false,
- }],
- moneyList: [
-
- {
- id: '10',
- name: '10'
- },
- {
- id: '20',
- name: '20'
- },
- {
- id: '50',
- name: '50'
- },
- {
- id: '100',
- name: '100'
- },
- ],
- moneyListN: [
- {
- id: '10',
- name: '10元'
- },
- {
- id: '20',
- name: '20元'
- },
- {
- id: '50',
- name: '50元'
- }
- ],
- userCard:null,
- canUse:false,
- selectObj:{},
- value:"",
- // 优惠券
- listlength:0,
- vin:true,
- bannerList:[],
- checked:true,
- selectItem:{},
- personInfo:{},
- carNumber:"",
- show3:false,
- }
- },
- computed:{
- userCardBool(){
- if(this.userCard){
- var date=new Date().getTime()
- var reg=new RegExp('-','gi')
- var str=this.userCard.endTime;
- //console.log(str.replace(reg,'/'))
- var date2=new Date(str.replace(reg,'/')).getTime();
- if(date<date2){
- return true;
- }
- }
- return false
- }
- },
- onLoad(op) {
-
- this.personInfo=this.carhelp.getPersonInfo()
- // if(plus){
- // this.userCard=plus.userCard;
- // }
- if(this.personInfo&&this.personInfo.userType=="1"){
- this.show3=true
- }
-
- this.uuid=new Date().getTime();
- this.stationId= op.stationId;
- if (op.deviceNo) {
-
- this.submitForm.deviceNo = op.deviceNo;
- this.submitForm.channelNo = op.gun;
- this.carNumber=op.carNumber;
- this.submitForm.carNumber = op.carNumber;
- this.carhelp.setGunIdCharge(this.submitForm);
- }
- if(op.vin=='no'){
- this.vin=false;
- }
- if(op.isback){
- this.isback=false;
- }
- this.useCoupon()
-
- var couponsuse=this.carhelp.getConfig().couponsuse
- // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
- if(couponsuse){
- this.couponsuse=couponsuse
- }
- this.init()
- },
- onReady(){
- this.personInfo=this.carhelp.getPersonInfo()
- if(this.personInfo.userType=="1"){
- this.payValueTemp=0;
- this.payValue=0;
- }else{
- this.payValueTemp=1;
-
- var payValueDefault=this.carhelp.get("payValueDefault");
-
- this.payValue=1;
- if(payValueDefault=="1"||payValueDefault=="0"){
- this.payValue=payValueDefault;
- }
-
- }
- this.payName=this.payList[this.payValue].name;
-
- this.getBannerInfo("charge-start")
-
- this.elderMode = this.carhelp.get('getElderModeClass') == '长辈模式';
- if(this.elderMode)
- this.theme('elder')
- else
- this.theme('standard')
- },
- onShow() {
- this.personInfo=this.carhelp.getPersonInfo()
-
- var obj=this.carhelp.get("chooseCoupons");
- if(obj){
- if(obj.uuid==this.uuid){
- this.selectObj=obj.selectObj;
- }
- }
-
- this.getHomePage()
- },
- methods: {
- gotoLogin(){
- this.onShowRole = true
- if(false){
-
- }else{
- uni.navigateTo({
- url: "/pages/login/login?jpcode=jp_team51_charge_id:A_" + this.submitForm.deviceNo
- })
- }
-
- },
- paySelectShow(){
- if(this.personInfo.userType=="1"){
-
- }else{
- this.show=true;
- this.recordId='';
- this.otherNum_f='';
- this.fee=0
- }
-
- },
- //companyPaySelect
- paySelectCompany(){
-
- },
- paySelectMethod(value,company){
- if(this.personInfo.userType=="1"){
- uni.showToast({
- title:"游客模式只支持“先付后退”"
- })
- }else{
- this.payValue=value
- if(value==2){
-
- this.companyPaySelect=company
-
-
- if(company.carList&&company.carList.length==1){
- //this.companyPaySelect=entRegList[0]
-
- this.companyPaySelect.car=company.carList[0].carNum;
- }
- }
- }
- console.log(this.companyPaySelect)
-
- },
- moneyClick_f(index,item) {
- this.otherNum_f='';
- this.moneyActiveClass_f = index;
- if(item){
- this.selectItem=item;
- // if(item.imgUrl){
- // this.selectImg=item
- // }
- }
- },
- rechargeNow2() {
- //先付后退
-
-
- this.submitForm_f={};
- var fee=0;
- this.submitForm_f.amount=this.fee;
-
-
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- if(this.recordId){
- this.submitForm_f.recordId=this.recordId
-
-
- }
- //(this.submitForm)
- this.wxpy()
-
- },
- rechargeNow() {
- if(!this.checked){
- uni.showToast({
- title:"请同意《充值协议》后进行充值"
- })
- return
- }
-
- this.submitForm_f={};
- var fee=0;
- if(!this.otherNum_f){
- this.submitForm_f.chargingMarketingId=this.selectItem.id;
- fee=this.selectItem.rechargeAmount
- }else{
- this.submitForm_f.amount=this.otherNum_f
- fee=this.otherNum_f
- }
-
- if(this.fee){
- var thisfee=this.fee
- if(this.fee>parseFloat(fee)){
- uni.showToast({
- title:`最少充值${thisfee}元才能启动充电`
- })
- return
- }
- }
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
- if(this.recordId){
- this.submitForm_f.recordId=this.recordId
-
-
- }
- //(this.submitForm)
- this.wxpy()
-
- },
- wxpy(){
- var obj={
- ...this.submitForm_f
- }
- if(obj.amount){
-
- for(var i in this.moneyList_f){
- var item =this.moneyList_f[i]
- if(item.rechargeAmount==obj.amount){
-
- delete obj.amount;
-
- obj.chargingMarketingId=item.id
- break
- }
- }
- }
- Pay.wxpay(obj).then((response) => {
-
- if(!response.result){
- uni.showToast({
- title: response.message
- })
- return
- }
- var data = response.data
- uni.hideLoading()
- //("Pay+"+new Date().getTime())
- wxPayJs(data);
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
-
- })
- },
- focus(){
- console.log(0)
- uni.pageScrollTo({
- scrollTop:999999,
- duration:0
- })
- },
- init() {
-
-
-
-
- var data = {
- type:2 ,
- };
-
-
- API_finance.marketingData(data).then((res) => {
-
- this.moneyList_f = res.data.chargingMarketingList
- if (this.moneyList_f.length > 0) {
- this.selectItem = this.moneyList_f[0];
- this.moneyActiveClass_f = this.moneyList_f[0].id
- //(this.moneyActiveClass)
- }
-
- var list=res.data.priceList
- if(list.length){
- this.moneyListN=[];
- for(var i in list){
- this.moneyListN.push({
- id:list[i],
- name:list[i]+"元"
- })
- }
- this.moneyActiveClass_n=list[0]
- }
-
-
- }).catch(error => {
- uni.showToast({
-
- title: error
- })
- })
- },
- clickBanner(index){
- var mod= this.bannerList[index]
-
- if(mod.linkUrl.indexOf('http')==0){
- window.location=mod.linkUrl;
- }
- else if(mod.linkUrl.indexOf('#/')==0){
- if(mod.linkUrl.indexOf("?")==-1){
- mod.linkUrl+='?';
- }
- //window.location=mod.linkUrl;
- var url=mod.linkUrl.split("#")[1]
- //window.location = mod.clickUrl;
- uni.navigateTo({
- url: url
- })
- }
- else if(mod.linkUrl=='#'||mod.linkUrl==''){
-
- }
- else{
- uni.navigateTo({
- url:mod.linkUrl
- })
- }
-
- },
- getBannerInfo(code){
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- newsApi.getBannerInfo(code).then((res) => {
- uni.hideLoading();
- this.bannerList =res.data;
-
- // document.getElementsByClassName("uni-swiper-wrapper")[0].parentNode.style="background-color: rgb(255, 255, 255); height: 300px;"
- }).catch(error => {
- uni.showToast({
-
- title: error,icon: "none"
- })
- })
- },
-
- getPile(){
-
- },
- theme(type) {
-
- if(type == 'elder')
- {
- document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
-
- }
- else
- {
- document.getElementsByTagName('body')[0].setAttribute('data-theme',type);
-
-
- }
- },
- chooseCoupons(){
- this.submitInit()
-
- this.gotoUrl('pages/user/coupon/chooseCoupons?uuid='+this.uuid+"&amount="+this.submitForm.amount+"&stationId="+this.stationId)
-
- },
- ckInput_f(text) {
- if (text.indexOf('.') > 0) {
-
- var k =text.split(".")[1]
- if(k.length>=3){
- this.$nextTick(()=>{
- text=parseFloat(text).toFixed(2);
- this.otherNum_f= text
- })
- }
- }
- var t = Number(text);
- if (t < 1) {
- this.$nextTick(() => {
- this.otherNum_f = '';
- })
-
- }
- if (t > 500) {
- this.$nextTick(() => {
- this.otherNum_f = 500;
- })
-
- }
-
- },
- ckInput(text) {
- if (text.indexOf('.') > 0) {
- this.$nextTick(() => {
- this.otherNum = text.substring(0, text.indexOf('.'))
- uni.showToast({
- title: "请输入正整数"
- })
- })
- }
- var t = Number(text);
- if (t < 1) {
- this.$nextTick(() => {
- this.otherNum = '';
- })
-
- }
- if (t > 500) {
- this.$nextTick(() => {
- this.otherNum = 500;
- })
-
- }
-
- this.selectJudge();
- },
- moneyClick(index) {
- this.otherNum = ''
- this.moneyActiveClass = index;
- this.selectJudge();
- },
- selectJudge(){
- this.submitInit()
- if(this.submitForm.amount==0){
- return
- }
- if(this.selectObj.id&&this.selectObj.threshold>this.submitForm.amount){
- uni.showToast({
- title:"请重新选择优惠券"
- })
- this.selectObj={}
- }
- },
- radioChange(e){},
- confirm() {
- ////(JSON.stringify(this.submitForm))
- if(this.payValue==1){
- if(this.selectObj.id){
- this.submitForm.userCouponId=this.selectObj.id
- }
- if(this.userCardBool&&this.canUse&&this.vin){
- this.submitForm.userCardId=this.userCard.id
- }
- }else{
- this.submitForm.userCouponId=""
- this.submitForm.userCardId=""
- }
- if(this.payValue==2){
- if(!this.companyPaySelect.car){
- uni.showToast({
- title: '请选择充车辆'
- })
- return
- }
- this.submitForm.vipUserId=this.companyPaySelect.vipUser.id;
- this.submitForm.carNumber = this.companyPaySelect.car;
- }else{
- this.submitForm.carNumber = this.carNumber;
- this.submitForm.vipUserId=""
- }
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- this.carhelp.set("payValueDefault",this.payValue);
- if(this.payValue==2){
- this.carhelp.set("payValueDefault3",{
- carNumber:this.companyPaySelect.car,
- companyId:this.companyPaySelect.enterpriseAccount.id,
- });
- }
-
- //this.submitForm.deviceNo = this.detail.deviceNo;
- API.startCarCharging(this.submitForm).then((res) => {
- //(JSON.stringify(this.res))
-
-
- if(res.data.status=="5"){
-
- uni.hideLoading()
-
- if(this.submitForm.payType=="1"){
- this.recordId=res.data.recordId;
- this.fee=res.data.fee;
-
- this.rechargeNow2()//先付后退
- }else{
- if(this.payValue==2){
- uni.showToast({
- title: "余额不足,请联系企业单位人员"
- })
- }else{
- this.showmodal=true;
- this.recordId=res.data.recordId;
-
- var fee=res.data.fee;
-
-
- this.fee=(fee-this.user.balance).toFixed(2);
- this.otherNum_f=this.fee;
- }
-
- }
-
- }else{
-
- this.gotoUrl("pages/searchPile/chargeProcess/dcCharging?id=" + res.data.recordId);
-
-
- }
-
-
- }).catch(error => {
- uni.hideLoading()
- if (error == '用户账户余额不足!') {
-
- } else {
- uni.showToast({
- title: error
- })
- }
- })
- },
- getHomePage() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
-
-
-
- API.userCard({
- stationId:this.stationId
- }).then((res) => {
- console.log(res)
- this.userCard=res.data.regUserCard
- this.canUse=res.data.canUse
- //this.user = res.data
-
-
- API.personalCenter({
- stationId:this.stationId
- }).then((res2) => {
- this.user = res2.data
- var entRegList=res2.data.entRegList;
- this.companyList=[]
-
- for(var i in entRegList){
- var item=entRegList[i]
- if(item.enterpriseAccount){
- this.companyList.push(item)
- }
- }
-
-
- this.isReady = true;
- uni.hideLoading()
-
- var payValueDefault=this.carhelp.get("payValueDefault");
-
- if(payValueDefault=="2"){
- var payValueDefault3=this.carhelp.get("payValueDefault3");
-
-
- for(var i in this.companyList){
- var item=this.companyList[i]
- if(item.enterpriseAccount.id==payValueDefault3.companyId){
- this.companyPaySelect=item;
-
- for(var j in item.carList){
- var car=item.carList[j]
- if(car.carNum==payValueDefault3.carNumber){
- this.companyPaySelect.car=payValueDefault3.carNumber;
- this.payValue=payValueDefault;
- }
- }
-
- }
- }
- }
-
-
-
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
-
-
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- useCoupon(){
- var obj={
- status:0,
- stationId:this.stationId,
- hideCardCoupon:1
- }
- if(this.userCardBool) {
- obj.userCardId=this.userCard.id
- }
-
- userApi.couponList(obj).then((res) => {
-
- this.listlength= res.data.recordsTotal;
-
-
-
- //uni.hideLoading()
-
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- submitInit(){
-
-
- if (this.moneyActiveClass == -1 && !this.otherNum) {
- this.submitForm.chargeStrategy = 0;
- this.submitForm.amount = 0
- } else {
- this.submitForm.chargeStrategy = 2;
- if (this.otherNum) {
- this.submitForm.amount = this.otherNum
- } else {
- this.submitForm.amount = this.moneyActiveClass
- }
- }
-
-
- },
- submit() {
-
-
- if (!this.submitForm.channelNo) {
- uni.showToast({
- title: '请先选择充电通道'
- })
- return
- }
- this.submitForm.payType=this.payList[this.payValue].value;
- if(this.submitForm.payType=="1"){
- this.submitForm.amount = this.moneyActiveClass_n
- this.submitForm.chargeStrategy = 2;
- }else{
- this.submitInit()
- }
-
- this.confirm()
-
- },
- }
- }
- </script>
- <style>
- page {
- background-color: #fff;
- }
- </style>
- <style lang="scss" scoped>
-
-
-
- .exchange{
- margin-right: 32rpx;
- color: rgba(119, 119, 119, 100);
- //font-size: 24rpx;
- font-size: 32rpx;
- //margin-right: 6rpx;
- }
- .rightspan{
- float: right;
- }
- .indexData5content {
- padding: 40rpx 40rpx;
- .contentTitle{
- color:#333333;
- font-size: 40rpx;
-
- font-weight: bold;
- margin-bottom: 16rpx;
- }
- .contentbody{
-
- width: 100%;
- display: block;
-
- .contentItem{
- border-bottom: 1px solid #ededed;
- padding:12rpx 0;
- font-size: 32rpx;
- display: flex;
- width: 100%;
- .span1{
- padding-top:8rpx ;
- width: 50%;
- }
- .span2{
- padding-top:8rpx ;
- width: 35%;
- }
- .span3{
- padding-top:8rpx ;
- padding-left: 8rpx;
- width: 10%;
-
- }
- }
- }
- }
- .textinfo{
- padding: 40rpx;
- font-size: 24rpx !important;
- color: #999999;
-
- p{
- font-size: 32rpx !important;
- color:#101010;
- font-weight: bold;
- }
- }
- .lefttitle{
- font-weight: bold;
- font-size: 32rpx
- }
- @import "@/_theme.scss";
- .listlength{
- float: right;
- padding-right: 20rpx;
- }
- /deep/.u-drawer-content{
- border-radius: 10px 10px 0 0
- }
-
- /deep/.u-radio-group {
- width: 100%;
- }
- /deep/.u-radio {
- position: relative;
- }
- /deep/.u-radio__icon-wrap {
- position: absolute;
- right: 0;
- }
- .recharge-item2 {
- @include themeify{
- font-size: themed('font-size2') !important;
- }
- /* font-size: 14px !important;*/
- color: #999999;
- }
- .paySelect{
- padding: 32rpx;
- .title{
- font-size:40rpx
- }
- p {
- width: 100%;
- span{
- color: #666;
- }
- .u-radio__label{
- color: #333333 ;
- }
- .u-radio{
- width: 100% !important;;
- }
- color: #333333 ;
- margin-top: 16rpx;
- font-size:32rpx;
- }
- }
- .recharge {
- padding: 32rpx;
- padding-bottom: 100px;
- .title {
- @include themeify{
- font-size: themed('font-size3');
- }
- /* font-size: 16px;*/
- position: relative;
- }
- p {
- color: #666;
- margin-top: 4px;
- }
- .self-stop.active {
- background-color: #EFFFF7;
- border-color: #00B962;
- color: #00B962;
- }
- .rechargeMain {
- display: flex;
- flex-wrap: wrap;
- // justify-content: space-between;
- margin-top: 24rpx;
- margin-bottom: 10rpx;
- .recharge-item {
- .u-input {
- text-align: center !important;
- }
- width: 31%;
- border: 1px solid #e3e3e3;
- padding: 20rpx 0;
- border-radius: 4px;
- text-align: center;
- margin-bottom: 20rpx;
- position: relative;
- margin-left: 10rpx;
- @include themeify{
- font-size: themed('font-size3');
- }
- /* font-size: 16px;*/
- }
- .active {
- background-color: #EFFFF7;
- border-color: #00B962;
- color: #00B962;
- }
- }
- .self-stop {
- width: 105px;
- /* height: 48px;
- line-height: 48px;*/
- border-radius: 4px;
- color: #101010;
- @include themeify{
- font-size: themed('font-size3');
- height:themed('font-size19');
- line-height:themed('font-size19')
- }
- /* font-size: 16px;*/
- text-align: center;
- font-family: Arial;
- border: 1px solid rgba(227, 227, 227, 100);
- margin-top: 12px;
- }
- }
- .recharge-input {
- margin-top: 8px;
- margin-bottom: 32px;
- }
- .recharge-radio {
- margin-top: 10px;
- .recharge-radio-item {
- display: flex;
- align-items: center;
- }
- .recharge-radio-name {
- margin-left: 8px;
- }
- }
- .but-box {
- width: 89.3%;
- height: 44px;
- margin: 0 auto;
- position: fixed;
- bottom: 0;
- right: 0;
- left: 0;
-
- }
- //优惠券
- .discounts {
- margin-top: 10px;
- width: 100%;
- .title {
- width: 100%;
-
- .title-1 {
-
- /* height: 22px;*/
- color: rgba(16, 16, 16, 100);
- @include themeify{
- font-size: themed('font-size3');
- height:themed('font-size6');
- }
- /* font-size: 16px;*/
- }
- .title-2 {
- margin-left: 4px;
- @include themeify{
- font-size: themed('font-size2');
- line-height:themed('font-size5');
- }
- /* font-size: 14px;
- line-height: 20px;*/
- }
- .title-3 {
- float: right;
- @include themeify{
- font-size: themed('font-size3');
- line-height:themed('font-size5');
- }
- /* height: 19px;
- font-size: 16px;*/
- }
- }
- .select {
- position: relative;
- /deep/.u-radio {
- padding: 36rpx 32rpx;
- margin-top: 12px;
- width: 100%;
- height: 48px;
- border-radius: 4px;
- background-color: rgba(255, 255, 255, 100);
- text-align: center;
- border: 1px solid rgba(227, 227, 227, 100);
- position: relative;
- }
- // /deep/.u-radio:nth-child(3) {
- //
- // }
- /deep/.u-radio__icon-wrap {
- left: 32rpx;
- background-color: #fff;
- }
- /deep/.u-radio__label {
- margin-left: 40px;
- }
- }
- .explain {
- width: 64px;
- /* height: 24px;
- line-height: 24px;*/
- position: absolute;
- top: 10px;
- right: 12px;
- border-radius: 4px;
- background-color: rgba(255, 255, 255, 100);
- text-align: center;
- border: 1px solid rgba(227, 227, 227, 100);
- color: rgba(0, 185, 98, 100);
- /* font-size: 12px;*/
- @include themeify{
- font-size: themed('font-size1');
- line-height:themed('font-size7');
- height:themed('font-size7');
- }
- }
- }
-
- // 优惠券2
- .discounts2{
- margin-top: 10px;
- width: 100%;
- display: flex;
- justify-content: space-between;
- .left{
- /* width: 70px;*/
- // height: 20px;
- color: rgba(16, 16, 16, 100);
- /* font-size: 20px;*/
- @include themeify{
- width:160rpx;
- font-size: 40rpx;
- }
- }
- .right{
- /*
- height: 16px;
- line-height: 28px;*/
- color: rgba(255, 61, 0, 100);
- @include themeify{
- font-size: themed('font-size3');
- height: themed('font-size3');
- line-height: themed('font-size9');
-
- }
- /* font-size: 16px;*/
- text-align: right;
- display: flex;
- }
- .iconfont{
- @include themeify{
- font-size: themed('font-size7');
- line-height: themed('font-size10');
-
- }
- /* line-height: 29px;*/
- text-align: center;
- color: #b3b3b3;
- /* font-size: 24px;*/
-
-
- }
- }
-
- // 会员活动
- .member{
- margin-top: 24rpx;
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- align-items: center;
- .actively{
-
- color: rgba(119, 119, 119, 1);
- font-size: 36rpx;
-
- }
- .type,.right{
- color: rgba(16, 18, 18, 100);
- font-size: 36rpx;
- //line-height: 28px;
- padding-right: 10px;
- display: flex;
- align-items: center;
- }
- .iconfont{
- @include themeify{
- font-size: themed('font-size7');
- line-height: themed('font-size10');
-
- }
- /* line-height: 29px;*/
- text-align: center;
- color: #b3b3b3;
- /* font-size: 24px;*/
-
-
- }
- }
-
-
- // 尾部
- .botton {
- border: 1px solid rgba(242, 242, 242, 1);
- background: linear-gradient(180deg, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 100%);
- position: fixed;
-
- //background: #fff;
- width: 100%;
-
- padding: 24rpx 40rpx;
- line-height: 88rpx;
-
- bottom: 0;
- left: 0;
- z-index: 999;
- //padding: 0px 32rpx 32rpx;
- padding-bottom: 12px;
- button {
-
- margin-left: 40rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- //width: 45.8%;
- // background-color: black;
- // color: #fff;
- // background-color: rgba(255, 255, 255, 1);
- // color: rgba(0, 185, 98, 1);
- background-color: rgba(0, 185, 98, 100);
- color: rgba(255, 255, 255, 100);
-
-
- height:88rpx;
- border-radius: 50px;
- font-size: 32rpx;
- }
-
- }
-
- .couponsuse{
- color: rgba(153, 153, 153, 100);
- margin-top: 10px;
-
- font-size: 14px;
- text-align: left;
- font-family: AlibabaPuHui-regular;
- }
- .to-recharge{
-
- padding: 0 16px;
- line-height: 36px;
- border-radius: 50px 0px 0px 50px;
- background:linear-gradient(#FF9000,#FFB700);
- color: rgba(255, 255, 255, 100);
- font-size: 16px;
- text-align: center;
- position: absolute;
- right: -16px;
- top: 0;
- }
- /deep/.u-checkbox__icon-wrap--checked{
- background-color: #2979ff !important;
- border-color: #2979ff !important;
- }
- .amount {
- // width: 41.9%;
- height: 16px;
- line-height: 15px;
- border-radius: 0px 4px 0px 4px;
- background-color: #ec4530;//rgba(0, 185, 98, 100)
- color: rgba(255, 255, 255, 100);
- font-size: 10px;
- text-align: center;
- position: absolute;
- top: 0;
- right: 0;
-
- }
- .card {
- overflow: hidden;
- padding: 10px;
- margin-top: 10px;
- .title{
-
- font-weight: bold;
- }
- }
- .cardselect {
- border-radius: 8px;
- border: 2px solid rgba(0, 185, 98, 1);
- .title{
- color:#00B962;
- font-weight: bold;
- }
- .cardgo{
- position: relative;
-
- .cardinfo{
- background-color: #57ad55;
- width: 64rpx;
- height: 64rpx;
- position: absolute;
- top: -12px;
- right: -12px;
- border-radius: 0 0 0 8px;
- img{
- width: 64rpx;
- }
- }
- }
- }
- .cardno {
- border: 2px solid rgba(204, 204, 204, 1);
- border-radius: 8px;
- .title{
-
- font-weight: bold;
- }
- .cardgo{
- position: relative;
-
- .cardinfo{
- background-color: rgba(204, 204, 204, 1);
- width: 64rpx;
- height: 64rpx;
- position: absolute;
- top: -12px;
- right: -12px;
- border-radius: 0 0 0 8px;
- img{
- width: 64rpx;
- }
- }
- }
-
- }
- .classtable{
- margin: 40rpx 40rpx;
-
- .td1{
- width: 50rpx;
- padding: 12rpx 0;
- text-align: center;
- img{
- width: 48rpx;
- height: 48rpx;
- }
- font-size: 10px;
- }
- .td2{
- padding-left: 16rpx;
- font-size: 12px;
- line-height: 24px;
- .dian{
- padding :0 10rpx
- }
- }
- }
- .carImg{
- margin: 0 40rpx;
- img{
- width: 100%;
- }
- }
- </style>
|