點擊留言,提交評論報錯。
var app = getApp(), WxParse = require("../../public/wxParse/wxParse.js"), article = null;
var input_value;
var actid;
var user_id;
Page({
data: {
syscfg: {},
user: {},
actid: null,
actdata: null,
setcont: "0",
barTitle: "",
input_value: '',
msg_data: '',
to_open: 'none',
to_cover: 'none',
user_id:''
},
open_all: function () {
var that = this;
that.setData({
to_open: 'block',
to_cover: 'block'
})
},
to_cover_over: function () {
var that = this;
that.setData({
to_open: 'none',
to_cover: 'none'
})
},
btn_send: function () {
var that = this
var fetch1
var fetch
//添加評論
console.log(actid);
wx.request({
url: 'https://m.yishushe.net/addons/slwl_fitment/remark.php?action=add_com',
method: 'POST',
header: {
'content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
},
data: {
act_id: actid,
user_id: user_id,
input_value: input_value
},
success: function (result) {
that.setData({
input_value: "",
to_open: 'none',
to_cover: 'none'
})
// 查詢評論fetch
wx.request({
url: 'https://m.yishushe.net/addons/slwl_fitment/remark.php?action=fetch_com',
method: 'POST',
header: {
'content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
},
data: {
id: actid
},
success: result => {
if (result.data.result == 'success') {
fetch = result.data.msg
console.log(fetch)
that.setData({
msg_data: fetch
})
} else if (result.data.msg == 'session已過期') {
//添加重新登錄模塊
wx.showToast({
title: '請重試',
image: '/image/wrong.png',
duration: 3000
})
} else if (result.data.msg == '無評論') {
//do nothing
} else {
wx.showToast({
title: result.data.msg,
image: '/image/wrong.png',
duration: 3000
})
}
},
fail: res => {
wx.showToast({
title: '網(wǎng)絡(luò)不好喲',
image: '/image/wrong.png',
duration: 3000
})
}
})
},
fail: res => {
wx.showToast({
title: '網(wǎng)絡(luò)不好喲',
image: '/image/wrong.png',
duration: 3000
})
}
})
},
bindLinkClick: function(a) {
app.sitefun.clickObjectLink(a, app);
},
bindCopyrightClick: function(a) {
app.sitefun.clickCopyright(a, app);
},
suspendCloseClick: function() {
"0" == app.sys.suspend.suspend_show ? this.setData({
"syscfg.suspend.suspend_show": "1"
}) : this.setData({
"syscfg.suspend.suspend_show": "0"
});
},
onLoad: function(a) {
var that = this
var fetch
wx.getStorage({
key: 'appUserInfo',
success: function (res) {
user_id = res.data.id
that.setData({
user_id: user_id
})
}
})
// 查詢評論fetch
wx.request({
url: 'https://m.yishushe.net/addons/slwl_fitment/remark.php?action=fetch_com',
method: 'POST',
header: {
'content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json'
},
data: {
id: actid
},
success: result => {
if (result.data.result == 'success') {
fetch = result.data.msg
console.log(fetch)
that.setData({
msg_data: fetch
})
} else if (result.data.msg == 'session已過期') {
//添加重新登錄模塊
wx.showToast({
title: '請重試',
image: '/image/wrong.png',
duration: 3000
})
} else if (result.data.msg == '無評論') {
//do nothing
} else {
wx.showToast({
title: result.data.msg,
image: '/image/wrong.png',
duration: 3000
})
}
},
fail: res => {
wx.showToast({
title: '網(wǎng)絡(luò)不好喲',
image: '/image/wrong.png',
duration: 3000
})
}
})
if (this.setData({
actid: a.id
}), null == app.globalData.userInfo || "undefined" == app.globalData.userInfo) {
var t = app.sitefun.getCurrentPageUrlWithArgs();
wx.redirectTo({
url: "/pages/auth/auth?rb=" + encodeURIComponent(t)
});
} else wx.showNavigationBarLoading(), app.info.isLoadInterval = setInterval(this.checkInfo, 500);
},
checkInfo: function() {
null != app.sys && (clearInterval(app.info.isLoadInterval), wx.hideNavigationBarLoading(),
this.setConfig(), this.setActContent(), this.checkPop());
},
setConfig: function() {
this.setData({
syscfg: app.sys,
user: app.globalData.userInfo
}), app.sitefun.appConfig(app);
},
setActContent: function() {
var t = this, a = t.data.actid;
wx.request({
url: app.siteInfo.siteroot + "?i=" + app.siteInfo.uniacid + "&c=entry&a=wxapp&do=smk_actnews_one&m=" + app.moduleName,
data: {
aid: a
},
success: function(a) {
t.setData({
actdata: a.data.data.one,
barTitle: a.data.data.one.newsname
}), wx.setNavigationBarTitle({
title: a.data.data.one.newsname
}), article = a.data.data.one.detail, WxParse.wxParse("article", "html", article, t);
},
error: function(a) {
wx.showToast({
title: a,
image: "/public/images/icon_error.png"
});
}
});
},
checkPop: function() {
var t = this;
wx.request({
url: app.siteInfo.siteroot + "?i=" + app.siteInfo.uniacid + "&c=entry&a=wxapp&do=smk_get_adpop&m=" + app.moduleName,
data: {
uid: app.globalData.userInfo.uid
},
header: {
"content-type": "application/json"
},
success: function(a) {
t.setData({
myadpop: a.data.data
});
},
error: function(a) {
wx.showToast({
title: a,
image: "/public/images/icon_error.png"
});
}
});
},
adpopClose: function() {
0 == this.data.myadpop.adpop_show ? this.setData({
"myadpop.adpop_show": "1"
}) : this.setData({
"myadpop.adpop_show": "0"
});
},
onReady: function() {},
onShow: function() {},
onHide: function() {},
onUnload: function() {},
onPullDownRefresh: function() {},
onReachBottom: function() {},
onShareAppMessage: function() {
return {
title: app.sys.appname,
success: function(a) {},
fail: function(a) {}
};
}
});
showToast:fail parameter error: parameter.title should be String instead of Undefined;
console.error @ VM6812:1
Y @ WAService.js:6
z @ WAService.js:6
vs @ WAService.js:10
(anonymous) @ WAService.js:6
(anonymous) @ WAService.js:7
(anonymous) @ WAService.js:14
(anonymous) @ WAService.js:6
success @ actnews.js? [sm]:85
function.a.(anonymous function) @ WAService.js:7
(anonymous) @ WAService.js:6
(anonymous) @ WAService.js:4
(anonymous) @ WAService.js:7
L.emit @ WAService.js:8
(anonymous) @ WAService.js:12
(anonymous) @ WAService.js:6
a @ appservice?t=1536166881574:10965
(anonymous) @ appservice?t=1536166881574:10965
b.emit @ appservice?t=1536166881574:10965
callback @ appservice?t=1536166881574:10965
setTimeout @ appservice?t=1536166881574:10965
(anonymous) @ WAService.js:4
(anonymous) @ WAService.js:4
setTimeout (async)
setTimeout @ WAService.js:4
n @ appservice?t=1536166881574:10965
c @ appservice?t=1536166881574:10965
v.onreadystatechange @ appservice?t=1536166881574:10965
XMLHttpRequest.send (async)
q @ appservice?t=1536166881574:10965
createRequestTask @ appservice?t=1536166881574:10965
invoke @ appservice?t=1536166881574:10965
invoke @ WAService.js:4
U @ WAService.js:6
H @ WAService.js:6
Rt @ WAService.js:7
e @ WAService.js:12
(anonymous) @ WAService.js:13
(anonymous) @ WAService.js:6
(anonymous) @ WAService.js:7
(anonymous) @ WAService.js:14
(anonymous) @ WAService.js:6
success @ actnews.js? [sm]:58
function.a.(anonymous function) @ WAService.js:7
(anonymous) @ WAService.js:6
(anonymous) @ WAService.js:4
(anonymous) @ WAService.js:7
L.emit @ WAService.js:8
(anonymous) @ WAService.js:12
(anonymous) @ WAService.js:6
a @ appservice?t=1536166881574:10965
(anonymous) @ appservice?t=1536166881574:10965
b.emit @ appservice?t=1536166881574:10965
callback @ appservice?t=1536166881574:10965
setTimeout @ appservice?t=1536166881574:10965
(anonymous) @ WAService.js:4
(anonymous) @ WAService.js:4
setTimeout (async)
setTimeout @ WAService.js:4
n @ appservice?t=1536166881574:10965
c @ appservice?t=1536166881574:10965
v.onreadystatechange @ appservice?t=1536166881574:10965
XMLHttpRequest.send (async)
q @ appservice?t=1536166881574:10965
createRequestTask @ appservice?t=1536166881574:10965
invoke @ appservice?t=1536166881574:10965
invoke @ WAService.js:4
U @ WAService.js:6
H @ WAService.js:6
Rt @ WAService.js:7
e @ WAService.js:12
(anonymous) @ WAService.js:13
(anonymous) @ WAService.js:6
(anonymous) @ WAService.js:7
(anonymous) @ WAService.js:14
(anonymous) @ WAService.js:6
btn_send @ actnews.js? [sm]:39
(anonymous) @ WAService.js:19
l @ WAService.js:18
Dt @ WAService.js:19
ln @ WAService.js:20
(anonymous) @ WAService.js:20
(anonymous) @ WAService.js:19
(anonymous) @ WAService.js:10
n @ WAService.js:6
a @ appservice?t=1536166881574:10965
e.registerCallback @ appservice?t=1536166881574:10965
n.forEach @ appservice?t=1536166881574:10965
d @ appservice?t=1536166881574:10965
k.onmessage @ appservice?t=1536166881574:10965
二次開發(fā),給原程序添加評論功能
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團創(chuàng)建于1999年,經(jīng)過二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團,成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機構(gòu),是中國一站式人才培養(yǎng)平臺、一站式人才輸送平臺。2014年4月3日在美國成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項目經(jīng)理從事移動互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團項目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺面向?qū)ο箝_發(fā)經(jīng)驗,技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點難點突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫,具有快速界面開發(fā)的能力,對瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗。曾經(jīng)歷任德國Software AG 技術(shù)顧問,美國Dachieve 系統(tǒng)架構(gòu)師,美國AngelEngineers Inc. 系統(tǒng)架構(gòu)師。