Merge branch 'develop' into feature/datadome

This commit is contained in:
2022-09-23 15:02:38 +02:00
5 changed files with 14 additions and 4 deletions
+4
View File
@@ -78,3 +78,7 @@ adb -s e08f0a85 shell am start -n com.android.chrome/com.google.android.apps.chr
adb -s B2NGAA8861320589 shell pm clear com.android.chrome adb -s B2NGAA8861320589 shell pm clear com.android.chrome
adb -s B2NGAA8861320589 shell am set-debug-app --persistent com.android.chrome adb -s B2NGAA8861320589 shell am set-debug-app --persistent com.android.chrome
adb -s B2NGAA8861320589 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main adb -s B2NGAA8861320589 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#xiao mi
adb -s e08f0a85 shell pm clear com.android.chrome
adb -s e08f0a85 shell am set-debug-app --persistent com.android.chrome
adb -s e08f0a85 shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
+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>
+1 -1
View File
@@ -64,7 +64,7 @@ async function startBookWithNumbers(startNumber, endNumber, selectedStore, pathT
if (endNumber <= allContactList.length) { if (endNumber <= allContactList.length) {
contactList = allContactList.slice(startNumber, endNumber); contactList = allContactList.slice(startNumber, endNumber);
} else { } else {
contactList = allContactList; contactList = allContactList.slice(startNumber, allContactList.length);
} }
if (contactList.length === 0) { if (contactList.length === 0) {
alert("联系人数为0") alert("联系人数为0")
+3 -1
View File
@@ -13,6 +13,7 @@ class ReserveResultPojo {
this.email = mail; this.email = mail;
this.type = type; this.type = type;
this.source_from = "" this.source_from = ""
this.created_at = new Date().toLocaleString()
} }
to_mongo_dict() { to_mongo_dict() {
@@ -25,7 +26,8 @@ class ReserveResultPojo {
passport: this.passportNumber, passport: this.passportNumber,
url: this.url, url: this.url,
store_type: this.storeType, store_type: this.storeType,
source_from: this.source_from source_from: this.source_from,
created_at: this.created_at
} }
} }
+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