monthlyCardBuy.vue 31 KB

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