App.vue
2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!--
* @Date: 2023-06-13 13:26:46
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-08-24 15:03:44
* @FilePath: /front/src/App.vue
* @Description: 文件描述
-->
<template>
<div class="bg-wrapper">
<div class="box-wrapper">
<div class="box-top"></div>
<router-view></router-view>
</div>
</div>
</template>
<script setup>
import { mainStore, useTitle } from '@/utils/generatePackage'
import { computed, watchEffect, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router'
import { setToastDefaultOptions } from 'vant';
// 会根据配置判断是否显示调试控件
// eslint-disable-next-line no-unused-vars
import vConsole from '@/utils/vconsole'
/*// 初始化WX环境
import wx from 'weixin-js-sdk'
import { wxJsAPI } from '@/api/wx/config'
import { apiList } from '@/api/wx/jsApiList.js'*/
import { orderInfoAPI } from '@/api/index'
// 使用 include + pinia 状态管理动态缓存页面
const store = mainStore()
const keepPages = computed(() => store.getKeepPages)
// TAG: 全局设置页面标题
const $route = useRoute();
const $router = useRouter();
watchEffect(
() => useTitle($route.meta.title)
)
// TAG: 全局配置Toast
setToastDefaultOptions({
duration: 2000,
className: 'zIndex'
});
onMounted(async () => {
/*const { data } = await wxJsAPI();
data.jsApiList = apiList;
wx.config(data);
wx.ready(() => {
wx.showAllNonBaseMenuItem();
});
wx.error((err) => {
console.warn(err);
});*/
// TODO: 进入后先查询有没有订单,有订单直接跳转最终页面
})
</script>
<style lang="less">
@prefix: ~'@{namespace}-x';
html,
body {
// width: 100%;
// height: 100%;
}
body {
position: relative;
// --van-white: #fff;
// --van-blue: #1989fa;
// --van-button-primary-color: var(--van-white);
// --van-button-primary-background: var(--van-primary-color);
/* 全局修改主色调 */
// --van-blue: #F9D95C;
background-color: #F7EFEB;
p {
margin: 0;
padding: 0;
}
}
.@{prefix} {
color: red;
}
.global-center {
position: relative;
top: 50%;
transform: translateY(-50%);
}
.zIndex {
z-index: 4500 !important;
}
.bg-wrapper {
padding: 1rem;
padding-bottom: 0;
background-image: url('https://cdn.ipadbiz.cn/bieyuan/bg@2x~1.png');
background-repeat:no-repeat;
}
.box-wrapper {
background: #FFFFFF;
box-shadow: 0px 0px 13px 0px rgba(95,69,54,0.25);
border-radius: 10px;
border-bottom-right-radius: 0;
border-bottom-left-radius: 0;
min-height: calc(100vh - 1rem);
.box-top {
padding: 0 1rem 1rem;
height: 1rem;
background-image: url('https://cdn.ipadbiz.cn/bieyuan/top@2x~1.png');
background-repeat:no-repeat;
background-size: calc(100% - 2rem);
background-position: 1rem 0; /* 向右位移 1rem */
}
}
</style>