publishResult.vue 5.8 KB

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