1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561 |
- <template>
- <view>
- <ujp-navbar title="服务费包月会员" >
- <view class="iconfont service" @click="openModal">
- 
- </view>
- </ujp-navbar>
- <!-- 提示 -->
- <!-- <template>
- <u-alert-tips type="warning" :title="title" :description="description" :show-icon="true"></u-alert-tips>
- </template> -->
- <!-- 卡片 -->
- <view class="main">
- <view class="carNone" v-if="!isReady">
- <img src="static/img/暂无数据-缺省页.png" alt="">
- <p class="" style="color: #bfdfd5;font-size: 18px;">加载中</p>
- </view>
- <view class="carNone" v-if="isReady&&cardList.length == 0">
- <img src="static/img/暂无数据-缺省页.png" alt="">
- <p class="" style="color: #bfdfd5;font-size: 18px;">暂无月卡上架</p>
- </view>
- <view class="user-card" v-if="ispay">
- <view class="head-img">
- <img style="border-radius: 50px;" v-if="userInfo.headImg" :src="userInfo.headImg" alt="">
- <img v-else src="../../assets/img/headPortrait.png" alt="">
- </view>
- <view class="user-name">
- <view class="name">
- {{userInfo.realName?userInfo.realName:userInfo.nickName}}
- </view>
- <view class="sign">
- {{userCard&&ispay?userCard.endTime.substring(0,10):''}}到期
- </view>
- </view>
- </view>
- <ujp-swiper v-if="!ispay" :img-mode="'scaleToFill'" height="240"
- :effect3d="true" :autoplay="false" :circular="false"
- @change="checkboxChangeBtn" :name="'picUrl'">
-
-
- <swiper-item class="scroll-view-item_H u-swiper-item"
-
- v-for="(item,i) in cardList" :key="i">
- <view
- :style="{
- backgroundImage:' url('+item.monthlyRentCard.image+') ',
-
- transform: 'scaleY(0.9)',
- margin: '0 20rpx' ,
- }"
-
-
- :class="'cardtab ' ">
- <view class="tag" v-if="item.monthlyRentCard.isVip">{{item.monthlyRentCard.platformText}}车主
- </view>
- <view class="tag" v-else-if="item.monthlyRentCard.remark">{{item.monthlyRentCard.remark}}</view>
- <view class="price">
- <view class="current-price">
- <b>{{item.monthlyRentCard.price}}</b><text>元/月</text>
- <!-- -->
- <p v-if="item.monthlyRentCard.buyNum">{{item.monthlyRentCard.buyNum}}人次购买</p>
- </view>
- <!-- <view class="original-cost" v-if="item.monthlyRentCard.isVip||item.monthlyRentCard.discount">
- 原价 {{item.monthlyRentCard.oldPrice}}元/月
- </view> -->
- </view>
- </view>
- </swiper-item>
- </ujp-swiper>
- </view>
- <u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
- <u-modal v-model="showModel" :show-cancel-button="true" @cancel="getUserInfo()" @confirm="confirm"
- confirm-text="支付成功?" title="扫码支付">
- <view style="
- text-align: center;
- ">
- <img id="qrcode2" :src="qrCodeImg">
- </view>
- <view style="
- text-align: center;
- ">请使用支付宝扫码</view>
- </u-modal>
- <u-modal v-model="show1" @confirm="gotoGz" cancel-text="暂不关注" confirm-text="前往关注" confirm-color="#53b56b"
- :show-cancel-button="true" ref="uModal2" :asyncClose="true">
- <view style="padding: 15px;">请先关注<span style=" color: #53b56b;">{{projectName}}</span>公众号,购买月卡</view>
- </u-modal>
- <u-modal v-model="infoSet1" @confirm="infoSet1=false,gotoUrl('pages/user/dataSet')" cancel-text="取消"
- confirm-text="完善个人信息" confirm-color="#53b56b" :show-cancel-button="true" ref="uModal2" :asyncClose="true">
- <view style="padding: 15px;">购买月卡需要完善以下2点<br />
- 1.填写真实姓名<br />
- 2.填写车牌号<br />
- </view>
- </u-modal>
- <img id="qrcode" style="display: none;">
- <!-- 须知 -->
- <view class="notice">
- <view class="title">
- 可享一个月充电服务费<span style="color:#ec4f27">全免</span>
- </view>
- <view class="line" >
- <!-- <view v-show="detail.type==1">· 仅限<b>非运营车</b>车主或<b>新用户</b>购买和使用</view>
- <view>· 在指定充电站充电时,此单服务费<b>全免</b></view>
- <view>· 不可抵扣电费、停车费、占位费</view> -->
-
- <view class="lineInfo" v-show="detail.type==1" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
- <view class="lineSvg">
- <img src="@/assets/img/buy/bus2.svg">
- </view>
- <view class="lineView">
- <view class="lineTitle">适用车主</view>
- <p class="linep">仅限非运营车车主或新用户购买和使用</p>
- </view>
- </view>
- <view class="lineInfo" v-show="detail.type==2" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
- <view class="lineSvg">
- <img src="@/assets/img/buy/bus.svg">
- </view>
- <view class="lineView">
- <view class="lineTitle">适用车主</view>
- <p class="linep">适合运营车车主购买和使用</p>
- </view>
- </view>
- <view class="lineInfo" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
- <view class="lineSvg">
- <img src="@/assets/img/buy/fee.svg">
- </view>
- <view class="lineView">
- <view class="lineTitle">充电免服务费</view>
- <p class="linep">在指定站点充电时,此单服务费全免</p>
- </view>
- </view>
- <view class="lineInfo" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
- <view class="lineSvg">
- <img src="@/assets/img/buy/tips.svg">
- </view>
- <view class="lineView">
- <view class="lineTitle">注意事项</view>
- <p class="linep">不可抵扣电费、停车费、占位费</p>
- </view>
- </view>
-
-
- </view>
- <u-divider fontSize="36" border-color="#bbc039" color="#101010">购卡须知</u-divider>
- <view class="text">
- <view class="num">
- 01
- </view>
- <view class="">
- 充电月卡默认与购卡人账户进行关联,所涉权益仅可绑定单个车牌,即账户、月卡、车牌三者关联形成一个权益主体。
- </view>
- </view>
- <view class="text">
- <view class="num">
- 02
- </view>
- <view class="">
- 充电月卡有效期内,持卡人在指定充电站为绑定车辆充电,可享受充电服务费全免。持卡人给非绑定车辆充电,将正常收取充电服务费。
- </view>
- </view>
- <view class="text">
- <view class="num">
- 03
- </view>
- <view class="">
- 如车牌等信息填写错误,请致电售后客服进行处理。
- </view>
- </view>
- <view class="text">
- <view class="num">
- 04
- </view>
- <view class="">
- 本卡一经售出,不支持任何形式的退换。
- </view>
- </view>
- <!-- <view
- @click="gotoUrl('pages/monthlyCardActivity/monthlyCardList?cardId='+(ispay?userCard.rentCardId:cardId))">
- 适用<br/>
- 站点
- </view> -->
- </view>
- <view class="notice2">
- <view class="titleHead">适用充电站点</view>
- <!-- 附近站点 -->
- <view class="station" v-for="(stationData,i) in pageListGetObj.list" :key="i"
- @click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)">
- <view class="head">
- <view class="title oldTextjp" oldstyle="font-size: 20px;">
- {{stationData.name}}
- </view>
- <view class="distance ">
- <!-- <text class="iconfont" style="color:#666666"></text>{{stationData.distance!=null&&stationData.distance>0.1 ? stationData.distance.toFixed(1)+'公里':'小于100米'}} -->
- </view>
- </view>
- <view class="sign" v-if="stationData.stationType==50">
- {{stationData.address}}
- </view>
- <view class="sign" v-else>
-
- <!-- -->
- <view class="sign-1"
- v-if="stationData.giveDiscount&&stationData.discountRatio&&stationData.discountRatio!=100">
- 会员{{discountRatio10(stationData.discountRatio)}}折</view>
- <view class="sign-3" v-if="stationData.category=='超充'">160kW超充站</view>
- <view class="sign-4"
- v-if="stationData.nightLowPriceEnabled">
- 夜间超低价</view>
- <view class="sign-2" v-if="stationData.platformType==1">自营站</view>
- <view class="sign-2" v-if="stationData.tagList.length != 0"
- v-for="(tagName,tagIndex) in stationData.tagList" :key="tagIndex">{{tagName}}</view>
-
- </view>
- <view class="price-free oldTextClass">
- <view class="price" v-if="userInfo&&userInfo.userType==2">
- <view class="price-1">
- <text class="num">
- {{!stationData.giveDiscount ? (stationData.electricityPrice+stationData.servicePrice).toFixed(2)
- : (stationData.electricityPrice+stationData.discountServicePrice).toFixed(2)}}</text>
- <text class="unit " oldstyle="font-size: 48rpx;">元/度</text>
- </view>
- <view class="price-2 " oldstyle="font-size: 48rpx;" v-if="stationData.giveDiscount">
- <text
- class="num">{{(stationData.electricityPrice+stationData.servicePrice).toFixed(2)}}</text>
- <text class="unit ">元/度</text>
- </view>
- </view>
- <!-- 游客价格-->
- <view class="price" v-else>
- <view class="price-1">
- <text class="num">
- {{(stationData.electricityPrice+stationData.servicePrice).toFixed(2)}}</text>
- <text class="unit " oldstyle="font-size: 48rpx;">元/度</text>
- </view>
- <view class="price-3 " oldstyle="font-size: 48rpx;" v-if="stationData.giveDiscount">
- <text class="num1">会员</text>
- <text class="num">{{ (stationData.electricityPrice+stationData.discountServicePrice).toFixed(2)}}</text>
- <text class="unit ">元/度</text>
- </view>
- </view>
- <view class="free">
- <view class="fast" v-if="stationData.fastNum">
- <view class="fast-font">
- 快
- </view>
- <view class="num">
- {{stationData.fastAvailableNum}}/{{stationData.fastNum}}
- </view>
- </view>
- <view class="slow oldTextjp2" oldstyle="margin-left: 1px;" v-if="stationData.slowNum">
- <view class="slow-font">
- 慢
- </view>
- <view class="num">
- {{stationData.slowAvailableNum}}/{{stationData.slowNum}}
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="bottom" @click="getPageList(true)"
- v-if="pageListGetObj.recordsTotal!=pageListGetObj.list.length">
- <view class="bot">
- <view class="bot-line"></view>
- <view class="bot-text " style="color: #00B962;text-align: center;margin-top: 10px">
- 点击查看更多(共{{pageListGetObj.recordsTotal}}站点)</view>
- <view class="bot-line"></view>
- </view>
- </view>
- <view class="bottom" v-else>
- <view class="bot">
- <view class="bot-line"></view>
- <view class="bot-text " style="color: #00B962;text-align: center;margin-top: 10px;">已经到底了</view>
- <view class="bot-line"></view>
- </view>
- </view>
- <view class="upupupView" v-show="flag==1">
- <view class="upupupImg">
- <img src="@/assets/img/upupup.svg">
- </view>
- <p>上划查看更多内容</p>
- </view>
- </view>
- <!-- 按钮 -->
- <view class="button" v-if="!ispay">
-
-
- <!-- <button class="btn btn2" @click="show4=true" v-if="userCard&&userCard.classify==2">购买月卡 - 并<span style="color:red">废弃</span>其他卡
- </button> -->
- <button class="btn " v-if="userInfo.userType=='1'">游客无法购买月卡
- </button>
-
- <button class="btn " v-else-if="!isReady">加载中
- </button>
- <button class="btn " v-else-if="ispay"> {{userCard&&ispay?userCard.endTime:''}}到期
- </button>
- <button class="btn " v-else-if="!endCardBool">已下架
- </button>
- <button class="btn " v-else-if="!show2" @click="gotoGz">关注公众号
- </button>
- <button class="btn " v-else-if="!infoSet" @click="gotoUrl('pages/user/dataSet')">完善个人信息
- </button>
- <button class="btn " v-else-if="!cardList.length" @click="putShelf">已下架
- </button>
- <button class="btn " @click="showPay" v-else-if="detail.isVip">
- <text style="font-size: 14px;">¥</text>
- <span>{{detail.price}}</span>
- <text class="price">{{detail.oldPrice}}</text>开通充电月卡
- <view class="position">
- <view id="talkbubble">{{detail.platformText}}车主</view>
- </view>
- </button>
- <button class="btn " @click="showPay" v-else>
- <text style="font-size: 14px;"></text>
- <span style="margin-right: 8px;">{{detail.price}}元</span>
- <text v-if="detail.discount" class="price">{{detail.oldPrice}}</text> 开通服务费包月会员
- <view class="position" v-if="detail.remark2">
- <view id="talkbubble">{{detail.remark2}}</view>
- </view>
- </button>
- <view class="hint">
- 开通表示阅读并同意<span @click="gotoUrl('pages/article/details?code=FWFZKXY')"
- style="text-decoration:underline;color: #C07C38;">《服务费折扣协议》</span>
- </view>
- </view>
- <u-modal v-model="show4" title="购买须知" @confirm="show4=false,show=true" cancel-text="取消" confirm-text="确认购买" confirm-color="red"
- :show-cancel-button="true" ref="uModal2" :asyncClose="true">
- <view style="padding: 15px; " v-if="userCard">
- <view>由于您已经购买了其他卡</view>
- <view style="margin-top: 8px;">汽车充电同时只生效一张卡,且本<span style="color: #00b962;">月卡</span>优惠力度最高。</view>
- <view style="margin-top: 4px;">购买成功后,将<span style="color: red;">废弃</span>您已购买的<span style="color: #00b962;">[6折卡]</span>,且<span style="color: red;">不退款、不折算</span>。</view>
- <view style="margin-top: 4px;">同时也建议您先使用完<span style="color: #00b962;">[6折卡]</span>的充电度数,以免造成不必要的损失。</view>
- <view style="margin-top: 4px;">已购买<span style="color: #00b962;">[6折卡]</span>:于{{userCard.endTime.substring(0,10)}}到期,已用{{userCard.chargedDegree?userCard.chargedDegree.toFixed(0):0.00}}度 /
- 共{{userCard.chargeDegreeLimit}}度。</view>
-
-
- </view>
-
-
- </u-modal>
-
- <u-modal v-model="show3" @confirm="confirmPhone" confirm-text="拨打电话" confirm-color="#606266"
- :show-cancel-button="true" ref="uModal" :asyncClose="true" title="客服电话" :content="consumerPhone"
- :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
- </view>
- </template>
- <script>
- import * as API_weixin from '@/apis/weixin.js'
- import * as API_site from '@/apis/site.js';
- import * as Pay from '@/apis/weixin.js'
- import * as API from '@/apis/card.js'
- import * as loginApi from '@/apis/login.js'
- import Tabbar from '@/components/Tabbar.vue';
- import QRCode from 'qrcodejs2'
- import {
- newDate,
- convertCanvasToImage,
- } from '@/utils'
- import {
- wxPayJs
- } from '@/utils/wxpay'
- export default {
- components: {
- Tabbar
- },
- data() {
- return {
- description: '盟主能量包本期限时优惠活动将于9月16日结束。',
- checked: "false",
- cardId: '',
- qrCodeImg: "",
- show4:false,
- showModel: false,
- cardList: [],
- pageList: [],
- projectName: "",
- list: [{
- text: '微信',
- }, {
- text: '支付宝'
- }],
- show: false,
- submitForm: {},
- ykgz: '',
- detail: {},
- ispay: false,
- show3: false,
- show2: true,
- show1: false,
- infoSet: true,
- infoSet1: false,
- userCard: null,
- isReady: false,
- userInfo: {},
- elderStatus: false,
- consumerPhone: "",
- scrollLeftSet: 0,
- scrollLeftOldSet: 0,
- scrollLeftSetBl: false,
- flag: 0, //0 初始化, 1 ,开始判断, 2已经滑动
- }
- },
- onLoad() {
- this.projectName = process.car.ProjectName;
- },
- onReady() {
- var consumerPhone = this.carhelp.getConfig().consumerPhone
- // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
- if (consumerPhone) {
- this.consumerPhone = consumerPhone
- }
- this.ykgz = this.carhelp.getConfig().ykgz
- //this.checkSubscribe()
- this.getCardList();
- },
- onShow() {
- if (this.carhelp.get("getElderModeClass") == "长辈模式") {
- this.elderStatus = true;
- } else {
- this.elderStatus = false;
- }
- if (this.$refs.tabbarMain) {
- this.$refs.tabbarMain.setcount(1);
- }
- //this.checkSubscribe();
- // this.getCardList();
- // this.show2 = true;
- },
- computed: {
- pageListGetObj() {
- var cardId = this.cardId
- if (this.ispay) {
- cardId = this.userCard.rentCardId;
- }
- var i = this.pageList.findIndex(item => {
- return item.monthlyRentCardId == cardId
- })
- if (i == -1)
- return {
- list: []
- }
- else
- return this.pageList[i]
- },
- endCardBool() {
- if (!this.cardList.length) {
- return false;
- }
- var date = new Date().getTime()
- if (!this.detail.endTime) {
- return true;
- }
- var date2 = newDate(this.detail.endTime).getTime();
- if (date < date2) {
- return true;
- } else {
- return false;
- }
- }
- },
- onPageScroll(e) {
- if (this.flag == 1) {
- if (e.scrollTop >= 50) {
- this.flag = 2;
- } else {
- }
- }
- },
- methods: {
-
- showPay(){
- if(this.userCard&&this.userCard.classify==2){
- this.show4=true
- }else{
- this.show=true
- }
- },
- scrolltolower: function(e) {
- //
- },
- scrolltoupper: function(e) {
- //this.scrollLeftSetBl=false;
- },
- scroll: function(e) {
- if (this.scrollLeftSetBl) {
- return
- }
- this.scrollLeftSetBl = true;
- var scrollWidth = e.detail.scrollWidth
- if (e.detail.deltaX > 0) {
- //右移动
- this.scrollLeftSet = 0;
- this.checkboxChange(this.cardList[0].monthlyRentCard)
- } else {
- //左移动
- this.scrollLeftSet = scrollWidth
- if (this.cardList.length > 1) {
- this.checkboxChange(this.cardList[1].monthlyRentCard)
- }
- }
- this.scrollLeftSetBl = false;
- //this.old.scrollTop = e.detail.scrollTop
- this.scrollLeftOldSet = e.detail.scrollLeft
- },
- confirmPhone() {
- this.show = false;
- uni.makePhoneCall({
- phoneNumber: this.consumerPhone //仅为示例
- });
- },
- openModal() {
- this.show3 = true;
- },
- checkboxChangeBtn(e){
- this.checkboxChange(this.cardList[e].monthlyRentCard)
- },
- checkboxChange(monthlyRentCard) {
- this.detail = monthlyRentCard;
- this.cardId = monthlyRentCard.id
- monthlyRentCard.checked = true
- for (var i in this.cardList) {
- var obj = this.cardList[i].monthlyRentCard;
- if (this.cardId == obj.id) {
- } else {
- obj.checked = false
- }
- }
- this.getPageList(false);
- },
- gotoGz() {
- this.carhelp.setGzDate()
- var url = "https://mp.weixin.qq.com/s/mCHz1nNvg0xAICiBeIyKRQ";
- window.location.href = url
- },
- checkSubscribe() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API_weixin.checkSubscribe({
- openId: this.carhelp.getOpenId()
- }).then((res) => {
- uni.hideLoading()
- if (res.data == "0") {
- this.show1 = true
- } else {
- //this.getInfo();
- this.getCardList();
- this.show2 = true;
- //this.carhelp.setGzDate()
- }
- //setGzDate
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- userCardBool(userCard) {
- if (userCard&&userCard.classify==1) {
- var date = new Date().getTime()
- var date2 = newDate(userCard.endTime).getTime();
- if (date < date2) {
- return true;
- }
- }
- return false
- },
- getCardList() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.cardList({
- type:1
- }).then((response) => {
-
- this.cardList = response.data.cardList;
- for (var i in this.cardList) {
- var obj = this.cardList[i].monthlyRentCard
- //不打折的卡
- obj.remark2 = obj.remark;
- if (obj.oldPrice) {
- if (!obj.discount && obj.couponRemark) {
- obj.remark2 = obj.couponRemark
- if (!obj.remark) {
- obj.remark = "月卡优惠券"
- }
- }
- obj.discount = true
- }
- }
- if (this.cardList.length) {
- this.detail = this.cardList[0].monthlyRentCard
- this.cardId = this.detail.id;
- this.cardList[0].monthlyRentCard.checked = true
- if (this.pageList.length == 0) {
- this.pageList = this.cardList.map(item => {
- return {
- recordsTotal: -1,
- monthlyRentCardId: item.monthlyRentCard.id,
- list: [],
- pageIndex: 1,
- }
- })
- this.getPageList(false);
- }
- //this.pageList.map(item)
- }
- this.getUserInfo()
- this.isReady = true;
- //cardId: this.cardId
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- getPageList(bl) {
- var cardId = this.cardId
- if (this.ispay) {
- cardId = this.userCard.rentCardId;
- }
- var i = this.pageList.findIndex(item => {
- return item.monthlyRentCardId == cardId
- })
- var data = {
- monthlyRentCardId: cardId,
- online: 0,
- pageSize: 6,
- }
- if (this.carhelp.getPersonInfo()) {
- data.openId = this.carhelp.getOpenId()
- }
- if (i > -1) {
- if (bl) {
- this.pageList[i].pageIndex += 1;
- } else {
- if (this.pageList[i].recordsTotal == -1) {
- } else {
- return
- }
- }
- data.pageIndex = this.pageList[i].pageIndex
- } else {
- return
- }
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- var list = this.pageList[i].list;
- API_site.getChargingStationData(data).then((response) => {
- console.log(response)
- list = [
- ...list,
- ...response.data.data
- ];
- this.pageList[i].recordsTotal = response.data.recordsTotal;
- this.pageList[i].list = list;
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- getUserInfo() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- loginApi.findByOpenId({
- openId: this.carhelp.getOpenId(),
- noerror: true
- }).then((res) => {
- if (res.code == 200 && res.result) {
- if (res.data.regUser) {
- var userInfo = res.data.regUser
- this.userInfo = userInfo;
- // if (userInfo.userType == "1") {
- // } else if (userInfo.carId && userInfo.realName) {
- // this.infoSet = true;
- // } else {
- // this.infoSet = false;
- // if (this.endCardBool) {
- // this.infoSet1 = true;
- // }
- // }
- var userCard = res.data.userCard;
- this.userCard = userCard
- this.ispay = this.userCardBool(userCard)
- } else {
- }
- if (this.flag == 0) {
- this.flag = 1;
- setTimeout(() => {
- this.flag = 2;
- }, 5000)
- }
- }
- uni.hideLoading();
- }).catch(error => {
- uni.showToast({
- title: error,
- icon: "none"
- })
- })
- },
- putShelf2() {
- uni.showToast({
- title: "暂不支持重复购买"
- })
- },
- putShelf() {
- uni.showToast({
- title: "已下架,暂不支持购买"
- })
- },
- getInfo() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.cardDetail({
- cardId: this.cardId
- }).then((response) => {
- this.detail = response.data.monthlyRentCard
- uni.hideLoading()
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- submit(type) {
- if (!this.endCardBool) {
- return
- }
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- API.openCard({
- cardId: this.cardId
- }).then((response) => {
- this.submitForm.id = response.data.orderInfoId
- if (type == 0) {
- this.wxpy()
- }
- if (type == 1) {
- this.alpy()
- }
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- alpy() {
- uni.showLoading({
- title: "加载中",
- mask: true,
- })
- var listcanvas = document.getElementsByTagName('canvas')
- if (listcanvas.length > 0) {
- document.getElementById("qrcode").removeChild(document.getElementsByTagName('canvas')[0]);
- }
- Pay.alpay(this.submitForm).then((response) => {
- let qrcode = new QRCode('qrcode', {
- width: 200,
- height: 200,
- text: response.data.qr_code,
- correctLevel: QRCode.CorrectLevel.M,
- })
- this.outOrderNo = response.data.outOrderNo;
- var canvas = document.getElementsByTagName('canvas')[0];
- this.qrCodeImg = convertCanvasToImage(canvas);
- uni.hideLoading()
- this.showModel = true
- }).catch(error => {
- uni.showToast({
- title: error
- })
- })
- },
- wxpy() {
- Pay.wxpay(this.submitForm).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
- })
- })
- },
- confirm() {
- this.getUserInfo();
- uni.redirectTo({
- url: "/pages/user/finance/rechargeRes?id=" + this.outOrderNo
- })
- },
- click(index) {
- console.log(`点击了第${index + 1}项,内容为:${this.list[index].text}`)
- this.submit(index);
- }
- }
- }
- </script>
- <style>
- @keyframes movepoint {
- 25% {
- top: 10px;
- }
- 100% {
- top: 15px;
- }
- }
- .upupupImg {
- height: 80px;
- }
- .upupupView {
- text-align: center;
- font-size: 12px;
- padding: 30rpx;
- border-radius: 12px;
- position: absolute;
- background: rgb(0 0 0 / 70%);
- top: 50%;
- transform: translate(-50%);
- left: 50%;
- color: #fff;
- }
- .upupupView img {
- top: 15px;
- position: relative;
- width: 60px;
- animation: movepoint 2s infinite;
- -webkit-animation: movepoint 2s infinite;
- }
- </style>
- <style lang="scss" scoped>
- .scroll-Y {
- height: 300rpx;
- }
- .scroll-view_H {
- white-space: nowrap;
- width: 100%;
- }
- .scroll-view-item {
- height: 300rpx;
- line-height: 300rpx;
- text-align: center;
- font-size: 36rpx;
- }
- .scroll-view-item_H {
- display: inline-block;
- //width: 85%;
- height: 300rpx;
- line-height: 300rpx;
- text-align: center;
- font-size: 36rpx;
- }
- .service {
- font-size: 24px;
- //color: #fff;
- position: absolute;
- right: 16px;
- }
- /deep/.u-alert-desc {
- color: #ff7300;
- }
- // 卡片
- .main {
- background-color: #404A5E;
- padding: 40rpx 0 0 0;
- z-index: 80;
- .tag {
- position: absolute;
- background-color: rgba(255, 61, 0, 100);
- color: #ffffff;
- font-size: 24rpx;
- text-align: center;
- line-height: 40rpx;
- padding: 0 12rpx;
- right: 0rpx;
- top: 0rpx;
- border-radius: 0 12px 0 12px;
- }
- // @media screen and (max-width:320px) {
- // .tag {
- // padding: 0 4rpx;
- // }
- // .price {
- // position: absolute;
- // top: 24rpx !important;
- // right: 32rpx !important;
- // }
- // .current-price {
- // font-size: 36rpx;
- // }
- // }
- .price {
- top: -90rpx;
- right: 76rpx;
- position: absolute;
- p {
- text-align: right;
- color: rgba(0, 0, 0, 0.5);
- font-size: 12px;
- position: relative;
- top: -250rpx;
- }
- }
- .current-price {
- font-size: 48rpx;
- color: #101010;
- text-align: right;
- text {
- font-size: 28rpx;
- }
- }
- .original-cost {
- color: rgba(75, 65, 50, 100);
- text-decoration: line-through;
- margin-bottom: 6rpx;
- }
- /deep/.u-iconfont {
- font-size: 36rpx !important;
- }
- .card-0 {}
- // .card-0 {
- // background-position-x: 40rpx;
- // }
- .cardtab {
- margin-top: 32rpx;
- position: relative;
- background-size: 100% 100%;
- background-repeat: no-repeat;
- height: 300rpx;
- /deep/.u-checkbox__icon-wrap {
- background-color: #607d8b;
- opacity: 0.3
- }
- .radio-box {
- position: absolute;
- right: 0;
- bottom: 40rpx;
- }
- }
- }
- // 按钮
- .button {
- position: fixed;
- margin-top: -20rpx;
- width: 100%;
- bottom: 0px;
- border-radius: 16px 16px 0px 0px;
- padding: 20px 20px 24px 20px;
- background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 67%, rgba(255, 255, 255, 1) 84%);
- uni-button:after {
- border: none;
- }
- .btn {
- border: none !important;
- background: linear-gradient(#D8A05B, #C07C38);
- box-shadow: 0px 2px 6px 0px rgba(207, 175, 118, 40);
- border-radius: 50px;
- color: #FFF;
- font-size: 18px !important;
- line-height: 44px;
- height: 44px;
- overflow: inherit !important;
- .price {
- text-decoration: line-through;
- margin: auto 4px;
- font-size: 12px
- }
- }
- .btn2 {
- background: #00b962;
- }
- .hint {
- color: rgba(159, 157, 154, 100);
- line-height: 20px;
- text-align: center;
- margin-top: 8px;
- }
- .btn-2 {
- position: relative;
- }
- .position {
- position: absolute;
- top: -16px;
- left: 24%;
- z-index: 999;
- }
- #talkbubble {
- position: absolute;
- top: 0;
- left: 0;
- padding: 0 10px;
- line-height: 20px;
- font-size: 12px;
- color: #fff;
- background: red;
- position: relative;
- border-radius: 10px;
- text-align: center;
- }
- #talkbubble:before {
- content: "";
- position: absolute;
- top: 100%;
- //right: 45%;
- border-top: 5px solid red;
- border-right: 5px solid transparent;
- border-left: 5px solid transparent;
- }
- }
- .notice2 {
- padding: 0 0 120px 0;
- .titleHead {
- color: #101010;
- font-size: 40rpx;
- text-align: center;
- margin-bottom: 10px;
- }
- }
- // 须知
- .notice {
- top: -10rpx;
- border-radius: 15px 15px 0 0;
- position: relative;
- .title {
- color: rgba(51, 51, 51, 1);
- font-size: 40rpx;
- text-align: center;
- margin-bottom: 30rpx;
- }
- .line {
- margin-bottom: 40rpx;
- color: #666666;
- font-size: 34rpx;
- line-height: 52rpx;
- .lineInfo1{
- border: 1px solid #D5C5B5;
- background-color: #fef9f5;
- }
- .lineInfo2{
- border: 1px solid #79ACDB ;
- background-color: #ffffff;
- }
- .lineInfo{
- margin-right: 20rpx;
- display: flex;
- padding: 20rpx 15rpx 15rpx 10rpx;
- border-radius: 10px;
- margin-bottom: 16rpx;
- .lineSvg{
- padding-top: 2px;
- margin: auto 16rpx;
- img{
- width: 70rpx;
- color:#62574C ;
- }
- }
- .lineView{
- .lineTitle{
- color:#62574C;
- font-size: 36rpx;
- }
- .linep{
- color:#8A7B6C;
- font-size: 28rpx;
- line-height: 28rpx;
- }
- }
- }
-
- }
- background-color: #fff;
- padding: 30rpx 30rpx 30rpx 50rpx;
- /deep/.u-divider {
- margin-bottom: 16px !important;
- }
- .text {
- color: #666666;
- margin-bottom: 12px;
- line-height: 24px;
- display: flex;
- .num {
- margin-right: 8px;
- }
- }
- }
- .carNone {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- img {
- width: 100%;
- height: 100%;
- }
- p {
- margin-top: -60px;
- }
- }
- .slogan-4 {
- margin-top: 10px;
- /* text-decoration: underline; */
- color: #9F9C99;
- text-align: center;
- position: fixed;
- /* top: 40px; */
- bottom: 40px;
- right: 20px;
- height: 55px;
- width: 55px;
- line-height: 20px;
- font-size: 16px;
- background: linear-gradient(45deg, #4BD2C0, rgb(72, 218, 149));
- box-shadow: 0 4rpx 24rpx 0 rgb(72, 218, 149);
- padding-top: 8px;
- color: #fff;
- border-radius: 25px;
- }
- .station,
- .location,
- .state1 {
- box-shadow: 0px 4rpx 12rpx 0px #008c4a33;
- }
- // 附近站点改版
- .station {
- width: 91.4%;
- border-radius: 8px;
- padding: 12px 12px 12px 11px;
- background-color: #fff;
- margin: 8px auto 0;
- .head {
- display: flex;
- justify-content: space-between;
- align-items: center;
- .title {
- color: rgba(16, 16, 16, 100);
- font-size: 32rpx;
- font-weight: 550;
- width: 440rpx;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- .distance {
- width: 180rpx;
- color: rgba(102, 102, 102, 100);
- font-size: 32rpx;
- text-align: end;
- .iconfont {
- font-size: 24rpx;
- margin-right: 4rpx;
- }
- }
- }
- .sign {
- display: flex;
- flex-wrap: wrap;
- margin-top: 16rpx;
- .sign-1 {
- line-height: 40rpx;
- border-radius: 8rpx;
- background-color: rgba(255, 255, 255, 100);
- color: rgba(255, 139, 0, 100);
- font-size: 24rpx;
- text-align: center;
- border: 1px solid rgba(255, 139, 0, 100);
- padding: 0 8rpx;
- margin-right: 16rpx;
- margin-bottom: 8rpx;
- }
- .sign-2 {
- line-height: 40rpx;
- border-radius: 8rpx;
- background-color: rgba(255, 255, 255, 100);
- color: rgba(153, 153, 153, 100);
- font-size: 24rpx;
- text-align: center;
- border: 1px solid rgba(204, 204, 204, 100);
- padding: 0 8rpx;
- margin-right: 16rpx;
- margin-bottom: 8rpx;
- }
- .sign-3 {
- line-height: 40rpx;
- border-radius: 8rpx;
- background-color: rgba(255, 255, 255, 100);
- color: #8161FF;
- font-size: 24rpx;
- text-align: center;
- border: 1px solid #8161FF;
- padding: 0 8rpx;
- margin-right: 16rpx;
- margin-bottom: 8rpx;
- }
- .sign-4 {
- line-height: 40rpx;
- border-radius: 8rpx;
- background-color: rgba(255, 255, 255, 100);
- color: #00B962;
- font-size: 24rpx;
- text-align: center;
- border: 1px solid #00B962;
- padding: 0 8rpx;
- margin-right: 16rpx;
- margin-bottom: 8rpx;
- }
- }
- .price-free {
- display: flex;
- justify-content: space-between;
- margin-top: 8rpx;
- .price {
- display: flex;
- align-items: baseline;
- }
- .price-1 {
- .num {
- color: rgba(255, 98, 0, 100);
- font-size: 44rpx;
- }
- .unit {
- font-size: 12px;
- color: rgba(153, 153, 153, 100);
- }
- }
- .price-3 {
- font-size: 24rpx;
- color: #fff;
- margin-left: 8rpx;
- padding-right: 9rpx;
- background:#00B962 ;
- border-radius: 8rpx;
- .num1{
- padding-left: 12rpx;
- border-radius: 8rpx 0 8rpx 8rpx;
- padding-right: 18rpx;
- background: #121212;
- -webkit-clip-path: polygon(0 0, 93% 0, 84% 100%, 0% 100%);
- clip-path: polygon(0 0, 93% 0, 84% 100%, 0% 100%);
-
- }
-
- }
- .price-2 {
- font-size: 24rpx;
- color: rgba(153, 153, 153, 100);
- margin-left: 8rpx;
- text-decoration: line-through;
- }
- }
- .free {
- display: flex;
- align-items: center;
- .slow,
- .fast {
- display: flex;
- .sp-font {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- border-radius: 4px;
- background-color: #7a68f6;
- color: #fff;
- font-size: 28rpx;
- text-align: center;
- margin-right: 2rpx;
- }
- .fast-font {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- border-radius: 8rpx;
- background-color: rgba(186, 240, 215, 100);
- color: rgba(0, 130, 69, 100);
- font-size: 28rpx;
- text-align: center;
- margin-right: 8rpx;
- }
- .slow-font {
- width: 40rpx;
- height: 40rpx;
- line-height: 40rpx;
- border-radius: 8rpx;
- background-color: rgba(226, 226, 226, 100);
- color: rgba(128, 128, 128, 100);
- font-size: 28rpx;
- text-align: center;
- margin-right: 8rpx;
- }
- .num {
- font-size: 32rpx;
- color: rgba(0, 145, 67, 100);
- line-height: 40rpx;
- }
- }
- .slow {
- margin-left: 24rpx;
- }
- }
- }
- .user-card {
- padding: 19px 0 39px 20px;
- margin: 21px 20px 0 20px;
- background: url(@/assets/img/companyVIP.png) no-repeat right, linear-gradient(to right, #C6D4ED, #DCE6F0) no-repeat;
- box-shadow: 0px 0px 16px 0px rgba(14, 39, 84, 28);
- border: 2px solid rgba(236, 239, 245, 100);
- border-radius: 16px;
- display: flex;
- .head-img {
- width: 48px;
- height: 48px;
- img {
- width: 100%;
- }
- }
- .user-name {
- margin-left: 12px;
- .name {
- line-height: 24px;
- color: rgba(33, 41, 48, 100);
- font-size: 24px;
- font-weight: 550;
- }
- .sign {
- color: rgba(76, 89, 111, 100);
- font-size: 16px;
- line-height: 16px;
- margin-top: 8px;
- }
- }
- }
- </style>
|