This commit is contained in:
zmr900709
2020-07-09 16:35:23 +08:00
parent 3d8cfd23d4
commit 10bbccc2bd
7 changed files with 139 additions and 37 deletions

View File

@@ -2,7 +2,7 @@
<view>
<u-navbar :is-back="false" :title-size="36" title="消息">
<view class="slot-wrap">
<image src="../../static/pageD/info(3).png"></image>
<image src="../../static/pageD/info(3).png" @click="delMessage()"></image>
<image src="../../static/pageD/info(2).png"></image>
</view>
</u-navbar>
@@ -11,7 +11,7 @@
</view>
<view class="sousuo"></view>
<view class="backes">
<titles></titles>
<titles :information="information_dles"></titles>
</view>
<!-- 消息通知 -->
<view class="backes">
@@ -20,12 +20,13 @@
<view>
<image :src="item.url"></image>
</view>
<view class="title">{{item.text}}</view>
<view class="title">{{item.title}}</view>
<view class="contentes">{{item.contentes}}</view>
<view class="times">{{item.title}}</view>
</view>
</view>
</view>
<u-toast ref="uToast" />
</view>
</template>
@@ -34,6 +35,29 @@
export default {
data() {
return {
information_dles : [{
id: 0,
url: '../../static/pageD/info(11).png',
text: '公告/资讯'
},
{
id: 0,
url: '../../static/pageD/info(6).png',
text: '活动消息'
},
{
id: 0,
url: '../../static/pageD/info(14).png',
text: '交易物流'
},
{
id: 0,
url: '../../static/pageD/info(15).png',
text: '关注消息'
},
],
// 通知消息
information_dl: [{
id: 0,
@@ -63,6 +87,10 @@
show: false
};
},
onLoad() {
// /消息模块的请求
this.messageIndex()
},
methods: {
// 选中某个复选框时由checkbox时触发
checkboxChange(e) {
@@ -75,6 +103,46 @@
mask_u() {
this.show = !this.show
},
// 消息模块的读取
messageIndex(){
console.log("消息模块的读取消息模块的读取消息模块的读取")
this.$u.api.messageIndex({}).then((res)=>{
console.log(res)
let data = res.data.allMessages;
for(let i in data){
var type = data[i].type;
console.log(data[i].type)
var array = []
array.push(type)
}
console.log( array)
// 获取到字段的类型 添加到数据中心
for(let j = 0; j < this.information_dles.length; j++ ){
console.log()
// this.information_dles[j].type = type;
for(let k = 0; k < array.length; k++ ){
this.information_dles[j].type = array[k];
console.log( array[k])
}
}
console.log(this.information_dles)
})
},
// 清空消息
delMessage(){
this.$u.api.delMessage({
type : "all"
}).then((res)=>{
console.log(res)
if(res.errCode == 0){
this.$refs.uToast.show({
title: '清除成功',
type: 'success'
})
}
})
}
},
components: {