Browse Source

获取组件popup返回值

master
kuaileWu 6 months ago
parent
commit
fd860bf5dc
  1. 6
      components/userCard.vue
  2. 11
      pages/visit_detail/visit_detail.vue

6
components/userCard.vue

@ -67,6 +67,12 @@ export default {
}, },
setType(typeval) { setType(typeval) {
this.value = typeval this.value = typeval
},
getData() {
var obj = new Object()
obj.value = this.value
obj.type = this.type
return obj
} }
} }
}; };

11
pages/visit_detail/visit_detail.vue

@ -29,12 +29,13 @@
<uni-popup ref="popup" type="bottom" background-color="#fff"> <uni-popup ref="popup" type="bottom" background-color="#fff">
<view class="edit-pop-title PfScSemibold">{{poptitle}}</view> <view class="edit-pop-title PfScSemibold">{{poptitle}}</view>
<user-card v-for="(item, key) in visitorList" :dataitem="item" @clickEvent="changeType" :index="key" :showuinfo="false"></user-card> <user-card :ref="'usercard_'+key" v-for="(item, key) in visitorList" :dataitem="item" @clickEvent="changeType" :index="key" :showuinfo="false"></user-card>
<view class="submit flex submit-popup"> <view class="submit flex submit-popup">
<view :class="'btn cancel'+(' btn1')" hover-class="hover" @click="closepop">取消</view> <view :class="'btn cancel'+(' btn1')" hover-class="hover" @click="closepop">取消</view>
<view class="btn primary btn1" hover-class="hover" v-if="showCancelBook">确认修改</view> <view class="btn primary btn1" hover-class="hover" @click="submitEdit">确认修改</view>
</view> </view>
</uni-popup> </uni-popup>
</view> </view>
@ -100,6 +101,9 @@
userCard userCard
}, },
methods: { methods: {
submitEdit(e){
console.log(this.$refs.usercard_0[0].getData())
},
closepop(){ closepop(){
this.$refs.popup.close() this.$refs.popup.close()
}, },
@ -149,6 +153,9 @@
reback(){ reback(){
this.$func.toPage('/pages/index/index') this.$func.toPage('/pages/index/index')
}, },
changeType() {
},
getBookDetail(){ getBookDetail(){
this.$http.req('user/get_appoint_detail', {appoint_id:this.bookId,depart_id:this.depart_id}, 'POST').then(data=>{ this.$http.req('user/get_appoint_detail', {appoint_id:this.bookId,depart_id:this.depart_id}, 'POST').then(data=>{
if(data == -1) { if(data == -1) {

Loading…
Cancel
Save