<p>//提交预约订单</p><p>wx.request({</p><p> url: 'http://www.pusonglin.cn/app/index.php?i=2&c=entry&do=api&op=addOrder&m=aiunv_book',</p><p> data: e.target.dataset,</p><p> header: {</p><p> 'content-type': 'application/json'</p><p> },</p><p> success: function (res) {</p><p> console.log(res.data)</p><p></p><p> let status = res.data.status;</p><p> if (status == 1) {</p><p> console.log('预定成功')</p><p> wx.showToast({</p><p> title: '成功',</p><p> icon: 'success',</p><p> duration: 2000,</p><p> success:function(){</p><p> console.log('haha');</p><p> setTimeout(function () {</p><p> //要延时执行的代码</p><p> wx.switchTab({</p><p> url: '../user/user'</p><p> })</p><p> }, 2000) //延迟时间</p><p> }</p><p> })</p><p> }</p><p> if (status == 0) {</p><p> console.log('失败');</p><p> }</p><p> that.setData({ addrArray: res.data });</p><p> }</p><p>});</p><p>另外,在内页做页面跳转需要用wx.switchTab。</p>