Browse Source

优惠券

qukaidi 4 years ago
parent
commit
f5e1aa30a5

+ 8 - 8
luntai/cartList_body.html

@@ -209,14 +209,14 @@
 						api.toast({ msg: '至少选择一件商品' });
 						return;
 					}
-					if (this.status == 3) {
-						api.alert({
-							title: '系统提示',
-							msg: '门店已冻结,请找相关业务经理解冻!',
-						}, function (ret, err) {
-						});
-						return;
-					}
+					// if (this.status == 3) {
+					// 	api.alert({
+					// 		title: '系统提示',
+					// 		msg: '门店已冻结,请找相关业务经理解冻!',
+					// 	}, function (ret, err) {
+					// 	});
+					// 	return;
+					// }
 					var data = {
 						"retailerId": this.userId,
 						"amount": count,

+ 1 - 6
luntai/css/main.css

@@ -1595,10 +1595,6 @@ font-size: 0.26rem;}
     background: #00a0ea;
     font-size: 0.26rem; }
 
-.intoInfo{
-  position:
-}
-
 .rukuTongji {
   width: 100%;
   height: 100%;
@@ -1622,8 +1618,7 @@ font-size: 0.26rem;}
     .rukuTongji .rukuTongjiHead .item {
       flex: 1; }
   .rukuTongji .rukuTongjiBody {
-    padding: 0px 0.2rem;
-    font-size: 0.28rem; }
+    font-size: 0.22rem; }
     .rukuTongji .rukuTongjiBody .item {
       padding: 0.2rem;
       border-bottom: 1px solid #e8e8e8;

+ 16 - 16
luntai/getStoreNet_body.html

@@ -364,14 +364,14 @@
 				},
 				//  添加购物车
 				addStoreCar: function (index) {
-					if (this.status == 3) {
-						api.alert({
-							title: '系统提示',
-							msg: '门店已冻结,请找相关业务经理解冻!',
-						}, function (ret, err) {
-						});
-						return;
-					}
+					// if (this.status == 3) {
+					// 	api.alert({
+					// 		title: '系统提示',
+					// 		msg: '门店已冻结,请找相关业务经理解冻!',
+					// 	}, function (ret, err) {
+					// 	});
+					// 	return;
+					// }
 					var storeInfo = this.list[index];
 					var data = {
 						"matnr": storeInfo.matnr,
@@ -406,14 +406,14 @@
 				},
 				//  立即抢购
 				buyStore: function (index) {
-					if (this.status == 3) {
-						api.alert({
-							title: '系统提示',
-							msg: '门店已冻结,请找相关业务经理解冻!',
-						}, function (ret, err) {
-						});
-						return;
-					}
+					// if (this.status == 3) {
+					// 	api.alert({
+					// 		title: '系统提示',
+					// 		msg: '门店已冻结,请找相关业务经理解冻!',
+					// 	}, function (ret, err) {
+					// 	});
+					// 	return;
+					// }
 					var _this = this;
 					this.showModal("下单提示", "是否确认立即购买该商品?", ["确认", "取消"], function (type) {
 						if (type == 1) {

+ 53 - 69
luntai/index.html

@@ -250,19 +250,19 @@
 				},
 				//  扫码出入库
 				scanInto: function (type) {
-					if (this.agentInfo.status == 3) {
-						api.confirm({
-									title: '系统提示',
-									msg: '门店已冻结,请找相关业务经理解冻!',
-									buttons: ['确定', '激活']
-								}, function (ret, err) {
-									var index = ret.buttonIndex;
-									if(index==2){
-										_this.goWin("activation", "activation_win.html", "");
-									}
-								});
-						return;
-					}
+					// if (this.agentInfo.status == 3) {
+					// 	api.confirm({
+					// 				title: '系统提示',
+					// 				msg: '门店已冻结,请找相关业务经理解冻!',
+					// 				buttons: ['确定', '激活']
+					// 			}, function (ret, err) {
+					// 				var index = ret.buttonIndex;
+					// 				if(index==2){
+					// 					_this.goWin("activation", "activation_win.html", "");
+					// 				}
+					// 			});
+					// 	return;
+					// }
 					var src = type == 1 ? 'saomaruku' : 'saomachuku';
 					this.goWin(src, src + '_win.html', '');
 				},
@@ -272,19 +272,19 @@
 					});
 				},
 				getStoreNet: function () {
-					if (this.agentInfo.status == 3) {
-					api.confirm({
-									title: '系统提示',
-									msg: '门店已冻结,请找相关业务经理解冻!',
-									buttons: ['确定', '激活']
-								}, function (ret, err) {
-									var index = ret.buttonIndex;
-									if(index==2){
-										_this.goWin("activation", "activation_win.html", "");
-									}
-								});
-						return;
-					}
+					// if (this.agentInfo.status == 3) {
+					// api.confirm({
+					// 				title: '系统提示',
+					// 				msg: '门店已冻结,请找相关业务经理解冻!',
+					// 				buttons: ['确定', '激活']
+					// 			}, function (ret, err) {
+					// 				var index = ret.buttonIndex;
+					// 				if(index==2){
+					// 					_this.goWin("activation", "activation_win.html", "");
+					// 				}
+					// 			});
+					// 	return;
+					// }
 					this.goWin("getStoreNet", "getStoreNet_win.html", {})
 				},
 				verifyBusiness: function () {
@@ -295,19 +295,19 @@
 					},
 						_this = this,
 						url = "verifyBusiness";
-					if (this.agentInfo.status == 3) {
-						api.confirm({
-									title: '系统提示',
-									msg: '门店已冻结,请找相关业务经理解冻!',
-									buttons: ['确定', '激活']
-								}, function (ret, err) {
-									var index = ret.buttonIndex;
-									if(index==2){
-										_this.goWin("activation", "activation_win.html", "");
-									}
-						});
-						return;
-					}
+					// if (this.agentInfo.status == 3) {
+					// 	api.confirm({
+					// 				title: '系统提示',
+					// 				msg: '门店已冻结,请找相关业务经理解冻!',
+					// 				buttons: ['确定', '激活']
+					// 			}, function (ret, err) {
+					// 				var index = ret.buttonIndex;
+					// 				if(index==2){
+					// 					_this.goWin("activation", "activation_win.html", "");
+					// 				}
+					// 	});
+					// 	return;
+					// }
 					this.$postuser(url, data, function (ret) {
 						if (ret.code == 0 && ret.data) {
 							_this.goWin("license_body", "license_body.html", {
@@ -346,19 +346,19 @@
 				//  扫码轮胎二维码
 				lipeiList: function () {
 					var _this = this;
-					if (this.agentInfo.status == 3) {
-						api.confirm({
-									title: '系统提示',
-									msg: '门店已冻结,请找相关业务经理解冻!',
-									buttons: ['确定', '激活']
-								}, function (ret, err) {
-									var index = ret.buttonIndex;
-									if(index==2){
-										_this.goWin("activation", "activation_win.html", "");
-									}
-								});
-						return;
-					}
+					// if (this.agentInfo.status == 3) {
+					// 	api.confirm({
+					// 				title: '系统提示',
+					// 				msg: '门店已冻结,请找相关业务经理解冻!',
+					// 				buttons: ['确定', '激活']
+					// 			}, function (ret, err) {
+					// 				var index = ret.buttonIndex;
+					// 				if(index==2){
+					// 					_this.goWin("activation", "activation_win.html", "");
+					// 				}
+					// 			});
+					// 	return;
+					// }
 					// 	this.goWin('settlementInfo', 'settlementInfo_win.html', {
 					// 		 code: '10000351'
 					//  });
@@ -403,23 +403,7 @@
 					this.$postuser(url, data, function (ret) {
 						if (ret.code == 0) {
 							$api.setStorage("status", ret.data.status);
-							if (ret.data.status == 3) {
-								api.confirm({
-									title: '系统提示',
-									msg: '门店已冻结,请找相关业务经理解冻!',
-									buttons: ['确定', '激活']
-								}, function (ret, err) {
-									var index = ret.buttonIndex;
-									if(index==2){
-										_this.goWin("activation", "activation_win.html", "");
-									}
-								});
-								// api.alert({
-								// 	title: '系统提示',
-								// 	msg: '门店已冻结,请找相关业务经理解冻1!',
-								// }, function (ret, err) {
-								// });
-							} else if (ret.data.status == 5) {
+							if (ret.data.status == 5) {
 								api.alert({
 									title: '系统提示',
 									msg: '门店账号无效!',

+ 16 - 16
luntai/integral_details.html

@@ -314,14 +314,14 @@
                     });
                 },
                 addShopCart: function () {
-                    if (this.status == 3) {
-                        api.alert({
-                            title: '系统提示',
-                            msg: '门店已冻结,请找相关业务经理解冻!',
-                        }, function (ret, err) {
-                        });
-                        return;
-                    }
+                    // if (this.status == 3) {
+                    //     api.alert({
+                    //         title: '系统提示',
+                    //         msg: '门店已冻结,请找相关业务经理解冻!',
+                    //     }, function (ret, err) {
+                    //     });
+                    //     return;
+                    // }
                     if (this.list.productQtyStock == 0) {
                         api.toast({
                             msg: '很抱歉,当前商品暂时缺货'
@@ -358,14 +358,14 @@
                     })
                 },
                 showPopup: function () {
-                    if (this.status == 3) {
-                        api.alert({
-                            title: '系统提示',
-                            msg: '门店已冻结,请找相关业务经理解冻!',
-                        }, function (ret, err) {
-                        });
-                        return;
-                    }
+                    // if (this.status == 3) {
+                    //     api.alert({
+                    //         title: '系统提示',
+                    //         msg: '门店已冻结,请找相关业务经理解冻!',
+                    //     }, function (ret, err) {
+                    //     });
+                    //     return;
+                    // }
                     if (this.list.productQtyStock == 0) {
                         api.toast({
                             msg: '很抱歉,当前商品暂时缺货'

+ 8 - 8
luntai/integral_index.html

@@ -297,14 +297,14 @@
                     this.activeId = index;
                 },
                 addShopCart: function (list) {
-                    if (this.status == 3) {
-                        api.alert({
-                            title: '系统提示',
-                            msg: '门店已冻结,请找相关业务经理解冻!',
-                        }, function (ret, err) {
-                        });
-                        return;
-                    }
+                    // if (this.status == 3) {
+                    //     api.alert({
+                    //         title: '系统提示',
+                    //         msg: '门店已冻结,请找相关业务经理解冻!',
+                    //     }, function (ret, err) {
+                    //     });
+                    //     return;
+                    // }
                     if (list.productQtyStock == 0 || list.productQtyStock == null) {
                         api.toast({
                             msg: '很抱歉,当前商品暂时缺货'

+ 7 - 7
luntai/integral_shop.html

@@ -540,13 +540,13 @@
                         this.showToast('至少选择一件商品');
                         return;
                     }
-                    if (this.status == 3) {
-                        api.alert({
-                            title: '系统提示',
-                            msg: '门店已冻结,请找相关业务经理解冻!'
-                        });
-                        return;
-                    }
+                    // if (this.status == 3) {
+                    //     api.alert({
+                    //         title: '系统提示',
+                    //         msg: '门店已冻结,请找相关业务经理解冻!'
+                    //     });
+                    //     return;
+                    // }
                     this.show = true;
                     var data = {
                         "url": "json",

+ 42 - 41
luntai/meber.html

@@ -434,21 +434,21 @@
 				 *  查看二维码
 				 */
 				inFanli: function () {
-					var _this = this
-					if (this.agentInfo.status == 3) {
-						api.confirm({
-							title: '系统提示',
-							msg: '门店已冻结,请找相关业务经理解冻!',
-							buttons: ['确定', '激活']
-						}, function (ret, err) {
-							var index = ret.buttonIndex;
-							if (index == 2) {
-								_this.goWin("activation", "activation_win.html", "");
-							}
-						});
-						_this.show = false;
-						return;
-					}
+					// var _this = this
+					// if (this.agentInfo.status == 5) {
+						// api.confirm({
+						// 	title: '系统提示',
+						// 	msg: '门店已冻结,请找相关业务经理解冻!',
+						// 	buttons: ['确定', '激活']
+						// }, function (ret, err) {
+						// 	var index = ret.buttonIndex;
+						// 	if (index == 2) {
+						// 		_this.goWin("activation", "activation_win.html", "");
+						// 	}
+						// });
+						// _this.show = false;
+						// return;
+					// }
 					this.show = true
 				},
 				lookAgentQrcode: function () {
@@ -617,19 +617,19 @@
 				},
 				insignAddress: function () {
 					var _this = this
-					if (this.agentInfo.status == 3) {
-						api.confirm({
-							title: '系统提示',
-							msg: '门店已冻结,请找相关业务经理解冻!',
-							buttons: ['确定', '激活']
-						}, function (ret, err) {
-							var index = ret.buttonIndex;
-							if (index == 2) {
-								_this.goWin("activation", "activation_win.html", "");
-							}
-						});
-						return;
-					}
+					// if (this.agentInfo.status == 3) {
+					// 	api.confirm({
+					// 		title: '系统提示',
+					// 		msg: '门店已冻结,请找相关业务经理解冻!',
+					// 		buttons: ['确定', '激活']
+					// 	}, function (ret, err) {
+					// 		var index = ret.buttonIndex;
+					// 		if (index == 2) {
+					// 			_this.goWin("activation", "activation_win.html", "");
+					// 		}
+					// 	});
+					// 	return;
+					// }
 					this.goWin('sign_address', 'sign_address.html', {
 						addressModify: this.agentInfo.addressModify,
 						contractTask: this.agentInfo.contractTask
@@ -637,19 +637,20 @@
 				},
 				inaddress: function () {
 					var _this = this
-					if (this.agentInfo.status == 3) {
-						api.confirm({
-							title: '系统提示',
-							msg: '门店已冻结,请找相关业务经理解冻!',
-							buttons: ['确定', '激活']
-						}, function (ret, err) {
-							var index = ret.buttonIndex;
-							if (index == 2) {
-								_this.goWin("activation", "activation_win.html", "");
-							}
-						});
-						return;
-					}
+					// if (this.agentInfo.status == 3) {
+					// 	api.confirm({
+					// 		title: '系统提示',
+					// 		msg: '门店已冻结,请找相关业务经理解冻!',
+					// 		buttons: ['确定', '激活']
+					// 	}, function (ret, err) {
+					// 		var index = ret.buttonIndex;
+					// 		if (index == 2) {
+					// 			_this.goWin("activation", "activation_win.html", "");
+					// 		}
+					// 	});
+					// 	return;
+					
+					// }
 					this.goWin('address', 'address_win.html');
 				},
 				//IOS获取动态ICON

+ 134 - 1
luntai/rukutongji_body.html

@@ -17,6 +17,24 @@
 	<script src="js/main.js"></script>
 	<title></title>
 </head>
+<style>
+	.couponleft {
+		width: 2.4rem;
+		color: #fff;
+		height: 2rem;
+		background: url(./img/images/youhuijuanLeft.png) no-repeat;
+		background-size: 100% 100%;
+		font-size: 0.7rem;
+		padding-top: 0.4rem;
+		padding-right: 0.2rem;
+	}
+
+	.mescroll {
+		position: relative;
+		height: 90%;
+		top: 1rem
+	}
+</style>
 
 <body>
 	<div id="app" v-cloak>
@@ -76,6 +94,9 @@
 						<div class="item flex a-center j-center">
 							奖励
 						</div>
+						<div class="item flex a-center j-center">
+							优惠券
+						</div>
 					</div>
 					<div class="rukuTongjiBody">
 						<div class="item flex a-center j-center" v-for="(s,index) in store">
@@ -88,6 +109,9 @@
 							<div class="fx1">
 								{{ s.reward }}元
 							</div>
+							<div class="fx1" style="color: #4CB4FF;" v-on:click="showPopups(s)">
+								{{s.couponName}}
+							</div>
 						</div>
 					</div>
 				</div>
@@ -99,9 +123,44 @@
 					扫码确认
 				</div>
 			</div>
+			<van-popup v-model="showPopup" round position="bottom" closeable close-icon="close"
+			v-bind:style="{ height: '80%' }">
+			<div style="height:90%;" class="mescroll-touch-y mescroll">
+				<div class="flex" v-for="(item,index) in couponList" :key="index">
+					<div class="flex" style="margin: 0.1rem 0;" v-on:click="selected(item)">
+						<div class="couponleft">
+							<div class="flex a-end j-center">
+								<div>¥</div>
+								<div>{{item.bonus}}</div>
+							</div>
+						</div>
+						<div class="flex col"
+							style="justify-content: space-between;border-top:1px solid #dadada;border-right:1px solid #dadada;border-bottom:1px solid #dadada;height:2rem;width: 5.1rem;">
+							<div class="flex"
+								style="justify-content: space-between;margin: auto 0;padding-left: 0.1rem;">
+								<div>
+									<div style="font-size: 0.5rem;">{{item.bonus}}元优惠券</div>
+									<div style="font-size: 0.25rem;color: #888;">失效时间:{{item.expireTime}}</div>
+								</div>
+								<!-- <div style="margin: auto 0;padding-right: 0.1rem;">
+									<van-checkbox v-model="item.checked"></van-checkbox>
+								</div> -->
+							</div>
+							<div class="flex"
+								style="border-top:1px dashed #dadada;height: .4rem;align-items: center;padding-left: 0.1rem;">
+								<div style="font-size: 0.18rem;">适用范围:{{item.couponDescribe}}</div>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</van-popup>
 		</div>
 	</div>
 </body>
+<link rel="stylesheet" href="./mescroll/mescroll.min.css">
+<script type="text/javascript" src="../script/aui-scroll.js"></script>
+<script type="text/javascript" src="./mescroll/mescroll.min.js"></script>
 <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
 <script type="text/javascript" src="../script/api.js"></script>
 <script type="text/javascript" src="../script/httpRequest.js"></script>
@@ -119,6 +178,16 @@
 				userid: '',
 				type: type,
 				canClick: true,
+				showPopup: false,
+				couponList: [],
+				couponNum: ""
+			},
+			created: function () {
+				this.store.map(function (item) {
+					item.couponName = "选择优惠券";
+					item.couponId = ""
+					item.couponData = ""
+				})
 			},
 			methods: {
 				init: function () {
@@ -149,11 +218,75 @@
 							});
 						}
 					})
-					//  获取当前地址
+					this.residueCoupon()
+				},
+				//查看可以优惠券数量
+				residueCoupon: function () {
+					var data = {
+						"storeId": this.userid,
+						"type": 'body',
+						"url": 'json'
+					}
+					var url = "residueCoupon",
+						_this = this;
+					this.$post(url, data, function (ret) {
+						if (ret.code == 0) {
+							_this.couponNum = ret.data
+						}
+					})
 				},
 				/**
 				 * 扫码入库
 				 */
+				showPopups: function (item) {
+					this.showPopup = true
+					var data = {
+						"storeId": this.userid,
+						"brand": item.brand,
+						"specs": item.specs,
+						"pattern": item.pattern,
+						"matnr": item.matnr,
+						"maktx": item.maktx,
+						"type": 'body',
+						"url": 'json'
+					}
+					var url = "storeCouponMessage",
+						_this = this;
+				    this.selectedData=item
+					this.$post(url, data, function (ret) {
+						if (ret.code == 0) {
+							ret.data.map(function (e) {
+								e.checked = false;
+							})
+							_this.couponList = ret.data
+							// _this.getcouponData(item, ret.data)
+						}
+					})
+				},
+				selected: function (a) {
+					this.selectedData
+					var _this=this;
+					this.store
+					.filter(function (e) {
+						return e.tirenumber==_this.selectedData.tirenumber && e.checked == false
+					})
+					.forEach(function (e) {
+						e.couponName = "-¥"+a.bonus;
+						e.popupid = a.id;
+						e.checked=true
+					})
+					this.showPopup=false
+				},
+				getcouponData: function (a, b) {
+					// alertJson(b)
+					this.store.filter(function (e) {
+						return e.tirenumber == a.tirenumber
+					}).forEach(function (e) {
+						// alertJson(e)
+						e.couponData = b
+					})
+					alertJson(this.store)
+				},
 				doneChoose: function () {
 					if (!this.address.lat || !this.address.lon) {
 						api.toast({

+ 1 - 1
luntai/sign_address.html

@@ -81,7 +81,7 @@
                 contractTask: contractTask,
                 SingLvStatus: false,
                 titleStyle: "#000",
-                text:""
+                text:"",
             },
             methods: {
                 init: function () {

+ 4 - 0
script/httpRequest.js

@@ -282,6 +282,10 @@ var $http = function () {
 	this.storeUnfreezeProposer="/web/biz/bizAgentFunction/storeUnfreezeProposer"
 	// 获取修改提示
 	this.getStoreSignMessage= "/web/biz/getStoreSignMessage"
+	//获取优惠券
+	this.storeCouponMessage="/web/biz/bizGoods/storeCouponMessage"
+	//获取优惠券余数
+	this.residueCoupon="/web/biz/bizGoods/residueCoupon"
 }
 $http.prototype.$postFile = function (url, data, callback) {
 	var urlT = this.ip + eval('this.' + url);

+ 43 - 41
script/vue_plugins.js

@@ -722,45 +722,45 @@ Vue.prototype.getCarNum = function (id, callback) {
 }
 //  获取新版本,然后下载安装
 Vue.prototype.getNewVersionUrl = function (c) {
-    var data = '',  
-        _this = this;
-          if(api.systemType == 'ios'){
-           var url = "ioscheckVersionU"
-        }else{
-           var url = "checkVersionU"
-        }
-    this.$get(url, data, function(ret) {
-        if (ret.code == 0 || ret.code == '0') {
-            if (ret.version != _this.getVersion()) {
-                if (api.systemType == 'ios') {
-                    api.alert({
-                        title: '新版本提示',
-                        msg: '检测到有新版本,请及时到APP Store 更新\n'+ret.plus_msg.replace(/\\n/g, "\n"),
-                        buttons:'我知道了!'
-                    }, function(ret, err) {
-                        if(ret){
-                          $api.clearStorage();
-                           _this.goWin("login ", "login.html", "");
-                        }
-                    });
-                } else {
-                    api.alert({
-                        title: '新版本提示',
-                        msg:ret.plus_msg.replace(/\\n/g, "\n"),
-                        buttons:'立即更新'
-                    }, function(res) {
-                        if(res){
-                            _this.downLoadApp(ret.url, c);
-                        }
-                    });
-                }
-            } else {
-                api.toast({
-                    msg: '已是最新版本'
-                })
-            }
-        }
-    })
+    // var data = '',  
+    //     _this = this;
+    //       if(api.systemType == 'ios'){
+    //        var url = "ioscheckVersionU"
+    //     }else{
+    //        var url = "checkVersionU"
+    //     }
+    // this.$get(url, data, function(ret) {
+    //     if (ret.code == 0 || ret.code == '0') {
+    //         if (ret.version != _this.getVersion()) {
+    //             if (api.systemType == 'ios') {
+    //                 api.alert({
+    //                     title: '新版本提示',
+    //                     msg: '检测到有新版本,请及时到APP Store 更新\n'+ret.plus_msg.replace(/\\n/g, "\n"),
+    //                     buttons:'我知道了!'
+    //                 }, function(ret, err) {
+    //                     if(ret){
+    //                       $api.clearStorage();
+    //                        _this.goWin("login ", "login.html", "");
+    //                     }
+    //                 });
+    //             } else {
+    //                 api.alert({
+    //                     title: '新版本提示',
+    //                     msg:ret.plus_msg.replace(/\\n/g, "\n"),
+    //                     buttons:'立即更新'
+    //                 }, function(res) {
+    //                     if(res){
+    //                         _this.downLoadApp(ret.url, c);
+    //                     }
+    //                 });
+    //             }
+    //         } else {
+    //             api.toast({
+    //                 msg: '已是最新版本'
+    //             })
+    //         }
+    //     }
+    // })
 }
 //  下载版本
 Vue.prototype.downLoadApp = function (url, callback) {
@@ -838,7 +838,8 @@ Vue.prototype.$post = function (url, data, callback, other) {
                     })
                 } else {
                     api.toast({
-                        msg: ret.msg
+                        msg: ret.msg,
+                        duration: 2000,
                     });
                 }
             }
@@ -858,7 +859,8 @@ Vue.prototype.$get = function (url, data, callback, other) {
             callback(ret);
         } else {
             api.toast({
-                msg: ret.msg
+                msg: ret.msg,
+                duration: 2000,
             });
         }
     }, other)