goods-mixin.js 766 B

123456789101112131415161718192021222324252627282930313233
  1. export default {
  2. onLoad() {
  3. console.log('--商品混入--');
  4. },
  5. computed: {
  6. remindParams() {
  7. return {
  8. sell_time: this.sell_time,
  9. goods_id: this.goods ? this.goods.id : 0,
  10. template_message_list: this.template_message_list,
  11. buy_text: '立即购买'
  12. };
  13. },
  14. rightRemindText() {
  15. if (this.remindParams.sell_time > 5*60) {
  16. return '开售提醒我';
  17. } else if (this.remindParams.sell_time > 0) {
  18. return '即将开售';
  19. } else {
  20. return this.remindParams.buy_text;
  21. }
  22. }
  23. },
  24. methods: {
  25. rightTip() {
  26. if (this.remindParams.sell_time < 5*60) {
  27. console.log('小于5分钟不进行开售提醒')
  28. return ;
  29. }
  30. this.$goodsRemind(this.remindParams.template_message_list, this.remindParams.goods_id);
  31. },
  32. }
  33. }