完善功能
This commit is contained in:
@ -2,19 +2,19 @@
|
||||
<view>
|
||||
<view class="shop">
|
||||
<view>
|
||||
<u-swiper :list="list" height="500" border-radius="0" mode="number" indicator-pos="bottomRight"></u-swiper>
|
||||
<u-swiper :list="goods.goods_image" name="uri" height="500" border-radius="0" mode="number" indicator-pos="bottomRight"></u-swiper>
|
||||
</view>
|
||||
|
||||
<view class="bg-white mx24 px24 u-m-t-24 u-padding-top-20 u-padding-bottom-20 br24">
|
||||
<view class="nr">煎饼果子套餐</view>
|
||||
<view class="nr">{{ goods.name }}</view>
|
||||
<view class="mt10 row u-row-between">
|
||||
<view class="row">
|
||||
<view class="primary">
|
||||
<price-format :price="12.9" :subscriptSize="22" :firstSize="34" :secondSize="26"></price-format>
|
||||
<price-format :price="goods.min_price" :subscriptSize="22" :firstSize="34" :secondSize="26"></price-format>
|
||||
</view>
|
||||
<view class="sale u-text-center primary u-m-l-12">0折</view>
|
||||
<view class="primary u-m-l-12">
|
||||
<price-format :lineThrough="true" color="#999" :subscriptSize="22" :firstSize="22" :secondSize="22" :price="16.9"></price-format>
|
||||
<price-format :lineThrough="true" color="#999" :subscriptSize="22" :firstSize="22" :secondSize="22" :price="goods.market_price"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
<view class="text-999">已售66</view>
|
||||
@ -36,7 +36,7 @@
|
||||
</view>
|
||||
<view>
|
||||
<u-button @click="chooseSpec" hover-class="none"
|
||||
:customStyle="{width: '116rpx', height: '46rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
|
||||
:customStyle="{width: '116rpx', height: '46rpx', lineHeight: '46rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
|
||||
:hair-line="false"
|
||||
shape="circle">
|
||||
选规格
|
||||
@ -69,7 +69,7 @@
|
||||
<view>门店</view>
|
||||
</view>
|
||||
<view class="u-m-l-64 flex1">
|
||||
<u-button hover-class="none"
|
||||
<u-button @click="onBuy" hover-class="none"
|
||||
:customStyle="{height: '92rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
|
||||
:hair-line="false"
|
||||
shape="circle">
|
||||
@ -83,6 +83,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getGoodsDetail,
|
||||
addCart,
|
||||
getPoster,
|
||||
getCartNum
|
||||
} from '@/api/store';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -96,12 +103,46 @@
|
||||
title: "身无彩凤双飞翼,心有灵犀一点通",
|
||||
}
|
||||
],
|
||||
showSpec: false
|
||||
id: 0,
|
||||
showSpec: false,
|
||||
goods: []
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
this.id = options.id
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.getGoodsDetailFun();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取商品详情
|
||||
async getGoodsDetailFun() {
|
||||
const {
|
||||
data,
|
||||
code
|
||||
} = await getGoodsDetail({
|
||||
id: this.id
|
||||
});
|
||||
if (code == 1) {
|
||||
this.goods = data
|
||||
console.log(this.goods.goods_image);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
chooseSpec() {
|
||||
this.showSpec = true
|
||||
},
|
||||
|
||||
// 购买商品
|
||||
onBuy() {
|
||||
console.log(this.isLogin);
|
||||
uni.navigateTo({
|
||||
url: `/pages/order_now/order_now`
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user