supplierShareAlert.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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">分享码</view>
  8. <view class="text-c">{{shareCode}} <text class="clipboard" @click.stop="clipboard(shareCode)">复制</text></view>
  9. <view class="text-h1">有效期为72小时。如果对方不是您公司的运营人员,需要输入该分享码才能查看本订单</view>
  10. </view>
  11. <view class="text-btn">
  12. <!-- #ifdef MP-WEIXIN -->
  13. <button class="btn" open-type="share" @click="btnConfirm(shareCode)">去分享</button>
  14. <!-- #endif -->
  15. <view class="btn-none" @click.stop="hideConfirm(shareCode)">取消</view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. const thorui = require("@/components/clipboard/clipboard.thorui.js")
  23. import { queryOrderShareCode } from "@/api/order.js"
  24. export default{
  25. name:'alert',
  26. props:{
  27. shopOrderID:{
  28. type:Number
  29. }
  30. },
  31. data() {
  32. return{
  33. shareCode:'',
  34. }
  35. },
  36. created() {
  37. this.getShareCode(this.shopOrderID)
  38. },
  39. onLoad(){
  40. },
  41. methods:{
  42. getShareCode(data){
  43. this.ShopService.ShopOrderShareCode({shopOrderId:data}).then(response =>{
  44. this.shareCode = response.data
  45. this.$parent.shareCode = this.shareCode;
  46. }).catch(error =>{
  47. this.$parent.isShareModal = false;
  48. this.$util.modal('提示',error.msg,'确定','',false,() =>{})
  49. })
  50. },
  51. clipboard(data) {
  52. thorui.getClipboardData(data, (res) => {
  53. // #ifdef H5
  54. if (res) {
  55. this.$util.msg("复制成功",2000);
  56. } else {
  57. this.$util.msg("复制失败",2000);
  58. }
  59. // #endif
  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: 492rpx;
  98. height: 666rpx;
  99. position: absolute;
  100. background: url(https://img.caimei365.com/group1/M00/03/95/Cmis2F76nVaAPs9JAAHGoKa8KvY492.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. border-radius: 12rpx;
  109. .text-content{
  110. width: 100%;
  111. height: auto;
  112. margin-top: 210rpx;
  113. .text-t{
  114. font-size: $font-size-28;
  115. color: $text-color;
  116. text-align: center;
  117. line-height: 44rpx;
  118. }
  119. .text-c{
  120. font-size: $font-size-44;
  121. color: #16E17C;
  122. text-align: center;
  123. line-height: 80rpx;
  124. position: relative;
  125. .clipboard{
  126. width: 84rpx;
  127. height: 36rpx;
  128. background: #EFEFEF;
  129. text-align: center;
  130. font-size: $font-size-24;
  131. color: #999999;
  132. border-radius: 4rpx;
  133. line-height: 36rpx;
  134. display: inline-block;
  135. position: absolute;
  136. top: 29%;
  137. right: 18%;
  138. }
  139. }
  140. .text-h1{
  141. line-height: 40rpx;
  142. font-size: $font-size-28;
  143. color: $text-color;
  144. text-align: justify;
  145. }
  146. }
  147. .text-btn{
  148. width: 100%;
  149. height: auto;
  150. margin-top: 40rpx;
  151. .btn{
  152. width: 100%;
  153. height: 88rpx;
  154. float: left;
  155. background: $btn-confirm;
  156. line-height: 88rpx;
  157. font-size: $font-size-28;
  158. text-align: center;
  159. color: #FFFFFF;
  160. border-radius: 14rpx;
  161. padding: 0;
  162. }
  163. .btn-none{
  164. width: 100%;
  165. height: 88rpx;
  166. float: left;
  167. line-height: 88rpx;
  168. font-size: $font-size-28;
  169. text-align: center;
  170. color: #666666;
  171. padding: 0;
  172. }
  173. }
  174. }
  175. }
  176. </style>