Ver código fonte

继续做智铺子的快速收银

张洋 3 anos atrás
pai
commit
cc86c9d47c

+ 1 - 1
bin/Win32/Debug/zhipuzi_pos_windows/skin/diandan_zhangdanmingxi_item.xml

@@ -3,6 +3,6 @@
 	<HorizontalLayout padding="0,10,0,0">
 		<Label name="name" text=""  height="30" width="100" align="left"/>
 		<Control></Control>
-		<Label name="value" text=""  height="30" width="100" align="right"/>
+		<Label name="value" text=""  height="30" width="150" align="right"/>
 	</HorizontalLayout>
 </Window>

+ 4 - 0
bin/Win32/Debug/zhipuzi_pos_windows/skin/main.xml

@@ -8,6 +8,10 @@
 	<Font id="24" name="微软雅黑" size="24" />
 	<Font id="26" name="微软雅黑" size="26" />
 	<Font id="28" name="微软雅黑" size="28" />	
+	<Font id="30" name="微软雅黑" size="30" />	
+	<Font id="32" name="微软雅黑" size="32" />	
+	<Font id="34" name="微软雅黑" size="34" />
+	<Font id="36" name="微软雅黑" size="36" />
 	
 	<Default shared="true" name="VScrollBar" value="width=&quot;8&quot; showbutton1=&quot;false&quot; showbutton2=&quot;false&quot; thumbnormalimage=&quot;file='scrollbar_shu_line_zhengchang.png' corner='2,2,2,2'&quot; thumbhotimage=&quot;file='scrollbar_shu_line_xuanfu.png' corner='2,2,2,2'&quot; thumbpushedimage=&quot;file='scrollbar_shu_line_dianji.png' corner='2,2,2,2'&quot;" />
     <Default shared="true" name="HScrollBar" value="height=&quot;8&quot; showbutton1=&quot;false&quot; showbutton2=&quot;false&quot; thumbnormalimage=&quot;file='scrollbar_heng_line_zhengchang.png' corner='2,2,2,2'&quot; thumbhotimage=&quot;file='scrollbar_heng_line_xuanfu.png' corner='2,2,2,2'&quot; thumbpushedimage=&quot;file='scrollbar_heng_line_dianji.png' corner='2,2,2,2'&quot;" />

+ 30 - 179
bin/Win32/Debug/zhipuzi_pos_windows/skin/shoukuan_page.xml

@@ -1,191 +1,42 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Window>
-	<DiandanPage>
+	<ShoukuanPage>
 		<HorizontalLayout>
 			<Control width="1" bkcolor="#FFD1D1D1"></Control>
 			
-			<VerticalLayout width="490" bkcolor="#FFFFFFFF">
-				<HorizontalLayout>					
-					<VerticalLayout width="380" padding="0,0,0,0">
-						<HorizontalLayout name="btn_diandan_qingkong" height="60">
-							<Control bkimage="member_login.png" width="32" height="32" padding="10,14,0,0"></Control>
-							<Button name="btn_diandan_member_login" align="left" text="会员登录" height="38" width="100" padding="10,10,10,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-							<Label name="diandan_page_member_info" text="" width="130" height="30" padding="10,10,10,10" visible="false"></Label>
-							<Control></Control>
-							<Button name="btn_diandan_canpaihao" text="输入餐牌号" height="38" width="100" padding="0,10,0,0" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-							<Control width="1" bkcolor="#FFEBE8E8" padding="5,15,15,15"></Control>
-							<Control bkimage="order_delete.png" width="20" height="20" padding="0,20,0,0"></Control>
-							<Button name="btn_diandan_qingkong" text="清空" height="38" width="40" padding="0,10,10,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-						</HorizontalLayout>
-						
-						<HorizontalLayout height="50" bkcolor="#FFF5F5F5">
-							<Control bkimage="beizhu_tishi.png" width="24" height="24" padding="10,13,0,0"></Control>
-							<Label name="diandan_page_label_zhengdanbeizhu" text="整单备注:" height="30" padding="10,10,10,10" textcolor="#FF8D8D8D"></Label>
-						</HorizontalLayout>
-												
-						<List name="list_diandan_cart" padding="0,10,0,0" itemlinecolor="#FF000000" vscrollbar="true">
-							<ListHeader inset="10,0,0,0"/>
-							<ListHeaderItem text="商品" width="220" align="left" />
-							<ListHeaderItem text="数量" width="80" align="center" />
-							<ListHeaderItem text="金额" width="80" align="center" />
-						</List>
-						
-						<HorizontalLayout name="diandan_page_youhui_tishi_layout" height="40" bkcolor="#FFFBEEEE" visible="false">
-							<Label name="diandan_page_youhui_tishi" text="已优惠10元" textcolor="#FFFF3838" padding="15,0,0,0" width="270" hegiht="40"></Label>
-							<Button name="btn_diandan_chakanyouhui" text="查看优惠>" height="30" width="80" padding="5,6,25,0" textcolor="#FF3CB371" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#00FFFFFF"></Button>
-						</HorizontalLayout>
-					</VerticalLayout>
-					
-					<Control width="1" bkcolor="#FFEBE8E8"></Control>
-					
-					<VerticalLayout width="110" padding="0,0,0,0" vscrollbar="true">
-						<Button name="btn_diandan_jia" width="90" height="40" padding="10,50,10,0" text="+" font="24" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						<Button name="btn_diandan_jian" width="90" height="40" padding="10,15,10,0" text="-" font="24" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						<Button name="btn_diandan_shanchu" width="90" height="40" padding="10,15,10,0" text="删除" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						<Button name="btn_diandan_guige" width="90" height="40" padding="10,30,10,0" text="规格/做法" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						
-						<Button name="btn_diandan_dabao" width="90" height="40" padding="10,15,10,0" text="打包" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						
-						<Button name="btn_diandan_cundan" width="90" height="40" padding="10,50,10,0" text="存单" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						<Button name="btn_diandan_qudan" width="90" height="40" padding="10,15,10,0" text="取单" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						
-						<Label name="diandan_page_qudan_num" text="10" mouse="false" width="19" height="19" align="center" textcolor="#FFFFFFFF" bkimage="num_bkg.png" float="true" pos="85,430,104,449" bordercolor="#FFFF0000" bordersize="0"></Label>
-						
-						<Button name="btn_diandan_zhengdanbeizhu" width="90" height="40" padding="10,15,10,0" text="整单备注" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-						
-						<Button name="btn_diandan_qianxiang" width="90" height="40" padding="10,50,10,30" text="打开钱箱" normalimage="file='btn_border_white.png' corner='5,5,5,5'" hotimage="file='btn_border_white_Hover.png' corner='5,5,5,5'" pushedimage="file='btn_border_white_Click.png' corner='5,5,5,5'" />
-					</VerticalLayout>
+			<VerticalLayout width="420" bkcolor="#FFFFFFFF">
+				<Label text="收款金额" heiht="30" padding="40,20,10,10"></Label>
+				
+				<HorizontalLayout height="68">
+					<Button name="shoukuan_page_money_edit" align="left" font="32" width="340" height="68" padding="40,0,40,0" textpadding="10,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF" textcolor="0xFF3CB371"/>
 				</HorizontalLayout>
 				
