mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-09-17 16:56:38 +08:00
feat: refactoring adjustments for member pages
This commit is contained in:
parent
f215643f2e
commit
4e39b93673
@ -79,7 +79,7 @@ func (js *PayJS) Pay(param JPayReq) JPayReps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (js *PayJS) sign(params url.Values) string {
|
func (js *PayJS) sign(params url.Values) string {
|
||||||
params.Del(`Sign`)
|
params.Del(`sign`)
|
||||||
var keys = make([]string, 0, 0)
|
var keys = make([]string, 0, 0)
|
||||||
for key := range params {
|
for key := range params {
|
||||||
if params.Get(key) != `` {
|
if params.Get(key) != `` {
|
||||||
@ -109,7 +109,7 @@ func (js *PayJS) Check(tradeNo string) error {
|
|||||||
apiURL := fmt.Sprintf("%s/api/check", js.config.ApiURL)
|
apiURL := fmt.Sprintf("%s/api/check", js.config.ApiURL)
|
||||||
params := url.Values{}
|
params := url.Values{}
|
||||||
params.Add("payjs_order_id", tradeNo)
|
params.Add("payjs_order_id", tradeNo)
|
||||||
params.Add("Sign", js.sign(params))
|
params.Add("sign", js.sign(params))
|
||||||
data := strings.NewReader(params.Encode())
|
data := strings.NewReader(params.Encode())
|
||||||
resp, err := http.Post(apiURL, "application/x-www-form-urlencoded", data)
|
resp, err := http.Post(apiURL, "application/x-www-form-urlencoded", data)
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
@ -135,6 +135,7 @@ func (js *PayJS) Check(tradeNo string) error {
|
|||||||
if r.ReturnCode == 1 && r.Status == 1 {
|
if r.ReturnCode == 1 && r.Status == 1 {
|
||||||
return nil
|
return nil
|
||||||
} else {
|
} else {
|
||||||
|
logger.Errorf("PayJs 支付验证响应:%s", string(body))
|
||||||
return errors.New("order not paid")
|
return errors.New("order not paid")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ func OpenAIRequest(db *gorm.DB, prompt string) (string, error) {
|
|||||||
r, err := client.R().SetHeader("Content-Type", "application/json").
|
r, err := client.R().SetHeader("Content-Type", "application/json").
|
||||||
SetHeader("Authorization", "Bearer "+apiKey.Value).
|
SetHeader("Authorization", "Bearer "+apiKey.Value).
|
||||||
SetBody(types.ApiRequest{
|
SetBody(types.ApiRequest{
|
||||||
Model: "gpt-3.5-turbo",
|
Model: "gpt-3.5-turbo-0125",
|
||||||
Temperature: 0.9,
|
Temperature: 0.9,
|
||||||
MaxTokens: 1024,
|
MaxTokens: 1024,
|
||||||
Stream: false,
|
Stream: false,
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
background-color: #393f4a;
|
background-color: #393f4a;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
height: 100vh;
|
|
||||||
}
|
}
|
||||||
.member .inner .user-profile .el-form-item__label {
|
.member .inner .user-profile .el-form-item__label {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -130,7 +129,7 @@
|
|||||||
.member .inner .product-box .list-box .product-item .product-info .info-line .expire {
|
.member .inner .product-box .list-box .product-item .product-info .info-line .expire {
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
}
|
}
|
||||||
.member .inner .product-box .list-box .product-item .product-info .info-line .calls {
|
.member .inner .product-box .list-box .product-item .product-info .info-line .power {
|
||||||
color: #f2cb51;
|
color: #f2cb51;
|
||||||
}
|
}
|
||||||
.member .inner .product-box .list-box .product-item .product-info .pay-way {
|
.member .inner .product-box .list-box .product-item .product-info .pay-way {
|
||||||
|
@ -71,7 +71,7 @@
|
|||||||
background-color #393F4A
|
background-color #393F4A
|
||||||
color #ffffff
|
color #ffffff
|
||||||
border-radius 10px
|
border-radius 10px
|
||||||
height 100vh
|
//height 100vh
|
||||||
|
|
||||||
.el-form-item__label {
|
.el-form-item__label {
|
||||||
color #ffffff
|
color #ffffff
|
||||||
@ -162,7 +162,7 @@
|
|||||||
color #409eff
|
color #409eff
|
||||||
}
|
}
|
||||||
|
|
||||||
.calls {
|
.power {
|
||||||
color #F2CB51
|
color #F2CB51
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 倒计时组件 -->
|
<!-- 倒计时组件 -->
|
||||||
<div class="countdown">
|
<div class="countdown">
|
||||||
<el-tag size="large" :type="type">{{ timerStr }}</el-tag>
|
<el-tag size="large" type="info">{{ timerStr }}</el-tag>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
<span>{{ scope.row.remark?.power }}</span>
|
<span>{{ scope.row.remark?.power }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="pay_way" label="支付方式"/>
|
||||||
<el-table-column label="支付时间">
|
<el-table-column label="支付时间">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row['pay_time']">{{ dateFormat(scope.row['pay_time']) }}</span>
|
<span v-if="scope.row['pay_time']">{{ dateFormat(scope.row['pay_time']) }}</span>
|
||||||
@ -56,7 +56,7 @@ import Clipboard from "clipboard";
|
|||||||
const items = ref([])
|
const items = ref([])
|
||||||
const total = ref(0)
|
const total = ref(0)
|
||||||
const page = ref(1)
|
const page = ref(1)
|
||||||
const pageSize = ref(10)
|
const pageSize = ref(12)
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -34,8 +34,9 @@
|
|||||||
<el-col :span="17">
|
<el-col :span="17">
|
||||||
<div class="product-box">
|
<div class="product-box">
|
||||||
<div class="info" v-if="orderPayInfoText !== ''">
|
<div class="info" v-if="orderPayInfoText !== ''">
|
||||||
<el-alert type="info" show-icon :closable="false" effect="dark">
|
<el-alert type="success" show-icon :closable="false" effect="dark">
|
||||||
<strong>说明:</strong> {{ orderPayInfoText }}
|
<strong>说明:</strong> 月度会员,年度会员每月赠送 {{ vipMonthPower }} 点算力,赠送算力当月有效,当月没有消费完的算力不结余到下个月。
|
||||||
|
点卡充值的算力长期有效。
|
||||||
</el-alert>
|
</el-alert>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -64,15 +65,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info-line">
|
<div class="info-line">
|
||||||
<span class="label">对话次数:</span>
|
<span class="label">算力值:</span>
|
||||||
<span class="calls" v-if="scope.item.calls > 0">{{ scope.item.calls }}</span>
|
<span class="power" v-if="scope.item.power > 0">{{ scope.item.power }}</span>
|
||||||
<span class="calls" v-else>{{ vipMonthCalls }}</span>
|
<span class="power" v-else>{{ vipMonthPower }}</span>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="info-line">
|
|
||||||
<span class="label">绘图次数:</span>
|
|
||||||
<span class="calls" v-if="scope.item.img_calls > 0">{{ scope.item.img_calls }}</span>
|
|
||||||
<span class="calls" v-else>{{ vipMonthImgCalls }}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pay-way">
|
<div class="pay-way">
|
||||||
@ -121,9 +116,9 @@
|
|||||||
title="参与众筹"
|
title="参与众筹"
|
||||||
>
|
>
|
||||||
<el-alert type="info" :closable="false">
|
<el-alert type="info" :closable="false">
|
||||||
<div style="font-size: 14px">您好,众筹 9.9元,就可以兑换 100 次对话,以此来覆盖我们的 OpenAI
|
<div style="font-size: 14px">您好,目前每单位算力众筹价格为 <strong style="color: #f56c6c">{{ powerPrice }}
|
||||||
账单和服务器的费用。<strong
|
</strong>元。
|
||||||
style="color: #f56c6c">由于本人没有开通微信支付,付款后请凭借转账单号,点击【众筹核销】按钮手动核销。</strong>
|
由于本人没有开通微信支付,付款后请凭借转账单号,点击【众筹核销】按钮手动核销。
|
||||||
</div>
|
</div>
|
||||||
</el-alert>
|
</el-alert>
|
||||||
<div style="text-align: center;padding-top: 10px;">
|
<div style="text-align: center;padding-top: 10px;">
|
||||||
@ -137,9 +132,8 @@
|
|||||||
:show-close="true"
|
:show-close="true"
|
||||||
:width="400"
|
:width="400"
|
||||||
@close="closeOrder"
|
@close="closeOrder"
|
||||||
title="充值订单支付">
|
:title="'实付金额:¥'+amount">
|
||||||
<div class="pay-container">
|
<div class="pay-container">
|
||||||
<h3 class="amount">实付金额:<span>¥{{ amount }}</span></h3>
|
|
||||||
<div class="count-down">
|
<div class="count-down">
|
||||||
<count-down :second="orderTimeout" @timeout="refreshPayCode" ref="countDownRef"/>
|
<count-down :second="orderTimeout" @timeout="refreshPayCode" ref="countDownRef"/>
|
||||||
</div>
|
</div>
|
||||||
@ -205,8 +199,8 @@ const countDownRef = ref(null)
|
|||||||
const orderTimeout = ref(1800)
|
const orderTimeout = ref(1800)
|
||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const orderPayInfoText = ref("")
|
const orderPayInfoText = ref("")
|
||||||
const vipMonthCalls = ref(0)
|
const vipMonthPower = ref(0)
|
||||||
const vipMonthImgCalls = ref(0)
|
const powerPrice = ref(0)
|
||||||
|
|
||||||
const payWays = ref({})
|
const payWays = ref({})
|
||||||
const amount = ref(0)
|
const amount = ref(0)
|
||||||
@ -234,8 +228,8 @@ onMounted(() => {
|
|||||||
if (res.data['order_pay_timeout'] > 0) {
|
if (res.data['order_pay_timeout'] > 0) {
|
||||||
orderTimeout.value = res.data['order_pay_timeout']
|
orderTimeout.value = res.data['order_pay_timeout']
|
||||||
}
|
}
|
||||||
vipMonthCalls.value = res.data['vip_month_calls']
|
vipMonthPower.value = res.data['vip_month_power']
|
||||||
vipMonthImgCalls.value = res.data['vip_month_img_calls']
|
powerPrice.value = res.data['power_price']
|
||||||
}).catch(e => {
|
}).catch(e => {
|
||||||
ElMessage.error("获取系统配置失败:" + e.message)
|
ElMessage.error("获取系统配置失败:" + e.message)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user