shareAlert.vue 3.1 KB

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