// 完善游客信息 // 网络请求工具类 var networkUtil = require('../../utils/network_util.js') var api = require('../../utils/apiFile.js') // 是否有更多 var userId = '' var token = '' Page({ data: { }, /*---------生命周期--------*/ onLoad: function (e) { userId = e.userId token = e.token }, formSubmit: function (e) { networkUtil.showLoading() getApp().globalData.token = token var param = { 'username': '李白', 'birth': '2017-02-15'} networkUtil._put(api.kTourisInfo + userId, param, function (res) { console.log(res) getApp().globalData.token = '' wx.showModal({ title: '提示', content: '注册成功,立即登录', success: function (res) { if (res.confirm) { wx.navigateBack({ delta: 5 }) } } }) }, function (res) { networkUtil.showErrorToast(res.errormsg) }) } })