about.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. components:{
  24. },
  25. data() {
  26. return {
  27. navbarTitle:'',
  28. typeList:['旭烁简介','商行简介'],
  29. curNow:0,
  30. }
  31. },
  32. watch:{
  33. curNow: {
  34. handler(newVal, oldVal){
  35. console.log('newVal',newVal);
  36. this.navbarTitle = this.typeList[newVal];
  37. this.getIntro();
  38. },
  39. immediate: true
  40. }
  41. },
  42. onLoad() {
  43. },
  44. methods: {
  45. sectionChange(index){
  46. this.curNow = index;
  47. },
  48. getIntro(){
  49. let type = this.curNow + 1;
  50. this.$u.api.xsGetIntro({type:type}).then(res=>{
  51. console.log('res',res);
  52. }).catch(err=>{
  53. console.log('err11111',err.data);
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style>
  60. page{
  61. background-color: #F9F9F9;
  62. }
  63. </style>
  64. <style lang="scss" scoped>
  65. </style>