This commit is contained in:
weipengfei 2024-03-06 17:40:26 +08:00
parent 90cb3619f5
commit 60f72cf533
8 changed files with 53 additions and 41 deletions

View File

@ -2,8 +2,8 @@
"name" : "养殖溯源",
"appid" : "__UNI__C509A32",
"description" : "",
"versionName" : "1.0.3",
"versionCode" : 103,
"versionName" : "1.0.4",
"versionCode" : 104,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@ -221,7 +221,9 @@
if (res.code == 1) {
datalist.splice(0, datalist.length, ...res.data)
res.data.forEach(item=>{
datalist.push(item)
})
res.data.detai
// console.log(res.data)
}

View File

@ -213,9 +213,9 @@
}).then((res) => {
if (res.code == 1) {
dataList.splice(0, dataList.length, ...res.data);
dataList.forEach(item => {
res.data.forEach(item=>{
item.showCode = false
dataList.push(item)
})
console.log(dataList)
}

View File

@ -298,7 +298,9 @@
item.pic = JSON.parse(item.pic||'[]');
return item
})
dataList.splice(0, dataList.length, ...res.data.lists);
res.data.lists.forEach(item=>{
dataList.push(item)
})
// console.log(dataList)
}
});

View File

@ -8,10 +8,13 @@
<view class="left">
<u--image @click="perviewFn(item.pic[0])" radius='10' :src="item.pic[0]" width="250rpx"
height="250rpx"></u--image>
<u---image class="qr-code" @click="showBarCode(item)" src="/static/main/house/su_yuan_ma_btn.png" width="60rpx" height="60rpx"></u---image>
<u---image class="qr-code" @click="showBarCode(item)" src="/static/main/house/su_yuan_ma_btn.png"
width="60rpx" height="60rpx"></u---image>
</view>
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)"></u--image>
<view class="right" style="color: #7B7B7B;" @click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)">
<u--image src="/static/main/house/xia_yi_ji_btn.png" class="next" width="38rpx" height="38rpx"
@click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)"></u--image>
<view class="right" style="color: #7B7B7B;"
@click="navTo(`/pages/plantAdmin/breedDetail?id=${item.id}&house_id=${item.fence_house_id}`)">
<view class="name">{{item.sn}}</view>
<view class="r-item">
<view class="item-title">品类:</view>
@ -60,7 +63,6 @@
</template>
<script setup>
import {
ref,
reactive
@ -89,12 +91,12 @@
}
const options = ref({
code: '',//
size: 460,// 460460rpx
code: '', //
size: 460, // 460460rpx
})
const qrCode = ref('');
const saveCode = async ()=>{//
const saveCode = async () => { //
const img = await qrCode.value.GetCodeImg()
uni.saveImageToPhotosAlbum({
filePath: img.tempFilePath,
@ -115,7 +117,7 @@
});
}
const codeRef = ref(null);
const showBarCode = (e)=>{
const showBarCode = (e) => {
options.value.code = 'd_' + e.sn;
codeRef.value.open();
}
@ -157,23 +159,25 @@
if (res.code == 1) {
res.data.lists = res.data.lists.map(item => {
item.showCode = false;
item.pic = JSON.parse(item.pic||'[]');
item.pic = JSON.parse(item.pic || '[]');
return item
})
dataList.splice(0, dataList, ...res.data.lists);
res.data.lists.forEach(item => {
dataList.push(item)
})
// console.log(dataList)
}
});
};
const animal_type_lists = ref([]);
const initAnimalTypeLists = ()=>{
animalTypeLists().then(res=>{
const initAnimalTypeLists = () => {
animalTypeLists().then(res => {
animal_type_lists.value = res.data;
})
}
initAnimalTypeLists();
const getAnimalType = (value)=>{
return animal_type_lists.value.find(item=>item.value==value)?.name || ''
const getAnimalType = (value) => {
return animal_type_lists.value.find(item => item.value == value)?.name || ''
}
onLoad((option) => {
@ -181,7 +185,7 @@
getlist();
});
onReachBottom(()=>{
onReachBottom(() => {
where.value.page_no++;
getlist();
})
@ -289,7 +293,8 @@
.left {
flex-shrink: 0;
position: relative;
.qr-code{
.qr-code {
position: absolute;
right: 10rpx;
bottom: 10rpx;
@ -374,7 +379,7 @@
background: linear-gradient(to right, #FEFFFF 0%, #E8FAF2 100%);
}
.bar-code{
.bar-code {
padding: 28rpx;
background-color: #fff;
border-radius: 24rpx;
@ -382,12 +387,14 @@
align-items: center;
flex-direction: column;
justify-content: center;
.title{
.title {
font-size: 32rpx;
font-weight: bold;
margin-bottom: 15rpx;
}
.btn{
.btn {
background-color: rgba(#999, 0.2);
font-size: 24rpx;
padding: 5rpx 20rpx;

View File

@ -210,8 +210,9 @@
item.pic = JSON.parse(item.pic||'[]');
return item
})
dataList.splice(0, dataList, ...res.data.lists);
// console.log(dataList)
res.data.lists.forEach(item=>{
dataList.push(item)
})
}
});
};

File diff suppressed because one or more lines are too long

View File

@ -7,8 +7,8 @@
"id": "__UNI__C509A32",
"name": "养殖溯源",
"version": {
"name": "1.0.3",
"code": 103
"name": "1.0.4",
"code": 104
},
"description": "",
"developer": {