小程式資料放入全域性變數可以使用
阿新 • • 發佈:2018-11-12
onLoad: function (options) {
var that = this;
var id = options.c_id
var s_id = options.s_id
that.setData({ 放入全域性變數
s_id: options.s_id, id: options.c_id, }) bindtap='go_pincan' data-s_id="{{s_id}}" data-c_id="{{shang.c_id}} go_pincan:function(e){ // 去拼餐 console.log(e) var c_id = e.currentTarget.dataset.c_id; var s_id = e.currentTarget.dataset.s_id; var time = this.data.date + this.data.time var arrs = this.data.zhi; var dex = this.data.current_pay; wx.navigateTo({ url: '../lijipindan/lijipindan?c_id=' + c_id + "&s_id=" + s_id + "&texts=" + arrs[dex].f_name + "&time=" + time, }) },