MrShi
2025-08-21 907ec8bf7687f8feaf4efbad3c98c585c31fc0e8
small-program/pages/index/index.vue
@@ -318,6 +318,7 @@
<script>
   import { mapState } from 'vuex'
   import sunuiMverify from '@/components/sunui-mverify/sunui-mverify.vue';
   var QQMapWX = require('@/utils/qqmap-wx-jssdk.js');
   export default {
      components: { sunuiMverify },
      computed: {
@@ -331,6 +332,7 @@
            show: false,
            isLogin: false,
            typeId: 0,
            qqmapsdk: null,
            type: [
               { name: '用工', id: 0 },
               { name: '运货', id: 1 },
@@ -392,23 +394,38 @@
      },
      async onLoad() {
         await this.$onLaunched;
         this.getCategoryLists()
         this.getOrderList()
         if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
            this.getOrderList()
            this.getCategoryLists()
         }
         this.qqmapsdk = new QQMapWX({
            key: '4PXBZ-JLBC7-LCLXG-P2SZX-C4HYE-LDBLQ'
         });
         this.form.linkPhone = this.userInfo.telephone
      },
      onShow(options) {
         this.typeViewId = 0
         if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}'){
         if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
            console.log('已登陆')
            this.isLogin = true
            if (!this.isOnce && this.userInfo.useIdentity == 1) {
               this.page = 1
               this.next = true
               this.orderList = []
               this.getOrderList()
            }
         } else {
            this.isLogin = false
            console.log('未登陆')
         }
         if (this.userInfo && this.userInfo.useIdentity == 1) {
            this.typeViewId = 1
         }
         if (!this.isOnce && this.userInfo.useIdentity == 1) {
            this.page = 1
            this.next = true
            this.orderList = []
            this.getOrderList()
         }
      },
      watch: {
@@ -421,7 +438,7 @@
               this.form.longitude = ''
               this.form.location = ''
               this.form.locationEnd = ''
               this.form.wayInfoDTOList = ''
               this.form.wayInfoDTOList = []
               this.form.workType = ''
               this.form.days = ''
               this.form.locationRemark = ''
@@ -465,6 +482,7 @@
      methods: {
         // 手动接单
         getaccept(e, orderId, index) {
            if (!e.msg) return;
            this.$u.api.accept({ orderId })
               .then(res => {
                  if (res.code === 200) {