Authored by 肖亚东

门票刷新问题修改

... ... @@ -4,6 +4,7 @@ Component({
data: {
type: Array,
value: [],
observer: '_dataChange'
},
},
data: {
... ... @@ -11,26 +12,28 @@ Component({
ticketCode: '',
ticketList: [],
},
ready: function() {
let ticketList = [];
this.properties.data.map(function(val, index) {
for (let item of val.ticks) {
if (item) {
ticketList.push(item);
}
}
})
if (ticketList.length) {
let ticket = ticketList[0];
let ticketCode = ticket.ticket_code || '';
this.setData({
ticketCode,
ticketList
});
}
},
methods: {
_dataChange(newValue, oldValue) {
let ticketList = [];
newValue.map(function(val, index) {
for (let item of val.ticks) {
if (item) {
ticketList.push(item);
}
}
})
if (ticketList.length) {
let ticket = ticketList[0];
let ticketCode = ticket.ticket_code || '';
this.setData({
ticketCode,
ticketList
});
}
},
swiperChange: function (e) {
let swiperCurrent = e.detail.current;
let ticket = this.data.ticketList[swiperCurrent];
... ...