index.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import {
  2. getPromotionText
  3. } from '~/api/sale'
  4. Component({
  5. properties: {
  6. },
  7. data: {
  8. current: 0,
  9. list: []
  10. },
  11. lifetimes: {
  12. async attached() {
  13. let list = await getPromotionText()
  14. this.setData({
  15. list
  16. })
  17. }
  18. },
  19. methods: {
  20. openInvite() {
  21. this.selectComponent("#popUp").showModal()
  22. },
  23. closeInvite() {
  24. this.selectComponent("#popUp").hideModal()
  25. },
  26. swiperChange(e) {
  27. this.setData({
  28. current: e.detail.current
  29. })
  30. },
  31. clipboar() {
  32. wx.setClipboardData({
  33. data: this.data.list[this.data.current].text,
  34. success: function (res) { //成功回调函数
  35. wx.showToast({
  36. title: '已复制',
  37. icon: "none"
  38. })
  39. },
  40. fail(res) {
  41. console.log(res, 'rrr');
  42. }
  43. })
  44. },
  45. createPoster() {
  46. this.closeInvite()
  47. this.selectComponent('#createPoster').open()
  48. },
  49. jump() {
  50. wx.navigateTo({
  51. url: '/salesperson/pages/gzhShare/index',
  52. })
  53. },
  54. }
  55. })