monthlyCardBuy.vue 30 KB

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