monthlyCardBuy.vue 33 KB

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