cm-share-popup.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. <template name="sharealert">
  2. <view class="alert spec" :class="specClass">
  3. <view class="model-warp">
  4. <view class="content">
  5. <view class="text-content">
  6. <view class="title">分享订单</view>
  7. <view class="share">您的分享码:<text class="txt">{{shareCode}}</text></view>
  8. <view class="text">
  9. <text>有效期为24小时。如果对方不是您机构的运营人员,需要输入该分享码才能查看本订单</text>
  10. </view>
  11. </view>
  12. <view class="alert-btn">
  13. <view class="btn btn-cancel" @click="hideConfirm">取消</view>
  14. <!-- #ifdef MP-WEIXIN -->
  15. <button class="btn btn-confirm" open-type="share" @click="btnConfirm(shareCode)">去分享</button>
  16. <!-- #endif -->
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default{
  24. name:'sharealert',
  25. props:{
  26. shopOrderId:{
  27. type:Number
  28. }
  29. },
  30. data() {
  31. return{
  32. shareCode:'',
  33. }
  34. },
  35. created() {
  36. this.getShareCode(this.shopOrderId)
  37. },
  38. methods:{
  39. //获取订单分享码
  40. async getShareCode(shopOrderId){
  41. try{
  42. const res = await this.OrderService.QueryOrderShareCode({shopOrderId:shopOrderId})
  43. this.shareCode = res.data
  44. this.$parent.shareCode = this.shareCode;
  45. }catch(error){
  46. this.$parent.isShareModal = false;
  47. this.$util.msg(error.msg, 2000)
  48. }
  49. },
  50. hideConfirm(){
  51. this.$parent.isShareModal = false
  52. },
  53. btnConfirm(code){//点击事件
  54. this.$emit('btnConfirm')
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss">
  60. /*弹窗*/
  61. .model-warp.none{
  62. display: none;
  63. }
  64. .model-warp.show{
  65. display: block;
  66. }
  67. .model-warp{
  68. width: 100%;
  69. height: 100%;
  70. background: rgba(0,0,0,0.3);
  71. position: fixed;
  72. top: 0;
  73. left: 0;
  74. z-index: 10000;
  75. transition: all 0.4s;
  76. &.none{
  77. display: none;
  78. }
  79. &.show{
  80. display: block;
  81. }
  82. .content{
  83. width: 518rpx;
  84. height: 418rpx;
  85. position: absolute;
  86. background: $bg-color;
  87. left: 0;
  88. right: 0;
  89. bottom: 0;
  90. top: 0;
  91. margin: auto;
  92. border-radius: 24rpx;
  93. .text-content{
  94. width: 448rpx;
  95. height: 264rpx;
  96. padding: 20rpx 35rpx;
  97. float: left;
  98. .title{
  99. line-height: 40rpx;
  100. font-size: $font-size-28;
  101. color: $text-color;
  102. text-align: center;
  103. font-weight: bold;
  104. margin-bottom: 36rpx;
  105. }
  106. .share{
  107. line-height: 36rpx;
  108. font-size: $font-size-26;
  109. color: $text-color;
  110. text-align: justify;
  111. margin-top: 22rpx;
  112. font-weight: normal;
  113. .txt{
  114. margin-left: 10rpx;
  115. color: #FF2A2A;
  116. }
  117. }
  118. .text{
  119. line-height: 36rpx;
  120. font-size: $font-size-26;
  121. color: $text-color;
  122. text-align: justify;
  123. margin-top: 22rpx;
  124. }
  125. }
  126. .alert-btn{
  127. width: 80%;
  128. height: 70rpx;
  129. display: flex;
  130. margin: 0 auto;
  131. .btn{
  132. flex: 1;
  133. line-height: 70rpx;
  134. font-size: $font-size-28;
  135. text-align: center;
  136. color: #FFFFFF;
  137. border-radius: 35rpx;
  138. padding: 0;
  139. margin: 0 15rpx;
  140. &.btn-cancel{
  141. background: $btn-cancel;
  142. }
  143. &.btn-confirm{
  144. background: $btn-confirm;
  145. }
  146. }
  147. }
  148. }
  149. }
  150. </style>