Commit a91d7f3b authored by jyx's avatar jyx

代码优化

parent 3d7977a7
...@@ -154,13 +154,22 @@ ...@@ -154,13 +154,22 @@
handlePay() { handlePay() {
let that = this; let that = this;
let vipBean = this.vipList[this.selectedIndex]; let vipBean = this.vipList[this.selectedIndex];
let myPayChannel = 'WEIXIN'
// #ifdef MP-TOUTIAO
myPayChannel = 'TT'
// #endif
// #ifdef MP-WEIXIN
myPayChannel = 'WEIXIN'
// #endif
this.post({ this.post({
url: '/vip/getVipPayParams/xpay', url: '/vip/getVipPayParams/xpay',
data: { data: {
vedioId: that.point <= 0 ? null : that.vedioId, vedioId: that.point <= 0 ? null : that.vedioId,
pid: vipBean.pid, pid: vipBean.pid,
payChannel: 'WEIXIN' payChannel: myPayChannel
}, },
showLoading: true, showLoading: true,
success: ({ success: ({
...@@ -226,10 +235,6 @@ ...@@ -226,10 +235,6 @@
} }
}, },
queryOrderStatus(largeType, tid) { queryOrderStatus(largeType, tid) {
// setTimeout(() => {
// }, 5000);
let that = this; let that = this;
this.post({ this.post({
data: { data: {
......
<template> <template>
<view class="body"> <view class="body">
<image style="width: 170rpx;height: 170rpx;margin-top: 30%;" src="@/static/logo-about.png" mode="widthFix" /> <image style="width: 170rpx;height: 170rpx;margin-top: 30%;" src="@/static/logo-about.png" mode="widthFix" />
<view style="color: black;margin-top: 30rpx;font-size: 40rpx;font-size: 50rpx;">河狸刷剧</view> <view style="color: black;margin-top: 30rpx;font-size: 40rpx;font-size: 50rpx;">{{appName}}</view>
<view style="color: #A231EF;margin-top: 10rpx;font-size: 40rpx;font-size: 40rpx;">欢迎使用</view> <view style="color: #A231EF;margin-top: 10rpx;font-size: 40rpx;font-size: 40rpx;">欢迎使用</view>
<view style="bottom: 0;position: absolute;"> <view style="bottom: 0;position: absolute;">
<image style="width: 540rpx;height: 644rpx;display: flex;align-items: center;margin-bottom: 30%;" <image style="width: 540rpx;height: 644rpx;display: flex;align-items: center;margin-bottom: 30%;"
...@@ -34,16 +34,166 @@ ...@@ -34,16 +34,166 @@
data() { data() {
return { return {
tips1: '', tips1: '',
slotParam: '' slotParam: '',
appName: ''
} }
}, },
onLoad(options) { onLoad(options) {
this.tips1 = options.tips1; this.tips1 = options.tips1
// #ifdef MP-TOUTIAO
this.appName = '巨爽刷剧'
// #endif
// #ifdef MP-WEIXIN
this.appName = '河狸刷剧'
// #endif
}, },
onShow(options) { onShow(options) {
this.wxlogin(); // #ifdef MP-TOUTIAO
this.ttLoging()
// #endif
// #ifdef MP-WEIXIN
this.wxlogin()
// #endif
}, },
methods: { methods: {
ttLoging() {
var that = this;
var obj = tt.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');
}
tt.login({
force: true,
success(res) {
console.log(`login 调用成功${res.code} ${res.anonymousCode}`);
that.post({
url: '/user/ttLogin',
data: {
channel: channel,
clueToken: clueToken,
code: res.code,
anonymousCode: res.anonymousCode,
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(res) {
console.log(`login 调用失败`);
},
});
},
wxlogin() { wxlogin() {
var that = this; var that = this;
var obj = wx.getLaunchOptionsSync() var obj = wx.getLaunchOptionsSync()
...@@ -61,10 +211,10 @@ ...@@ -61,10 +211,10 @@
var vedio_id = ''; // 自有剧 var vedio_id = ''; // 自有剧
var zs_os = ''; // 当前系统 var zs_os = ''; // 当前系统
var vedio_index = ''; // 自有剧 var vedio_index = ''; // 自有剧
var free_index = '';// 自有剧 var free_index = ''; // 自有剧
var remark1 = '';// 预留 var remark1 = ''; // 预留
var remark2 = '';// 预留 var remark2 = ''; // 预留
var remark3 = '';// 预留 var remark3 = ''; // 预留
var mid1 = ""; var mid1 = "";
var mid2 = ""; var mid2 = "";
......
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