头条小程序用户对接开发
parent
ac9b2812bc
commit
bcc43fd02a
|
|
@ -146,6 +146,9 @@
|
|||
<dt>百度openid</dt>
|
||||
<dd>{{if empty($v['baidu_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.baidu_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>头条openid</dt>
|
||||
<dd>{{if empty($v['toutiao_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.toutiao_openid}}{{/if}}</dd>
|
||||
|
||||
<dt>微信openid</dt>
|
||||
<dd>{{if empty($v['weixin_openid'])}}<span class="cr-ddd">未知</span>{{else /}}{{$v.weixin_openid}}{{/if}}</dd>
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@
|
|||
<label>百度openid</label>
|
||||
<input type="text" name="baidu_openid" class="am-radius" placeholder="百度openid" data-validation-message="请填写百度openid" {{if !empty($data)}} value="{{$data.baidu_openid}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>头条openid</label>
|
||||
<input type="text" name="toutiao_openid" class="am-radius" placeholder="头条openid" data-validation-message="请填写头条openid" {{if !empty($data)}} value="{{$data.toutiao_openid}}"{{/if}} />
|
||||
</div>
|
||||
<div class="am-form-group">
|
||||
<label>微信openid</label>
|
||||
<input type="text" name="weixin_openid" class="am-radius" placeholder="微信openid" data-validation-message="请填写微信openid" {{if !empty($data)}} value="{{$data.weixin_openid}}"{{/if}} />
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -67,7 +67,7 @@ App({
|
|||
// 请求地址
|
||||
request_url: "{{request_url}}",
|
||||
request_url: 'http://tp5-dev.com/',
|
||||
// request_url: 'https://test.shopxo.net/',
|
||||
request_url: 'https://test.shopxo.net/',
|
||||
|
||||
// 基础信息
|
||||
application_title: "{{application_title}}",
|
||||
|
|
@ -469,12 +469,13 @@ App({
|
|||
{
|
||||
tt.showToast({
|
||||
title: msg,
|
||||
icon: 'success',
|
||||
duration: 3000
|
||||
});
|
||||
} else {
|
||||
tt.showToast({
|
||||
image: '/images/default-toast-error.png',
|
||||
title: msg,
|
||||
icon: 'none',
|
||||
duration: 3000
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,9 @@ Page({
|
|||
form_submit_loading: false,
|
||||
verify_time_total: 60,
|
||||
temp_clear_time: null,
|
||||
|
||||
// 是否第一次使用授权失败
|
||||
is_first_authorize_error: true,
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -41,7 +44,24 @@ Page({
|
|||
},
|
||||
fail (res) {
|
||||
self.setData({ user: null});
|
||||
app.showToast('获取授权失败');
|
||||
|
||||
// 头条bug-没有授权不弹出授窗口
|
||||
if(self.data.is_first_authorize_error == true)
|
||||
{
|
||||
tt.login();
|
||||
setTimeout(function(){
|
||||
self.get_user_info_event();
|
||||
}, 1000);
|
||||
} else {
|
||||
app.showToast('请同意用户信息授权');
|
||||
tt.openSetting();
|
||||
}
|
||||
|
||||
// 头条bug-第一次失败使用授权后更新状态
|
||||
if(self.data.is_first_authorize_error == true)
|
||||
{
|
||||
self.setData({is_first_authorize_error: false});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue