Browse Source

修改问题

master
396316021 1 year ago
parent
commit
fbee79cf92
  1. 30
      components/PetPage/index.vue

30
components/PetPage/index.vue

@ -1,5 +1,5 @@
<template>
<view class="pet-page-container" :style="{width:buttonWidth}" v-if="type === 'create'">
<view class="pet-page-container" :style="{width:buttonWidth}" v-if="typeData === 'create'">
<view class="pet-page-capsule-container row">
<view class="pet-page-capsule col-4" v-for="(item,index) in petTypeList"
:class="{active:(item.value === data.type)}" @click="selectPetType(item.value)">
@ -7,7 +7,7 @@
</view>
</view>
</view>
<view class="pet-page-group row" v-if="type === 'create'">
<view class="pet-page-group row" v-if="typeData === 'create'">
<view class="order-item row">
<view class="item-title">
<text style="color: red;">*</text>宝贝姓名
@ -288,7 +288,7 @@
</view>
</view>
<view class="pet-list" v-if="type === 'lists'">
<view class="pet-list" v-if="typeData === 'lists'">
<view class="order-screen-container row">
<view class="order-list-container">
<view class="order-list-item" v-for="(item,index) in petCheckList">
@ -331,7 +331,7 @@
</view>
<view class="pet-page-button row">
<view class="col-6" style="justify-content: center;" v-if="type === 'lists'">
<view class="col-6" style="justify-content: center;" v-if="typeData === 'lists'">
<view class="" style="display: inline-block;">
<MzButton
title="选择萌宠"
@ -344,7 +344,7 @@
</MzButton>
</view>
</view>
<view class="col-6" style="justify-content: center;" v-if="type === 'lists'">
<view class="col-6" style="justify-content: center;" v-if="typeData === 'lists'">
<view class="" style="display: inline-block;">
<MzButton
title="添加萌宠"
@ -352,23 +352,23 @@
font-color="#fff"
button-width="300rpx"
class=""
@click="type = 'create'"
@click="typeData = 'create'"
>
</MzButton>
</view>
</view>
<view class="col-6" v-if="type === 'create' && showCancel">
<view class="col-6" v-if="typeData === 'create' && showCancel">
<MzButton
title="取消"
button-color="#FFFFFF"
font-color="#262626"
button-width="300rpx"
class=""
@click="type = 'lists'"
@click="typeData = 'lists'"
>
</MzButton>
</view>
<view class="col-6" v-if="type === 'create'">
<view class="col-6" v-if="typeData === 'create'">
<MzButton
title="保存"
button-color="#4DC3B8"
@ -608,7 +608,7 @@
},
autoBack:{
type:Boolean,
default:false,
default:true,
},
petId:{
type:Number,
@ -620,6 +620,7 @@
},
data() {
return {
typeData: this.type,
petList:[],
petCheckList:[],
status:'loadmore',
@ -683,7 +684,7 @@
if(this.petId!==0){
this.getDetail(this.petId)
}
if(this.type === 'lists'){
if(this.typeData === 'lists'){
this.getMyPets()
}
},
@ -933,7 +934,12 @@
}).join(',');
editPet(this.data).then(res => {
api.success('添加成功');
uni.navigateBack();
if(this.autoBack){
uni.navigateBack();
}else{
this.typeData = 'lists';
this.getMyPets();
}
})
}
}

Loading…
Cancel
Save