mirror of
				https://github.com/yangjian102621/geekai.git
				synced 2025-11-04 08:13:43 +08:00 
			
		
		
		
	Merge branch 'main' of github.com:yangjian102621/chatgpt-plus
This commit is contained in:
		@@ -8,6 +8,7 @@
 | 
			
		||||
 | 
			
		||||
import {onMounted, ref, watch} from "vue";
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line no-undef
 | 
			
		||||
const props = defineProps({
 | 
			
		||||
  second: Number,
 | 
			
		||||
  type: {
 | 
			
		||||
@@ -16,6 +17,7 @@ const props = defineProps({
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line no-undef
 | 
			
		||||
const emits = defineEmits(['timeout']);
 | 
			
		||||
const counter = ref(props.second)
 | 
			
		||||
const timerStr = ref("")
 | 
			
		||||
@@ -34,7 +36,7 @@ const resetTimer = () => {
 | 
			
		||||
  if (handler.value) {
 | 
			
		||||
    clearInterval(handler.value)
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
 | 
			
		||||
  counter.value = props.second
 | 
			
		||||
  formatTimer(counter.value)
 | 
			
		||||
  handler.value = setInterval(() => {
 | 
			
		||||
@@ -80,6 +82,7 @@ const formatTimer = (secs) => {
 | 
			
		||||
  timerStr.value = timer.join("")
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line no-undef
 | 
			
		||||
defineExpose({resetTimer})
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -47,7 +47,7 @@ onMounted(() => {
 | 
			
		||||
const computeSize = () => {
 | 
			
		||||
  const w = container.value.offsetWidth - 8 // 减去滚动条的宽度
 | 
			
		||||
  let cols = Math.floor(w / props.width)
 | 
			
		||||
  itemWidth.value = Math.floor(w / cols)
 | 
			
		||||
  itemWidth.value = Math.ceil(w / cols)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
window.onresize = () => {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,75 +1,82 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div class="member">
 | 
			
		||||
  <div class="member custom-scroll">
 | 
			
		||||
    <div class="title">
 | 
			
		||||
      会员充值中心
 | 
			
		||||
    </div>
 | 
			
		||||
    <div class="inner custom-scroll">
 | 
			
		||||
    <div class="inner" :style="{height: listBoxHeight + 'px'}">
 | 
			
		||||
      <el-row :gutter="20">
 | 
			
		||||
        <el-col :span="7">
 | 
			
		||||
          <div class="user-profile">
 | 
			
		||||
            <user-profile/>
 | 
			
		||||
 | 
			
		||||
      <div class="user-profile">
 | 
			
		||||
        <user-profile/>
 | 
			
		||||
            <el-row class="user-opt" :gutter="20">
 | 
			
		||||
              <el-col :span="12">
 | 
			
		||||
                <el-button type="primary" @click="showPasswordDialog = true">修改密码</el-button>
 | 
			
		||||
              </el-col>
 | 
			
		||||
              <el-col :span="12">
 | 
			
		||||
                <el-button type="primary" @click="showBindMobileDialog = true">绑定手机号</el-button>
 | 
			
		||||
              </el-col>
 | 
			
		||||
              <el-col :span="12">
 | 
			
		||||
                <el-button type="primary" v-if="enableReward" @click="showRewardDialog = true">加入众筹</el-button>
 | 
			
		||||
              </el-col>
 | 
			
		||||
              <el-col :span="12">
 | 
			
		||||
                <el-button type="primary" v-if="enableReward" @click="showRewardVerifyDialog = true">众筹核销
 | 
			
		||||
                </el-button>
 | 
			
		||||
              </el-col>
 | 
			
		||||
 | 
			
		||||
        <el-row class="user-opt" :gutter="20">
 | 
			
		||||
          <el-col :span="12">
 | 
			
		||||
            <el-button type="primary" @click="showPasswordDialog = true">修改密码</el-button>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="12">
 | 
			
		||||
            <el-button type="primary" @click="showBindMobileDialog = true">绑定手机号</el-button>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="12">
 | 
			
		||||
            <el-button type="primary" v-if="enableReward" @click="showRewardDialog = true">加入众筹</el-button>
 | 
			
		||||
          </el-col>
 | 
			
		||||
          <el-col :span="12">
 | 
			
		||||
            <el-button type="primary" v-if="enableReward" @click="showRewardVerifyDialog = true">众筹核销</el-button>
 | 
			
		||||
          </el-col>
 | 
			
		||||
              <el-col :span="24" style="padding-top: 30px">
 | 
			
		||||
                <el-button type="danger" round @click="logout">退出登录</el-button>
 | 
			
		||||
              </el-col>
 | 
			
		||||
            </el-row>
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-col>
 | 
			
		||||
 | 
			
		||||
          <el-col :span="24" style="padding-top: 30px">
 | 
			
		||||
            <el-button type="danger" round @click="logout">退出登录</el-button>
 | 
			
		||||
          </el-col>
 | 
			
		||||
        </el-row>
 | 
			
		||||
      </div>
 | 
			
		||||
 | 
			
		||||
      <div class="product-box" :style="{height: listBoxHeight + 'px'}">
 | 
			
		||||
        <div class="info">
 | 
			
		||||
          <el-alert type="info" show-icon :closable="false" effect="dark">
 | 
			
		||||
            <strong>说明:</strong> 成为本站会员后每月有500次对话额度,50次 AI 绘画额度,限制下月1号解除,若在期间超过次数后可单独购买点卡。
 | 
			
		||||
            当月充值的点卡有效期可以延期到下个月底。
 | 
			
		||||
          </el-alert>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <ItemList :items="list" v-if="list.length > 0" :gap="30" :width="240">
 | 
			
		||||
          <template #default="scope">
 | 
			
		||||
            <div class="product-item" :style="{width: scope.width+'px'}" @click="orderPay(scope.item)">
 | 
			
		||||
              <div class="image-container">
 | 
			
		||||
                <el-image :src="vipImg" fit="cover"/>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="product-title">
 | 
			
		||||
                <span class="name">{{ scope.item.name }}</span>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="product-info">
 | 
			
		||||
                <div class="info-line">
 | 
			
		||||
                  <span class="label">商品原价:</span>
 | 
			
		||||
                  <span class="price">¥{{ scope.item.price }}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="info-line">
 | 
			
		||||
                  <span class="label">促销立减:</span>
 | 
			
		||||
                  <span class="price">¥{{ scope.item.discount }}</span>
 | 
			
		||||
                </div>
 | 
			
		||||
                <div class="info-line">
 | 
			
		||||
                  <span class="label">有效期:</span>
 | 
			
		||||
                  <span class="expire" v-if="scope.item.days > 0">{{ scope.item.days }}天</span>
 | 
			
		||||
                  <span class="expire" v-else>当月有效</span>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
        <el-col :span="17">
 | 
			
		||||
          <div class="product-box">
 | 
			
		||||
            <div class="info">
 | 
			
		||||
              <el-alert type="info" show-icon :closable="false" effect="dark">
 | 
			
		||||
                <strong>说明:</strong> 成为本站会员后每月有500次对话额度,50次 AI 绘画额度,限制下月1号解除,若在期间超过次数后可单独购买点卡。
 | 
			
		||||
                当月充值的点卡有效期可以延期到下个月底。
 | 
			
		||||
              </el-alert>
 | 
			
		||||
            </div>
 | 
			
		||||
          </template>
 | 
			
		||||
        </ItemList>
 | 
			
		||||
 | 
			
		||||
        <h2 class="headline">消费账单</h2>
 | 
			
		||||
            <ItemList :items="list" v-if="list.length > 0" :gap="30" :width="240">
 | 
			
		||||
              <template #default="scope">
 | 
			
		||||
                <div class="product-item" :style="{width: scope.width+'px'}" @click="orderPay(scope.item)">
 | 
			
		||||
                  <div class="image-container">
 | 
			
		||||
                    <el-image :src="vipImg" fit="cover"/>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="product-title">
 | 
			
		||||
                    <span class="name">{{ scope.item.name }}</span>
 | 
			
		||||
                  </div>
 | 
			
		||||
                  <div class="product-info">
 | 
			
		||||
                    <div class="info-line">
 | 
			
		||||
                      <span class="label">商品原价:</span>
 | 
			
		||||
                      <span class="price">¥{{ scope.item.price }}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="info-line">
 | 
			
		||||
                      <span class="label">促销立减:</span>
 | 
			
		||||
                      <span class="price">¥{{ scope.item.discount }}</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                    <div class="info-line">
 | 
			
		||||
                      <span class="label">有效期:</span>
 | 
			
		||||
                      <span class="expire" v-if="scope.item.days > 0">{{ scope.item.days }}天</span>
 | 
			
		||||
                      <span class="expire" v-else>当月有效</span>
 | 
			
		||||
                    </div>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </template>
 | 
			
		||||
            </ItemList>
 | 
			
		||||
 | 
			
		||||
            <h2 class="headline">消费账单</h2>
 | 
			
		||||
 | 
			
		||||
            <div class="user-order">
 | 
			
		||||
              <user-order v-if="isLogin"/>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </el-col>
 | 
			
		||||
      </el-row>
 | 
			
		||||
 | 
			
		||||
        <div class="user-order">
 | 
			
		||||
          <user-order v-if="isLogin"/>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <login-dialog :show="showLoginDialog" @hide="showLoginDialog = false"/>
 | 
			
		||||
@@ -145,14 +152,13 @@ import BindMobile from "@/components/BindMobile.vue";
 | 
			
		||||
import RewardVerify from "@/components/RewardVerify.vue";
 | 
			
		||||
import {useRouter} from "vue-router";
 | 
			
		||||
import {removeUserToken} from "@/store/session";
 | 
			
		||||
import CountDown from "@/components/CountDown.vue";
 | 
			
		||||
import UserOrder from "@/components/UserOrder.vue";
 | 
			
		||||
import CountDown from "@/components/CountDown.vue";
 | 
			
		||||
 | 
			
		||||
const listBoxHeight = window.innerHeight - 97
 | 
			
		||||
const list = ref([])
 | 
			
		||||
const showLoginDialog = ref(false)
 | 
			
		||||
const showPayDialog = ref(false)
 | 
			
		||||
const elements = ref(null)
 | 
			
		||||
const vipImg = ref("/images/vip.png")
 | 
			
		||||
const enableReward = ref(false) // 是否启用众筹功能
 | 
			
		||||
const rewardImg = ref('/images/reward.png')
 | 
			
		||||
@@ -205,6 +211,7 @@ const orderPay = (row) => {
 | 
			
		||||
    curPayProduct.value = row
 | 
			
		||||
  }
 | 
			
		||||
  loading.value = true
 | 
			
		||||
  text.value = ""
 | 
			
		||||
  httpPost("/api/payment/alipay/qrcode", {product_id: curPayProduct.value.id, user_id: user.value.id}).then(res => {
 | 
			
		||||
    showPayDialog.value = true
 | 
			
		||||
    qrcode.value = res.data['image']
 | 
			
		||||
@@ -310,13 +317,15 @@ const logout = function () {
 | 
			
		||||
    display flex
 | 
			
		||||
    color #ffffff
 | 
			
		||||
    padding 15px 0 15px 15px;
 | 
			
		||||
    overflow hidden
 | 
			
		||||
    overflow-x hidden
 | 
			
		||||
    overflow-y visible
 | 
			
		||||
 | 
			
		||||
    .user-profile {
 | 
			
		||||
      padding 10px 20px
 | 
			
		||||
      padding 10px 20px 20px 20px
 | 
			
		||||
      background-color #393F4A
 | 
			
		||||
      color #ffffff
 | 
			
		||||
      border-radius 10px
 | 
			
		||||
      height 100vh
 | 
			
		||||
 | 
			
		||||
      .el-form-item__label {
 | 
			
		||||
        color #ffffff
 | 
			
		||||
@@ -336,17 +345,12 @@ const logout = function () {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    .product-box {
 | 
			
		||||
      overflow-x hidden
 | 
			
		||||
      overflow-y visible
 | 
			
		||||
      width 100%
 | 
			
		||||
      padding-left 20px
 | 
			
		||||
 | 
			
		||||
      .info {
 | 
			
		||||
        .el-alert__description {
 | 
			
		||||
          font-size 14px !important
 | 
			
		||||
          margin 0
 | 
			
		||||
        }
 | 
			
		||||
        padding 10px 20px
 | 
			
		||||
        padding 10px 20px 20px 0
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .list-box {
 | 
			
		||||
@@ -423,11 +427,11 @@ const logout = function () {
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .headline {
 | 
			
		||||
        padding 0 20px
 | 
			
		||||
        padding 0 20px 20px 0
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      .user-order {
 | 
			
		||||
        padding 0 20px 20px 20px
 | 
			
		||||
        padding 0 20px 20px 0
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user