This commit is contained in:
Shaun Chyxion 2017-06-30 23:33:29 +08:00
parent 1bf2906d73
commit cb0eebe20d
7 changed files with 74 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import Ember from 'ember';
export function numberUs(params) {
let num = params[0];
let p = num.toFixed(2).split('.');
return p[0].split('').reverse().reduce(function(acc, num, i, orig) {
return num == "-" ? acc : num + (i && !(i % 3) ? ',' : '') + acc;
}, ''); // + '.' + p[1];
}
export default Ember.Helper.helper(numberUs);

View File

@ -0,0 +1,11 @@
import Ember from 'ember';
import BaseEditRoute from '../base-edit';
export default Ember.Route.extend({
service: Ember.inject.service('user.service'),
breadcrumbs: [{text: '修改密码'}],
model() {
return {};
}
});

View File

@ -0,0 +1,12 @@
import Ember from 'ember';
import BaseService from '../service';
export default BaseService.extend({
modelName: 'CustomerYearToDateSale',
pageSize: 64,
importConstraints: {
ytdSales: {
presence: true
}
}
});

View File

@ -0,0 +1,8 @@
{{#form-content}}
<hr />
{{form-input type='password' name='originPassword' label='原始密码'}}
{{form-input type='password' name='password' label='登录密码'}}
{{form-input type='password' name='confirmPassword' label='重复密码'}}
<hr />
{{form-footer-buttons type='updatePassword' postUrl='user/update-password' successMsg='修改成功'}}
{{/form-content}}

View File

@ -0,0 +1,10 @@
import { numberUs } from 'ambition-crm/helpers/number-us';
import { module, test } from 'qunit';
module('Unit | Helper | number us');
// Replace this with your real tests.
test('it works', function(assert) {
let result = numberUs([42]);
assert.ok(result);
});

View File

@ -0,0 +1,11 @@
import { moduleFor, test } from 'ember-qunit';
moduleFor('route:user/update-password', 'Unit | Route | user/update password', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
test('it exists', function(assert) {
let route = this.subject();
assert.ok(route);
});

View File

@ -0,0 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
moduleFor('service:customer-ytd-sale/service', 'Unit | Service | customer ytd sale/service', {
// Specify the other units that are required for this test.
// needs: ['service:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
let service = this.subject();
assert.ok(service);
});