作者 李康

update

... ... @@ -110,7 +110,7 @@
width: 100%;
height: 120rpx;
background: #fff;
z-index: 999;
}
.bottomInput image {
... ...
... ... @@ -35,10 +35,10 @@
<text style="width:160rpx;font-size: 28rpx;color: #323233;">我的宠物:</text>
<picker @change="bindPickerPet" :value="petIndex" :range="petList" range-key="name">
<view style="display:flex;align-items: center;">
<!-- <view class="select" v-if="petIndex==''">
<view class="select" v-if="token==''" @click="goLogin">
请选择宠物
</view>-->
<view class="uni-input" v-if="petIndex!==''">{{petList[petIndex].name}}</view>
</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,8 +96,6 @@
<scroll-view scroll-x="true" class="colorBox scroll-view_H">
<view class="colorItem">
<view class="" style="display: flex;align-items: center;">
<!-- <view class="circle circlePublic">
</view> -->
<image src="/static/image/shengbing_icon@2x.png" mode="" style="width:32rpx;height:32rpx;margin-right:10rpx;"></image>
生病
</view>
... ... @@ -141,11 +139,11 @@
</view>
</view>
</scroll-view>
<view class="" class="reminberBox" v-if="isFaTrue">
<view class="" class="reminberBox" v-if="token">
<image src="/static/image/zhuyi.png" mode=""></image>
孕期不能打疫苗
</view>
<view class="" v-if="isFaTrue">
<view class="" v-if="token">
<view class="cwInfo">
<view class="pickerItem">
<view class="">
... ... @@ -268,7 +266,7 @@
备注
</view>
<view class="textarea">
<textarea @blur="bindTextAreaBlur" placeholder="请输入内容" v-model="textareaInput" />
<textarea @blur="bindTextAreaBlur" placeholder="请输入内容" v-model="textareaInput" />
</view>
</view>
</view>
... ... @@ -276,7 +274,7 @@
保存
</view>
</view>
<view class="noToken" v-if="!isFaTrue">
<view class="noToken" v-if="!token">
<image src="/static/image/weitianjia_img@2x.png" mode=""></image>
尚未添加宠物
<view class="addCwBtn" @click="addCw">
... ... @@ -296,25 +294,16 @@
},
data() {
return {
isFaTrue:[],
//显示弹框
confr:'',
isShowWenDu:true,
qing:'',
tqWedu:0,
mapData:amap,
petDataList:[],
petStateList:[],
//宠物
petId:'', //宠物id
status:'', //是否在孕期
petIndex:0,
petList:[],
petNameList:[],
petIdList:[],
SelectSym:'请选择症状',
//宠物温度
petWD:'请选择温度',
//日历开始
year: '2021',
flag: true,
... ... @@ -339,10 +328,7 @@
//日历结束
topHtint: '当前气温较低,请注意宠物的保暖问题。',
userData: {
address: '',
waetherText: '晴',
waetherNum: '-1/5C',
myPet: '琪琪'
address: ''
},
token:'',
heat:false, //发情
... ... @@ -356,7 +342,7 @@
arrayWd: ['20','30','40'],
indexWd: '',
disease:'',
symptomList:'' , //症状
symptomList:{}, //症状
textareaInput:'', //备注
face1:false, //表情
face2:false,
... ... @@ -407,14 +393,11 @@
},
//判断是否有宠物
isPet(){
let ary=[];
let ary1=[];
request.postRequest('/api/Pet/petList',{},data=>{
if(data.code==1){
let list = data.data.list;
this.petList = list;
this.petId = data.data.list.length>0?list[0].id:'';
console.log(this.petId)
this.petId = list.length>0?list[0].id:'';
if(this.petId){
this.getPetInfo()
}
... ... @@ -444,7 +427,6 @@
uni.showToast({
title:'保存成功'
})
this.indexPage()
}else{
uni.showToast({
icon:'none',
... ... @@ -479,12 +461,8 @@
break;
}
},
//日历
change(e) {
console.log(e);
},
lastMonth(){
let year = this.month-2<0 ? this.year - 1 : this.year;
let year = this.month-1<0 ? this.year - 1 : this.year;
let month = this.month - 1 < 0 ? 11 : this.month - 1;
this.year=year;
this.month=month+3;
... ... @@ -512,75 +490,70 @@
var month = e.currentTarget.dataset.month < 10 ? '0' + e.currentTarget.dataset.month : e.currentTarget.dataset.month
var date = e.currentTarget.dataset.datenum
var YMD = e.currentTarget.dataset.year + '-' + month + '-' + date;
// this.setData({
// dates: YMD,
// show: !this.data.show,
// daskShow: !this.data.daskShow
// })
},
dateInit: function(setYear, setMonth) {
let _this = this;
//全部时间的月份都是按0~11基准,显示月份才+1
let dateArr = []; //需要遍历的日历数组数据
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);
let startWeek = new Date(month + 1 + '/1' + '/' + year).getDay(); //目标月1号对应的星期
let dayNums = new Date(year, nextMonth, 0).getDate(); //获取目标月有多少天
let obj = {};
let num = 0;
_this.year = year;
_this.month = month;
if (month + 1 > 11) {
nextYear = year + 1;
dayNums = new Date(nextYear, nextMonth, 0).getDate();
}
arrLen = startWeek + dayNums;
for (let i = 0; i < arrLen; i++) {
if (i >= startWeek) {
let num = Number(i - startWeek + 1);
num = num > 9 ? num : ('0' + num)
obj = {
isToday: '' + year + (Number(month + 1) < 10 ? '0' + (month + 1) : (month + 1)) + num,
dateNum: num,
weight: 5,
flag: false
}
} else {
obj = {};
}
dateArr[i] = obj;
_this.dateArr = dateArr;
let _this = this;
//全部时间的月份都是按0~11基准,显示月份才+1
let dateArr = []; //需要遍历的日历数组数据
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);
let startWeek = new Date(month + 1 + '/1' + '/' + year).getDay(); //目标月1号对应的星期
let dayNums = new Date(year, nextMonth, 0).getDate(); //获取目标月有多少天
let obj = {};
let num = 0;
_this.year = year;
_this.month = month;
if (month + 1 > 11) {
nextYear = year + 1;
dayNums = new Date(nextYear, nextMonth, 0).getDate();
}
arrLen = startWeek + dayNums;
for (let i = 0; i < arrLen; i++) {
if (i >= startWeek) {
let num = Number(i - startWeek + 1);
num = num > 9 ? num : ('0' + num)
obj = {
isToday: '' + year + (Number(month + 1) < 10 ? '0' + (month + 1) : (month + 1)) + num,
dateNum: num,
weight: 5,
flag: false
}
let nowDate = new Date();
let nowYear = nowDate.getFullYear();
let nowMonth = nowDate.getMonth() + 1;
let nowWeek = nowDate.getDay();
let getYear = setYear || nowYear;
let getMonth = setMonth >= 0 ? (setMonth + 1) : nowMonth;
if (nowYear == getYear && nowMonth == getMonth) {
_this.isTodayWeek = true;
_this.todayIndex = nowWeek;
} else {
_this.isTodayWeek = false;
_this.todayIndex = -1;
} else {
obj = {};
}
dateArr[i] = obj;
_this.dateArr = dateArr;
}
let nowDate = new Date();
let nowYear = nowDate.getFullYear();
let nowMonth = nowDate.getMonth() + 1;
let nowWeek = nowDate.getDay();
let getYear = setYear || nowYear;
let getMonth = setMonth >= 0 ? (setMonth + 1) : nowMonth;
if (nowYear == getYear && nowMonth == getMonth) {
_this.isTodayWeek = true;
_this.todayIndex = nowWeek;
} else {
_this.isTodayWeek = false;
_this.todayIndex = -1;
}
},
faqings:function(){
let list=this.dateArr;
let lists=this.faqingList;
lists.forEach((item,index)=>{
list.forEach((items,indexs)=>{
if(item==items.isToday){
items.faqing=true;
}
},
faqings:function(){
let list=this.dateArr;
let lists=this.faqingList;
lists.forEach((item,index)=>{
list.forEach((items,indexs)=>{
if(item==items.isToday){
items.faqing=true;
}
})
})
},
})
})
},
switch1Change: function (e) {
this.heat=e.target.value
},
... ... @@ -591,39 +564,45 @@
this.shengbing=e.target.value
},
bindPickerPet: function(e) {
console.log(e)
console.log(e.target.value)
uni.removeStorage('parData')
this.petIndex = e.target.value;
this.petId=this.petList[this.petIndex].id
this.getPetInfo();
this.dateInit();
},
getPetInfo(){
let that = this;
let param ={
date:this.getTime(),
p_id:this.petId
}
request.postRequest('/api/Index/index',param,data=>{
this.petDataList=data.data.list
this.petStateList=data.data.sate
this.slInput=!data.data.list.eat?'':data.data.list.eat
this.tcInput=!data.data.list.length?'':data.data.list.length
this.tzInput=!data.data.list.weight?'':data.data.list.weight
this.peizhong=data.data.list.is_breeding==1? false :true
this.heat=data.data.list.is_rut==1?false:true
this.shengbing=data.data.list.is_sick==1?false:true
this.wendu=data.data.list.temperature
this.textareaInput=!data.data.list.note?'':data.data.list.note
this.sbDate=data.data.sick
this.yimiao=data.data.vaccine
this.faqingList=data.data.rut
this.earlyList=data.data.pregnant_one
this.middleList=data.data.pregnant_two
this.lateList=data.data.pregnant_three
this.expectList=data.data.pregnant_four
this.showWendu=data.data.list.temperature
this.energy=data.data.list.energy
this.SelectSym=data.data.list.symptom
let info = data.data.list;
console.log('获取温度')
console.log(info?info.temperature:'')
that.faqingList=data.data.rut
that.sbDate=data.data.sick
that.yimiao=data.data.vaccine
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.wendu=info.temperature?info:''
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:'请选择温度'
that.energy=info?info.energy:''
that.SelectSym=info?info.symptom:''
if(data.data.pet.is_confirm==1){
this.showModalT()
}
})
},
bindPickerChangeZl: function(e) {
... ... @@ -639,8 +618,7 @@
this.tcInput= e.detail.value
},
bindPickerChangeWd: function(e) {
this.indexWd = e.target.value;
// this.wendu=this.arrayWd[this.indexWd]
this.indexWd = e.target.value;
this.showWendu=this.arrayWd[this.indexWd]
},
bindTextAreaBlur: function (e) {
... ... @@ -731,6 +709,19 @@
}
})
},
//登录
goLogin(){
let token = uni.getStorageSync('token')
if(token){
this.getPetInfo()
}else{
uni.showToast({
title:'请先登录',
duration:2000,
icon:'none'
})
}
},
havaWeather(){
var myAmapFun = new this.mapData.AMapWX({key:'f046b73f34f95e78d65438b8ed5fc579'});
myAmapFun.getWeather({
... ... @@ -749,66 +740,28 @@
}
},
created() {
this.token=uni.getStorageSync('token')
//宠物列表
this.isPet();
//天气
this.havaWeather()
//日历
this.dateInit();
this.faqings();
this.todayDate() //当前日期
},
onShow() {
this.token=uni.getStorageSync('token')
//宠物列表
if(this.token){
this.isPet();
}
this.isShowWenDu=this.tqWedu <20 ?true:false
this.userData.address=uni.getStorageSync('address')
if(!this.petId){
this.symptomList=''
}else{
this.symptomList=uni.getStorageSync('parData')
this.customList=uni.getStorageSync('custom')
}
this.havaWeather()
// this.isPet();
let parId=''
let opar=uni.getStorageSync('parData')
if(opar){
let datas=opar.map(x=>{
return parId.concat(x.id);
})
this.symptom=datas
}
// let address = uni.getStorageSync('address')
// if(address){
// console.log('有地址')
// }else{
// let that= this
// uni.authorize({
// scope: 'scope.userLocation',
// success(res) {
// this.getLocations()
// },
// fail(err) {
// console.log(err)
// wx.showModal({
// title: '是否授权当前位置',
// content: '需要获取您的地理位置,请确认授权',
// confirmColor: '#f16765',
// success: res => {
// if (res.confirm) {
// wx.openSetting({
// success: data => {
// if (data.authSetting["scope.userLocation"]) {
// that.getLocations()
// }
// }
// })
// }
// }
// })
// }
// })
// }
}
}
</script>
... ... @@ -817,9 +770,4 @@
@import url("/common/uni.css");
@import url("/common/index.css");
@import url("/common/rili.css");
/* .container {
padding: 20px;
font-size: 14px;
line-height: 24px;
} */
</style>
... ...
... ... @@ -89,8 +89,8 @@
let data = this.parData.filter((element, index, self) => {
return self.indexOf(element) === index;
})
console.log(data)
uni.setStorageSync('parData', data)
uni.setStorageSync('custom', this.list4)
uni.navigateBack()
},
//症状
... ... @@ -119,18 +119,24 @@
},
selectZD(item, index) {
console.log(index)
this.indexZD = index
this.parData.push(item)
},
bindInput(e) {
this.inputValue = e.detail.value
},
add() {
this.list4.push(this.inputValue)
this.inputValue = ''
if (this.inputValue == '') {
uni.showToast({
title: '请先输入内容',
duration: 2000,
icon: 'none'
})
} else {
this.list4.push(this.inputValue)
this.inputValue = ''
}
}
},
onLoad(options) {
this.petId = options.id
... ...
... ... @@ -100,7 +100,7 @@
</van-cell-group>
</view>
<view class="addAii">
<van-cell title="疫苗时间" is-link @click="showPickervaccine = true" />
<van-cell title="第一针疫苗时间" is-link @click="showPickervaccine = true" />
<van-popup :show="showPickervaccine" position="bottom">
<van-datetime-picker type="date" :value="currentDate" :min-date="minDate" :max-date="maxDate" @confirm="onConfirmvaccine"
@cancel="showPickervaccine = false" />
... ...
... ... @@ -55,7 +55,7 @@
<view class="addAii">
<van-cell title="出生日期" is-link @click="showPickerTimes = true" />
<van-popup :show="showPickerTimes" position="bottom" @click="showPickerTimes = true">
<van-datetime-picker type="date" :value="currentDate" :min-date="minDate" :max-date="maxDate" @confirm="onConfirmTiems"
<van-datetime-picker type="date" :value="currentDate" :min-date="minDate" :max-date="currentDate" @confirm="onConfirmTiems"
@cancel="showPickerTimes = false" />
</van-popup>
<view class="petClassText" @click="showPickerTimes = true">
... ... @@ -170,7 +170,7 @@
//体长
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岁'],
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: '请选择宠物种类',
petHeight: "请选择身高",
petWeight: "请选择体重",
... ...
... ... @@ -13,7 +13,7 @@
<view class="" v-if="item.type == 3">
<text class="replyNavTitle">{{item.content}}</text>
</view>
<view class="" v-if="item.type == 2 || 1">
<view class="" v-if="item.type !=3">
<image src="../../static/image/dianzanzan_icon@2x.png" style="width: 40rpx;height: 40rpx;" />
</view>
</view>
... ... @@ -42,6 +42,10 @@
page: 1 //记录加载数据的页数参数
}
},
onReachBottom: function() {
this.page = this.page + 1
this.replyList()
},
methods: {
//圈子详情
circleDetail(id) {
... ... @@ -51,11 +55,15 @@
},
replyList() {
let param = {
page: 1
page: this.page
}
request.postRequest('/api/User/replyList', param, data => {
console.log(data)
this.dataList = data.data.list
data.data.list.map(x => {
this.dataList.push(x)
})
// this.dataList.push(data.data.list)
})
},
loadMore(ee) {
... ...
... ... @@ -73,9 +73,14 @@
classifyDesc: '对于饲养幼猫的朋友来说,是需要付出更多的时间和精力去照顾它的。而且幼年的猫咪非常的开朗活泼,它们对生活充满的了好奇,它们在家里会随处的啃咬东西,探究这些东西的情况。',
},
tabIndex: '',
list: []
list: [],
page: 1
}
},
onReachBottom: function() {
this.page = this.page + 1
this.classifyList()
},
methods: {
//发布帖子
addDetail() {
... ... @@ -117,6 +122,7 @@
let postData = {
cid: this.classifyId,
up: 1
}
request.postRequest('/api/Circle/circleList', postData, data => {
if (data.code == 1) {
... ... @@ -151,15 +157,18 @@
classifyList() {
let that = this;
let postData = {
cid: this.classifyId
cid: this.classifyId,
page: this.page
}
request.postRequest('/api/Circle/circleList', postData, data => {
this.list = data.data.list;
if (data.code == 1) {
data.data.list.map(x => {
this.list.push(x)
})
}
// this.list = data.data.list;
})
}
},
created() {
}
}
</script>
... ...
... ... @@ -80,18 +80,18 @@
import request from '../../utils/request.js'
export default {
onLoad(options) {
console.log(options,'options')
this.evaluateDetail(options.id,options.ids)
console.log(options, 'options')
this.evaluateDetail(options.id, options.ids)
},
data() {
return {
isZan:false,
isZan: false,
inputValue: '',
postData: {
userName: '张璐瑶',
image: '',
userTime: '2020/10/10',
postData:{},
postData: {},
content: '送给我的小侄女的,刚生下来,布料很柔和。尺寸也刚刚好放,小婴儿没有问题。没有异味。颜色很可爱。好评好评!',
list: [{
name: '张璐瑶',
... ... @@ -113,24 +113,24 @@
content: '看起来不错啊',
},
{
name: '张璐瑶',
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
content: '看起来不错啊新入手的小猫咪,可爱不,有人也想要吗?这里有英短、橘猫。',
replayName: '辛巴的主人',
lists: [{
name: '张旭',
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
content: '看起来不错啊',
}]
},
{
name: '张璐瑶',
name: '张璐瑶',
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
content: '看起来不错啊新入手的小猫咪,可爱不,有人也想要吗?这里有英短、橘猫。',
replayName: '辛巴的主人',
lists: [{
name: '张旭',
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
content: '看起来不错啊',
},{
}]
},
{
name: '张璐瑶',
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
content: '看起来不错啊',
}, {
name: '张璐瑶',
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
... ... @@ -148,7 +148,7 @@
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
content: '看起来不错啊',
},{
}, {
name: '张璐瑶',
image: '/static/image/meirishipin_icon@2x.png',
time: '2020/10/10',
... ... @@ -173,20 +173,20 @@
},
methods: {
//评论详情
evaluateDetail(id,ids){
let postData={
id:id,
fid:ids
evaluateDetail(id, ids) {
let postData = {
id: id,
fid: ids
}
request.postRequest('/api/Circle/commentsDetail',postData,data=>{
if(data.code==1){
this.postData=data.data
request.postRequest('/api/Circle/commentsDetail', postData, data => {
if (data.code == 1) {
this.postData = data.data
}
})
},
//点赞
zan(){
this.isZan=!this.isZan
zan() {
this.isZan = !this.isZan
},
keyInput(e) {
this.inputValue = e.detail.value
... ... @@ -287,7 +287,7 @@
width: 100%;
height: 120rpx;
background: #fff;
z-index: 999;
}
.bottomInput image {
... ...
... ... @@ -73,37 +73,14 @@
switchClassList: [],
//分类
ClassifyList: [],
list: [{
image: '/static/image/biaoqing1_icon@2x.png',
userName: '杰尼猫咪',
content: '新入手的小猫咪,可爱不,有人也想要吗?这里有英短、橘猫。',
picList: [{
image: '/static/image/bg_icon@2x.png'
}, {
image: '/static/image/bg_icon@2x.png'
}, {
image: '/static/image/bg_icon@2x.png'
}],
time: '4',
zan: '666',
pinglun: '888'
}, {
image: '/static/image/biaoqing1_icon@2x.png',
userName: '杰尼猫咪',
content: '新入手的小猫咪,可爱不,有人也想要吗?这里有英短、橘猫。',
picList: [{
image: '/static/image/bg_icon@2x.png'
}, {
image: '/static/image/bg_icon@2x.png'
}, {
image: '/static/image/bg_icon@2x.png'
}],
time: '4',
zan: '666',
pinglun: '888'
}]
list: [],
page: 1
}
},
onReachBottom: function() {
this.page = this.page + 1
this.postList()
},
methods: {
//发布帖子
addDetail() {
... ... @@ -138,10 +115,16 @@
},
//圈子列表
postList() {
let postData = {};
let postData = {
page: this.page
};
request.postRequest('/api/Circle/circleList', postData, data => {
if (data.code == 1) {
this.list = data.data.list
data.data.list.map(x => {
this.list.push(x)
})
// this.list = data.data.list
}
})
},
... ...
... ... @@ -37,7 +37,7 @@
({{postData.discuss_num}})
</view>
</view>
<view class="evaluateBox" v-for="(item,index) in postData.comments" :key="index">
<view class="evaluateBox" v-for="(item,index) in comments" :key="index">
<view class="evaluateLeft">
<image :src="item.avatar" mode=""></image>
</view>
... ... @@ -102,6 +102,10 @@
},
data() {
return {
//评论
comments:[],
//评论分页
page: 1,
tid: '', //用户id
id: '', //帖子id
ids: '', //一级评论id
... ... @@ -150,14 +154,23 @@
}
}
},
onReachBottom: function() {
this.page = this.page + 1
this.circleDetail()
},
methods: {
//圈子详情
circleDetail(id) {
let postData = {
id: id
id: this.id,
page: this.page
}
request.postRequest('/api/Circle/circleDetail', postData, data => {
if (data.code == 1) {
data.data.comments.map(x=>{
this.comments.push(x)
})
this.postData = data.data
}
})
... ... @@ -191,7 +204,7 @@
},
//回复用户信息
reId(id, nickname,ids) {
reId(id, nickname, ids) {
this.placeholder = '回复' + " " + nickname
this.tid = id
this.ids = ids
... ...