

<template><view class='goods_detail'><swiper indicator-dots><swiper-item v-for="(item,index) in swipers" :key="index"><image :src='item.src'></image></swiper-item></swiper><view class='box1'><view class='price'><text>¥6788</text><text>¥8788</text><view class='goods_name'>苹果Apple iPhone 6 plus 16G 4G手机(联网三网板)</view></view></view><view class='line'></view><view class='box2'><view>货号:1111</view><view>库存:2222</view></view><view class='line'></view><view class='box3'><view class='tit'>详情介绍</view><view class='content'>内容</view></view></view></template><script>export default {data() {return {id: 0,swipers: []}},methods: {//获取轮播图的数据,首先会有函数async getSwipers() {const res = await this.$myRequest({url: '/api/getthumimages/' + this.id})this.swipers = res.data.message}},onLoad(options) {// console.log(options)this.id = options.idthis.getSwipers()}}</script><style lang="scss">.goods_detail {swiper {height: 750rpx;image {width: 100%;height: 100%;}}.box1 {padding: 10px;.price {font-size: 35rpx;color: $shop-color;line-height: 80rpx;text:nth-child(2) {color: #ccc;font-size: 28rpx;text-decoration: line-through;margin-left: 20rpx;}}.goods_name {font-size: 35rpx;line-height: 60rpx;color:#333;}}.box2{padding:10rpx 10rpx;font-size: 35rpx;line-height: 60rpx;}.box3{.tit{font-size: 40rpx;padding-left: 10px;border-bottom: 1px solid #eee;line-height: 70rpx;}.content{padding:10px;font-size:28rpx;color:#333;}}}.line{height:10rpx;width:750rpx;background: #eee;}</style>
本章节主要就是 样式的调节,使用scss相对来说简单一点 注意行显示和块显示的区别
