新增自提
This commit is contained in:
parent
840ba58aa6
commit
89cf7b96db
@ -139,7 +139,7 @@ export default {
|
||||
});
|
||||
},
|
||||
// 订单步骤2:发起订单,返回订单信息
|
||||
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id }) {
|
||||
sendOrder({ ifcart, cart_id, address_id, buy_city_id, pintuan_id, pintuangroup_id, voucher_id, is_selfraising }) {
|
||||
return vm.$u.post('buy/buy_step2', {
|
||||
ifcart: ifcart,
|
||||
cart_id: cart_id,
|
||||
@ -148,6 +148,7 @@ export default {
|
||||
pintuan_id: pintuan_id,
|
||||
pintuangroup_id: pintuangroup_id,
|
||||
voucher_id: voucher_id, // 优惠券信息
|
||||
is_selfraising: is_selfraising, // 是否自提
|
||||
});
|
||||
},
|
||||
// 订单步骤3:发起支付(第三方统一下单)
|
||||
|
@ -9,7 +9,7 @@
|
||||
<view class="text">{{ content.geval_content }}</view>
|
||||
</view>
|
||||
<view class="image-container">
|
||||
<image :src="src" v-for="(src, index) in content.geval_image" :key="index" @click="previewImage(content.geval_image)"></image>
|
||||
<image :src="src" v-for="(src, index) in content.geval_image" :key="index" @click="previewImage(content.geval_image, index)"></image>
|
||||
</view>
|
||||
<view class="reply" v-if="reply && content.geval_explain">
|
||||
<view class="title">掌柜回复:</view>
|
||||
@ -41,11 +41,12 @@ export default {
|
||||
if(this.content.hasOwnProperty('scores_two')) this.rate = this.content.scores_two;
|
||||
},
|
||||
methods: {
|
||||
previewImage(urls) {
|
||||
console.log(urls);
|
||||
// uni.previewImage({
|
||||
// urls: urls,
|
||||
// });
|
||||
previewImage(urls, index) {
|
||||
// console.log(urls);
|
||||
uni.previewImage({
|
||||
urls: urls,
|
||||
current: urls[index]
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
|
@ -25,7 +25,7 @@
|
||||
<view class="order-btn" v-if="[1, 2, 3, 4, 8, 11].indexOf(order.view_type) >= 0">
|
||||
<!-- || order.view_type == 2 -->
|
||||
<view class="cancel" v-if="(order.view_type == 3 || order.view_type == 2) && order.is_refund == 1" @click="toOtherPage('RefundOrder')">申请退款</view>
|
||||
<view class="cancel" v-if="order.view_type == 3 && order.shipping_code" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="cancel" v-if="order.view_type == 3 && order.shipping_code && order.is_selfraising != 1" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="logistics" v-if="order.view_type == 3" @click="confirmReceive">确认收货</view>
|
||||
<view class="comment" v-if="order.view_type == 4" @click="toOtherPage('Comment')">立即评价</view>
|
||||
<view class="cancel" v-if="order.view_type == 1" @click="cancelOrder">取消支付</view>
|
||||
|
@ -49,7 +49,7 @@
|
||||
<!-- <navs :value="'选择尺码'"></navs> -->
|
||||
<view class="comment">
|
||||
<view class="title">
|
||||
<view class="left">商品评价({{ evaluate.evaluate_num }})</view>
|
||||
<view class="left">商品评价({{ evaluate.evaluate_num || '0' }})</view>
|
||||
<view class="right" @click="viewComment">
|
||||
<text>查看全部</text>
|
||||
<image src="/static/image/common/1.png"></image>
|
||||
|
@ -107,9 +107,15 @@ export default {
|
||||
deliveryList: [{
|
||||
text: '快递',
|
||||
value: 'express',
|
||||
disabled: false,
|
||||
}, {
|
||||
text: '骑手',
|
||||
value: 'takeawayer',
|
||||
disabled: false,
|
||||
}, {
|
||||
text: '自提',
|
||||
value: 'selfraising',
|
||||
disabled: false,
|
||||
}],
|
||||
delivery: {
|
||||
text: '快递',
|
||||
@ -123,6 +129,7 @@ export default {
|
||||
goodsClass: [],
|
||||
orderType: '', // 订单类型 1 普通订单 2 拼团订单 3 秒杀订单 4 优惠券 5 购物车订单
|
||||
debounce: true,
|
||||
is_selfraising: 0, // 是否自提:0=》否,1=》是
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -148,6 +155,8 @@ export default {
|
||||
onLoad(option) {
|
||||
this.orderType = this.$store.state.orderType;
|
||||
this.orderInfo = this.$store.state.orderInfo;
|
||||
// 判断是否可选自提
|
||||
if(!this.orderInfo.is_selfraising) this.deliveryList[2].disabled = true;
|
||||
// console.log('orderType' + this.orderType);
|
||||
// console.log(this.orderInfo);
|
||||
this.getGoodsClass();
|
||||
@ -182,8 +191,10 @@ export default {
|
||||
// console.log(this.orderInfo);
|
||||
// console.log(this.$store.state.pintuangroup_headid);
|
||||
if(this.orderInfo.pintuangroup_id) {
|
||||
Object.assign(params, { pintuangroup_headid: this.$store.state.pintuangroup_headid });
|
||||
Object.assign(params, { pintuangroup_id: this.orderInfo.pintuangroup_id });
|
||||
Object.assign(params, {
|
||||
pintuangroup_headid: this.$store.state.pintuangroup_headid,
|
||||
pintuangroup_id: this.orderInfo.pintuangroup_id
|
||||
});
|
||||
}
|
||||
console.log(params);
|
||||
this.$u.api.withImmediate(params).then(res => {
|
||||
@ -249,6 +260,7 @@ export default {
|
||||
cart_id: id,
|
||||
address_id: this.addressInfo.address_id,
|
||||
buy_city_id: this.addressInfo.city_id,
|
||||
is_selfraising: this.is_selfraising,
|
||||
}
|
||||
if(coupon.length) Object.assign(params, { voucher_id: coupon });
|
||||
if(this.orderType == 2) {
|
||||
@ -262,10 +274,9 @@ export default {
|
||||
type: 'redirect',
|
||||
url: '/pageC/cart/cashier',
|
||||
params: {
|
||||
ifcart: params.ifcart,
|
||||
pay_sn: res.data.pay_sn,
|
||||
price: res.data.order_total_amount,
|
||||
order_id: res.data.order_list[0].order_id,
|
||||
order_id: res.data.order_list[0].order_id,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
@ -282,13 +293,8 @@ export default {
|
||||
this.couponStatus = true;
|
||||
},
|
||||
useCoupon(coupon) {
|
||||
console.log(coupon)
|
||||
|
||||
|
||||
|
||||
|
||||
// console.log(coupon)
|
||||
if(this.couponType.type == 1){
|
||||
|
||||
this.choiceCoupon = {}
|
||||
for(let i in this.orderInfo.store_voucher_all_list){
|
||||
if(this.orderInfo.store_voucher_all_list[i].voucher_id == coupon.voucher_id && !this.orderInfo.store_voucher_all_list[i].sel){
|
||||
@ -338,23 +344,23 @@ export default {
|
||||
const goods = this.orderInfo.store_goods_total;
|
||||
let [freight, price, minPrice] = [0, 0, 0];
|
||||
// 运费
|
||||
for (const key in this.freight) {
|
||||
if (this.freight.hasOwnProperty(key)) {
|
||||
for(const key in this.freight) {
|
||||
if(this.freight.hasOwnProperty(key)) {
|
||||
const element = this.freight[key];
|
||||
freight += Number(element);
|
||||
}
|
||||
}
|
||||
// 商品价格减去优惠券
|
||||
// 店铺
|
||||
for (const gid in goods) {
|
||||
if (goods.hasOwnProperty(gid)) {
|
||||
for(const gid in goods) {
|
||||
if(goods.hasOwnProperty(gid)) {
|
||||
// 计算最小价格
|
||||
minPrice += 0.01;
|
||||
// 每个店铺所有商品的价格
|
||||
let sprice = Number(goods[gid]);
|
||||
if(JSON.stringify(this.storeCoupon) != '{}') {
|
||||
for (const cid in this.storeCoupon) {
|
||||
if (this.storeCoupon.hasOwnProperty(cid)) {
|
||||
for(const cid in this.storeCoupon) {
|
||||
if(this.storeCoupon.hasOwnProperty(cid)) {
|
||||
const cprice = this.storeCoupon[cid];
|
||||
// 商品减去优惠券价格
|
||||
if(gid == cid) {
|
||||
@ -378,13 +384,31 @@ export default {
|
||||
// console.log("price:" + price);
|
||||
this.totalPrice = (price + freight).toFixed(2);
|
||||
},
|
||||
setDelivery(index) {
|
||||
async setDelivery(index) {
|
||||
// console.log(index);
|
||||
if(index == 2) {
|
||||
this.is_selfraising = 1;
|
||||
for (const key in this.freight) {
|
||||
if (this.freight.hasOwnProperty(key)) {
|
||||
this.freight[key] = '0.00';
|
||||
}
|
||||
}
|
||||
this.isTakeawayer = false;
|
||||
this.setTotalPrice(); // 计算总价
|
||||
this.delivery = this.deliveryList[index];
|
||||
} else {
|
||||
this.is_selfraising = 0;
|
||||
}
|
||||
if(index == 1) {
|
||||
if(!this.isTakeawayer) this.$u.toast('此地区不支持骑手配送');
|
||||
return false;
|
||||
this.delivery = this.deliveryList[index];
|
||||
this.getFreight();
|
||||
}
|
||||
if(index == 0) {
|
||||
this.delivery = this.deliveryList[index];
|
||||
this.getFreight();
|
||||
}
|
||||
this.delivery = this.deliveryList[index];
|
||||
this.getFreight();
|
||||
},
|
||||
settlement() {
|
||||
uni.navigateTo({
|
||||
@ -471,7 +495,7 @@ export default {
|
||||
height: 60rpx;
|
||||
border-radius: 50%;
|
||||
margin-right: 15rpx;
|
||||
background-color: aquamarine;
|
||||
// background-color: aquamarine;
|
||||
}
|
||||
> view {
|
||||
font-size: 28rpx;
|
||||
@ -479,6 +503,7 @@ export default {
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
.right {
|
||||
margin-left: auto;
|
||||
flex-shrink: 0;
|
||||
width: 11rpx;
|
||||
height: 22rpx;
|
||||
@ -496,7 +521,7 @@ export default {
|
||||
width: 180rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 10rpx;
|
||||
background-color: aqua;
|
||||
// background-color: aqua;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.info {
|
||||
|
@ -39,6 +39,10 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-others">
|
||||
<view>
|
||||
<view class="title">配送方式</view>
|
||||
<view class="price" v-if="orderInfo.is_selfraising == 1">自提</view>
|
||||
</view>
|
||||
<view>
|
||||
<view class="title">运费(快递/骑手)</view>
|
||||
<view class="price">¥{{ orderInfo.shipping_fee }}</view>
|
||||
@ -75,7 +79,7 @@
|
||||
<view class="comment" v-if="orderstate == '2'" @click="toOtherPage('Comment')">立即评价</view>
|
||||
<view class="cancel" v-if="orderstate == '6'" @click="cancelOrder">取消支付</view>
|
||||
<!-- <view class="cancel" v-if="orderstate == '8'" @click="cancelOrder">取消订单</view> -->
|
||||
<view class="cancel" v-if="orderstate == '1' && orderInfo.shipping_code" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="cancel" v-if="orderstate == '1' && orderInfo.shipping_code && orderInfo.is_selfraising != 1" @click="toOtherPage('Logistics')">查看物流</view>
|
||||
<view class="phone" v-if="orderstate == '1' && orderInfo.takeawayer_mobile" @click="makePhone(orderInfo.takeawayer_mobile)">
|
||||
<u-icon name="phone-fill" color="#FF780F" size="28"></u-icon>
|
||||
<text>联系骑手</text>
|
||||
|
@ -135,7 +135,7 @@
|
||||
"backgroundColor":"#ffffff",
|
||||
"buttons": [
|
||||
{
|
||||
// "type":"none",
|
||||
"type":"none",
|
||||
"text":"\ue636",
|
||||
"float":"right",
|
||||
"fontSize":"18",
|
||||
|
Loading…
Reference in New Issue
Block a user