铝交易,微信公众号
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.

94 lines
1.8 KiB

1 month ago
1 month ago
3 months ago
1 month ago
4 months ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="top-bar">
  3. <!--左边-->
  4. <view class="titleCls">
  5. <view>
  6. <img src="../../static/image/logo.png" style="width: 70rpx;height: 70rpx;border-radius: 50%;">
  7. </view>
  8. <span class="text"> {{ $t('pageTitle.proName') }}</span>
  9. </view>
  10. <!--右边-->
  11. <view v-if="showRight == '1' && !userInfo.id" @click="$utils.toLogin" class="change">
  12. <!-- {{ $t('pages.index.index.purchaser') }} -->
  13. 登录
  14. </view>
  15. <view v-else-if="showRight == '1'" @click="switchIdentity" class="change">
  16. <!-- {{ $t('pages.index.index.purchaser') }} -->
  17. {{ userShop ? '供应商' : '采购商' }}
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. mapGetters
  24. } from 'vuex'
  25. export default {
  26. props: {
  27. showRight: {
  28. default: '0',
  29. type: String,
  30. }
  31. },
  32. mounted() {
  33. console.log(this.$store.state, "this.$store.state")
  34. },
  35. data() {
  36. return {
  37. }
  38. },
  39. computed: {
  40. ...mapGetters(['userShop', 'userInfo']),
  41. },
  42. methods: {
  43. // 切换身份
  44. switchIdentity() {
  45. uni.navigateTo({
  46. url: '/pages_order/auth/selectionIdentity'
  47. })
  48. },
  49. }
  50. }
  51. </script>
  52. <style lang="scss" scoped>
  53. // 顶部栏
  54. .top-bar {
  55. display: flex;
  56. justify-content: space-between;
  57. height: 120rpx;
  58. background-color: $uni-color;
  59. .titleCls {
  60. display: flex;
  61. padding: 20rpx 10rpx;
  62. align-items: center;
  63. .text {
  64. display: flex;
  65. justify-content: center;
  66. align-items: center;
  67. font-size: 30rpx;
  68. color: #FFFFFF;
  69. margin-left: 20rpx;
  70. }
  71. }
  72. .change {
  73. display: flex;
  74. align-items: center;
  75. justify-content: center;
  76. width: 30%;
  77. height: 70rpx;
  78. border-radius: 40rpx;
  79. color: white;
  80. font-size: 28rpx;
  81. margin: 20rpx 10rpx 0 0;
  82. background: $uni-color;
  83. border: 1px solid #757986;
  84. //margin-top: 20rpx;
  85. border-radius: 40rpx;
  86. }
  87. }
  88. </style>