114 lines
4.4 KiB
HTML
114 lines
4.4 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
|
|
<title>Title</title>
|
|
<link rel="stylesheet" href="css/reset.css">
|
|
<link rel="stylesheet" href="css/swiper.css">
|
|
<link rel="stylesheet" href="css/style.css">
|
|
<script src="js/rem.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="app" v-cloak>
|
|
<div class="feedback-type">
|
|
<div class="type-box" :class="{active: tab == '0'}" @click="changeTab('0')">未回复</div>
|
|
<div class="type-box" :class="{active: tab == '1'}" @click="changeTab('1')">已回复</div>
|
|
</div>
|
|
<div class="feedback-list">
|
|
<div class="feedback-box" v-for="item in feedbackList" @click="checkDetail(item.contentOpinionId, item.opinionReply, item.opinionReplyTime)">
|
|
<div class="feedback-avatar">
|
|
<img src="image/default.png" alt="" v-if="!item.opinionImage">
|
|
<img :src="requestUrl + 'news/route/file/downloadfile/true/' + item.opinionImage" alt="" v-else>
|
|
</div>
|
|
<div class="feedback-info">
|
|
<div class="feedback-text">{{item.opinionContent}}</div>
|
|
<div class="feedback-time">{{item.gmtCreate}}</div>
|
|
</div>
|
|
</div>
|
|
<div class="have-more" v-if="haveMore" @click="loadMore">加载更多</div>
|
|
<div class="loading" v-if="isLoading">
|
|
<img src="image/loading.gif" alt="">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="js/vue.js"></script>
|
|
<script src="js/jquery-2.1.4.min.js"></script>
|
|
<script src="js/ajax.js"></script>
|
|
<script src="js/swiper.js"></script>
|
|
<script src="js/layer/layer.js"></script>
|
|
<script>
|
|
var vue = new Vue({
|
|
el: '#app',
|
|
data: {
|
|
requestUrl: 'http://219.159.20.131:8081/',
|
|
token: sessionStorage.getItem('token'),
|
|
tab: '0',
|
|
feedbackList: [],
|
|
page: {
|
|
page: 1,
|
|
rows: 10,
|
|
opinionReplyStatus: 0
|
|
},
|
|
haveMore: true,
|
|
isLoading:false
|
|
},
|
|
methods: {
|
|
changeTab: function (tab) {
|
|
if (!this.isLoading) {
|
|
if (this.tab != tab) {
|
|
this.tab = tab
|
|
this.page.page = 1
|
|
this.page.opinionReplyStatus = tab
|
|
this.getFeedbackList()
|
|
}
|
|
}
|
|
},
|
|
getFeedbackList: function () {
|
|
var self = this
|
|
self.isLoading = true
|
|
doGetForm(self.requestUrl + 'news/app/contentopinion/listpage/travelOpinionFeedback', self.page, null, function (code, data) {
|
|
for (let i = 0; i < data.rows.length; i++) {
|
|
if (data.rows[i].opinionImage) {
|
|
data.rows[i].opinionImage = data.rows[i].opinionImage.split(',')[0]
|
|
}
|
|
}
|
|
if (self.page.page == 1) {
|
|
self.feedbackList = data.rows
|
|
} else {
|
|
if (data.rows.length > 0) {
|
|
for (let i = 0; i < data.rows.length; i++) {
|
|
self.feedbackList.push(data.rows[i])
|
|
}
|
|
} else {
|
|
self.page.page--
|
|
layer.msg('暂无更多')
|
|
}
|
|
}
|
|
if (data.rows.length < self.page.rows) {
|
|
self.haveMore = false
|
|
}
|
|
self.isLoading = false
|
|
}, null, function (res) {
|
|
res.setRequestHeader('token',self.token)
|
|
})
|
|
},
|
|
checkDetail: function (id,reply,time) {
|
|
if (!this.isLoading) {
|
|
window.location.href = 'feedback-detail.html?contentOpinionId=' + id + '&reply=' + reply + '&time=' + encodeURI(time)
|
|
}
|
|
},
|
|
loadMore: function () {
|
|
if (!this.isLoading) {
|
|
this.page.page++
|
|
this.getFeedbackList()
|
|
}
|
|
}
|
|
},
|
|
mounted: function () {
|
|
this.getFeedbackList()
|
|
}
|
|
})
|
|
</script>
|
|
</body>
|
|
</html> |