Browse Source

订单

devlop
mo-bai 4 years ago
parent
commit
c7c3098bd3
8 changed files with 61 additions and 19 deletions
  1. 12
      apis/orderApi.js
  2. 6
      enums/index.js
  3. 6
      pages/cart/index.vue
  4. 26
      pages/order-detail/index.vue
  5. 21
      pages/order-make/index.vue
  6. 7
      pages/paper-details/index.vue
  7. 2
      pages/store/index.vue
  8. BIN
      static/imgs/order/wxpay-icon.png

12
apis/orderApi.js

@ -125,3 +125,15 @@ export function calcNotInvoiceOrderInfo(data) {
data
})
}
/**
* 获取供应商收款码
* @param {object} data mallSupplierId
* @returns {Promise<Object>}
*/
export function getReciptCode(data) {
return http.get({
url: '/yyt-uec/get/mall/supplier/payee/code/byId',
data
})
}

6
enums/index.js

@ -227,10 +227,10 @@ export const paymentMethodMap = {
}
/**
* 订单是否开票 0:开票 1:不开票
* 订单是否开票 1:开票 0:不开票
* 默认开票
*/
export const invoiceStatusEnum = {
INVOICE: 0,
NO_INVOICE: 1
INVOICE: 1,
NO_INVOICE: 0
}

6
pages/cart/index.vue

@ -46,7 +46,7 @@
<view class="weight">预估重量{{ subItem.weight }}</view>
<view class="price-row">
<view class="value">¥{{ subItem.price }}</view>
<view class=""><qnInputNumber :quantity="subItem.quantity" @change="change($event, item, subItem)" /></view>
<view class=""><qnInputNumber :quantity="subItem.quantity" @input="change($event, subItem)" /></view>
</view>
</view>
</view>
@ -171,7 +171,7 @@ export default {
})
})
}
return num
return round(num, 2)
}
},
methods: {
@ -344,7 +344,7 @@ export default {
* @param {Number} num
* 计数器返回值
*/
change(num, shop, good) {
change(num, good) {
good.quantity = num
good.weight = round(good.gramWeight * good.width * good.length * good.quantity * 1e-12, 4)
}

26
pages/order-detail/index.vue

@ -24,8 +24,14 @@
<view class="flex-row-center-space header">
<text style="font-size: 32rpx; font-weight: 600">{{ supplierOrder.supplierEnterpriseName }}</text>
<view>
<!-- 微信支付待付款 -->
<view v-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_PAY" class="button-item" @click="confirmWxPay(supplierOrder.mallSupplierId)">
去付款
</view>
<!-- 待收货展示 -->
<view v-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_RECEIVE" class="button-item" @click="confirmReceive(supplierOrder)">确认收货</view>
<view v-else-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_RECEIVE" class="button-item" @click="confirmReceive(supplierOrder)">
确认收货
</view>
<!-- 待借款展示 -->
<view v-else-if="supplierOrder.status == supplierOrderStatusEnum.WAIT_CLIENT_LOAN" class="button-item" @click="goFsPage()">去借款</view>
<!-- 飞算支付且待还款状态 -->
@ -144,7 +150,7 @@
<script>
import { go2, back, uploadImage } from '@/utils/hook.js'
import { getClientOrderInfo, clientUploadVoucher, clientDeleteVoucher, clientConfirmOrder } from '@/apis/orderApi.js'
import { getClientOrderInfo, clientUploadVoucher, clientDeleteVoucher, clientConfirmOrder, getReciptCode } from '@/apis/orderApi.js'
import { transformFileToImg, getFeisuanUrl } from '@/apis/commonApi.js'
import { orderStatusEnum, supplierOrderStatusMap, supplierOrderStatusEnum, paymentMethodMap, paymentMethodEnum } from '@/enums/index.js'
const statusImg = {
@ -327,6 +333,22 @@ export default {
}
})
},
//
confirmWxPay(mallSupplierId) {
getReciptCode({ mallSupplierId }).then((res) => {
if (res.payeeCodeUrl) {
uni.previewImage({
urls: [res.payeeCodeUrl],
current: res.payeeCodeUrl
})
} else {
uni.showToast({
title: '暂无二维码,请联系供应商',
icon: 'error'
})
}
})
},
clip(content) {
uni.setClipboardData({
data: content,

21
pages/order-make/index.vue

@ -127,6 +127,17 @@
余额不足
</text>
</view>
<view class="pay-item" style="border: none">
<view class="left">
<image class="img" src="/static/imgs/order/wxpay-icon.png"></image>
<text style="font-size: 30rpx; color: #000000; margin: 0 16rpx">使用现款支付</text>
</view>
<image
@click="selectPayMethod('wxpay')"
class="img"
:src="currentPayType == 'wxpay' ? '/static/imgs/order/selected-icon.png' : '/static/imgs/order/select-icon.png'"
></image>
</view>
</view>
<qn-footer fixed height="120rpx">
<view class="button-area">
@ -166,10 +177,13 @@ export default {
fs: {
availableCreditLine: 0,
value: 4
},
wxpay: {
value: 1
}
},
loading: false,
isInvoice: true //
isInvoice: true //
}
},
onLoad(option) {
@ -220,7 +234,7 @@ export default {
//
calcNotInvoiceOrderInfo({
customerOrderId: this.orderInfo.orderId,
isPayTaxes: invoiceStatusEnum.NO_INVOICE // 1:
invoiceOrNot: invoiceStatusEnum.NO_INVOICE // 1:
}).then((res) => {
if (res) {
this.noInvoiceInfo = res
@ -263,7 +277,8 @@ export default {
itemsRemarkList,
orderId: this.orderInfo.orderId,
paymentMethod: this.payMap[this.currentPayType].value,
receivedTime: this.orderInfo.receivedTime
receivedTime: this.orderInfo.receivedTime,
invoiceOrNot: this.isInvoice ? invoiceStatusEnum.INVOICE : invoiceStatusEnum.NO_INVOICE
})
.then((res) => {
if (res) {

7
pages/paper-details/index.vue

@ -227,13 +227,6 @@ export default {
return value == 1 ? '张' : '吨'
}
},
onShow() {
setTimeout(() => {
uni.showToast({
title: window.location.href
})
}, 2000)
},
onLoad(option) {
if (option.paperId) {
this.params.productId = option.paperId

2
pages/store/index.vue

@ -168,7 +168,7 @@ export default {
}
},
onShow() {
this.downCallback()
// this.downCallback()
this.getCustomer()
},
computed: {

BIN
static/imgs/order/wxpay-icon.png

Before After
Width: 40  |  Height: 40  |  Size: 1.2 KiB
Loading…
Cancel
Save