Skip to content

Commit

Permalink
增加突破数量限制选项
Browse files Browse the repository at this point in the history
  • Loading branch information
Firesuiry committed Apr 13, 2022
1 parent f038a94 commit 20a633e
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 19 deletions.
39 changes: 23 additions & 16 deletions client.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="mainTab">
<property name="currentIndex">
<number>0</number>
<number>1</number>
</property>
<widget class="QWidget" name="loginTab">
<attribute name="title">
Expand Down Expand Up @@ -169,21 +169,14 @@
<string>网盘链接批量上传</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QPushButton" name="insertBtn">
<property name="text">
<string>增加行</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QPushButton" name="deleteBtn">
<widget class="QPushButton" name="setMainImgBtn">
<property name="text">
<string>删除当前行</string>
<string>设置当前选中文件主图</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<item row="1" column="0" colspan="4">
<widget class="QTableWidget" name="inforTable">
<column>
<property name="text">
Expand Down Expand Up @@ -237,27 +230,41 @@
</column>
</widget>
</item>
<item row="0" column="0">
<widget class="QPushButton" name="insertBtn">
<property name="text">
<string>增加行</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QComboBox" name="cateCb"/>
</item>
<item row="2" column="1">
<item row="0" column="3">
<widget class="QPushButton" name="deleteBtn">
<property name="text">
<string>删除当前行</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QPushButton" name="publishBtn">
<property name="text">
<string>发布</string>
</property>
</widget>
</item>
<item row="2" column="2">
<item row="2" column="3">
<widget class="QPushButton" name="clearBtn">
<property name="text">
<string>清空</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="setMainImgBtn">
<item row="2" column="1">
<widget class="QCheckBox" name="use_money_checkBox">
<property name="text">
<string>设置当前选中文件主图</string>
<string>突破数量限制(每个文件消耗0.1元)</string>
</property>
</widget>
</item>
Expand Down
10 changes: 7 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,12 @@ class PublistWorker(QThread):
pub_finish_signal = Signal(requests.Response, int)
pub_fail_signal = Signal(str, int)

def __init__(self, table, cookie, cateCb):
def __init__(self, table, cookie, cateCb, use_money_checkBox):
super(PublistWorker, self).__init__()
self.table = table
self.cookie = cookie
self.cateCb = cateCb
self.use_money_checkBox = use_money_checkBox

def run(self):
print('发布进程运行')
Expand Down Expand Up @@ -113,6 +114,8 @@ def run(self):
files = {}
if main_img:
f = files['main_img'] = open(main_img, 'rb')
if self.use_money_checkBox.isChecked():
data['use_money'] = 1
print(data)
headers = {'referer': 'https://www.jiandanmaimai.cn/web/upload/'}
res = requests.post(post_url, data, cookies=self.cookie, files=files, headers=headers)
Expand Down Expand Up @@ -262,8 +265,9 @@ def on_publish_btn_clicked(self):
return

self.window.publishBtn.setEnabled(False)

self.pub_woker = PublistWorker(self.table, self.cookie, self.window.cateCb)
# print(self.window.use_money_checkBox.isChecked())
# return
self.pub_woker = PublistWorker(self.table, self.cookie, self.window.cateCb, self.window.use_money_checkBox)
self.pub_woker.pub_finish_signal.connect(self.on_publish_single_finish)
self.pub_woker.finished.connect(self.on_publish_all_finish)
self.pub_woker.pub_fail_signal.connect(self.on_publish_fail)
Expand Down

0 comments on commit 20a633e

Please sign in to comment.