|
|
@@ -58,7 +58,7 @@
|
|
|
<button
|
|
|
v-if="item.status === 'pending'"
|
|
|
class="btn-small btn-pay"
|
|
|
- @click.stop="onPay(item.orderNo)"
|
|
|
+ @click.stop="onPay(item.orderNo, item.totalAmount)"
|
|
|
>支付</button>
|
|
|
<button
|
|
|
v-if="item.status === 'paid'"
|
|
|
@@ -80,7 +80,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { danshopOrderList, productOrderPay, productOrderCancel, productOrderConfirm } from '@/utils/api.js'
|
|
|
+import { danshopOrderList, danshopOrderCancel, danshopOrderConfirm } from '@/utils/api.js'
|
|
|
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -165,18 +165,10 @@ export default {
|
|
|
goDetail(orderNo) {
|
|
|
uni.navigateTo({ url: '/pages/shop/order-detail/order-detail?orderNo=' + orderNo })
|
|
|
},
|
|
|
- onPay(orderNo) {
|
|
|
- uni.showLoading({ title: '支付中...' })
|
|
|
- productOrderPay({ orderNo }).then(res => {
|
|
|
- uni.hideLoading()
|
|
|
- if (res.code === 200) {
|
|
|
- uni.showToast({ title: '支付成功', icon: 'success' })
|
|
|
- this.onRefresh()
|
|
|
- } else {
|
|
|
- uni.showToast({ title: res.message || '支付失败', icon: 'none' })
|
|
|
- }
|
|
|
- }).catch(() => {
|
|
|
- uni.hideLoading()
|
|
|
+ onPay(orderNo, amount) {
|
|
|
+ // Navigate to payment page — DanShop payment flow (same as checkout)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/shop/payment/payment?orderNo=' + orderNo + '&amount=' + (amount || 0)
|
|
|
})
|
|
|
},
|
|
|
onCancel(orderNo) {
|
|
|
@@ -185,7 +177,7 @@ export default {
|
|
|
content: '确定取消该订单吗?',
|
|
|
success: (confirm) => {
|
|
|
if (confirm.confirm) {
|
|
|
- productOrderCancel({ orderNo }).then(res => {
|
|
|
+ danshopOrderCancel({ orderNo }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
uni.showToast({ title: '订单已取消', icon: 'success' })
|
|
|
this.onRefresh()
|
|
|
@@ -198,7 +190,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
onConfirm(orderNo) {
|
|
|
- productOrderConfirm({ orderNo }).then(res => {
|
|
|
+ danshopOrderConfirm({ orderNo }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
uni.showToast({ title: '订单已完成', icon: 'success' })
|
|
|
this.onRefresh()
|