desWithCode.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <!-- 立即咨询 -->
  3. <div class="service-code-box mta-hidden-xs" :class="pageData.topClass" :style="pageData.topStyle">
  4. <h4>{{ pageData.title }}</h4>
  5. <p v-if="pageData.p1" class="jinglu-weixin">{{ pageData.p1 }}</p>
  6. <img :src="imgUrl" alt="">
  7. <p v-if="pageData.p2" class="kefu-weixin">{{ pageData.p2 }}</p>
  8. </div>
  9. </template>
  10. <script>
  11. export default {
  12. name: "desWithCode",
  13. props: {
  14. source: {
  15. type: String,
  16. }
  17. },
  18. data() {
  19. return {
  20. imgUrl: require('static/codeImage/code-kefu.png'), // 客服二维码
  21. imgUrl2: require('static/codeImage/code-jingli.png'), // 经理二维码
  22. bg1: require('static/codeImage/code-bj01.png'), // 企业培训
  23. bg2: require('static/codeImage/code-bj02.png'), // 教育机构+食品餐饮
  24. }
  25. },
  26. computed: {
  27. pageData() {
  28. const title = '立即扫码资讯,领取您的专属解决方案';
  29. const p1 = '马上扫码添加客户经理';
  30. const p2 = '扫码添加客服微信';
  31. let result = {};
  32. switch (this.source) {
  33. case 'exam':
  34. // 严肃考试
  35. result = Object.assign({title, p2}, {topClass: 'kefu'}, {topStyle: ''}, {imgUrl: this.imgUrl});
  36. break;
  37. case 'peixun':
  38. // 企业培训
  39. result = Object.assign({
  40. title,
  41. p1
  42. }, {topClass: 'jingli'}, {topStyle: `background-image: url(${this.bg1})`}, {imgUrl: this.imgUrl2});
  43. break;
  44. case 'education':
  45. // 解决方案 -> 教育机构
  46. case 'biteAndSup':
  47. // 解决方案 -> 食品餐饮
  48. case 'erupt':
  49. // 解决方案 -> 万人高并发
  50. case 'transportation':
  51. // 解决方案 -> 交通运输
  52. case 'financial':
  53. // 解决方案 -> 金融保险
  54. case 'medical':
  55. // 解决方案 -> 医疗行业
  56. case 'privatization':
  57. // 解决方案 -> 私有化部署
  58. case 'government':
  59. // 解决方案 -> 政府机构
  60. case 'news':
  61. // 客户案例
  62. case 'energy':
  63. // 解决方案 -> 能源化工
  64. result = Object.assign({
  65. title,
  66. p2
  67. }, {topClass: 'kefu-leve-bj'}, {topStyle: `background-image: url(${this.bg2})`}, {imgUrl: this.imgUrl});
  68. break;
  69. }
  70. return result;
  71. },
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .service-code-box {
  77. width: 100%;
  78. height: 440px;
  79. text-align: center;
  80. box-sizing: border-box;
  81. overflow: hidden;
  82. background-repeat: no-repeat;
  83. padding: 100px 0 83px;
  84. background-size: cover;
  85. h4 {font-size: 30px;text-align: center;margin: 0 0 45px;color: #fff;}
  86. img {width: 142px;height: 142px;margin: 0 auto;}
  87. p {font-size: 18px;text-align: center;margin: 24px 0 0;color: #fff;}
  88. // 客服---(纯白色背景)
  89. &.kefu {
  90. background-color: #FAFAFA;
  91. h4,p {color: #333;}
  92. }
  93. // 经理---(/背景为弧形的光)
  94. &.jingli {
  95. height: 360px;padding: 62px 0 62px;
  96. h4 {margin: 0 0 30px;}
  97. p{margin: 0 0 16px;}
  98. }
  99. // 客服带背景图---(背景为菱形的光)
  100. &.kefu-leve-bj {}
  101. }
  102. </style>