creditGiftAlert.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // components/creditGiftAlert/creditGiftAlert.js
  2. Component({
  3. /**
  4. * 组件的属性列表
  5. */
  6. properties: {
  7. isReady: {
  8. type: Boolean,
  9. value: false
  10. },
  11. obj: Object
  12. },
  13. /**
  14. * 组件的初始数据
  15. */
  16. data: {
  17. imgOne: 'https://yuesuo.yueguanjia.com/MiniProgram/images/phaseI/coupnB.png',
  18. imgRed: 'https://yuesuo.yueguanjia.com/MiniProgram/images/phaseI/coupnR.png',
  19. sB: 'https://yuesuo.yueguanjia.com/MiniProgram/images/phaseI/giftB.png',
  20. sR: 'https://yuesuo.yueguanjia.com/MiniProgram/images/phaseI/giftR.png',
  21. gifpicsrc: ''
  22. },
  23. /**
  24. * 组件的方法列表
  25. */
  26. methods: {
  27. // 关闭弹窗
  28. closeGift: function() {
  29. this.triggerEvent('closeGift', {}, {})
  30. },
  31. // 跳转到优惠券页面
  32. gotoCoupon: function() {
  33. this.closeGift()
  34. wx.navigateTo({
  35. url: '/pages/mine/mycoupon/mycoupon'
  36. })
  37. },
  38. //领取实物礼品
  39. getgift: function() {
  40. this.closeGift()
  41. let cityname = wx.getStorageSync('branche_name')
  42. if (cityname == '上海') {
  43. this.setData({
  44. gifpicsrc: 'http://yuesuo.yueguanjia.com/college/present/sh.jpg'
  45. })
  46. } else if (cityname == '苏州') {
  47. this.setData({
  48. gifpicsrc: 'http://yuesuo.yueguanjia.com/college/present/sz.jpg'
  49. })
  50. }
  51. wx.navigateTo({
  52. url: '/pages/supermama/gifout/gifout?src='+this.data.gifpicsrc
  53. })
  54. }
  55. },
  56. ready: function() {
  57. console.log(this.data.obj)
  58. }
  59. })