import win.ui;
import win.ui.atom;
import win.ui.statusbar;
import inet.url;
/*DSG{{*/
mainForm = ..win.form( mode="popup";right=784;bottom=286;max=false;text="速卖通售价计算器";border="thin" )
mainForm.add(
static_chengben={ bgcolor=32896;bottom=144;color=0;text="static5";left=472;top=115;font=LOGFONT( h=-14;weight=700 );z=3;right=700;cls="static" };
static6={ notify=1;text="货代折扣";left=15;top=153;transparent=1;bottom=174;right=84;z=19;cls="static" };
static4={ bottom=143;right=436;left=367;top=121;z=11;notify=1;text="总成本";transparent=1;cls="static" };
static3={ bottom=83;right=77;left=19;top=61;z=7;notify=1;text="重量";transparent=1;cls="static" };
static_lirun={ bgcolor=14720;bottom=264;color=0;text="static9";left=474;top=233;font=LOGFONT( h=-14;weight=700 );z=15;right=702;cls="static" };
groupbox={ bottom=108;right=749;left=320;top=-4;text="计算方法";z=20;edge=1;cls="groupbox" };
edit_post={ right=290;bottom=134;text="edit2";left=95;multiline=1;top=99;z=10;edge=1;cls="edit" };
edit_price={ right=291;bottom=44;text="edit";left=96;multiline=1;top=9;z=2;edge=1;cls="edit" };
static8={ bottom=176;right=437;left=368;top=154;z=13;notify=1;text="国际运费";transparent=1;cls="static" };
static={ bottom=135;right=82;left=13;top=106;z=9;notify=1;text="国际运费(KG)";transparent=1;cls="static" };
edit_post_off={ right=292;bottom=181;text="edit";left=97;multiline=1;top=146;z=18;edge=1;cls="edit" };
static2={ bottom=38;right=77;left=19;text="商品价格";top=16;z=6;transparent=1;cls="static" };
static5={ bottom=109;right=772;left=340;text="
总成本=淘宝价格+淘宝运费(10元)+国际运费+挂号费(8)+寄给货代处邮费(10)
国际运费=商品重量(KG)*176
销售价格=((淘宝价格+国际运费)*2+淘宝运费+挂号费+寄给货代运费)/(0.95)
利润=销售价格*0.95-总成本
";top=-2;z=5;transparent=1;cls="static" };
static12={ bottom=259;right=439;left=369;top=237;z=16;notify=1;text="利润";transparent=1;cls="static" };
static7={ bottom=220;right=437;left=368;top=198;z=12;notify=1;text="销售价格";transparent=1;cls="static" };
edit_kg={ right=291;bottom=87;text="edit";left=96;multiline=1;top=52;z=8;edge=1;cls="edit" };
button_set={ bottom=225;text="设定";left=34;top=195;z=17;right=107;cls="button" };
static_yunfei={ bgcolor=12639424;bottom=182;color=0;text="static6";left=470;top=151;font=LOGFONT( h=-14;weight=700 );z=4;right=698;cls="static" };
static_xiaoshoujiage={ bgcolor=10789024;bottom=223;color=0;text="static8";left=471;top=192;font=LOGFONT( h=-14;weight=700 );z=14;right=699;cls="static" };
btn_price={ bottom=225;right=225;left=152;top=195;z=1;text="计算";cls="button" }
)
/*}}*/
init_run = function(){
mainForm.edit_kg.text =1;
mainForm.edit_price.text = 100;
mainForm.edit_post.text = 176;
mainForm.edit_post_off.text = 0.73;
}
var yunfei;
var chengben;
var sale_price;
var sale_price_15
var sale_price_20
count_price =function(){
yunfei = mainForm.edit_post.text*mainForm.edit_kg.text*mainForm.edit_post_off.text;
chengben = mainForm.edit_price.text+10+yunfei+8+10;
sale_price_15 = ((mainForm.edit_price.text+yunfei)*1.5+10+8+10)/0.95
sale_price_20 = ((mainForm.edit_price.text+yunfei)*2.0+10+8+10)/0.95
}
mainForm.button_set.oncommand = function(id,event){
init_run();
}
mainForm.btn_price.oncommand = function(id,event){
count_price();
mainForm["static_chengben"].text =chengben;
mainForm["static_yunfei"].text = yunfei;
mainForm["static_xiaoshoujiage"].text = string.format("%0.2f",sale_price_15/(6.1406))+"$"+"###"+string.format("%0.2f",sale_price_20/(6.1406))+"$"
mainForm["static_lirun"].text = string.format("%0.2f",(sale_price_15*0.95-chengben))+"¥"+"###"+string.format("%0.2f",(sale_price_20*0.95-chengben))+"¥"
}
mainForm.show()
win.loopMessage();