publishResult.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view class="default_page adffc" :style="{'height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='发布结果'></cus-header>
  4. <view class="xcx">
  5. <view class="box">
  6. <view class="box-title">{{title}}</view>
  7. <view class="box-fill">
  8. <view class="box-fill-bottom adfacjb">
  9. <view class="box-fill-bottom-left adfac">
  10. <image :src="imgBase+'publish_result_avatar.png'"></image>
  11. <text>邀请填写</text>
  12. </view>
  13. <view class="box-fill-bottom-right">进入</view>
  14. </view>
  15. </view>
  16. <view class="box-bottom adfac">
  17. <image :src="imgBase+'publish_result_xcx.png'"></image>
  18. <text>小程序</text>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="share">
  23. <view class="share-title">分享到</view>
  24. <view class="share-menu adf">
  25. <view class="share-menu-pre adffcac">
  26. <button class="share-btn" open-type="share">
  27. <image :src="imgBase+'publish_result_wx.png'"></image>
  28. <text>微信好友</text>
  29. </button>
  30. </view>
  31. <view class="share-menu-pre adffcac" @click="copyLink">
  32. <image :src="imgBase+'publish_result_copy.png'"></image>
  33. <text>复制链接</text>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. export default {
  41. data(){
  42. return {
  43. title:'',
  44. teamQuestionnaireId:''
  45. }
  46. },
  47. onShareTimeline() {
  48. const sharerId = JSON.parse(uni.getStorageSync('userInfo')).id||'';
  49. return {
  50. title: this.title,
  51. query: `shareUserId=${sharerId}&shareTQId=${this.teamQuestionnaireId}&from=timeline&shareType=Questionnaire`,
  52. imageUrl: this.$imgBase+'share_fm.png'
  53. };
  54. },
  55. onShareAppMessage(res) {
  56. const sharerId = JSON.parse(uni.getStorageSync('userInfo'))?.id||'';
  57. return {
  58. title: this.title,
  59. path: `/pages/home?shareTQId=${this.teamQuestionnaireId}&shareUserId=${sharerId}&shareType=Questionnaire`,
  60. imageUrl: this.$imgBase+'share_fm.png'
  61. };
  62. },
  63. onLoad(options){
  64. this.title = options.title;
  65. this.teamQuestionnaireId = options.teamQuestionnaireId;
  66. },
  67. methods:{
  68. async copyLink(){
  69. let shareUserId = JSON.parse(uni.getStorageSync('userInfo')).id;
  70. let res = await this.$api.post('/wx/genInviteLink',{
  71. 'path': '',
  72. 'query': `shareTQId=${this.teamQuestionnaireId}&shareUserId=${shareUserId}&shareType=Questionnaire`,
  73. 'env_version': 'trial'//默认"release",正式版"release",体验版"trial",开发版"develop"
  74. });
  75. if(res.data.code!==0) return this.$showToast(res.data.msg)
  76. uni.setClipboardData({
  77. data:res.data.data.openlink,
  78. success: () => {
  79. this.$showToast('复制成功')
  80. },
  81. fail: () => {
  82. this.$showToast('复制失败')
  83. }
  84. })
  85. }
  86. }
  87. }
  88. </script>
  89. <style scoped lang="scss">
  90. .share-btn {
  91. background-color: transparent;
  92. border: none;
  93. padding: 0;
  94. margin: 0;
  95. line-height: 1;
  96. display: flex;
  97. flex-direction: column;
  98. justify-content: center;
  99. align-items: center;
  100. &::after {
  101. border: none;
  102. }
  103. }
  104. .default_page{
  105. box-sizing: border-box;
  106. .xcx{
  107. padding: 70rpx 155rpx;
  108. .box{
  109. background: #FFFFFF;
  110. border-radius: 8rpx;
  111. padding: 40rpx 24rpx 18rpx;
  112. &-title{
  113. font-family: PingFangSC, PingFang SC;
  114. font-weight: 400;
  115. font-size: 24rpx;
  116. color: #002846;
  117. line-height: 32rpx;
  118. }
  119. &-fill{
  120. margin-top: 34rpx;
  121. width: 100%;
  122. height: 322rpx;
  123. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/publish_result_bg1.png') no-repeat;
  124. background-size: 100% 100%;
  125. display: flex;
  126. flex-direction: column;
  127. justify-content: flex-end;
  128. padding: 0 5rpx 5rpx;
  129. &-bottom{
  130. width: 100%;
  131. height: 84rpx;
  132. background: url('https://gitee.com/hw_0302/chuang-heng-wechat-images/raw/master/publish_result_bg2.png') no-repeat;
  133. background-size: 100% 100%;
  134. padding: 13rpx 16rpx;
  135. box-sizing: border-box;
  136. &-left{
  137. image{
  138. width: 56rpx;
  139. height: 56rpx;
  140. }
  141. text{
  142. font-family: PingFangSC, PingFang SC;
  143. font-weight: 400;
  144. font-size: 24rpx;
  145. color: #002846;
  146. line-height: 33rpx;
  147. margin-left: 12rpx;
  148. }
  149. }
  150. &-right{
  151. width: 86rpx;
  152. height: 42rpx;
  153. background: #33A7A7;
  154. border-radius: 10rpx;
  155. font-family: PingFangSC, PingFang SC;
  156. font-weight: 400;
  157. font-size: 24rpx;
  158. color: #FFFFFF;
  159. line-height: 42rpx;
  160. text-align: center;
  161. letter-spacing: 2rpx;
  162. }
  163. }
  164. }
  165. &-bottom{
  166. margin-top: 16rpx;
  167. border-top: 1rpx solid #EFEFEF;
  168. padding-top: 10rpx;
  169. image{
  170. width: 24rpx;
  171. height: 24rpx;
  172. }
  173. text{
  174. font-family: PingFangSC, PingFang SC;
  175. font-weight: 400;
  176. font-size: 20rpx;
  177. color: #95A5B1;
  178. line-height: 20rpx;
  179. margin-left: 8rpx;
  180. }
  181. }
  182. }
  183. }
  184. .share{
  185. flex: 1;
  186. background: #FFFFFF;
  187. border-radius: 24rpx 24rpx 0rpx 0rpx;
  188. padding: 40rpx 30rpx;
  189. &-title{
  190. font-family: PingFang-SC, PingFang-SC;
  191. font-weight: bold;
  192. font-size: 30rpx;
  193. color: #002846;
  194. line-height: 42rpx;
  195. padding-left: 10rpx;
  196. }
  197. &-menu{
  198. flex-wrap: wrap;
  199. &-pre{
  200. width: calc(100% / 2);
  201. margin-top: 42rpx;
  202. image{
  203. width: 102rpx;
  204. height: 102rpx;
  205. }
  206. text{
  207. font-family: PingFangSC, PingFang SC;
  208. font-weight: 400;
  209. font-size: 26rpx;
  210. color: #002846;
  211. line-height: 37rpx;
  212. text-align: center;
  213. margin-top: 24rpx;
  214. }
  215. }
  216. }
  217. }
  218. }
  219. </style>