Commit 9fdc4cd3 by 姜雷

Merge branch 'test'

parents 2766a416 82d47d8c
const path = require('path');
const config = { const config = {
projectName: 'wx-school-app', projectName: 'wx-school-app',
date: '2019-2-20', date: '2019-2-20',
...@@ -5,32 +7,35 @@ const config = { ...@@ -5,32 +7,35 @@ const config = {
deviceRatio: { deviceRatio: {
'640': 2.34 / 2, '640': 2.34 / 2,
'750': 1, '750': 1,
'828': 1.81 / 2 '828': 1.81 / 2,
}, },
sourceRoot: 'src', sourceRoot: 'src',
outputRoot: 'dist', outputRoot: 'dist',
alias: {
'@': path.resolve(__dirname, '..', 'src'),
},
plugins: { plugins: {
babel: { babel: {
sourceMap: true, sourceMap: true,
presets: [ presets: [
['env', { [
modules: false 'env',
}] {
modules: false,
},
],
], ],
plugins: [ plugins: [
'transform-decorators-legacy', 'transform-decorators-legacy',
'transform-class-properties', 'transform-class-properties',
'transform-object-rest-spread' 'transform-object-rest-spread',
] ],
} },
},
defineConstants: {
}, },
defineConstants: {},
copy: { copy: {
patterns: [ patterns: [],
], options: {},
options: {
}
}, },
weapp: { weapp: {
module: { module: {
...@@ -38,34 +43,28 @@ const config = { ...@@ -38,34 +43,28 @@ const config = {
autoprefixer: { autoprefixer: {
enable: true, enable: true,
config: { config: {
browsers: [ browsers: ['last 3 versions', 'Android >= 4.1', 'ios >= 8'],
'last 3 versions', },
'Android >= 4.1',
'ios >= 8'
]
}
}, },
pxtransform: { pxtransform: {
enable: true, enable: true,
config: { config: {},
}
}, },
url: { url: {
enable: true, enable: true,
config: { config: {
limit: 10240 // 设定转换尺寸上限 limit: 10240, // 设定转换尺寸上限
} },
}, },
cssModules: { cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: { config: {
namingPattern: 'module', // 转换模式,取值为 global/module namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]' generateScopedName: '[name]__[local]___[hash:base64:5]',
} },
} },
} },
} },
}, },
h5: { h5: {
publicPath: '/', publicPath: '/',
...@@ -75,28 +74,24 @@ const config = { ...@@ -75,28 +74,24 @@ const config = {
autoprefixer: { autoprefixer: {
enable: true, enable: true,
config: { config: {
browsers: [ browsers: ['last 3 versions', 'Android >= 4.1', 'ios >= 8'],
'last 3 versions', },
'Android >= 4.1',
'ios >= 8'
]
}
}, },
cssModules: { cssModules: {
enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true enable: false, // 默认为 false,如需使用 css modules 功能,则设为 true
config: { config: {
namingPattern: 'module', // 转换模式,取值为 global/module namingPattern: 'module', // 转换模式,取值为 global/module
generateScopedName: '[name]__[local]___[hash:base64:5]' generateScopedName: '[name]__[local]___[hash:base64:5]',
} },
} },
} },
} },
} },
} };
module.exports = function (merge) { module.exports = function(merge) {
if (process.env.NODE_ENV === 'development') { if (process.env.NODE_ENV === 'development') {
return merge({}, config, require('./dev')) return merge({}, config, require('./dev'));
} }
return merge({}, config, require('./prod')) return merge({}, config, require('./prod'));
} };
...@@ -4,13 +4,13 @@ ...@@ -4,13 +4,13 @@
"private": true, "private": true,
"description": "", "description": "",
"scripts": { "scripts": {
"build:weapp": "npx @tarojs/cli build --type weapp", "build:weapp": "cross-env NODE_ENV=product npx @tarojs/cli build --type weapp",
"build:swan": "npx @tarojs/cli build --type swan", "build:swan": "npx @tarojs/cli build --type swan",
"build:alipay": "npx @tarojs/cli build --type alipay", "build:alipay": "npx @tarojs/cli build --type alipay",
"build:tt": "npx @tarojs/cli build --type tt", "build:tt": "npx @tarojs/cli build --type tt",
"build:h5": "npx @tarojs/cli build --type h5", "build:h5": "npx @tarojs/cli build --type h5",
"build:rn": "npx @tarojs/cli build --type rn", "build:rn": "npx @tarojs/cli build --type rn",
"dev:weapp": "npm run build:weapp -- --watch", "dev:weapp": "npx @tarojs/cli build --type weapp -- --watch",
"dev:swan": "npm run build:swan -- --watch", "dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch", "dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch", "dev:tt": "npm run build:tt -- --watch",
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
"babel-plugin-transform-jsx-stylesheet": "^0.6.5", "babel-plugin-transform-jsx-stylesheet": "^0.6.5",
"babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1", "babel-preset-env": "^1.6.1",
"cross-env": "^5.2.0",
"eslint": "^4.19.1", "eslint": "^4.19.1",
"eslint-config-taro": "1.2.13", "eslint-config-taro": "1.2.13",
"eslint-plugin-import": "^2.12.0", "eslint-plugin-import": "^2.12.0",
......
import { baseFetch } from './index'; import { baseFetch, ResponseDataEntity } from './index';
export const fetchAllArea = () => export type Area = {
id: number;
areaName: string;
initial?: string;
};
export const fetchAllArea = (): Promise<ResponseDataEntity<Area[]>> =>
baseFetch({ baseFetch({
url: '/area/queryAreaList', url: '/area/queryAreaList',
}); });
import { CustomerBeanAccountVo, AccountParams } from './baseClass'; import { CustomerBeanAccountVo } from './baseClass';
import { customerFetch, ResponseDataEntity } from '.'; import { customerFetch, ResponseDataEntity } from '.';
type Params = {
areaId: number;
/** 会员电话 */
customerPhone: string;
/** 会员id */
id: number;
/** 服务id */
serviceIdList: string[];
};
export const fetchBeanCount = ( export const fetchBeanCount = (
data: AccountParams, data: Params,
): Promise<ResponseDataEntity<CustomerBeanAccountVo[]>> => ): Promise<ResponseDataEntity<CustomerBeanAccountVo[]>> =>
customerFetch({ customerFetch({
url: '/customerAccount/queryAccount', url: '/customerAccount/queryAccount',
......
import { customerFetch } from '.'; import { customerFetch, ResponseDataEntity } from '.';
export class LoginParams { export class LoginParams {
/** 登陆标识 */ /** 登陆标识 */
...@@ -35,7 +35,16 @@ export const changePwdByCellphone = (data: PwdParams) => ...@@ -35,7 +35,16 @@ export const changePwdByCellphone = (data: PwdParams) =>
data: data, data: data,
}); });
type RegisiterPramas = {}; type RegisiterPramas = {
code: string;
areaId: number;
areaName: string;
customerName: string;
customerPhone: string;
customerSex: string;
password: string;
verificationCode: string;
};
// type RegisiterReponseData = {}; // type RegisiterReponseData = {};
export const wxUserRegister = (entity: RegisiterPramas) => export const wxUserRegister = (entity: RegisiterPramas) =>
...@@ -78,3 +87,8 @@ export const fetchFeedback = (entity: CustomerParam) => ...@@ -78,3 +87,8 @@ export const fetchFeedback = (entity: CustomerParam) =>
method: 'POST', method: 'POST',
data: entity, data: entity,
}); });
export const refreshCodeBar = (): Promise<ResponseDataEntity<string>> =>
customerFetch({
url: '/dcxy/wechat/applet/flush/idbar',
});
import Taro, { request } from '@tarojs/taro'; import Taro, { request } from '@tarojs/taro';
import store from '../store/index'; import store from '../store/index';
import { import {
OLD_BASE_SERVER_URL,
BASE_SERVER_URL, BASE_SERVER_URL,
CUSTOMER_SERVER_URL, CUSTOMER_SERVER_URL,
SCHOOL_MAIN_URL, SCHOOL_MAIN_URL,
LogoutCode,
SuccessCode,
} from '../constants/index'; } from '../constants/index';
export type ResponseDataEntity<T> = { export type ResponseDataEntity<T> = {
...@@ -27,15 +28,24 @@ const createFetch = (basePath: string) => { ...@@ -27,15 +28,24 @@ const createFetch = (basePath: string) => {
header: token header: token
? { ? {
token: token, token: token,
reqSource: 'wxmini',
} }
: {}, : {
reqSource: 'wxmini',
},
url: basePath + entity.url, url: basePath + entity.url,
}).then(({ data }: ResponseEntity) => { }).then(({ data }: ResponseEntity) => {
if (data.code === 1000) { if (data.code === SuccessCode) {
return data; return data;
} }
if (data.code === LogoutCode) {
Taro.redirectTo({
url: '/pages/Login/Login',
});
throw data;
}
Taro.showToast({ Taro.showToast({
title: data.msg, title: data.msg || '网络错误',
icon: 'none', icon: 'none',
}); });
throw data; throw data;
...@@ -43,7 +53,6 @@ const createFetch = (basePath: string) => { ...@@ -43,7 +53,6 @@ const createFetch = (basePath: string) => {
}; };
}; };
export const oldBaseFetch = createFetch(OLD_BASE_SERVER_URL);
export const baseFetch = createFetch(BASE_SERVER_URL); export const baseFetch = createFetch(BASE_SERVER_URL);
export const customerFetch = createFetch(CUSTOMER_SERVER_URL); export const customerFetch = createFetch(CUSTOMER_SERVER_URL);
export const schoolMainFetch = createFetch(SCHOOL_MAIN_URL); export const schoolMainFetch = createFetch(SCHOOL_MAIN_URL);
......
import { baseFetch } from '.';
type ImageVcodePramas = {
effective?: number;
loginName: string;
codeNum?: number;
};
export const getImageVcode = (data: ImageVcodePramas) =>
baseFetch({
url: `/common/getCode?loginName=${data.loginName}&codeNum=4`,
method: 'POST',
data: data,
});
type VcodePramas = {
cellphone: string;
};
export const getVcode = (entity: VcodePramas) =>
baseFetch({
url: `/common/sendMsgCode?cellphone=${entity.cellphone}&codeNum=6`,
method: 'POST',
data: entity,
});
import { oldBaseFetch, baseFetch, ResponseDataEntity } from './index';
import { UserState } from '../store/rootReducers/userinfo';
type LoginPramas = {
code: string;
};
type LoginReponseData = {
register: boolean;
wxToken: string;
} & UserState;
export interface LoginReponse extends ResponseDataEntity<LoginReponseData> {
data: LoginReponseData;
}
export const login = (data: LoginPramas) =>
oldBaseFetch({
url: '/wx/api/user/login2',
data: data,
});
export const fetchValidateCode = () =>
oldBaseFetch({
url: '/wx/api/getValidateCode',
});
type ImageVcodePramas = {
effective?: number;
loginName: string;
codeNum?: number;
};
export const getImageVcode = (data: ImageVcodePramas) =>
baseFetch({
url: `/common/getCode?loginName=${data.loginName}&codeNum=4`,
method: 'POST',
data: data,
});
export const getVcode = entity =>
oldBaseFetch({
url: '/wx/api/getValidateCode',
method: 'POST',
data: entity,
});
type RegisiterPramas = {};
// type RegisiterReponseData = {};
export const fetchWxUserRegister = (entity: RegisiterPramas) =>
baseFetch({
url: '/dcxy/wechat/applet/register/',
method: 'POST',
data: entity,
});
...@@ -38,6 +38,7 @@ class App extends Component { ...@@ -38,6 +38,7 @@ class App extends Component {
'pages/Order/OrderDetail/OrderDetail', 'pages/Order/OrderDetail/OrderDetail',
'pages/SelectCampus/SelectCampus', 'pages/SelectCampus/SelectCampus',
'pages/Content/Content', 'pages/Content/Content',
'pages/WebPage/WebPage',
], ],
window: { window: {
backgroundTextStyle: 'light', backgroundTextStyle: 'light',
......
...@@ -20,6 +20,9 @@ interface Modal { ...@@ -20,6 +20,9 @@ interface Modal {
class Modal extends Component { class Modal extends Component {
static externalClasses = ['body-class']; static externalClasses = ['body-class'];
static options = {
addGlobalClass: true,
};
static defaultProps = { static defaultProps = {
visiabled: false, visiabled: false,
title: '提示', title: '提示',
......
import { ComponentClass } from 'react'; import { ComponentClass } from 'react';
import Taro, { Component } from '@tarojs/taro'; import Taro, { Component } from '@tarojs/taro';
import { View, Input, Canvas } from '@tarojs/components'; import { View, Input, Canvas } from '@tarojs/components';
import { getVcode, getImageVcode } from '../../api/wx'; import { getVcode, getImageVcode } from '../../api/vcode';
import Modal from '../Modal/Modal'; import Modal from '../Modal/Modal';
import './Vcode.scss'; import './Vcode.scss';
import { ResponseDataEntity } from 'src/api'; import { ResponseDataEntity } from 'src/api';
...@@ -66,7 +66,7 @@ class Vcode extends Component { ...@@ -66,7 +66,7 @@ class Vcode extends Component {
this.setState({ this.setState({
showImgBox: true, showImgBox: true,
}); });
this.renderImg(1234); // this.renderImg(1234);
} else { } else {
Taro.showToast({ Taro.showToast({
title: '输入正确的手机号', title: '输入正确的手机号',
...@@ -76,7 +76,7 @@ class Vcode extends Component { ...@@ -76,7 +76,7 @@ class Vcode extends Component {
} }
} }
closeImageBox() { closeImageBox() {
const ctx = Taro.createCanvasContext('Vcode', this); const ctx = Taro.createCanvasContext('Vcode', this.$scope);
ctx.setFillStyle('#6180f4'); ctx.setFillStyle('#6180f4');
ctx.fillRect(0, 0, 73, 38); ctx.fillRect(0, 0, 73, 38);
ctx.draw(); ctx.draw();
...@@ -86,7 +86,7 @@ class Vcode extends Component { ...@@ -86,7 +86,7 @@ class Vcode extends Component {
} }
renderImg(vcode: number) { renderImg(vcode: number) {
const ctx = Taro.createCanvasContext('Vcode', this); const ctx = Taro.createCanvasContext('Vcode', this.$scope);
ctx.setFillStyle('#6180f4'); ctx.setFillStyle('#6180f4');
ctx.fillRect(0, 0, 73, 38); ctx.fillRect(0, 0, 73, 38);
ctx.font = '26px arial'; ctx.font = '26px arial';
...@@ -102,7 +102,7 @@ class Vcode extends Component { ...@@ -102,7 +102,7 @@ class Vcode extends Component {
const { cellphone } = this.props; const { cellphone } = this.props;
getVcode({ getVcode({
tel: cellphone, cellphone: cellphone,
}) })
.then(res => { .then(res => {
this.countStart(); this.countStart();
......
export const APP_ID = 'wxf5912b79bba23663'; export const APP_ID = 'wxf5912b79bba23663';
export const SuccessCode = 1000;
export const LogoutCode = -2;
export const NotRegisterCode = 1005;
export const OLD_BASE_SERVER_URL = 'https://ex-dev-selfbase.168cad.top'; export const BASE_SERVER_URL = 'https://ex-test-dcxy-base-app.168cad.top';
export const BASE_SERVER_URL = 'https://ex-dev-dcxy-base-app.168cad.top';
export const CUSTOMER_SERVER_URL = export const CUSTOMER_SERVER_URL =
'https://ex-dev-dcxy-customer-app.168cad.top'; 'https://ex-test-dcxy-customer-app.168cad.top';
export const SCHOOL_MAIN_URL = 'https://internal-dev-school-main.168cad.top'; export const SCHOOL_MAIN_URL =
export const ANN_LINK_URL = 'https://ex-dev-wx.168cad.top/announcement/'; 'https://internal-test-school-home-bg.168cad.top';
export const ANN_LINK_URL = 'https://ex-test-wx.168cad.top/announcement/';
...@@ -26,8 +26,13 @@ ...@@ -26,8 +26,13 @@
margin-right: 16px; margin-right: 16px;
} }
.Announcement-item-title { .Announcement-item-title {
height: 40px;
line-height: 40px;
flex: 1; flex: 1;
font-size: 32px; font-size: 32px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.Announcement-item-date { .Announcement-item-date {
margin-top: 10px; margin-top: 10px;
......
...@@ -5,13 +5,12 @@ import { View, ScrollView, Image, Text, WebView } from '@tarojs/components'; ...@@ -5,13 +5,12 @@ import { View, ScrollView, Image, Text, WebView } from '@tarojs/components';
import AnnIcon from '../../images/icon/ann_tongzhi_icon@2x.png'; import AnnIcon from '../../images/icon/ann_tongzhi_icon@2x.png';
import { fetchAllAnn, AnnItem } from '../../api/announcement'; import { fetchAllAnn, AnnItem } from '../../api/announcement';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { UserState } from '../../store/rootReducers/userinfo';
import './Announcement.scss'; import './Announcement.scss';
import { ANN_LINK_URL } from '../../constants'; import { Customer } from '@/types/Customer/Customer';
type PageStateProps = { type PageStateProps = {
userinfo: UserState; userinfo: Customer;
}; };
type PageOwnProps = {}; type PageOwnProps = {};
type PageState = { type PageState = {
...@@ -56,7 +55,7 @@ class Announcement extends Component { ...@@ -56,7 +55,7 @@ class Announcement extends Component {
console.log(err); console.log(err);
}); });
} }
geAnnDetail(id: number, title: string) { geAnnDetail(id: number) {
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/Content/Content?id=${id}`, url: `/pages/Content/Content?id=${id}`,
}); });
...@@ -70,7 +69,7 @@ class Announcement extends Component { ...@@ -70,7 +69,7 @@ class Announcement extends Component {
<View <View
key={annItem.id} key={annItem.id}
className='Announcement-item' className='Announcement-item'
onClick={() => this.geAnnDetail(annItem.id, annItem.title)}> onClick={() => this.geAnnDetail(annItem.id)}>
<Image <Image
className='Announcement-item-img' className='Announcement-item-img'
src={annItem.linkUrls[0]} src={annItem.linkUrls[0]}
......
page {
background-color: #eee;
}
.BarCode { .BarCode {
.OrderBox { .OrderBox {
box-sizing: border-box; box-sizing: border-box;
...@@ -13,9 +16,9 @@ ...@@ -13,9 +16,9 @@
} }
.BarCodeBox { .BarCodeBox {
position: relative; position: relative;
background-color: #fff;
width: 100%; width: 100%;
height: 260px; height: 260px;
overflow: hidden;
transition: all 0.28s; transition: all 0.28s;
display: flex; display: flex;
} }
...@@ -28,7 +31,6 @@ ...@@ -28,7 +31,6 @@
flex: 1; flex: 1;
margin: 26px 52px 46px; margin: 26px 52px 46px;
background-color: #fff; background-color: #fff;
overflow: hidden;
transition: all 0.28s; transition: all 0.28s;
} }
.BarCodeImgBig { .BarCodeImgBig {
...@@ -36,26 +38,39 @@ ...@@ -36,26 +38,39 @@
} }
.BarCodeBox-refresh { .BarCodeBox-refresh {
position: absolute; position: absolute;
right: 4px; right: 44px;
width: 32px; bottom: -58px;
height: 52px; width: 176px;
height: 96px;
} }
.BarCodeCav { .BarCodeCav {
display: none;
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
.BarCodeCav.show {
display: block;
}
.toggleBtn { .toggleBtn {
position: absolute; position: absolute;
right: 0; display: flex;
bottom: 4px; justify-content: center;
background-color: #6180f4; align-items: center;
left: 50%;
bottom: 0;
transform: translate(-50%, 40px);
background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
width: 82px; width: 136px;
height: 40px; height: 45px;
line-height: 40px; border-radius: 0 0 20px 20px;
padding-left: 20px; .arricon {
border-radius: 20px 0 0 20px; width: 24px;
font-size: 24px; height: 24px;
color: #fff; transition: all 400ms ease-in-out;
}
.rever {
transform: rotate(180deg);
}
} }
} }
import Taro, { Component } from '@tarojs/taro'; import Taro, { Component } from '@tarojs/taro';
import { ComponentClass } from 'react'; import { ComponentClass } from 'react';
import { View, Canvas, Image } from '@tarojs/components'; import { View, Canvas, Image } from '@tarojs/components';
import BarCodeBoxBg from '../../images/barcode/tiaoxingma-1.png';
import BarCodeBoxBigBg from '../../images/barcode/tiaoxingma-2.png'; import RefreshIcon from '../../images/barcode/pic_shuaxin@2x.png';
import RefreshIcon from '../../images/barcode/icon_shuaxin@2x.png'; import ArrIcon from '../../images/barcode/icon_fangda@2x.png';
import wxbarcode from 'wxbarcode'; import wxbarcode from 'wxbarcode';
import './BarCode.scss'; import './BarCode.scss';
import { UserState } from '../../store/rootReducers/userinfo'; import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { import { fetchPayOrder, fetchOrderDetailAndPay } from '../../api/order';
fetchPayOrder,
fetchOrderDetailAndPay,
fetchDeductionInfo,
} from '../../api/order';
import OrderInfo from '../Order/components/OrderInfo/OrderInfo'; import OrderInfo from '../Order/components/OrderInfo/OrderInfo';
import OrderTitle from '../Order/components/OrderTitle/OrderTitle'; import OrderTitle from '../Order/components/OrderTitle/OrderTitle';
import OrderPayway from '../Order/components/OrderPayway/OrderPayway'; import OrderPayway from '../Order/components/OrderPayway/OrderPayway';
import { import {
ConsumeOrder,
PaymentAndActiveInfo, PaymentAndActiveInfo,
CustomerBeanAccountVo, CustomerBeanAccountVo,
} from '../../api/baseClass'; } from '../../api/baseClass';
import { Customer } from '../../types/Customer/Customer';
import { refreshCodeBar } from '../../api/customer';
import Order from '@/types/Order/Order';
type PageStateProps = { type PageStateProps = {
userinfo: UserState; userinfo: Customer;
};
type PageDispatchProps = {
updateUserInfo: (e: UserState) => void;
}; };
type PageOwnProps = {}; type PageOwnProps = {};
type PageState = { type PageState = {
ScreenBrightness: number;
showPayOrder: boolean; showPayOrder: boolean;
showBig: boolean; showBig: boolean;
accounts: CustomerBeanAccountVo[]; accounts: CustomerBeanAccountVo[];
orderInfo: ConsumeOrder; orderInfo: Order;
payInfos: { payInfos: {
paymentAndActiveInfos: PaymentAndActiveInfo[]; paymentAndActiveInfos: PaymentAndActiveInfo[];
paymentConfId: number; paymentConfId: number;
...@@ -49,37 +53,45 @@ type PageState = { ...@@ -49,37 +53,45 @@ type PageState = {
}; };
}; };
type IProps = PageStateProps & PageOwnProps; type IProps = PageStateProps & PageOwnProps & PageDispatchProps;
interface BarCode { interface BarCode {
props: IProps; props: IProps;
state: PageState; state: PageState;
} }
@connect(({ userinfo }) => ({ @connect(
userinfo, ({ userinfo }) => ({
})) userinfo,
}),
dispatch => ({
updateUserInfo(entity: UserState) {
dispatch(updateUserInfo(entity));
},
}),
)
class BarCode extends Component { class BarCode extends Component {
constructor(props: PageOwnProps) { constructor(props: PageOwnProps) {
super(props); super(props);
this.state = { this.state = {
ScreenBrightness: 1,
showPayOrder: false, showPayOrder: false,
showBig: false, showBig: false,
accounts: [], accounts: [],
orderInfo: { orderInfo: {
actualMoney: undefined, actualMoney: 0,
areaId: undefined, areaId: 0,
areaName: '', areaName: '',
consumeType: '', consumeType: '',
createAt: '', createAt: '',
customerCellphone: '', customerCellphone: '',
customerId: undefined, customerId: 0,
customerName: '', customerName: '',
deductionBean: undefined, deductionBean: 0,
deductionMoney: undefined, deductionMoney: 0,
equipmentNum: '', equipmentNum: '',
equipmentPosition: '', equipmentPosition: '',
id: undefined, id: 0,
operateId: undefined, operateId: 0,
operateName: '', operateName: '',
operationMode: '', operationMode: '',
orderName: '', orderName: '',
...@@ -87,10 +99,10 @@ class BarCode extends Component { ...@@ -87,10 +99,10 @@ class BarCode extends Component {
orderState: '', orderState: '',
outTradeNo: '', outTradeNo: '',
payType: '', payType: '',
payableMoney: undefined, payableMoney: 0,
serviceId: undefined, serviceId: 0,
serviceName: '', serviceName: '',
thirdDiscountMoney: undefined, thirdDiscountMoney: 0,
thirdTradeNumber: '', thirdTradeNumber: '',
updateDate: '', updateDate: '',
}, },
...@@ -122,12 +134,39 @@ class BarCode extends Component { ...@@ -122,12 +134,39 @@ class BarCode extends Component {
this.fetchOrder(res.data[0].id); this.fetchOrder(res.data[0].id);
this.setState({ showPayOrder: true }); this.setState({ showPayOrder: true });
} else { } else {
this.drawBarCode(false); this.drawBarCode();
} }
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
}); });
console.log('调整亮度');
Taro.getScreenBrightness()
.then(({ value }) => {
console.log(value);
this.setState({
ScreenBrightness: value,
});
Taro.setScreenBrightness({
value: 1,
});
})
.catch(err => {
console.log(err);
Taro.setScreenBrightness({
value: 1,
});
});
}
componentWillUnmount() {
console.log('调整亮度');
const { ScreenBrightness } = this.state;
console.log(ScreenBrightness);
Taro.setScreenBrightness({
value: ScreenBrightness,
});
} }
fetchOrder(id: number) { fetchOrder(id: number) {
...@@ -148,32 +187,46 @@ class BarCode extends Component { ...@@ -148,32 +187,46 @@ class BarCode extends Component {
} }
payDoneHandle() { payDoneHandle() {
const { showBig } = this.state;
this.setState( this.setState(
{ {
showPayOrder: false, showPayOrder: false,
}, },
() => { () => {
this.drawBarCode(showBig); this.drawBarCode();
}, },
); );
} }
drawBarCode(showBig: boolean) { drawBarCode() {
const { userinfo } = this.props; const { userinfo } = this.props;
if (showBig) { let idBar = userinfo.idBar.substring(0, userinfo.idBar.length - 2) + '04';
wxbarcode.barcode('BarCode', userinfo.idBar, 646, 188); wxbarcode.barcode('BarCode', idBar, 646, 188);
} else { wxbarcode.barcode('BarCodeBig', idBar, 700, 364);
wxbarcode.barcode('BarCode', userinfo.idBar, 700, 364);
}
} }
toggleBigBarCode() { toggleBigBarCode() {
const { showBig } = this.state; const { showBig } = this.state;
this.drawBarCode(showBig);
this.setState({ this.setState({
showBig: !showBig, showBig: !showBig,
}); });
} }
refreshCodeBar() {
const { updateUserInfo } = this.props;
refreshCodeBar()
.then(res => {
console.log(res);
const data = res.data;
updateUserInfo({
idBar: data,
});
this.drawBarCode();
})
.catch(err => {
Taro.showToast({
title: err.msg || '获取失败',
icon: 'none',
});
});
}
render() { render() {
const { userinfo } = this.props; const { userinfo } = this.props;
...@@ -198,21 +251,28 @@ class BarCode extends Component { ...@@ -198,21 +251,28 @@ class BarCode extends Component {
className={`BarCodeBox ${showPayOrder ? 'blur' : ''} ${ className={`BarCodeBox ${showPayOrder ? 'blur' : ''} ${
showBig ? 'BarCodeBoxBig' : '' showBig ? 'BarCodeBoxBig' : ''
}`}> }`}>
{showBig ? ( <Image
<Image className='bg' src={BarCodeBoxBigBg} /> className='BarCodeBox-refresh'
) : ( src={RefreshIcon}
<Image className='bg' src={BarCodeBoxBg} /> onClick={this.refreshCodeBar}
/>
{showPayOrder ? null : (
<View className={`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`}>
<Canvas
className={`BarCodeCav ${showBig ? 'show' : ''}`}
canvasId='BarCodeBig'
/>
<Canvas
className={`BarCodeCav ${showBig ? '' : 'show'}`}
canvasId='BarCode'
/>
</View>
)} )}
{!showBig && (
<Image className='BarCodeBox-refresh' src={RefreshIcon} />
)}
<View className={`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`}>
{showPayOrder ? null : (
<Canvas className='BarCodeCav' canvasId='BarCode' />
)}
</View>
<View className='toggleBtn' onClick={this.toggleBigBarCode}> <View className='toggleBtn' onClick={this.toggleBigBarCode}>
{showBig ? '缩小' : '放大'} <Image
className={`arricon ${showBig ? 'rever' : ''}`}
src={ArrIcon}
/>
</View> </View>
</View> </View>
</View> </View>
......
.checkTelephone {
width: 100%;
height: 100%;
overflow: hidden;
// background: url('../../images/login/bg@2x.png') center;
background-size: cover;
}
.loginBox {
width: 634px;
height: 538px;
margin: 180px auto 0;
background-color: rgba(255, 255, 255, 0.5);
border-radius: 8px;
padding: 50px 40px 0;
line-height: 88px;
.loginBox-input {
box-sizing: border-box;
background-color: #fff;
width: 100%;
height: 88px;
padding: 0 20px;
font-size: 30px;
margin-bottom: 50px;
border-radius: 8px;
color: #ff9000;
}
.loginBox-input::-webkit-input-placeholder {
/* WebKit browsers */
color: #d9a842;
}
.loginBox-button {
font-size: 28px;
width: 100%;
height: 88px;
background-color: #ff9000;
color: #fff;
border: none;
outline: none;
border-radius: 8px;
}
.loginBox-button.big {
font-size: 34px;
}
.loginBox-button.fetching {
background-color: #ccc;
}
.loginBox-vcodeBox {
display: flex;
}
.vcodeBox-input-wrap {
flex: 1;
margin-right: 20px;
}
.vcodeBox-button-wrap {
text-align: center;
width: 200px;
height: 88px;
}
.countDownText {
color: #ff9000;
font-size: 30px;
}
}
.imgVcodeBox-wrap {
.imgVcodeBox-content {
width: 380px;
height: 332px;
}
.imgVcodeBox {
display: flex;
margin-bottom: 60px;
justify-content: space-between;
}
.imgVcodeBox-item {
width: 180px;
height: 88px;
background-color: #ffebcc;
border-radius: 8px;
}
.loginBox-input {
background-color: #ffebcc;
color: #d9a842;
}
}
import { ComponentClass } from 'react';
import Taro, { Component } from '@tarojs/taro';
import { View, Text, Button, Input } from '@tarojs/components';
import './CheckTelephone.scss';
type PageOwnProps = {};
type PageState = {
count: number;
timer: null;
fetching: boolean;
tel: string;
code: string;
sending: boolean;
vcode: string;
imgCode: string;
imgVcode: string;
dialogVisible: boolean;
};
interface CheckTelephone {
state: PageState;
}
class CheckTelephone extends Component {
constructor(props) {
super(props);
this.state = {
timer: null,
fetching: false,
tel: '',
code: '',
count: 60,
sending: false,
vcode: '',
imgCode: '',
imgVcode: '',
dialogVisible: false,
};
}
fetchImageVcode = () => {
console.log('in fetchImageVcode');
};
registerUser = () => {
Taro.navigateTo({
url: '/pages/Register/Register',
});
};
render() {
const { sending, count } = this.state;
return (
<View className='checkTelephone'>
<View className='loginBox'>
<Input
className='loginBox-input'
type='text'
placeholder='输入您的手机号'
/>
<View className='loginBox-vcodeBox'>
<View className='vcodeBox-input-wrap'>
<Input
className='loginBox-input'
type='text'
placeholder='请输入短信验证码'
/>
</View>
<View className='vcodeBox-button-wrap'>
{sending && <Text className='countDownText'>{{ count }}s</Text>}
<Button
v-else
className='loginBox-button'
onClick={this.fetchImageVcode}>
获取验证码
</Button>
</View>
</View>
<Button className='loginBox-button big' onClick={this.registerUser}>
登 录
</Button>
{/* // <ks-Dialog
// class="imgVcodeBox-wrap"
// :visible.sync="dialogVisible"
// top="180px"
// >
// <View class="imgVcodeBox-content">
// <View class="imgVcodeBox">
// <View class="imgVcodeBox-item">
// <input
// class="loginBox-input"
// type="text"
// v-model="imgCode"
// maxlength="6"
// />
// </View>
// <CodeView class="imgVcodeBox-item" :value="imgVcode"></CodeView>
// </View>
// <button v-if="fetching" class="loginBox-button big fetching">
// 确认
// </button>
// <button v-else class="loginBox-button big" @click="fetchVcode">
// 确认
// </button>
// </View>
// </ks-Dialog> */}
</View>
</View>
);
}
}
export default CheckTelephone as ComponentClass<PageOwnProps, PageState>;
...@@ -3,7 +3,6 @@ import Taro, { Component, Config } from '@tarojs/taro'; ...@@ -3,7 +3,6 @@ import Taro, { Component, Config } from '@tarojs/taro';
import { View, Textarea, Button } from '@tarojs/components'; import { View, Textarea, Button } from '@tarojs/components';
import { fetchFeedback } from '../../api/customer'; import { fetchFeedback } from '../../api/customer';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { UserState } from 'src/store/rootReducers/userinfo';
import './Feedback.scss'; import './Feedback.scss';
...@@ -43,7 +42,7 @@ class Feedback extends Component<PageProps, PageState> { ...@@ -43,7 +42,7 @@ class Feedback extends Component<PageProps, PageState> {
feedbackHandle() { feedbackHandle() {
Taro.showLoading(); Taro.showLoading();
const { feedbackContent } = this.state; const { feedbackContent } = this.state;
if (feedbackContent && feedbackContent.length > 5) { if (feedbackContent && feedbackContent.length >= 5) {
const { const {
areaId, areaId,
areaName, areaName,
......
...@@ -175,6 +175,14 @@ ...@@ -175,6 +175,14 @@
font-size: 32px; font-size: 32px;
color: #fff; color: #fff;
font-weight: bold; font-weight: bold;
.Home-Announcement-Content-title {
height: 40px;
line-height: 40px;
flex: 1;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.ContentDate { .ContentDate {
font-size: 24px; font-size: 24px;
font-weight: normal; font-weight: normal;
......
...@@ -16,28 +16,45 @@ import UserHeaderF from '../../images/home/img_girl_touxiang@2x.png'; ...@@ -16,28 +16,45 @@ import UserHeaderF from '../../images/home/img_girl_touxiang@2x.png';
import './Home.scss'; import './Home.scss';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { UserState } from '../../store/rootReducers/userinfo'; import {
UserState,
updateUserInfo,
INITIAL_STATE as userINitState,
} from '../../store/rootReducers/userinfo';
import { fetchBeanCount } from '../../api/bean'; import { fetchBeanCount } from '../../api/bean';
import { fetchAnn, SectionItem } from '../../api/announcement'; import { fetchAnn, SectionItem } from '../../api/announcement';
import { appLogout } from '../../api/customer'; import { appLogout } from '../../api/customer';
import { Customer } from '@/types/Customer/Customer';
type PageStateProps = { type PageStateProps = {
userinfo: UserState; userinfo: Customer;
}; };
type PageDispatchProps = {
updateUserInfo: (e: UserState) => void;
};
type PageState = { type PageState = {
barMenuVisiable: boolean; barMenuVisiable: boolean;
commBean: number; commBean: number;
hairDryerBean: number; hairDryerBean: number;
annItem: SectionItem; annItem: SectionItem;
}; };
type IProps = PageStateProps & PageDispatchProps;
interface Home { interface Home {
props: PageStateProps; props: IProps;
state: PageState; state: PageState;
} }
@connect(({ userinfo }) => ({ @connect(
userinfo, ({ userinfo }) => ({
})) userinfo,
}),
dispatch => ({
updateUserInfo(entity: UserState) {
dispatch(updateUserInfo(entity));
},
}),
)
class Home extends Component { class Home extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -63,7 +80,29 @@ class Home extends Component { ...@@ -63,7 +80,29 @@ class Home extends Component {
componentWillMount() { componentWillMount() {
this.getInitData(); this.getInitData();
} }
componentDidShow() {
this.getBeanCountData();
}
getInitData() { getInitData() {
this.getBeanCountData();
const { userinfo } = this.props;
fetchAnn({
campusId: userinfo.areaId,
customerId: userinfo.customerId,
})
.then(res => {
if (res) {
this.setState({
annItem: res,
});
}
})
.catch(err => {
console.error(err);
});
}
getBeanCountData() {
const { userinfo } = this.props; const { userinfo } = this.props;
fetchBeanCount({ fetchBeanCount({
id: userinfo.customerId, id: userinfo.customerId,
...@@ -74,7 +113,7 @@ class Home extends Component { ...@@ -74,7 +113,7 @@ class Home extends Component {
.then(res => { .then(res => {
const data = res.data; const data = res.data;
let commBeanItem = data.find(item => item.serviceId === '1'); let commBeanItem = data.find(item => item.serviceId === '1');
let hairDryerBeanItem = data.find(item => item.serviceId === '1'); let hairDryerBeanItem = data.find(item => item.serviceId === '4');
let commBean = commBeanItem ? commBeanItem.money : 0.0; let commBean = commBeanItem ? commBeanItem.money : 0.0;
let hairDryerBean = hairDryerBeanItem ? hairDryerBeanItem.money : 0.0; let hairDryerBean = hairDryerBeanItem ? hairDryerBeanItem.money : 0.0;
this.setState({ this.setState({
...@@ -83,65 +122,6 @@ class Home extends Component { ...@@ -83,65 +122,6 @@ class Home extends Component {
}); });
}) })
.catch(console.error); .catch(console.error);
fetchAnn({
campusId: userinfo.areaId,
customerId: userinfo.customerId,
})
.then(res => {
if (res) {
this.setState({
annItem: res,
});
}
})
.catch(err => {
// this.setState({
// annItem: {
// id: 896,
// styleType: 'ANNOUNCEMENT',
// name: '公告1',
// titleTypeRemark: '无',
// titleType: 'NONE',
// titleContent: '',
// sort: 3,
// updateTime: 1528770103000,
// itemsCount: 10,
// items: [
// {
// id: 301070,
// title: 'ASFDSGSD大苏打',
// multiImageType: 'SINGLE',
// source: '关机开不开地方',
// linkUrls: ['sqwerqwerqwefsf'],
// linkType: 'DEFAULT',
// jumpUrl: '',
// urlParameters: {},
// sort: 1,
// loadAd: false,
// mandatoryPrompt: false,
// createTime: '2018-06-01 10:41:11',
// updateTime: '2019-01-25 09:43:17',
// },
// {
// id: 301073,
// title: '啊实打实的阿斯顿',
// multiImageType: 'SINGLE',
// source: '个撒大',
// linkUrls: ['sqwerqwerqwefsf'],
// linkType: 'DEFAULT',
// jumpUrl: '',
// urlParameters: {},
// sort: 2,
// loadAd: false,
// mandatoryPrompt: false,
// createTime: '2018-06-12 10:52:15',
// updateTime: '2019-01-25 09:47:39',
// },
// ],
// },
// });
console.error(err);
});
} }
goSetting() { goSetting() {
...@@ -155,9 +135,9 @@ class Home extends Component { ...@@ -155,9 +135,9 @@ class Home extends Component {
url: '/pages/Feedback/Feedback', url: '/pages/Feedback/Feedback',
}); });
} }
goAnn() { goAnn(id: number) {
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/Announcement/Announcement?sectionId=896', url: '/pages/Announcement/Announcement?sectionId=' + id,
}); });
} }
...@@ -179,19 +159,21 @@ class Home extends Component { ...@@ -179,19 +159,21 @@ class Home extends Component {
})); }));
} }
logoutHandle() { logoutHandle() {
const { updateUserInfo } = this.props;
appLogout() appLogout()
.then(() => { .then(() => {
updateUserInfo(userINitState);
Taro.redirectTo({ Taro.redirectTo({
url: '/pages/index/index', url: '/pages/index/index',
}); });
}) })
.catch(console.log); .catch(console.log);
} }
formatePhone = phone => { formatePhone = (phone: string) => {
let newPhone = phone.replace(/([0-9]{3})([0-9]{4})([0-9]{4})/, '$1****$3'); let newPhone = phone.replace(/([0-9]{3})([0-9]{4})([0-9]{4})/, '$1****$3');
return newPhone; return newPhone;
}; };
geAnnDetail(id: number, title: string) { geAnnDetail(id: number) {
console.log(id); console.log(id);
Taro.navigateTo({ Taro.navigateTo({
url: `/pages/Content/Content?id=${id}`, url: `/pages/Content/Content?id=${id}`,
...@@ -247,12 +229,16 @@ class Home extends Component { ...@@ -247,12 +229,16 @@ class Home extends Component {
<View className='Home-UserBox-BeanItem'> <View className='Home-UserBox-BeanItem'>
<Image className='Home-UserBox-BeanIcon' src={HBeanIcon} /> <Image className='Home-UserBox-BeanIcon' src={HBeanIcon} />
<Text>吹风豆:</Text> <Text>吹风豆:</Text>
<Text className='Home-UserBox-BeanCount'>{hairDryerBean}</Text> <Text className='Home-UserBox-BeanCount'>
{hairDryerBean.toFixed(2)}
</Text>
</View> </View>
<View className='Home-UserBox-BeanItem'> <View className='Home-UserBox-BeanItem'>
<Image className='Home-UserBox-BeanIcon' src={TBeanIcon} /> <Image className='Home-UserBox-BeanIcon' src={TBeanIcon} />
<Text>通用豆:</Text> <Text>通用豆:</Text>
<Text className='Home-UserBox-BeanCount'>{commBean}</Text> <Text className='Home-UserBox-BeanCount'>
{commBean.toFixed(2)}
</Text>
</View> </View>
</View> </View>
<View className='Home-UserBox-Order'> <View className='Home-UserBox-Order'>
...@@ -275,7 +261,9 @@ class Home extends Component { ...@@ -275,7 +261,9 @@ class Home extends Component {
<Image className='bg' src={AnnouncementBg} /> <Image className='bg' src={AnnouncementBg} />
<View className='Home-Announcement-title'> <View className='Home-Announcement-title'>
<Text>最新公告</Text> <Text>最新公告</Text>
<View className='Home-Announcement-more' onClick={this.goAnn}> <View
className='Home-Announcement-more'
onClick={() => this.goAnn(annItem.id)}>
更多 更多
<Image className='more-icon' src={MoreIcon} /> <Image className='more-icon' src={MoreIcon} />
</View> </View>
...@@ -283,10 +271,10 @@ class Home extends Component { ...@@ -283,10 +271,10 @@ class Home extends Component {
{annItem.items.length && ( {annItem.items.length && (
<View <View
className='Home-Announcement-Content' className='Home-Announcement-Content'
onClick={() => onClick={() => this.geAnnDetail(annItem.items[0].id)}>
this.geAnnDetail(annItem.items[0].id, annItem.items[0].title) <Text className='Home-Announcement-Content-title'>
}> {annItem.items[0].title}
<Text>{annItem.items[0].title}</Text> </Text>
<Text className='ContentDate'> <Text className='ContentDate'>
{annItem.items[0].updateTime} {annItem.items[0].updateTime}
</Text> </Text>
......
...@@ -5,14 +5,16 @@ import { View, Button, Input, Navigator } from '@tarojs/components'; ...@@ -5,14 +5,16 @@ import { View, Button, Input, Navigator } from '@tarojs/components';
import './Login.scss'; import './Login.scss';
import { appLogin } from '../../api/customer'; import { appLogin } from '../../api/customer';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { updateUserInfo } from '../../store/rootReducers/userinfo'; import { updateUserInfo, UserState } from '../../store/rootReducers/userinfo';
import { LoginInfoVo } from '../../api/baseClass'; import { NotRegisterCode } from '../../constants/index';
type PageDispatchProps = { type PageDispatchProps = {
updateUserInfo: (e: LoginInfoVo) => void; userinfo: UserState;
updateUserInfo: (e: UserState) => void;
}; };
type PageState = { type PageState = {
fetching: boolean;
account: string; account: string;
pwd: string; pwd: string;
}; };
...@@ -23,9 +25,9 @@ interface Login { ...@@ -23,9 +25,9 @@ interface Login {
} }
@connect( @connect(
() => ({}), ({ userinfo }) => ({ userinfo }),
dispatch => ({ dispatch => ({
updateUserInfo(data: LoginInfoVo) { updateUserInfo(data: UserState) {
dispatch(updateUserInfo(data)); dispatch(updateUserInfo(data));
}, },
}), }),
...@@ -38,6 +40,7 @@ class Login extends Component { ...@@ -38,6 +40,7 @@ class Login extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
fetching: false,
account: '', account: '',
pwd: '', pwd: '',
}; };
...@@ -63,22 +66,48 @@ class Login extends Component { ...@@ -63,22 +66,48 @@ class Login extends Component {
} }
loginHandle(): void { loginHandle(): void {
if (this.state.fetching) return;
if (this.validataLoginData()) { if (this.validataLoginData()) {
this.setState({
fetching: true,
});
const { updateUserInfo, userinfo } = this.props;
const { account, pwd } = this.state; const { account, pwd } = this.state;
console.log('in loginHandle'); console.log('in loginHandle');
appLogin({ appLogin({
loginAccount: account, loginAccount: account,
password: pwd, password: pwd,
code: userinfo.code,
}) })
.then(res => { .then(res => {
const data = res.data; const data = res.data;
console.log(data); console.log(data);
this.props.updateUserInfo(data); updateUserInfo(data);
Taro.navigateTo({ Taro.reLaunch({
url: '/pages/Home/Home', url: '/pages/Home/Home',
}); });
}) })
.catch(console.error); .catch(err => {
console.log(err);
if (err.code && err.code === NotRegisterCode) {
updateUserInfo({
customerPhone: account,
});
setTimeout(() => {
this.setState({
fetching: false,
});
Taro.navigateTo({
url: '/pages/Register/Register',
});
}, 2000);
} else {
this.setState({
fetching: false,
});
}
});
} }
} }
...@@ -94,6 +123,7 @@ class Login extends Component { ...@@ -94,6 +123,7 @@ class Login extends Component {
placeholder='请输入账号手机号' placeholder='请输入账号手机号'
type='number' type='number'
value={account} value={account}
maxLength={11}
onInput={({ detail: { value } }) => { onInput={({ detail: { value } }) => {
this.setState({ this.setState({
account: value, account: value,
...@@ -107,6 +137,7 @@ class Login extends Component { ...@@ -107,6 +137,7 @@ class Login extends Component {
password password
placeholder='请输入密码' placeholder='请输入密码'
value={pwd} value={pwd}
maxLength={20}
onInput={({ detail: { value } }) => { onInput={({ detail: { value } }) => {
this.setState({ this.setState({
pwd: value, pwd: value,
......
...@@ -118,6 +118,7 @@ class OrderDetail extends Component { ...@@ -118,6 +118,7 @@ class OrderDetail extends Component {
equipmentNum, equipmentNum,
equipmentPosition, equipmentPosition,
deductionMoney, deductionMoney,
thirdDiscountMoney,
} = this.state; } = this.state;
const payTypeName = getPayType(payType); const payTypeName = getPayType(payType);
return ( return (
...@@ -140,7 +141,7 @@ class OrderDetail extends Component { ...@@ -140,7 +141,7 @@ class OrderDetail extends Component {
</View> </View>
{deductionBean ? ( {deductionBean ? (
<View className='OrderDetail-payinfo'> <View className='OrderDetail-payinfo'>
<Text>通用豆抵扣</Text> <Text>{serviceName ? serviceName : ''}豆抵扣</Text>
<Text className='deduction'>{deductionBean.toFixed(2)}</Text> <Text className='deduction'>{deductionBean.toFixed(2)}</Text>
</View> </View>
) : null} ) : null}
...@@ -150,6 +151,12 @@ class OrderDetail extends Component { ...@@ -150,6 +151,12 @@ class OrderDetail extends Component {
<Text className='deduction'>{deductionMoney.toFixed(2)}</Text> <Text className='deduction'>{deductionMoney.toFixed(2)}</Text>
</View> </View>
) : null} ) : null}
{thirdDiscountMoney ? (
<View className='OrderDetail-payinfo'>
<Text>三方抵扣</Text>
<Text className='deduction'>{thirdDiscountMoney.toFixed(2)}</Text>
</View>
) : null}
<View className='OrderDetail-payinfo'> <View className='OrderDetail-payinfo'>
<Text>支付方式</Text> <Text>支付方式</Text>
......
...@@ -15,13 +15,12 @@ import { ...@@ -15,13 +15,12 @@ import {
} from './actions'; } from './actions';
import { StoreState } from './store'; import { StoreState } from './store';
import { fetchAllOrder, fetchPayOrder } from '../../../api/order'; import { fetchAllOrder, fetchPayOrder } from '../../../api/order';
import { UserState } from '../../../store/rootReducers/userinfo';
import { ConsumeOrder } from '../../../api/baseClass';
import Order, { AllOrderItem } from '../../../types/Order/Order'; import Order, { AllOrderItem } from '../../../types/Order/Order';
import { Customer } from '@/types/Customer/Customer';
type PageStateProps = { type PageStateProps = {
orderList: StoreState; orderList: StoreState;
userinfo: UserState; userinfo: Customer;
}; };
type PageDispatchProps = { type PageDispatchProps = {
toggleOrderState: (state: String) => void; toggleOrderState: (state: String) => void;
...@@ -33,8 +32,13 @@ type PageOwnProps = {}; ...@@ -33,8 +32,13 @@ type PageOwnProps = {};
type PageProps = PageStateProps & PageDispatchProps & PageOwnProps; type PageProps = PageStateProps & PageDispatchProps & PageOwnProps;
type PageState = {
needRefresh: boolean;
};
interface OrderList { interface OrderList {
props: PageProps; props: PageProps;
state: PageState;
} }
@connect( @connect(
...@@ -52,7 +56,7 @@ interface OrderList { ...@@ -52,7 +56,7 @@ interface OrderList {
updateAllOrder(data) { updateAllOrder(data) {
dispatch(updateAllOrderList(data)); dispatch(updateAllOrderList(data));
}, },
}) }),
) )
class OrderList extends Component { class OrderList extends Component {
config: Config = { config: Config = {
...@@ -61,10 +65,21 @@ class OrderList extends Component { ...@@ -61,10 +65,21 @@ class OrderList extends Component {
}; };
constructor(props: PageProps) { constructor(props: PageProps) {
super(props); super(props);
this.state = {
needRefresh: false,
};
} }
componentWillMount() { componentWillMount() {
this.getPayOrderHandle(); this.getPayOrderHandle();
this.getAllOrderHandle();
}
componentDidShow() {
const { needRefresh } = this.state;
if (needRefresh) {
this.getPayOrderHandle();
this.getAllOrderHandle();
}
} }
onPullDownRefresh() { onPullDownRefresh() {
...@@ -95,7 +110,7 @@ class OrderList extends Component { ...@@ -95,7 +110,7 @@ class OrderList extends Component {
: { : {
customerId: userinfo.customerId, customerId: userinfo.customerId,
pageSize: 10, pageSize: 10,
} },
) )
.then(res => { .then(res => {
console.log(res); console.log(res);
...@@ -119,7 +134,7 @@ class OrderList extends Component { ...@@ -119,7 +134,7 @@ class OrderList extends Component {
: { : {
customerId: customerId, customerId: customerId,
pageSize: 10, pageSize: 10,
} },
) )
.then(res => { .then(res => {
console.log(res); console.log(res);
...@@ -129,12 +144,18 @@ class OrderList extends Component { ...@@ -129,12 +144,18 @@ class OrderList extends Component {
} }
goPayPage(data) { goPayPage(data) {
this.setState({
needRefresh: true,
});
this.$preload({ id: data.id }); this.$preload({ id: data.id });
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/Order/OrderPay/OrderPay', url: '/pages/Order/OrderPay/OrderPay',
}); });
} }
goDetail(data) { goDetail(data) {
this.setState({
needRefresh: false,
});
this.$preload(data); this.$preload(data);
Taro.navigateTo({ Taro.navigateTo({
url: '/pages/Order/OrderDetail/OrderDetail', url: '/pages/Order/OrderDetail/OrderDetail',
...@@ -187,14 +208,12 @@ class OrderList extends Component { ...@@ -187,14 +208,12 @@ class OrderList extends Component {
<View className='Tab'> <View className='Tab'>
<Text <Text
className={`Tab-item ${orderState === '1' ? 'active' : ''}`} className={`Tab-item ${orderState === '1' ? 'active' : ''}`}
onClick={() => this.toggleStateHandle('1')} onClick={() => this.toggleStateHandle('1')}>
>
待付款 待付款
</Text> </Text>
<Text <Text
className={`Tab-item ${orderState === 'all' ? 'active' : ''}`} className={`Tab-item ${orderState === 'all' ? 'active' : ''}`}
onClick={() => this.toggleStateHandle('all')} onClick={() => this.toggleStateHandle('all')}>
>
全部 全部
</Text> </Text>
</View> </View>
...@@ -206,8 +225,7 @@ class OrderList extends Component { ...@@ -206,8 +225,7 @@ class OrderList extends Component {
upperThreshold={-100} upperThreshold={-100}
lowerThreshold={70} lowerThreshold={70}
scrollWithAnimation scrollWithAnimation
scrollTop={0} scrollTop={0}>
>
{orderState === '1' {orderState === '1'
? payList.map(order => ( ? payList.map(order => (
<OrderItem <OrderItem
......
...@@ -4,20 +4,20 @@ import { View } from '@tarojs/components'; ...@@ -4,20 +4,20 @@ import { View } from '@tarojs/components';
import OrderTitle from '../components/OrderTitle/OrderTitle'; import OrderTitle from '../components/OrderTitle/OrderTitle';
import OrderInfo from '../components/OrderInfo/OrderInfo'; import OrderInfo from '../components/OrderInfo/OrderInfo';
import { fetchOrderDetailAndPay, fetchDeductionInfo } from '../../../api/order'; import { fetchOrderDetailAndPay } from '../../../api/order';
import './OrderPay.scss'; import './OrderPay.scss';
import { import {
ConsumeOrder,
CustomerBeanAccountVo, CustomerBeanAccountVo,
PaymentAndActiveInfo, PaymentAndActiveInfo,
} from '../../../api/baseClass'; } from '../../../api/baseClass';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { UserState } from 'src/store/rootReducers/userinfo';
import OrderPayway from '../components/OrderPayway/OrderPayway'; import OrderPayway from '../components/OrderPayway/OrderPayway';
import Order from '@/types/Order/Order';
import { Customer } from '@/types/Customer/Customer';
type PageStateProps = { type PageStateProps = {
userinfo: UserState; userinfo: Customer;
}; };
type PageProps = { type PageProps = {
id?: number; id?: number;
...@@ -25,7 +25,7 @@ type PageProps = { ...@@ -25,7 +25,7 @@ type PageProps = {
type PageState = { type PageState = {
prePay: boolean; prePay: boolean;
accounts: CustomerBeanAccountVo[]; accounts: CustomerBeanAccountVo[];
orderInfo: ConsumeOrder; orderInfo: Order;
payInfos: { payInfos: {
paymentAndActiveInfos: PaymentAndActiveInfo[]; paymentAndActiveInfos: PaymentAndActiveInfo[];
paymentConfId: number; paymentConfId: number;
...@@ -48,20 +48,20 @@ class OrderPay extends Component { ...@@ -48,20 +48,20 @@ class OrderPay extends Component {
prePay: true, prePay: true,
accounts: [], accounts: [],
orderInfo: { orderInfo: {
actualMoney: undefined, actualMoney: 0,
areaId: undefined, areaId: 0,
areaName: '', areaName: '',
consumeType: '', consumeType: '',
createAt: '', createAt: '',
customerCellphone: '', customerCellphone: '',
customerId: undefined, customerId: 0,
customerName: '', customerName: '',
deductionBean: undefined, deductionBean: 0,
deductionMoney: undefined, deductionMoney: 0,
equipmentNum: '', equipmentNum: '',
equipmentPosition: '', equipmentPosition: '',
id: undefined, id: 0,
operateId: undefined, operateId: 0,
operateName: '', operateName: '',
operationMode: '', operationMode: '',
orderName: '', orderName: '',
...@@ -69,10 +69,10 @@ class OrderPay extends Component { ...@@ -69,10 +69,10 @@ class OrderPay extends Component {
orderState: '', orderState: '',
outTradeNo: '', outTradeNo: '',
payType: '', payType: '',
payableMoney: undefined, payableMoney: 0,
serviceId: undefined, serviceId: 0,
serviceName: '', serviceName: '',
thirdDiscountMoney: undefined, thirdDiscountMoney: 0,
thirdTradeNumber: '', thirdTradeNumber: '',
updateDate: '', updateDate: '',
}, },
...@@ -116,7 +116,9 @@ class OrderPay extends Component { ...@@ -116,7 +116,9 @@ class OrderPay extends Component {
const { orderInfo, payInfos, accounts } = this.state; const { orderInfo, payInfos, accounts } = this.state;
return ( return (
<View className='OrderPay topBr'> <View className='OrderPay topBr'>
<OrderTitle price={orderInfo.payableMoney} /> <OrderTitle
price={orderInfo.payableMoney ? orderInfo.payableMoney : 0}
/>
<OrderInfo orderInfo={orderInfo} /> <OrderInfo orderInfo={orderInfo} />
<View className='OrderPay-line' /> <View className='OrderPay-line' />
<OrderPayway <OrderPayway
......
.OrderDetail-info, .OrderDetail-info {
.OrderDetail-payinfo {
display: flex; display: flex;
height: 60px;
line-height: 60px; line-height: 60px;
justify-content: space-between; justify-content: space-between;
font-size: 28px; font-size: 28px;
color: #666; color: #666;
.OrderDetail-info-title {
width: 120px;
}
.OrderDetail-info-content {
text-align: right;
flex: 1;
}
} }
...@@ -47,28 +47,32 @@ class OrderInfo extends Component { ...@@ -47,28 +47,32 @@ class OrderInfo extends Component {
return ( return (
<View> <View>
<View className='OrderDetail-info'> <View className='OrderDetail-info'>
<Text>商品说明</Text> <Text className='OrderDetail-info-title'>商品说明</Text>
<Text>{serviceName ? serviceName : ''}</Text> <Text className='OrderDetail-info-content'>
{serviceName ? serviceName : ''}
</Text>
</View> </View>
<View className='OrderDetail-info'> <View className='OrderDetail-info'>
<Text>消费时间</Text> <Text className='OrderDetail-info-title'>消费时间</Text>
<Text>{createAt}</Text> <Text className='OrderDetail-info-content'>{createAt}</Text>
</View> </View>
<View className='OrderDetail-info'> <View className='OrderDetail-info'>
<Text>订单号</Text> <Text className='OrderDetail-info-title'>订单号</Text>
<Text>{orderNumber}</Text> <Text className='OrderDetail-info-content'>{orderNumber}</Text>
</View> </View>
<View className='OrderDetail-info'> <View className='OrderDetail-info'>
<Text>所属区域</Text> <Text className='OrderDetail-info-title'>所属区域</Text>
<Text>{areaName}</Text> <Text className='OrderDetail-info-content'>{areaName}</Text>
</View> </View>
<View className='OrderDetail-info'> <View className='OrderDetail-info'>
<Text>设备编号</Text> <Text className='OrderDetail-info-title'>设备编号</Text>
<Text>{equipmentNum}</Text> <Text className='OrderDetail-info-content'>{equipmentNum}</Text>
</View> </View>
<View className='OrderDetail-info'> <View className='OrderDetail-info'>
<Text>设备位置</Text> <Text className='OrderDetail-info-title'>设备位置</Text>
<Text>{equipmentPosition ? equipmentPosition : ''}</Text> <Text className='OrderDetail-info-content'>
{equipmentPosition ? equipmentPosition : ''}
</Text>
</View> </View>
</View> </View>
); );
......
...@@ -19,6 +19,9 @@ ...@@ -19,6 +19,9 @@
border: 6px solid #c8c8c8; border: 6px solid #c8c8c8;
border-radius: 50%; border-radius: 50%;
} }
.OrderPay-check.disabled {
background-color: #c8c8c8;
}
.checked { .checked {
border-color: #ffd506; border-color: #ffd506;
background-color: #ffd506; background-color: #ffd506;
...@@ -48,7 +51,7 @@ ...@@ -48,7 +51,7 @@
.OrderPay-DeductionInfo::before { .OrderPay-DeductionInfo::before {
content: ''; content: '';
position: absolute; position: absolute;
top: -12px; top: -10px;
left: 120px; left: 120px;
border-bottom: 12px solid #ffe4e4; border-bottom: 12px solid #ffe4e4;
border-left: 11px solid transparent; border-left: 11px solid transparent;
......
import Taro, { Component } from '@tarojs/taro'; import Taro, { Component } from '@tarojs/taro';
import { ComponentClass } from 'react'; import { ComponentClass } from 'react';
import { Button, View, Image, Text } from '@tarojs/components'; import { Button, View, Image, Text } from '@tarojs/components';
import { UserState } from '../../../../store/rootReducers/userinfo';
import { import {
PaymentAndActiveInfo, PaymentAndActiveInfo,
CustomerBeanAccountVo, CustomerBeanAccountVo,
ConsumeOrder,
} from '../../../../api/baseClass'; } from '../../../../api/baseClass';
import { confirmPay, fetchDeductionInfo } from '../../../../api/order'; import { confirmPay, fetchDeductionInfo } from '../../../../api/order';
...@@ -20,11 +18,13 @@ import Utf8 from 'crypto-js/enc-utf8'; ...@@ -20,11 +18,13 @@ import Utf8 from 'crypto-js/enc-utf8';
import ECBmode from 'crypto-js/mode-ecb'; import ECBmode from 'crypto-js/mode-ecb';
import PaddingPkcs7 from 'crypto-js/pad-pkcs7'; import PaddingPkcs7 from 'crypto-js/pad-pkcs7';
import { getPayType } from '../../../../utils/payType'; import { getPayType } from '../../../../utils/payType';
import Order from '../../../../types/Order/Order';
import { Customer } from '../../../../types/Customer/Customer';
type PageOwnProps = { type PageOwnProps = {
onPayDoneCallback: () => void; onPayDoneCallback: () => void;
userinfo: UserState; userinfo: Customer;
orderInfo: ConsumeOrder; orderInfo: Order;
accounts: CustomerBeanAccountVo[]; accounts: CustomerBeanAccountVo[];
payInfos: { payInfos: {
paymentAndActiveInfos: PaymentAndActiveInfo[]; paymentAndActiveInfos: PaymentAndActiveInfo[];
...@@ -67,9 +67,34 @@ class OrderPayway extends Component { ...@@ -67,9 +67,34 @@ class OrderPayway extends Component {
paymentAndActiveInfos: [], paymentAndActiveInfos: [],
paymentConfId: 0, paymentConfId: 0,
}, },
orderInfo: { orderInfo: {
actualMoney: 0,
areaId: 0,
areaName: '',
consumeType: '',
createAt: '',
customerCellphone: '',
customerId: 0,
customerName: '',
deductionBean: 0,
deductionMoney: 0,
equipmentNum: '',
equipmentPosition: '',
id: 0,
operateId: 0,
operateName: '',
operationMode: '',
orderName: '',
orderNumber: '',
orderState: '',
outTradeNo: '',
payType: '',
payableMoney: 0, payableMoney: 0,
serviceId: 0,
serviceName: '',
thirdDiscountMoney: 0,
thirdTradeNumber: '',
updateDate: '',
}, },
}; };
constructor(props: PageOwnProps) { constructor(props: PageOwnProps) {
...@@ -146,8 +171,10 @@ class OrderPayway extends Component { ...@@ -146,8 +171,10 @@ class OrderPayway extends Component {
const { payWay } = this.state; const { payWay } = this.state;
confirmPay({ confirmPay({
orderId: id, orderId: id,
payType: payWay.payType, payType: payWay ? payWay.payType : '',
[payWay.activeId ? 'activeId' : 'notUse']: payWay.activeId, [payWay && payWay.activeId ? 'activeId' : 'notUse']: payWay
? payWay.activeId
: 0,
returnUrl: '', returnUrl: '',
callType: '3', callType: '3',
paymentConfId: payInfos.paymentConfId, paymentConfId: payInfos.paymentConfId,
...@@ -163,24 +190,23 @@ class OrderPayway extends Component { ...@@ -163,24 +190,23 @@ class OrderPayway extends Component {
}).toString(Utf8), }).toString(Utf8),
); );
console.log(payData); console.log(payData);
Taro.requestPayment({ Taro.requestPayment({
timeStamp: payData.msg.timeStamp.toString(), timeStamp: payData.msg.timeStamp.toString(),
nonceStr: payData.msg.nonceStr, nonceStr: payData.msg.nonceStr,
package: payData.msg.package, package: payData.msg.package,
signType: payData.msg.signType, signType: payData.msg.signType,
paySign: payData.msg.paySign, paySign: payData.msg.paySign,
success(res) { })
.then(res => {
console.log(res); console.log(res);
onPayDoneCallback(); onPayDoneCallback();
}, })
fail(res) { .catch(err => {
Taro.showToast({ Taro.showToast({
title: res.msg || '发起支付失败', title: err.msg || '发起支付失败',
icon: 'none', icon: 'none',
}); });
}, });
});
} else { } else {
onPayDoneCallback(); onPayDoneCallback();
} }
...@@ -207,9 +233,6 @@ class OrderPayway extends Component { ...@@ -207,9 +233,6 @@ class OrderPayway extends Component {
item.payType === '7' || item.payType === '7' ||
item.payType === '8', item.payType === '8',
); );
const payInfo = prePay
? null
: payInfoList.find(item => item.payType === payWay.payType);
const useAmi = accountsInfo && accountsInfo['6'] >= orderInfo.payableMoney; const useAmi = accountsInfo && accountsInfo['6'] >= orderInfo.payableMoney;
const useCom = accountsInfo && accountsInfo['8'] >= orderInfo.payableMoney; const useCom = accountsInfo && accountsInfo['8'] >= orderInfo.payableMoney;
const useBean = accountsInfo && accountsInfo['7'] >= orderInfo.payableMoney; const useBean = accountsInfo && accountsInfo['7'] >= orderInfo.payableMoney;
...@@ -244,9 +267,9 @@ class OrderPayway extends Component { ...@@ -244,9 +267,9 @@ class OrderPayway extends Component {
<Image className='OrderPay-icon' src={payWayAimiLogo} /> <Image className='OrderPay-icon' src={payWayAimiLogo} />
<Text className='OrderPay-text'> <Text className='OrderPay-text'>
{getPayType(payway.payType)}(余额: {getPayType(payway.payType)}(余额:
{accountsInfo && {accountsInfo && accountsInfo['6']
accountsInfo['6'] && ? accountsInfo['6'].toFixed(2)
accountsInfo['6'].toFixed(2)} : '0.00'}
) )
</Text> </Text>
<View <View
...@@ -254,7 +277,7 @@ class OrderPayway extends Component { ...@@ -254,7 +277,7 @@ class OrderPayway extends Component {
payWay && payWay.payType === payway.payType payWay && payWay.payType === payway.payType
? 'checked' ? 'checked'
: '' : ''
}`} } ${useAmi ? '' : 'disabled'}`}
/> />
</View> </View>
) : payway.payType === '7' ? ( ) : payway.payType === '7' ? (
...@@ -264,7 +287,7 @@ class OrderPayway extends Component { ...@@ -264,7 +287,7 @@ class OrderPayway extends Component {
onClick={() => this.changePayWay(payway, !useBean)}> onClick={() => this.changePayWay(payway, !useBean)}>
<Image className='OrderPay-icon' src={payWayHairLogo} /> <Image className='OrderPay-icon' src={payWayHairLogo} />
<Text className='OrderPay-text'> <Text className='OrderPay-text'>
{getPayType(payway.payType)}(余额: {orderInfo.serviceName}(余额:
{accountsInfo && accountsInfo['7'] {accountsInfo && accountsInfo['7']
? accountsInfo['7'].toFixed(2) ? accountsInfo['7'].toFixed(2)
: '0.00'} : '0.00'}
...@@ -275,7 +298,7 @@ class OrderPayway extends Component { ...@@ -275,7 +298,7 @@ class OrderPayway extends Component {
payWay && payWay.payType === payway.payType payWay && payWay.payType === payway.payType
? 'checked' ? 'checked'
: '' : ''
}`} } ${useBean ? '' : 'disabled'}`}
/> />
</View> </View>
) : payway.payType === '8' ? ( ) : payway.payType === '8' ? (
...@@ -296,7 +319,7 @@ class OrderPayway extends Component { ...@@ -296,7 +319,7 @@ class OrderPayway extends Component {
payWay && payWay.payType === payway.payType payWay && payWay.payType === payway.payType
? 'checked' ? 'checked'
: '' : ''
}`} } ${useCom ? '' : 'disabled'}`}
/> />
</View> </View>
) : null, ) : null,
......
...@@ -17,15 +17,19 @@ import agreeNotIcon from '../../images/login/icon_zhuce_nor@2x.png'; ...@@ -17,15 +17,19 @@ import agreeNotIcon from '../../images/login/icon_zhuce_nor@2x.png';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo'; import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo';
import { wxUserRegister } from '../../api/customer'; import { wxUserRegister } from '../../api/customer';
import { replaceIllegalPwd } from '../../utils/pwd';
import { Customer } from '@/types/Customer/Customer';
import { ANN_LINK_URL } from '@/constants';
type PageStateProps = { type PageStateProps = {
userinfo: UserState; userinfo: Customer;
}; };
type PageDispatchProps = { type PageDispatchProps = {
updateUserInfo: (e: UserState) => void; updateUserInfo: (e: UserState) => void;
}; };
type PageState = { type PageState = {
fetching: boolean;
name: string; name: string;
cellphone: string; cellphone: string;
vcode: string; vcode: string;
...@@ -60,9 +64,11 @@ class Register extends Component { ...@@ -60,9 +64,11 @@ class Register extends Component {
constructor(props: IProps) { constructor(props: IProps) {
super(props); super(props);
const { customerPhone } = props.userinfo;
this.state = { this.state = {
fetching: false,
name: '', name: '',
cellphone: '', cellphone: customerPhone,
vcode: '', vcode: '',
pwd: '', pwd: '',
checkPwd: '', checkPwd: '',
...@@ -78,32 +84,17 @@ class Register extends Component { ...@@ -78,32 +84,17 @@ class Register extends Component {
sex: value, sex: value,
}); });
} }
getVcode() {
const { cellphone } = this.state; setPwdValue(key: string, value: string) {
if (cellphone.length == 11) { let val = replaceIllegalPwd(value);
// getVcode({ this.setState({
// tel: cellphone, [key]: val,
// }) });
// .then(res => { return val;
// console.log(res);
// Taro.showToast({
// title: res.msg,
// mask: true,
// });
// })
// .catch(console.error);
this.refs.Vcode.countStart();
} else {
Taro.showToast({
title: '输入正确的手机号',
icon: 'none',
mask: true,
});
}
} }
validateRegisterEntity(): boolean { validateRegisterEntity(): boolean {
const { name, cellphone, pwd, checkPwd } = this.state; const { name, cellphone, vcode, pwd, checkPwd } = this.state;
const { const {
userinfo: { areaId }, userinfo: { areaId },
} = this.props; } = this.props;
...@@ -121,14 +112,21 @@ class Register extends Component { ...@@ -121,14 +112,21 @@ class Register extends Component {
}); });
return false; return false;
} }
if (!pwd) { if (!vcode || vcode.length !== 6) {
Taro.showToast({ Taro.showToast({
title: '请输入码', title: '请输入6位验证码',
icon: 'none', icon: 'none',
}); });
return false; return false;
} }
if (!checkPwd) { if (!pwd || pwd.length < 6) {
Taro.showToast({
title: '请输入大于6位密码',
icon: 'none',
});
return false;
}
if (!checkPwd || checkPwd.length < 6) {
Taro.showToast({ Taro.showToast({
title: '请输入确认密码', title: '请输入确认密码',
icon: 'none', icon: 'none',
...@@ -137,7 +135,7 @@ class Register extends Component { ...@@ -137,7 +135,7 @@ class Register extends Component {
} }
if (pwd != checkPwd) { if (pwd != checkPwd) {
Taro.showToast({ Taro.showToast({
title: '请输入确认密码', title: '两次密码不一致',
icon: 'none', icon: 'none',
}); });
return false; return false;
...@@ -153,34 +151,48 @@ class Register extends Component { ...@@ -153,34 +151,48 @@ class Register extends Component {
} }
getRegister() { getRegister() {
if (this.state.fetching) return;
if (this.validateRegisterEntity()) { if (this.validateRegisterEntity()) {
this.setState({
fetching: true,
});
const { name, cellphone, pwd, sex, vcode } = this.state; const { name, cellphone, pwd, sex, vcode } = this.state;
const { const {
userinfo: { areaId, areaName }, userinfo: { areaId, areaName },
updateUserInfo,
} = this.props; } = this.props;
wxUserRegister({ Taro.login()
areaId: areaId, .then(res => res.code)
areaName: areaName, .then(code => {
customerName: name, wxUserRegister({
customerPhone: cellphone, code: code,
customerSex: sex, areaId: areaId,
password: pwd, areaName: areaName,
verificationCode: vcode, customerName: name,
}) customerPhone: cellphone,
.then(res => { customerSex: sex,
const { register, wxToken, ...userInfo } = res.data; password: pwd,
updateUserInfo({ verificationCode: vcode,
...userInfo, })
token: wxToken, .then(res => {
}); const data = res.data;
Taro.showToast({ console.log(data);
title: '注册成功', updateUserInfo(data);
}); Taro.showToast({
setTimeout(() => { title: '注册成功',
Taro.redirectTo({ });
url: '/pages/Home/Home', setTimeout(() => {
Taro.reLaunch({
url: '/pages/Home/Home',
});
}, 2000);
})
.catch(err => {
console.log(err);
this.setState({
fetching: false,
});
}); });
}, 2000);
}) })
.catch(console.log); .catch(console.log);
} }
...@@ -210,6 +222,15 @@ class Register extends Component { ...@@ -210,6 +222,15 @@ class Register extends Component {
})); }));
} }
goAgreementPage(e) {
e.stopPropagation();
Taro.navigateTo({
url:
'/pages/WebPage/WebPage?url=' +
encodeURIComponent(ANN_LINK_URL + '/agreement.html'),
});
}
render() { render() {
const { const {
name, name,
...@@ -311,12 +332,9 @@ class Register extends Component { ...@@ -311,12 +332,9 @@ class Register extends Component {
placeholder='密码由6-20位组成' placeholder='密码由6-20位组成'
maxLength={20} maxLength={20}
value={pwd} value={pwd}
onInput={({ detail: { value } }) => { onInput={({ detail: { value } }) =>
this.setState({ this.setPwdValue('pwd', value)
pwd: value, }
});
return value;
}}
/> />
<Image <Image
className='registerBox-pwdIcon' className='registerBox-pwdIcon'
...@@ -332,12 +350,9 @@ class Register extends Component { ...@@ -332,12 +350,9 @@ class Register extends Component {
placeholder='确认密码' placeholder='确认密码'
maxLength={20} maxLength={20}
value={checkPwd} value={checkPwd}
onInput={({ detail: { value } }) => { onInput={({ detail: { value } }) =>
this.setState({ this.setPwdValue('checkPwd', value)
checkPwd: value, }
});
return value;
}}
/> />
<Image <Image
className='registerBox-pwdIcon' className='registerBox-pwdIcon'
...@@ -364,7 +379,9 @@ class Register extends Component { ...@@ -364,7 +379,9 @@ class Register extends Component {
<Image className='registerBox-agreeCheck' src={agreeNotIcon} /> <Image className='registerBox-agreeCheck' src={agreeNotIcon} />
)} )}
<Text>同意条款</Text> <Text>同意条款</Text>
<Text className='service-deal'>《多彩校园服务协议》</Text> <Text className='service-deal' onClick={this.goAgreementPage}>
《多彩校园服务协议》
</Text>
</View> </View>
{agree ? ( {agree ? (
<Button className='registerBox-button' onClick={this.getRegister}> <Button className='registerBox-button' onClick={this.getRegister}>
......
...@@ -8,6 +8,7 @@ import ToastBox from '../../components/ToastBox/ToastBox'; ...@@ -8,6 +8,7 @@ import ToastBox from '../../components/ToastBox/ToastBox';
import './ResetPwd.scss'; import './ResetPwd.scss';
import { changePwdByCellphone } from '../../api/customer'; import { changePwdByCellphone } from '../../api/customer';
import { replaceIllegalPwd } from '../../utils/pwd';
type PageOwnProps = {}; type PageOwnProps = {};
type PageState = { type PageState = {
...@@ -31,7 +32,7 @@ class ResetPwd extends Component { ...@@ -31,7 +32,7 @@ class ResetPwd extends Component {
constructor(props: PageOwnProps) { constructor(props: PageOwnProps) {
super(props); super(props);
this.state = { this.state = {
cellphone: '18108096099', cellphone: '',
vcode: '', vcode: '',
pwd: '', pwd: '',
checkPwd: '', checkPwd: '',
...@@ -40,6 +41,14 @@ class ResetPwd extends Component { ...@@ -40,6 +41,14 @@ class ResetPwd extends Component {
}; };
} }
setPwdValue(key: string, value: string) {
let val = replaceIllegalPwd(value);
this.setState({
[key]: val,
});
return val;
}
togglePwdBox() { togglePwdBox() {
this.setState(({ showPwd }: PageState) => ({ this.setState(({ showPwd }: PageState) => ({
showPwd: !showPwd, showPwd: !showPwd,
...@@ -62,7 +71,7 @@ class ResetPwd extends Component { ...@@ -62,7 +71,7 @@ class ResetPwd extends Component {
} }
if (!vcode || vcode.length !== 6) { if (!vcode || vcode.length !== 6) {
Taro.showToast({ Taro.showToast({
title: '请输入验证码', title: '请输入6位验证码',
icon: 'none', icon: 'none',
}); });
return false; return false;
...@@ -76,7 +85,7 @@ class ResetPwd extends Component { ...@@ -76,7 +85,7 @@ class ResetPwd extends Component {
} }
if (!checkPwd || checkPwd.length < 6) { if (!checkPwd || checkPwd.length < 6) {
Taro.showToast({ Taro.showToast({
title: '请输入大于6位密码', title: '请输入确认密码',
icon: 'none', icon: 'none',
}); });
return false; return false;
...@@ -111,7 +120,14 @@ class ResetPwd extends Component { ...@@ -111,7 +120,14 @@ class ResetPwd extends Component {
} }
} }
render() { render() {
const { cellphone, vcode, showPwd, pwd,showCheckPwd, checkPwd } = this.state; const {
cellphone,
vcode,
showPwd,
pwd,
showCheckPwd,
checkPwd,
} = this.state;
return ( return (
<View className='ResetPwd'> <View className='ResetPwd'>
<ToastBox ref='ToastBox' /> <ToastBox ref='ToastBox' />
...@@ -162,12 +178,9 @@ class ResetPwd extends Component { ...@@ -162,12 +178,9 @@ class ResetPwd extends Component {
placeholder='输入6-20位新密码' placeholder='输入6-20位新密码'
maxLength={20} maxLength={20}
value={pwd} value={pwd}
onInput={({ detail: { value } }) => { onInput={({ detail: { value } }) =>
this.setState({ this.setPwdValue('pwd', value)
pwd: value, }
});
return value;
}}
/> />
<Image <Image
className='registerBox-pwdIcon' className='registerBox-pwdIcon'
...@@ -183,12 +196,9 @@ class ResetPwd extends Component { ...@@ -183,12 +196,9 @@ class ResetPwd extends Component {
placeholder='确认6-20位新密码' placeholder='确认6-20位新密码'
maxLength={20} maxLength={20}
value={checkPwd} value={checkPwd}
onInput={({ detail: { value } }) => { onInput={({ detail: { value } }) =>
this.setState({ this.setPwdValue('checkPwd', value)
checkPwd: value, }
});
return value;
}}
/> />
<Image <Image
className='registerBox-pwdIcon' className='registerBox-pwdIcon'
......
...@@ -88,4 +88,7 @@ ...@@ -88,4 +88,7 @@
border-bottom: 2px solid #ebebeb; border-bottom: 2px solid #ebebeb;
word-break: break-all; word-break: break-all;
} }
.locationItem:last-child {
border-bottom: none;
}
} }
...@@ -5,17 +5,11 @@ import { connect } from '@tarojs/redux'; ...@@ -5,17 +5,11 @@ import { connect } from '@tarojs/redux';
import { View, Text, Input, Image, ScrollView } from '@tarojs/components'; import { View, Text, Input, Image, ScrollView } from '@tarojs/components';
import SearchIcon from '../../images/login/icon_search@2x.png'; import SearchIcon from '../../images/login/icon_search@2x.png';
import { fetchAllArea } from '../../api/area'; import { fetchAllArea, Area } from '../../api/area';
import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo'; import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo';
import './SelectCampus.scss'; import './SelectCampus.scss';
type Area = {
id: number;
areaName: string;
initial?: string;
};
type AreaList = Array<{ type AreaList = Array<{
firstPin: string; firstPin: string;
children: Array<Area>; children: Array<Area>;
...@@ -80,6 +74,34 @@ class SelectCampus extends Component { ...@@ -80,6 +74,34 @@ class SelectCampus extends Component {
fetchAllArea() fetchAllArea()
.then(res => { .then(res => {
console.log(res); console.log(res);
let initialList = [
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
];
let campusIndexArr: Array<string> = []; let campusIndexArr: Array<string> = [];
let campusList: AreaList = []; let campusList: AreaList = [];
res.data.map((area: Area) => { res.data.map((area: Area) => {
...@@ -89,11 +111,12 @@ class SelectCampus extends Component { ...@@ -89,11 +111,12 @@ class SelectCampus extends Component {
if (index > -1) { if (index > -1) {
campusList[index].children.push(area); campusList[index].children.push(area);
} else { } else {
campusIndexArr.push(firstPin); let index = initialList.indexOf(firstPin);
campusList.push({ campusIndexArr[index] = firstPin;
campusList[index] = {
firstPin: firstPin, firstPin: firstPin,
children: [area], children: [area],
}); };
} }
} }
}); });
...@@ -190,14 +213,16 @@ class SelectCampus extends Component { ...@@ -190,14 +213,16 @@ class SelectCampus extends Component {
</View> </View>
</View> </View>
<View className='infoBar'> <View className='infoBar'>
{pinList.map(item => ( {pinList.map(item =>
<View item ? (
key={item} <View
className='infoItem' key={item}
onClick={() => this.showToastHandle(item)}> className='infoItem'
{item} onClick={() => this.showToastHandle(item)}>
</View> {item}
))} </View>
) : null,
)}
</View> </View>
<View className={showToast ? 'show br8 infoToast' : 'br8 infoToast'}> <View className={showToast ? 'show br8 infoToast' : 'br8 infoToast'}>
{localText} {localText}
...@@ -207,22 +232,24 @@ class SelectCampus extends Component { ...@@ -207,22 +232,24 @@ class SelectCampus extends Component {
className='locationList' className='locationList'
scrollIntoView={localText} scrollIntoView={localText}
scrollWithAnimation> scrollWithAnimation>
{filterList.map(campusItem => ( {filterList.map(campusItem =>
<View key={campusItem.firstPin} className='locationArea'> campusItem ? (
<View id={campusItem.firstPin} className='locationTitle'> <View key={campusItem.firstPin} className='locationArea'>
{campusItem.firstPin} <View id={campusItem.firstPin} className='locationTitle'>
</View> {campusItem.firstPin}
{campusItem.children.map(campus => (
<View
key={campus.id}
className='locationItem'
data-campus={campus}
onClick={this.bindCampus}>
{campus.areaName}
</View> </View>
))} {campusItem.children.map(campus => (
</View> <View
))} key={campus.id}
className='locationItem'
data-campus={campus}
onClick={this.bindCampus}>
{campus.areaName}
</View>
))}
</View>
) : null,
)}
</ScrollView> </ScrollView>
</View> </View>
); );
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
font-size: 32px; font-size: 32px;
color: #333; color: #333;
} }
.UserSetting-placeholder,
.UserSetting-ContentItem.Disabled { .UserSetting-ContentItem.Disabled {
color: #999; color: #999;
} }
......
...@@ -11,14 +11,23 @@ import radioIcon from '../../images/login/pc_nor_icon@2x.png'; ...@@ -11,14 +11,23 @@ import radioIcon from '../../images/login/pc_nor_icon@2x.png';
import radioCheckIcon from '../../images/login/pc_sel_icon@2x.png'; import radioCheckIcon from '../../images/login/pc_sel_icon@2x.png';
import './UserSetting.scss'; import './UserSetting.scss';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo'; import { updateUserInfo } from '../../store/rootReducers/userinfo';
import { perfectionUserInfo } from '../../api/customer'; import { perfectionUserInfo } from '../../api/customer';
import { Customer } from '../../types/Customer/Customer';
type UpdateParams = {
customerId: number;
customerName: string;
customerSex: string;
birthDay: string;
studentNo: string;
entranceDate: string;
};
type PageStateProps = { type PageStateProps = {
userinfo: UserState; userinfo: Customer;
}; };
type PageDispatchProps = { type PageDispatchProps = {
updateUserInfo: (e: UserState) => void; updateUserInfo: (e: UpdateParams) => void;
}; };
type PageOwnProps = {}; type PageOwnProps = {};
type PageState = { type PageState = {
...@@ -40,10 +49,10 @@ interface UserSetting { ...@@ -40,10 +49,10 @@ interface UserSetting {
userinfo, userinfo,
}), }),
dispatch => ({ dispatch => ({
updateUserInfo(entity: UserState) { updateUserInfo(entity: UpdateParams) {
dispatch(updateUserInfo(entity)); dispatch(updateUserInfo(entity));
}, },
}) }),
) )
class UserSetting extends Component { class UserSetting extends Component {
config: Config = { config: Config = {
...@@ -63,12 +72,12 @@ class UserSetting extends Component { ...@@ -63,12 +72,12 @@ class UserSetting extends Component {
}, },
} = props; } = props;
this.state = { this.state = {
birthDay: birthDay, birthDay: birthDay ? birthDay.split(' ')[0] : '',
customerHead: customerHead, customerHead: customerHead ? customerHead : '',
customerName: customerName, customerName: customerName ? customerName : '',
customerSex: customerSex, customerSex: customerSex ? customerSex : '',
entranceDate: entranceDate, entranceDate: entranceDate ? entranceDate.split(' ')[0] : '',
studentNo: studentNo, studentNo: studentNo ? studentNo : '',
}; };
} }
...@@ -171,8 +180,7 @@ class UserSetting extends Component { ...@@ -171,8 +180,7 @@ class UserSetting extends Component {
this.setState({ this.setState({
customerSex: '2', customerSex: '2',
}) })
} }>
>
{customerSex === '2' ? ( {customerSex === '2' ? (
<Image className='sexBox-icon' src={radioCheckIcon} /> <Image className='sexBox-icon' src={radioCheckIcon} />
) : ( ) : (
...@@ -186,8 +194,7 @@ class UserSetting extends Component { ...@@ -186,8 +194,7 @@ class UserSetting extends Component {
this.setState({ this.setState({
customerSex: '1', customerSex: '1',
}) })
} }>
>
{customerSex === '1' ? ( {customerSex === '1' ? (
<Image className='sexBox-icon' src={radioCheckIcon} /> <Image className='sexBox-icon' src={radioCheckIcon} />
) : ( ) : (
...@@ -206,9 +213,14 @@ class UserSetting extends Component { ...@@ -206,9 +213,14 @@ class UserSetting extends Component {
this.setState({ this.setState({
birthDay: value, birthDay: value,
}) })
} }>
> {birthDay ? (
<View>{birthDay}</View> <View>{birthDay}</View>
) : (
<View className='UserSetting-placeholder'>
{'请选择出生日期'}
</View>
)}
</Picker> </Picker>
</View> </View>
<View className='UserSetting-ContentItem Disabled'> <View className='UserSetting-ContentItem Disabled'>
...@@ -233,6 +245,8 @@ class UserSetting extends Component { ...@@ -233,6 +245,8 @@ class UserSetting extends Component {
<Input <Input
className='UserSetting-ContentItem-input' className='UserSetting-ContentItem-input'
value={studentNo} value={studentNo}
placeholderClass='UserSetting-placeholder'
placeholder='请输入学号'
onInput={({ detail: { value } }) => { onInput={({ detail: { value } }) => {
this.setState({ this.setState({
studentNo: value.trim(), studentNo: value.trim(),
...@@ -250,9 +264,14 @@ class UserSetting extends Component { ...@@ -250,9 +264,14 @@ class UserSetting extends Component {
this.setState({ this.setState({
entranceDate: value, entranceDate: value,
}) })
} }>
> {entranceDate ? (
<View>{entranceDate}</View> <View>{entranceDate}</View>
) : (
<View className='UserSetting-placeholder'>
{'请选择入学日期'}
</View>
)}
</Picker> </Picker>
</View> </View>
</View> </View>
......
import { Component } from '@tarojs/taro';
import { ComponentClass } from 'react';
import { WebView } from '@tarojs/components';
type PageState = {
linkUrl: string;
};
interface WebPage {
state: PageState;
}
class WebPage extends Component {
constructor(props) {
super(props);
this.state = {
linkUrl: '',
};
}
componentWillMount() {
console.log(this.$router.params);
const { url } = this.$router.params;
if (url) {
this.setState({
linkUrl: url,
});
}
}
render() {
const { linkUrl } = this.state;
return linkUrl && <WebView src={linkUrl} />;
}
}
export default WebPage as ComponentClass<any, PageState>;
...@@ -3,7 +3,6 @@ import Taro, { Component, Config } from '@tarojs/taro'; ...@@ -3,7 +3,6 @@ import Taro, { Component, Config } from '@tarojs/taro';
import { View } from '@tarojs/components'; import { View } from '@tarojs/components';
import './index.scss'; import './index.scss';
import { LoginReponse } from '../../api/wx';
import { connect } from '@tarojs/redux'; import { connect } from '@tarojs/redux';
import { updateUserInfo, UserState } from '../../store/rootReducers/userinfo'; import { updateUserInfo, UserState } from '../../store/rootReducers/userinfo';
...@@ -67,35 +66,25 @@ class Index extends Component { ...@@ -67,35 +66,25 @@ class Index extends Component {
Taro.login() Taro.login()
.then(res => { .then(res => {
console.log(res); console.log(res);
const code = res.code;
updateUserInfo({
code,
});
appLogin({ appLogin({
code: res.code, code: res.code,
}) })
.then((res: LoginReponse) => { .then(res => {
const { register, wxToken, ...userInfo } = res.data; const data = res.data;
console.log(wxToken); updateUserInfo(data);
Taro.redirectTo({
if (register) { url: '/pages/Home/Home',
updateUserInfo({ });
...userInfo,
token: wxToken,
});
Taro.redirectTo({
url: '/pages/Home/Home',
});
} else {
updateUserInfo({
token: wxToken,
});
Taro.hideLoading();
Taro.redirectTo({
url: '/pages/Login/Login',
});
}
}) })
.catch(err => { .catch(err => {
console.log(err); console.log(err);
this.setState({ Taro.hideLoading();
errorText: err.msg, Taro.redirectTo({
url: '/pages/Login/Login',
}); });
}); });
}) })
......
...@@ -3,8 +3,9 @@ import thunkMiddleware from 'redux-thunk'; ...@@ -3,8 +3,9 @@ import thunkMiddleware from 'redux-thunk';
import rootReducer from './reducers'; import rootReducer from './reducers';
const composeEnhancers = const composeEnhancers =
typeof window === 'object' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ typeof window === 'object' &&
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? (window as any).__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
// Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize... // Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
}) })
: compose; : compose;
......
type INITIAL_STATE = { type ConstantState = {
APP_ID: string; APP_ID: string;
}; };
const INITIAL_STATE = { const INITIAL_STATE = {
APP_ID: 'wxf5912b79bba23663', APP_ID: 'wxf5912b79bba23663',
}; };
export default function counter(state = INITIAL_STATE) { export default function counter(state: ConstantState = INITIAL_STATE) {
return state; return state;
} }
import Action from '../../types/Store/Actions'; import Action from '../../types/Store/Actions';
import { Customer } from '../../types/Customer/Customer';
export class UserState { export type UserState = StoreState<Customer & { code: string }>;
login?: boolean;
areaId: number;
areaName?: string;
birthDay?: string;
createAt?: string;
createLoginDate?: string;
customerHead?: string;
customerId: number;
customerName?: string;
customerPhone?: string;
customerSex?: string;
customerType?: string;
email?: string;
entranceDate?: string;
hardwareAccount?: string;
hardwarePwd?: string;
hardwareState?: string;
hardwarelastDate?: string;
idBar: string;
idCard?: string;
isFirstRecharge?: number;
lastLoginDate?: string;
loginAccount?: string;
loginPwd?: string;
loginPwdSalt?: string;
loginState?: string;
state?: string;
studentNo?: string;
token?: string;
updateAt?: string;
updateLoginDate?: string;
version?: string;
}
const INITIAL_STATE = { export const INITIAL_STATE = {
login: false, code: '',
areaId: undefined, areaId: 0,
areaName: '', areaName: '',
birthDay: '', birthDay: '',
createAt: '', createAt: '',
createLoginDate: '', createLoginDate: '',
customerHead: '', customerHead: '',
customerId: undefined, customerId: 0,
customerName: '', customerName: '',
customerPhone: '', customerPhone: '',
customerSex: '', customerSex: '',
...@@ -56,7 +24,7 @@ const INITIAL_STATE = { ...@@ -56,7 +24,7 @@ const INITIAL_STATE = {
hardwarelastDate: '', hardwarelastDate: '',
idBar: '', idBar: '',
idCard: '', idCard: '',
isFirstRecharge: undefined, isFirstRecharge: 0,
lastLoginDate: '', lastLoginDate: '',
loginAccount: '', loginAccount: '',
loginPwd: '', loginPwd: '',
...@@ -76,9 +44,9 @@ export const updateUserInfo = (entity: UserState): Action => ({ ...@@ -76,9 +44,9 @@ export const updateUserInfo = (entity: UserState): Action => ({
}); });
export default function userinfo( export default function userinfo(
state: UserState = INITIAL_STATE, state: Customer = INITIAL_STATE,
actions: Action, actions: Action,
): UserState { ): Customer {
switch (actions.type) { switch (actions.type) {
case 'UPDATE_USERINFO': case 'UPDATE_USERINFO':
return { return {
......
export type Customer = {
areaId: number;
areaName: string;
birthDay: string;
createAt: string;
createLoginDate: string;
customerHead: string;
customerId: number;
customerName: string;
customerPhone: string;
customerSex: string;
customerType: string;
email: string;
entranceDate: string;
hardwareAccount: string;
hardwarePwd: string;
hardwareState: string;
hardwarelastDate: string;
idBar: string;
idCard: string;
isFirstRecharge: number;
lastLoginDate: string;
loginAccount: string;
loginPwd: string;
loginPwdSalt: string;
loginState: string;
state: string;
studentNo: string;
token: string;
updateAt: string;
updateLoginDate: string;
version: string;
};
...@@ -15,6 +15,7 @@ type Order = { ...@@ -15,6 +15,7 @@ type Order = {
operateId: number; operateId: number;
operateName: string; operateName: string;
operationMode: string; operationMode: string;
orderName: string;
orderNumber: string; orderNumber: string;
orderState: string; orderState: string;
outTradeNo: string; outTradeNo: string;
......
type StoreState<T> = { [P in keyof T]?: T[P] };
export const replaceIllegalPwd = (val: string) =>
val.replace(/[^a-zA-Z0-9]+/g, '');
...@@ -15,16 +15,14 @@ ...@@ -15,16 +15,14 @@
"sourceMap": true, "sourceMap": true,
"baseUrl": ".", "baseUrl": ".",
"rootDir": ".", "rootDir": ".",
"paths": {
"@/*": ["./src/*"]
},
"jsx": "preserve", "jsx": "preserve",
"jsxFactory": "Taro.createElement", "jsxFactory": "Taro.createElement",
"allowJs": true, "allowJs": true,
"typeRoots": [ "typeRoots": ["node_modules/@types"]
"node_modules/@types"
]
}, },
"exclude": [ "exclude": ["node_modules", "dist"],
"node_modules",
"dist"
],
"compileOnSave": false "compileOnSave": false
} }
...@@ -2003,6 +2003,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: ...@@ -2003,6 +2003,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
sha.js "^2.4.8" sha.js "^2.4.8"
cross-env@^5.2.0:
version "5.2.0"
resolved "http://registry.npm.taobao.org/cross-env/download/cross-env-5.2.0.tgz#6ecd4c015d5773e614039ee529076669b9d126f2"
dependencies:
cross-spawn "^6.0.5"
is-windows "^1.0.0"
cross-spawn@^3.0.0: cross-spawn@^3.0.0:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
...@@ -2018,7 +2025,7 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0: ...@@ -2018,7 +2025,7 @@ cross-spawn@^5.0.1, cross-spawn@^5.1.0:
shebang-command "^1.2.0" shebang-command "^1.2.0"
which "^1.2.9" which "^1.2.9"
cross-spawn@^6.0.0: cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5" version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
dependencies: dependencies:
...@@ -3868,7 +3875,7 @@ is-utf8@^0.2.0: ...@@ -3868,7 +3875,7 @@ is-utf8@^0.2.0:
version "0.2.1" version "0.2.1"
resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72"
is-windows@^1.0.2: is-windows@^1.0.0, is-windows@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment