...
|
...
|
@@ -2,7 +2,6 @@ |
|
|
'use strict';
|
|
|
|
|
|
const Promise = require('bluebird');
|
|
|
const api = global.yoho.API;
|
|
|
const _ = require('lodash');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const crypto = global.yoho.crypto;
|
...
|
...
|
@@ -279,11 +278,15 @@ class couponFloor extends global.yoho.BaseModel { |
|
|
}
|
|
|
|
|
|
floor(params, isApp, appVersion) {
|
|
|
let that = this;
|
|
|
|
|
|
return Promise.coroutine(function*() {
|
|
|
let result = {},
|
|
|
resource = yield api.get('', Object.assign(params, {
|
|
|
method: 'app.promotion.queryCouponCenter',
|
|
|
}));
|
|
|
resource = yield that.get({
|
|
|
data: Object.assign(params, {
|
|
|
method: 'app.promotion.queryCouponCenter',
|
|
|
})
|
|
|
});
|
|
|
|
|
|
if (resource && resource.code === 200) {
|
|
|
result = _getContent(resource.data, isApp);
|
...
|
...
|
@@ -298,10 +301,14 @@ class couponFloor extends global.yoho.BaseModel { |
|
|
}
|
|
|
|
|
|
status(params) {
|
|
|
let that = this;
|
|
|
|
|
|
return Promise.coroutine(function*() {
|
|
|
const resource = yield api.get('', Object.assign(params, {
|
|
|
method: 'app.promotion.couponStatus'
|
|
|
}));
|
|
|
const resource = yield that.get({
|
|
|
data: Object.assign(params, {
|
|
|
method: 'app.promotion.couponStatus'
|
|
|
})
|
|
|
});
|
|
|
const result = {
|
|
|
code: resource.code,
|
|
|
data: []
|
...
|
...
|
@@ -332,10 +339,12 @@ class couponFloor extends global.yoho.BaseModel { |
|
|
}
|
|
|
|
|
|
// 登录后调用领券接口
|
|
|
return api.get('', {
|
|
|
method: 'app.promotion.getCoupon',
|
|
|
couponId: receiveData.couponID,
|
|
|
uid: uid
|
|
|
return this.get({
|
|
|
data: {
|
|
|
method: 'app.promotion.getCoupon',
|
|
|
couponId: receiveData.couponID,
|
|
|
uid: uid
|
|
|
}
|
|
|
}).then(result => {
|
|
|
switch (result.code) {
|
|
|
case 200:
|
...
|
...
|
@@ -394,8 +403,9 @@ class couponFloor extends global.yoho.BaseModel { |
|
|
};
|
|
|
}
|
|
|
|
|
|
return api.get('', data).then(result => {
|
|
|
|
|
|
return this.get({
|
|
|
data: data
|
|
|
}).then(result => {
|
|
|
if (!result) {
|
|
|
result.code = 404;
|
|
|
result.message = '出错啦~';
|
...
|
...
|
|