Feat(订单):新增再买一单功能
This commit is contained in:
@@ -160,4 +160,13 @@ export function orderVerific(verifyCode, isConfirm) {
|
||||
// 延迟收货
|
||||
export function orderDelay(uni) {
|
||||
return request.post("/order/extendedDelivery", {uni})
|
||||
}
|
||||
|
||||
/**
|
||||
* 再买一单
|
||||
* @param {*} params
|
||||
* @returns
|
||||
*/
|
||||
export function aginConfirm(params) {
|
||||
return request.post('/order/buyAgainConfirm', params)
|
||||
}
|
||||
@@ -341,7 +341,7 @@
|
||||
<view class="v12-justify-between " style="width: 100%">
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
|
||||
<view class="v12-justify-between">
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyOrder">再买一单</view>
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
|
||||
<view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</view>
|
||||
<!-- <view class="bnt v12-dark-text v12-dark-border default" @click="
|
||||
$yrouter.push({ path: '/pages/order/Logistics/index' ,query:{id:orderInfo.orderId }})
|
||||
@@ -358,14 +358,14 @@
|
||||
<template v-if="status.type == -2">
|
||||
<view class="v12-justify-between " style="width: 100%">
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyOrder">再买一单</view>
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
|
||||
</view>
|
||||
</template>
|
||||
<template v-if="status.type == -3">
|
||||
<view class="v12-justify-between " style="width: 100%">
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="goRoom(orderInfo)">联系商家</view>
|
||||
<view class="v12-justify-between ">
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyOrder">再买一单</view>
|
||||
<view class="bnt v12-dark-text v12-dark-border cancel" @click="buyAgin">再买一单</view>
|
||||
<view class="bnt v12-primary-text v12-primary-border" @click="routerGo(orderInfo.cartInfo[0])">立即评价</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -400,7 +400,7 @@
|
||||
<script>
|
||||
import passkeyborad from '@/components/yzc-paykeyboard/yzc-paykeyboard'
|
||||
import OrderGoods from "@/components/OrderGoods";
|
||||
import {orderDetail, orderDelay} from "@/api/order";
|
||||
import {orderDetail, orderDelay, aginConfirm} from "@/api/order";
|
||||
import Payment from "@/components/Payment";
|
||||
import DataFormat from "@/components/DataFormat";
|
||||
import {copyClipboard} from "@/utils";
|
||||
@@ -474,6 +474,19 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
copyClipboard,
|
||||
buyAgin() {
|
||||
const params = {
|
||||
orderId: this.orderInfo.orderId
|
||||
}
|
||||
aginConfirm(params).then(res => {
|
||||
const ids = res.data.cartInfo.map(e => e.id)
|
||||
const addressInfo = res.data.addressInfo
|
||||
if (ids.length === 0) return
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/OrderSubmission/index?id=' + ids.join(',') + '&address=' + JSON.stringify(addressInfo)
|
||||
})
|
||||
})
|
||||
},
|
||||
goAddress() {
|
||||
uni.navigateTo({
|
||||
url:'/pages/user/address/AddressManagement/index'
|
||||
@@ -490,21 +503,18 @@ export default {
|
||||
});
|
||||
},
|
||||
buyOrder() {
|
||||
// console.log(this.orderInfo);
|
||||
// let q = {
|
||||
// productId: this,
|
||||
// cartNum: that.attr.productSelect.cart_num,
|
||||
// new: 1,
|
||||
// uniqueId: that.attr.productSelect !== undefined ?
|
||||
// that.attr.productSelect.unique : ""
|
||||
// };
|
||||
// const ids = this.orderInfo.cartId
|
||||
// console.log(ids);
|
||||
|
||||
// if (ids.length === 0) return
|
||||
// uni.navigateTo({
|
||||
// url: '/pages/order/OrderSubmission/index?id=' + ids
|
||||
// })
|
||||
let q = {
|
||||
productId: this,
|
||||
cartNum: that.attr.productSelect.cart_num,
|
||||
new: 1,
|
||||
uniqueId: that.attr.productSelect !== undefined ?
|
||||
that.attr.productSelect.unique : ""
|
||||
};
|
||||
const ids = this.orderInfo.cartId
|
||||
if (ids.length === 0) return
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/OrderSubmission/index?id=' + ids
|
||||
})
|
||||
},
|
||||
routerGo(cart) {
|
||||
this.$yrouter.push({
|
||||
|
||||
Reference in New Issue
Block a user