-				<Control height="1" bkcolor="#FFEBE8E8"></Control>
+				<HorizontalLayout width="340" height="416" bkcolor="#FFF3F3F3" padding="40,50,40,10">
+					<Button name="jianpan_1" text="1" font="0" heiht="60" width="60" float="true" pos="10,10,110,100" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_2" text="2" font="0" heiht="60" width="60" float="true" pos="120,10,220,100" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_3" text="3" font="0" heiht="60" width="60" float="true" pos="230,10,330,100" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					
+					<Button name="jianpan_4" text="4" font="0" heiht="60" width="60" float="true" pos="10,110,110,200" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_5" text="5" font="0" heiht="60" width="60" float="true" pos="120,110,220,200" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_6" text="6" font="0" heiht="60" width="60" float="true" pos="230,110,330,200" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					
+					<Button name="jianpan_7" text="7" font="0" heiht="60" width="60" float="true" pos="10,210,110,300" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_8" text="8" font="0" heiht="60" width="60" float="true" pos="120,210,220,300" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_9" text="9" font="0" heiht="60" width="60" float="true" pos="230,210,330,300" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					
+					<Button name="jianpan_qingkong" text="清空" font="0" heiht="60" width="60" float="true" pos="10,310,110,400" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_0" text="0" font="0" heiht="60" width="60" float="true" pos="120,310,220,400" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+					<Button name="jianpan_dian" text="." font="0" heiht="60" width="60" float="true" pos="230,310,330,400" normalimage="file='shuzi_btn_normal.png' corner='5,5,5,5'" hotimage="file='shuzi_btn_hover.png' corner='5,5,5,5'" pushedimage="file='shuzi_btn_push.png' corner='5,5,5,5'"></Button>
+				</HorizontalLayout>
 				
-				<VerticalLayout height="165" bkcolor="#FFFFFFFF">
-					<HorizontalLayout height="70">
-						<Label name="diandan_page_otherprice" text="" width="260" align="left" padding="15,24,0,0"></Label>
-						<Label name="diandan_page_totalprice" text="总价:¥0.00" font="22" textcolor="#FFFF0000" width="200" align="right" padding="0,0,15,0"></Label>
-					</HorizontalLayout>
-					
-					<HorizontalLayout height="90" name="diandan_pay_layout">
-						<Button name="btn_diandan_weixinzhifu_pay" text="" height="75" width="110" padding="10,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF4242"></Button>
-						<Control bkimage="weixinzhifu_icon.png" width="24" height="22" float="true" pos="56,10,80,32" mouse="false"></Control>
-						<Label text="微信支付/支付宝/云闪付" multiline="true" width="110" height="40" font="14" float="true" pos="11,35,121,75" textcolor="#FFFFFFFF" mouse="false"></Label>
-						
-						<Button name="btn_diandan_huiyuanzhifu_pay" text="" height="75" width="110" padding="10,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF8910"></Button>
-						<Control bkimage="huiyuanzhifu_icon.png" width="26" height="20" float="true" pos="176,12,202,32" mouse="false"></Control>
-						<Label text="会员支付" width="110" height="35" font="14" float="true" pos="159,35,269,70" textcolor="#FFFFFFFF" mouse="false"></Label>
-					
-						<Button name="btn_diandan_xianjinzhifu_pay" text="" height="75" width="110" padding="10,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FF52CB4B"></Button>
-						<Control bkimage="xianjinzhifu_icon.png" width="21" height="24" float="true" pos="297,10,318,34" mouse="false"></Control>
-						<Label text="现金支付" width="110" height="35" font="14" float="true" pos="279,35,389,70" textcolor="#FFFFFFFF" mouse="false"></Label>
-						
-						<Button name="btn_diandan_gengduozhifu_pay" text="" height="75" width="108" padding="10,0,0,15" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFC1C1C1" bkcolor="#FFF7F7F7"></Button>
-						<Control bkimage="gengduozhifu_icon.png" width="21" height="21" float="true" pos="413,10,434,31" mouse="false"></Control>
-						<Label text="更多支付" width="110" height="35" font="14" float="true" pos="394,35,504,70" mouse="false"></Label>
-					</HorizontalLayout>
-					
-					<Button visible="false" name="btn_diandan_jixujiacai" text="继续点单" height="55" padding="20,20,20,15" textcolor="#FFFFFFFF"></Button>
-				</VerticalLayout>
+				<Control></Control>
+				
+				<Label name="errorinfo" text="" width="400" height="26" padding="43,10,10,10" textcolor="#FFFF0000" visible="false" align="center"></Label>
 			</VerticalLayout>
 			
 			<Control width="1" bkcolor="#FFEBE8E8"></Control>
 			
