Authored by 李奇

最近十笔订单和全球购订单接口session_key添加

... ... @@ -98,9 +98,10 @@ exports.saveMSG = (req, res) => {
* 2. 失败情况
*/
exports.fetchOrders = (req, res) => {
let encryptedUid = req.body.encryptedUid;
const uid = req.user.uid || req.query.uid;
const encryptedUid = req.body.encryptedUid;
imApi.fetchOrderList(encryptedUid)
imApi.fetchOrderList(uid, encryptedUid)
.then(result => {
imModel.handleOrderList(result.data, 128, 170);
res.json(result);
... ... @@ -142,7 +143,8 @@ exports.saveEvalute = (req, res) => {
exports.queryGlobalOrder = (req, res) => {
let encryptedUid = req.body.encryptedUid;
const uid = req.user.uid || req.query.uid;
const encryptedUid = req.body.encryptedUid;
let emptyOrder = {
code: 200,
... ... @@ -150,9 +152,12 @@ exports.queryGlobalOrder = (req, res) => {
message: '获取失败'
};
imApi.queryGlobalOrder(encryptedUid)
imApi.queryGlobalOrder(uid, encryptedUid)
.then(result=> {
imModel.handleOrderList(result.data, 128, 170);
if (result.code === 200) {
imModel.handleOrderList(result.data, 128, 170);
}
res.json(result);
}, () => {
res.json(emptyOrder);
... ...
... ... @@ -67,8 +67,9 @@ exports.fetchImHistory = (encryptedUid, endTime, pageSize, startTime) => {
* @param {string} encryptedUid 用户加密uid
* @param {init} createTimeBegin 开始时间
*/
exports.fetchOrderList = (encryptedUid, createTimeBegin) => {
exports.fetchOrderList = (uid, encryptedUid, createTimeBegin) => {
let params = {
uid,
encryptedUid,
imgSize: '90x120',
};
... ... @@ -111,8 +112,9 @@ exports.saveEvalute = (params) => {
* 获取全球购的订单
*/
exports.queryGlobalOrder = encryptedUid => {
exports.queryGlobalOrder = (uid, encryptedUid) => {
let params = {
uid,
encryptedUid
};
... ...
... ... @@ -370,6 +370,10 @@ OrderListView.prototype = $.extend({}, EventEmitter.prototype, {
if (totalCount === null) { // 还未加载数据
api.fetchOrders(type).done(
result => {
if (result && result.code === 401) {
window.location.href = '//m.yohobuy.com/signin.html?refer=' + window.location.href;
}
let html = self.orderListT({
orders: result.data,
isApp: appBridge.isApp,
... ...