对接烟台app的h5页面
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

113 lines
3.3 KiB

<template>
<view class="m-agency_grid_list" v-if="!agency.isNone">
<view class="list-title" onTap="shiftFolded">
<view :class="'f-fl ico ' + (agency.selected ? 'z-on' : '')" :data-agency-id="agency.agencyId" :data-isopt="agency.isOpt" @Tap.stop.prevent="shiftSelectAgency">
<image mode="aspectFit" src="/static/data/images/selected2.png"></image>
</view>
<text :style="'color: ' + (agency.isOpt ? '#333' : '#999')">{{ agency.agencyName }}</text>
<image :class="'f-fr ico-go ' + (!folded ? 'z-unfold' : '')" mode="aspectFit" src="/static/data/images/select.png"></image>
</view>
<view class="list" v-if="!folded">
<view class="item" :data-grid-id="item.gridId" onTap="shiftSelectGrid" v-for="(item, index) in agency.gridList" :key="index">
<view class="item-wrap">
<view :class="'f-fl ico ' + (item.selected ? 'z-on' : '')">
<image mode="widthFix" src="/static/data/images/selected2.png"></image>
</view>
<view class="f-fl name">{{ item.gridName }}</view>
</view>
</view>
<oneself
:agency="item"
onShiftSelectGrid="shiftSelectGrid"
onShiftSelectAgency="shiftSelectAgency"
v-for="(item, index) in agency.subAgencyGridList"
:key="index"
></oneself>
</view>
</view>
</template>
<script>
import oneself from './single';
var app = getApp();
export default {
components: {
oneself
},
data() {
return {
folded: true
};
},
props: {
agency: {
type: Object,
default: () => ({})
},
iniFolded: {
type: Boolean,
default: true
},
onShiftSelectGrid: () => {},
onShiftSelectAgency: () => {}
},
didMount() {
// console.log(this.props.agency);
if (!this.iniFolded) {
this.setData({
folded: false
});
}
},
methods: {
shiftFolded: function () {
this.setData({
folded: !this.folded
});
},
shiftSelectGrid: function (event) {
console.log(event);
let obj = null;
if ('gridId' in event) {
obj = event;
} else {
obj = event.currentTarget.dataset;
}
var gridId = obj.gridId;
this.props.onShiftSelectGrid({
gridId: gridId
});
},
shiftSelectAgency: function (event) {
let obj = null;
if ('agencyId' in event) {
obj = event;
} else {
obj = event.currentTarget.dataset;
}
var agencyId = obj.agencyId;
var isopt = obj.isopt;
if (!isopt) {
return false;
}
this.props.onShiftSelectAgency({
agencyId: agencyId,
isopt: isopt
});
}
},
created: function () {}
};
</script>
<style>
@import '/data/acss/m-agency_grid_list.css';
.asd {
display: flex;
height: none;
}
</style>