|
@@ -31,9 +31,9 @@
|
|
|
</view>
|
|
|
|
|
|
<view class="message-box">
|
|
|
- <view class="goods-title"> 猫牙米·卖瓜的(红雷店) </view>
|
|
|
+ <view class="goods-title"> {{ init_list.merchantDTO.name }} </view>
|
|
|
<u-line margin='20rpx 0'></u-line>
|
|
|
- <view class="goods-item" v-for="(item,index) of init_list" :key='item.goodsId'>
|
|
|
+ <view class="goods-item" v-for="(item,index) of init_list.cartItems" :key='item.goodsId'>
|
|
|
<view class="item-left">
|
|
|
<image class="left-img" src="@/static/QR57a.jpg"></image>
|
|
|
<view class="left-text">
|
|
@@ -41,7 +41,7 @@
|
|
|
<view class="text-number">×{{ item.quantity }}</view>
|
|
|
<view class="price-box">
|
|
|
<p class="price red-color"> <span style="font-size: 24rpx;">¥</span>{{ item.price }}</p><span
|
|
|
- class="false-price">¥{{ item.price }}</span>
|
|
|
+ class="false-price">¥{{ item.originalPrice }}</span>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -77,8 +77,8 @@
|
|
|
<view class="message-item">
|
|
|
<view class="item-left"> 订单总价 </view>
|
|
|
<view class=" flex-end red-color" style="align-items: center;">
|
|
|
- <p style="margin-right: 20rpx; font-size: 36rpx; font-weight: bold;">¥{{ orderParams.allPrice.toFixed(2) }}</p>
|
|
|
- <p>( 已优惠¥{{ orderParams.discountPrice.toFixed(2) }} )</p>
|
|
|
+ <p style="margin-right: 20rpx; font-size: 36rpx; font-weight: bold;">¥{{ orderParams.price.toFixed(2) }}</p>
|
|
|
+ <p>( 已优惠¥{{ orderParams.allPrice.toFixed(2) }} )</p>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -139,7 +139,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { getShoppingCart ,generateOrder } from "@/api/client/business.js"
|
|
|
+ import { getShoppingCart ,generateOrder ,getCartList} from "@/api/client/business.js"
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
@@ -190,37 +190,43 @@
|
|
|
let price = 0
|
|
|
let discountPrice = 0
|
|
|
let allPrice = 0
|
|
|
- this.init_list.map(rs=>{
|
|
|
+ this.init_list.cartItems.map(rs=>{
|
|
|
price += Number( rs.price * rs.quantity )
|
|
|
- discountPrice += Number( rs.price * rs.quantity )
|
|
|
+ discountPrice += Number( rs.originalPrice * rs.quantity )
|
|
|
})
|
|
|
- allPrice = price - discountPrice
|
|
|
- return { allPrice , discountPrice }
|
|
|
+ allPrice = discountPrice - price
|
|
|
+ return { allPrice , price }
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
handlerInitList(){
|
|
|
- getShoppingCart().then(res=>{
|
|
|
+ getCartList(this.merchantId).then(res=>{
|
|
|
this.init_list = res.data
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
// 结算按钮
|
|
|
handlerSettleBtn(){
|
|
|
|
|
|
- // uni.navigateTo({
|
|
|
- // url:'/pages/client/clientPackage/settleStatusPage'
|
|
|
- // })
|
|
|
-
|
|
|
let params = {
|
|
|
payType:'2',
|
|
|
cartIds:[],
|
|
|
- merchantId:this.merchantId
|
|
|
+ merchantId:this.init_list.merchantDTO.id
|
|
|
}
|
|
|
- this.init_list.map(rs=>{
|
|
|
+ this.init_list.cartItems.map(rs=>{
|
|
|
params.cartIds.push(rs.goodsId)
|
|
|
})
|
|
|
generateOrder(params).then(res=>{
|
|
|
- console.log("@@@@res",res)
|
|
|
+ if(res.code == 200){
|
|
|
+ uni.navigateTo({
|
|
|
+ url:'/pages/client/clientPackage/settleStatusPage'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title:res.msg,
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
})
|
|
|
|
|
|
|