inviteGhsShop.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="app-content">
  3. <view class="img_box">
  4. <image :src="imgUrl" class="img_url"></image>
  5. </view>
  6. <view style="margin:50upx 0 0 32upx;font-size:30upx;">保存图片,并分享给您要邀请的人识别注册。</view>
  7. <div class="confirm-btn">
  8. <button class="admin-button-com big blue" @click="downloadImg">保存图片</button>
  9. </div>
  10. <!-- #ifdef MP-WEIXIN -->
  11. <div class="confirm-btn1">
  12. <button class="admin-button-com big default" @click="goToMallPt()">直接打开</button>
  13. </div>
  14. <!-- #endif -->
  15. </view>
  16. </template>
  17. <script>
  18. import { applyInviteGhsPoster } from '@/api/apply/index'
  19. import { getWeixinId } from "@/api/invite/index";
  20. import { mapGetters } from "vuex";
  21. export default {
  22. data() {
  23. return {
  24. imgUrl: '',
  25. getappIdList: {}
  26. }
  27. },
  28. computed: {
  29. ...mapGetters({ loginInfo: "getLoginInfo" })
  30. },
  31. methods: {
  32. init() {
  33. this.getImg()
  34. getWeixinId().then(res => {
  35. this.getappIdList = res.data
  36. });
  37. },
  38. downloadImg() {
  39. uni.downloadFile({
  40. url: this.imgUrl,
  41. success: (res) => {
  42. console.log(res)
  43. uni.saveImageToPhotosAlbum({
  44. filePath: res.tempFilePath,
  45. success: function() {
  46. uni.showToast({
  47. title: '保存成功',
  48. icon: 'none'
  49. });
  50. },
  51. fail: (res) => {
  52. // this.$msg('保存失败')
  53. uni.showToast({
  54. title: '保存失败',
  55. icon: 'none'
  56. });
  57. }
  58. })
  59. },
  60. })
  61. },
  62. getImg() {
  63. applyInviteGhsPoster().then(res => {
  64. console.log(res)
  65. this.imgUrl = res.data.imgUrl
  66. }).catch(err => {})
  67. },
  68. goToMallPt () {
  69. //查看分享的路径,不要删除 shish 20210517
  70. console.log('pagesClient/official/index?ghsShopAdminId='+this.loginInfo.shopAdminId)
  71. this.pageTo({url: `/pagesClient/official/index?ghsShopAdminId=${this.loginInfo.shopAdminId}`})
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .app-content{
  78. overflow: hidden;
  79. }
  80. .img_box{
  81. height: 450upx;
  82. box-sizing: border-box;
  83. &>.img_url{
  84. height: 450upx;
  85. width: 450upx;
  86. margin: 100upx auto;
  87. }
  88. }
  89. // 按钮
  90. .confirm-btn {
  91. width: calc(100% - 60upx);
  92. margin: 50upx 30upx 20upx;
  93. .admin-button-com {
  94. width: 100%;
  95. }
  96. }
  97. // 按钮
  98. .confirm-btn1 {
  99. width: calc(100% - 60upx);
  100. margin: 50upx 30upx 20upx;
  101. .admin-button-com {
  102. width: 100%;
  103. }
  104. }
  105. </style>