about.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <template>
  2. <view class="pages">
  3. <u-navbar
  4. :title="navbarTitle"
  5. :autoBack="true"
  6. :safeAreaInsetTop="true"
  7. >
  8. </u-navbar>
  9. <view class="page-wrap">
  10. <u-subsection
  11. class="subsection"
  12. :customStyle="{height: '66rpx'}"
  13. :list="typeList"
  14. mode="subsection"
  15. activeColor="#00A447"
  16. @change="sectionChange"
  17. :current="curNow"></u-subsection>
  18. <view class="content">
  19. <view class="" v-if="curNow==0">
  20. <view class="name">贵州旭烁食品有限公司简介</view>
  21. <u--image v-if="pageData.uxImg" :src="pageData.uxImg" :showLoading="true" width="100%" mode="aspectFill"></u--image>
  22. <view class="xsIntro">{{pageData.xsIntro}}</view>
  23. <view class="shopIntro">
  24. <view class="title">一、成立背景</view>
  25. {{pageData.shopIntro}}
  26. </view>
  27. <!-- <view class="shopIntro">{{pageData.shopIntro}}</view> -->
  28. </view>
  29. <view class="" v-if="curNow==1">
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. components:{
  38. },
  39. data() {
  40. return {
  41. navbarTitle:'',
  42. typeList:['旭烁简介','商行简介'],
  43. curNow:0,
  44. pageData:{}
  45. }
  46. },
  47. watch:{
  48. curNow: {
  49. handler(newVal, oldVal){
  50. console.log('newVal',newVal);
  51. this.navbarTitle = this.typeList[newVal];
  52. this.getIntro();
  53. },
  54. immediate: true
  55. }
  56. },
  57. onLoad() {
  58. },
  59. methods: {
  60. sectionChange(index){
  61. this.curNow = index;
  62. },
  63. getIntro(){
  64. let type = this.curNow + 1;
  65. this.$u.api.xsGetIntro({type:type}).then(res=>{
  66. this.pageData = res.data;
  67. // console.log('res',res);
  68. }).catch(err=>{
  69. console.log('xsGetIntro',err.data);
  70. })
  71. }
  72. }
  73. }
  74. </script>
  75. <style>
  76. page{
  77. background-color: #F9F9F9;
  78. }
  79. </style>
  80. <style lang="scss" scoped>
  81. .content{
  82. font-size: 26rpx;
  83. font-weight: 400;
  84. color: #666666;
  85. line-height: 44rpx;
  86. .name{
  87. font-size: 32rpx;
  88. font-weight: 600;
  89. color: #333333;
  90. line-height: 45rpx;
  91. text-align: center;
  92. margin-top: 34rpx;
  93. margin-bottom: 30rpx;
  94. }
  95. .title{
  96. font-size: 30rpx;
  97. font-weight: 400;
  98. color: #333333;
  99. line-height: 50rpx;
  100. margin: 30rpx auto 15rpx;
  101. }
  102. .xsIntro{
  103. font-size: 24rpx;
  104. font-weight: 400;
  105. color: #999999;
  106. line-height: 33rpx;
  107. margin: 20rpx auto 50rpx;
  108. }
  109. }
  110. </style>