monthlyCardBuy.vue 31 KB

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