publishResult.vue 5.8 KB

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