提交 4afc0506 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

去掉编译警告

上级 868e35d6
...@@ -4,11 +4,11 @@ ...@@ -4,11 +4,11 @@
<view class="uni-padding-wrap uni-common-mt"> <view class="uni-padding-wrap uni-common-mt">
<view style="background:#FFFFFF; padding:40rpx;"> <view style="background:#FFFFFF; padding:40rpx;">
<view class="uni-hello-text uni-center">网络状态</view> <view class="uni-hello-text uni-center">网络状态</view>
<view v-if="hasNetworkType === false"> <view v-if="hasNetworkType == false">
<view class="uni-h2 uni-center uni-common-mt">未获取</view> <view class="uni-h2 uni-center uni-common-mt">未获取</view>
<view class="uni-hello-text uni-center uni-common-mt">请点击下面按钮获取网络状态</view> <view class="uni-hello-text uni-center uni-common-mt">请点击下面按钮获取网络状态</view>
</view> </view>
<view v-if="hasNetworkType === true"> <view v-if="hasNetworkType == true">
<view class="uni-h2 uni-center uni-common-mt">{{networkType}}</view> <view class="uni-h2 uni-center uni-common-mt">{{networkType}}</view>
</view> </view>
</view> </view>
......
...@@ -154,10 +154,11 @@ ...@@ -154,10 +154,11 @@
this.windowHeight = res.windowHeight + ""; this.windowHeight = res.windowHeight + "";
this.windowTop = res.windowTop + ""; this.windowTop = res.windowTop + "";
this.windowBottom = res.windowBottom + ""; this.windowBottom = res.windowBottom + "";
if (res.statusBarHeight == null){ const statusBarHeight = res.statusBarHeight;
if (statusBarHeight == null){
this.statusBarHeight = ""; this.statusBarHeight = "";
}else{ }else{
this.statusBarHeight = res.statusBarHeight!! + ""; this.statusBarHeight = statusBarHeight + "";
} }
this.pixelRatio = res.pixelRatio + ""; this.pixelRatio = res.pixelRatio + "";
this.SDKVersion = res.SDKVersion; this.SDKVersion = res.SDKVersion;
......
...@@ -48,10 +48,7 @@ ...@@ -48,10 +48,7 @@
methods: { methods: {
getNodeInfo() { getNodeInfo() {
uni.createSelectorQuery().select('.rect').boundingClientRect().exec((ret) => { uni.createSelectorQuery().select('.rect').boundingClientRect().exec((ret) => {
const rect = ret[0] as NodeInfo this.nodeInfo = ret[0] as NodeInfo
if (rect != null) {
this.nodeInfo = rect
}
}) })
} }
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<text class="text-desc">图片指示器样式</text> <text class="text-desc">图片指示器样式</text>
<radio-group class="cell-ct" style="background-color: white;" @change="onIndicatorChanged"> <radio-group class="cell-ct" style="background-color: white;" @change="onIndicatorChanged">
<view class="indicator-it" v-for="(item,index) in indicator" :key="item.value"> <view class="indicator-it" v-for="(item,index) in indicator" :key="item.value">
<radio :checked="index === 0" :value="item.value">{{item.name}}</radio> <radio :checked="index == 0" :value="item.value">{{item.name}}</radio>
</view> </view>
</radio-group> </radio-group>
</view> </view>
...@@ -66,14 +66,14 @@ ...@@ -66,14 +66,14 @@
success: (e) => { success: (e) => {
this.imageList = this.imageList.concat(e.tempFilePaths) this.imageList = this.imageList.concat(e.tempFilePaths)
}, },
fail(e) { fail(_) {
} }
}) })
}, },
onIndicatorChanged(e: RadioGroupChangeEvent) { onIndicatorChanged(e: RadioGroupChangeEvent) {
this.currentIndicator = e.detail.value this.currentIndicator = e.detail.value
}, },
onCheckboxChange(e: CheckboxGroupChangeEvent) { onCheckboxChange(_: CheckboxGroupChangeEvent) {
this.isLoop = !this.isLoop this.isLoop = !this.isLoop
} }
} }
......
...@@ -240,13 +240,13 @@ ...@@ -240,13 +240,13 @@
this.key = '' this.key = ''
this.data = '' this.data = ''
uni.clearStorage({ uni.clearStorage({
success:function(res){ success:function(_){
uni.showModal({ uni.showModal({
title: '清除数据成功', title: '清除数据成功',
showCancel: false showCancel: false
}) })
}, },
fail:function(res){ fail:function(_){
uni.showModal({ uni.showModal({
title: '清除数据失败', title: '清除数据失败',
showCancel: false showCancel: false
......
...@@ -52,29 +52,27 @@ ...@@ -52,29 +52,27 @@
filePath:'static/list-mock/mock.json', filePath:'static/list-mock/mock.json',
success:function(result){ success:function(result){
const content = result.data; const content = result.data;
if (content != null){ const items = [] as Item[];
const items = [] as Item[]; const jsonArr = JSON.parse(content);
const jsonArr = JSON.parse(content); jsonArr?.forEach((res)=>{
jsonArr?.forEach((res)=>{ const json = res as UTSJSONObject;
const json = res as UTSJSONObject; const title = json["title"] as string;
const title = json["title"] as string; const subTitle = json["subTitle"] as string;
const subTitle = json["subTitle"] as string; const img = json["img"] as string;
const img = json["img"] as string; const detail = json["detail"] as string;
const detail = json["detail"] as string; const item:Item = {
const item:Item = { title,
title, subTitle,
subTitle, img,
img, detail
detail
}
items.push(item);
})
let temp = [] as Item[];
for(let i = 0; i < 100; i++){
temp = temp.concat(items);
} }
listData = temp; items.push(item);
})
let temp = [] as Item[];
for(let i = 0; i < 100; i++){
temp = temp.concat(items);
} }
listData = temp;
setTimeout(()=>{ setTimeout(()=>{
this.refresherTriggered = false this.refresherTriggered = false
},0); },0);
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
}, },
methods: { methods: {
onRefresherrefresh(e: RefresherEvent) { onRefresherrefresh(_: RefresherEvent) {
console.log("onRefresherrefresh--------------下拉刷新触发") console.log("onRefresherrefresh--------------下拉刷新触发")
this.refresherTriggered = true this.refresherTriggered = true
setTimeout(function(){ setTimeout(function(){
...@@ -40,10 +40,10 @@ ...@@ -40,10 +40,10 @@
}, 1500) }, 1500)
}, },
onRefresherabort(e: RefresherEvent) { onRefresherabort(_: RefresherEvent) {
console.log("onRefresherabort------下拉刷新被中止") console.log("onRefresherabort------下拉刷新被中止")
}, },
onRefresherrestore(e: RefresherEvent) { onRefresherrestore(_: RefresherEvent) {
console.log("onRefresherrestore------下拉刷新被复位") console.log("onRefresherrestore------下拉刷新被复位")
}, },
onRefresherpulling(e: RefresherEvent) { onRefresherpulling(e: RefresherEvent) {
......
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
onEnded: function (res : any) { onEnded: function (res : any) {
console.log(JSON.stringify(res)); console.log(JSON.stringify(res));
}, },
onTimeUpdate: function (res : any) { onTimeUpdate: function (_ : any) {
// console.log(JSON.stringify(res)); // console.log(JSON.stringify(res));
}, },
onFullScreenChange: function (res : any) { onFullScreenChange: function (res : any) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册