xinelu-applet-ui/pages/myinformation/myinformation.vue

538 lines
14 KiB
Vue
Raw Normal View History

2023-09-20 10:42:44 +08:00
<template>
<view class="app">
<view class="topbanner">
2023-09-20 14:07:06 +08:00
<!-- <view class="title">
2023-09-20 10:42:44 +08:00
我的
2023-09-20 14:07:06 +08:00
</view> -->
2023-09-20 10:42:44 +08:00
<image src="../../static/pages/userbanner.png" mode="" class="userbanner"></image>
2023-10-16 15:11:26 +08:00
<image src="/static/headsculpture.png" mode="" class="headsculpture" @tap='updatainfo'
2023-10-16 11:23:57 +08:00
v-if="!appPersonallist.headPictureUrl">
</image>
<image :src="baseurl+appPersonallist.headPictureUrl" mode="" class="headsculpture" @tap='updatainfo' v-else>
2023-10-16 09:25:38 +08:00
</image>
2023-11-09 16:43:24 +08:00
<view class="namesigning" @tap='updatainfo'>
2023-11-09 15:58:45 +08:00
<span class="name">
2023-11-09 16:44:06 +08:00
{{appPersonallist.patientName?appPersonallist.patientName:'点击登录'}}
2023-09-20 11:30:45 +08:00
</span>
2023-11-09 15:58:45 +08:00
<span class="" v-show="appPersonallist.patientName">
2023-10-27 11:08:26 +08:00
<span class="signing" v-if="appPersonallist.signNo">
2023-10-27 09:36:30 +08:00
已签约
2023-10-27 11:08:26 +08:00
</span>
<span class="signing" v-else>
2023-10-27 09:36:30 +08:00
未签约
2023-10-27 11:08:26 +08:00
</span>
</span>
2023-09-20 10:42:44 +08:00
</view>
2023-10-16 11:23:57 +08:00
<view class="phone" v-if="appPersonallist.phone">
2023-10-13 17:32:38 +08:00
{{appPersonallist.phone}}
2023-09-20 11:30:45 +08:00
</view>
2023-10-16 11:33:36 +08:00
<view class="switch btn" @tap='homeshow'>
2023-09-20 11:30:45 +08:00
切换家庭成员
</view>
<view class="manage btn" @click="gomanagefamily">
2023-09-20 11:30:45 +08:00
管理家庭成员
</view>
<view class="Threecategories">
2023-09-20 14:26:05 +08:00
<view class="item" @tap="goBehaviorpoints">
2023-09-20 11:30:45 +08:00
<view class="number">
2023-11-13 09:57:09 +08:00
{{appPersonallist.score>0?appPersonallist.score:0}}
2023-09-20 11:30:45 +08:00
</view>
<view class="text">
行为积分
</view>
</view>
2023-09-22 15:07:20 +08:00
<view class="item" @tap='gointegral'>
2023-11-09 17:24:28 +08:00
<view class="number">
2023-11-13 09:57:09 +08:00
{{appPersonallist.integral>0?appPersonallist.integral:0}}
2023-11-08 15:40:35 +08:00
</view>
2023-09-20 11:30:45 +08:00
<view class="text">
健康豆
</view>
</view>
2023-09-20 13:52:08 +08:00
<view class="item" @tap='gocoupon'>
2023-11-09 17:24:28 +08:00
<view class="number">
2023-11-13 09:57:09 +08:00
{{appPersonallist.patientCouponCount>0?appPersonallist.patientCouponCount:0}}
2023-09-20 11:30:45 +08:00
</view>
<view class="text">
优惠券
</view>
</view>
</view>
</view>
<view class="myorder">
<view class="title">
我的订单
</view>
2023-09-22 14:50:49 +08:00
<view class="righttitle" @tap="goorder(0,'')">
2023-09-20 11:30:45 +08:00
查看全部
<image src="../../static/huijiantou.png" mode=""></image>
</view>
<view class="orderStatus">
2023-09-22 14:50:49 +08:00
<view class="item" @tap="goorder(1,'WAIT_PAY')">
2023-09-20 11:30:45 +08:00
<image src="../../static/pages/daifukuan.png" mode=""></image>
<view class="text">
待付款
</view>
2023-11-07 10:59:36 +08:00
<view class="orderCount" v-if="appPersonallist.waitPayCount>0&&appPersonallist.waitPayCount<100">
{{appPersonallist.waitPayCount}}
</view>
<view class="orderCount" style="width: 57rpx;border-radius: 17rpx;right:25rpx"
v-if="appPersonallist.waitPayCount>=100">
99+
</view>
2023-09-20 11:30:45 +08:00
</view>
2023-09-22 14:50:49 +08:00
<view class="item" @tap="goorder(2,'WAIT_RECEIVED_GOODS')">
2023-09-20 11:30:45 +08:00
<image src="../../static/pages/daishouhuo.png" mode=""></image>
<view class="text">
待收货
2023-09-20 14:21:34 +08:00
</view>
2023-11-08 14:10:01 +08:00
<view class="orderCount"
v-if="appPersonallist.waitReceivedGoodsCount>0&&appPersonallist.waitReceivedGoodsCount<100">
{{appPersonallist.waitReceivedGoodsCount}}
</view>
<view class="orderCount" style="width: 57rpx;border-radius: 17rpx;right:25rpx"
v-if="appPersonallist.waitReceivedGoodsCount>=100">
99+
</view>
2023-09-20 11:30:45 +08:00
</view>
2023-09-22 14:50:49 +08:00
<view class="item" @tap="goorder(3,'RECEIVED_GOODS')">
2023-09-20 11:30:45 +08:00
<image src="../../static/pages/daipingjia.png" mode=""></image>
<view class="text">
待评价
2023-09-20 14:21:34 +08:00
</view>
2023-11-07 10:59:36 +08:00
<view class="orderCount"
v-if="appPersonallist.receivedGoodsCount>0&&appPersonallist.receivedGoodsCount<100">
{{appPersonallist.receivedGoodsCount}}
</view>
<view class="orderCount" style="width: 57rpx;border-radius: 17rpx;right:25rpx"
v-if="list.receivedGoodsCount>=100">
99+
</view>
2023-09-20 11:30:45 +08:00
</view>
2023-09-22 14:50:49 +08:00
<view class="item" @tap="goorder(4,'EVALUATED')">
2023-09-20 11:30:45 +08:00
<image src="../../static/pages/yiwancheng.png" mode=""></image>
<view class="text">
已完成
</view>
2023-11-07 10:59:36 +08:00
<!-- <view class="orderCount" v-if="appPersonallist.evaluatedCount>0&&appPersonallist.evaluatedCount<100">
{{appPersonallist.evaluatedCount}}
</view>
<view class="orderCount" v-if="appPersonallist.evaluatedCount>=100">
99+
</view> -->
2023-09-20 11:30:45 +08:00
</view>
</view>
</view>
<view class="myorder">
<view class="title">
常用功能
</view>
<view class="orderStatus">
2023-11-08 16:30:31 +08:00
<!-- <view class="item" @tap='goHealthrecords'>
2023-09-20 11:30:45 +08:00
<image src="../../static/pages/jiankangdangan.png" mode=""></image>
<view class="text">
健康档案
</view>
2023-11-08 16:30:31 +08:00
</view> -->
2023-10-31 10:37:09 +08:00
<view class="item" @tap="gomyappiont">
2023-09-20 11:30:45 +08:00
<image src="../../static/pages/wodeyuyue.png" mode=""></image>
<view class="text">
我的预约
2023-09-20 14:21:34 +08:00
</view>
2023-09-20 11:30:45 +08:00
</view>
2023-10-16 16:03:32 +08:00
<view class="item" @tap="evaluation">
2023-09-20 11:30:45 +08:00
<image src="../../static/pages/fuwupingjia.png" mode=""></image>
<view class="text">
服务评价
</view>
</view>
<view class="item"></view>
</view>
</view>
2023-09-22 15:29:53 +08:00
<view class="myorder titles" @tap="gonursestation">
2023-09-20 11:30:45 +08:00
<view class="title">
护理服务订单
</view>
<view class="righttitle">
<image src="../../static/huijiantou.png" mode=""></image>
</view>
</view>
2023-09-27 16:38:01 +08:00
<view class="myorder titles" @tap="expertOrder">
2023-09-20 11:30:45 +08:00
<view class="title">
专家咨询订单
</view>
<view class="righttitle">
<image src="../../static/huijiantou.png" mode=""></image>
2023-09-20 10:42:44 +08:00
</view>
</view>
2023-10-31 10:20:40 +08:00
<view class="myorder titles" @tap="Signing">
2023-09-20 11:30:45 +08:00
<view class="title">
签约信息
</view>
<view class="righttitle">
<image src="../../static/huijiantou.png" mode=""></image>
</view>
</view>
2023-10-18 10:56:01 +08:00
<view class="myorder titles" @tap="remove()">
2023-09-20 11:30:45 +08:00
<view class="title">
退出登录
</view>
<view class="righttitle">
<image src="../../static/huijiantou.png" mode=""></image>
2023-09-20 10:42:44 +08:00
</view>
</view>
2023-10-27 14:55:48 +08:00
<view class="mask" @click.stop='showhome = false' v-if="showhome">
2023-10-16 15:11:26 +08:00
<view class="masktext" @click.stop=''>
2023-10-27 14:55:48 +08:00
<view class="maskcontent" v-if="familyList">
2023-10-16 15:11:26 +08:00
<template v-for="item in familyList">
2023-11-13 09:57:09 +08:00
<view :class="item.cardNo == appPersonallist.cardNo ? 'p1' : 'p2'"
2023-10-17 16:20:03 +08:00
@click.stop="changeFamilyInfo(item)">
<text>{{item.patientName}}</text>
<text
v-if="item.cardNo">{{item.cardNo.substring(0,4)}}************{{item.cardNo.substring(16,18)}}</text>
2023-10-16 15:11:26 +08:00
</view>
</template>
</view>
<view class="add" @click.stop="addFamilyItem">
添加家庭成员
</view>
</view>
2023-10-16 11:33:36 +08:00
</view>
2023-10-17 16:20:03 +08:00
<u-toast ref="uToast" />
2023-09-20 10:42:44 +08:00
</view>
</template>
<script>
2023-09-22 15:07:20 +08:00
import {
mapActions
} from "vuex";
import {
appPersonal,
2023-10-17 16:20:03 +08:00
getFamilyList,
registerdata,
getCurrentUser,
switchResident
2023-09-22 15:07:20 +08:00
} 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'
2023-09-20 10:42:44 +08:00
export default {
data() {
return {
2023-09-22 15:07:20 +08:00
baseurl: '',
appPersonallist: null, //获取个人信息
timer: null,
list: {},
2023-10-16 15:11:26 +08:00
showhome: false, //切换
2023-10-27 14:55:48 +08:00
familyList: null, //切换列表
2023-09-20 10:42:44 +08:00
};
},
2023-09-22 15:07:20 +08:00
onShow() {
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
2023-11-13 09:57:09 +08:00
this.appPersonallist = uni.getStorageSync('userinfo')
2023-10-27 14:55:48 +08:00
this.baseurl = baseurl
2023-11-09 15:58:45 +08:00
this.myInfo()
2023-10-17 17:26:09 +08:00
this.getpersnoal()
2023-09-22 15:07:20 +08:00
},
methods: {
2023-11-08 14:10:01 +08:00
gomyappiont() {
2023-10-31 10:37:09 +08:00
uni.navigateTo({
url: '/pagesC/Myappointment/Myappointment'
})
},
2023-10-18 10:56:01 +08:00
// 退出登录
remove() {
let that = this
const value = uni.getStorageSync('patientId');
if (value) {
uni.showModal({
title: '提示',
content: '确认要退出此账号吗',
2023-11-08 14:10:01 +08:00
success: function(res) {
2023-10-18 10:56:01 +08:00
if (res.confirm) {
2023-11-07 17:04:46 +08:00
// uni.clearStorageSync();、
that.removes()
2023-10-18 10:56:01 +08:00
that.$refs.uToast.show({
title: '退出账号成功',
type: 'success',
duration: '1000'
})
2023-11-07 16:20:36 +08:00
if (that.timer) {
clearTimeout(that.timer)
}
2023-11-08 14:10:01 +08:00
that.timer = setTimeout(e => {
2023-10-18 10:56:01 +08:00
uni.switchTab({
url: '/pages/homepage/homepage'
})
}, 1000)
}
}
});
} else {
that.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000'
})
}
},
2023-10-17 17:26:09 +08:00
// 获取成员
2023-10-31 10:37:09 +08:00
getpersnoal() {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('openid');
if (value) {
getCurrentUser(value).then(res => {
this.familyList = res.data
})
}
2023-10-17 17:26:09 +08:00
},
2023-10-17 16:20:03 +08:00
// 切换成员
changeFamilyInfo(e) {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('openid');
if (value) {
switchResident(value, e.patientCode).then(res => {
2023-10-27 09:36:30 +08:00
uni.setStorageSync('userinfo', res.data);
uni.setStorageSync('patientId', res.data.id);
2023-11-13 09:57:09 +08:00
this.appPersonallist = res.data
2023-11-09 15:58:45 +08:00
if (res.code == 200) {
this.$refs.uToast.show({
title: '切换成功',
type: 'success',
duration: '1000',
})
this.myInfo()
} else {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
duration: '1000',
})
}
})
this.showhome = false
}
2023-10-17 16:20:03 +08:00
},
2023-09-22 15:07:20 +08:00
removes() {
this.appPersonallist = null
2023-10-27 14:55:48 +08:00
uni.removeStorageSync('patientId');
uni.removeStorageSync('openid');
uni.removeStorageSync('phone');
uni.removeStorageSync('userinfo');
2023-09-20 13:52:08 +08:00
},
2023-09-22 15:07:20 +08:00
//获取个人信息
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) {
2023-11-13 09:57:09 +08:00
uni.setStorageSync('userinfo', Response.data);
2023-09-22 15:07:20 +08:00
that.appPersonallist = Response.data
that.appPersonallist.homeLatitude = Number(that.appPersonallist
.homeLatitude)
that.appPersonallist.homeLongitude = Number(that.appPersonallist
.homeLongitude)
2023-11-09 15:58:45 +08:00
} else {
2023-09-22 15:07:20 +08:00
that.removes();
}
})
} else {
that.removes();
}
})
} else {
that.removes();
}
},
updatainfo() {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('userinfo');
2023-09-22 15:07:20 +08:00
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
2023-09-22 16:01:48 +08:00
url: `/pagesB/modify/modify`
2023-09-22 15:07:20 +08:00
})
} else {
this.gologin();
}
},
//护理站服务订单
gonursestation() {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('userinfo');
2023-09-22 15:07:20 +08:00
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/Nursingstationserviceorder/Nursingstationserviceorder'
})
} else {
this.gologin();
}
},
2023-10-16 16:03:32 +08:00
// 服务评价
2023-10-17 16:20:03 +08:00
evaluation() {
2023-10-16 16:03:32 +08:00
uni.navigateTo({
url: '/pagesB/Serviceevaluation/Serviceevaluation'
})
2023-10-17 16:20:03 +08:00
2023-10-16 16:03:32 +08:00
},
2023-10-31 10:20:40 +08:00
// 签约信息
2023-11-08 14:10:01 +08:00
Signing() {
2023-11-13 15:56:11 +08:00
if (uni.getStorageSync('region') == 3) {
this.$refs.uToast.show({
title: '当前地区不支持,请选择其它地区',
type: 'error',
})
} else {
uni.navigateTo({
url: '/pagesB/mysigning/mysigning'
})
}
2023-10-31 10:20:40 +08:00
},
2023-09-22 15:07:20 +08:00
//去登陆
gologin() {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
url: '/pages/login/login'
})
},
//优惠券
gocoupon() {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('userinfo');
2023-09-22 15:07:20 +08:00
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/coupon/coupon'
})
} else {
this.gologin();
}
},
2023-10-09 13:29:39 +08:00
//健康档案
goHealthrecords() {
uni.navigateTo({
url: '/pagesC/Healthrecords/Healthrecords'
})
},
2023-09-22 15:29:53 +08:00
//全部订单
goorder(index, item) {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('userinfo');
2023-10-27 14:55:48 +08:00
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: `/pagesB/CommodityOrder/CommodityOrder?toindex=${index}&&orderStatus=${item}`
})
} else {
this.gologin();
}
2023-09-22 15:29:53 +08:00
},
//去登陆
gologin() {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
url: '/pages/login/login'
})
},
//护理站服务订单
gonursestation() {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('userinfo');
2023-09-22 15:29:53 +08:00
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/Nursingstationserviceorder/Nursingstationserviceorder'
})
} else {
this.gologin();
}
},
//行为积分
goBehaviorpoints() {
2023-11-09 16:59:45 +08:00
if (uni.getStorageSync('region') == 3) {
this.$refs.uToast.show({
title: '当前地区不支持,请选择其它地区',
type: 'error',
})
} else {
uni.navigateTo({
url: '/pagesB/Behaviorpoints/Behaviorpoints'
})
}
2023-09-22 15:29:53 +08:00
},
2023-10-16 11:33:36 +08:00
// 切换家庭成员
homeshow() {
this.showhome = true
2023-11-09 15:58:45 +08:00
this.getpersnoal()
// this.myInfo()
2023-10-16 11:33:36 +08:00
},
//管理家庭成员
2023-09-22 15:29:53 +08:00
gomanagefamily() {
uni.navigateTo({
url: '/pagesB/managefamily/managefamily'
})
},
2023-10-16 11:33:36 +08:00
// 添加家庭成员
addFamilyItem() {
uni.navigateTo({
2023-10-16 15:11:26 +08:00
url: '/pagesB/AddMembers/AddMembers'
2023-10-16 11:33:36 +08:00
})
2023-10-16 15:11:26 +08:00
// if (!this.userInfo) {
// uni.showModal({
// title: "提示",
// content: "您还未注册,是否去注册?",
// confirmText: '是',
// cancelText: '否',
// success(res) {
// if (res.confirm) {
// uni.redirectTo({
// url: "/pages/login/login?mode=注册"
// })
// } else {
// wx.exitMiniProgram()
// }
// },
// })
// } else {
// this.getSetting()
// uni.navigateTo({
// url: '/pages/login/login'
// });
// }
2023-10-16 11:33:36 +08:00
},
2023-09-22 15:07:20 +08:00
//积分页面
...mapActions(["integralopenPopup"]),
gointegral() {
2023-11-09 15:58:45 +08:00
const value = uni.getStorageSync('userinfo');
2023-09-22 15:07:20 +08:00
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
2023-09-22 15:29:53 +08:00
this.integralopenPopup();
2023-09-22 15:07:20 +08:00
setTimeout(e => {
uni.navigateTo({
url: `/pagesB/healthybeans/healthybeans?integral=${this.appPersonallist.integral}`
})
}, 0)
} else {
this.gologin();
}
},
2023-09-27 16:38:01 +08:00
// 专家咨询订单
2023-10-09 13:29:39 +08:00
expertOrder() {
2023-09-27 16:38:01 +08:00
uni.navigateTo({
2023-11-08 15:33:37 +08:00
url: "/pagesB/ExpertlookOrder/ExpertlookOrder"
2023-09-27 16:38:01 +08:00
})
2023-10-16 11:33:36 +08:00
},
2023-09-20 10:42:44 +08:00
}
}
</script>
<style lang="scss">
2023-09-20 11:33:09 +08:00
@import './myinformation.scss'
2023-11-13 15:56:11 +08:00
</style>