mycard.vue
4.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<template>
<view>
<view class="vipBox">
<image class="fm" src="@/usercenter/img/xf_bg.png"></image>
<view class="poInfo">
<view class="flexline">
<view class="typeStr"></view>
</view>
<view class="flexline mt40">
<view class="ye">
金币
<text>{{mm.gold||0}}</text>
</view>
<view class="ye">
积分
<text>{{mm.score||0}}</text>
</view>
<view class="zk">
<view v-if="mm.memType=='0'">普通会员</view>
<view v-if="mm.memType=='1'">PLUS会员</view>
</view>
</view>
</view>
<view class="cardBottom">
<text>有效期至{{mm.validityDate}}</text>
<text class="renewBtn" v-if="system!='iPhone'&&system!='iPad'" @click="goRenew">金币充值</text>
</view>
</view>
<view class="uni-padding-wrap uni-common-mt" style="margin-bottom: 30rpx;">
<uni-segmented-control :current="current" :values="items" style-type="text" active-color="#16C682"
@clickItem="onClickItem" />
</view>
<view v-if="current === 0">
<view class="billItem" v-for="(item,index) in list1" :key="index">
<view class="tag tagkk" v-if="item.payType == '0'">会员</view>
<view class="tag" v-if="item.payType == '1'">金币</view>
<view class="text-warning price" style="display: flex;align-items: center;">
<image src="@/usercenter/img/mmm.png" style="width: 32rpx;height: 32rpx;margin-right: 6rpx;"/>
{{item.total}}</view>
<view>{{item.payDate}}</view>
</view>
<view class="nodata" v-if="list1.length==0">
<image mode="aspectFit" src="/static/nodata.png"/>
</view>
</view>
<view v-if="current === 1">
<view class="billItem" v-for="(item,index) in list2" :key="index">
<view class="tag tagkk" v-if="item.orderType == '0'">课程兑换</view>
<view class="tag" v-if="item.orderType == '1'">活动预约</view>
<view class="tag" v-if="item.orderType == '1'">活动预约</view>
<text class="text-warning price" v-if="item.payType == '0'">-{{item.score}}积分</text>
<text class="text-warning price" v-if="item.payType == '1'">-{{item.gold}}金币</text>
<text class="text-warning price" v-if="item.payType == '2'">-{{item.score}}积分 -{{item.gold}}金币</text>
<view>{{item.createTime}}</view>
<text v-if="item.status==1" class="danger">已退订</text>
</view>
<view class="nodata" v-if="list1.length==0">
<image mode="aspectFit" src="/static/nodata.png"/>
</view>
</view>
<view style="height: 100rpx;"></view>
</view>
</template>
<script setup>
import {
onLoad,onShow
} from '@dcloudio/uni-app'
import {
ref
} from 'vue'
import * as api from '@/common/api.js'
const mm = ref({})
const list1 = ref([])
const list2 = ref([])
const items = ref(['会员记录', '消费记录'])
const current = ref(0)
const currUser = uni.getStorageSync('currUser');
const system = uni.getStorageSync('systemType')
onShow(() => {
init()
})
function onClickItem(e) {
if (current.value !== e.currentIndex) {
current.value = e.currentIndex;
}
}
function init() {
api.getUserExtByUserId().then(res => {
mm.value = res.data
})
api.czList().then((res) => {
list1.value = res.rows
})
api.xfList().then((res) => {
list2.value = res.rows
})
}
function goRenew() {
let path = '/usercenter/mycard/renew';
uni.navigateTo({
url: path
});
}
</script>
<style scoped lang="scss">
.price{font-size: 32rpx;}
.vipBox {
margin-bottom: 30rpx
}
.billItem {position: relative;
padding: 70rpx 30rpx 40rpx;
margin: 0 auto 30rpx;
.tag{position: absolute;
color: #fff;
background: linear-gradient(90deg, #FFCE56, #F79A45);
top: 0;left: 0;
padding: 6rpx 20rpx;
border-radius: 10rpx 0rpx 10rpx 0;
}
.tagkk{
background: linear-gradient(0deg, #77E5C6, #67BDBB);
}
.price{position: absolute;right: 30rpx;top: 0rpx;bottom:0;margin: auto;height: 32rpx;}
}
.billItem view text text {
float: none;
}
.billFoot {
padding: 22rpx 35rpx;
margin-bottom: 20rpx
}
.success {
color: #16C682;
}
.danger {
color: #da2a2a;
}
</style>