Commit ab50e845 by 姜雷

添加分享方式

parent 258c8a14
type ShareEntity = {
title: string;
path: string;
imageUrl: string;
};
import shareImg from '../images/icon/shareImg.png';
export const shareHandle = (): ShareEntity => {
return {
title: '多彩生活服务',
path: '/pages/index/index',
imageUrl: shareImg,
};
};
......@@ -8,6 +8,7 @@ import { connect } from '@tarojs/redux';
import './Announcement.scss';
import { Customer } from '@/types/Customer/Customer';
import { shareHandle } from '@/common/shareMethod';
type PageStateProps = {
userinfo: Customer;
......@@ -38,6 +39,8 @@ class Announcement extends Component {
linkUrl: '',
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
const { userinfo } = this.props;
const { sectionId } = this.$router.params;
......
......@@ -21,6 +21,7 @@ import {
import { Customer } from '../../types/Customer/Customer';
import { refreshCodeBar } from '../../api/customer';
import Order from '@/types/Order/Order';
import { shareHandle } from '@/common/shareMethod';
type PageStateProps = {
userinfo: Customer;
......@@ -123,6 +124,7 @@ class BarCode extends Component {
},
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
const { userinfo } = this.props;
......
......@@ -3,6 +3,7 @@ import { ComponentClass } from 'react';
import { WebView } from '@tarojs/components';
import { connect } from '@tarojs/redux';
import { ANN_LINK_URL } from '../../constants';
import { shareHandle } from '@/common/shareMethod';
type PageOwnProps = {
token: string;
......@@ -27,6 +28,7 @@ class Content extends Component {
};
this.getLinkUrl();
}
onShareAppMessage = shareHandle;
getLinkUrl() {
const { token } = this.props;
......
......@@ -5,6 +5,7 @@ import { fetchFeedback } from '../../api/customer';
import { connect } from '@tarojs/redux';
import './Feedback.scss';
import { shareHandle } from '@/common/shareMethod';
type PageProps = {
areaId: number;
......@@ -38,6 +39,7 @@ class Feedback extends Component<PageProps, PageState> {
feedbackContent: '',
};
}
onShareAppMessage = shareHandle;
feedbackHandle() {
Taro.showLoading();
......
......@@ -25,6 +25,7 @@ import { fetchBeanCount } from '../../api/bean';
import { fetchAnn, SectionItem } from '../../api/announcement';
import { appLogout } from '../../api/customer';
import { Customer } from '@/types/Customer/Customer';
import { shareHandle } from '@/common/shareMethod';
type PageStateProps = {
userinfo: Customer;
......@@ -77,6 +78,8 @@ class Home extends Component {
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
this.getInitData();
}
......
......@@ -7,6 +7,7 @@ import { appLogin } from '../../api/customer';
import { connect } from '@tarojs/redux';
import { updateUserInfo, UserState } from '../../store/rootReducers/userinfo';
import { NotRegisterCode } from '../../constants/index';
import { shareHandle } from '@/common/shareMethod';
type PageDispatchProps = {
userinfo: UserState;
......@@ -45,6 +46,7 @@ class Login extends Component {
pwd: '',
};
}
onShareAppMessage = shareHandle;
validataLoginData(): boolean {
const { account, pwd } = this.state;
......
......@@ -8,6 +8,7 @@ import OrderInfo from '../components/OrderInfo/OrderInfo';
import './OrderDetail.scss';
import { fetchOrderDetailAndPay } from '../../../api/order';
import { PayType, getPayType } from '../../../utils/payType';
import { shareHandle } from '@/common/shareMethod';
type pageProps = {};
type PageState = {
......@@ -80,6 +81,7 @@ class OrderDetail extends Component {
updateDate: '',
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
console.log('preload: ', this.$router.preload);
......
......@@ -17,6 +17,7 @@ import { StoreState } from './store';
import { fetchAllOrder, fetchPayOrder } from '../../../api/order';
import Order, { AllOrderItem } from '../../../types/Order/Order';
import { Customer } from '@/types/Customer/Customer';
import { shareHandle } from '@/common/shareMethod';
type PageStateProps = {
orderList: StoreState;
......@@ -69,6 +70,7 @@ class OrderList extends Component {
needRefresh: false,
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
this.getPayOrderHandle();
......
......@@ -15,6 +15,7 @@ import { connect } from '@tarojs/redux';
import OrderPayway from '../components/OrderPayway/OrderPayway';
import Order from '@/types/Order/Order';
import { Customer } from '@/types/Customer/Customer';
import { shareHandle } from '@/common/shareMethod';
type PageStateProps = {
userinfo: Customer;
......@@ -82,6 +83,7 @@ class OrderPay extends Component {
},
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
const data = this.$router.preload;
......
......@@ -20,6 +20,7 @@ import { wxUserRegister } from '../../api/customer';
import { replaceIllegalPwd } from '../../utils/pwd';
import { Customer } from '@/types/Customer/Customer';
import { ANN_LINK_URL } from '@/constants';
import { shareHandle } from '@/common/shareMethod';
type PageStateProps = {
userinfo: Customer;
......@@ -78,6 +79,7 @@ class Register extends Component {
showCheckPwd: false,
};
}
onShareAppMessage = shareHandle;
setSex(value: string) {
this.setState({
......
......@@ -9,6 +9,7 @@ import ToastBox from '../../components/ToastBox/ToastBox';
import './ResetPwd.scss';
import { changePwdByCellphone } from '../../api/customer';
import { replaceIllegalPwd } from '../../utils/pwd';
import { shareHandle } from '@/common/shareMethod';
type PageOwnProps = {};
type PageState = {
......@@ -40,6 +41,7 @@ class ResetPwd extends Component {
showCheckPwd: false,
};
}
onShareAppMessage = shareHandle;
setPwdValue(key: string, value: string) {
let val = replaceIllegalPwd(value);
......
......@@ -9,6 +9,7 @@ import { fetchAllArea, Area } from '../../api/area';
import { UserState, updateUserInfo } from '../../store/rootReducers/userinfo';
import './SelectCampus.scss';
import { shareHandle } from '@/common/shareMethod';
type AreaList = Array<{
firstPin: string;
......@@ -65,6 +66,7 @@ class SelectCampus extends Component {
timer: undefined,
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
this.getList();
......
......@@ -14,6 +14,7 @@ import { connect } from '@tarojs/redux';
import { updateUserInfo } from '../../store/rootReducers/userinfo';
import { perfectionUserInfo } from '../../api/customer';
import { Customer } from '../../types/Customer/Customer';
import { shareHandle } from '@/common/shareMethod';
type UpdateParams = {
customerId: number;
......@@ -80,6 +81,7 @@ class UserSetting extends Component {
studentNo: studentNo ? studentNo : '',
};
}
onShareAppMessage = shareHandle;
validateSaveForm(): boolean {
const { customerName } = this.state;
......
import { Component } from '@tarojs/taro';
import { ComponentClass } from 'react';
import { WebView } from '@tarojs/components';
import { shareHandle } from '@/common/shareMethod';
type PageState = {
linkUrl: string;
......@@ -17,6 +18,7 @@ class WebPage extends Component {
linkUrl: '',
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
console.log(this.$router.params);
......
......@@ -7,6 +7,7 @@ import { connect } from '@tarojs/redux';
import { updateUserInfo, UserState } from '../../store/rootReducers/userinfo';
import { appLogin } from '../../api/customer';
import { shareHandle } from '@/common/shareMethod';
type PageDispatchProps = {
updateUserInfo: (e: UserState | { token: string }) => void;
......@@ -42,6 +43,7 @@ class Index extends Component {
errorText: '',
};
}
onShareAppMessage = shareHandle;
componentWillMount() {
Taro.showLoading();
......
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