index.vue
6.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!--
* @Date: 2022-09-29 16:32:03
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-10-21 18:18:46
* @FilePath: /swx/src/pages/userInfo/index.vue
* @Description: 用户资料
-->
<template>
<view class="user-info-page">
<view class="bg-header">
<view style="height: 4rem; padding: 1rem;">
<van-row>
<van-col span="17">
<view style="position: relative;">
<van-image :round="true" width="4rem" height="4rem" :src="avatar" />
<view style="display: inline-block; position: absolute; top: 30%; left: 30%;">
<text style="font-size: 1.15rem;">{{ name }}</text>
<!-- <van-icon :name="icon_vip" size="1rem" color="" class="vip-icon" /> -->
</view>
</view>
</van-col>
<van-col span="7">
<view @tap="editInfo()" style="background-color: #DABE73; color: white; padding: 0.5rem 0; border-radius: 1rem; text-align: center; font-size: 0.9rem;margin-top: 1rem;">修改资料</view>
</van-col>
</van-row>
</view>
<view style="background-color: white; margin: 1rem; padding: 1rem; border-radius: 1rem;">
<view class="header-info">
<view class="activity">
<view><text style="font-size: 1.25rem;">{{ reg_count }}</text>次</view>
<view>
<van-icon :name="icon_join" size="1.5rem" color="" style="vertical-align: sub;" />
<text style="font-size: 0.9rem; color: #999999;">参加活动</text>
</view>
</view>
<view class="job">
<text style="font-size: 1.25rem;">{{ age_group }}</text>
<view>
<text style="font-size: 0.9rem; color: #999999;">年龄</text>
</view>
</view>
<view class="sign">
<view><text style="font-size: 1.25rem;">{{ gender }}</text></view>
<view>
<text style="font-size: 0.9rem; color: #999999;">性别</text>
</view>
</view>
</view>
</view>
</view>
<view class="list-wrapper" style="margin: 1rem;">
<view style="background-color: white; border-radius: 0.65rem; padding: 1rem;overflow: auto; margin-bottom: 1px;">
<view style="display: inline-block; margin-right: 1rem; line-height: 60rpx;">
<view class="bg-gradient" style="font-size: 1.15rem;">陪伴记录</view>
</view>
<view @tap="show_status_popup=true" style="float: right; color: #FFFFFF; font-size: 0.9rem; border-radius: 1rem; padding: 0.3rem 1rem 0.3rem 1rem; background-color: #199A74;">
{{ status_type === '' ? '全部' : status_type }}
<van-icon :name="icon_sel3" size="0.8rem" color="" style="vertical-align: middle;" />
</view>
<view style="float: right; margin-top: 0.25rem;">
陪伴者:
</view>
</view>
<view>
<view style="background-color: white; padding: 1rem; border-radius: 1rem; margin-bottom: 1rem;">
<view style="overflow: auto;">
<view style="float: left; font-size: 1.15rem;">
<text style="color: #999999;">状态:</text><text style="color: #199A74;">跟进</text>
</view>
<view style="float: right; margin-top: 0.2rem; font-size: 0.9rem; color: #222222;">
净弘 2022-08-11 14:22
</view>
</view>
<view style="margin-top: 1rem;">
对比上次净妙这次参与活动明显的能够融入进去了,与其他学员间的交流也比较多了,期待越来越好!
</view>
</view>
<view style="background-color: white; padding: 1rem; border-radius: 1rem; margin-bottom: 1rem;">
<view style="overflow: auto;">
<view style="float: left; font-size: 1.15rem;">
<text style="color: #999999;">状态:</text><text style="color: #199A74;">跟进</text>
</view>
<view style="float: right; margin-top: 0.2rem; font-size: 0.9rem; color: #222222;">
净弘 2022-08-11 14:22
</view>
</view>
<view style="margin-top: 1rem;">
对比上次净妙这次参与活动明显的能够融入进去了,与其他学员间的交流也比较多了,期待越来越好!
</view>
</view>
</view>
</view>
<view style="height: 2rem;"></view>
<bottom-button @on-submit="onSubmit">添加记录</bottom-button>
</view>
<!-- 切换状态弹出框 -->
<van-popup :show="show_status_popup" position="bottom" custom-style="height: 40%;" :lock-scroll="true">
<van-picker :show-toolbar="true" title="" confirm-button-text="确定" :columns="status_type_columns"
toolbar-class="picker-toolbar" @confirm="onStatusTypeConfirm" @cancel="onStatusTypeCancel" @change="onStatusTypeChange" />
</van-popup>
</template>
<script setup>
import { ref } from "vue";
import icon_vip from '@/images/icon/vip@2x.png'
import Taro from '@tarojs/taro'
import { AtAvatar } from 'taro-ui-vue3'
import "taro-ui-vue3/dist/style/components/avatar.scss"
import icon_join from '@/images/icon/baoming@2x.png'
import icon_sel3 from '@/images/icon/sel03@2x.png'
import bottomButton from "@/components/bottom-button";
const show_status_popup = ref(false);
const status_type = ref('');
const status_type_columns = ref(['净弘']);
const onStatusTypeChange = (event) => {
const { picker, value, index } = event.detail;
}
const onStatusTypeConfirm = (event) => {
const { picker, value, index } = event.detail;
show_status_popup.value = false;
status_type.value = value;
console.warn('查询新数据');
}
const onStatusTypeCancel = (event) => {
show_status_popup.value = false;
}
const editInfo = (val) => {
Taro.navigateTo({
url: '../editInfo/index'
})
}
const onSubmit = (val) => {
Taro.navigateTo({
url: '../addRecord/index'
})
}
</script>
<script>
import "./index.less";
import { infoMemberAPI } from '@/api/Member/index';
import { getCurrentPageParam } from "@/utils/weapp";
export default {
name: "userInfoPage",
data () {
return {
avatar: '',
name: '',
reg_count: '',
age_group: '',
gender: '',
}
},
async onShow () {
const { code, data } = await infoMemberAPI({ i: getCurrentPageParam().member_id });
if (code) {
this.name = data.member.name;
this.avatar = data.member.avatar ? data.member.avatar : 'https://jdc.jd.com/img/200';
this.reg_count = data.reg_count;
this.age_group = data.member.age_group;
this.gender = data.member.gender === 'man' ? '男士' : '女士';
}
}
};
</script>