微信小程序 > 微信公开课 > C#商店计费打折小程序
微信小程序,微信公开课,C#商店计费打折小程序

C#商店计费打折小程序

2019-03-12 17:02:19

微信公开课小程序热门讨论「C#商店计费打折小程序」最新回复-应付金额:inputname=textfieldtype=textid=TruePricewidth=30pxmaxlength=10onchange=GetPrice();/打折:selectname=selectid=zheonchange=GetPrice();optionvalue=one一折/optionoptionvalue=five五折/optionoptionvalue=seven七折/optionoptionvalue=eight八折/optionoptionvalue=nine九折/option/select实收金额:inputname=textfield2type=textid=Discountwidth=30pxmaxlength=10/因无开发工具就写了JSscripttype=text/javascriptfunctionGetPrice(){varTruePrice=document.getElementById(TruePrice).value;//应收金额varZhe=document.getElementById(zhe);//打折varcalue=Zhe.options[Zhe.selectedIndex].text;switch(calue){case一折:calue=0.1;break;case五折:calue=0.5;break;case七折:calue=0.7;break;case八折:calue=0.8;break;case九折:calue=0.9;break;}vara=Number(calue)*Number(TruePrice);document.getElementById(Discount).value=a;//实收金额}/script在C#的开发环境中可以在打折这个下拉框的一个Select事件中进行计算
/*方法一 doublesum=0; doublenum1=double.Parse(this.textTotalMoney.Text); doublenum2=double.Parse(this.textZHEKOU.Text); sum=num1*num2/100; this.textFactMoney.Text=sum.ToString();  */ //方法二 this.ShowPrice();privatevoidShowPrice(){ if(this.textTotalMoney.Text==) { this.textTotalMoney.Text=; return; } doubletextBox1=Convert.ToDouble(this.comboBox1.Text); doubleprice=Convert.ToDouble(this.textTotalMoney.Text)*textBox1/10.0; this.textFactMoney.Text=price.ToString();}privatevoidtextTotalMoney_KeyPress(objectsender,KeyPressEventArgse){ if((e.KeyChar0||e.KeyChar9)&&e.KeyChar!=8)//只允许显示数字 { e.Handled=true; }}本回答被提问者采纳 更多有关「C#商店计费打折小程序」的疑问请扫码关注微信公开课+小程序!
标签:微信公开课,小程序
微信小程序,微信公开课,C#商店计费打折小程序

「C#商店计费打折小程序」热议话题订阅

方法1:微信扫描微信公开课小程序码即可订阅热议话题「C#商店计费打折小程序」

方法2:微信搜索微信公开课小程序名称进入,即可订阅热议话题「C#商店计费打折小程序」

方法3:微信网页访问即速商店,长按识别微信公开课小程序码即可订阅热议话题「C#商店计费打折小程序」

微信公开课小程序热议话题「C#商店计费打折小程序」由微信公开课原创摘录于微信小程序商店shop.jisuapp.cn,转载请注明出处。

微信公开课热议话题「C#商店计费打折小程序」由微信公开课开发者向微信用户提供,并对本服务内容、数据资料及其运营行为等真实性、合法性及有效性承担全部责任。