| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472 |
- '''
- 注意,复制数据的时候不要忘了把sectorCanvasHeight加上,因为我的数据跟前端的不太一样。
- 我生成画布数据需要sectorCanvasHeight画布高度。
- '''
- #1-4套皮肤 首页数据
- class sectorStyle1to4Data:
- def __init__(self):
- # 通栏权重设置
- self.sectors_config = [
- {"name": "headLineSector", "total": 1, "weight": 10 ,"CNname":"网站头条" , "random": False},
- {"name": "bannerSector", "total": 1, "weight": 9 ,"CNname":"焦点图" , "random": False},
- {"name": "linkSector", "total": 1, "weight": 8 ,"CNname":"外链面板" , "random": False},
- {"name": "manyPictureSector", "total": 2, "weight": 7 ,"CNname":"新闻图文组合1" , "random": True},
- {"name": "commentSector", "total": 2, "weight": 7 ,"CNname":"新闻图文组合2" , "random": True},
- {"name": "listSector", "total": 2, "weight": 7 ,"CNname":"新闻图文组合3" , "random": True},
- {"name": "onlyImgSector", "total": 2, "weight": 7 ,"CNname":"带广告新闻组合" , "random": True},
- {"name": "adSector", "total": 4, "weight": 6 ,"CNname":"通栏广告" , "random": False}
- ]
- # 通栏数据
- self.sectors_data = {
- #广告通栏
- "adSector": {
- "sectorName": "adSector",
- "sectorCanvasHeight": 12, #占据画布高度
- "componentList": [
- {
- "component_type": 2,
- "component_style": 1,
- "sort": 1,
- "componentData": {}
- }
- ],
- "ad": {
- "width": 1200,
- "height": 90,
- "name": "",
- "price": 0,
- "introduce":"",
- "website_id": "",
- "thumb": "https://img.bjzxtw.org.cn/pre/image/png/20250530/1748588901281358.png",
- "typeid": 2,
- "ad_tag": ""
- }
- },
- #头条通栏
- "headLineSector": {
- "sectorName": "headLineSector",
- "sectorCanvasHeight": 17,
- "componentList": [
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 1,
- "componentData": {
- "level": 1,
- "imgSize": 0,
- "textSize": 4,
- "child": {
- "id": "",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- }
- ]
- },
- #轮播图通栏
- "bannerSector": {
- "sectorName": "bannerSector",
- "sectorCanvasHeight": 44,
- "componentList": [
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 1,
- "componentData": {
- "level": 2,
- "imgSize": 5,
- "textSize": 0,
- "child": {
- "id": "",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- },
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 2,
- "componentData": {
- "level": 6,
- "imgSize": 0,
- "textSize": 10,
- "child": {
- "id": "",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- }
- ]
- },
- #新闻组合通栏1
- "manyPictureSector": {
- "sectorName": "manyPictureSector",
- "sectorCanvasHeight": 47,
- "componentList": [
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 1,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 3,
- "textSize": 9,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- },
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 2,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 3,
- "textSize": 6,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- }
- ]
- },
- #新闻组合通栏2
- "commentSector": {
- "sectorName": "commentSector",
- "sectorCanvasHeight": 47,
- "componentList": [
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 1,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 2,
- "textSize": 12,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- },
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 2,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 1,
- "textSize": 3,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- }
- ]
- },
- #新闻组合通栏3
- "listSector": {
- "sectorName": "listSector",
- "sectorCanvasHeight": 98,
- "componentList": [
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 1,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 2,
- "textSize": 6,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- },
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 2,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 2,
- "textSize": 14,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- },
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 3,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 7,
- "textSize": 0,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- }
- ]
- },
- #广告新闻混合通栏
- "onlyImgSector": {
- "sectorName": "onlyImgSector",
- "sectorCanvasHeight": 51,
- "componentList": [
- {
- "component_type": 1,
- "component_style": 1,
- "sort": 1,
- "componentData": {
- "category_id":"",
- "category_arr":"",
- "name":"请选择导航..",
- "level":"",
- "imgSize": 3,
- "textSize": 4,
- "child":{
- "id":"",
- "imgSize": "",
- "textSize": ""
- },
- "listType": [
- "id",
- "title",
- "imgurl",
- "author",
- "updated_at",
- "introduce",
- "islink",
- "linkurl",
- "copyfrom",
- "cat_arr_id",
- "catid",
- "pinyin"
- ],
- }
- },
- ],
- "ad": {
- "width": 450,
- "height": 290,
- "name": "",
- "price": 0,
- "introduce":"",
- "website_id": "",
- "thumb": "http://img.bjzxtw.org.cn/pre/image/png/20250609/174945725555092.png",
- "typeid": 2,
- "ad_tag": ""
- }
- },
- #外链通栏
- "linkSector": {
- "sectorName": "linkSector",
- "sectorCanvasHeight": 26,
- "componentList": [
- {
- "component_type": 3,
- "component_style": 1,
- "sort": 1,
- "componentData": {}
- }
- ]
- },
- }
- #初始化通栏权重
- def reset_sectors_config(self):
- self.sectors_config = [
- {"name": "headLineSector", "total": 1, "weight": 10 ,"CNname":"网站头条"},
- {"name": "bannerSector", "total": 1, "weight": 9 ,"CNname":"焦点图"},
- {"name": "linkSector", "total": 1, "weight": 8 ,"CNname":"外链面板"},
- {"name": "manyPictureSector", "total": 2, "weight": 7 ,"CNname":"新闻图文组合1"},
- {"name": "commentSector", "total": 2, "weight": 7 ,"CNname":"新闻图文组合2"},
- {"name": "listSector", "total": 2, "weight": 7 ,"CNname":"新闻图文组合3"},
- {"name": "onlyImgSector", "total": 2, "weight": 7 ,"CNname":"带广告新闻组合"},
- {"name": "adSector", "total": 4, "weight": 6 ,"CNname":"通栏广告"}
- ]
- #创建一个templateData实例
- sectorStyle1to4Data = sectorStyle1to4Data()
|