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