You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

249 lines
4.5 KiB

<template>
<view class="body">
<view class="font">
<uni-icons style="padding-left: 11px;color: white;font-weight: 100;cursor: pointer;" type="back" size="23" @click="backs"></uni-icons>
<text style="margin-left: 30%;color: white;">Message</text>
</view>
<view class="empty_item" v-if="!List">
<view class="empty_item_img">
<image src="../../static/img/message.png" mode=""></image>
</view>
<view>No comment!</view>
<!-- <view><button @click="gotoindex()">Go to see</button></view> -->
</view>
<view class="mask" v-show="isShwo" @click="isShwo=false"></view>
<button class="body-btn">Continue shopping</button>
</view>
</template>
<script>
import {
defaultRequest
} from '../../api/index.js'
export default {
data() {
return {
list: [],
//个人信息
myMes: {
_action: 'getmessagelist',
type: 1,
importance: '',
label: '',
title: '',
page_index: 1,
page_size: 100
},
//系统信息
myMes1: {
_action: 'getmessagelist',
type: 0,
importance: '',
label: '',
title: '',
page_index: 1,
page_size: 100
},
app_Mes: [],
}
},
filters: {
Mes(e) {
let str = e
str = str.substring(0, 10);
const year = str.substring(0, 4)
let date = str.substring(5, 10)
date = date.replace('-', '/')
let time = date + '/' + year
return time
}
},
methods: {
// getList(){
// let data={_action:'getfavourableactivities'}
// defaultRequest(data).then(res=>{
// console.info(res)
// if(res.error==0){
// // this.list=res.data
// }
// })
// },
getMes() {
let data = {
_action: 'getpagedata',
pagecode: '006-PERSONALCENTERPAGE'
}
defaultRequest(data).then(res => {
let list = res.data.zones
list.map(item => {
if (item.zone_code == 'XIAOXI') {
this.list = item
console.log(this.list)
}
})
})
defaultRequest(this.myMes).then(res => {
console.log(res)
let i = 0
if (res.error == 0) {
this.app_Mes = res.data.message_list
this.app_Mes.map(item => {
// console.log(item)
if (item.unread == 1) {
i++
}
})
console.log(i)
}
})
defaultRequest(this.myMes1).then(res => {
// console.log(res)
if (res.error == 0) {
this.app_Mes = res.data.message_list
console.log(this.app_Mes)
}
})
},
gotopage(item) {
let data = {
_action: 'readmessage',
message_id: ''
}
console.log(item)
if (item.id) {
data.message_id = item.id
}
// else{
// data.message_id = item.block_id
// }
defaultRequest(data).then(res => {
if (res.error == 0) {
uni.showToast({
title: 'Read',
icon: 'none'
})
console.log(res)
this.getMes()
}
})
if (item.block_link) {
if (item.block_link.includes('goodslist')) {
const i = item.block_link.indexOf('?')
const src = item.block_link.substring(i)
uni.navigateTo({
url: '../category/productList' + src
})
} else {
uni.navigateTo({
url: '../productDetails/index' + src
})
}
}
},
backs() {
// uni.navigateTo({
// url:'../category/index'
// })
uni.navigateTo({
// url:'index'
url:'../category/index'
// url:'../account/index'
})
}
},
onLoad() {
// this.getList()
this.getMes()
}
}
</script>
<style lang="scss" scoped>
.font {
display: flex;
position: fixed;
background-color: #000;
height: 44px;
width: 100%;
z-index: 999;
// padding-top: 28px;
align-items: center;
text-align: center;
top: 0;
left: 0;
font-size: 16px;
// font-weight: bold;
}
.empty_item {
height: auto;
margin: 79px 0 0;
padding: 10px 50px 0 50px;
&_img {
margin-bottom: 0;
}
}
.body {
padding: 0 32rpx;
&-btn {
// margin-top: 42px;
background: #000;
border-radius: 8px;
color: #fff;
width: 200px;
height: auto;
transform: scale(.5);
}
}
.more {
text-align: right;
position: relative;
// margin-top: 20rpx;
image {
width: 24rpx;
height: 6.67rpx;
}
.more_delete {
background-image: url(@/static/img/message.png);
background-size: 100% 100%;
width: 102.67rpx;
height: 67.33rpx;
position: absolute;
right: 0;
bottom: 20rpx;
line-height: 50rpx;
text-align: center;
font-size: 24rpx;
z-index: 999;
}
}
.mask {
background-color: white;
opacity: 0;
}
</style>