优化已采集页面数据统计、更新初始化页面加载动画资源、替换新识别模型
This commit is contained in:
Binary file not shown.
@@ -5,9 +5,11 @@
|
||||
"丝瓜WP2026032300114",
|
||||
"乳瓜WP2026032000107",
|
||||
"冬瓜WP2026032300115",
|
||||
"冰糖",
|
||||
"冰草WP2026020900054",
|
||||
"刀豆",
|
||||
"北豆腐WP2025111900007",
|
||||
"南瓜[倭瓜,番瓜]",
|
||||
"味精WP2026013000034",
|
||||
"圆生菜WP2026020900053",
|
||||
"基围虾WP2025110700019",
|
||||
@@ -16,37 +18,55 @@
|
||||
"大葱WP2026013000026",
|
||||
"大蒜(去皮)WP2026020200011",
|
||||
"大蒜(带皮)WP2026020300046",
|
||||
"奶白菜",
|
||||
"姜(子姜)[嫩姜]",
|
||||
"姜[黄姜]WP2026022800956",
|
||||
"娃娃菜WP2026020200005",
|
||||
"小白菜WP2026022800031",
|
||||
"小米辣椒WP2026013000027",
|
||||
"小葱WP2026013000029",
|
||||
"小鸡腿(带骨)",
|
||||
"山药(带皮)WP2026020200008",
|
||||
"巨人笋",
|
||||
"平菇[糙皮侧耳,青蘑]WP2026031700086",
|
||||
"广东菜心WP2025120100014",
|
||||
"新世纪哈密瓜",
|
||||
"明虾",
|
||||
"木耳(干)[黑木耳,云耳]WP2026022801182",
|
||||
"杏鲍菇WP2026022700030",
|
||||
"松花蛋",
|
||||
"松茸菌WP2025120100016",
|
||||
"槐花[洋槐花,豆槐花]",
|
||||
"橙",
|
||||
"沙葱",
|
||||
"油麦菜WP2026031200077",
|
||||
"海带(浸)[江白菜,昆布]WP2026022800035",
|
||||
"淀粉(马铃薯)",
|
||||
"湿米线过桥米线",
|
||||
"火龙果(带皮)",
|
||||
"炒饼丝",
|
||||
"牛肉(腹部肉)[牛腩]",
|
||||
"牛肚",
|
||||
"牛腩WP2025110700043",
|
||||
"猪五花肉WP2026020300048",
|
||||
"猪小排(带骨)",
|
||||
"猪排(带骨)WP2026031200078",
|
||||
"猪肉(瘦)",
|
||||
"猪肉(腿)WP2026022800033",
|
||||
"猪肉(里脊)WP2026021000025",
|
||||
"猪肝(鲜)WP2026032000105",
|
||||
"猪肾(fat8g)[猪腰子]",
|
||||
"玉米WP2025120100017",
|
||||
"玉米糁(黄)WP2026022800038",
|
||||
"甜椒[灯笼椒,柿子椒]WP2026020500018",
|
||||
"生菜(叶用莴苣)WP2026020500020",
|
||||
"生蚝",
|
||||
"番茄[西红柿]WP2026021000028",
|
||||
"白吉饼WP2026013000024",
|
||||
"白玉菇WP2026031100072",
|
||||
"白菜薹[菜薹,菜心]WP2026031100068",
|
||||
"白萝卜WP2026031200079",
|
||||
"石斑鱼(整条鱼)",
|
||||
"笋",
|
||||
"粉丝",
|
||||
"素鸡WP2026031700096",
|
||||
@@ -64,50 +84,72 @@
|
||||
"羊排WP2025120300021",
|
||||
"羊血WP2026013000038",
|
||||
"胡萝卜WP2025110600008",
|
||||
"腰果(熟)",
|
||||
"芋头",
|
||||
"芥蓝[甘蓝菜,盖蓝菜]",
|
||||
"芦笋(绿)[石刁柏,龙须菜]",
|
||||
"花卷",
|
||||
"花椒(粉)",
|
||||
"花生仁(生)WP2026032000102",
|
||||
"花螺",
|
||||
"芹菜(茎)[旱芹,药芹]WP2026022800032",
|
||||
"苦菊",
|
||||
"苹果(代表值)WP2026032300117",
|
||||
"茄子(紫皮,长)WP2025110700024",
|
||||
"茼蒿WP2026020200045",
|
||||
"草鱼",
|
||||
"荷兰豆WP2026032000104",
|
||||
"莲藕(带皮)",
|
||||
"莴笋(鲜)[莴苣]WP2026020200009",
|
||||
"菜花(白色)[花椰菜]WP2026030600057",
|
||||
"菠菜(鲜)[赤根菜]WP2026022800700",
|
||||
"菠萝[凤梨,地菠萝]",
|
||||
"蒜苗WP2026013000028",
|
||||
"蒜薹(圆)",
|
||||
"蒸鱼豉油WP2026013000032",
|
||||
"蕹菜[空心菜,藤藤菜]",
|
||||
"薏米[薏仁米,苡米]WP2026022800037",
|
||||
"虫草花(干)WP2026032000108",
|
||||
"蛏子",
|
||||
"西兰花[绿菜花]WP2026031100071",
|
||||
"西瓜(代表值)",
|
||||
"西芹[西洋芹菜,美芹]WP2026031100069",
|
||||
"西葫芦WP2026021000027",
|
||||
"豆腐干(代表值)",
|
||||
"豆腐皮WP2026031700097",
|
||||
"豆角豇豆WP2026021000026",
|
||||
"赤小豆[小豆,红小豆](干)WP2026032300118",
|
||||
"辣椒(红,小)WP2025111000066",
|
||||
"辣椒(青,尖)WP2026030600056",
|
||||
"辣椒段(干)",
|
||||
"醪糟",
|
||||
"金针菇[(鲜)[智力菇]WP2026030600051",
|
||||
"青线椒WP2026013000031",
|
||||
"青美人椒辣椒(青,尖)",
|
||||
"青花椒鲜花椒",
|
||||
"面条(生,代表值)WP2026030600055",
|
||||
"面条(生,炒细面",
|
||||
"韭菜WP2026020200044",
|
||||
"韭薹",
|
||||
"韭黄",
|
||||
"馒头(代表值)WP2026030600056",
|
||||
"香椿[香椿芽]WP2026022801086",
|
||||
"香菇(鲜)[香蕈,冬菇]WP2026030600050",
|
||||
"香菜WP2026013000030",
|
||||
"马铃薯[土豆、洋芋]WP2026012900001",
|
||||
"鱿鱼(鲜,中国枪乌贼)[枪乌贼]",
|
||||
"鲍鱼(带壳)",
|
||||
"鲑鱼[大马哈鱼,三文鱼]",
|
||||
"鲜猪精排",
|
||||
"鸡全腿(带骨)",
|
||||
"鸡翅(带骨)",
|
||||
"鸡胸脯肉WP2026022802698",
|
||||
"鸡腿肉WP2025110700048",
|
||||
"鸡腿(带骨)",
|
||||
"鸡蛋WP2026013000039",
|
||||
"鸭(均值)",
|
||||
"鸭蛋黄",
|
||||
"黄瓜(鲜)[胡瓜]WP2025110700031",
|
||||
"黄豆",
|
||||
"黄豆芽WP2026020200042",
|
||||
"黑米WP2026031200081",
|
||||
"黑袋子",
|
||||
@@ -119,113 +161,155 @@
|
||||
"丝瓜WP2026032300114": 2,
|
||||
"乳瓜WP2026032000107": 3,
|
||||
"冬瓜WP2026032300115": 4,
|
||||
"冰草WP2026020900054": 5,
|
||||
"刀豆": 6,
|
||||
"北豆腐WP2025111900007": 7,
|
||||
"味精WP2026013000034": 8,
|
||||
"圆生菜WP2026020900053": 9,
|
||||
"基围虾WP2025110700019": 10,
|
||||
"多宝鱼WP2025112600011": 11,
|
||||
"大白菜(代表值)WP2026031700085": 12,
|
||||
"大葱WP2026013000026": 13,
|
||||
"大蒜(去皮)WP2026020200011": 14,
|
||||
"大蒜(带皮)WP2026020300046": 15,
|
||||
"姜[黄姜]WP2026022800956": 16,
|
||||
"娃娃菜WP2026020200005": 17,
|
||||
"小白菜WP2026022800031": 18,
|
||||
"小米辣椒WP2026013000027": 19,
|
||||
"小葱WP2026013000029": 20,
|
||||
"山药(带皮)WP2026020200008": 21,
|
||||
"巨人笋": 22,
|
||||
"平菇[糙皮侧耳,青蘑]WP2026031700086": 23,
|
||||
"广东菜心WP2025120100014": 24,
|
||||
"木耳(干)[黑木耳,云耳]WP2026022801182": 25,
|
||||
"杏鲍菇WP2026022700030": 26,
|
||||
"松花蛋": 27,
|
||||
"松茸菌WP2025120100016": 28,
|
||||
"沙葱": 29,
|
||||
"油麦菜WP2026031200077": 30,
|
||||
"海带(浸)[江白菜,昆布]WP2026022800035": 31,
|
||||
"牛腩WP2025110700043": 32,
|
||||
"猪五花肉WP2026020300048": 33,
|
||||
"猪排(带骨)WP2026031200078": 34,
|
||||
"猪肉(腿)WP2026022800033": 35,
|
||||
"猪肉(里脊)WP2026021000025": 36,
|
||||
"猪肝(鲜)WP2026032000105": 37,
|
||||
"玉米WP2025120100017": 38,
|
||||
"玉米糁(黄)WP2026022800038": 39,
|
||||
"甜椒[灯笼椒,柿子椒]WP2026020500018": 40,
|
||||
"生菜(叶用莴苣)WP2026020500020": 41,
|
||||
"番茄[西红柿]WP2026021000028": 42,
|
||||
"白吉饼WP2026013000024": 43,
|
||||
"白玉菇WP2026031100072": 44,
|
||||
"白菜薹[菜薹,菜心]WP2026031100068": 45,
|
||||
"白萝卜WP2026031200079": 46,
|
||||
"笋": 47,
|
||||
"粉丝": 48,
|
||||
"素鸡WP2026031700096": 49,
|
||||
"红心萝卜[心里美]WP2026022800368": 50,
|
||||
"红提子WP2025111900006": 51,
|
||||
"红椒WP2026030300055": 52,
|
||||
"红洋葱WP2026030600054": 53,
|
||||
"红美人椒WP2026020300049": 54,
|
||||
"红薯": 55,
|
||||
"红薯粉条WP2026031700091": 56,
|
||||
"红薯粉条(袋)": 57,
|
||||
"结球甘蓝(紫)[圆白菜]WP2026020500017": 58,
|
||||
"结球甘蓝(绿)[圆白菜]WP2026032300116": 59,
|
||||
"绿豆芽WP2026031100073": 60,
|
||||
"羊排WP2025120300021": 61,
|
||||
"羊血WP2026013000038": 62,
|
||||
"胡萝卜WP2025110600008": 63,
|
||||
"芋头": 64,
|
||||
"花卷": 65,
|
||||
"花生仁(生)WP2026032000102": 66,
|
||||
"芹菜(茎)[旱芹,药芹]WP2026022800032": 67,
|
||||
"苦菊": 68,
|
||||
"苹果(代表值)WP2026032300117": 69,
|
||||
"茄子(紫皮,长)WP2025110700024": 70,
|
||||
"茼蒿WP2026020200045": 71,
|
||||
"荷兰豆WP2026032000104": 72,
|
||||
"莲藕(带皮)": 73,
|
||||
"莴笋(鲜)[莴苣]WP2026020200009": 74,
|
||||
"菜花(白色)[花椰菜]WP2026030600057": 75,
|
||||
"菠菜(鲜)[赤根菜]WP2026022800700": 76,
|
||||
"蒜苗WP2026013000028": 77,
|
||||
"蒜薹(圆)": 78,
|
||||
"蒸鱼豉油WP2026013000032": 79,
|
||||
"薏米[薏仁米,苡米]WP2026022800037": 80,
|
||||
"虫草花(干)WP2026032000108": 81,
|
||||
"西兰花[绿菜花]WP2026031100071": 82,
|
||||
"西芹[西洋芹菜,美芹]WP2026031100069": 83,
|
||||
"西葫芦WP2026021000027": 84,
|
||||
"豆腐皮WP2026031700097": 85,
|
||||
"豆角豇豆WP2026021000026": 86,
|
||||
"赤小豆[小豆,红小豆](干)WP2026032300118": 87,
|
||||
"辣椒(红,小)WP2025111000066": 88,
|
||||
"辣椒(青,尖)WP2026030600056": 89,
|
||||
"醪糟": 90,
|
||||
"金针菇[(鲜)[智力菇]WP2026030600051": 91,
|
||||
"青线椒WP2026013000031": 92,
|
||||
"面条(生,代表值)WP2026030600055": 93,
|
||||
"韭菜WP2026020200044": 94,
|
||||
"韭黄": 95,
|
||||
"馒头(代表值)WP2026030600056": 96,
|
||||
"香椿[香椿芽]WP2026022801086": 97,
|
||||
"香菇(鲜)[香蕈,冬菇]WP2026030600050": 98,
|
||||
"香菜WP2026013000030": 99,
|
||||
"马铃薯[土豆、洋芋]WP2026012900001": 100,
|
||||
"鸡全腿(带骨)": 101,
|
||||
"鸡翅(带骨)": 102,
|
||||
"鸡胸脯肉WP2026022802698": 103,
|
||||
"鸡腿肉WP2025110700048": 104,
|
||||
"鸡腿(带骨)": 105,
|
||||
"鸡蛋WP2026013000039": 106,
|
||||
"黄瓜(鲜)[胡瓜]WP2025110700031": 107,
|
||||
"黄豆芽WP2026020200042": 108,
|
||||
"黑米WP2026031200081": 109,
|
||||
"黑袋子": 110,
|
||||
"黑鱼(整条鱼)WP2025110600012": 111
|
||||
"冰糖": 5,
|
||||
"冰草WP2026020900054": 6,
|
||||
"刀豆": 7,
|
||||
"北豆腐WP2025111900007": 8,
|
||||
"南瓜[倭瓜,番瓜]": 9,
|
||||
"味精WP2026013000034": 10,
|
||||
"圆生菜WP2026020900053": 11,
|
||||
"基围虾WP2025110700019": 12,
|
||||
"多宝鱼WP2025112600011": 13,
|
||||
"大白菜(代表值)WP2026031700085": 14,
|
||||
"大葱WP2026013000026": 15,
|
||||
"大蒜(去皮)WP2026020200011": 16,
|
||||
"大蒜(带皮)WP2026020300046": 17,
|
||||
"奶白菜": 18,
|
||||
"姜(子姜)[嫩姜]": 19,
|
||||
"姜[黄姜]WP2026022800956": 20,
|
||||
"娃娃菜WP2026020200005": 21,
|
||||
"小白菜WP2026022800031": 22,
|
||||
"小米辣椒WP2026013000027": 23,
|
||||
"小葱WP2026013000029": 24,
|
||||
"小鸡腿(带骨)": 25,
|
||||
"山药(带皮)WP2026020200008": 26,
|
||||
"巨人笋": 27,
|
||||
"平菇[糙皮侧耳,青蘑]WP2026031700086": 28,
|
||||
"广东菜心WP2025120100014": 29,
|
||||
"新世纪哈密瓜": 30,
|
||||
"明虾": 31,
|
||||
"木耳(干)[黑木耳,云耳]WP2026022801182": 32,
|
||||
"杏鲍菇WP2026022700030": 33,
|
||||
"松花蛋": 34,
|
||||
"松茸菌WP2025120100016": 35,
|
||||
"槐花[洋槐花,豆槐花]": 36,
|
||||
"橙": 37,
|
||||
"沙葱": 38,
|
||||
"油麦菜WP2026031200077": 39,
|
||||
"海带(浸)[江白菜,昆布]WP2026022800035": 40,
|
||||
"淀粉(马铃薯)": 41,
|
||||
"湿米线过桥米线": 42,
|
||||
"火龙果(带皮)": 43,
|
||||
"炒饼丝": 44,
|
||||
"牛肉(腹部肉)[牛腩]": 45,
|
||||
"牛肚": 46,
|
||||
"牛腩WP2025110700043": 47,
|
||||
"猪五花肉WP2026020300048": 48,
|
||||
"猪小排(带骨)": 49,
|
||||
"猪排(带骨)WP2026031200078": 50,
|
||||
"猪肉(瘦)": 51,
|
||||
"猪肉(腿)WP2026022800033": 52,
|
||||
"猪肉(里脊)WP2026021000025": 53,
|
||||
"猪肝(鲜)WP2026032000105": 54,
|
||||
"猪肾(fat8g)[猪腰子]": 55,
|
||||
"玉米WP2025120100017": 56,
|
||||
"玉米糁(黄)WP2026022800038": 57,
|
||||
"甜椒[灯笼椒,柿子椒]WP2026020500018": 58,
|
||||
"生菜(叶用莴苣)WP2026020500020": 59,
|
||||
"生蚝": 60,
|
||||
"番茄[西红柿]WP2026021000028": 61,
|
||||
"白吉饼WP2026013000024": 62,
|
||||
"白玉菇WP2026031100072": 63,
|
||||
"白菜薹[菜薹,菜心]WP2026031100068": 64,
|
||||
"白萝卜WP2026031200079": 65,
|
||||
"石斑鱼(整条鱼)": 66,
|
||||
"笋": 67,
|
||||
"粉丝": 68,
|
||||
"素鸡WP2026031700096": 69,
|
||||
"红心萝卜[心里美]WP2026022800368": 70,
|
||||
"红提子WP2025111900006": 71,
|
||||
"红椒WP2026030300055": 72,
|
||||
"红洋葱WP2026030600054": 73,
|
||||
"红美人椒WP2026020300049": 74,
|
||||
"红薯": 75,
|
||||
"红薯粉条WP2026031700091": 76,
|
||||
"红薯粉条(袋)": 77,
|
||||
"结球甘蓝(紫)[圆白菜]WP2026020500017": 78,
|
||||
"结球甘蓝(绿)[圆白菜]WP2026032300116": 79,
|
||||
"绿豆芽WP2026031100073": 80,
|
||||
"羊排WP2025120300021": 81,
|
||||
"羊血WP2026013000038": 82,
|
||||
"胡萝卜WP2025110600008": 83,
|
||||
"腰果(熟)": 84,
|
||||
"芋头": 85,
|
||||
"芥蓝[甘蓝菜,盖蓝菜]": 86,
|
||||
"芦笋(绿)[石刁柏,龙须菜]": 87,
|
||||
"花卷": 88,
|
||||
"花椒(粉)": 89,
|
||||
"花生仁(生)WP2026032000102": 90,
|
||||
"花螺": 91,
|
||||
"芹菜(茎)[旱芹,药芹]WP2026022800032": 92,
|
||||
"苦菊": 93,
|
||||
"苹果(代表值)WP2026032300117": 94,
|
||||
"茄子(紫皮,长)WP2025110700024": 95,
|
||||
"茼蒿WP2026020200045": 96,
|
||||
"草鱼": 97,
|
||||
"荷兰豆WP2026032000104": 98,
|
||||
"莲藕(带皮)": 99,
|
||||
"莴笋(鲜)[莴苣]WP2026020200009": 100,
|
||||
"菜花(白色)[花椰菜]WP2026030600057": 101,
|
||||
"菠菜(鲜)[赤根菜]WP2026022800700": 102,
|
||||
"菠萝[凤梨,地菠萝]": 103,
|
||||
"蒜苗WP2026013000028": 104,
|
||||
"蒜薹(圆)": 105,
|
||||
"蒸鱼豉油WP2026013000032": 106,
|
||||
"蕹菜[空心菜,藤藤菜]": 107,
|
||||
"薏米[薏仁米,苡米]WP2026022800037": 108,
|
||||
"虫草花(干)WP2026032000108": 109,
|
||||
"蛏子": 110,
|
||||
"西兰花[绿菜花]WP2026031100071": 111,
|
||||
"西瓜(代表值)": 112,
|
||||
"西芹[西洋芹菜,美芹]WP2026031100069": 113,
|
||||
"西葫芦WP2026021000027": 114,
|
||||
"豆腐干(代表值)": 115,
|
||||
"豆腐皮WP2026031700097": 116,
|
||||
"豆角豇豆WP2026021000026": 117,
|
||||
"赤小豆[小豆,红小豆](干)WP2026032300118": 118,
|
||||
"辣椒(红,小)WP2025111000066": 119,
|
||||
"辣椒(青,尖)WP2026030600056": 120,
|
||||
"辣椒段(干)": 121,
|
||||
"醪糟": 122,
|
||||
"金针菇[(鲜)[智力菇]WP2026030600051": 123,
|
||||
"青线椒WP2026013000031": 124,
|
||||
"青美人椒辣椒(青,尖)": 125,
|
||||
"青花椒鲜花椒": 126,
|
||||
"面条(生,代表值)WP2026030600055": 127,
|
||||
"面条(生,炒细面": 128,
|
||||
"韭菜WP2026020200044": 129,
|
||||
"韭薹": 130,
|
||||
"韭黄": 131,
|
||||
"馒头(代表值)WP2026030600056": 132,
|
||||
"香椿[香椿芽]WP2026022801086": 133,
|
||||
"香菇(鲜)[香蕈,冬菇]WP2026030600050": 134,
|
||||
"香菜WP2026013000030": 135,
|
||||
"马铃薯[土豆、洋芋]WP2026012900001": 136,
|
||||
"鱿鱼(鲜,中国枪乌贼)[枪乌贼]": 137,
|
||||
"鲍鱼(带壳)": 138,
|
||||
"鲑鱼[大马哈鱼,三文鱼]": 139,
|
||||
"鲜猪精排": 140,
|
||||
"鸡全腿(带骨)": 141,
|
||||
"鸡翅(带骨)": 142,
|
||||
"鸡胸脯肉WP2026022802698": 143,
|
||||
"鸡腿肉WP2025110700048": 144,
|
||||
"鸡蛋WP2026013000039": 145,
|
||||
"鸭(均值)": 146,
|
||||
"鸭蛋黄": 147,
|
||||
"黄瓜(鲜)[胡瓜]WP2025110700031": 148,
|
||||
"黄豆": 149,
|
||||
"黄豆芽WP2026020200042": 150,
|
||||
"黑米WP2026031200081": 151,
|
||||
"黑袋子": 152,
|
||||
"黑鱼(整条鱼)WP2025110600012": 153
|
||||
},
|
||||
"idx_to_class": {
|
||||
"0": "三黄鸡",
|
||||
@@ -233,115 +317,157 @@
|
||||
"2": "丝瓜WP2026032300114",
|
||||
"3": "乳瓜WP2026032000107",
|
||||
"4": "冬瓜WP2026032300115",
|
||||
"5": "冰草WP2026020900054",
|
||||
"6": "刀豆",
|
||||
"7": "北豆腐WP2025111900007",
|
||||
"8": "味精WP2026013000034",
|
||||
"9": "圆生菜WP2026020900053",
|
||||
"10": "基围虾WP2025110700019",
|
||||
"11": "多宝鱼WP2025112600011",
|
||||
"12": "大白菜(代表值)WP2026031700085",
|
||||
"13": "大葱WP2026013000026",
|
||||
"14": "大蒜(去皮)WP2026020200011",
|
||||
"15": "大蒜(带皮)WP2026020300046",
|
||||
"16": "姜[黄姜]WP2026022800956",
|
||||
"17": "娃娃菜WP2026020200005",
|
||||
"18": "小白菜WP2026022800031",
|
||||
"19": "小米辣椒WP2026013000027",
|
||||
"20": "小葱WP2026013000029",
|
||||
"21": "山药(带皮)WP2026020200008",
|
||||
"22": "巨人笋",
|
||||
"23": "平菇[糙皮侧耳,青蘑]WP2026031700086",
|
||||
"24": "广东菜心WP2025120100014",
|
||||
"25": "木耳(干)[黑木耳,云耳]WP2026022801182",
|
||||
"26": "杏鲍菇WP2026022700030",
|
||||
"27": "松花蛋",
|
||||
"28": "松茸菌WP2025120100016",
|
||||
"29": "沙葱",
|
||||
"30": "油麦菜WP2026031200077",
|
||||
"31": "海带(浸)[江白菜,昆布]WP2026022800035",
|
||||
"32": "牛腩WP2025110700043",
|
||||
"33": "猪五花肉WP2026020300048",
|
||||
"34": "猪排(带骨)WP2026031200078",
|
||||
"35": "猪肉(腿)WP2026022800033",
|
||||
"36": "猪肉(里脊)WP2026021000025",
|
||||
"37": "猪肝(鲜)WP2026032000105",
|
||||
"38": "玉米WP2025120100017",
|
||||
"39": "玉米糁(黄)WP2026022800038",
|
||||
"40": "甜椒[灯笼椒,柿子椒]WP2026020500018",
|
||||
"41": "生菜(叶用莴苣)WP2026020500020",
|
||||
"42": "番茄[西红柿]WP2026021000028",
|
||||
"43": "白吉饼WP2026013000024",
|
||||
"44": "白玉菇WP2026031100072",
|
||||
"45": "白菜薹[菜薹,菜心]WP2026031100068",
|
||||
"46": "白萝卜WP2026031200079",
|
||||
"47": "笋",
|
||||
"48": "粉丝",
|
||||
"49": "素鸡WP2026031700096",
|
||||
"50": "红心萝卜[心里美]WP2026022800368",
|
||||
"51": "红提子WP2025111900006",
|
||||
"52": "红椒WP2026030300055",
|
||||
"53": "红洋葱WP2026030600054",
|
||||
"54": "红美人椒WP2026020300049",
|
||||
"55": "红薯",
|
||||
"56": "红薯粉条WP2026031700091",
|
||||
"57": "红薯粉条(袋)",
|
||||
"58": "结球甘蓝(紫)[圆白菜]WP2026020500017",
|
||||
"59": "结球甘蓝(绿)[圆白菜]WP2026032300116",
|
||||
"60": "绿豆芽WP2026031100073",
|
||||
"61": "羊排WP2025120300021",
|
||||
"62": "羊血WP2026013000038",
|
||||
"63": "胡萝卜WP2025110600008",
|
||||
"64": "芋头",
|
||||
"65": "花卷",
|
||||
"66": "花生仁(生)WP2026032000102",
|
||||
"67": "芹菜(茎)[旱芹,药芹]WP2026022800032",
|
||||
"68": "苦菊",
|
||||
"69": "苹果(代表值)WP2026032300117",
|
||||
"70": "茄子(紫皮,长)WP2025110700024",
|
||||
"71": "茼蒿WP2026020200045",
|
||||
"72": "荷兰豆WP2026032000104",
|
||||
"73": "莲藕(带皮)",
|
||||
"74": "莴笋(鲜)[莴苣]WP2026020200009",
|
||||
"75": "菜花(白色)[花椰菜]WP2026030600057",
|
||||
"76": "菠菜(鲜)[赤根菜]WP2026022800700",
|
||||
"77": "蒜苗WP2026013000028",
|
||||
"78": "蒜薹(圆)",
|
||||
"79": "蒸鱼豉油WP2026013000032",
|
||||
"80": "薏米[薏仁米,苡米]WP2026022800037",
|
||||
"81": "虫草花(干)WP2026032000108",
|
||||
"82": "西兰花[绿菜花]WP2026031100071",
|
||||
"83": "西芹[西洋芹菜,美芹]WP2026031100069",
|
||||
"84": "西葫芦WP2026021000027",
|
||||
"85": "豆腐皮WP2026031700097",
|
||||
"86": "豆角豇豆WP2026021000026",
|
||||
"87": "赤小豆[小豆,红小豆](干)WP2026032300118",
|
||||
"88": "辣椒(红,小)WP2025111000066",
|
||||
"89": "辣椒(青,尖)WP2026030600056",
|
||||
"90": "醪糟",
|
||||
"91": "金针菇[(鲜)[智力菇]WP2026030600051",
|
||||
"92": "青线椒WP2026013000031",
|
||||
"93": "面条(生,代表值)WP2026030600055",
|
||||
"94": "韭菜WP2026020200044",
|
||||
"95": "韭黄",
|
||||
"96": "馒头(代表值)WP2026030600056",
|
||||
"97": "香椿[香椿芽]WP2026022801086",
|
||||
"98": "香菇(鲜)[香蕈,冬菇]WP2026030600050",
|
||||
"99": "香菜WP2026013000030",
|
||||
"100": "马铃薯[土豆、洋芋]WP2026012900001",
|
||||
"101": "鸡全腿(带骨)",
|
||||
"102": "鸡翅(带骨)",
|
||||
"103": "鸡胸脯肉WP2026022802698",
|
||||
"104": "鸡腿肉WP2025110700048",
|
||||
"105": "鸡腿(带骨)",
|
||||
"106": "鸡蛋WP2026013000039",
|
||||
"107": "黄瓜(鲜)[胡瓜]WP2025110700031",
|
||||
"108": "黄豆芽WP2026020200042",
|
||||
"109": "黑米WP2026031200081",
|
||||
"110": "黑袋子",
|
||||
"111": "黑鱼(整条鱼)WP2025110600012"
|
||||
"5": "冰糖",
|
||||
"6": "冰草WP2026020900054",
|
||||
"7": "刀豆",
|
||||
"8": "北豆腐WP2025111900007",
|
||||
"9": "南瓜[倭瓜,番瓜]",
|
||||
"10": "味精WP2026013000034",
|
||||
"11": "圆生菜WP2026020900053",
|
||||
"12": "基围虾WP2025110700019",
|
||||
"13": "多宝鱼WP2025112600011",
|
||||
"14": "大白菜(代表值)WP2026031700085",
|
||||
"15": "大葱WP2026013000026",
|
||||
"16": "大蒜(去皮)WP2026020200011",
|
||||
"17": "大蒜(带皮)WP2026020300046",
|
||||
"18": "奶白菜",
|
||||
"19": "姜(子姜)[嫩姜]",
|
||||
"20": "姜[黄姜]WP2026022800956",
|
||||
"21": "娃娃菜WP2026020200005",
|
||||
"22": "小白菜WP2026022800031",
|
||||
"23": "小米辣椒WP2026013000027",
|
||||
"24": "小葱WP2026013000029",
|
||||
"25": "小鸡腿(带骨)",
|
||||
"26": "山药(带皮)WP2026020200008",
|
||||
"27": "巨人笋",
|
||||
"28": "平菇[糙皮侧耳,青蘑]WP2026031700086",
|
||||
"29": "广东菜心WP2025120100014",
|
||||
"30": "新世纪哈密瓜",
|
||||
"31": "明虾",
|
||||
"32": "木耳(干)[黑木耳,云耳]WP2026022801182",
|
||||
"33": "杏鲍菇WP2026022700030",
|
||||
"34": "松花蛋",
|
||||
"35": "松茸菌WP2025120100016",
|
||||
"36": "槐花[洋槐花,豆槐花]",
|
||||
"37": "橙",
|
||||
"38": "沙葱",
|
||||
"39": "油麦菜WP2026031200077",
|
||||
"40": "海带(浸)[江白菜,昆布]WP2026022800035",
|
||||
"41": "淀粉(马铃薯)",
|
||||
"42": "湿米线过桥米线",
|
||||
"43": "火龙果(带皮)",
|
||||
"44": "炒饼丝",
|
||||
"45": "牛肉(腹部肉)[牛腩]",
|
||||
"46": "牛肚",
|
||||
"47": "牛腩WP2025110700043",
|
||||
"48": "猪五花肉WP2026020300048",
|
||||
"49": "猪小排(带骨)",
|
||||
"50": "猪排(带骨)WP2026031200078",
|
||||
"51": "猪肉(瘦)",
|
||||
"52": "猪肉(腿)WP2026022800033",
|
||||
"53": "猪肉(里脊)WP2026021000025",
|
||||
"54": "猪肝(鲜)WP2026032000105",
|
||||
"55": "猪肾(fat8g)[猪腰子]",
|
||||
"56": "玉米WP2025120100017",
|
||||
"57": "玉米糁(黄)WP2026022800038",
|
||||
"58": "甜椒[灯笼椒,柿子椒]WP2026020500018",
|
||||
"59": "生菜(叶用莴苣)WP2026020500020",
|
||||
"60": "生蚝",
|
||||
"61": "番茄[西红柿]WP2026021000028",
|
||||
"62": "白吉饼WP2026013000024",
|
||||
"63": "白玉菇WP2026031100072",
|
||||
"64": "白菜薹[菜薹,菜心]WP2026031100068",
|
||||
"65": "白萝卜WP2026031200079",
|
||||
"66": "石斑鱼(整条鱼)",
|
||||
"67": "笋",
|
||||
"68": "粉丝",
|
||||
"69": "素鸡WP2026031700096",
|
||||
"70": "红心萝卜[心里美]WP2026022800368",
|
||||
"71": "红提子WP2025111900006",
|
||||
"72": "红椒WP2026030300055",
|
||||
"73": "红洋葱WP2026030600054",
|
||||
"74": "红美人椒WP2026020300049",
|
||||
"75": "红薯",
|
||||
"76": "红薯粉条WP2026031700091",
|
||||
"77": "红薯粉条(袋)",
|
||||
"78": "结球甘蓝(紫)[圆白菜]WP2026020500017",
|
||||
"79": "结球甘蓝(绿)[圆白菜]WP2026032300116",
|
||||
"80": "绿豆芽WP2026031100073",
|
||||
"81": "羊排WP2025120300021",
|
||||
"82": "羊血WP2026013000038",
|
||||
"83": "胡萝卜WP2025110600008",
|
||||
"84": "腰果(熟)",
|
||||
"85": "芋头",
|
||||
"86": "芥蓝[甘蓝菜,盖蓝菜]",
|
||||
"87": "芦笋(绿)[石刁柏,龙须菜]",
|
||||
"88": "花卷",
|
||||
"89": "花椒(粉)",
|
||||
"90": "花生仁(生)WP2026032000102",
|
||||
"91": "花螺",
|
||||
"92": "芹菜(茎)[旱芹,药芹]WP2026022800032",
|
||||
"93": "苦菊",
|
||||
"94": "苹果(代表值)WP2026032300117",
|
||||
"95": "茄子(紫皮,长)WP2025110700024",
|
||||
"96": "茼蒿WP2026020200045",
|
||||
"97": "草鱼",
|
||||
"98": "荷兰豆WP2026032000104",
|
||||
"99": "莲藕(带皮)",
|
||||
"100": "莴笋(鲜)[莴苣]WP2026020200009",
|
||||
"101": "菜花(白色)[花椰菜]WP2026030600057",
|
||||
"102": "菠菜(鲜)[赤根菜]WP2026022800700",
|
||||
"103": "菠萝[凤梨,地菠萝]",
|
||||
"104": "蒜苗WP2026013000028",
|
||||
"105": "蒜薹(圆)",
|
||||
"106": "蒸鱼豉油WP2026013000032",
|
||||
"107": "蕹菜[空心菜,藤藤菜]",
|
||||
"108": "薏米[薏仁米,苡米]WP2026022800037",
|
||||
"109": "虫草花(干)WP2026032000108",
|
||||
"110": "蛏子",
|
||||
"111": "西兰花[绿菜花]WP2026031100071",
|
||||
"112": "西瓜(代表值)",
|
||||
"113": "西芹[西洋芹菜,美芹]WP2026031100069",
|
||||
"114": "西葫芦WP2026021000027",
|
||||
"115": "豆腐干(代表值)",
|
||||
"116": "豆腐皮WP2026031700097",
|
||||
"117": "豆角豇豆WP2026021000026",
|
||||
"118": "赤小豆[小豆,红小豆](干)WP2026032300118",
|
||||
"119": "辣椒(红,小)WP2025111000066",
|
||||
"120": "辣椒(青,尖)WP2026030600056",
|
||||
"121": "辣椒段(干)",
|
||||
"122": "醪糟",
|
||||
"123": "金针菇[(鲜)[智力菇]WP2026030600051",
|
||||
"124": "青线椒WP2026013000031",
|
||||
"125": "青美人椒辣椒(青,尖)",
|
||||
"126": "青花椒鲜花椒",
|
||||
"127": "面条(生,代表值)WP2026030600055",
|
||||
"128": "面条(生,炒细面",
|
||||
"129": "韭菜WP2026020200044",
|
||||
"130": "韭薹",
|
||||
"131": "韭黄",
|
||||
"132": "馒头(代表值)WP2026030600056",
|
||||
"133": "香椿[香椿芽]WP2026022801086",
|
||||
"134": "香菇(鲜)[香蕈,冬菇]WP2026030600050",
|
||||
"135": "香菜WP2026013000030",
|
||||
"136": "马铃薯[土豆、洋芋]WP2026012900001",
|
||||
"137": "鱿鱼(鲜,中国枪乌贼)[枪乌贼]",
|
||||
"138": "鲍鱼(带壳)",
|
||||
"139": "鲑鱼[大马哈鱼,三文鱼]",
|
||||
"140": "鲜猪精排",
|
||||
"141": "鸡全腿(带骨)",
|
||||
"142": "鸡翅(带骨)",
|
||||
"143": "鸡胸脯肉WP2026022802698",
|
||||
"144": "鸡腿肉WP2025110700048",
|
||||
"145": "鸡蛋WP2026013000039",
|
||||
"146": "鸭(均值)",
|
||||
"147": "鸭蛋黄",
|
||||
"148": "黄瓜(鲜)[胡瓜]WP2025110700031",
|
||||
"149": "黄豆",
|
||||
"150": "黄豆芽WP2026020200042",
|
||||
"151": "黑米WP2026031200081",
|
||||
"152": "黑袋子",
|
||||
"153": "黑鱼(整条鱼)WP2025110600012"
|
||||
},
|
||||
"embedding_dim": 512,
|
||||
"total_images": 2575,
|
||||
"build_time": "2026-03-26T09:07:01.309292"
|
||||
"total_images": 3180,
|
||||
"build_time": "2026-04-27T14:13:11.594418"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -50,6 +50,7 @@ import com.sw.inbound.utils.ext.toJsonString
|
||||
import com.sw.inbound.utils.ext.toast
|
||||
import com.sw.inbound.utils.ext.visible
|
||||
import com.sw.inbound.viewmodel.ReceiptViewModel
|
||||
import com.sw.inbound.viewmodel.UserViewModel
|
||||
import dagger.hilt.android.AndroidEntryPoint
|
||||
import io.objectbox.exception.DbException
|
||||
import io.objectbox.exception.FileCorruptException
|
||||
@@ -78,8 +79,8 @@ class FoodCollectionActivity : BaseActivity() {
|
||||
private lateinit var binding: ActivityFoodCollectionBinding
|
||||
private lateinit var previewView: PreviewView
|
||||
|
||||
private val viewModel: ReceiptViewModel by viewModels()
|
||||
|
||||
private val receiptViewModel: ReceiptViewModel by viewModels()
|
||||
val userViewModel: UserViewModel by viewModels()
|
||||
private val cameraUtils: CameraUtils by lazy {
|
||||
CameraUtils(this)
|
||||
}
|
||||
@@ -517,7 +518,7 @@ class FoodCollectionActivity : BaseActivity() {
|
||||
// 取消上一次未完成的搜索,避免并发竞争导致结果乱序
|
||||
searchJob?.cancel()
|
||||
searchJob = lifecycleScope.launch {
|
||||
val records = viewModel.searchGoodsInfoList2(
|
||||
val records = receiptViewModel.searchGoodsInfoList2(
|
||||
goodsName = searchName,
|
||||
pageNo = pageNo,
|
||||
pageSize = pageSize
|
||||
@@ -549,7 +550,7 @@ class FoodCollectionActivity : BaseActivity() {
|
||||
totalList = collectList,
|
||||
uploadImage = { batch ->
|
||||
val files = batch.map { it.imageFile }
|
||||
viewModel.uploadMultipleImages(files = files, params)
|
||||
receiptViewModel.uploadMultipleImages(files = files, params)
|
||||
},
|
||||
onProgress = { count, batch ->
|
||||
// lifecycleScope 默认在主线程执行,无需 runOnUiThread
|
||||
@@ -585,7 +586,7 @@ class FoodCollectionActivity : BaseActivity() {
|
||||
pageSize: Int = 10
|
||||
): List<SearchGoodsInfo.Record> {
|
||||
// 统一使用类顶部声明的 viewModel,避免重复创建 ViewModel 实例
|
||||
return viewModel.searchGoodsInfoList2(goodsName, pageNo, pageSize)
|
||||
return receiptViewModel.searchGoodsInfoList2(goodsName, pageNo, pageSize)
|
||||
}
|
||||
|
||||
private var mDialogWaiting: CustomDialog? = null
|
||||
|
||||
@@ -146,7 +146,7 @@ class InitActivity : BaseActivity() {
|
||||
GlobalData.appBaseUrl = savedUrl
|
||||
} else {
|
||||
// 未保存过则使用默认逻辑:特定设备走测试环境,其余走 UAT
|
||||
GlobalData.appBaseUrl = GlobalData.UAT_BASE_URL
|
||||
GlobalData.appBaseUrl = GlobalData.PROD_BASE_URL
|
||||
val list = listOf(
|
||||
//"5a41a2cf-3cee-3731-911d-a28b10164f7a",
|
||||
"f0bcabbb-0d58-3b14-8bed-9863b7ec61ef"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.sw.inbound.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Dialog
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
@@ -9,11 +10,11 @@ import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.sw.inbound.base.BaseActivity
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import coil.load
|
||||
import com.chad.library.adapter4.BaseQuickAdapter
|
||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||
import com.sw.inbound.base.BaseActivity
|
||||
import com.sw.inbound.databinding.ActivityLocalImagePreviewBinding
|
||||
import com.sw.inbound.databinding.DialogImageFullPreviewBinding
|
||||
import com.sw.inbound.databinding.ListItemImagePreviewBinding
|
||||
@@ -23,6 +24,8 @@ import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
import java.io.File
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Date
|
||||
|
||||
class LocalImagePreviewActivity : BaseActivity() {
|
||||
|
||||
@@ -57,7 +60,7 @@ class LocalImagePreviewActivity : BaseActivity() {
|
||||
val nameWithoutExt = it.nameWithoutExtension
|
||||
// 兼容 IMG_CROP_{时间戳} 和其他命名格式
|
||||
val displayName = if (nameWithoutExt.startsWith("IMG_CROP_")) {
|
||||
nameWithoutExt.removePrefix("IMG_CROP_")
|
||||
df.format(Date(nameWithoutExt.removePrefix("IMG_CROP_").toLong()))
|
||||
} else {
|
||||
nameWithoutExt
|
||||
}
|
||||
@@ -74,6 +77,9 @@ class LocalImagePreviewActivity : BaseActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("SimpleDateFormat")
|
||||
private val df = SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
/** 弹出全屏大图预览 Dialog,支持左右切换 */
|
||||
private fun showFullImagePreview(startPosition: Int) {
|
||||
var currentIndex = startPosition
|
||||
|
||||
@@ -8,12 +8,13 @@ import androidx.core.graphics.toColorInt
|
||||
import com.chad.library.adapter4.BaseQuickAdapter
|
||||
import com.chad.library.adapter4.viewholder.QuickViewHolder
|
||||
import com.sw.inbound.databinding.ListItemCollectSearchBinding
|
||||
import com.sw.inbound.model.response.CollectedFoodInfo
|
||||
import com.sw.inbound.model.response.SearchGoodsInfo
|
||||
import com.sw.inbound.utils.ext.dp
|
||||
import com.sw.inbound.utils.ext.setShapeDrawable
|
||||
|
||||
class CollectSearchAdapter(var list: MutableList<SearchGoodsInfo.Record>) :
|
||||
BaseQuickAdapter<SearchGoodsInfo.Record, CollectSearchAdapter.VH>(list) {
|
||||
class CollectSearchAdapter(var list: MutableList<CollectedFoodInfo>) :
|
||||
BaseQuickAdapter<CollectedFoodInfo, CollectSearchAdapter.VH>(list) {
|
||||
|
||||
inner class VH(var binding: ListItemCollectSearchBinding) : QuickViewHolder(binding.root)
|
||||
|
||||
@@ -23,19 +24,20 @@ class CollectSearchAdapter(var list: MutableList<SearchGoodsInfo.Record>) :
|
||||
return VH(binding)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(holder: VH, position: Int, item: SearchGoodsInfo.Record?) {
|
||||
override fun onBindViewHolder(holder: VH, position: Int, item: CollectedFoodInfo?) {
|
||||
holder.binding.let {
|
||||
var goodsName = item!!.goodsName?.split("WP")?.get(0)
|
||||
val goodsName = item!!.foodName.split("WP")[0]
|
||||
// if (goodsName?.contains("\n") == true) {
|
||||
// goodsName = goodsName?.split("\n")?.get(0)
|
||||
// }
|
||||
it.tvGoodsName.run {
|
||||
text = Html.fromHtml(goodsName)
|
||||
setTextColor(if (item!!.isSelected) "#FF0032C8".toColorInt() else "#FF666666".toColorInt())
|
||||
setTextColor(if (item.isSelected) "#FF0032C8".toColorInt() else "#FF666666".toColorInt())
|
||||
//setTextColor("#FF666666".toColorInt())
|
||||
}
|
||||
it.tvGoodsNum.text = "已采集${item.foodNum}"
|
||||
it.root.run {
|
||||
if (item!!.isSelected) {
|
||||
if (item.isSelected) {
|
||||
setShapeDrawable(
|
||||
solidColor = "#FFEAF0FF",
|
||||
strokeColor = "#FF0033CC",
|
||||
|
||||
@@ -5,7 +5,9 @@ import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import androidx.core.widget.addTextChangedListener
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.lifecycle.repeatOnLifecycle
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.sw.inbound.R
|
||||
@@ -13,6 +15,7 @@ import com.sw.inbound.activity.FoodCollectionActivity
|
||||
import com.sw.inbound.adapter.CollectSearchAdapter
|
||||
import com.sw.inbound.databinding.DialogCollectSearchBinding
|
||||
import com.sw.inbound.databinding.LayoutEmptySearchBinding
|
||||
import com.sw.inbound.model.response.CollectedFoodInfo
|
||||
import com.sw.inbound.model.response.SearchGoodsInfo
|
||||
import com.sw.inbound.objbox.ObjectBox
|
||||
import com.sw.inbound.utils.ext.addOnActionSearchListener
|
||||
@@ -28,6 +31,32 @@ class CollectSearchDialog(
|
||||
private lateinit var inflater: LayoutInflater
|
||||
private var emptyBinding: LayoutEmptySearchBinding? = null
|
||||
private lateinit var binding: DialogCollectSearchBinding
|
||||
|
||||
/**
|
||||
* 收集 searchFoodState
|
||||
*/
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun initObserver() {
|
||||
activity?.run {
|
||||
lifecycleScope.launch {
|
||||
repeatOnLifecycle(Lifecycle.State.STARTED) {
|
||||
userViewModel.collectedFoodListState.collect { items ->
|
||||
binding.rvSearch.layoutManager =
|
||||
GridLayoutManager(activity, 2, LinearLayoutManager.VERTICAL, false)
|
||||
list.clear()
|
||||
list.addAll(items)
|
||||
searchAdapter.notifyDataSetChanged()
|
||||
finishRefresh()
|
||||
binding.root.hideKeyboard()
|
||||
if (items.isEmpty()) {
|
||||
loadEmptyView()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getRootView(): View {
|
||||
inflater = LayoutInflater.from(context)
|
||||
binding = DialogCollectSearchBinding.inflate(inflater)
|
||||
@@ -82,23 +111,14 @@ class CollectSearchDialog(
|
||||
this@CollectSearchDialog.clickIndex = -1
|
||||
val searchName = binding.etInputGoods.text.toString().trim()
|
||||
getCollectGoods(searchName)
|
||||
}
|
||||
//it.setOnLoadMoreListener {
|
||||
// searchGoods()
|
||||
//}
|
||||
}
|
||||
getCollectGoods()
|
||||
//binding.root.clickWithDebounce {
|
||||
// Thread {
|
||||
// FoodModule.initDefFoodData(activity!!) {
|
||||
// activity?.runOnUiThread {
|
||||
// activity?.toast("添加完成")
|
||||
// getCollectGoods()
|
||||
// }
|
||||
// }
|
||||
// }.start()
|
||||
//}
|
||||
|
||||
binding.root.postDelayed({
|
||||
finishRefresh()
|
||||
}, 1000)
|
||||
}
|
||||
}
|
||||
initObserver()
|
||||
getCollectGoods()
|
||||
}
|
||||
|
||||
private var pageNo = 1
|
||||
@@ -118,17 +138,17 @@ class CollectSearchDialog(
|
||||
|
||||
private var clickIndex = -1
|
||||
|
||||
private val list: MutableList<SearchGoodsInfo.Record> = mutableListOf()
|
||||
private val list: MutableList<CollectedFoodInfo> = mutableListOf()
|
||||
private val searchAdapter by lazy {
|
||||
CollectSearchAdapter(list).apply {
|
||||
isStateViewEnable = true
|
||||
setOnItemClickListener { _, _, position ->
|
||||
activity?.lifecycleScope?.launch {
|
||||
val goodsName = list[position].goodsName?:""
|
||||
val count = ObjectBox.countNameField(goodsName)
|
||||
activity?.toast("已采集数据${count}条")
|
||||
}
|
||||
}
|
||||
// setOnItemClickListener { _, _, position ->
|
||||
// activity?.lifecycleScope?.launch {
|
||||
// val goodsName = list[position].goodsName?:""
|
||||
// val count = ObjectBox.countNameField(goodsName)
|
||||
// activity?.toast("已采集数据${count}条")
|
||||
// }
|
||||
// }
|
||||
addOnItemChildClickListener(R.id.ivDelete) { _, _, position ->
|
||||
this@CollectSearchDialog.clickIndex = position
|
||||
list.forEach { item ->
|
||||
@@ -144,46 +164,24 @@ class CollectSearchDialog(
|
||||
}
|
||||
|
||||
private fun showDeleteDialog(position: Int, deleteAction: () -> Unit = {}) {
|
||||
val foodName = list[position].foodName
|
||||
WarnDialog(
|
||||
context = context,
|
||||
content = "请确认是否删除物品:${list[position].goodsName?.split("WP")?.get(0)}?",
|
||||
content = "请确认是否删除物品:${foodName.split("WP").first()}?",
|
||||
cancelBlock = {
|
||||
this@CollectSearchDialog.clickIndex = -1
|
||||
list[position].isSelected = false
|
||||
searchAdapter.notifyItemChanged(position)
|
||||
},
|
||||
confirmBlock = {
|
||||
// Thread {
|
||||
// }.start()
|
||||
activity?.lifecycleScope?.launch {
|
||||
deleteGoods(position, deleteAction)
|
||||
}
|
||||
activity?.userViewModel?.removeCollectedFood(
|
||||
foodName = foodName,
|
||||
nameFilter = binding.etInputGoods.text.toString().trim()
|
||||
)
|
||||
deleteAction()
|
||||
}).show()
|
||||
}
|
||||
|
||||
private suspend fun deleteGoods(position: Int, deleteAction: () -> Unit = {}) {
|
||||
activity?.runOnUiThread {
|
||||
Loading.show(activity!!)
|
||||
}
|
||||
val name = list[position].goodsName ?: ""
|
||||
// val filterIdList = box?.all?.filter { it.name == name }?.map { it.id }
|
||||
// ObjectBox.boxStore.runInTx {
|
||||
// box?.removeByIds(filterIdList)
|
||||
// }
|
||||
ObjectBox.remove(name)
|
||||
activity?.runOnUiThread {
|
||||
Loading.dismiss()
|
||||
//list.remove(list[position])
|
||||
//searchAdapter.notifyDataSetChanged()
|
||||
searchAdapter.removeAt(position)
|
||||
activity?.toast("删除成功")
|
||||
if (list.isEmpty()) {
|
||||
loadEmptyView()
|
||||
}
|
||||
deleteAction()
|
||||
}
|
||||
}
|
||||
|
||||
private fun finishRefresh() {
|
||||
binding.refreshLayout.let {
|
||||
if (pageNo == 1) {
|
||||
@@ -197,27 +195,8 @@ class CollectSearchDialog(
|
||||
// private var box: Box<Food>? = null
|
||||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun getCollectGoods(searchName: String? = null) = activity?.lifecycleScope?.launch {
|
||||
// if (box == null) {
|
||||
// box = ObjectBox.boxStore.boxFor(Food::class)
|
||||
// }
|
||||
list.clear()
|
||||
// var queryList = box?.all?.distinctBy { it.name }
|
||||
// if (searchName.isNullOrBlank().not()) {
|
||||
// queryList = queryList?.filter { it.name?.contains(searchName!!) == true }
|
||||
// }
|
||||
val queryList = ObjectBox.filter(searchName)
|
||||
queryList?.forEach {
|
||||
list.add((SearchGoodsInfo.Record(goodsName = it.name)))
|
||||
}
|
||||
binding.rvSearch.layoutManager =
|
||||
GridLayoutManager(activity, 2, LinearLayoutManager.VERTICAL, false)
|
||||
searchAdapter.notifyDataSetChanged()
|
||||
if (list.isEmpty()) {
|
||||
loadEmptyView()
|
||||
}
|
||||
finishRefresh()
|
||||
binding.root.hideKeyboard()
|
||||
private fun getCollectGoods(name: String? = null) {
|
||||
activity?.userViewModel?.loadCollectedFoodList(nameFilter = name)
|
||||
}
|
||||
|
||||
// fun test() {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.sw.inbound.model.request
|
||||
|
||||
import android.os.Parcelable
|
||||
import com.sw.inbound.model.response.BaseBean
|
||||
import com.sw.inbound.model.response.GoodsInfo
|
||||
import kotlinx.parcelize.Parcelize
|
||||
import java.math.BigDecimal
|
||||
@@ -90,6 +89,6 @@ private data class UploadGoodsInfo(
|
||||
|
||||
// 已调整
|
||||
var isAdjusted: Boolean = false
|
||||
) : Parcelable, BaseBean() {
|
||||
) : Parcelable {
|
||||
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
open class BaseBean() {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.sw.inbound.model.response
|
||||
|
||||
data class CollectedFoodInfo(
|
||||
var foodName: String,
|
||||
var foodNum: Int,
|
||||
var isSelected: Boolean = false
|
||||
)
|
||||
@@ -117,7 +117,7 @@ data class GoodsInfo(
|
||||
var buyToInventoryValue:String?="",
|
||||
|
||||
//--------------------------------------------------------
|
||||
) : Parcelable, BaseBean() {
|
||||
) : Parcelable {
|
||||
|
||||
val goodNameStr: String
|
||||
get() {
|
||||
|
||||
@@ -31,6 +31,6 @@ data class PurchaseInfo(
|
||||
var receiveGoodsInfoList: List<GoodsInfo> = emptyList<GoodsInfo>(),
|
||||
// 自用
|
||||
var warehouseName: String = "选择仓库"
|
||||
) : BaseBean() {
|
||||
) {
|
||||
|
||||
}
|
||||
|
||||
@@ -209,6 +209,31 @@ object ObjectBox {
|
||||
} ?: emptyList()
|
||||
}
|
||||
|
||||
/**
|
||||
* 按名称分组统计采集数量
|
||||
* 使用属性查询只加载 name 字段,不加载 foodVector,节省大量内存
|
||||
* @param nameFilter 名称过滤关键词,为空时查询全部
|
||||
* @return 按名称分组后的 (名称, 数量) 列表,按名称排序
|
||||
*/
|
||||
suspend fun queryFoodNameCounts(nameFilter: String? = null) = safeDbOp {
|
||||
val box = getBox<Food>() ?: return@safeDbOp emptyList<Pair<String, Int>>()
|
||||
val query = if (!nameFilter.isNullOrBlank()) {
|
||||
box.query(Food_.name.contains(nameFilter)).build()
|
||||
} else {
|
||||
box.query().build()
|
||||
}
|
||||
try {
|
||||
// 只查 name 字段,完全不加载 foodVector
|
||||
query.property(Food_.name).findStrings()
|
||||
.groupingBy { it }
|
||||
.eachCount()
|
||||
.map { (name, count) -> Pair(name, count) }
|
||||
.sortedBy { it.first }
|
||||
} finally {
|
||||
query.close()
|
||||
}
|
||||
} ?: emptyList()
|
||||
|
||||
// 使用 QueryBuilder 在数据库层删除,避免全量加载到内存
|
||||
suspend fun remove(name: String) = safeDbOp {
|
||||
getBox<Food>()?.query(Food_.name.equal(name))?.build()?.remove()
|
||||
|
||||
@@ -14,6 +14,7 @@ import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.TypedValue
|
||||
import android.view.TouchDelegate
|
||||
import android.view.View
|
||||
import android.view.inputmethod.EditorInfo
|
||||
import android.view.inputmethod.InputMethodManager
|
||||
@@ -270,3 +271,24 @@ fun String.copyText(context: Context, showToast: Boolean = true) {
|
||||
Toast.makeText(context, "文本已复制到剪贴板", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扩大 View 的点击区域
|
||||
* @param horizontal 水平方向扩大距离(dp)→ 左右各扩大一半
|
||||
* @param vertical 垂直方向扩大距离(dp)→ 上下各扩大一半
|
||||
*/
|
||||
fun View.expandClickArea(horizontal: Int, vertical: Int) {
|
||||
val density = resources.displayMetrics.density
|
||||
val hPx = (horizontal * density).toInt()
|
||||
val vPx = (vertical * density).toInt()
|
||||
|
||||
post {
|
||||
val rect = android.graphics.Rect()
|
||||
getHitRect(rect)
|
||||
|
||||
// 扩大区域:负值 = 向外扩大
|
||||
rect.inset(-hPx, -vPx)
|
||||
//rect.bottom += downPx // 只往下扩大
|
||||
(parent as View).touchDelegate = TouchDelegate(rect, this)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
package com.sw.inbound.viewmodel
|
||||
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.sw.inbound.GlobalData
|
||||
import com.sw.inbound.GlobalKey
|
||||
import com.sw.inbound.model.request.LoginParam
|
||||
import com.sw.inbound.model.response.CollectedFoodInfo
|
||||
import com.sw.inbound.model.response.User
|
||||
import com.sw.inbound.objbox.ObjectBox
|
||||
import com.sw.inbound.repository.RemoteRepository
|
||||
import com.sw.inbound.utils.GsonUtils
|
||||
import com.sw.inbound.utils.SPUtil
|
||||
import dagger.hilt.android.lifecycle.HiltViewModel
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import kotlinx.coroutines.flow.asStateFlow
|
||||
import kotlinx.coroutines.launch
|
||||
import timber.log.Timber
|
||||
import javax.inject.Inject
|
||||
import kotlin.collections.remove
|
||||
|
||||
@HiltViewModel
|
||||
class UserViewModel @Inject constructor(
|
||||
@@ -64,6 +70,39 @@ class UserViewModel @Inject constructor(
|
||||
SPUtil.getInstance().remove(GlobalKey.KEY_TOKEN)
|
||||
}
|
||||
|
||||
/**
|
||||
* 已采集食材列表 UI 状态流
|
||||
* 元素为按名称分组后的(名称,数量)数据
|
||||
*/
|
||||
private val _collectedFoodListState = MutableStateFlow<List<CollectedFoodInfo>>(emptyList())
|
||||
val collectedFoodListState: StateFlow<List<CollectedFoodInfo>> = _collectedFoodListState.asStateFlow()
|
||||
|
||||
/**
|
||||
* 加载已采集食材列表,按名称分组统计数量
|
||||
* 使用属性查询只读 name 字段,不加载 foodVector,节省内存
|
||||
* @param nameFilter 名称过滤关键词,为空时加载全部
|
||||
*/
|
||||
fun loadCollectedFoodList(nameFilter: String? = null) {
|
||||
viewModelScope.launch {
|
||||
val result = ObjectBox.queryFoodNameCounts(nameFilter)
|
||||
_collectedFoodListState.value = result.map { (name, count) ->
|
||||
CollectedFoodInfo(foodName = name, foodNum = count)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定名称的所有采集记录,删除完成后刷新列表
|
||||
* @param foodName 食材名称
|
||||
* @param nameFilter 当前搜索关键词,用于删除后刷新列表
|
||||
*/
|
||||
fun removeCollectedFood(foodName: String, nameFilter: String? = null) {
|
||||
viewModelScope.launch {
|
||||
ObjectBox.remove(foodName)
|
||||
loadCollectedFoodList(nameFilter)
|
||||
}
|
||||
}
|
||||
|
||||
override fun handleSensorScale(weight: Double) {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="240dp"
|
||||
android:height="240dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
|
||||
<!-- 由小到大排列的圆点,构成旋转加载指示器 -->
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M876.864,782.592c3.264,0 6.272,-3.2 6.272,-6.656c0,-3.456 -3.008,-6.592 -6.272,-6.592c-3.264,0 -6.272,3.2 -6.272,6.592c0,3.456 3.008,6.656 6.272,6.656z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M736.32,935.936c2.304,2.432 5.568,3.84 8.768,3.84a12.16,12.16 0,0 0,8.832 -3.84a13.76,13.76 0,0 0,0 -18.56a12.224,12.224 0,0 0,-8.832 -3.84a12.16,12.16 0,0 0,-8.768 3.84a13.696,13.696 0,0 0,0 18.56z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M552.32,1018.24c3.456,3.648 8.32,5.76 13.184,5.76a18.368,18.368 0,0 0,13.184 -5.76a20.608,20.608 0,0 0,0 -27.968a18.368,18.368 0,0 0,-13.184 -5.824a18.368,18.368 0,0 0,-13.184 5.76a20.608,20.608 0,0 0,0 28.032z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M353.984,1012.48c4.608,4.8 11.072,7.68 17.6,7.68a24.448,24.448 0,0 0,17.536 -7.68a27.456,27.456 0,0 0,0 -37.248a24.448,24.448 0,0 0,-17.536 -7.68a24.448,24.448 0,0 0,-17.6 7.68a27.52,27.52 0,0 0,0 37.184z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M178.304,920.64c5.76,6.08 13.824,9.6 21.952,9.6a30.592,30.592 0,0 0,22.016 -9.6a34.368,34.368 0,0 0,0 -46.592a30.592,30.592 0,0 0,-22.016 -9.6a30.592,30.592 0,0 0,-21.952 9.6a34.368,34.368 0,0 0,0 46.592z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M57.152,761.28c6.912,7.36 16.64,11.648 26.368,11.648a36.736,36.736 0,0 0,26.432 -11.584a41.28,41.28 0,0 0,0 -55.936a36.736,36.736 0,0 0,-26.432 -11.584a36.8,36.8 0,0 0,-26.368 11.52a41.28,41.28 0,0 0,0 56z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M12.736,564.672a42.88,42.88 0,0 0,30.784 13.44a42.88,42.88 0,0 0,30.784 -13.44a48.128,48.128 0,0 0,0 -65.216a42.88,42.88 0,0 0,-30.72 -13.44a42.88,42.88 0,0 0,-30.848 13.44a48.128,48.128 0,0 0,0 65.216z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M52.544,369.28a48.96,48.96 0,0 0,35.2 15.36a48.96,48.96 0,0 0,35.2 -15.36a54.976,54.976 0,0 0,0 -74.56a48.96,48.96 0,0 0,-35.2 -15.424a48.96,48.96 0,0 0,-35.2 15.424a54.976,54.976 0,0 0,0 74.56z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M168.32,212.48c10.368,11.008 24.96,17.408 39.68,17.408c14.592,0 29.184,-6.4 39.552,-17.408a61.888,61.888 0,0 0,0 -83.84a55.104,55.104 0,0 0,-39.616 -17.408c-14.656,0 -29.248,6.4 -39.616,17.408a61.888,61.888 0,0 0,0 83.84z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M337.344,124.8c11.52,12.16 27.712,19.264 43.968,19.264c16.256,0 32.448,-7.04 43.968,-19.264a68.672,68.672 0,0 0,0 -93.184a61.248,61.248 0,0 0,-43.968 -19.264a61.248,61.248 0,0 0,-43.968 19.264a68.736,68.736 0,0 0,0 93.184z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M526.976,123.712c12.672,13.44 30.528,21.248 48.448,21.248s35.712,-7.808 48.384,-21.248a75.584,75.584 0,0 0,0 -102.464A67.392,67.392 0,0 0,575.36 0c-17.92,0 -35.776,7.808 -48.448,21.248a75.584,75.584 0,0 0,0 102.464z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M700.8,210.304c13.824,14.592 33.28,23.104 52.736,23.104c19.584,0 39.04,-8.512 52.8,-23.104a82.432,82.432 0,0 0,0 -111.744a73.472,73.472 0,0 0,-52.8 -23.168c-19.52,0 -38.912,8.512 -52.736,23.168a82.432,82.432 0,0 0,0 111.744z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M824.832,368.832c14.976,15.872 36.032,25.088 57.216,25.088c21.12,0 42.24,-9.216 57.152,-25.088a89.344,89.344 0,0 0,0 -121.088a79.616,79.616 0,0 0,-57.152 -25.088c-21.184,0 -42.24,9.216 -57.216,25.088a89.344,89.344 0,0 0,0 121.088z" />
|
||||
<path
|
||||
android:fillColor="#262626"
|
||||
android:pathData="M875.264,572.864c16.128,17.088 38.784,27.008 61.632,27.008c22.784,0 45.44,-9.92 61.568,-27.008a96.256,96.256 0,0 0,0 -130.432a85.76,85.76 0,0 0,-61.568 -27.072c-22.848,0 -45.44,9.984 -61.632,27.072a96.192,96.192 0,0 0,0 130.432z" />
|
||||
|
||||
</vector>
|
||||
@@ -20,7 +20,7 @@
|
||||
android:id="@+id/ivLoading"
|
||||
android:layout_width="160dp"
|
||||
android:layout_height="160dp"
|
||||
android:src="@drawable/loading_spinner"
|
||||
android:src="@drawable/loading"
|
||||
android:contentDescription="加载中" />
|
||||
|
||||
<!-- 倒计时文字 -->
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="82dp"
|
||||
android:layout_height="100dp"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_marginVertical="10dp"
|
||||
android:layout_marginHorizontal="20dp"
|
||||
android:orientation="horizontal"
|
||||
@@ -11,23 +12,41 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvGoodsName"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
tools:text="高杆白菜"
|
||||
android:textColor="#ff666666"
|
||||
android:textColor="#ff333333"
|
||||
android:textSize="30sp"
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tvGoodsNum"
|
||||
android:layout_marginStart="30dp"
|
||||
android:maxLines="1"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:ellipsize="end"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvGoodsNum"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:text="已采集100"
|
||||
app:layout_constraintStart_toStartOf="@id/tvGoodsName"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tvGoodsName"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:textColor="#ff666666"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textSize="20sp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivDelete"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:padding="25dp"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:src="@mipmap/ic_close"/>
|
||||
</LinearLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
Reference in New Issue
Block a user