-			<VerticalLayout name="diandan_food_layout">
-				<VerticalLayout name="diandan_fenlei_layout_scrolllayout" vscrollbar="true">
-					<HorizontalLayout name="diandan_fenlei_layout" padding="0,0,0,0" bkcolor="#FFFFFFFF">
-
-					</HorizontalLayout>
-				</VerticalLayout>
-				
-				<TileLayout name="diandan_foodlist" padding="0,0,0,0" inset="15,15,15,15" childpadding="1" itemsize="160,250" vscrollbar="true" hscrollbar="false">
-				
-				</TileLayout>
-				
-				<HorizontalLayout height="70" padding="0,0,0,0" bkcolor="#FFFFFFFF">
-					<Edit name="diandan_food_search_edit" tooltip="请输入商品名字搜索" width="380" height="50" padding="30,10,0,10" textpadding="50,0,50,0" borderround="45,45" bkcolor="#FFECEFED" nativebkcolor="#FFECEFED" />
-					
-					<Label name="diandan_food_search_tishi" text="请输入商品名字搜索" width="120" height="35" font="16" float="true" pos="90,18,425,50" mouse="false"></Label>
-					
-					<Control bkimage="search_icon.png" width="25" height="26" pos="45,23,70,49" float="true"></Control>
-					
-					<Button name="diandan_food_search_clear" visible="false" normalimage="search_clear.png" hotimage="search_clear.png" pushedimage="search_clear.png" bkimage="search_clear.png" width="23" height="23" pos="365,23,68,46" float="true"></Button>
-				</HorizontalLayout>
-			</VerticalLayout>
-			
-			<HorizontalLayout name="diandan_jiesuan_layout" bkcolor="#FFFFFFFF" visible="false" hscrollbar="true">
-				<VerticalLayout width="390">
-					<Label text="选择优惠" width="100" height="58" padding="20,0,0,0" font="20"></Label>
-					
-					<Control height="1" bkcolor="#FFEBE8E8" padding="10,0,10,0"></Control>
-					
-					<HorizontalLayout padding="0,15,0,0" height="48">
-						<Label text="整单折扣:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Button name="diandan_jiesuan_zhekou_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
-						<Label text="%" width="60" height="48" padding="20,0,0,0"></Label>
-					</HorizontalLayout>
-					
-					<HorizontalLayout padding="0,15,0,0" height="48">
-						<Label text="加价:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Button name="diandan_jiesuan_jiajia_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
-						<Label text="元" width="60" height="48" padding="20,0,0,0"></Label>
-					</HorizontalLayout>
-					
-					<HorizontalLayout padding="0,15,0,0" height="48">
-						<Label text="优惠:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Button name="diandan_jiesuan_youhui_value" text="" height="48" width="220" padding="0,0,0,0" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFA9A9A9" bkcolor="#00FFFFFF"></Button>
-						<Label text="元" width="60" height="48" padding="20,0,0,0"></Label>
-					</HorizontalLayout>
-					
-					<HorizontalLayout padding="0,15,0,0" height="48">
-						<Label text="优惠券:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Label name="diandan_jiesuan_youhuiquan_status" text="未使用" width="70" height="48" padding="0,0,0,0"></Label>
-						<Button name="diandan_jiesuan_youhuiquan_btn" text="扫码使用" height="35" width="90" padding="0,6,0,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
-						<Button name="diandan_jiesuan_youhuiquan_btn_cancel" visible="false" text="取消使用" height="35" width="90" padding="15,6,0,0" textcolor="#FFFF6666" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFFF6666" bkcolor="#FFFFFFFF"></Button>
-					</HorizontalLayout>
-					
-					<HorizontalLayout padding="0,15,0,0" height="48">
-						<Label text="商品券:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Label name="diandan_jiesuan_shangpinquan_status" text="未使用" width="70" height="48" padding="0,0,0,0"></Label>
-						<Button name="diandan_jiesuan_shangpinquan_btn" text="扫码使用" height="35" width="90" padding="0,6,0,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
-						<Button name="diandan_jiesuan_shangpinquan_btn_cancel" visible="false" text="取消使用" height="35" width="90" padding="15,6,0,0" textcolor="#FFFF6666" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFFF6666" bkcolor="#FFFFFFFF"></Button>
-					</HorizontalLayout>
-					
-					<HorizontalLayout padding="0,15,0,0" height="48">
-						<Label text="次卡:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Label name="diandan_jiesuan_cika_status" text="未使用" width="70" height="48" padding="0,0,0,0"></Label>
-						<Button name="diandan_jiesuan_cika_btn" text="扫码使用" height="35" width="90" padding="0,6,0,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
-						<Button name="diandan_jiesuan_cika_btn_cancel" visible="false" text="取消使用" height="35" width="90" padding="15,6,0,0" textcolor="#FFFF6666" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFFF6666" bkcolor="#FFFFFFFF"></Button>
-					</HorizontalLayout>
-					
-					<HorizontalLayout padding="0,15,0,0" height="48">
-						<Label text="权益卡:" width="90" height="48" padding="20,0,0,0"></Label>
-						<Label name="diandan_jiesuan_quanyika_status" text="未使用" width="70" height="48" padding="0,0,0,0"></Label>
-						<Button name="diandan_jiesuan_quanyika_btn" text="扫码使用" height="35" width="90" padding="0,6,0,0" textcolor="#FF41A846" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FF41A846" bkcolor="#FFFFFFFF"></Button>
-						<Button name="diandan_jiesuan_quanyika_btn_cancel" visible="false" text="取消使用" height="35" width="90" padding="15,6,0,0" textcolor="#FFFF6666" normalimage="" hotimage="" pushedimage="" bordersize="1" bordercolor="#FFFF6666" bkcolor="#FFFFFFFF"></Button>
-					</HorizontalLayout>
-					
-					<HorizontalLayout padding="0,15,0,0" height="130">
-						<Label text="抹零:" width="90" height="48" padding="20,0,0,0"></Label>
-						<VerticalLayout padding="0,10,0,0">
-							<HorizontalLayout padding="0,0,30,0" width="200" height="30">
-								<CheckBox name="diandan_jiesuan_moling_bumoling" group="diandan_jiesuan_moling" padding="0,7,0,7" width="13" height="13" normalimage="file='RadioBtnNon.png'" hotimage="file='RadioBtnNon.png'" selectedimage="file='RadioBtnSel.png'"/>
-								<Label name="" text="不抹零" width="150" height="30" padding="15,0,0,0"/>
-							</HorizontalLayout>
-							
-							<HorizontalLayout padding="0,0,30,0" width="200" height="30">
-								<CheckBox name="diandan_jiesuan_moling_molingdaojiao" group="diandan_jiesuan_moling" padding="0,7,0,7" width="13" height="13" normalimage="file='RadioBtnNon.png'" hotimage="file='RadioBtnNon.png'" selectedimage="file='RadioBtnSel.png'"/>
-								<Label name="" text="抹零到角" width="150" height="30" padding="15,0,0,0"/>
-							</HorizontalLayout>
-							
-							<HorizontalLayout padding="0,0,30,0" width="200" height="30">
-								<CheckBox name="diandan_jiesuan_moling_molingdaoyuan" group="diandan_jiesuan_moling" padding="0,7,0,7" width="13" height="13" normalimage="file='RadioBtnNon.png'" hotimage="file='RadioBtnNon.png'" selectedimage="file='RadioBtnSel.png'"/>
-								<Label name="" text="抹零到元" width="150" height="30" padding="15,0,0,0"/>
-							</HorizontalLayout>
-						</VerticalLayout>
-					</HorizontalLayout>
-				</VerticalLayout>
-				
-				<Control width="1" bkcolor="#FFEBE8E8"></Control>
-				
+			<HorizontalLayout name="diandan_jiesuan_layout" bkcolor="#FFFFFFFF" hscrollbar="true">				
 				<VerticalLayout name="diandan_page_jiesuan_zhangdan_layout" vscrollbar="true">
 					<Label text="账单明细" height="58" padding="20,0,0,0" font="20"></Label>
 					
