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