|
@@ -28,20 +28,8 @@
|
|
|
<view class="name ellipsis-2" @click="$u.route('/shopping/productdetails',{id:item.goodsId})">{{item.goodsName}}</view>
|
|
|
<view class="u-flex u-row-between">
|
|
|
<view class="left">
|
|
|
- <view class="up">
|
|
|
- <view class="" v-if="vuex_member_info.priceType>1">
|
|
|
- <text class="price">¥ <text class="price-num">{{item.vipPrice}}</text></text>
|
|
|
- <text class="vip-icon">VIP</text>
|
|
|
- </view>
|
|
|
- <view class="" v-else>
|
|
|
- <text class="price">¥ <text class="price-num">{{item.salePrice}}</text></text>
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <view class="down">
|
|
|
- <!-- <text class="discount">8.8折</text> -->
|
|
|
- <text v-if="vuex_member_info.priceType>1" class="original-price gray line-through">¥ {{item.salePrice}}</text>
|
|
|
- <!-- <text class="sales gray">销量999+</text> -->
|
|
|
- </view>
|
|
|
+ <text class="red" style="font-size: 24rpx;">供货价</text>
|
|
|
+ <text class="price">¥ <text class="price-num">{{item.patchPrice}}</text></text>
|
|
|
</view>
|
|
|
<u-number-box
|
|
|
v-model="item.quantity"
|
|
@@ -62,7 +50,7 @@
|
|
|
</mescroll-body>
|
|
|
|
|
|
</view>
|
|
|
- <view class="recommend" v-if="dataList.length>=total">
|
|
|
+ <!-- <view class="recommend" v-if="dataList.length>=total">
|
|
|
<view class="til u-flex">
|
|
|
<u-icon name="heart" color="#FF3C3F" size="28"></u-icon>
|
|
|
<text class="text">为你推荐</text>
|
|
@@ -81,7 +69,7 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- </view>
|
|
|
+ </view> -->
|
|
|
<view class="cart-bottom">
|
|
|
<view class="inner u-flex u-row-between">
|
|
|
<view class="left u-flex">
|
|
@@ -94,8 +82,8 @@
|
|
|
合计:{{totalPrice}}
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="btn active" v-if="selectGoods.length>0&&cansubmit" @click="submitorder">去结算</view>
|
|
|
- <view class="btn" v-else>去结算</view>
|
|
|
+ <view class="btn active" v-if="selectGoods.length>0&&cansubmit" @click="submitorder">提交</view>
|
|
|
+ <view class="btn" v-else>提交</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<u-toast ref="uToast"></u-toast>
|
|
@@ -108,6 +96,17 @@
|
|
|
mixins: [MescrollMixin,systemInfo], // 使用mixin
|
|
|
data() {
|
|
|
return {
|
|
|
+ downOption: {},
|
|
|
+ // 上拉加载的配置(可选, 绝大部分情况无需配置)
|
|
|
+ upOption: {
|
|
|
+ page: {
|
|
|
+ size: 10 // 每页数据的数量,默认10
|
|
|
+ },
|
|
|
+ noMoreSize: 5, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
|
|
|
+ empty: {
|
|
|
+ tip: '暂无相关数据'
|
|
|
+ }
|
|
|
+ },
|
|
|
cansubmit:true,
|
|
|
hasAddr:false,
|
|
|
buyNowId:null,//立即购买id
|
|
@@ -157,11 +156,7 @@
|
|
|
return this.dataList.reduce((total, item) => {
|
|
|
if (item.checked) {
|
|
|
let price = null;
|
|
|
- if(that.vuex_member_info.priceType>1){
|
|
|
- price = item.vipPrice
|
|
|
- }else{
|
|
|
- price = item.salePrice
|
|
|
- }
|
|
|
+ price = item.patchPrice
|
|
|
total += price * item.quantity;
|
|
|
}
|
|
|
return total;
|
|
@@ -174,7 +169,7 @@
|
|
|
this.buyNowName = page.buyNowName;
|
|
|
},
|
|
|
onShow() {
|
|
|
- this.getAddrList();
|
|
|
+ // this.getAddrList();
|
|
|
},
|
|
|
methods: {
|
|
|
/*下拉刷新的回调, 重置列表为第一页 (此处可删,mixins已默认)
|
|
@@ -253,9 +248,10 @@
|
|
|
console.log('allCheckboxChange',n);
|
|
|
let selectAll = n[0]?true:false;
|
|
|
this.dataList.forEach(item => {
|
|
|
- if(item.quantity<=item.stock){
|
|
|
- item.checked = selectAll
|
|
|
- }
|
|
|
+ item.checked = selectAll
|
|
|
+ // if(item.quantity<=item.stock){
|
|
|
+ // item.checked = selectAll
|
|
|
+ // }
|
|
|
})
|
|
|
},
|
|
|
checkboxChange(n){
|
|
@@ -271,7 +267,7 @@
|
|
|
this.changeQuantityApi(this.dataList[index].id,value.value,index)
|
|
|
},
|
|
|
changeQuantityApi(id,num,index){
|
|
|
- this.$u.api.updateQuantity({id:id,quantity:num}).then(res=>{
|
|
|
+ this.$u.api.updateQuantity({cartId:id,num:num,type:0}).then(res=>{
|
|
|
this.dataList[index].quantity = num;
|
|
|
console.log('res',res.data);
|
|
|
}).catch(err=>{
|
|
@@ -312,43 +308,18 @@
|
|
|
// console.log('submitorder',this.selectGoods);
|
|
|
this.cansubmit = false;
|
|
|
let param = {};
|
|
|
- if(!this.hasAddr){
|
|
|
- // this.$refs.uToast.show({
|
|
|
- // type: 'error',
|
|
|
- // title: '提示',
|
|
|
- // message: "请先去'我的-地址管理'设置收货地址!",
|
|
|
- // duration:3000
|
|
|
- // })
|
|
|
- uni.showModal({
|
|
|
- title: '温馨提示',
|
|
|
- content: '请先设置地址!',
|
|
|
- success: res => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.$u.route('/center/addrlist', {
|
|
|
- from: 'cart',
|
|
|
- backUrl:'/shopping/cart'
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
param.goodsList = this.selectGoods.map(item=>{
|
|
|
return {goodsId:item.goodsId,quantity:item.quantity}
|
|
|
})
|
|
|
- this.$u.vuex('cartGoods', param.goodsList);
|
|
|
- uni.$u.route('/shopping/submitorder', {});
|
|
|
- this.cansubmit = true;
|
|
|
- // // console.log('param',param);取消在这个获取订单结算详情
|
|
|
- // this.$u.api.getSettlement(param).then(res=>{
|
|
|
- // console.log('submitorder',res.data);
|
|
|
- // // return
|
|
|
- // uni.$u.route('/shopping/submitorder', {
|
|
|
- // selectGoods: JSON.stringify(res.data),
|
|
|
- // });
|
|
|
- // }).catch(err=>{
|
|
|
- // console.log('getSettlement',err.data);
|
|
|
- // })
|
|
|
+ param.ifCartSubmint = true;
|
|
|
+
|
|
|
+ this.$u.api.submitOrder(param).then(res=>{
|
|
|
+ uni.$u.route('/shopping/paysuccess');
|
|
|
+ this.cansubmit = true;
|
|
|
+ }).catch(err=>{
|
|
|
+ console.log('getAddrList',err.data);
|
|
|
+ });
|
|
|
+
|
|
|
},
|
|
|
delSelect(){
|
|
|
let that = this;
|
|
@@ -408,7 +379,7 @@
|
|
|
.til{
|
|
|
position: sticky;
|
|
|
background-color: #fff;
|
|
|
- z-index: 1001;
|
|
|
+ z-index: 999;
|
|
|
padding-bottom: 10rpx;
|
|
|
margin-bottom: 20rpx;
|
|
|
min-height: 30px;
|