uniapp, destroy the previous page, click back without returning to the previous page

When we encounter page A to page B and then to page C,
we click back on page C but return to page B. At this time, we want to destroy the previous page, which is page B, and go directly to page C. This can be done in uniapp by one of the following ways of judging the jump page.

For example, when we go to product details, page A, insert image description here
click to buy, and then to page B, insert image description here
click to pay. Regardless of success or failure, we want to destroy page B. At this time, we return to page C, and return directly to page B with the default applet . At this time, we can judge from which page it came from on page B. If it is page A, let it go freely. If it is page C, it will jump to page C by default and carry parameters.
Code:
insert image description here
page B carries the product id and jumps to page C. Page
insert image description here
C directly carries parameters and jumps to page A. Implementation does not return to the B page.
There are irregularities in the method, you can see if you try it yourself.

Guess you like

Origin blog.csdn.net/H5XDJ/article/details/128207053