index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="text" v-if="is_member">会员已与{{member_date}}过期</view>
  5. <view class="text" v-else>开通会员,立享多种特权</view>
  6. </view>
  7. <view class="box">
  8. <view class="title">全年VIP</view>
  9. <view class="price">¥{{price}}<span style="font-size: 40rpx;">/年</span></view>
  10. <view class="title" style="margin: 36rpx 0 20rpx;">会员权益</view>
  11. <u-parse :content="text"></u-parse>
  12. </view>
  13. <view class="bottom">
  14. <view class="hflex acenter">
  15. <u-checkbox-group @change="checkboxChange">
  16. <u-checkbox v-model="agree" shape="circle"></u-checkbox>
  17. </u-checkbox-group>
  18. <view class="text">已阅读并同意<span class="read" @click="open(0)">《会员服务协议》</span></view>
  19. </view>
  20. <view class="button hflex acenter jcenter" @click="openMember">
  21. <view>确定协议并开通</view>
  22. </view>
  23. </view>
  24. <u-popup :show="pay_show" @close="close" mode="bottom" :round="20" :closeable="true">
  25. <view class="popup">
  26. <view class="title">立即支付</view>
  27. <view class="price">¥{{price}}</view>
  28. <view class="text1">支付方式</view>
  29. <view class="box1 hflex acenter jbetween">
  30. <view class="hflex acenter">
  31. <u-icon name="weixin-circle-fill" color="#506dff" size="24"></u-icon>
  32. <view class="box_right">微信支付</view>
  33. </view>
  34. <u-checkbox-group @change="checkboxChange1">
  35. <u-checkbox v-model="agree1" :checked="true" shape="circle"></u-checkbox>
  36. </u-checkbox-group>
  37. </view>
  38. <view class="btn" @click="pay">立即支付</view>
  39. </view>
  40. </u-popup>
  41. </view>
  42. </template>
  43. <script>
  44. import $api from '@/static/js/api.js'
  45. var that = ''
  46. export default {
  47. data() {
  48. return {
  49. text: `
  50. <p>权益说明:</p>
  51. <p>1.纯净去广告,优质外刊原著精读,导师领读;</p>
  52. <p>2.纯净去广告,优质外刊原著精读,导师领读;</p>
  53. <p>3.纯净去广告,优质外刊原著精读,导师领读;</p>
  54. <p>4.纯净去广告,优质外刊原著精读,导师领读,纯净去广告,优质外刊原著精读,导师领读;</p>
  55. `,
  56. agree: false,
  57. agree1: true,
  58. pay_show: false,
  59. price: 588,
  60. is_member: 1,
  61. member_date: '2022-12-01'
  62. }
  63. },
  64. onLoad() {
  65. that = this
  66. },
  67. methods: {
  68. // 阅读并同意
  69. checkboxChange(n) {
  70. this.agree = !this.agree
  71. },
  72. // 选择支付方式
  73. checkboxChange1(n) {
  74. this.agree1 = !this.agree1
  75. },
  76. // 确定协议并开通
  77. openMember() {
  78. if(that.agree) {
  79. that.pay_show = true
  80. } else {
  81. $api.info('请先阅读并同意《会员服务协议》')
  82. }
  83. },
  84. // 关闭弹窗
  85. close() {
  86. that.pay_show = false
  87. },
  88. // 立即支付
  89. pay() {
  90. if(that.agree1) {
  91. that.pay_show = true
  92. } else {
  93. $api.info('请先选择支付方式')
  94. }
  95. }
  96. },
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .content {
  101. background-color: #e4e8f4;
  102. .top {
  103. background: url('/static//images/mine/member_bg.png') no-repeat;
  104. background-size: 100%;
  105. width: 100%;
  106. height: 480rpx;
  107. .text {
  108. font-size: 26rpx;
  109. color: #fff;
  110. padding: 332rpx 0 0 84rpx;
  111. }
  112. }
  113. .box {
  114. width: 100%;
  115. height: calc(100vh - 480rpx);
  116. background-color: #fff;
  117. border-radius: 40rpx 40rpx 0 0;
  118. box-sizing: border-box;
  119. padding: 36rpx 30rpx;
  120. margin-bottom: 246rpx;
  121. .title {
  122. font-size: 40rpx;
  123. color: #444;
  124. }
  125. .price {
  126. font-size: 60rpx;
  127. color: #ff2626;
  128. padding:34rpx 0 52rpx;
  129. border-bottom: 1rpx solid #f2f2f2;
  130. }
  131. }
  132. .bottom {
  133. width: 100%;
  134. height: 246rpx;
  135. background-color: #fff;
  136. box-shadow: 0 -2rpx 16rpx 0 rgba(215,215,215,0.5);
  137. position: fixed;
  138. bottom: 0;
  139. box-sizing: border-box;
  140. padding: 36rpx 30rpx;
  141. .text {
  142. font-size: 24rpx;
  143. color: #9c9c9c;
  144. }
  145. .read {
  146. color: #2a63f3;
  147. }
  148. .button {
  149. width: 690rpx;
  150. height: 96rpx;
  151. background-color: #506dff;
  152. border-radius: 50rpx;
  153. box-shadow: 0 4rpx 28rpx 0 rgba(132,123,255,0.4);
  154. font-size: 40rpx;
  155. color: #fff;
  156. margin: 40rpx 0 36rpx;
  157. }
  158. }
  159. .popup {
  160. width: 100%;
  161. box-sizing: border-box;
  162. padding: 48rpx 30rpx;
  163. background-color: #fff;
  164. .title {
  165. width: 100%;
  166. text-align: center;
  167. font-size: 36rpx;
  168. color: #222;
  169. margin-bottom: 50rpx;
  170. }
  171. .price {
  172. width: 100%;
  173. text-align: center;
  174. font-size: 60rpx;
  175. color: #ff2626;
  176. margin-bottom: 36rpx;
  177. }
  178. .text1 {
  179. font-size: 30rpx;
  180. color: #222;
  181. margin-bottom: 28rpx;
  182. }
  183. .box1 {
  184. width: 100%;
  185. box-sizing: border-box;
  186. padding: 36rpx 20rpx;
  187. background-color: #f6f6f6;
  188. border-radius: 20rpx;
  189. .box_img {
  190. width: 48rpx;
  191. height: 48rpx;
  192. }
  193. .box_right {
  194. margin-left: 20rpx;
  195. font-size: 26rpx;
  196. color: #555;
  197. }
  198. }
  199. .btn {
  200. margin-top: 166rpx;
  201. width: 670rpx;
  202. height: 96rpx;
  203. background-color: #506dff;
  204. border-radius: 50rpx;
  205. box-shadow: 0 4rpx 28rpx 0 rgba(132,123,255,0.4);
  206. font-size: 40rpx;
  207. color: #fff;
  208. text-align: center;
  209. line-height: 96rpx;
  210. // margin: 40rpx 0 36rpx;
  211. }
  212. }
  213. }
  214. </style>