菜品详情页转发
来源:4-13 课程常见错误解决方案汇总
SuperMan_GYD
2020-04-15
分享转发出去后,数据库没有显示信息,插入有问题。。。onShareAppMessage:function (res) {
var that = this;
return {
title: that.data.info.name,
path: ‘/pages/food/info?id=’ + that.data.info.id,
success: function (res) {
// 转发成功
wx.request({
url: app.buildUrl("/member/share"),
header: app.getRequestHeader(),
method: ‘POST’,
data: {
url: utils.getCurrentPageUrlWithArgs()
},
success: function (res) {
}
});
};
@route_api.route("/member/share",methods = [ “POST” ])
def memberShare():
resp = {‘code’: 200, ‘msg’: ‘操作成功~’, ‘data’: {}}
req = request.values
url = req[‘url’] if ‘url’ in req else ''
member_info = g.member_info
model_share = WxShareHistory()
if member_info:
model_share.member_id = member_info.id
model_share.share_url = url
model_share.created_time = getFormatDate()
db.session.add(model_share)
db.session.commit()
return jsonify(resp)
1回答
-
你好
如下图
可以实现变种,只要点击都提交过去
012020-04-16
相似问题