合并冲突

This commit is contained in:
Gao xiaosong
2021-11-12 22:47:41 +08:00
38 changed files with 2779 additions and 890 deletions

View File

@ -72,37 +72,34 @@ export default {
!this.loading && this.getProductReplyList();
},
methods: {
getProductReplyCount: function() {
let that = this;
getReplyConfig(that.product_id).then(res => {
that.$set(that, "replyData", res.data);
that.navList[0].num = res.data.sumCount;
that.navList[1].num = res.data.goodCount;
that.navList[2].num = res.data.inCount;
that.navList[3].num = res.data.poorCount;
getProductReplyCount () {
getReplyConfig(this.product_id).then(res => {
this.$set(that, "replyData", res.data);
this.navList[0].num = res.data.sumCount;
this.navList[1].num = res.data.goodCount;
this.navList[2].num = res.data.inCount;
this.navList[3].num = res.data.poorCount;
});
},
getProductReplyList: function() {
let that = this;
if (that.loading) return; //阻止下次请求false可以进行请求
if (that.loadend) return; //阻止结束当前请求false可以进行请求
that.loading = true;
let q = { page: that.page, limit: that.limit, type: that.currentActive };
getReplyList(that.product_id, q).then(res => {
that.loading = false;
getProductReplyList () {
if (this.loading) return; //阻止下次请求false可以进行请求
if (this.loadend) return; //阻止结束当前请求false可以进行请求
this.loading = true;
let q = { page: this.page, limit: this.limit, type: this.currentActive };
getReplyList(this.product_id, q).then(res => {
this.loading = false;
//apply();js将一个数组插入另一个数组;
that.reply.push.apply(that.reply, res.data);
that.loadend = res.data.length < that.limit; //判断所有数据是否加载完成;
that.page = that.page + 1;
this.reply.push.apply(this.reply, res.data);
this.loadend = res.data.length < this.limit; //判断所有数据是否加载完成;
this.page = this.page + 1;
});
},
changeType: function(index) {
let that = this;
that.currentActive = index;
that.page = 1;
that.loadend = false;
that.$set(that, "reply", []);
that.getProductReplyList();
changeType (index) {
this.currentActive = index;
this.page = 1;
this.loadend = false;
this.$set(this, "reply", []);
this.getProductReplyList();
}
}
};

View File

@ -108,7 +108,7 @@ export default {
nows: false,
recommendLoading: false,
target: false,
isIntegral: false,
isIntegral: false
}
},
watch: {
@ -189,18 +189,19 @@ export default {
this.stock = 0
// this.getProductList();
}
let q = that.where
let q = this.where
let getData = this.isIntegral !== 'true' ? getProducts : getProductsIntegral
getData(q).then(res => {
that.loading = false
if (that.target) {
that.productList = res.data
this.loading = false
if (this.target) {
this.productList = res.data
this.target = false
} else {
that.productList.push.apply(that.productList, res.data)
this.productList.push.apply(this.productList, res.data)
}
that.target = false
that.loadend = res.data.length < that.where.limit //判断所有数据是否加载完成;
that.where.page = that.where.page + 1
console.log(this.target)
this.loadend = res.data.length < this.where.limit //判断所有数据是否加载完成;
this.where.page = this.where.page + 1
})
},
submitForm: function() {
@ -248,27 +249,25 @@ export default {
that.getProductList()
},
//设置where条件
setWhere: function() {
let that = this
if (that.price === 0) {
that.where.priceOrder = ''
} else if (that.price === 1) {
that.where.priceOrder = 'asc'
} else if (that.price === 2) {
that.where.priceOrder = 'desc'
setWhere() {
if (this.price === 0) {
this.where.priceOrder = ''
} else if (this.price === 1) {
this.where.priceOrder = 'asc'
} else if (this.price === 2) {
this.where.priceOrder = 'desc'
}
if (that.stock === 0) {
that.where.salesOrder = ''
} else if (that.stock === 1) {
that.where.salesOrder = 'asc'
} else if (that.stock === 2) {
that.where.salesOrder = 'desc'
if (this.stock === 0) {
this.where.salesOrder = ''
} else if (this.stock === 1) {
this.where.salesOrder = 'asc'
} else if (this.stock === 2) {
this.where.salesOrder = 'desc'
}
that.where.news = that.nows ? '1' : '0'
this.where.news = this.nows ? '1' : '0'
},
switchTap: function() {
let that = this
that.Switch = !that.Switch
switchTap() {
this.Switch = !this.Switch
},
},
}

View File

@ -520,5 +520,9 @@
}
.shoppingCart{
position: relative;
.list{
margin-top: 150rpx;
padding-top: 15rpx;
}
}
</style>