Exchange.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. <template>
  2. <view>
  3. <view class="title" >
  4. <view class="title_text">{{title}}</view>
  5. <view class="title_more" @click="linkpath()">更多></view>
  6. </view>
  7. <view v-if="info">
  8. <exchangeItem :info="info" ></exchangeItem>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. import exchangeItem from '@/pages/components/exchange-item.vue'
  14. import {moduleBySeven} from '@/http/api/common.js'
  15. export default {
  16. components: {
  17. exchangeItem,
  18. },
  19. data() {
  20. return {
  21. info:[],
  22. title:'互动天地',
  23. }
  24. },
  25. async mounted() {
  26. this.getmoduleBySeven()
  27. },
  28. methods: {
  29. async getmoduleBySeven(){
  30. //获取模块7
  31. let res = await moduleBySeven()
  32. if (res.data.code == 200) {
  33. this.title = res.data.data.title
  34. this.info = res.data.data.contentVoList
  35. }
  36. },
  37. linkpath(){
  38. if (this.info && this.info.length > 0) {
  39. let data = {
  40. curNowid:this.info[0].columnId,
  41. curNowsubid:this.info[0].subId,
  42. }
  43. uni.setStorageSync('curNowdata',JSON.stringify(data) );
  44. uni.switchTab({
  45. url: '/pages/home/Information',
  46. });
  47. }
  48. }
  49. }
  50. }
  51. </script>
  52. <style>
  53. .title{
  54. display: flex;
  55. width: 90vw;
  56. justify-content: space-between;
  57. margin: 0 auto;
  58. }
  59. .title_text{
  60. width: 128rpx;
  61. height: 45rpx;
  62. font-size: 32rpx;
  63. font-weight: bold;
  64. color: #333333;
  65. line-height: 45rpx;
  66. }
  67. .title_more{
  68. width: 80rpx;
  69. height: 40rpx;
  70. font-size: 28rpx;
  71. font-weight: 500;
  72. color: #999999;
  73. line-height: 40rpx;
  74. }
  75. </style>