confirm.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <view>
  3. <!-- <view class="username">{{username}}</view> -->
  4. <view class="content1">
  5. <image src="../../static/sm.png" mode="widthFix" class="img"></image>
  6. <view class="row1">
  7. 即将通过扫码
  8. </view>
  9. <view class="row2">
  10. 登录畅运通网站
  11. </view>
  12. <button @click="mobileOkPcLogin()" class="row3 btn">确认登录</button>
  13. <button @click="mobileOkPcLogin()" class="row4 btn">取消登录</button>
  14. </view>
  15. <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
  16. confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
  17. </view>
  18. </template>
  19. <script>
  20. import {
  21. mapState
  22. } from 'vuex';
  23. export default {
  24. data() {
  25. return {
  26. token: '',
  27. phone: '',
  28. alertTitle: '登录成功!',
  29. isShowAlert: false
  30. }
  31. },
  32. computed: {
  33. ...mapState(['hasLogin', 'userInfo', "firstAuthentication"]),
  34. },
  35. onLoad(option) {
  36. this.token = option.token;
  37. console.log(option);
  38. },
  39. methods: {
  40. confirmClick() {
  41. this.isShowAlert = false
  42. uni.switchTab({
  43. url: '/pages/mine/index'
  44. });
  45. },
  46. cancelClick() {
  47. this.isShowAlert = false
  48. },
  49. mobileOkPcLogin() {
  50. this.$request.baseRequest('post', '/login/loginCode', {
  51. phone: this.userInfo.phone,
  52. token: this.token
  53. }).then(res => {
  54. console.log(1111111111111111111)
  55. console.log(res)
  56. this.isShowAlert = true
  57. })
  58. .catch(res => {
  59. uni.$u.toast(res.message);
  60. });
  61. }
  62. }
  63. }
  64. </script>
  65. <style scoped lang="scss">
  66. .content1 {
  67. display: flex;
  68. align-items: center;
  69. justify-content: center;
  70. flex-direction: column;
  71. padding-top: 300rpx;
  72. }
  73. .img {
  74. width: 50%;
  75. }
  76. .row1 {
  77. font-size: 14rpx;
  78. color: #AFB3BF;
  79. margin: 40rpx 0 10rpx 0;
  80. }
  81. .row2 {
  82. font-size: 46rpx;
  83. font-weight: 500;
  84. color: #333333;
  85. }
  86. .row3 {
  87. margin-top: 300rpx;
  88. background: #2772FB;
  89. color: white;
  90. }
  91. .row4 {
  92. margin-top: 60rpx;
  93. background: #F1F3F6;
  94. color: #AFB3BF;
  95. }
  96. .btn {
  97. border-radius: 50rpx;
  98. width: 90%;
  99. }
  100. </style>