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

121 lines
2.2 KiB

6 months ago
  1. <template>
  2. <view class="trading-platform">
  3. <view class="frame">
  4. <!--顶部栏-->
  5. <topbar showRight="0"></topbar>
  6. <!--折线图-->
  7. <view class="chart">
  8. 折线图
  9. </view>
  10. <!-- 供应商 -->
  11. <view class="supplier" v-if="userShop">
  12. </view>
  13. <!-- 采购商 -->
  14. <view class="purchaser" v-else>
  15. <view style="" class="purchaser-title">
  16. <span @click="actionIndexChange(0)" :class="actionIndex==0?'active':'noactive'" >现货交易</span>
  17. <span @click="actionIndexChange(1)" :class="actionIndex==1?'active':'noactive'">期货交易</span>
  18. </view>
  19. <view class="productList">
  20. <productList :productList="productList.records"/>
  21. </view>
  22. </view>
  23. </view>
  24. <tabber select="1"/>
  25. </view>
  26. </template>
  27. <script>
  28. import tabber from '@/components/base/tabbar.vue'
  29. import topbar from "@/components/base/topbar.vue";
  30. import {mapGetters} from 'vuex'
  31. import ProductList from "@/components/user/productList.vue";
  32. export default {
  33. components: {
  34. ProductList,
  35. topbar,
  36. tabber,
  37. },
  38. computed: {
  39. ...mapGetters(['userShop']),
  40. },
  41. data() {
  42. return {
  43. productList: {
  44. records: [
  45. {}
  46. ],
  47. total: 0,
  48. },
  49. actionIndex: 0,
  50. }
  51. },
  52. methods: {
  53. // 切换tab
  54. actionIndexChange(index){
  55. // index为0时切换到现货交易,index为1时切换到期货交易
  56. this.actionIndex = index;
  57. },
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .trading-platform {
  63. .frame {
  64. .chart {
  65. border: 1px solid red;
  66. height: 250rpx;
  67. }
  68. .supplier {
  69. padding: 20rpx 0;
  70. }
  71. .purchaser {
  72. padding: 20rpx 0;
  73. background-image: url('../../static/image/index/1.png');
  74. color: #FFF;
  75. font-size: 32rpx;
  76. .purchaser-title {
  77. .active {
  78. text-decoration: underline;
  79. width: 80rpx;
  80. margin: 20rpx 20rpx 20rpx 20rpx;
  81. padding: 10rpx 20rpx;
  82. }
  83. .noactive {
  84. width: 80rpx;
  85. margin: 20rpx 20rpx 20rpx 20rpx;
  86. padding: 10rpx 20rpx;
  87. }
  88. }
  89. .productList{
  90. margin-top: 20rpx;
  91. height: 60vh;
  92. overflow: auto;
  93. }
  94. }
  95. }
  96. }
  97. </style>