shareAlert.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. orderId:{
  27. type:Number
  28. }
  29. },
  30. data() {
  31. return{
  32. shareCode:'',
  33. }
  34. },
  35. created() {
  36. this.getShareCode(this.orderId)
  37. },
  38. methods:{
  39. getShareCode(res){
  40. this.OrderService.QueryOrderShareCode({orderId:res}).then(response =>{
  41. this.shareCode = response.data
  42. this.$parent.shareCode = this.shareCode;
  43. }).catch(error =>{
  44. this.$parent.isShareModal = false;
  45. this.$util.modal('提示',error.msg,'确定','',false,() =>{})
  46. })
  47. },
  48. hideConfirm(){
  49. this.$parent.isShareModal = false
  50. },
  51. btnConfirm(code){//点击事件
  52. this.$emit('btnConfirm')
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="scss">
  58. /*弹窗*/
  59. .model-warp.none{
  60. display: none;
  61. }
  62. .model-warp.show{
  63. display: block;
  64. }
  65. .model-warp{
  66. width: 100%;
  67. height: 100%;
  68. background: rgba(0,0,0,0.3);
  69. position: fixed;
  70. top: 0;
  71. left: 0;
  72. z-index: 10000;
  73. transition: all 0.4s;
  74. &.none{
  75. display: none;
  76. }
  77. &.show{
  78. display: block;
  79. }
  80. .content{
  81. width: 518rpx;
  82. height: 418rpx;
  83. position: absolute;
  84. background: $bg-color;
  85. left: 0;
  86. right: 0;
  87. bottom: 0;
  88. top: 0;
  89. margin: auto;
  90. border-radius: 24rpx;
  91. .text-content{
  92. width: 448rpx;
  93. height: 264rpx;
  94. padding: 20rpx 35rpx;
  95. float: left;
  96. .title{
  97. line-height: 40rpx;
  98. font-size: $font-size-28;
  99. color: $text-color;
  100. text-align: center;
  101. font-weight: bold;
  102. margin-bottom: 36rpx;
  103. }
  104. .share{
  105. line-height: 36rpx;
  106. font-size: $font-size-26;
  107. color: $text-color;
  108. text-align: justify;
  109. margin-top: 22rpx;
  110. font-weight: normal;
  111. .txt{
  112. margin-left: 10rpx;
  113. color: #FF2A2A;
  114. }
  115. }
  116. .text{
  117. line-height: 36rpx;
  118. font-size: $font-size-26;
  119. color: $text-color;
  120. text-align: justify;
  121. margin-top: 22rpx;
  122. }
  123. }
  124. .alert-btn{
  125. width: 80%;
  126. height: 70rpx;
  127. display: flex;
  128. margin: 0 auto;
  129. .btn{
  130. flex: 1;
  131. line-height: 70rpx;
  132. font-size: $font-size-28;
  133. text-align: center;
  134. color: #FFFFFF;
  135. border-radius: 35rpx;
  136. padding: 0;
  137. margin: 0 15rpx;
  138. &.btn-cancel{
  139. background: $btn-cancel;
  140. }
  141. &.btn-confirm{
  142. background: $btn-confirm;
  143. }
  144. }
  145. }
  146. }
  147. }
  148. </style>