通知和提示

This commit is contained in:
2020-08-28 14:51:35 +08:00
parent 40e252c400
commit 1305931e3b
7 changed files with 134 additions and 17 deletions

70
pages/messages/info.vue Normal file
View File

@@ -0,0 +1,70 @@
<template>
<view>
<image :src="list.picture" class="picture" mode=""></image>
<view class="box">
<view class="info">
<text class="title u-line-2">{{ list.title }}</text>
<u-divider class="time">{{ list.addtime }}</u-divider>
<!-- <text class="time"></text> -->
</view>
<view class="content">{{ list.content }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
id: 0,
list: [],
};
},
onLoad(option) {
// console.log(option);
this.id = option.id;
// 获取数据
this.informationList();
},
methods: {
informationList(){
console.log(this.id)
this.$u.api.messageInfo({id:this.id}).then((res)=>{
console.log(res);
})
}
}
}
</script>
<style lang="scss">
page {
}
.picture {
width: 100%;
}
.box {
width: 100%;
padding: 20rpx;
.info {
.title {
font-size: 38rpx;
color: rgba(0,0,0,.84);
line-height: 1.2;
}
.time {
padding: 40rpx 0;
}
}
.content {
padding: 0 6rpx;
font-size: 34rpx;
color: rgba(0,0,0,.6);
line-height: 1.4;
letter-spacing: 1rpx;
text-indent: 2rem;
}
}
</style>

View File

@@ -1,10 +1,10 @@
<template>
<view class="box">
<view class="item">
<view class="time">2020-05-14 20:22</view>
<view class="item" v-for="(item,index) in list" :key="index" @click="navto(item.id)">
<view class="time">{{item.addtime}}</view>
<view class="info">
<image class="img"></image>
<view class="title u-line-2">潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名潮牌1折秒杀杨幂同款小白鞋今日43元送10000元大红包还有明星限量签名照</view>
<image class="img" :src="item.picture"></image>
<view class="title u-line-2">{{item.title}}</view>
<view class="next">
<text>查看详情</text>
<image class="right" src="@/static/image/user/1.png"></image>
@@ -68,7 +68,24 @@
export default {
data(){
return {
list:[]
}
},
onLoad(){
this.$u.api.messageList({page:1}).then((res)=>{
console.log(res)
this.list = res.data
})
},
methods:{
navto(id){
console.log(id)
this.$u.route({
url:"/pages/messages/info",
params:{
id
}
})
}
}
}

View File

@@ -12,9 +12,9 @@
<image src="" ></image>
</view>
<view class="names">活动消息</view>
<view class="content u-line-1">12121212</view>
<view class="times">12121</view>
<view class="tishi" v-if="true"></view>
<view class="content u-line-1">{{huodong.data.title}}</view>
<view class="times">{{huodong.data.addtime}}</view>
<view class="tishi" v-if="huodong.count != 0"></view>
</view>
<!-- <u-empty text="并没有什么消息" mode="message" v-if="Object.keys(list).length == 0" style="margin: auto"></u-empty> -->
<view class="massage_list" v-for="(item,index) in list" :key="index" @click="gochat(item)">
@@ -37,6 +37,11 @@
list: [
],
huodong:{
data:{
}
}
};
},
methods: {
@@ -73,6 +78,10 @@
const res = uni.getSystemInfoSync();
this.swiperHeight = res.windowHeight;
this.list = this.imService.friends;
this.$u.api.isread().then((res)=>{
console.log(res)
this.huodong = res.data
})
}
};
</script>