team.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view class="contentBox">
  3. <view v-if="info.name">
  4. <view class="title">{{info.name}}</view>
  5. <!-- <view class="time">{{info.updated_at}}</view> -->
  6. <rich-text class="content" :nodes="info.introduction"></rich-text>
  7. </view>
  8. <view v-if="loading && !info.name" class="noInfo">暂无团队简介</view>
  9. </view>
  10. </template>
  11. <script>
  12. import { teamInfo } from "../../api/index.js"
  13. export default{
  14. data(){
  15. return{
  16. info:{
  17. name:"",
  18. introduction:"",
  19. updated_at:""
  20. },
  21. loading: false
  22. }
  23. },
  24. onShow() {
  25. const that=this
  26. teamInfo().then(res=>{
  27. that.loading=true
  28. const {error_code}=res
  29. if(error_code===200){
  30. let content=res.data.introduction
  31. const regex = new RegExp('<img', 'gi');
  32. content = content.replace(regex, `<img style="width: 100%;height:auto;margin:10px 0"`);
  33. res.data.introduction=content
  34. that.info=res.data
  35. }
  36. }).catch(e=>{
  37. console.log(e)
  38. that.loading=true
  39. })
  40. }
  41. }
  42. </script>
  43. <style lang="scss">
  44. page{
  45. width: 100%;
  46. min-height: 100%;
  47. background: $uni-bg-color-normal;
  48. overflow-x: hidden;
  49. }
  50. .contentBox{
  51. font-size: 24rpx;
  52. color: #4D4D4D;
  53. padding: 20rpx 26rpx 20rpx 31rpx;
  54. }
  55. .title{
  56. text-align: center;
  57. margin-bottom: 20rpx;
  58. font-size: 32rpx;
  59. }
  60. .orgTitle{
  61. text-align: center;
  62. margin: 50rpx auto;
  63. }
  64. .time{
  65. text-align: center;
  66. padding-bottom: 20rpx;
  67. }
  68. .content{
  69. overflow-x: hidden;
  70. line-height: 50rpx;
  71. }
  72. .content img{
  73. display: block;
  74. width: 100%;
  75. height: auto;
  76. }
  77. .noInfo{
  78. text-align: center;
  79. padding: 10px 0;
  80. }
  81. </style>