dev v1
This commit is contained in:
parent
2887be11e9
commit
0df437e7bc
@ -98,6 +98,10 @@ class VoucherPoster extends Component {
|
|||||||
this.props.onPassDataToChild(false)
|
this.props.onPassDataToChild(false)
|
||||||
}
|
}
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
this.setState({
|
||||||
|
voucherName: nextProps.userName,
|
||||||
|
voucherPhone: nextProps.userPhone,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
|
||||||
@ -111,9 +115,6 @@ class VoucherPoster extends Component {
|
|||||||
componentDidHide() { }
|
componentDidHide() { }
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View className='voucherEventPopUpComponent'>
|
<View className='voucherEventPopUpComponent'>
|
||||||
{/* <!-- The Modal --> */}
|
{/* <!-- The Modal --> */}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
//const LOCALURL = "http://192.168.1.230/"
|
const LOCALURL = "http://192.168.1.230/"
|
||||||
const LOCALURL = "https://www.ihome6.com/"
|
//const LOCALURL = "https://www.ihome6.com/"
|
||||||
const URL = {
|
const URL = {
|
||||||
Base: LOCALURL,
|
Base: LOCALURL,
|
||||||
Login: LOCALURL + 'Applet-login', //登入接口
|
Login: LOCALURL + 'Applet-login', //登入接口
|
||||||
|
@ -31,7 +31,7 @@ export default function login() {
|
|||||||
success(res) {
|
success(res) {
|
||||||
if (res.code) {
|
if (res.code) {
|
||||||
// 发起网络请求
|
// 发起网络请求
|
||||||
// console.log('手机端微信code:',res.code)
|
console.log('手机端微信code:',res.code)
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: URL.Login,
|
url: URL.Login,
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -44,14 +44,14 @@ export default function login() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (response.data.err_code === 888) {
|
if (response.data.err_code === 0) {
|
||||||
console.log('微信登入成功', response)
|
console.log('微信登入成功', response)
|
||||||
Taro.showToast({
|
Taro.showToast({
|
||||||
title: '微信登入成功',
|
title: '微信登入成功',
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
duration: 2000
|
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('shopInfo', response.data.shop_info)
|
||||||
Taro.setStorageSync('userInfo', response.data.user_info)
|
Taro.setStorageSync('userInfo', response.data.user_info)
|
||||||
setUserInfoToStorage()
|
setUserInfoToStorage()
|
||||||
|
Loading…
Reference in New Issue
Block a user