mui ajax傳參示例
阿新 • • 發佈:2018-12-06
//加入購物車
var data=[];
var row1 = {good_id:'1',number:'2',goods_spec_ids:[1,2]};
data.push(row1);
console.log(JSON.stringify(data));
//加入訂單
var data=[];
var row1 = {good_id:'1',number:'1',goods_spec_ids:[1,2],address_id:'13'};
var row2 = {good_id:'2',number:'3',goods_spec_ids:[3,4],address_id:'13'};
data.push(row1);
data.push(row2);
//http://test.dailingmei.com/wechat/Pay_order/index?orderids=1,6
//'data':JSON.stringify(data)
//價格計算
/*var data=[];
var row1 = {cart_desc_id:'30',number:'1'};
var row2 = {cart_desc_id:'29',number:'3'};
data.push(row1);
data.push(row2);
//'data':JSON.stringify(data)
//加入訂單
var data=[];
var row1 = {cart_desc_id:'30',number:'1',address_id:'13'};
var row2 = {cart_desc_id:'29',number:'3',address_id:'13'};
data.push(row1);
data.push(row2);*/
//'data':JSON.stringify(data)
var data=[];
var row1 = {good_id:'1',number:'2',goods_spec_ids:[1,2]};
data.push(row1);
//console.log(JSON.stringify(data));
mui.ajax('/api/Cart/addCartDesc', {
data: {
'type':0,
'page':1,
'size':1,
'examine':'1',
'status':[1,2],
'tag_id':5,
'good_id':1,
'data':JSON.stringify(data)
},
dataType: 'json',
type: 'post',
async: false,
headers: {'Content-Type': 'application/json'},
success: function (jsondata) {
console.log(jsondata);
},
});