Commit 1a985b6e authored by 高宇's avatar 高宇

我的消息已完成

parent a4c95e7f
......@@ -105,13 +105,13 @@
],
matrimonyList: [
{
value: '0',
value: 0,
label: '未婚'
}
,
{
value: '1',
value: 1,
label: '已婚'
}
],
......
......@@ -2,18 +2,18 @@
<view class="myMessage">
<view v-for="(item,index) in list" :key="index">
<!-- 时间 -->
<view class="date">{{item.time}}</view>
<view class="date">{{item.pushTime}}</view>
<view class="uplowCard">
<view class="one">
<view class="address">{{item.address}}</view>
<view class="time">{{item.time}}</view>
<view class="address">{{tenantName}}</view>
<view class="time">{{item.pushTime}}</view>
</view>
<view class="two">
<view class="title">{{item.title}}</view>
<view class="content">{{item.content}}</view>
</view>
</view>
<view class="lowerCard">
<view class="lowerCard" @click="toUser(item)">
<view class="button">立即使用</view>
<view class="icon">
<u-icon name="arrow-right"></u-icon>
......@@ -27,14 +27,68 @@
export default{
data() {
return{
total: 0,
time: '2023-07-05',
list: [{
time: '2023-07-05',
address: '天津复悦里',
title: '【新会员】 1小时停车券',
content: '亲爱的会员,您已成功领取【新会员】1小时停车券!有效期:领取后当天生效,生效后持续7天使用规则:请到适用商场使用'
}]
tenantName: '天津复悦里',
list: []
}
},
onShow() {
this.getList()
},
methods: {
// 去使用
toUser(item){
console.log('item',item)
this.$u.route({
url:item.url,
})
},
// 获取消息list
getList(){
let recipientId = ''
let tenantId = ''
const that = this
// 没有登录跳转登录页
uni.getStorage({
key: 'lifeData',
success: function (res) {
console.log('data',res.data);
recipientId = res.data.vuex_user.id
if(res.data.vuex_token === '') {
that.$u.route({
url:'/pages/login/login',
params:{}
})
} else {
uni.getStorage({
key: 'business',
success:function(Lres){
tenantId = Lres.data.id
that.tenantName = Lres.data.name
console.log('recipientId',recipientId)
console.log('tenantId',tenantId)
that.$u.get('/mobile/messageInstance/list/'+tenantId + '/' + recipientId).then(response => {
for(const index in response.records){
const item = response.records[index]
item.pushTime = item.pushTime.substring(0,10)
}
that.list = response.records
that.total = response.total
})
}
})
}
},
fail: function(res) {
console.log('fail',res.data);
that.$u.route({
url:'/pages/login/login',
params:{}
})
}
});
}
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment