|
@@ -18,23 +18,30 @@ var previewContainer = new Vue({
|
|
|
trainingMethodText:'',
|
|
|
trainingType:'',
|
|
|
isTrainingMethod:false,
|
|
|
+ skuStext:''
|
|
|
},
|
|
|
computed: {
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
shopInfoData: function(){
|
|
|
- var _this = this;
|
|
|
+ const _this = this;
|
|
|
SupplierApi.SupplierViewShopInfo({userId:_this.userId},function(response){
|
|
|
- if(response.code ==0 ){
|
|
|
+ if(response.code ===0 ){
|
|
|
_this.isRequest = true;
|
|
|
_this.shopData = response.data.shop;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
infoFata: function(){
|
|
|
- var _this = this;
|
|
|
+ const _this = this;
|
|
|
_this.previewThumb = _this.shopInfo.params.image;
|
|
|
+ let newArray = this.shopInfo.skus
|
|
|
+ this.skuStext = newArray.map(item =>{ return item.unit }).join(',')
|
|
|
+ this.shopInfo.price = newArray[0].price;
|
|
|
+ this.shopInfo.normalPrice = newArray[0].normalPrice;
|
|
|
+ this.shopInfo.minBuyNumber = newArray[0].minBuyNumber;
|
|
|
+ this.shopInfo.stock = newArray[0].stock;
|
|
|
},
|
|
|
changeTab: function(index){
|
|
|
this.tabIndex = index;
|
|
@@ -49,7 +56,7 @@ var previewContainer = new Vue({
|
|
|
return "title_" +index
|
|
|
},
|
|
|
setArray: function(arr){//回显处理字符串
|
|
|
- var _ARRAY = [];
|
|
|
+ const _ARRAY = [];
|
|
|
arr.split(',').forEach(function(item,index){
|
|
|
var _OBJ = {name:item};
|
|
|
_ARRAY.push(_OBJ)
|
|
@@ -58,7 +65,7 @@ var previewContainer = new Vue({
|
|
|
},
|
|
|
},
|
|
|
mounted: function () {
|
|
|
- var _this = this;
|
|
|
+ const _this = this;
|
|
|
if(globalUserData){
|
|
|
_this.userId = globalUserData.userId;
|
|
|
_this.shopId = globalUserData.shopId;
|
|
@@ -77,7 +84,7 @@ var previewContainer = new Vue({
|
|
|
}
|
|
|
console.log(_this.previewTags);
|
|
|
}
|
|
|
- var magnifier = new mag('.preview-banner-big', '.preview-box','#CM____pic_thumb','.hover','.bigitem');
|
|
|
- magnifier.init();
|
|
|
+ const magnifier = new mag('.preview-banner-big', '.preview-box', '#CM____pic_thumb', '.hover', '.bigitem');
|
|
|
+ magnifier.init();
|
|
|
}
|
|
|
});
|