康巴易测肤/伤疤uniapp小程序类
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

302 lines
7.2KB

  1. <template>
  2. <view class="records">
  3. <view class="main">
  4. <view class="steps">
  5. <view class="step-content">
  6. <view class="step-banner" v-if="userInfo">
  7. <view class="right">
  8. <u-avatar :src="avatarSrc" size="60" @click="onUpdateInfo"></u-avatar>
  9. </view>
  10. <view class="left">
  11. <view class="date">
  12. {{ now || '--' }}
  13. </view>
  14. <view class="info">
  15. <view class="tag">{{ calculateAge(userInfo.date) || '--' }}岁</view>
  16. <view class="tag">{{ userInfo.gender || '--' }}</view>
  17. </view>
  18. </view>
  19. </view>
  20. <view class="add-user" v-else>
  21. <u-icon name="plus-people-fill" :color="themeColor" size="40"></u-icon>
  22. <view class="btn-box">
  23. <u-button @click="onAddUser()" shape="circle" color="#000" type="info" size="large">
  24. <text :style="{ color: themeColor, fontSize: '32rpx', fontWeight: 'bold', }">添加用户</text>
  25. </u-button>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. <view class="skin-evaluation-container">
  31. <view class="list" v-if="evaluations.length > 0">
  32. <view v-for="(item, index) in evaluations" :key="index" class="evaluation-item" @click="onResult(item)">
  33. <view class="date-time">
  34. <view class="left">
  35. <text>{{ item.date }}</text>
  36. <text>{{ item.time }}</text>
  37. <text>{{ item.day }}</text>
  38. </view>
  39. <view class="right">
  40. <text>{{ item.year }}</text>
  41. </view>
  42. </view>
  43. <view class="image-text">
  44. <u--image :src="item.imageSrc" mode="widthFix"
  45. :customStyle="{ marginLeft: '20rpx', marginRight: '20rpx' }" shape="circle" width="50px" height="50px"
  46. @click="onPre"></u--image>
  47. <view class="right">
  48. <text class="evaluation-text gray">测肤评价</text>
  49. <text class="evaluation-text">{{ item.evaluation }}</text>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="no-data" v-else>
  55. <u-empty mode="history" height="220" width="220" icon="https://telpo-healthy.oss-cn-hangzhou.aliyuncs.com/healthy/diary/202503/ca3b689e7f074ff8bc61a0764710b393.png">
  56. </u-empty>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. export default {
  64. data() {
  65. return {
  66. imgList: [
  67. { src: '' },
  68. { src: '' },
  69. ],
  70. evaluations: [
  71. /* {
  72. date: '03月11日',
  73. time: '12:20',
  74. day: '星期二',
  75. year: '2025',
  76. imageSrc: 'path/to/image1.jpg',
  77. evaluation: '伤口减小,肉芽无增生,皮肤逐渐变浅'
  78. },
  79. {
  80. date: '03月09日',
  81. time: '19:07',
  82. day: '星期日',
  83. year: '2025',
  84. imageSrc: 'path/to/image2.jpg',
  85. evaluation: '伤口减小,肉芽无增生,皮肤逐渐变浅'
  86. }, */
  87. ]
  88. }
  89. },
  90. computed: {
  91. themeColor() {
  92. return this.$themeColor
  93. },
  94. avatarSrc() {
  95. return this.$store.state.user.userInfo.avatarSrc || require('../../static/tabbar/user_default.png')
  96. },
  97. userInfo() {
  98. return this.$store.state.user.userInfo
  99. },
  100. now() {
  101. return this.$util.formateDate('yyy-mm-dd', new Date())
  102. }
  103. },
  104. onLoad() {
  105. this.initDat();
  106. },
  107. methods: {
  108. initDat() {
  109. uni.showLoading({
  110. title: '数据加载中',
  111. mask: true,
  112. })
  113. setTimeout(() => {
  114. uni.showToast({ title: '加载成功', icon: 'success' });
  115. this.evaluations = this.$store.state.user.resultList || []
  116. }, 1500);
  117. },
  118. calculateAge(date) {
  119. return this.$util.calculateAge(date)
  120. },
  121. onAddUser() {
  122. uni.reLaunch({
  123. url: '/pages/user/info',
  124. })
  125. },
  126. onResult(item){
  127. uni.reLaunch({ url: '/pages/details/result' })
  128. },
  129. onUpdateInfo() {
  130. uni.reLaunch({
  131. url: `/pages/user/info?action=update`,
  132. })
  133. }
  134. }
  135. }
  136. </script>
  137. <style lang="scss">
  138. .records {
  139. height: 100vh;
  140. width: 100vw;
  141. overflow: hidden;
  142. .main {
  143. position: relative;
  144. background: #fff;
  145. .steps {
  146. padding: 24rpx 32rpx;
  147. background: $cus-theme-color;
  148. .step-content {
  149. background: #fff;
  150. border-radius: 20rpx;
  151. padding: 30rpx;
  152. .step-banner {
  153. display: flex;
  154. justify-content: flex-start;
  155. align-items: center;
  156. .left {
  157. margin-left: 40rpx;
  158. .date {
  159. color: #282828;
  160. font-weight: bold;
  161. font-size: 24rpx;
  162. }
  163. .info {
  164. margin-top: 20rpx;
  165. display: flex;
  166. justify-content: space-around;
  167. align-items: center;
  168. .tag {
  169. width: 100rpx;
  170. height: 20rpx;
  171. padding: 10rpx 0;
  172. margin-right: 20rpx;
  173. border-radius: 20rpx;
  174. background-color: $cus-theme-color;
  175. color: #fff;
  176. display: flex;
  177. justify-content: center;
  178. align-items: center;
  179. font-size: 28rpx;
  180. }
  181. }
  182. }
  183. .right {
  184. display: flex;
  185. justify-content: flex-start;
  186. align-items: center;
  187. text {
  188. margin-left: 10rpx;
  189. color: $cus-theme-color
  190. }
  191. }
  192. }
  193. .add-user {
  194. display: flex;
  195. justify-content: flex-start;
  196. align-items: center;
  197. .btn-box {
  198. margin-left: 20rpx;
  199. width: 220rpx;
  200. }
  201. }
  202. }
  203. }
  204. .skin-evaluation-container {
  205. overflow: scroll;
  206. padding: 20rpx;
  207. max-height: calc(100vh - 120px);
  208. }
  209. .evaluation-item {
  210. padding: 20rpx;
  211. display: flex;
  212. flex-direction: column;
  213. align-items: flex-start;
  214. .date-time {
  215. width: 100%;
  216. display: flex;
  217. justify-content: space-between;
  218. align-items: center;
  219. .left,
  220. .right {
  221. text {
  222. padding-left: 10rpx;
  223. font-weight: bold;
  224. font-size: 24rpx;
  225. }
  226. }
  227. }
  228. .image-text {
  229. width: 100%;
  230. margin: 20rpx 0;
  231. padding: 40rpx 0;
  232. padding-right: 20rpx;
  233. display: flex;
  234. align-items: center;
  235. border: 2rpx solid $cus-theme-color;
  236. border-radius: 30rpx;
  237. .skin-image {
  238. width: 60px;
  239. height: 60px;
  240. border-radius: 50%;
  241. margin-right: 10px;
  242. }
  243. .right {
  244. display: flex;
  245. justify-content: flex-start;
  246. align-items: flex-start;
  247. flex-direction: column;
  248. .evaluation-text {
  249. font-size: 16px;
  250. color: #333;
  251. padding: 10rpx 0;
  252. font-weight: bold;
  253. &.gray {
  254. font-weight: 400;
  255. color: $uni-text-color-grey;
  256. }
  257. }
  258. }
  259. }
  260. }
  261. }
  262. }
  263. </style>