var app = getApp(); var network = require('./network.js') function share(newsname, Thepath,newsid, typevalue){ if (!typevalue) { typevalue = 1 } var _this = this; var params = new Object() params.uid = app.getUid() params.session = app.getSession() params.type = typevalue params.id = newsid params.status = 1 params.content = newsname console.log(params) //发起请求 network.GET( { turl: 'share.submit', params: params, success: function (res) { }, fail: function () { //失败后的逻辑 }, }) return { title: newsname, path: Thepath + newsid + '&share_uid=' + app.getUid() + '&share_id=' + newsid + '&share_table=' + typevalue, success: function (res) { var params = new Object() params.uid = app.getUid() params.session = app.getSession() params.type = typevalue params.id = newsid params.status = 2 params.content = newsname console.log(params) //发起请求 network.GET( { turl: 'share.submit', params: params, success: function (res) { }, fail: function () { //失败后的逻辑 }, }) }, fail: function () { //失败后的逻辑 var params = new Object() params.uid = app.getUid() params.session = app.getSession() params.type = 1 params.id = newsid params.status = 3 params.content = newsname //发起请求 network.GET( { turl: 'share.submit', params: params, success: function (res) { }, fail: function () { //失败后的逻辑 }, }) }, } } module.exports = { share: share, }