天府星
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="my">
|
||||
<div class="user" @click="toSetting">
|
||||
<div class="user">
|
||||
<image :src="user.avatarUrl || 'https://cdn.cunwuyun.cn/wxmp/tianfuxing/avatar.png'" />
|
||||
<div class="right" v-if="isLogin">
|
||||
<h2>{{ user.nickName }}</h2>
|
||||
@@ -23,21 +23,18 @@
|
||||
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/nav1.png" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="my-list">
|
||||
<h2>积分明细</h2>
|
||||
<div class="list">
|
||||
<div class="item" v-for="(item, index) in list" :key="index">
|
||||
<div class="left">
|
||||
<h2>{{ item.detail }}</h2>
|
||||
<p>{{ item.createTime }}</p>
|
||||
</div>
|
||||
<div class="right">
|
||||
<i>{{ item.calcType === '0' ? '-' : '+' }}</i>
|
||||
<span>{{ item.integral || 0 }}</span>
|
||||
<em>积分</em>
|
||||
</div>
|
||||
</div>
|
||||
<AiEmpty v-if="!list.length"></AiEmpty>
|
||||
<div class="my-group">
|
||||
<div class="group-item" hover-class="bg-hover" @click="linkTo('./UserInfo')">
|
||||
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/banshijindu@2x.png" />
|
||||
<span>个人中心</span>
|
||||
</div>
|
||||
<div class="group-item" hover-class="bg-hover" @click="linkTo('./Merchants')">
|
||||
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/chaoshidingdan@2x.png" />
|
||||
<span>商户中心</span>
|
||||
</div>
|
||||
<div class="group-item" hover-class="bg-hover" @click="linkTo('./Integral')">
|
||||
<image src="https://cdn.cunwuyun.cn/wxmp/tianfuxing/wodejifen@2x.png" />
|
||||
<span>积分明细</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,7 +65,6 @@
|
||||
onLoad () {
|
||||
if (this.token) {
|
||||
this.getUserInfo()
|
||||
this.getList()
|
||||
} else {
|
||||
this.autoLogin()
|
||||
}
|
||||
@@ -78,23 +74,14 @@
|
||||
})
|
||||
},
|
||||
|
||||
onShow () {
|
||||
this.isMore = false
|
||||
this.current = 1
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapActions(['autoLogin', 'getUserInfo']),
|
||||
|
||||
toSetting () {
|
||||
linkTo (url) {
|
||||
if (!this.token) {
|
||||
this.autoLogin()
|
||||
} else {
|
||||
this.$linkTo('./UserInfo')
|
||||
this.$linkTo(url)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -107,44 +94,7 @@
|
||||
} else {
|
||||
this.getUserInfo()
|
||||
}
|
||||
},
|
||||
|
||||
getList () {
|
||||
if (this.isMore) return
|
||||
|
||||
this.$instance.post(`/api/appwechatintegraldetail/list`, null, {
|
||||
params: {
|
||||
current: this.current,
|
||||
size: 10,
|
||||
openId: this.user.openId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$hideLoading()
|
||||
if (this.current > 1) {
|
||||
this.list = [...this.list, ...res.data.records]
|
||||
} else {
|
||||
this.list = res.data.records
|
||||
}
|
||||
|
||||
if (res.data.records.length < 10) {
|
||||
this.isMore = true
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
this.current = this.current + 1
|
||||
} else {
|
||||
this.isMore = true
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$hideLoading()
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
onReachBottom () {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -158,6 +108,32 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.my-group {
|
||||
margin: 0 32px;
|
||||
|
||||
.group-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
margin-bottom: 24px;
|
||||
padding: 0 16px;
|
||||
box-shadow: 0 0 8px 0 rgba(0,0,0,0.02);
|
||||
border-radius: 16px;
|
||||
background: #fff;
|
||||
|
||||
image {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
margin-right: 18px;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #666666;
|
||||
font-size: 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user, .info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -189,66 +165,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.my-list {
|
||||
padding: 0 32px;
|
||||
|
||||
& > h2 {
|
||||
margin-bottom: 42px;
|
||||
font-weight: 600;
|
||||
font-size: 34px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 24px;
|
||||
padding: 24px;
|
||||
background: #FFFFFF;
|
||||
box-shadow: 0 0 8px 0 rgba(0,0,0,0.02);
|
||||
border-radius: 16px;
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
line-height: 1;
|
||||
|
||||
i {
|
||||
color: #FFB94C;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
span {
|
||||
color: #FFB94C;
|
||||
font-size: 40px;
|
||||
}
|
||||
|
||||
em {
|
||||
font-size: 26px;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
|
||||
.left {
|
||||
flex: 1;
|
||||
margin-right: 20px;
|
||||
|
||||
h2 {
|
||||
line-height: 1.3;
|
||||
margin-bottom: 10px;
|
||||
font-size: 34px;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 26px;
|
||||
color: #999999;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
Reference in New Issue
Block a user