修改页面
This commit is contained in:
@@ -1,73 +1,50 @@
|
||||
<script setup>
|
||||
import { onLaunch } from '@dcloudio/uni-app'
|
||||
|
||||
// 应用启动时执行
|
||||
import { onLaunch, onShow } from '@dcloudio/uni-app'
|
||||
import { captureAppLaunchData } from '/pageSubPack/api/appLaunch.js'
|
||||
|
||||
onLaunch(() => {
|
||||
console.log('App 启动')
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
// 只有 App 平台才获取 CID
|
||||
getPushCID()
|
||||
// #endif
|
||||
console.log('App 启动')
|
||||
// 捕获 App 跳转传入的支付参数(冷启动)
|
||||
captureAppLaunchData()
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
getPushCID()
|
||||
// #endif
|
||||
})
|
||||
|
||||
|
||||
onShow((options) => {
|
||||
console.log('App onShow, options:', JSON.stringify(options))
|
||||
// 捕获 App 跳转传入的支付参数(热启动 — options 携带新的 referrerInfo)
|
||||
captureAppLaunchData(options)
|
||||
})
|
||||
|
||||
// 获取 uniPush 2.0 CID
|
||||
function getPushCID() {
|
||||
uni.getPushClientId({
|
||||
success: (res) => {
|
||||
console.log('推送初始化成功')
|
||||
console.log('CID =', res.cid)
|
||||
|
||||
// 存起来备用
|
||||
console.log('推送初始化成功, CID =', res.cid)
|
||||
uni.setStorageSync('push_cid', res.cid)
|
||||
|
||||
// 弹出CID给你看
|
||||
// uni.showModal({
|
||||
// title: '你的CID',
|
||||
// content: res.cid
|
||||
// })
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('获取推送 CID 失败', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
// export default {
|
||||
// on
|
||||
// onShow: function() {
|
||||
// // console.log('App Show')
|
||||
// },
|
||||
// onHide: function() {
|
||||
// console.log('App Hide')
|
||||
// },
|
||||
|
||||
|
||||
// }
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/uni_modules/uview-plus/index.scss";
|
||||
/*每个页面公共css */
|
||||
</style>
|
||||
|
||||
<style>
|
||||
/* 全局给 uni.showToast 加内边距 */
|
||||
.uni-toast {
|
||||
padding: 5px !important;
|
||||
/* 上下20 左右40,自己改数值 */
|
||||
min-height: auto !important;
|
||||
box-sizing: border-box !important;
|
||||
}
|
||||
|
||||
/* 文字也可以居中、调整行高 */
|
||||
.uni-toast-content {
|
||||
/* line-height: 1.6 !important; */
|
||||
padding: 0 !important;
|
||||
white-space: normal !important;
|
||||
word-break: break-all !important;
|
||||
}
|
||||
|
||||
/* button:after{
|
||||
border-radius: 50px;
|
||||
} */
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user