Browse Source

no message

featrue/v4.1
xpz2018 5 years ago
parent
commit
e74f316ea0
11 changed files with 3 additions and 52 deletions
  1. 5
      pages/agent/factory/index.js
  2. 7
      pages/article/detail/index.js
  3. 1
      pages/article/factory/index.js
  4. 5
      pages/article/hot-index/index.js
  5. 2
      pages/article/list/index.js
  6. 2
      pages/article/point-index/index.js
  7. 2
      pages/article/price-detail/index.js
  8. 2
      pages/article/price-index/index.js
  9. 8
      pages/article/publish/index.js
  10. 13
      pages/article/queue-detail/index.js
  11. 8
      pages/article/queue-index/index.js

5
pages/agent/factory/index.js

@ -50,14 +50,12 @@ Page({
this.data.form.millPaperId = options.id this.data.form.millPaperId = options.id
wx.showLoading({ title: '加载中', mask: true }) wx.showLoading({ title: '加载中', mask: true })
getFactoryPriceDetail(options.id).then(result => { getFactoryPriceDetail(options.id).then(result => {
//成功回调
if(result.data.paperCategoryList && result.data.paperCategoryList.length){ if(result.data.paperCategoryList && result.data.paperCategoryList.length){
this.data.cateId = result.data.paperCategoryList[this.data.cateIndex].categoryId this.data.cateId = result.data.paperCategoryList[this.data.cateIndex].categoryId
} }
this.setData({ factoryDetail: result.data }) this.setData({ factoryDetail: result.data })
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
//异常回调
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
@ -65,7 +63,6 @@ Page({
}, },
onEvent: function (message) { onEvent: function (message) {
if (message.what == 570 || message.what == 571 || message.what == 572 || message.what == 573) { if (message.what == 570 || message.what == 571 || message.what == 572 || message.what == 573) {
// 帖子发布刷新
this.onRefreshList() this.onRefreshList()
} }
}, },
@ -129,7 +126,6 @@ Page({
} }
this.setData({ requesting: true }) this.setData({ requesting: true })
getPreferList(this.data.form).then(result => { getPreferList(this.data.form).then(result => {
//成功回调
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `momentList[${this.data.momentList.length}]` let nowList = `momentList[${this.data.momentList.length}]`
@ -145,7 +141,6 @@ Page({
this.setData({ finished: true, requesting: false }) this.setData({ finished: true, requesting: false })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ requesting: false }) this.setData({ requesting: false })
}) })
}, },

7
pages/article/detail/index.js

@ -41,14 +41,11 @@ Page({
this.data.id = options.id this.data.id = options.id
this.data.form.articleId = options.id this.data.form.articleId = options.id
wx.showLoading({ title: '加载中', mask: true }) wx.showLoading({ title: '加载中', mask: true })
// /article/get/Article-detail/{id}文章详情
getMomentDetail(options.id).then(result => { getMomentDetail(options.id).then(result => {
//成功回调
this.setData({ momentDetail: result.data }) this.setData({ momentDetail: result.data })
this.fetchCommentList() this.fetchCommentList()
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
//异常回调
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })
@ -67,7 +64,6 @@ Page({
return return
} }
this.setData({ requesting: true }) this.setData({ requesting: true })
// /article-reply/get/reply-list/in/{articleId} 帖子评论列表
getCommentList(this.data.id, this.data.form).then(result => { getCommentList(this.data.id, this.data.form).then(result => {
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
@ -96,7 +92,6 @@ Page({
this.setData({ requesting: false, finished: true }) this.setData({ requesting: false, finished: true })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ requesting: false }) this.setData({ requesting: false })
}) })
}, },
@ -138,7 +133,6 @@ Page({
} }
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
var form = { content: this.data.comment, articleId: this.data.id} var form = { content: this.data.comment, articleId: this.data.id}
// /article-reply/reply 评论
commentMoment(form).then(result => { commentMoment(form).then(result => {
this.setData({ inputBottom: 0, focus: false, comment: '' }) this.setData({ inputBottom: 0, focus: false, comment: '' })
wx.hideLoading() wx.hideLoading()
@ -159,7 +153,6 @@ Page({
util.showToast('请勿重复点赞') util.showToast('请勿重复点赞')
return return
} }
// /article-reply/like-or-cancel/reply 点赞评论
likeComment({replyId: item.id}).then(result => { likeComment({replyId: item.id}).then(result => {
if(item.isLiked){ if(item.isLiked){
this.setData({ this.setData({

1
pages/article/factory/index.js

@ -34,7 +34,6 @@ Page({
this.data.idString = options.ids this.data.idString = options.ids
} }
getAllFactoryList().then(result => { getAllFactoryList().then(result => {
//成功回调
if(!util.isEmpty(this.data.recommendedString)){ if(!util.isEmpty(this.data.recommendedString)){
var that = this var that = this
result.data.forEach(element => { result.data.forEach(element => {

5
pages/article/hot-index/index.js

@ -97,9 +97,7 @@ Component({
return return
} }
this.data.requesting = true this.data.requesting = true
// /article/get/article-list 查询文章列表
getPreferList(this.data.form).then(result => { getPreferList(this.data.form).then(result => {
//成功回调
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `momentList[${this.data.momentList.length}]` let nowList = `momentList[${this.data.momentList.length}]`
@ -115,7 +113,6 @@ Component({
this.setData({ finished: true, requesting: false }) this.setData({ finished: true, requesting: false })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ requesting: false }) this.setData({ requesting: false })
}) })
}, },
@ -126,7 +123,6 @@ Component({
} }
this.data.loopRequesting = true this.data.loopRequesting = true
getIndexInfoId().then(result => { getIndexInfoId().then(result => {
//成功回调
this.data.loopRequesting = false this.data.loopRequesting = false
this.data.noticeList = result.data this.data.noticeList = result.data
if(result.data && result.data.length){ if(result.data && result.data.length){
@ -135,7 +131,6 @@ Component({
this.setData({ content: result.data[0].title}) this.setData({ content: result.data[0].title})
} }
}).catch(err => { }).catch(err => {
//异常回调
this.data.loopRequesting = false this.data.loopRequesting = false
}) })
}, },

2
pages/article/list/index.js

@ -160,12 +160,10 @@ Page({
onTap(e) { onTap(e) {
wx.showLoading({ title: '处理中', mask: true }) wx.showLoading({ title: '处理中', mask: true })
deleteMoment({id: item.id}).then(result => { deleteMoment({id: item.id}).then(result => {
//成功回调
wx.hideLoading() wx.hideLoading()
util.showToast('删除成功') util.showToast('删除成功')
that.onRefreshList() that.onRefreshList()
}).catch(err => { }).catch(err => {
//异常回调
wx.hideLoading() wx.hideLoading()
util.showToast(err) util.showToast(err)
}) })

2
pages/article/point-index/index.js

@ -66,7 +66,6 @@ Component({
} }
this.data.requesting = true this.data.requesting = true
getPreferList(this.data.form).then(result => { getPreferList(this.data.form).then(result => {
//成功回调
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `momentList[${this.data.momentList.length}]` let nowList = `momentList[${this.data.momentList.length}]`
@ -82,7 +81,6 @@ Component({
this.setData({ requesting: false }) this.setData({ requesting: false })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ requesting: false }) this.setData({ requesting: false })
}) })
}, },

2
pages/article/price-detail/index.js

@ -59,7 +59,6 @@ Page({
this.setData({ requesting: true }) this.setData({ requesting: true })
} }
getFactoryPrice(this.data.form).then(result => { getFactoryPrice(this.data.form).then(result => {
//成功回调
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `orderList[${this.data.orderList.length}]` let nowList = `orderList[${this.data.orderList.length}]`
@ -93,7 +92,6 @@ Page({
}) })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ this.setData({
requesting: false, requesting: false,
finished: true, finished: true,

2
pages/article/price-index/index.js

@ -60,7 +60,6 @@ Component({
} }
this.data.requesting = true this.data.requesting = true
getPreferList(this.data.form).then(result => { getPreferList(this.data.form).then(result => {
//成功回调
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `momentList[${this.data.momentList.length}]` let nowList = `momentList[${this.data.momentList.length}]`
@ -76,7 +75,6 @@ Component({
this.setData({ finished: true, requesting: false }) this.setData({ finished: true, requesting: false })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ requesting: false }) this.setData({ requesting: false })
}) })
} }

8
pages/article/publish/index.js

@ -37,7 +37,6 @@ Page({
if(options.id){ if(options.id){
wx.showLoading({ title: '加载中', mask: true }) wx.showLoading({ title: '加载中', mask: true })
getMomentDetail(options.id).then(result => { getMomentDetail(options.id).then(result => {
// imgUrlList
var fileList = [] var fileList = []
if (result.data.imgUrlList && result.data.imgUrlList.length) { if (result.data.imgUrlList && result.data.imgUrlList.length) {
result.data.imgUrlList.forEach(element => { result.data.imgUrlList.forEach(element => {
@ -47,7 +46,6 @@ Page({
this.setData({ form: result.data, fileList: fileList }) this.setData({ form: result.data, fileList: fileList })
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
//异常回调
wx.hideLoading() wx.hideLoading()
}) })
} }
@ -82,7 +80,6 @@ Page({
this.data.requesting = true this.data.requesting = true
if(util.isEmpty(this.data.form.id)){ if(util.isEmpty(this.data.form.id)){
updateMoment(this.data.form).then(result => { updateMoment(this.data.form).then(result => {
//成功回调
wx.hideLoading() wx.hideLoading()
var what = 570 var what = 570
if(Number(this.data.form.categoryId) > 0){ if(Number(this.data.form.categoryId) > 0){
@ -91,20 +88,16 @@ Page({
event.emit('EventMessage', { what, desc: 'PostChange' }) event.emit('EventMessage', { what, desc: 'PostChange' })
util.showBackToast('发布成功') util.showBackToast('发布成功')
}).catch(err => { }).catch(err => {
//异常回调
wx.hideLoading() wx.hideLoading()
this.data.requesting = false this.data.requesting = false
util.showToast(err) util.showToast(err)
}) })
} else { } else {
// /article/update/Article/{id} 编辑文章
postMoment(this.data.form.id, this.data.form).then(result => { postMoment(this.data.form.id, this.data.form).then(result => {
//成功回调
wx.hideLoading() wx.hideLoading()
event.emit('EventMessage', { what: 501, desc: 'PostChange' }) event.emit('EventMessage', { what: 501, desc: 'PostChange' })
util.showBackToast('编辑成功') util.showBackToast('编辑成功')
}).catch(err => { }).catch(err => {
//异常回调
wx.hideLoading() wx.hideLoading()
this.data.requesting = false this.data.requesting = false
util.showToast(err) util.showToast(err)
@ -129,7 +122,6 @@ Page({
this.pickerView.showPicker(this.data.factoryList) this.pickerView.showPicker(this.data.factoryList)
wx.hideLoading() wx.hideLoading()
}).catch(err => { }).catch(err => {
//异常回调
wx.hideLoading() wx.hideLoading()
}) })
} }

13
pages/article/queue-detail/index.js

@ -68,19 +68,10 @@ Page({
}) })
} }
} else { } else {
this.setData({
finished: true,
requesting: false,
loading: false
})
this.setData({ finished: true, requesting: false, loading: false })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({
requesting: false,
finished: true,
loading: false
})
this.setData({ requesting: false, finished: true, loading: false })
}) })
} }

8
pages/article/queue-index/index.js

@ -45,11 +45,7 @@ Component({
}, },
//*************************************************momentList************************************************// //*************************************************momentList************************************************//
onRefreshList: function () { onRefreshList: function () {
this.setData({
momentList: [],
['form.pageNum']: 1,
finished: false
})
this.setData({ momentList: [], ['form.pageNum']: 1, finished: false })
this.fetchMomentList() this.fetchMomentList()
}, },
fetchMomentList: function(){ fetchMomentList: function(){
@ -58,7 +54,6 @@ Component({
} }
this.data.requesting = true this.data.requesting = true
getPreferList(this.data.form).then(result => { getPreferList(this.data.form).then(result => {
//成功回调
if (result.data.records.length) { if (result.data.records.length) {
var respList = result.data.records var respList = result.data.records
let nowList = `momentList[${this.data.momentList.length}]` let nowList = `momentList[${this.data.momentList.length}]`
@ -74,7 +69,6 @@ Component({
this.setData({ finished: true, requesting: false }) this.setData({ finished: true, requesting: false })
} }
}).catch(err => { }).catch(err => {
//异常回调
this.setData({ requesting: false }) this.setData({ requesting: false })
}) })
} }

Loading…
Cancel
Save