|
|
@@ -141,22 +141,19 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { Swiper, SwiperSlide } from 'swiper/vue'
|
|
|
-import 'swiper/swiper.min.css'
|
|
|
import { ref, onMounted, computed } from 'vue'
|
|
|
import { useRoute, useRouter } from 'vue-router'
|
|
|
import { useWindowSize } from '@vueuse/core'
|
|
|
import toast from '@/utils/toast'
|
|
|
import { http } from '@/plugins/http'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
-import { IonButton, alertController } from '@ionic/vue'
|
|
|
import { useUserStore } from '@/stores/user'
|
|
|
-import { mapState } from 'pinia'
|
|
|
import { useSystemStore } from '../stores/system'
|
|
|
import { accAdd, accMul } from '../plugins/calc'
|
|
|
import ProductBanner from '../components/ProductBanner.vue'
|
|
|
import ProductTitle from '../components/ProductTitle.vue'
|
|
|
import { closeOutline } from 'ionicons/icons'
|
|
|
+import { showConfirmDialog } from 'vant'
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
@@ -221,8 +218,19 @@ const pay = () => {
|
|
|
})
|
|
|
})
|
|
|
.catch(e => {
|
|
|
- console.log(e)
|
|
|
- toast.error(e.error)
|
|
|
+ if (e.code == -2) {
|
|
|
+ showConfirmDialog({
|
|
|
+ title: this.$t('common.alert'),
|
|
|
+ message: e.error,
|
|
|
+ confirmButtonText: this.$t('balance.recharge')
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$router.push({ name: 'wallet' })
|
|
|
+ })
|
|
|
+ .catch(() => {})
|
|
|
+ } else {
|
|
|
+ toast.error(e.error)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
</script>
|