This commit is contained in:
2023-10-12 10:40:40 +08:00
parent 11172e3717
commit ca98468c3a
6 changed files with 267 additions and 278 deletions

View File

@ -32,3 +32,14 @@ export function detail(identity,region) {
}, },
}) })
} }
//是否注册
export function checkSignApply(identity, region) {
return request({
url: `/applet/sign/apply/checkSignApply/${identity}`,
method: 'GET',
header: {
region: region,
},
})
}

View File

@ -495,7 +495,6 @@
"onReachBottomDistance": 40, // px "onReachBottomDistance": 40, // px
"enablePullDownRefresh": true //true "enablePullDownRefresh": true //true
} }
}, { }, {
"path": "selectInstitution/selectInstitution", "path": "selectInstitution/selectInstitution",
"style": { "style": {

View File

@ -68,8 +68,8 @@
import { import {
getOpenId, getOpenId,
getCurrentUser, getCurrentUser,
detail detail,
checkSignApply
} from '@/api/pages/homepage/homepage.js' } from '@/api/pages/homepage/homepage.js'
export default { export default {
data() { data() {
@ -79,6 +79,7 @@
identity: '', identity: '',
region: '', region: '',
openid: '', openid: '',
checkSign: null,
} }
}, },
onLoad() { onLoad() {
@ -86,38 +87,31 @@
}, },
onShow() { onShow() {
this.userinfo = uni.getStorageSync('userinfo'); this.userinfo = uni.getStorageSync('userinfo');
this.region = this.userinfo.cityCode; if (this.userinfo) {
this.openid = this.userinfo.openid; checkSignApply(this.userinfo.cardNo, '1').then(res => {
this.identity = this.userinfo.cardNo; if (res.code != 0) {
if (!this.openid && !this.region) { this.checkSign = true
// that.appPersonallist = null }
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
})
} else {
getCurrentUser(this.openid, this.region).then(res => {
this.patientName = res.data.patientName
uni.setStorageSync('patientId', res.data.id);
// if (!res.data) {
// //
// }
}) })
} }
}, },
methods: { methods: {
// //
login() { login() {
this.gologin(); uni.navigateTo({
url: "/pages/login/login"
})
}, },
gologin() { gologin() {
if (!this.userinfo) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '您未登录,请先登录', title: '您未登录,请先登录',
type: 'error', type: 'error',
duration: '1000', duration: '1000',
url: '/pages/login/login' url: '/pages/login/login'
}) })
return
}
}, },
// //
detailinfo(url1, url2) { detailinfo(url1, url2) {
@ -139,98 +133,100 @@
}, },
// //
goonline() { goonline() {
uni.navigateTo({ this.gologin();
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning" url: "/pagesC/Onlinesigning/Onlinesigning"
}) })
// this.detailinfo('/pagesC/Onlinesigning/Onlinesigning', '/pagesB/mysigning/mysigning')
if (!this.userinfo && !this.identity) {
// this.gologin();
} else { } else {
// this.detailinfo('/pagesC/Onlinesigning/Onlinesigning', '/pagesB/mysigning/mysigning') uni.navigateTo({
url: "/pagesB/mysigning/mysigning"
})
} }
}, },
// //
count() { count() {
if (!this.userinfo && !this.identity) {
this.gologin(); this.gologin();
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning"
})
} else { } else {
this.detailinfo('', '') uni.navigateTo({
url: ""
})
} }
}, },
// //
goHealthrecords() { goHealthrecords() {
if (!this.userinfo && !this.identity) {
this.gologin(); this.gologin();
} else {
// this.detailinfo('', '')
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Healthrecords/Healthrecords' url: "/pagesC/Healthrecords/Healthrecords"
}) })
}
}, },
// //
gorecords() { gorecords() {
if (!this.userinfo && !this.identity) {
this.gologin(); this.gologin();
} else {
// this.detailinfo('', '')
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Screeningrecords/Screeningrecords' url: "/pagesC/Screeningrecords/Screeningrecords"
}) })
}
}, },
// //
healthtest() { healthtest() {
if (!this.userinfo && !this.identity) {
this.gologin(); this.gologin();
} else {
// this.detailinfo('', '')
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/healthtest/healthtest' url: "/pagesC/healthtest/healthtest"
}) })
}
}, },
// //
sign() { sign() {
if (!this.userinfo && !this.identity) {
this.gologin(); this.gologin();
} else {
// this.detailinfo('', '')
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Physicalexamination/Physicalexamination' url: "/pagesC/Physicalexamination/Physicalexamination"
}) })
}
}, },
// //
goappoint() { goappoint() {
uni.navigateTo({
url: '/pagesC/ServiceAppointment/ServiceAppointment'
})
// if (!this.userinfo && !this.identity) {
// this.gologin();
// } else {
// this.detailinfo('', '/pagesC/ServiceAppointment/ServiceAppointment')
// }
},
//
servicerecord() {
if (!this.userinfo && !this.identity) {
this.gologin(); this.gologin();
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning"
})
} else { } else {
// this.detailinfo('', '')
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/servicerecord/servicerecord' url: "/pagesC/ServiceAppointment/ServiceAppointment"
}) })
} }
}, },
//
servicerecord() {
this.gologin();
uni.navigateTo({
url: "/pagesC/servicerecord/servicerecord"
})
},
// //
myappointment() { myappointment() {
if (!this.userinfo && !this.identity) {
this.gologin(); this.gologin();
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning"
})
} else { } else {
// this.detailinfo('', '')
uni.navigateTo({ uni.navigateTo({
url: '/pagesC/Myappointment/Myappointment' url: "/pagesC/Myappointment/Myappointment"
}) })
} }
}, },

