user.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view>
  3. <view class="user-header" v-if="userInfo">
  4. <view class="avatar-btn">
  5. <image :src="userInfo?userInfo.avatar:'https://washmy.oss-cn-guangzhou.aliyuncs.com/storage/20260511/23627b2cb8f73a8a90b95c31d726e6ecad0cbb9a.png'"></image>
  6. </view>
  7. <view class="user-info">
  8. <view class="name">{{userInfo.nickname}}</view>
  9. <!-- <view class="desc">180*******22</view> -->
  10. </view>
  11. </view>
  12. <view class="user-header" v-else>
  13. <view class="avatar-btn">
  14. <image src="https://washmy.oss-cn-guangzhou.aliyuncs.com/storage/20260511/23627b2cb8f73a8a90b95c31d726e6ecad0cbb9a.png"></image>
  15. </view>
  16. <view class="user-info">
  17. <view class="name" @click="toLogin">请先登录</view>
  18. </view>
  19. </view>
  20. <view class="user-menu">
  21. <view class="menu-item">
  22. <view class="icon"><image src="/static/image/yuyue.png"></image></view>
  23. <view class="name">我的预约</view>
  24. <view class="right"><image src="/static/image/right.png"></image></view>
  25. </view>
  26. <view class="menu-item">
  27. <view class="icon"><image src="/static/image/info.png"></image></view>
  28. <view class="name">个人信息</view>
  29. <view class="right"><image src="/static/image/right.png"></image></view>
  30. </view>
  31. <view class="menu-item" @click="$dialog.jumpUri('/pages/user/complaint/complaint')">
  32. <view class="icon"><image src="/static/image/rule-rule.png"></image></view>
  33. <view class="name">我的投诉</view>
  34. <view class="right"><image src="/static/image/right.png"></image></view>
  35. </view>
  36. <view class="menu-item" @click="showService(1)">
  37. <view class="icon"><image src="/static/image/service.png"></image></view>
  38. <view class="name">商家客服</view>
  39. <view class="right"><image src="/static/image/right.png"></image></view>
  40. </view>
  41. <navigator hover-class="none" class="menu-item" url="/pages/user/license">
  42. <view class="icon"><image src="/static/image/zizhi.png"></image></view>
  43. <view class="name">服务资质</view>
  44. <view class="right"><image src="/static/image/right.png"></image></view>
  45. </navigator>
  46. <view class="menu-item" @click="outLogin">
  47. <view class="icon"><image src="/static/image/out.png"></image></view>
  48. <view class="name">退出</view>
  49. <view class="right"><image src="/static/image/right.png"></image></view>
  50. </view>
  51. </view>
  52. <uni-popup ref="maskpopup" type="bottom" border-radius="10px 10px 0 0" background-color="#ffffff" :mask-click="false">
  53. <view class="service-popup">
  54. <view class="top">
  55. <view class="item">客服时间:{{storeData.start_at}}-{{storeData.end_at}}</view>
  56. <view class="item">
  57. <button class="btn" @click="$dialog.jumpUri('/pages/service/chat/chat?poi='+storeData.poi_id+'&source=user',1);showService(2)">在线咨询商家</button>
  58. </view>
  59. <view class="item" v-if="storeData.service_mobile" @click="callMobile(storeData.service_mobile)">商家客服电话</view>
  60. </view>
  61. <view class="foot" @click="showService(2)">取消</view>
  62. </view>
  63. </uni-popup>
  64. </view>
  65. </template>
  66. <script>
  67. var app;
  68. import * as Api from "@/static/api/user.js";
  69. export default {
  70. data() {
  71. return {
  72. userInfo:null,
  73. storeData:{}
  74. }
  75. },
  76. onShow() {
  77. this.getUser()
  78. },
  79. onLoad() {
  80. app = this;
  81. app.storeData = uni.getStorageSync("contact");
  82. },
  83. methods: {
  84. getUser(){
  85. Api.data().then((res)=>{
  86. if (res.code == 0) {
  87. return ;
  88. }
  89. app.userInfo = res.data;
  90. })
  91. },
  92. outLogin(order){
  93. app.$dialog.showError("确定要退出登录吗",function(res){
  94. if (res.confirm) {
  95. app.userInfo = null;
  96. uni.clearStorageSync();
  97. }
  98. })
  99. },
  100. toLogin(){
  101. uni.navigateTo({
  102. url:"/pages/auth/login",
  103. animationType:"slide-in-bottom"
  104. })
  105. },
  106. callMobile(mobile){
  107. uni.makePhoneCall({
  108. phoneNumber:mobile,
  109. success(res) {
  110. console.log(res)
  111. },fail(res) {
  112. console.log(res)
  113. }
  114. })
  115. },
  116. showService(type){
  117. if (type == 1) {
  118. uni.hideTabBar()
  119. app.$refs.maskpopup.open()
  120. } else {
  121. this.$nextTick(() => {
  122. uni.showTabBar()
  123. })
  124. app.$refs.maskpopup.close()
  125. }
  126. }
  127. }
  128. }
  129. </script>
  130. <style>
  131. page{background-color: #f8f8f8;}
  132. .user-header{padding: 40upx;display: flex;align-items: center;background-color: #007aff;}
  133. .user-header image{width: 100upx;height: 100upx;border-radius: 100upx;}
  134. .user-header .user-info{margin-left: 20upx;}
  135. .user-header .name{font-size: 32upx;color: #fff;}
  136. .user-header .desc{font-size: 24upx;color: #f8f8f8;margin-top: 20upx;}
  137. .user-menu{width: 95%;margin: 40upx auto;border-radius: 10upx;background-color: #fff;}
  138. .user-menu .menu-item{height: 100upx;line-height: 100upx;display: flex;align-items: center;font-size: 28upx;color: #333;padding: 0 20upx;border-bottom: 2upx solid #f8f8f8;}
  139. .user-menu .menu-item .icon{margin-right: 20upx;display: flex;align-items: center;justify-content: center;}
  140. .user-menu .menu-item .right{margin-right: 0;margin-left: auto;}
  141. .user-menu .menu-item .icon image{width: 40upx;height: 40upx;}
  142. .user-menu .menu-item .right image{width: 40upx;height: 40upx;}
  143. .service-popup .item{height: 100upx;line-height: 100upx;text-align: center;font-size: 28upx;color: #333;border-bottom: 2upx solid #f8f8f8;}
  144. .service-popup .item .btn{background-color: #fff;border: 0;height: 100upx;line-height: 100upx;text-align: center;font-size: 28upx;color: #333;}
  145. .service-popup .item .btn::after{border: 0;}
  146. .service-popup .foot{height: 100upx;line-height: 100upx;text-align: center;font-size: 28upx;color: #333;border-top: 20upx solid #f8f8f8;}
  147. </style>