Przeglądaj źródła

Merge branch 'dev' of xiongzhu/paimaide into master

熊竹 2 lat temu
rodzic
commit
c0f7fdb1cd
3 zmienionych plików z 22 dodań i 19 usunięć
  1. 1 1
      public/meta.js
  2. 21 8
      src/App.vue
  3. 0 10
      src/views/OrderDetailPage.vue

+ 1 - 1
public/meta.js

@@ -1 +1 @@
-window.www_version = 1119
+window.www_version = 1122

+ 21 - 8
src/App.vue

@@ -71,7 +71,7 @@
 <script setup>
 import { ConfigProvider as VantConfigProvider, showConfirmDialog } from 'vant'
 import { useBackButton, useIonRouter } from '@ionic/vue'
-import { onMounted, onBeforeUnmount, ref, provide } from 'vue'
+import { onMounted, onBeforeUnmount, ref, provide, watch } from 'vue'
 import { useRoute } from 'vue-router'
 import { useSystemStore } from './stores/system'
 import { App } from '@capacitor/app'
@@ -85,12 +85,15 @@ import { Clipboard as NativeClipboard } from '@capacitor/clipboard'
 import { Capacitor } from '@capacitor/core'
 import { useClipboard } from '@vueuse/core'
 import { AppLauncher } from '@capacitor/app-launcher'
+import { storeToRefs } from 'pinia'
+import { useUserStore } from './stores/user'
 
 const store = useSettingsStore()
 const { t } = useI18n()
 const ionRouter = useIonRouter()
 const route = useRoute()
 const customers = ref([])
+const { user } = storeToRefs(useUserStore())
 
 const promptLogin = async () => {
     const confirm = await showConfirmDialog({
@@ -119,14 +122,8 @@ useBackButton(1, processNextHandler => {
         processNextHandler()
     }
 })
-onMounted(() => {
-    init()
-})
 
-function init() {
-    useSystemStore().getSysConfigs()
-    emitter.on('promptLogin', promptLogin)
-    emitter.on('customer', customer)
+function getBrokers() {
     http.get('/sysConfig/get/customer_json').then(res => {
         customers.value = JSON.parse(res.value)
         http.get('/user/myBroker').then(res => {
@@ -141,9 +138,25 @@ function init() {
     })
 }
 
+function init() {
+    useSystemStore().getSysConfigs()
+    getBrokers()
+    emitter.on('promptLogin', promptLogin)
+    emitter.on('customer', customer)
+}
+
+onMounted(() => {
+    init()
+})
+
 onBeforeUnmount(() => {
     emitter.off('promptLogin', promptLogin)
 })
+
+watch(user, () => {
+    getBrokers()
+})
+
 const showCustmer = ref(false)
 function customer() {
     showCustmer.value = true

+ 0 - 10
src/views/OrderDetailPage.vue

@@ -281,16 +281,6 @@ export default {
             .then(res => {
                 this.fromUser = res
             })
-        this.$http.get('/sysConfig/get/delegation_time').then(res => {
-            var date = parse(res.value, 'HH:mm', new Date())
-            this.$http.get('/sysConfig/get/sell_time').then(res => {
-                var date2 = parse(res.value, 'HH:mm', new Date())
-                if (new Date().getTime() >= date.getTime() || new Date().getTime() <= date2.getTime()) {
-                    // this.delegationActive = true
-                    // this.delegationTime = res.value
-                }
-            })
-        })
         // this.$http.get('/sysConfig/get/pay_type').then(res => {
         //     if (res.value == '0') {
         //         if (this.isWeixin) {