diff --git a/api/synthesis.js b/api/synthesis.js new file mode 100644 index 0000000..0ba3f93 --- /dev/null +++ b/api/synthesis.js @@ -0,0 +1,13 @@ +import { authRequest } from '../utils/request' + +export function getSynthesisRecipes(userId) { + return authRequest({ url: `/api/app/users/${userId}/synthesis/recipes`, method: 'GET' }) +} + +export function doSynthesis(userId, recipeId) { + return authRequest({ url: `/api/app/users/${userId}/synthesis/do`, method: 'POST', data: { recipe_id: recipeId } }) +} + +export function getSynthesisLogs(userId, page = 1, pageSize = 20) { + return authRequest({ url: `/api/app/users/${userId}/synthesis/logs`, method: 'GET', data: { page, page_size: pageSize } }) +} diff --git a/pages-user/synthesis/index.vue b/pages-user/synthesis/index.vue new file mode 100644 index 0000000..429b781 --- /dev/null +++ b/pages-user/synthesis/index.vue @@ -0,0 +1,274 @@ + + + + + diff --git a/pages.json b/pages.json index 368e5fe..b2fb303 100755 --- a/pages.json +++ b/pages.json @@ -164,6 +164,12 @@ "navigationStyle": "default" } } + }, + { + "path": "synthesis/index", + "style": { + "navigationBarTitleText": "碎片合成" + } } ] }, diff --git a/pages/cabinet/index.vue b/pages/cabinet/index.vue index 1c5dabf..2ac89cd 100755 --- a/pages/cabinet/index.vue +++ b/pages/cabinet/index.vue @@ -21,6 +21,9 @@ 已申请发货 ({{ shippedList.length }}) + + 碎片合成 + @@ -38,15 +41,18 @@ - + + {{ item.name || '未命名道具' }} + 碎片 单价: ¥{{ item.price }} - 邀请填写 + 邀请填写 + 去合成 x{{ item.count || 1 }} - @@ -500,7 +506,8 @@ async function loadInventory(uid) { selected: false, selectedCount: item.count || 0, has_shipment: item.has_shipment, - updated_at: item.updated_at + updated_at: item.updated_at, + is_fragment: item.is_fragment || false } nextList.push(mappedItem) }) @@ -574,6 +581,10 @@ function changeCount(item, delta) { } } +function goSynthesis() { + uni.navigateTo({ url: '/pages-user/synthesis/index' }) +} + async function onRedeem() { vibrateShort() const user_id = uni.getStorageSync('user_id') @@ -1437,4 +1448,25 @@ function onCopyShareLink() { } } } + +.item-tag-fragment { + display: inline-block; + font-size: 20rpx; + padding: 2rpx 10rpx; + border-radius: 6rpx; + background: linear-gradient(135deg, #ff9800, #ff5722); + color: #fff; + margin-left: 8rpx; + vertical-align: middle; +} + +.synthesis-link { + font-size: 24rpx; + color: #667eea; + font-weight: bold; +} + +.fragment-placeholder { + width: 40rpx; +}