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

229 lines
5.0 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 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. <!-- <uv-cell icon="setting-fill" title="我的预约"
  48. @click="$utils.navigateTo('/pages_order/auth/wxUserInfo')"
  49. isLink>
  50. <template #icon>
  51. <image src="/static/image/center/2.png"
  52. class="uv-cell-icon"></image>
  53. </template>
  54. </uv-cell> -->
  55. <!-- 我的订单 -->
  56. <uv-cell icon="setting-fill" title="我的订单"
  57. @click="$utils.navigateTo('/pages_order/order/order')"
  58. isLink>
  59. <template #icon>
  60. <image src="/static/image/center/3.png"
  61. class="uv-cell-icon"></image>
  62. </template>
  63. </uv-cell>
  64. <!-- 我的地址 -->
  65. <uv-cell icon="setting-fill" title="我的地址"
  66. @click="$utils.navigateTo('/pages_order/mine/address')"
  67. isLink>
  68. <template #icon>
  69. <image src="/static/image/center/1.png"
  70. class="uv-cell-icon"></image>
  71. </template>
  72. </uv-cell>
  73. <!-- 购物车 -->
  74. <uv-cell icon="setting-fill" title="我的购物车"
  75. @click="$utils.navigateTo('/pages_order/mine/cart')"
  76. isLink>
  77. <template #icon>
  78. <image src="/static/image/center/1.png"
  79. class="uv-cell-icon"></image>
  80. </template>
  81. </uv-cell>
  82. <!-- 加入志愿者 -->
  83. <uv-cell icon="setting-fill" title="加入志愿者"
  84. isLink @click="$utils.navigateTo('/pages_order/mine/volunteer')">
  85. <template #icon>
  86. <image src="/static/image/center/4.png"
  87. class="uv-cell-icon"></image>
  88. </template>
  89. </uv-cell>
  90. <!-- 退出登录 -->
  91. <uv-cell icon="setting-fill" title="退出登录"
  92. isLink @click="$store.commit('logout')">
  93. <template #icon>
  94. <image src="/static/image/center/4.png"
  95. class="uv-cell-icon"></image>
  96. </template>
  97. </uv-cell>
  98. </uv-cell-group>
  99. </view>
  100. <tabber select="2" />
  101. </view>
  102. </template>
  103. <script>
  104. import { mapState } from 'vuex'
  105. export default {
  106. computed: {
  107. ...mapState(['userInfo']),
  108. isLogin() {
  109. return this.userInfo && this.userInfo.id
  110. }
  111. },
  112. data() {
  113. return {
  114. show: false,
  115. }
  116. },
  117. onShow() {
  118. if(uni.getStorageSync('token')){
  119. this.$store.commit('getUserInfo')
  120. }
  121. },
  122. methods: {
  123. toLogin() {
  124. this.$utils.navigateTo('/pages_order/auth/wxLogin')
  125. }
  126. }
  127. }
  128. </script>
  129. <style scoped lang="scss">
  130. .page {
  131. .line{
  132. margin: 30rpx;
  133. background-color: #fff;
  134. border-radius: 30rpx;
  135. overflow: hidden;
  136. box-shadow: 0 0 10rpx 10rpx #00000007;
  137. .uv-cell-icon{
  138. width: 60rpx;
  139. height: 60rpx;
  140. margin-right: 20rpx;
  141. }
  142. /deep/ .uv-cell__body{
  143. padding: 40rpx 30rpx;
  144. }
  145. }
  146. }
  147. image {
  148. width: 100%;
  149. height: 100%;
  150. }
  151. .head {
  152. display: flex;
  153. background-color: $uni-color;
  154. padding: 60rpx 40rpx;
  155. align-items: center;
  156. position: relative;
  157. color: #fff;
  158. .headImage {
  159. width: 120rpx;
  160. height: 120rpx;
  161. background-image: url(/static/image/center/3.png);
  162. background-size: 100% 100%;
  163. overflow: hidden;
  164. border-radius: 50%;
  165. margin-right: 40rpx;
  166. }
  167. .info {
  168. font-size: 28rpx;
  169. .name {
  170. font-size: 32rpx;
  171. margin-bottom: 10rpx;
  172. }
  173. .tips {
  174. font-size: 26rpx;
  175. }
  176. }
  177. .setting {
  178. position: absolute;
  179. right: 50rpx;
  180. top: 50rpx;
  181. }
  182. }
  183. .login-container {
  184. display: flex;
  185. flex-direction: column;
  186. align-items: center;
  187. margin: 60rpx 30rpx;
  188. }
  189. .login-btn {
  190. width: 80%;
  191. height: 80rpx;
  192. line-height: 80rpx;
  193. background-color: $uni-color;
  194. color: #fff;
  195. border-radius: 40rpx;
  196. font-size: 32rpx;
  197. margin-bottom: 20rpx;
  198. }
  199. .login-tips {
  200. font-size: 26rpx;
  201. color: #999;
  202. }
  203. </style>