景徳镇旅游微信小程序
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.

219 lines
4.7 KiB

8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
  1. <template>
  2. <view class="page">
  3. <navbar title="个人中心" />
  4. <view class="head">
  5. <view class="headImage">
  6. <image :src="userInfo.headImage || '/static/image/center/default_avatar.png'" mode="aspectFill"></image>
  7. </view>
  8. <view class="info">
  9. <view class="name">
  10. {{ userInfo.nickName || '未登录用户'}}
  11. </view>
  12. <view class="tips"
  13. v-if="userInfo.createTime">
  14. 加入时间{{ $dayjs(userInfo.createTime).format('YYYY-MM-DD') }}
  15. </view>
  16. </view>
  17. <view class="setting">
  18. <!-- <uv-icon name="setting" size="40rpx"></uv-icon> -->
  19. </view>
  20. </view>
  21. <!-- 未登录状态显示登录按钮 -->
  22. <view v-if="!isLogin" class="login-container">
  23. <button class="login-btn" @click="toLogin">立即登录</button>
  24. <view class="login-tips">登录后查看更多功能</view>
  25. </view>
  26. <!-- 已登录状态显示菜单 -->
  27. <view class="line" v-if="isLogin">
  28. <uv-cell-group>
  29. <!-- 我的收藏 -->
  30. <uv-cell icon="setting-fill" title="我的收藏"
  31. @click="$utils.navigateTo('/pages_order/mine/collect')"
  32. isLink>
  33. <template #icon>
  34. <image src="/static/image/center/1.png"
  35. class="uv-cell-icon"></image>
  36. </template>
  37. </uv-cell>
  38. <!-- 我的预约 -->
  39. <uv-cell icon="setting-fill" title="我的预约"
  40. @click="$utils.navigateTo('/pages_order/mine/subscribe')"
  41. isLink>
  42. <template #icon>
  43. <image src="/static/image/center/2.png"
  44. class="uv-cell-icon"></image>
  45. </template>
  46. </uv-cell>
  47. <!-- 我的订单 -->
  48. <uv-cell icon="setting-fill" title="我的订单"
  49. @click="$utils.navigateTo('/pages_order/order/order')"
  50. isLink>
  51. <template #icon>
  52. <image src="/static/image/center/3.png"
  53. class="uv-cell-icon"></image>
  54. </template>
  55. </uv-cell>
  56. <!-- 我的地址 -->
  57. <uv-cell icon="setting-fill" title="我的地址"
  58. @click="$utils.navigateTo('/pages_order/mine/address')"
  59. isLink>
  60. <template #icon>
  61. <image src="/static/image/center/1.png"
  62. class="uv-cell-icon"></image>
  63. </template>
  64. </uv-cell>
  65. <!-- 购物车 -->
  66. <uv-cell icon="setting-fill" title="我的购物车"
  67. @click="$utils.navigateTo('/pages_order/mine/cart')"
  68. isLink>
  69. <template #icon>
  70. <image src="/static/image/center/1.png"
  71. class="uv-cell-icon"></image>
  72. </template>
  73. </uv-cell>
  74. <!-- 加入志愿者 -->
  75. <uv-cell icon="setting-fill" title="加入志愿者"
  76. isLink @click="$utils.navigateTo('/pages_order/mine/volunteer')">
  77. <template #icon>
  78. <image src="/static/image/center/4.png"
  79. class="uv-cell-icon"></image>
  80. </template>
  81. </uv-cell>
  82. <!-- 退出登录 -->
  83. <uv-cell icon="setting-fill" title="退出登录"
  84. isLink @click="$store.commit('logout')">
  85. <template #icon>
  86. <image src="/static/image/center/4.png"
  87. class="uv-cell-icon"></image>
  88. </template>
  89. </uv-cell>
  90. </uv-cell-group>
  91. </view>
  92. <tabber select="2" />
  93. </view>
  94. </template>
  95. <script>
  96. import { mapState } from 'vuex'
  97. export default {
  98. computed: {
  99. ...mapState(['userInfo']),
  100. isLogin() {
  101. return this.userInfo && this.userInfo.id
  102. }
  103. },
  104. data() {
  105. return {
  106. show: false,
  107. }
  108. },
  109. onShow() {
  110. if(uni.getStorageSync('token')){
  111. this.$store.commit('getUserInfo')
  112. }
  113. },
  114. methods: {
  115. toLogin() {
  116. this.$utils.navigateTo('/pages_order/auth/wxLogin')
  117. }
  118. }
  119. }
  120. </script>
  121. <style scoped lang="scss">
  122. .page {
  123. .line{
  124. margin: 30rpx;
  125. background-color: #fff;
  126. border-radius: 30rpx;
  127. overflow: hidden;
  128. box-shadow: 0 0 10rpx 10rpx #00000007;
  129. .uv-cell-icon{
  130. width: 60rpx;
  131. height: 60rpx;
  132. margin-right: 20rpx;
  133. }
  134. /deep/ .uv-cell__body{
  135. padding: 40rpx 30rpx;
  136. }
  137. }
  138. }
  139. image {
  140. width: 100%;
  141. height: 100%;
  142. }
  143. .head {
  144. display: flex;
  145. background-color: $uni-color;
  146. padding: 60rpx 40rpx;
  147. align-items: center;
  148. position: relative;
  149. color: #fff;
  150. .headImage {
  151. width: 120rpx;
  152. height: 120rpx;
  153. background-image: url(/static/image/center/3.png);
  154. background-size: 100% 100%;
  155. overflow: hidden;
  156. border-radius: 50%;
  157. margin-right: 40rpx;
  158. }
  159. .info {
  160. font-size: 28rpx;
  161. .name {
  162. font-size: 32rpx;
  163. margin-bottom: 10rpx;
  164. }
  165. .tips {
  166. font-size: 26rpx;
  167. }
  168. }
  169. .setting {
  170. position: absolute;
  171. right: 50rpx;
  172. top: 50rpx;
  173. }
  174. }
  175. .login-container {
  176. display: flex;
  177. flex-direction: column;
  178. align-items: center;
  179. margin: 60rpx 30rpx;
  180. }
  181. .login-btn {
  182. width: 80%;
  183. height: 80rpx;
  184. line-height: 80rpx;
  185. background-color: $uni-color;
  186. color: #fff;
  187. border-radius: 40rpx;
  188. font-size: 32rpx;
  189. margin-bottom: 20rpx;
  190. }
  191. .login-tips {
  192. font-size: 26rpx;
  193. color: #999;
  194. }
  195. </style>