supplierShareAlert.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. if (res) {
  54. this.$util.msg("复制成功",2000,true,'success');
  55. } else {
  56. this.$util.msg("复制失败",2000,true,'none');
  57. }
  58. })
  59. },
  60. hideConfirm(){
  61. this.$parent.isShareModal = false
  62. },
  63. btnConfirm(code){//点击事件
  64. this.$emit('btnConfirm')
  65. }
  66. },
  67. onShow(){
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. /*弹窗*/
  73. .model-warp.none{
  74. display: none;
  75. }
  76. .model-warp.show{
  77. display: block;
  78. }
  79. .freight-alert{
  80. width: 100%;
  81. height: 100%;
  82. background: rgba(0,0,0,.5);
  83. position: fixed;
  84. top: 0;
  85. left: 0;
  86. z-index: 8888;
  87. transition: all 0.4s;
  88. &.none{
  89. display: none;
  90. }
  91. &.show{
  92. display: block;
  93. }
  94. .content{
  95. width: 492rpx;
  96. height: 666rpx;
  97. position: absolute;
  98. background: url(https://img.caimei365.com/group1/M00/03/95/Cmis2F76nVaAPs9JAAHGoKa8KvY492.png) no-repeat;
  99. background-size: cover;
  100. left: 0;
  101. right: 0;
  102. bottom: 0;
  103. top: 0;
  104. margin: auto;
  105. padding:0 24rpx 20rpx 24rpx;
  106. border-radius: 12rpx;
  107. .text-content{
  108. width: 100%;
  109. height: auto;
  110. margin-top: 210rpx;
  111. .text-t{
  112. font-size: $font-size-28;
  113. color: $text-color;
  114. text-align: center;
  115. line-height: 44rpx;
  116. }
  117. .text-c{
  118. font-size: $font-size-44;
  119. color: #16E17C;
  120. text-align: center;
  121. line-height: 80rpx;
  122. position: relative;
  123. .clipboard{
  124. width: 84rpx;
  125. height: 36rpx;
  126. background: #EFEFEF;
  127. text-align: center;
  128. font-size: $font-size-24;
  129. color: #999999;
  130. border-radius: 4rpx;
  131. line-height: 36rpx;
  132. display: inline-block;
  133. position: absolute;
  134. top: 29%;
  135. right: 18%;
  136. }
  137. }
  138. .text-h1{
  139. line-height: 40rpx;
  140. font-size: $font-size-28;
  141. color: $text-color;
  142. text-align: justify;
  143. }
  144. }
  145. .text-btn{
  146. width: 100%;
  147. height: auto;
  148. margin-top: 40rpx;
  149. .btn{
  150. width: 80%;
  151. height: 70rpx;
  152. margin: 0 auto;
  153. background: $btn-confirm;
  154. line-height: 70rpx;
  155. font-size: $font-size-28;
  156. text-align: center;
  157. color: #FFFFFF;
  158. border-radius: 35rpx;
  159. padding: 0;
  160. }
  161. .btn-none{
  162. width: 100%;
  163. height: 70rpx;
  164. float: left;
  165. line-height: 70rpx;
  166. font-size: $font-size-28;
  167. text-align: center;
  168. color: #666666;
  169. padding: 0;
  170. }
  171. }
  172. }
  173. }
  174. </style>