index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="vip-box">
  3. <view class="vip_top hflex acenter jbetween">
  4. <view class="vip_uesr hflex acenter">
  5. <image :src="user.avatar" mode="aspectFill"></image>
  6. <view class="name vflex">
  7. <text>{{user.username}}</text>
  8. <text>{{user.introduction}}</text>
  9. </view>
  10. </view>
  11. <view class="btn hflex acenter" v-if="showsign" @click="tosign">
  12. <image src="/static/images/rili.png" mode="aspectFill"></image>
  13. <text>{{user.is_qiandao ? '签到' : '已签到'}}</text>
  14. </view>
  15. </view>
  16. <view class="level hflex acenter jbetween" v-if="showlevel">
  17. <text>LV{{user.level}}</text>
  18. <u-line-progress :percentage="user.already_upgrade_rate * 100" inactiveColor="#CCCCCC" height="2" activeColor="#FFFFFF"></u-line-progress>
  19. <text>LV{{Number(user.level) + 1}}</text>
  20. </view>
  21. <view class="bottom hflex acenter jbetween">
  22. <text>{{user.is_vip ? user.vip_expired_at : '开通会员享福利'}}</text>
  23. <text @click="show_buy = true">{{user.is_vip ? '立即续费' : '立即开通'}}</text>
  24. </view>
  25. <u-popup :show="show" mode="center" @close="toclose">
  26. <view class="qiandao vflex acenter jcenter">
  27. <image src="/static/images/qiandao.png" mode="aspectFill"></image>
  28. <text>签到成功</text>
  29. <text>获得积分+ {{jifen}}</text>
  30. <view class="btn">确定</view>
  31. </view>
  32. </u-popup>
  33. <u-popup :show="show_buy" mode="bottom" @close="toclose" :round="16">
  34. <view class="vip-buy">
  35. <view class="buy-title">会员充值</view>
  36. <view class="buy-list hflex acenter jbetween">
  37. <view class="buy-item vflex acenter jcenter" :class="buy_active == index ? 'buy-active' : ''" v-for="(item,index) in buylist" :key="index">
  38. <text>{{item.name}}</text>
  39. <text><span></span>{{item.price}}</text>
  40. <view class="text">额外获得{{item.integral}}积分</view>
  41. <view class="text">额外免费拍摄{{item.sell_count}}次</view>
  42. <view class="text">升级领福利</view>
  43. <view class="text">积分商城折扣</view>
  44. </view>
  45. </view>
  46. <view class="buy-title">支付方式</view>
  47. <view class="hflex acenter jbetween pay-item">
  48. <view class="hflex acenter">
  49. <image src="../../static/images/ali-pay.png" mode="aspectFill" class="pay-icon"></image>
  50. <text>支付宝支付</text>
  51. </view>
  52. <view class="">
  53. <image src="../../static/images/check-active.png" mode="aspectFill" class="pay-select" v-if="pay_active == 1"></image>
  54. <image src="../../static/images/check.png" mode="aspectFill" class="pay-select" v-else></image>
  55. </view>
  56. </view>
  57. <view class="hflex acenter jbetween pay-item">
  58. <view class="hflex acenter">
  59. <image src="../../static/images/wx-pay.png" mode="aspectFill" class="pay-icon"></image>
  60. <text>微信支付</text>
  61. </view>
  62. <view class="">
  63. <image src="../../static/images/check-active.png" mode="aspectFill" class="pay-select" v-if="pay_active == 2"></image>
  64. <image src="../../static/images/check.png" mode="aspectFill" class="pay-select" v-else></image>
  65. </view>
  66. </view>
  67. </view>
  68. </u-popup>
  69. </view>
  70. </template>
  71. <script>
  72. import $api from '@/static/js/api.js'
  73. export default {
  74. props: {
  75. user: {
  76. typeof: Object,
  77. default: {}
  78. },
  79. showsign: {
  80. typeof: Boolean,
  81. default: true
  82. },
  83. showlevel: {
  84. typeof: Boolean,
  85. default: true
  86. },
  87. },
  88. data() {
  89. return {
  90. show: false,
  91. show_buy: false,
  92. jifen: 2,
  93. buylist: [],
  94. pay_active: 0
  95. }
  96. },
  97. mounted() {
  98. },
  99. methods: {
  100. toclose() {
  101. this.show = false
  102. this.show_buy = false
  103. },
  104. tosign() {
  105. $api.req({
  106. url: 'sign',
  107. method: 'POST'
  108. }, function(res) {
  109. if(res.code == 10000) {
  110. _this.show = true
  111. }
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss">
  118. .vip-box {
  119. background: linear-gradient(225deg, #4C4B4E 0%, #121212 100%);
  120. border-radius: 16rpx;
  121. box-sizing: border-box;
  122. padding: 28rpx 20rpx;
  123. .qiandao {
  124. width: 550rpx;
  125. image {
  126. width: 270rpx;
  127. height: 260rpx;
  128. padding: 40rpx;
  129. }
  130. text {
  131. font-size: 28rpx;
  132. font-family: SFPro, SFPro;
  133. font-weight: 400;
  134. color: #222222;
  135. padding: 14rpx 0 0;
  136. }
  137. .btn {
  138. margin: 48rpx 0 60rpx;
  139. width: 250rpx;
  140. height: 80rpx;
  141. background: #00B0B0;
  142. border-radius: 8rpx;
  143. font-size: 32rpx;
  144. font-family: PingFangSC, PingFang SC;
  145. font-weight: 400;
  146. color: #FFFFFF;
  147. line-height: 80rpx;
  148. letter-spacing: 1px;
  149. text-align: center;
  150. }
  151. }
  152. .bottom {
  153. text {
  154. font-size: 24rpx;
  155. font-family: PingFangSC, PingFang SC;
  156. font-weight: 400;
  157. color: #FFFFFF;
  158. }
  159. text:last-child {
  160. color: #FF7B15;
  161. }
  162. }
  163. .level {
  164. padding: 44rpx 0;
  165. text {
  166. font-size: 32rpx;
  167. font-family: Silom;
  168. color: #FFFFFF;
  169. }
  170. text:first-child {
  171. padding-right: 16rpx;
  172. }
  173. text:last-child {
  174. padding-left: 16rpx;
  175. }
  176. }
  177. .vip_top {
  178. .btn {
  179. background: #00B0B0;
  180. border-radius: 40rpx;
  181. padding: 8rpx 18rpx;
  182. image {
  183. width: 36rpx;
  184. height: 36rpx;
  185. margin: 8rpx;
  186. }
  187. text {
  188. font-size: 24rpx;
  189. font-family: PingFangSC, PingFang SC;
  190. font-weight: 400;
  191. color: #FFFFFF;
  192. }
  193. }
  194. .vip_uesr {
  195. image {
  196. width: 80rpx;
  197. height: 80rpx;
  198. border-radius: 50%;
  199. margin: 0 12rpx 0 0;
  200. }
  201. .name {
  202. text:first-child {
  203. font-size: 28rpx;
  204. font-family: PingFangSC, PingFang SC;
  205. font-weight: 400;
  206. color: #FFFFFF;
  207. }
  208. text:last-child {
  209. font-size: 24rpx;
  210. font-family: PingFangSC, PingFang SC;
  211. font-weight: 400;
  212. color: #999999;
  213. padding: 6rpx 0 0;
  214. }
  215. }
  216. }
  217. }
  218. }
  219. </style>