Commit 9183be10 authored by mengcuiguang's avatar mengcuiguang

抖音添加短视频挂载

parent 08aa6009
......@@ -341,31 +341,40 @@
},
showFirstDialog() {
let that = this;
// 匹配用户展示视频
let showFirstVedio = uni.getStorageSync('showFirstVedio') || '';
if (showFirstVedio == '') {
uni.setStorage({
key: 'showFirstVedio',
data: 'true'
});
let loadEpisode_id = uni.getStorageSync('tt_episode_id') || '';
let loadAlbum_id = uni.getStorageSync('tt_album_id') || '';
setTimeout(() => {
that.post({
url: '/vedio/firstVedio',
data: {},
data: {
episode_id: loadEpisode_id,
album_id: loadAlbum_id
},
showLoading: false,
success: ({
data
}) => {
if (data.vedioMsg != null) {
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(JSON.stringify(data.vedioMsg)) +
'&tt_album_id=' + data.vedioMsg.douyinAlbumId + '&tt_episode_id=' + data.vedioMsg.douyinEpisodeId);
navigateTo(`/pagesC/ttvideo/ttVideoDetail?data=` + encodeURIComponent(
JSON.stringify(data.vedioMsg)) +
'&tt_album_id=' + data.vedioMsg.douyinAlbumId +
'&tt_episode_id=' + data.vedioMsg.douyinEpisodeId);
// 重置短视频挂载id
uni.setStorage({
key: 'tt_album_id',
data: ''
});
uni.setStorage({
key: 'tt_episode_id',
data: ''
});
}
}
});
}, 800);
}
}
}
};
</script>
......
......@@ -35,22 +35,10 @@ export default {
},
methods: {
authTo(url) {//登录校验
if (app.globalData.userInfo) {
navigateTo(url);
} else {
// navigateTo('user/login', {
// redirect: url
// });
}
},
authToNs(url) {//登录校验不保留当前页面
if (app.globalData.userInfo) {
redirectTo(url);
} else {
// navigateTo('user/login', {
// redirect: url
// });
}
},
loadData() {},
startPay() {
......@@ -88,7 +76,6 @@ export default {
// navigateTo('user/login?redirect=' + encodeURIComponent(redirect));
},
logout() {
app.globalData.userInfo = null;
uni.removeStorageSync('token');
},
put(options) {
......
......@@ -26,16 +26,9 @@ export default {
}
},
loadData() {
if (!app.globalData.userInfo) {
// redirectTo('user/login');
return;
}
},
queryList(page, size) {
if (!app.globalData.userInfo) {
this.$refs.paging.complete([]);
return;
}
this.tempList = [];
this.current = 0;
if (page === 1) {
......
......@@ -55,7 +55,7 @@
// #endif
// #ifdef MP-WEIXIN
this.wxlogin()
// this.wxlogin()
// #endif
},
methods: {
......@@ -86,6 +86,9 @@
var mid3 = "";
var mid4 = "";
var mid5 = "";
var thirdParam = "";
var album_id = "";
var episode_id = "";
zs_os = wx.getSystemInfoSync().platform;
// 判断渠道来源
......@@ -135,6 +138,19 @@
}
thirdParam = JSON.stringify(obj.query);
album_id = obj.query.tt_album_id ?? ''
episode_id = obj.query.tt_episode_id ?? ''
uni.setStorage({
key: 'tt_album_id',
data: album_id
});
uni.setStorage({
key: 'tt_episode_id',
data: episode_id
});
// 打印渠道参数
if (this.tips1 == 'mints_vedio' || tips2 == 'mints_vedio') {
this.slotParam = JSON.stringify(obj.query);
......@@ -171,6 +187,7 @@
mid3: mid3,
mid4: mid4,
mid5: mid5,
thirdParam: thirdParam,
zsChannel: zs_channel
},
showLoading: false,
......@@ -181,10 +198,9 @@
key: 'token',
data: data.token
});
app.globalData.userInfo = data;
setTimeout(() => {
redirectTo('home');
}, 1500);
}, 1000);
}
});
},
......@@ -193,140 +209,6 @@
},
});
},
wxlogin() {
var that = this;
var obj = wx.getLaunchOptionsSync()
var channel = 'mints' // 渠道
var clueToken = '' // 归因参数
var adId = '' // 计划id
var advertiserId = '' // 账号id
var reqId = '' // 请求id
var promotionId = '' // aid
var projectId = '';
var tips2 = ''; // 投放测试标记
var product_type = ''; //自有产品
var zs_channel = ''; // 自有渠道
var vedio_id = ''; // 自有剧
var zs_os = ''; // 当前系统
var vedio_index = ''; // 自有剧
var free_index = ''; // 自有剧
var remark1 = ''; // 预留
var remark2 = ''; // 预留
var remark3 = ''; // 预留
var mid1 = "";
var mid2 = "";
var mid3 = "";
var mid4 = "";
var mid5 = "";
zs_os = wx.getSystemInfoSync().platform;
// 判断渠道来源
if (obj.query.clue_token ?? '' != '') {
// 头条渠道参数
channel = 'tt'
clueToken = obj.query.clue_token ?? ''
adId = obj.query.ad_id ?? ''
advertiserId = obj.query.advertiser_id ?? ''
reqId = obj.query.req_id ?? ''
promotionId = obj.query.promotion_id ?? ''
projectId = obj.query.project_id ?? ''
tips2 = obj.query.tips2 ?? ''
product_type = obj.query.product_type ?? ''
zs_channel = obj.query.zs_channel ?? ''
vedio_id = obj.query.vedio_id ?? ''
free_index = obj.query.free_index ?? ''
remark1 = obj.query.remark1 ?? ''
remark2 = obj.query.remark2 ?? ''
remark3 = obj.query.remark3 ?? ''
vedio_index = obj.query.vedio_index ?? ''
mid1 = obj.query.mid1 ?? ''
mid2 = obj.query.mid2 ?? ''
mid3 = obj.query.mid3 ?? ''
mid4 = obj.query.mid4 ?? ''
mid5 = obj.query.mid5 ?? ''
} else if (obj.query.ksChannel ?? '' != '') {
// 快手渠道参数
channel = 'kuaishou'
adId = obj.query.ksUnitId ?? '' //组id
advertiserId = obj.query.ksSiteAccountId ?? '' //账户id
clueToken = obj.query.callback ?? '' //快手归因参数
reqId = obj.query.ksCampaignId ?? '' //计划id
promotionId = obj.query.ksPageId ?? '' //落地页id
tips2 = obj.query.tips2 ?? ''
projectId = obj.query.ksCreativeId ?? '' //创意id
product_type = obj.query.product_type ?? ''
zs_channel = obj.query.zs_channel ?? ''
vedio_id = obj.query.vedio_id ?? ''
remark1 = obj.query.remark1 ?? ''
remark2 = obj.query.remark2 ?? ''
remark3 = obj.query.remark3 ?? ''
vedio_index = obj.query.vedio_index ?? ''
free_index = obj.query.free_index ?? ''
} else {
// 自有渠道
}
// 打印渠道参数
if (this.tips1 == 'mints_vedio' || tips2 == 'mints_vedio') {
this.slotParam = JSON.stringify(obj.query);
this.$refs.select.open('center');
}
uni.login({
provider: 'weixin',
success: function(loginRes) {
that.post({
url: '/user/wechatlogin',
data: {
channel: channel,
clueToken: clueToken,
code: loginRes.code,
adId: adId,
advertiserId: advertiserId,
reqId: reqId,
promotionId: promotionId,
projectId: projectId,
productType: product_type,
vedioId: vedio_id,
remark1: remark1,
remark2: remark2,
remark3: remark3,
os: zs_os,
vedioIndex: vedio_index,
freeIndex: free_index,
mid1: mid1,
mid2: mid2,
mid3: mid3,
mid4: mid4,
mid5: mid5,
zsChannel: zs_channel
},
showLoading: false,
success: ({
data
}) => {
uni.setStorage({
key: 'token',
data: data.token
});
app.globalData.userInfo = data;
setTimeout(() => {
redirectTo('home');
}, 1500);
}
});
},
fail: function(err) {
// 登录授权失败
message.notify('登录授权失败 错误码:' + err.code);
}
});
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment