切换导航条
此项目
正在载入...
登录
倪静楠
/
chongwu
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
李康
4 years ago
提交
0cba7bf8a09fa7df6a5982699ed7ddc41eb79ad8
1 个父辈
d7dbaa4c
update
隐藏空白字符变更
内嵌
并排对比
正在显示
6 个修改的文件
包含
97 行增加
和
56 行删除
pages/index/breeding-records.vue
pages/index/index.vue
pages/index/symptom.vue
pages/me/addPet.vue
pages/me/myPet.vue
static/image/shengbing_icon@2x.png
pages/index/breeding-records.vue
查看文件 @
0cba7bf
...
...
@@ -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>
...
...
pages/index/index.vue
查看文件 @
0cba7bf
...
...
@@ -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=>{
th
is
.getPetInfo()
th
at
.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>
...
...
pages/index/symptom.vue
查看文件 @
0cba7bf
...
...
@@ -157,6 +157,7 @@
onLoad(options) {
this.petId = options.id
this.symptom()
uni.setStorageSync('anShow', true)
}
}
</script>
...
...
pages/me/addPet.vue
查看文件 @
0cba7bf
...
...
@@ -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>
...
...
pages/me/myPet.vue
查看文件 @
0cba7bf
<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()
...
...
static/image/shengbing_icon@2x.png
查看文件 @
0cba7bf
1.1 KB
|
宽:
|
高:
1.2 KB
|
宽:
|
高:
两方对比
交换覆盖
透明覆盖
请
注册
或
登录
后发表评论