add georgev or faubourg options

This commit is contained in:
2022-09-19 21:24:14 +02:00
parent 6d1543570a
commit b80385b21d
3 changed files with 6 additions and 5 deletions
+1
View File
@@ -29,6 +29,7 @@
<select name="store_list" id="store_selector" class="form-select"> <select name="store_list" id="store_selector" class="form-select">
<option value="random">随机</option> <option value="random">随机</option>
<option value="faubourg">Hermès Faubourg Saint-Honoré</option> <option value="faubourg">Hermès Faubourg Saint-Honoré</option>
<option value="faubourg:georgev">总店或香街</option>
<option value="georgev">Hermès George V</option> <option value="georgev">Hermès George V</option>
<option value="sevres">Hermès Sèvres</option> <option value="sevres">Hermès Sèvres</option>
</select> </select>
-3
View File
@@ -70,9 +70,6 @@ async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathT
alert("联系人数为0") alert("联系人数为0")
return return
} }
contactList.forEach((contact) => {
console.log(contact.mail)
})
mongoManager.connect().then(r => { mongoManager.connect().then(r => {
filterAlreadyBookedContacts(contactList).then(listToBook => { filterAlreadyBookedContacts(contactList).then(listToBook => {
console.log("number of contacts to book:" + listToBook.length) console.log("number of contacts to book:" + listToBook.length)
+5 -2
View File
@@ -61,6 +61,7 @@ class CommandorPage {
this.device = device; this.device = device;
this.mongoManager = mongoManager; this.mongoManager = mongoManager;
this.selectedStore = selectedStore; this.selectedStore = selectedStore;
this.choosedStore = selectedStore
this.isFillingFields = false; this.isFillingFields = false;
this.isTerminated = false; this.isTerminated = false;
} }
@@ -207,7 +208,9 @@ class CommandorPage {
await page.locator(PREFER_STORE).focus() await page.locator(PREFER_STORE).focus()
await delay(1000) await delay(1000)
await page.click(PREFER_STORE); 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) { } catch (e) {
@@ -347,7 +350,7 @@ class CommandorPage {
return return
} }
// save to mongoDb // 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(); reserve.source_from = this.device.model();
await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict()) await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict())
this.isTerminated = true this.isTerminated = true