2023-02-23
功能完善
This commit is contained in:
@@ -360,19 +360,35 @@
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo']),
|
||||
},
|
||||
methods: {
|
||||
clickParentMethod() {
|
||||
console.log('clickParentMethod')
|
||||
this.$refs.SubComponent.callSubMethod()
|
||||
},
|
||||
callParentMethod(val) {
|
||||
let info = val
|
||||
console.log('callParentMethod: ' + val)
|
||||
console.log('val: ' + val.id)
|
||||
console.log('val: ' + info.id)
|
||||
// 默认去遍历list集合,将集合中的每个元素传入到function的item里,
|
||||
var index = this.couponList.findIndex(function(item) {
|
||||
return item.id == val.id;
|
||||
})
|
||||
var index = this.couponList.findIndex(
|
||||
// function(item) {
|
||||
// console.log('item: ' + JSON.stringify(item))
|
||||
// console.log('val: ' + val)
|
||||
// return item.id == val.id;
|
||||
item => {
|
||||
console.log('item: ' + JSON.stringify(item).id)
|
||||
console.log('val: ' + val.id)
|
||||
if (item == val) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
console.log('index: ' + index)
|
||||
this.couponList.splice(index, 1);
|
||||
|
||||
// this.getCouponList();
|
||||
},
|
||||
|
||||
async sysInfoMethod() {
|
||||
@@ -526,7 +542,7 @@
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取轮播图
|
||||
* 获取优惠券
|
||||
*/
|
||||
async getCouponList() {
|
||||
let params = {
|
||||
@@ -536,7 +552,9 @@
|
||||
if (data) {
|
||||
console.log("优惠券")
|
||||
console.log("优惠券", data)
|
||||
this.couponList = data || [];
|
||||
console.log("优惠券id",data[0].id)
|
||||
this.couponList = []
|
||||
this.couponList = this.couponList.concat(data) || [];
|
||||
}
|
||||
},
|
||||
/**
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user