Merge branch 'bookxiangqing'
This commit is contained in:
@@ -327,7 +327,7 @@
|
|||||||
// 点击购物车
|
// 点击购物车
|
||||||
onClick(e) {
|
onClick(e) {
|
||||||
console.log(e.content.text)
|
console.log(e.content.text)
|
||||||
uni.switchTab({
|
uni.navigateTo({
|
||||||
url: '../peanut/shopping'
|
url: '../peanut/shopping'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
<text>{{item.productName}}</text>
|
<text>{{item.productName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemPrice">
|
<view class="itemPrice">
|
||||||
<text>¥{{item.price*item.productAmount}}</text>
|
<text v-if="item.activityPrice && item.activityPrice > 0">¥{{item.activityPrice*item.productAmount}}</text>
|
||||||
|
<text v-else>¥{{item.price*item.productAmount}}</text>
|
||||||
<u-number-box v-model="item.productAmount" @change="valChange($event, item)" :input-width="50"
|
<u-number-box v-model="item.productAmount" @change="valChange($event, item)" :input-width="50"
|
||||||
:input-height="20" :min="1" :max="item.productStock" integer ></u-number-box>
|
:input-height="20" :min="1" :max="item.productStock" integer ></u-number-box>
|
||||||
</view>
|
</view>
|
||||||
@@ -403,12 +404,17 @@
|
|||||||
this.$http
|
this.$http
|
||||||
.post('book/shopproduct/info/' + e)
|
.post('book/shopproduct/info/' + e)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
console.log(res)
|
||||||
let prodCont = {}
|
let prodCont = {}
|
||||||
prodCont.productId = res.shopProduct.productId
|
prodCont.productId = res.shopProduct.productId
|
||||||
prodCont.image = res.shopProduct.productImages
|
prodCont.image = res.shopProduct.productImages
|
||||||
prodCont.productName = res.shopProduct.productName
|
prodCont.productName = res.shopProduct.productName
|
||||||
prodCont.productAmount = 1
|
prodCont.productAmount = 1
|
||||||
prodCont.price = res.shopProduct.price
|
if(res.shopProduct.activityPrice && res.shopProduct.activityPrice > 0){
|
||||||
|
prodCont.price = res.shopProduct.activityPrice
|
||||||
|
}else{
|
||||||
|
prodCont.price = res.shopProduct.price
|
||||||
|
}
|
||||||
prodCont.weight = res.shopProduct.weight
|
prodCont.weight = res.shopProduct.weight
|
||||||
this.cartList.push(prodCont)
|
this.cartList.push(prodCont)
|
||||||
this.getCourpe()
|
this.getCourpe()
|
||||||
@@ -467,7 +473,11 @@
|
|||||||
let allprice = 0;
|
let allprice = 0;
|
||||||
this.cartList.forEach((item, index) => {
|
this.cartList.forEach((item, index) => {
|
||||||
let price = 0;
|
let price = 0;
|
||||||
price = item.productAmount * item.price;
|
if(item.activityPrice && item.activityPrice > 0){
|
||||||
|
price = item.productAmount * item.activityPrice;
|
||||||
|
}else{
|
||||||
|
price = item.productAmount * item.price;
|
||||||
|
}
|
||||||
allprice += price
|
allprice += price
|
||||||
})
|
})
|
||||||
this.totalPrice = allprice
|
this.totalPrice = allprice
|
||||||
|
|||||||
@@ -37,7 +37,8 @@
|
|||||||
<text>{{item.productName}}</text>
|
<text>{{item.productName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemPrice">
|
<view class="itemPrice">
|
||||||
<text>¥{{item.price*item.productAmount}}</text>
|
<text v-if="item.activityPrice && item.activityPrice > 0">¥{{item.activityPrice*item.productAmount}}</text>
|
||||||
|
<text v-else>¥{{item.price*item.productAmount}}</text>
|
||||||
<u-number-box v-model="item.productAmount" @change="valChange($event, item)" :input-width="50"
|
<u-number-box v-model="item.productAmount" @change="valChange($event, item)" :input-width="50"
|
||||||
:input-height="20" :min="1" :max="item.productStock" integer ></u-number-box>
|
:input-height="20" :min="1" :max="item.productStock" integer ></u-number-box>
|
||||||
</view>
|
</view>
|
||||||
@@ -430,7 +431,11 @@
|
|||||||
prodCont.image = res.shopProduct.productImages
|
prodCont.image = res.shopProduct.productImages
|
||||||
prodCont.productName = res.shopProduct.productName
|
prodCont.productName = res.shopProduct.productName
|
||||||
prodCont.productAmount = 1
|
prodCont.productAmount = 1
|
||||||
prodCont.price = res.shopProduct.price
|
if(res.shopProduct.activityPrice && res.shopProduct.activityPrice > 0){
|
||||||
|
prodCont.price = res.shopProduct.activityPrice
|
||||||
|
}else{
|
||||||
|
prodCont.price = res.shopProduct.price
|
||||||
|
}
|
||||||
prodCont.weight = res.shopProduct.weight
|
prodCont.weight = res.shopProduct.weight
|
||||||
this.cartList.push(prodCont)
|
this.cartList.push(prodCont)
|
||||||
this.getCourpe()
|
this.getCourpe()
|
||||||
@@ -489,7 +494,11 @@
|
|||||||
let allprice = 0;
|
let allprice = 0;
|
||||||
this.cartList.forEach((item, index) => {
|
this.cartList.forEach((item, index) => {
|
||||||
let price = 0;
|
let price = 0;
|
||||||
price = item.productAmount * item.price;
|
if(item.activityPrice && item.activityPrice > 0){
|
||||||
|
price = item.productAmount * item.activityPrice;
|
||||||
|
}else{
|
||||||
|
price = item.productAmount * item.price;
|
||||||
|
}
|
||||||
allprice += price
|
allprice += price
|
||||||
})
|
})
|
||||||
this.totalPrice = allprice
|
this.totalPrice = allprice
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
<text>搜索</text>
|
<text>搜索</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="home_lunbo">
|
<!-- <view class="home_lunbo">
|
||||||
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
|
<u-swiper :list="list3" indicator indicatorMode="line" circular style="height: 180rpx;"></u-swiper>
|
||||||
</view>
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
<!-- <view class="home_nar" v-if="showEbook"> -->
|
<!-- <view class="home_nar" v-if="showEbook"> -->
|
||||||
<view class="home_nar">
|
<view class="home_nar">
|
||||||
@@ -633,9 +633,9 @@
|
|||||||
background-position: center center;
|
background-position: center center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
padding: 100rpx 20rpx 40rpx 20rpx;
|
padding: 20rpx;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 400rpx; margin-bottom: 130rpx;
|
// height: 400rpx; margin-bottom: 130rpx;
|
||||||
.icon_hua_1 {
|
.icon_hua_1 {
|
||||||
// margin: 0 auto;
|
// margin: 0 auto;
|
||||||
width: 150rpx;
|
width: 150rpx;
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
<text>{{item.productName}}</text>
|
<text>{{item.productName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="itemPrice">
|
<view class="itemPrice">
|
||||||
<text>¥{{item.price*item.productAmount}}</text>
|
<text v-if="item.activityPrice && item.activityPrice > 0">¥{{item.activityPrice*item.productAmount}}</text>
|
||||||
|
<text v-else>¥{{item.price*item.productAmount}}</text>
|
||||||
<u-number-box v-model="item.productAmount" @change="valChange($event,item)" :input-width="50"
|
<u-number-box v-model="item.productAmount" @change="valChange($event,item)" :input-width="50"
|
||||||
:input-height="20" :min="1" :max="item.productStock" integer @overlimit='overlimit'></u-number-box>
|
:input-height="20" :min="1" :max="item.productStock" integer @overlimit='overlimit'></u-number-box>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
Reference in New Issue
Block a user