|
|
@ -245,8 +245,8 @@ |
|
|
|
</view> |
|
|
|
<text class="title clamp">{{ item.name }}</text> |
|
|
|
<view> |
|
|
|
<text class="price">惠农价¥{{ item.price }}</text> |
|
|
|
<text class="m-price">市场价¥{{ item.originalPrice }}</text> |
|
|
|
<text class="price">惠农价¥{{ item.originalPrice }}</text> |
|
|
|
<text class="m-price">市场价¥{{ item.price }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@ -360,6 +360,9 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState(['hasLogin', 'userInfo']), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
clickParentMethod() { |
|
|
|
console.log('clickParentMethod') |
|
|
@ -368,11 +371,21 @@ |
|
|
|
callParentMethod(val) { |
|
|
|
console.log('callParentMethod: ' + val) |
|
|
|
// 默认去遍历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_id: ' +JSON.parse(JSON.stringify(item)).id) |
|
|
|
console.log('val_id: ' +JSON.parse(val).id) |
|
|
|
if (JSON.parse(JSON.stringify(item)).id == JSON.parse(val).id) { |
|
|
|
return true |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log('index: ' + index) |
|
|
|
this.couponList.splice(index, 1); |
|
|
|
|
|
|
|
// this.getCouponList(); |
|
|
|
}, |
|
|
|
|
|
|
|
async sysInfoMethod() { |
|
|
@ -526,7 +539,7 @@ |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 获取轮播图 |
|
|
|
* 获取优惠券 |
|
|
|
*/ |
|
|
|
async getCouponList() { |
|
|
|
let params = { |
|
|
@ -536,7 +549,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) || []; |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
@ -785,25 +800,25 @@ |
|
|
|
url: '/pages/search/search' |
|
|
|
}); |
|
|
|
}, |
|
|
|
//点击导航栏 buttons 时触发 |
|
|
|
onNavigationBarButtonTap(e) { |
|
|
|
const index = e.index; |
|
|
|
if (index === 0) { |
|
|
|
this.$api.msg('点击了扫描'); |
|
|
|
} else if (index === 1) { |
|
|
|
// #ifdef APP-PLUS |
|
|
|
const pages = getCurrentPages(); |
|
|
|
const page = pages[pages.length - 1]; |
|
|
|
const currentWebview = page.$getAppWebview(); |
|
|
|
currentWebview.hideTitleNViewButtonRedDot({ |
|
|
|
index |
|
|
|
}); |
|
|
|
// #endif |
|
|
|
uni.navigateTo({ |
|
|
|
url: '../../pagesU/notice/notice' |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
// //点击导航栏 buttons 时触发 |
|
|
|
// onNavigationBarButtonTap(e) { |
|
|
|
// const index = e.index; |
|
|
|
// if (index === 0) { |
|
|
|
// this.$api.msg('点击了扫描'); |
|
|
|
// } else if (index === 1) { |
|
|
|
// // #ifdef APP-PLUS |
|
|
|
// const pages = getCurrentPages(); |
|
|
|
// const page = pages[pages.length - 1]; |
|
|
|
// const currentWebview = page.$getAppWebview(); |
|
|
|
// currentWebview.hideTitleNViewButtonRedDot({ |
|
|
|
// index |
|
|
|
// }); |
|
|
|
// // #endif |
|
|
|
// uni.navigateTo({ |
|
|
|
// url: '../../pagesU/notice/notice' |
|
|
|
// }); |
|
|
|
// } |
|
|
|
// } |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|