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

181 lines
3.5 KiB

4 months ago
4 months ago
4 months ago
  1. <template>
  2. <view class="trading-platform">
  3. <topbar showRight="0"></topbar>
  4. <view class="frame">
  5. <!--顶部栏-->
  6. <!--折线图-->
  7. <view class="chart">
  8. 折线图
  9. </view>
  10. <!-- 供应商 -->
  11. <view class="supplier" v-if="userShop">
  12. <view style="" class="purchaser-title">
  13. <span class="active"> {{ $t('other.orderList') }}</span>
  14. </view>
  15. <view class="supplierList">
  16. <orderList :orderList="list" />
  17. </view>
  18. </view>
  19. <!-- 采购商 -->
  20. <view class="purchaser" v-else>
  21. <view style="" class="purchaser-title">
  22. <span @click="actionIndexChange(index)"
  23. v-for="(item, index) in type"
  24. :class="actionIndex == index ? 'active' : 'noactive'">{{ item.name }}</span>
  25. <!-- <span @click="actionIndexChange(index)"
  26. :class="actionIndex==index?'active':'noactive'">{{ $t('other.futuresTrading') }}</span> -->
  27. </view>
  28. <view class="productList">
  29. <productList :list="list" />
  30. </view>
  31. </view>
  32. </view>
  33. <tabber select="1" />
  34. </view>
  35. </template>
  36. <script>
  37. import tabber from '@/components/base/tabbar.vue'
  38. import topbar from "@/components/base/topbar.vue";
  39. import {
  40. mapGetters
  41. } from 'vuex'
  42. import ProductList from "@/components/user/productList.vue";
  43. import OrderList from "@/pages_order/components/order/orderList.vue";
  44. import mixinList from '@/mixins/list.js'
  45. export default {
  46. mixins : [mixinList],
  47. components: {
  48. OrderList,
  49. ProductList,
  50. topbar,
  51. tabber,
  52. },
  53. computed: {
  54. ...mapGetters(['userShop']),
  55. },
  56. data() {
  57. return {
  58. actionIndex: 0,
  59. mixinsListApi : 'getMyProductlist',
  60. type : [
  61. {
  62. name : this.$t('other.spotTrading')
  63. },
  64. {
  65. name : this.$t('other.futuresTrading')
  66. },
  67. ],
  68. }
  69. },
  70. onLoad() {
  71. if(this.userShop){
  72. this.mixinsListApi = 'getMyProductlist'
  73. }else{
  74. this.mixinsListApi = 'productlist'
  75. this.queryParams.productType = this.actionIndex
  76. }
  77. },
  78. methods: {
  79. // 切换tab
  80. actionIndexChange(index) {
  81. // index为0时切换到现货交易,index为1时切换到期货交易
  82. this.actionIndex = index;
  83. this.queryParams.productType = this.actionIndex
  84. this.getData()
  85. },
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .trading-platform {
  91. .frame {
  92. display: flex;
  93. flex-direction: column;
  94. justify-content: center;
  95. height: calc(100vh - 120rpx - 120rpx);
  96. .chart {
  97. height: 30%;
  98. }
  99. .supplier {
  100. height: 70%;
  101. padding: 20rpx 20rpx;
  102. background-image: url('../../static/image/index/1.png');
  103. color: #FFF;
  104. font-size: 32rpx;
  105. .supplierList {
  106. margin-top: 20rpx;
  107. height: 92%;
  108. overflow: auto;
  109. }
  110. .purchaser-title {
  111. height: 8%;
  112. .active {
  113. text-decoration: underline;
  114. width: 80rpx;
  115. margin: 20rpx 20rpx 20rpx 20rpx;
  116. padding: 10rpx 20rpx;
  117. }
  118. .noactive {
  119. width: 80rpx;
  120. margin: 20rpx 20rpx 20rpx 20rpx;
  121. padding: 10rpx 20rpx;
  122. }
  123. }
  124. }
  125. .purchaser {
  126. height: 60%;
  127. padding: 20rpx 0;
  128. background-image: url('../../static/image/index/1.png');
  129. color: #FFF;
  130. font-size: 32rpx;
  131. .purchaser-title {
  132. .active {
  133. text-decoration: underline;
  134. width: 80rpx;
  135. margin: 20rpx 20rpx 20rpx 20rpx;
  136. padding: 10rpx 20rpx;
  137. }
  138. .noactive {
  139. width: 80rpx;
  140. margin: 20rpx 20rpx 20rpx 20rpx;
  141. padding: 10rpx 20rpx;
  142. }
  143. }
  144. .productList {
  145. margin-top: 20rpx;
  146. height: 60vh;
  147. overflow: auto;
  148. }
  149. }
  150. }
  151. }
  152. </style>