123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393 |
- <template>
- <view class="content">
- <view class="inner">
- <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption"
- :up="upOption">
- <u-swipe-action>
- <view class="form-swipe mb20" v-for="(item,index) in dataList" :key="index">
- <u-swipe-action-item :options="options" @click="cancel(item,index)" :name="index"
- :ref="'swipeAction' + index">
- <view class="item" @click="showDetail(item)">
- <view class="user-info">
- <view class="user-top">
- <view class="user-left">
- <image :src="item.avatar==null?maleurl:item.avatar" class="w112 h112"></image>
- <view class="ml32">
- <view class="name">{{item.username!==null?item.username:'微信用户'}}</view>
- <view class="age-box" :style="{'background-color':item.sex==0?'#EBF8FF':'#FCF0E7'}">
- <u-icon :color="item.sex==0?'#008FD3':'#FF5030'" :name="item.sex==0?'man':'woman'"></u-icon>
- <view class="age">{{utils.getAge(item.birthdate)}}岁</view>
- </view>
- </view>
-
- </view>
- <view class="user-phone">{{utils.parsePhone(item.phone)}}</view>
- </view>
- <view class="user-bottom">
- <view class="btn" @click.stop="toBuy(item)">购买信息</view>
- <view class="btn" @click.stop="toUser(item)">基本信息</view>
- <view class="btn" @click.stop="toDoc(item)">健康档案</view>
- </view>
- </view>
- </view>
- </u-swipe-action-item>
- </view>
- </u-swipe-action>
- <view class="h150"></view>
- </mescroll-body>
- <!-- <view v-if="docs.length == 0" class="no-data-box" @click="getMyDocList()">
- <image src="https://user.test.ylrztop.com/images/empty_icon.png" mode="aspectFit"></image>
- <view class="empty-title">暂无数据</view>
- </view> -->
-
- </view>
- <view class="btn-box">
- <view class="sub-btn" @click="addDoc">
- <image src="/static/images/health/nav_add_icon24.png" class="w48 h48"></image>
- <text>创建用户信息</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {getInfoList,deleteInfo} from '@/api/health.js'
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- famaleurl:"/static/images/health/female_profile.png",
- maleurl:"/static/images/health/my_heads.png",
- dataList:[
- // {userName:'西航宇',sex:1,birthday:'1990-01-01',phone:'16666666666'},
- // {userName:'蓝西',sex:2,birthday:'1990-06-01',phone:'1888888888'},
- // {userName:'西航宇',sex:1,birthday:'1993-01-01',phone:'16666666666'},
- // {userName:'蓝西',sex:2,birthday:'1994-06-01',phone:'1888888888'},
- // {userName:'蓝西',sex:2,birthday:'1994-06-01',phone:'1888888888'}
- ],
- options: [{
- text: '删除',
- style: {
- backgroundColor: '#FF5030'
- }
- }],
- mescroll: null,
- // 上拉加载的配置
- upOption: {
- onScroll: true,
- use: true, // 是否启用上拉加载; 默认true
- page: {
- num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
- size: 10 // 每页数据的数量,默认10
- },
- noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
- empty: {
- icon: 'https://user.test.ylrztop.com/images/empty_icon.png',
- tip: '暂无数据'
- }
- },
- }
- },
- onLoad(options) {
- this.companyId=options.companyId;
- this.companyUserId=options.companyUserId;
- uni.$on('refreshDoc', () => {
- this.mescroll.resetUpScroll()
- // this.getMyDocList()
- })
- },
- methods: {
- navgetTo(url){
- uni.navigateTo({
- url: url
- })
- },
-
-
-
- toBuy(item){
- uni.navigateTo({
- url: '/pages_company/buyOrder?userId='+item.userId+'&companyUserId='+this.companyUserId
- })
- },
- toUser(item){
- uni.navigateTo({
- url: '/pages_company/addUser?type=edit&userId='+item.userId+'&companyUserId='+this.companyUserId
- })
- },
- toDoc(item){
- uni.navigateTo({
- url: '/pages_company/addDoc?userId='+item.userId+'&companyUserId='+this.companyUserId
- })
- },
- showDetail(item){
- uni.navigateTo({
- url: '/pages_company/clientDetail?userId='+item.userId+"&companyUserId="+this.companyUserId
- })
- },
- editDoc(item){
- uni.navigateTo({
- url: './addDoc?type=edit&docId='+item.docId
- })
- },
- cancel(item, index) {
- var that = this;
- let test = 'swipeAction' + index
- uni.showModal({
- title: '提示',
- content: '确定删除用户信息吗',
- success: function(res) {
- if (res.confirm) {
- var data = {
- userId:item.userId
- };
- deleteInfo(data).then(res => {
- if (res.code == 200) {
- uni.showToast({
- icon: 'success',
- title: '操作成功',
- });
- that.$refs[test][0].closeHandler()
- that.mescroll.resetUpScroll()
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg,
- });
- }
- });
- } else if (res.cancel) {
- that.$refs[test][0].closeHandler()
- }
- }
- });
- },
- mescrollInit(mescroll) {
- this.mescroll = mescroll;
- },
- /*下拉刷新的回调 */
- downCallback(mescroll) {
- mescroll.resetUpScroll()
- },
- upCallback(page) {
- //联网加载数据
- var that = this;
- var data = {
- // companyUserId:this.companyUserId,
- pageNum: page.num,
- pageSize: page.size
- };
- getInfoList(data).then(res => {
- if (res.code == 200) {
- //设置列表数据
- if (page.num == 1) {
- that.dataList = res.data.list;
-
- } else {
- that.dataList = that.dataList.concat(res.data.list);
-
- }
- that.mescroll.endBySize(res.data.list.length, res.data.total);
-
- } else {
- uni.showToast({
- icon: 'none',
- title: "请求失败",
- });
- that.dataList = null;
- that.mescroll.endErr();
- }
- });
- },
- addDoc() {
- uni.navigateTo({
- url: '/pages_company/addUser?type=add&companyId='+this.companyId+"&companyUserId="+this.companyUserId
- })
- }
-
- }
- }
- </script>
- <style lang="scss">
- page{
- height: 100%;
- }
- .content{
- height: 100%;
- display: flex;
- // flex-direction: column;
- // justify-content: space-between;
- .inner{
- flex: 1;
- padding: 20upx 20upx 160upx;
- .item{
- background: #FFFFFF;
- border-radius: 20upx;
- margin-bottom: 20upx;
- // padding: 40upx 30upx;
- padding: 32rpx;
- &:last-child{
- margin-bottom: 0;
- }
- .user-info{
- .user-top{
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- border-bottom: 1px solid #ECECEC;
- padding-bottom: 40rpx;
- .user-left{
- display: flex;
- align-items: center;
- justify-content: flex-start;
- image{
- border-radius: 50%;
- }
- .name{
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 36rpx;
- color: #222426;
- text-align: left;
- }
- .age-box{
- display: flex;
- align-items: center;
- justify-content: center;
- border-radius: 24rpx 24rpx 24rpx 24rpx;
- margin-top: 16rpx;
- width: 114rpx;
- height: 40rpx;
- .age{
- font-weight: 400;
- font-size: 22rpx;
- color: #626468;
- line-height: 22rpx;
- text-align: left;
- }
- }
-
- }
- .user-phone{
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 28rpx;
- color: #222426;
- text-align: right;
- }
- }
- .user-bottom{
- display: flex;
- align-items: center;
- justify-content: flex-end;
- padding-top: 20rpx;
- .btn{
- width: 176rpx;
- height: 60rpx;
- border-radius: 30rpx 30rpx 30rpx 30rpx;
- border: 1rpx solid #B2B2B2;
- font-size: 24rpx;
- color: #222426;
- line-height: 60rpx;
- text-align: center;
- margin-left:16rpx ;
- &:last-child{
- border: 1rpx solid #008FD3;
- color: #008FD3;
- }
- }
-
- }
- .gray-tag{
- height: 46upx;
- line-height: 46upx;
- padding: 0 16upx;
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- background: #F7F7F7;
- border-radius: 8upx;
- margin-right: 10upx;
- }
- .blue-tag{
- height: 46upx;
- line-height: 46upx;
- padding: 0 16upx;
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #4BC9B1;
- background: #E2F6F2;
- border-radius: 8upx;
- }
- }
- .stage-box{
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- margin-top: 34upx;
- .stage{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #111111;
- line-height: 1;
- }
- .stage-text{
- font-size: 26upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #666666;
- line-height: 1;
- }
- }
- .progress-box{
- margin-top: 18upx;
- }
- .period{
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #999999;
- line-height: 1;
- margin-top: 40upx;
- }
- }
-
- }
- .btn-box{
- z-index: 9999;
- width: 100%;
- padding: 30upx;
- position: fixed;
- bottom: 0;
- left: 0;
- box-sizing: border-box;
- // background: #FFFFFF;
-
-
- .sub-btn{
- width: 100%;
- height: 88upx;
- line-height: 88upx;
- text-align: center;
- font-size: 30upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- background: #008FD3;
- border-radius: 44upx;
- display: flex;
- align-items: center;
- justify-content: center;
- image{
- margin-right: 16rpx;
- }
- }
- }
-
- }
- </style>
|