This commit is contained in:
郑茂强 2019-02-13 11:19:18 +08:00
parent 2887be11e9
commit 0df437e7bc
3 changed files with 9 additions and 8 deletions

View File

@ -98,6 +98,10 @@ class VoucherPoster extends Component {
this.props.onPassDataToChild(false)
}
componentWillReceiveProps(nextProps) {
this.setState({
voucherName: nextProps.userName,
voucherPhone: nextProps.userPhone,
})
}
componentDidMount() {
@ -111,9 +115,6 @@ class VoucherPoster extends Component {
componentDidHide() { }
render() {
return (
<View className='voucherEventPopUpComponent'>
{/* <!-- The Modal --> */}

View File

@ -1,6 +1,6 @@
//const LOCALURL = "http://192.168.1.230/"
const LOCALURL = "https://www.ihome6.com/"
const LOCALURL = "http://192.168.1.230/"
//const LOCALURL = "https://www.ihome6.com/"
const URL = {
Base: LOCALURL,
Login: LOCALURL + 'Applet-login', //登入接口

View File

@ -31,7 +31,7 @@ export default function login() {
success(res) {
if (res.code) {
// 发起网络请求
// console.log('手机端微信code',res.code)
console.log('手机端微信code',res.code)
Taro.request({
url: URL.Login,
method: 'POST',
@ -44,14 +44,14 @@ export default function login() {
}
})
.then(response => {
if (response.data.err_code === 888) {
if (response.data.err_code === 0) {
console.log('微信登入成功', response)
Taro.showToast({
title: '微信登入成功',
icon: 'success',
duration: 2000
})
Taro.setStorageSync('session_id', response.data.session_id)
Taro.setStorageSync('session_id', response.data.session_id)
Taro.setStorageSync('shopInfo', response.data.shop_info)
Taro.setStorageSync('userInfo', response.data.user_info)
setUserInfoToStorage()