@@ -199,7 +50,7 @@
 					
 					<HorizontalLayout height="50">
 						<Control></Control>
-						<Label name="diandan_jiesuan_total_yingshou" text="" width="150" height="50" align="right" padding="0,0,15,0"/>
+						<Label name="diandan_jiesuan_total_yingshou" text="" width="300" height="50" align="right" padding="0,0,15,0"/>
 					</HorizontalLayout>
 					
 					<Label text="支付方式" width="100" height="58" padding="20,30,0,0" font="20"></Label>
@@ -214,7 +65,7 @@
 						</HorizontalLayout>
 						
 						<HorizontalLayout name="diandan_jiesuan_zhifufangshi_huiyuan" width="120" hegiht="80" float="true">
-							<Button name="diandan_jiesuan_zhifufangshi_huiyuan_btn" text="" height="80" width="120" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF8910"></Button>
+							<Button name="diandan_jiesuan_zhifufangshi_shoukuan_btn" text="" height="80" width="120" padding="0,0,0,0" textcolor="#FF999999" normalimage="" hotimage="" pushedimage="" bordersize="0" bkcolor="#FFFF8910"></Button>
 							<Control name="zhifu_icon" bkimage="huiyuanzhifu_icon.png" width="26" height="20" float="true" pos="50,10,76,30" mouse="false"></Control>
 							<Label name="zhifu_name" text="会员支付" width="180" height="35" font="14" float="true" pos="30,35,210,70" textcolor="#FFFFFFFF" mouse="false"></Label>
 						</HorizontalLayout>
@@ -248,5 +99,5 @@
 				</VerticalLayout>
 			</HorizontalLayout>
 		</HorizontalLayout>
-	</DiandanPage>
+	</ShoukuanPage>
 </Window>

+ 5 - 0
zhipuzi_pos_windows/control/ControlEx.h

@@ -22,6 +22,7 @@
 #include "../page/CZhengcanDiandanPageUI.h"
 #include "../page/CZhengcanOrderListPageUI.h"
 #include "../page/CZhengcanOrderInfoPageUI.h"
