|
@@ -5,6 +5,7 @@ var productDetail = new Vue({
|
|
|
showProduct: false,
|
|
|
productId: 0,
|
|
|
userId: 0,
|
|
|
+ identity:0,
|
|
|
number: 0,
|
|
|
productStock: 0,
|
|
|
pcActType: 0,
|
|
@@ -22,6 +23,7 @@ var productDetail = new Vue({
|
|
|
supplierId: 0,
|
|
|
userIdentity: 0 //2-会员机构;3-供应商;4-普通机构
|
|
|
},
|
|
|
+ product:{},// 商品信息
|
|
|
ladderList: [],//阶梯价
|
|
|
promotions: {},//促销活动信息
|
|
|
promotionsId: 0,//活动id
|
|
@@ -171,6 +173,7 @@ var productDetail = new Vue({
|
|
|
ProductApi.GetProductDdtails({userId: GLOBAL_USER_ID, productId: _self.productId}, function (response) {
|
|
|
if (response.code == 0) {
|
|
|
var product = response.data;
|
|
|
+ _self.product = response.data;
|
|
|
_self.pcActType = product.pcActType;
|
|
|
_self.beautyActFlag = product.beautyActFlag;
|
|
|
_self.productTypeName = product.typeName;
|
|
@@ -210,6 +213,10 @@ var productDetail = new Vue({
|
|
|
if (product.stock == 0 && product.validFlag != 3) {
|
|
|
_self.disabledText = '售罄'
|
|
|
}
|
|
|
+ if(product.productType === 2 && (GLOBAL_USER_IDENTITY != 3)){
|
|
|
+ _self.handleShowProductType()
|
|
|
+ return
|
|
|
+ }
|
|
|
_self.getRecommends();
|
|
|
_self.getProdcutArchiveDetails(); //获取资料列表
|
|
|
// 获取路由hash标识,设置默认展开tab
|
|
@@ -222,6 +229,49 @@ var productDetail = new Vue({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ handleShowProductType: function (){
|
|
|
+ if(GLOBAL_USER_ID === 0){//游客
|
|
|
+ CAIMEI.Popup({
|
|
|
+ content: '<div class="payAlert"><p>该商品仅限医美类机构查看,请注册医美机构后继续查看。有采美账号的,请直接登录。</p></div>',
|
|
|
+ confitmBtnText: '去注册/登录',
|
|
|
+ cancelBtnText: '关闭'
|
|
|
+ },function(){
|
|
|
+ // 确定
|
|
|
+ window.location.href = '/login.html';
|
|
|
+ },function(){
|
|
|
+ // 关闭
|
|
|
+ window.history.back(-1);
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ if(GLOBAL_USER_IDENTITY === 4 ){// 普通机构
|
|
|
+ CAIMEI.Popup({
|
|
|
+ content: '<div class="payAlert"><p>该商品仅限医美类机构查看,请升级为医美机构后继续查看。</p></div>',
|
|
|
+ confitmBtnText: '去升级',
|
|
|
+ cancelBtnText: '关闭'
|
|
|
+ },function(){
|
|
|
+ // 确定
|
|
|
+ window.location.href = '/user/setting/upgrade.html';
|
|
|
+ },function(){
|
|
|
+ // 关闭
|
|
|
+ window.history.back(-1);
|
|
|
+ });
|
|
|
+ }else if( GLOBAL_USER_IDENTITY === 2 ){//会员机构
|
|
|
+ if(GLOBAL_CLUB_TYPE != 1){
|
|
|
+ CAIMEI.Popup({
|
|
|
+ content: '<div class="payAlert"><p>该商品仅限医美类机构查看,您暂无权限。您可去机构资料页面查看机构类型。</p></div>',
|
|
|
+ confitmBtnText: '去查看资料',
|
|
|
+ cancelBtnText: '关闭'
|
|
|
+ },function(){
|
|
|
+ // 确定
|
|
|
+ window.location.href = '/user/setting/information.html';
|
|
|
+ },function(){
|
|
|
+ // 关闭
|
|
|
+ window.history.back(-1);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
getProductPrice: function () {//获取商品价格
|
|
|
var _self = this;
|
|
|
if (_self.productId === 0) {
|
|
@@ -731,6 +781,7 @@ var productDetail = new Vue({
|
|
|
// visibility:3:所有人可见,2:普通机构可见,1:会员机构可见
|
|
|
var visible = $("#productVisibility").val() * 1;
|
|
|
var identity = GLOBAL_USER_IDENTITY;
|
|
|
+ this.identity = identity
|
|
|
this.showProduct = visible === 3 || identity === 1 || identity === 2 || (identity === 4 && visible === 2);
|
|
|
if (!this.showProduct) {
|
|
|
window.location.href = "/404.html?error=未查询到该商品";
|