OctopusGraph.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. <template>
  2. <view class="family-relationship-wrapper">
  3. <!-- ===== 重要关系维护 ===== -->
  4. <view class="contact-section" v-if="isLoggedIn">
  5. <view class="contact-header">
  6. <text class="contact-section-title">重要关系</text>
  7. <view class="contact-header-right">
  8. <text class="contact-more" @click="$emit('refresh')">刷新</text>
  9. <text class="contact-import-btn" @click="$emit('import')">+ 导入</text>
  10. <text class="contact-manage-btn" @click="$emit('manage')">⚙️</text>
  11. </view>
  12. </view>
  13. <scroll-view class="contact-scroll" scroll-x enable-flex>
  14. <view class="contact-scroll-inner">
  15. <view class="contact-card-wrap" v-for="item in contactList" :key="item.id" @click="$emit('contactClick', item)">
  16. <ContactCard :contact="item" />
  17. </view>
  18. <view class="contact-card-wrap contact-add-card" @click="$emit('import')">
  19. <view class="add-card-inner">
  20. <text class="add-card-icon">+</text>
  21. <text class="add-card-label">导入通讯录</text>
  22. </view>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. <view class="contact-empty" v-if="contactList.length === 0">
  27. <text class="contact-empty-text">暂无重要联系人,点击导入添加</text>
  28. </view>
  29. </view>
  30. <!-- ===== 关系健康概览 ===== -->
  31. <view class="rq-section" v-if="isLoggedIn && healthAlerts.length > 0">
  32. <view class="rq-header">
  33. <text class="rq-title">关系健康</text>
  34. <text class="rq-more" @click="$emit('questionnaire')">去做问卷</text>
  35. </view>
  36. <!-- 健康预警列表 -->
  37. <view class="rq-alerts" v-if="healthAlerts.length > 0">
  38. <view class="rq-alert-card" v-for="alert in healthAlerts" :key="alert.memberId" @click="$emit('interactionLog', alert.memberId)">
  39. <view class="rq-alert-icon">
  40. <text class="rq-alert-emoji">⚠️</text>
  41. </view>
  42. <view class="rq-alert-info">
  43. <text class="rq-alert-name">{{ alert.memberName }}</text>
  44. <text class="rq-alert-desc">已{{ alert.daysSinceInteraction }}天无互动</text>
  45. </view>
  46. <view class="rq-alert-action">
  47. <text class="rq-alert-btn">去互动</text>
  48. </view>
  49. </view>
  50. </view>
  51. <!-- 快捷操作 -->
  52. <view class="rq-quick-actions">
  53. <view class="rq-action-btn" @click="$emit('interactionLog')">
  54. <text class="rq-action-icon">📝</text>
  55. <text class="rq-action-label">记录互动</text>
  56. </view>
  57. <view class="rq-action-btn" @click="$emit('questionnaire')">
  58. <text class="rq-action-icon">🤝</text>
  59. <text class="rq-action-label">做关系问卷</text>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </template>
  65. <script>
  66. export default {
  67. props: {
  68. contactList: { type: Array, default: function() { return [] } },
  69. healthAlerts: { type: Array, default: function() { return [] } },
  70. isLoggedIn: { type: Boolean, default: false }
  71. }
  72. }
  73. </script>
  74. <style scoped>
  75. /* ===== 重要关系 ===== */
  76. .contact-section {
  77. margin: 20rpx 20rpx 0;
  78. }
  79. .contact-header {
  80. display: flex;
  81. justify-content: space-between;
  82. align-items: center;
  83. margin-bottom: 16rpx;
  84. }
  85. .contact-section-title {
  86. font-size: 30rpx;
  87. font-weight: 600;
  88. color: #333;
  89. }
  90. .contact-header-right {
  91. display: flex;
  92. gap: 16rpx;
  93. align-items: center;
  94. }
  95. .contact-more {
  96. font-size: 24rpx;
  97. color: #999;
  98. }
  99. .contact-import-btn {
  100. font-size: 24rpx;
  101. color: #F97316;
  102. font-weight: 500;
  103. }
  104. .contact-manage-btn {
  105. font-size: 30rpx;
  106. color: #999;
  107. padding: 4rpx;
  108. }
  109. .contact-scroll {
  110. white-space: nowrap;
  111. overflow: hidden;
  112. }
  113. .contact-scroll-inner {
  114. display: flex;
  115. flex-direction: row;
  116. gap: 16rpx;
  117. padding: 8rpx 0 16rpx;
  118. }
  119. .contact-card-wrap {
  120. flex-shrink: 0;
  121. width: 220rpx;
  122. }
  123. .contact-card-wrap:active {
  124. opacity: 0.8;
  125. }
  126. .contact-add-card {
  127. width: 160rpx;
  128. }
  129. .add-card-inner {
  130. width: 160rpx;
  131. height: 280rpx;
  132. background: #fff;
  133. border-radius: 16rpx;
  134. border: 2rpx dashed #ddd;
  135. display: flex;
  136. flex-direction: column;
  137. align-items: center;
  138. justify-content: center;
  139. gap: 12rpx;
  140. }
  141. .add-card-icon {
  142. font-size: 48rpx;
  143. color: #ccc;
  144. }
  145. .add-card-label {
  146. font-size: 22rpx;
  147. color: #999;
  148. }
  149. .contact-empty {
  150. padding: 40rpx 0;
  151. text-align: center;
  152. }
  153. .contact-empty-text {
  154. font-size: 26rpx;
  155. color: #ccc;
  156. }
  157. /* ===== 关系健康概览 ===== */
  158. .rq-section {
  159. margin: 20rpx 20rpx 0;
  160. }
  161. .rq-header {
  162. display: flex;
  163. justify-content: space-between;
  164. align-items: center;
  165. margin-bottom: 16rpx;
  166. }
  167. .rq-title {
  168. font-size: 30rpx;
  169. font-weight: 600;
  170. color: #333;
  171. }
  172. .rq-more {
  173. font-size: 24rpx;
  174. color: #F97316;
  175. font-weight: 500;
  176. }
  177. /* 健康预警卡片 */
  178. .rq-alerts {
  179. display: flex;
  180. flex-direction: column;
  181. gap: 12rpx;
  182. margin-bottom: 16rpx;
  183. }
  184. .rq-alert-card {
  185. background: #FFF7ED;
  186. border-radius: 16rpx;
  187. padding: 20rpx;
  188. display: flex;
  189. align-items: center;
  190. gap: 16rpx;
  191. border: 1rpx solid #FED7AA;
  192. }
  193. .rq-alert-card:active {
  194. opacity: 0.8;
  195. }
  196. .rq-alert-icon {
  197. width: 64rpx;
  198. height: 64rpx;
  199. border-radius: 50%;
  200. background: #fff;
  201. display: flex;
  202. align-items: center;
  203. justify-content: center;
  204. flex-shrink: 0;
  205. }
  206. .rq-alert-emoji {
  207. font-size: 32rpx;
  208. }
  209. .rq-alert-info {
  210. flex: 1;
  211. display: flex;
  212. flex-direction: column;
  213. gap: 4rpx;
  214. }
  215. .rq-alert-name {
  216. font-size: 28rpx;
  217. font-weight: 600;
  218. color: #333;
  219. }
  220. .rq-alert-desc {
  221. font-size: 24rpx;
  222. color: #F97316;
  223. }
  224. .rq-alert-action {
  225. flex-shrink: 0;
  226. }
  227. .rq-alert-btn {
  228. font-size: 24rpx;
  229. color: #fff;
  230. background: #F97316;
  231. padding: 8rpx 20rpx;
  232. border-radius: 20rpx;
  233. }
  234. /* 快捷操作 */
  235. .rq-quick-actions {
  236. display: flex;
  237. gap: 16rpx;
  238. margin-top: 8rpx;
  239. }
  240. .rq-action-btn {
  241. flex: 1;
  242. background: #fff;
  243. border-radius: 16rpx;
  244. padding: 20rpx;
  245. display: flex;
  246. align-items: center;
  247. justify-content: center;
  248. gap: 10rpx;
  249. box-shadow: 0 2rpx 12rpx rgba(0,0,0,0.06);
  250. }
  251. .rq-action-btn:active {
  252. opacity: 0.8;
  253. }
  254. .rq-action-icon {
  255. font-size: 36rpx;
  256. }
  257. .rq-action-label {
  258. font-size: 26rpx;
  259. color: #333;
  260. font-weight: 500;
  261. }
  262. </style>