+#include "../page/CShoukuanPageUI.h"
 
 #include "CWaimaiOrderItemUI.h"
 #include "CDianneiOrderItemUI.h"
@@ -119,6 +120,10 @@ public:
 		{
 			return new CZhengcanOrderInfoPageUI;
 		}
+		else if (_tcscmp(pstrClass, _T("ShoukuanPage")) == 0)
+		{
+			return new CShoukuanPageUI;
+		}
 
 		//控件相关的
 		else if (_tcscmp(pstrClass, _T("WaimaiOrderItem")) == 0)

+ 42 - 0
zhipuzi_pos_windows/helper/CLewaimaiString.cpp

@@ -609,4 +609,46 @@ std::string CLewaimaiString::SqlZhuanyi(std::string old)
 	CLewaimaiString::string_replace(old, "'", "''");
 
 	return old;
+}
+
+std::wstring CLewaimaiString::ShuziInputFormat(std::wstring old, std::wstring input)
+{
+	if (old == L"0")
+	{
+		if (input == L".")
+		{
+			return old + input;
+		}
+		else if(input == L"0")
+		{
+			return L"0";
+		}
+		else
+		{
+			return input;
+		}
+	}
+
+	int pos = old.find(L".");
+	if (pos != old.npos)
+	{
+		//已经有一个.了
+		if (input == L".")
+		{
+			return old;
+		}
+
+		if (old.length() - pos > 2)
+		{
+			//小数点后已经有2个数字了
+			return old;
+		}
+
+		return old + input;
+	}
+	else
+	{
+		//还没有小数点
+		return old + input;
+	}
 }

+ 3 - 0
zhipuzi_pos_windows/helper/CLewaimaiString.h

@@ -71,4 +71,7 @@ public:
 
 	//把字符串中的单引号'转化成2个单引号'',这样就可以插入到sqllite中,并且插入进去之后就是一个单引号
 	static std::string SqlZhuanyi(std::string old);
+
+	//对于一个是数字的字符串,通过键盘输入一个新的字符之后,求新的数字字符串,主要是考虑各种异常数字格式的问题,返回值是新的有效的数字
+	static std::wstring ShuziInputFormat(std::wstring old, std::wstring input);
 };

+ 559 - 0
zhipuzi_pos_windows/page/CShoukuanPageUI.cpp

