refactor(组件): 优化代码格式并移除未使用的评论代码
- 在articleList组件中格式化HTML结构并移除被注释的列表项内容 - 在搜索页面简化输入组件结构并调整登录验证逻辑 - 统一代码缩进和样式格式
This commit is contained in:
parent
df0b47d766
commit
8ce73d4bda
|
|
@ -18,15 +18,17 @@
|
|||
<view v-else>
|
||||
<view :class="['listItemTitle1']" v-html="item.title"> </view>
|
||||
</view>
|
||||
<view :class="['listItemAbstract', isLogin ? '' : 'mohu']" v-if="item.newType !== 'search'" v-html="item.summary"></view>
|
||||
<view :class="['listItemAbstract', isLogin ? '' : 'mohu']" v-else v-html="item.MarkInRedContent || item.abstract"></view>
|
||||
<view :class="['listItemAbstract', isLogin ? '' : 'mohu']" v-if="item.newType !== 'search'"
|
||||
v-html="item.summary"></view>
|
||||
<view :class="['listItemAbstract', isLogin ? '' : 'mohu']" v-else
|
||||
v-html="item.MarkInRedContent || item.abstract"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view class="tabContainer">
|
||||
<view class="tag">{{ item.tag }}</view>
|
||||
</view> -->
|
||||
|
||||
<!--
|
||||
<view :class="['listItemContent', isLogin ? '' : 'mohu']">
|
||||
<view style="display: flex">
|
||||
<view class="tag">{{ item.tag }}</view>
|
||||
|
|
@ -43,7 +45,7 @@
|
|||
<image class="option_icon" src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/share_icon%402x.png"></image>
|
||||
<text class="option_text">{{ item.shareNums }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="listItemFooter" v-if="item.needpay"></view> -->
|
||||
</view>
|
||||
|
|
@ -160,6 +162,7 @@ const handleClick = (item: any) => {
|
|||
text-align: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.listItemTitle {
|
||||
// font-size: 32rpx;
|
||||
// font-size: var(--h1-font-size);
|
||||
|
|
|
|||
|
|
@ -20,19 +20,12 @@
|
|||
|
||||
<!-- 搜索 start -->
|
||||
<view class="sreach">
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/static/icon_left.png" class="back_icon" @click="handleBack" />
|
||||
<image src="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/static/icon_left.png" class="back_icon"
|
||||
@click="handleBack" />
|
||||
|
||||
<view style="width: 75vw">
|
||||
<u-input
|
||||
v-model="keyWord"
|
||||
@change="handleChange"
|
||||
confirm-type="search"
|
||||
@confirm="getData()"
|
||||
prefixIcon="search"
|
||||
style="flex: 1"
|
||||
placeholder="搜索资讯"
|
||||
class="sreach_input"
|
||||
:border="false" />
|
||||
<u-input v-model="keyWord" @change="handleChange" confirm-type="search" @confirm="getData()" prefixIcon="search"
|
||||
style="flex: 1" placeholder="搜索资讯" class="sreach_input" :border="false" />
|
||||
</view>
|
||||
<text class="serach_btn" @click="getData()">搜索</text>
|
||||
</view>
|
||||
|
|
@ -44,11 +37,7 @@
|
|||
<!-- <view class="onLoad-btn" @click="onload" v-if="finish === false && inputValue">加载更多</view> -->
|
||||
|
||||
<view style="margin-top: 20vh">
|
||||
<u-empty
|
||||
v-if="screenList.length === 0"
|
||||
text="无搜索结果"
|
||||
width="157"
|
||||
height="100"
|
||||
<u-empty v-if="screenList.length === 0" text="无搜索结果" width="157" height="100"
|
||||
icon="https://cankao.obs.cn-east-3.myhuaweicloud.com/mini/newmini/nosearch_icon%E5%A4%87%E4%BB%BD%402x.png"></u-empty>
|
||||
</view>
|
||||
|
||||
|
|
@ -62,7 +51,8 @@
|
|||
<Pay :show="payShow" @onClick="handleClose" @handleSub="handleSub" />
|
||||
|
||||
<!-- 登录弹框 -->
|
||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose" @handlePopupSuccessCallback="handlePopupSuccessCallback" />
|
||||
<LoginPopup :show="LoginShow" @handlePopupClose="handlePopupClose"
|
||||
@handlePopupSuccessCallback="handlePopupSuccessCallback" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -152,14 +142,10 @@ const handleShowPay = (type) => {
|
|||
// 点击轮播图进入详情
|
||||
const handleSwiperJump = (item: any) => {
|
||||
console.log("item ===>", item);
|
||||
if (uni.getStorageSync("token")) {
|
||||
if (Session.get("token")) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/detail/indexNewsInfo?id=${item.id}&type=${item.type}`,
|
||||
});
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: "/pages/login/indexMini",
|
||||
});
|
||||
}
|
||||
// if (item.needpay) {
|
||||
// // 需要先弹出订阅的弹框
|
||||
|
|
@ -309,11 +295,13 @@ onShow(() => {
|
|||
color: #828b92;
|
||||
}
|
||||
}
|
||||
|
||||
.back_icon {
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
.custom-bav-bar {
|
||||
width: 100%;
|
||||
height: 88rpx;
|
||||
|
|
|
|||
Loading…
Reference in New Issue