yhdl.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="">
  3. <u-navbar :border-bottom="false" back-icon-size="35" title-size="32" :background="background"
  4. :back-text-style="hhyanm" title-color="#374B6E" back-icon-color="#374B6E"></u-navbar>
  5. <view style="margin-top: -80rpx;">
  6. <image src="/static/index/uying.png" style="width: 750rpx;height: 1624rpx;" mode=""></image>
  7. </view>
  8. <view class="fzddrew dltoor">
  9. <view class="dlyhr" hover-class="none" @click="gomy(0)">
  10. <text>我是用户</text>
  11. </view>
  12. <view class="dlyzxs" hover-class="none" v-if="identity == 1" @click="gomy(1)">
  13. <text>我是咨询师</text>
  14. </view>
  15. <view class="dlyzxs" hover-class="none" v-if="identity != 1" @click="toApply(1)">
  16. <text>申请成为咨询师</text>
  17. </view>
  18. <view class="dlyzxs" hover-class="none" v-if="identity == 2" @click="gomy(2)">
  19. <text>我是机构</text>
  20. </view>
  21. <view class="dlyzxs" hover-class="none" v-if="identity != 2" @click="toApply(2)">
  22. <text>申请机构</text>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <style>
  28. page {
  29. background: #374B6E;
  30. }
  31. </style>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. background: {
  37. backgroundColor: '#374B6E',
  38. },
  39. hhyanm: {
  40. color: '#374B6E',
  41. },
  42. userinfo: null,
  43. is_lecturer:false,
  44. identity: 0,
  45. }
  46. },
  47. onLoad() {
  48. console.log(uni.getStorageSync('is_lecturer'));
  49. if(uni.getStorageSync('is_lecturer')==0){
  50. this.is_lecturer = false
  51. }else{
  52. this.is_lecturer = true
  53. }
  54. this.getuserinfo();
  55. },
  56. methods:{
  57. //获取用户信息
  58. getuserinfo(loading = true) {
  59. let id = uni.getStorageSync('id');
  60. this.$request.getuserinfo({
  61. id
  62. }).then( res =>{
  63. console.log(res)
  64. this.userinfo = res.data;
  65. this.identity = res.data.identity;
  66. }).catch( e=>{
  67. console.log(e)
  68. })
  69. },
  70. getMyIdentity: function(e) {
  71. this.$post({
  72. data: {
  73. do: 'GetMyIdentity',
  74. data: {
  75. user_id: uni.getStorageSync('id'),
  76. }
  77. }
  78. }).then(res => {
  79. this.state = res.data.state;
  80. })
  81. },
  82. gomy(type){
  83. uni.setStorageSync('type',type);
  84. uni.navigateBack();
  85. },
  86. toApply(n){
  87. uni.navigateTo({
  88. url:'/pages/index/apply?identity=' + n
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. </style>