|
@@ -53,27 +53,28 @@ var promotionsList = new Vue({
|
|
|
},
|
|
|
getPromotions: function(){
|
|
|
var _self = this;
|
|
|
- $.getJSON(spiServer+"/product/promotion/info?promotionsId="+this.params.id, function (r) {
|
|
|
- if (r.code === 0 && r.data) {
|
|
|
- _self.promotions = r.data;
|
|
|
+ ProductApi.GetPromotionsInfo({promotionsId:this.params.id},function (res) {
|
|
|
+ if (res.code === 0 && res.data) {
|
|
|
+ _self.promotions = res.data;
|
|
|
_self.getProductsByPromotions();
|
|
|
}else{
|
|
|
CAIMEI.Alert("该促销活动已过期或不存在!", '确定', true, function(){
|
|
|
window.location.href="/";
|
|
|
});
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
getProductsByPromotions: function () {
|
|
|
var _self = this;
|
|
|
- $.getJSON(spiServer+"/product/promotion/products",{
|
|
|
+ ProductApi.GetPromotionsProduct({
|
|
|
promotionsId: this.params.id,
|
|
|
pageSize: this.params.size,
|
|
|
- pageNum: this.params.num
|
|
|
- },function (r) {
|
|
|
- if (r.code === 0 && r.data) {
|
|
|
- _self.listRecord = r.data.total;
|
|
|
- var resultData = r.data.list;
|
|
|
+ pageNum: this.params.num,
|
|
|
+ identity:this.userIdentity
|
|
|
+ },function (res) {
|
|
|
+ if (res.code === 0 && res.data) {
|
|
|
+ _self.listRecord = res.data.total;
|
|
|
+ var resultData = res.data.list;
|
|
|
var productIdArr = [];
|
|
|
resultData.map(function (item) {
|
|
|
productIdArr.push(item.id)
|
|
@@ -86,11 +87,13 @@ var promotionsList = new Vue({
|
|
|
}else{
|
|
|
_self.listData = _self.listData.concat(resultData);
|
|
|
}
|
|
|
- console.log(_self.listData)
|
|
|
+ console.log(_self.listData);
|
|
|
+ _self.listLoading = false;
|
|
|
+ _self.requestFlag = true;
|
|
|
+ }else{
|
|
|
+ CAIMEI.Alert(res.msg, '确定');
|
|
|
}
|
|
|
- _self.listLoading = false;
|
|
|
- _self.requestFlag = true;
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|