完善商品数据提交
This commit is contained in:
@ -25,36 +25,30 @@
|
||||
<!-- 轮播图 -->
|
||||
<view class="swiper u-relative">
|
||||
<u-swiper height="524" :list="adList" border-radius="0"></u-swiper>
|
||||
<view class="balance bg-white u-flex">
|
||||
<view>
|
||||
<navigator class="u-flex u-row-center" url="/pages/my/wallet" hover-class="none">
|
||||
<u-image :src="cloudPath + 'img/icon_balance.png'" width="52" height="52"></u-image>
|
||||
<view class="u-m-l-60 u-text-center">
|
||||
<view class="nr">{{userInfo.user_money || 0.00}}</view>
|
||||
<view class="text-default xs">余额</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<navigator class="u-flex u-row-center" url="/bundle/pages/points/points" hover-class="none">
|
||||
<u-image :src="cloudPath + 'img/icon_points.png'" width="52" height="52"></u-image>
|
||||
<view class="u-m-l-60 u-text-center">
|
||||
<view class="nr">{{ userInfo.user_integral || 0}}</view>
|
||||
<view class="text-default xs">积分</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<navigator class="u-flex u-row-center" url="/bundle/pages/coupon/coupon" hover-class="none">
|
||||
<u-image :src="cloudPath + 'img/icon_coupon.png'" width="52" height="52"></u-image>
|
||||
<view class="u-m-l-60 u-text-center">
|
||||
<view class="nr">{{ userInfo.coupon || 0}}</view>
|
||||
<view class="text-default xs u-text-center">券</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="balance bg-white row-between u-p-l-54 u-p-r-54">
|
||||
<navigator class="u-flex u-row-center" url="/pages/my/wallet" hover-class="none">
|
||||
<u-image :src="cloudPath + 'img/icon_balance.png'" width="52" height="52"></u-image>
|
||||
<view class="u-m-l-60 u-text-center">
|
||||
<view class="nr">{{userInfo.user_money || 0.00}}</view>
|
||||
<view class="text-default xs">余额</view>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
<navigator class="u-flex u-row-center" url="/bundle/pages/points/points" hover-class="none">
|
||||
<u-image :src="cloudPath + 'img/icon_points.png'" width="52" height="52"></u-image>
|
||||
<view class="u-m-l-60 u-text-center">
|
||||
<view class="nr">{{ userInfo.user_integral || 0}}</view>
|
||||
<view class="text-default xs">积分</view>
|
||||
</view>
|
||||
</navigator>
|
||||
|
||||
<navigator class="u-flex u-row-center" url="/bundle/pages/coupon/coupon" hover-class="none">
|
||||
<u-image :src="cloudPath + 'img/icon_coupon.png'" width="52" height="52"></u-image>
|
||||
<view class="u-m-l-60 u-text-center">
|
||||
<view class="nr">{{ userInfo.coupon || 0}}</view>
|
||||
<view class="text-default xs u-text-center">券</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -192,18 +186,15 @@
|
||||
width: 100%;
|
||||
|
||||
.balance {
|
||||
// display: grid;
|
||||
// grid-template-columns: repeat(3, 1fr);
|
||||
// place-items: center;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0 20rpx;
|
||||
height: 140rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
|
||||
& > view {
|
||||
width: 33.33%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<text class="text-999 ml20">随时退 过期自动退</text>
|
||||
</view>
|
||||
<view>
|
||||
<u-button @click="chooseSpec" hover-class="none"
|
||||
<u-button @click="showSpec = true" hover-class="none"
|
||||
: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 @click="onBuy" hover-class="none"
|
||||
<u-button hover-class="none" @click="onBuy"
|
||||
:customStyle="{height: '92rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
|
||||
:hair-line="false"
|
||||
shape="circle">
|
||||
@ -78,7 +78,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<shop-spec v-model="showSpec" @close="showSpec = false"></shop-spec>
|
||||
<shop-spec v-model="showSpec" :spec="goods.goods_spec" @close="showSpec = false" @confirm="confirmSpec"></shop-spec>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -98,7 +98,8 @@
|
||||
return {
|
||||
id: 0,
|
||||
showSpec: false,
|
||||
goods: []
|
||||
goods: [],
|
||||
spec: [],
|
||||
}
|
||||
},
|
||||
|
||||
@ -126,13 +127,25 @@
|
||||
}
|
||||
},
|
||||
|
||||
chooseSpec() {
|
||||
this.showSpec = true
|
||||
// 获取选择的商品规格
|
||||
confirmSpec(data) {
|
||||
console.log("data>>>", data.spec);
|
||||
this.spec = data.spec
|
||||
this.showSpec = false
|
||||
},
|
||||
|
||||
// 购买商品
|
||||
onBuy() {
|
||||
// 这里需压判断选购规格
|
||||
if (!this.isLogin) return toLogin();
|
||||
this.$store.commit("setBuyGoods", {
|
||||
id: this.id, // 商品id
|
||||
num: 1, // 购买商品数量
|
||||
spec: this.spec // 选中的商品规格
|
||||
});
|
||||
|
||||
console.log("this.$>>>", this.$store.state.goods.buyGoods);
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/order_now/order_now`
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user