userCenter.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. <template>
  2. <view class="userPage">
  3. <view class="userTop">
  4. <image src="../static/usercenter/bg.png" mode="widthFix"></image>
  5. <view class="userTop-content" v-if="loginShow">
  6. <view class="avatar" @click="goEndit">
  7. </view>
  8. <view class="userinfo">
  9. <view class="">
  10. 去远方Y
  11. </view>
  12. <view class="phonenumber">
  13. 15296189206
  14. </view>
  15. </view>
  16. </view>
  17. <view class="login" v-if="!loginShow">
  18. <view class="">
  19. 登录日月峡森林康养旅行
  20. </view>
  21. <view class="btn" @click="gologin">
  22. 去登录
  23. </view>
  24. </view>
  25. </view>
  26. <view class="userOrder">
  27. <view class="flex-item" @click="goOrder">
  28. <image mode="widthFix" src="../static/usercenter/Tobepaid.png" style="width: 45%;margin-bottom: 5px;"></image>
  29. <view>待付款</view>
  30. </view>
  31. <view class="line">
  32. </view>
  33. <view class="flex-item" @click="goOrder">
  34. <image mode="widthFix" src="../static/usercenter/Aftersales.png" style="width: 45%;margin-bottom: 5px;"></image>
  35. <view>已付款</view>
  36. </view>
  37. <view class="line">
  38. </view>
  39. <view class="flex-item" @click="goOrder">
  40. <image mode="widthFix" src="../static/usercenter/Tobepaid1.png" style="width: 45%;margin-bottom: 5px;"></image>
  41. <view>已完成</view>
  42. </view>
  43. <view class="line">
  44. </view>
  45. <view class="flex-item " @click="goOrder">
  46. <image mode="widthFix" src="../static/usercenter/all.png" style="width: 45%;margin-bottom: 5px;"></image>
  47. <view>全部订单</view>
  48. </view>
  49. </view>
  50. <view class="" style="background-color: #FFFFFF; margin: 0 30rpx;border-radius: 8rpx;">
  51. <u-cell-group :border="false" >
  52. <u-cell title="出行人" isLink size="large" :border="false" @click="goaddpeople"></u-cell>
  53. <u-cell title="发票" isLink size="large" :border="false" @click="goinvoice"></u-cell>
  54. </u-cell-group>
  55. </view>
  56. <view class="" style="background-color: #FFFFFF; margin: 20rpx 30rpx;border-radius: 8rpx 8rpx 8rpx 56rpx;">
  57. <u-cell-group :border="false">
  58. <u-cell title="客服" size="large" isLink :border="false" @click="gomes"></u-cell>
  59. <u-cell title="关于日月峡" size="large" isLink :border="false" @click="goaboutus"></u-cell>
  60. </u-cell-group>
  61. </view>
  62. <view class="signout" @click="signout" v-if="loginShow">
  63. 退出登录
  64. </view>
  65. <view class="kefuicon" @click="gomes">
  66. <image src="../static/usercenter/service.png" mode="widthFix"></image>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data(){
  73. return{
  74. loginShow:this.$store.state.login
  75. }
  76. },
  77. onLoad() {
  78. this.init()
  79. },
  80. onShow() {
  81. this.init()
  82. },
  83. // watch:{
  84. // "this.$store.state.token": {
  85. // handler(newValue, oldValue) {
  86. // console.log("单个属性监听", newValue, oldValue);
  87. // }
  88. // },
  89. // },
  90. methods: {
  91. init(){
  92. // this.loginShow=this.$store.state.login
  93. let token=uni.getStorageSync("token")
  94. // console.log(token)
  95. if(token){
  96. this.loginShow=true
  97. }
  98. // if(!token){
  99. // }
  100. },
  101. // 登录
  102. gologin(){
  103. uni.navigateTo({
  104. url:"/pages/login"
  105. })
  106. },
  107. // 跳转完善个人信息
  108. goEndit(){
  109. uni.navigateTo({
  110. url:"/pages/userCenter/userEdit"
  111. })
  112. },
  113. // 跳转订单列表
  114. goOrder(){
  115. uni.navigateTo({
  116. url:"/pages/order/order"
  117. })
  118. },
  119. //跳转出行人
  120. goaddpeople(){
  121. uni.navigateTo({
  122. url:"/pages/peopleList/peopleList?id=0"
  123. })
  124. },
  125. // 跳转发票
  126. goinvoice(){
  127. uni.navigateTo({
  128. url:"/pages/userCenter/invoice"
  129. })
  130. },
  131. // 客服
  132. gomes(){
  133. uni.navigateTo({
  134. url:"/pages/customerService"
  135. })
  136. },
  137. // 关于我们
  138. goaboutus(){
  139. uni.navigateTo({
  140. url:"/pages/userCenter/aboutus"
  141. })
  142. },
  143. // 退出登录
  144. signout(){
  145. uni.removeStorageSync('token')
  146. uni.removeStorageSync('code')
  147. uni.removeStorageSync('phone')
  148. this.$store.commit("setToken","")
  149. this.$store.commit('getUserInfo',{})
  150. this.$store.commit('loginState',null)
  151. this.loginShow=this.$store.state.login
  152. },
  153. }
  154. }
  155. </script>
  156. <style lang="less">
  157. page{
  158. background-color: #F4F4F4;
  159. font-size: 32rpx;
  160. font-family: PingFang-SC-Bold, PingFang-SC;
  161. position: relative;
  162. }
  163. .userPage{
  164. height: 100vh;
  165. position: relative;
  166. .userTop{
  167. position: relative;
  168. width: 100%;
  169. box-sizing: border-box;
  170. padding: 50rpx 30rpx 65rpx;
  171. image{
  172. width: 100%;
  173. position: absolute;
  174. left: 0;
  175. top: 0;
  176. z-index: -1;
  177. }
  178. .userTop-content{
  179. display: flex;
  180. align-items: center;
  181. }
  182. .avatar{
  183. width: 172rpx;
  184. height: 172rpx;
  185. border-radius: 50%;
  186. background-color: pink;
  187. margin-right: 30rpx;
  188. }
  189. .login{
  190. text-align: center;
  191. }
  192. .btn{
  193. width: 324rpx;
  194. height: 62rpx;
  195. line-height: 62rpx;
  196. background: #1E9F6A;
  197. border-radius: 8rpx 32rpx 8rpx 32rpx;
  198. color: #FFFFFF;
  199. margin: 40rpx auto;
  200. }
  201. }
  202. .userOrder {
  203. margin: 20rpx 30rpx;
  204. padding: 40rpx 0;
  205. border-radius: 8rpx 56rpx 8rpx 8rpx;
  206. background-color: #ffffff;
  207. display: flex;
  208. font-size: 22rpx;
  209. font-weight: bold;
  210. color: #141328;
  211. text-align: center;
  212. .flex-item{
  213. flex: 1;
  214. }
  215. .line{
  216. width: 1px;
  217. height: 48rpx;
  218. line-height: 48rpx;
  219. background: #141328;
  220. opacity: 0.29;
  221. margin: auto 0;
  222. }
  223. }
  224. .signout{
  225. margin: 46rpx auto 0;
  226. padding: 24rpx 0;
  227. width: 438rpx;
  228. text-align: center;
  229. background: #E6E5E5;
  230. border-radius: 8rpx 56rpx 8rpx 56rpx;
  231. }
  232. .kefuicon{
  233. position: absolute;
  234. right: 30rpx;
  235. bottom: 0;
  236. image{
  237. width: 136rpx;
  238. }
  239. }
  240. }
  241. </style>