Commit ec82838386ce06fbf1d882fad8ea89415b2a315b
1 parent
8a18bc7f
卡数量 时间区间
Showing
3 changed files
with
22 additions
and
22 deletions
src/views/cards/buyCard.vue
... | ... | @@ -216,24 +216,24 @@ export default { |
216 | 216 | if (this.startData) { |
217 | 217 | switch (this.typeNum) { |
218 | 218 | case 1: |
219 | - this.endDate = this.$moment(this.startData).add(12, "month").format("YYYY-MM-DD"); | |
220 | - return this.$moment(this.startData).add(12, "month").format("YYYY-MM-DD"); | |
219 | + this.endDate = this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD"); | |
220 | + return this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD"); | |
221 | 221 | break; |
222 | 222 | case 2: |
223 | - this.endDate = this.$moment(this.startData).add(6, "month").format("YYYY-MM-DD"); | |
224 | - return this.$moment(this.startData).add(6, "month").format("YYYY-MM-DD"); | |
223 | + this.endDate = this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD"); | |
224 | + return this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD"); | |
225 | 225 | break; |
226 | 226 | case 3: |
227 | - this.endDate = this.$moment(this.startData).add(3, "month").format("YYYY-MM-DD"); | |
228 | - return this.$moment(this.startData).add(3, "month").format("YYYY-MM-DD"); | |
227 | + this.endDate = this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD"); | |
228 | + return this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD"); | |
229 | 229 | break; |
230 | 230 | case 4: |
231 | - this.endDate = this.$moment(this.startData).add(1, "month").format("YYYY-MM-DD"); | |
232 | - return this.$moment(this.startData).add(1, "month").format("YYYY-MM-DD"); | |
231 | + this.endDate = this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD"); | |
232 | + return this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD"); | |
233 | 233 | break; |
234 | 234 | case 5: |
235 | - this.endDate = this.$moment(this.startData).add(1, "days").format("YYYY-MM-DD"); | |
236 | - return this.$moment(this.startData).add(1, "days").format("YYYY-MM-DD"); | |
235 | + this.endDate = this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD"); | |
236 | + return this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD"); | |
237 | 237 | break; |
238 | 238 | } |
239 | 239 | // return this.$moment(this.startData).add(1,"month").format("YYYY-MM-DD"); |
... | ... | @@ -372,6 +372,7 @@ export default { |
372 | 372 | }, |
373 | 373 | addCardNum() { // 增加购买数量 |
374 | 374 | this.cardNum++; |
375 | + | |
375 | 376 | this.calcMoney(); |
376 | 377 | }, |
377 | 378 | reduceCarNum() { // 增加购买数量 | ... | ... |
src/views/cards/renew.vue
... | ... | @@ -164,27 +164,26 @@ export default { |
164 | 164 | endTimeFunc() { |
165 | 165 | |
166 | 166 | if (this.startData) { |
167 | - | |
168 | 167 | switch (this.typeNum) { |
169 | 168 | case '1': |
170 | - this.endDate = this.$moment(this.startData).add(12, "month").format("YYYY-MM-DD"); | |
171 | - return this.$moment(this.startData).add(12, "month").format("YYYY-MM-DD"); | |
169 | + this.endDate = this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD"); | |
170 | + return this.$moment(this.startData).add(12*this.cardNum, "month").format("YYYY-MM-DD"); | |
172 | 171 | break; |
173 | 172 | case '2': |
174 | - this.endDate = this.$moment(this.startData).add(6, "month").format("YYYY-MM-DD"); | |
175 | - return this.$moment(this.startData).add(6, "month").format("YYYY-MM-DD"); | |
173 | + this.endDate = this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD"); | |
174 | + return this.$moment(this.startData).add(6*this.cardNum, "month").format("YYYY-MM-DD"); | |
176 | 175 | break; |
177 | 176 | case '3': |
178 | - this.endDate = this.$moment(this.startData).add(3, "month").format("YYYY-MM-DD"); | |
179 | - return this.$moment(this.startData).add(3, "month").format("YYYY-MM-DD"); | |
177 | + this.endDate = this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD"); | |
178 | + return this.$moment(this.startData).add(3*this.cardNum, "month").format("YYYY-MM-DD"); | |
180 | 179 | break; |
181 | 180 | case '4': |
182 | - this.endDate = this.$moment(this.startData).add(1, "month").format("YYYY-MM-DD"); | |
183 | - return this.$moment(this.startData).add(1, "month").format("YYYY-MM-DD"); | |
181 | + this.endDate = this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD"); | |
182 | + return this.$moment(this.startData).add(1*this.cardNum, "month").format("YYYY-MM-DD"); | |
184 | 183 | break; |
185 | 184 | case '5': |
186 | - this.endDate = this.$moment(this.startData).add(1, "days").format("YYYY-MM-DD"); | |
187 | - return this.$moment(this.startData).add(1, "days").format("YYYY-MM-DD"); | |
185 | + this.endDate = this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD"); | |
186 | + return this.$moment(this.startData).add(1*this.cardNum, "days").format("YYYY-MM-DD"); | |
188 | 187 | break; |
189 | 188 | } |
190 | 189 | // return this.$moment(this.startData).add(1,"month").format("YYYY-MM-DD"); | ... | ... |