shareAlert.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <template name="alert">
  2. <view class="alert spec" :class="specClass">
  3. <!-- 运费弹窗说明 -->
  4. <view class="freight-alert" @click.stop="hideConfirm">
  5. <view class="content clearfix">
  6. <view class="text-content">
  7. <view class="text-t">
  8. <text class="text-a">您的分享码:</text>
  9. <text class="text-c">{{shareCode}}</text>
  10. <text class="clipboard" @click.stop="clipboard(shareCode)">复制</text>
  11. </view>
  12. <view class="text-h1">有效期为72小时,分享后对方需要输入分享码才能查看订单。</view>
  13. </view>
  14. <view class="text-btn">
  15. <!-- #ifdef MP-WEIXIN -->
  16. <button class="btn" open-type="share" @click="btnConfirm(shareCode)">去分享</button>
  17. <!-- #endif -->
  18. <view class="btn-none" @click.stop="hideConfirm(shareCode)">取消</view>
  19. </view>
  20. </view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  26. export default{
  27. name:'alert',
  28. props:{
  29. orderID:{
  30. type:Number
  31. }
  32. },
  33. data() {
  34. return{
  35. shareCode:'',
  36. }
  37. },
  38. created() {
  39. this.getShareCode(this.orderID)
  40. },
  41. onLoad(){
  42. },
  43. methods:{
  44. getShareCode(data){
  45. this.OrderService.QueryOrderShareCode({orderId:data}).then(response =>{
  46. this.shareCode = response.data
  47. this.$parent.shareCode = this.shareCode;
  48. }).catch(error =>{
  49. this.$parent.isShareModal = false;
  50. this.$util.modal('提示',error.msg,'确定','',false,() =>{})
  51. })
  52. },
  53. clipboard(data) {
  54. thorui.getClipboardData(data, (res) => {
  55. if (res) {
  56. this.$util.msg("复制成功",2000,true,'success');
  57. } else {
  58. this.$util.msg("复制失败",2000,true,'none');
  59. }
  60. })
  61. },
  62. hideConfirm(){
  63. this.$parent.isShareModal = false
  64. },
  65. btnConfirm(code){//点击事件
  66. this.$emit('btnConfirm')
  67. }
  68. },
  69. onShow(){
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. /*弹窗*/
  75. .model-warp.none{
  76. display: none;
  77. }
  78. .model-warp.show{
  79. display: block;
  80. }
  81. .freight-alert{
  82. width: 100%;
  83. height: 100%;
  84. background: rgba(0,0,0,.5);
  85. position: fixed;
  86. top: 0;
  87. left: 0;
  88. z-index: 8888;
  89. transition: all 0.4s;
  90. &.none{
  91. display: none;
  92. }
  93. &.show{
  94. display: block;
  95. }
  96. .content{
  97. width: 580rpx;
  98. height: 630rpx;
  99. position: absolute;
  100. background: url(https://static.caimei365.com/app/wisa/img/icon/dd_pop.png) no-repeat;
  101. background-size: cover;
  102. left: 0;
  103. right: 0;
  104. bottom: 0;
  105. top: 0;
  106. margin: auto;
  107. padding:0 24rpx 20rpx 24rpx;
  108. box-sizing: border-box;
  109. border-radius: 12rpx;
  110. .text-content{
  111. width: 100%;
  112. height: auto;
  113. margin-top: 210rpx;
  114. .text-t{
  115. font-size: $font-size-28;
  116. color: $text-color;
  117. text-align: left;
  118. line-height: 80rpx;
  119. display: inline-block;
  120. .text-a{
  121. display: inline-block;
  122. float: left;
  123. }
  124. .text-c{
  125. font-size: $font-size-44;
  126. color: #c4761f;
  127. text-align: center;
  128. line-height: 80rpx;
  129. display: inline-block;
  130. float: left;
  131. }
  132. .clipboard{
  133. width: 84rpx;
  134. height: 36rpx;
  135. background: #EFEFEF;
  136. text-align: center;
  137. font-size: $font-size-24;
  138. color: #999999;
  139. border-radius: 4rpx;
  140. line-height: 36rpx;
  141. display: inline-block;
  142. float: left;
  143. margin: 20rpx 0 0 20rpx;
  144. }
  145. }
  146. .text-h1{
  147. line-height: 40rpx;
  148. font-size: $font-size-28;
  149. color: $text-color;
  150. text-align: justify;
  151. }
  152. }
  153. .text-btn{
  154. width: 100%;
  155. height: auto;
  156. margin-top: 40rpx;
  157. .btn{
  158. width: 80%;
  159. height: 70rpx;
  160. margin: 0 auto;
  161. background: $btn-confirm;
  162. line-height: 70rpx;
  163. font-size: $font-size-28;
  164. text-align: center;
  165. color: #FFFFFF;
  166. border-radius: 35rpx;
  167. padding: 0;
  168. }
  169. .btn-none{
  170. width: 100%;
  171. height: 70rpx;
  172. float: left;
  173. line-height: 70rpx;
  174. font-size: $font-size-28;
  175. text-align: center;
  176. color: #666666;
  177. padding: 0;
  178. }
  179. }
  180. }
  181. }
  182. </style>