铝交易,微信公众号
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

146 lines
3.0 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view>
  3. <navbar :title="$t('pageTitle.selectIdentity')" :leftClick="!$route.query.back"
  4. @leftClick="$utils.navigateBack" />
  5. <view class="container">
  6. <view class="title">{{ $t('components.selectIdentity') }}</view>
  7. <view class="button-group">
  8. <!--供应商-->
  9. <view :class="{'identity-button' : true, act : !!$store.state.buy}" @click="selectIdentity(0)">
  10. <view class="identity-text"> {{ $t('other.iAmBuyer') }}</view>
  11. <view class="identity-icon">
  12. <img src="../../static/image/index/5.png" style="width: 100%; height: 100%;">
  13. </view>
  14. </view>
  15. <!--采购-->
  16. <view :class="{'identity-button' : true, act : !!$store.state.shopData}" @click="selectIdentity(1)">
  17. <view class="identity-text"> {{ $t('other.iAmSupplier') }}</view>
  18. <view class="identity-icon">
  19. <img src="../../static/image/index/6.png" style="width: 100%; height: 100%;">
  20. </view>
  21. </view>
  22. </view>
  23. <view style="margin-top: 100rpx;
  24. text-decoration: underline;color: blue;
  25. display: flex;
  26. gap: 100rpx;">
  27. <view style=""
  28. @click="refus">
  29. 刷新身份信息
  30. </view>
  31. <view style=""
  32. @click="$store.commit('logout')">
  33. 退出登录
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import {
  41. mapGetters
  42. } from 'vuex'
  43. export default {
  44. computed: {
  45. ...mapGetters(['userShop', "userInfo"]),
  46. },
  47. onLoad() {
  48. this.$store.commit('getUserInfo')
  49. },
  50. methods: {
  51. selectIdentity(identity) {
  52. // if (userInfo)
  53. if (identity == 0 && this.$store.state.buy) {
  54. this.$store.commit('setShop', false)
  55. uni.reLaunch({
  56. url: '/pages/index/index'
  57. })
  58. } else if (identity == 1 && this.$store.state.shopData) {
  59. this.$store.commit('setShop', true)
  60. uni.reLaunch({
  61. url: '/pages/index/index'
  62. })
  63. } else {
  64. uni.navigateTo({
  65. url: `/pages_order/auth/registerShop?identity=${identity}`
  66. })
  67. }
  68. },
  69. refus(){
  70. this.$store.commit('getUserInfo')
  71. uni.showLoading()
  72. setTimeout(() => {
  73. uni.showToast({
  74. title: '刷新成功',
  75. icon: 'none'
  76. })
  77. uni.hideLoading()
  78. }, 500)
  79. },
  80. }
  81. }
  82. </script>
  83. <style scoped lang="scss">
  84. * {
  85. box-sizing: border-box;
  86. }
  87. .container {
  88. display: flex;
  89. flex-direction: column;
  90. align-items: center;
  91. justify-content: center;
  92. //height: 100vh;
  93. background-color: #f5f5f5;
  94. .title {
  95. font-size: 40rpx;
  96. color: #333;
  97. margin: 80rpx 0;
  98. }
  99. .button-group {
  100. display: flex;
  101. flex-direction: column;
  102. align-items: center;
  103. justify-content: center;
  104. width: 100vw;
  105. //padding: 0 20px;
  106. .identity-button {
  107. display: flex;
  108. align-items: center;
  109. justify-content: space-between;
  110. width: 80%;
  111. margin-bottom: 40rpx;
  112. padding: 40rpx 50rpx;
  113. background-color: #2d2f5997;
  114. border-radius: 20rpx;
  115. color: white;
  116. .identity-text {
  117. font-size: 40rpx;
  118. }
  119. .identity-icon {
  120. width: 130rpx;
  121. height: 130rpx;
  122. }
  123. }
  124. .act{
  125. background-color: #2d2f59;
  126. }
  127. }
  128. }
  129. </style>