inviteShop.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. <template>
  2. <view class="app-content">
  3. <view class="img_box">
  4. <image :src="imgUrl" class="img_url"></image>
  5. </view>
  6. <view class="intro">
  7. <view>1、保存图片分享给供货商,供货商识别并注册</view>
  8. <view>2、直接打开分享给供货商注册也可以</view>
  9. <view>3、奖金分二次发放,供货商注册并审核通过奖励10元,供货商线上营业额达20万元,奖励290元</view>
  10. <view>4、只能邀请城市批发商,昆明批发商无法使用</view>
  11. <view>5、如有疑问,请<text style="color:blue" @click="getCustomService()">点我联系客服</text></view>
  12. </view>
  13. <div class="confirm-btn">
  14. <button class="admin-button-com big blue" @click="downloadImg">保存图片邀请</button>
  15. </div>
  16. <div class="confirm-btn1">
  17. <button class="admin-button-com big blue" @click="goToMallPt()">直接打开邀请</button>
  18. </div>
  19. </view>
  20. </template>
  21. <script>
  22. import { applyInviteGhsPoster } from '@/api/apply/index'
  23. import { getWeixinId } from "@/api/invite/index";
  24. import { mapGetters } from "vuex";
  25. export default {
  26. data() {
  27. return {
  28. imgUrl: '',
  29. getappIdList: {}
  30. }
  31. },
  32. computed: {
  33. ...mapGetters({ loginInfo: "getLoginInfo" })
  34. },
  35. methods: {
  36. getCustomService(){
  37. let self = this;
  38. uni.showModal({
  39. title: "请加客服微信",
  40. content: "15280215347",
  41. cancelText: "取消",
  42. confirmText: "复制",
  43. success: function (res) {
  44. if (res.confirm) {
  45. uni.setClipboardData({
  46. data: "15280215347",
  47. success: function() {
  48. self.$msg("已复制")
  49. }
  50. });
  51. }
  52. },
  53. })
  54. },
  55. init() {
  56. this.getImg()
  57. getWeixinId().then(res => {
  58. this.getappIdList = res.data
  59. });
  60. },
  61. downloadImg() {
  62. uni.downloadFile({
  63. url: this.imgUrl,
  64. success: (res) => {
  65. console.log(res)
  66. uni.saveImageToPhotosAlbum({
  67. filePath: res.tempFilePath,
  68. success: function() {
  69. uni.showToast({
  70. title: '保存成功',
  71. icon: 'none'
  72. });
  73. },
  74. fail: (res) => {
  75. // this.$msg('保存失败')
  76. uni.showToast({
  77. title: '保存失败',
  78. icon: 'none'
  79. });
  80. }
  81. })
  82. },
  83. })
  84. },
  85. getImg() {
  86. applyInviteGhsPoster().then(res => {
  87. console.log(res)
  88. this.imgUrl = res.data.imgUrl
  89. }).catch(err => {})
  90. },
  91. goToMallPt () {
  92. //查看分享的路径,不要删除 shish 20210517
  93. console.log('pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId)
  94. getWeixinId().then(res => {
  95. uni.navigateToMiniProgram({
  96. appId: res.data.ghs.miniAppId,
  97. path: 'pagesClient/official/index?hdShopAdminId='+this.loginInfo.shopAdminId,
  98. //develop 开发版 trial 体验版 release 正式版
  99. envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
  100. extraData: {},
  101. success(res) {
  102. // 打开成功
  103. }
  104. })
  105. })
  106. },
  107. }
  108. }
  109. </script>
  110. <style lang="scss" scoped>
  111. .app-content{
  112. overflow: hidden;
  113. .intro{
  114. padding:50upx 35upx 0 35upx;
  115. font-size:30upx;
  116. view{
  117. margin-top:15upx;
  118. }
  119. }
  120. }
  121. .img_box{
  122. height: 450upx;
  123. box-sizing: border-box;
  124. &>.img_url{
  125. height: 450upx;
  126. width: 450upx;
  127. margin: 50upx auto;
  128. }
  129. }
  130. // 按钮
  131. .confirm-btn {
  132. width: calc(100% - 60upx);
  133. margin: 50upx 30upx 20upx;
  134. .admin-button-com {
  135. width: 100%;
  136. }
  137. }
  138. // 按钮
  139. .confirm-btn1 {
  140. width: calc(100% - 60upx);
  141. margin: 50upx 30upx 20upx;
  142. .admin-button-com {
  143. width: 100%;
  144. }
  145. }
  146. </style>