View File

@ -24,15 +24,14 @@
logincode: undefined, logincode: undefined,
code: undefined, code: undefined,
timer: undefined, timer: undefined,
scenenurseStationId: undefined, // scenenurseStationId: undefined,
codes:'',
}; };
}, },
onShow() { onShow() {
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: {
getPhoneNumberp(val) { getPhoneNumberp(val) {
@ -42,73 +41,53 @@
wx.login({ wx.login({
provider: 'weixin', provider: 'weixin',
success: function(loginRes) { success: function(loginRes) {
console.log(loginRes)
// uni.$emit('code',loginRes.code)
that.code = loginRes.code that.code = loginRes.code
isRegistered(that.code).then(resp=>{
console.log(resp,'0000')
if(!resp.data){
uni.navigateTo({
url:`/pages/register/register?code=${that.logincode}`
})
}else{
uni.setStorageSync('userinfo', resp.data);
uni.switchTab({
url:'/pages/homepage/homepage'
})
}
}),
that.codes=that.code
that.login() that.login()
} }
}); });
} }
},
//
isRegisteredget(){
}, },
login() { login() {
let that = this; let that = this;
console.log(that.codes,'9999') getWeChatUser(that.code).then(res => {
getWeChatUser(that.codes).then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.setStorageSync("openid", res.data) uni.setStorageSync("openid", res.data)
// uni.setStorageSync("patientId", res.data.id) isRegistered(that.code).then(resp => {
// uni.setStorageSync("phone", res.data.phone) if (!resp.data) {
// this.$refs.uToast.show({ that.$refs.uToast.show({
// title: '', title: '未注册,请先注册',
// type: 'success', type: 'error',
// duration: '1500' duration: '1500',
// }) url: '/pages/register/register',
// console.log(this.logincode) })
// this.phonecode = undefined
// this.logincode = undefined
// uni.setStorageSync("Refresh", 'Refresh')
// if (this.timer) {
// clearTimeout(this.timer)
// }
// this.timer = setTimeout(e => {
// uni.navigateBack({
// delta: 1
// })
// }, 500)
} else { } else {
// this.$refs.uToast.show({ getCurrentUser(that.openid, that.region).then(res => {
// title: '', if (res.code == 200) {
// type: 'error', that.$refs.uToast.show({
// duration: '1500' title: '登录成功',
// }) type: 'success',
duration: '1500'
})
uni.setStorageSync('patientId', res.data.id);
uni.setStorageSync('userinfo', resp.data);
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(e => {
uni.navigateBack({
delta: 1
})
}, 500)
} else {
that.$refs.uToast.show({
title: '登录失败',
type: 'error',
duration: '1500'
})
}
})
}
})
} }
}) })
}, },

