Authored by 郭成尧

wechat-client-type

@@ -181,6 +181,7 @@ exports.orderSub = (req, res, next) => { @@ -181,6 +181,7 @@ exports.orderSub = (req, res, next) => {
181 let yohoCoin = req.body.yohoCoin || 0; 181 let yohoCoin = req.body.yohoCoin || 0;
182 let skuList = req.body.skuList || ''; 182 let skuList = req.body.skuList || '';
183 let orderInfo; 183 let orderInfo;
  184 + let isWechat = req.yoho.isWechat;
184 185
185 try { 186 try {
186 orderInfo = JSON.parse(req.cookies['order-info']); 187 orderInfo = JSON.parse(req.cookies['order-info']);
@@ -260,11 +261,11 @@ exports.orderSub = (req, res, next) => { @@ -260,11 +261,11 @@ exports.orderSub = (req, res, next) => {
260 261
261 result = yield cartModel.orderSub(uid, addressId, 'bundle', deliveryTimeId, 262 result = yield cartModel.orderSub(uid, addressId, 'bundle', deliveryTimeId,
262 deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode, 263 deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode,
263 - yohoCoin, null, unionKey, userAgent, times, activityInfo, ip); 264 + yohoCoin, null, unionKey, userAgent, times, activityInfo, ip, isWechat);
264 } else { 265 } else {
265 result = yield cartModel.orderSub(uid, addressId, cartType, deliveryTimeId, 266 result = yield cartModel.orderSub(uid, addressId, cartType, deliveryTimeId,
266 deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode, 267 deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode,
267 - yohoCoin, skuList, unionKey, userAgent, null, null, ip); 268 + yohoCoin, skuList, unionKey, userAgent, null, null, ip, isWechat);
268 } 269 }
269 270
270 // 提交成功清除Cookie 271 // 提交成功清除Cookie
@@ -178,12 +178,13 @@ exports.ticketsOrderCompute = (uid, productSku, buyNumber, yohoCoin) => { @@ -178,12 +178,13 @@ exports.ticketsOrderCompute = (uid, productSku, buyNumber, yohoCoin) => {
178 * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息 178 * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息
179 * @param int $times 179 * @param int $times
180 * @param null $activityInfo 套餐数据 180 * @param null $activityInfo 套餐数据
  181 + * @param isWechat 是否是微信商城
181 * @return array 接口返回的数据 182 * @return array 接口返回的数据
182 */ 183 */
183 exports.orderSub = (uid, addressId, cartType, deliveryTime, 184 exports.orderSub = (uid, addressId, cartType, deliveryTime,
184 deliveryWay, invoices, paymentId, paymentType, remark, 185 deliveryWay, invoices, paymentId, paymentType, remark,
185 couponCode, yohoCoin, skuList, qhyUnio, 186 couponCode, yohoCoin, skuList, qhyUnio,
186 - userAgent, times, activityInfo, ip) => { 187 + userAgent, times, activityInfo, ip, isWechat) => {
187 if (!qhyUnio) { 188 if (!qhyUnio) {
188 qhyUnio = ''; 189 qhyUnio = '';
189 } 190 }
@@ -215,7 +216,7 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, @@ -215,7 +216,7 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
215 return shoppingAPI.orderSub(uid, addressId, cartType, deliveryTime, 216 return shoppingAPI.orderSub(uid, addressId, cartType, deliveryTime,
216 deliveryWay, invoices, paymentId, paymentType, 217 deliveryWay, invoices, paymentId, paymentType,
217 remark, couponCode, yohoCoin, skuList, qhyUnio, 218 remark, couponCode, yohoCoin, skuList, qhyUnio,
218 - userAgent, times, activityInfo, ip).then(orderSubRes => { 219 + userAgent, times, activityInfo, ip, isWechat).then(orderSubRes => {
219 let finalResult = {}; 220 let finalResult = {};
220 221
221 if (orderSubRes && orderSubRes.data && orderSubRes.data.is_hint === 'Y') { 222 if (orderSubRes && orderSubRes.data && orderSubRes.data.is_hint === 'Y') {
@@ -153,11 +153,12 @@ exports.checkTickets = (uid, productSku, buyNumber, useYohoCoin, yohoCoinMode) = @@ -153,11 +153,12 @@ exports.checkTickets = (uid, productSku, buyNumber, useYohoCoin, yohoCoinMode) =
153 * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息 153 * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息
154 * @param $times 154 * @param $times
155 * @param null $activityInfo 套餐信息 155 * @param null $activityInfo 套餐信息
  156 + * @param isWechat 是否是微信商城
156 * @return array 接口返回的数据 157 * @return array 接口返回的数据
157 */ 158 */
158 exports.orderSub = (uid, addressId, cartType, deliveryTime, 159 exports.orderSub = (uid, addressId, cartType, deliveryTime,
159 deliveryWay, invoices, paymentId, paymentType, remark, couponCode, 160 deliveryWay, invoices, paymentId, paymentType, remark, couponCode,
160 - yohoCoin, skuList, qhyUnion, userAgent, times, activityInfo, ip) => { 161 + yohoCoin, skuList, qhyUnion, userAgent, times, activityInfo, ip, isWechat) => {
161 if (!activityInfo) { 162 if (!activityInfo) {
162 activityInfo = null; 163 activityInfo = null;
163 } 164 }
@@ -226,6 +227,11 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, @@ -226,6 +227,11 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime,
226 params.qhy_union = qhyUnion; 227 params.qhy_union = qhyUnion;
227 } 228 }
228 229
  230 + // 是否是微信商城
  231 + if (isWechat) {
  232 + params.client_type = 'wechat';
  233 + }
  234 +
229 return api.post('', params, { 235 return api.post('', params, {
230 headers: { 236 headers: {
231 'X-Forwarded-For': ip || '', 237 'X-Forwarded-For': ip || '',