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