@@ -0,0 +1,559 @@
+#include "../pch/pch.h"
+#include "CShoukuanPageUI.h"
+
+#include "../control/ControlEx.h"
+
+#include "../wnd/CWeixinzhifuShoukuanWnd.h"
+#include "../wnd/CHuiyuanShoukuanWnd.h"
+#include "../wnd/CXianjinShoukuanWnd.h"
+#include "../wnd/CFulikaShoukuanWnd.h"
+#include "../wnd/CZidingyiShoukuanWnd.h"
+
+#include "../wnd/CMainWnd.h"
+
+CShoukuanPageUI::CShoukuanPageUI()
+{
+
+}
+
+CShoukuanPageUI::~CShoukuanPageUI()
+{
+
+}
+
+//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
+void CShoukuanPageUI::InitShow()
+{
+	InitMoney();
+
+	UpdateJiesuanInfo();
+
+	if (m_is_zidingyizhifu_init == false)
+	{
+		//初始化结算页面的支付方式
+		this->InitJiesuanZhifu();
+
+		m_is_zidingyizhifu_init = true;
+	}
+
+	//更新结算按钮位置
+	UpdateJiesuanZhifuPos();
+}
+
+//处理按钮点击类事件
+void CShoukuanPageUI::HandleClickMsg(TNotifyUI& msg)
+{
+	CDuiString senderName = msg.pSender->GetName();
+
+	if (senderName == L"jianpan_1")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"1");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_2")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"2");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_3")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"3");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_4")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"4");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_5")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"5");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_6")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"6");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_7")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"7");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_8")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"8");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_9")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"9");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_0")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L"0");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_dian")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = CLewaimaiString::ShuziInputFormat(wsReason, L".");
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"jianpan_qingkong")
+	{
+		CEditUI* pContent = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+		wstring wsReason = pContent->GetText();
+
+		wsReason = L"0";
+
+		pContent->SetText(wsReason.c_str());
+		pContent->SetFocus();
+
+		UpdateJiesuanInfo();
+	}
+	else if (senderName == L"diandan_jiesuan_zhifufangshi_weixinzhifu_btn")
+	{
+		//点击微信支付
+		this->StartWeixinzhifuShoukuan();
+	}
+}
+
+//处理option切换事件
+void CShoukuanPageUI::HandleSelectChangeMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理下拉框、radio的切换事件
+void CShoukuanPageUI::HandleItemSelectMsg(TNotifyUI& msg)
+{
+
+}
+
+//处理编辑框输入内容改变事件
+void CShoukuanPageUI::HandleTextChangedMsg(TNotifyUI& msg)
+{
+	
+}
+
+//处理扫码枪捕捉到的扫码信息
+void CShoukuanPageUI::HandleTextCapture(std::string content)
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		m_curModalWnd->HandleTextCapture(content);
+	}
+}
+
+void CShoukuanPageUI::ShowError(std::wstring err)
+{
+	CLabelUI* m_pLabel = static_cast<CLabelUI*>(this->FindSubControl(_T("errorinfo")));
+	m_pLabel->SetText(err.c_str());
+
+	m_pLabel->SetVisible(true);
+
+	this->FindSubControl(L"shoukuan_info_layout")->SetVisible(false);
+	this->FindSubControl(L"shoukuan_page_no_layout")->SetVisible(true);
+}
+
+void CShoukuanPageUI::HideError()
+{
+	CLabelUI* m_pLabel = static_cast<CLabelUI*>(this->FindSubControl(_T("errorinfo")));
+	m_pLabel->SetVisible(true);
+}
+
+void CShoukuanPageUI::InitJiesuanZhifu()
+{
+	CHorizontalLayoutUI* pZhifufangshiLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_layout")));
+
+	int num = 0;
+
+	CHorizontalLayoutUI* pWeixinLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_weixinzhifu")));
+	if (CShopinfo::GetInstance()->m_is_online_pay_open == "1")
+	{
+		//展示微信支付,并且调整位置
+		pWeixinLayout->SetVisible(true);
+
+		num++;
+	}
+	else
+	{
+		pZhifufangshiLayout->RemoveAt(num);
+	}
+
+	//会员支付
+	CHorizontalLayoutUI* pHuiyuanLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_huiyuan")));
+	if (CShopinfo::GetInstance()->m_is_vip_pay_open == "1")
+	{
+		pHuiyuanLayout->SetVisible(true);
+
+		num++;
+	}
+	else
+	{
+		pZhifufangshiLayout->RemoveAt(num);
+	}
+
+	//现金支付
+	CHorizontalLayoutUI* pXianjinLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_xianjin")));
+	if (CShopinfo::GetInstance()->m_is_cash_pay_open == "1")
+	{
+		pXianjinLayout->SetVisible(true);
+
+		num++;
+	}
+	else
+	{
+		pZhifufangshiLayout->RemoveAt(num);
+	}
+
+	/*
+	//购物卡
+	CHorizontalLayoutUI* pGouwukaLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_gouwuka")));
+	if (CShopinfo::GetInstance()->m_is_giftcard_pay_open == "1")
+	{
+		pGouwukaLayout->SetVisible(true);
+
+		num++;
+	}
+	else
+	{
+		pGouwukaLayout->SetVisible(false);
+	}
+
+	//美食城临时卡
+	CHorizontalLayoutUI* pMeishichengLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_meishicheng")));
+	if (CShopinfo::GetInstance()->m_is_food_town_card_pay_open == "1")
+	{
+		pMeishichengLayout->SetVisible(true);
+
+		num++;
+	}
+	else
+	{
+		pMeishichengLayout->SetVisible(false);
+	}
+	*/
+
+	//福利卡
+	CHorizontalLayoutUI* pFulikaLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_fulika")));
+	if (CShopinfo::GetInstance()->m_is_open_fulika_pay == "1")
+	{
+		pFulikaLayout->SetVisible(true);
+
+		num++;
+	}
+	else
+	{
+		pZhifufangshiLayout->RemoveAt(num);
+	}
+
+	//接着添加自定义支付的
+	for (std::vector<SelfPay>::iterator it = CShopinfo::GetInstance()->m_self_pay.begin(); it != CShopinfo::GetInstance()->m_self_pay.end(); it++)
+	{
+		SelfPay selfpay = *it;
+
+		if (selfpay.is_open == "1")
+		{
+			CButtonUI* newButton = new CButtonUI();
+
+			newButton->SetFixedWidth(120);
+			newButton->SetFixedHeight(80);
+			newButton->SetText(CLewaimaiString::UTF8ToUnicode(selfpay.name).c_str());
+
+			newButton->SetBorderSize(1);
+			newButton->SetBorderColor(0xFFC1C1C1);
+			newButton->SetBkColor(0xFFF7F7F7);
+
+			//设置定义属性,在点击按钮的时候好区分
+			newButton->SetAttribute(L"name", L"diandan_jiesuan_zhifufangshi_zidingyi_btn");
+			newButton->AddCustomAttribute(L"selfpay_id", CLewaimaiString::UTF8ToUnicode(selfpay.id).c_str());
+			newButton->SetAttribute(L"float", L"true");
+
+			//必须先Add,才能调用下面的SetPos,否则无效
+			pZhifufangshiLayout->Add(newButton);
+
+			num++;
+		}
+	}
+
+	m_nZhiufuNum = num;
+}
+
+void CShoukuanPageUI::UpdateJiesuanZhifuPos()
+{
+	//添加支付方式
+	int nWidth = m_nPageWidth;
+	if (nWidth == 0)
+	{
+		return;
+	}
+
+	int nZhangdanWidth = nWidth - 420 - 5;
+	if (nZhangdanWidth < 290)
+	{
+		nZhangdanWidth = 290;
+	}
+	CVerticalLayoutUI* pZhangdanLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(L"diandan_page_jiesuan_zhangdan_layout"));
+	pZhangdanLayout->SetFixedWidth(nZhangdanWidth);
+
+	//根据宽度计算每行显示的数量
+	int nMeihangNum = (nZhangdanWidth) / 144;
+	if (nMeihangNum < 1)
+	{
+		nMeihangNum = 1;
+	}
+
+	int num = 0;
+
+	CHorizontalLayoutUI* pZhifufangshiLayout = static_cast<CHorizontalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhifufangshi_layout")));
+	for (int i = 0; i < m_nZhiufuNum; i++)
+	{
+		CButtonUI* curItem = static_cast<CButtonUI*>(pZhifufangshiLayout->GetItemAt(i));
+
+		int curRow = num / nMeihangNum + 1;
+		int curCol = num % nMeihangNum + 1;
+
+		RECT rect;
+		rect.left = (curCol - 1) * 140 + 20;
+		rect.right = rect.left + 120;
+		rect.top = (curRow - 1) * 100 + 20;
+		rect.bottom = rect.top + 80;
+
+		curItem->SetPos(rect);
+
+		num++;
+	}
+
+	//调整区域高度
+	int lastRow = (num - 1) / nMeihangNum + 1;
+	pZhifufangshiLayout->SetFixedHeight(lastRow * 105);
+}
+
+//初始化收款金额
+void CShoukuanPageUI::InitMoney()
+{
+	CEditUI* pMoneyEdit = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	pMoneyEdit->SetText(L"0");
+}
+
+std::string CShoukuanPageUI::GetMoney()
+{
+	CEditUI* pJiajiaEdit = static_cast<CEditUI*>(this->FindSubControl(_T("shoukuan_page_money_edit")));
+	wstring ws_jiajia = pJiajiaEdit->GetText();
+	double money = atof(CLewaimaiString::UnicodeToUTF8(ws_jiajia).c_str());
+
+	return CLewaimaiString::DoubleToString(money, 2);
+}
+
+void CShoukuanPageUI::UpdateJiesuanInfo()
+{
+	//再刷新账单明细展示
+	CVerticalLayoutUI* pmingxiLayout = static_cast<CVerticalLayoutUI*>(this->FindSubControl(_T("diandan_jiesuan_zhangdanmingxi_jiage_layout")));
+	pmingxiLayout->RemoveAll();
+
+	std::string money = this->GetMoney();
+
+	int item_num = 0;
+
+	//先显示基础价格
+	if (true)
+	{
+		CDialogBuilder builder;
+		CDialogBuilderCallbackEx cb;
+		CHorizontalLayoutUI* pItem = static_cast<CHorizontalLayoutUI*>(builder.Create(_T("diandan_zhangdanmingxi_item.xml"), (UINT)0, &cb, m_pManager));
+		pmingxiLayout->Add(pItem);
+
+		CLabelUI* pName = static_cast<CLabelUI*>(pItem->FindSubControl(_T("name")));
+		CLabelUI* pValue = static_cast<CLabelUI*>(pItem->FindSubControl(_T("value")));
+
+		pName->SetText(L"原价:");
+		pValue->SetText((CLewaimaiString::UTF8ToUnicode(money) + L"元").c_str());
+
+		item_num++;
+	}
+
+	pmingxiLayout->SetFixedHeight(item_num * 40);
+
+	CLabelUI* pYingshou = static_cast<CLabelUI*>(this->FindSubControl(_T("diandan_jiesuan_total_yingshou")));
+	pYingshou->SetText((L"应收金额:" + CLewaimaiString::UTF8ToUnicode(money) + L"元").c_str());
+}
+
+//开始进行微信支付收款,如果fukuanma不为空,默认自动唤起支付
+void CShoukuanPageUI::StartWeixinzhifuShoukuan(std::string fukuanma)
+{
+	if (m_is_show_modal_wnd == true)
+	{
+		return;
+	}
+
+	if (atof(GetMoney().c_str()) < 0.0001)
+	{
+		m_pMainWnd->ShowToast(L"收款金额不能为0");
+
+		return;
+	}
+
+	CWeixinzhifuShoukuanWnd* pShoukuanWnd = new CWeixinzhifuShoukuanWnd;
+	if (pShoukuanWnd != NULL)
+	{
+		m_is_show_modal_wnd = true;
+		m_curModalWnd = pShoukuanWnd;
+
+		pShoukuanWnd->Create(m_pManager->GetPaintWindow(), _T(""), UI_WNDSTYLE_DIALOG, WS_EX_TOOLWINDOW);
+		pShoukuanWnd->SetIcon(IDI_ICON_DUILIB);
+		pShoukuanWnd->CenterWindow();
+
+		std::string format_string = GetMoney();
+		std::wstring watchValue = CLewaimaiString::UTF8ToUnicode(format_string);
+		pShoukuanWnd->InitMoney(watchValue);
+
+		//这里要对提交订单的参数进行组装,然后方便请求
+		pShoukuanWnd->SetCommonParams(GetSendorderParams());
+
+		if (fukuanma != "")
+		{
+			pShoukuanWnd->InitFukuanma(fukuanma);
+		}
+
+		UINT ret = pShoukuanWnd->ShowModal();
+		if (ret == IDOK)
+		{
+			int fukuanma_type = pShoukuanWnd->m_fukuanma_type;
+
+			std::string zhifu_type;
+			if (fukuanma_type == 1)
+			{
+				zhifu_type = "weixinzhifu";
+			}
+			else if (fukuanma_type == 2)
+			{
+				zhifu_type = "zhifubao";
+			}
+			else if (fukuanma_type == 3)
+			{
+				zhifu_type = "yunshanfu";
+			}
+
+			//说明收款成功了,需要进行一些后续的处理
+			//this->StartWorkAfterShoukuan(pShoukuanWnd->m_kucun_string, pShoukuanWnd->m_take_food_code, pShoukuanWnd->m_show_trade_no, zhifu_type);
+
+			m_pMainWnd->ShowToast(L"收款成功!");
+		}
+		else
+		{
+			int a = 1;
+		}
+
+		m_is_show_modal_wnd = false;
+		delete pShoukuanWnd;
+	}
+}
+
+//获取通用参数,任何支付方式都要用到的参数,个性化参数在弹框里面处理
+//参考文档 http://apidoc.zhipuzi.com/index.php/home/item/show?item_id=4
+std::map<string, string> CShoukuanPageUI::GetSendorderParams()
+{
+	std::map<string, string> params;
+
+	params["order_no"] = CRandomHelper::GetRandString(20);
+
+	params["coupon"] = CLewaimaiString::DoubleToString(1, 2);
+	params["price_plus"] = CLewaimaiString::DoubleToString(1, 2);
+	params["price_moling"] = CLewaimaiString::DoubleToString(1, 2);
+	params["yingshou_value"] = CLewaimaiString::DoubleToString(1, 2);
+	params["shishou_value"] = CLewaimaiString::DoubleToString(1, 2);
+	params["zhaoling_value"] = "0";
+
+	params["zhifu_type"] = "";
+
+	return params;
+}
+
+void CShoukuanPageUI::SetPos(RECT rc, bool bNeedInvalidate)
+{
+	m_nPageWidth = rc.right - rc.left;
+
+	//拖动窗口的时候,更新位置
+	UpdateJiesuanZhifuPos();
+
+	CContainerUI::SetPos(rc, bNeedInvalidate);
+}

