desWithCode.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. case 'education':
  44. // 解决方案 -> 教育机构
  45. case 'bitAnsSup':
  46. // 解决方案 -> 食品餐饮
  47. case 'erupt':
  48. // 解决方案 -> 万人高并发
  49. case 'transportation':
  50. // 解决方案 -> 交通运输
  51. case 'financial':
  52. // 解决方案 -> 金融保险
  53. case 'medical':
  54. // 解决方案 -> 医疗行业
  55. case 'privatization':
  56. // 解决方案 -> 私有化部署
  57. case 'government':
  58. // 解决方案 -> 政府机构
  59. case 'news':
  60. // 客户案例
  61. case 'energy':
  62. // 解决方案 -> 能源化工
  63. result = Object.assign({
  64. title,
  65. p2
  66. }, {topClass: 'kefu-leve-bj'}, {topStyle: `background-image: url(${this.bg2})`}, {imgUrl: this.imgUrl});
  67. break;
  68. }
  69. return result;
  70. },
  71. }
  72. }
  73. </script>
  74. <style lang="scss" scoped>
  75. .service-code-box {
  76. width: 100%;
  77. height: 440px;
  78. text-align: center;
  79. box-sizing: border-box;
  80. overflow: hidden;
  81. background-repeat: no-repeat;
  82. padding: 100px 0 83px;
  83. h4 {font-size: 30px;text-align: center;margin: 0 0 45px;color: #fff;}
  84. img {width: 142px;height: 142px;margin: 0 auto;}
  85. p {font-size: 18px;text-align: center;margin: 24px 0 0;color: #fff;}
  86. // 客服---(纯白色背景)
  87. &.kefu {
  88. height: 360px;background-color: #FAFAFA;
  89. h4,p {color: #333;}
  90. }
  91. // 经理---(/背景为弧形的光)
  92. &.jingli {
  93. padding: 62px 0 62px;
  94. h4 {margin: 0 0 30px;}
  95. p{margin: 0 0 16px;}
  96. }
  97. // 客服带背景图---(背景为菱形的光)
  98. &.kefu-leve-bj {}
  99. }
  100. </style>