refactor(api): 统一文章和导航查询接口命名
- 将getCmsArticleByCode重命名为getByCode - 新增cmsNavigation的getByCode查询方法 - 统一返回数据处理逻辑 style(ui): 调整商品详情页底部按钮样式 - 减少底部按钮区域内边距 - 调整咨询按钮文字大小和内间距 - 缩小耳机图标尺寸 chore(app): 移除多余空行和调试信息 - 删除组件间无用空白行 - 将邀请提示改为控制台输出 - 保持导出语句格式一致
This commit is contained in:
@@ -207,7 +207,7 @@ export async function getByIds(params?: CmsArticleParam) {
|
|||||||
/**
|
/**
|
||||||
* 根据code查询文章
|
* 根据code查询文章
|
||||||
*/
|
*/
|
||||||
export async function getCmsArticleByCode(code: string) {
|
export async function getByCode(code: string) {
|
||||||
const res = await request.get<ApiResult<CmsArticle>>(
|
const res = await request.get<ApiResult<CmsArticle>>(
|
||||||
'/cms/cms-article/getByCode/' + code
|
'/cms/cms-article/getByCode/' + code
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -123,3 +123,16 @@ export async function getNavigationByPath(params: CmsNavigationParam) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据code查询导航
|
||||||
|
*/
|
||||||
|
export async function getByCode(code: string) {
|
||||||
|
const res = await request.get<ApiResult<CmsNavigation>>(
|
||||||
|
'/cms/cms-navigation/getByCode/' + code
|
||||||
|
);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
return res.data;
|
||||||
|
}
|
||||||
|
return Promise.reject(new Error(res.message));
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,11 +78,7 @@ function App(props: { children: any; }) {
|
|||||||
|
|
||||||
// 显示邀请提示
|
// 显示邀请提示
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Taro.showToast({
|
console.log(`检测到邀请信息 ID:${inviteParams.inviter}`)
|
||||||
title: `检测到邀请信息 ID:${inviteParams.inviter}`,
|
|
||||||
icon: 'success',
|
|
||||||
duration: 3000
|
|
||||||
})
|
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -361,11 +361,11 @@ const GoodsDetail = () => {
|
|||||||
</View>
|
</View>
|
||||||
</Popup>
|
</Popup>
|
||||||
{/*底部购买按钮*/}
|
{/*底部购买按钮*/}
|
||||||
<View className={'fixed bg-white w-full bottom-0 left-0 pt-4 pb-8'}>
|
<View className={'fixed bg-white w-full bottom-0 left-0 pt-4 pb-6'}>
|
||||||
<View className={'btn-bar flex justify-between items-center'}>
|
<View className={'btn-bar flex justify-between items-center'}>
|
||||||
<View className={'flex justify-center items-center mx-4'}>
|
<View className={'flex justify-center items-center mx-4'}>
|
||||||
<button open-type="contact" className={'flex items-center'}>
|
<button open-type="contact" className={'flex items-center text-sm py-2'}>
|
||||||
<Headphones size={18} style={{marginRight: '4px'}}/>咨询
|
<Headphones size={16} style={{marginRight: '4px'}}/>咨询
|
||||||
</button>
|
</button>
|
||||||
</View>
|
</View>
|
||||||
<View className={'buy-btn mx-4'}>
|
<View className={'buy-btn mx-4'}>
|
||||||
|
|||||||
Reference in New Issue
Block a user