作者 倪静楠

4/14

... ... @@ -19,7 +19,7 @@
</view>
<view class="rightPublic">
<text>{{detailData.address}}</text>
<text style="margin-left: 10rpx;">({{detailData.dis}} km)</text>
<text style="margin-left: 10rpx;" v-if="detailData.dis>0">({{detailData.dis}} km)</text>
<view class="" style="display: flex;align-items: center;" @click="tomap">
<image src="../../static/image/Frame_11@2x.png" mode=""
style="width:28rpx;height: 28rpx;margin-right: 6rpx;"></image>
... ...
... ... @@ -12,7 +12,7 @@
<view class="btn" v-if="checked">
登录
<button class="sys_btn" open-type="getUserInfo" lang="zh_CN" @getuserinfo="appLoginWx"></button>
<button class="sys_btn" @click="GetUser()"></button>
</view>
<view class="btn1" v-else @click="login">
登录
... ... @@ -33,7 +33,8 @@
export default {
data() {
return {
checked: ''
checked: '',
dataSource: {}
}
},
... ... @@ -53,6 +54,17 @@
icon: "none"
})
},
//获取用户信息
GetUser() {
wx.getUserProfile({
desc: '用于完善会员资料', // 声明获取用户个人信息后的用途,后续会展示在弹窗中,请谨慎填写
success: (res) => {
this.dataSource = res
uni.setStorageSync('userInfo', res.userInfo)
this.appLoginWx()
}
})
},
appLoginWx() {
uni.getProvider({
service: 'oauth',
... ... @@ -63,11 +75,9 @@
success: function(loginRes) {
console.log(uni.getStorageSync('pid'),'pidd')
// 获取用户信息
uni.getUserInfo({
provider: 'weixin',
success: function(infoRes) {
uni.setStorageSync('userInfo', infoRes
.userInfo)
// uni.getUserInfo({
// provider: 'weixin',
// success: function(infoRes) {
request.post('/api/common/login', {
code: loginRes.code,
rawData: JSON.stringify(uni
... ... @@ -88,14 +98,14 @@
}
})
},
fail: () => {
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
});
// },
// fail: () => {
// uni.showToast({
// title: "微信登录授权失败",
// icon: "none"
// });
// }
// });
},
fail: () => {
uni.showToast({
... ...
... ... @@ -432,4 +432,7 @@
<style>
@import url("/common/uni.css");
@import url("/common/publish.css");
input{
width: 98%;
}
</style>
... ...
... ... @@ -377,4 +377,7 @@
<style>
@import url("/common/uni.css");
@import url("/common/publish.css");
input{
width: 98%;
}
</style>
... ...