<view class="page">
  <view class="row">
    <button bindtap="doLogin" disabled="{{logging}}">{{ logging ? '登录中...' : '登录' }}</button>
  </view>
  <view class="row">
    <input placeholder="输入订单号" value="{{orderNo}}" bindinput="onOrderNoInput" />
  </view>
  <view class="row">
    <button bindtap="doPay" disabled="{{paying || !token}}">{{ paying ? '发起中...' : '发起支付' }}</button>
  </view>
  <view class="row">
    <button bindtap="doCreateOrder" disabled="{{!token}}">生成订单号</button>
  </view>
  <view class="info">openid: {{openid}}</view>
  <view class="info">token: {{token ? '已获取' : '未登录'}}</view>
  <view class="info">昵称: {{nickname}}</view>
  <image wx:if="{{avatar}}" src="{{avatar}}" mode="aspectFit" style="width: 80px; height: 80px;" />
</view>