|
@@ -120,8 +120,7 @@
|
|
that = this;
|
|
that = this;
|
|
uni.$once('sendData', info => {
|
|
uni.$once('sendData', info => {
|
|
that.orderInfo = info;
|
|
that.orderInfo = info;
|
|
- console.log(that.orderInfo)
|
|
|
|
- that.checkInPersonList = that.orderInfo.detailFormList[0].checkInPersonList;
|
|
|
|
|
|
+ that.checkInPersonList = that.deepClone(that.orderInfo.detailFormList[0].checkInPersonList)
|
|
if (!that.checkInPersonList || that.checkInPersonList.length == 0) {
|
|
if (!that.checkInPersonList || that.checkInPersonList.length == 0) {
|
|
that.checkInPersonList.push({
|
|
that.checkInPersonList.push({
|
|
cardType: 0,
|
|
cardType: 0,
|
|
@@ -134,6 +133,32 @@
|
|
uni.$emit('toSendData');
|
|
uni.$emit('toSendData');
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ deepClone(obj, cache = new WeakMap()) {
|
|
|
|
+ if (obj === null || typeof obj !== 'object') return obj;
|
|
|
|
+ if (cache.has(obj)) return cache.get(obj);
|
|
|
|
+ let clone;
|
|
|
|
+ if (obj instanceof Date) {
|
|
|
|
+ clone = new Date(obj.getTime());
|
|
|
|
+ } else if (obj instanceof RegExp) {
|
|
|
|
+ clone = new RegExp(obj);
|
|
|
|
+ } else if (obj instanceof Map) {
|
|
|
|
+ clone = new Map(Array.from(obj, ([key, value]) => [key, this.deepClone(value, cache)]));
|
|
|
|
+ } else if (obj instanceof Set) {
|
|
|
|
+ clone = new Set(Array.from(obj, value => this.deepClone(value, cache)));
|
|
|
|
+ } else if (Array.isArray(obj)) {
|
|
|
|
+ clone = obj.map(value => this.deepClone(value, cache));
|
|
|
|
+ } else if (Object.prototype.toString.call(obj) === '[object Object]') {
|
|
|
|
+ clone = Object.create(Object.getPrototypeOf(obj));
|
|
|
|
+ cache.set(obj, clone);
|
|
|
|
+ for (const [key, value] of Object.entries(obj)) {
|
|
|
|
+ clone[key] = this.deepClone(value, cache);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ clone = Object.assign({}, obj);
|
|
|
|
+ }
|
|
|
|
+ cache.set(obj, clone);
|
|
|
|
+ return clone;
|
|
|
|
+ },
|
|
passengerConfirm(e, index) {
|
|
passengerConfirm(e, index) {
|
|
this.checkInPersonList[index].cardType = e.value[0].value;
|
|
this.checkInPersonList[index].cardType = e.value[0].value;
|
|
this.show = false;
|
|
this.show = false;
|