@@ -123,8 +123,9 @@ function getSystemApps() {
123123 name : '京东618' ,
124124 keys : [ 'chavy_url_jd816' , 'chavy_body_jd816' , 'chavy_headers_jd816' ] ,
125125 settings : [
126- { id : 'CFG_BOOM_times_JD618' , name : '炸弹次数' , val : '1' , type : 'text' , desc : '总共发送多少次炸弹!' } ,
127- { id : 'CFG_BOOM_interval_JD618' , name : '炸弹间隔 (毫秒)' , val : '100' , type : 'text' , desc : '每次间隔多少毫秒!' }
126+ { id : 'CFG_618_isSignShop' , name : '商店签到' , val : true , type : 'boolean' , desc : '71家商店, 如果每天都签不上, 可以关掉了! 默认: true' } ,
127+ { id : 'CFG_BOOM_times_JD618' , name : '炸弹次数' , val : 1 , type : 'text' , desc : '总共发送多少次炸弹! 默认: 1' } ,
128+ { id : 'CFG_BOOM_interval_JD618' , name : '炸弹间隔 (毫秒)' , val : 100 , type : 'text' , desc : '每次间隔多少毫秒! 默认: 100' }
128129 ] ,
129130 author : '@chavyleung' ,
130131 repo : 'https://github.com/chavyleung/scripts/tree/master/jd' ,
@@ -165,7 +166,14 @@ function getSystemApps() {
165166 } )
166167 Array . isArray ( app . settings ) &&
167168 app . settings . forEach ( ( setting ) => {
168- setting . val = $ . getdata ( setting . id ) || setting . val
169+ const val = $ . getdata ( setting . id )
170+ if ( setting . type === 'boolean' ) {
171+ setting . val = val === null ? setting . val : val === 'true'
172+ } else if ( setting . type === 'int' ) {
173+ setting . val = val * 1 || setting . val
174+ } else {
175+ setting . val = val || setting . val
176+ }
169177 } )
170178 } )
171179 return sysapps
@@ -219,9 +227,9 @@ function handleApi() {
219227 settings . forEach ( ( setting ) => {
220228 const oldval = $ . getdata ( setting . id )
221229 const newval = setting . val
222- const usesuc = $ . setdata ( newval , setting . id )
230+ const usesuc = $ . setdata ( ` ${ newval } ` , setting . id )
223231 $ . log ( `❕ ${ $ . name } , 保存设置: ${ setting . id } ${ usesuc ? '成功' : '失败' } !` , `旧值: ${ oldval } ` , `新值: ${ newval } ` )
224- $ . setdata ( newval , setting . id )
232+ $ . setdata ( ` ${ newval } ` , setting . id )
225233 } )
226234 $ . subt = `保存设置: 成功! `
227235 $ . msg ( $ . name , $ . subt , '' )
@@ -237,7 +245,7 @@ function handleApi() {
237245 session . datas . forEach ( ( data ) => {
238246 const oldval = $ . getdata ( data . key )
239247 const newval = data . val
240- const usesuc = $ . setdata ( newval , data . key )
248+ const usesuc = $ . setdata ( ` ${ newval } ` , data . key )
241249 $ . log ( `❕ ${ $ . name } , 替换数据: ${ data . key } ${ usesuc ? '成功' : '失败' } !` , `旧值: ${ oldval } ` , `新值: ${ newval } ` )
242250 } )
243251 $ . subt = `应用会话: 成功 (${ session . appName } )`
@@ -370,24 +378,26 @@ function printHtml(data, curapp = null) {
370378 </v-card>
371379 </v-container>
372380 <v-container fluid v-if="ui.curview === 'appsession'">
373- <v-card class="mx-auto">
381+ <v-card class="mx-auto mb-4 ">
374382 <template v-if="Array.isArray(ui.curapp.settings)">
375383 <v-subheader v-if="Array.isArray(ui.curapp.settings)">
376384 应用设置 ({{ ui.curapp.settings.length }})
377385 </v-subheader>
378386 <v-form class="pl-4 pr-4">
379387 <template v-for="(setting, settingIdx) in ui.curapp.settings">
380388 <v-text-field :label="setting.name" v-model="setting.val" :hint="setting.desc" v-if="setting.type === 'text'"></v-text-field>
381- <v-slider :label="setting.name" v-model="setting.val" :hint="setting.desc" :min="setting.min" :max="setting.max" thumb-label="always" v-if="setting.type === 'slider'"></v-slider>
389+ <v-slider :label="setting.name" v-model="setting.val" :hint="setting.desc" :min="setting.min" :max="setting.max" thumb-label="always" v-else-if="setting.type === 'slider'"></v-slider>
390+ <v-switch :label="setting.name" v-model="setting.val" :hint="setting.desc" v-else-if="setting.type === 'boolean'"></v-switch>
382391 </template>
383392 </v-form>
384393 <v-divider></v-divider>
385394 <v-card-actions>
386395 <v-spacer></v-spacer>
387396 <v-btn small text color="success" @click="onSavePops">保存设置</v-btn>
388397 </v-card-actions>
389- <v-divider></v-divider>
390398 </template>
399+ </v-card>
400+ <v-card class="mx-auto">
391401 <v-subheader>
392402 当前会话 ({{ ui.curapp.datas.length }})
393403 <v-spacer></v-spacer>
@@ -420,17 +430,6 @@ function printHtml(data, curapp = null) {
420430 <v-card class="ml-10 mt-4" v-for="(session, sessionIdx) in ui.curappSessions" :key="session.id">
421431 <v-subheader>
422432 #{{ sessionIdx + 1 }} {{ session.name }}
423- <v-spacer></v-spacer>
424- <v-menu bottom left>
425- <template v-slot:activator="{ on }">
426- <v-btn icon v-on="on"><v-icon>mdi-dots-vertical</v-icon></v-btn>
427- </template>
428- <v-list>
429- <v-list-item @click="" v-clipboard:copy="JSON.stringify(session)" v-clipboard:success="onCopy">
430- <v-list-item-title>复制会话</v-list-item-title>
431- </v-list-item>
432- </v-list>
433- </v-menu>
434433 </v-subheader>
435434 <v-list-item two-line dense v-for="(data, dataIdx) in session.datas" :key="dataIdx">
436435 <v-list-item-content>
@@ -440,7 +439,7 @@ function printHtml(data, curapp = null) {
440439 </v-list-item>
441440 <v-divider></v-divider>
442441 <v-card-actions>
443- <v-btn x- small text color="grey">{{ session.createTime }}</v-btn>
442+ <v-btn small text color="grey">{{ session.createTime }}</v-btn>
444443 <v-spacer></v-spacer>
445444 <v-btn small text color="error" @click="onDelSession(session)">删除</v-btn>
446445 <v-btn small text color="success" @click="onUseSession(session)">应用</v-btn>
0 commit comments