mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-02 10:16:38 +08:00
更改
This commit is contained in:
parent
cbe204d689
commit
8baf7eb678
@ -17,7 +17,7 @@
|
|||||||
>
|
>
|
||||||
<div class="uservideo" v-if="videoshow">
|
<div class="uservideo" v-if="videoshow">
|
||||||
<video controls="" preload="videoimg">
|
<video controls="" preload="videoimg">
|
||||||
<source :src= videolist type="video/mp4">
|
<source :src="videolist" type="video/mp4" />
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-column" v-if="!videoshow">
|
<div class="rc-column" v-if="!videoshow">
|
||||||
@ -111,19 +111,15 @@
|
|||||||
<div class="rc-productdetail" v-if="!userbuy">
|
<div class="rc-productdetail" v-if="!userbuy">
|
||||||
<i class="ts-row-title">所属分类:</i>
|
<i class="ts-row-title">所属分类:</i>
|
||||||
<span>{{ curItem.categoryName }}</span>
|
<span>{{ curItem.categoryName }}</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-button" v-if="userloginbuy">
|
<div class="rc-button" v-if="userloginbuy">
|
||||||
<span @click="chuafangbuy()">立即购买</span>
|
<span @click="chuafangbuy()">立即购买</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="rc-productdetail" v-if="userbuy">
|
<div class="rc-productdetail" v-if="userbuy">
|
||||||
<i class="ts-row-title">商品价格:</i>
|
<i class="ts-row-title">商品价格:</i>
|
||||||
<span class="ts-realprice">¥{{ curItem.ecPrice }}</span>
|
<span class="ts-realprice">¥{{ curItem.ecPrice }}</span>
|
||||||
<span class="ts-remove ts-ecprice"
|
<span class="ts-remove ts-ecprice">¥{{ curItem.rsp }} </span>
|
||||||
>¥{{ curItem.rsp }}
|
|
||||||
</span>
|
|
||||||
<span class="ts-record" v-if="curItem.basePoint !== 0">
|
<span class="ts-record" v-if="curItem.basePoint !== 0">
|
||||||
购买该商品你将获得{{ curItem.basePoint }}积分
|
购买该商品你将获得{{ curItem.basePoint }}积分
|
||||||
</span>
|
</span>
|
||||||
@ -151,7 +147,17 @@
|
|||||||
<i class="ts-row-title">商品规格:</i>
|
<i class="ts-row-title">商品规格:</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="ts-tag-list">
|
<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']">
|
<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 }}
|
{{ item.specifications }}
|
||||||
</em>
|
</em>
|
||||||
</div>
|
</div>
|
||||||
@ -163,7 +169,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-main">
|
<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>
|
<div><i class="ts-row-title">商品数量:</i></div>
|
||||||
<img
|
<img
|
||||||
src="../../assets/image/userjian.png"
|
src="../../assets/image/userjian.png"
|
||||||
@ -208,11 +217,13 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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, 0)">加入购物车</span>
|
||||||
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="online bold rc-md-down"></div>
|
<div class="online bold rc-md-down"></div>
|
||||||
</div>
|
</div>
|
||||||
@ -224,10 +235,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<FixRight></FixRight>
|
<FixRight></FixRight>
|
||||||
<Myfooter v-on:litentop="showmesg"></Myfooter>
|
<Myfooter v-on:litentop="showmesg"></Myfooter>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<el-dialog :visible.sync="dialogInfo1" @close="userclose" class="pop_coupon" :close-on-click-modal="false">
|
<el-dialog
|
||||||
<div class="ts-no-data" v-if="usernewlist.length<=0">目前还没有可用的优惠券</div>
|
: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="rs-dis">
|
||||||
<div
|
<div
|
||||||
class="rc-discount"
|
class="rc-discount"
|
||||||
@ -238,11 +255,15 @@
|
|||||||
<div class="rc-contair">
|
<div class="rc-contair">
|
||||||
<div class="rc-left">
|
<div class="rc-left">
|
||||||
<div>
|
<div>
|
||||||
<i v-if="(item.couponTypeId!='4' && item.couponAmount>0)">
|
<i v-if="item.couponTypeId != '4' && item.couponAmount > 0">
|
||||||
¥
|
¥
|
||||||
</i>
|
</i>
|
||||||
<span>
|
<span>
|
||||||
{{ item.couponAmount?item.couponAmount:(parseInt((item.discount)*10)+'折') }}
|
{{
|
||||||
|
item.couponAmount
|
||||||
|
? item.couponAmount
|
||||||
|
: parseInt(item.discount * 10) + "折"
|
||||||
|
}}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<strong>{{ item.couponName }}</strong>
|
<strong>{{ item.couponName }}</strong>
|
||||||
@ -280,14 +301,16 @@
|
|||||||
</nuxt-link>
|
</nuxt-link>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</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, 0)">加入购物车</span>
|
||||||
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
<span @click="usertanchu(curItem, 1)">立即购买</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="rc-button rc-md-down" v-if="userloginbuy">
|
<div class="rc-button rc-md-down" v-if="userloginbuy">
|
||||||
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
|
<span @click="chuafangbuy()" style="margin-right: 20px">立即购买</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -306,7 +329,7 @@ import {
|
|||||||
getdraw,
|
getdraw,
|
||||||
alldiscount,
|
alldiscount,
|
||||||
oncequery,
|
oncequery,
|
||||||
biaomessage
|
biaomessage,
|
||||||
} from "../../ajax/getData";
|
} from "../../ajax/getData";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -319,12 +342,12 @@ export default {
|
|||||||
let videolist = [];
|
let videolist = [];
|
||||||
let productAttachmentList = [];
|
let productAttachmentList = [];
|
||||||
let userlistmenu = [];
|
let userlistmenu = [];
|
||||||
isRxGoods = (isRxGoods == '1'?true:false);
|
isRxGoods = isRxGoods == "1" ? true : false;
|
||||||
let mainProductCode = context.route.query.mainProductCode;
|
let mainProductCode = context.route.query.mainProductCode;
|
||||||
let productCode = context.route.query.productCode;
|
let productCode = context.route.query.productCode;
|
||||||
let activeIndexa = 0;
|
let activeIndexa = 0;
|
||||||
if (!productCode || productCode.length <= 0)
|
if (!productCode || productCode.length <= 0)
|
||||||
throw new Error('Empty product code');
|
throw new Error("Empty product code");
|
||||||
productCode = productCode.split(",");
|
productCode = productCode.split(",");
|
||||||
// console.log(this.productCode);
|
// console.log(this.productCode);
|
||||||
if (isRxGoods) {
|
if (isRxGoods) {
|
||||||
@ -334,21 +357,26 @@ export default {
|
|||||||
chufang = data;
|
chufang = data;
|
||||||
outputObj = data;
|
outputObj = data;
|
||||||
outputObj.productName = data.name;
|
outputObj.productName = data.name;
|
||||||
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;
|
outputObj.picture =
|
||||||
outputObj.showImgFile = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.showImgFile;
|
"https://royalcanincn.escase.cn/jc/royalcanin/" + outputObj.picture;
|
||||||
|
outputObj.showImgFile =
|
||||||
|
"https://royalcanincn.escase.cn/jc/royalcanin/" +
|
||||||
|
outputObj.showImgFile;
|
||||||
newlist = [outputObj];
|
newlist = [outputObj];
|
||||||
curItem = outputObj;
|
curItem = outputObj;
|
||||||
}
|
}
|
||||||
let insertTmpObj = {id:1, attachmentType:1, sort:1, attachmentPath:newlist[0].picture};
|
let insertTmpObj = {
|
||||||
|
id: 1,
|
||||||
|
attachmentType: 1,
|
||||||
|
sort: 1,
|
||||||
|
attachmentPath: newlist[0].picture,
|
||||||
|
};
|
||||||
productAttachmentList = [insertTmpObj];
|
productAttachmentList = [insertTmpObj];
|
||||||
userbuy = false;
|
userbuy = false;
|
||||||
console.log(curItem);
|
console.log(curItem);
|
||||||
// debugger
|
// debugger
|
||||||
|
|
||||||
|
console.log("这是处方量数据");
|
||||||
console.log('这是处方量数据')
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
let stopLeftAllotmentChecking = false;
|
let stopLeftAllotmentChecking = false;
|
||||||
let stopIndex = 0;
|
let stopIndex = 0;
|
||||||
@ -369,19 +397,18 @@ export default {
|
|||||||
productAttachmentList = curItem.productAttachmentList;
|
productAttachmentList = curItem.productAttachmentList;
|
||||||
let list = [];
|
let list = [];
|
||||||
|
|
||||||
if(curItem.productName == undefined)
|
if (curItem.productName == undefined) curItem = newlist[0];
|
||||||
curItem = newlist[0];
|
|
||||||
userbuy = true;
|
userbuy = true;
|
||||||
}
|
}
|
||||||
if (!curItem || curItem.productName == undefined)
|
if (!curItem || curItem.productName == undefined)
|
||||||
throw new Error("商品信息错误");
|
throw new Error("商品信息错误");
|
||||||
let crumbs = [
|
let crumbs = [
|
||||||
{
|
{
|
||||||
path:'/productdetails/productlist/',
|
path: "/productdetails/productlist/",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: curItem.productName,
|
title: curItem.productName,
|
||||||
}
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -392,8 +419,8 @@ export default {
|
|||||||
chufang,
|
chufang,
|
||||||
videolist,
|
videolist,
|
||||||
productAttachmentList,
|
productAttachmentList,
|
||||||
userbuy
|
userbuy,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@ -402,7 +429,7 @@ export default {
|
|||||||
gotop: false,
|
gotop: false,
|
||||||
dialogInfo1: false,
|
dialogInfo1: false,
|
||||||
videolist: [],
|
videolist: [],
|
||||||
videoimg:'',
|
videoimg: "",
|
||||||
videoshow: false,
|
videoshow: false,
|
||||||
name: [],
|
name: [],
|
||||||
userloginbuy: false,
|
userloginbuy: false,
|
||||||
@ -466,7 +493,7 @@ export default {
|
|||||||
tabs,
|
tabs,
|
||||||
unlogin,
|
unlogin,
|
||||||
Myfooter,
|
Myfooter,
|
||||||
FixRight
|
FixRight,
|
||||||
},
|
},
|
||||||
// middleware: 'metaTitle',
|
// middleware: 'metaTitle',
|
||||||
// // middleware: 'metaTitle',
|
// // middleware: 'metaTitle',
|
||||||
@ -475,25 +502,32 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
this.checkIsLogin();
|
this.checkIsLogin();
|
||||||
console.log(this.curItem);
|
console.log(this.curItem);
|
||||||
if(this.curItem.goodUrl.includes('pages')){
|
if(!this.userbuy){
|
||||||
this.userloginbuy=false
|
if (this.curItem.goodUrl.includes("pages")) {
|
||||||
console.log('------')
|
this.userloginbuy = false;
|
||||||
|
console.log("------");
|
||||||
} else {
|
} else {
|
||||||
this.userloginbuy=true
|
this.userloginbuy = true;
|
||||||
console.log('-22222222');
|
console.log("-22222222");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
|
if (this.usermessage !== "" || this.usermessage.data !== undefined) {
|
||||||
this.usermessage = this.$store.state.userInfo;
|
this.usermessage = this.$store.state.userInfo;
|
||||||
this.productCode = this.$route.query.productCode;
|
this.productCode = this.$route.query.productCode;
|
||||||
//video显示
|
//video显示
|
||||||
this.productAttachmentList.map(element=>{
|
this.productAttachmentList.map((element) => {
|
||||||
if(element.attachmentPath.substring(element.attachmentPath.lastIndexOf(".")+1)=='mp4'){
|
if (
|
||||||
|
element.attachmentPath.substring(
|
||||||
|
element.attachmentPath.lastIndexOf(".") + 1
|
||||||
|
) == "mp4"
|
||||||
|
) {
|
||||||
this.videolist = element.attachmentPath;
|
this.videolist = element.attachmentPath;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
this.videoimg = this.productAttachmentList[0].attachmentPath;
|
this.videoimg = this.productAttachmentList[0].attachmentPath;
|
||||||
if (this.videolist.length > 0) {
|
if (this.videolist.length > 0) {
|
||||||
this.videoshow=true
|
this.videoshow = true;
|
||||||
} else {
|
} else {
|
||||||
this.videoshow = false;
|
this.videoshow = false;
|
||||||
}
|
}
|
||||||
@ -528,10 +562,9 @@ export default {
|
|||||||
//获取用户领取的优惠券
|
//获取用户领取的优惠券
|
||||||
async getconf(memberId, couponId) {
|
async getconf(memberId, couponId) {
|
||||||
let data = await getConfig(memberId, couponId);
|
let data = await getConfig(memberId, couponId);
|
||||||
let msg = '领取成功';
|
let msg = "领取成功";
|
||||||
if (data) {
|
if (data) {
|
||||||
if(data.code!='0')
|
if (data.code != "0") msg = data.msg;
|
||||||
msg = data.msg;
|
|
||||||
this.$message({
|
this.$message({
|
||||||
type: "warning",
|
type: "warning",
|
||||||
message: msg,
|
message: msg,
|
||||||
@ -554,8 +587,8 @@ export default {
|
|||||||
async userquery() {
|
async userquery() {
|
||||||
let data = await goodsmessage(this.productCode);
|
let data = await goodsmessage(this.productCode);
|
||||||
if (data) {
|
if (data) {
|
||||||
console.log(data)
|
console.log(data);
|
||||||
debugger
|
debugger;
|
||||||
this.newlist = data.data;
|
this.newlist = data.data;
|
||||||
}
|
}
|
||||||
this.productAttachmentList = this.newlist[0].productAttachmentList;
|
this.productAttachmentList = this.newlist[0].productAttachmentList;
|
||||||
@ -569,11 +602,14 @@ export default {
|
|||||||
let outputObj = {};
|
let outputObj = {};
|
||||||
if (data) {
|
if (data) {
|
||||||
console.log(data);
|
console.log(data);
|
||||||
debugger
|
debugger;
|
||||||
outputObj = data;
|
outputObj = data;
|
||||||
outputObj.productName = data.name;
|
outputObj.productName = data.name;
|
||||||
outputObj.picture = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.picture;
|
outputObj.picture =
|
||||||
outputObj.showImgFile = 'https://royalcanincn.escase.cn/jc/royalcanin/'+outputObj.showImgFile;
|
"https://royalcanincn.escase.cn/jc/royalcanin/" + outputObj.picture;
|
||||||
|
outputObj.showImgFile =
|
||||||
|
"https://royalcanincn.escase.cn/jc/royalcanin/" +
|
||||||
|
outputObj.showImgFile;
|
||||||
this.newlist = [outputObj];
|
this.newlist = [outputObj];
|
||||||
}
|
}
|
||||||
let picture = this.newlist[0].picture.split(",");
|
let picture = this.newlist[0].picture.split(",");
|
||||||
@ -599,7 +635,10 @@ export default {
|
|||||||
let alllist = [];
|
let alllist = [];
|
||||||
this.userlist = this.alldraw.data;
|
this.userlist = this.alldraw.data;
|
||||||
this.userlist.forEach((element, index) => {
|
this.userlist.forEach((element, index) => {
|
||||||
if (typeof element.productCodes == "string" || !element.productCodes) {
|
if (
|
||||||
|
typeof element.productCodes == "string" ||
|
||||||
|
!element.productCodes
|
||||||
|
) {
|
||||||
userlist.push(element);
|
userlist.push(element);
|
||||||
// let s=element.productCodes.split(',');
|
// let s=element.productCodes.split(',');
|
||||||
// console.log(s.indexOf(this.productCode) != -1 )
|
// console.log(s.indexOf(this.productCode) != -1 )
|
||||||
@ -647,7 +686,7 @@ export default {
|
|||||||
if (this.sales_num >= this.curItem.leftAllotment) {
|
if (this.sales_num >= this.curItem.leftAllotment) {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: "warning",
|
type: "warning",
|
||||||
message: '已达到本品最大购买上限',
|
message: "已达到本品最大购买上限",
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.sales_num = parseInt(this.sales_num) + 1;
|
this.sales_num = parseInt(this.sales_num) + 1;
|
||||||
@ -736,8 +775,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectsearch(item, index) {
|
selectsearch(item, index) {
|
||||||
if(!item.leftAllotment || item.leftAllotment<=0)
|
if (!item.leftAllotment || item.leftAllotment <= 0) return;
|
||||||
return;
|
|
||||||
this.activeIndexa = index;
|
this.activeIndexa = index;
|
||||||
this.curItem = item;
|
this.curItem = item;
|
||||||
this.productAttachmentList = item.productAttachmentList;
|
this.productAttachmentList = item.productAttachmentList;
|
||||||
|
Loading…
Reference in New Issue
Block a user