no message

This commit is contained in:
bentz
2019-03-22 11:08:08 +08:00
parent c8bc3014b7
commit 9a271666cb
4 changed files with 13 additions and 5 deletions

View File

@@ -49,6 +49,11 @@ export default class AddressPicker extends Component {
}
changeSelection (params = {}) {
if (!params || !params.address_id) {
this.props.onChange(null)
return
}
const { address_id } = params
const { list } = this.state
const address = find(list, addr => address_id ? address_id === addr.address_id : addr.def_addr > 0) || list[0] || null

View File

@@ -28,8 +28,6 @@ export default function withBackToTop (Component) {
const { scrollTop, scrollHeight } = e.detail
const offset = 300
console.log(scrollTop)
this.setState({
scrollTop
})

View File

@@ -192,6 +192,11 @@ export default class CartCheckout extends Component {
}
handleAddressChange = (address) => {
if (!address) {
this.toggleAddressPicker(true)
return
}
address = pickBy(address, {
state: 'province',
city: 'city',
@@ -257,7 +262,7 @@ export default class CartCheckout extends Component {
handlePay = async () => {
if (!this.state.address) {
return S.notify('请选择地址')
return S.toast('请选择地址')
}
Taro.showLoading({
@@ -300,6 +305,7 @@ export default class CartCheckout extends Component {
: coupon.type === 'member'
? '会员折扣'
: ((coupon.value && coupon.value.title) || '')
const isBtnDisabled = !address || !address.address.addr_id
return (
<View className='page-checkout'>
@@ -513,6 +519,7 @@ export default class CartCheckout extends Component {
circle
type='primary'
className='btn-confirm-order'
disabled={isBtnDisabled}
onClick={this.handlePay}
>提交订单</AtButton>
</View>

View File

@@ -2,8 +2,6 @@ import Taro from '@tarojs/taro'
import { WGTS_NAV_MAP } from '@/consts'
export function linkPage (type, id) {
console.log(type, id)
debugger
let url = ''
switch (type) {