Commit 244711c4 by 程默

init

parent 0dcab989
<template> <template>
<div class="domain">获取微信地址{{address}}----{{openid}}</div> <div class="domain">获取微信地址</div>
<!-- {{address}}----{{openid}} -->
</template> </template>
<script> <script>
...@@ -43,7 +44,7 @@ export default { ...@@ -43,7 +44,7 @@ export default {
this.init(); this.init();
}, },
onShow() { onShow() {
console.log("onshow",this.openSetting); console.log("onshow", this.openSetting);
if (this.openSetting) { if (this.openSetting) {
this.init(); this.init();
} }
...@@ -55,6 +56,21 @@ export default { ...@@ -55,6 +56,21 @@ export default {
}); });
let that = this; let that = this;
wx.chooseAddress({
success: function(res) {
console.log(4);
that.disposeAddress(res);
},
fail: function(res) {
//用户取消
console.log(5);
// wx.navigateBack();
that.getSett();
}
});
},
getSett() {
let that = this;
wx.getSetting({ wx.getSetting({
success(res) { success(res) {
if (!res.authSetting["scope.address"]) { if (!res.authSetting["scope.address"]) {
......
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
<button class="btn" lang="zh_CN" open-type="getUserInfo" @getuserinfo="getUserInfo">微信一键登录</button> <button class="btn" lang="zh_CN" open-type="getUserInfo" @getuserinfo="getUserInfo">微信一键登录</button>
</div> </div>
<div>{{testd}}</div> <!-- <div>{{testd}}</div>
<div>{{test_sessionId}}</div>--sessionId <div>{{test_sessionId}}</div>--sessionId
<div>{{unionId}}</div>--unionId <div>{{unionId}}</div>--unionId
<div>{{test_isHaveUnion}}</div>--isHaveUnion <div>{{test_isHaveUnion}}</div>--isHaveUnion -->
<!-- <div class="enterpriseLogin" @click="eLogin">账号登录</div> --> <!-- <div class="enterpriseLogin" @click="eLogin">账号登录</div> -->
</div> </div>
<div class="toCLogin1" v-if="isShowPhone"> <div class="toCLogin1" v-if="isShowPhone">
...@@ -93,7 +93,7 @@ export default { ...@@ -93,7 +93,7 @@ export default {
login login
.miniLogin({ code: res.code }) .miniLogin({ code: res.code })
.then(res => { .then(res => {
wx.showToast({ title: res.data.code, icon: "none" }); // wx.showToast({ title: res.data.code, icon: "none" });
if (res.data.code == 200) { if (res.data.code == 200) {
this.testd = JSON.stringify(res.data); this.testd = JSON.stringify(res.data);
this.test_isHaveUnion = res.data.data.isHaveUnion; this.test_isHaveUnion = res.data.data.isHaveUnion;
......
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