Sfoglia il codice sorgente

付款和取消付款提示语

lifanagju_citu 4 mesi fa
parent
commit
373da05b12

+ 5 - 2
src/views/mall/cart/index.vue

@@ -233,12 +233,15 @@ const orderCreated = (id) => {
   getCartList()
 }
 const payCancel = () => {
-  Snackbar.warning('您已取消支付,请前往我的订单中查看!')
+  Snackbar.warning('您已取消支付!')
   showPay.value = false
+  // window.open('/mall/user/order?tab=0')
+  setTimeout(() => { router.push({ path: '/mall/user/order', query: { tab: 0 } }) }, 500);
 }
 const paySuccess = () => {
-  Snackbar.success('支付成功,请前往我的订单查看!')
+  Snackbar.success('支付成功!')
   showPay.value = false
+  setTimeout(() => { router.push({ path: '/mall/user/order', query: { tab: 10 } }) }, 500);
 }
 </script>
 

+ 2 - 1
src/views/mall/components/details.vue

@@ -167,8 +167,9 @@ const orderCreated = (id) => {
 }
 // 
 const payCancel = () => {
-  Snackbar.warning('您已取消支付,请前往我的订单中查看!')
+  Snackbar.warning('您已取消支付!')
   showPay.value = false
+  setTimeout(() => { router.push({ path: '/mall/user/order', query: { tab: 0 } }) }, 500);
 }
 const paySuccess = () => {
   Snackbar.success('支付成功,请前往我的订单查看!')

+ 7 - 5
src/views/mall/user/order/index.vue

@@ -53,7 +53,9 @@ import Snackbar from '@/plugins/snackbar'
 import GoodsItem from '../../components/GoodsItem/index.vue'
 import CommentForm from './commentForm.vue'
 import pay from '@/views/mall/components/details/order/pay.vue'
-// import { useRouter } from 'vue-router'
+import { useRoute } from 'vue-router'; const route = useRoute()
+// import { useRouter } from 'vue-router'; const router = useRouter()
+
 const props = defineProps({
   tabListBg: {
     type: Boolean,
@@ -61,8 +63,7 @@ const props = defineProps({
   },
 })
 
-// const router = useRouter()
-const tab = ref(-1)
+const tab = ref(route?.query?.tab ? (route.query.tab)-0 : -1)
 const tabList = [
   { title: '全部', value: -1 },
   { title: '待付款', value: 0 },
@@ -171,11 +172,12 @@ const handlePay = (val) => {
 }
 // 
 const payCancel = () => {
-  Snackbar.warning('您已取消支付,请前往我的订单中查看!')
+  Snackbar.warning('您已取消支付!')
   showPay.value = false
+  // router.push({ path: '/mall/user/order', query: { tab: 0 } })
 }
 const paySuccess = () => {
-  Snackbar.success('支付成功,请前往我的订单查看!')
+  Snackbar.success('支付成功!')
   showPay.value = false
   getOrderPage()
 }