monthlyCardBuy.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516
  1. <template>
  2. <view>
  3. <ujp-navbar title="服务费包月会员" :background="{background: '#424a5d'}" title-color="#ffffff" :is-back="false">
  4. <view class="iconfont service" @click="openModal">
  5. &#xe60d;
  6. </view>
  7. </ujp-navbar>
  8. <!-- 提示 -->
  9. <!-- <template>
  10. <u-alert-tips type="warning" :title="title" :description="description" :show-icon="true"></u-alert-tips>
  11. </template> -->
  12. <!-- 卡片 -->
  13. <view class="main">
  14. <view class="carNone" v-if="!isReady">
  15. <img src="static/img/暂无数据-缺省页.png" alt="">
  16. <p class="" style="color: #bfdfd5;font-size: 18px;">加载中</p>
  17. </view>
  18. <view class="carNone" v-if="isReady&&cardList.length == 0">
  19. <img src="static/img/暂无数据-缺省页.png" alt="">
  20. <p class="" style="color: #bfdfd5;font-size: 18px;">暂无月卡上架</p>
  21. </view>
  22. <view class="user-card" v-if="ispay">
  23. <view class="head-img">
  24. <img style="border-radius: 50px;" v-if="userInfo.headImg" :src="userInfo.headImg" alt="">
  25. <img v-else src="../../assets/img/headPortrait.png" alt="">
  26. </view>
  27. <view class="user-name">
  28. <view class="name">
  29. {{userInfo.realName?userInfo.realName:userInfo.nickName}}
  30. </view>
  31. <view class="sign">
  32. {{userCard&&ispay?userCard.endTime.substring(0,10):''}}到期
  33. </view>
  34. </view>
  35. </view>
  36. <scroll-view class="scroll-view_H" scroll-x="true" :scrollWithAnimation="true" @scroll="scroll"
  37. :scrollLeft="scrollLeftSet" @scrolltoupper="scrolltoupper" @scrolltolower="scrolltolower">
  38. <view class="scroll-view-item_H" v-if="!ispay" v-for="(item,i) in cardList" :key="i">
  39. <view :style="'background-image: url('+item.monthlyRentCard.image+') ;'"
  40. :class="'cardtab card-'+i ">
  41. <view class="tag" v-if="item.monthlyRentCard.isVip">{{item.monthlyRentCard.platformText}}车主
  42. </view>
  43. <view class="tag" v-else-if="item.monthlyRentCard.remark">{{item.monthlyRentCard.remark}}</view>
  44. <view class="price">
  45. <view class="current-price">
  46. <b>{{item.monthlyRentCard.price}}</b><text>元/月</text>
  47. <!-- -->
  48. <p v-if="item.monthlyRentCard.buyNum">{{item.monthlyRentCard.buyNum}}人次购买</p>
  49. </view>
  50. <!-- <view class="original-cost" v-if="item.monthlyRentCard.isVip||item.monthlyRentCard.discount">
  51. 原价 {{item.monthlyRentCard.oldPrice}}元/月
  52. </view> -->
  53. </view>
  54. </view>
  55. </view>
  56. </scroll-view>
  57. </view>
  58. <u-action-sheet :list="list" @click="click" v-model="show"></u-action-sheet>
  59. <u-modal v-model="showModel" :show-cancel-button="true" @cancel="getUserInfo()" @confirm="confirm"
  60. confirm-text="支付成功?" title="扫码支付">
  61. <view style="
  62. text-align: center;
  63. ">
  64. <img id="qrcode2" :src="qrCodeImg">
  65. </view>
  66. <view style="
  67. text-align: center;
  68. ">请使用支付宝扫码</view>
  69. </u-modal>
  70. <u-modal v-model="show1" @confirm="gotoGz" cancel-text="暂不关注" confirm-text="前往关注" confirm-color="#53b56b"
  71. :show-cancel-button="true" ref="uModal2" :asyncClose="true">
  72. <view style="padding: 15px;">请先关注<span style=" color: #53b56b;">{{projectName}}</span>公众号,购买月卡</view>
  73. </u-modal>
  74. <u-modal v-model="infoSet1" @confirm="infoSet1=false,gotoUrl('pages/user/dataSet')" cancel-text="取消"
  75. confirm-text="完善个人信息" confirm-color="#53b56b" :show-cancel-button="true" ref="uModal2" :asyncClose="true">
  76. <view style="padding: 15px;">购买月卡需要完善以下2点<br />
  77. 1.填写真实姓名<br />
  78. 2.填写车牌号<br />
  79. </view>
  80. </u-modal>
  81. <img id="qrcode" style="display: none;">
  82. <!-- 须知 -->
  83. <view class="notice">
  84. <view class="title">
  85. 可享一个月充电服务费<span style="color:#ec4f27">全免</span>
  86. </view>
  87. <view class="line" >
  88. <!-- <view v-show="detail.type==1">· 仅限<b>非运营车</b>车主或<b>新用户</b>购买和使用</view>
  89. <view>· 在指定充电站充电时,此单服务费<b>全免</b></view>
  90. <view>· 不可抵扣电费、停车费、占位费</view> -->
  91. <view class="lineInfo" v-show="detail.type==1" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
  92. <view class="lineSvg">
  93. <img src="@/assets/img/buy/bus2.svg">
  94. </view>
  95. <view class="lineView">
  96. <view class="lineTitle">适用车主</view>
  97. <p class="linep">仅限非运营车车主或新用户购买和使用</p>
  98. </view>
  99. </view>
  100. <view class="lineInfo" v-show="detail.type==2" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
  101. <view class="lineSvg">
  102. <img src="@/assets/img/buy/bus.svg">
  103. </view>
  104. <view class="lineView">
  105. <view class="lineTitle">适用车主</view>
  106. <p class="linep">适合运营车车主购买和使用</p>
  107. </view>
  108. </view>
  109. <view class="lineInfo" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
  110. <view class="lineSvg">
  111. <img src="@/assets/img/buy/fee.svg">
  112. </view>
  113. <view class="lineView">
  114. <view class="lineTitle">充电免服务费</view>
  115. <p class="linep">在指定站点充电时,此单服务费全免</p>
  116. </view>
  117. </view>
  118. <view class="lineInfo" :class="detail.type==1?'lineInfo1':'lineInfo2'" >
  119. <view class="lineSvg">
  120. <img src="@/assets/img/buy/tips.svg">
  121. </view>
  122. <view class="lineView">
  123. <view class="lineTitle">注意事项</view>
  124. <p class="linep">不可抵扣电费、停车费、占位费</p>
  125. </view>
  126. </view>
  127. </view>
  128. <u-divider fontSize="36" border-color="#bbc039" color="#101010">购卡须知</u-divider>
  129. <view class="text">
  130. <view class="num">
  131. 01
  132. </view>
  133. <view class="">
  134. 充电月卡默认与购卡人账户进行关联,所涉权益仅可绑定单个车牌,即账户、月卡、车牌三者关联形成一个权益主体。
  135. </view>
  136. </view>
  137. <view class="text">
  138. <view class="num">
  139. 02
  140. </view>
  141. <view class="">
  142. 充电月卡有效期内,持卡人在指定充电站为绑定车辆充电,可享受充电服务费全免。持卡人给非绑定车辆充电,将正常收取充电服务费。
  143. </view>
  144. </view>
  145. <view class="text">
  146. <view class="num">
  147. 03
  148. </view>
  149. <view class="">
  150. 如车牌等信息填写错误,请致电售后客服进行处理。
  151. </view>
  152. </view>
  153. <view class="text">
  154. <view class="num">
  155. 04
  156. </view>
  157. <view class="">
  158. 本卡一经售出,不支持任何形式的退换。
  159. </view>
  160. </view>
  161. <!-- <view
  162. @click="gotoUrl('pages/monthlyCardActivity/monthlyCardList?cardId='+(ispay?userCard.rentCardId:cardId))">
  163. 适用<br/>
  164. 站点
  165. </view> -->
  166. </view>
  167. <view class="notice2">
  168. <view class="titleHead">适用充电站点</view>
  169. <!-- 附近站点 -->
  170. <view class="station" v-for="(stationData,i) in pageListGetObj.list" :key="i"
  171. @click="gotoUrl('pages/searchPile/stationAndPile/stationDetails?id=' + stationData.id)">
  172. <view class="head">
  173. <view class="title oldTextjp" oldstyle="font-size: 20px;">
  174. {{stationData.name}}
  175. </view>
  176. <view class="distance ">
  177. <!-- <text class="iconfont" style="color:#666666">&#xe615;</text>{{stationData.distance!=null&&stationData.distance>0.1 ? stationData.distance.toFixed(1)+'公里':'小于100米'}} -->
  178. </view>
  179. </view>
  180. <view class="sign" v-if="stationData.stationType==50">
  181. {{stationData.address}}
  182. </view>
  183. <view class="sign" v-else>
  184. <!-- -->
  185. <view class="sign-1"
  186. v-if="stationData.giveDiscount&&stationData.discountRatio&&stationData.discountRatio!=100">
  187. 会员服务费{{discountRatio10(stationData.discountRatio)}}折</view>
  188. <view class="sign-3" v-if="stationData.category=='超充'">160kW超充站</view>
  189. <view class="sign-4"
  190. v-if="stationData.nightLowPriceEnabled">
  191. 夜间超低价</view>
  192. <view class="sign-2" v-if="stationData.tagList.length != 0"
  193. v-for="(tagName,tagIndex) in stationData.tagList" :key="tagIndex">{{tagName}}</view>
  194. </view>
  195. <view class="price-free oldTextClass">
  196. <view class="price" v-if="userInfo&&userInfo.userType==2">
  197. <view class="price-1">
  198. <text class="num">
  199. {{!stationData.giveDiscount ? (stationData.electricityPrice+stationData.servicePrice).toFixed(2)
  200. : (stationData.electricityPrice+stationData.discountServicePrice).toFixed(2)}}</text>
  201. <text class="unit " oldstyle="font-size: 48rpx;">元/度</text>
  202. </view>
  203. <view class="price-2 " oldstyle="font-size: 48rpx;" v-if="stationData.giveDiscount">
  204. <text
  205. class="num">{{(stationData.electricityPrice+stationData.servicePrice).toFixed(2)}}</text>
  206. <text class="unit ">元/度</text>
  207. </view>
  208. </view>
  209. <!-- 游客价格-->
  210. <view class="price" v-else>
  211. <view class="price-1">
  212. <text class="num">
  213. {{(stationData.electricityPrice+stationData.servicePrice).toFixed(2)}}</text>
  214. <text class="unit " oldstyle="font-size: 48rpx;">元/度</text>
  215. </view>
  216. <view class="price-3 " oldstyle="font-size: 48rpx;" v-if="stationData.giveDiscount">
  217. <text class="num1">会员</text>
  218. <text class="num">{{ (stationData.electricityPrice+stationData.discountServicePrice).toFixed(2)}}</text>
  219. <text class="unit ">元/度</text>
  220. </view>
  221. </view>
  222. <view class="free">
  223. <view class="fast" v-if="stationData.fastNum">
  224. <view class="fast-font">
  225. </view>
  226. <view class="num">
  227. {{stationData.fastAvailableNum}}/{{stationData.fastNum}}
  228. </view>
  229. </view>
  230. <view class="slow oldTextjp2" oldstyle="margin-left: 1px;" v-if="stationData.slowNum">
  231. <view class="slow-font">
  232. </view>
  233. <view class="num">
  234. {{stationData.slowAvailableNum}}/{{stationData.slowNum}}
  235. </view>
  236. </view>
  237. </view>
  238. </view>
  239. </view>
  240. <view class="bottom" @click="getPageList(true)"
  241. v-if="pageListGetObj.recordsTotal!=pageListGetObj.list.length">
  242. <view class="bot">
  243. <view class="bot-line"></view>
  244. <view class="bot-text " style="color: #00B962;text-align: center;margin-top: 10px">
  245. 点击查看更多(共{{pageListGetObj.recordsTotal}}站点)</view>
  246. <view class="bot-line"></view>
  247. </view>
  248. </view>
  249. <view class="bottom" v-else>
  250. <view class="bot">
  251. <view class="bot-line"></view>
  252. <view class="bot-text " style="color: #00B962;text-align: center;margin-top: 10px;">已经到底了</view>
  253. <view class="bot-line"></view>
  254. </view>
  255. </view>
  256. <view class="upupupView" v-show="flag==1">
  257. <view class="upupupImg">
  258. <img src="@/assets/img/upupup.svg">
  259. </view>
  260. <p>上划查看更多内容</p>
  261. </view>
  262. </view>
  263. <!-- 按钮 -->
  264. <view class="button" v-if="!ispay">
  265. <button class="btn " v-if="userInfo.userType=='1'">游客无法购买月卡
  266. </button>
  267. <button class="btn " v-else-if="!isReady">加载中
  268. </button>
  269. <button class="btn " v-else-if="ispay"> {{userCard&&ispay?userCard.endTime:''}}到期
  270. </button>
  271. <button class="btn " v-else-if="!endCardBool">已下架
  272. </button>
  273. <button class="btn " v-else-if="!show2" @click="gotoGz">关注公众号
  274. </button>
  275. <button class="btn " v-else-if="!infoSet" @click="gotoUrl('pages/user/dataSet')">完善个人信息
  276. </button>
  277. <button class="btn " v-else-if="!cardList.length" @click="putShelf">已下架
  278. </button>
  279. <button class="btn " @click="show = true" v-else-if="detail.isVip">
  280. <text style="font-size: 14px;">¥</text>
  281. <span>{{detail.price}}</span>
  282. <text class="price">{{detail.oldPrice}}</text>开通充电月卡
  283. <view class="position">
  284. <view id="talkbubble">{{detail.platformText}}车主</view>
  285. </view>
  286. </button>
  287. <button class="btn " @click="show = true" v-else>
  288. <text style="font-size: 14px;"></text>
  289. <span style="margin-right: 8px;">{{detail.price}}元</span>
  290. <text v-if="detail.discount" class="price">{{detail.oldPrice}}</text> 开通服务费包月会员
  291. <view class="position" v-if="detail.remark2">
  292. <view id="talkbubble">{{detail.remark2}}</view>
  293. </view>
  294. </button>
  295. <view class="hint">
  296. 开通表示阅读并同意<span @click="gotoUrl('pages/article/details?code=FWFZKXY')"
  297. style="text-decoration:underline;color: #C07C38;">《服务费折扣协议》</span>
  298. </view>
  299. </view>
  300. <u-modal v-model="show3" @confirm="confirmPhone" confirm-text="拨打电话" confirm-color="#606266"
  301. :show-cancel-button="true" ref="uModal" :asyncClose="true" title="客服电话" :content="consumerPhone"
  302. :content-style="{fontSize: '24px',color: '#101010'}"></u-modal>
  303. <Tabbar :current="1" ref="tabbarMain" :elderStatus="elderStatus"></Tabbar>
  304. </view>
  305. </template>
  306. <script>
  307. import * as API_weixin from '@/apis/weixin.js'
  308. import * as API_site from '@/apis/site.js';
  309. import * as Pay from '@/apis/weixin.js'
  310. import * as API from '@/apis/card.js'
  311. import * as loginApi from '@/apis/login.js'
  312. import Tabbar from '@/components/Tabbar.vue';
  313. import QRCode from 'qrcodejs2'
  314. import {
  315. newDate,
  316. convertCanvasToImage,
  317. } from '@/utils'
  318. import {
  319. wxPayJs
  320. } from '@/utils/wxpay'
  321. export default {
  322. components: {
  323. Tabbar
  324. },
  325. data() {
  326. return {
  327. description: '盟主能量包本期限时优惠活动将于9月16日结束。',
  328. checked: "false",
  329. cardId: '',
  330. qrCodeImg: "",
  331. showModel: false,
  332. cardList: [],
  333. pageList: [],
  334. projectName: "",
  335. list: [{
  336. text: '微信',
  337. }, {
  338. text: '支付宝'
  339. }],
  340. show: false,
  341. submitForm: {},
  342. ykgz: '',
  343. detail: {},
  344. ispay: false,
  345. show3: false,
  346. show2: false,
  347. show1: false,
  348. infoSet: false,
  349. infoSet1: false,
  350. userCard: null,
  351. isReady: false,
  352. userInfo: {},
  353. elderStatus: false,
  354. consumerPhone: "",
  355. scrollLeftSet: 0,
  356. scrollLeftOldSet: 0,
  357. scrollLeftSetBl: false,
  358. flag: 0, //0 初始化, 1 ,开始判断, 2已经滑动
  359. }
  360. },
  361. onLoad() {
  362. this.projectName = process.car.ProjectName;
  363. },
  364. onReady() {
  365. var consumerPhone = this.carhelp.getConfig().consumerPhone
  366. // img="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  367. if (consumerPhone) {
  368. this.consumerPhone = consumerPhone
  369. }
  370. this.ykgz = this.carhelp.getConfig().ykgz
  371. //this.checkSubscribe()
  372. },
  373. onShow() {
  374. if (this.carhelp.get("getElderModeClass") == "长辈模式") {
  375. this.elderStatus = true;
  376. } else {
  377. this.elderStatus = false;
  378. }
  379. if (this.$refs.tabbarMain) {
  380. this.$refs.tabbarMain.setcount(1);
  381. }
  382. this.checkSubscribe();
  383. // this.getCardList();
  384. // this.show2 = true;
  385. },
  386. computed: {
  387. pageListGetObj() {
  388. var cardId = this.cardId
  389. if (this.ispay) {
  390. cardId = this.userCard.rentCardId;
  391. }
  392. var i = this.pageList.findIndex(item => {
  393. return item.monthlyRentCardId == cardId
  394. })
  395. if (i == -1)
  396. return {
  397. list: []
  398. }
  399. else
  400. return this.pageList[i]
  401. },
  402. endCardBool() {
  403. if (!this.cardList.length) {
  404. return false;
  405. }
  406. var date = new Date().getTime()
  407. if (!this.detail.endTime) {
  408. return true;
  409. }
  410. var date2 = newDate(this.detail.endTime).getTime();
  411. if (date < date2) {
  412. return true;
  413. } else {
  414. return false;
  415. }
  416. }
  417. },
  418. onPageScroll(e) {
  419. if (this.flag == 1) {
  420. if (e.scrollTop >= 50) {
  421. this.flag = 2;
  422. } else {
  423. }
  424. }
  425. },
  426. methods: {
  427. scrolltolower: function(e) {
  428. //
  429. },
  430. scrolltoupper: function(e) {
  431. //this.scrollLeftSetBl=false;
  432. },
  433. scroll: function(e) {
  434. if (this.scrollLeftSetBl) {
  435. return
  436. }
  437. this.scrollLeftSetBl = true;
  438. var scrollWidth = e.detail.scrollWidth
  439. if (e.detail.deltaX > 0) {
  440. //右移动
  441. this.scrollLeftSet = 0;
  442. this.checkboxChange(this.cardList[0].monthlyRentCard)
  443. } else {
  444. //左移动
  445. this.scrollLeftSet = scrollWidth
  446. if (this.cardList.length > 1) {
  447. this.checkboxChange(this.cardList[1].monthlyRentCard)
  448. }
  449. }
  450. this.scrollLeftSetBl = false;
  451. //this.old.scrollTop = e.detail.scrollTop
  452. this.scrollLeftOldSet = e.detail.scrollLeft
  453. },
  454. confirmPhone() {
  455. this.show = false;
  456. uni.makePhoneCall({
  457. phoneNumber: this.consumerPhone //仅为示例
  458. });
  459. },
  460. openModal() {
  461. this.show3 = true;
  462. },
  463. checkboxChange(monthlyRentCard) {
  464. this.detail = monthlyRentCard;
  465. this.cardId = monthlyRentCard.id
  466. monthlyRentCard.checked = true
  467. for (var i in this.cardList) {
  468. var obj = this.cardList[i].monthlyRentCard;
  469. if (this.cardId == obj.id) {
  470. } else {
  471. obj.checked = false
  472. }
  473. }
  474. this.getPageList(false);
  475. },
  476. gotoGz() {
  477. this.carhelp.setGzDate()
  478. var url = "https://mp.weixin.qq.com/s/mCHz1nNvg0xAICiBeIyKRQ";
  479. window.location.href = url
  480. },
  481. checkSubscribe() {
  482. uni.showLoading({
  483. title: "加载中",
  484. mask: true,
  485. })
  486. API_weixin.checkSubscribe({
  487. openId: this.carhelp.getOpenId()
  488. }).then((res) => {
  489. uni.hideLoading()
  490. if (res.data == "0") {
  491. this.show1 = true
  492. } else {
  493. //this.getInfo();
  494. this.getCardList();
  495. this.show2 = true;
  496. //this.carhelp.setGzDate()
  497. }
  498. //setGzDate
  499. }).catch(error => {
  500. uni.showToast({
  501. title: error
  502. })
  503. })
  504. },
  505. userCardBool(userCard) {
  506. if (userCard) {
  507. var date = new Date().getTime()
  508. var date2 = newDate(userCard.endTime).getTime();
  509. if (date < date2) {
  510. return true;
  511. }
  512. }
  513. return false
  514. },
  515. getCardList() {
  516. uni.showLoading({
  517. title: "加载中",
  518. mask: true,
  519. })
  520. API.cardList({
  521. }).then((response) => {
  522. this.cardList = response.data.cardList;
  523. for (var i in this.cardList) {
  524. var obj = this.cardList[i].monthlyRentCard
  525. //不打折的卡
  526. obj.remark2 = obj.remark;
  527. if (obj.oldPrice) {
  528. if (!obj.discount && obj.couponRemark) {
  529. obj.remark2 = obj.couponRemark
  530. if (!obj.remark) {
  531. obj.remark = "月卡优惠券"
  532. }
  533. }
  534. obj.discount = true
  535. }
  536. }
  537. if (this.cardList.length) {
  538. this.detail = this.cardList[0].monthlyRentCard
  539. this.cardId = this.detail.id;
  540. this.cardList[0].monthlyRentCard.checked = true
  541. if (this.pageList.length == 0) {
  542. this.pageList = this.cardList.map(item => {
  543. return {
  544. recordsTotal: -1,
  545. monthlyRentCardId: item.monthlyRentCard.id,
  546. list: [],
  547. pageIndex: 1,
  548. }
  549. })
  550. this.getPageList(false);
  551. }
  552. //this.pageList.map(item)
  553. }
  554. this.getUserInfo()
  555. this.isReady = true;
  556. //cardId: this.cardId
  557. }).catch(error => {
  558. uni.showToast({
  559. title: error
  560. })
  561. })
  562. },
  563. getPageList(bl) {
  564. var cardId = this.cardId
  565. if (this.ispay) {
  566. cardId = this.userCard.rentCardId;
  567. }
  568. var i = this.pageList.findIndex(item => {
  569. return item.monthlyRentCardId == cardId
  570. })
  571. var data = {
  572. monthlyRentCardId: cardId,
  573. online: 0,
  574. pageSize: 6,
  575. }
  576. if (this.carhelp.getPersonInfo()) {
  577. data.openId = this.carhelp.getOpenId()
  578. }
  579. if (i > -1) {
  580. if (bl) {
  581. this.pageList[i].pageIndex += 1;
  582. } else {
  583. if (this.pageList[i].recordsTotal == -1) {
  584. } else {
  585. return
  586. }
  587. }
  588. data.pageIndex = this.pageList[i].pageIndex
  589. } else {
  590. return
  591. }
  592. uni.showLoading({
  593. title: "加载中",
  594. mask: true,
  595. })
  596. var list = this.pageList[i].list;
  597. API_site.getChargingStationData(data).then((response) => {
  598. console.log(response)
  599. list = [
  600. ...list,
  601. ...response.data.data
  602. ];
  603. this.pageList[i].recordsTotal = response.data.recordsTotal;
  604. this.pageList[i].list = list;
  605. uni.hideLoading()
  606. }).catch(error => {
  607. uni.showToast({
  608. title: error
  609. })
  610. })
  611. },
  612. getUserInfo() {
  613. uni.showLoading({
  614. title: "加载中",
  615. mask: true,
  616. })
  617. loginApi.findByOpenId({
  618. openId: this.carhelp.getOpenId(),
  619. noerror: true
  620. }).then((res) => {
  621. if (res.code == 200 && res.result) {
  622. if (res.data.regUser) {
  623. var userInfo = res.data.regUser
  624. this.userInfo = userInfo;
  625. if (userInfo.userType == "1") {
  626. } else if (userInfo.carId && userInfo.realName) {
  627. this.infoSet = true;
  628. } else {
  629. this.infoSet = false;
  630. if (this.endCardBool) {
  631. this.infoSet1 = true;
  632. }
  633. }
  634. var userCard = res.data.userCard;
  635. this.userCard = userCard
  636. this.ispay = this.userCardBool(userCard)
  637. } else {
  638. }
  639. if (this.flag == 0) {
  640. this.flag = 1;
  641. setTimeout(() => {
  642. this.flag = 2;
  643. }, 5000)
  644. }
  645. }
  646. uni.hideLoading();
  647. }).catch(error => {
  648. uni.showToast({
  649. title: error,
  650. icon: "none"
  651. })
  652. })
  653. },
  654. putShelf2() {
  655. uni.showToast({
  656. title: "暂不支持重复购买"
  657. })
  658. },
  659. putShelf() {
  660. uni.showToast({
  661. title: "已下架,暂不支持购买"
  662. })
  663. },
  664. getInfo() {
  665. uni.showLoading({
  666. title: "加载中",
  667. mask: true,
  668. })
  669. API.cardDetail({
  670. cardId: this.cardId
  671. }).then((response) => {
  672. this.detail = response.data.monthlyRentCard
  673. uni.hideLoading()
  674. }).catch(error => {
  675. uni.showToast({
  676. title: error
  677. })
  678. })
  679. },
  680. submit(type) {
  681. if (!this.endCardBool) {
  682. return
  683. }
  684. uni.showLoading({
  685. title: "加载中",
  686. mask: true,
  687. })
  688. API.openCard({
  689. cardId: this.cardId
  690. }).then((response) => {
  691. this.submitForm.id = response.data.orderInfoId
  692. if (type == 0) {
  693. this.wxpy()
  694. }
  695. if (type == 1) {
  696. this.alpy()
  697. }
  698. }).catch(error => {
  699. uni.showToast({
  700. title: error
  701. })
  702. })
  703. },
  704. alpy() {
  705. uni.showLoading({
  706. title: "加载中",
  707. mask: true,
  708. })
  709. var listcanvas = document.getElementsByTagName('canvas')
  710. if (listcanvas.length > 0) {
  711. document.getElementById("qrcode").removeChild(document.getElementsByTagName('canvas')[0]);
  712. }
  713. Pay.alpay(this.submitForm).then((response) => {
  714. let qrcode = new QRCode('qrcode', {
  715. width: 200,
  716. height: 200,
  717. text: response.data.qr_code,
  718. correctLevel: QRCode.CorrectLevel.M,
  719. })
  720. this.outOrderNo = response.data.outOrderNo;
  721. var canvas = document.getElementsByTagName('canvas')[0];
  722. this.qrCodeImg = convertCanvasToImage(canvas);
  723. uni.hideLoading()
  724. this.showModel = true
  725. }).catch(error => {
  726. uni.showToast({
  727. title: error
  728. })
  729. })
  730. },
  731. wxpy() {
  732. Pay.wxpay(this.submitForm).then((response) => {
  733. if (!response.result) {
  734. uni.showToast({
  735. title: response.message
  736. })
  737. return
  738. }
  739. var data = response.data
  740. uni.hideLoading()
  741. //("Pay+"+new Date().getTime())
  742. wxPayJs(data);
  743. }).catch(error => {
  744. uni.showToast({
  745. title: error
  746. })
  747. })
  748. },
  749. confirm() {
  750. this.getUserInfo();
  751. uni.redirectTo({
  752. url: "/pages/user/finance/rechargeRes?id=" + this.outOrderNo
  753. })
  754. },
  755. click(index) {
  756. console.log(`点击了第${index + 1}项,内容为:${this.list[index].text}`)
  757. this.submit(index);
  758. }
  759. }
  760. }
  761. </script>
  762. <style>
  763. @keyframes movepoint {
  764. 25% {
  765. top: 10px;
  766. }
  767. 100% {
  768. top: 15px;
  769. }
  770. }
  771. .upupupImg {
  772. height: 80px;
  773. }
  774. .upupupView {
  775. text-align: center;
  776. font-size: 12px;
  777. padding: 30rpx;
  778. border-radius: 12px;
  779. position: absolute;
  780. background: rgb(0 0 0 / 70%);
  781. top: 50%;
  782. transform: translate(-50%);
  783. left: 50%;
  784. color: #fff;
  785. }
  786. .upupupView img {
  787. top: 15px;
  788. position: relative;
  789. width: 60px;
  790. animation: movepoint 2s infinite;
  791. -webkit-animation: movepoint 2s infinite;
  792. }
  793. </style>
  794. <style lang="scss" scoped>
  795. .scroll-Y {
  796. height: 300rpx;
  797. }
  798. .scroll-view_H {
  799. white-space: nowrap;
  800. width: 100%;
  801. }
  802. .scroll-view-item {
  803. height: 300rpx;
  804. line-height: 300rpx;
  805. text-align: center;
  806. font-size: 36rpx;
  807. }
  808. .scroll-view-item_H {
  809. display: inline-block;
  810. width: 85%;
  811. //height: 300rpx;
  812. line-height: 300rpx;
  813. text-align: center;
  814. font-size: 36rpx;
  815. }
  816. .service {
  817. font-size: 24px;
  818. color: #fff;
  819. position: absolute;
  820. right: 16px;
  821. }
  822. /deep/.u-alert-desc {
  823. color: #ff7300;
  824. }
  825. // 卡片
  826. .main {
  827. background-color: #404A5E;
  828. padding: 40rpx 0 0 0;
  829. z-index: 80;
  830. .tag {
  831. position: absolute;
  832. background-color: rgba(255, 61, 0, 100);
  833. color: #ffffff;
  834. font-size: 24rpx;
  835. text-align: center;
  836. line-height: 40rpx;
  837. padding: 0 12rpx;
  838. right: 26rpx;
  839. top: 0rpx;
  840. border-radius: 0 12px 0 12px;
  841. }
  842. // @media screen and (max-width:320px) {
  843. // .tag {
  844. // padding: 0 4rpx;
  845. // }
  846. // .price {
  847. // position: absolute;
  848. // top: 24rpx !important;
  849. // right: 32rpx !important;
  850. // }
  851. // .current-price {
  852. // font-size: 36rpx;
  853. // }
  854. // }
  855. .price {
  856. top: -90rpx;
  857. right: 76rpx;
  858. position: absolute;
  859. p {
  860. text-align: right;
  861. color: rgba(0, 0, 0, 0.5);
  862. font-size: 12px;
  863. position: relative;
  864. top: -250rpx;
  865. }
  866. }
  867. .current-price {
  868. font-size: 48rpx;
  869. color: #101010;
  870. text-align: right;
  871. text {
  872. font-size: 28rpx;
  873. }
  874. }
  875. .original-cost {
  876. color: rgba(75, 65, 50, 100);
  877. text-decoration: line-through;
  878. margin-bottom: 6rpx;
  879. }
  880. /deep/.u-iconfont {
  881. font-size: 36rpx !important;
  882. }
  883. .card-0 {}
  884. .card-0 {
  885. background-position-x: 40rpx;
  886. }
  887. .cardtab {
  888. margin-top: 32rpx;
  889. position: relative;
  890. background-size: 90% 100%;
  891. background-repeat: no-repeat;
  892. height: 200rpx;
  893. /deep/.u-checkbox__icon-wrap {
  894. background-color: #607d8b;
  895. opacity: 0.3
  896. }
  897. .radio-box {
  898. position: absolute;
  899. right: 0;
  900. bottom: 40rpx;
  901. }
  902. }
  903. }
  904. // 按钮
  905. .button {
  906. position: fixed;
  907. margin-top: -20rpx;
  908. width: 100%;
  909. bottom: 40px;
  910. border-radius: 16px 16px 0px 0px;
  911. padding: 20px 20px 24px 20px;
  912. background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.75) 67%, rgba(255, 255, 255, 1) 84%);
  913. uni-button:after {
  914. border: none;
  915. }
  916. .btn {
  917. border: none !important;
  918. background: linear-gradient(#D8A05B, #C07C38);
  919. box-shadow: 0px 2px 6px 0px rgba(207, 175, 118, 40);
  920. border-radius: 50px;
  921. color: #FFF;
  922. font-size: 18px !important;
  923. line-height: 44px;
  924. height: 44px;
  925. overflow: inherit !important;
  926. .price {
  927. text-decoration: line-through;
  928. margin: auto 4px;
  929. font-size: 12px
  930. }
  931. }
  932. .hint {
  933. color: rgba(159, 157, 154, 100);
  934. line-height: 20px;
  935. text-align: center;
  936. margin-top: 8px;
  937. }
  938. .btn-2 {
  939. position: relative;
  940. }
  941. .position {
  942. position: absolute;
  943. top: -16px;
  944. left: 24%;
  945. z-index: 999;
  946. }
  947. #talkbubble {
  948. position: absolute;
  949. top: 0;
  950. left: 0;
  951. padding: 0 10px;
  952. line-height: 20px;
  953. font-size: 12px;
  954. color: #fff;
  955. background: red;
  956. position: relative;
  957. border-radius: 10px;
  958. text-align: center;
  959. }
  960. #talkbubble:before {
  961. content: "";
  962. position: absolute;
  963. top: 100%;
  964. //right: 45%;
  965. border-top: 5px solid red;
  966. border-right: 5px solid transparent;
  967. border-left: 5px solid transparent;
  968. }
  969. }
  970. .notice2 {
  971. padding: 0 0 120px 0;
  972. .titleHead {
  973. color: #101010;
  974. font-size: 40rpx;
  975. text-align: center;
  976. margin-bottom: 10px;
  977. }
  978. }
  979. // 须知
  980. .notice {
  981. top: -15px;
  982. border-radius: 15px 15px 0 0;
  983. position: relative;
  984. .title {
  985. color: rgba(51, 51, 51, 1);
  986. font-size: 40rpx;
  987. text-align: center;
  988. margin-bottom: 30rpx;
  989. }
  990. .line {
  991. margin-bottom: 40rpx;
  992. color: #666666;
  993. font-size: 34rpx;
  994. line-height: 52rpx;
  995. .lineInfo1{
  996. border: 1px solid #D5C5B5;
  997. background-color: #fef9f5;
  998. }
  999. .lineInfo2{
  1000. border: 1px solid #79ACDB ;
  1001. background-color: #ffffff;
  1002. }
  1003. .lineInfo{
  1004. margin-right: 20rpx;
  1005. display: flex;
  1006. padding: 20rpx 15rpx 15rpx 10rpx;
  1007. border-radius: 10px;
  1008. margin-bottom: 16rpx;
  1009. .lineSvg{
  1010. padding-top: 2px;
  1011. margin: auto 16rpx;
  1012. img{
  1013. width: 70rpx;
  1014. color:#62574C ;
  1015. }
  1016. }
  1017. .lineView{
  1018. .lineTitle{
  1019. color:#62574C;
  1020. font-size: 36rpx;
  1021. }
  1022. .linep{
  1023. color:#8A7B6C;
  1024. font-size: 28rpx;
  1025. line-height: 28rpx;
  1026. }
  1027. }
  1028. }
  1029. }
  1030. background-color: #fff;
  1031. padding: 30rpx 30rpx 30rpx 50rpx;
  1032. /deep/.u-divider {
  1033. margin-bottom: 16px !important;
  1034. }
  1035. .text {
  1036. color: #666666;
  1037. margin-bottom: 12px;
  1038. line-height: 24px;
  1039. display: flex;
  1040. .num {
  1041. margin-right: 8px;
  1042. }
  1043. }
  1044. }
  1045. .carNone {
  1046. display: flex;
  1047. flex-direction: column;
  1048. justify-content: center;
  1049. align-items: center;
  1050. img {
  1051. width: 100%;
  1052. height: 100%;
  1053. }
  1054. p {
  1055. margin-top: -60px;
  1056. }
  1057. }
  1058. .slogan-4 {
  1059. margin-top: 10px;
  1060. /* text-decoration: underline; */
  1061. color: #9F9C99;
  1062. text-align: center;
  1063. position: fixed;
  1064. /* top: 40px; */
  1065. bottom: 40px;
  1066. right: 20px;
  1067. height: 55px;
  1068. width: 55px;
  1069. line-height: 20px;
  1070. font-size: 16px;
  1071. background: linear-gradient(45deg, #4BD2C0, rgb(72, 218, 149));
  1072. box-shadow: 0 4rpx 24rpx 0 rgb(72, 218, 149);
  1073. padding-top: 8px;
  1074. color: #fff;
  1075. border-radius: 25px;
  1076. }
  1077. .station,
  1078. .location,
  1079. .state1 {
  1080. box-shadow: 0px 4rpx 12rpx 0px #008c4a33;
  1081. }
  1082. // 附近站点改版
  1083. .station {
  1084. width: 91.4%;
  1085. border-radius: 8px;
  1086. padding: 12px 12px 12px 11px;
  1087. background-color: #fff;
  1088. margin: 8px auto 0;
  1089. .head {
  1090. display: flex;
  1091. justify-content: space-between;
  1092. align-items: center;
  1093. .title {
  1094. color: rgba(16, 16, 16, 100);
  1095. font-size: 32rpx;
  1096. font-weight: 550;
  1097. width: 440rpx;
  1098. text-overflow: ellipsis;
  1099. overflow: hidden;
  1100. white-space: nowrap;
  1101. }
  1102. .distance {
  1103. width: 180rpx;
  1104. color: rgba(102, 102, 102, 100);
  1105. font-size: 32rpx;
  1106. text-align: end;
  1107. .iconfont {
  1108. font-size: 24rpx;
  1109. margin-right: 4rpx;
  1110. }
  1111. }
  1112. }
  1113. .sign {
  1114. display: flex;
  1115. flex-wrap: wrap;
  1116. margin-top: 16rpx;
  1117. .sign-1 {
  1118. line-height: 40rpx;
  1119. border-radius: 8rpx;
  1120. background-color: rgba(255, 255, 255, 100);
  1121. color: rgba(255, 139, 0, 100);
  1122. font-size: 24rpx;
  1123. text-align: center;
  1124. border: 1px solid rgba(255, 139, 0, 100);
  1125. padding: 0 8rpx;
  1126. margin-right: 16rpx;
  1127. margin-bottom: 8rpx;
  1128. }
  1129. .sign-2 {
  1130. line-height: 40rpx;
  1131. border-radius: 8rpx;
  1132. background-color: rgba(255, 255, 255, 100);
  1133. color: rgba(153, 153, 153, 100);
  1134. font-size: 24rpx;
  1135. text-align: center;
  1136. border: 1px solid rgba(204, 204, 204, 100);
  1137. padding: 0 8rpx;
  1138. margin-right: 16rpx;
  1139. margin-bottom: 8rpx;
  1140. }
  1141. .sign-3 {
  1142. line-height: 40rpx;
  1143. border-radius: 8rpx;
  1144. background-color: rgba(255, 255, 255, 100);
  1145. color: #8161FF;
  1146. font-size: 24rpx;
  1147. text-align: center;
  1148. border: 1px solid #8161FF;
  1149. padding: 0 8rpx;
  1150. margin-right: 16rpx;
  1151. margin-bottom: 8rpx;
  1152. }
  1153. .sign-4 {
  1154. line-height: 40rpx;
  1155. border-radius: 8rpx;
  1156. background-color: rgba(255, 255, 255, 100);
  1157. color: #00B962;
  1158. font-size: 24rpx;
  1159. text-align: center;
  1160. border: 1px solid #00B962;
  1161. padding: 0 8rpx;
  1162. margin-right: 16rpx;
  1163. margin-bottom: 8rpx;
  1164. }
  1165. }
  1166. .price-free {
  1167. display: flex;
  1168. justify-content: space-between;
  1169. margin-top: 8rpx;
  1170. .price {
  1171. display: flex;
  1172. align-items: baseline;
  1173. }
  1174. .price-1 {
  1175. .num {
  1176. color: rgba(255, 98, 0, 100);
  1177. font-size: 44rpx;
  1178. }
  1179. .unit {
  1180. font-size: 12px;
  1181. color: rgba(153, 153, 153, 100);
  1182. }
  1183. }
  1184. .price-3 {
  1185. font-size: 24rpx;
  1186. color: #fff;
  1187. margin-left: 8rpx;
  1188. padding-right: 9rpx;
  1189. background:#00B962 ;
  1190. border-radius: 8rpx;
  1191. .num1{
  1192. padding-left: 12rpx;
  1193. border-radius: 8rpx 0 8rpx 8rpx;
  1194. padding-right: 18rpx;
  1195. background: #121212;
  1196. -webkit-clip-path: polygon(0 0, 93% 0, 84% 100%, 0% 100%);
  1197. clip-path: polygon(0 0, 93% 0, 84% 100%, 0% 100%);
  1198. }
  1199. }
  1200. .price-2 {
  1201. font-size: 24rpx;
  1202. color: rgba(153, 153, 153, 100);
  1203. margin-left: 8rpx;
  1204. text-decoration: line-through;
  1205. }
  1206. }
  1207. .free {
  1208. display: flex;
  1209. align-items: center;
  1210. .slow,
  1211. .fast {
  1212. display: flex;
  1213. .sp-font {
  1214. width: 40rpx;
  1215. height: 40rpx;
  1216. line-height: 40rpx;
  1217. border-radius: 4px;
  1218. background-color: #7a68f6;
  1219. color: #fff;
  1220. font-size: 28rpx;
  1221. text-align: center;
  1222. margin-right: 2rpx;
  1223. }
  1224. .fast-font {
  1225. width: 40rpx;
  1226. height: 40rpx;
  1227. line-height: 40rpx;
  1228. border-radius: 8rpx;
  1229. background-color: rgba(186, 240, 215, 100);
  1230. color: rgba(0, 130, 69, 100);
  1231. font-size: 28rpx;
  1232. text-align: center;
  1233. margin-right: 8rpx;
  1234. }
  1235. .slow-font {
  1236. width: 40rpx;
  1237. height: 40rpx;
  1238. line-height: 40rpx;
  1239. border-radius: 8rpx;
  1240. background-color: rgba(226, 226, 226, 100);
  1241. color: rgba(128, 128, 128, 100);
  1242. font-size: 28rpx;
  1243. text-align: center;
  1244. margin-right: 8rpx;
  1245. }
  1246. .num {
  1247. font-size: 32rpx;
  1248. color: rgba(0, 145, 67, 100);
  1249. line-height: 40rpx;
  1250. }
  1251. }
  1252. .slow {
  1253. margin-left: 24rpx;
  1254. }
  1255. }
  1256. }
  1257. .user-card {
  1258. padding: 19px 0 39px 20px;
  1259. margin: 21px 20px 0 20px;
  1260. background: url(@/assets/img/companyVIP.png) no-repeat right, linear-gradient(to right, #C6D4ED, #DCE6F0) no-repeat;
  1261. box-shadow: 0px 0px 16px 0px rgba(14, 39, 84, 28);
  1262. border: 2px solid rgba(236, 239, 245, 100);
  1263. border-radius: 16px;
  1264. display: flex;
  1265. .head-img {
  1266. width: 48px;
  1267. height: 48px;
  1268. img {
  1269. width: 100%;
  1270. }
  1271. }
  1272. .user-name {
  1273. margin-left: 12px;
  1274. .name {
  1275. line-height: 24px;
  1276. color: rgba(33, 41, 48, 100);
  1277. font-size: 24px;
  1278. font-weight: 550;
  1279. }
  1280. .sign {
  1281. color: rgba(76, 89, 111, 100);
  1282. font-size: 16px;
  1283. line-height: 16px;
  1284. margin-top: 8px;
  1285. }
  1286. }
  1287. }
  1288. </style>