123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- <template name="sharealert">
- <view class="alert spec" :class="specClass">
- <view class="model-warp">
- <view class="content">
- <view class="title-image">
- <image :src="staticUrl + 'icon_share_modal@2x.png'" mode=""></image>
- </view>
- <view class="text-content">
- <view class="share">您的分享码:<text class="txt">{{shareCode}}</text></view>
- <view class="text">
- <text>有效期为24小时。需要输入该分享码才能查看本订单</text>
- </view>
- </view>
- <view class="alert-btn">
- <view class="btn btn-cancel" @click="hideConfirm">取消</view>
- <!-- #ifdef MP-WEIXIN -->
- <button class="btn btn-confirm" open-type="share" @click="btnConfirm(shareCode)">去分享</button>
- <!-- #endif -->
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default{
- name:'sharealert',
- props:{
- orderId:{
- type:Number
- }
- },
- data() {
- return{
- shareCode:'',
- staticUrl: this.global.staticUrl,
- }
- },
- created() {
- this.getShareCode(this.orderId)
- },
- methods:{
- getShareCode(res){
- this.OrderService.QueryOrderShareCode({orderId:res}).then(response =>{
- this.shareCode = response.data
- this.$parent.shareCode = this.shareCode;
- }).catch(error =>{
- this.$parent.isShareModal = false;
- this.$util.modal('提示',error.msg,'确定','',false,() =>{})
- })
- },
- hideConfirm(){
- this.$parent.isShareModal = false
- },
- btnConfirm(code){//点击事件
- this.$emit('btnConfirm')
- }
- }
- }
- </script>
- <style lang="scss">
- /*弹窗*/
- .model-warp.none{
- display: none;
- }
- .model-warp.show{
- display: block;
- }
- .model-warp{
- width: 100%;
- height: 100%;
- background: rgba(0,0,0,0.3);
- position: fixed;
- top: 0;
- left: 0;
- z-index: 10000;
- transition: all 0.4s;
- &.none{
- display: none;
- }
- &.show{
- display: block;
- }
- .content{
- width: 580rpx;
- height: 540rpx;
- position: absolute;
- background: $bg-color;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- margin: auto;
- border-radius: 24rpx;
- .title-image{
- width: 580rpx;
- height: 210rpx;
- image{
- width: 580rpx;
- height: 210rpx;
- display: block;
- }
- }
- .text-content{
- width: 580rpx;
- height: auto;
- padding: 20rpx 35rpx;
- box-sizing: border-box;
- .share{
- line-height: 36rpx;
- font-size: $font-size-26;
- color: $text-color;
- text-align: justify;
- margin-top: 22rpx;
- font-weight: normal;
- .txt{
- margin-left: 10rpx;
- color: #FF2A2A;
- }
- }
- .text{
- line-height: 36rpx;
- font-size: $font-size-26;
- color: $text-color;
- text-align: justify;
- margin-top: 22rpx;
- }
- }
- .alert-btn{
- width: 80%;
- height: 70rpx;
- display: flex;
- margin: 15rpx auto;
- .btn{
- flex: 1;
- line-height: 70rpx;
- font-size: $font-size-28;
- text-align: center;
- color: #FFFFFF;
- border-radius: 35rpx;
- padding: 0;
- margin: 0 15rpx;
- &.btn-cancel{
- background: $btn-cancel;
- }
- &.btn-confirm{
- background: $btn-confirm;
- }
- }
- }
- }
- }
- </style>
|