View File

@ -127,6 +127,9 @@
</template> </template>
<script> <script>
import {
getCurrentUser,
} from '@/api/pages/homepage/homepage.js'
import { import {
AppIdentification AppIdentification
} from '@/api/pagesB/AppIdentification/index.js' } from '@/api/pagesB/AppIdentification/index.js'
@ -197,7 +200,6 @@
value: '0', value: '0',
label: '无' label: '无'
}], }],
// checked:false, // checked:false,
// chooseLocation: '', // // chooseLocation: '', //
arealist: [], //list arealist: [], //list
@ -214,7 +216,6 @@
headPictureUrl: '', headPictureUrl: '',
couponId: null, couponId: null,
patientName: "", patientName: "",
cardNo: "", cardNo: "",
phone: "", phone: "",
address: "", address: "",
@ -298,21 +299,12 @@
selectChange(val) { selectChange(val) {
console.log(val); console.log(val);
}, },
cancel() { cancel() {},
},
confirm(e) { confirm(e) {
this.query.diseaseList = e.map(Number) this.query.diseaseList = e.map(Number)
console.log(e) console.log(e)
}, },
submit() { submit() {
console.log(this.query)
// this.query.openid = uni.getStorageSync('openid');
// uni.navigateTo({
// url: '/pagesB/information/information'
// })
var that = this var that = this
that.query.openid = uni.getStorageSync('openid'); that.query.openid = uni.getStorageSync('openid');
if (that.query.sexname == '男') { if (that.query.sexname == '男') {
@ -325,10 +317,7 @@
title: '请选择性别', title: '请选择性别',
type: 'error' type: 'error'
}) })
} }
console.log(that.selected)
if (!that.query.locationName) { if (!that.query.locationName) {
that.$refs.uToast.show({ that.$refs.uToast.show({
title: '请选择所在位置', title: '请选择所在位置',
@ -342,7 +331,6 @@
}) })
} }
that.$refs.uForm.validate(valid => { that.$refs.uForm.validate(valid => {
console.log(valid)
if (valid) { if (valid) {
if (!that.selected) { if (!that.selected) {
that.$refs.uToast.show({ that.$refs.uToast.show({
@ -351,13 +339,12 @@
}) })
} else { } else {
registerdata(that.query).then(res => { registerdata(that.query).then(res => {
if (res.code == 500) { if (res.code == 200) {
that.$refs.uToast.show({ getCurrentUser(that.query.openid, '1').then(res => {
title: res.msg, // uni.setStorageSync('patientId', res.data.id);
type: 'error', // uni.setStorageSync('patientName', res.data.patientName);
uni.setStorageSync("userinfo", res.data)
}) })
}else{
uni.setStorageSync("userinfo", that.query)
that.$refs.uToast.show({ that.$refs.uToast.show({
title: '注册成功', title: '注册成功',
type: 'success', type: 'success',
@ -366,14 +353,15 @@
uni.switchTab({ uni.switchTab({
url: '/pages/homepage/homepage', url: '/pages/homepage/homepage',
}); });
} } else {
that.$refs.uToast.show({
title: res.msg,
type: 'error',
}) })
} }
})
} else {
console.log('验证失败');
} }
} else {}
}); });
}, },
// //
@ -389,10 +377,7 @@
uni.navigateTo({ uni.navigateTo({
url: '/pages/facecollection/facecollection' url: '/pages/facecollection/facecollection'
}) })
}, },
// //
// informationinfo() { // informationinfo() {
// var that = this // var that = this
@ -640,6 +625,7 @@
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.Agreement { .Agreement {
width: 100%; width: 100%;
background-color: #fff; background-color: #fff;
@ -648,6 +634,7 @@
position: absolute; position: absolute;
top: 5%; top: 5%;
font-size: 30rpx; font-size: 30rpx;
.title { .title {
height: 100rpx; height: 100rpx;
line-height: 100rpx; line-height: 100rpx;
@ -657,12 +644,14 @@
width: 100%; width: 100%;
text-align: center; text-align: center;
} }
.scroll-Y { .scroll-Y {
height: 830rpx; height: 830rpx;
overflow-y: scroll; overflow-y: scroll;
text-align: left; text-align: left;
text-indent: 2em; text-indent: 2em;
} }
.cancel { .cancel {
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
@ -675,6 +664,7 @@
width: 50%; width: 50%;
color: #000000; color: #000000;
} }
.determine { .determine {
height: 70rpx; height: 70rpx;
line-height: 70rpx; line-height: 70rpx;
@ -687,12 +677,14 @@
left: 0; left: 0;
} }
} }
.radio-content { .radio-content {
margin: 50rpx auto; margin: 50rpx auto;
width: 70%; width: 70%;
text-align: center; text-align: center;
font-size: 28rpx; font-size: 28rpx;
position: relative; position: relative;
.agreement { .agreement {
position: absolute; position: absolute;
top: 50%; top: 50%;
@ -700,6 +692,7 @@
transform: translateY(-50%); transform: translateY(-50%);
color: #878987; color: #878987;
} }
.radio-right { .radio-right {
height: 100rpx; height: 100rpx;
@ -713,6 +706,7 @@
top: 50%; top: 50%;
left: 5%; left: 5%;
transform: translateY(-50%); transform: translateY(-50%);
.radio-active { .radio-active {
width: 16rpx; width: 16rpx;
height: 16rpx; height: 16rpx;
@ -740,6 +734,7 @@
.form { .form {
margin-top: 106rpx; margin-top: 106rpx;
::v-deep .u-input { ::v-deep .u-input {
width: 630rpx; width: 630rpx;
height: 63rpx; height: 63rpx;

View File

@ -137,8 +137,6 @@
<u-checkbox v-model="item.checked" v-for="(item, index) in crowdslist" :key="index" <u-checkbox v-model="item.checked" v-for="(item, index) in crowdslist" :key="index"
:name="item.crowdNo" label-size='20rpx'>{{item.crowdName}}</u-checkbox> :name="item.crowdNo" label-size='20rpx'>{{item.crowdName}}</u-checkbox>
</u-checkbox-group> </u-checkbox-group>
<u-checkbox-group @change="packagescheckboxGroupChange" v-model="query.packagesName" <u-checkbox-group @change="packagescheckboxGroupChange" v-model="query.packagesName"
v-if="showGroup == 2" label-size='20rpx'> v-if="showGroup == 2" label-size='20rpx'>
<u-checkbox v-model="item.checked" v-for="(item, index) in packageslist" :key="index" <u-checkbox v-model="item.checked" v-for="(item, index) in packageslist" :key="index"
@ -208,6 +206,17 @@
methods: { methods: {
updata() { updata() {
if (this.radio == 2) { if (this.radio == 2) {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (month < 10) {
month = '0' + month;
}
if (day < 10) {
day = '0' + day;
}
this.query.signTime = year + '-' + month + '-' + day;
if (this.query.identity) { if (this.query.identity) {
this.query.birthday = getBirthday(this.query.identity) this.query.birthday = getBirthday(this.query.identity)
let gender = getSex(this.query.identity) let gender = getSex(this.query.identity)