546 lines
14 KiB
Vue
546 lines
14 KiB
Vue
<template>
|
|
<view class="app">
|
|
<view class="topbanner">
|
|
<!-- <view class="title">
|
|
我的
|
|
</view> -->
|
|
<image src="../../static/pages/userbanner.png" mode="" class="userbanner"></image>
|
|
<image src="/static/headsculpture.png" mode="" class="headsculpture" @tap='updatainfo'
|
|
v-if="!appPersonallist.headPictureUrl">
|
|
</image>
|
|
<image :src="baseurl+appPersonallist.headPictureUrl" mode="" class="headsculpture" @tap='updatainfo' v-else>
|
|
</image>
|
|
<view class="namesigning">
|
|
<span class="name" v-if="appPersonallist.patientName">
|
|
{{appPersonallist.patientName}}
|
|
</span>
|
|
<span class="name" v-else>
|
|
请先登录!
|
|
</span>
|
|
<span class="" v-if="appPersonallist.patientName">
|
|
<span class="signing" v-if="appPersonallist.signNo">
|
|
已签约
|
|
</span>
|
|
<span class="signing" v-else>
|
|
未签约
|
|
</span>
|
|
</span>
|
|
</view>
|
|
<view class="phone" v-if="appPersonallist.phone">
|
|
{{appPersonallist.phone}}
|
|
</view>
|
|
<view class="switch btn" @tap='homeshow'>
|
|
切换家庭成员
|
|
</view>
|
|
<view class="manage btn" @click="gomanagefamily">
|
|
管理家庭成员
|
|
</view>
|
|
<view class="Threecategories">
|
|
<view class="item" @tap="goBehaviorpoints">
|
|
<view class="number">
|
|
0
|
|
</view>
|
|
<view class="text">
|
|
行为积分
|
|
</view>
|
|
</view>
|
|
<view class="item" @tap='gointegral'>
|
|
<view class="number">
|
|
0
|
|
</view>
|
|
<view class="text">
|
|
健康豆
|
|
</view>
|
|
</view>
|
|
<view class="item" @tap='gocoupon'>
|
|
<view class="number">
|
|
0
|
|
</view>
|
|
<view class="text">
|
|
优惠券
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="myorder">
|
|
<view class="title">
|
|
我的订单
|
|
</view>
|
|
<view class="righttitle" @tap="goorder(0,'')">
|
|
查看全部
|
|
<image src="../../static/huijiantou.png" mode=""></image>
|
|
</view>
|
|
<view class="orderStatus">
|
|
<view class="item" @tap="goorder(1,'WAIT_PAY')">
|
|
<image src="../../static/pages/daifukuan.png" mode=""></image>
|
|
<view class="text">
|
|
待付款
|
|
</view>
|
|
<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>
|
|
|
|
</view>
|
|
<view class="item" @tap="goorder(2,'WAIT_RECEIVED_GOODS')">
|
|
<image src="../../static/pages/daishouhuo.png" mode=""></image>
|
|
<view class="text">
|
|
待收货
|
|
</view>
|
|
<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>
|
|
</view>
|
|
<view class="item" @tap="goorder(3,'RECEIVED_GOODS')">
|
|
<image src="../../static/pages/daipingjia.png" mode=""></image>
|
|
<view class="text">
|
|
待评价
|
|
</view>
|
|
<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>
|
|
</view>
|
|
<view class="item" @tap="goorder(4,'EVALUATED')">
|
|
<image src="../../static/pages/yiwancheng.png" mode=""></image>
|
|
<view class="text">
|
|
已完成
|
|
</view>
|
|
<!-- <view class="orderCount" v-if="appPersonallist.evaluatedCount>0&&appPersonallist.evaluatedCount<100">
|
|
{{appPersonallist.evaluatedCount}}
|
|
</view>
|
|
<view class="orderCount" v-if="appPersonallist.evaluatedCount>=100">
|
|
99+
|
|
</view> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="myorder">
|
|
<view class="title">
|
|
常用功能
|
|
</view>
|
|
<view class="orderStatus">
|
|
<view class="item" @tap='goHealthrecords'>
|
|
<image src="../../static/pages/jiankangdangan.png" mode=""></image>
|
|
<view class="text">
|
|
健康档案
|
|
</view>
|
|
</view>
|
|
<view class="item" @tap="gomyappiont">
|
|
<image src="../../static/pages/wodeyuyue.png" mode=""></image>
|
|
<view class="text">
|
|
我的预约
|
|
</view>
|
|
</view>
|
|
<view class="item" @tap="evaluation">
|
|
<image src="../../static/pages/fuwupingjia.png" mode=""></image>
|
|
<view class="text">
|
|
服务评价
|
|
</view>
|
|
</view>
|
|
<view class="item"></view>
|
|
</view>
|
|
</view>
|
|
<view class="myorder titles" @tap="gonursestation">
|
|
<view class="title">
|
|
护理服务订单
|
|
</view>
|
|
<view class="righttitle">
|
|
<image src="../../static/huijiantou.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="myorder titles" @tap="expertOrder">
|
|
<view class="title">
|
|
专家咨询订单
|
|
</view>
|
|
<view class="righttitle">
|
|
<image src="../../static/huijiantou.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="myorder titles" @tap="Signing">
|
|
<view class="title">
|
|
签约信息
|
|
</view>
|
|
<view class="righttitle">
|
|
<image src="../../static/huijiantou.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="myorder titles" @tap="remove()">
|
|
<view class="title">
|
|
退出登录
|
|
</view>
|
|
<view class="righttitle">
|
|
<image src="../../static/huijiantou.png" mode=""></image>
|
|
</view>
|
|
</view>
|
|
<view class="mask" @click.stop='showhome = false' v-if="showhome">
|
|
<view class="masktext" @click.stop=''>
|
|
<view class="maskcontent" v-if="familyList">
|
|
<template v-for="item in familyList">
|
|
<view :class="item.cardNo == userinfo.cardNo ? 'p1' : 'p2'"
|
|
@click.stop="changeFamilyInfo(item)">
|
|
<text>{{item.patientName}}</text>
|
|
<text
|
|
v-if="item.cardNo">{{item.cardNo.substring(0,4)}}************{{item.cardNo.substring(16,18)}}</text>
|
|
</view>
|
|
</template>
|
|
</view>
|
|
<view class="add" @click.stop="addFamilyItem">
|
|
添加家庭成员
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<u-toast ref="uToast" />
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
mapActions
|
|
} from "vuex";
|
|
import {
|
|
appPersonal,
|
|
getFamilyList,
|
|
registerdata,
|
|
getCurrentUser,
|
|
switchResident
|
|
} 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 {
|
|
data() {
|
|
return {
|
|
baseurl: '',
|
|
appPersonallist: null, //获取个人信息
|
|
timer: null,
|
|
list: {},
|
|
showhome: false, //切换
|
|
familyList: null, //切换列表
|
|
userinfo: {}, //用户信息
|
|
valueopenid: '',
|
|
cityCode: '',
|
|
};
|
|
},
|
|
onShow() {
|
|
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
|
|
let that = this
|
|
this.userinfo = uni.getStorageSync('userinfo')
|
|
this.baseurl = baseurl
|
|
this.valueopenid = uni.getStorageSync('openid');
|
|
this.cityCode = uni.getStorageSync('region');
|
|
if (that.userinfo) {
|
|
that.myInfo()
|
|
} else {
|
|
that.appPersonallist = null
|
|
}
|
|
this.getpersnoal()
|
|
},
|
|
methods: {
|
|
gomyappiont() {
|
|
uni.navigateTo({
|
|
url: '/pagesC/Myappointment/Myappointment'
|
|
})
|
|
},
|
|
// 退出登录
|
|
remove() {
|
|
let that = this
|
|
const value = uni.getStorageSync('patientId');
|
|
if (value) {
|
|
uni.showModal({
|
|
title: '提示',
|
|
content: '确认要退出此账号吗',
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
// uni.clearStorageSync();、
|
|
that.removes()
|
|
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'
|
|
})
|
|
}
|
|
},
|
|
// 获取成员
|
|
getpersnoal() {
|
|
getCurrentUser(this.valueopenid).then(res => {
|
|
this.familyList = res.data
|
|
})
|
|
},
|
|
// 切换成员
|
|
changeFamilyInfo(e) {
|
|
switchResident(this.valueopenid, e.patientCode).then(res => {
|
|
if (res.code == 200) {
|
|
this.$refs.uToast.show({
|
|
title: '切换成功',
|
|
type: 'success',
|
|
duration: '1000',
|
|
})
|
|
uni.setStorageSync('userinfo', res.data);
|
|
uni.setStorageSync('patientId', res.data.id);
|
|
this.myInfo()
|
|
} else {
|
|
this.$refs.uToast.show({
|
|
title: res.msg,
|
|
type: 'error',
|
|
duration: '1000',
|
|
})
|
|
}
|
|
})
|
|
this.showhome = false
|
|
},
|
|
removes() {
|
|
this.appPersonallist = null
|
|
uni.removeStorageSync('patientId');
|
|
uni.removeStorageSync('openid');
|
|
uni.removeStorageSync('phone');
|
|
uni.removeStorageSync('userinfo');
|
|
uni.removeStorageSync('token');
|
|
},
|
|
//获取个人信息
|
|
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 => {
|
|
uni.setStorageSync('userinfo', Response.data);
|
|
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: `/pagesB/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();
|
|
}
|
|
},
|
|
// 服务评价
|
|
evaluation() {
|
|
uni.navigateTo({
|
|
url: '/pagesB/Serviceevaluation/Serviceevaluation'
|
|
})
|
|
|
|
},
|
|
// 签约信息
|
|
Signing() {
|
|
uni.navigateTo({
|
|
url: '/pagesB/mysigning/mysigning'
|
|
})
|
|
},
|
|
//去登陆
|
|
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();
|
|
}
|
|
},
|
|
//健康档案
|
|
goHealthrecords() {
|
|
uni.navigateTo({
|
|
url: '/pagesC/Healthrecords/Healthrecords'
|
|
})
|
|
},
|
|
//全部订单
|
|
goorder(index, item) {
|
|
const value = uni.getStorageSync('openid');
|
|
const value2 = uni.getStorageSync('patientId');
|
|
if (value && value2) {
|
|
uni.navigateTo({
|
|
url: `/pagesB/CommodityOrder/CommodityOrder?toindex=${index}&&orderStatus=${item}`
|
|
})
|
|
} else {
|
|
this.gologin();
|
|
}
|
|
},
|
|
//去登陆
|
|
gologin() {
|
|
this.$refs.uToast.show({
|
|
title: '您未登录,请先登录',
|
|
type: 'error',
|
|
url: '/pages/login/login'
|
|
})
|
|
},
|
|
//护理站服务订单
|
|
gonursestation() {
|
|
const value = uni.getStorageSync('openid');
|
|
const value2 = uni.getStorageSync('patientId');
|
|
if (value && value2) {
|
|
uni.navigateTo({
|
|
url: '/pagesB/Nursingstationserviceorder/Nursingstationserviceorder'
|
|
})
|
|
} else {
|
|
this.gologin();
|
|
}
|
|
},
|
|
//行为积分
|
|
goBehaviorpoints() {
|
|
uni.navigateTo({
|
|
url: '/pagesB/Behaviorpoints/Behaviorpoints'
|
|
})
|
|
},
|
|
// 切换家庭成员
|
|
homeshow() {
|
|
// this.getSetting()
|
|
// this.listquery.bindingCity = uni.getStorageSync('userinfo').bindingCity
|
|
var patientCode = this.userinfo.patientCode
|
|
var openid = uni.getStorageSync('openid')
|
|
// getFamilyList(openid, patientCode).then(res => {
|
|
// this.familyList = res.data
|
|
// console.log(this.familyList, '000')
|
|
// })
|
|
this.showhome = true
|
|
},
|
|
//管理家庭成员
|
|
gomanagefamily() {
|
|
uni.navigateTo({
|
|
url: '/pagesB/managefamily/managefamily'
|
|
})
|
|
},
|
|
// 添加家庭成员
|
|
addFamilyItem() {
|
|
uni.navigateTo({
|
|
url: '/pagesB/AddMembers/AddMembers'
|
|
})
|
|
// 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'
|
|
// });
|
|
// }
|
|
},
|
|
//积分页面
|
|
...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();
|
|
}
|
|
},
|
|
// 专家咨询订单
|
|
expertOrder() {
|
|
// uni.navigateTo({
|
|
// url: "/pagesB/ExpertlookOrder/ExpertlookOrder"
|
|
// })
|
|
uni.navigateTo({
|
|
url: "/pagesmeeting/calling"
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
@import './myinformation.scss'
|
|
</style>
|