|
|
/* eslint no-undef: "_yas" */
|
|
|
|
|
|
require('../../scss/activity/_app-downloads.css');
|
|
|
require('../../js/common');
|
|
|
|
|
|
const url = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
|
|
|
const u = navigator.userAgent.toLowerCase();
|
|
|
const isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1;
|
|
|
var url = 'yohobuy://yohobuy.com/goapp?openby:yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}}';
|
|
|
var u = navigator.userAgent.toLowerCase();
|
|
|
var isiOS = u.indexOf('os') > -1 || u.indexOf('iphone') > -1 || u.indexOf('mac') > -1 || u.indexOf('ipad') > -1;
|
|
|
|
|
|
let appPath = url;
|
|
|
let ifr;
|
|
|
var appPath = url;
|
|
|
var ifr;
|
|
|
|
|
|
if (isiOS) {
|
|
|
window.location.href = appPath;
|
...
|
...
|
@@ -16,12 +19,36 @@ if (isiOS) { |
|
|
document.body.appendChild(ifr);
|
|
|
}
|
|
|
|
|
|
$('#download').click(function () {
|
|
|
var mktc = '';
|
|
|
//1: 男生,2-女生,3-潮童,4-创意生活
|
|
|
var CHANNELS = {
|
|
|
boys: 1,
|
|
|
girls: 2,
|
|
|
kids: 3,
|
|
|
lifestyle: 4
|
|
|
};
|
|
|
|
|
|
$('#download').click(function() {
|
|
|
var url;
|
|
|
var channel = window.cookie('_Channel');
|
|
|
|
|
|
if (isiOS) {
|
|
|
location.href = 'http://itunes.apple.com/us/app/id490655927?ls=1&mt=8';
|
|
|
url = 'http://itunes.apple.com/us/app/id490655927?ls=1&mt=8';
|
|
|
} else {
|
|
|
location.href = 'http://yoho-apps.qiniudn.com/YohoBuy_YOHO.apk';
|
|
|
url = 'http://yoho-apps.qiniudn.com/YohoBuy_YOHO.apk';
|
|
|
}
|
|
|
|
|
|
// 上报 nginx 数据
|
|
|
$.get('https://m.yohobuy.com/activitylog.json?download2');
|
|
|
|
|
|
// 上报 yas 数据
|
|
|
if (typeof _yas !=='undefined') {
|
|
|
_yas.sendCustomInfo && _yas.sendCustomInfo({
|
|
|
op: 'YB_DOWNLOAD_C',
|
|
|
param: JSON.stringify({
|
|
|
C_ID: CHANNELS[channel],
|
|
|
TO_URL: url
|
|
|
})
|
|
|
}, true);
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
|