diff --git a/h5/config.js b/h5/config.js index 3822cc9..3b12687 100644 --- a/h5/config.js +++ b/h5/config.js @@ -1,6 +1,6 @@ const app_type = 'gzh' -const base_url="https://api.hainan2024.sa0.online" //开发环境 -//const base_url="http://124.225.137.54:39080" //正式环境 +//const base_url="https://api.hainan2024.sa0.online" //开发环境 +const base_url="http://124.225.137.54:39080" //正式环境 const config = { api_map_url: base_url+'/api/ApiMap/h5', base_assets_url: base_url, diff --git a/h5/pages/main/index/index.vue b/h5/pages/main/index/index.vue index 3432694..5036703 100644 --- a/h5/pages/main/index/index.vue +++ b/h5/pages/main/index/index.vue @@ -260,7 +260,7 @@ - 09262059 + 09262246 diff --git a/h5/pages/main/order/order.vue b/h5/pages/main/order/order.vue index 30271db..cb69f11 100644 --- a/h5/pages/main/order/order.vue +++ b/h5/pages/main/order/order.vue @@ -8,27 +8,30 @@ ref, computed, nextTick, - provide + } from 'vue' import { $api, $response } from '@/api' import { - onShow + onShow,onLoad } from '@dcloudio/uni-app' import OrderComponent from './src/order.vue' import { useStore } from '@/store' + import { useRouter } from 'vue-router'; + const router = useRouter(); const $store = useStore() const order_list = ref([]) - const getOrderList = async () => { - uni.showLoading() + const getOrderList = async () => { + uni.showLoading() const response = await $api('OrderList') uni.hideLoading() $response(response, () => { order_list.value = response.data.list + }) } const order_list_computed = computed(() => { @@ -89,12 +92,15 @@ status_active.value = status }) } - provide('ReLoadOrderList', (value) => { - if(value=="orderUpdate"){ - getOrderList() - } - }); + const ReLoadOrderList = (newValue) => { + if (newValue == "orderUpdate") { + setTimeout(() => { + router.go(0); + }, 1000); + + } + }; onShow(() => { if (!!config_ref.value) { getOrderList() @@ -115,7 +121,8 @@ - + + diff --git a/h5/pages/main/order/src/order.vue b/h5/pages/main/order/src/order.vue index d99439a..45a7624 100644 --- a/h5/pages/main/order/src/order.vue +++ b/h5/pages/main/order/src/order.vue @@ -7,7 +7,7 @@ import { ref, onMounted, - inject + defineEmits } from 'vue' import { $api, @@ -75,8 +75,10 @@ } }) } - const ReLoadOrderList = inject('ReLoadOrderList'); + + const emit = defineEmits(); const Refound = async (id) => { + uni.showLoading() const response = await $api('Refund', { openid: localStorage.getItem('OPENID'), @@ -88,7 +90,7 @@ uni.showToast({ title: '退款完成' }); - ReLoadOrderList("orderUpdate"); + emit('updateValue', 'orderUpdate'); } }) }