user.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view>
  3. <view class="bg" @click="goNav('/pages/my/userinfo')">
  4. <view>个人信息</view>
  5. <view class="flex align-center">
  6. <view style="font-weight: 500;color: #333333;font-size: 28rpx;margin-right: 20rpx;">去上传</view>
  7. <image src="../../static/images/my/right.png" style="width: 16rpx;height: 25rpx;"></image>
  8. </view>
  9. </view>
  10. <view class="bg" @click="goRenZheng">
  11. <view>身份认证</view>
  12. <view class="flex align-center">
  13. <view style="font-weight: 500;color: #333333;font-size: 28rpx;margin-right: 20rpx;">去上传</view>
  14. <image src="../../static/images/my/right.png" style="width: 16rpx;height: 25rpx;"></image>
  15. </view>
  16. </view>
  17. <view class="bg" @click="goNav('/pages/my/userinfo')">
  18. <view>头像/相册</view>
  19. <view class="flex align-center">
  20. <view style="font-weight: 500;color: #333333;font-size: 28rpx;margin-right: 20rpx;">去上传</view>
  21. <image src="../../static/images/my/right.png" style="width: 16rpx;height: 25rpx;"></image>
  22. </view>
  23. </view>
  24. <view class="bg" @click="goRenZheng">
  25. <view>资质信息</view>
  26. <view class="flex align-center">
  27. <view style="font-weight: 500;color: #333333;font-size: 28rpx;margin-right: 20rpx;">去上传</view>
  28. <image src="../../static/images/my/right.png" style="width: 16rpx;height: 25rpx;"></image>
  29. </view>
  30. </view>
  31. <view class="bg" @click="show = true">
  32. <view>出行方式</view>
  33. <view class="flex align-center">
  34. <view style="font-weight: 500;color: #333333;font-size: 28rpx;margin-right: 20rpx;" v-if="tripWay == 0">
  35. 去上传</view>
  36. <view style="font-weight: 500;color: #333333;font-size: 28rpx;margin-right: 20rpx;" v-if="tripWay != 0">
  37. <!-- {{tripWay == 1 ? '公交' ? tripWay == 2 : '出租'}} -->
  38. <text v-if="tripWay == 1">公交</text>
  39. <text v-if="tripWay == 2">出租</text>
  40. <text v-if="tripWay == 3">免费</text>
  41. </view>
  42. <image src="../../static/images/my/right.png" style="width: 16rpx;height: 25rpx;"></image>
  43. </view>
  44. </view>
  45. <u-action-sheet :list="cxList" v-model="show" @click="cxCallback"></u-action-sheet>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. tripWay: 0,
  53. show: false,
  54. renzheng: 0,
  55. cxList: [{
  56. text: '公交',
  57. label: 1
  58. },
  59. {
  60. text: '出租',
  61. label: 2
  62. },
  63. {
  64. text: '免费',
  65. label: 3
  66. }
  67. ]
  68. }
  69. },
  70. onShow() {
  71. this.getUserInfo();
  72. this.getArtificer();
  73. },
  74. methods: {
  75. //获取技师的信息
  76. getArtificer() {
  77. this.$Request.getT("/app/artificer/selectArtificer").then(res => {
  78. if (res.code == 0) {
  79. this.tripWay = res.data.tripWay ? res.data.tripWay : 0;
  80. }
  81. });
  82. },
  83. cxCallback(index) {
  84. console.log(index)
  85. this.setChuXing(index + 1)
  86. },
  87. setChuXing(tripWay) {
  88. this.$queue.showLoading('设置中...')
  89. this.$Request.postT("/app/artificer/updateArtificerTripWay?tripWay=" + tripWay).then(res => {
  90. uni.hideLoading();
  91. if (res.code == 0) {
  92. this.$queue.showToast('设置成功!');
  93. this.getArtificer();
  94. }else{
  95. this.$queue.showToast(res.msg);
  96. }
  97. });
  98. },
  99. goRenZheng() {
  100. if (this.renzheng == 0) {
  101. uni.navigateTo({
  102. url: '/my/renzheng/rzType'
  103. });
  104. } else if (this.renzheng != 0) {
  105. if(this.renzheng == 1){
  106. this.$queue.showToast('实名认证系统审核中,请耐心等待');
  107. }else{
  108. uni.navigateTo({
  109. url: '/my/renzheng/index'
  110. });
  111. }
  112. }
  113. },
  114. getUserInfo() {
  115. this.$Request.get("/app/user/selectUserById").then(res => {
  116. if (res.code == 0) {
  117. if (res.data.isAuthentication == 0 || res.data.isAuthentication == null) {
  118. this.renzheng = 0
  119. uni.setStorageSync("renzheng", this.renzheng)
  120. } else if (res.data.isAuthentication == 1) {
  121. this.renzheng = 1
  122. uni.setStorageSync("renzheng", this.renzheng)
  123. } else if (res.data.isAuthentication == 2) {
  124. this.renzheng = 2
  125. uni.setStorageSync("renzheng", this.renzheng)
  126. } else if (res.data.isAuthentication == 3) {
  127. this.renzheng = 3
  128. uni.setStorageSync("renzheng", this.renzheng)
  129. } else if (res.data.isAuthentication == 4) {
  130. this.renzheng = 4
  131. uni.setStorageSync("renzheng", this.renzheng)
  132. } else if (res.data.isAuthentication == 5) {
  133. this.renzheng = 5
  134. uni.setStorageSync("renzheng", this.renzheng)
  135. } else if (res.data.isAuthentication == 6) {
  136. this.renzheng = 6
  137. uni.setStorageSync("renzheng", this.renzheng)
  138. }
  139. }
  140. });
  141. },
  142. goNav(e) {
  143. uni.navigateTo({
  144. url: e
  145. })
  146. },
  147. }
  148. }
  149. </script>
  150. <style>
  151. page {
  152. background: #F5F5F5;
  153. }
  154. .bg {
  155. background: #FFFFFF;
  156. border-radius: 20rpx;
  157. display: flex;
  158. align-items: center;
  159. justify-content: space-between;
  160. margin: 30rpx;
  161. padding: 40rpx 30rpx;
  162. font-size: 32rpx;
  163. font-weight: bold;
  164. font-family: PingFang SC;
  165. }
  166. </style>