|
@@ -34,7 +34,7 @@ var productDetail = new Vue({
|
|
methods: {
|
|
methods: {
|
|
getImages: function(){
|
|
getImages: function(){
|
|
var _self = this;
|
|
var _self = this;
|
|
- if(this.productId ===0){return;}
|
|
|
|
|
|
+ if(!this.productId){return;}
|
|
$.getJSON(spiServer + "/product/detail/images",{productId: this.productId}).done(function (r) {
|
|
$.getJSON(spiServer + "/product/detail/images",{productId: this.productId}).done(function (r) {
|
|
if (r.code === 0 && r.data) {
|
|
if (r.code === 0 && r.data) {
|
|
_self.images = r.data;
|
|
_self.images = r.data;
|
|
@@ -208,7 +208,7 @@ var productDetail = new Vue({
|
|
},
|
|
},
|
|
getRecommends: function(){
|
|
getRecommends: function(){
|
|
var _self = this;
|
|
var _self = this;
|
|
- if(this.productId ===0){return;}
|
|
|
|
|
|
+ if(!this.productId){return;}
|
|
$.getJSON(spiServer + "/product/detail/recommend",{
|
|
$.getJSON(spiServer + "/product/detail/recommend",{
|
|
productId: this.productId,
|
|
productId: this.productId,
|
|
recommendType: this.recommendType
|
|
recommendType: this.recommendType
|
|
@@ -233,7 +233,7 @@ var productDetail = new Vue({
|
|
},
|
|
},
|
|
ladderPrice:function(){
|
|
ladderPrice:function(){
|
|
var _self = this;
|
|
var _self = this;
|
|
- if(this.productId ===0){return;}
|
|
|
|
|
|
+ if(!this.productId){return;}
|
|
$.getJSON(spiServer + "/product/ladderPrice",{
|
|
$.getJSON(spiServer + "/product/ladderPrice",{
|
|
productId: this.productId
|
|
productId: this.productId
|
|
}).done(function (r) {
|
|
}).done(function (r) {
|
|
@@ -255,7 +255,7 @@ var productDetail = new Vue({
|
|
},
|
|
},
|
|
getParameters: function(){
|
|
getParameters: function(){
|
|
var _self = this;
|
|
var _self = this;
|
|
- if(this.productId ===0){return;}
|
|
|
|
|
|
+ if(!this.productId){return;}
|
|
$.getJSON(spiServer + "/product/detail/parameter",{
|
|
$.getJSON(spiServer + "/product/detail/parameter",{
|
|
productId: this.productId
|
|
productId: this.productId
|
|
}).done(function (r) {
|
|
}).done(function (r) {
|
|
@@ -286,7 +286,7 @@ var productDetail = new Vue({
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created: function () {
|
|
created: function () {
|
|
- this.productId = getUrlParam("id") ? getUrlParam("id")*1 : 0;
|
|
|
|
|
|
+ this.productId = $("#productId").val();
|
|
var userInfo = localStorage.getItem('userInfo');
|
|
var userInfo = localStorage.getItem('userInfo');
|
|
if(userInfo){
|
|
if(userInfo){
|
|
this.userId = JSON.parse(userInfo).userId*1;
|
|
this.userId = JSON.parse(userInfo).userId*1;
|