feat: 更新抖音绑定逻辑为直接绑定抖音ID,调整积分显示方式,并切换开发环境API地址
This commit is contained in:
parent
ea7b3e33c0
commit
c75946676a
@ -373,9 +373,9 @@ export function purchaseGamePass(package_id, count = 1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 绑定抖音订单获取抖音用户ID
|
* 绑定抖音ID (Buyer ID)
|
||||||
* @param {string} shop_order_id - 抖音订单号
|
* @param {string} douyin_id - 抖音号
|
||||||
*/
|
*/
|
||||||
export function bindDouyinOrder(order_id) {
|
export function bindDouyinID(douyin_id) {
|
||||||
return authRequest({ url: '/api/app/users/douyin/bind-order', method: 'POST', data: { order_id } })
|
return authRequest({ url: '/api/app/users/douyin/bind', method: 'POST', data: { douyin_id } })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -67,9 +67,8 @@ const pageSize = ref(20)
|
|||||||
const hasMore = ref(true)
|
const hasMore = ref(true)
|
||||||
function formatPoints(v) {
|
function formatPoints(v) {
|
||||||
const n = Number(v) || 0
|
const n = Number(v) || 0
|
||||||
if (n === 0) return '0.0'
|
if (n === 0) return '0'
|
||||||
const f = n / 100
|
return n.toString()
|
||||||
return f.toFixed(1)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatTime(t) {
|
function formatTime(t) {
|
||||||
|
|||||||
@ -185,7 +185,7 @@
|
|||||||
<view class="menu-icon-box">
|
<view class="menu-icon-box">
|
||||||
<image class="menu-icon-img" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik05IDExVjlhMyAzIDAgMCAxIDMtM2g0YTMgMyAwIDAgMSAzIDN2Mm0tMTAtM2gtNGEzIDMgMCAwIDAtMyAzdi04YTIgMiAwIDAgMSAyLTJoMTRhMiAyIDAgMCAxIDIgMnY4YTIgMiAwIDAgMS0yIDJoLTRhMyAzIDAgMCAxLTMtM3oiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjEzIiByPSIzIi8+PC9zdmc+" mode="aspectFit"></image>
|
<image class="menu-icon-img" src="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0OCIgaGVpZ2h0PSI0OCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9IiMzMzMiIHN0cm9rZS13aWR0aD0iMS41IiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwYXRoIGQ9Ik05IDExVjlhMyAzIDAgMCAxIDMtM2g0YTMgMyAwIDAgMSAzIDN2Mm0tMTAtM2gtNGEzIDMgMCAwIDAtMyAzdi04YTIgMiAwIDAgMSAyLTJoMTRhMiAyIDAgMCAxIDIgMnY4YTIgMiAwIDAgMS0yIDJoLTRhMyAzIDAgMCAxLTMtM3oiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjEzIiByPSIzIi8+PC9zdmc+" mode="aspectFit"></image>
|
||||||
</view>
|
</view>
|
||||||
<text class="menu-label">{{ douyinUserId ? '已绑定' : '绑定订单' }}</text>
|
<text class="menu-label">{{ douyinUserId ? '已绑定' : '绑定抖音' }}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -474,7 +474,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
getUserInfo, getUserStats, getPointsBalance, getUserPoints, getUserCoupons, getItemCards,
|
getUserInfo, getUserStats, getPointsBalance, getUserPoints, getUserCoupons, getItemCards,
|
||||||
getUserTasks, getTaskProgress, getInviteRecords, modifyUser, getUserProfile, bindDouyinOrder
|
getUserTasks, getTaskProgress, getInviteRecords, modifyUser, getUserProfile, bindDouyinID
|
||||||
} from '../../api/appUser.js'
|
} from '../../api/appUser.js'
|
||||||
import { checkPhoneBoundSync } from '../../utils/checkPhone.js'
|
import { checkPhoneBoundSync } from '../../utils/checkPhone.js'
|
||||||
|
|
||||||
@ -957,25 +957,25 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '绑定抖音订单',
|
title: '绑定抖音',
|
||||||
editable: true,
|
editable: true,
|
||||||
placeholderText: '请输入抖音订单号',
|
placeholderText: '请输入您的抖音号(Buyer ID)',
|
||||||
success: async (res) => {
|
success: async (res) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
const orderId = res.content?.trim()
|
const douyinId = res.content?.trim()
|
||||||
if (!orderId) {
|
if (!douyinId) {
|
||||||
uni.showToast({ title: '订单号不能为空', icon: 'none' })
|
uni.showToast({ title: '抖音号不能为空', icon: 'none' })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
uni.showLoading({ title: '绑定中...' })
|
uni.showLoading({ title: '绑定中...' })
|
||||||
const data = await bindDouyinOrder(orderId)
|
const data = await bindDouyinID(douyinId)
|
||||||
this.douyinUserId = data.douyin_user_id
|
this.douyinUserId = data.douyin_id
|
||||||
|
|
||||||
// 更新缓存
|
// 更新缓存
|
||||||
const userInfo = uni.getStorageSync('user_info') || {}
|
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.setStorageSync('user_info', userInfo)
|
||||||
|
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
const BASE_URL = 'https://mini-chat.1024tool.vip'
|
const BASE_URL = 'http://127.0.0.1:9991'
|
||||||
|
|
||||||
let authModalShown = false
|
let authModalShown = false
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user