|
@@ -8,6 +8,239 @@ window.onbeforeunload = function(){
|
|
|
closeWebSocket();
|
|
|
}
|
|
|
|
|
|
+function calculateGoodsPrice(r){
|
|
|
+
|
|
|
+ var rMap = r.map;
|
|
|
+ var barCode = r.goodsDetails.prodBarcode;
|
|
|
+ var brand = r.goodsDetails.brand;
|
|
|
+ console.log(rMap);
|
|
|
+
|
|
|
+ if(rMap.yhq){
|
|
|
+ for(var i in rMap.yhq){
|
|
|
+ vm.coupons.set(i,rMap.yhq[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 是否有满减活动
|
|
|
+ if(rMap.mj){
|
|
|
+ if(rMap.mj[barCode] && !vm.mj.get(barCode)){
|
|
|
+ // 该商品是否已经有过满减活动
|
|
|
+ vm.mj.set(barCode,rMap.mj[barCode]);
|
|
|
+ }else if(rMap.mj[brand] && !vm.mj.get(brand)){
|
|
|
+ // 该品牌是否已经有过满减活动
|
|
|
+ vm.mj.set(brand,rMap.mj[brand]);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(rMap.mysy){
|
|
|
+ vm.mysy.push(rMap.mysy[barCode]);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(rMap.mz){
|
|
|
+ if(rMap.mz[barCode] && !vm.mz.get(barCode)){
|
|
|
+ // 该商品是否已经有过满赠活动
|
|
|
+ vm.mz.set(barCode,rMap.mz[barCode]);
|
|
|
+ }else if(rMap.mz[brand] && !vm.mz.get(brand)){
|
|
|
+ // 该品牌是否已经有过满赠活动
|
|
|
+ vm.mz.set(brand,rMap.mz[brand]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(rMap.zhjsp){
|
|
|
+ // 遍历该商品所有可能的组合价商品类型
|
|
|
+ for(var data in rMap.zhjsp){
|
|
|
+ if(!vm.zhjsp.get(data)){
|
|
|
+ // 分割组合价商品的条码,并以 条码:0 放入map中
|
|
|
+ var barCodeArray = data.toString().split(":");
|
|
|
+ var dataMap = new Map();
|
|
|
+ console.log(rMap.zhjsp[data]);
|
|
|
+ // dataMap.set();
|
|
|
+ for(var j = 0 ; j < barCodeArray.length ; j ++){
|
|
|
+ dataMap.set(barCodeArray[j],0);
|
|
|
+ }
|
|
|
+ vm.combinationPrice.set(data,rMap.zhjsp[data][0].combinedPrice)
|
|
|
+ vm.zhjsp.set(data,dataMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ calculateGoodsByMj(r.goodsDetails);
|
|
|
+ calculateGoodsByMysy(r.goodsDetails);
|
|
|
+ calculateGoodsByMz(r.goodsDetails);
|
|
|
+ calculateGoodsByZhjsp(r);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// ==================== 满减==========================
|
|
|
+
|
|
|
+// 满减
|
|
|
+function calculateGoodsByMj(goodsDetails){
|
|
|
+ if(vm.mj.get(goodsDetails.prodBarcode)){
|
|
|
+ fullReduction(goodsDetails,goodsDetails.prodBarcode);
|
|
|
+ }else if(vm.mj.get(goodsDetails.brand)){
|
|
|
+ fullReduction(goodsDetails,goodsDetails.brand);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+// 满减的计算内容
|
|
|
+function fullReduction(goodsDetails,key){
|
|
|
+ // 获取满减条件金额
|
|
|
+ var qualifiedAmount = vm.mj.get(key).qualifiedAmount;
|
|
|
+ // 获取已累积金额
|
|
|
+ var money = vm.accumulatedAmount.get(key);
|
|
|
+ if(isNaN(money)){
|
|
|
+ money = goodsDetails.retailPrice;
|
|
|
+ }else{
|
|
|
+ money = money + goodsDetails.retailPrice;
|
|
|
+ }
|
|
|
+ if(money >= qualifiedAmount){
|
|
|
+ vm.reduceMoney += vm.mj.get(key).deductionAmount; // 达到满减金额,获取扣减的额度
|
|
|
+ vm.mj.delete(key); // 获取后删除该商品的满减
|
|
|
+ vm.accumulatedAmount.delete(key); // 删除满减的金额
|
|
|
+ }else{
|
|
|
+ vm.accumulatedAmount.set(key,money);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// ============================= 满赠 ==============================
|
|
|
+
|
|
|
+// 满赠
|
|
|
+function calculateGoodsByMz(goodsDetails){
|
|
|
+
|
|
|
+ // 1.满赠的商品是不是自己,遍历满赠商品数组
|
|
|
+ isSend(vm.fullGiftCode,goodsDetails,"满赠");
|
|
|
+
|
|
|
+ if(vm.mz.get(goodsDetails.prodBarcode)){
|
|
|
+ fullGift(goodsDetails,goodsDetails.prodBarcode);
|
|
|
+ }else if(vm.mz.get(goodsDetails.brand)){
|
|
|
+ fullGift(goodsDetails,goodsDetails.brand);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+function fullGift(goodsDetails,key){
|
|
|
+ // 获取满赠条件金额
|
|
|
+ var qualifiedAmount = vm.mz.get(key).qualifiedAmount;
|
|
|
+ // 获取已累积金额
|
|
|
+ var money = vm.accumulatedAmountForFullGift.get(key);
|
|
|
+ if(isNaN(money)){
|
|
|
+ money = goodsDetails.retailPrice;
|
|
|
+
|
|
|
+ }else{
|
|
|
+ money = money + goodsDetails.retailPrice;
|
|
|
+ }
|
|
|
+ // 达到满赠的要求
|
|
|
+ if(money >= qualifiedAmount){
|
|
|
+ // 将满赠的商品放入数组中,重置金额
|
|
|
+ vm.fullGiftCode.push(vm.mz.get(key).giftBarcode);
|
|
|
+ vm.mz.delete(key); // 获取后删除该商品的满减
|
|
|
+ vm.accumulatedAmountForFullGift.delete(key); // 删除满减的金额
|
|
|
+
|
|
|
+ // 2.购物车的商品里面是否有满赠的商品
|
|
|
+ shopCartContain(vm.fullGiftCode,goodsDetails,"满赠");
|
|
|
+ }else{
|
|
|
+ vm.accumulatedAmountForFullGift.set(key,money);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 买一送一
|
|
|
+function calculateGoodsByMysy(goodsDetails){
|
|
|
+ // 判断当前商品是否为赠品
|
|
|
+ isSend(vm.mysy,goodsDetails,"买一送一");
|
|
|
+ // 判断购物车里面是否有商品为赠品
|
|
|
+ shopCartContain(vm.mysy,goodsDetails,"买一送一");
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+// 判断当前商品是否为赠品
|
|
|
+function isSend(activity,goodsDetails,activityName){
|
|
|
+ if(activity.indexOf(goodsDetails.prodBarcode) >= 0){
|
|
|
+ // 如果符合条件,把赠送的条码给删除(一次性)
|
|
|
+ var index = activity.indexOf(goodsDetails.prodBarcode);
|
|
|
+ activity.splice(index,1);
|
|
|
+ // 设置赠品的单价
|
|
|
+ goodsDetails.discountedPrice = goodsDetails.retailPrice;
|
|
|
+ goodsDetails.actualPaymentAmount = 0;
|
|
|
+ goodsDetails.activity = activityName;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 判断购物车里面是否有商品为赠品
|
|
|
+function shopCartContain(activity,goodsDetails,activityName){
|
|
|
+ if(vm.goodsList && vm.goodsList.length > 0 ){
|
|
|
+ for(var i = 0 ; i < vm.goodsList.length ; i ++){
|
|
|
+ // 如果有商品为赠品,则把价格置位0并跳出循环
|
|
|
+ if(activity.indexOf(vm.goodsList[i].prodBarcode) >= 0 && vm.goodsList[i].actualPaymentAmount != 0){
|
|
|
+ // 如果符合条件,把赠送的条码给删除(一次性)
|
|
|
+ var index = vm.mysy.indexOf(goodsDetails.prodBarcode);
|
|
|
+ activity.splice(index,1);
|
|
|
+ vm.goodsList[i].discountedPrice = vm.goodsList[i].retailPrice;
|
|
|
+ vm.goodsList[i].actualPaymentAmount = 0;
|
|
|
+ vm.goodsList[i].activity = activityName;
|
|
|
+
|
|
|
+
|
|
|
+ vm.discountedPrice = vm.discountedPrice + vm.goodsList[i].retailPrice ;
|
|
|
+ vm.actualPrice = vm.actualPrice - vm.goodsList[i].retailPrice ;
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// ======================= 组合价商品 ============================
|
|
|
+// 组合价商品
|
|
|
+function calculateGoodsByZhjsp(r){
|
|
|
+ var barCode = r.goodsDetails.prodBarcode;
|
|
|
+ if(r.map.zhjsp){
|
|
|
+ // 将有组合的商品设置为1 ps:{"flag" => 0, "4005808550739" => 1, "4305615120454" => 0}
|
|
|
+ vm.zhjsp.forEach(function(value,key,map){
|
|
|
+ // 将组合价中组合的产品出现的次数+1
|
|
|
+ value.forEach(function(v, k ,m){
|
|
|
+ if(k === barCode)
|
|
|
+ m.set(k,v+1);
|
|
|
+ });
|
|
|
+ var flag = 1;
|
|
|
+ // 判断是否有商品成功组合
|
|
|
+ value.forEach(function(v, k ,m){
|
|
|
+ if(v === 0)
|
|
|
+ flag = 0;
|
|
|
+ });
|
|
|
+ if(flag === 1){
|
|
|
+ var combinationPrice = vm.combinationPrice.get(key);
|
|
|
+ var barCodeArr = key.toString().split(":");
|
|
|
+ for( var j = 0 ; j < barCodeArr.length ; j ++ ){
|
|
|
+ // 如果是扫描的产品,直接退出,因为购物车中无该产品
|
|
|
+ if(barCodeArr[j] == barCode){
|
|
|
+ r.goodsDetails.isCombination = 1;
|
|
|
+ r.goodsDetails.discountedPrice = r.goodsDetails.retailPrice - combinationPrice; // 优惠价格
|
|
|
+ r.goodsDetails.actualPaymentAmount = combinationPrice; // 实际支付价格
|
|
|
+ r.goodsDetails.activity = "组合价";
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ for(var i = 0 ; i < vm.goodsList.length ; i ++){
|
|
|
+ if(vm.goodsList[i].prodBarcode === barCodeArr[j] && !vm.goodsList[i].isCombination){
|
|
|
+ // 如果符合条件,把赠送的条码给删除(一次性)
|
|
|
+ vm.goodsList[i].discountedPrice = vm.goodsList[i].retailPrice ; // 优惠价格
|
|
|
+ vm.goodsList[i].actualPaymentAmount = 0; // 实际支付价格
|
|
|
+ vm.goodsList[i].isCombination = 1;
|
|
|
+ vm.goodsList[i].activity = "组合价";
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 扣减
|
|
|
+ var updateMap = map.get(key);
|
|
|
+ updateMap.forEach(function(v, k ,m){
|
|
|
+ m.set(k,v-1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
let vm = new Vue({
|
|
|
el: '#rrapp',
|
|
|
data: {
|
|
@@ -35,6 +268,9 @@ let vm = new Vue({
|
|
|
storeId:null,
|
|
|
index:0,
|
|
|
max:0,
|
|
|
+ totalPrice:0,
|
|
|
+ discountedPrice:0,
|
|
|
+ actualPrice:0,
|
|
|
ruleValidate: {
|
|
|
name: [
|
|
|
{required: true, message: '名称不能为空', trigger: 'blur'}
|
|
@@ -42,40 +278,65 @@ let vm = new Vue({
|
|
|
},
|
|
|
q: {
|
|
|
name: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ // 买一送一
|
|
|
+ mysy: [],
|
|
|
+ // 组合价
|
|
|
+ zhjsp: new Map(),
|
|
|
+ combinationPrice: new Map(), // 组合价商品的组合价
|
|
|
+ // 满减
|
|
|
+ mj: new Map(),
|
|
|
+ accumulatedAmount: new Map(), // 累积金额(满减使用的)
|
|
|
+ reduceMoney:0, // 满减金额
|
|
|
+ showReduceMoney:0, // 用于展示的满减金额
|
|
|
+ // 满赠
|
|
|
+ mz: new Map(),
|
|
|
+ accumulatedAmountForFullGift: new Map(), // 累积金额(满赠使用的)
|
|
|
+ fullGiftCode:[],// 满赠商品条码
|
|
|
+ // 优惠券
|
|
|
+ coupons: new Map(),
|
|
|
},
|
|
|
methods: {
|
|
|
query: function () {
|
|
|
-
|
|
|
vm.storeId = sessionStorage.getItem("storeId");;
|
|
|
-
|
|
|
var thisGoods = {};
|
|
|
$.get("../goods/details/"+vm.prodBarcode+"/"+vm.storeId, function (r) {
|
|
|
- console.log(typeof r);
|
|
|
- console.log(r.code == 0);
|
|
|
- console.log(r.code);
|
|
|
if (r.code == 0) {
|
|
|
|
|
|
- vm.goodsDetail = true;
|
|
|
- thisGoods.name = r.goodsDetails.name;
|
|
|
- thisGoods.primaryPicUrl = r.goodsDetails.primaryPicUrl;
|
|
|
- thisGoods.retailPrice = r.goodsDetails.retailPrice;
|
|
|
- thisGoods.specification = r.goodsDetails.specification;
|
|
|
- thisGoods.prodBarcode = r.goodsDetails.prodBarcode;
|
|
|
- thisGoods.stockNum = r.goodsDetails.stockNum;
|
|
|
- // thisGoods.goodsDesc = r.goodsDetails.goodsDesc;
|
|
|
- thisGoods.sellVolume = 1;
|
|
|
+ // r.goodsDetails.discountedPrice = 0;
|
|
|
+ // r.goodsDetails.actualPaymentAmount = r.goodsDetails.retailPrice;
|
|
|
|
|
|
+ calculateGoodsPrice(r);
|
|
|
+ vm.goodsDetail = true;
|
|
|
+ // thisGoods.name = r.goodsDetails.name;// thisGoods.primaryPicUrl = r.goodsDetails.primaryPicUrl; // thisGoods.retailPrice = r.goodsDetails.retailPrice;// thisGoods.specification = r.goodsDetails.specification; // thisGoods.prodBarcode = r.goodsDetails.prodBarcode;// thisGoods.stockNum = r.goodsDetails.stockNum;// thisGoods.goodsDesc = r.goodsDetails.goodsDesc;// thisGoods.sellVolume = 1;// thisGoods.id = vm.index++;
|
|
|
+ r.goodsDetails.sellVolume = 1;
|
|
|
+ r.goodsDetails.id = vm.index++;
|
|
|
if(!vm.goodsList[vm.index]){
|
|
|
vm.index = vm.max;
|
|
|
}
|
|
|
-
|
|
|
- thisGoods.id = vm.index++;
|
|
|
vm.max++;
|
|
|
-
|
|
|
- var data = Object.assign({}, JSON.parse(JSON.stringify(thisGoods)));
|
|
|
+ r.goodsDetails.goodsDesc = "";
|
|
|
+ // r.goodsDetails.primaryPicUrl = "";
|
|
|
+ var data = Object.assign({}, JSON.parse(JSON.stringify(r.goodsDetails)));
|
|
|
vm.goodsList.push(data);
|
|
|
- vm.goods = thisGoods;
|
|
|
+ vm.goods = r.goodsDetails;
|
|
|
+
|
|
|
+ vm.totalPrice = (vm.totalPrice + r.goodsDetails.retailPrice);
|
|
|
+ if(vm.reduceMoney > 0){
|
|
|
+ vm.discountedPrice = vm.discountedPrice + r.goodsDetails.discountedPrice + vm.reduceMoney;
|
|
|
+ vm.actualPrice = vm.actualPrice + r.goodsDetails.actualPaymentAmount - vm.reduceMoney;
|
|
|
+ vm.showReduceMoney = vm.showReduceMoney + vm.reduceMoney;
|
|
|
+ vm.reduceMoney = 0;
|
|
|
+ }else{
|
|
|
+ vm.discountedPrice = vm.discountedPrice + r.goodsDetails.discountedPrice ;
|
|
|
+ vm.actualPrice = vm.actualPrice + r.goodsDetails.actualPaymentAmount ;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 处理精度
|
|
|
+ vm.totalPrice = Math.round(vm.totalPrice * 100) / 100;
|
|
|
+ vm.discountedPrice = Math.round(vm.discountedPrice * 100) / 100;
|
|
|
+ vm.actualPrice = Math.round(vm.actualPrice * 100) / 100;
|
|
|
+ vm.showReduceMoney = Math.round(vm.showReduceMoney * 100) / 100;
|
|
|
|
|
|
} else {
|
|
|
alert(r.msg);
|
|
@@ -85,28 +346,48 @@ let vm = new Vue({
|
|
|
},
|
|
|
add:function(value){
|
|
|
// 增加数量
|
|
|
- var goods = this.goodsList[value];
|
|
|
- goods.sellVolume = goods.sellVolume + 1;
|
|
|
+ for(var i = 0 ; i < this.goodsList.length ; i++){
|
|
|
+ if(this.goodsList[i].id == value){
|
|
|
+ var goods = this.goodsList[i];
|
|
|
+ goods.sellVolume = goods.sellVolume + 1;
|
|
|
+ vm.totalPrice = vm.totalPrice + goods.retailPrice;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
minus:function(value){
|
|
|
// 减少数量
|
|
|
- var goods = this.goodsList[value];
|
|
|
- if(goods.sellVolume === 1){
|
|
|
- alert("数量至少为1个");
|
|
|
- return ;
|
|
|
+ for(var i = 0 ; i < this.goodsList.length ; i++){
|
|
|
+ if(this.goodsList[i].id == value){
|
|
|
+ var goods = this.goodsList[i];
|
|
|
+ if(goods.sellVolume === 1){
|
|
|
+ alert("数量至少为1个");
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ goods.sellVolume = goods.sellVolume - 1;
|
|
|
+ vm.totalPrice = vm.totalPrice - goods.retailPrice;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- goods.sellVolume = goods.sellVolume - 1;
|
|
|
+
|
|
|
},
|
|
|
deleteItem:function(value){
|
|
|
console.log(value);
|
|
|
// 删除这条记录
|
|
|
- this.goodsList.splice(value,1);
|
|
|
+ for(var i = 0 ; i < this.goodsList.length ; i++){
|
|
|
+ if(this.goodsList[i].id == value){
|
|
|
+ var goods = this.goodsList[i];
|
|
|
+ vm.totalPrice = vm.totalPrice - (goods.retailPrice * goods.sellVolume);
|
|
|
+ this.goodsList.splice(i,1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.index = value;
|
|
|
|
|
|
},
|
|
|
clearGoodsList:function(){
|
|
|
this.goodsList = [];
|
|
|
-
|
|
|
+ vm.totalPrice = 0;
|
|
|
|
|
|
},
|
|
|
toOrderSubmit:function(){
|
|
@@ -122,6 +403,7 @@ let vm = new Vue({
|
|
|
vm.machineCode = sessionStorage.getItem("machineCode");
|
|
|
console.log(vm.machineCode);
|
|
|
var param = {'userInfo':vm.userInfo,'payCode':this.$refs.payCode.currentValue,'goodsList':vm.goodsList,'sessionId':vm.sessionId,'machineCode':vm.machineCode};
|
|
|
+ console.log(JSON.stringify(param));
|
|
|
this.$refs.payCode.currentValue = '';
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
@@ -141,6 +423,26 @@ let vm = new Vue({
|
|
|
vm.goodsList = [];
|
|
|
vm.customname = '' ;
|
|
|
vm.customidcard = '';
|
|
|
+ vm.totalPrice = 0;
|
|
|
+ vm.discountedPrice = 0;
|
|
|
+ vm.actualPrice = 0;
|
|
|
+ // 买一送一
|
|
|
+ vm.mysy = [];
|
|
|
+ // 组合价
|
|
|
+ vm.zhjsp = new Map();
|
|
|
+ vm.combinationPrice = new Map(); // 组合价商品的组合价
|
|
|
+ // 满减
|
|
|
+ vm.mj = new Map();
|
|
|
+ vm.accumulatedAmount = new Map();// 累积金额(满减使用的)
|
|
|
+ vm.reduceMoney = 0; // 满减金额
|
|
|
+ vm.showReduceMoney = 0; // 用于展示的满减金额
|
|
|
+ // 满赠
|
|
|
+ vm.mz = new Map();
|
|
|
+ vm.accumulatedAmountForFullGift = new Map(); // 累积金额(满赠使用的)
|
|
|
+ vm.fullGiftCode = [];// 满赠商品条码
|
|
|
+ // 优惠券
|
|
|
+ vm.coupons = new Map();
|
|
|
+
|
|
|
// alert('打印小票完成');
|
|
|
}else{
|
|
|
// alert("打印小票失败");
|
|
@@ -153,7 +455,6 @@ let vm = new Vue({
|
|
|
|
|
|
},
|
|
|
getIDCardInfo: function(){
|
|
|
- console.log(1);
|
|
|
$.get("../order/getIdCardInfo", function (r){
|
|
|
if(r.code === 0){
|
|
|
if(!r.info){
|
|
@@ -173,8 +474,10 @@ let vm = new Vue({
|
|
|
this.userInfo.customName = this.$refs.customName.value ;
|
|
|
this.userInfo.customIDCard = this.$refs.customIDCard.value ;
|
|
|
this.userInfo.customPhone = this.$refs.customPhone.value;
|
|
|
+ if(this.$refs.couponSn)
|
|
|
+ this.userInfo.couponSn = this.$refs.couponSn.value;
|
|
|
var idcardReg = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$|^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/;
|
|
|
- if(!this.userInfo.customName){
|
|
|
+ /*if(!this.userInfo.customName){
|
|
|
alert("姓名不能为空!");
|
|
|
return ;
|
|
|
}
|
|
@@ -186,8 +489,15 @@ let vm = new Vue({
|
|
|
if(!(/^1[3456789]\d{9}$/.test(this.userInfo.customPhone))){
|
|
|
alert("手机号码有误,请重填");
|
|
|
return ;
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
+ if(this.userInfo.couponSn){
|
|
|
+ var coupon = vm.coupons.get(this.userInfo.couponSn);
|
|
|
+ if(coupon == null){
|
|
|
+ alert("请输入正确的优惠券码");
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
|
@@ -222,7 +532,7 @@ let vm = new Vue({
|
|
|
vm.orderProcessRecord.eleOrderStartTime = parsedate(vm.orderProcessRecord.eleOrderStartTime);
|
|
|
}
|
|
|
if(vm.orderProcessRecord.paymentStartTime){
|
|
|
- vm.orderProcessRecord.paymentStartTime = parsedate(vm.orderProcessRecord.paymentStartTime);
|
|
|
+ vm.orderProcessRecord.paymentStartTime = parsedate(vm.orderProcessRecord.paymentStartTime);
|
|
|
}
|
|
|
if(vm.orderProcessRecord.waybillStartTime){
|
|
|
vm.orderProcessRecord.waybillStartTime = parsedate(vm.orderProcessRecord.waybillStartTime);
|
|
@@ -434,8 +744,8 @@ function openWebSocket() {
|
|
|
//注意ws、wss使用不同的端口。我使用自签名的证书测试,
|
|
|
//无法使用wss,浏览器打开WebSocket时报错
|
|
|
//ws对应http、wss对应https。
|
|
|
- webSocket = new WebSocket("ws://183.62.225.124:8080/ws/server/"+storeId);
|
|
|
- // webSocket = new WebSocket("ws://127.0.0.1:8080/ws/server/"+storeId);
|
|
|
+ // webSocket = new WebSocket("ws://183.62.225.124:8080/ws/server/"+storeId);
|
|
|
+ webSocket = new WebSocket("ws://localhost:8080//ws/server/"+storeId);
|
|
|
if (webSocket.readyState === webSocket.CONNECTING) {
|
|
|
console.log('1.连接正在打开......');
|
|
|
}
|
|
@@ -649,6 +959,10 @@ function queryAssistantInfo(){
|
|
|
});
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|