shareCardPage.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <view class="share_body">
  3. <view class="share_card_info">
  4. <view class="share_title">
  5. <image class="title" src="../../static/icons/icon_share_title.png" mode=""></image>
  6. <image @click="back" class="close" src="../../static/icons/icon_close_share.png" mode=""></image>
  7. </view>
  8. <view class="share_desc">
  9. {{shareRemark}}
  10. </view>
  11. <view class="share_copy" @click="copy">
  12. <image class="icon_share_copy" src="../../static/icons/icon_copy.png" mode=""></image>
  13. <text class="share_txt">复制发圈</text>
  14. </view>
  15. <image class="shareCard" :src="shareUrl" mode=""></image>
  16. </view>
  17. <view class="share_copy_txt">
  18. 长按图片保存至本地
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. shareUrl:"",
  27. type:"",
  28. projectId:"",
  29. page:"",
  30. shareRemark:"",
  31. };
  32. },
  33. created() {
  34. },
  35. onLoad(param) {
  36. this.page = param.page;
  37. this.projectId =param.projectId;
  38. this.type=param.type;
  39. this.getShareCard();
  40. this.queryProjectByH5();
  41. },
  42. methods:{
  43. async getShareCard(){
  44. let ret = await this.$myRequest({
  45. url: "/share/shareCard",
  46. data: {
  47. "page": this.page,
  48. "projectId": this.projectId,
  49. "type":this.type
  50. }
  51. })
  52. if (ret.data.success) {
  53. this.shareUrl = ret.data.single
  54. }
  55. },
  56. async queryProjectByH5(){
  57. let ret = await this.$myRequest({
  58. url: "/project/queryProjectByH5",
  59. data: {
  60. "projectId": this.projectId,
  61. }
  62. })
  63. if (ret.data.success) {
  64. this.shareRemark = ret.data.single.shareRemark||''
  65. }
  66. },
  67. back(){
  68. uni.reLaunch({
  69. url:"../homePage/homePage"
  70. })
  71. },
  72. copy(){
  73. uni.setClipboardData({
  74. data:this.shareRemark,
  75. success() {
  76. uni.showToast({
  77. icon:"none",
  78. title:"复制成功"
  79. })
  80. }
  81. })
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang="scss">
  87. .share_body{
  88. display: flex;
  89. flex-direction: column;
  90. justify-content: center;
  91. align-items: center;
  92. width: 100%;
  93. background: #4e4e4e;
  94. height: 100vh;
  95. }
  96. .share_card_info{
  97. width: 550rpx;
  98. display: flex;
  99. flex-direction: column;
  100. align-items: center;
  101. background-color: #FFFFFF;
  102. border-radius: 10rpx;
  103. .share_title{
  104. width: 100%;
  105. display: flex;
  106. justify-content: center;
  107. align-items: center;
  108. margin-top: 30rpx;
  109. position: relative;
  110. .title{
  111. width: 292rpx;
  112. height: 34rpx;
  113. }
  114. .close{
  115. width: 24rpx;
  116. height: 24rpx;
  117. position: absolute;
  118. right: 20rpx;
  119. top: 5rpx;
  120. }
  121. }
  122. .share_desc{
  123. width: calc(100% - 60rpx);
  124. font-size: 24rpx;
  125. font-family: Verdana, Verdana-Regular;
  126. font-weight: 400;
  127. text-align: left;
  128. color: #7f7f7f;
  129. margin-top: 22rpx;
  130. box-sizing: border-box;
  131. text-overflow: -o-ellipsis-lastline;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. display: -webkit-box;
  135. -webkit-line-clamp: 2;
  136. line-clamp: 2;
  137. -webkit-box-orient: vertical;
  138. }
  139. .share_copy{
  140. display: flex;
  141. justify-content: center;
  142. align-items: center;
  143. margin-top: 12rpx;
  144. .icon_share_copy{
  145. width: 24rpx;
  146. height: 24rpx;
  147. }
  148. .share_txt{
  149. font-size: 24rpx;
  150. font-family: Verdana, Verdana-Regular;
  151. font-weight: 400;
  152. text-align: left;
  153. color: #2c2c2c;
  154. margin-left: 6rpx;
  155. }
  156. }
  157. .shareCard{
  158. width: 490rpx;
  159. height: 872rpx;
  160. margin-top: 10rpx;
  161. margin-bottom: 30rpx;
  162. }
  163. }
  164. .share_copy_txt{
  165. font-size: 28rpx;
  166. font-family: Verdana, Verdana-Regular;
  167. font-weight: 400;
  168. text-align: center;
  169. color: #ffffff;
  170. margin-top: 40rpx;
  171. }
  172. </style>