tk-vue3-template 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/components/NoData.vue +2 -2
- package/src/utils/common.js +2 -2
- package/src/utils/request.js +2 -2
- package/src/views/index.vue +3 -44
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
</template>
|
|
11
11
|
|
|
12
12
|
<script setup>
|
|
13
|
-
|
|
13
|
+
defineProps({
|
|
14
14
|
text: {
|
|
15
15
|
type: String,
|
|
16
16
|
default: '暂无数据~'
|
|
@@ -43,4 +43,4 @@ const props = defineProps({
|
|
|
43
43
|
color: rgba(255, 255, 255, 0.5);
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
</style>
|
|
46
|
+
</style>
|
package/src/utils/common.js
CHANGED
|
@@ -7,7 +7,7 @@ class Common {
|
|
|
7
7
|
return decodeURIComponent(!m ? '' : m[2])
|
|
8
8
|
}
|
|
9
9
|
getToken() {
|
|
10
|
-
return new Promise((resolve
|
|
10
|
+
return new Promise((resolve) => {
|
|
11
11
|
DSBridge.call(`DS.getToken`, {}, (v) => {
|
|
12
12
|
resolve(v)
|
|
13
13
|
})
|
|
@@ -47,4 +47,4 @@ class Common {
|
|
|
47
47
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export default new Common()
|
|
50
|
+
export default new Common()
|
package/src/utils/request.js
CHANGED
|
@@ -26,7 +26,7 @@ service.interceptors.request.use(
|
|
|
26
26
|
const time = Date.parse(new Date()) / 1000
|
|
27
27
|
const custom = Math.random().toString(36).substr(2)
|
|
28
28
|
const c = request.url
|
|
29
|
-
let url
|
|
29
|
+
let url
|
|
30
30
|
if (c.search('&') !== -1) {
|
|
31
31
|
url = c.substring(0, c.indexOf('&'))
|
|
32
32
|
} else {
|
|
@@ -61,7 +61,7 @@ service.interceptors.response.use(
|
|
|
61
61
|
let string = decrypted.toString(CryptoJS.enc.Utf8)
|
|
62
62
|
try {
|
|
63
63
|
ret.data = JSON.parse(string)
|
|
64
|
-
} catch
|
|
64
|
+
} catch {
|
|
65
65
|
ret.data = string
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/views/index.vue
CHANGED
|
@@ -6,50 +6,9 @@
|
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
<script setup>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
import NoData from '@/components/NoData.vue'
|
|
12
|
-
import BackTop from '@/components/BackTop.vue'
|
|
13
|
-
import common from '@/utils/common';
|
|
14
|
-
const { proxy } = getCurrentInstance()
|
|
15
|
-
const showSkeleton = ref(true)
|
|
16
|
-
const isLoading = ref(false)
|
|
17
|
-
const isFinished = ref(false)
|
|
18
|
-
const currentPage = ref(1)
|
|
19
|
-
const dataList = ref([])
|
|
20
|
-
const currentType = ref(1)
|
|
21
|
-
const userInfo = ref({})
|
|
22
|
-
const background = ref('#ff4444')
|
|
23
|
-
const isRefreshing = ref(false)
|
|
24
|
-
const tabList = [{
|
|
25
|
-
name: '余额明细',
|
|
26
|
-
value: 1
|
|
27
|
-
}, {
|
|
28
|
-
name: '提现记录',
|
|
29
|
-
value: 2
|
|
30
|
-
}]
|
|
31
|
-
|
|
32
|
-
// 页面挂载时执行
|
|
33
|
-
onMounted(() => {
|
|
34
|
-
|
|
9
|
+
defineOptions({
|
|
10
|
+
name: 'HomePage',
|
|
35
11
|
})
|
|
36
|
-
|
|
37
|
-
// 设置头部
|
|
38
|
-
const setHeader = (params) => {
|
|
39
|
-
common.setHeader({
|
|
40
|
-
showHeader: 0,
|
|
41
|
-
})
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const getUserInfo = async () => {
|
|
48
|
-
let res = await proxy.$api.userInfo()
|
|
49
|
-
userInfo.value = res.data || {}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
12
|
</script>
|
|
54
13
|
<style lang="less" scoped>
|
|
55
14
|
.page {
|
|
@@ -121,4 +80,4 @@ const getUserInfo = async () => {
|
|
|
121
80
|
}
|
|
122
81
|
}
|
|
123
82
|
}
|
|
124
|
-
</style>
|
|
83
|
+
</style>
|