VipDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <template>
  2. <view :class="['qn-page-' + theme]">
  3. <view class="vimg">
  4. <view class="contAll">
  5. <image class="img" src="https://onlineimg.qianniao.vip/vip-icon.png" alt="" />
  6. <text class="contUser">{{ infoList.name }}</text>
  7. <text v-if="parseFloat(infoList.price) === 0 && parseInt(infoList.renew) === 4" class="cont_desc">免费领取</text>
  8. <text v-else-if="parseInt(infoList.renew) === 4" class="cont_desc">立即开通</text>
  9. <text v-else-if="parseInt(infoList.renew) === 5 && parseFloat(infoList.price) !== 0" class="cont_desc">立即续费</text>
  10. <text v-else class="cont_desc">{{ infoList.effectiveDate === 5 ? '长期有效' : (infoList.effectiveMonth || 0) + '个月' }}</text>
  11. </view>
  12. <view class="vip-head">
  13. <image class="vipCont" src="https://onlineimg.qianniao.vip/v-1.png"></image>
  14. <view class="vip-cont-in clearfix">
  15. <view class="float_left vipContit">
  16. <view v-if="infoList.vipDiscount === 5" class="openVip">
  17. 会员折扣
  18. <text class="vip-discount">{{ parseFloat(infoList.discount) }}</text>
  19. </view>
  20. <view v-else class="openVip">更多优惠</view>
  21. <view class="returnVip">专享会员权益</view>
  22. </view>
  23. <view class="float_right vipRight"><image src="https://onlineimg.qianniao.vip/v-2.png" alt="" /></view>
  24. </view>
  25. </view>
  26. </view>
  27. <view class="main_view">
  28. <text class="view_text vip-title-t">会员权益</text>
  29. <view class="content">
  30. <ul class="clearfix gqbm-ul">
  31. <li v-if="infoList.freeShipping === 5" class="quick-btn-item">
  32. <text class="ibonfont ibonbaoyou"></text>
  33. <view class="qt-tit">包邮特权</view>
  34. </li>
  35. <li v-if="infoList.vipDiscount === 5" class="quick-btn-item">
  36. <text class="ibonfont ibonhuiyuanqia-dazhe"></text>
  37. <view class="qt-tit">折扣特权</view>
  38. </li>
  39. <li v-if="infoList.hasMonthCoupon === 5" class="quick-btn-item">
  40. <text class="ibonfont ibonyouhuiquan"></text>
  41. <view class="qt-tit">优惠券特权</view>
  42. </li>
  43. </ul>
  44. </view>
  45. </view>
  46. <!-- <view class="vip-super">
  47. <img src="https://onlineimg.qianniao.vip/v-2.png" alt="">
  48. <text class="vip-title">超级会员权益</text>
  49. </view> -->
  50. <view class="main-get" v-if="infoList.hasMonthCoupon === 5">
  51. <text class="view_text">每月优惠券</text>
  52. <scroll-view scroll-x class="coupon-hua">
  53. <view class="ye_color clearfix" v-for="item in infoList.monthCoupon" :key="item.id">
  54. <view class="float_left coupon-price">
  55. <view class="vip-price">
  56. <text>{{ $_utils.formatNub(item.reducePrice) }}</text>
  57. </view>
  58. <view class="vip-coupon">优惠券</view>
  59. </view>
  60. <view class="float_left vip-line"></view>
  61. <view class="float_right coupon-desc">
  62. <view class="vip-coupon-desc coupon-b">{{ item.name }}</view>
  63. <view class="vip-coupon-desc">有效期:一个月</view>
  64. </view>
  65. </view>
  66. </scroll-view>
  67. <view class="look-coupon" v-if="infoList.hasBuy === 4 && infoList.hasReceived === 4">开卡后领取</view>
  68. <view class="look-coupon" @click="hasCoupon" v-else-if="infoList.hasReceived === 5 && infoList.hasBuy === 5">本月已经领取</view>
  69. <view class="look-coupon" @click="getCoupon" v-else-if="infoList.hasReceived === 4 && infoList.hasBuy === 5">一键领取并查看</view>
  70. </view>
  71. <view class="main_view view_li">
  72. <text class="view_text">使用说明</text>
  73. <view class="m_title"><textarea style="width:100%" :disabled="true" auto-height v-model="remark" /></view>
  74. </view>
  75. <view class="vip-bottom" v-if="parseFloat(infoList.price) > 0 || (parseInt(infoList.renew) === 4 && parseFloat(infoList.price) === 0)">
  76. <view class="vip-btn" v-if="parseFloat(infoList.price) === 0 && parseInt(infoList.renew) === 4" @click="noMoey"><text>免费领取</text></view>
  77. <view class="vip-btn" v-else-if="parseInt(infoList.renew) === 4" @click="goPay">
  78. 立即开通
  79. <text class="btn-text" v-if="infoList.effectiveMonth > 0">¥{{ $_utils.formatNub(infoList.price) }}/{{ infoList.effectiveMonth }}个月</text>
  80. <text v-else>/ 永久有效</text>
  81. </view>
  82. <view class="vip-btn" v-else-if="parseInt(infoList.renew) === 5 && parseFloat(infoList.price) !== 0" @click="goPay">
  83. 立即续费
  84. <text v-if="infoList.effectiveMonth > 0">¥{{ $_utils.formatNub(infoList.price) }}/{{ infoList.effectiveMonth }}个月</text>
  85. <text v-else>/ 永久有效</text>
  86. </view>
  87. </view>
  88. </view>
  89. </template>
  90. <script>
  91. export default {
  92. data() {
  93. return {
  94. vipId: '',
  95. infoList: {},
  96. source: '', //订单来源
  97. monthCouponIds: '',
  98. payInfo: '',
  99. remark: [],
  100. // 判断是否领取过
  101. received: ''
  102. };
  103. },
  104. onLoad(options) {
  105. this.vipId = options.id;
  106. this.source = this.$common.source();
  107. this.getVipInfo();
  108. },
  109. methods: {
  110. async goPay(item) {
  111. // if (this.$store.state.baseSet.personnelReview === 5) {
  112. // 验证账户状态
  113. this.userAudit();
  114. if (!this.isUserAudit) {
  115. return;
  116. }
  117. // }
  118. if (this.received === 5) {
  119. uni.showModal({
  120. title: '此会员卡购买成功后,其余拥有会员卡自动作废',
  121. success: async res => {
  122. if (res.confirm) {
  123. this.payCheck();
  124. }
  125. }
  126. });
  127. } else {
  128. this.payCheck();
  129. }
  130. },
  131. payCheck() {
  132. if (this.infoList.price > 0) {
  133. uni.navigateTo({
  134. url: `/pagesT/money/pay?price=${this.infoList.price}&vip=${1}&vipId=${this.infoList.id}`
  135. });
  136. } else {
  137. this.$u.api
  138. .createVipCardOrder({
  139. payType: 1,
  140. source: this.source,
  141. vipCardId: this.infoList.id
  142. })
  143. .then(({ data }) => {
  144. this.payInfo = data;
  145. if (this.payInfo.orderId) {
  146. this.$api.msg('免费领取成功,请在我的会员卡里查看');
  147. this.getlist();
  148. }
  149. });
  150. }
  151. },
  152. // 已经领取过,仅作提示语
  153. claimed() {
  154. this.$api.msg('免费会员卡只可领取一次,不能重复领取');
  155. },
  156. hasCoupon() {
  157. this.$api.msg('优惠券每月只可领取一次,不能重复领取');
  158. },
  159. getVipInfo() {
  160. this.$u.api.getVipInfo(this.vipId).then(({ data }) => {
  161. this.infoList = data;
  162. this.remark = this.infoList.remark.split('/n');
  163. this.monthCouponIds = data.monthCouponIds;
  164. this.received = data.received;
  165. });
  166. },
  167. // 免费领取
  168. noMoey() {
  169. if (this.received === 5) {
  170. uni.showModal({
  171. title: '此会员卡购买成功后,其余拥有会员卡自动作废',
  172. success: res => {
  173. if (res.confirm) {
  174. this.$u.api
  175. .createVipCardOrder({
  176. payType: 1,
  177. source: this.source,
  178. vipCardId: this.infoList.id
  179. })
  180. .then(({ data }) => {
  181. this.payInfo = data;
  182. if (this.payInfo.orderId) {
  183. this.$api.msg('免费领取成功,请在我的会员卡里查看');
  184. }
  185. this.getVipInfo();
  186. });
  187. }
  188. }
  189. });
  190. } else {
  191. this.$u.api
  192. .createVipCardOrder({
  193. payType: 1,
  194. source: this.source,
  195. vipCardId: this.infoList.id
  196. })
  197. .then(({ data }) => {
  198. this.payInfo = data;
  199. if (this.payInfo.orderId) {
  200. this.$api.msg('免费领取成功,请在我的会员卡里查看');
  201. }
  202. this.getVipInfo();
  203. });
  204. }
  205. },
  206. // 一键领取优惠券
  207. async getCoupon() {
  208. this.$u.api
  209. .oneKeyReceive({
  210. couponId: this.monthCouponIds,
  211. vipCardId: this.vipId
  212. })
  213. .then(res => {
  214. this.$api.msg('领取成功');
  215. this.goPage('/pagesT/user/DiscountCoupon');
  216. });
  217. }
  218. }
  219. };
  220. </script>
  221. <style lang="scss">
  222. page {
  223. background-color: #f5f9fc;
  224. }
  225. .vimg {
  226. width: 100%;
  227. background-color: #000000;
  228. }
  229. .vip-discount {
  230. font-size: 40upx;
  231. padding: 0 10upx;
  232. }
  233. .vimg .butImg {
  234. width: 100%;
  235. height: 300rpx;
  236. margin-top: 100rpx;
  237. }
  238. .contAll {
  239. color: #ffffff;
  240. padding-top: 80rpx;
  241. height: 70rpx;
  242. // transform: translateX(30rpx);
  243. .img {
  244. width: 70rpx;
  245. height: 70rpx;
  246. border-radius: 35px;
  247. display: inline-block;
  248. vertical-align: middle;
  249. margin-left: 30upx;
  250. }
  251. .contUser {
  252. font-size: 30rpx;
  253. font-weight: bold;
  254. margin: 0 20rpx;
  255. // transform: translateY(10rpx);
  256. }
  257. .cont_desc {
  258. display: inline-block;
  259. // transform: translateY(10rpx);
  260. border: 1rpx solid rgba(127, 127, 127, 1);
  261. border-radius: 20rpx 0rpx 20rpx 0rpx;
  262. padding: 10upx;
  263. font-size: 24rpx;
  264. text-align: center;
  265. color: #7f7f7f;
  266. }
  267. }
  268. .vipRight image {
  269. width: 121rpx;
  270. height: 90rpx;
  271. position: absolute;
  272. top: 80upx;
  273. right: 80upx;
  274. }
  275. .vipCont {
  276. margin-top: 100rpx;
  277. height: 300rpx;
  278. width: 100%;
  279. display: block;
  280. }
  281. .vip-cont-in {
  282. // padding: 58upx 80upx 0;
  283. }
  284. .vip-head {
  285. position: relative;
  286. }
  287. .vipContit {
  288. position: absolute;
  289. top: 60upx;
  290. left: 80upx;
  291. .openVip {
  292. font-size: 32rpx;
  293. font-weight: bold;
  294. color: #d8b17f;
  295. line-height: 70rpx;
  296. }
  297. .returnVip {
  298. // padding-top:18rpx;
  299. font-size: 30rpx;
  300. font-weight: 300;
  301. color: #ffffff;
  302. }
  303. }
  304. .main-get {
  305. background: #ffffff;
  306. padding: 1rpx 20rpx;
  307. .coupon-hua {
  308. height: 200upx;
  309. white-space: nowrap;
  310. width: 100%;
  311. }
  312. .look-coupon {
  313. margin: 30upx 0 30upx 14upx;
  314. width: 690upx;
  315. height: 88upx;
  316. border: 1px solid #e8caa0;
  317. background: rgba(255, 255, 255, 1);
  318. border-radius: 20upx;
  319. font-size: 30upx;
  320. color: #e8caa0;
  321. font-weight: 500;
  322. text-align: center;
  323. line-height: 88upx;
  324. }
  325. .ye_color {
  326. display: inline-block;
  327. color: #ffffff;
  328. margin: 40upx 0 30upx 30upx;
  329. width: 492upx;
  330. height: 160upx;
  331. background: linear-gradient(90deg, rgba(232, 202, 160, 1), rgba(216, 177, 127, 1));
  332. border-radius: 20upx;
  333. padding: 40upx;
  334. .vip-price {
  335. width: 100upx;
  336. white-space: nowrap;
  337. overflow: hidden;
  338. font-size: 30upx;
  339. font-weight: bold;
  340. padding-bottom: 10upx;
  341. }
  342. .vip-coupon {
  343. font-size: 24upx;
  344. }
  345. .coupon-desc {
  346. width: 240upx;
  347. }
  348. .vip-coupon-desc {
  349. font-size: 24upx;
  350. width: 240upx;
  351. overflow: hidden;
  352. text-overflow: ellipsis;
  353. }
  354. .coupon-b {
  355. padding-bottom: 10upx;
  356. font-size: 28upx;
  357. }
  358. .vip-line {
  359. padding: 40upx 0;
  360. transform: translateX(20upx);
  361. width: 1upx;
  362. height: 100upx;
  363. background: rgba(239, 241, 254, 1);
  364. }
  365. }
  366. .view_text {
  367. position: relative;
  368. // transform: translateY(-10rpx);
  369. font-weight: bold;
  370. font-size: 40rpx;
  371. color: #111111;
  372. display: inline-block;
  373. width: 200rpx;
  374. text-align: center;
  375. z-index: 1;
  376. &:after {
  377. content: '';
  378. display: block;
  379. height: 20upx;
  380. width: 210rpx;
  381. background: linear-gradient(90deg, rgba(232, 202, 160, 1), rgba(216, 177, 127, 1));
  382. opacity: 0.4;
  383. transform: translateY(-4rpx);
  384. z-index: -1;
  385. position: absolute;
  386. bottom: -10upx;
  387. left: 0;
  388. }
  389. }
  390. }
  391. .main_view {
  392. padding: 1rpx 20rpx;
  393. background: #fff;
  394. // margin: 0 auto;
  395. width: 100%;
  396. border-radius: 8rpx;
  397. // position: relative;
  398. .vip-title-t {
  399. transform: translateY(-30rpx);
  400. }
  401. .view_text {
  402. position: relative;
  403. // transform: translateY(-10rpx);
  404. font-weight: bold;
  405. font-size: 40upx;
  406. color: #111111;
  407. display: inline-block;
  408. width: 180rpx;
  409. text-align: center;
  410. z-index: 1;
  411. &:after {
  412. content: '';
  413. display: block;
  414. height: 20upx;
  415. width: 180rpx;
  416. background: linear-gradient(90deg, rgba(232, 202, 160, 1), rgba(216, 177, 127, 1));
  417. opacity: 0.4;
  418. transform: translateY(-4rpx);
  419. z-index: -1;
  420. position: absolute;
  421. bottom: -10upx;
  422. left: 0;
  423. }
  424. }
  425. }
  426. .mi_title {
  427. text-align: center;
  428. font-size: 18upx;
  429. color: #8f8f8f;
  430. margin: 10upx 0;
  431. }
  432. .m_title {
  433. padding: 30upx 30upx 200upx 30upx;
  434. display: block;
  435. width: 100%;
  436. text-align: left;
  437. font-size: 28upx;
  438. color: #8f8f8f;
  439. margin: 10upx 0;
  440. }
  441. .text_color {
  442. color: #c1a167;
  443. font-size: 28upx;
  444. }
  445. .text_border {
  446. color: #000;
  447. border: 2upx solid #111111;
  448. border-radius: 22upx;
  449. text-align: center;
  450. display: inline-block;
  451. font-size: 18upx;
  452. width: 160upx;
  453. height: 50upx;
  454. line-height: 50upx;
  455. }
  456. .bg_color {
  457. margin: 50upx 0;
  458. width: 100%;
  459. height: 194upx;
  460. background: linear-gradient(to right, #373737, #4a4a4a);
  461. .card-padd {
  462. padding: 80upx 30upx;
  463. }
  464. }
  465. .vip-bottom {
  466. background-color: #ffffff;
  467. position: fixed;
  468. bottom: 0;
  469. width: 100%;
  470. padding: 20upx 0;
  471. // height: 100upx;
  472. z-index: 95;
  473. box-shadow: 10px 10px 20px 10px rgba(193, 192, 192, 1);
  474. }
  475. .vip-btn {
  476. margin: 0 auto;
  477. width: 690upx;
  478. height: 88upx;
  479. background: linear-gradient(90deg, rgba(232, 202, 160, 1), rgba(216, 177, 127, 1));
  480. border-radius: 20upx;
  481. text-align: center;
  482. font-size: 30rpx;
  483. font-weight: 600;
  484. line-height: 88upx;
  485. }
  486. .btn-text {
  487. padding-left: 20upx;
  488. }
  489. .content {
  490. .gqbm-ul {
  491. list-style: none;
  492. width: 100%;
  493. color: #333;
  494. padding: 30upx 36upx;
  495. .quick-btn-item {
  496. float: left;
  497. .qt-tit {
  498. font-size: 28rpx;
  499. font-weight: 300;
  500. transform: translateX(-12rpx);
  501. }
  502. .ibonfont {
  503. width: 76upx;
  504. height: 60upx;
  505. display: inline-block;
  506. font-size: 76rpx;
  507. color: #d8a96c;
  508. margin: 0 105rpx 30rpx 0;
  509. }
  510. }
  511. .quick-btn-item:nth-child(4n + 0) {
  512. padding-right: 0;
  513. }
  514. }
  515. }
  516. .vip-super {
  517. height: 111upx;
  518. font-size: 40upx;
  519. line-height: 111upx;
  520. text-align: center;
  521. image {
  522. width: 48upx;
  523. height: 35upx;
  524. }
  525. .vip-title {
  526. padding-left: 12upx;
  527. font-weight: 500;
  528. }
  529. }
  530. </style>