index1.vue 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <view class="friend-page">
  3. <!-- 顶部导航 -->
  4. <u-navbar title="好友信息" :back-icon="true" bg-color="#fff"></u-navbar>
  5. <!-- 用户信息头部 -->
  6. <view class="user-box">
  7. <view class="avatar">
  8. <image src="https://via.placeholder.com/120" mode="widthFix"></image>
  9. </view>
  10. <view class="info">
  11. <view class="name">
  12. <text>王小明</text>
  13. <u-tag text="AI在线" type="primary" size="mini" plain></u-tag>
  14. </view>
  15. <view class="uid">U405430201</view>
  16. <view class="hospital">
  17. <u-icon name="location" color="#FF6A00" size="28"></u-icon>
  18. <text>御君方互联网医院(张三)</text>
  19. </view>
  20. </view>
  21. </view>
  22. <!-- 功能按钮区 -->
  23. <view class="action-grid">
  24. <view class="action-item" @click="createGroup">
  25. <u-icon name="add" color="#FF9A76" size="36"></u-icon>
  26. <text>创建群聊</text>
  27. </view>
  28. <view class="action-item" @click="setRemark">
  29. <u-icon name="edit" color="#FF9A76" size="36"></u-icon>
  30. <text>设置备注</text>
  31. </view>
  32. <view class="action-item" @click="extendChat">
  33. <u-icon name="chat" color="#FF9A76" size="36"></u-icon>
  34. <text>延长人工对话</text>
  35. </view>
  36. <view class="action-item" @click="pinUser">
  37. <u-icon name="top" color="#FF9A76" size="36"></u-icon>
  38. <text>置顶联系人</text>
  39. </view>
  40. </view>
  41. <!-- 近7天看课记录 -->
  42. <view class="card">
  43. <view class="card-header">
  44. <text class="title">近7天看课记录</text>
  45. <view class="right">
  46. <u-switch v-model="colorBlind" size="mini"></u-switch>
  47. <text class="tips">色盲模式</text>
  48. <text class="more" @click="goMore">更多详情 ></text>
  49. </view>
  50. </view>
  51. <!-- 图例 -->
  52. <view class="legend">
  53. <view class="item"><view class="dot gray"></view><text>未看课</text></view>
  54. <view class="item"><view class="dot blue"></view><text>看课中</text></view>
  55. <view class="item"><view class="dot green"></view><text>完课</text></view>
  56. <view class="item"><view class="dot red"></view><text>待看课</text></view>
  57. <view class="item"><view class="dot yellow"></view><text>看课中断</text></view>
  58. </view>
  59. <!-- 日期状态 -->
  60. <view class="date-list">
  61. <view class="date-item" v-for="(item, idx) in 7" :key="idx">
  62. <text>{{ 15 + idx }}</text>
  63. <view class="circle" :class="recordList[idx]"></view>
  64. </view>
  65. </view>
  66. </view>
  67. <!-- 用户信息卡片 -->
  68. <view class="card">
  69. <view class="card-header">
  70. <text class="title">用户信息</text>
  71. <text class="edit" @click="editInfo">
  72. <u-icon name="edit" size="24" color="#999"></u-icon>
  73. 修改用户信息
  74. </text>
  75. </view>
  76. <view class="info-list">
  77. <view class="info-item" v-for="(item, idx) in infoData" :key="idx">
  78. <text class="label">{{ item.label }}</text>
  79. <text class="value">{{ item.value }}</text>
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. colorBlind: false,
  90. // 状态:gray未看 blue看课中 green完课 red待看 yellow中断
  91. recordList: ['gray', 'gray', 'blue', 'green', 'gray', 'red', 'yellow'],
  92. infoData: [
  93. { label: '姓名', value: '未知' },
  94. { label: '性别', value: '男' },
  95. { label: '年龄', value: '58' },
  96. { label: '行为习惯', value: '无' },
  97. { label: '患病时间', value: '无' },
  98. { label: '疾病', value: '气血不足、失眠健忘' },
  99. { label: '家人的疾病', value: '无' },
  100. { label: '是否线下就诊', value: '否' },
  101. { label: '体质', value: '阴虚体' },
  102. { label: '使用药物', value: '无' },
  103. { label: '咨询产品', value: '无' },
  104. { label: '是否已经购买产品', value: '否' },
  105. ]
  106. }
  107. },
  108. methods: {
  109. createGroup() {},
  110. setRemark() {},
  111. extendChat() {},
  112. pinUser() {},
  113. goMore() {},
  114. editInfo() {}
  115. }
  116. }
  117. </script>
  118. <style scoped>
  119. .friend-page {
  120. background: #f5f6f7;
  121. min-height: 100vh;
  122. }
  123. /* 用户头部 */
  124. .user-box {
  125. display: flex;
  126. padding: 30rpx;
  127. background: #fff;
  128. align-items: center;
  129. margin-bottom: 20rpx;
  130. }
  131. .avatar {
  132. width: 120rpx;
  133. height: 120rpx;
  134. border-radius: 12rpx;
  135. overflow: hidden;
  136. margin-right: 24rpx;
  137. }
  138. .avatar image {
  139. width: 100%;
  140. height: 100%;
  141. }
  142. .info {
  143. flex: 1;
  144. }
  145. .name {
  146. display: flex;
  147. align-items: center;
  148. font-size: 36rpx;
  149. font-weight: bold;
  150. margin-bottom: 12rpx;
  151. }
  152. .name text {
  153. margin-right: 16rpx;
  154. }
  155. .uid {
  156. font-size: 28rpx;
  157. color: #999;
  158. margin-bottom: 12rpx;
  159. }
  160. .hospital {
  161. display: flex;
  162. align-items: center;
  163. color: #ff6a00;
  164. font-size: 28rpx;
  165. }
  166. /* 功能按钮 */
  167. .action-grid {
  168. display: flex;
  169. justify-content: space-around;
  170. background: #fff;
  171. padding: 30rpx 0;
  172. margin-bottom: 20rpx;
  173. }
  174. .action-item {
  175. display: flex;
  176. flex-direction: column;
  177. align-items: center;
  178. font-size: 26rpx;
  179. color: #666;
  180. }
  181. .action-item text {
  182. margin-top: 12rpx;
  183. }
  184. /* 卡片 */
  185. .card {
  186. background: #fff;
  187. border-radius: 16rpx;
  188. padding: 30rpx;
  189. margin: 0 20rpx 20rpx;
  190. }
  191. .card-header {
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: center;
  195. margin-bottom: 24rpx;
  196. }
  197. .title {
  198. font-size: 32rpx;
  199. font-weight: bold;
  200. }
  201. .right {
  202. display: flex;
  203. align-items: center;
  204. }
  205. .tips {
  206. font-size: 24rpx;
  207. color: #999;
  208. margin: 0 16rpx;
  209. }
  210. .more {
  211. font-size: 26rpx;
  212. color: #999;
  213. }
  214. .edit {
  215. font-size: 26rpx;
  216. color: #999;
  217. display: flex;
  218. align-items: center;
  219. }
  220. /* 图例 */
  221. .legend {
  222. display: flex;
  223. flex-wrap: wrap;
  224. gap: 20rpx;
  225. margin-bottom: 30rpx;
  226. }
  227. .item {
  228. display: flex;
  229. align-items: center;
  230. font-size: 24rpx;
  231. color: #666;
  232. }
  233. .dot {
  234. width: 28rpx;
  235. height: 28rpx;
  236. border-radius: 6rpx;
  237. margin-right: 8rpx;
  238. }
  239. .gray { background: #8c8c8c; }
  240. .blue { background: #1890ff; }
  241. .green { background: #52c41a; }
  242. .red { background: #ff4d4f; }
  243. .yellow { background: #ffc107; }
  244. /* 日期状态 */
  245. .date-list {
  246. display: flex;
  247. justify-content: space-between;
  248. }
  249. .date-item {
  250. display: flex;
  251. flex-direction: column;
  252. align-items: center;
  253. font-size: 28rpx;
  254. color: #666;
  255. }
  256. .circle {
  257. width: 40rpx;
  258. height: 40rpx;
  259. border-radius: 50%;
  260. margin-top: 16rpx;
  261. }
  262. /* 用户信息列表 */
  263. .info-list {
  264. border-top: 1rpx solid #f0f0f0;
  265. }
  266. .info-item {
  267. display: flex;
  268. justify-content: space-between;
  269. padding: 24rpx 0;
  270. border-bottom: 1rpx solid #f0f0f0;
  271. font-size: 28rpx;
  272. }
  273. .label {
  274. color: #666;
  275. }
  276. .value {
  277. color: #333;
  278. }
  279. </style>