+ 81 - 0
zhipuzi_pos_windows/page/CShoukuanPageUI.h

@@ -0,0 +1,81 @@
+#pragma once
+
+#include "../pch/pch.h"
+#include "CBasePageUI.h"
+
+#include "../wnd/CModalWnd.h"
+
+class CShoukuanPageUI : public CBasePageUI
+{
+public:
+	CShoukuanPageUI();
+
+	~CShoukuanPageUI();
+
+	//初始化当前页面的展示,处理默认展示效果,在页面每次被选中加载(注意不是页面创建构造)的时候调用,如果多次选中会多次调用,这里要避免数据重复处理
+	void InitShow();
+
+	//处理按钮点击类事件
+	void HandleClickMsg(TNotifyUI& msg);
+
+	//处理option切换事件
+	void HandleSelectChangeMsg(TNotifyUI& msg);
+
+	//处理下拉框、radio的切换事件
+	void HandleItemSelectMsg(TNotifyUI& msg);
+
+	//处理编辑框输入内容改变事件
+	void HandleTextChangedMsg(TNotifyUI& msg);
+
+	//处理扫码枪捕捉到的扫码信息
+	void HandleTextCapture(std::string content);
+
+	//处理自定义消息,各个页面处理各个页面自己的(是自己处理的消息返回true,不是自己处理的消息返回false)
+	bool HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
+	{
+		return false;
+	}
+
+	void SetPos(RECT rc, bool bNeedInvalidate = true);
+
+private:
+	void ShowError(std::wstring err);
+
+	void HideError();
+
+	//初始化结算页面的支付方式展示(仅需要在页面初始化的时候调用一次,这里只添加支付方式,不设置位置)
+	void InitJiesuanZhifu();
+
+	//这个只更新结算页面支付方式的位置,不处理控件添加
+	void UpdateJiesuanZhifuPos();
+
+	//初始化收款金额
+	void InitMoney();
+
+	std::string GetMoney();
+
+	//任何可以引起价格变化的,比如添加、修改、删除商品,或者修改优惠等,需要重新计算总价格,刷新结算账单等地方的显示,都要调用这个方法
+	void UpdateJiesuanInfo();
+
+	//开始进行微信支付收款,如果fukuanma不为空,默认自动唤起支付
+	void StartWeixinzhifuShoukuan(std::string fukuanma = "");
+
+	//获取用于提交订单的参数结构
+	std::map<string, string> GetSendorderParams();
+
+private:
+	//是否正在请求服务器
+	bool m_is_handle = false;
+
+	bool m_is_zidingyizhifu_init = false;
+
+	//模态对话框有关的
+	bool m_is_show_modal_wnd = false;
+	CModalWnd* m_curModalWnd;
+
+	//结算页面总的支付方式数量
+	int m_nZhiufuNum;
+
+	//当前控件的实际宽度
+	int m_nPageWidth;
+};

