普兆健康管家前端代码仓库
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.

313 lines
7.3 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="page__view">
  3. <image class="bg" src="@/pages_order/static/center/bg.png" mode="widthFix"></image>
  4. <view class="main">
  5. <navbar bgColor="transparent" >
  6. <image class="nav-icon" src="@/pages_order/static/center/icon-nav.png" mode="widthFix"></image>
  7. </navbar>
  8. <view class="content">
  9. <view class="flex user">
  10. <!-- 用户信息 -->
  11. <template v-if="isLogin">
  12. <view class="user-avatar">
  13. <image class="user-avatar-img" src="@/pages_order/static/report/avatar.png" mode="scaleToFill"></image>
  14. </view>
  15. <view class="user-info">
  16. <view class="user-info-name">战斗世界</view>
  17. <view class="user-info-desc">世界这么美身体要健康</view>
  18. </view>
  19. </template>
  20. <template v-else>
  21. <view class="user-avatar is-default">
  22. <image class="user-avatar-img" src="@/pages_order/static/center/avatar-default.png" mode="scaleToFill"></image>
  23. </view>
  24. <view class="user-info">
  25. <view class="user-info-tips">暂未登录 请先登录</view>
  26. </view>
  27. </template>
  28. </view>
  29. <!-- 体检报告 -->
  30. <report-card></report-card>
  31. <!-- 订单信息 -->
  32. <template v-if="isLogin">
  33. <order-card></order-card>
  34. </template>
  35. <!-- 微信公众号 -->
  36. <account-card></account-card>
  37. <!-- 用户菜单 -->
  38. <template v-if="isLogin">
  39. <view class="card">
  40. <view v-for="item in list1" :key="item.id">
  41. <template v-if="item.key === 'service'">
  42. <button plain class="flex btn-service" open-type="contact">
  43. <view class="flex row">
  44. <view class="flex label">
  45. <image class="icon" :src="item.icon" mode="scaleToFill"></image>
  46. <view>{{ item.label }}</view>
  47. </view>
  48. <uv-icon name="arrow-right" color="#C6C6C6" size="24rpx"></uv-icon>
  49. </view>
  50. </button>
  51. </template>
  52. <view v-else class="flex row" @click="onClick(item)">
  53. <view class="flex label">
  54. <image class="icon" :src="item.icon" mode="scaleToFill"></image>
  55. <view>{{ item.label }}</view>
  56. </view>
  57. <uv-icon name="arrow-right" color="#C6C6C6" size="24rpx"></uv-icon>
  58. </view>
  59. </view>
  60. </view>
  61. <view class="card">
  62. <view v-for="item in list2" :key="item.id">
  63. <view class="flex row" @click="onClick(item)">
  64. <view class="flex label">
  65. <image class="icon" :src="item.icon" mode="scaleToFill"></image>
  66. <view>{{ item.label }}</view>
  67. </view>
  68. <uv-icon name="arrow-right" color="#C6C6C6" size="24rpx"></uv-icon>
  69. </view>
  70. </view>
  71. </view>
  72. </template>
  73. <!-- 用户登陆 -->
  74. <template v-else>
  75. <view class="login">
  76. <button class="btn" @click="$utils.toLogin">立即登录</button>
  77. <view class="tips">暂未登录 请先登录</view>
  78. </view>
  79. </template>
  80. </view>
  81. <tabber select="center" />
  82. </view>
  83. </view>
  84. </template>
  85. <script>
  86. import { mapState } from 'vuex'
  87. import tabber from '@/components/base/tabbar.vue'
  88. import reportCard from '@/pages_order/center/reportCard.vue'
  89. import orderCard from '@/pages_order/center/orderCard.vue'
  90. import accountCard from '@/pages_order/center/accountCard.vue'
  91. export default {
  92. components: {
  93. reportCard,
  94. orderCard,
  95. accountCard,
  96. tabber,
  97. },
  98. data() {
  99. return {
  100. list1: [
  101. { id: '001', label: '检测预约', icon: '/pages_order/static/center/icon-detectBook.png', path: '/pages_order/checkup/checkupRecords' },
  102. { id: '002', label: '联系客服', icon: '/pages_order/static/center/icon-service.png', key: 'service' },
  103. // todo: check key
  104. { id: '003', label: '服用说明', icon: '/pages_order/static/center/icon-instruc.png', path: `/pages_order/common?key=instruc&title=服用说明` },
  105. // todo: check key
  106. { id: '004', label: '用户须知', icon: '/pages_order/static/center/icon-userAgreement.png', path: `/pages_order/common?key=userAgreement&title=用户须知` },
  107. ],
  108. list2: [
  109. { id: '005', label: '我的评价', icon: '/pages_order/static/center/icon-comment.png', key: 'comment' },
  110. // todo: check key
  111. { id: '006', label: '关于我们', icon: '/pages_order/static/center/icon-aboutUs.png', path: `/pages_order/common?key=aboutUs&title=关于我们` },
  112. { id: '007', label: '修改信息', icon: '/pages_order/static/center/icon-modifyInfo.png', path: `/pages_order/auth/wxUserInfo?mode=edit` },
  113. { id: '008', label: '退出登录', icon: '/pages_order/static/center/icon-logout.png', key: 'logout' },
  114. ],
  115. }
  116. },
  117. computed: {
  118. ...mapState(['userInfo']),
  119. isLogin() {
  120. return this.userInfo && this.userInfo.id
  121. }
  122. },
  123. methods: {
  124. onClick(target) {
  125. const { key, path } = target
  126. switch(key) {
  127. case 'comment':
  128. this.$utils.navigateTo(`/pages_order/comment/commentRecords?creator=${this.userInfo.id}`)
  129. break
  130. case 'logout':
  131. this.$store.commit('logout')
  132. break
  133. default:
  134. path && this.$utils.navigateTo(path)
  135. break
  136. }
  137. },
  138. },
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. .page__view {
  143. width: 100vw;
  144. min-height: 100vh;
  145. background-color: $uni-bg-color;
  146. position: relative;
  147. /deep/ .nav-bar__view {
  148. position: fixed;
  149. top: 0;
  150. left: 0;
  151. }
  152. .nav-icon {
  153. width: 200rpx;
  154. height: auto;
  155. vertical-align: top;
  156. }
  157. }
  158. .bg {
  159. width: 100vw;
  160. height: auto;
  161. }
  162. .main {
  163. position: absolute;
  164. top: 176rpx;
  165. left: 0;
  166. width: 100%;
  167. }
  168. .content {
  169. width: 100%;
  170. padding: 16rpx 32rpx 80rpx 32rpx;
  171. box-sizing: border-box;
  172. }
  173. .user {
  174. column-gap: 24rpx;
  175. &-avatar {
  176. flex: none;
  177. width: 100rpx;
  178. height: 100rpx;
  179. border: 4rpx solid #FFFFFF;
  180. border-radius: 50%;
  181. overflow: hidden;
  182. &.is-default {
  183. width: 108rpx;
  184. height: 108rpx;
  185. border: none;
  186. }
  187. &-img {
  188. width: 100%;
  189. height: 100%;
  190. }
  191. }
  192. &-info {
  193. flex: 1;
  194. &-name {
  195. font-family: PingFang SC;
  196. font-weight: 600;
  197. font-size: 36rpx;
  198. line-height: 1.2;
  199. color: #FFFFFF;
  200. }
  201. &-desc {
  202. margin-top: 8rpx;
  203. font-family: PingFang SC;
  204. font-weight: 400;
  205. font-size: 24rpx;
  206. line-height: 1.5;
  207. color: #F4F4F4;
  208. }
  209. &-tips {
  210. font-family: PingFang SC;
  211. font-weight: 400;
  212. font-size: 36rpx;
  213. line-height: 1.2;
  214. color: #FFFFFF;
  215. }
  216. }
  217. }
  218. .card {
  219. margin-top: 32rpx;
  220. width: 100%;
  221. background: #FAFAFF;
  222. border: 2rpx solid #FFFFFF;
  223. border-radius: 32rpx;
  224. box-sizing: border-box;
  225. .row {
  226. justify-content: space-between;
  227. width: 100%;
  228. padding: 40rpx;
  229. box-sizing: border-box;
  230. .label {
  231. font-family: PingFang SC;
  232. font-weight: 400;
  233. font-size: 28rpx;
  234. line-height: 1;
  235. color: #252545;
  236. .icon {
  237. margin-right: 16rpx;
  238. width: 40rpx;
  239. height: 40rpx;
  240. }
  241. }
  242. }
  243. }
  244. .btn-service {
  245. border: none;
  246. padding: 0;
  247. }
  248. .login {
  249. margin-top: 307rpx;
  250. padding: 0 128rpx;
  251. .btn {
  252. padding: 16rpx 0;
  253. font-family: PingFang SC;
  254. font-weight: 500;
  255. font-size: 36rpx;
  256. line-height: 1.4;
  257. color: #FFFFFF;
  258. background-image: linear-gradient(to right, #4B348F, #845CFA);
  259. border-radius: 41rpx;
  260. }
  261. .tips {
  262. margin-top: 16rpx;
  263. text-align: center;
  264. font-family: PingFang SC;
  265. font-weight: 400;
  266. font-size: 26rpx;
  267. line-height: 1.4;
  268. color: #A3A3A3;
  269. }
  270. }
  271. </style>