62 lines
1.3 KiB
JavaScript
62 lines
1.3 KiB
JavaScript
const app = getApp();
|
|
const host = app.globalData.devUrl;
|
|
|
|
// 我的油卡收钱
|
|
const qcodePay = function (qrdata) {
|
|
return new Promise((reslove, reject) => {
|
|
wx.request({
|
|
url: `${host}/api/v1/cooperation/pay/qcodePay`,
|
|
method: `POST`,
|
|
header: {
|
|
"content-type": "application/x-www-form-urlencoded",
|
|
},
|
|
data: {
|
|
cooId: wx.getStorageSync("cooperation").id,
|
|
...qrdata,
|
|
},
|
|
success: function (e) {
|
|
if (e.data.code == 0) {
|
|
reslove(e.data);
|
|
} else {
|
|
reject(e.data);
|
|
}
|
|
},
|
|
fail: function (e) {
|
|
reject(e);
|
|
},
|
|
});
|
|
});
|
|
};
|
|
|
|
// 获取加油站统计信息
|
|
const count = function (data) {
|
|
return new Promise((reslove, reject) => {
|
|
wx.request({
|
|
url: `${host}/api/v1/cooperation/coo/count`,
|
|
method: `POST`,
|
|
header: {
|
|
"content-type": "application/x-www-form-urlencoded",
|
|
},
|
|
data: {
|
|
cooId: wx.getStorageSync("cooperation").id,
|
|
...data,
|
|
},
|
|
success: function (e) {
|
|
if (e.data.code == 0) {
|
|
reslove(e.data);
|
|
} else {
|
|
reject(e.data);
|
|
}
|
|
},
|
|
fail: function (e) {
|
|
reject(e);
|
|
},
|
|
});
|
|
});
|
|
};
|
|
|
|
module.exports = {
|
|
qcodePay,
|
|
count,
|
|
};
|