+ 2 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj

@@ -229,6 +229,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     </PostBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClInclude Include="page\CShoukuanPageUI.h" />
     <ClInclude Include="wnd\CThirdDeliverySelectWnd.h" />
     <ClInclude Include="wnd\CNumInputWnd.h" />
     <ClInclude Include="control\CZhengcanOrderItemUI.h" />
@@ -339,6 +340,7 @@ copy $(ProjectDir)conf\ $(SolutionDir)bin\$(Platform)\$(Configuration)\conf\</Co
     <ClInclude Include="helper\CSystem.h" />
   </ItemGroup>
   <ItemGroup>
+    <ClCompile Include="page\CShoukuanPageUI.cpp" />
     <ClCompile Include="wnd\CThirdDeliverySelectWnd.cpp" />
     <ClCompile Include="wnd\CNumInputWnd.cpp" />
     <ClCompile Include="control\CZhengcanOrderItemUI.cpp" />

+ 6 - 0
zhipuzi_pos_windows/zhipuzi_pos_windows.vcxproj.filters

@@ -339,6 +339,9 @@
     <ClInclude Include="wnd\CThirdDeliverySelectWnd.h">
       <Filter>头文件</Filter>
     </ClInclude>
+    <ClInclude Include="page\CShoukuanPageUI.h">
+      <Filter>头文件</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="pch\pch.cpp">
@@ -638,6 +641,9 @@
     <ClCompile Include="wnd\CThirdDeliverySelectWnd.cpp">
       <Filter>源文件</Filter>
     </ClCompile>
+    <ClCompile Include="page\CShoukuanPageUI.cpp">
+      <Filter>源文件</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <Image Include="resource\zhipuzi.ico">