|
@ -113,7 +113,7 @@ |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</uni-popup> |
|
|
</uni-popup> |
|
|
<button class="getphone-box" open-type="getPhoneNumber" bindgetphonenumber="onGetPhoneNumber" v-if="!doctorInfo.aid"></button> |
|
|
<button class="getphone-box" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber" v-if="!doctorInfo.aid"></button> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
@ -160,12 +160,6 @@ export default { |
|
|
this.state = option.state |
|
|
this.state = option.state |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
onReady() { // 使用 onReady 替代 onLoad |
|
|
|
|
|
// #ifdef MP-WEIXIN |
|
|
|
|
|
// this.triggerGetPhone(); |
|
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
async onShow() { |
|
|
async onShow() { |
|
|
this.doctor_id = getApp().globalData.doctorId |
|
|
this.doctor_id = getApp().globalData.doctorId |
|
|
if (!this.doctor_id) return |
|
|
if (!this.doctor_id) return |
|
@ -196,42 +190,18 @@ export default { |
|
|
this.$refs.nameWrap.close() |
|
|
this.$refs.nameWrap.close() |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
// 主动触发获取手机号 |
|
|
getPhoneNumber(e) { |
|
|
triggerGetPhone() { |
|
|
console.log(e) |
|
|
// 确保组件作用域和延迟 |
|
|
|
|
|
setTimeout(() => { |
|
|
|
|
|
const query = uni.createSelectorQuery().in(this); |
|
|
|
|
|
query.select('#getPhoneBtn') |
|
|
|
|
|
.node() |
|
|
|
|
|
.exec((res) => { |
|
|
|
|
|
const node = res[0]?.node; |
|
|
|
|
|
if (node) { |
|
|
|
|
|
node.dispatchEvent(new CustomEvent('tap')); |
|
|
|
|
|
} else { |
|
|
|
|
|
console.error('节点未找到,请检查:', res); |
|
|
|
|
|
// 备用方案:引导用户手动点击 |
|
|
|
|
|
wx.showModal({ |
|
|
|
|
|
title: '提示', |
|
|
|
|
|
content: '请手动点击授权按钮', |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, 800); |
|
|
|
|
|
}, |
|
|
|
|
|
// 手机号授权回调 |
|
|
|
|
|
onGetPhoneNumber(e) { |
|
|
|
|
|
if (e.detail.errMsg === 'getPhoneNumber:ok') { |
|
|
if (e.detail.errMsg === 'getPhoneNumber:ok') { |
|
|
console.log(e.detail.code) |
|
|
|
|
|
this.$http.req('api/user/bind_phone', {phonecode:e.detail.code}, 'POST').then(data=>{ |
|
|
this.$http.req('api/user/bind_phone', {phonecode:e.detail.code}, 'POST').then(data=>{ |
|
|
if(data == -1) return |
|
|
if(data == -1) return |
|
|
|
|
|
this.getDoctorInfo() |
|
|
}); |
|
|
}); |
|
|
} else { |
|
|
} else { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
toLocation(hospital) { |
|
|
toLocation(hospital) { |
|
|
|
|
|
|
|
|
// #ifdef MP-WEIXIN |
|
|
// #ifdef MP-WEIXIN |
|
|
var lngLat = hospital.hospital_pos.toString().split(',') |
|
|
var lngLat = hospital.hospital_pos.toString().split(',') |
|
|
var lng = Number(lngLat[1]) |
|
|
var lng = Number(lngLat[1]) |
|
@ -320,7 +290,7 @@ export default { |
|
|
this.doctorInfo = data; |
|
|
this.doctorInfo = data; |
|
|
this.user_type = this.doctorInfo.user_type; |
|
|
this.user_type = this.doctorInfo.user_type; |
|
|
|
|
|
|
|
|
if(!data.realname) { |
|
|
if(!data.realname && data.aid) { |
|
|
this.$nextTick(() => { |
|
|
this.$nextTick(() => { |
|
|
this.$refs.nameWrap.open('bottom') |
|
|
this.$refs.nameWrap.open('bottom') |
|
|
}) |
|
|
}) |
|
|