|
|
@@ -120,15 +120,7 @@
|
|
|
v-if="availableCoupon"
|
|
|
@click="showCouponDialog = true"
|
|
|
/>
|
|
|
- <div class="coupon-dialog-wrapper" v-if="showCouponDialog">
|
|
|
- <div class="coupon-dialog-mask" @click="showCouponDialog = false"></div>
|
|
|
- <button class="coupon-dialog" open-type="share">
|
|
|
- <img
|
|
|
- :style="{ backgroundImage: `url(${availableCoupon ? availableCoupon.pic : ''})` }"
|
|
|
- class="coupon-dialog"
|
|
|
- />
|
|
|
- </button>
|
|
|
- </div>
|
|
|
+ <coupon :coupon="availableCoupon" :visible.sync="showCouponDialog"></coupon>
|
|
|
<land-mark-dialog
|
|
|
:visible.sync="showLandMarkDialog"
|
|
|
@confirm="checkOrder"
|
|
|
@@ -152,15 +144,16 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapGetters } from 'vuex';
|
|
|
+import { mapGetters, mapState } from 'vuex';
|
|
|
import LandMarkDialog from '../components/LandMarkDialog';
|
|
|
import MsgBox from '../components/MsgBox';
|
|
|
import PurchaseDialog from '../components/PurchaseDialog';
|
|
|
import LoginDialog from '../components/LoginDialog';
|
|
|
import QQMapWX from '../qqmap-wx-jssdk';
|
|
|
+import Coupon from '../components/Coupon';
|
|
|
export default {
|
|
|
onShareAppMessage(res) {
|
|
|
- this.shareNum++;
|
|
|
+ this.$store.commit('addShareNum');
|
|
|
return {
|
|
|
title: '来一米世界,购优惠门票!',
|
|
|
path: 'pages/home',
|
|
|
@@ -180,7 +173,8 @@ export default {
|
|
|
LandMarkDialog,
|
|
|
MsgBox,
|
|
|
PurchaseDialog,
|
|
|
- LoginDialog
|
|
|
+ LoginDialog,
|
|
|
+ Coupon
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -202,14 +196,12 @@ export default {
|
|
|
empty: false,
|
|
|
showSharePopup: false,
|
|
|
showLocationDialog: false,
|
|
|
- availableCoupon: null,
|
|
|
- showCouponDialog: false,
|
|
|
- shareNum: 1,
|
|
|
- currentShareNum: 0
|
|
|
+ showCouponDialog: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
...mapGetters(['screenWidth', 'statusBarHeight']),
|
|
|
+ ...mapState(['availableCoupon']),
|
|
|
bannerWidth() {
|
|
|
return (this.screenWidth - 48) / 2;
|
|
|
},
|
|
|
@@ -340,7 +332,7 @@ export default {
|
|
|
scenicId: scenicId
|
|
|
})
|
|
|
.then(res => {
|
|
|
- this.availableCoupon = res;
|
|
|
+ this.$store.commit('setAvailableCoupon', res);
|
|
|
});
|
|
|
},
|
|
|
checkOrder() {
|
|
|
@@ -668,27 +660,4 @@ export default {
|
|
|
top: 300px;
|
|
|
right: 0;
|
|
|
}
|
|
|
-.coupon-dialog-wrapper {
|
|
|
- .coupon-dialog-mask {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- background: rgba(0, 0, 0, 0.3);
|
|
|
- }
|
|
|
- .coupon-dialog {
|
|
|
- position: absolute;
|
|
|
- left: 0;
|
|
|
- top: 0;
|
|
|
- right: 0;
|
|
|
- bottom: 0;
|
|
|
- width: 285px;
|
|
|
- height: 228px;
|
|
|
- margin: auto;
|
|
|
- background-size: cover;
|
|
|
- background-position: center;
|
|
|
- background-repeat: no-repeat;
|
|
|
- }
|
|
|
-}
|
|
|
</style>
|