Commit 837991c5 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent 84ff9c63
......@@ -3,21 +3,21 @@
<view class="body loading">
<view class="logo">
<image src="@/static/logo-about.png" mode="widthFix" style="border-radius: 20rpx;margin-bottom: 200rpx;" />
<view class="animation">
<text style="animation-delay: 0s;color: black;"></text>
<text style="animation-delay: 0.1s;color: black;"> </text>
<text style="animation-delay: 0.2s;color: black;"> </text>
<text style="animation-delay: 0.3s;color: black;"></text>
<text style="animation-delay: 0.4s;color: black;"> </text>
<text style="animation-delay: 0.4s;color: black;"> </text>
<text style="animation-delay: 0.5s;color: black;"></text>
<text style="animation-delay: 0.6s;color: black;"> </text>
<text style="animation-delay: 0.7s;color: black;"> </text>
<text style="animation-delay: 0.8s;color: black;"></text>
<text style="animation-delay: 0.9s;color: black;"> </text>
<text style="animation-delay: 1s;color: black;"> </text>
<text style="animation-delay: 1.1s;color: black;"></text>
</view>
<view class="animation">
<text style="animation-delay: 0s;color: black;"></text>
<text style="animation-delay: 0.1s;color: black;"> </text>
<text style="animation-delay: 0.2s;color: black;"> </text>
<text style="animation-delay: 0.3s;color: black;"></text>
<text style="animation-delay: 0.4s;color: black;"> </text>
<text style="animation-delay: 0.4s;color: black;"> </text>
<text style="animation-delay: 0.5s;color: black;"></text>
<text style="animation-delay: 0.6s;color: black;"> </text>
<text style="animation-delay: 0.7s;color: black;"> </text>
<text style="animation-delay: 0.8s;color: black;"></text>
<text style="animation-delay: 0.9s;color: black;"> </text>
<text style="animation-delay: 1s;color: black;"> </text>
<text style="animation-delay: 1.1s;color: black;"></text>
</view>
<view style="color: black;margin-top: 40rpx;font-size: 40rpx;">欢迎使用</view>
</view>
</view>
......@@ -26,7 +26,7 @@
<script>
import {
message,
redirectTo,
redirectTo,
uuid
} from '@/utils/fun.js';
......@@ -53,67 +53,72 @@
redirectTo('home');
}, 2300);
},
methods: {
methods: {
wxlogin() {
var obj = wx.getEnterOptionsSync()
var channel = '' // 渠道
var clueToken = '' // 归因参数
var adId = '' // 计划id
var advertiserId = '' // 账号id
var reqId = '' // 请求id
var promotionId = '' // aid
var productId='';
if (obj.query.clueToken ?? '' != '') {
channel = 'tt'
clueToken = obj.query.clueToken ?? ''
adId = obj.query.adId ?? ''
advertiserId = obj.query.advertiserId ?? ''
reqId = obj.query.reqId ?? ''
promotionId = obj.query.promotionId ?? ''
productId = obj.query.productId ?? ''
}
if (obj.query.ksChannel ?? '' != '') {
channel = 'kuaishou'
advertiserId = obj.query.accountid ?? ''
clueToken = obj.query.callback ?? ''
adId = obj.query.aid ?? ''
}
uni.login({
provider: 'weixin',
success: function(loginRes) {
that.post({
url: '/user/wechatlogin',
data: {
channel: channel,
clueToken: clueToken,
adId: adId,
advertiserId: advertiserId,
reqId: reqId,
creativeId: creativeId,
code: loginRes.code,
inviteUId: tempInviteUId
},
showLoading: false,
success: ({
data
}) => {
app.globalData.token = data.token;
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
}
});
},
fail: function(err) {
// 登录授权失败
message.notify('登录授权失败 错误码:'+err.code);
}
});
var that=this;
var obj = wx.getEnterOptionsSync()
var channel = '' // 渠道
var clueToken = '' // 归因参数
var adId = '' // 计划id
var advertiserId = '' // 账号id
var reqId = '' // 请求id
var promotionId = '' // aid
var productId = ''
if (obj.query.clueToken ?? '' != '') {
channel = 'tt'
clueToken = obj.query.clueToken ?? ''
adId = obj.query.adId ?? ''
advertiserId = obj.query.advertiserId ?? ''
reqId = obj.query.reqId ?? ''
promotionId = obj.query.promotionId ?? ''
productId = obj.query.productId ?? ''
}
if (obj.query.ksChannel ?? '' != '') {
channel = 'kuaishou'
advertiserId = obj.query.accountid ?? ''
clueToken = obj.query.callback ?? ''
adId = obj.query.aid ?? ''
}
console.log("1");
uni.login({
provider: 'weixin',
success: function(loginRes) {
console.log("2"+loginRes.code);
that.post({
url: '/user/wechatlogin',
data: {
channel: channel,
clueToken: clueToken,
code: loginRes.code,
adId: adId,
advertiserId: advertiserId,
reqId: reqId,
promotionId: promotionId,
productId: productId,
},
showLoading: false,
success: ({
data
}) => {
app.globalData.token = data.token;
app.globalData.userId = data.pk_id;
app.globalData.userInfo = data;
console.log("3");
redirectTo('home');
}
});
},
fail: function(err) {
console.log("4");
// 登录授权失败
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