商品价格和标题

This commit is contained in:
jqtmviyu@gmail.com 2021-02-26 23:48:08 +08:00
parent eaaaeec4c9
commit c36e3053e9
3 changed files with 159 additions and 2 deletions

View File

@ -14,6 +14,7 @@
<style lang="scss">
@import "uview-ui/index.scss";
@import "styles/iconfont.css";
/* 公共样式 */
page,view,text,button,navigator,image,swiper,swiper-item,input {

View File

@ -7,6 +7,17 @@
</swiper-item>
</swiper>
<!-- 2.0 商品标题 -->
<view class="info">
<view class="info_head">
<text class="price">{{ goods_price }}</text>
<view class="iconfont icon-zhuanfa"></view>
<view class="iconfont icon-shoucang1"></view>
</view>
<view class="title">
{{goods_name}}
</view>
</view>
</view>
</template>
@ -15,7 +26,10 @@ export default {
data(){
return {
goods_id: "",
pics: []
pics: [],
goods_name: "商品名称",
goods_price: "0",
goods_introduce: "",
}
},
onLoad( {goods_id} ){
@ -25,8 +39,11 @@ export default {
},
methods: {
async getGoodsDetail(){
const { pics } = (await this.$u.api.getGoodsDetail({ goods_id: this.goods_id })).message
const { pics, goods_name, goods_price, goods_introduce } = (await this.$u.api.getGoodsDetail({ goods_id: this.goods_id })).message
this.pics = pics
this.goods_name = goods_name
this.goods_price = goods_price
this.goods_introduce = goods_introduce
},
showBigImgHandle(current){
const urls = this.pics.map(item => item.pics_big)
@ -51,4 +68,31 @@ export default {
height: 500rpx;
}
}
.info {
padding: 20rpx 30rpx;
.info_head {
display: flex;
.price {
flex: 1;
font-size: 36rpx;
color: #eb4450;
//
&::before {
content: "¥";
font-size: 80%;
margin-right: 3rpx;
}
}
.iconfont {
margin: 0 10rpx;
}
}
.title {
font-size: 30rpx;
line-height: 1.4;
margin: 5rpx;
}
}
</style> </style>

112
src/styles/iconfont.css Normal file

File diff suppressed because one or more lines are too long