作者 李康

update

... ... @@ -74,14 +74,14 @@
//配种记录
dreedingRecord() {
console.log(this.isBreedShow)
let postData = {
pid: this.id
let postData = {
pid: this.id
}
request.postRequest('/api/Index/mateList', postData, data => {
if (data.code == 1) {
this.list = data.data.list;
}
request.postRequest('/api/Index/mateList', postData, data => {
if (data.code == 1) {
this.list = data.data.list;
}
})
})
},
bindTimeChange: function(e) {
this.startTime = e.target.value
... ... @@ -113,7 +113,7 @@
};
request.postRequest('/api/Index/index', postData, data => {
if (data.code == 1) {
if(data.data.list.is_breeding == 2){
if (data.data.list.is_breeding == 2) {
this.dreedingRecord()
}
}
... ... @@ -137,6 +137,7 @@
this.todayDate() //当前日期
this.indexPage()
this.dreedingRecord()
uni.setStorageSync('xiShow', true)
},
}
</script>
... ...
... ... @@ -38,7 +38,10 @@
<view class="select" v-if="petList==''" @click="goLogin">
请选择宠物
</view>
<view class="uni-input" v-else>{{petList[petIndex].name}}</view>
<view class="uni-input" v-else>
{{petName}}
</view>
<!-- <view class="uni-input" v-else>{{petList[petIndex].name}}</view> -->
<image src="../../static/image/xuanze_icon@2x.png" style="width: 12rpx;height: 12rpx;margin: 12rpx 0 0 12rpx;"
mode=""></image>
</view>
... ... @@ -96,7 +99,7 @@
<scroll-view scroll-x="true" class="colorBox scroll-view_H">
<view class="colorItem">
<view class="" style="display: flex;align-items: center;">
<image src="/static/image/shengbing_icon@2x.png" mode="" style="width:32rpx;height:32rpx;margin-right:10rpx;"></image>
<image src="../../static/image/shengbing_icon@2x.png" mode="" style="width:32rpx;height:32rpx;margin-right:10rpx;"></image>
生病
</view>
</view>
... ... @@ -167,7 +170,7 @@
<switch @change="switch2Change" :checked="peizhong" style="transform: scale(0.7,0.7)" />
</view>
</view>
<view class="pickerItem" v-if="peizhong">
<view class="pickerItem" v-if="heat&&peizhong">
<view class="">
配种记录
</view>
... ... @@ -302,6 +305,7 @@
},
data() {
return {
petName:'',//宠物名字
perShow:0,
isShowWenDu:true,
qing:'',
... ... @@ -355,7 +359,7 @@
disease:'',
symptomList:'', //症状
textareaInput:'', //备注
faceIndex:-1,//表情字段
faceIndex:'',//表情字段
showWendu:'请选择温度',
//显示id
sysId:{},
... ... @@ -432,13 +436,13 @@
note:this.textareaInput,
is_breeding:this.peizhong?2:1,
symptom:this.cuList,
// is_confirm:this.peizhong?2:1,
is_rut:this.heat?2:1
}
request.postRequest('/api/Index/recordEdit',postData,data=>{
if(data.code==1){
uni.removeStorageSync('parData');
uni.removeStorageSync('custom');
uni.removeStorageSync('xiShow');
uni.showToast({
title:'保存成功'
})
... ... @@ -488,13 +492,17 @@
var date = e.currentTarget.dataset.datenum
var YMD = e.currentTarget.dataset.year + '-' + month + '-' + date;
that.dataTime=YMD
console.log(YMD)
let paramData={
date:YMD,
p_id:this.petId
}
request.postRequest('/api/Index/index',paramData,data=>{
let pei =uni.getStorageSync('xiShow')
if(pei){
that.peizhong=pei
}else{
let info = data.data.list;
let pets =data.data.pet
that.faqingList=data.data.rut
that.symptomList=info?info.symptom:''
that.sbDate=data.data.sick
... ... @@ -504,8 +512,8 @@
that.slInput=info?info.eat:''
that.tcInput=info?info.length:''
that.tzInput=info?info.weight:''
that.peizhong=info?(info.is_breeding==1? false :true):false
that.heat=info?(info.is_rut==1? false :true):false
that.peizhong=pets?(pets.is_breeding==1? false :true):false
that.heat=pets?(pets.rut==1? true :false):false
that.shengbing=info?(info.is_sick==1? false :true):false
that.textareaInput=info?info.note:''
that.earlyList=data.data.pregnant_one
... ... @@ -515,6 +523,7 @@
that.showWendu=info&&info.temperature?info.temperature:'请选择温度'
that.faceIndex=info?info.energy:''
this.perShow=data.data.per
}
})
},
dateInit: function(setYear, setMonth) {
... ... @@ -582,7 +591,6 @@
switch1Change: function (e) {
let that =this
let data= e.detail.value
console.log(data)
if(data){
let paramData={
time:that.getTime(),
... ... @@ -590,8 +598,8 @@
type:1
}
request.postRequest('/api/Index/rutEdit',paramData,data=>{
console.log('打开开关'+data)
this.getPetInfo()
this.dateInit()
})
}
if(!data){
... ... @@ -601,22 +609,23 @@
type:2
}
request.postRequest('/api/Index/rutEdit',paramData,data=>{
console.log(data)
this.getPetInfo()
this.dateInit()
})
}
this.heat=e.target.value
},
switch2Change: function (e) {
this.peizhong=e.target.value
},
uni.setStorageSync('xiShow',e.target.value)
},
switch3Change: function (e) {
this.shengbing=e.target.value
},
bindPickerPet: function(e) {
this.petIndex = e.target.value;
this.petId=this.petList[this.petIndex].id
uni.setStorageSync('u_id',this.petList[this.petIndex].id)
this.getPetInfo();
this.dateInit();
uni.removeStorageSync('parData');
... ... @@ -640,30 +649,37 @@
p_id:this.petId
}
request.postRequest('/api/Index/index',param,data=>{
let info = data.data.list;
that.faqingList=data.data.rut
that.symptomList=info?info.symptom:''
that.sbDate=data.data.sick
that.yimiao=data.data.vaccine
that.sysId=info?info.symptom_id:''
that.symptom=info?info.symptom:''
that.slInput=info?info.eat:''
that.tcInput=info?info.length:''
that.tzInput=info?info.weight:''
that.peizhong=data.data?(info.is_breeding==1? false :true):false
that.heat=data.data.pet?(data.data.pet.rut==1? true :false):false
that.shengbing=info?(info.is_sick==1? false :true):false
that.textareaInput=info?info.note:''
that.earlyList=data.data.pregnant_one
that.middleList=data.data.pregnant_two
that.lateList=data.data.pregnant_three
that.expectList=data.data.pregnant_four
that.showWendu=info&&info.temperature?info.temperature:'请选择温度'
that.faceIndex=info?info.energy:''
this.perShow=data.data.per
if(data.data.pet.is_confirm==1){
this.showModalT()
let pei =uni.getStorageSync('xiShow')
if(pei){
that.peizhong=pei
}else{
this.petName=data.data.pet.pet_name;
let info = data.data.list;
that.faqingList=data.data.rut
that.symptomList=info.symptom
that.sbDate=data.data.sick
that.yimiao=data.data.vaccine
that.sysId=info?info.symptom_id:''
that.symptom=info?info.symptom:''
that.slInput=info?info.eat:''
that.tcInput=info?info.length:''
that.tzInput=info?info.weight:''
that.peizhong=data.data.pet?(data.data.pet.is_breeding==1 ? false :true):false
that.heat=data.data.pet.rut==1?true:false
that.shengbing=info?(info.is_sick==1? false :true):false
that.textareaInput=info?info.note:''
that.earlyList=data.data.pregnant_one
that.middleList=data.data.pregnant_two
that.lateList=data.data.pregnant_three
that.expectList=data.data.pregnant_four
that.showWendu=info&&info.temperature?info.temperature:''
that.faceIndex=info?info.energy:''
this.perShow=data.data.per
if(data.data.pet.is_confirm==1&&data.data.per==0){
this.showModalT()
}
}
})
},
bindPickerChangeZl: function(e) {
... ... @@ -744,6 +760,7 @@
}
//确认配种
request.postRequest('/api/Index/confirm',postData,data=>{
that.getPetInfo()
let paramData={
time:this.getTime(),
p_id:this.petId,
... ... @@ -751,9 +768,10 @@
}
//关闭发情
request.postRequest('/api/Index/rutEdit',paramData,data=>{
this.getPetInfo()
that.getPetInfo()
})
})
} else if (res.cancel) {
console.log('用户点击取消');
}
... ... @@ -831,6 +849,18 @@
}
},
onShow() {
let Show= uni.getStorageSync('anShow')
if(!Show){
let u_id=uni.getStorageSync('u_id')
if(u_id){
this.petId=u_id
this.dateInit()
this.getPetInfo()
}
}
let token= uni.getStorageSync('token')
//宠物列表
if(token){
... ... @@ -858,16 +888,17 @@
return x.title
}
})
let ListTitle= list.filter(x=>{
let ListTitle=list.filter(x=>{
return x!=undefined
})
let ziList=cuslist.map(x=>{
return x
})
console.log(ziList.toString())
let zList=ziList.toString();
this.cuList=ziList
this.symptomList=ListTitle.concat(zList)
let zList=ziList.toString()
this.cuList=zList
let upList=ListTitle.concat(zList)
this.symptomList=upList.toString()
console.log()
}
}
</script>
... ...
... ... @@ -157,6 +157,7 @@
onLoad(options) {
this.petId = options.id
this.symptom()
uni.setStorageSync('anShow', true)
}
}
</script>
... ...
... ... @@ -9,7 +9,7 @@
<text>请选择头像</text>
</view>
<view v-if="petImg">
<image :src="petImg" style="width: 56rpx;height: 56rpx;" mode=""></image>
<image :src="petImg" style="width: 56rpx;height: 56rpx;border-radius: 50%;" mode=""></image>
</view>
</view>
</view>
... ...
<template>
<view style="border-top: 1px solid #F2F2F2;">
<view style="padding-top: 32rpx;">
<view class="petBack" v-for="(item,index) in petData" :key="index" @click="goBian(item.id)">
<view class="petBackImg">
<view class="petBack" v-for="(item,index) in petData" :key="index">
<view class="petBackImg" @click="goShow(item.id)">
<view class="">
<image :src="item.avatar" style="width:120rpx;height:120rpx;background: #ffffff;border-radius: 50%;box-shadow: 0px 4px 8px 0px rgba(0,0,0,0.01);"
mode=""></image>
... ... @@ -14,7 +14,7 @@
<image src="../../static/image/nv_icon@2x.png" style="width: 28rpx;height: 28rpx;" mode=""></image>
</view>
</view>
<view class="petNav">
<view class="petNav" @click="goShow(item.id)">
<view class="petCatText">
<text class="petCatTitle">{{item.name}}</text>
</view>
... ... @@ -32,7 +32,7 @@
<view class="petRightSeMo" v-if="item.status == 1 " @click="setStatus(item.id)">
<text class="petRightSeText">设为默认</text>
</view>
<view style="margin: 52rpx 0 0 30px;" >
<view style="margin: 52rpx 0 0 30px;" @click="goBian(item.id)">
<image src="../../static/image/bianji_icon@2x.png" style="width: 29rpx;height: 29rpx;" mode=""></image>
</view>
</view>
... ... @@ -58,6 +58,13 @@
},
methods: {
//点击宠物跳转首页
goShow(id) {
uni.switchTab({
url: '/pages/index/index'
})
uni.setStorageSync('u_id', id);
},
setStatus(id) {
let paramData = {
id: id,
... ... @@ -86,7 +93,8 @@
request.postRequest('/api/Pet/petList', {}, data => {
this.petData = data.data.list
})
}
},
},
onShow() {
this.petList()
... ...

1.1 KB | 宽: | 高:

1.2 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