Authored by 邱骏

merge

phantomjs_cdnurl=http://npm.taobao.org/mirrors/phantomjs
sass_binary_site=http://npm.taobao.org/mirrors/node-sass
registry=http://npm.yohops.com
... ...
const _ = require('lodash');
const aes = require('../../../utils/aes');
const logger = global.yoho.logger;
const UfoApi = global.yoho.UfoAPI;
const _sender = global.yoho.sender;
const mysqlCli = global.yoho.utils.mysqlCli;
... ... @@ -45,7 +46,8 @@ const prizeType = {
1: '谢谢惠顾',
2: '红包',
3: '优惠券',
4: '实物奖品'
4: '实物奖品',
5: 'UFO优惠券'
};
class ActWheelSurfModelRedis extends global.yoho.BaseModel {
... ... @@ -289,6 +291,7 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel {
sendResult.data = sendResult.data || {};
sendMessage(0, {}, {succeedTimes: sendResult.data.amount || 0}, 0);
logger.info(`app.redpac.addRedpac=>uid: ${uid}, ${JSON.stringify(sendResult || {})}`);
if (sendResult.code === 200) {
if (!sendResult.data.amount) {
sendResult.code = 201; // 重复领取
... ... @@ -312,6 +315,7 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel {
sendMessage(1, {}, {succeedTimes: 1}, 0);
logger.info(`app.coupons.couponsSend=>uid: ${uid}, ${JSON.stringify(sendResult || {})}`);
if (sendResult && sendResult.code === 200) {
getPrize.desc = '恭喜您获得' + getPrize.name + '优惠券';
}
... ... @@ -323,6 +327,31 @@ class ActWheelSurfModelRedis extends global.yoho.BaseModel {
} else if (getPrize.type === 4) {
sendResult.code = 200;
getPrize.desc = '恭喜您获得' + getPrize.name;
} else if (getPrize.type === 5) {
// ufo优惠券
try {
sendResult = await this.get({
url: 'coupon',
data: {
method: 'ufo.coupons.send',
uid: uid,
coupon_tokens: getPrize.value,
sendType: 2
},
api: UfoApi
});
sendMessage(1, {}, {succeedTimes: 1}, 0);
logger.info(`ufo.coupons.send=>uid: ${uid}, ${JSON.stringify(sendResult || {})}`);
if (sendResult && sendResult.code === 200) {
getPrize.desc = '恭喜您获得' + getPrize.name + '优惠券';
}
} catch (e) {
logger.error(e);
sendMessage(1, {}, {message: e.message || 'interface error', stack: e}, 1);
}
}
// 插入数据库
... ...
... ... @@ -23,11 +23,14 @@ module.exports = {
api: 'http://api-test3.dev.yohocorp.com/',
service: 'http://api-test3.dev.yohocorp.com/',
singleApi: 'http://api-test3.yohops.com:9999/',
ufo: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway/',
// singleApi: 'http://api.yoho.cn/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
ufo: 'http://2.yohobuy.com',
// ufo: 'http://2.yohobuy.com',
store: 'http://192.168.102.47:8080/portal-gateway/wechat/',
serviceNotify: 'http://service.yoho.cn/',
platformApi: 'http://172.16.6.210:8088/',
... ...
This diff could not be displayed because it is too large.
... ... @@ -51,7 +51,7 @@
"feed": "^1.1.0",
"geetest": "^4.1.2",
"influx-batch-sender": "^0.1.9",
"json2csv": "^4.3.3",
"json2csv": "^4.5.1",
"jsonp": "^0.2.1",
"lodash": "^4.17.4",
"mOxie": "^1.5.5",
... ...
... ... @@ -17,11 +17,12 @@
<Option :value="2">红包</Option>
<Option :value="3">优惠券</Option>
<Option :value="4">实物奖品</Option>
<Option :value="5">UFO优惠券</Option>
</Select>
</FormItem>
<FormItem label="奖品token" prop="value">
<Input v-model="prize.value"
placeholder="红包优惠券token(实物奖品和谢谢惠顾不填)" :maxlenght="200"></Input>
placeholder="红包优惠券UFO优惠券token(实物奖品和谢谢惠顾不填)" :maxlenght="200"></Input>
</FormItem>
<FormItem label="奖品总数" prop="total">
<Input v-model="prize.total" placeholder="奖品总数(不限量奖品可填9999999999)" number
... ... @@ -65,7 +66,8 @@
1: '谢谢惠顾',
2: '红包',
3: '优惠券',
4: '实物奖品'
4: '实物奖品',
5: 'UFO优惠券'
};
export default {
... ...
... ... @@ -17,7 +17,8 @@
1: '谢谢惠顾',
2: '红包',
3: '优惠券',
4: '实物奖品'
4: '实物奖品',
5: 'UFO优惠券'
};
module.exports = {
... ...
This diff could not be displayed because it is too large.