123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <template>
- <view>
- <a ref="payUrlRef" :href="jumpUrl"></a>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- jumpUrl: "",
- }
- },
- onload() {
- let url = localStorage.getItem('jumpUrl');
- // let url = this.cookie.get("jumpUrl");
- if(url){
- this.jumpUrl = url;
- }else{
- this.jumpUrl = 'https://h5.pdzhtc.com';
- }
- this.getOrderId()
- },
- mounted() {
- this.$refs.payUrlRef.click();
- },
- methods: {
- getOrderId(id) {
- const localToken = JSON.parse(localStorage.getItem('lifeData') ?? '{}')
- const token = localToken?.data?.vuex_token
- $.ajax({
- //请求方式
- type : "get",
- //请求地址
- url : baseUrl + '/client/orderinfo/orderListByPoly/' + id,
- // token
- beforeSend: function(request) {
- request.setRequestHeader("Authorization", 'Bearer ' + token);
- },
- //请求成功
- success: function(result) {
- if (result.code === 200) {
- this.jumpUrl = result?.data?.jumpUrl ?? 'https://h5.pdzhtc.com'
- } else {
- alert(result.msg)
- }
- },
- //请求失败,包含具体的错误信息
- error: function(e){
- alert('程序错误!')
- }
- });
- }
- }
- }
- </script>
- <style>
- </style>
|