康巴易测肤/伤疤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.

296 line
7.1KB

  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"></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. }
  130. }
  131. </script>
  132. <style lang="scss">
  133. .records {
  134. height: 100vh;
  135. width: 100vw;
  136. overflow: hidden;
  137. .main {
  138. position: relative;
  139. background: #fff;
  140. .steps {
  141. padding: 24rpx 32rpx;
  142. background: $cus-theme-color;
  143. .step-content {
  144. background: #fff;
  145. border-radius: 20rpx;
  146. padding: 30rpx;
  147. .step-banner {
  148. display: flex;
  149. justify-content: flex-start;
  150. align-items: center;
  151. .left {
  152. margin-left: 40rpx;
  153. .date {
  154. color: #282828;
  155. font-weight: bold;
  156. font-size: 24rpx;
  157. }
  158. .info {
  159. margin-top: 20rpx;
  160. display: flex;
  161. justify-content: space-around;
  162. align-items: center;
  163. .tag {
  164. width: 100rpx;
  165. height: 20rpx;
  166. padding: 10rpx 0;
  167. margin-right: 20rpx;
  168. border-radius: 20rpx;
  169. background-color: $cus-theme-color;
  170. color: #fff;
  171. display: flex;
  172. justify-content: center;
  173. align-items: center;
  174. font-size: 28rpx;
  175. }
  176. }
  177. }
  178. .right {
  179. display: flex;
  180. justify-content: flex-start;
  181. align-items: center;
  182. text {
  183. margin-left: 10rpx;
  184. color: $cus-theme-color
  185. }
  186. }
  187. }
  188. .add-user {
  189. display: flex;
  190. justify-content: flex-start;
  191. align-items: center;
  192. .btn-box {
  193. margin-left: 20rpx;
  194. width: 220rpx;
  195. }
  196. }
  197. }
  198. }
  199. .skin-evaluation-container {
  200. overflow: scroll;
  201. padding: 20rpx;
  202. max-height: calc(100vh - 120px);
  203. }
  204. .evaluation-item {
  205. padding: 20rpx;
  206. display: flex;
  207. flex-direction: column;
  208. align-items: flex-start;
  209. .date-time {
  210. width: 100%;
  211. display: flex;
  212. justify-content: space-between;
  213. align-items: center;
  214. .left,
  215. .right {
  216. text {
  217. padding-left: 10rpx;
  218. font-weight: bold;
  219. font-size: 24rpx;
  220. }
  221. }
  222. }
  223. .image-text {
  224. width: 100%;
  225. margin: 20rpx 0;
  226. padding: 40rpx 0;
  227. display: flex;
  228. align-items: center;
  229. border: 2rpx solid $cus-theme-color;
  230. border-radius: 30rpx;
  231. .skin-image {
  232. width: 60px;
  233. height: 60px;
  234. border-radius: 50%;
  235. margin-right: 10px;
  236. }
  237. .right {
  238. display: flex;
  239. justify-content: flex-start;
  240. align-items: flex-start;
  241. flex-direction: column;
  242. .evaluation-text {
  243. font-size: 16px;
  244. color: #333;
  245. padding: 10rpx 0;
  246. font-weight: bold;
  247. &.gray {
  248. font-weight: 400;
  249. color: $uni-text-color-grey;
  250. }
  251. }
  252. }
  253. }
  254. }
  255. }
  256. }
  257. </style>