123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284 |
- <template>
- <view class="content">
- <view class="user-top flex">
- <view class="user-avart">
- <image :src="userInfo.avatar" mode="" v-if="userInfo.avatar" class="user-avatar"></image>
- <image src="../../static/error/missing-face.png" mode="" class="user-avatar" v-else></image>
- </view>
- <view class="user-info">
- <view class="user-name clamp">
- {{ userInfo.nickname}}
- </view>
- <view class="user-level">
- {{ userInfo.level ==0 ? '尚未开通VIP':'会员' }}
- </view>
- </view>
- <view class="bottom-bg"></view>
- </view>
- <view class="title">
- 会员权益
- </view>
- <view class="tit">
- 开通会员可享受无限次使用次数,非会员仅可享受0次。
- </view>
- <view class="title">
- VIP充值套餐
- </view>
- <view class="menber-item flex" v-for="(item,index) in list" :class="{'action': index == currentIndex}" @click="navClick(index,item)">
- <view class="item-right-top">
- {{((item.price*1)/(item.time*1)).toFixed(2)}}元/天
- </view>
- <view class="item-price">
- {{item.title}}
- </view>
- <view class="item-info">
- <text class="old-price">原价{{item.ot_price*1}}元</text>{{item.price*1}}<text class="dw">元</text>
- </view>
- </view>
- <view class="zf-btn" @click="zf" :class="{'press': loading}">
- {{loading?'支付中':'立即支付'}}
- </view>
- <view class="check_box flex_item">
- <view>
- <radio style="transform: scale(0.75)" @click="Getcheckbox" color="#FFCE8A" :checked="checked" />
- </view>
- <view class="">我已阅读并同意会员<text @click="TOprivacy">用户协议</text></view>
- </view>
- </view>
- </template>
- <script>
- import { getMenberCard,buyMenber } from '@/api/index.js'
- import {
- mapState,
- mapMutations
- } from 'vuex';
- export default {
- data() {
- return {
- currentIndex: 0,
- checked: true,
- list: [],
- loading: false,
- chooosId: '',
- }
- },
- computed: {
- ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
- },
- onLoad() {
- },
- onShow() {
- this.getMenberCard()
- },
- onReachBottom() {
- },
- onReady() {
- },
- methods: {
- navClick(index,item) {
- this.currentIndex = index
- this.chooosId = item.id
- },
- //阅读并同意
- Getcheckbox() {
- let obj = this;
- obj.checked = !obj.checked;
- },
- TOprivacy() {
- // uni.navigateTo({
- // url: ''
- // })
- },
- zf() {
- let obj = this
- if(obj.loading) {
- return
- }
- if(!obj.checked) {
- return obj.$api.msg('请阅读并同意会员用户协议')
- }
- obj.loading = true
- buyMenber({
- char_id: obj.chooosId,
- type: 0
- }).then(res => {
- console.log(res)
- }).catch(err => {
- obj.loading = false
- })
- },
- getMenberCard() {
- let obj = this
- getMenberCard().then(res => {
- console.log(res)
- obj.list = res.data
- obj.chooosId = res.data[0].id
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #fff;
- }
- .user-top {
- width: 100%;
- height: 350rpx;
- background-color: #1c1c20;
- font-size: 38rpx;
- font-weight: bold;
- color: #FFFFFF;
- align-items: center;
- justify-content: flex-start;
- padding: 0 52rpx;
- position: relative;
- .user-avart {
- flex-shrink: 0;
- width: 100rpx;
- height: 100rpx;
- image {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- }
- .user-info {
- flex-grow: 1;
- padding-left: 24rpx;
- .user-name {
- font-size: 38rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- .user-level {
- font-size: 24rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- }
- .bottom-bg {
- width: 750rpx;
- height: 55rpx;
- position: absolute;
- border-radius: 25rpx 25rpx 0 0;
- background-color: #fff;
- bottom: 0;
- left: 0;
- }
- }
- .title {
- font-size: 36rpx;
- font-weight: bold;
- color: #000000;
- padding-left: 30rpx;
- }
- .tit {
- font-size: 26rpx;
- font-weight: 500;
- color: #5C5C5C;
- padding: 30rpx 0 30rpx 30rpx;
- }
- .action {
- border: 6rpx solid #ffe5c2;
- font-weight: 900;
- background: #FFFAF3;
- }
- .menber-item {
- width: 690rpx;
- height: 170rpx;
- margin: auto;
-
- // border: 3rpx solid #ffe5c2;
- box-shadow: 2rpx 1rpx 30rpx 0px rgba(0, 0, 0, 0.1);
- border-radius: 18rpx;
- position: relative;
- align-items: center;
- padding: 0 30rpx 0 40rpx;
- margin-top: 30rpx;
- .item-right-top {
- min-width: 128rpx;
- display: inline-block;
- text-align: center;
- line-height: 38rpx;
- font-size: 24rpx;
- font-weight: bold;
- color: #9F570E;
- height: 38rpx;
- background: linear-gradient(270deg, #FFE7C4, #FFCE8A);
- border-radius: 0px 18rpx 0px 18rpx;
- position: absolute;
- right: 0;
- top: 0;
- }
- .item-info {
- font-size: 48rpx;
- font-weight: bold;
- color: #9F570E;
- .item-price {
- font-size: 32rpx;
- font-weight: bold;
- color: #131313;
- }
- .old-price {
- font-size: 24rpx;
- font-weight: bold;
- text-decoration: line-through;
- color: #AEAEAE;
- padding-right: 12rpx;
- }
- .dw {
- font-size: 26rpx;
- }
- }
- }
- .zf-btn {
- width: 620rpx;
- background: linear-gradient(270deg, #FFE7C4, #FFCE8A);
- border-radius: 49rpx;
- margin: 80rpx auto 40rpx;
- font-size: 32rpx;
- font-weight: bold;
- color: #9F570E;
- line-height: 100rpx;
- text-align: center;
- }
- .press {
- background: #999;
- color: #eee;
- }
- .check_box {
- // padding: 25rpx 25rpx;
- padding-bottom: 70rpx;
- font-size: 28rpx;
- text {
- color: #6786FB;
- }
- }
- .flex_item {
- display: flex;
- justify-content: center;
- }
- </style>
|