sellerShareAlert.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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" v-if="shareType == 1">
  9. <text>有效期为72小时。订单分享后客户可无需登录直接线上支付订单,也支持客户使用账号密码登录或直接输入分享码的方式查看订单。</text>
  10. </view>
  11. <view class="text" v-if="shareType == 2">
  12. <text>有效期为72小时。订单分享后若对方无法直接登录小程序查看订单,请提供该分享码给对方,通过输入分享码查看。</text>
  13. </view>
  14. </view>
  15. <view class="alert-btn">
  16. <view class="btn btn-cancel" @click="hideConfirm">取消</view>
  17. <!-- #ifdef MP-WEIXIN -->
  18. <button class="btn btn-confirm" open-type="share" @click="btnConfirm(shareCode)">去分享</button>
  19. <!-- #endif -->
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. export default{
  27. name:'sharealert',
  28. props:{
  29. orderId:{
  30. type:Number
  31. },
  32. shareType:{
  33. type:Number
  34. }
  35. },
  36. data() {
  37. return{
  38. shareCode:'',
  39. }
  40. },
  41. created() {
  42. this.getShareCode(this.orderId)
  43. },
  44. methods:{
  45. getShareCode(res){
  46. this.OrderService.QueryOrderShareCode({orderId:res}).then(response =>{
  47. this.shareCode = response.data
  48. this.$parent.shareCode = this.shareCode
  49. }).catch(error =>{
  50. this.$parent.isShareModal = false
  51. this.$util.modal('提示',error.msg,'确定','',false,() =>{})
  52. })
  53. },
  54. hideConfirm(){
  55. this.$parent.isShareModal = false
  56. },
  57. btnConfirm(code){//点击事件
  58. this.$emit('btnConfirm')
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss">
  64. /*弹窗*/
  65. .model-warp.none{
  66. display: none;
  67. }
  68. .model-warp.show{
  69. display: block;
  70. }
  71. .model-warp{
  72. width: 100%;
  73. height: 100%;
  74. background: rgba(0,0,0,0.3);
  75. position: fixed;
  76. top: 0;
  77. left: 0;
  78. z-index: 10000;
  79. transition: all 0.4s;
  80. &.none{
  81. display: none;
  82. }
  83. &.show{
  84. display: block;
  85. }
  86. .content{
  87. width: 518rpx;
  88. height: 428rpx;
  89. position: absolute;
  90. background: $bg-color;
  91. left: 0;
  92. right: 0;
  93. bottom: 0;
  94. top: 0;
  95. margin: auto;
  96. border-radius: 14rpx;
  97. .text-content{
  98. width: 448rpx;
  99. height: 284rpx;
  100. padding: 20rpx 35rpx;
  101. float: left;
  102. .title{
  103. line-height: 40rpx;
  104. font-size: $font-size-28;
  105. color: $text-color;
  106. text-align: center;
  107. font-weight: bold;
  108. margin-bottom: 36rpx;
  109. }
  110. .share{
  111. line-height: 36rpx;
  112. font-size: $font-size-26;
  113. color: $text-color;
  114. text-align: justify;
  115. margin-top: 22rpx;
  116. font-weight: normal;
  117. .txt{
  118. margin-left: 10rpx;
  119. color: #FF2A2A;
  120. }
  121. }
  122. .text{
  123. line-height: 36rpx;
  124. font-size: $font-size-26;
  125. color: $text-color;
  126. text-align: justify;
  127. margin-top: 22rpx;
  128. }
  129. }
  130. .alert-btn{
  131. width: 80%;
  132. height: 70rpx;
  133. display: flex;
  134. margin: 0 auto;
  135. .btn{
  136. flex: 1;
  137. line-height: 70rpx;
  138. font-size: $font-size-28;
  139. text-align: center;
  140. color: #FFFFFF;
  141. border-radius: 35rpx;
  142. padding: 0;
  143. margin: 0 15rpx;
  144. &.btn-cancel{
  145. background: $btn-cancel;
  146. }
  147. &.btn-confirm{
  148. background: $btn-confirm;
  149. }
  150. }
  151. }
  152. }
  153. }
  154. </style>