mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 02:06:38 +08:00
更改
This commit is contained in:
parent
cbe204d689
commit
8baf7eb678
@ -15,11 +15,11 @@
|
||||
rc-border-colour--brand4
|
||||
"
|
||||
>
|
||||
<div class="uservideo" v-if="videoshow">
|
||||
<video controls="" preload="videoimg">
|
||||
<source :src= videolist type="video/mp4">
|
||||
</video>
|
||||
</div>
|
||||
<div class="uservideo" v-if="videoshow">
|
||||
<video controls="" preload="videoimg">
|
||||
<source :src="videolist" type="video/mp4" />
|
||||
</video>
|
||||
</div>
|
||||
<div class="rc-column" v-if="!videoshow">
|
||||
<div data-js-carousel="" data-image-gallery="true">
|
||||
<div
|
||||
@ -104,30 +104,26 @@
|
||||
<div class="online rc-md-down"></div>
|
||||
<div class="rc-main">
|
||||
<div class="productdetails">
|
||||
<div class="rc-productdetail" v-if="!userbuy">
|
||||
<i class="ts-row-title">适用年龄:</i>
|
||||
<span>{{ curItem.tagUsedAge }}</span>
|
||||
</div>
|
||||
<div class="rc-productdetail" v-if="!userbuy">
|
||||
<i class="ts-row-title">所属分类:</i>
|
||||
<span>{{ curItem.categoryName }}</span>
|
||||
|
||||
</div>
|
||||
<div class="rc-button" v-if="userloginbuy">
|
||||
<div class="rc-productdetail" v-if="!userbuy">
|
||||
<i class="ts-row-title">适用年龄:</i>
|
||||
<span>{{ curItem.tagUsedAge }}</span>
|
||||
</div>
|
||||
<div class="rc-productdetail" v-if="!userbuy">
|
||||
<i class="ts-row-title">所属分类:</i>
|
||||
<span>{{ curItem.categoryName }}</span>
|
||||
</div>
|
||||
<div class="rc-button" v-if="userloginbuy">
|
||||
<span @click="chuafangbuy()">立即购买</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="rc-productdetail" v-if="userbuy">
|
||||
<i class="ts-row-title">商品价格:</i>
|
||||
<span class="ts-realprice">¥{{ curItem.ecPrice }}</span>
|
||||
<span class="ts-remove ts-ecprice"
|
||||
>¥{{ curItem.rsp }}
|
||||
<span class="ts-remove ts-ecprice">¥{{ curItem.rsp }} </span>
|
||||
<span class="ts-record" v-if="curItem.basePoint !== 0">
|
||||
购买该商品你将获得{{ curItem.basePoint }}积分
|
||||
</span>
|
||||
<span class="ts-record" v-if="curItem.basePoint!==0">
|
||||
购买该商品你将获得{{curItem.basePoint}}积分
|
||||
</span>
|
||||
|
||||
|
||||
<!-- <span class="rc-title">购买该商品你将得到22积分</span> -->
|
||||
</div>
|
||||
<div class="rc-productdetai" v-if="userbuy">
|
||||
@ -150,12 +146,22 @@
|
||||
<div>
|
||||
<i class="ts-row-title">商品规格:</i>
|
||||
</div>
|
||||
<div class="ts-tag-list">
|
||||
<em v-for="(item, index) in newlist" :key="index" @click="selectsearch(item, index)" :class="[(activeIndexa==index && item.leftAllotment>0)?'active':'unactive',item.leftAllotment>0?'':'disabled']">
|
||||
{{ item.specifications }}
|
||||
</em>
|
||||
</div>
|
||||
<!-- 一个标品有多个商品, 每个商品有不同的价格
|
||||
<div class="ts-tag-list">
|
||||
<em
|
||||
v-for="(item, index) in newlist"
|
||||
:key="index"
|
||||
@click="selectsearch(item, index)"
|
||||
:class="[
|
||||
activeIndexa == index && item.leftAllotment > 0
|
||||
? 'active'
|
||||
: 'unactive',
|
||||
item.leftAllotment > 0 ? '' : 'disabled',
|
||||
]"
|
||||
>
|
||||
{{ item.specifications }}
|
||||
</em>
|
||||
</div>
|
||||
<!-- 一个标品有多个商品, 每个商品有不同的价格
|
||||
<em class="active">
|
||||
{{ item.specifications }}
|
||||
</em>
|
||||
@ -163,7 +169,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-main">
|
||||
<div class="rc-produnnum" v-if="(userbuy && curItem.leftAllotment>0)">
|
||||
<div
|
||||
class="rc-produnnum"
|
||||
v-if="userbuy && curItem.leftAllotment > 0"
|
||||
>
|
||||
<div><i class="ts-row-title">商品数量:</i></div>
|
||||
<img
|
||||
src="../../assets/image/userjian.png"
|
||||
@ -208,11 +217,13 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="rc-button" v-if="(userbuy && curItem.leftAllotment>0)">
|
||||
<div
|
||||
class="rc-button"
|
||||
v-if="userbuy && curItem.leftAllotment > 0"
|
||||
>
|
||||
<span @click="usertanchu(curItem, 0)">加入购物车</span>
|
||||
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="online bold rc-md-down"></div>
|
||||
</div>
|
||||
@ -224,10 +235,16 @@
|
||||
</div>
|
||||
<FixRight></FixRight>
|
||||
<Myfooter v-on:litentop="showmesg"></Myfooter>
|
||||
|
||||
</div>
|
||||
<el-dialog :visible.sync="dialogInfo1" @close="userclose" class="pop_coupon" :close-on-click-modal="false">
|
||||
<div class="ts-no-data" v-if="usernewlist.length<=0">目前还没有可用的优惠券</div>
|
||||
<el-dialog
|
||||
:visible.sync="dialogInfo1"
|
||||
@close="userclose"
|
||||
class="pop_coupon"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<div class="ts-no-data" v-if="usernewlist.length <= 0">
|
||||
目前还没有可用的优惠券
|
||||
</div>
|
||||
<div class="rs-dis">
|
||||
<div
|
||||
class="rc-discount"
|
||||
@ -235,32 +252,36 @@
|
||||
:key="index"
|
||||
>
|
||||
<img :src="userimage" alt="" />
|
||||
<div class="rc-contair">
|
||||
<div class="rc-left">
|
||||
<div>
|
||||
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
|
||||
¥
|
||||
</i>
|
||||
<span>
|
||||
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
|
||||
</span>
|
||||
</div>
|
||||
<strong>{{ item.couponName }}</strong>
|
||||
</div>
|
||||
<div class="rc-right">
|
||||
<i>
|
||||
{{ item.couponName }}
|
||||
</i>
|
||||
<div class="rc-userfont">
|
||||
<strong>有效期</strong>
|
||||
<span>{{item.validFrom}}至</span>
|
||||
<em>{{item.validTo}}</em>
|
||||
</div>
|
||||
<div class="rc-footer">
|
||||
<span @click="usergetconf(item)">立即领取</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rc-contair">
|
||||
<div class="rc-left">
|
||||
<div>
|
||||
<i v-if="item.couponTypeId != '4' && item.couponAmount > 0">
|
||||
¥
|
||||
</i>
|
||||
<span>
|
||||
{{
|
||||
item.couponAmount
|
||||
? item.couponAmount
|
||||
: parseInt(item.discount * 10) + "折"
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
<strong>{{ item.couponName }}</strong>
|
||||
</div>
|
||||
<div class="rc-right">
|
||||
<i>
|
||||
{{ item.couponName }}
|
||||
</i>
|
||||
<div class="rc-userfont">
|
||||
<strong>有效期</strong>
|
||||
<span>{{ item.validFrom }}至</span>
|
||||
<em>{{ item.validTo }}</em>
|
||||
</div>
|
||||
<div class="rc-footer">
|
||||
<span @click="usergetconf(item)">立即领取</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@ -280,14 +301,16 @@
|
||||
</nuxt-link>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div class="rc-button rc-md-down" v-if="(userbuy && curItem.leftAllotment>0)">
|
||||
<div
|
||||
class="rc-button rc-md-down"
|
||||
v-if="userbuy && curItem.leftAllotment > 0"
|
||||
>
|
||||
<span @click="usertanchu(curItem, 0)">加入购物车</span>
|
||||
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
||||
</div>
|
||||
<div class="rc-button rc-md-down " v-if="userloginbuy">
|
||||
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
|
||||
</div>
|
||||
|
||||
<div class="rc-button rc-md-down" v-if="userloginbuy">
|
||||
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -306,106 +329,110 @@ import {
|
||||
getdraw,
|
||||
alldiscount,
|
||||
oncequery,
|
||||
biaomessage
|
||||
biaomessage,
|
||||
} from "../../ajax/getData";
|
||||
|
||||
export default {
|
||||
async asyncData (context) {
|
||||
let isRxGoods = context.route.query.isRxGoods;
|
||||
let userbuy = true;
|
||||
let newlist = [];
|
||||
let curItem = {};
|
||||
let chufang = {};
|
||||
let videolist=[];
|
||||
let productAttachmentList = [];
|
||||
let userlistmenu = [];
|
||||
isRxGoods = (isRxGoods == '1'?true:false);
|
||||
let mainProductCode = context.route.query.mainProductCode;
|
||||
let productCode = context.route.query.productCode;
|
||||
let activeIndexa = 0;
|
||||
if(!productCode || productCode.length<=0)
|
||||
throw new Error('Empty product code');
|
||||
productCode = productCode.split(",");
|
||||
// console.log(this.productCode);
|
||||
if(isRxGoods){
|
||||
let data = await oncequery(mainProductCode);
|
||||
let outputObj = {};
|
||||
if (data) {
|
||||
chufang=data;
|
||||
outputObj = data;
|
||||
outputObj.productName = data.name;
|
||||
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;
|
||||
outputObj.showImgFile = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.showImgFile;
|
||||
newlist = [outputObj];
|
||||
curItem = outputObj;
|
||||
}
|
||||
let insertTmpObj = {id:1, attachmentType:1, sort:1, attachmentPath:newlist[0].picture};
|
||||
productAttachmentList = [insertTmpObj];
|
||||
userbuy = false;
|
||||
async asyncData(context) {
|
||||
let isRxGoods = context.route.query.isRxGoods;
|
||||
let userbuy = true;
|
||||
let newlist = [];
|
||||
let curItem = {};
|
||||
let chufang = {};
|
||||
let videolist = [];
|
||||
let productAttachmentList = [];
|
||||
let userlistmenu = [];
|
||||
isRxGoods = isRxGoods == "1" ? true : false;
|
||||
let mainProductCode = context.route.query.mainProductCode;
|
||||
let productCode = context.route.query.productCode;
|
||||
let activeIndexa = 0;
|
||||
if (!productCode || productCode.length <= 0)
|
||||
throw new Error("Empty product code");
|
||||
productCode = productCode.split(",");
|
||||
// console.log(this.productCode);
|
||||
if (isRxGoods) {
|
||||
let data = await oncequery(mainProductCode);
|
||||
let outputObj = {};
|
||||
if (data) {
|
||||
chufang = data;
|
||||
outputObj = data;
|
||||
outputObj.productName = data.name;
|
||||
outputObj.picture =
|
||||
"https://royalcanincn.escase.cn/jc/royalcanin/" + outputObj.picture;
|
||||
outputObj.showImgFile =
|
||||
"https://royalcanincn.escase.cn/jc/royalcanin/" +
|
||||
outputObj.showImgFile;
|
||||
newlist = [outputObj];
|
||||
curItem = outputObj;
|
||||
}
|
||||
let insertTmpObj = {
|
||||
id: 1,
|
||||
attachmentType: 1,
|
||||
sort: 1,
|
||||
attachmentPath: newlist[0].picture,
|
||||
};
|
||||
productAttachmentList = [insertTmpObj];
|
||||
userbuy = false;
|
||||
console.log(curItem);
|
||||
// debugger
|
||||
|
||||
|
||||
console.log('这是处方量数据')
|
||||
// debugger
|
||||
|
||||
console.log("这是处方量数据");
|
||||
} else {
|
||||
let stopLeftAllotmentChecking = false;
|
||||
let stopIndex = 0;
|
||||
for (let singleCode of productCode) {
|
||||
let data = await goodsmessage(singleCode);
|
||||
if (data && data.data.length > 0) {
|
||||
newlist.push(data.data[0]);
|
||||
|
||||
} else {
|
||||
let stopLeftAllotmentChecking = false;
|
||||
let stopIndex = 0;
|
||||
for(let singleCode of productCode) {
|
||||
let data = await goodsmessage(singleCode);
|
||||
if (data && data.data.length>0) {
|
||||
newlist.push(data.data[0]);
|
||||
if (data.data[0].leftAllotment > 0 && !stopLeftAllotmentChecking) {
|
||||
activeIndexa = stopIndex;
|
||||
curItem = data.data[0];
|
||||
stopLeftAllotmentChecking = true;
|
||||
}
|
||||
stopIndex++;
|
||||
}
|
||||
}
|
||||
if (curItem.productAttachmentList != undefined)
|
||||
productAttachmentList = curItem.productAttachmentList;
|
||||
let list = [];
|
||||
|
||||
if(data.data[0].leftAllotment>0 && !stopLeftAllotmentChecking) {
|
||||
activeIndexa = stopIndex;
|
||||
curItem = data.data[0];
|
||||
stopLeftAllotmentChecking=true;
|
||||
}
|
||||
stopIndex++;
|
||||
}
|
||||
}
|
||||
if(curItem.productAttachmentList != undefined)
|
||||
productAttachmentList = curItem.productAttachmentList;
|
||||
let list=[];
|
||||
|
||||
if(curItem.productName == undefined)
|
||||
curItem = newlist[0];
|
||||
userbuy = true;
|
||||
}
|
||||
if(!curItem || curItem.productName == undefined)
|
||||
throw new Error("商品信息错误");
|
||||
let crumbs = [
|
||||
{
|
||||
path:'/productdetails/productlist/',
|
||||
},
|
||||
{
|
||||
title: curItem.productName,
|
||||
}
|
||||
];
|
||||
|
||||
return {
|
||||
crumbs,
|
||||
activeIndexa,
|
||||
curItem,
|
||||
newlist,
|
||||
if (curItem.productName == undefined) curItem = newlist[0];
|
||||
userbuy = true;
|
||||
}
|
||||
if (!curItem || curItem.productName == undefined)
|
||||
throw new Error("商品信息错误");
|
||||
let crumbs = [
|
||||
{
|
||||
path: "/productdetails/productlist/",
|
||||
},
|
||||
{
|
||||
title: curItem.productName,
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
crumbs,
|
||||
activeIndexa,
|
||||
curItem,
|
||||
newlist,
|
||||
chufang,
|
||||
videolist,
|
||||
productAttachmentList,
|
||||
userbuy
|
||||
}
|
||||
},
|
||||
data() {
|
||||
productAttachmentList,
|
||||
userbuy,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableLabelTest: [],
|
||||
userimage: require("../../assets/image/unused.png"),
|
||||
gotop: false,
|
||||
dialogInfo1: false,
|
||||
videolist:[],
|
||||
videoimg:'',
|
||||
videolist: [],
|
||||
videoimg: "",
|
||||
videoshow: false,
|
||||
name: [],
|
||||
userloginbuy:false,
|
||||
userloginbuy: false,
|
||||
userlist: [],
|
||||
drawlist: [], //用户可以领取的优惠券
|
||||
alldraw: [],
|
||||
@ -466,39 +493,46 @@ export default {
|
||||
tabs,
|
||||
unlogin,
|
||||
Myfooter,
|
||||
FixRight
|
||||
FixRight,
|
||||
},
|
||||
// middleware: 'metaTitle',
|
||||
// // middleware: 'metaTitle',
|
||||
// meta: {title: '产品详情'},
|
||||
|
||||
|
||||
mounted() {
|
||||
this.checkIsLogin();
|
||||
console.log(this.curItem);
|
||||
if(this.curItem.goodUrl.includes('pages')){
|
||||
this.userloginbuy=false
|
||||
console.log('------')
|
||||
}else{
|
||||
this.userloginbuy=true
|
||||
console.log('-22222222');
|
||||
}
|
||||
this.checkIsLogin();
|
||||
console.log(this.curItem);
|
||||
if(!this.userbuy){
|
||||
if (this.curItem.goodUrl.includes("pages")) {
|
||||
this.userloginbuy = false;
|
||||
console.log("------");
|
||||
} else {
|
||||
this.userloginbuy = true;
|
||||
console.log("-22222222");
|
||||
}
|
||||
}
|
||||
|
||||
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
|
||||
this.usermessage = this.$store.state.userInfo;
|
||||
this.productCode = this.$route.query.productCode;
|
||||
//video显示
|
||||
this.productAttachmentList.map(element=>{
|
||||
if(element.attachmentPath.substring(element.attachmentPath.lastIndexOf(".")+1)=='mp4'){
|
||||
this.videolist=element.attachmentPath;
|
||||
}
|
||||
})
|
||||
this.videoimg=this.productAttachmentList[0].attachmentPath;
|
||||
if(this.videolist.length>0){
|
||||
this.videoshow=true
|
||||
}else{
|
||||
this.videoshow=false;
|
||||
}
|
||||
|
||||
/*
|
||||
this.productCode = this.$route.query.productCode;
|
||||
//video显示
|
||||
this.productAttachmentList.map((element) => {
|
||||
if (
|
||||
element.attachmentPath.substring(
|
||||
element.attachmentPath.lastIndexOf(".") + 1
|
||||
) == "mp4"
|
||||
) {
|
||||
this.videolist = element.attachmentPath;
|
||||
}
|
||||
});
|
||||
this.videoimg = this.productAttachmentList[0].attachmentPath;
|
||||
if (this.videolist.length > 0) {
|
||||
this.videoshow = true;
|
||||
} else {
|
||||
this.videoshow = false;
|
||||
}
|
||||
|
||||
/*
|
||||
let stype = this.$route.query.stype;
|
||||
let isRxGoods = this.$route.query.isRxGoods;
|
||||
isRxGoods = (isRxGoods == '1'?true:false);
|
||||
@ -513,7 +547,7 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(["changemessage","checkIsLogin"]),
|
||||
...mapMutations(["changemessage", "checkIsLogin"]),
|
||||
showmesg() {
|
||||
this.toTop();
|
||||
},
|
||||
@ -528,19 +562,18 @@ export default {
|
||||
//获取用户领取的优惠券
|
||||
async getconf(memberId, couponId) {
|
||||
let data = await getConfig(memberId, couponId);
|
||||
let msg = '领取成功';
|
||||
let msg = "领取成功";
|
||||
if (data) {
|
||||
if(data.code!='0')
|
||||
msg = data.msg;
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: msg,
|
||||
});
|
||||
if (data.code != "0") msg = data.msg;
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
//处方用粮跳转
|
||||
chuafangbuy(){
|
||||
window.location.href =this.chufang.goodUrl;
|
||||
chuafangbuy() {
|
||||
window.location.href = this.chufang.goodUrl;
|
||||
},
|
||||
|
||||
// changeName(newName){
|
||||
@ -549,13 +582,13 @@ export default {
|
||||
|
||||
userclose() {
|
||||
this.userlist = [];
|
||||
this.dialogInfo1=false;
|
||||
this.dialogInfo1 = false;
|
||||
},
|
||||
async userquery() {
|
||||
let data = await goodsmessage(this.productCode);
|
||||
if (data) {
|
||||
console.log(data)
|
||||
debugger
|
||||
console.log(data);
|
||||
debugger;
|
||||
this.newlist = data.data;
|
||||
}
|
||||
this.productAttachmentList = this.newlist[0].productAttachmentList;
|
||||
@ -564,21 +597,24 @@ export default {
|
||||
this.changemessage({ data: changemess });
|
||||
this.parent_msg = this.userlistmenu;
|
||||
},
|
||||
async rxquery() {
|
||||
let data = await oncequery(this.productCode);
|
||||
let outputObj = {};
|
||||
if (data) {
|
||||
console.log(data);
|
||||
debugger
|
||||
outputObj = data;
|
||||
outputObj.productName = data.name;
|
||||
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;
|
||||
outputObj.showImgFile = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.showImgFile;
|
||||
this.newlist = [outputObj];
|
||||
}
|
||||
let picture = this.newlist[0].picture.split(",");
|
||||
this.productAttachmentList = picture;
|
||||
},
|
||||
async rxquery() {
|
||||
let data = await oncequery(this.productCode);
|
||||
let outputObj = {};
|
||||
if (data) {
|
||||
console.log(data);
|
||||
debugger;
|
||||
outputObj = data;
|
||||
outputObj.productName = data.name;
|
||||
outputObj.picture =
|
||||
"https://royalcanincn.escase.cn/jc/royalcanin/" + outputObj.picture;
|
||||
outputObj.showImgFile =
|
||||
"https://royalcanincn.escase.cn/jc/royalcanin/" +
|
||||
outputObj.showImgFile;
|
||||
this.newlist = [outputObj];
|
||||
}
|
||||
let picture = this.newlist[0].picture.split(",");
|
||||
this.productAttachmentList = picture;
|
||||
},
|
||||
|
||||
//获取用户领取的优惠券
|
||||
async userdraw(mobile) {
|
||||
@ -599,7 +635,10 @@ export default {
|
||||
let alllist = [];
|
||||
this.userlist = this.alldraw.data;
|
||||
this.userlist.forEach((element, index) => {
|
||||
if (typeof element.productCodes == "string" || !element.productCodes) {
|
||||
if (
|
||||
typeof element.productCodes == "string" ||
|
||||
!element.productCodes
|
||||
) {
|
||||
userlist.push(element);
|
||||
// let s=element.productCodes.split(',');
|
||||
// console.log(s.indexOf(this.productCode) != -1 )
|
||||
@ -608,50 +647,50 @@ export default {
|
||||
});
|
||||
let menualist = [];
|
||||
userlist.filter((item) => {
|
||||
let valDateFromTime=0;
|
||||
let valDateToTime=0;
|
||||
let curTime = new Date().getTime();
|
||||
let dateChecked=true;
|
||||
if(item.fValidFrom) {
|
||||
valDateFromTime = new Date(item.fValidFrom).getTime();
|
||||
}
|
||||
if(item.fValidTo) {
|
||||
valDateToTime = new Date(item.fValidTo).getTime();
|
||||
}
|
||||
if(valDateFromTime && curTime < valDateFromTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if(valDateToTime && curTime > valDateToTime) {
|
||||
dateChecked=false;
|
||||
}
|
||||
if(dateChecked && item.activityId!=10) {
|
||||
if(!item.productCodes) {
|
||||
menualist.push(item);
|
||||
} else {
|
||||
item.productCodes = item.productCodes.split(",");
|
||||
item.productCodes.forEach((element) => {
|
||||
if (element == this.curItem.productCode) {
|
||||
menualist.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
//Expired coupons
|
||||
}
|
||||
let valDateFromTime = 0;
|
||||
let valDateToTime = 0;
|
||||
let curTime = new Date().getTime();
|
||||
let dateChecked = true;
|
||||
if (item.fValidFrom) {
|
||||
valDateFromTime = new Date(item.fValidFrom).getTime();
|
||||
}
|
||||
if (item.fValidTo) {
|
||||
valDateToTime = new Date(item.fValidTo).getTime();
|
||||
}
|
||||
if (valDateFromTime && curTime < valDateFromTime) {
|
||||
dateChecked = false;
|
||||
}
|
||||
if (valDateToTime && curTime > valDateToTime) {
|
||||
dateChecked = false;
|
||||
}
|
||||
if (dateChecked && item.activityId != 10) {
|
||||
if (!item.productCodes) {
|
||||
menualist.push(item);
|
||||
} else {
|
||||
item.productCodes = item.productCodes.split(",");
|
||||
item.productCodes.forEach((element) => {
|
||||
if (element == this.curItem.productCode) {
|
||||
menualist.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
//Expired coupons
|
||||
}
|
||||
});
|
||||
this.usernewlist = menualist;
|
||||
}
|
||||
},
|
||||
|
||||
plus(num, index) {
|
||||
if(this.sales_num >= this.curItem.leftAllotment) {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: '已达到本品最大购买上限',
|
||||
});
|
||||
} else {
|
||||
this.sales_num = parseInt(this.sales_num) + 1;
|
||||
}
|
||||
if (this.sales_num >= this.curItem.leftAllotment) {
|
||||
this.$message({
|
||||
type: "warning",
|
||||
message: "已达到本品最大购买上限",
|
||||
});
|
||||
} else {
|
||||
this.sales_num = parseInt(this.sales_num) + 1;
|
||||
}
|
||||
},
|
||||
// 数量减方法
|
||||
sub(num, index) {
|
||||
@ -666,8 +705,8 @@ export default {
|
||||
// let userid=JSON.parse(location.getItem('userInfo'));
|
||||
// let mobile=JSON.parse(location.getItem('userInfo'));
|
||||
// console.log(userid,mobile);
|
||||
let basePoint = item.basePoint;
|
||||
basePoint = basePoint?basePoint:0;
|
||||
let basePoint = item.basePoint;
|
||||
basePoint = basePoint ? basePoint : 0;
|
||||
let data = await postCourseId(
|
||||
item.productCode,
|
||||
this.sales_num,
|
||||
@ -678,7 +717,7 @@ export default {
|
||||
item.ecPrice,
|
||||
item.specifications,
|
||||
item.leftAllotment,
|
||||
basePoint
|
||||
basePoint
|
||||
);
|
||||
if (data) {
|
||||
this.productlist = data;
|
||||
@ -706,8 +745,8 @@ export default {
|
||||
productName: item.productName,
|
||||
productImg: item.picFile,
|
||||
specifications: item.specifications,
|
||||
leftAllotment: item.leftAllotment,
|
||||
basePoint: item.basePoint,
|
||||
leftAllotment: item.leftAllotment,
|
||||
basePoint: item.basePoint,
|
||||
buyCount: this.sales_num,
|
||||
memberId: "",
|
||||
mobile: "",
|
||||
@ -736,13 +775,12 @@ export default {
|
||||
}
|
||||
},
|
||||
selectsearch(item, index) {
|
||||
if(!item.leftAllotment || item.leftAllotment<=0)
|
||||
return;
|
||||
if (!item.leftAllotment || item.leftAllotment <= 0) return;
|
||||
this.activeIndexa = index;
|
||||
this.curItem = item;
|
||||
this.productAttachmentList = item.productAttachmentList;
|
||||
this.crumbs.pop();
|
||||
this.crumbs.push({title: item.productName});
|
||||
this.curItem = item;
|
||||
this.productAttachmentList = item.productAttachmentList;
|
||||
this.crumbs.pop();
|
||||
this.crumbs.push({ title: item.productName });
|
||||
},
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user