<!-- pages/course/applyPromotion/applyPromotion.wxml -->
<view class="flex-col page">
  <view class="flex-col items-center group">
    <!-- 生成推广码按钮，文字垂直居中，点击触发 handleGenerate -->
    <view class="flex-col justify-center items-center text-wrapper" bindtap="handleGenerate">
      <text class="font text">{{buttonText}}</text>
    </view>

    <!-- 只有当 showCode 为 true 时才显示推广码图片 -->
    <image
      wx:if="{{showCode}}"
      class="mt-12 image"
      src="{{codeImageUrl}}"
    />

    <!-- 只有当 showCode 为 true 时才显示保存图片按钮，且垂直居中 -->
    <view
      wx:if="{{showCode}}"
      class="mt-12 flex-col justify-center items-center text-wrapper_2"
      bindtap="saveImage"
    >
      <text class="font">保存图片</text>
    </view>
  </view>

  <view class="flex-col section">
    <view class="flex-row items-center group_2">
      <image
        class="image_2"
        src="./image/wenhao.png"
      />
      <text class="ml-6 font text_2">推广码说明</text>
    </view>
    <view class="section_2"></view>
  </view>
</view>
