You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.3 KiB

3 months ago
  1. <template>
  2. <view class='sharing-packets' :style="{ top: top + 'px'}"
  3. :class="sharePacket.touchstart?'hide_left':'' "
  4. @touchmove.stop.prevent="setTouchMove" @click="handleleterClick()" v-if="!sharePacket.isState">
  5. <view class='sharing-con' :style="{backgroundImage:'url('+imgHost+ '/' + picBg+')'}">
  6. <view class='text' >
  7. <view class="main_color">会员分享返</view>
  8. <view class='money price'><text class='label'></text>{{sharePacket.priceName}}</view>
  9. <view class='tip'>下单即返佣金</view>
  10. <view class='shareBut'>立即分享</view>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <!-- -->
  16. <script>
  17. import { getImageDomain } from '@/api/api.js'
  18. export default {
  19. props: {
  20. sharePacket: {
  21. type: Object,
  22. default: function(){
  23. return {isState: true,priceName:'',touchstart:false}
  24. }
  25. }
  26. },
  27. data() {
  28. return {
  29. imgHost:'',
  30. picBg:'crmebimage/perset/share_tip/share_tip1.png',
  31. top: "260",
  32. };
  33. },
  34. created(){
  35. let that = this;
  36. uni.getStorage({
  37. key: 'theme',
  38. success: function (res) {
  39. switch (res.data) {
  40. case 'theme1':
  41. that.picBg = 'crmebimage/perset/share_tip/share_tip1.png';
  42. break;
  43. case 'theme2':
  44. that.picBg = 'crmebimage/perset/share_tip/share_tip2.png';
  45. break;
  46. case 'theme3':
  47. that.picBg = 'crmebimage/perset/share_tip/share_tip3.png';
  48. break;
  49. case 'theme4':
  50. that.picBg = 'crmebimage/perset/share_tip/share_tip4.png';
  51. break;
  52. case 'theme5':
  53. that.picBg = 'crmebimage/perset/share_tip/share_tip5.png';
  54. break;
  55. }
  56. }
  57. });
  58. getImageDomain().then(res=>{
  59. that.$set(that,'imgHost',res.data);
  60. })
  61. },
  62. methods: {
  63. goShare:function(){
  64. this.$emit('listenerActionSheet');
  65. },
  66. setTouchMove(e) {
  67. var that = this;
  68. if (e.touches[0].clientY < 545 && e.touches[0].clientY > 66) {
  69. that.top = e.touches[0].clientY
  70. }
  71. },
  72. handleleterClick(){
  73. if(this.sharePacket.touchstart){
  74. this.$emit('showShare',false)
  75. }else{
  76. // this.$emit('showShare',true)
  77. this.goShare()
  78. }
  79. }
  80. },
  81. }
  82. </script>
  83. <style scoped lang="scss">
  84. .sharing-packets{
  85. position:fixed;left:30rpx;z-index:99;transition: all .2s linear;
  86. &.hide_left{
  87. transition: all .2s linear;left: -110rpx;
  88. transform: scale(.6);
  89. }
  90. }
  91. .sharing-packets .iconfont{width:44rpx;height:44rpx;border-radius:50%;text-align:center;line-height:44rpx;background-color:#999;font-size:20rpx;color:#fff;margin:0 auto;box-sizing:border-box;padding-left:1px;}
  92. .sharing-packets .line{width:2rpx;height:40rpx;background-color:#999;margin:0 auto;}
  93. .sharing-packets .sharing-con{width:187rpx;height:210rpx;position:relative;background-size: cover;}
  94. .sharing-packets .sharing-con .text{position:absolute;top:30rpx;font-size:20rpx;width:100%;text-align:center;}
  95. .sharing-packets .sharing-con .text .money{font-size:32rpx;font-weight:bold;margin-top:5rpx;}
  96. .sharing-packets .sharing-con .text .money .label{font-size:20rpx;}
  97. .sharing-packets .sharing-con .text .tip{font-size:18rpx;color:#999;margin-top:5rpx;}
  98. .sharing-packets .sharing-con .text .shareBut{font-size:22rpx;color:#fff;margin-top:28rpx;height:50rpx;line-height:50rpx;}
  99. .main_color{@include main_color(theme);}
  100. .price{@include price_color(theme);}
  101. </style>