refactor: 重构页面结构,将页面按模块拆分至pages-user、pages-activity等目录并更新相关配置和组件。
This commit is contained in:
parent
2af47b7979
commit
3175c6e8ae
@ -5,8 +5,8 @@ export function wechatLogin(code, invite_code) {
|
||||
return request({ url: '/api/app/users/weixin/login', method: 'POST', data })
|
||||
}
|
||||
|
||||
export function getInventory(user_id, page = 1, page_size = 20) {
|
||||
return authRequest({ url: `/api/app/users/${user_id}/inventory`, method: 'GET', data: { page, page_size } })
|
||||
export function getInventory(user_id, page = 1, page_size = 20, params = {}) {
|
||||
return authRequest({ url: `/api/app/users/${user_id}/inventory`, method: 'GET', data: { page, page_size, ...params } })
|
||||
}
|
||||
|
||||
export function bindPhone(user_id, code, extraHeader = {}) {
|
||||
|
||||
@ -163,7 +163,7 @@ function onCardChange(e) {
|
||||
|
||||
function openAgreement() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/agreement/purchase' // 假设协议页面路径,如果没有请替换为实际路径
|
||||
url: '/pages-user/agreement/purchase' // 假设协议页面路径,如果没有请替换为实际路径
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@ -76,29 +76,22 @@ async function loadItems() {
|
||||
try {
|
||||
const userId = uni.getStorageSync('user_id')
|
||||
if (!userId) { items.value = []; total.value = 0; return }
|
||||
const res = await getInventory(userId, 1, 50)
|
||||
const res = await getInventory(userId, 1, 50, { status: 1 })
|
||||
let list = []
|
||||
let rawTotal = 0
|
||||
if (res && Array.isArray(res.list)) { list = res.list; rawTotal = res.total || 0 }
|
||||
else if (res && Array.isArray(res.data)) { list = res.data; rawTotal = res.total || 0 }
|
||||
else if (Array.isArray(res)) { list = res; rawTotal = res.length }
|
||||
|
||||
const filtered = list.filter(item => Number(item.status) === 1 && !item.has_shipment)
|
||||
const aggregated = new Map()
|
||||
filtered.forEach(item => {
|
||||
const key = String(item.product_id || item.id)
|
||||
if (aggregated.has(key)) {
|
||||
aggregated.get(key).count += 1
|
||||
} else {
|
||||
aggregated.set(key, {
|
||||
id: key,
|
||||
name: (item.product_name || item.name || '').trim() || '未知物品',
|
||||
image: cleanUrl(item.product_images || item.image),
|
||||
count: 1
|
||||
})
|
||||
}
|
||||
})
|
||||
items.value = Array.from(aggregated.values())
|
||||
// 后端已按 status=1 过滤,这里只需要排除前端正在处理的项
|
||||
// 后端已经按 status=1 过滤并聚合,直接映射
|
||||
const displayRes = list.map(item => ({
|
||||
id: item.product_id,
|
||||
name: (item.product_name || '未知商品').trim(),
|
||||
image: cleanUrl(item.product_images || item.image),
|
||||
count: item.count
|
||||
}))
|
||||
items.value = displayRes
|
||||
total.value = rawTotal
|
||||
} catch (e) {
|
||||
console.error('[CabinetPreviewPopup] 加载失败', e)
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
{
|
||||
"name" : "app_client",
|
||||
"appid" : "",
|
||||
"description" : "",
|
||||
"versionName" : "1.0.0",
|
||||
"versionCode" : "100",
|
||||
"transformPx" : false,
|
||||
"name": "app_client",
|
||||
"appid": "",
|
||||
"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,36 +41,40 @@
|
||||
]
|
||||
},
|
||||
/* 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
|
||||
"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"
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true,
|
||||
"appid": "ttf031868c6f33d91001"
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"vueVersion" : "3"
|
||||
}
|
||||
"vueVersion": "3"
|
||||
}
|
||||
@ -170,6 +170,13 @@
|
||||
v-model:visible="cabinetVisible"
|
||||
:activity-id="activityId"
|
||||
/>
|
||||
|
||||
<!-- 开奖结果弹窗 -->
|
||||
<LotteryResultPopup
|
||||
v-model:visible="resultVisible"
|
||||
:results="resultItems"
|
||||
@close="onResultClose"
|
||||
/>
|
||||
</template>
|
||||
</ActivityPageLayout>
|
||||
</template>
|
||||
@ -186,6 +193,7 @@ import RewardsPopup from '@/components/activity/RewardsPopup.vue'
|
||||
import RecordsList from '@/components/activity/RecordsList.vue'
|
||||
import RulesPopup from '@/components/activity/RulesPopup.vue'
|
||||
import CabinetPreviewPopup from '@/components/activity/CabinetPreviewPopup.vue'
|
||||
import LotteryResultPopup from '@/components/activity/LotteryResultPopup.vue'
|
||||
import { getActivityDetail, getActivityIssues, getActivityIssueRewards, getUserCoupons, getItemCards, createWechatOrder, getMatchingCardTypes, createMatchingPreorder, checkMatchingGame, getIssueDrawLogs, getMatchingGameCards } from '../../../api/appUser'
|
||||
import { levelToAlpha } from '@/utils/activity'
|
||||
|
||||
@ -211,6 +219,8 @@ const selectedCardTypeCode = ref('')
|
||||
const rewardsVisible = ref(false)
|
||||
const rulesVisible = ref(false)
|
||||
const cabinetVisible = ref(false)
|
||||
const resultVisible = ref(false)
|
||||
const resultItems = ref([])
|
||||
const resumeGame = ref(null)
|
||||
const resumeIssueId = ref('')
|
||||
const hasResumeGame = computed(() => {
|
||||
@ -928,15 +938,96 @@ async function finishAndReport() {
|
||||
const entry = gameEntry.value || null
|
||||
const gameId = entry && entry.game_id ? String(entry.game_id) : ''
|
||||
if (!gameId) return
|
||||
await checkMatchingGame(gameId, Number(totalPairs.value || 0))
|
||||
clearMatchingGameCacheEntry(aid, issueId)
|
||||
gameFinished.value = true
|
||||
closeGame()
|
||||
uni.showModal({
|
||||
title: '游戏结束',
|
||||
content: `总对数:${Number(totalPairs.value || 0)}`,
|
||||
showCancel: false
|
||||
})
|
||||
|
||||
try {
|
||||
const checkRes = await checkMatchingGame(gameId, Number(totalPairs.value || 0))
|
||||
clearMatchingGameCacheEntry(aid, issueId)
|
||||
gameFinished.value = true
|
||||
closeGame()
|
||||
|
||||
console.log('[对对碰] checkRes:', JSON.stringify(checkRes))
|
||||
console.log('[对对碰] currentIssueRewards:', currentIssueRewards.value?.length, 'items')
|
||||
console.log('[对对碰] rewardsMap keys:', Object.keys(rewardsMap.value || {}))
|
||||
|
||||
// 解析中奖结果 - 后端返回格式是 { reward: { reward_id, name, level } }
|
||||
let wonItems = []
|
||||
|
||||
// 后端返回单个 reward 对象的情况
|
||||
if (checkRes?.reward && checkRes.reward.reward_id) {
|
||||
const reward = checkRes.reward
|
||||
console.log('[对对碰] 检测到reward对象:', reward)
|
||||
// 从本地 rewardsMap 查找图片
|
||||
const allRewards = rewardsMap.value[issueId] || currentIssueRewards.value || []
|
||||
console.log('[对对碰] 本地奖励数据:', allRewards.length, 'items')
|
||||
const foundReward = allRewards.find(r =>
|
||||
String(r.id) === String(reward.reward_id) ||
|
||||
String(r.reward_id) === String(reward.reward_id)
|
||||
)
|
||||
console.log('[对对碰] 匹配到的奖励:', foundReward)
|
||||
wonItems = [{
|
||||
title: reward.name || foundReward?.name || foundReward?.title || '神秘奖励',
|
||||
image: foundReward?.image || foundReward?.pic || foundReward?.img || foundReward?.product_image || '',
|
||||
reward_id: reward.reward_id
|
||||
}]
|
||||
}
|
||||
// 处理数组格式(兼容)
|
||||
else if (Array.isArray(checkRes) && checkRes.length > 0) {
|
||||
wonItems = checkRes
|
||||
} else if (checkRes?.list && checkRes.list.length > 0) {
|
||||
wonItems = checkRes.list
|
||||
} else if (checkRes?.data && Array.isArray(checkRes.data) && checkRes.data.length > 0) {
|
||||
wonItems = checkRes.data
|
||||
} else if (checkRes?.rewards && checkRes.rewards.length > 0) {
|
||||
wonItems = checkRes.rewards
|
||||
} else if (checkRes?.items && checkRes.items.length > 0) {
|
||||
wonItems = checkRes.items
|
||||
}
|
||||
|
||||
console.log('[对对碰] wonItems:', wonItems)
|
||||
|
||||
// 转换为 LotteryResultPopup 需要的格式
|
||||
if (wonItems.length > 0) {
|
||||
const allRewards = rewardsMap.value[issueId] || currentIssueRewards.value || []
|
||||
resultItems.value = wonItems.map(item => {
|
||||
// 如果已经有 title,直接使用
|
||||
if (item.title) return item
|
||||
// 否则尝试从本地数据匹配
|
||||
const found = allRewards.find(r =>
|
||||
String(r.id) === String(item.reward_id) ||
|
||||
String(r.reward_id) === String(item.reward_id)
|
||||
)
|
||||
return {
|
||||
title: item.title || item.name || found?.name || found?.title || '神秘奖励',
|
||||
image: item.image || item.img || found?.image || found?.pic || found?.product_image || '',
|
||||
reward_id: item.reward_id || item.id
|
||||
}
|
||||
})
|
||||
} else {
|
||||
resultItems.value = []
|
||||
}
|
||||
|
||||
console.log('[对对碰] resultItems:', resultItems.value)
|
||||
|
||||
// 显示结果弹窗
|
||||
if (resultItems.value.length > 0) {
|
||||
resultVisible.value = true
|
||||
} else {
|
||||
// 没有中奖物品时显示简单提示
|
||||
uni.showModal({
|
||||
title: '游戏结束',
|
||||
content: `总对数:${Number(totalPairs.value || 0)}`,
|
||||
showCancel: false
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('finishAndReport error', e)
|
||||
uni.showToast({ title: e?.message || '结算失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
|
||||
function onResultClose() {
|
||||
resultVisible.value = false
|
||||
resultItems.value = []
|
||||
}
|
||||
|
||||
async function advanceOne() {
|
||||
@ -94,10 +94,10 @@ function onActivityTap(a) {
|
||||
let path = ''
|
||||
|
||||
// Navigate to DETAIL, not list
|
||||
if (name.includes('一番赏')) path = '/pages/activity/yifanshang/index'
|
||||
else if (name.includes('无限赏')) path = '/pages/activity/wuxianshang/index'
|
||||
else if (name.includes('对对碰')) path = '/pages/activity/duiduipeng/index'
|
||||
else if (name.includes('爬塔')) path = '/pages/activity/pata/index'
|
||||
if (name.includes('一番赏')) path = '/pages-activity/activity/yifanshang/index'
|
||||
else if (name.includes('无限赏')) path = '/pages-activity/activity/wuxianshang/index'
|
||||
else if (name.includes('对对碰')) path = '/pages-activity/activity/duiduipeng/index'
|
||||
else if (name.includes('爬塔')) path = '/pages-activity/activity/pata/index'
|
||||
|
||||
if (path && id) {
|
||||
uni.navigateTo({ url: `${path}?id=${id}` })
|
||||
@ -93,7 +93,7 @@ function onStartChallenge() {
|
||||
const gameUrl = 'http://localhost:5174/'
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/game/webview?url=${encodeURIComponent(gameUrl)}&ticket=${ticketId.value}`
|
||||
url: `/pages-game/game/webview?url=${encodeURIComponent(gameUrl)}&ticket=${ticketId.value}`
|
||||
})
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ import LotteryResultPopup from '@/components/activity/LotteryResultPopup.vue'
|
||||
import DrawLoadingPopup from '@/components/activity/DrawLoadingPopup.vue'
|
||||
import PaymentPopup from '@/components/PaymentPopup.vue'
|
||||
// Composables
|
||||
import { useActivity, useIssues, useRewards, useRecords } from '@/composables'
|
||||
import { useActivity, useIssues, useRewards, useRecords } from '../../composables'
|
||||
// API
|
||||
import { joinLottery, createWechatOrder, getLotteryResult, getItemCards, getUserCoupons } from '@/api/appUser'
|
||||
|
||||
@ -131,7 +131,7 @@ import CabinetPreviewPopup from '@/components/activity/CabinetPreviewPopup.vue'
|
||||
import FlipGrid from '@/components/FlipGrid.vue'
|
||||
import YifanSelector from '@/components/YifanSelector.vue'
|
||||
// Composables
|
||||
import { useActivity, useIssues, useRewards, useRecords } from '@/composables'
|
||||
import { useActivity, useIssues, useRewards, useRecords } from '../../composables'
|
||||
// Utils
|
||||
import { formatDateTime, parseTimeMs } from '@/utils/format'
|
||||
|
||||
@ -124,7 +124,7 @@ export default {
|
||||
|
||||
// 跳转到webview
|
||||
uni.navigateTo({
|
||||
url: `/pages/game/webview?url=${encodeURIComponent(gameUrl)}`
|
||||
url: `/pages-game/game/webview?url=${encodeURIComponent(gameUrl)}`
|
||||
})
|
||||
} catch (e) {
|
||||
uni.showToast({
|
||||
@ -112,12 +112,12 @@ async function fetchList() {
|
||||
|
||||
function toAdd() {
|
||||
uni.removeStorageSync('edit_address')
|
||||
uni.navigateTo({ url: '/pages/address/edit' })
|
||||
uni.navigateTo({ url: '/pages-user/address/edit' })
|
||||
}
|
||||
|
||||
function toEdit(item) {
|
||||
uni.setStorageSync('edit_address', item)
|
||||
uni.navigateTo({ url: `/pages/address/edit?id=${item.id}` })
|
||||
uni.navigateTo({ url: `/pages-user/address/edit?id=${item.id}` })
|
||||
}
|
||||
|
||||
function onDelete(item) {
|
||||
@ -14,8 +14,8 @@
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
toUser() { uni.navigateTo({ url: '/pages/agreement/user' }) },
|
||||
toPurchase() { uni.navigateTo({ url: '/pages/agreement/purchase' }) }
|
||||
toUser() { uni.navigateTo({ url: '/pages-user/agreement/user' }) },
|
||||
toPurchase() { uni.navigateTo({ url: '/pages-user/agreement/purchase' }) }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -122,8 +122,8 @@ function toggleAgreement() {
|
||||
agreementChecked.value = !agreementChecked.value
|
||||
}
|
||||
|
||||
function toUserAgreement() { uni.navigateTo({ url: '/pages/agreement/user' }) }
|
||||
function toPurchaseAgreement() { uni.navigateTo({ url: '/pages/agreement/purchase' }) }
|
||||
function toUserAgreement() { uni.navigateTo({ url: '/pages-user/agreement/user' }) }
|
||||
function toPurchaseAgreement() { uni.navigateTo({ url: '/pages-user/agreement/purchase' }) }
|
||||
|
||||
function goLogin() {
|
||||
uni.navigateTo({ url: '/pages/login/index' })
|
||||
@ -338,11 +338,11 @@ function navigateToGame(ord) {
|
||||
|
||||
let url = ''
|
||||
if (playType === 'match') {
|
||||
url = `/pages/activity/duiduipeng/index?activity_id=${activityId}`
|
||||
url = `/pages-activity/activity/duiduipeng/index?activity_id=${activityId}`
|
||||
} else if (playType === 'ichiban') {
|
||||
url = `/pages/activity/yifanshang/index?activity_id=${activityId}`
|
||||
url = `/pages-activity/activity/yifanshang/index?activity_id=${activityId}`
|
||||
} else if (playType === 'infinity') {
|
||||
url = `/pages/activity/wuxianshang/index?activity_id=${activityId}`
|
||||
url = `/pages-activity/activity/wuxianshang/index?activity_id=${activityId}`
|
||||
}
|
||||
|
||||
if (url) {
|
||||
@ -399,7 +399,7 @@ async function fetchAllOrders() {
|
||||
function goOrderDetail(item) {
|
||||
// 跳转订单详情页
|
||||
uni.navigateTo({
|
||||
url: `/pages/orders/detail?id=${item.id}&order_no=${item.order_no}`
|
||||
url: `/pages-user/orders/detail?id=${item.id}&order_no=${item.order_no}`
|
||||
})
|
||||
}
|
||||
|
||||
@ -476,11 +476,11 @@ function navigateToGame(item) {
|
||||
|
||||
let url = ''
|
||||
if (playType === 'match') {
|
||||
url = `/pages/activity/duiduipeng/index?activity_id=${activityId}`
|
||||
url = `/pages-activity/activity/duiduipeng/index?activity_id=${activityId}`
|
||||
} else if (playType === 'ichiban') {
|
||||
url = `/pages/activity/yifanshang/index?activity_id=${activityId}`
|
||||
url = `/pages-activity/activity/yifanshang/index?activity_id=${activityId}`
|
||||
} else if (playType === 'infinity') {
|
||||
url = `/pages/activity/wuxianshang/index?activity_id=${activityId}`
|
||||
url = `/pages-activity/activity/wuxianshang/index?activity_id=${activityId}`
|
||||
}
|
||||
|
||||
if (url) {
|
||||
280
pages.json
280
pages.json
@ -18,12 +18,6 @@
|
||||
"navigationBarTitleText": "商城"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/shop/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/cabinet/index",
|
||||
"style": {
|
||||
@ -35,135 +29,163 @@
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "pages-activity",
|
||||
"pages": [
|
||||
{
|
||||
"path": "activity/yifanshang/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "一番赏"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "activity/wuxianshang/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "无限赏"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "activity/duiduipeng/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "对对碰"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "activity/list/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "活动列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "activity/pata/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "爬塔"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pages/points/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "积分记录"
|
||||
}
|
||||
"root": "pages-user",
|
||||
"pages": [
|
||||
{
|
||||
"path": "points/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "积分记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "coupons/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的优惠券"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "item-cards/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的道具卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "invite/landing",
|
||||
"style": {
|
||||
"navigationBarTitleText": "好友邀请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "invites/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "tasks/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务中心"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "orders/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "orders/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "address/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "地址管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "address/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑地址"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "address/submit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "填写收货信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "help/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "使用帮助"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "agreement/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户协议"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "agreement/purchase",
|
||||
"style": {
|
||||
"navigationBarTitleText": "购买协议"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pages/coupons/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的优惠券"
|
||||
}
|
||||
"root": "pages-shop",
|
||||
"pages": [
|
||||
{
|
||||
"path": "shop/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "商品详情"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"path": "pages/item-cards/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的道具卡"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/invite/landing",
|
||||
"style": {
|
||||
"navigationBarTitleText": "好友邀请"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/invites/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "邀请记录"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/tasks/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "任务中心"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/orders/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "我的订单"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/orders/detail",
|
||||
"style": {
|
||||
"navigationBarTitleText": "订单详情"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/address/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "地址管理"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/address/edit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "编辑地址"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/address/submit",
|
||||
"style": {
|
||||
"navigationBarTitleText": "填写收货信息"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/help/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "使用帮助"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/agreement/user",
|
||||
"style": {
|
||||
"navigationBarTitleText": "用户协议"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/agreement/purchase",
|
||||
"style": {
|
||||
"navigationBarTitleText": "购买协议"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/activity/yifanshang/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "一番赏"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/activity/wuxianshang/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "无限赏"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/activity/duiduipeng/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "对对碰"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/activity/list/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "活动列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/activity/pata/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "爬塔"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/game/minesweeper/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "扫雷游戏"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "pages/game/webview",
|
||||
"style": {
|
||||
"navigationBarTitleText": "游戏挑战",
|
||||
"navigationBarBackgroundColor": "#000000",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
"root": "pages-game",
|
||||
"pages": [
|
||||
{
|
||||
"path": "game/minesweeper/index",
|
||||
"style": {
|
||||
"navigationStyle": "custom",
|
||||
"navigationBarTitleText": "扫雷 game"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "game/webview",
|
||||
"style": {
|
||||
"navigationBarTitleText": "游戏挑战",
|
||||
"navigationBarBackgroundColor": "#000000",
|
||||
"navigationBarTextStyle": "white"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"tabBar": {
|
||||
|
||||
@ -162,7 +162,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { onShow, onReachBottom, onShareAppMessage } from '@dcloudio/uni-app'
|
||||
import { onShow, onReachBottom, onShareAppMessage, onPullDownRefresh } from '@dcloudio/uni-app'
|
||||
import { getInventory, getProductDetail, redeemInventory, requestShipping, cancelShipping, listAddresses, getShipments, createAddressShare } from '@/api/appUser'
|
||||
|
||||
const currentTab = ref(0)
|
||||
@ -253,6 +253,20 @@ onShow(() => {
|
||||
}
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
const uid = uni.getStorageSync("user_id")
|
||||
page.value = 1
|
||||
hasMore.value = true
|
||||
// Reset lists
|
||||
if (currentTab.value === 1) {
|
||||
shippedList.value = []
|
||||
loadShipments(uid).finally(() => uni.stopPullDownRefresh())
|
||||
} else {
|
||||
aggregatedList.value = []
|
||||
loadInventory(uid).finally(() => uni.stopPullDownRefresh())
|
||||
}
|
||||
})
|
||||
|
||||
onReachBottom(() => {
|
||||
if (hasMore.value && !loading.value) {
|
||||
const uid = uni.getStorageSync("user_id")
|
||||
@ -415,7 +429,7 @@ async function loadShipments(uid) {
|
||||
|
||||
const next = page.value === 1 ? mapped : [...shippedList.value, ...mapped]
|
||||
shippedList.value = next
|
||||
if (list.length < pageSize.value || (page.value * pageSize.value >= total && total > 0)) { hasMore.value = false } else { page.value += 1 }
|
||||
if (page.value * pageSize.value >= total && total > 0) { hasMore.value = false } else { page.value += 1 }
|
||||
if (list.length === 0) { hasMore.value = false }
|
||||
} catch (e) {
|
||||
console.error('Load shipments error:', e)
|
||||
@ -429,7 +443,11 @@ async function loadInventory(uid) {
|
||||
if (loading.value) return
|
||||
loading.value = true
|
||||
try {
|
||||
const res = await getInventory(uid, page.value, pageSize.value)
|
||||
const params = {}
|
||||
if (currentTab.value === 0) {
|
||||
params.status = 1
|
||||
}
|
||||
const res = await getInventory(uid, page.value, pageSize.value, params)
|
||||
console.log('Inventory loaded:', res)
|
||||
|
||||
let list = []
|
||||
@ -446,138 +464,37 @@ async function loadInventory(uid) {
|
||||
total = res.length
|
||||
}
|
||||
|
||||
// 过滤 status=1 (正常) 或 status=3 (已使用/已发货/已兑换) 的物品
|
||||
// status=1: 正常在背包
|
||||
// status=3: 已处理(可能是已发货或已兑换积分)
|
||||
const filteredList = list.filter(item => {
|
||||
const s = Number(item.status)
|
||||
return s === 1 || s === 3
|
||||
})
|
||||
// 后端已经按 status 分页并聚合了,这里直接映射返回的 items
|
||||
const nextList = page.value === 1 ? [] : (currentTab.value === 1 ? [...shippedList.value] : [...aggregatedList.value])
|
||||
|
||||
// 调试日志:打印第一条数据以确认字段结构
|
||||
if (filteredList.length > 0) {
|
||||
console.log('Debug Inventory Item:', filteredList[0])
|
||||
}
|
||||
|
||||
// 根据当前 Tab 过滤是否发货
|
||||
const targetItems = filteredList.filter(item => {
|
||||
// Tab 0: 待处理 (has_shipment 为 false 且 status=1)
|
||||
// Tab 1: 已申请发货 (has_shipment 为 true)
|
||||
|
||||
// 注意:API 返回的 has_shipment 可能是布尔值 true/false,也可能是数字 1/0,或者是字符串 "true"/"false"
|
||||
// 这里做一个宽容的判断
|
||||
const isShipped = item.has_shipment === true || item.has_shipment === 1 || String(item.has_shipment) === 'true' || String(item.has_shipment) === '1'
|
||||
|
||||
if (currentTab.value === 1) {
|
||||
// 已申请发货列表:必须是已发货状态
|
||||
// 注意:有些记录 status=3 且 has_shipment=true 表示已发货
|
||||
return isShipped
|
||||
} else {
|
||||
// 待处理列表:未发货且 status=1 (status=3 且未发货的可能是已兑换积分,不应显示在待处理)
|
||||
return !isShipped && Number(item.status) === 1
|
||||
}
|
||||
})
|
||||
|
||||
console.log('Filtered list (status=1, tab=' + currentTab.value + '):', targetItems)
|
||||
|
||||
// 处理新数据
|
||||
const newItems = targetItems.map(item => {
|
||||
let imageUrl = ''
|
||||
try {
|
||||
let rawImg = item.product_images || item.image
|
||||
if (rawImg && typeof rawImg === 'string') {
|
||||
imageUrl = cleanUrl(rawImg)
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Image parse error:', e)
|
||||
}
|
||||
|
||||
const isShipped = item.has_shipment === true || item.has_shipment === 1 || String(item.has_shipment) === 'true' || String(item.has_shipment) === '1'
|
||||
|
||||
return {
|
||||
id: item.product_id || item.id, // 优先使用 product_id
|
||||
original_ids: [item.id], // 初始化 id 数组
|
||||
name: (item.product_name || item.name || '').trim(),
|
||||
list.forEach(item => {
|
||||
let imageUrl = cleanUrl(item.product_images || item.image)
|
||||
const mappedItem = {
|
||||
id: item.product_id,
|
||||
original_ids: item.inventory_ids || [],
|
||||
name: (item.product_name || '未知商品').trim(),
|
||||
image: imageUrl,
|
||||
price: item.product_price ? item.product_price / 100 : null, // 直接使用后端返回的价格
|
||||
count: 1,
|
||||
price: item.product_price ? item.product_price / 100 : null,
|
||||
count: item.count || 0,
|
||||
selected: false,
|
||||
selectedCount: 1,
|
||||
has_shipment: isShipped,
|
||||
updated_at: item.updated_at // 保留更新时间用于分组
|
||||
selectedCount: item.count || 0,
|
||||
has_shipment: item.has_shipment,
|
||||
updated_at: item.updated_at
|
||||
}
|
||||
nextList.push(mappedItem)
|
||||
})
|
||||
|
||||
console.log('Mapped new items:', newItems.length)
|
||||
|
||||
// 正确的聚合逻辑:
|
||||
// 1. 如果是第一页,直接基于 newItems 生成初始列表(带去重聚合)
|
||||
// 2. 如果是后续页,将 newItems 聚合到现有列表中
|
||||
|
||||
// 深拷贝当前列表
|
||||
let currentList = currentTab.value === 1 ? shippedList : aggregatedList
|
||||
let next = page.value === 1 ? [] : [...currentList.value]
|
||||
console.log('Final list (tab=' + currentTab.value + '):', JSON.parse(JSON.stringify(nextList)))
|
||||
|
||||
if (currentTab.value === 1) {
|
||||
// 已发货列表:按 updated_at 分组展示
|
||||
// 这里我们实际上不按 ID 聚合,而是直接把新数据追加进去,
|
||||
// 但为了 UI 展示,我们可以在前端通过 computed 或在这里预处理进行分组
|
||||
// 为了保持与原有列表结构一致(flat list),我们这里暂时按照 updated_at + product_id 聚合
|
||||
// 或者:既然用户要求按 updated_at 分组,可能希望看到的是“一次发货申请”作为一个卡片?
|
||||
// 这里的实现逻辑是:如果 updated_at 和 product_id 都相同,则聚合数量;否则作为新条目
|
||||
|
||||
newItems.forEach(newItem => {
|
||||
// 查找是否存在 updated_at 和 product_id 都相同的条目
|
||||
// 注意:updated_at 可能是 ISO 字符串,比较前最好截取到秒或直接比较字符串
|
||||
const existingItem = next.find(i =>
|
||||
i.id == newItem.id &&
|
||||
new Date(i.updated_at).getTime() === new Date(newItem.updated_at).getTime()
|
||||
)
|
||||
|
||||
if (existingItem) {
|
||||
existingItem.count += 1
|
||||
if (Array.isArray(existingItem.original_ids)) {
|
||||
existingItem.original_ids.push(...newItem.original_ids)
|
||||
}
|
||||
} else {
|
||||
next.push(newItem)
|
||||
}
|
||||
})
|
||||
|
||||
shippedList.value = nextList
|
||||
} else {
|
||||
// 待处理列表:按 product_id (id) 聚合
|
||||
newItems.forEach(newItem => {
|
||||
if (!newItem.id) {
|
||||
next.push(newItem)
|
||||
return
|
||||
}
|
||||
|
||||
const existingItem = next.find(i => i.id == newItem.id)
|
||||
if (existingItem) {
|
||||
existingItem.count += 1
|
||||
if (Array.isArray(existingItem.original_ids)) {
|
||||
existingItem.original_ids.push(...newItem.original_ids)
|
||||
} else {
|
||||
existingItem.original_ids = [...newItem.original_ids]
|
||||
}
|
||||
} else {
|
||||
next.push(newItem)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
console.log('Final aggregated list:', JSON.parse(JSON.stringify(next)))
|
||||
|
||||
if (currentTab.value === 1) {
|
||||
shippedList.value = next
|
||||
} else {
|
||||
aggregatedList.value = next
|
||||
aggregatedList.value = nextList
|
||||
}
|
||||
|
||||
// 判断是否还有更多
|
||||
// 注意:这里的 total 是总记录数(未过滤 status=1 之前的),
|
||||
// 我们的分页是基于原始数据的,所以判断依据是原始数据的分页进度
|
||||
if (list.length < pageSize.value || (page.value * pageSize.value >= total && total > 0)) {
|
||||
// 注意:这里的 total 是后端匹配过滤后的总记录数
|
||||
if ((page.value * pageSize.value >= total && total > 0) || list.length === 0) {
|
||||
hasMore.value = false
|
||||
} else {
|
||||
page.value += 1
|
||||
@ -673,7 +590,7 @@ async function onRedeem() {
|
||||
aggregatedList.value = []
|
||||
page.value = 1
|
||||
hasMore.value = true
|
||||
loadAllInventory(user_id)
|
||||
loadInventory(user_id)
|
||||
} catch (e) {
|
||||
uni.showToast({ title: e.message || '兑换失败', icon: 'none' })
|
||||
} finally {
|
||||
@ -721,7 +638,7 @@ async function onShip() {
|
||||
aggregatedList.value = []
|
||||
page.value = 1
|
||||
hasMore.value = true
|
||||
loadAllInventory(user_id)
|
||||
loadInventory(user_id)
|
||||
} catch (e) {
|
||||
uni.showToast({ title: e.message || '申请失败', icon: 'none' })
|
||||
} finally {
|
||||
@ -762,7 +679,7 @@ onShareAppMessage((res) => {
|
||||
showSharePopup.value = false
|
||||
return {
|
||||
title: `送你一个好礼,快来填写地址领走吧!`,
|
||||
path: `/pages/address/submit?token=${currentShareToken.value}`,
|
||||
path: `/pages-user/address/submit?token=${currentShareToken.value}`,
|
||||
imageUrl: sharingItem.value.image || '/static/logo.png'
|
||||
}
|
||||
})
|
||||
@ -809,7 +726,7 @@ async function onInvite(item) {
|
||||
function onCopyShareLink() {
|
||||
let url = currentShortLink.value
|
||||
if (!url) {
|
||||
url = `${window?.location?.origin || ''}/pages/address/submit?token=${currentShareToken.value}`
|
||||
url = `${window?.location?.origin || ''}/pages-user/address/submit?token=${currentShareToken.value}`
|
||||
}
|
||||
|
||||
uni.setClipboardData({
|
||||
|
||||
@ -52,7 +52,7 @@
|
||||
<view class="gameplay-grid-v2">
|
||||
<!-- 上排:两大核心 -->
|
||||
<view class="grid-row-top">
|
||||
<view class="game-card-large card-yifan" @tap="navigateTo('/pages/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-content-large">
|
||||
<text class="card-title-large">一番赏</text>
|
||||
@ -60,7 +60,7 @@
|
||||
<image class="card-mascot-large" src="https://via.placeholder.com/150/90EE90/000000?text=YI" mode="aspectFit" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="game-card-large card-wuxian" @tap="navigateTo('/pages/activity/list/index?category=无限赏')">
|
||||
<view class="game-card-large card-wuxian" @tap="navigateTo('/pages-activity/activity/list/index?category=无限赏')">
|
||||
<view class="card-content-large">
|
||||
<text class="card-title-large">无限赏</text>
|
||||
<view class="card-tag-large yellow">一发入魂</view>
|
||||
@ -71,13 +71,13 @@
|
||||
|
||||
<!-- 下排:三小功能 -->
|
||||
<view class="grid-row-bottom">
|
||||
<view class="game-card-small card-match" @tap="navigateTo('/pages/activity/list/index?category=对对碰')">
|
||||
<view class="game-card-small card-match" @tap="navigateTo('/pages-activity/activity/list/index?category=对对碰')">
|
||||
<text class="card-title-small">对对碰</text>
|
||||
<text class="card-subtitle-small">碰一碰消除</text>
|
||||
<image class="card-icon-small" src="https://via.placeholder.com/80/FFB6C1/000000?text=Match" mode="aspectFit" />
|
||||
</view>
|
||||
|
||||
<view class="game-card-small card-tower" @tap="navigateTo('/pages/game/minesweeper/index')">
|
||||
<view class="game-card-small card-tower" @tap="navigateTo('/pages-game/game/minesweeper/index')">
|
||||
<text class="card-title-small">扫雷</text>
|
||||
<text class="card-subtitle-small">福利挑战</text>
|
||||
<image class="card-icon-small" src="https://via.placeholder.com/80/9370DB/000000?text=Mine" mode="aspectFit" />
|
||||
@ -282,10 +282,10 @@ export default {
|
||||
const name = (a.category_name || a.categoryName || '').trim()
|
||||
const id = a.id
|
||||
let path = ''
|
||||
if (name.includes('一番赏')) path = '/pages/activity/yifanshang/index'
|
||||
else if (name.includes('无限赏')) path = '/pages/activity/wuxianshang/index'
|
||||
else if (name.includes('对对碰')) path = '/pages/activity/duiduipeng/index'
|
||||
else if (name.includes('爬塔')) path = '/pages/activity/pata/index'
|
||||
if (name.includes('一番赏')) path = '/pages-activity/activity/yifanshang/index'
|
||||
else if (name.includes('无限赏')) path = '/pages-activity/activity/wuxianshang/index'
|
||||
else if (name.includes('对对碰')) path = '/pages-activity/activity/duiduipeng/index'
|
||||
else if (name.includes('爬塔')) path = '/pages-activity/activity/pata/index'
|
||||
|
||||
if (path && id) {
|
||||
uni.navigateTo({ url: `${path}?id=${id}` })
|
||||
|
||||
@ -123,8 +123,8 @@ function handleTestLogin() {
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
function toUserAgreement() { uni.navigateTo({ url: '/pages/agreement/user' }) }
|
||||
function toPurchaseAgreement() { uni.navigateTo({ url: '/pages/agreement/purchase' }) }
|
||||
function toUserAgreement() { uni.navigateTo({ url: '/pages-user/agreement/user' }) }
|
||||
function toPurchaseAgreement() { uni.navigateTo({ url: '/pages-user/agreement/purchase' }) }
|
||||
|
||||
function onGetPhoneNumber(e) {
|
||||
if (!agreementChecked.value) {
|
||||
|
||||
@ -527,7 +527,7 @@ export default {
|
||||
const inviteCode = uni.getStorageSync('invite_code') || (uni.getStorageSync('user_info') || {}).invite_code || ''
|
||||
return {
|
||||
title: '🎁 好友邀请你一起玩,快来领福利!',
|
||||
path: inviteCode ? `/pages/invite/landing?invite_code=${inviteCode}` : '/pages/invite/landing',
|
||||
path: inviteCode ? `/pages-user/invite/landing?invite_code=${inviteCode}` : '/pages-user/invite/landing',
|
||||
imageUrl: '/static/share_invite.png'
|
||||
}
|
||||
},
|
||||
@ -565,7 +565,7 @@ export default {
|
||||
},
|
||||
getInviteSharePath() {
|
||||
const code = this.getInviteCode()
|
||||
return code ? `/pages/invite/landing?invite_code=${encodeURIComponent(code)}` : '/pages/invite/landing'
|
||||
return code ? `/pages-user/invite/landing?invite_code=${encodeURIComponent(code)}` : '/pages-user/invite/landing'
|
||||
},
|
||||
normalizePointsBalance(v) {
|
||||
if (v && typeof v === 'object') {
|
||||
@ -647,29 +647,29 @@ export default {
|
||||
uni.navigateTo({ url: '/pages/login/index' })
|
||||
},
|
||||
toOrders(status) {
|
||||
uni.navigateTo({ url: `/pages/orders/index?status=${status}` })
|
||||
uni.navigateTo({ url: `/pages-user/orders/index?status=${status}` })
|
||||
},
|
||||
toCabinetTab(tabIndex) {
|
||||
uni.setStorageSync('cabinet_target_tab', tabIndex)
|
||||
uni.switchTab({ url: '/pages/cabinet/index' })
|
||||
},
|
||||
toAddresses() {
|
||||
uni.navigateTo({ url: '/pages/address/index' })
|
||||
uni.navigateTo({ url: '/pages-user/address/index' })
|
||||
},
|
||||
toPointsPage() {
|
||||
uni.navigateTo({ url: '/pages/points/index' })
|
||||
uni.navigateTo({ url: '/pages-user/points/index' })
|
||||
},
|
||||
toCouponsPage() {
|
||||
uni.navigateTo({ url: '/pages/coupons/index' })
|
||||
uni.navigateTo({ url: '/pages-user/coupons/index' })
|
||||
},
|
||||
toItemCardsPage() {
|
||||
uni.navigateTo({ url: '/pages/item-cards/index' })
|
||||
uni.navigateTo({ url: '/pages-user/item-cards/index' })
|
||||
},
|
||||
toInvitesPage() {
|
||||
uni.navigateTo({ url: '/pages/invites/index' })
|
||||
uni.navigateTo({ url: '/pages-user/invites/index' })
|
||||
},
|
||||
toTasksPage() {
|
||||
uni.navigateTo({ url: '/pages/tasks/index' })
|
||||
uni.navigateTo({ url: '/pages-user/tasks/index' })
|
||||
},
|
||||
toHelp() {
|
||||
uni.showActionSheet({
|
||||
@ -677,11 +677,11 @@ export default {
|
||||
success: (res) => {
|
||||
const idx = Number(res && res.tapIndex)
|
||||
if (idx === 0) {
|
||||
uni.navigateTo({ url: '/pages/agreement/purchase' })
|
||||
uni.navigateTo({ url: '/pages-user/agreement/purchase' })
|
||||
return
|
||||
}
|
||||
if (idx === 1) {
|
||||
uni.navigateTo({ url: '/pages/agreement/user' })
|
||||
uni.navigateTo({ url: '/pages-user/agreement/user' })
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,7 +203,7 @@ function onSearchConfirm() { applyFilters() }
|
||||
|
||||
function onProductTap(p) {
|
||||
if (p.kind === 'product') {
|
||||
uni.navigateTo({ url: `/pages/shop/detail?id=${p.id}` })
|
||||
uni.navigateTo({ url: `/pages-shop/shop/detail?id=${p.id}` })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BIN
static/logo.png
BIN
static/logo.png
Binary file not shown.
|
Before Width: | Height: | Size: 311 KiB After Width: | Height: | Size: 92 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 518 KiB After Width: | Height: | Size: 44 KiB |
Loading…
x
Reference in New Issue
Block a user