nologin.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template name="nologin">
  2. <view class="model-warp">
  3. <view class="model-alert">
  4. <view class="alert-content">
  5. <view class="t-h1">{{text}}</view>
  6. <view class="t-p">请联系客服获取邀请码后再登录,联系电话:{{telPhones}}</view>
  7. </view>
  8. <view class="alert-btn">
  9. <view class="btn btn-cancel" @click="hideModel">取消</view>
  10. <view class="btn btn-confirm" @click="goLogin">去登录</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default{
  17. name:'nologin',
  18. data(){
  19. return{
  20. text:'',
  21. telPhones:this.telPhone,
  22. productids:this.productid,
  23. type:this.alertType,
  24. tabPath:this.path
  25. }
  26. },
  27. props:{
  28. productid:Number,
  29. telPhone:String,
  30. alertType:String,
  31. path:Boolean
  32. },
  33. created(){
  34. this.getProductid()
  35. },
  36. methods:{
  37. getProductid(){
  38. this.$parent.tel
  39. switch(this.alertType){
  40. case '1':
  41. this.text ='需要登录之后才能加入购物车哟~'
  42. break;
  43. case '2':
  44. this.text ='需要登录之后才能购买哟~'
  45. break;
  46. case '3':
  47. this.text ='需要登录之后查看购物车哟~'
  48. break;
  49. case '4':
  50. this.text ='需要登录才能查看个人中心哟~'
  51. break;
  52. }
  53. },
  54. hideModel(){
  55. if(this.tabPath){
  56. uni.switchTab({
  57. url: '/pages/tabBar/home/home'
  58. });
  59. }else{
  60. this.$parent.isShowNoLogin=false;
  61. }
  62. },
  63. goLogin(){
  64. let self = this
  65. let url;
  66. if(self.alertType =='3'){
  67. url =`/pages/login/login-accont?type=1`
  68. this.$parent.isShowNoLogin=false;
  69. }else if(self.alertType =='4'){
  70. url =`/pages/login/login-accont?type=2`
  71. this.$parent.isShowNoLogin=true;
  72. }else{
  73. url=`/pages/login/login-accont?type=detilType&id=${self.productids}`
  74. this.$parent.isShowNoLogin=false;
  75. }
  76. uni.navigateTo ({
  77. url
  78. })
  79. },
  80. }
  81. }
  82. </script>
  83. <style>
  84. </style>