作者 李康

合并分支 'lk' 到 'master'

Lk



查看合并请求 !31
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"type": "uniCloud",
"default": {
"launchtype": "remote"
}
}
]
}
... ...
... ... @@ -5,7 +5,7 @@
.inputClass {
font-size: 28rpx;
color: #BDC4CE;
text-align: end;
text-align: right;
}
.addBtns {
... ... @@ -16,6 +16,13 @@
height: 104rpx;
}
.petClassTextS {
position: absolute;
top: 24rpx;
right: 60rpx;
width: 153rpx;
}
.addBtn {
height: 88rpx;
background: linear-gradient(90deg, #ffa73d, #ff8735);
... ... @@ -54,6 +61,7 @@
.petClass {
font-size: 28rpx;
color: #BDC4CE;
text-align: center;
}
.petClassText {
... ... @@ -81,7 +89,7 @@
}
.addBack {
padding-top: 35rpx;
padding: 35rpx 0;
margin-bottom: 104rpx;
}
... ...
... ... @@ -185,6 +185,10 @@
background: linear-gradient(180deg, #ffa6a6 2%, #f64747 96%);
}
.circle6 {
background: linear-gradient(180deg, #ff0000 50%, #ff0000 36%);
}
/* end */
.cwInfo {
width: 90%;
... ...
... ... @@ -12,6 +12,18 @@
font-size: 28rpx;
}
.inputClass {
font-size: 28rpx;
color: #BDC4CE;
text-align: right;
}
.petClassTextS {
position: absolute;
top: 20rpx;
right: 78rpx;
width: 153rpx;
}
.BtnImgSum {
display: flex;
... ... @@ -92,6 +104,7 @@
.petClass {
font-size: 28rpx;
color: #BDC4CE;
text-align: center;
}
.petClassText {
... ... @@ -118,7 +131,7 @@
}
.addBack {
padding-top: 35rpx;
padding: 35rpx 0;
margin-bottom: 100rpx;
}
... ...
... ... @@ -38,7 +38,7 @@
}
.replyBody {
margin: 32rpx;
margin: 0 32rpx 32rpx 32rpx;
border-bottom: 1rpx solid #EBEDF0;
display: flex;
height: 220rpx;
... ... @@ -48,5 +48,13 @@
margin: 32rpx;
border-bottom: 1rpx solid #EBEDF0;
display: flex;
height: 180rpx;
}
.replyNavData {
display: -webkit-box;
word-break: break-all;
text-overflow: ellipsis;
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
}
... ...
... ... @@ -302,19 +302,6 @@
}
/* .select_public .type_title {
display: inline-block;
font-size: 28rpx;
font-weight: 400;
text-align: center;
color: #969799;
line-height: 1;
} */
.today .date-head {
/* background-color: #fd5d41; */
color: #ff8936 !important;
... ... @@ -333,6 +320,15 @@
margin-left: 7rpx;
}
.yuchan .date-head {
background: linear-gradient(180deg, #ff0000 50%, #ff0000 36%);
color: #fff !important;
border-radius: 16rpx;
width: 80rpx;
height: 80rpx;
margin-left: 7rpx;
}
.yimiao .date-head {
background: linear-gradient(180deg, #c3e6cf, #8cd5c3);
color: #fff !important;
... ... @@ -377,7 +373,8 @@
height: 80rpx;
margin-left: 7rpx;
}
.startYextAll{
.startYextAll {
position: absolute;
top: 40rpx;
left: 28rpx;
... ... @@ -385,16 +382,19 @@
font-size: 20rpx;
font-weight: 500;
}
.faStyle {
color: #B8BDFF;
}
.earlyStyle{
.earlyStyle {
color: #FFC9DB;
}
.middlexStyle{
color:#FC75A1;
.middlexStyle {
color: #FC75A1;
}
.lateStyle {
color: #F64747;
}
.lateStyle{
color:#F64747;
}
... ...
... ... @@ -33,7 +33,6 @@
添加相爱记录
</view>
</view>
</view>
</template>
... ... @@ -74,14 +73,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 +112,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 +136,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>
... ... @@ -71,17 +74,17 @@
</view>
</view>
<view class='date-box'>
<view v-for="(item,index) in dateArr" :key="index" :class="faqingList.indexOf(item.isToday)!==-1 ?'faqing':earlyList.indexOf(item.isToday)!==-1?'early':middleList.indexOf(item.isToday)!==-1?'middle':lateList.indexOf(item.isToday)!==-1?'lateDate':sbDate.indexOf(item.isToday)!==-1?'shengbing':yimiao.indexOf(item.isToday)!==-1?'yimiao':today==item.isToday?'today':''"
<view v-for="(item,index) in dateArr" :key="index" :class="faqingList.indexOf(item.isToday)!==-1 ?'faqing':earlyList.indexOf(item.isToday)!==-1?'early':middleList.indexOf(item.isToday)!==-1?'middle':lateList.indexOf(item.isToday)!==-1?'lateDate':sbDate.indexOf(item.isToday)!==-1?'shengbing':expectList.indexOf(item.isToday)!==-1?'yuchan':yimiao.indexOf(item.isToday)!==-1?'yimiao':today==item.isToday?'today':''"
:data-faqing='faqing'>
<view class='date-head' @click='lookHuoDong' :data-year='year' :data-month='month' :data-datenum='item.dateNum'
style="position: relative;">
<view :class="ymd==item.isToday?'acred date-head':'date-head'" @click='lookHuoDong' :data-year='year'
:data-month='month' :data-datenum='item.dateNum' style="position: relative;">
<view v-if="item.dateNum">{{item.dateNum}}
<view class="" style="position: absolute;top: 82rpx;font-size: 20rpx;width: 26px;display: flex;align-items: center;color: #FF8936;"
v-if="today==item.isToday">
今日
</view>
<view class="" v-if="sbDate.indexOf(item.isToday)!==-1">
<image src="/static/image/shengbing_icon@2x%20(1).png" mode="" :class="sbDate.indexOf(item.isToday)!==-1&&yimiao.indexOf(item.isToday)==-1&&faqingList.indexOf(item.isToday)!==-1&&earlyList.indexOf(item.isToday)==-1&&middleList.indexOf(item.isToday)==-1&&lateList.indexOf(item.isToday)==-1?'fallIcon1':'fallIcon'"></image>
<image src="../../static/image/shengbing_icon.png" mode="" :class="sbDate.indexOf(item.isToday)!==-1&&yimiao.indexOf(item.isToday)==-1&&faqingList.indexOf(item.isToday)!==-1&&earlyList.indexOf(item.isToday)==-1&&middleList.indexOf(item.isToday)==-1&&lateList.indexOf(item.isToday)==-1?'fallIcon1':'fallIcon'"></image>
</view>
<view v-if="yimiao.indexOf(item.isToday)!==-1">
<image src="/static/image/yimiao_icon@2x.png" mode="" :class="yimiao.indexOf(item.isToday)!==-1&&sbDate.indexOf(item.isToday)==-1?'vanniceIcon1':'vanniceIcon2'"></image>
... ... @@ -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>
... ... @@ -133,9 +136,15 @@
<view class="colorItem" style="margin-right: 22rpx;">
<view class="" style="display: flex;align-items: center;">
<view class="circle5 circlePublic">
</view>
孕后期
孕中后期
</view>
</view>
<view class="colorItem" style="margin-right: 22rpx;">
<view class="" style="display: flex;align-items: center;">
<view class="circle6 circlePublic">
</view>
预产期
</view>
</view>
</scroll-view>
... ... @@ -153,7 +162,7 @@
<switch @change="switch1Change" :checked="heat" style="transform: scale(0.7,0.7)" />
</view>
</view>
<view class="pickerItem" v-if="perShow!=1">
<view class="pickerItem" v-if="heat">
<view class="">
配种
</view>
... ... @@ -161,6 +170,12 @@
<switch @change="switch2Change" :checked="peizhong" style="transform: scale(0.7,0.7)" />
</view>
</view>
<view class="pickerItem" v-if="heat&&peizhong">
<view class="">
配种记录
</view>
<image src="/static/image/arrow.png" mode="" @click="dreedingRecord"></image>
</view>
<view class="pickerItem">
<view class="">
生病
... ... @@ -169,12 +184,7 @@
<switch @change="switch3Change" :checked="shengbing" style="transform: scale(0.7,0.7)" />
</view>
</view>
<view class="pickerItem" v-if="peizhong">
<view class="">
配种记录
</view>
<image src="/static/image/arrow.png" mode="" @click="dreedingRecord"></image>
</view>
<view class="pickerItem">
<view class="">
食量
... ... @@ -188,11 +198,11 @@
温度
</view>
<view style="display:flex;align-items: center;">
<picker @change="bindPickerChangeWd" data-item="arrayWd" :value="indexWd" :range="arrayWd">
<picker mode="multiSelector" @change="bindMultiPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex"
:range="multiArray">
<view class="select">
{{showWendu}}
</view>
<!-- <view v-else class="uni-input">{{arrayWd[indexWd]}}</view> -->
</picker>
<image src="/static/image/arrow.png" mode=""></image>
</view>
... ... @@ -221,7 +231,7 @@
</view>
</view>
<view class="selectText">
<input type="text" value="" placeholder="请输入体长" v-model="tcInput" @input="bindInputTc" style="text-align: right;" />
<input type="digit" value="" placeholder="请输入体长" v-model="tcInput" @input="bindInputTc" style="text-align: right;" />
</view>
</view>
<view class="pickerItem">
... ... @@ -233,7 +243,7 @@
</view>
</view>
<view class="selectText">
<input type="text" value="" placeholder="请输入体重" v-model="tzInput" @input="bindInputTz" style="text-align: right;" />
<input type="digit" value="" placeholder="请输入体重" v-model="tzInput" @input="bindInputTz" style="text-align: right;" />
</view>
</view>
<view class="pickerItem">
... ... @@ -285,7 +295,6 @@
</view>
</view>
</template>
<script>
import amap from '../../utils/amap-wx.js'
import request from '../../utils/request.js'
... ... @@ -296,6 +305,9 @@
},
data() {
return {
multiArray: [['35', '36','37', '38','39', '40','41', '42','43'], ['0','1', '2', '3', '4', '5','6', '7', '8', '9']],
multiIndex: [0, 0, 0],
petName:'',//宠物名字
perShow:0,
isShowWenDu:true,
qing:'',
... ... @@ -342,22 +354,30 @@
slInput:'',
tcInput:'',
tzInput:'',
arrayWd: ['35','35.1','35.2','35.3','35.4','35.5','35.6','35.7','35.8','35.9','36','36.1','36.2','36.3','36.4','36.5','36.6','36.7','36.8','36.9','37','37.1','37.2','37.3','37.4','37.5','37.6','37.7','37.8','37.9',
'38','38.1','38.2','38.3','38.4','38.5','38.6','38.7','38.8','38.9','39','39.1','39.2','39.3','39.4','39.5','39.6','39.7','39.8','39.9','40','40.1','40.2','40.3','40.4','40.5','40.6','40.7','40.8','40.9',
'41','41.1','41.2','41.3','41.4','41.5','41.6','41.7','41.8','41.9','42','42.1','42.2','42.3','42.4','42.5','42.6','42.7','42.8','42.9','43','43.1','43.2','43.3','43.4','43.5','43.6','43.7','43.8','43.9','44','44.1','44.2','44.3','44.4','44.5','44.6','44.7','44.8','44.9',],
indexWd: '',
disease:'',
symptomList:'', //症状
textareaInput:'', //备注
faceIndex:-1,//表情字段
faceIndex:'',//表情字段
showWendu:'请选择温度',
//显示id
sysId:{},
//自定义汉字
cuList:{}
cuList:'',
//当前时间
dataTime:this.getTime(),
ymd:''
}
},
methods: {
bindMultiPickerChange (e) {
this.indexWd=this.multiArray[0][e.detail.value[0]]+'.'+this.multiArray[1][e.detail.value[1]]
this.showWendu=this.multiArray[0][e.detail.value[0]]+'.'+this.multiArray[1][e.detail.value[1]]
},
bindMultiPickerColumnChange (e) {
console.log(e);
// 知道修改的列以后,就可以通过修改multiIndex中对应元素的值,然后再修改multiArray
},
goweight(){
uni.navigateTo({
url:'/pages/index/weight-norm'
... ... @@ -412,7 +432,7 @@
//保存
save(){
let postData={
time:this.getTime(),
time:this.dataTime,
p_id:this.petId,
eat:this.slInput,
temperature:this.showWendu,
... ... @@ -423,14 +443,15 @@
energy:this.faceIndex,
note:this.textareaInput,
is_breeding:this.peizhong?2:1,
symptom:this.cuList.toString(),
// is_confirm:this.peizhong?2:1,
symptom:this.cuList,
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.removeStorageSync('anShow');
uni.showToast({
title:'保存成功'
})
... ... @@ -474,10 +495,53 @@
this.today=today.replace(/-/g,'')
},
lookHuoDong: function(e) {
console.log(e)
var month = e.currentTarget.dataset.month < 10 ? '0' + e.currentTarget.dataset.month : e.currentTarget.dataset.month
let that =this
let mon=e.currentTarget.dataset.month+1
var month = mon < 10 ? '0' +mon :mon
var date = e.currentTarget.dataset.datenum
var YMD = e.currentTarget.dataset.year + '-' + month + '-' + date;
var ymd = e.currentTarget.dataset.year + month + date;
that.dataTime=YMD
console.log(ymd)
that.ymd=ymd
// dateArr.forEach((item,index)=>{
// if(ymd==item){
// }
// })
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
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=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
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
}
})
},
dateInit: function(setYear, setMonth) {
let _this = this;
... ... @@ -486,7 +550,6 @@
let arrLen = 0; //dateArr的数组长度
let now = setYear ? new Date(setYear, setMonth) : new Date();
let year = setYear || now.getFullYear();
let nextYear = 0;
let month = setMonth || now.getMonth(); //没有+1方便后面计算当月总天数
let nextMonth = (month + 1) > 11 ? 1 : (month + 1);
... ... @@ -544,40 +607,42 @@
},
switch1Change: function (e) {
let that =this
console.log(e)
let data= e.detail.value
if(e){
if(data){
let paramData={
time:that.getTime(),
p_id:that.petId,
type:1
}
request.postRequest('/api/Index/rutEdit',paramData,data=>{
console.log('打开开关'+data)
that.getPetInfo()
that.dateInit()
})
this.getPetInfo();
}else{
}
if(!data){
let paramData={
time:that.getTime(),
p_id:that.petId,
type:2
}
request.postRequest('/api/Index/rutEdit',paramData,data=>{
console.log('关闭开关'+data)
that.getPetInfo()
that.dateInit()
})
this.getPetInfo();
}
this.heat=e.target.value
that.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');
... ... @@ -601,30 +666,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=info?(info.is_breeding==1? false :true):false
that.heat=info?(info.is_rut==1? false :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){
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?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) {
... ... @@ -639,10 +711,6 @@
bindInputTc: function(e) {
this.tcInput= e.detail.value
},
bindPickerChangeWd: function(e) {
this.indexWd = e.target.value;
this.showWendu=this.arrayWd[this.indexWd]
},
bindTextAreaBlur: function (e) {
this.textareaInput=e.detail.value
},
... ... @@ -684,7 +752,6 @@
})
},1500)
}
},
//症状
diseases(){
... ... @@ -701,12 +768,22 @@
if (res.confirm) {
let postData={
time:that.getTime(),
p_id:that.petId,
is_confirm:2
p_id:that.petId
}
//确认配种
request.postRequest('/api/Index/confirm',postData,data=>{
that.getPetInfo()
let paramData={
time:this.getTime(),
p_id:this.petId,
type:2
}
//关闭发情
request.postRequest('/api/Index/rutEdit',paramData,data=>{
that.getPetInfo()
})
})
} else if (res.cancel) {
console.log('用户点击取消');
}
... ... @@ -784,6 +861,17 @@
}
},
onShow() {
let Show = uni.getStorageSync('anShow')
let u_id=uni.getStorageSync('u_id')
if(!Show){
if(u_id){
this.petId=u_id
this.getPetInfo()
this.dateInit()
}
}else{
this.petId=u_id
}
let token= uni.getStorageSync('token')
//宠物列表
if(token){
... ... @@ -795,38 +883,38 @@
}
this.isShowWenDu=this.tqWedu <20 ?true:false;
this.userData.address=uni.getStorageSync('address');
let symlist=uni.getStorageSync('parData');
let cuslist=uni.getStorageSync('custom');
let sysId=symlist.map(x=>{
if(x.id!=undefined){
return x.id
}
})
let DataId=sysId.filter(x=>{
return x!=undefined
})
this.sysId=DataId.toString()
let symlist=uni.getStorageSync('parData');
let cuslist=uni.getStorageSync('custom');
let sysIds=symlist.map(x=>{
if(x.id!=undefined){
return x.id
}
})
//自定义症状
this.cuList=cuslist
//选中的症状id
this.sysId=sysIds.toString()
let list = symlist.map(x=>{
if(x.id!=undefined){
return x.title
}
})
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.toString()
this.symptomList=ListTitle.concat(zList)
let sysDataList=list.toString();
//把症状名称拼接后
this.symptomList=sysDataList.concat(cuslist)
}
}
</script>
<style>
@import url("/common/uni.css");
@import url("/common/index.css");
@import url("/common/rili.css");
.acred{
border: 1rpx solid red;
width: 88rpx;
height: 80rpx;
border-radius: 16rpx;
}
</style>
... ...
... ... @@ -5,7 +5,7 @@
头部
</view>
<view class="innerBox">
<view :class="indexX==item.id? ' active':'Item'" v-for="(item,index) in head" :key="index" @click="selectX(item,index)">
<view :class="indexX==item.id? 'active':'Item'" v-for="(item,index) in head" :key="index" @click="selectX(item,index)">
{{item.title}}
</view>
</view>
... ... @@ -15,7 +15,7 @@
腹部
</view>
<view class="innerBox">
<view :class="indexY ==item.id ? ' active':'Item'" v-for="(item,index) in belly" :key="index" @click="selectY(item,index)">
<view :class="indexY ==item.id ? 'active':'Item'" v-for="(item,index) in belly" :key="index" @click="selectY(item,index)">
{{item.title}}
</view>
</view>
... ... @@ -25,7 +25,7 @@
全身
</view>
<view class="innerBox">
<view :class="indexZ == item.id ? ' active':'Item'" v-for="(item,index) in body" :key="index" @click="selectZ(item,index)">
<view :class="indexZ == item.id ? 'active':'Item'" v-for="(item,index) in body" :key="index" @click="selectZ(item,index)">
{{item.title}}
</view>
</view>
... ... @@ -89,11 +89,12 @@
fubu: {},
//身体
shenti: {},
dataIsShow: false
dataIsShow: false,
//只能选一个
oneText: ''
}
},
methods: {
//保存症状
onSave() {
let tempArry = [];
... ... @@ -107,7 +108,7 @@
tempArry.push(this.shenti)
}
uni.setStorageSync('parData', tempArry)
uni.setStorageSync('custom', this.list4)
uni.setStorageSync('custom', this.oneText)
uni.navigateBack()
},
//症状
... ... @@ -121,7 +122,6 @@
})
},
selectX(item, index) {
console.log(item)
this.indexX = item.id
this.toubu = item
},
... ... @@ -135,6 +135,7 @@
},
selectZD(item, index) {
this.oneText = item
this.indexZD = index
},
bindInput(e) {
... ... @@ -157,6 +158,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>
... ... @@ -26,29 +26,25 @@
</view>
</view>
<view class="addAii">
<van-field type="text" inputmode="decimal":value="petWeight" clearable label="体重" input-align="right" placeholder="请输入体重"
bind:click-icon="onClickIcon" />
<!-- <van-popup :show="showPickerWeight" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="petWeightArray" @confirm="bindPickerWeight" @cancel="showPickerWeight = false" />
</van-popup> -->
<!-- <van-cell title="体重" @click="showPickerWeight = true" />
<view class="petClassText">
<input class="inputClass" @input="detall" :value="petWeight" type="text" placeholder-style="font-size:28rpx;color:#BDC4CE"
value="" placeholder="请填写体重" />
<text class="petClass" @click="showPickerWeight = true">{{petWeight}}</text>
</view> -->
<van-cell title="体重(斤)" @click="showPickerWeight = true" is-link />
<view class="petClassTextS">
<picker mode="multiSelector" @change="TiZhongPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex"
:range="multiArray">
<view class="petClass">
{{showTiZhong}}
</view>
</picker>
</view>
</view>
<view class="addAii">
<van-cell title="体长" @click="showPickerLenght = true" />
<!-- <van-popup :show="showPickerLenght" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="petLenghtArray" @confirm="bindPickerLenght" @cancel="showPickerLenght = false" />
</van-popup> -->
<view class="petClassText">
<input class="inputClass" @input="detalllang" :value="petLenght" type="text" placeholder-style="font-size:28rpx;color:#BDC4CE"
value="" placeholder="请填写体长" />
<!-- <text class="petClass" @click="showPickerLenght = true">{{petLenght}}</text> -->
<van-cell title="体长(厘米)" @click="showPickerLenght = true" is-link />
<view class="petClassTextS">
<picker mode="multiSelector" @change="TiChangPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex"
:range="multiArrays">
<view class="petClass">
{{showTiChang}}
</view>
</picker>
</view>
</view>
<view class="addAii">
... ... @@ -61,9 +57,9 @@
</view>
<view class="addAii">
<van-cell title="年龄" is-link @click="showPickerAge = true" />
<van-popup :show="showPickerAge" position="bottom">
<!-- <van-popup :show="showPickerAge" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="petAgeArray" @confirm="bindPickerAge" @cancel="showPickerAge = false" />
</van-popup>
</van-popup> -->
<view class="petClassText">
<text class="petClass" @click="showPickerAge = true">{{petAge}}</text>
</view>
... ... @@ -170,7 +166,7 @@
],
petClass: '请选择宠物种类',
petWeight: "",
petLenght: "请选择体长",
petLenght: "",
petAge: "请选择年龄",
petTime: "请选择出生日期",
petgHome: "请选择回家日期",
... ... @@ -180,10 +176,266 @@
//公母
XbRadio: '1',
//种类数字
petClassSum: ''
petClassSum: '',
multiArray: [
['1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'20',
'21',
'22',
'23',
'24',
'25',
'26',
'27',
'28',
'29',
'30',
'31',
'32',
'33',
'34',
'35',
'36',
'37',
'38',
'39',
'40',
'41',
'42',
'43',
'44',
'45',
'46',
'47',
'48',
'49',
'50',
'51',
'52',
'53',
'54',
'55',
'56',
'57',
'58',
'59',
'60',
'61',
'62',
'63',
'64',
'65',
'66',
'67',
'68',
'69',
'70',
'71',
'72',
'73',
'74',
'75',
'76',
'77',
'78',
'79',
'80',
'81',
'82',
'83',
'84',
'85',
'86',
'87',
'88',
'89',
'90',
'91',
'92',
'93',
'94',
'95',
'96',
'97',
'98',
'99'],
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
],
multiArrays: [
['1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'20',
'21',
'22',
'23',
'24',
'25',
'26',
'27',
'28',
'29',
'30',
'31',
'32',
'33',
'34',
'35',
'36',
'37',
'38',
'39',
'40',
'41',
'42',
'43',
'44',
'45',
'46',
'47',
'48',
'49',
'50',
'51',
'52',
'53',
'54',
'55',
'56',
'57',
'58',
'59',
'60',
'61',
'62',
'63',
'64',
'65',
'66',
'67',
'68',
'69',
'70',
'71',
'72',
'73',
'74',
'75',
'76',
'77',
'78',
'79',
'80',
'81',
'82',
'83',
'84',
'85',
'86',
'87',
'88',
'89',
'90',
'91',
'92',
'93',
'94',
'95',
'96',
'97',
'98',
'99'],
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
],
multiIndex: [0, 0, 0],
showTiZhong: "请选择体重",
showTiChang: "请选择体长"
}
},
methods: {
getAge(strBirthday) {
var returnAge = '';
var mouthAge = '';
var strBirthdayArr = strBirthday.split("-");
var birthYear = strBirthdayArr[0];
var birthMonth = strBirthdayArr[1];
var birthDay = strBirthdayArr[2];
var d = new Date();
var nowYear = d.getFullYear();
var nowMonth = d.getMonth() + 1;
var nowDay = d.getDate();
if (nowYear == birthYear) {
// returnAge = 0; //同年 则为0岁
var monthDiff = nowMonth - birthMonth; //月之差
if (monthDiff < 0) {} else {
mouthAge = monthDiff + '个月';
}
} else {
var ageDiff = nowYear - birthYear; //年之差
if (ageDiff > 0) {
if (nowMonth == birthMonth) {
var dayDiff = nowDay - birthDay; //日之差
if (dayDiff < 0) {
returnAge = ageDiff - 1 + '岁';
} else {
returnAge = ageDiff + '岁';
}
} else {
var monthDiff = nowMonth - birthMonth; //月之差
if (monthDiff < 0) {
returnAge = ageDiff - 1 + '岁';
} else {
mouthAge = monthDiff + '个月';
returnAge = ageDiff + '岁';
}
}
} else {
returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
}
}
return returnAge + mouthAge; //返回周岁年龄+月份
},
//双滚轮组件
TiZhongPickerChange(e) {
this.showTiZhong = this.multiArray[0][e.detail.value[0]] + '.' + this.multiArray[1][e.detail.value[1]]
},
TiChangPickerChange(e) {
this.showTiChang = this.multiArrays[0][e.detail.value[0]] + '.' + this.multiArrays[1][e.detail.value[1]]
},
// 验证小数
validateNumber(val) {
val = val.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
... ... @@ -197,12 +449,11 @@
},
//输入体重
detall(e) {
let value = this.validateNumber(e.detail.value)
this.petWeight = value
this.petWeight = e.detail.value
},
//输入体长
detalllang(e) {
this.petLenght = this.validateNumber(e.detail.value)
this.petLenght = e.detail.value
},
getFieldValue(e) {
this.petName = e.detail
... ... @@ -277,13 +528,13 @@
duration: 1000,
icon: 'none'
})
} else if (this.petWeight == "请选择体重") {
} else if (this.showTiZhong == "请选择体重") {
uni.showToast({
title: '请选择体重',
duration: 1000,
icon: 'none'
})
} else if (this.petLenght == "请选择体长") {
} else if (this.showTiChang == "请选择体长") {
uni.showToast({
title: '请选择体长',
duration: 1000,
... ... @@ -313,19 +564,13 @@
duration: 1000,
icon: 'none'
})
} else if (this.urlImg.length < 1) {
uni.showToast({
title: '请添加宠物相册',
duration: 1000,
icon: 'none'
})
} else {
let paramData = {
avatar: this.petImg,
name: this.petName,
kind: this.petClassSum,
weight: this.petWeight,
length: this.petLenght,
weight: this.showTiZhong,
length: this.showTiChang,
birthday: this.petTime,
age: this.petAge,
gender: this.XbRadio,
... ... @@ -359,6 +604,7 @@
},
//出生日期
onConfirmTiems(e) {
this.petAge = this.getAge(e.detail.value)
this.petTime = e.detail.value
},
//回家日期
... ... @@ -415,6 +661,11 @@
<style>
@import url("/common/addPet.css");
.select {
color: #a3a3a3;
font-size: 28rpx;
}
.van-field__body {
margin-right: 38rpx !important;
}
... ...
<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 class="" 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()
... ...
... ... @@ -26,21 +26,26 @@
</view>
</view>
<view class="addAii">
<van-cell title="体重" is-link @click="showPickerWeight = true" />
<van-popup :show="showPickerWeight" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="petWeightArray" @confirm="bindPickerWeight" @cancel="showPickerWeight = false" />
</van-popup>
<view class="petClassText">
<text class="petClass" @click="showPickerWeight = true">{{petWeight}}</text>
<van-cell title="体重(斤)" @click="showPickerWeight = true" is-link />
<view class="petClassTextS">
<picker mode="multiSelector" @change="TiZhongPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex"
:range="multiArray">
<view class="petClass">
{{showTiZhong}}
</view>
</picker>
</view>
</view>
<view class="addAii">
<van-cell title="体长" is-link @click="showPickerLenght = true" />
<van-popup :show="showPickerLenght" position="bottom">
<van-picker show-toolbar value-key="h_name" :columns="petLenghtArray" @confirm="bindPickerLenght" @cancel="showPickerLenght = false" />
</van-popup>
<view class="petClassText">
<text class="petClass" @click="showPickerLenght = true">{{petLenght}}</text>
<van-cell title="体长(厘米)" @click="showPickerLenght = true" is-link />
<view class="petClassTextS">
<picker mode="multiSelector" @change="TiChangPickerChange" @columnchange="bindMultiPickerColumnChange" :value="multiIndex"
:range="multiArrays">
<view class="petClass">
{{showTiChang}}
</view>
</picker>
</view>
</view>
<view class="addAii">
... ... @@ -148,17 +153,13 @@
id: 2,
name: '狗'
}],
//体重
petWeightArray: ['0.5kg', '0.6kg', '0.7kg', '0.8kg'],
//体长
petLenghtArray: ['35cm', '45cm', '55cm', '65cm'],
//Age
petAgeArray: ['1个月', '2个月', '3个月', '4个月', '5个月', '6个月', '7个月', '8个月', '9个月', '10个月', '11个月', '1岁', '2岁', '3岁', '4岁',
'5岁', '6岁', '7岁', '8岁', '9岁', '10岁', '11岁', '12岁', '13岁', '14岁', '15岁', '16岁', '17岁', '18岁', '19岁', '20岁', '21岁'
],
petClass: '请选择宠物种类',
petWeight: "请选择体重",
petLenght: "请选择体长",
petWeight: "",
petLenght: "",
petAge: "请选择年龄",
petTime: "请选择出生日期",
petgHome: "请选择回家日期",
... ... @@ -171,10 +172,275 @@
urlImg: [],
sum: 0,
//种类数字
petClassSum: ''
petClassSum: '',
multiArray: [
['1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'20',
'21',
'22',
'23',
'24',
'25',
'26',
'27',
'28',
'29',
'30',
'31',
'32',
'33',
'34',
'35',
'36',
'37',
'38',
'39',
'40',
'41',
'42',
'43',
'44',
'45',
'46',
'47',
'48',
'49',
'50',
'51',
'52',
'53',
'54',
'55',
'56',
'57',
'58',
'59',
'60',
'61',
'62',
'63',
'64',
'65',
'66',
'67',
'68',
'69',
'70',
'71',
'72',
'73',
'74',
'75',
'76',
'77',
'78',
'79',
'80',
'81',
'82',
'83',
'84',
'85',
'86',
'87',
'88',
'89',
'90',
'91',
'92',
'93',
'94',
'95',
'96',
'97',
'98',
'99'],
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
],
multiArrays: [
['1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'10',
'11',
'12',
'13',
'14',
'15',
'16',
'17',
'18',
'19',
'20',
'21',
'22',
'23',
'24',
'25',
'26',
'27',
'28',
'29',
'30',
'31',
'32',
'33',
'34',
'35',
'36',
'37',
'38',
'39',
'40',
'41',
'42',
'43',
'44',
'45',
'46',
'47',
'48',
'49',
'50',
'51',
'52',
'53',
'54',
'55',
'56',
'57',
'58',
'59',
'60',
'61',
'62',
'63',
'64',
'65',
'66',
'67',
'68',
'69',
'70',
'71',
'72',
'73',
'74',
'75',
'76',
'77',
'78',
'79',
'80',
'81',
'82',
'83',
'84',
'85',
'86',
'87',
'88',
'89',
'90',
'91',
'92',
'93',
'94',
'95',
'96',
'97',
'98',
'99'],
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
],
multiIndex: [0, 0, 0],
showTiZhong: "请选择体重",
showTiChang: "请选择体长"
}
},
methods: {
getAge(strBirthday) {
var returnAge = '';
var mouthAge = '';
var strBirthdayArr = strBirthday.split("-");
var birthYear = strBirthdayArr[0];
var birthMonth = strBirthdayArr[1];
var birthDay = strBirthdayArr[2];
var d = new Date();
var nowYear = d.getFullYear();
var nowMonth = d.getMonth() + 1;
var nowDay = d.getDate();
if (nowYear == birthYear) {
// returnAge = 0; //同年 则为0岁
var monthDiff = nowMonth - birthMonth; //月之差
if (monthDiff < 0) {} else {
mouthAge = monthDiff + '个月';
}
} else {
var ageDiff = nowYear - birthYear; //年之差
if (ageDiff > 0) {
if (nowMonth == birthMonth) {
var dayDiff = nowDay - birthDay; //日之差
if (dayDiff < 0) {
returnAge = ageDiff - 1 + '岁';
} else {
returnAge = ageDiff + '岁';
}
} else {
var monthDiff = nowMonth - birthMonth; //月之差
if (monthDiff < 0) {
returnAge = ageDiff - 1 + '岁';
} else {
mouthAge = monthDiff + '个月';
returnAge = ageDiff + '岁';
}
}
} else {
returnAge = -1; //返回-1 表示出生日期输入错误 晚于今天
}
}
return returnAge + mouthAge; //返回周岁年龄+月份
},
//双滚轮组件
TiZhongPickerChange(e) {
this.showTiZhong = this.multiArray[0][e.detail.value[0]] + '.' + this.multiArray[1][e.detail.value[1]]
},
TiChangPickerChange(e) {
this.showTiChang = this.multiArrays[0][e.detail.value[0]] + '.' + this.multiArrays[1][e.detail.value[1]]
},
//输入体重
detall(e) {
this.petWeight = e.detail.value
},
//输入体长
detalllang(e) {
this.petLenght = e.detail.value
},
//上传头像
TouxiangImg() {
let that = this
uni.chooseImage({
... ... @@ -198,6 +464,7 @@
}
});
},
//宠物名字
getFieldValue(e) {
this.petName = e.detail
},
... ... @@ -207,8 +474,8 @@
avatar: this.petImg,
name: this.petName,
kind: this.petClassSum,
weight: this.petWeight,
length: this.petLenght,
weight: this.showTiZhong,
length: this.showTiChang,
birthday: this.petTime,
age: this.petAge,
gender: this.XbRadio,
... ... @@ -259,24 +526,26 @@
id: this.petId
}
request.postRequest('/api/Pet/petInfo', paramId, data => {
console.log(data.data.list),
this.PetList = data.data.list,
this.petImg = data.data.list.avatar,
this.petName = data.data.list.name,
this.petClass = data.data.list.kind == 1 ? '猫' : '狗',
this.petHeight = data.data.list.height,
this.petWeight = data.data.list.weight,
this.petLenght = data.data.list.length,
this.petAge = data.data.list.age,
this.petTime = data.data.list.birthday,
this.petgHome = data.data.list.go_htime,
this.JyRadio = data.data.list.is_ster,
this.XbRadio = data.data.list.gender,
this.fileList = data.data.list.pet_images,
this.petVaccine = data.data.list.needle_time
let prr = data.data.list
this.PetList = prr,
this.petImg = prr.avatar,
this.petName = prr.name,
this.petClassSum = prr.kind,
this.petClass = prr.kind == 1 ? '猫' : '狗',
this.petHeight = prr.height,
this.showTiZhong = prr.weight,
this.showTiChang = prr.length,
this.petAge = prr.age,
this.petTime = prr.birthday,
this.petgHome = prr.go_htime,
this.JyRadio = prr.is_ster,
this.XbRadio = prr.gender,
this.fileList = prr.pet_images,
this.petVaccine = prr.needle_time
})
},
//时间戳转换
timechange(value) { //13位时间戳
var date = new Date(value);
const Y = date.getFullYear() + '-';
... ...
<template>
<view style="border-top: 1px solid #F2F2F2;">
<scroll-view scroll-y style='height:724px;' @bindscrolltolower="loadMore">
<view style="padding-top: 32rpx;">
<scroll-view scroll-y style='height:724px;' @bindscrolltolower="onReachBottom">
<view :class="[item.type==1?'replyBody':'replyBody1']" v-for="(item,index) in dataList" :key="index" @click="circleDetail(item.c_id)">
<view class="replyBodyImg">
<image :src="item.avatar" style="width: 68rpx;height: 68rpx;" mode=""></image>
... ... @@ -10,14 +10,14 @@
<text class="replyName">{{item.nickname}}</text><text class="replyHuiFu">{{item.type==3?"回复了你":"点赞"}}</text>
</view>
<view class="replyNavTitles">
<view class="" v-if="item.type == 3">
<view class="replyNavData" v-if="item.type == 3">
<text class="replyNavTitle">{{item.content}}</text>
</view>
<view class="" v-if="item.type !=3">
<image src="../../static/image/dianzanzan_icon@2x.png" style="width: 40rpx;height: 40rpx;" />
</view>
</view>
<view class="">
<view class="" style="margin-bottom:32rpx;">
<text class="replyTime">{{item.createtime}}</text>
</view>
</view>
... ... @@ -43,6 +43,7 @@
}
},
onReachBottom: function() {
console.log('触底了')
this.page = this.page + 1
this.replyList()
},
... ...
... ... @@ -14,7 +14,6 @@
</view>
<view class="userTime">
{{postData.createtime}}
</view>
</view>
</view>
... ... @@ -99,9 +98,7 @@
content: this.inputValue,
parent_id: this.ids
}
request.postRequest('/api/Circle/circleComments', postData, data => {
console.log(data)
if (data.code == 1) {
this.evaluateDetail();
this.inputValue = '';
... ...
... ... @@ -236,6 +236,8 @@
}
.uni-input {
background-color: transparent;
color: #BDC4CE;
font-size: 28rpx;
}
.selectText {
height: 88rpx;
... ...

1.1 KB | 宽: | 高:

1.2 KB | 宽: | 高:

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