Mpservice.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <Popup :show="isPopup" :width="width" :padding="0" @hidePopup="hidePopupFunc">
  3. <view class="d-s-s d-c p20 mpservice-wrap" >
  4. <view class="d-b-c p-30-0 f34 ww100 border-b" @click="copyQQ(dataModel.qq)">
  5. <text class="gray9" style="width: 140rpx;">QQ:</text>
  6. <text class="p-0-30 flex-1">{{dataModel.qq}}</text>
  7. <text class="blue">复制</text>
  8. </view>
  9. <view class="d-b-c p-30-0 f34 ww100" @click="copyQQ(dataModel.qq)">
  10. <text class="gray9" style="width: 140rpx;">微信号:</text>
  11. <text class="p-0-30 flex-1">{{dataModel.wechat}}</text>
  12. <text class="blue">复制</text>
  13. </view>
  14. <view class="mp-image">
  15. <image :src="dataModel.mp_image" mode="widthFix"></image>
  16. </view>
  17. <view class="ww100 pt10 tc f30 gray9">
  18. 公众号
  19. </view>
  20. </view>
  21. <view class="d-c-c ww100">
  22. <view class="p20" @click="hidePopupFunc(true)"><text class="icon iconfont icon-guanbi"></text></view>
  23. </view>
  24. </Popup>
  25. </template>
  26. <script>
  27. import Popup from '@/components/uni-popup.vue';
  28. export default {
  29. components: {
  30. Popup
  31. },
  32. data(){
  33. return {
  34. /*是否打开*/
  35. isPopup:false,
  36. /*宽度*/
  37. width: 600,
  38. /*数据对象*/
  39. dataModel:{}
  40. }
  41. },
  42. created() {
  43. this.isPopup=true;
  44. this.getData();
  45. },
  46. methods:{
  47. /*获取数据*/
  48. getData() {
  49. let self = this;
  50. self._get(
  51. 'index/mpService',
  52. {},
  53. function(res) {
  54. self.dataModel=res.data.mp_service;
  55. }
  56. );
  57. },
  58. /*关闭弹窗*/
  59. hidePopupFunc(e) {
  60. this.isPopup = false;
  61. this.$emit('close');
  62. },
  63. /*复制*/
  64. copyQQ(message) {
  65. var input = document.createElement("input");
  66. input.value = message;
  67. document.body.appendChild(input);
  68. input.select();
  69. input.setSelectionRange(0, input.value.length), document.execCommand('Copy');
  70. document.body.removeChild(input);
  71. uni.showToast({
  72. title: '复制成功',
  73. icon: 'success',
  74. mask:true,
  75. duration:2000
  76. });
  77. }
  78. }
  79. }
  80. </script>
  81. <style>
  82. .mpservice-wrap .mp-image{ width: 560rpx; margin-top: 40rpx;}
  83. .mpservice-wrap .mp-image image{ width: 100%;}
  84. </style>