Commit 7ada8ee0 authored by 吴春's avatar 吴春

11

parent f6954d5f
<style> <style>
.koraNews { .koraNews {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
background: #f6f6f6; background: #f6f6f6;
overflow: hidden; overflow: hidden;
} }
.koraNewsList {
width: 100%; .koraNewsList {
padding: 0 15px; width: 100%;
margin-top: 20px; padding: 0 15px;
} margin-top: 20px;
.koraNews-time { }
width: 100%;
display: flex; .koraNews-time {
align-items: center; width: 100%;
justify-content: center; display: flex;
font-size: 12px; align-items: center;
color: #b9bcca; justify-content: center;
font-family: aa; font-size: 12px;
} color: #b9bcca;
.koraNews-box { font-family: aa;
width: 100%; }
border-radius: 6px;
.koraNews-box {
width: 100%;
border-radius: 6px;
background: #fff;
overflow: hidden;
margin-top: 10px;
}
.newsimgs {
width: 100%;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
height: 145px;
}
.n-img {
width: 100%;
height: 100%;
border-top-left-radius: 6px;
border-top-right-radius: 6px;
}
.box-conet {
width: 100%;
padding: 10px 15px;
}
background: #fff; .koraRName {
overflow: hidden; color: #111111;
margin-top: 10px; display: -webkit-box;
} -webkit-box-orient: vertical;
.newsimgs { -webkit-line-clamp: 2;
width: 100%; overflow: hidden;
border-top-left-radius: 6px; font-size: 28rpx;
border-top-right-radius: 6px; line-height: 30rpx;
height: 145px; font-weight: 600;
} }
.n-img {
width: 100%; .koraRName-f {
height: 100%; font-size: 12px;
border-top-left-radius: 6px; color: #999999;
border-top-right-radius: 6px; margin-top: 5px;
} overflow: hidden;
.box-conet { white-space: nowrap;
width: 100%; text-overflow: ellipsis;
padding: 10px 15px; }
}
.koraRName { .koraNewsSearch {
color: #111111; padding: 0px 10px 10px;
display: -webkit-box; }
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
font-size: 28rpx;
line-height: 30rpx;
font-weight: 600;
}
.koraRName-f {
font-size: 12px;
color: #999999;
margin-top: 5px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.koraNewsSearch {
padding: 0px 10px 10px;
}
</style> </style>
<template> <template>
<view class="koraNews"> <view class="koraNews">
<view class="koraNewsSearch" v-if="isauth"> <view class="koraNewsSearch" v-if="isauth">
<u-search <u-search action-text="搜索" :clearabled="true" style="width: 95%" :show-action="false" radius="40"
action-text="搜索" v-model="msg.Title" @search="getList(1)" @custom="getList(1)"></u-search>
:clearabled="true" </view>
style="width: 95%" <u-empty v-if="dataList.length == 0" text="暂无数据" mode="data"></u-empty>
:show-action="false" <scroll-view v-else :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
radius="40" style="height: calc(100vh - 139px)">
v-model="msg.Title" <view v-if="tenantId==18" style="font-size: 30rpx; font-weight: 700; color: #111; padding: 0 15px">资讯信息
@search="getList(1)" </view>
@custom="getList(1)" <view>
></u-search> <view class="koraNewsList" v-for="(item, index) in dataList" :key="index" @click="goNewsDetail(item)">
</view> <view class="koraNews-time">{{ item.CreateDate ? item.CreateDate.replace("T", " ") : ""}}
<!-- <view </view>
style=" <view class="koraNews-box">
display: flex; <view class="newsimgs" style="position: relative">
align-items: center; <image :src="item.CoverImg" mode="aspectFill" class="n-img" />
margin-bottom: 30rpx; <view style="top: 10px; left: 10px; position: absolute"
padding: 0px 15px; v-if="item.Industry && item.Industry.length > 0">
" <u-tag :text="item.Industry" mode="dark" bg-color="rgba(0,0,0,.4)" color="#FFF"
v-if="tenantId==18" size="mini"></u-tag>
> </view>
<image </view>
@click="goNewFirstShop" <view class="box-conet">
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616490607000_36.png" <view class="koraRName">{{ item.Title }}</view>
style="flex: 1; width: 1px; margin-right: 15rpx" <view class="koraRName-f">{{ item.Subtitle }}</view>
mode="widthFix" </view>
></image> </view>
<image </view>
@click="goMyFirstShop" </view>
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1616490607000_108.png" <u-loadmore :status="status" :load-text="loadText" :font-size="24" :margin-top="20" :margin-bottom="20"
style="flex: 1; width: 1px; margin-left: 15rpx" bg-color="#F6F6F6" />
mode="widthFix" </scroll-view>
></image> <tabbars></tabbars>
</view> -->
<u-empty v-if="dataList.length == 0" text="暂无数据" mode="data"></u-empty> <template v-show="setting&&setting.is_show_auth==1">
<scroll-view <auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth"></auth>
v-else </template>
:scroll-y="true"
:enable-back-to-top="true" </view>
:enable-flex="true"
@scrolltolower="lower"
style="height: calc(100vh - 189px)"
>
<view
v-if="tenantId==18"
style="font-size: 30rpx; font-weight: 700; color: #111; padding: 0 15px"
>资讯信息</view
>
<view>
<view
class="koraNewsList"
v-for="(item, index) in dataList"
:key="index"
@click="goNewsDetail(item)"
>
<view class="koraNews-time">{{
item.CreateDate ? item.CreateDate.replace("T", " ") : ""
}}</view>
<view class="koraNews-box">
<view class="newsimgs" style="position: relative">
<image :src="item.CoverImg" mode="aspectFill" class="n-img" />
<view
style="top: 10px; left: 10px; position: absolute"
v-if="item.Industry && item.Industry.length > 0"
>
<u-tag
:text="item.Industry"
mode="dark"
bg-color="rgba(0,0,0,.4)"
color="#FFF"
size="mini"
></u-tag>
</view>
</view>
<view class="box-conet">
<view class="koraRName">{{ item.Title }}</view>
<view class="koraRName-f">{{ item.Subtitle }}</view>
</view>
</view>
</view>
</view>
<view style="height: 30px;"></view>
<u-loadmore
:status="status"
:load-text="loadText"
:font-size="24"
:margin-top="20"
:margin-bottom="20"
bg-color="#F6F6F6"
/>
</scroll-view>
<tabbars></tabbars>
<template v-show="setting&&setting.is_show_auth==1">
<auth v-if="showAuth" @changeuserinfo="reloadUserinfo" @gbAuth="gbAuth" ></auth>
</template>
</view>
</template> </template>
<script> <script>
import tabbars from "@/components/tabbar/index"; import tabbars from "@/components/tabbar/index";
import auth from "@/components/auth/index.vue"; import auth from "@/components/auth/index.vue";
export default { export default {
components: { components: {
tabbars, tabbars,
auth auth
}, },
data() { data() {
return { return {
pageTitle: "首店经济", pageTitle: "首店经济",
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
Title: "", Title: "",
// Type:1 // Type:1
}, },
showAuth:false, showAuth: false,
u:{}, u: {},
isauth:false, isauth: false,
pageCount: 1, pageCount: 1,
dataList: [], dataList: [],
loadText: { loadText: {
loadmore: "轻轻上拉,加载更多", loadmore: "轻轻上拉,加载更多",
loading: "努力加载中", loading: "努力加载中",
nomore: "", nomore: "",
}, },
status: "", status: "",
CommpanyStatus: 0, //公司认证状态 CommpanyStatus: 0, //公司认证状态
FirstShopType: 0, //1:品牌,2:载体 FirstShopType: 0, //1:品牌,2:载体
tenantId:0, tenantId: 0,
setting:{}, setting: {},
}; };
}, },
onShareTimeline() { onShareTimeline() {
//朋友圈 //朋友圈
let uid = uni.getStorageSync("mall_UserInfo") let uid = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").UserId uni.getStorageSync("mall_UserInfo").UserId :
: 0; 0;
if (uid == 0) { if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
} }
let SmallShopId = uni.getStorageSync("mall_UserInfo") let SmallShopId = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").SmallShopId uni.getStorageSync("mall_UserInfo").SmallShopId :
: 0; 0;
if (SmallShopId == 0) { if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id //如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo") SmallShopId = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").UserSmallShopId uni.getStorageSync("mall_UserInfo").UserSmallShopId :
: 0; 0;
} }
let Up = uni.getStorageSync("mall_UserInfo") let Up = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").UserPageType uni.getStorageSync("mall_UserInfo").UserPageType :
: 0; 0;
return { return {
title: "首店经济", title: "首店经济",
query: "user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + Up, query: "user_id=" + uid + "&SmallShopId=" + SmallShopId + "&Up=" + Up,
imageUrl: "", imageUrl: "",
}; };
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
//朋友 //朋友
let uid = uni.getStorageSync("mall_UserInfo") let uid = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").UserId uni.getStorageSync("mall_UserInfo").UserId :
: 0; 0;
if (uid == 0) { if (uid == 0) {
uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0; uid = uni.getStorageSync("pid") ? uni.getStorageSync("pid").pid : 0;
} }
let SmallShopId = uni.getStorageSync("mall_UserInfo") let SmallShopId = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").SmallShopId uni.getStorageSync("mall_UserInfo").SmallShopId :
: 0; 0;
if (SmallShopId == 0) { if (SmallShopId == 0) {
//如果微店id为0 去找所属微店id //如果微店id为0 去找所属微店id
SmallShopId = uni.getStorageSync("mall_UserInfo") SmallShopId = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").UserSmallShopId uni.getStorageSync("mall_UserInfo").UserSmallShopId :
: 0; 0;
} }
let Up = uni.getStorageSync("mall_UserInfo") let Up = uni.getStorageSync("mall_UserInfo") ?
? uni.getStorageSync("mall_UserInfo").UserPageType uni.getStorageSync("mall_UserInfo").UserPageType :
: 0; 0;
return { return {
title: "首店经济", title: "首店经济",
path: path: "/pages/kotra/news?user_id=" +
"/pages/kotra/news?user_id=" + uid +
uid + "&SmallShopId=" +
"&SmallShopId=" + SmallShopId +
SmallShopId + "&Up=" +
"&Up=" + Up,
Up, imageUrl: "",
imageUrl: "", };
}; },
}, mounted() {
mounted() { this.u = uni.getStorageSync("mall_UserInfo");
this.u = uni.getStorageSync("mall_UserInfo"); let set = uni.getStorageSync("basedata") ?
let set = uni.getStorageSync("basedata") ? uni.getStorageSync("basedata").mall.setting : {};
uni.getStorageSync("basedata").mall.setting : {}; this.setting = set;
this.setting=set; if (!this.u) {
if (!this.u) { this.u = {
this.u = { nickName: "未登录",
nickName: "未登录", avatarUrl: "",
avatarUrl: "", };
}; this.showAuth = true;
this.showAuth = true; } else {
} else { this.tenantId = this.u.TenantId
this.tenantId = this.u.TenantId this.getList(1);
this.getList(1); this.getCommpanyStatus();
this.getCommpanyStatus(); this.isauth = true
this.isauth = true this.pageTitle = this.tenantId == 18 ? this.pageTitle : '商业资讯'
this.pageTitle = this.tenantId==18?this.pageTitle:'商业资讯' }
} uni.setNavigationBarTitle({
uni.setNavigationBarTitle({ title: this.pageTitle,
title: this.pageTitle, });
}); },
}, methods: {
methods: { reloadUserinfo() {
reloadUserinfo() { this.u = uni.getStorageSync("mall_UserInfo");
this.u = uni.getStorageSync("mall_UserInfo"); this.getList(1);
this.getList(1); this.getCommpanyStatus();
this.getCommpanyStatus(); this.isauth = true
this.isauth = true },
}, //关闭登录窗口
//关闭登录窗口 gbAuth() {
gbAuth() { this.showAuth = false
this.showAuth = false },
}, //获取数据
//获取数据 getList(num) {
getList(num) { if (num == 1) {
if (num == 1) { this.dataList = [];
this.dataList = []; }
} uni.showLoading({
uni.showLoading({ title: "加载中",
title: "加载中", });
}); this.request2({
this.request2( url: "/api/AppletTrade/GetNewsPage",
{ data: this.msg,
url: "/api/AppletTrade/GetNewsPage", },
data: this.msg, (res) => {
}, uni.hideLoading();
(res) => { if (res.resultCode == 1) {
uni.hideLoading(); this.dataList = this.dataList.concat(res.data.pageData);
if (res.resultCode == 1) { this.pageCount = res.data.pageCount;
this.dataList = this.dataList.concat(res.data.pageData); }
this.pageCount = res.data.pageCount; }
} );
} },
); //滚动加载
}, lower(e) {
//滚动加载 if (this.msg.pageIndex < this.pageCount) {
lower(e) { this.msg.pageIndex++;
if (this.msg.pageIndex < this.pageCount) { this.status = "loading";
this.msg.pageIndex++; this.getList();
this.status = "loading"; } else {
this.getList(); this.status = "nomore";
} else { }
this.status = "nomore"; },
} //跳转至新闻详情
}, goNewsDetail(item) {
//跳转至新闻详情 uni.navigateTo({
goNewsDetail(item) { url: "/pages/kotra/newsInDetail?Id=" + item.Id,
uni.navigateTo({ });
url: "/pages/kotra/newsInDetail?Id=" + item.Id, },
}); goNewFirstShop() {
}, this.auth("/pages/kotra/firstShop/firstShop");
goNewFirstShop() {
this.auth("/pages/kotra/firstShop/firstShop");
// uni.navigateTo({ // uni.navigateTo({
// url: "/pages/kotra/firstShop/firstShop", // url: "/pages/kotra/firstShop/firstShop",
// }); // });
}, },
goMyFirstShop() { goMyFirstShop() {
this.auth("/pages/kotra/firstShop/list"); this.auth("/pages/kotra/firstShop/list");
// uni.navigateTo({ // uni.navigateTo({
// url: "/pages/kotra/firstShop/list", // url: "/pages/kotra/firstShop/list",
// }); // });
}, },
auth(url) { auth(url) {
console.log(308, this.CommpanyStatus, this.FirstShopType); console.log(308, this.CommpanyStatus, this.FirstShopType);
if (this.CommpanyStatus === 1 || this.CommpanyStatus === 4) { if (this.CommpanyStatus === 1 || this.CommpanyStatus === 4) {
uni.showModal({ uni.showModal({
title: "提示", title: "提示",
content: "请您先完成实名认证", content: "请您先完成实名认证",
// showCancel: false, // showCancel: false,
confirmText: "立即认证", confirmText: "立即认证",
success: function (res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
uni.navigateTo({ uni.navigateTo({
url: "/pages/kotra/identification", url: "/pages/kotra/identification",
}); });
} else if (res.cancel) { } else if (res.cancel) {}
} },
}, });
}); } else if (this.CommpanyStatus === 3) {
} else if (this.CommpanyStatus === 3) { uni.showModal({
uni.showModal({ title: "提示",
title: "提示", content: "感谢您的厚爱,请等待认证通过以后再来尝试吧",
content: "感谢您的厚爱,请等待认证通过以后再来尝试吧", showCancel: false,
showCancel: false, confirmText: "我知道了",
confirmText: "我知道了", success: function(res) {
success: function (res) { if (res.confirm) {}
if (res.confirm) { },
} });
}, } else if (this.CommpanyStatus === 2) {
}); uni.showModal({
} else if (this.CommpanyStatus === 2) { title: "提示",
uni.showModal({ content: "认证待完善",
title: "提示", // showCancel: false,
content: "认证待完善", confirmText: "立即完善",
// showCancel: false, success: function(res) {
confirmText: "立即完善", if (res.confirm) {
success: function (res) { uni.navigateTo({
if (res.confirm) { url: "/pages/kotra/identification",
uni.navigateTo({ });
url: "/pages/kotra/identification", } else if (res.cancel) {}
}); },
} else if (res.cancel) { });
} } else if (this.CommpanyStatus === 5 && this.FirstShopType === 1) {
}, uni.navigateTo({
}); url: url,
} else if (this.CommpanyStatus === 5 && this.FirstShopType === 1) { });
uni.navigateTo({ }
url: url, },
}); getCommpanyStatus() {
} this.request2({
}, url: "/api/AppletTrade/GetCommpanyStatus",
getCommpanyStatus() { data: {},
this.request2( },
{ (res) => {
url: "/api/AppletTrade/GetCommpanyStatus", if (res.resultCode == 1) {
data: {}, this.CommpanyStatus = res.data.CompanyStatus;
}, this.FirstShopType = res.data.FirstShopType;
(res) => { }
if (res.resultCode == 1) { }
this.CommpanyStatus = res.data.CompanyStatus; );
this.FirstShopType = res.data.FirstShopType; },
} },
} };
); </script>
}, \ No newline at end of file
},
};
</script>
...@@ -53,11 +53,19 @@ ...@@ -53,11 +53,19 @@
<template> <template>
<view class="newsInDetail" style="height:100vh;"> <view class="newsInDetail" style="height:100vh;">
<view class="acdetailTop"> <view class="acdetailTop">
<view class="acdetaiTitle">{{dataList.Title}}</view> <view class="acdetaiTitle">
<template v-if="dataList&&dataList.Title">
{{dataList.Title}}
</template>
</view>
<view class="acdetaiWriter"> <view class="acdetaiWriter">
<view> <view>
<u-tag :text="dataList.Industry" type="primary" style="margin-right: 12px;"></u-tag> <u-tag v-if="dataList&&dataList.Industry" :text="dataList.Industry" type="primary" style="margin-right: 12px;"></u-tag>
<text>{{dataList.PublishTimeStr}}</text> <text>
<template v-if="dataList&&dataList.PublishTimeStr">
{{dataList.PublishTimeStr}}
</template>
</text>
</view> </view>
</view> </view>
</view> </view>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment