details.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <view class="content">
  3. <block v-if="detail">
  4. <image class="top" :src="detail.img" mode="widthFix"></image>
  5. <view class="box">
  6. <view class="title">{{detail.title}}</view>
  7. <view class="client">客户:<span>{{detail.client}}</span></view>
  8. <view class="intro">{{detail.intro}}</view>
  9. <view class="title t2">效果</view>
  10. <view class="intro">{{detail.effect}}</view>
  11. </view>
  12. </block>
  13. </view>
  14. </template>
  15. <script>
  16. import { data } from '../plan/data.js'
  17. export default {
  18. data(){
  19. return {
  20. detail:null
  21. }
  22. },
  23. created() {
  24. uni.setNavigationBarTitle({
  25. title:'案例'
  26. })
  27. },
  28. onLoad(option) {
  29. if(option.id&&option.key){
  30. this.getDetails(option.id,option.key);
  31. }
  32. },
  33. methods:{
  34. getDetails(id,key){
  35. let temp = data[key];
  36. if(temp.length){
  37. this.detail = temp.find(t=>t.id == id).details || null;
  38. }
  39. }
  40. }
  41. }
  42. </script>
  43. <style scoped lang="less">
  44. .content{
  45. .top{
  46. width: 100%;
  47. }
  48. .box{
  49. width: 100%;
  50. padding: 0 30rpx 30rpx;
  51. box-sizing: border-box;
  52. .title{
  53. font-family: PingFang-SC, PingFang-SC;
  54. font-weight: bold;
  55. font-size: 32rpx;
  56. color: #111111;
  57. line-height: 45rpx;
  58. margin-top: 36rpx;
  59. &.t2{
  60. margin-top: 48rpx;
  61. }
  62. }
  63. .client{
  64. font-family: PingFangSC, PingFang SC;
  65. font-weight: bold;
  66. font-size: 32rpx;
  67. color: #333333;
  68. line-height: 45rpx;
  69. margin-top: 21rpx;
  70. span{
  71. font-size: 30rpx;
  72. line-height: 42rpx;
  73. color: #134F99;
  74. }
  75. }
  76. .intro{
  77. font-family: PingFangSC, PingFang SC;
  78. font-weight: 400;
  79. font-size: 28rpx;
  80. color: #666666;
  81. line-height: 48rpx;
  82. letter-spacing: 2rpx;
  83. margin-top: 21rpx;
  84. }
  85. .effect{
  86. font-family: PingFangSC, PingFang SC;
  87. font-weight: 400;
  88. font-size: 28rpx;
  89. color: #666666;
  90. line-height: 40rpx;
  91. margin-top: 6rpx;
  92. }
  93. }
  94. }
  95. </style>