|
@@ -1,5 +1,6 @@
|
|
|
var productDetail = new Vue({
|
|
|
el: "#productDetail",
|
|
|
+ mixins: [beautyArchiveDetailMixin],
|
|
|
data: {
|
|
|
showProduct: false,
|
|
|
productId: 0,
|
|
@@ -21,67 +22,68 @@ var productDetail = new Vue({
|
|
|
supplierId: 0,
|
|
|
userIdentity: 0 //2-会员机构;3-供应商;4-普通机构
|
|
|
},
|
|
|
- ladderList:[],//阶梯价
|
|
|
- promotions:{},//促销活动信息
|
|
|
- promotionsId:0,//活动id
|
|
|
+ ladderList: [],//阶梯价
|
|
|
+ promotions: {},//促销活动信息
|
|
|
+ promotionsId: 0,//活动id
|
|
|
addStatus: true,
|
|
|
recommendType: 0,//相关推荐类型 0自动选择; 1手动推荐
|
|
|
recommendPage: 1,
|
|
|
recommends: [],
|
|
|
parameters: [],
|
|
|
- tabsIndex:0,
|
|
|
- disabledText:'',
|
|
|
- isNoneDisabled:false,
|
|
|
- isServiceInfo:false,
|
|
|
- isTrainingMethod:false,
|
|
|
- productTypeName:"",
|
|
|
- beautyActFlag:'',
|
|
|
- trainingMethodText:'',
|
|
|
- trainingType:'',
|
|
|
- isShowPopup:false,
|
|
|
- currentTab:1,
|
|
|
- couponParam:{// 获取弹窗优惠券领取参数
|
|
|
- userId:0,
|
|
|
- productId:0,
|
|
|
- status:1,
|
|
|
- source:1
|
|
|
+ tabsIndex: 0,
|
|
|
+ disabledText: '',
|
|
|
+ isNoneDisabled: false,
|
|
|
+ isServiceInfo: false,
|
|
|
+ isTrainingMethod: false,
|
|
|
+ productTypeName: "",
|
|
|
+ beautyActFlag: '',
|
|
|
+ trainingMethodText: '',
|
|
|
+ trainingType: '',
|
|
|
+ isShowPopup: false,
|
|
|
+ currentTab: 1,
|
|
|
+ couponParam: {// 获取弹窗优惠券领取参数
|
|
|
+ userId: 0,
|
|
|
+ productId: 0,
|
|
|
+ status: 1,
|
|
|
+ source: 1
|
|
|
},
|
|
|
- isCouponEmpty:false,
|
|
|
- productCoupon:[], // 优惠券
|
|
|
- productCouponList:[], // 优惠券弹窗列表
|
|
|
+ isCouponEmpty: false,
|
|
|
+ productCoupon: [], // 优惠券
|
|
|
+ productCouponList: [], // 优惠券弹窗列表
|
|
|
collectionType:false, // 商品收藏状态
|
|
|
|
|
|
},
|
|
|
filters: {
|
|
|
- TypeFormat:function(value) {
|
|
|
+ TypeFormat: function (value) {
|
|
|
switch (value) {
|
|
|
case 0:
|
|
|
- return '活动券';
|
|
|
+ return '活动券';
|
|
|
break;
|
|
|
case 1:
|
|
|
- return '品类券';
|
|
|
+ return '品类券';
|
|
|
break;
|
|
|
case 2:
|
|
|
- return '用户专享券';
|
|
|
+ return '用户专享券';
|
|
|
break;
|
|
|
case 3:
|
|
|
- return '店铺券';
|
|
|
+ return '店铺券';
|
|
|
break;
|
|
|
case 4:
|
|
|
- return '新用户券';
|
|
|
+ return '新用户券';
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- computed: {},
|
|
|
methods: {
|
|
|
- getImages: function(){
|
|
|
+ getImages: function () {
|
|
|
var _self = this;
|
|
|
- if(!this.productId){return;}
|
|
|
- ProductApi.GetProductDdtailsImages({productId: _self.productId},function (response) {
|
|
|
+ if (!this.productId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ProductApi.GetProductDdtailsImages({productId: _self.productId}, function (response) {
|
|
|
if (response.code === 0 && response.data) {
|
|
|
_self.images = response.data;
|
|
|
- setTimeout(function(){
|
|
|
+ setTimeout(function () {
|
|
|
if (isPC) {
|
|
|
var magnifier = new ImageMagnifier(
|
|
|
'#imgShown .smallImage li',
|
|
@@ -93,7 +95,7 @@ var productDetail = new Vue({
|
|
|
).init();
|
|
|
} else {
|
|
|
var swiper = new Swiper('#swiperImage', {
|
|
|
- loop : true,
|
|
|
+ loop: true,
|
|
|
autoplay: {
|
|
|
delay: 2000,
|
|
|
disableOnInteraction: false
|
|
@@ -104,127 +106,149 @@ var productDetail = new Vue({
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- },500);
|
|
|
+ }, 500);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getProductDetails:function(){
|
|
|
+ getProductDetails: function () {
|
|
|
var _self = this;
|
|
|
- ProductApi.GetProductDdtails({userId:GLOBAL_USER_ID,productId:_self.productId},function (response) {
|
|
|
- if(response.code == 0){
|
|
|
+ ProductApi.GetProductDdtails({userId: GLOBAL_USER_ID, productId: _self.productId}, function (response) {
|
|
|
+ if (response.code == 0) {
|
|
|
var product = response.data;
|
|
|
+ _self.pcActType = product.pcActType;
|
|
|
_self.beautyActFlag = product.beautyActFlag;
|
|
|
_self.productTypeName = product.typeName;
|
|
|
- _self.pcActType = product.pcActType;
|
|
|
_self.recommendType = product.recommendType ? product.recommendType : 0;
|
|
|
- if(product.productDetail.orderInfo!='' && product.productDetail.serviceInfo!=''){
|
|
|
+ _self.archiveId = product.archiveId; // 保存资料列表id
|
|
|
+ if (product.productDetail.orderInfo != '' && product.productDetail.serviceInfo != '') {
|
|
|
_self.isServiceInfo = true;
|
|
|
}
|
|
|
- if(product.commodityType == 2 && product.trainingMethod){
|
|
|
+ if (product.commodityType == 2 && product.trainingMethod) {
|
|
|
_self.isTrainingMethod = true;
|
|
|
_self.trainingMethodText = product.trainingMethod == 1 ? '线上培训' : '线下培训';
|
|
|
- _self.trainingType = product.trainingType == 1 ? '¥'+product.trainingFee : '售价已包含';
|
|
|
+ _self.trainingType = product.trainingType == 1 ? '¥' + product.trainingFee : '售价已包含';
|
|
|
}
|
|
|
- if(product.validFlag == 3 || product.validFlag == 9 || product.validFlag == 0 || product.validFlag == 10 || product.stock == 0 ){
|
|
|
+ if (product.validFlag == 3 || product.validFlag == 9 || product.validFlag == 0 || product.validFlag == 10 || product.stock == 0) {
|
|
|
_self.isNoneDisabled = true;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
_self.isNoneDisabled = false;
|
|
|
}
|
|
|
- if(product.validFlag ==3){
|
|
|
+ if (product.validFlag == 3) {
|
|
|
_self.disabledText = '下架'
|
|
|
}
|
|
|
- if(product.validFlag ==10){
|
|
|
+ if (product.validFlag == 10) {
|
|
|
_self.disabledText = '停售'
|
|
|
}
|
|
|
- if(product.validFlag ==9 || product.validFlag ==0){
|
|
|
+ if (product.validFlag == 9 || product.validFlag == 0) {
|
|
|
_self.disabledText = '失效'
|
|
|
}
|
|
|
- if(product.stock == 0 && product.validFlag !=3){
|
|
|
+ if (product.stock == 0 && product.validFlag != 3) {
|
|
|
_self.disabledText = '售罄'
|
|
|
}
|
|
|
_self.getRecommends();
|
|
|
- }else{
|
|
|
+ _self.getProdcutArchiveDetails(); //获取资料列表
|
|
|
+ // 获取路由hash标识,设置默认展开tab
|
|
|
+ var str = CAIMEI.getUrlParam('open');
|
|
|
+ if (str === 'caimei365' && _self.archiveId > 0) {
|
|
|
+ _self.tabsIndex = 4;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
CAIMEI.Alert(response.msg, '确定', false);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getProductPrice:function(){//获取商品价格
|
|
|
+ getProductPrice: function () {//获取商品价格
|
|
|
var _self = this;
|
|
|
- if(_self.productId ===0){return;}
|
|
|
- ProductApi.GetProductDdtailsPrice({ userId: GLOBAL_USER_ID,productId: _self.productId},function (response) {
|
|
|
+ if (_self.productId === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ProductApi.GetProductDdtailsPrice({
|
|
|
+ userId: GLOBAL_USER_ID,
|
|
|
+ productId: _self.productId
|
|
|
+ }, function (response) {
|
|
|
if (response.code === 0 && response.data) {
|
|
|
_self.priceObj = response.data;
|
|
|
_self.number = response.data.minBuyNumber;
|
|
|
- if(response.data.ladderPriceFlag===1){
|
|
|
+ if (response.data.ladderPriceFlag === 1) {
|
|
|
_self.ladderPrice();
|
|
|
}
|
|
|
- if(response.data.actStatus==1){
|
|
|
- _self.promotions = response.data.promotions;
|
|
|
+ if (response.data.actStatus == 1) {
|
|
|
+ _self.promotions = response.data.promotions;
|
|
|
_self.promotionsId = response.data.promotions.id;
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- ladderPrice:function(){//获取商品阶梯价格
|
|
|
+ ladderPrice: function () {//获取商品阶梯价格
|
|
|
var _self = this;
|
|
|
- if(!this.productId){return;}
|
|
|
- ProductApi.GetProductDdtailsLadderPrice({ productId: _self.productId },function (response) {
|
|
|
+ if (!this.productId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ProductApi.GetProductDdtailsLadderPrice({productId: _self.productId}, function (response) {
|
|
|
if (response.code === 0 && response.data) {
|
|
|
- _self.ladderList =response.data;
|
|
|
+ _self.ladderList = response.data;
|
|
|
_self.numberResize();
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- getParameters: function(){//获取商品参数
|
|
|
+ getParameters: function () {//获取商品参数
|
|
|
var _self = this;
|
|
|
- if(!this.productId){return;}
|
|
|
- ProductApi.GetProductDdtailsParameter({ productId: _self.productId},function (response) {
|
|
|
+ if (!this.productId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ ProductApi.GetProductDdtailsParameter({productId: _self.productId}, function (response) {
|
|
|
if (response.code === 0 && response.data) {
|
|
|
_self.parameters = response.data;
|
|
|
console.log(_self.parameters)
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- toggleThisLadder: function(event){
|
|
|
+ toggleThisLadder: function (event) {
|
|
|
var el = event.currentTarget;
|
|
|
- if($(el).hasClass("on")){
|
|
|
+ if ($(el).hasClass("on")) {
|
|
|
$(el).removeClass("on").siblings('.mFixed').hide();
|
|
|
- if(!isPC){looseBody();}
|
|
|
- }else{
|
|
|
+ if (!isPC) {
|
|
|
+ looseBody();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
$(el).addClass("on").siblings('.mFixed').show();
|
|
|
- if(!isPC){fixedBody();}
|
|
|
+ if (!isPC) {
|
|
|
+ fixedBody();
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- hideThisLadder: function(event){
|
|
|
+ hideThisLadder: function (event) {
|
|
|
var el = event.currentTarget;
|
|
|
$(el).parents('.priceTag').find('.tag').removeClass("on").siblings('.mFixed').hide();
|
|
|
- if(!isPC){looseBody();}
|
|
|
+ if (!isPC) {
|
|
|
+ looseBody();
|
|
|
+ }
|
|
|
},
|
|
|
- numberSub: function(){
|
|
|
+ numberSub: function () {
|
|
|
this.number -= this.priceObj.step;
|
|
|
this.numberResize();
|
|
|
},
|
|
|
- numberAdd: function(){
|
|
|
+ numberAdd: function () {
|
|
|
this.number += this.priceObj.step;
|
|
|
this.numberResize();
|
|
|
|
|
|
},
|
|
|
- numberChange: function(){
|
|
|
- this.number = Math.ceil(this.number/this.priceObj.step)*this.priceObj.step;
|
|
|
+ numberChange: function () {
|
|
|
+ this.number = Math.ceil(this.number / this.priceObj.step) * this.priceObj.step;
|
|
|
this.numberResize();
|
|
|
|
|
|
},
|
|
|
- numberResize: function(){
|
|
|
+ numberResize: function () {
|
|
|
var _self = this;
|
|
|
- if (this.number<this.priceObj.minBuyNumber){
|
|
|
+ if (this.number < this.priceObj.minBuyNumber) {
|
|
|
this.number = this.priceObj.minBuyNumber;
|
|
|
}
|
|
|
- if (this.number>this.productStock){
|
|
|
+ if (this.number > this.productStock) {
|
|
|
this.number = this.productStock;
|
|
|
}
|
|
|
- if(this.priceObj.ladderPriceFlag){
|
|
|
- this.ladderList.forEach(function(ladder){
|
|
|
- if(_self.number>=ladder.buyNum){
|
|
|
+ if (this.priceObj.ladderPriceFlag) {
|
|
|
+ this.ladderList.forEach(function (ladder) {
|
|
|
+ if (_self.number >= ladder.buyNum) {
|
|
|
_self.priceObj.price = ladder.buyPrice;
|
|
|
}
|
|
|
});
|
|
@@ -233,32 +257,34 @@ var productDetail = new Vue({
|
|
|
handleCollection:function (){
|
|
|
this.collectionType = !this.collectionType
|
|
|
},
|
|
|
- toLogin: function() {
|
|
|
+ toLogin: function () {
|
|
|
setBeforeUrl();
|
|
|
window.location.href = '/login.html';
|
|
|
},
|
|
|
- toUpgrade: function() {
|
|
|
+ toUpgrade: function () {
|
|
|
setBeforeUrl();
|
|
|
window.location.href = '/user/setting/upgrade.html';
|
|
|
},
|
|
|
- addShopCart: function(){ //加入购物车
|
|
|
- var _self = this;
|
|
|
- if(this.addStatus){
|
|
|
- _self.addStatus = false;
|
|
|
- addShoppingCart(this.userId, this.productId, this.number,function(){
|
|
|
+ addShopCart: function () { //加入购物车
|
|
|
+ var _self = this;
|
|
|
+ if (this.addStatus) {
|
|
|
+ _self.addStatus = false;
|
|
|
+ addShoppingCart(this.userId, this.productId, this.number, function () {
|
|
|
_self.addStatus = true;
|
|
|
});
|
|
|
- }
|
|
|
- },
|
|
|
- buyNowSubmit: function(){
|
|
|
- if(this.productId && this.number){
|
|
|
+ }
|
|
|
+ },
|
|
|
+ buyNowSubmit: function () {
|
|
|
+ if (this.productId && this.number) {
|
|
|
// type:(1购物车提交[对应表cm_cart],2直接购买提交, 3协销下单)
|
|
|
- window.location.href = '/shopping/confirm.html?type=2&id='+this.productId+'&count='+this.number;
|
|
|
+ window.location.href = '/shopping/confirm.html?type=2&id=' + this.productId + '&count=' + this.number;
|
|
|
}
|
|
|
},
|
|
|
- getRecommends: function(){
|
|
|
+ getRecommends: function () {
|
|
|
var _self = this;
|
|
|
- if(!this.productId){return;}
|
|
|
+ if (!this.productId) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
ProductApi.GetProductDdtailsRecommend(
|
|
|
{
|
|
|
productId: _self.productId,
|
|
@@ -266,110 +292,121 @@ var productDetail = new Vue({
|
|
|
userId: _self.userId
|
|
|
},
|
|
|
function (response) {
|
|
|
- if (response.code === 0 && response.data) {
|
|
|
- if(response.data.length > 0){
|
|
|
- _self.recommends = response.data;
|
|
|
- _self.recommendPage = isPC ? Math.ceil(response.data.length / 7) : Math.ceil(response.data.length / 3);
|
|
|
- setTimeout(function(){
|
|
|
- if (isPC) {
|
|
|
- $('#productRecommend').slide({
|
|
|
- mainCell:".swiper-wrapper",
|
|
|
- titCell:".swiper-pagination span",
|
|
|
- effect: "leftLoop",
|
|
|
- interTime: 3000,
|
|
|
- autoPlay: true,
|
|
|
- scroll:7,
|
|
|
- vis:7,
|
|
|
- trigger: "mouseover"
|
|
|
- });
|
|
|
- } else {
|
|
|
- var swiper = new Swiper('#productRecommend', {
|
|
|
- slidesPerView: 3,
|
|
|
- spaceBetween: 0,
|
|
|
- autoplay: {
|
|
|
- delay: 3000,
|
|
|
- disableOnInteraction: false
|
|
|
- },
|
|
|
- pagination: {
|
|
|
- el: '.swiper-pagination'
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },500);
|
|
|
+ if (response.code === 0 && response.data) {
|
|
|
+ if (response.data.length > 0) {
|
|
|
+ _self.recommends = response.data;
|
|
|
+ _self.recommendPage = isPC ? Math.ceil(response.data.length / 7) : Math.ceil(response.data.length / 3);
|
|
|
+ setTimeout(function () {
|
|
|
+ if (isPC) {
|
|
|
+ $('#productRecommend').slide({
|
|
|
+ mainCell: ".swiper-wrapper",
|
|
|
+ titCell: ".swiper-pagination span",
|
|
|
+ effect: "leftLoop",
|
|
|
+ interTime: 3000,
|
|
|
+ autoPlay: true,
|
|
|
+ scroll: 7,
|
|
|
+ vis: 7,
|
|
|
+ trigger: "mouseover"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ var swiper = new Swiper('#productRecommend', {
|
|
|
+ slidesPerView: 3,
|
|
|
+ spaceBetween: 0,
|
|
|
+ autoplay: {
|
|
|
+ delay: 3000,
|
|
|
+ disableOnInteraction: false
|
|
|
+ },
|
|
|
+ pagination: {
|
|
|
+ el: '.swiper-pagination'
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- });
|
|
|
+ });
|
|
|
},
|
|
|
- queryProductDetilsCoupons(){// 初始化商品详情优惠券信息
|
|
|
- var _self = this;
|
|
|
+ queryProductDetilsCoupons() {// 初始化商品详情优惠券信息
|
|
|
+ var _self = this;
|
|
|
ProductApi.QueryProductDetilsCoupons(_self.couponParam, function (response) {
|
|
|
- if(response.code == 0){
|
|
|
+ if (response.code == 0) {
|
|
|
var data = response.data;
|
|
|
- if(isPC){
|
|
|
- _self.productCoupon = response.data.list.splice(0,3);
|
|
|
- }else{
|
|
|
- _self.productCoupon = response.data.list.splice(0,2);
|
|
|
+ if (isPC) {
|
|
|
+ _self.productCoupon = response.data.list.splice(0, 3);
|
|
|
+ } else {
|
|
|
+ _self.productCoupon = response.data.list.splice(0, 2);
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log('获取优惠券列表失败');
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- queryPopupCoupons:function(){// 获取弹窗优惠券列表
|
|
|
- var _self = this;
|
|
|
+ queryPopupCoupons: function () {// 获取弹窗优惠券列表
|
|
|
+ var _self = this;
|
|
|
ProductApi.QueryProductDetilsCoupons(_self.couponParam, function (response) {
|
|
|
- if(response.code == 0){
|
|
|
+ if (response.code == 0) {
|
|
|
var data = response.data;
|
|
|
- if(data.couponList && data.couponList.length >0){
|
|
|
+ if (data.couponList && data.couponList.length > 0) {
|
|
|
_self.productCouponList = data.couponList;
|
|
|
_self.isCouponEmpty = false;
|
|
|
console.log('有优惠券')
|
|
|
console.log(_self.productCouponList)
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log('没有优惠券')
|
|
|
_self.isCouponEmpty = true;
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
console.log('获取优惠券列表失败')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- receiveCoupon:function(coupon){// 点击领取优惠券
|
|
|
- var _self = this;
|
|
|
- ProductApi.ReceiveCoupon({userId:_self.couponParam.userId, couponId:coupon.couponId, source:1}, function (response) {
|
|
|
- if(response.code == 0){
|
|
|
+ receiveCoupon: function (coupon) {// 点击领取优惠券
|
|
|
+ var _self = this;
|
|
|
+ ProductApi.ReceiveCoupon({
|
|
|
+ userId: _self.couponParam.userId,
|
|
|
+ couponId: coupon.couponId,
|
|
|
+ source: 1
|
|
|
+ }, function (response) {
|
|
|
+ if (response.code == 0) {
|
|
|
_self.currentTab = 2;
|
|
|
_self.couponParam.status = 2;
|
|
|
_self.queryPopupCoupons();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
CAIMEI.Alert(response.msg, '确定', false);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- queryCouponTabs:function (value){// 切换优惠券
|
|
|
+ queryCouponTabs: function (value) {// 切换优惠券
|
|
|
var _self = this;
|
|
|
_self.currentTab = _self.couponParam.status = value;
|
|
|
_self.queryPopupCoupons();
|
|
|
},
|
|
|
- showPopup:function(){// 显示优惠券弹窗
|
|
|
+ showPopup: function () {// 显示优惠券弹窗
|
|
|
var _self = this;
|
|
|
- if(_self.userId>0){
|
|
|
+ if (_self.userId > 0) {
|
|
|
_self.productCouponList = [];
|
|
|
_self.currentTab = 1;
|
|
|
_self.couponParam.status = 1;
|
|
|
_self.queryPopupCoupons();
|
|
|
_self.isShowPopup = true;
|
|
|
- }else{
|
|
|
- window.location.href='/login.html';
|
|
|
+ } else {
|
|
|
+ window.location.href = '/login.html';
|
|
|
}
|
|
|
},
|
|
|
- hidePopup:function(){// 隐藏优惠券弹窗
|
|
|
+ hidePopup: function () {// 隐藏优惠券弹窗
|
|
|
var _self = this;
|
|
|
_self.isShowPopup = false;
|
|
|
},
|
|
|
- detailsClicktab:function(index){
|
|
|
+ detailsClicktab: function (index) {
|
|
|
var _self = this;
|
|
|
_self.tabsIndex = index;
|
|
|
+ if (index !== 4) return;
|
|
|
+ // 只有当前用户权限为0,并且未初始化时初始化图片预览
|
|
|
+ if (_self.permission === 0) {
|
|
|
+ setTimeout(function () {
|
|
|
+ _self.initPreviewImage()
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|
|
@@ -378,19 +415,19 @@ var productDetail = new Vue({
|
|
|
this.getImages();
|
|
|
// identity: 0个人,1协销,2会员机构,3供应商,4普通机构
|
|
|
// visibility:3:所有人可见,2:普通机构可见,1:会员机构可见
|
|
|
- var visible = $("#productVisibility").val()*1;
|
|
|
+ var visible = $("#productVisibility").val() * 1;
|
|
|
var identity = GLOBAL_USER_IDENTITY;
|
|
|
this.showProduct = visible === 3 || identity === 1 || identity === 2 || (identity === 4 && visible === 2);
|
|
|
- if(!this.showProduct) {
|
|
|
+ if (!this.showProduct) {
|
|
|
window.location.href = "/404.html?error=未查询到该商品";
|
|
|
}
|
|
|
},
|
|
|
mounted: function () {
|
|
|
- this.userId = this.couponParam.userId = GLOBAL_USER_ID;
|
|
|
this.getProductDetails();
|
|
|
this.getProductPrice();
|
|
|
this.getParameters();
|
|
|
this.queryProductDetilsCoupons();
|
|
|
+
|
|
|
// $('.productInfo').slide({
|
|
|
// mainCell:".tabCon"
|
|
|
// ,titCell:".tabTit span"
|