image.pngimage.png

    1. <template>
    2. <view class='goods_detail'>
    3. <swiper indicator-dots>
    4. <swiper-item v-for="(item,index) in swipers" :key="index">
    5. <image :src='item.src'></image>
    6. </swiper-item>
    7. </swiper>
    8. <view class='box1'>
    9. <view class='price'>
    10. <text>¥6788</text>
    11. <text>¥8788</text>
    12. <view class='goods_name'>苹果Apple iPhone 6 plus 16G 4G手机(联网三网板)</view>
    13. </view>
    14. </view>
    15. <view class='line'></view>
    16. <view class='box2'>
    17. <view>货号:1111</view>
    18. <view>库存:2222</view>
    19. </view>
    20. <view class='line'></view>
    21. <view class='box3'>
    22. <view class='tit'>详情介绍</view>
    23. <view class='content'>内容</view>
    24. </view>
    25. </view>
    26. </template>
    27. <script>
    28. export default {
    29. data() {
    30. return {
    31. id: 0,
    32. swipers: []
    33. }
    34. },
    35. methods: {
    36. //获取轮播图的数据,首先会有函数
    37. async getSwipers() {
    38. const res = await this.$myRequest({
    39. url: '/api/getthumimages/' + this.id
    40. })
    41. this.swipers = res.data.message
    42. }
    43. },
    44. onLoad(options) {
    45. // console.log(options)
    46. this.id = options.id
    47. this.getSwipers()
    48. }
    49. }
    50. </script>
    51. <style lang="scss">
    52. .goods_detail {
    53. swiper {
    54. height: 750rpx;
    55. image {
    56. width: 100%;
    57. height: 100%;
    58. }
    59. }
    60. .box1 {
    61. padding: 10px;
    62. .price {
    63. font-size: 35rpx;
    64. color: $shop-color;
    65. line-height: 80rpx;
    66. text:nth-child(2) {
    67. color: #ccc;
    68. font-size: 28rpx;
    69. text-decoration: line-through;
    70. margin-left: 20rpx;
    71. }
    72. }
    73. .goods_name {
    74. font-size: 35rpx;
    75. line-height: 60rpx;
    76. color:#333;
    77. }
    78. }
    79. .box2{
    80. padding:10rpx 10rpx;
    81. font-size: 35rpx;
    82. line-height: 60rpx;
    83. }
    84. .box3{
    85. .tit{
    86. font-size: 40rpx;
    87. padding-left: 10px;
    88. border-bottom: 1px solid #eee;
    89. line-height: 70rpx;
    90. }
    91. .content{
    92. padding:10px;
    93. font-size:28rpx;
    94. color:#333;
    95. }
    96. }
    97. }
    98. .line{
    99. height:10rpx;
    100. width:750rpx;
    101. background: #eee;
    102. }
    103. </style>

    本章节主要就是 样式的调节,使用scss相对来说简单一点 注意行显示和块显示的区别