Ejemplo n.º 1
0
			 	},{emulateJSON:true}).then(function(data){
			 		if (data.data.success) {
			 			window.location.href = "success?orderIds="+data.data.orderId+"&type=shopcart&orderBusiIds="+data.data.orderBusiId;
			 		} else {
						weui.toast('期货订单生成失败!', 3000);
			 		}
				}).catch(function(rs){
Ejemplo n.º 2
0
			 	self.$http.post("saveEditAddr",{'editAddr':JSON.stringify(editAddr)},{emulateJSON:true}).then(function(data){
			 		//self.userConsignee = data.data.userConsignee;
				 	loading.hide();
			 		weui.toast("保存成功",1500);
				 	self.closeEditAddrView();
				 	self.userConsigneeList = data.data.consigneeList;
			 	});
Ejemplo n.º 3
0
			        success: function(resp){
			        	if(resp.orderStatus == '1'){
			        		$('#iosActionsheet').addClass('weui-actionsheet_toggle');
			        		order_busi_id = orderBusiId;
			        	}else{
			        		weui.toast('订单已变更,请刷新页面!', 2000);
			        	}
			        },
Ejemplo n.º 4
0
			 	self.$http.post("deleteAddrById",{'conId':conId},{emulateJSON:true}).then(function(data){
			 		loading.hide();
			 		weui.toast("删除成功",1500);
			 		self.userConsigneeList.forEach(function(obj,index){
			 			if (conId == obj.con_id) {
			 				self.userConsigneeList.splice(index,1);
			 			}
			 		});
			 	});
Ejemplo n.º 5
0
			 	self.$http.post("updateDefaultAddrById",{'conId':id},{emulateJSON:true}).then(function(data){
			 		//self.userConsignee = data.data.userConsignee;
			 		weui.toast("设置成功",1500);
				 	$("div[name='defaultAddr']").removeClass("choosed");
				 	loading.hide();
				 	var defaultD = $(e.target).parent().children().eq(0);
				 	if (defaultD.hasClass("choosed")) {
					 	defaultD.removeClass("choosed");
				 	} else {
					 	defaultD.addClass("choosed");
				 	}
			 	});
Ejemplo n.º 6
0
			 	},{emulateJSON:true}).then(function(data){
			 		var orderIds = [];
			 		var orderBusiIds = [];
			 		loading.hide();
			 		if (data.data.success) {
			 			orderIds.push(data.data.orderId);
			 			orderBusiIds.push(data.data.orderBusiId);
			 		} else {
			 			if (data.data.success != undefined) {
							weui.toast('期货订单生成失败!', 3000);
			 			}
			 		}
			 		if (data.data.success1) {
			 			orderIds.push(data.data.orderId1)
			 			orderBusiIds.push(data.data.orderBusiId1)
			 		} else {
			 			if (data.data.success1 != undefined) {
							weui.toast('现货订单生成失败!', 3000);
			 			}
			 		}
			 		if (orderIds.length > 0) {
			 			window.location.href = "success?orderIds="+orderIds+"&type=quote&orderBusiIds="+orderBusiIds;
			 		}
				}).catch(function(rs){
Ejemplo n.º 7
0
			 	},{emulateJSON:true}).then(function(data){
			 		loading.hide();
			 		if (data.data.result) {
						self.shoppingCartList.forEach(function(obj,index){
							if (obj.id == id) {
								self.shoppingCartList.splice(index,1);
							}
						});
						var totalWeight = 0;
						self.shoppingCartList.forEach(function(obj,index){
							totalWeight += obj.buyWeight;
						});
						self.totalWeight = totalWeight;
			 		} else {
						weui.toast('删除失败!', 3000);
			 		}
				}).catch(function(rs){
Ejemplo n.º 8
0
			 confirmWeight:function(type){
			 	var self = this;
			 	var reg = new RegExp("^[0-9]+(.[0-9]{1,3})?$");
				var value = "";
				var input = null;
			 	if ('width' == type) {
					value = $("#width").find("input").val();
					//要映射的输入框dom对象
					input =$($('#dialog1')[0].currentInput);
				} else if ('thickness' == type) {

					var value1 = $("#thickness").find("select").val();
					var value2 = $("#thickness").find("input").val();
					if (value1 == "其他") {
						value = value2;
					} else {
						value = value1;
					}
					//要映射的输入框dom对象
					input =$($('#dialog3')[0].currentInput);
				} else if ('weight' == type) {
					value = $("#weight").find("input").val();
					//要映射的输入框dom对象
					input =$($('#dialog4')[0].currentInput);
				}
				if(!reg.test(value)){
					window.alert("只能为非负数,且小数位数不超过3位");
					if ('width' == type) {
						$("#width").find("input").focus();
						$("#width").find("input").select();
					} else if ('thickness' == type) {
						$("#thickness").find("input").focus();
						$("#thickness").find("input").select();
					} else if ('weight' == type) {
						$("#weight").find("input").focus();
						$("#weight").find("input").select();
					}
					return;
				}
				input.val(Number(value));
				var val = input.val();
			 	if (type == "weight") {
					var totalWeight = 0;
					var availableQuantity = input.attr("availableQuantity");
					if (Number(val) > Number(availableQuantity)) {
						input.val("");
						window.alert("超出可购买量!");
					}
					self.refreshTotalNum();
			 	} else if (type == "thickness") {
			 		var specificationId = input.attr("specificationId");
			 		var quoteId = input.attr("quoteId");
			 		var quotePrice = input.attr("quotePrice");
			 		var flag = false;
			 		var d = input.closest("li").index();
			 		var quote = this.getQuote(quoteId,d);
			 		self.specificationList.forEach(function(obj,index){
			 			if (obj.specificationId == specificationId) {
			 				//当前厚度等于基准价格
			 			    if(val == obj.baseThickness ){
			 			    	flag = true;
			 			    	quote.quotePrice = Number(quotePrice);
			 			    }else{
			 			    	obj.listAddPrice.forEach(function(p,i){
				 					if (val == p.thickness) {
				 						flag = true;
				 						quote.quotePrice = Number(quotePrice) + Number(p.thicknessPrice);
				 					}
				 				});
			 			    }
			 				
			 			}
			 		});
			 		if (!flag) {
			 			weui.toast("当前厚度无加价,请联系供应商确认!",1500);
		 				self.quoteList.forEach(function(quote,index){
		 					if (d == index) {
		 						//quote.quotePrice = Number(quotePrice);
		 						quote.quotePrice = "待定";
		 					}
		 				});
			 			//input.closest("li").find("#quotePrice").html("待定");
			 		}
			 	} else if (type == "width") {// 验证宽度
			 		var avaliableWidth = input.attr("placeholder");
			 		if (avaliableWidth.indexOf("-")==-1) {
			 			if (val != avaliableWidth) {
			 				input.val(avaliableWidth);
			 				window.alert("宽度超出范围!");
			 			}
			 		} else {
			 			var widths = avaliableWidth.split("-");
			 			if (Number(widths[0]) <= Number(val) && Number(widths[1]) >= Number(val)) {
			 			} else {
			 				input.val('');
			 				window.alert("宽度超出范围!");
			 			}
			 		}
			 	}
			 	if ('width' == type) {
					$('#dialog1').hide();
				} else if ('thickness' == type) {
					$('#dialog3').hide();
				} else if ('weight' == type) {
					$('#dialog4').hide();
				}
			 },
Ejemplo n.º 9
0
			        error: function(data,xhr, type){
			        	loading.hide();
			        	weui.toast('网络异常!', 3000);
			        }
Ejemplo n.º 10
0
			        error: function(data,xhr, type){
			        	loading.hide();
			        	weui.toast('网络异常!', 2000);
			        	$('#iosActionsheet').removeClass('weui-actionsheet_toggle');
			        }
Ejemplo n.º 11
0
				}).catch(function(rs){
			 		loading.hide();
					weui.toast('网络异常!', 3000);
				});
Ejemplo n.º 12
0
			        error: function(data,xhr, type){
			        	weui.toast('系统错误!', 2000);
			        }
Ejemplo n.º 13
0
			        error: function(data,xhr, type){
			        	loading.hide();
			        	weui.toast('网络异常!', 2000);
			        	$('#androidDialog1').css('display','block');
			        }
Ejemplo n.º 14
0
			        success: function(resp){
			        	loading.hide();
			        	weui.toast('已完成', 1000);
			        	$('#androidDialog1').css('display','none');
			        	self.doQuery();
			        },
Ejemplo n.º 15
0
			        error: function(data,xhr, type){
			        	weui.toast('获取提货单位失败!', 3000);
			        }
Ejemplo n.º 16
0
			}).catch(function(rs){
				weui.toast('网络异常!', 3000);
			});
Ejemplo n.º 17
0
			        success: function(resp){
			        	loading.hide();
			        	weui.toast('已完成', 1000);
			        	$('#iosActionsheet').removeClass('weui-actionsheet_toggle');
			        	self.doQuery();
			        },