Model12.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="model-12">
  3. <view class="graphic-nav" :style="{backgroundColor:editablePageConfig.editable_page_config_content.back_color}">
  4. <view class="wrap">
  5. <view v-for="(v,index) in editablePageConfig.editable_page_config_content.nav" :key="index" class="item" :style="'width:'+getBannerStyle.width+'%'" @click="goAdUrl(v.link)">
  6. <view>
  7. <image class="img" mode="aspectFit" :src="v.image">
  8. </view>
  9. <text class="span">{{v.text}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. name: 'Model12',
  18. data () {
  19. return {
  20. }
  21. },
  22. props: ['editablePageConfig','editablePage'],
  23. computed: {
  24. getBannerStyle(){
  25. var width
  26. if(this.editablePageConfig.editable_page_config_content['show_format']==1){
  27. width=25
  28. }else if(this.editablePageConfig.editable_page_config_content['show_format']==2){
  29. width=20
  30. }
  31. return {width:width}
  32. }
  33. },
  34. methods: {
  35. goAdUrl (url) {
  36. uni.navigateTo({url: url })
  37. }
  38. }
  39. }
  40. </script>
  41. <style lang="scss" scoped>
  42. .model-12 .graphic-nav{
  43. border-radius: 5px;
  44. }
  45. .model-12 .graphic-nav>.wrap {
  46. /* overflow-x: hidden;
  47. white-space: nowrap;
  48. background: #ffffff;
  49. */
  50. display: flex;
  51. /* justify-content: space-around;
  52. */
  53. flex-wrap: wrap;
  54. padding: 0 5px;
  55. }
  56. .model-12 .graphic-nav .item {
  57. text-align: center;
  58. float: none;
  59. display: inline-block;
  60. box-sizing: border-box;
  61. padding: 8px 5px;
  62. }
  63. .model-12 .graphic-nav .item .img {
  64. width: 45px;
  65. height: 45px;
  66. }
  67. .model-12 .graphic-nav .item .span {
  68. white-space: nowrap;
  69. text-overflow: ellipsis;
  70. overflow: hidden;
  71. display: block;
  72. font-size: 13px;
  73. }
  74. </style>