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

318 lines
7.4 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 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. onLoad() {
  124. if(uni.getStorageSync('token')){
  125. this.$store.commit('getUserInfo')
  126. }
  127. },
  128. methods: {
  129. onClick(target) {
  130. const { key, path } = target
  131. switch(key) {
  132. case 'comment':
  133. this.$utils.navigateTo(`/pages_order/comment/commentRecords?creator=${this.userInfo.id}`)
  134. break
  135. case 'logout':
  136. this.$store.commit('logout')
  137. break
  138. default:
  139. path && this.$utils.navigateTo(path)
  140. break
  141. }
  142. },
  143. },
  144. }
  145. </script>
  146. <style scoped lang="scss">
  147. .page__view {
  148. width: 100vw;
  149. min-height: 100vh;
  150. background-color: $uni-bg-color;
  151. position: relative;
  152. /deep/ .nav-bar__view {
  153. position: fixed;
  154. top: 0;
  155. left: 0;
  156. }
  157. .nav-icon {
  158. width: 200rpx;
  159. height: auto;
  160. vertical-align: top;
  161. }
  162. }
  163. .bg {
  164. width: 100vw;
  165. height: auto;
  166. }
  167. .main {
  168. position: absolute;
  169. top: 176rpx;
  170. left: 0;
  171. width: 100%;
  172. }
  173. .content {
  174. width: 100%;
  175. padding: 16rpx 32rpx 80rpx 32rpx;
  176. box-sizing: border-box;
  177. }
  178. .user {
  179. column-gap: 24rpx;
  180. &-avatar {
  181. flex: none;
  182. width: 100rpx;
  183. height: 100rpx;
  184. border: 4rpx solid #FFFFFF;
  185. border-radius: 50%;
  186. overflow: hidden;
  187. &.is-default {
  188. width: 108rpx;
  189. height: 108rpx;
  190. border: none;
  191. }
  192. &-img {
  193. width: 100%;
  194. height: 100%;
  195. }
  196. }
  197. &-info {
  198. flex: 1;
  199. &-name {
  200. font-family: PingFang SC;
  201. font-weight: 600;
  202. font-size: 36rpx;
  203. line-height: 1.2;
  204. color: #FFFFFF;
  205. }
  206. &-desc {
  207. margin-top: 8rpx;
  208. font-family: PingFang SC;
  209. font-weight: 400;
  210. font-size: 24rpx;
  211. line-height: 1.5;
  212. color: #F4F4F4;
  213. }
  214. &-tips {
  215. font-family: PingFang SC;
  216. font-weight: 400;
  217. font-size: 36rpx;
  218. line-height: 1.2;
  219. color: #FFFFFF;
  220. }
  221. }
  222. }
  223. .card {
  224. margin-top: 32rpx;
  225. width: 100%;
  226. background: #FAFAFF;
  227. border: 2rpx solid #FFFFFF;
  228. border-radius: 32rpx;
  229. box-sizing: border-box;
  230. .row {
  231. justify-content: space-between;
  232. width: 100%;
  233. padding: 40rpx;
  234. box-sizing: border-box;
  235. .label {
  236. font-family: PingFang SC;
  237. font-weight: 400;
  238. font-size: 28rpx;
  239. line-height: 1;
  240. color: #252545;
  241. .icon {
  242. margin-right: 16rpx;
  243. width: 40rpx;
  244. height: 40rpx;
  245. }
  246. }
  247. }
  248. }
  249. .btn-service {
  250. border: none;
  251. padding: 0;
  252. }
  253. .login {
  254. margin-top: 307rpx;
  255. padding: 0 128rpx;
  256. .btn {
  257. padding: 16rpx 0;
  258. font-family: PingFang SC;
  259. font-weight: 500;
  260. font-size: 36rpx;
  261. line-height: 1.4;
  262. color: #FFFFFF;
  263. background-image: linear-gradient(to right, #4B348F, #845CFA);
  264. border-radius: 41rpx;
  265. }
  266. .tips {
  267. margin-top: 16rpx;
  268. text-align: center;
  269. font-family: PingFang SC;
  270. font-weight: 400;
  271. font-size: 26rpx;
  272. line-height: 1.4;
  273. color: #A3A3A3;
  274. }
  275. }
  276. </style>