|
|
@@ -90,7 +90,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { danshopOrderDetail, danshopOrderConfirm, productOrderPay, productOrderCancel } from '@/utils/api.js'
|
|
|
+import { danshopOrderDetail, danshopOrderConfirm } from '@/utils/api.js'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -119,17 +119,9 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
onPay() {
|
|
|
- uni.showLoading({ title: '支付中...' })
|
|
|
- productOrderPay({ orderNo: this.orderNo }).then(res => {
|
|
|
- uni.hideLoading()
|
|
|
- if (res.code === 200) {
|
|
|
- uni.showToast({ title: '支付成功', icon: 'success' })
|
|
|
- this.loadDetail()
|
|
|
- } else {
|
|
|
- uni.showToast({ title: res.message || '支付失败', icon: 'none' })
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- uni.hideLoading()
|
|
|
+ // Navigate to payment page — DanShop WeChat payment flow
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/shop/payment/payment?orderNo=' + this.orderNo + '&amount=' + (this.order.totalAmount / 100 || 0)
|
|
|
})
|
|
|
},
|
|
|
onCancel() {
|
|
|
@@ -138,7 +130,7 @@ export default {
|
|
|
content: '确定取消该订单吗?',
|
|
|
success: (confirm) => {
|
|
|
if (confirm.confirm) {
|
|
|
- productOrderCancel({ orderNo: this.orderNo }).then(res => {
|
|
|
+ danshopOrderCancel({ orderNo: this.orderNo }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
uni.showToast({ title: '订单已取消', icon: 'success' })
|
|
|
this.loadDetail()
|
|
|
@@ -161,7 +153,7 @@ export default {
|
|
|
content: '确定已收到商品吗?',
|
|
|
success: (confirm) => {
|
|
|
if (confirm.confirm) {
|
|
|
- danshopOrderConfirm({ orderId: this.order.id }).then(res => {
|
|
|
+ danshopOrderConfirm({ orderNo: this.orderNo }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
uni.showToast({ title: '已确认收货', icon: 'success' })
|
|
|
this.loadDetail()
|
|
|
@@ -175,7 +167,7 @@ export default {
|
|
|
},
|
|
|
onBuyAgain() {
|
|
|
if (this.order.items && this.order.items.length > 0) {
|
|
|
- uni.navigateTo({ url: '/pages/discover/product-detail/product-detail?id=' + this.order.items[0].productId })
|
|
|
+ uni.navigateTo({ url: '/pages/shop/detail/detail?id=' + this.order.items[0].productId })
|
|
|
}
|
|
|
},
|
|
|
statusLabel(status) {
|