修改刷新问题

wenjuan
yanzai 1 year ago
parent a460fcae62
commit 52747bdb10

@ -1,6 +1,6 @@
const app_type = 'gzh' const app_type = 'gzh'
const base_url="https://api.hainan2024.sa0.online" //开发环境 //const base_url="https://api.hainan2024.sa0.online" //开发环境
//const base_url="http://124.225.137.54:39080" //正式环境 const base_url="http://124.225.137.54:39080" //正式环境
const config = { const config = {
api_map_url: base_url+'/api/ApiMap/h5', api_map_url: base_url+'/api/ApiMap/h5',
base_assets_url: base_url, base_assets_url: base_url,

@ -260,7 +260,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">09262059</view> <view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">09262246</view>
</view> </view>
</view> </view>
</template> </template>

@ -8,27 +8,30 @@
ref, ref,
computed, computed,
nextTick, nextTick,
provide
} from 'vue' } from 'vue'
import { import {
$api, $api,
$response $response
} from '@/api' } from '@/api'
import { import {
onShow onShow,onLoad
} from '@dcloudio/uni-app' } from '@dcloudio/uni-app'
import OrderComponent from './src/order.vue' import OrderComponent from './src/order.vue'
import { import {
useStore useStore
} from '@/store' } from '@/store'
import { useRouter } from 'vue-router';
const router = useRouter();
const $store = useStore() const $store = useStore()
const order_list = ref([]) const order_list = ref([])
const getOrderList = async () => { const getOrderList = async () => {
uni.showLoading() uni.showLoading()
const response = await $api('OrderList') const response = await $api('OrderList')
uni.hideLoading() uni.hideLoading()
$response(response, () => { $response(response, () => {
order_list.value = response.data.list order_list.value = response.data.list
}) })
} }
const order_list_computed = computed(() => { const order_list_computed = computed(() => {
@ -89,12 +92,15 @@
status_active.value = status status_active.value = status
}) })
} }
provide('ReLoadOrderList', (value) => {
if(value=="orderUpdate"){
getOrderList()
}
});
const ReLoadOrderList = (newValue) => {
if (newValue == "orderUpdate") {
setTimeout(() => {
router.go(0);
}, 1000);
}
};
onShow(() => { onShow(() => {
if (!!config_ref.value) { if (!!config_ref.value) {
getOrderList() getOrderList()
@ -115,7 +121,8 @@
</view> </view>
</view> </view>
<view class="order_list_wrapper"> <view class="order_list_wrapper">
<OrderComponent v-for="(i,k) in order_list_computed" :key="k" :info="i"></OrderComponent> <OrderComponent v-for="(i,k) in order_list_computed" :key="k" :info="i" @updateValue="ReLoadOrderList">
</OrderComponent>
</view> </view>
<view class="blank_wrapper"></view> <view class="blank_wrapper"></view>
</view> </view>

@ -7,7 +7,7 @@
import { import {
ref, ref,
onMounted, onMounted,
inject defineEmits
} from 'vue' } from 'vue'
import { import {
$api, $api,
@ -75,8 +75,10 @@
} }
}) })
} }
const ReLoadOrderList = inject('ReLoadOrderList');
const emit = defineEmits();
const Refound = async (id) => { const Refound = async (id) => {
uni.showLoading() uni.showLoading()
const response = await $api('Refund', { const response = await $api('Refund', {
openid: localStorage.getItem('OPENID'), openid: localStorage.getItem('OPENID'),
@ -88,7 +90,7 @@
uni.showToast({ uni.showToast({
title: '退款完成' title: '退款完成'
}); });
ReLoadOrderList("orderUpdate"); emit('updateValue', 'orderUpdate');
} }
}) })
} }

Loading…
Cancel
Save