diff --git a/index.html b/index.html index 73d105c..0325943 100644 --- a/index.html +++ b/index.html @@ -29,6 +29,7 @@ diff --git a/src/appointment.js b/src/appointment.js index 2c7a68c..eff562e 100644 --- a/src/appointment.js +++ b/src/appointment.js @@ -70,9 +70,6 @@ async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathT alert("联系人数为0") return } - contactList.forEach((contact) => { - console.log(contact.mail) - }) mongoManager.connect().then(r => { filterAlreadyBookedContacts(contactList).then(listToBook => { console.log("number of contacts to book:" + listToBook.length) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index d4b6795..8af7085 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -61,6 +61,7 @@ class CommandorPage { this.device = device; this.mongoManager = mongoManager; this.selectedStore = selectedStore; + this.choosedStore = selectedStore this.isFillingFields = false; this.isTerminated = false; } @@ -207,7 +208,9 @@ class CommandorPage { await page.locator(PREFER_STORE).focus() await delay(1000) await page.click(PREFER_STORE); - await page.selectOption(PREFER_STORE, this.selectedStore); + let stores = this.selectedStore.split(":") + this.choosedStore = stores[Math.floor(Math.random() * stores.length)] + await page.selectOption(PREFER_STORE, this.choosedStore); } } } catch (e) { @@ -347,7 +350,7 @@ class CommandorPage { return } // save to mongoDb - let reserve = ReserveResultPojo.create_from_contact(this.contact, id, this.page.url(), 1, publishType); + let reserve = ReserveResultPojo.create_from_contact(this.contact, id, this.page.url(), this.choosedStore, publishType); reserve.source_from = this.device.model(); await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict()) this.isTerminated = true