<script setup lang="ts">
import {appMembershipConfigGet} from "@/service";

const { t } = useI18n();
function handleClickLeft() {
  uni.navigateBack();
}

// 订阅
function handleSubscribe() {
  uni.navigateTo({
    url: '/pages-user/pages/member/index'
  })
}
// 暂时跳过
function handleSkip() {
  uni.navigateTo({
    url: "/pages-user/pages/member-center/choose-like",
  });
}

const membershipConfig = ref({});
onLoad(()=> {
  appMembershipConfigGet({}).then(res=> {
    console.log(res)
    membershipConfig.value = res.data;
  })
})
</script>

<template>
  <view>
    <wd-navbar
      safeAreaInsetTop
      :fixed="true"
      :placeholder="false"
      :bordered="false"
      custom-class="!bg-transparent"
      @click-left="handleClickLeft"
    >
    </wd-navbar>
    <image :src="membershipConfig?.centerTopImage" mode="aspectFill" class="w-full h-1762rpx" />
<!--    <view class="px-30rpx py-37rpx">-->
<!--      <image src="@img/ls/2.png" class="w-full h-1121rpx" />-->
<!--    </view>-->
    <view class="px-30rpx pb-37rpx">
      <wd-button
        custom-class="!h-108rpx !text-30rpx !rounded-16rpx"
        block
        @click="handleSubscribe"
      >
        {{ t('pages-user.member-center.subscribe') }}
      </wd-button>
    </view>
    <view class="h-20rpx bg-#F6F6F6"></view>
    <view class="px-30rpx pb-82rpx pt-42rpx">
<!--      <view class="text-48rpx lh-48rpx text-#333 font-500">-->
<!--        {{ t('pages-user.member-center.notCurrentlyTrying') }}-->
<!--      </view>-->
<!--      <view class="mt-36rpx mb-42rpx flex items-center">-->
<!--        <image src="@img/chef/100221.png" class="w-98rpx h-98rpx shrink-0 rounded-full" />-->
<!--        <view class="text-26rpx lh-26rpx text-#333 font-400 ml-30rpx">-->
<!--            {{ t('pages-user.member-center.youWillMissOut') }}-->
<!--        </view>-->
<!--      </view>-->
      <image :src="membershipConfig?.centerBottomImage" class="w-full h-200rpx" />
      <wd-button
        custom-class="!h-108rpx !text-#333 !text-30rpx !bg-#D8D8D8 !rounded-16rpx mt-46rpx"
        block
        @click="handleSkip"
      >
        {{ t('pages-user.member-center.temporarilySkip') }}
      </wd-button>
    </view>
  </view>
</template>

<style lang="scss" scoped>
page {
  background-color: #fff;
}
</style>
