...
|
...
|
@@ -42,7 +42,6 @@ exports.page = (req, res, next) => { |
|
|
imCs: global.yoho.config.domains.imCs,
|
|
|
imSocket: global.yoho.config.domains.imSocket,
|
|
|
userData: {
|
|
|
uid: uid,
|
|
|
encrypteduid: crypto.encryption(null, uid + ''),
|
|
|
avatar: helpers.image(userinfo.head_ico, 100, 100),
|
|
|
uname: userinfo.profile_name
|
...
|
...
|
@@ -80,15 +79,10 @@ exports.getOrders = (req, res, next) => { |
|
|
*
|
|
|
*/
|
|
|
exports.fetchHistory = (req, res) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
if (!uid) {
|
|
|
uid = req.query.uid;
|
|
|
}
|
|
|
|
|
|
const endTime = req.query.endTime;
|
|
|
const encryptedUid = req.body.encryptedUid;
|
|
|
const endTime = req.body.endTime;
|
|
|
|
|
|
imApi.fetchImHistory(uid, endTime).then(result => {
|
|
|
imApi.fetchImHistory(encryptedUid, endTime).then(result => {
|
|
|
res.json(result);
|
|
|
});
|
|
|
};
|
...
|
...
|
@@ -115,16 +109,11 @@ exports.msghistory = (req, res) => { |
|
|
* content 留言内容
|
|
|
*/
|
|
|
exports.saveMSG = (req, res) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
if (!uid) {
|
|
|
uid = req.body.uid;
|
|
|
}
|
|
|
|
|
|
let encryptedUid = req.body.encryptedUid;
|
|
|
const conversationId = req.body.conversationId;
|
|
|
const content = req.body.content;
|
|
|
|
|
|
imApi.saveMessage(uid, conversationId, content)
|
|
|
imApi.saveMessage(encryptedUid, conversationId, content)
|
|
|
.then(result => {
|
|
|
res.json(result);
|
|
|
});
|
...
|
...
|
@@ -139,14 +128,9 @@ exports.saveMSG = (req, res) => { |
|
|
* 2. 失败情况
|
|
|
*/
|
|
|
exports.fetchOrders = (req, res) => {
|
|
|
let uid = req.user.uid;
|
|
|
let encryptedUid = req.body.encryptedUid;
|
|
|
|
|
|
if (!uid) {
|
|
|
uid = req.query.uid;
|
|
|
}
|
|
|
|
|
|
|
|
|
imApi.fetchOrderList(uid)
|
|
|
imApi.fetchOrderList(encryptedUid)
|
|
|
.then(result => {
|
|
|
imModel.handleOrderList(result.data, 128, 170);
|
|
|
res.json(result);
|
...
|
...
|
@@ -159,19 +143,13 @@ exports.fetchOrders = (req, res) => { |
|
|
};
|
|
|
|
|
|
exports.saveEvalute = (req, res) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
if (!uid) {
|
|
|
uid = req.body.uid;
|
|
|
}
|
|
|
|
|
|
|
|
|
const encryptedUid = req.body.encryptedUid;
|
|
|
const conversationId = req.body.conversationId;
|
|
|
const promoter = req.body.promoter;
|
|
|
const stars = req.body.stars;
|
|
|
const reasonMsg = req.body.reasonMsg || '';
|
|
|
|
|
|
imApi.saveEvalute(uid, conversationId, promoter, stars, reasonMsg)
|
|
|
imApi.saveEvalute(encryptedUid, conversationId, promoter, stars, reasonMsg)
|
|
|
.then(result => {
|
|
|
return res.json(result);
|
|
|
}).catch(() => {
|
...
|
...
|
@@ -184,12 +162,7 @@ exports.saveEvalute = (req, res) => { |
|
|
|
|
|
|
|
|
exports.queryGlobalOrder = (req, res) => {
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
if (!uid) {
|
|
|
uid = req.query.uid;
|
|
|
}
|
|
|
|
|
|
let encryptedUid = req.body.encryptedUid;
|
|
|
|
|
|
let emptyOrder = {
|
|
|
code: 200,
|
...
|
...
|
@@ -197,7 +170,7 @@ exports.queryGlobalOrder = (req, res) => { |
|
|
message: '获取失败'
|
|
|
};
|
|
|
|
|
|
imApi.queryGlobalOrder(uid)
|
|
|
imApi.queryGlobalOrder(encryptedUid)
|
|
|
.then(result=> {
|
|
|
imModel.handleOrderList(result.data, 128, 170);
|
|
|
res.json(result);
|
...
|
...
|
|