|
|
|
@ -15,13 +15,13 @@
|
|
|
|
|
:clearabled="true"
|
|
|
|
|
class="view-global"
|
|
|
|
|
bgColor="#fff"
|
|
|
|
|
@search="onSearch"
|
|
|
|
|
@clear="onClear"
|
|
|
|
|
@change="ListMsg"
|
|
|
|
|
></u-search>
|
|
|
|
|
<view class="msg-list">
|
|
|
|
|
<view
|
|
|
|
|
class="msg-item view-global"
|
|
|
|
|
v-for="(item, index) in listMsgs"
|
|
|
|
|
@click="getMesInfo(item)"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<view class="msg-icon" style="background-color: #367bef">
|
|
|
|
@ -29,7 +29,7 @@
|
|
|
|
|
<u-badge
|
|
|
|
|
bgColor="#FE3434"
|
|
|
|
|
max="99"
|
|
|
|
|
|
|
|
|
|
:isDot="item.isLook == 1 ? false : true"
|
|
|
|
|
:absolute="true"
|
|
|
|
|
:offset="[0, 0]"
|
|
|
|
|
></u-badge>
|
|
|
|
@ -77,68 +77,70 @@
|
|
|
|
|
<view class="msg-date">19:18</view>
|
|
|
|
|
</view> -->
|
|
|
|
|
</view>
|
|
|
|
|
<u-modal :show="show" :title="msgInfo.title" :content='msgInfo.content' @confirm="confirm"></u-modal>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
import { listNews, delNews } from "../../api/jn/news";
|
|
|
|
|
import { shopIdlist, deleteShopId, getInfoShop, isLookCount } from "../../api/jn/news";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
listMsgs: [],
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
title: "",
|
|
|
|
|
status: 0
|
|
|
|
|
id:'',
|
|
|
|
|
},
|
|
|
|
|
show: false,
|
|
|
|
|
msgInfo: {
|
|
|
|
|
title:"",
|
|
|
|
|
content:""
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onLoad() {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
onShow() {
|
|
|
|
|
this.ListMsg();
|
|
|
|
|
const launchOptions = uni.getLaunchOptionsSync();
|
|
|
|
|
const { query } = launchOptions;
|
|
|
|
|
// console.log(query,"query");
|
|
|
|
|
if(query.storeId) {
|
|
|
|
|
this.queryParams.id = query.storeId;
|
|
|
|
|
this.ListMsg();
|
|
|
|
|
} else {
|
|
|
|
|
uni.$u.toast('店铺id为空')
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
onAllclear() {
|
|
|
|
|
this.$modal.confirm('确定删除所有消息吗?').then(() => {
|
|
|
|
|
let ids = [];
|
|
|
|
|
this.listMsgs.forEach(element => {
|
|
|
|
|
ids.push(element.id);
|
|
|
|
|
});
|
|
|
|
|
if(ids.length == 0) {
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
delNews(ids).then((res) => {
|
|
|
|
|
console.log(JSON.stringify(res),"删除接口");
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
this.ListMsg();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
onSearch() {
|
|
|
|
|
this.ListMsg();
|
|
|
|
|
},
|
|
|
|
|
onClear() {
|
|
|
|
|
this.queryParams.title = "";
|
|
|
|
|
this.ListMsg();
|
|
|
|
|
deleteShopId(15).then((res) => {
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
uni.showToast({ title: "删除成功", icon: 'success' })
|
|
|
|
|
this.ListMsg();
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getMesInfo(item) {
|
|
|
|
|
this.show = true;
|
|
|
|
|
this.msgInfo = item;
|
|
|
|
|
getInfoShop(item.id).then(res=>{})
|
|
|
|
|
},
|
|
|
|
|
ListMsg() {
|
|
|
|
|
listNews(this.queryParams).then((res) => {
|
|
|
|
|
// console.log(res);
|
|
|
|
|
this.listMsgs = res.rows;
|
|
|
|
|
if(res.code == 200) {
|
|
|
|
|
uni.setTabBarBadge({
|
|
|
|
|
//显示数字
|
|
|
|
|
index: 1, //tabbar下标
|
|
|
|
|
text: res.total + '', //数字
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
shopIdlist(this.queryParams).then((res) => {
|
|
|
|
|
this.listMsgs = res.data;
|
|
|
|
|
// if(res.code == 200) {
|
|
|
|
|
// uni.setTabBarBadge({
|
|
|
|
|
// //显示数字
|
|
|
|
|
// index: 1, //tabbar下标
|
|
|
|
|
// text: res.total + '', //数字
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
confirm(){
|
|
|
|
|
this.show = false
|
|
|
|
|
this.ListMsg();
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
@ -161,7 +163,11 @@ export default {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
.u-badge {
|
|
|
|
|
width: 10px;
|
|
|
|
|
height: 10px;
|
|
|
|
|
left: 0px;
|
|
|
|
|
}
|
|
|
|
|
image {
|
|
|
|
|
height: 44rpx;
|
|
|
|
|
width: 44rpx;
|
|
|
|
|