userCenter.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  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">
  66. <button open-type="contact" type="default" style="background-color: transparent;border-style:none;border:0;" >
  67. <image src="../static/usercenter/service.png" mode="widthFix"></image>
  68. </button>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. export default {
  74. data(){
  75. return{
  76. loginShow:this.$store.state.login
  77. }
  78. },
  79. onLoad() {
  80. this.init()
  81. },
  82. onShow() {
  83. this.init()
  84. },
  85. // watch:{
  86. // "this.$store.state.token": {
  87. // handler(newValue, oldValue) {
  88. // console.log("单个属性监听", newValue, oldValue);
  89. // }
  90. // },
  91. // },
  92. methods: {
  93. init(){
  94. // this.loginShow=this.$store.state.login
  95. let token=uni.getStorageSync("token")
  96. // console.log(token)
  97. if(token){
  98. this.loginShow=true
  99. }
  100. // if(!token){
  101. // }
  102. },
  103. // 登录
  104. gologin(){
  105. uni.navigateTo({
  106. url:"/pages/login"
  107. })
  108. },
  109. // 跳转完善个人信息
  110. goEndit(){
  111. uni.navigateTo({
  112. url:"/pages/userCenter/userEdit"
  113. })
  114. },
  115. // 跳转订单列表
  116. goOrder(){
  117. uni.navigateTo({
  118. url:"/pages/order/order"
  119. })
  120. },
  121. //跳转出行人
  122. goaddpeople(){
  123. uni.navigateTo({
  124. url:"/pages/peopleList/peopleList?id=0"
  125. })
  126. },
  127. // 跳转发票
  128. goinvoice(){
  129. uni.navigateTo({
  130. url:"/pages/userCenter/invoice"
  131. })
  132. },
  133. // 客服
  134. gomes(){
  135. uni.navigateTo({
  136. url:"/pages/customerService"
  137. })
  138. },
  139. // 关于我们
  140. goaboutus(){
  141. uni.navigateTo({
  142. url:"/pages/userCenter/aboutus"
  143. })
  144. },
  145. // 退出登录
  146. signout(){
  147. uni.removeStorageSync('token')
  148. uni.removeStorageSync('code')
  149. uni.removeStorageSync('phone')
  150. this.$store.commit("setToken","")
  151. this.$store.commit('getUserInfo',{})
  152. this.$store.commit('loginState',null)
  153. this.loginShow=this.$store.state.login
  154. },
  155. }
  156. }
  157. </script>
  158. <style lang="less">
  159. page{
  160. background-color: #F4F4F4;
  161. font-size: 32rpx;
  162. font-family: PingFang-SC-Bold, PingFang-SC;
  163. position: relative;
  164. }
  165. .userPage{
  166. height: 100vh;
  167. position: relative;
  168. .userTop{
  169. position: relative;
  170. width: 100%;
  171. box-sizing: border-box;
  172. padding: 50rpx 30rpx 65rpx;
  173. image{
  174. width: 100%;
  175. position: absolute;
  176. left: 0;
  177. top: 0;
  178. z-index: -1;
  179. }
  180. .userTop-content{
  181. display: flex;
  182. align-items: center;
  183. }
  184. .avatar{
  185. width: 172rpx;
  186. height: 172rpx;
  187. border-radius: 50%;
  188. background-color: pink;
  189. margin-right: 30rpx;
  190. }
  191. .login{
  192. text-align: center;
  193. }
  194. .btn{
  195. width: 324rpx;
  196. height: 62rpx;
  197. line-height: 62rpx;
  198. background: #1E9F6A;
  199. border-radius: 8rpx 32rpx 8rpx 32rpx;
  200. color: #FFFFFF;
  201. margin: 40rpx auto;
  202. }
  203. }
  204. .userOrder {
  205. margin: 20rpx 30rpx;
  206. padding: 40rpx 0;
  207. border-radius: 8rpx 56rpx 8rpx 8rpx;
  208. background-color: #ffffff;
  209. display: flex;
  210. font-size: 22rpx;
  211. font-weight: bold;
  212. color: #141328;
  213. text-align: center;
  214. .flex-item{
  215. flex: 1;
  216. }
  217. .line{
  218. width: 1px;
  219. height: 48rpx;
  220. line-height: 48rpx;
  221. background: #141328;
  222. opacity: 0.29;
  223. margin: auto 0;
  224. }
  225. }
  226. .signout{
  227. margin: 46rpx auto 0;
  228. padding: 24rpx 0;
  229. width: 438rpx;
  230. text-align: center;
  231. background: #E6E5E5;
  232. border-radius: 8rpx 56rpx 8rpx 56rpx;
  233. }
  234. .kefuicon{
  235. button::after {
  236. border: none;
  237. }
  238. position: absolute;
  239. right: 30rpx;
  240. bottom: 0;
  241. image{
  242. width: 136rpx;
  243. }
  244. }
  245. }
  246. </style>