<!--pages/personalCenter/personalCenter.wxml-->
<view class="all">
  <image class="centerBg" src="../images/centerBg.png"></image>
  <view class="userMess">
    <image class="userCircle" src="../images/userCircle.png"></image>
    <view class="userAll">
      <view class="userHeader">
        <image class="userImg" src="{{getUserArr.avatarUrl}}"></image>
      </view>
      <button wx:if="{{!getUser}}" plain="true" size="mini" class="getUser" open-type="getUserInfo" bindgetuserinfo="getUser">登陆</button>
      <view class="userName">{{getUserArr.nickName}}</view>
      <view wx:if="{{getUser}}" class="userPhone">12345678910</view>
    </view>

    <view class="myTicketAll">
      <view class="myTicketTop" bindtap="lookMyTicket">
        <image class="ticketIcon" src="../images/ticketIcon.png"></image>
        <view class="myTicket">我的优惠券</view>
        <image style="transform:rotate({{mydeg}}deg)" class="ticketArrows" src="../images/ticketArrows.png"></image>
      </view>

      <scroll-view class="scrollY1" scroll-y="true" wx:if="{{myTicketArrows}}" bindscrolltolower="lower">
        <view class="contAll" wx:for="{{myTicketArr}}">
          <view class="ticketCont"  bindtap="lookTicket" data-id = "{{item.coupon_sell_id}}">
            <view class="ticketImg">
              <image class="ticketImg" src="{{item.coupon_img_small}}"></image>
            </view>
            <view class="rigWord">
              <view class="name">{{item.coupon_name}}</view>
              <view class="time">{{item.coupon_memo}}</view>
              <view class="time">(有效期：{{item.end_date}}）</view>
            </view>
          </view>
          <view class="look">
            <!-- <view bindtap="lookTicket" data-index = "{{index}}" class="clickLook">点击查看券码</view> -->
            <image bindtap="giveTicket" class="giveFrinedBtn" data-id = "{{item.coupon_sell_id}}" src="../images/giveFrinedBtn.png"></image>
          </view>
        </view>
      </scroll-view>

      <view class="myTicketTop" style="margin-top:81rpx;" bindtap="lookHistory">
        <image class="historyIcon" src="../images/historyIcon.png"></image>
        <view class="myTicket" style="margin-left:-310rpx;">优惠券使用记录</view>
        <image class="ticketArrows" src="../images/ticketArrows.png" style="transform:rotate({{historydeg}}deg)"></image>
      </view>

      <scroll-view class="scrollY2" scroll-y="true"  wx:if="{{historyTicketArrows}}">
        <view class="history" wx:for="{{historyArr}}">
          <view class="historyLeft">
            <image class="historyTicketBg" src="../images/historyTicketBg.png"></image>
            <view class="ticketCode">券码：{{item.coupon_sell_id}}</view>
          </view>
          <view class="tickName">{{item.coupon_type}}</view>
          <view class="tickType">已使用</view>
        </view>
      </scroll-view>
    </view>
  </view>
</view>
