index.vue 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222
  1. <template>
  2. <view class="vip-container" >
  3. <view class="heard-box" :class="`active${selectedPrice}`">
  4. <!-- 自定义头部 -->
  5. <PageHeader title="" class="PageHeader" :class="{ 'whitePhageHeader': headerOpacity > 0.2 }"
  6. :style="{ opacity: headerOpacity < 0.2 ? 1 : headerOpacity }">
  7. <template v-slot:center>
  8. <view class="center-title" style="font-size: 32rpx;color: #fff;">会员中心</view>
  9. </template>
  10. <template v-slot:right>
  11. <view class="more-options" @tap="toggleDropdown">
  12. <image src="@/static/icon/more3.png" v-if="headerOpacity < 0.2" style="width: 64rpx;height: 64rpx; margin-top: 15rpx;" mode="widthFix"></image>
  13. <image src="@/static/icon/more2.png" v-else style="width: 64rpx;height: 64rpx; margin-top: 15rpx;" mode="widthFix"></image>
  14. <view class="dropdown-menu" v-if="showDropdown">
  15. <view class="dropdown-item" @tap="handleOption('vipRecord')">VIP记录</view>
  16. <view class="dropdown-item" @tap="handleOption('contact')">联系客服</view>
  17. </view>
  18. </view>
  19. </template>
  20. </PageHeader>
  21. <view class="reserveASeat"></view>
  22. <view class="vip-card-box">
  23. <!-- 顶部会员信息 -->
  24. <view class="vip-header">
  25. <view class="vip-info">
  26. <CircleAvatar class="vip-info-left" v-if="userInfo.avator" :src="userInfo.avator">
  27. </CircleAvatar>
  28. <view class="vip-info-right">
  29. <view class="vip-nickname">{{ userInfo.nickname }}</view>
  30. <view class="vip-expire" v-if="userInfo.is_vip">VIP到期时间: {{ userInfo.vip_date }}</view>
  31. <view class="vip-expire" v-else>暂未开通</view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="vip-content">
  38. <!-- 会员价格选择 -->
  39. <view class="vip-price-options">
  40. <view class="price-option" v-for="(item, index) in priceOptions" :key="index"
  41. :class="{ active: selectedPrice === index }" @tap="selectPrice(index)">
  42. <view class="price-left-img" v-if="item.limitedTimeGift">
  43. <!-- 限时优惠M币{{ item.limitedTimeGift }} -->
  44. 限时优惠
  45. </view>
  46. <view class="price-tag" v-if="item.tag">{{ item.tag }}</view>
  47. <view class="duration">{{ item.name }}</view>
  48. <view class="price"><text style="font-size: 40rpx;">¥</text>{{ item.price }}</view>
  49. <view class="originalPrice">¥{{ item.originalPrice }}</view>
  50. </view>
  51. </view>
  52. <uv-notice-bar direction="column" speed="250" color="#333" :text="memberInformation"></uv-notice-bar>
  53. <!-- 会员特权列表 -->
  54. <view class="vip-privileges">
  55. <view class="privileges-title">尊享特权</view>
  56. <view class="privileges-list">
  57. <view class="privilege-item" v-for="(item, index) in privileges" :key="index">
  58. <image class="privilege-icon" v-if="item.icon" :src="item.icon" mode="aspectFit"></image>
  59. <view class="privilege-info">
  60. <view class="privilege-name">{{ item.name }}</view>
  61. <view class="privilege-desc">{{ item.desc }}</view>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="agree">
  68. <view class="agree2" @click="agreeChk()">
  69. <image style="width: 32rpx;height: 32rpx;" src="../../static/icon/wd_icon_gouxuan04.png"
  70. v-if="is_agree == 0">
  71. </image>
  72. <image style="width: 32rpx;height: 32rpx;" src="../../static/icon/wd_icon_gouxuan05.png"
  73. v-if="is_agree == 1">
  74. </image>
  75. </view>
  76. <view>
  77. 同意
  78. <text class="xy" @click="goPage('/pages/AboutUs/pay_xy')">
  79. 《充值服务协议》
  80. </text>,充值M币仅【萌创星球】使用,点击查看
  81. <text class="xy" @click="goPage('/pages/vip/record?type=vip')">
  82. 充值记录
  83. </text>
  84. </view>
  85. </view>
  86. <view class="bottom-pay-btn-bottom"
  87. v-if="priceOptions && priceOptions[selectedPrice] && priceOptions[selectedPrice].price"
  88. :class="{ 'btn-loading': isSubmitting }" @tap="showPaymentOptions">
  89. <text class="price-value" v-if="!isSubmitting">¥{{ priceOptions[selectedPrice].price }}</text>
  90. <text v-if="!isSubmitting">立即购买</text>
  91. <view v-if="isSubmitting" class="loading-spinner"></view>
  92. </view>
  93. <!-- 支付方式选择弹窗 -->
  94. <uni-popup ref="paymentPopup" type="bottom">
  95. <view class="payment-popup">
  96. <view class="popup-header">
  97. <view class="popup-title">选择支付方式</view>
  98. <!-- <view class="popup-close" @tap="closePaymentPopup">×</view> -->
  99. </view>
  100. <view class="payment-options">
  101. <view class="payment-option" @tap="selectPayment('alipay')">
  102. <image class="payment-icon" src="../../static/icon/pay_ali.png" mode="aspectFit"></image>
  103. <view class="payment-name">支付宝支付</view>
  104. <image class="payment-select"
  105. :src="paymentMethod === 'alipay' ? '../../static/icon/wd_icon_gouxuan05.png' : '../../static/icon/wd_icon_gouxuan04.png'"
  106. mode="aspectFit"></image>
  107. </view>
  108. <view v-if="isWeChatPay" class="payment-option" @tap="selectPayment('wechat')">
  109. <image class="payment-icon" src="../../static/icon/pay_wx.png" mode="aspectFit"></image>
  110. <view class="payment-name">微信支付</view>
  111. <image class="payment-select"
  112. :src="paymentMethod === 'wechat' ? '../../static/icon/wd_icon_gouxuan05.png' : '../../static/icon/wd_icon_gouxuan04.png'"
  113. mode="aspectFit"></image>
  114. </view>
  115. </view>
  116. <view class="confirm-payment" @tap="confirmPayment">立即支付</view>
  117. </view>
  118. </uni-popup>
  119. <CustomerServicePopup ref="customerServicePopup"></CustomerServicePopup>
  120. </view>
  121. </template>
  122. <script>
  123. import { mapState } from 'vuex'
  124. export default {
  125. data() {
  126. return {
  127. userInfo: {
  128. is_vip: false,
  129. vip_date: '2023-10-23'
  130. },
  131. headerOpacity: 0,
  132. memberInformation: [
  133. '墨色** 于10分钟前开通了月会员',
  134. '雾散时** 于24分钟前开通了季会员',
  135. 'Jox** 于17分钟前开通了月会员',
  136. '漂亮的** 于19分钟前开通了年会员',
  137. 'Ri** 于30分钟前开通了季会员',
  138. '山桃** 于15分钟前开通了月会员',
  139. 'zx** 于19分钟前开通了年会员',
  140. '** 于13分钟前开通了年会员',
  141. 'CarrollSo** 于21分钟前开通了季会员',
  142. 'Nanng** 于17分钟前开通了月会员',
  143. '芭比B** 于9分钟前开通了年会员',
  144. '小周不是** 于29分钟前开通了季会员',
  145. '落雪_** 于26分钟前开通了月会员',
  146. '雾岛听蝉9** 于19分钟前开通了年会员',
  147. '如** 于19分钟前开通了季会员',
  148. '言川Art** 于25分钟前开通了月会员',
  149. '兔子君mrbun** 于30分钟前开通了月会员',
  150. '呼哧Hac** 于6分钟前开通了年会员',
  151. 'alxe_不爱吹** 于17分钟前开通了季会员',
  152. '飞清** 于25分钟前开通了月会员',
  153. ],
  154. // memberInformation:[
  155. // '墨色轨迹于10分钟前开通了月会员',
  156. // '雾散时见山于24分钟前开通了季会员',
  157. // 'Joxin于17分钟前开通了月会员',
  158. // '漂亮的倾城于19分钟前开通了年会员',
  159. // 'Rick于30分钟前开通了季会员',
  160. // '山桃始华于15分钟前开通了月会员',
  161. // 'zx浊酒于19分钟前开通了年会员',
  162. // '桥九于13分钟前开通了年会员',
  163. // 'CarrollSong于21分钟前开通了季会员',
  164. // 'Nanngua于17分钟前开通了月会员',
  165. // '芭比Box于9分钟前开通了年会员',
  166. // '小周不是小粥于29分钟前开通了季会员',
  167. // '落雪_桃桃于26分钟前开通了月会员',
  168. // '雾岛听蝉999于19分钟前开通了年会员',
  169. // '如青稞于19分钟前开通了季会员',
  170. // '言川Artie于25分钟前开通了月会员',
  171. // '兔子君mrbunny于30分钟前开通了月会员',
  172. // '呼哧Hachi于6分钟前开通了年会员',
  173. // 'alxe_不爱吹泡泡于17分钟前开通了季会员',
  174. // '飞清云淡于25分钟前开通了月会员',
  175. // ],
  176. priceOptions: [
  177. ],
  178. selectedPrice: 1, // 默认选中的价格选项索引
  179. privileges: [{
  180. name: 'VIP专属通道',
  181. icon: '../../static/vip/hy_icon_quanyi01.png',
  182. desc: '创作加速,更快生成'
  183. },
  184. // {
  185. // name: '专属星源礼包',
  186. // icon: '../../static/vip/hy_icon_quanyi02.png',
  187. // desc: '每日登录领更多星源'
  188. // },
  189. {
  190. name: '数据安全增强',
  191. icon: '../../static/vip/hy_icon_quanyi03.png',
  192. desc: '多重数据安全更放心'
  193. },
  194. {
  195. name: '深度思考升级',
  196. icon: '../../static/vip/hy_icon_quanyi04.png',
  197. desc: '深度思考,提升50%'
  198. },
  199. {
  200. name: '成长加成',
  201. icon: '../../static/vip/hy_icon_quanyi05.png',
  202. desc: '设计达人等级加速'
  203. },
  204. // {
  205. // name: 'VIP专属通道',
  206. // icon: '../../static/vip/hy_icon_quanyi05.png',
  207. // desc: '创作加速,更快生成'
  208. // },
  209. // {
  210. // name: '免广告',
  211. // icon: '../../static/vip/hy_icon_quanyi06.png',
  212. // desc: '无广告免费体验'
  213. // }
  214. ],
  215. paymentMethod: 'alipay', // 默认支付方式
  216. privilegesHeight: 0, // 添加存储特权区域高度的变量
  217. showDropdown: false, // 控制下拉菜单显示状态
  218. is_agree: 0,
  219. linkid: '',
  220. lastClickTime: 0,
  221. isSubmitting: false,
  222. }
  223. },
  224. computed: {
  225. ...mapState('hideModule', ['isWeChatPay'])
  226. },
  227. onShow() {
  228. this.isSubmitting = false;
  229. },
  230. onLoad() {
  231. // 获取用户信息,检查是否为VIP
  232. this.getUserInfo();
  233. },
  234. onReady() {
  235. // 页面渲染完成后获取vip-privileges的高度
  236. this.getPrivilegesHeight();
  237. },
  238. onPageScroll(e) {
  239. console.log(e.scrollTop, "滚动高度");
  240. var scrollTop = e.scrollTop - 10;
  241. if (scrollTop > 0) {
  242. this.headerOpacity = Math.min(scrollTop / 100, 1);
  243. }
  244. if (e.scrollTop == 0) {
  245. this.headerOpacity = 0;
  246. }
  247. },
  248. methods: {
  249. // 获取用户信息
  250. getUserInfo() {
  251. // 这里添加获取用户信息的API调用
  252. uni.request({
  253. url: this.$apiHost + "/User/getinfo",
  254. data: {
  255. uuid: getApp().globalData.uuid,
  256. skey: getApp().globalData.skey,
  257. },
  258. header: {
  259. "content-type": "application/json",
  260. sign: getApp().globalData.headerSign,
  261. },
  262. success: (res) => {
  263. if (res) {
  264. console.log("获取到用户信息", res.data);
  265. this.userInfo = res.data
  266. }
  267. },
  268. complete: (com) => {
  269. },
  270. fail: (e) => {
  271. console.log("----e:", e);
  272. },
  273. });
  274. uni.request({
  275. url: this.$apiHost + "/Member/vipList",
  276. data: {
  277. uuid: getApp().globalData.uuid,
  278. skey: getApp().globalData.skey,
  279. },
  280. header: {
  281. "content-type": "application/json",
  282. sign: getApp().globalData.headerSign,
  283. },
  284. success: (res) => {
  285. console.log("作品列表数据:", res.data);
  286. // 确保在任何情况下都完成加载
  287. if (
  288. res.data.success == "yes" &&
  289. res.data.list &&
  290. res.data.list.length > 0
  291. ) {
  292. console.log(res.data.list, "会员列表数据");
  293. this.priceOptions = []
  294. res.data.list.reverse()
  295. res.data.list.forEach(v => {
  296. this.priceOptions.push({
  297. id: v.id,
  298. limitedTimeGift: v.price_market - v.price,
  299. name: v.name,
  300. price: v.price,
  301. originalPrice: v.price_market,
  302. tag: v.tag,
  303. numDay: v.num_day,
  304. numSong: v.num_song,
  305. })
  306. });
  307. this.priceOptions[1].tag = "推荐"
  308. console.log(this.priceOptions, "会员列表数据");
  309. } else {
  310. // priceOptions: [{
  311. // name: '月度VIP',
  312. // price: '98',
  313. // originalPrice: '168',
  314. // tag: '',
  315. // limitedTimeGift: ""
  316. // },
  317. // {
  318. // name: '季度VIP',
  319. // price: '198',
  320. // originalPrice: '268',
  321. // tag: '推荐',
  322. // limitedTimeGift: "100"
  323. // },
  324. // {
  325. // name: '年度VIP',
  326. // price: '398',
  327. // originalPrice: '498',
  328. // tag: '',
  329. // limitedTimeGift: "1500"
  330. // }
  331. // ],
  332. }
  333. },
  334. complete: () => {
  335. },
  336. fail: (e) => {
  337. console.log("请求关注列表失败:", e);
  338. },
  339. });
  340. },
  341. // 选择价格选项
  342. selectPrice(index) {
  343. this.selectedPrice = index;
  344. },
  345. // 显示支付方式选择弹窗
  346. showPaymentOptions() {
  347. const now = Date.now();
  348. if (now - this.lastClickTime < 3000) {
  349. uni.showToast({
  350. title: "请勿频繁点击",
  351. icon: "none"
  352. });
  353. return;
  354. }
  355. this.lastClickTime = now;
  356. if (this.isSubmitting) return;
  357. if (this.is_agree == 0) {
  358. uni.showToast({
  359. title: "请确认并选择协议",
  360. icon: "none",
  361. });
  362. return;
  363. }
  364. this.isSubmitting = true;
  365. this.$refs.paymentPopup.open();
  366. this.isSubmitting = false;
  367. },
  368. // 关闭支付方式选择弹窗
  369. closePaymentPopup() {
  370. this.$refs.paymentPopup.close();
  371. },
  372. // 选择支付方式
  373. selectPayment(method) {
  374. this.paymentMethod = method;
  375. },
  376. // 确认支付
  377. confirmPayment() {
  378. if (!this.priceOptions || !this.priceOptions[this.selectedPrice]) {
  379. uni.showToast({
  380. title: '请选择会员套餐',
  381. icon: 'none'
  382. });
  383. return;
  384. }
  385. if (this.is_agree == 0) {
  386. uni.showToast({
  387. title: "请确认并选择协议",
  388. icon: "none",
  389. });
  390. return;
  391. }
  392. this.isSubmitting = true;
  393. this.submitPayment();
  394. },
  395. // 提交支付
  396. submitPayment() {
  397. let that = this;
  398. uni.showLoading({
  399. title: '创建订单中...'
  400. });
  401. uni.request({
  402. url: this.$apiHost + '/Order/submit',
  403. data: {
  404. uuid: getApp().globalData.uuid,
  405. skey: getApp().globalData.skey,
  406. product_id: this.priceOptions[this.selectedPrice].id,
  407. type: 'buyVip',
  408. payType: this.paymentMethod
  409. },
  410. header: {
  411. 'content-type': 'application/json',
  412. sign: getApp().globalData.headerSign
  413. },
  414. success: (res) => {
  415. console.log("支付订单创建结果:", res.data);
  416. if (res.data.success == 'yes') {
  417. this.linkid = res.data.linkid;
  418. this.$refs.paymentPopup.close();
  419. // 根据支付方式调用不同的支付接口
  420. if (this.paymentMethod === 'wechat') {
  421. uni.requestPayment({
  422. provider: "wxpay",
  423. orderInfo: {
  424. appid: res.data.wepay.appid,
  425. partnerid: res.data.wepay.partnerid,
  426. prepayid: res.data.wepay.prepayid,
  427. package: "Sign=WXPay",
  428. noncestr: res.data.wepay.noncestr,
  429. timestamp: res.data.wepay.timestamp,
  430. sign: res.data.wepay.sign
  431. },
  432. success: (payRes) => {
  433. console.log("微信支付成功:", payRes);
  434. that.checkPayStatus();
  435. },
  436. fail: (err) => {
  437. console.log("微信支付失败:", err);
  438. uni.hideLoading();
  439. that.isSubmitting = false;
  440. uni.hideLoading()
  441. uni.showToast({
  442. title: '支付取消',
  443. icon: 'none'
  444. });
  445. }
  446. });
  447. } else if (this.paymentMethod === 'alipay') {
  448. uni.requestPayment({
  449. provider: "alipay",
  450. orderInfo: res.data.ali_pay,
  451. success: (payRes) => {
  452. console.log("支付宝支付成功:", payRes);
  453. that.checkPayStatus();
  454. },
  455. fail: (err) => {
  456. console.log("支付宝支付失败:", err);
  457. uni.hideLoading();
  458. that.isSubmitting = false;
  459. uni.hideLoading()
  460. uni.showToast({
  461. title: '支付取消',
  462. icon: 'none'
  463. });
  464. }
  465. });
  466. }
  467. } else {
  468. uni.hideLoading();
  469. that.isSubmitting = false;
  470. uni.hideLoading()
  471. uni.showToast({
  472. title: res.data.msg || '创建订单失败',
  473. icon: "error"
  474. });
  475. }
  476. },
  477. fail: (err) => {
  478. console.log("创建订单失败:", err);
  479. uni.hideLoading();
  480. that.isSubmitting = false;
  481. uni.hideLoading()
  482. uni.showToast({
  483. title: '网络错误,请稍后重试',
  484. icon: "error"
  485. });
  486. }
  487. });
  488. },
  489. // 检查支付状态
  490. checkPayStatus() {
  491. let that = this;
  492. uni.request({
  493. url: this.$apiHost + "/Order/getstatus",
  494. data: {
  495. uuid: getApp().globalData.uuid,
  496. linkid: this.linkid,
  497. },
  498. header: {
  499. "content-type": "application/json",
  500. 'sign': getApp().globalData.headerSign
  501. },
  502. success: (res) => {
  503. if (res.data.success == "yes") {
  504. uni.hideLoading();
  505. uni.showToast({
  506. title: "充值成功",
  507. icon: "none",
  508. });
  509. // 支付成功后刷新用户信息
  510. this.getUserInfo();
  511. } else {
  512. setTimeout(function () {
  513. that.checkPayStatus();
  514. }, 1000);
  515. }
  516. },
  517. fail: (err) => {
  518. console.log("检查支付状态失败:", err);
  519. uni.hideLoading();
  520. uni.showToast({
  521. title: "网络错误,请重试",
  522. icon: "none"
  523. });
  524. }
  525. });
  526. },
  527. // 获取特权列表区域的高度
  528. getPrivilegesHeight() {
  529. const query = uni.createSelectorQuery().in(this);
  530. query.select('.vip-privileges').boundingClientRect(data => {
  531. if (data) {
  532. this.privilegesHeight = data.height;
  533. console.log('特权区域高度:', this.privilegesHeight);
  534. } else {
  535. console.log('未能获取到特权区域元素');
  536. // 如果首次获取失败,可以添加延迟重试
  537. setTimeout(() => {
  538. this.getPrivilegesHeight();
  539. }, 100);
  540. }
  541. }).exec();
  542. },
  543. // 如果需要在某些数据变化后重新获取高度
  544. updatePrivilegesHeight() {
  545. this.$nextTick(() => {
  546. this.getPrivilegesHeight();
  547. });
  548. },
  549. // 切换下拉菜单显示状态
  550. toggleDropdown() {
  551. this.showDropdown = !this.showDropdown;
  552. },
  553. // 处理下拉菜单选项点击
  554. handleOption(type) {
  555. this.showDropdown = false;
  556. switch (type) {
  557. case 'vipRecord':
  558. uni.navigateTo({
  559. url: '/pages/vip/record?type=vip'
  560. });
  561. break;
  562. case 'help':
  563. uni.navigateTo({
  564. url: '/pages/help/index'
  565. });
  566. break;
  567. case 'contact':
  568. this.openCustomPopup();
  569. break;
  570. }
  571. },
  572. openCustomPopup() {
  573. this.$refs.customerServicePopup.open();
  574. },
  575. goPage(page) {
  576. uni.navigateTo({
  577. url: page,
  578. })
  579. }, agreeChk() {
  580. if (this.is_agree == 0) {
  581. this.is_agree = 1;
  582. } else {
  583. this.is_agree = 0;
  584. }
  585. },
  586. }
  587. }
  588. </script>
  589. <style lang="scss">
  590. .vip-container {
  591. min-height: 100vh;
  592. padding-bottom: 360rpx;
  593. position: relative;
  594. left: 0;
  595. top: 0;
  596. .heard-box {
  597. .PageHeader {
  598. background-image: url("@/static/vip/hy_bg_01.png");
  599. background-size: 100% auto;
  600. background-repeat: no-repeat;
  601. background-position-y: -var(--status-bar-height);
  602. ::v-deep .uni-icons {
  603. color: #fff !important;
  604. }
  605. .fa {
  606. color: #fff;
  607. }
  608. &.whitePhageHeader {
  609. background-image: none !important;
  610. background: #fff;
  611. .center-title {
  612. color: #1f1f1f !important;
  613. }
  614. ::v-deep .uni-icons {
  615. color: #000 !important;
  616. }
  617. }
  618. }
  619. .vip-card-box {
  620. width: 100%;
  621. padding: 0 36rpx;
  622. height: 300rpx;
  623. padding-top: 40rpx;
  624. .vip-header {
  625. width: 100%;
  626. height: 210rpx;
  627. padding-left: 28rpx;
  628. padding-top: 110rpx;
  629. .vip-info {
  630. padding-top: 10rpx;
  631. padding-left: 4rpx;
  632. display: flex;
  633. .vip-info-left {
  634. width: 60rpx;
  635. height: 60rpx;
  636. border: #fff solid 2rpx;
  637. margin-right: 10rpx;
  638. }
  639. .vip-info-right {
  640. .vip-nickname {
  641. font-size: 26rpx;
  642. font-weight: 400;
  643. font-family: 'PingFang SC-Bold';
  644. }
  645. .vip-expire {
  646. font-size: 22rpx;
  647. font-family: 'PingFang SC-Medium';
  648. }
  649. }
  650. }
  651. }
  652. }
  653. &.active0 {
  654. background: url("@/static/vip/hy_bg_01.png") center/100% 100% no-repeat;
  655. .PageHeader {
  656. background-image: url("@/static/vip/hy_bg_01.png");
  657. }
  658. .vip-card-box {
  659. .vip-header {
  660. background: url("@/static/vip/hy_card_01.png") top center/100% auto no-repeat;
  661. .vip-info {
  662. .vip-nickname {
  663. color: #1f1f1f;
  664. }
  665. .vip-expire {
  666. color: rgba(31, 31, 31, 0.7);
  667. }
  668. }
  669. }
  670. }
  671. }
  672. &.active1 {
  673. background: url("@/static/vip/hy_bg_02.png") center/100% 100% no-repeat;
  674. .PageHeader {
  675. background-image: url("@/static/vip/hy_bg_02.png");
  676. }
  677. .vip-card-box {
  678. .vip-header {
  679. background: url("@/static/vip/hy_card_02.png") top center/100% auto no-repeat;
  680. .vip-info {
  681. .vip-nickname {
  682. color: #FFE590;
  683. }
  684. .vip-expire {
  685. color: rgba(255, 229, 144, 0.35);
  686. }
  687. }
  688. }
  689. }
  690. }
  691. &.active2 {
  692. background: url("@/static/vip/hy_bg_03.png") center/100% 100% no-repeat;
  693. .PageHeader {
  694. background-image: url("@/static/vip/hy_bg_03.png");
  695. }
  696. .vip-card-box {
  697. .vip-header {
  698. background: url("@/static/vip/hy_card_03.png") top center/100% auto no-repeat;
  699. .vip-info {
  700. .vip-nickname {
  701. color: #FFFFFF;
  702. }
  703. .vip-expire {
  704. color: rgba(255, 255, 255, 0.35);
  705. }
  706. }
  707. }
  708. }
  709. }
  710. .reserveASeat {
  711. width: 100%;
  712. background: transparent;
  713. height: calc(var(--status-bar-height) + 90rpx);
  714. }
  715. }
  716. .vip-content {
  717. background: #fff;
  718. border-top-left-radius: 32rpx;
  719. border-top-right-radius: 32rpx;
  720. .vip-price-options {
  721. display: flex;
  722. justify-content: space-between;
  723. padding: 32rpx;
  724. padding-bottom: 24rpx;
  725. margin-top: -60rpx;
  726. .price-option {
  727. width: 218rpx;
  728. height: 250rpx;
  729. background-color: #fff;
  730. border-radius: 20rpx;
  731. display: flex;
  732. flex-direction: column;
  733. justify-content: center;
  734. align-items: center;
  735. position: relative;
  736. transition: all 0.3s;
  737. border-radius: 20rpx;
  738. border: 6rpx solid #E9E9E9;
  739. padding-top: 48rpx;
  740. padding-bottom: 34rpx;
  741. .price-left-img {
  742. min-width: 160rpx;
  743. height: 48rpx;
  744. padding: 6rpx 12rpx 14rpx 12rpx;
  745. position: absolute;
  746. left: -11rpx;
  747. top: -6rpx;
  748. background: url("../../static/vip/hy_biaoqian_02.png") center/100% 100% no-repeat;
  749. font-weight: 400;
  750. font-size: 10px;
  751. color: #898888;
  752. display: flex;
  753. align-items: center;
  754. justify-content: center;
  755. }
  756. .price-tag {
  757. position: absolute;
  758. bottom: -4rpx;
  759. right: -4rpx;
  760. font-family: 'PingFang SC-Bold';
  761. font-weight: 400;
  762. background-color: #4A4A4A;
  763. color: #ffffff;
  764. font-size: 24rpx;
  765. width: 86rpx;
  766. height: 36rpx;
  767. border-top-left-radius: 20rpx;
  768. border-bottom-right-radius: 20rpx;
  769. display: flex;
  770. align-items: center;
  771. justify-content: center;
  772. }
  773. .duration {
  774. font-family: 'PingFang SC-Bold';
  775. font-weight: 400;
  776. font-size: 32rpx;
  777. color: #1F1F1F;
  778. }
  779. .price {
  780. font-size: 68rpx;
  781. font-weight: bold;
  782. color: #4A4A4A;
  783. // padding-top: -10rpx;
  784. line-height: 1;
  785. padding-top: 8rpx;
  786. padding-bottom: 2rpx;
  787. }
  788. .originalPrice {
  789. font-size: 28rpx;
  790. color: #999999;
  791. text-decoration: line-through;
  792. }
  793. &.active {
  794. background: linear-gradient(to bottom, #F0FFD9, rgba(0, 0, 0, 0));
  795. border-color: #1f1f1f;
  796. transform: scale(1.05);
  797. .price-tag {
  798. background: #1f1f1f;
  799. }
  800. .price-left-img {
  801. background: url("../../static/vip/hy_biaoqian_01.png") center/100% no-repeat;
  802. color: #ACF934;
  803. }
  804. .price {
  805. color: #7CCB00;
  806. }
  807. }
  808. }
  809. }
  810. .vip-privileges {
  811. padding: 0 30rpx;
  812. .privileges-title {
  813. font-family: 'PingFang SC-Bold';
  814. font-weight: 400;
  815. font-size: 16px;
  816. color: #1F1F1F;
  817. padding-top: 36rpx;
  818. padding-bottom: 22rpx;
  819. }
  820. .privileges-list {
  821. display: flex;
  822. flex-wrap: wrap;
  823. justify-content: space-between;
  824. }
  825. .privilege-item {
  826. width: 330rpx;
  827. height: 136rpx;
  828. flex-grow: 0;
  829. background-color: #F7F7F7;
  830. border-radius: 16rpx;
  831. padding: 26rpx;
  832. padding-right: 0;
  833. // padding-left: 20rpx;
  834. margin-bottom: 20rpx;
  835. display: flex;
  836. align-items: center;
  837. }
  838. .privilege-icon {
  839. width: 84rpx;
  840. height: 84rpx;
  841. margin-right: 20rpx;
  842. }
  843. .privilege-name {
  844. font-size: 28rpx;
  845. font-weight:400;
  846. color: #1f1f1f;
  847. margin-bottom: 10rpx;
  848. font-family: 'PingFang SC-Bold';
  849. }
  850. .privilege-desc {
  851. font-size: 20rpx;
  852. color: #999999;
  853. }
  854. }
  855. }
  856. .uv-notice-bar {
  857. background-color: #F2F6F2 !important;
  858. border-radius: 108rpx;
  859. width: calc(100% - 64rpx);
  860. margin: 0 auto;
  861. ::v-deep.uvicon-volume {
  862. color: #333 !important;
  863. }
  864. }
  865. .bottom-pay-btn {
  866. position: fixed;
  867. bottom: 0;
  868. left: 0;
  869. right: 0;
  870. display: flex;
  871. align-items: center;
  872. justify-content: space-between;
  873. background-color: #242424;
  874. padding: 30rpx 40rpx;
  875. box-sizing: border-box;
  876. .total-price {
  877. color: #cccccc;
  878. font-size: 28rpx;
  879. }
  880. .price-value {
  881. color: #ffffff;
  882. font-size: 40rpx;
  883. font-weight: bold;
  884. }
  885. .pay-button {
  886. background: linear-gradient(to right, #9758DE, #5F17DD);
  887. color: #ffffff;
  888. padding: 20rpx 60rpx;
  889. border-radius: 50rpx;
  890. font-size: 32rpx;
  891. }
  892. }
  893. /* 支付方式选择弹窗样式 */
  894. .payment-popup {
  895. background-color: #ffffff;
  896. border-radius: 24rpx 24rpx 0 0;
  897. padding: 40rpx;
  898. .popup-header {
  899. display: flex;
  900. justify-content: center;
  901. align-items: center;
  902. margin-bottom: 40rpx;
  903. position: relative;
  904. }
  905. .popup-title {
  906. font-size: 32rpx;
  907. color: #333;
  908. font-weight: 500;
  909. text-align: center;
  910. }
  911. .popup-close {
  912. position: absolute;
  913. right: 0;
  914. top: 50%;
  915. transform: translateY(-50%);
  916. font-size: 48rpx;
  917. color: #999999;
  918. line-height: 1;
  919. }
  920. .payment-options {
  921. margin-bottom: 40rpx;
  922. }
  923. .payment-option {
  924. display: flex;
  925. align-items: center;
  926. padding: 32rpx 0;
  927. border-bottom: 1rpx solid #EEEEEE;
  928. &:last-child {
  929. border-bottom: none;
  930. }
  931. }
  932. .payment-icon {
  933. width: 72rpx;
  934. height: 72rpx;
  935. margin-right: 24rpx;
  936. }
  937. .payment-name {
  938. flex: 1;
  939. color: #333;
  940. font-size: 32rpx;
  941. }
  942. .payment-select {
  943. width: 40rpx;
  944. height: 40rpx;
  945. }
  946. .confirm-payment {
  947. background: #333333;
  948. color: #ACF934;
  949. text-align: center;
  950. padding: 28rpx 0;
  951. border-radius: 76rpx;
  952. font-size: 32rpx;
  953. margin-top: 60rpx;
  954. font-weight: 500;
  955. }
  956. }
  957. ::v-deep .uni-popup .uni-popup__wrapper {
  958. border-radius: 24rpx 24rpx 0 0;
  959. }
  960. ::v-deep .uni-popup .uni-popup__wrapper-box {
  961. border-radius: 24rpx 24rpx 0 0;
  962. }
  963. .more-options {
  964. position: relative;
  965. display: inline-block;
  966. .fa {
  967. font-size: 40rpx;
  968. padding: 0 20rpx;
  969. }
  970. .dropdown-menu {
  971. position: absolute;
  972. top: calc(100% + 10rpx);
  973. right: 20rpx;
  974. background-color: #ffffff;
  975. border-radius: 20rpx;
  976. padding: 0;
  977. width: 200rpx;
  978. box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.1);
  979. z-index: 100;
  980. transform-origin: top right;
  981. animation: dropdownAnimation 0.2s ease-out;
  982. overflow: hidden;
  983. .dropdown-item {
  984. padding: 24rpx 0;
  985. color: #333333;
  986. font-size: 28rpx;
  987. position: relative;
  988. text-align: center;
  989. &:not(:last-child)::after {
  990. content: '';
  991. position: absolute;
  992. left: 0;
  993. right: 0;
  994. bottom: 0;
  995. height: 1rpx;
  996. background-color: #EEEEEE;
  997. }
  998. &:active {
  999. background-color: #f8f8f8;
  1000. }
  1001. }
  1002. }
  1003. }
  1004. @keyframes dropdownAnimation {
  1005. 0% {
  1006. opacity: 0;
  1007. transform: scale(0.95) translateY(-5rpx);
  1008. }
  1009. 100% {
  1010. opacity: 1;
  1011. transform: scale(1) translateY(0);
  1012. }
  1013. }
  1014. @keyframes spin {
  1015. to {
  1016. transform: rotate(360deg);
  1017. }
  1018. }
  1019. }
  1020. .agree {
  1021. width: 90%;
  1022. margin: 0 auto;
  1023. color: #666666;
  1024. font-size: 24rpx;
  1025. margin-top: 40rpx;
  1026. display: flex;
  1027. align-items: center;
  1028. text-align: left;
  1029. line-height: 32rpx;
  1030. position: absolute;
  1031. bottom: 210rpx;
  1032. left: 50%;
  1033. transform: translateX(-50%);
  1034. .agree2 {
  1035. display: flex;
  1036. flex-direction: row;
  1037. justify-content: flex-start;
  1038. align-items: center;
  1039. padding-right: 8rpx;
  1040. flex-shrink: 0;
  1041. margin-bottom: 34rpx;
  1042. }
  1043. .xy {
  1044. color: #0084FF;
  1045. display: inline;
  1046. }
  1047. image {
  1048. width: 32rpx;
  1049. height: 32rpx;
  1050. }
  1051. }
  1052. .bottom-pay-btn-bottom {
  1053. width: 626rpx;
  1054. height: 88rpx;
  1055. background: linear-gradient(to left, #1F1F1F, #444444);
  1056. border-radius: 76rpx;
  1057. margin: 0 auto;
  1058. margin-top: 70rpx;
  1059. color: #ACF934;
  1060. display: flex;
  1061. align-items: center;
  1062. justify-content: center;
  1063. font-size: 32rpx;
  1064. line-height: 0;
  1065. position: relative;
  1066. overflow: hidden;
  1067. transition: all 0.3s ease;
  1068. position: absolute;
  1069. bottom: 100rpx;
  1070. left: 50%;
  1071. transform: translateX(-50%);
  1072. .price-value {
  1073. font-size: 44rpx;
  1074. font-family: 'CustomFont';
  1075. }
  1076. &.btn-loading {
  1077. opacity: 0.7;
  1078. pointer-events: none;
  1079. }
  1080. .loading-spinner {
  1081. width: 40rpx;
  1082. height: 40rpx;
  1083. border: 4rpx solid rgba(255, 255, 255, 0.3);
  1084. border-radius: 50%;
  1085. border-top-color: #fff;
  1086. animation: spin 1s linear infinite;
  1087. }
  1088. text {
  1089. display: inline-block;
  1090. margin-right: 10rpx;
  1091. }
  1092. }
  1093. </style>