This commit is contained in:
2023-10-16 11:54:32 +08:00
parent 46fd79638e
commit f250d0438b
3 changed files with 63 additions and 31 deletions

View File

@ -4,7 +4,7 @@
<image src="/static/pageC/homepage.png" mode=""></image> <image src="/static/pageC/homepage.png" mode=""></image>
<view class="loginmount"> <view class="loginmount">
<image src="/static/pageC/TAB.png" mode=""></image> <image src="/static/pageC/TAB.png" mode=""></image>
<text v-if="patientName">{{patientName}}</text> <text v-if="patientName">{{patientName}},你好</text>
<text @tap="login" v-else>你好,请登录</text> <text @tap="login" v-else>你好,请登录</text>
</view> </view>
</view> </view>
@ -75,7 +75,7 @@
data() { data() {
return { return {
patientName: '', patientName: '',
userinfo: {}, userinfo: null,
region: '', region: '',
checkSign: null, checkSign: null,
} }
@ -88,7 +88,7 @@
this.userinfo = uni.getStorageSync('userinfo'); this.userinfo = uni.getStorageSync('userinfo');
this.patientName = this.userinfo.patientName this.patientName = this.userinfo.patientName
if (this.userinfo) { if (this.userinfo) {
checkSignApply(this.userinfo.cardNo, '1').then(res => { checkSignApply(this.userinfo.cardNo).then(res => {
if (res.code != 0) { if (res.code != 0) {
this.checkSign = true this.checkSign = true
} else { } else {
@ -114,6 +114,7 @@
}, },
// //
goonline() { goonline() {
console.log(!this.userinfo)
if (!this.userinfo) { if (!this.userinfo) {
this.gologin(); this.gologin();
} else { } else {
@ -133,25 +134,22 @@
}, },
// //
count() { count() {
uni.navigateTo({ if (!this.userinfo) {
url: '/pagesB/Behaviorpoints/Behaviorpoints' this.gologin();
}) } else {
// if (!this.userinfo) { if (!this.checkSign) {
// this.gologin(); this.$refs.uToast.show({
// } else { title: '未签约,请先签约',
// if (!this.checkSign) { type: 'error',
// this.$refs.uToast.show({ duration: '1000',
// title: '', url: "/pagesC/Onlinesigning/Onlinesigning"
// type: 'error', })
// duration: '1000', } else {
// url: "/pagesC/Onlinesigning/Onlinesigning" uni.navigateTo({
// }) url: '/pagesB/Behaviorpoints/Behaviorpoints'
// } else { })
// uni.navigateTo({ }
// url: "/pagesB/PointsMall/PointsMall" }
// })
// }
// }
}, },
// //
goHealthrecords() { goHealthrecords() {

View File

@ -28,17 +28,50 @@
code: undefined, code: undefined,
timer: undefined, timer: undefined,
cityCode: '1', cityCode: '1',
openid:'', openid: '',
// scenenurseStationId: undefined, // scenenurseStationId: undefined,
}; };
}, },
onShow() { onShow() {
this.getAddress();
this.phonecode = undefined this.phonecode = undefined
this.logincode = undefined this.logincode = undefined
this.code = undefined this.code = undefined
// this.scenenurseStationId = uni.getStorageSync('scenenurseStationId'); // this.scenenurseStationId = uni.getStorageSync('scenenurseStationId');
}, },
methods: { methods: {
//
getAddress() {
let that = this;
uni.getLocation({
type: 'wgs84',
success: (res) => {
let location = res.latitude + ',' + res.longitude
//
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=location', //
data: {
location: location,
'key': "Q4DBZ-UIMC2-B63UX-CUZ6A-S3UT7-TBF3V", //Key
},
method: "GET",
success(res) {
uni.setStorageSync('location', res.data.result.address_component.city)
},
fail: res => {
console.log(res.errMsg, '解析失败返回的错误信息');
}
})
},
//
fail: (res) => {
uni.showToast({
icon: 'none',
title: '获取地址失败,请打开定位',
})
}
})
},
getPhoneNumberp(val) { getPhoneNumberp(val) {
let that = this; let that = this;
if (val.detail.code) { if (val.detail.code) {
@ -58,8 +91,8 @@
// getWeChatUser(that.logincode).then(res => { // getWeChatUser(that.logincode).then(res => {
// if (res.code == 200) { // if (res.code == 200) {
isRegistered(that.logincode, that.phonecode).then(resp => { isRegistered(that.logincode, that.phonecode).then(resp => {
uni.setStorageSync("openid", resp.data.openid) uni.setStorageSync("openid", resp.data.openid)
that.openid=resp.data.openid that.openid = resp.data.openid
if (resp.data.code == '0') { if (resp.data.code == '0') {
that.$refs.uToast.show({ that.$refs.uToast.show({
title: '未注册,请先注册', title: '未注册,请先注册',
@ -87,8 +120,7 @@
delta: 1 delta: 1
}) })
}, 500) }, 500)
} } else {
else {
that.$refs.uToast.show({ that.$refs.uToast.show({
title: '登录失败', title: '登录失败',
type: 'error', type: 'error',

View File

@ -3,7 +3,7 @@
<view class="address"> <view class="address">
<image src="../../static/pages/address.png" mode=""></image> <image src="../../static/pages/address.png" mode=""></image>
<text> <text>
济南市 {{location?location:''}}
</text> </text>
</view> </view>
<view class="topbar"> <view class="topbar">
@ -61,12 +61,14 @@
informationCategoryVOList: [], // informationCategoryVOList: [], //
patientId: '', patientId: '',
userInfo: null, userInfo: null,
location: null,
}; };
}, },
onShow() { onShow() {
this.pageNum = 1 this.pageNum = 1
this.patientId = uni.getStorageSync('patientId'); this.patientId = uni.getStorageSync('patientId');
this.userInfo = uni.getStorageSync('userinfo') this.userInfo = uni.getStorageSync('userinfo')
this.location = uni.getStorageSync('location')
this.getHeathHousing(); this.getHeathHousing();
}, },
methods: { methods: {
@ -92,7 +94,7 @@
getScreening(this.patientId).then(res => { getScreening(this.patientId).then(res => {
if (res.code == 200) { if (res.code == 200) {
let userinfo = JSON.stringify(this.userInfo) let userinfo = JSON.stringify(this.userInfo)
if (!res.data||res.data==null) { if (!res.data || res.data == null) {
uni.navigateTo({ uni.navigateTo({
url: `/pagesB/screenorder/screenorder?userinfo=${userinfo}` url: `/pagesB/screenorder/screenorder?userinfo=${userinfo}`
}) })
@ -122,7 +124,7 @@
getHeathHousingList(this.pageNum, this.pageSize).then(res => { getHeathHousingList(this.pageNum, this.pageSize).then(res => {
if (res.rows) { if (res.rows) {
res.rows.forEach(e => { res.rows.forEach(e => {
e.leadThumbnailUrl = baseurl+ e.leadThumbnailUrl e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl
}) })
} }
this.informationCategoryVOList = res.rows this.informationCategoryVOList = res.rows
@ -203,4 +205,4 @@
<style lang="scss"> <style lang="scss">
@import "./medicalservice.scss"; @import "./medicalservice.scss";
</style> </style>