| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <template>
- <u-popup
- v-model="showPopup"
- @close="closePopup"
- @open="openPopup"
- mode="center"
- border-radius="20"
- width="85%"
- class="first-order-free-popup"
- >
- <view class="popup-content">
- <image class="gift-image" :src="dialogInfo.img" mode="widthFix" @click="handleClick" />
- </view>
- </u-popup>
- </template>
- <script>
- export default {
- name: "OrderSuccessPopup",
- data() {
- return {
- showPopup: false,
- dialogInfo: {
- autoClose: "",
- autoCloseTime: "",
- img: "",
- jumpPage: "",
- },
- };
- },
- methods: {
- openPopup(data) {
- if (data.id) {
- this.dialogInfo = data;
- this.showPopup = true;
- this.autoClose();
- }
- },
- closePopup() {
- this.showPopup = false;
- this.$emit("close");
- if (this.dialogInfo.frequency == 1) {
- uni.setStorageSync("frequency", 1);
- } else {
- uni.removeStorageSync("frequency");
- }
- },
- //点击图片跳转
- handleClick() {
- if (this.dialogInfo.jumpPage) {
- uni.navigateTo({
- url: this.dialogInfo.jumpPage,
- });
- this.closePopup();
- }
- },
- //自动关闭弹窗
- autoClose() {
- if (this.dialogInfo?.autoClose == 1) {
- let time = this.dialogInfo.autoCloseTime ? this.dialogInfo.autoCloseTime * 1000 : 5000;
- setTimeout(() => {
- this.closePopup();
- }, time);
- }
- },
- },
- };
- </script>
- <style lang="scss">
- .popup-content {
- position: relative;
- display: flex;
- flex-direction: column;
- align-items: center;
- .gift-image {
- width: 100%;
- height: auto;
- }
- .action-buttons {
- position: absolute;
- bottom: 100rpx;
- width: 100%;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .check-rules {
- font-size: 40rpx;
- color: #ffffff;
- text-align: center;
- padding: 10rpx;
- padding-left: 80rpx;
- }
- }
- </style>
|