<template>
<view style="">
<view v-for="(item,index) in list" :key="index" style="">
<view class="" style="flex-direction: row;margin: 2%;">
<view class="">
<image src="../../static/logo.png" style="height: 80rpx;width: 80rpx;border-radius: 5px;"></image>
</view>
<view class="" style="margin-left: 5px;width: 100%;">
<view class="" style="margin-bottom: 10px;">
<text style="color: #576b96;font-size: 18px;">{{item.nicheng}}</text>
</view>
<view class=""><text style="font-size: 18px;">{{item.wenben}}</text></view>
<view class="" v-if="item.tupian.length<2" style="width: 100%;">
<image :src="item.tupian[0]" mode="widthFix" @click="previewImage(0,item.tupian)" style="width: 100%;"></image>
</view>
<view v-else class=""
style="flex-direction: row;width: 100%;flex-wrap:wrap;margin-top: 10px;margin-bottom: 3px;">
<view style="width: 203rpx;height:203rpx;margin-right: 3px;margin-bottom: 3px;"
v-for="(item2,index2) in item.tupian" :key="index2">
<image :src="item2" mode="widthFix"
@click="previewImage(index2,item.tupian)"></image>
</view>
</view>
</view>
</view>
<view class="" style="border-top: 1px solid #f5f5f5;"></view>
</view>
<view class="" style="height: 2300px;background-color: #576b96;z-index: 999;flex-direction: column;">这里怎么才能显示出来?</view>
<!-- <text>{{ yuming }}</text>
<view class="" style="height: 100rpx;"></view>
<button @click="shanchu()" type="default">删除缓存</button>
<view class="" style="height: 100rpx;"></view>
<button @click="jiancha()" type="default">存放</button>
<view class="" style="height: 100rpx;"></view>
<button @click="chakan()" type="default">查看</button>
<view class="" style="height: 100rpx;"></view>
<button @click="plus" type="default">加加加</button> -->
</view>
</template>
<script lang="uts">
import { state, setGlobalNum, quanju } from '@/store/index.uts'
type Neirong = {
id : Number,
tupian : string[],
wenben : string,
nicheng : string,
}
export default {
data() {
return {
list: [] as Array<Neirong>,
yuming: '',
page: 1,
}
},
onLoad() {
this.fenye(1)
},
onPullDownRefresh() {
this.page = 1;
this.list = [];
this.fenye(1)
uni.stopPullDownRefresh()
},
onReachBottom() {
this.page += 1;
this.fenye(this.page)
},
onReady() {
// this.jiancha()
},
methods: {
fenye(page : number) {
uni.request({
url: quanju.yuming + '/zuopin/LimitZuopin',
method: 'GET',
data: {
page: page,
pagesize: 50,
},
success: res => {
let aa = res.data as UTSJSONObject[]
if (aa.length == 0) {
return
}
for (var i = 0; i < aa.length; i++) {
let tupian2 = aa[i].getArray("Tupian") as UTSJSONObject[]
let shuzu1 = [] as Array<string>
for (var k = 0; k < tupian2.length; k++) {
shuzu1.push(quanju.yuming + '/tupian/' + tupian2[k]);
}
let nn : Neirong = {
id: aa[i].getNumber("ID") as number,
tupian: shuzu1,
wenben: aa[i].getString("Wenben") as string,
nicheng: aa[i].getString("Nicheng") as string
}
this.list.push(nn)
}
// console.log('===this.list==', this.list)
}
});
},
previewImage(index : number, dizhi : string[]) {
uni.previewImage({
urls: dizhi,
current: index,
})
},
fabClick() {
uni.navigateTo({
url: '/pages/fabu/fabu'
})
},
shanchu() {
uni.removeStorage({
key: 'yonghu',
success: () => {
uni.showModal({
title: '移除数据成功',
showCancel: false,
})
},
fail: () => {
uni.showModal({
title: '移除数据失败',
showCancel: false,
})
},
})
},
chakan() {
let yonghu2 = uni.getStorageSync('yonghu');
if (yonghu2 == '') {
console.log('==不存在=', yonghu2)
} else {
let yy = yonghu2 as UTSJSONObject
console.log('==kong==2=', yy.getNumber("id"))
console.log('==kong==2=', yy.getString("nicheng"))
console.log('==kong==2=', yy.getString("miyue"))
}
},
jiancha() {
let yonghu = uni.getStorageSync('yonghu');
if (yonghu != '') {
return
}
uni.request({
url: quanju.yuming + '/yonghu/CreateYonghu',
method: 'GET',
data: {},
success: res => {
let rrs = res.data as UTSJSONObject
let yonghu2 = {
id: rrs.getNumber("ID"),
nicheng: rrs.getString("Nicheng"),
miyue: rrs.getString("Miyue")
}
uni.setStorageSync('yonghu', yonghu2);
}
});
},
plus() {
console.log('=====', quanju.yuming)
// setGlobalNum(state.globalNum + 1)
}
}
}
</script>
<style>
</style>
uniappx显示数据
原创wx62cbd84cdb743 ©著作权
©著作权归作者所有:来自51CTO博客作者wx62cbd84cdb743的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:ubuntu22安装pm2
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
谷歌地球引擎:导入、筛选、显示栅格遥感影像数据
本文介绍谷歌地球引擎GEE自带的各类遥感、高程等栅格数据导入,并进行可视化显示的方法。本文是谷歌地球引擎(Google Earth Engine,GEE)系列教学文章的第二篇~
GEE 谷歌地球引擎 Earth Engine 遥感影像 GIS数据 -
ExpandableListView 显示分组数据VS ListView显示列表数据
摘要 项目中有些类似以前j2ee里面的级联菜单的控件叫ExpandableListView是可扩展列表,用来
android开发 app 广州传智播客 android高薪 ExpandableListView