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

去掉编译警告

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