welcome.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <view>
  3. <view class="welcome">
  4. <view class="welcome-state1">
  5. <view class="welcome-next">跳过</view>
  6. <view class="welcome-foot">
  7. <u-image width="185px" height="48px" src="../../static/img/logo.png"></u-image>
  8. </view>
  9. </view>
  10. <!-- <view class="welcome-state2">
  11. <view class="welcome-logo">
  12. <u-image width="200px" height="50px" src="../../static/img/logo2.png"></u-image>
  13. </view>
  14. <view class="welcome-btn">
  15. <u-button class="welcomeBtn" shape="circle">用户登录</u-button>
  16. <p>随便逛逛</p>
  17. </view>
  18. </view> -->
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. }
  27. },
  28. methods: {
  29. gotoMain(k){
  30. if(k){
  31. uni.navigateTo({
  32. url:"/pagesA/pages/login/index"
  33. })
  34. }else{
  35. uni.switchTab({
  36. url: '/pages/index/index'
  37. });
  38. }
  39. },
  40. findByOpenId(){
  41. var openId=this.carhelp.getOpenId()
  42. if(openId==""){
  43. console.log("--------findByOpenId----------")
  44. setTimeout(()=>{
  45. this.findByOpenId()
  46. },1000)
  47. return
  48. }
  49. uni.request({
  50. method:'get',
  51. url: process.car.BASE_URL + "/mobile/regUser/findByOpenId",
  52. data: {
  53. openId:openId,
  54. },
  55. header: {
  56. 'Content-Type': 'application/x-www-form-urlencoded',
  57. 'X-Requested-With': 'XMLHttpRequest',
  58. }
  59. }).then((response) => {
  60. let [error, res] = response;
  61. //var backImg="https://yktwechat.xiaoxinda.com/config/xxd2021.jpg"
  62. this.carhelp.setConfig(res.data.data.configure)
  63. this.setBackImg()
  64. if (res.data.code == 200&&res.data.result) {
  65. var token = res ? res.data.data.token : '';
  66. this.carhelp.setPersonInfo(res.data.data.memberInfo );
  67. this.carhelp.setToken(token);
  68. this.carhelp.setPersonInfoPlus(res.data.data);
  69. setTimeout(()=>{
  70. uni.switchTab({
  71. url: '/pages/index/index'
  72. });
  73. },1000)
  74. } else{
  75. this.carhelp.logoff()
  76. this.bottonShow=true
  77. }
  78. }).catch(error => {
  79. this.carhelp.logoff()
  80. this.bottonShow=true
  81. })
  82. },
  83. setBackImg(){
  84. var img=this.carhelp.getConfig().homepageLogo
  85. if(img){
  86. this.customStyle0="background:url("+img+") no-repeat;background-size: 100%;"
  87. }
  88. }
  89. },
  90. onLoad() {
  91. this.setBackImg( )
  92. },
  93. onReady() {
  94. this.findByOpenId()
  95. }
  96. }
  97. </script>
  98. <style>
  99. page{
  100. background:url(../../static/img/welcome_bg.png) no-repeat;
  101. background-size:100%;
  102. }
  103. </style>
  104. <style lang="scss" scoped>
  105. .welcome{
  106. position: relative;
  107. }
  108. .welcome-next{
  109. position: absolute;
  110. padding: 4px 15px;
  111. color:#fff;
  112. border-radius: 14px;
  113. background:rgba(0,0,0,0.5);
  114. right: 15px;
  115. top: 15px;
  116. }
  117. .welcome-foot{
  118. position:fixed;
  119. left: 0;
  120. right: 0;
  121. bottom: 0;
  122. background-color: #fff;
  123. height: 100px;
  124. display: flex;
  125. align-items: center;
  126. justify-content: center;
  127. }
  128. .welcome-logo{
  129. position: absolute;
  130. left: 50%;
  131. margin-left: -100px;
  132. top: 120px;
  133. }
  134. .welcome-btn{
  135. position: fixed;
  136. left: 48px;
  137. right: 48px;
  138. bottom:48px;
  139. text-align: center;
  140. .welcomeBtn{
  141. color:#009143;
  142. border-color:#fff;
  143. }
  144. p{
  145. color:#fff;
  146. margin-top: 12px;
  147. font-size: 16px;
  148. }
  149. }
  150. </style>