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

180 lines
3.4 KiB

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