feat: 更新抖音绑定逻辑为直接绑定抖音ID,调整积分显示方式,并切换开发环境API地址

This commit is contained in:
邹方成 2026-01-06 02:02:38 +08:00
parent ea7b3e33c0
commit c75946676a
4 changed files with 17 additions and 18 deletions

View File

@ -373,9 +373,9 @@ export function purchaseGamePass(package_id, count = 1) {
}
/**
* 绑定抖音订单获取抖音用户ID
* @param {string} shop_order_id - 抖音订单
* 绑定抖音ID (Buyer ID)
* @param {string} douyin_id - 抖音
*/
export function bindDouyinOrder(order_id) {
return authRequest({ url: '/api/app/users/douyin/bind-order', method: 'POST', data: { order_id } })
export function bindDouyinID(douyin_id) {
return authRequest({ url: '/api/app/users/douyin/bind', method: 'POST', data: { douyin_id } })
}

View File

@ -67,9 +67,8 @@ const pageSize = ref(20)
const hasMore = ref(true)
function formatPoints(v) {
const n = Number(v) || 0
if (n === 0) return '0.0'
const f = n / 100
return f.toFixed(1)
if (n === 0) return '0'
return n.toString()
}
function formatTime(t) {

View File

@ -185,7 +185,7 @@
<view class="menu-icon-box">
<image class="menu-icon-img" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik05IDExVjlhMyAzIDAgMCAxIDMtM2g0YTMgMyAwIDAgMSAzIDN2Mm0tMTAtM2gtNGEzIDMgMCAwIDAtMyAzdi04YTIgMiAwIDAgMSAyLTJoMTRhMiAyIDAgMCAxIDIgMnY4YTIgMiAwIDAgMS0yIDJoLTRhMyAzIDAgMCAxLTMtM3oiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjEzIiByPSIzIi8+PC9zdmc+" mode="aspectFit"></image>
</view>
<text class="menu-label">{{ douyinUserId ? '已绑定' : '绑定订单' }}</text>
<text class="menu-label">{{ douyinUserId ? '已绑定' : '绑定抖音' }}</text>
</view>
</view>
</view>
@ -474,7 +474,7 @@
<script>
import {
getUserInfo, getUserStats, getPointsBalance, getUserPoints, getUserCoupons, getItemCards,
getUserTasks, getTaskProgress, getInviteRecords, modifyUser, getUserProfile, bindDouyinOrder
getUserTasks, getTaskProgress, getInviteRecords, modifyUser, getUserProfile, bindDouyinID
} from '../../api/appUser.js'
import { checkPhoneBoundSync } from '../../utils/checkPhone.js'
@ -957,25 +957,25 @@ export default {
}
uni.showModal({
title: '绑定抖音订单',
title: '绑定抖音',
editable: true,
placeholderText: '请输入抖音订单号',
placeholderText: '请输入您的抖音号(Buyer ID)',
success: async (res) => {
if (res.confirm) {
const orderId = res.content?.trim()
if (!orderId) {
uni.showToast({ title: '订单号不能为空', icon: 'none' })
const douyinId = res.content?.trim()
if (!douyinId) {
uni.showToast({ title: '抖音号不能为空', icon: 'none' })
return
}
try {
uni.showLoading({ title: '绑定中...' })
const data = await bindDouyinOrder(orderId)
this.douyinUserId = data.douyin_user_id
const data = await bindDouyinID(douyinId)
this.douyinUserId = data.douyin_id
//
const userInfo = uni.getStorageSync('user_info') || {}
userInfo.douyin_user_id = data.douyin_user_id
userInfo.douyin_user_id = data.douyin_id
uni.setStorageSync('user_info', userInfo)
uni.hideLoading()

View File

@ -1,4 +1,4 @@
const BASE_URL = 'https://mini-chat.1024tool.vip'
const BASE_URL = 'http://127.0.0.1:9991'
let authModalShown = false