style5data.py 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. '''
  2. 注意,复制数据的时候不要忘了把sectorCanvasHeight加上,因为我的数据跟前端的不太一样。
  3. 我生成画布数据需要sectorCanvasHeight画布高度。
  4. '''
  5. #第5套皮肤 首页数据
  6. class sectorStyle5Data:
  7. def __init__(self):
  8. # 通栏权重设置
  9. self.sectors_config = [
  10. # 皮肤5-首页
  11. {"name": "headLineSector", "total": 1, "weight": 10 ,"CNname":"网站头条" , "random": False},
  12. {"name": "bannerSectorMerge", "total": 1, "weight": 9 ,"CNname":"焦点图" , "random": False},
  13. {"name": "linkCxfwSector", "total": 1, "weight": 8 ,"CNname":"外链面板-带查询服务" , "random": False},
  14. {"name": "NewsHyjjSector", "total": 2, "weight": 7 ,"CNname":"行业聚焦新闻通栏" , "random": True},
  15. {"name": "newsTabsSector", "total": 2, "weight": 7 ,"CNname":"热点新闻选项卡" , "random": True},
  16. {"name": "newsTextSector", "total": 2, "weight": 7 ,"CNname":"文字新闻通栏1" , "random": True},
  17. {"name": "newsTabsTextSector", "total": 2, "weight": 7 ,"CNname":"选项卡文字新闻通栏" , "random": True},
  18. {"name": "newsAllPictureSector", "total": 2, "weight": 7 ,"CNname":"图片新闻通栏1" , "random": True},
  19. {"name": "newsTabsAdSector", "total": 2, "weight": 7 ,"CNname":"选项卡资讯带两个广告" , "random": True},
  20. {"name": "adSector", "total": 4, "weight": 6 ,"CNname":"通栏广告" , "random": False}
  21. ]
  22. # 通栏数据
  23. self.sectors_data = {
  24. #广告通栏
  25. "adSector": {
  26. "sectorName": "adSector",
  27. "sectorCanvasHeight": 12, #占据画布高度
  28. "componentList": [
  29. {
  30. "component_type": 2,
  31. "component_style": 1,
  32. "sort": 1,
  33. "componentData": {}
  34. }
  35. ],
  36. "ad": {
  37. "width": 1200,
  38. "height": 90,
  39. "name": "",
  40. "price": 0,
  41. "introduce":"",
  42. "website_id": "",
  43. "thumb": "https://img.bjzxtw.org.cn/pre/image/png/20250530/1748588901281358.png",
  44. "typeid": 2,
  45. "ad_tag": ""
  46. }
  47. },
  48. #皮肤5-新增轮播图通栏
  49. "bannerSectorMerge": {
  50. "sectorName": "bannerSectorMerge",
  51. "sectorCanvasHeight": 44,
  52. "componentList": [
  53. {
  54. "component_type": 1,
  55. "component_style": 1,
  56. "sort": 1,
  57. "componentData": {
  58. "level": 2,
  59. "imgSize": 5,
  60. "textSize": 7,
  61. "child": {
  62. "id": "",
  63. "imgSize": "",
  64. "textSize": ""
  65. },
  66. "listType": [
  67. "id",
  68. "title",
  69. "imgurl",
  70. "author",
  71. "updated_at",
  72. "introduce",
  73. "islink",
  74. "linkurl",
  75. "copyfrom",
  76. "cat_arr_id",
  77. "catid",
  78. "pinyin"
  79. ],
  80. }
  81. }
  82. ]
  83. },
  84. #皮肤5-新增外链面板-带查询服务
  85. "linkCxfwSector": {
  86. "sectorName": "linkCxfwSector",
  87. "sectorCanvasHeight": 28,
  88. "componentList": [
  89. {
  90. "component_type": 3,
  91. "component_style": 1,
  92. "sort": 1,
  93. "componentData": {}
  94. }
  95. ]
  96. },
  97. #行业聚焦新闻通栏
  98. "NewsHyjjSector": {
  99. "sectorName": "NewsHyjjSector",
  100. "sectorCanvasHeight": 56,
  101. "componentList": [
  102. {
  103. "component_type": 1,
  104. "component_style": 1,
  105. "sort": 1,
  106. "componentData": {
  107. "category_id": "",
  108. "category_arr": "",
  109. "name": "请选择导航..",
  110. "level": "",
  111. "imgSize": 1,
  112. "textSize": 9,
  113. "child": {
  114. "id": "",
  115. "imgSize": "",
  116. "textSize": ""
  117. },
  118. "listType": [
  119. "id",
  120. "title",
  121. "imgurl",
  122. "author",
  123. "updated_at",
  124. "introduce",
  125. "islink",
  126. "linkurl",
  127. "copyfrom",
  128. "cat_arr_id",
  129. "catid",
  130. "pinyin"
  131. ],
  132. },
  133. },
  134. ],
  135. },
  136. #热点新闻选项卡
  137. "newsTabsSector": {
  138. "sectorName": "newsTabsSector",
  139. "sectorCanvasHeight": 38,
  140. "componentList": [
  141. {
  142. "component_type": 1,
  143. "component_style": 1,
  144. "sort": 1,
  145. "componentData": {
  146. "category_id": "",
  147. "category_arr": "",
  148. "name": "请选择导航..",
  149. "level": "",
  150. "imgSize": 0,
  151. "textSize": 5,
  152. "child": {
  153. "id": "",
  154. "imgSize": "",
  155. "textSize": ""
  156. },
  157. "listType": [
  158. "id",
  159. "title",
  160. "imgurl",
  161. "author",
  162. "updated_at",
  163. "introduce",
  164. "islink",
  165. "linkurl",
  166. "copyfrom",
  167. "cat_arr_id",
  168. "catid",
  169. "pinyin"
  170. ],
  171. },
  172. },
  173. {
  174. "component_type": 1,
  175. "component_style": 1,
  176. "sort": 2,
  177. "componentData": [
  178. {
  179. "category_id": "",
  180. "category_arr": "",
  181. "name": "请选择导航..",
  182. "level": "",
  183. "imgSize": 0,
  184. "textSize": 5,
  185. "child": {
  186. "id": "",
  187. "imgSize": "",
  188. "textSize": ""
  189. },
  190. "listType": [
  191. "id",
  192. "title",
  193. "imgurl",
  194. "author",
  195. "updated_at",
  196. "introduce",
  197. "islink",
  198. "linkurl",
  199. "copyfrom",
  200. "cat_arr_id",
  201. "catid",
  202. "pinyin"
  203. ],
  204. },
  205. {
  206. "category_id": "",
  207. "category_arr": "",
  208. "name": "请选择导航..",
  209. "level": "",
  210. "imgSize": 0,
  211. "textSize": 5,
  212. "child": {
  213. "id": "",
  214. "imgSize": "",
  215. "textSize": ""
  216. },
  217. "listType": [
  218. "id",
  219. "title",
  220. "imgurl",
  221. "author",
  222. "updated_at",
  223. "introduce",
  224. "islink",
  225. "linkurl",
  226. "copyfrom",
  227. "cat_arr_id",
  228. "catid",
  229. "pinyin"
  230. ],
  231. }
  232. ]
  233. },
  234. ]
  235. },
  236. #文字新闻通栏1
  237. "newsTextSector": {
  238. "sectorName": "newsTextSector",
  239. "sectorCanvasHeight": 43,
  240. "componentList": [
  241. {
  242. "component_type": 1,
  243. "component_style": 1,
  244. "sort": 1,
  245. "componentData": {
  246. "category_id": "",
  247. "category_arr": "",
  248. "name": "请选择导航..",
  249. "level": "",
  250. "imgSize": 0,
  251. "textSize": 6,
  252. "child": {
  253. "id": "",
  254. "imgSize": "",
  255. "textSize": ""
  256. },
  257. "listType": [
  258. "id",
  259. "title",
  260. "imgurl",
  261. "author",
  262. "updated_at",
  263. "introduce",
  264. "islink",
  265. "linkurl",
  266. "copyfrom",
  267. "cat_arr_id",
  268. "catid",
  269. "pinyin"
  270. ],
  271. }
  272. },
  273. {
  274. "component_type": 1,
  275. "component_style": 1,
  276. "sort": 2,
  277. "componentData": {
  278. "category_id": "",
  279. "category_arr": "",
  280. "name": "请选择导航..",
  281. "level": "",
  282. "imgSize": 0,
  283. "textSize": 6,
  284. "child": {
  285. "id": "",
  286. "imgSize": "",
  287. "textSize": ""
  288. },
  289. "listType": [
  290. "id",
  291. "title",
  292. "imgurl",
  293. "author",
  294. "updated_at",
  295. "introduce",
  296. "islink",
  297. "linkurl",
  298. "copyfrom",
  299. "cat_arr_id",
  300. "catid",
  301. "pinyin"
  302. ],
  303. }
  304. }
  305. ]
  306. },
  307. #选项卡文字新闻通栏
  308. "newsTabsTextSector": {
  309. "sectorName": "newsTabsTextSector",
  310. "sectorCanvasHeight": 28,
  311. "componentList": [
  312. {
  313. "component_type": 4,
  314. "component_style": 1,
  315. "sort": 1,
  316. "componentData": [
  317. {
  318. "category_id": "",
  319. "category_arr": "",
  320. "name": "请选择导航..",
  321. "level": "",
  322. "imgSize": 0,
  323. "textSize": 5,
  324. "child": {
  325. "id": "",
  326. "imgSize": "",
  327. "textSize": ""
  328. },
  329. "listType": [
  330. "id",
  331. "title",
  332. "imgurl",
  333. "author",
  334. "updated_at",
  335. "introduce",
  336. "islink",
  337. "linkurl",
  338. "copyfrom",
  339. "cat_arr_id",
  340. "catid",
  341. "pinyin"
  342. ],
  343. },
  344. {
  345. "category_id": "",
  346. "category_arr": "",
  347. "name": "请选择导航..",
  348. "level": "",
  349. "imgSize": 0,
  350. "textSize": 5,
  351. "child": {
  352. "id": "",
  353. "imgSize": "",
  354. "textSize": ""
  355. },
  356. "listType": [
  357. "id",
  358. "title",
  359. "imgurl",
  360. "author",
  361. "updated_at",
  362. "introduce",
  363. "islink",
  364. "linkurl",
  365. "copyfrom",
  366. "cat_arr_id",
  367. "catid",
  368. "pinyin"
  369. ],
  370. }
  371. ]
  372. },
  373. {
  374. "component_type": 1,
  375. "component_style": 1,
  376. "sort": 2,
  377. "componentData": [
  378. {
  379. "category_id": "",
  380. "category_arr": "",
  381. "name": "请选择导航..",
  382. "level": "",
  383. "imgSize": 0,
  384. "textSize": 5,
  385. "child": {
  386. "id": "",
  387. "imgSize": "",
  388. "textSize": ""
  389. },
  390. "listType": [
  391. "id",
  392. "title",
  393. "imgurl",
  394. "author",
  395. "updated_at",
  396. "introduce",
  397. "islink",
  398. "linkurl",
  399. "copyfrom",
  400. "cat_arr_id",
  401. "catid",
  402. "pinyin"
  403. ],
  404. },
  405. {
  406. "category_id": "",
  407. "category_arr": "",
  408. "name": "请选择导航..",
  409. "level": "",
  410. "imgSize": 0,
  411. "textSize": 5,
  412. "child": {
  413. "id": "",
  414. "imgSize": "",
  415. "textSize": ""
  416. },
  417. "listType": [
  418. "id",
  419. "title",
  420. "imgurl",
  421. "author",
  422. "updated_at",
  423. "introduce",
  424. "islink",
  425. "linkurl",
  426. "copyfrom",
  427. "cat_arr_id",
  428. "catid",
  429. "pinyin"
  430. ],
  431. }
  432. ]
  433. },
  434. ]
  435. },
  436. #图片新闻通栏1
  437. "newsAllPictureSector": {
  438. "sectorName": "newsAllPictureSector",
  439. "sectorCanvasHeight": 41,
  440. "componentList": [
  441. {
  442. "component_type": 1,
  443. "component_style": 1,
  444. "sort": 1,
  445. "componentData": {
  446. "category_id": "",
  447. "category_arr": "",
  448. "name": "请选择导航..",
  449. "level": "",
  450. "imgSize": 7,
  451. "textSize": 0,
  452. "child": {
  453. "id": "",
  454. "imgSize": "",
  455. "textSize": ""
  456. },
  457. "listType": [
  458. "id",
  459. "title",
  460. "imgurl",
  461. "author",
  462. "updated_at",
  463. "introduce",
  464. "islink",
  465. "linkurl",
  466. "copyfrom",
  467. "cat_arr_id",
  468. "catid",
  469. "pinyin"
  470. ],
  471. },
  472. },
  473. ],
  474. },
  475. #选项卡资讯带两个广告
  476. "newsTabsAdSector": {
  477. "sectorName": "newsTabsAdSector",
  478. "sectorCanvasHeight": 40,
  479. "componentList": [
  480. {
  481. "component_type": 1,
  482. "component_style": 1,
  483. "sort": 1,
  484. "componentData": [
  485. {
  486. "category_id": "",
  487. "category_arr": "",
  488. "name": "请选择导航..",
  489. "level": "",
  490. "imgSize": 0,
  491. "textSize": 6,
  492. "child": {
  493. "id": "",
  494. "imgSize": "",
  495. "textSize": ""
  496. },
  497. "listType": [
  498. "id",
  499. "title",
  500. "imgurl",
  501. "author",
  502. "updated_at",
  503. "introduce",
  504. "islink",
  505. "linkurl",
  506. "copyfrom",
  507. "cat_arr_id",
  508. "catid",
  509. "pinyin"
  510. ],
  511. },
  512. {
  513. "category_id": "",
  514. "category_arr": "",
  515. "name": "请选择导航..",
  516. "level": "",
  517. "imgSize": 0,
  518. "textSize": 6,
  519. "child": {
  520. "id": "",
  521. "imgSize": "",
  522. "textSize": ""
  523. },
  524. "listType": [
  525. "id",
  526. "title",
  527. "imgurl",
  528. "author",
  529. "updated_at",
  530. "introduce",
  531. "islink",
  532. "linkurl",
  533. "copyfrom",
  534. "cat_arr_id",
  535. "catid",
  536. "pinyin"
  537. ],
  538. }
  539. ]
  540. },
  541. ],
  542. "ad": [
  543. {
  544. "width": 380,
  545. "height": 148,
  546. "name": "",
  547. "price": 0,
  548. "introduce": "",
  549. "website_id": "",
  550. "thumb": "https://img.bjzxtw.org.cn/pre/image/png/20251106/1762408575165380.png",
  551. "typeid": 2,
  552. "ad_tag": ""
  553. },
  554. {
  555. "width": 380,
  556. "height": 148,
  557. "name": "",
  558. "price": 0,
  559. "introduce": "",
  560. "website_id": "",
  561. "thumb": "https://img.bjzxtw.org.cn/pre/image/png/20251106/1762408575165380.png",
  562. "typeid": 2,
  563. "ad_tag": ""
  564. }
  565. ]
  566. }
  567. }
  568. #初始化通栏权重
  569. def reset_sectors_config(self):
  570. self.sectors_config = [
  571. {"name": "headLineSector", "total": 1, "weight": 10 ,"CNname":"网站头条"},
  572. {"name": "bannerSectorMerge", "total": 1, "weight": 9 ,"CNname":"焦点图"},
  573. {"name": "linkCxfwSector", "total": 1, "weight": 8 ,"CNname":"外链面板-带查询服务"},
  574. {"name": "NewsHyjjSector", "total": 2, "weight": 7 ,"CNname":"行业聚焦新闻通栏"},
  575. {"name": "newsTabsSector", "total": 2, "weight": 7 ,"CNname":"热点新闻选项卡"},
  576. {"name": "newsTextSector", "total": 2, "weight": 7 ,"CNname":"文字新闻通栏1"},
  577. {"name": "newsTabsTextSector", "total": 2, "weight": 7 ,"CNname":"选项卡文字新闻通栏"},
  578. {"name": "newsAllPictureSector", "total": 2, "weight": 7 ,"CNname":"图片新闻通栏1"},
  579. {"name": "newsTabsAdSector", "total": 2, "weight": 7 ,"CNname":"选项卡资讯带两个广告"},
  580. {"name": "adSector", "total": 4, "weight": 6 ,"CNname":"通栏广告"}
  581. ]
  582. #创建一个templateData实例
  583. sectorStyle5Data = sectorStyle5Data()