Merge pull request !201 from Admin/sit-Leung-v3
This commit is contained in:
Admin 2022-03-03 04:10:23 +00:00 committed by Gitee
commit d587a93f42
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 74 additions and 27 deletions

View File

@ -425,10 +425,13 @@ export const dogquery = (productCode,type) => {
//查询商品信息 //查询商品信息
export const productQuery = (productCode) => { export const productQuery = (productCode) => {
var data = { let url = 'product/query';
productCode:productCode if(productCode) {
} url += '?productCode='+encodeURI(productCode);
return fetch('product/query', data, 'POST' ) }
var data = {
}
return fetch(url, data, 'POST' )
} }

View File

@ -75,6 +75,21 @@ let util = {
return mapping[paytype]; return mapping[paytype];
return ''; return '';
}, },
getAgeMapping(tagAgeStr){
let mapping = {
"1":'<4月龄,离乳期', //奶糕
"2":'4-12月龄,幼年',//幼年
"3":'1-7岁,成年',//成年
"4":'>7岁,老年',//老年
};
for(let id in mapping) {
let item = mapping[id];
if(item.indexOf(tagAgeStr)>-1) {
return id;
}
}
return false;
},
/* /*
couponDisplayFilter(couponList,filterObj,returnRequirement){ couponDisplayFilter(couponList,filterObj,returnRequirement){
//Dictionary : filterObj {} //Dictionary : filterObj {}

View File

@ -36,15 +36,15 @@
</a> </a>
</swiper-slide> </swiper-slide>
<!-- <swiper-slide> <swiper-slide>
<a href="/" target="_blank"> <a href="#">
<picture> <picture>
<source media="(max-width: 768px)" srcset="/images/banner/four.jpg"> <source media="(max-width: 768px)" srcset="/images/banner/38.jpg">
<source media="(min-width: 769px)" srcset="/images/banner/pc-banner4.png"> <source media="(min-width: 769px)" srcset="/images/banner/pc-38.png">
<img src="/images/banner/four.jpg"> <img src="/images/banner/four.jpg">
</picture> </picture>
</a> </a>
</swiper-slide> --> </swiper-slide>
</swiper> </swiper>
<div <div
id="homeBannerSwiperPagnation" id="homeBannerSwiperPagnation"

View File

@ -48,13 +48,14 @@
</i> </i>
<div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')"> <div class="rc-userfont" :style="(item.validTo?'visibility:visible':'visibility:hidden')">
<strong>有效期</strong> <strong>有效期</strong>
<span>{{item.validFrom}}</span> <span>{{item.validFrom}}</span>
<span></span>
<em>{{item.validTo}}</em> <em>{{item.validTo}}</em>
</div> </div>
<nuxt-link :to="`/productdetails/productlist`" v-if="activeIndex==0"> <nuxt-link :to="`/productdetails/productlist`" v-if="item.canUse">
<div class="ts-standard-btn"> <div class="ts-standard-btn">
立即使用 立即使用
</div> </div>
</nuxt-link> </nuxt-link>
</div> </div>
@ -153,6 +154,7 @@ export default {
} }
}); });
this.fullCouponList = list; this.fullCouponList = list;
this.selectGoods('',UNUSE);
} }
}, },
selectGoods(item, index) { selectGoods(item, index) {
@ -197,6 +199,7 @@ export default {
valDateToTime = new Date(coupon.fValidTo).getTime(); valDateToTime = new Date(coupon.fValidTo).getTime();
} }
if(curTime > valDateToTime && coupon.status==0) { if(curTime > valDateToTime && coupon.status==0) {
coupon.canUse=false;
this.newlist.push(coupon); this.newlist.push(coupon);
} }
} }
@ -209,11 +212,13 @@ export default {
valDateToTime = new Date(coupon.fValidTo).getTime(); valDateToTime = new Date(coupon.fValidTo).getTime();
} }
if(valDateFromTime && valDateToTime && curTime >= valDateFromTime && curTime <= valDateToTime && coupon.status == 0) { if(valDateFromTime && valDateToTime && curTime >= valDateFromTime && curTime <= valDateToTime && coupon.status == 0) {
coupon.canUse=true;
this.newlist.push(coupon); this.newlist.push(coupon);
} }
break; break;
case USED: case USED:
if(coupon.status == 1) { if(coupon.status == 1) {
coupon.canUse=false;
this.newlist.push(coupon); this.newlist.push(coupon);
} }
break; break;
@ -243,7 +248,6 @@ export default {
this.$router.push({ path: "/userlogin/login"}) this.$router.push({ path: "/userlogin/login"})
} }
this.userdraw(this.usermessage.data.mobile); this.userdraw(this.usermessage.data.mobile);
this.selectGoods('',0);
}, },
components: { components: {
Myheader, Myheader,

View File

@ -424,7 +424,7 @@ export default {
if(myCoupon.udf2!='H5') { if(myCoupon.udf2!='H5') {
dateChecked=false; dateChecked=false;
} }
//TODO add more checking
if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) { if(dateChecked && myCoupon.activityId != 10 && myCoupon.status == 0 && (!myCoupon.productCodes || myCoupon.productCodes.indexOf(itemInCart.productCode)>-1)) {
data.data.splice(tmpIndex,1); data.data.splice(tmpIndex,1);
_self.drawlist.push(myCoupon); _self.drawlist.push(myCoupon);
@ -635,21 +635,25 @@ export default {
this.goldmedal = JSON.parse(this.$route.query.list); this.goldmedal = JSON.parse(this.$route.query.list);
this.getAddressList(); this.getAddressList();
this.checkIsLogin(); this.checkIsLogin();
let user = this.$store.state.userInfo;
let memberId = '';
if(user)
memberId = user.data.id;
this.finalAmount = this.sumPrice; this.finalAmount = this.sumPrice;
this.goldmedal.forEach((item) => { this.goldmedal.forEach((item) => {
_hmt.push([ _hmt.push([
"_trackCustomEvent", "_trackCustomEvent",
"placing_order", "placing_order",
{ {
//TODO order id add here "member_id": memberId,
"product_id":item.productCode, "product_id": item.productCode,
"product_name": item.productName, "product_name": item.productName,
"product_quantity" : item.buyCount, "product_quantity" : item.buyCount,
"product_amount" : item.buyCount*item.productPrice, "product_amount" : item.buyCount*item.productPrice,
} }
]) ])
}); });
let user = this.$store.state.userInfo;
if(user) { if(user) {
this.userdraw(user.data.mobile); this.userdraw(user.data.mobile);
} }

View File

@ -107,7 +107,7 @@
import Myheader from "~/components/header.vue"; import Myheader from "~/components/header.vue";
import tabs from "@/components/tabs.vue"; import tabs from "@/components/tabs.vue";
import vueQr from 'vue-qr' import vueQr from 'vue-qr'
import { mapMutations } from "vuex";
import { generateOrderAlipay, updateOrderWX, monitorOrderNotify,repayOrde } from "../../ajax/getData"; import { generateOrderAlipay, updateOrderWX, monitorOrderNotify,repayOrde } from "../../ajax/getData";
import util from "@/ajax/util"; import util from "@/ajax/util";
@ -120,7 +120,7 @@ export default {
paymentTimer:undefined, paymentTimer:undefined,
isSucess: false, isSucess: false,
h5PayUrl:"", h5PayUrl:"",
dialogSuccess: true, dialogSuccess: false,
paytype: "微信", paytype: "微信",
userpaystype: [ userpaystype: [
{ {
@ -158,6 +158,7 @@ export default {
this.defaultHandlePayment(); this.defaultHandlePayment();
}, },
methods: { methods: {
...mapMutations(["checkIsLogin"]),
detectQrcodeDisplay(){ detectQrcodeDisplay(){
let payType = this.util.pickPaytype(); let payType = this.util.pickPaytype();
switch(payType) { switch(payType) {
@ -192,10 +193,16 @@ export default {
//TODO raise WX jsapi pay //TODO raise WX jsapi pay
break; break;
} }
this.checkIsLogin();
let user = this.$store.state.userInfo;
let memberId = '';
if(user)
memberId = user.data.id;
_hmt.push([ _hmt.push([
"_trackCustomEvent", "_trackCustomEvent",
"payment", "payment",
{ {
"member_id": memberId,
"payType" : payType, "payType" : payType,
"product_amount" : this.userPayData.userprice, "product_amount" : this.userPayData.userprice,
} }
@ -268,10 +275,15 @@ export default {
if (res.success) { if (res.success) {
this.qrtext = '成功加入群的二维码'; this.qrtext = '成功加入群的二维码';
this.dialogSuccess = true; this.dialogSuccess = true;
let user = this.$store.state.userInfo;
let memberId = '';
if(user)
memberId = user.data.id;
_hmt.push([ _hmt.push([
"_trackCustomEvent", "_trackCustomEvent",
"payment_finished", "payment_finished",
{ {
"member_id" : memberId,
"payType" : 'native', "payType" : 'native',
"product_amount" : this.userPayData.userprice, "product_amount" : this.userPayData.userprice,
} }

View File

@ -336,7 +336,10 @@ export default {
productAttachmentList = [insertTmpObj]; productAttachmentList = [insertTmpObj];
userbuy = false; userbuy = false;
} else { } else {
mainProduct = await productQuery(mainProductCode); if(mainProductCode && mainProductCode.length>2) {
mainProduct = await productQuery(mainProductCode);
mainProduct = mainProduct.pop();
}
let stopLeftAllotmentChecking = false; let stopLeftAllotmentChecking = false;
let stopIndex = 0; let stopIndex = 0;
for(let singleCode of productCode) { for(let singleCode of productCode) {
@ -597,12 +600,18 @@ export default {
if(item.packageTypeIds!='1') { if(item.packageTypeIds!='1') {
dateChecked=false; dateChecked=false;
} }
if(this.mainProduct && this.mainProduct.petType) { if(this.mainProduct && this.mainProduct.petType && item.petCategoryIds) {
if(this.mainProduct.petType===0 && item.petCategoryIds!='1') if(this.mainProduct.petType===0 && item.petCategoryIds!='1')
dateChecked=false; dateChecked=false;
if(this.mainProduct.petType===1 && item.petCategoryIds!='2') if(this.mainProduct.petType===1 && item.petCategoryIds!='2')
dateChecked=false; dateChecked=false;
} }
if(this.mainProduct && this.mainProduct.tagUsedAge && item.petAgeTypeIds) {
let productToCouponAgeId = this.util.getAgeMapping(this.mainProduct.tagUsedAge);
if(item.petAgeTypeIds!=productToCouponAgeId)
dateChecked=false;
}
if(dateChecked && item.activityId!=10) { if(dateChecked && item.activityId!=10) {
if(!item.productCodes) { if(!item.productCodes) {
menualist.push(item); menualist.push(item);

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 546 KiB