fix 针对抖音再提交一个版本
This commit is contained in:
parent
a083681697
commit
0609f5c531
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,3 +8,5 @@ node_modules/
|
||||
*.tmp
|
||||
*.swp
|
||||
.claude/settings.local.json
|
||||
.hbuilderx/project.config.json
|
||||
clean-cache.bat
|
||||
|
||||
16
App.vue
16
App.vue
@ -20,21 +20,7 @@ export default {
|
||||
console.warn('Failed to load public config:', err)
|
||||
})
|
||||
|
||||
// #ifdef MP-TOUTIAO
|
||||
// 抖音平台:跳转到"我的"页面作为首页
|
||||
// 检查是否已经登录,如果未登录则跳转到登录页
|
||||
const token = uni.getStorageSync('token')
|
||||
if (!token) {
|
||||
uni.reLaunch({
|
||||
url: '/pages/login/index'
|
||||
})
|
||||
} else {
|
||||
// 已登录,跳转到我的页面
|
||||
uni.reLaunch({
|
||||
url: '/pages/mine/index'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
// 抖音平台现在也显示首页,不再需要强制跳转
|
||||
},
|
||||
onShow: function() {
|
||||
console.log('App Show')
|
||||
|
||||
@ -1,18 +1,23 @@
|
||||
<template>
|
||||
<view class="custom-tab-bar">
|
||||
<view class="tab-bar-item" @tap="switchTab('pages/index/index')">
|
||||
<image class="tab-icon" :src="selected === 0 ? '/static/tab/home_active.png' : '/static/tab/home.png'" mode="aspectFit"></image>
|
||||
<text class="tab-text" :class="{ active: selected === 0 }">首页</text>
|
||||
</view>
|
||||
|
||||
<view class="tab-bar-item" @tap="switchTab('pages/shop/index')">
|
||||
<image class="tab-icon" :src="selected === 0 ? '/static/tab/shop_active.png' : '/static/tab/shop.png'" mode="aspectFit"></image>
|
||||
<text class="tab-text" :class="{ active: selected === 0 }">商城</text>
|
||||
<image class="tab-icon" :src="selected === 1 ? '/static/tab/shop_active.png' : '/static/tab/shop.png'" mode="aspectFit"></image>
|
||||
<text class="tab-text" :class="{ active: selected === 1 }">商城</text>
|
||||
</view>
|
||||
|
||||
<view class="tab-bar-item" @tap="switchTab('pages/cabinet/index')">
|
||||
<image class="tab-icon" :src="selected === 1 ? '/static/tab/box_active.png' : '/static/tab/box.png'" mode="aspectFit"></image>
|
||||
<text class="tab-text" :class="{ active: selected === 1 }">盒柜</text>
|
||||
<image class="tab-icon" :src="selected === 2 ? '/static/tab/box_active.png' : '/static/tab/box.png'" mode="aspectFit"></image>
|
||||
<text class="tab-text" :class="{ active: selected === 2 }">盒柜</text>
|
||||
</view>
|
||||
|
||||
<view class="tab-bar-item" @tap="switchTab('pages/mine/index')">
|
||||
<image class="tab-icon" :src="selected === 2 ? '/static/tab/profile_active.png' : '/static/tab/profile.png'" mode="aspectFit"></image>
|
||||
<text class="tab-text" :class="{ active: selected === 2 }">我的</text>
|
||||
<image class="tab-icon" :src="selected === 3 ? '/static/tab/profile_active.png' : '/static/tab/profile.png'" mode="aspectFit"></image>
|
||||
<text class="tab-text" :class="{ active: selected === 3 }">我的</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@ -21,7 +26,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selected: 2 // 默认选中"我的"
|
||||
selected: 3 // 默认选中"我的"
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -37,9 +42,10 @@ export default {
|
||||
const currentPage = pages[pages.length - 1]
|
||||
const route = currentPage.route
|
||||
|
||||
if (route === 'pages/shop/index') this.selected = 0
|
||||
else if (route === 'pages/cabinet/index') this.selected = 1
|
||||
else if (route === 'pages/mine/index') this.selected = 2
|
||||
if (route === 'pages/index/index') this.selected = 0
|
||||
else if (route === 'pages/shop/index') this.selected = 1
|
||||
else if (route === 'pages/cabinet/index') this.selected = 2
|
||||
else if (route === 'pages/mine/index') this.selected = 3
|
||||
}
|
||||
},
|
||||
switchTab(url) {
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
{
|
||||
"name": "app_client",
|
||||
"appid": "",
|
||||
"description": "",
|
||||
"versionName": "1.0.0",
|
||||
"versionCode": "100",
|
||||
"transformPx": false,
|
||||
"name" : "app_client",
|
||||
"appid" : "__UNI__07C684D",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
/* 5+App特有相关 */
|
||||
"app-plus": {
|
||||
"usingComponents": true,
|
||||
"nvueStyleCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": true,
|
||||
"waiting": true,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
"app-plus" : {
|
||||
"usingComponents" : true,
|
||||
"nvueStyleCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
/* 模块配置 */
|
||||
"modules": {},
|
||||
"modules" : {},
|
||||
/* 应用发布信息 */
|
||||
"distribute": {
|
||||
"distribute" : {
|
||||
/* android打包配置 */
|
||||
"android": {
|
||||
"permissions": [
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||
@ -41,45 +41,45 @@
|
||||
]
|
||||
},
|
||||
/* ios打包配置 */
|
||||
"ios": {},
|
||||
"ios" : {},
|
||||
/* SDK配置 */
|
||||
"sdkConfigs": {}
|
||||
"sdkConfigs" : {}
|
||||
}
|
||||
},
|
||||
/* 快应用特有相关 */
|
||||
"quickapp": {},
|
||||
"quickapp" : {},
|
||||
/* 小程序特有相关 */
|
||||
"mp-weixin": {
|
||||
"appid": "wx26ad074017e1e63f",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"minified": true,
|
||||
"es6": true,
|
||||
"postcss": true
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx26ad074017e1e63f",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"minified" : true,
|
||||
"es6" : true,
|
||||
"postcss" : true
|
||||
},
|
||||
"usingComponents": true,
|
||||
"lazyCodeLoading": "requiredComponents",
|
||||
"optimization": {
|
||||
"subPackages": true
|
||||
"usingComponents" : true,
|
||||
"lazyCodeLoading" : "requiredComponents",
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
}
|
||||
},
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true,
|
||||
"appid": "ttf031868c6f33d91001",
|
||||
"privacy": {
|
||||
"getPhoneNumber": {
|
||||
"desc": "用于登录和账号绑定"
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true,
|
||||
"appid" : "ttf031868c6f33d91001",
|
||||
"privacy" : {
|
||||
"getPhoneNumber" : {
|
||||
"desc" : "用于登录和账号绑定"
|
||||
}
|
||||
}
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"vueVersion": "3"
|
||||
"vueVersion" : "3"
|
||||
}
|
||||
@ -122,11 +122,21 @@ import { onShareAppMessage, onShareTimeline } from '@dcloudio/uni-app'
|
||||
|
||||
onShareAppMessage(() => {
|
||||
const inviteCode = uni.getStorageSync('invite_code') || (uni.getStorageSync('user_info') || {}).invite_code || ''
|
||||
// #ifdef MP-TOUTIAO
|
||||
// 抖音平台分享到商城页面
|
||||
return {
|
||||
title: `${title.value || '精彩活动'} - 柯大鸭潮玩`,
|
||||
path: `/pages/shop/index?invite_code=${inviteCode}`,
|
||||
imageUrl: '/static/logo.png'
|
||||
}
|
||||
// #endif
|
||||
// #ifndef MP-TOUTIAO
|
||||
return {
|
||||
title: `${title.value || '精彩活动'} - 柯大鸭潮玩`,
|
||||
path: `/pages/index/index?invite_code=${inviteCode}`,
|
||||
imageUrl: '/static/logo.png'
|
||||
}
|
||||
// #endif
|
||||
})
|
||||
|
||||
onShareTimeline(() => {
|
||||
|
||||
@ -174,7 +174,13 @@ async function onSubmit() {
|
||||
content: '收货信息已提交,请等待发货。' + (isLoggedIn.value ? '资产已转移至您的盒柜。' : ''),
|
||||
showCancel: false,
|
||||
success: () => {
|
||||
// #ifdef MP-TOUTIAO
|
||||
// 抖音平台跳转到商城
|
||||
uni.switchTab({ url: '/pages/shop/index' })
|
||||
// #endif
|
||||
// #ifndef MP-TOUTIAO
|
||||
uni.switchTab({ url: '/pages/index/index' })
|
||||
// #endif
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
|
||||
@ -285,10 +285,18 @@ async function fetchData(append = false) {
|
||||
// 去使用优惠券
|
||||
function onUseCoupon(item) {
|
||||
vibrateShort()
|
||||
// #ifdef MP-TOUTIAO
|
||||
// 抖音平台跳转到商城
|
||||
uni.switchTab({
|
||||
url: '/pages/shop/index'
|
||||
})
|
||||
// #endif
|
||||
// #ifndef MP-TOUTIAO
|
||||
// 通常跳转到首页或抽盒页
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
@ -186,7 +186,13 @@ function onGetPhoneNumber(e) {
|
||||
|
||||
uni.showToast({ title: '欢迎加入!', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
// #ifdef MP-TOUTIAO
|
||||
// 抖音平台跳转到商城
|
||||
uni.switchTab({ url: '/pages/shop/index' })
|
||||
// #endif
|
||||
// #ifndef MP-TOUTIAO
|
||||
uni.switchTab({ url: '/pages/index/index' })
|
||||
// #endif
|
||||
}, 500)
|
||||
|
||||
} catch (err) {
|
||||
|
||||
@ -253,10 +253,18 @@ async function fetchData(append = false) {
|
||||
// 去使用道具卡
|
||||
function onUseCard(item) {
|
||||
vibrateShort()
|
||||
// #ifdef MP-TOUTIAO
|
||||
// 抖音平台跳转到商城
|
||||
uni.switchTab({
|
||||
url: '/pages/shop/index'
|
||||
})
|
||||
// #endif
|
||||
// #ifndef MP-TOUTIAO
|
||||
// 道具卡通常去首页或指定的活动页
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
})
|
||||
// #endif
|
||||
}
|
||||
|
||||
onLoad(() => {
|
||||
|
||||
@ -406,7 +406,13 @@ function goOrderDetail(item) {
|
||||
}
|
||||
|
||||
function goShopping() {
|
||||
// #ifdef MP-TOUTIAO
|
||||
// 抖音平台跳转到商城
|
||||
uni.switchTab({ url: '/pages/shop/index' })
|
||||
// #endif
|
||||
// #ifndef MP-TOUTIAO
|
||||
uni.switchTab({ url: '/pages/index/index' })
|
||||
// #endif
|
||||
}
|
||||
|
||||
async function doCancelOrder(item) {
|
||||
|
||||
@ -56,13 +56,13 @@
|
||||
|
||||
|
||||
<!-- 玩法分类专区 -->
|
||||
<!-- #ifndef MP-TOUTIAO -->
|
||||
<view class="gameplay-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">玩法分类</text>
|
||||
</view>
|
||||
<view class="gameplay-grid-v2">
|
||||
<!-- 上排:两大核心 -->
|
||||
<!-- #ifndef MP-TOUTIAO -->
|
||||
<view class="grid-row-top">
|
||||
<view class="game-card-large card-yifan" @tap="navigateTo('/pages-activity/activity/list/index?category=一番赏')">
|
||||
<view class="card-bg-decoration"></view>
|
||||
@ -80,7 +80,6 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 下排:三小功能 -->
|
||||
<view class="grid-row-bottom">
|
||||
@ -104,8 +103,10 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 推荐活动列表 -->
|
||||
<!-- #ifndef MP-TOUTIAO -->
|
||||
<view class="activity-section">
|
||||
<view class="section-header">
|
||||
<text class="section-title">推荐活动</text>
|
||||
@ -132,6 +133,7 @@
|
||||
</view>
|
||||
<view v-else class="activity-empty">暂无更多活动</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- 底部垫高 -->
|
||||
<view style="height: 40rpx"></view>
|
||||
|
||||
@ -38,6 +38,11 @@
|
||||
<text class="level-text">Lv1 {{ title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 绑定的抖音号 -->
|
||||
<view class="douyin-id-row" v-if="douyinUserId">
|
||||
<text class="douyin-id-label">抖音号:</text>
|
||||
<text class="douyin-id-value">{{ douyinUserId }}</text>
|
||||
</view>
|
||||
<view class="userid" v-if="userId">ID: {{ userId }}</view>
|
||||
<!-- <view class="progress-container" v-if="nickname">
|
||||
<view class="progress-bar">
|
||||
@ -988,13 +993,14 @@ export default {
|
||||
|
||||
uni.showModal({
|
||||
title: '绑定抖音',
|
||||
content: '请输入您的抖店订单号即可完成绑定',
|
||||
editable: true,
|
||||
placeholderText: '请输入您的抖音号(Buyer ID)',
|
||||
placeholderText: '请输入您的抖店订单号',
|
||||
success: async (res) => {
|
||||
if (res.confirm) {
|
||||
const douyinId = res.content?.trim()
|
||||
if (!douyinId) {
|
||||
uni.showToast({ title: '抖音号不能为空', icon: 'none' })
|
||||
uni.showToast({ title: '抖店订单号不能为空', icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
@ -1600,6 +1606,23 @@ export default {
|
||||
|
||||
.userid { font-size: $font-sm; color: $text-tertiary; font-family: monospace; }
|
||||
|
||||
/* 绑定的抖音号 */
|
||||
.douyin-id-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 8rpx;
|
||||
font-size: $font-sm;
|
||||
}
|
||||
.douyin-id-label {
|
||||
color: $text-tertiary;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
.douyin-id-value {
|
||||
color: $brand-primary;
|
||||
font-weight: 600;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
.join-btn {
|
||||
background: $text-main;
|
||||
color: $text-inverse;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user