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