monthlyCardBuy.vue 34 KB

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