Commit 837991c5 authored by mengcuiguang's avatar mengcuiguang

代码优化

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