step-one.vue
5.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<template>
<view class="pageBox">
<view class="width-calc">
<view class="content-title">
经营模式<span class="validate">*</span>
</view>
<view class="select-list">
<view v-for="(item, index) in operateArr" :key="index"
:class="{ 'select-but': true, 'ml-12': index === 1, 'pitchOn': pageData.businessModel === item.value }"
@click="selectOperate(item.value)">
{{ item.label }}
<view v-if="pageData.businessModel === item.value" class="pitchOn-img"></view>
</view>
</view>
<view class="tip-head">
<view class="tips-img-box">
<image src="https://img02.glsx.com.cn/aus/images/preference/tips.png" class="tips-img"></image>
</view>
<view class="tip-box">
<text class="tip">批发商模式优先推荐“高周转车型”,</text>
<text class="tip">零售模式优先推荐“高利润车型”。</text>
</view>
</view>
<view class="content-title mt-16" style="height: 28px; line-height: 28px;">
注册地区<span class="validate">*</span>
</view>
<view class="reason-select" @click="openChangeCity()">
<text v-if="pageData.cityName">{{ pageData.cityName }}</text>
<text v-else class="placeholder">请选择注册城市</text>
<uni-icons type="right" size="14" color="#999999" />
</view>
</view>
</view>
</template>
<script lang="ts">
import { Component, Vue, Watch } from 'vue-facing-decorator';
@Component({})
export default class stepOne extends Vue {
//页面数据
pageData = {
businessModel: '1',
cityCode: '',
cityName: '',
cityCn: ''
}
//经营模式
operateArr = [
{ label: '批发', value: '1' },
{ label: '零售', value: '2' }
]
//初始化数据
initData(data: any) {
this.pageData.businessModel = data.businessModel || '';
this.pageData.cityCode = data.cityCode || '';
this.pageData.cityName = data.cityName || '';
this.pageData.cityCn = data.cityCn || '';
}
//选择经营模式
selectOperate(value: string) {
this.pageData.businessModel = value;
}
openChangeCity(): void {
const that = this;
uni.navigateTo({
url: '/pages/LocationCityPage', events: {
onReturnData: function (city: any) {
if (city) {
that.pageData.cityCode = city.code || '';
that.pageData.cityName = city.name || '';
that.pageData.cityCn = city.value || '';
}
}
},
});
}
// 深度监听整个pageData对象
@Watch('pageData', { deep: true, immediate: true })
watchPageData(newVal: any, oldVal: any) {
this.$emit('oneData', newVal);
}
}
</script>
<style scoped lang="scss">
.pageBox {
width: 100%;
background: #fff;
float: left;
}
.width-calc {
width: -webkit-calc(100% - 40px);
width: -moz-calc(100% - 40px);
width: calc(100% - 40px);
float: left;
margin: 0 20px;
padding-bottom: 20px;
}
.content-title {
width: 100%;
height: 50px;
line-height: 50px;
float: left;
color: #141e34;
font-size: 16px;
font-weight: 中黑体;
font-family: "苹方-简";
}
.validate {
color: #ee3040;
font-size: 16px;
padding-left: 2px;
}
.select-but {
width: -webkit-calc(50% - 6px);
width: -moz-calc(50% - 6px);
width: calc(50% - 6px);
height: 40px;
line-height: 40px;
border-radius: 4px;
background: #f5f9ff;
color: #333333;
font-size: 14px;
font-family: "苹方-简";
text-align: center;
float: left;
cursor: pointer;
position: relative;
}
.pitchOn {
background: #f5f9ff !important;
color: #185efe !important;
}
.pitchOn-img {
position: absolute;
top: 0;
right: 0;
width: 16px;
height: 16px;
z-index: 99;
background-image: url("https://img02.glsx.com.cn/aus/images/preference/pitchOn.png");
background-repeat: no-repeat;
background-size: 100%;
}
.ml-12 {
margin-left: 12px;
}
.mt-16 {
margin-top: 16px;
}
.tip-head {
width: 100%;
float: left;
margin-top: 16px;
}
.tips-img-box {
width: 14px;
height: 36px;
float: left;
}
.tip-box {
width: -webkit-calc(100% - 18px);
width: -moz-calc(100% - 18px);
width: calc(100% - 18px);
height: 36px;
float: left;
margin-left: 4px;
}
.tips-img {
width: 14px;
height: 14px;
z-index: -1;
}
.tip {
width: 100%;
height: 18px;
float: left;
line-height: 18px;
color: #666666;
font-size: 12px;
}
.reason-select {
width: 100%;
height: 52px;
line-height: 52px;
float: left;
display: flex;
align-items: center;
justify-content: space-between;
font-size: 14px;
border-bottom: 1px solid #e6ebf5;
cursor: pointer;
color: #333333;
}
.placeholder {
color: #999999;
font-size: 14px;
}
</style>