- res解析json问题?
代码片段如下 wx.request({ url: api.my_service_url, // 后端路径 data: that.data.request_data, // code method: "POST", success: function (res) { console.log('getMyserviceData 请求成功') wx.hideLoading(); console.log(res.data) var resData = res.data if(typeof resData != "object"){ log.info('getMyserviceData typeof res:',typeof resData) var resData = JSON.parse(res.data); } log.info('getMyserviceData res:',resData) log.info('getMyserviceData status:',resData.status) log.info('getMyserviceData[status]:',resData["status"]) log.error('getMyserviceData 500 error res.data.service_list:',resData.service_list) }, fail: function (res) { log.error('getMyserviceData fail error:',res.data) console.log('getMyserviceData 请求失败') that.showInfo('内部服务错误!'); } }) 关键数据res.data的console打印如下: {"status": 1,"totalpage": "26","service_list":[{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 13:13:38","content": "XXXXX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/17 12:45:24","content": "XX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/17 12:20:26","content": "XXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 12:16:35","content": "XXXXXX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/17 11:42:55","content": "XXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 11:08:09","content": "XXXXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 10:12:54","content": "XXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/16 12:57:58","content": "XXXXXXXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/16 12:19:49","content": "XXXXX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/15 15:46:17","content": "X"}]} log打印日志如下: [13:30:00] getMyserviceData res: {"status": 1,"totalpage": "26","service_list":[{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 13:13:38","content": "XXXXX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/17 12:45:24","content": "XX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/17 12:20:26","content": "XXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 12:16:35","content": "XXXXXX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/17 11:42:55","content": "XXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 11:08:09","content": "XXXXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/17 10:12:54","content": "XXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/16 12:57:58","content": "XXXXXXXXX"},{"group_id": "2","article_id": "376379","user_name": "XXX","add_time": "2020/9/16 12:19:49","content": "XXXXX"},{"group_id": "2","article_id": "376379","user_name": "XX","add_time": "2020/9/15 15:46:17","content": "X"}]} [13:30:00] getMyserviceData status: <Undefined> [13:30:00] getMyserviceData status: <Undefined> [13:30:00] getMyserviceData 500 error status: <Undefined> res.data有数据,并且确实为object类型,如何解析其中的status和service_list值?
2020-09-17 - 转发显示成功但实际没有成功如何排查
- 问题描述:小程序的网页,点击右上角的转发,选择群或者个人发送后,提示【已转发】,但是群或者个人均未收到该卡片信息。 - 预期效果:提示【已转发】后,群或者个人均可以正常收到卡片信息。 -其他说明:其他手机客户端同样的操作,没有该问题。 真机调试和后台均未发现报错信息,如何排查该问题?
2019-02-20 - 小程序分享的卡片间隙性不能再次转发
- 问题描述:小程序里分享到群或者个人的卡片,长按卡片后,有时候可以出现 发送给朋友,有时候不出现 发送给朋友。 - 预期效果:发送到群或者个人的卡片,长安卡片后,出现 发送给朋友 ,发送后,长按该卡片,还可以 发送给朋友。
2019-02-19 - onShareAppMessage方法之外,如何获取web-view的URL地址
用户分享时可获取当前[代码]<web-view>[代码]的URL,即在[代码]onShareAppMessage[代码]回调中返回[代码]webViewUrl[代码]参数。 在其他方法中能否获得当前web-view的URL地址? 我的目的,是在onShareAppMessage之前,拿到web-view的URL地址,并解析网页内容,获得onShareAppMessage中return所需要的title等参数。
2019-02-14