提交 2d01ae69 编写于 作者: F fxy060608

chore(mp-weixin): 调整部分条件编译

上级 e12723de
...@@ -48,6 +48,7 @@ ...@@ -48,6 +48,7 @@
// } as PerformanceObserverOptions) // } as PerformanceObserverOptions)
// 统计上报 - 应用启动 // 统计上报 - 应用启动
// #ifdef APP-ANDROID || APP-IOS || WEB
uni.report({ uni.report({
name: 'uni-app-launch', name: 'uni-app-launch',
options: res, options: res,
...@@ -57,6 +58,7 @@ ...@@ -57,6 +58,7 @@
console.log(err); console.log(err);
} }
}) })
// #endif
// #ifdef APP // #ifdef APP
if (process.env.NODE_ENV !== 'development') { //真机运行可以注释此条件 if (process.env.NODE_ENV !== 'development') { //真机运行可以注释此条件
uni.getPrivacySetting({ uni.getPrivacySetting({
...@@ -86,6 +88,7 @@ ...@@ -86,6 +88,7 @@
setLifeCycleNum(state.lifeCycleNum + 100) setLifeCycleNum(state.lifeCycleNum + 100)
console.log('App Show') console.log('App Show')
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用显示 // 统计上报 - 应用显示
uni.report({ uni.report({
name: 'uni-app-show', name: 'uni-app-show',
...@@ -94,13 +97,15 @@ ...@@ -94,13 +97,15 @@
}, fail(err) { }, fail(err) {
console.log(err); console.log(err);
} }
}) })
// #endif
}, },
onHide: function () { onHide: function () {
// 自动化测试 // 自动化测试
setLifeCycleNum(state.lifeCycleNum - 100) setLifeCycleNum(state.lifeCycleNum - 100)
console.log('App Hide') console.log('App Hide')
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用进入后台 // 统计上报 - 应用进入后台
uni.report({ uni.report({
name: 'uni-app-hide', name: 'uni-app-hide',
...@@ -109,7 +114,8 @@ ...@@ -109,7 +114,8 @@
}, fail(err) { }, fail(err) {
console.log(err); console.log(err);
} }
}) })
// #endif
}, },
// #ifdef APP-ANDROID // #ifdef APP-ANDROID
onLastPageBackPress: function () { onLastPageBackPress: function () {
...@@ -134,6 +140,7 @@ ...@@ -134,6 +140,7 @@
console.log('App Exit') console.log('App Exit')
}, },
onError(err : any) { onError(err : any) {
// #ifdef APP-ANDROID || APP-IOS || WEB
// 统计上报 - 应用发生错误 // 统计上报 - 应用发生错误
uni.report({ uni.report({
name: 'uni-app-error', name: 'uni-app-error',
...@@ -144,6 +151,7 @@ ...@@ -144,6 +151,7 @@
console.log(err); console.log(err);
} }
}) })
// #endif
}, },
// #endif // #endif
methods: { methods: {
......
// 仅测试 console.log 时机问题 // 仅测试 console.log 时机问题
import './test-main-console.uts' import './test-main-console.uts'
// #ifdef APP-ANDROID || APP-IOS || WEB
import { uniStat } from '@/uni_modules/uni-stat/plugin.uts' import { uniStat } from '@/uni_modules/uni-stat/plugin.uts'
// #endif
import App from './App.uvue' import App from './App.uvue'
import { createSSRApp } from 'vue' import { createSSRApp } from 'vue'
...@@ -17,7 +19,9 @@ const statOptions = { ...@@ -17,7 +19,9 @@ const statOptions = {
export function createApp() { export function createApp() {
const app = createSSRApp(App) const app = createSSRApp(App)
app.use(uniStat, statOptions) // #ifdef APP-ANDROID || APP-IOS || WEB
app.use(uniStat, statOptions)
// #endif
// app.mixin({ // app.mixin({
// onReady() { // onReady() {
// setTimeout(() => { // setTimeout(() => {
......
...@@ -489,7 +489,7 @@ ...@@ -489,7 +489,7 @@
"navigationBarTitleText": "涂鸦" "navigationBarTitleText": "涂鸦"
} }
}, },
// #ifndef WEB // #ifdef APP-ANDROID || APP-IOS
{ {
"path": "pages/component/native-view/native-view", "path": "pages/component/native-view/native-view",
"group": "0,2,4", "group": "0,2,4",
...@@ -1151,7 +1151,7 @@ ...@@ -1151,7 +1151,7 @@
"navigationBarTitleText": "createSelectorQuery | 创建 SelectorQuery 实例" "navigationBarTitleText": "createSelectorQuery | 创建 SelectorQuery 实例"
} }
}, },
// #ifndef WEB // #ifdef APP-ANDROID || APP-IOS
{ {
"path": "pages/API/get-native-view/element-getnativeview", "path": "pages/API/get-native-view/element-getnativeview",
"group": "1,30", "group": "1,30",
...@@ -1799,12 +1799,14 @@ ...@@ -1799,12 +1799,14 @@
} }
}, },
// #endif // #endif
// #ifdef APP-ANDROID || APP-IOS || WEB
{ {
"path": "pages/template/schema/schema", "path": "pages/template/schema/schema",
"style": { "style": {
"navigationBarTitleText": "打开schema示例" "navigationBarTitleText": "打开schema示例"
} }
}, },
// #endif
// #ifdef APP-ANDROID // #ifdef APP-ANDROID
{ {
"path": "pages/template/share/share", "path": "pages/template/share/share",
...@@ -1839,6 +1841,7 @@ ...@@ -1839,6 +1841,7 @@
} }
}, },
// #endif // #endif
// #ifdef APP-ANDROID || APP-IOS || WEB
{ {
"path": "pages/template/custom-long-list/custom-long-list", "path": "pages/template/custom-long-list/custom-long-list",
"style": { "style": {
...@@ -1846,6 +1849,7 @@ ...@@ -1846,6 +1849,7 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
}, },
// #endif
{ {
"path": "pages/template/test-background-color-content/test-background-color-content", "path": "pages/template/test-background-color-content/test-background-color-content",
"style": { "style": {
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
// #ifdef APP // #ifdef APP
if (!generalTarget.classList.includes('general-class')) { if (!generalTarget.classList.includes('general-class')) {
// #endif // #endif
// #ifdef WEB // #ifndef APP
if (!Array.from(generalTarget.classList).includes('general-class')) { if (!Array.from(generalTarget.classList).includes('general-class')) {
// #endif // #endif
this.validateGeneralAttrText = '基础属性 class 验证失败' this.validateGeneralAttrText = '基础属性 class 验证失败'
......
...@@ -255,15 +255,16 @@ ...@@ -255,15 +255,16 @@
" @click="changePassword"></image> " @click="changePassword"></image>
</view> </view>
</view> </view>
<!-- #ifndef MP -->
<view> <view>
<view class="uni-title"> <view class="uni-title">
<text class="uni-title-text">同时存在 v-model 和 value</text> <text class="uni-title-text">同时存在 v-model 和 value</text>
</view> </view>
<view class="input-wrapper"> <view class="input-wrapper">
<input id="both-model-value" class="uni-input" v-model="demoValue" value="456" /> <input id="both-model-value" class="uni-input" v-model="demoValue"/>
</view> </view>
</view> </view>
<!-- #endif -->
<view> <view>
<view class="uni-title" style="flex-direction: row; align-items: center"> <view class="uni-title" style="flex-direction: row; align-items: center">
......
...@@ -63,8 +63,10 @@ ...@@ -63,8 +63,10 @@
<text class="uni-subtitle-text">decode</text> <text class="uni-subtitle-text">decode</text>
<text class="uni-subtitle-text">依次为lt gt amp apos nbsp ensp emsp效果</text> <text class="uni-subtitle-text">依次为lt gt amp apos nbsp ensp emsp效果</text>
</view> </view>
<view class="text-box"> <view class="text-box">
<text :decode="true">&lt; &gt; &amp; &apos;</text> <!-- #ifndef MP-WEIXIN -->
<text :decode="true">&lt; &gt; &amp; &apos;</text>
<!-- #endif -->
<text :decode="true">uni-app&nbsp;x,终极跨平台方案</text> <text :decode="true">uni-app&nbsp;x,终极跨平台方案</text>
<text :decode="true">uni-app&ensp;x,终极跨平台方案</text> <text :decode="true">uni-app&ensp;x,终极跨平台方案</text>
<text :decode="true">uni-app&emsp;x,终极跨平台方案</text> <text :decode="true">uni-app&emsp;x,终极跨平台方案</text>
......
...@@ -138,13 +138,14 @@ ...@@ -138,13 +138,14 @@
<view class="textarea-wrap"> <view class="textarea-wrap">
<textarea class="textarea-instance" :hold-keyboard="hold_keyboard" /> <textarea class="textarea-instance" :hold-keyboard="hold_keyboard" />
</view> </view>
<!-- #ifndef MP -->
<view class="title-wrap"> <view class="title-wrap">
<view>同时存在 v-model 和 value</view> <view>同时存在 v-model 和 value</view>
</view> </view>
<view class="textarea-wrap"> <view class="textarea-wrap">
<textarea id="both-model-value" class="textarea-instance" v-model='defaultModel' value='456'></textarea> <textarea id="both-model-value" class="textarea-instance" v-model='defaultModel'></textarea>
</view> </view>
<!-- #endif -->
<view class="title-wrap"> <view class="title-wrap">
<view>设置adjust-position</view> <view>设置adjust-position</view>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册