意见反馈消息列表模式

This commit is contained in:
2022-07-13 15:52:58 +08:00
parent b9e5946f91
commit 47aa866d86
9 changed files with 4679 additions and 2514 deletions

40
apis/interfaces/news.js Normal file
View File

@@ -0,0 +1,40 @@
/**
* Web-zdx
* moduleName: 消息中心
*/
import {
request
} from '../index'
// 意见反馈通知列表
const list = (type,data) => {
return request({
url: 'notifications/'+type+'/list',
data:data,
})
}
// 意见反馈 详情
const detail = (notification_id) => {
return request({
url: 'notifications/'+notification_id,
})
}
// 全部已读
const readAll = (type) => {
return request({
url: 'notifications/'+type,
method:'PUT',
})
}
export {
list,
detail,
readAll,
}

View File

@@ -464,6 +464,50 @@
} }
} }
,{
"path" : "pages/news/index",
"name": "newsIndex",
"style" :
{
"navigationBarTitleText": "消息中心",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"type": "default",
"buttons": [{
"float": "right",
"text": " 全部已读",
"width": "80px",
"fontSize": "14px",
"color": "#34CE98"
}]
}
}
}
}
,{
"path" : "pages/news/detail",
"name": "newsDetail",
"style" :
{
"navigationBarTitleText": "反馈详情",
"enablePullDownRefresh": false,
"app-plus": {
"titleNView": {
"type": "default",
"buttons": [{
"float": "right",
"text": "微信客服",
"width": "80px",
"fontSize": "14px",
"color": "#34CE98"
}]
}
}
}
}
], ],
"tabBar": { "tabBar": {
"borderStyle": "white", "borderStyle": "white",

316
pages/news/detail.vue Normal file
View File

@@ -0,0 +1,316 @@
<template>
<view class="notification">
<view class="notification-block">
<view class="notification-title">
<view class="" style="display: flex;flex-direction: row;">
<image class="answer-img" src="/static/news/news.png" mode="widthFix" />官方客服回复
</view>
<view class="date" v-if="notificationInfo.detail"> {{notificationInfo.detail.created_at}}</view>
</view>
<view class="notification-radiobox">
<view class="answer show"> A : {{notificationInfo.content}}</view>
</view>
</view>
<view class="notification-block">
<view class="notification-title">
我的意见与建议
<view class="date"> {{notificationInfo.created_at}}</view>
</view>
<view class="notification-radiobox">
<view class="notification-radiobox-item" :class="{'show': radioValue === '页面闪退'}">页面闪退</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '操作体验'}">操作体验</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '账号问题'}">账号问题</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '功能异常'}">功能异常</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '产品建议'}">产品建议</view>
<view class="notification-radiobox-item" :class="{'show': radioValue === '其他问题'}">其他问题</view>
</view>
</view>
<view class="notification-block" v-if="notificationImg.length>0">
<view class="notification-title">上传应用截图({{notificationImg.length}}/8)</view>
<view class="notification-sbutitle">上传出现问题的应用图片</view>
<view class="notification-imgs">
<view class="notification-imgs-item" v-for="(item, index) in notificationImg" :key="index">
<image :src="item" mode="aspectFill" @click="prieve(index)"></image>
</view>
</view>
</view>
<view class="notification-block" v-if="description.length>0">
<view class="notification-title"> 问题说明</view>
<view class="notification-sbutitle">请对您所遇到的问题进行尽可能详细的描述</view>
<view class="notification-textarea">
<textarea maxlength="200" v-model="description" :disabled="true" />
<view class="notification-textarea-size">{{description.length}}/200</view>
</view>
</view>
<view class="notification-block" v-if="mobile.length>0">
<view class="notification-title">联系方式</view>
<input class="notification-input" type="number" :disabled="true" v-model="mobile" maxlength="11"
placeholder="输入手机号码" />
</view>
<!-- 微信客服 -->
<u-modal :show="wechatCode" title="微信客服" confirmColor="#34CE98" :showCancelButton="true" cancelText="关闭"
confirmText="保存二维码" @cancel="wechatCode = false" @confirm="dowQrCode">
<slot>
<view class="wechat-content">
<image class="wechat-qrcode" :src="require('@/static/user/qrCode.jpeg')" mode="widthFix"></image>
<view class="wechat-text">扫描企业微信二维码添加微信客服</view>
</view>
</slot>
</u-modal>
</view>
</template>
<script>
import {
notifications
} from '@/apis/interfaces/versions'
import {
detail
} from '@/apis/interfaces/news'
export default {
data() {
return {
radioValue: "页面闪退",
description: "",
mobile: "",
systemInfo: {},
notificationImg: [],
wechatCode: false,
notificationInfo: {}
}
},
onLoad() {
uni.getSystemInfo({
success: systemRes => {
this.systemInfo = {
brand: systemRes.brand,
models: systemRes.model,
pixel: systemRes.pixelRatio,
width: systemRes.windowWidth,
height: systemRes.windowHeight,
version: systemRes.system,
platform: systemRes.platform,
font_size: systemRes.fontSizeSetting,
client_id: systemRes.deviceId,
}
}
})
detail(this.$Route.query.id).then(res => {
this.notificationInfo = res;
this.radioValue = res.detail.type || ''
this.notificationImg = res.detail.pictures || []
this.description = res.detail.description || ''
this.mobile = res.detail.mobile || ''
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
})
})
},
onNavigationBarButtonTap() {
this.wechatCode = true
},
methods: {
dowQrCode() {
uni.saveImageToPhotosAlbum({
filePath: require('@/static/user/qrCode.jpeg'),
success(res) {
uni.showToast({
title: '二维码已保存到系统相册',
icon: 'none'
})
},
fail(err) {
uni.showToast({
title: err.message,
icon: 'none'
})
}
})
},
prieve(index) {
uni.previewImage({
urls: this.notificationImg,
current:index
});
}
}
}
</script>
<style scoped lang="scss">
.notification-block {
padding: 30rpx;
border-top: solid 20rpx #F8F8F8;
}
.notification-title {
font-size: 34rpx;
font-weight: bold;
line-height: 40rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.date{
color: grey;
font-size: 26rpx;
font-weight: normal;
}
}
.notification-title text {
color: #e6576b;
padding-left: 5rpx;
}
.notification-radiobox {
display: flex;
flex-wrap: wrap;
margin: 20rpx -10rpx 0;
}
.notification-radiobox-item {
position: relative;
width: calc(33.33% - 20rpx);
display: inline-block;
margin: 10rpx;
background: #F8F8F8;
text-align: center;
line-height: 70rpx;
border-radius: 30rpx;
font-size: 30rpx;
}
.answer {
position: relative;
width: calc(100% - 20rpx);
display: inline-block;
margin: 10rpx;
background: rgba($color: #34ce98, $alpha: 0.1);
text-align: center;
line-height: 70rpx;
border-radius: 10rpx;
font-size: 30rpx;
text-align: left;
padding: 10rpx 20rpx;
}
.notification-radiobox-item.show {
background: #34CE98;
color: white;
}
.notification-imgs {
display: flex;
flex-direction: row;
flex-wrap: wrap;
margin: 10rpx -10rpx 0;
}
.notification-imgs-item {
position: relative;
width: calc(25% - 20rpx);
padding-top: calc(25% - 20rpx);
margin: 20rpx 10rpx 0 10rpx;
}
.notification-imgs-item image {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: solid 1rpx #f8f8f8;
}
.notification-sbutitle {
font-size: 28rpx;
padding-top: 10rpx;
color: gray;
}
.notification-textarea {
background: #F8F8F8;
border-radius: 20rpx;
padding: 20rpx;
margin-top: 20rpx;
}
.notification-textarea textarea {
width: 100%;
height: 200rpx;
font-size: 32rpx;
}
.notification-textarea-size {
text-align: right;
font-size: 28rpx;
color: gray;
}
.notification-input {
background: #F8F8F8;
border-radius: 20rpx;
height: 90rpx;
line-height: 90rpx;
margin-top: 20rpx;
font-size: 32rpx;
padding: 0 20rpx;
}
.btn {
padding: 30rpx;
}
.btn button {
height: 90rpx;
line-height: 90rpx;
border-radius: 45rpx;
background: #34CE98;
font-size: 34rpx;
font-weight: bold;
color: white;
border: none;
padding: 0;
}
.btn button:after {
display: none;
}
/* 弹出层 */
.wechat-content {
text-align: center;
padding: 30rpx 0;
}
.wechat-qrcode {
width: 248rpx;
height: 248rpx;
}
.wechat-text {
text-align: center;
font-size: 28rpx;
color: gray;
padding-top: 30rpx;
}
.answer-img {
width: 50rpx;
height: 50rpx;
margin-right: 10rpx;
}
</style>

174
pages/news/index.vue Normal file
View File

@@ -0,0 +1,174 @@
<template>
<view class="news">
<block v-if="lists.length > 0">
<view class="list-item" v-for="(item,index) in lists" :key="index" @click="goUrl(item.notification_id,index)">
<u-badge class="bell_fill_dot" :isDot="item.read_at === ''" type="error" />
<image src="/static/news/news.png" mode="widthFix" />
<view class="list-item-right">
<view class="top">
<view class="title">
<view class="titl"> 系统反馈 </view>
<view class="des">官方</view>
</view>
<view class="date">{{item.created_at}}</view>
</view>
<view class="sub-title">快捷反馈:{{item.content}}</view>
</view>
</view>
</block>
<view class="no-list" v-else>
<u-empty mode="message" icon="http://cdn.uviewui.com/uview/empty/message.png" text="暂无消息~" textColor="#999" />
</view>
</view>
</template>
<script>
import {list,readAll} from '@/apis/interfaces/news.js'
export default {
data() {
return {
lists:[],
type:'FeedbackNotification',
has_more: true,
page: 1,
}
},
onLoad() {
this.getList();
},
onReachBottom() {
if(this.has_more){
this.page = this.page + 1;
this.getList();
} else{
uni.showToast({
title:'没有更多啦~',
icon:'none',
mask:true,
})
}
},
onNavigationBarButtonTap() {
readAll(this.type).then(res=>{
uni.showToast({
title:'全部已读',
icon:"none",
mask:true,
duration:3000
});
this.page = 1;
this.has_more = true;
this.getList();
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true,
duration:3000
})
})
},
methods: {
goUrl(id,index){
this.lists[index].read_at = '11111'
this.$Router.push({name:'newsDetail',params:{id:id}});
},
getList(){
list(this.type,{page:this.page}).then(res=>{
if(this.page === 1){
this.lists = []
}
this.lists = this.lists.concat(res.data)
this.has_more = res.page.has_more
}).catch(err=>{
uni.showToast({
title:err.message,
icon:"none",
mask:true,
duration:3000
})
})
}
}
}
</script>
<style lang="scss">
.list-item {
padding: $padding - 10 $padding;
display: flex;
flex-direction: row;
align-items: flex-start;
justify-content: center;
box-sizing: border-box;
border-bottom: solid 1rpx #f0f0f0;
image {
width: 100rpx;
height: 100rpx;
}
.list-item-right {
padding-left: $padding - 10;
flex: 1;
.top {
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
.title {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
.titl {
font-size: 32rpx;
font-weight: bold;
}
.des {
margin-left: 10rpx;
border-radius: 6rpx;
border: solid 1rpx #F76260;
font-size: 24rpx;
font-weight: bold;
color: #F76260;
padding: 0 10rpx;
}
}
.date {
font-size: 26rpx;
color: grey;
padding-right: 10rpx;
}
}
.sub-title {
font-size: 26rpx;
color: grey;
padding-top: 10rpx;
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
}
.no-list {
height: 80vh;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
box-sizing: border-box;
}
</style>

View File

@@ -1,12 +1,15 @@
<template> <template>
<view class="content"> <view class="content">
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="info-box"> <view class="info-box" style="background-color: red;">
<image src="@/static/user/user_back.png" mode="aspectFill" /> <image src="@/static/user/user_back.png" mode="aspectFill" />
<view class="user-flex"> <view class="user-flex">
<view class="news" @click="onBtn('newsIndex', {})">
<u-icon class="bell_fill" name="bell-fill" color="#fff" size="28" />
<u-badge class="bell_fill_dot" :isDot="messages > 0" type="error" />
</view>
<image class="cover" @click="onBtn('Setting', {})" <image class="cover" @click="onBtn('Setting', {})"
:src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill" /> :src="userInfo.avatar || require('@/static/user/cover.png')" mode="aspectFill" />
<view class="user-content"> <view class="user-content">
<view class="name">{{ userInfo.nickname }}</view> <view class="name">{{ userInfo.nickname }}</view>
<view class="tabs"> <view class="tabs">
@@ -219,7 +222,8 @@
isWallet: false, isWallet: false,
walletNum: 0, walletNum: 0,
// 数据看板权限 // 数据看板权限
canSeeData: false canSeeData: false,
messages:0,
}; };
}, },
onShow() { onShow() {
@@ -227,10 +231,14 @@
this.getInfo(); this.getInfo();
}, },
methods: { methods: {
zzz(){
console.log('....');
},
// 用户信息 // 用户信息
getInfo() { getInfo() {
if (this.$store.state.token === '') return; if (this.$store.state.token === '') return;
info().then(res => { info().then(res => {
console.log(res)
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: res.nickname title: res.nickname
}); });
@@ -244,10 +252,11 @@
isOpenVip: res.is_open_vip, isOpenVip: res.is_open_vip,
username: res.username username: res.username
} }
this.identity = res.identity this.identity = res.identity;
this.account = res.account this.account = res.account;
this.serial = res.serial this.serial = res.serial;
this.hasPassword = res.has_transfer_password this.hasPassword = res.has_transfer_password;
this.messages = Number(res.messages);
}) })
.catch(err => { .catch(err => {
uni.showToast({ uni.showToast({
@@ -313,6 +322,7 @@
}, },
// 按钮导航 // 按钮导航
onBtn(name, params) { onBtn(name, params) {
console.log('name',name);
this.$Router.push({ this.$Router.push({
name, name,
params params
@@ -476,13 +486,30 @@
right: 0; right: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
// z-index: 100; z-index: 1;
} }
.user-flex { .user-flex {
position: relative; position: relative;
padding: $padding * 2 $padding ($padding * 2 + 60); padding: $padding * 2 $padding ($padding * 2 + 60);
height: 128rpx; height: 128rpx;
.news{
top: -30rpx;
right: -30rpx;
position: relative;
.bell_fill_dot{
position: absolute;
top: 24rpx;
right: 46rpx;
z-index: 1000;
}
.bell_fill{
position: absolute;
right: 50rpx;
top: 30rpx;
z-index: 10000000;
}
}
.cover { .cover {
position: absolute; position: absolute;

BIN
static/news/news.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long