123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <template>
- <div class="step-2">
- <div class="ptc-block">
- <div class="ptc-inner">
- <p class="ptc-label">Version & Price</p>
- <div class="detail">
- <strong class="s1">{{ getters.selectedProduct.name }}</strong>
- <span style="font-size: 0"
- ><strong class="s2">${{ getters.cost }}</strong
- ><span class="s3">{{
- state.form.subscribe_type === 'year' ? 'Annual' : 'Monthly'
- }}</span></span
- >
- <strong class="s4" @click="$emit('go', -1)">Modify ></strong>
- </div>
- </div>
- </div>
- <div class="ptc-block">
- <div class="ptc-inner">
- <p class="ptc-label">Choose a mobile phone brand</p>
- <PtcRadioGroup
- v-model="state.form.brand_id"
- class="device-list"
- @change="onSelectBrand"
- >
- <PtcRadio
- v-for="brand of state.brandList"
- :key="brand.id"
- class="device-item"
- :value="brand.id"
- :disabled="!!state.form.renewal"
- >
- <i
- :class="[
- 'device-img',
- [, 'd-iphone', 'd-ipag', 'd-samsung'][brand.id] || 'd-other',
- ]"
- />
- <p class="device-name">{{ brand.name }}</p>
- </PtcRadio>
- </PtcRadioGroup>
- </div>
- </div>
- <div v-if="state.modelList.length" class="ptc-wrapper">
- <div class="ptc-block">
- <div class="ptc-inner">
- <p class="ptc-label">Choose phone model</p>
- <PtcRadioGroup v-model="state.form.phone_id" class="device-list">
- <PtcRadio
- v-for="model of state.modelList"
- :key="model.id"
- class="device-item"
- :value="model.id"
- :disabled="!!state.form.renewal"
- >
- <img class="device-img" :src="model.image" />
- <p class="device-name">{{ model.name }}</p>
- </PtcRadio>
- </PtcRadioGroup>
- </div>
- </div>
- <div class="ptc-button-group">
- <div class="ptc-inner">
- <button class="ptc-button" @click="$emit('go')">NEXT</button>
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup lang="ts">
- import { PtcRadioGroup, PtcRadio } from '@/components/radio'
- import { state, getters, getModelList } from './store'
- const emit = defineEmits<{
- (e: 'go', delta?: number): void
- }>()
- // const showNextBtn = state.form.brand_id && state.form.phone_id
- function onSelectBrand() {
- state.form.phone_id = ''
- getModelList()
- }
- function onSelectModel() {
- setTimeout(() => emit('go'), 200)
- }
- </script>
- <style lang="scss">
- .device {
- &-list {
- display: flex;
- flex-wrap: wrap;
- width: 680px;
- margin: auto;
- }
- &-item {
- padding-top: 24px;
- width: 322px;
- height: 322px;
- text-align: center;
- font-size: 40px;
- font-weight: bold;
- &:nth-child(2n + 1) {
- margin-right: 34px;
- }
- &:nth-child(n + 3) {
- margin-top: 36px;
- }
- }
- &-img {
- display: inline-block;
- vertical-align: top;
- margin-bottom: 18px;
- width: 200px;
- height: 200px;
- background-color: #eee;
- background-size: contain;
- }
- }
- </style>
|