This commit is contained in:
2023-09-22 15:07:20 +08:00
parent 96023542d9
commit 9c912b1b9c
4 changed files with 178 additions and 10 deletions

View File

@ -32,7 +32,7 @@
行为积分 行为积分
</view> </view>
</view> </view>
<view class="item" @tap='gohealthybeans'> <view class="item" @tap='gointegral'>
<view class="number"> <view class="number">
0 0
</view> </view>
@ -148,12 +148,44 @@
</template> </template>
<script> <script>
import {
mapActions
} from "vuex";
import {
appPersonal,
} from '@/api/pages/myinformation/myinformation.js';
import {
existPatientInfo
} from '@/api/pages/startup/index.js'
import {
createMobileToken
} from '@/api/pages/login/index.js'
import baseurl from '@/api/baseurl.js'
export default { export default {
data() { data() {
return { return {
baseurl: '',
appPersonallist: null, //
timer: null,
list: {},
// bjimg: '',
}; };
}, },
onShow() {
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
let that = this
this.baseurl = baseurl
this.myInfo()
const value = uni.getStorageSync('patientId');
if (value) {} else {
that.appPersonallist = null
that.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
})
}
},
methods: { methods: {
// //
goorder(index, item) { goorder(index, item) {
@ -186,14 +218,150 @@
url: '/pagesB/managefamily/managefamily' url: '/pagesB/managefamily/managefamily'
}) })
}, },
gocoupon() { gohealthybeans() {
uni.navigateTo({ uni.navigateTo({})
url: '/pagesB/coupon/coupon' },
remove() {
let that = this
const value = uni.getStorageSync('patientId');
if (value) {
uni.showModal({
title: '提示',
content: '确认要退出此账号吗',
success: function(res) {
if (res.confirm) {
uni.clearStorageSync();
that.$refs.uToast.show({
title: '退出账号成功',
type: 'success',
duration: '1000'
})
createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token)
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.switchTab({
url: '/pages/homepage/homepage'
})
}, 1000)
}
}
});
} else {
that.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000'
})
}
},
removes() {
this.appPersonallist = null
uni.removeStorageSync('patientId');
uni.removeStorageSync('openid');
uni.removeStorageSync('phone');
uni.removeStorageSync('Refresh');
uni.navigateBack({
delta: 1
}) })
}, },
gohealthybeans() { //
myInfo() {
var that = this
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
existPatientInfo(value).then(res => {
if (res.code == 200 && res.msg == 'LOGIN') {
appPersonal(value2).then(Response => {
if (Response.code == 200) {
that.appPersonallist = Response.data
if (!that.appPersonallist.integral) {
that.appPersonallist.integral = 0
}
that.appPersonallist.homeLatitude = Number(that.appPersonallist
.homeLatitude)
that.appPersonallist.homeLongitude = Number(that.appPersonallist
.homeLongitude)
} else if (Response.code == 9999) {} else {
that.removes();
}
})
} else {
that.removes();
}
})
} else {
that.removes();
}
},
updatainfo() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: `/pages/modify/modify`
})
} else {
this.gologin();
}
},
//
gonursestation() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/Nursingstationserviceorder/Nursingstationserviceorder'
})
} else {
this.gologin();
}
},
//
gologin() {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
url: '/pages/login/login'
})
},
//
gocoupon() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/coupon/coupon'
})
} else {
this.gologin();
}
},
//
...mapActions(["integralopenPopup"]),
gointegral() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
// this.integralopenPopup();
setTimeout(e => {
uni.navigateTo({
url: `/pagesB/healthybeans/healthybeans?integral=${this.appPersonallist.integral}`
})
}, 0)
} else {
this.gologin();
}
},
//
goHealthrecords() {
uni.navigateTo({ uni.navigateTo({
url: '/pagesB/healthybeans/healthybeans' url: '/pages/Healthrecords/Healthrecords'
}) })
}, },
} }

View File

@ -191,7 +191,7 @@
} from '@/api/pagesB/integral/index.js' } from '@/api/pagesB/integral/index.js'
import { import {
inviteFriends inviteFriends
} from '@/api/pagesB/Personal/Personal.js'; } from '@/api/pages/myinformation/myinformation.js';
import { import {
goodPatientInfo goodPatientInfo
} from '@/api/pagesB/modifyAddress/modifyAddress.js'; } from '@/api/pagesB/modifyAddress/modifyAddress.js';

View File

@ -112,7 +112,7 @@
import baseurl from '@/api/baseurl.js' import baseurl from '@/api/baseurl.js'
import { import {
appPersonal, appPersonal,
} from '@/api/pagesB/Personal/Personal.js'; } from '@/api/pages/myinformation/myinformation.js';
import { import {
getSubordinateRegions, getSubordinateRegions,
} from '@/api/pagesB/modifyAddress/modifyAddress.js'; } from '@/api/pagesB/modifyAddress/modifyAddress.js';
@ -434,4 +434,4 @@
<style lang="scss"> <style lang="scss">
@import "./modify.scss" @import "./modify.scss"
</style> </style>