Authored by zhangxiaoru

protocol

... ... @@ -7,11 +7,12 @@ const shareBuyModel = require('../models/share-buy'),
exports.index = (req, res, next) => {
let activityId = req.query.act_id || 2023,
isApp = req.yoho.isApp,
uid = req.user.uid;
uid = req.user.uid,
protocol = req.protocol;
co(function* () {
let isStudent = yield req.ctx(shareBuyModel).checkStudent(uid);
let indexData = yield req.ctx(shareBuyModel).shareIndex(activityId, isApp, uid, isStudent);
let indexData = yield req.ctx(shareBuyModel).shareIndex(activityId, isApp, uid, isStudent, protocol);
res.render('share-buy/share-buy', {
pageHeader: headerModel.setNav({
... ...
... ... @@ -11,7 +11,7 @@ module.exports = class extends global.yoho.BaseModel {
/**
* 首页数据
*/
shareIndex(activityId, isApp, uid, isStudent) {
shareIndex(activityId, isApp, uid, isStudent, protocol) {
return api.all([this._CouponInfo(activityId, uid, isStudent), this._redeatList(),
this._banner()]).then(result => {
... ... @@ -44,9 +44,9 @@ module.exports = class extends global.yoho.BaseModel {
});
if (isApp) {
val.detailUrl = val.detailUrl +
'&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"http:' + val.detailUrl +
'","params":{"couponId":"' + val.couponId + '","couponCode":"' +
val.detailUrl = protocol + ':' + val.detailUrl +
'&openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + protocol + ':' +
val.detailUrl + '","params":{"couponId":"' + val.couponId + '","couponCode":"' +
val.couponCode + '"}}}';
}
... ...