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