shareAlert.vue 3.1 KB

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