xinelu-applet-ui/pagesB/managefamily/managefamily.vue

152 lines
4.0 KiB
Vue
Raw Normal View History

<template>
2023-09-20 12:06:32 +08:00
<view class="app">
<view class="forlist">
2024-03-20 09:54:20 +08:00
<view class="item" @click.stop='gofamilymemberdetail(item)' v-for="item in familyList">
2023-09-20 12:06:32 +08:00
<view class="namesigning">
<span class="name">
2023-10-17 17:26:09 +08:00
{{item.patientName}}
2023-09-20 12:06:32 +08:00
</span>
<view class="signing">
2024-03-20 09:54:20 +08:00
{{!item.signNo ?"未签约":'已签约'}}
2023-09-20 12:06:32 +08:00
</view>
</view>
2024-03-20 11:34:50 +08:00
<view class="primaryAccountFlag" v-if="Number(item.primaryAccountFlag)==0">
主账号
2024-03-20 09:54:20 +08:00
</view>
2023-09-20 12:06:32 +08:00
<view class="card">
2023-10-17 17:26:09 +08:00
{{item.cardNo}}
2023-09-20 12:06:32 +08:00
</view>
<view class="border"></view>
2023-10-30 14:56:03 +08:00
<view class="identityname" v-if="item.householdRelationship">
2023-10-17 17:26:09 +08:00
{{item.householdRelationship=='1'?"户主本人":''}}
{{item.householdRelationship=='2'?"配偶":''}}
{{item.householdRelationship=='3'?"子女":''}}
{{item.householdRelationship=='4'?"(外)孙子女":''}}
{{item.householdRelationship=='5'?"父母":''}}
{{item.householdRelationship=='6'?"(外)祖父母":''}}
{{item.householdRelationship=='7'?"兄弟姐妹":''}}
{{item.householdRelationship=='8'?"儿媳":''}}
{{item.householdRelationship=='9'?"女婿":''}}
{{item.householdRelationship=='10'?"孙子女":''}}
{{item.householdRelationship=='11'?"侄子女":''}}
{{item.householdRelationship=='12'?"曾孙子女":''}}
{{item.householdRelationship=='13'?"祖父母":''}}
{{item.householdRelationship=='99'?"其他":''}}
2023-09-20 12:06:32 +08:00
</view>
2024-03-20 09:54:20 +08:00
<view class="button" @click.stop="updata(item)" v-if='Number(item.primaryAccountFlag)!=0'>
设置为主账号
</view>
2023-09-20 12:06:32 +08:00
</view>
</view>
<view class="bottom">
<view class="text">
每位微信用户最多可以绑定8名家庭成员
</view>
2023-10-13 15:34:14 +08:00
<view class="btn" @tap="add">
2023-09-20 12:06:32 +08:00
添加家庭成员
</view>
</view>
2024-03-20 11:34:50 +08:00
<u-popup v-model="updatashow" mode="center" width="80%" height="400rpx" class="popup" closeable>
<view class="title">
提示
</view>
<view class="text">是否确认设置该用户为主账号?</view>
<view class="text" style="color: red;">
30天内只能设置一次
</view>
<view class="btns">
<view class="btn" @click="updatashow=false">
取消
</view>
<view class="btn" @click="updataconfirm" style="background-color: #26A888;color: #fff;">
确定
</view>
</view>
</u-popup>
2024-03-20 09:54:20 +08:00
<u-toast ref="uToast" />
</view>
</template>
<script>
2023-10-17 17:26:09 +08:00
import {
getCurrentUser,
2024-03-20 09:54:20 +08:00
editPrimaryAccountFlag
2023-10-17 17:26:09 +08:00
} from '@/api/pages/myinformation/myinformation.js';
export default {
data() {
return {
2024-03-20 09:54:20 +08:00
familyList: {},
updatashow: false,
updataitem: {},
};
2023-09-20 13:52:08 +08:00
},
2024-03-20 09:54:20 +08:00
onShow() {
2023-10-17 17:26:09 +08:00
this.getpersnoal()
},
2023-09-25 11:04:44 +08:00
methods: {
2024-03-20 09:54:20 +08:00
updata(item) {
this.updataitem = item
this.updatashow = true
},
updataconfirm() {
var obj = {
cardNo: this.updataitem.cardNo,
bindOpenId: uni.getStorageSync('openid'),
}
editPrimaryAccountFlag(obj).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '设置主账号成功',
type: 'success',
})
this.getpersnoal()
} else {
this.$refs.uToast.show({
title: res.msg,
type: 'error',
})
}
2024-03-20 11:34:50 +08:00
this.updatashow = false
2024-03-20 09:54:20 +08:00
})
},
2023-10-17 17:26:09 +08:00
// 获取成员
2024-03-20 09:54:20 +08:00
getpersnoal() {
getCurrentUser(uni.getStorageSync('openid')).then(res => {
2023-10-17 17:26:09 +08:00
this.familyList = res.data
})
},
2023-10-13 15:34:14 +08:00
// 添加家庭成员
2024-03-20 09:54:20 +08:00
add() {
2023-10-13 15:34:14 +08:00
uni.navigateTo({
2024-03-20 09:54:20 +08:00
url: '/pagesB/AddMembers/AddMembers'
2023-10-13 15:34:14 +08:00
})
},
2023-10-18 10:56:01 +08:00
gofamilymemberdetail(item) {
2023-09-25 11:04:44 +08:00
uni.navigateTo({
2023-10-18 10:56:01 +08:00
url: `/pagesB/familymemberdetail/familymemberdetail?patientCode=${item.patientCode}`
2023-09-25 11:04:44 +08:00
})
}
},
2023-10-30 14:56:03 +08:00
// onReachBottom() { //下滑加载
// if (this.couponlist.length >= this.total) {} else {
// this.pageNum++;
// selectCoupon(this.pageNum, this.pageSize, this.patientId, this.couponstatus).then(res => {
// res.rows.forEach(e => {
// this.couponlist.push(e)
// })
// })
// }
// },
2023-09-20 13:52:08 +08:00
onPullDownRefresh() { //下拉刷新
this.pageNum = 1;
this.getlist();
setTimeout(function() {
uni.stopPullDownRefresh();
}, 1000);
},
}
</script>
<style lang="scss">
2023-09-20 12:09:09 +08:00
@import './managefamily.scss';
2024-03-20 09:54:20 +08:00
</style>