feat: 公告

This commit is contained in:
2025-12-13 16:53:31 +08:00
parent b711663966
commit 43851b703e
7 changed files with 631 additions and 211 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
"appid" : "__UNI__4910728", "appid" : "__UNI__4910728",
"description" : "信任桥优品是一款集线上商城、线下联盟商家的DAO聚合商城;通过“有趣”“有利”“有希望”的卖货玩法,吸引消费者、推广者、商家、投资人参与生态,共同打造共创共享的全球产业生态。", "description" : "信任桥优品是一款集线上商城、线下联盟商家的DAO聚合商城;通过“有趣”“有利”“有希望”的卖货玩法,吸引消费者、推广者、商家、投资人参与生态,共同打造共创共享的全球产业生态。",
"versionName" : "1.0.1", "versionName" : "1.0.1",
"versionCode" : 147, "versionCode" : 148,
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
+12
View File
@@ -514,6 +514,18 @@
"navigationStyle": "custom" "navigationStyle": "custom"
} }
}, },
{
"path": "announcement/announcement",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "announcement-detail/announcement-detail",
"style": {
"navigationStyle": "custom"
}
},
{ {
"path": "register/register", "path": "register/register",
"style": { "style": {
+374 -207
View File
@@ -1,17 +1,21 @@
<template> <template>
<view class="home_warp" :class="platformType ? '' :'iosplatformType'"> <view class="home_warp" :class="platformType ? '' : 'iosplatformType'">
<!-- 带背景的头部 --> <!-- 带背景的头部 -->
<view class="home_header_warp"></view> <view class="home_header_warp"></view>
<view class="home_content_z_warp"> <view class="home_content_z_warp">
<view class="header_title_warp"> <view class="header_title_warp">
<!-- <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/logo.png" width="86" height="30" bgColor="#f1f6ff00"></up-image> --> <!-- <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/logo.png" width="86" height="30" bgColor="#f1f6ff00"></up-image> -->
<!-- <view class="header_right_warp"> --> <!-- <view class="header_right_warp"> -->
<view class="language_warp" style="width: 100%;justify-content: flex-start;" @click="jumpSearch"> <view class="language_warp" style="width: 100%; justify-content: flex-start" @click="jumpSearch">
<view style="margin-top: 10rpx;"> <view style="margin-top: 10rpx">
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/search_b.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/search_b.png"
width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view> </view>
<text class="search_msg_warp">搜索</text> <text class="search_msg_warp">搜索</text>
</view> </view>
<image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/chart.png" class="chart_img"
@click.stop="jumpNewSearch('list')"></image>
<!-- <view class="language_warp" @click="languageShow = true"> <!-- <view class="language_warp" @click="languageShow = true">
<text>CN</text> <text>CN</text>
<up-image src="/static/common/down.png" width="10" height="10" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/down.png" width="10" height="10" bgColor="#f1f6ff00"></up-image>
@@ -38,54 +42,58 @@
</view> --> </view> -->
<!-- logo分类 --> <!-- logo分类 -->
<view class="logo_banner"> <view class="logo_banner">
<view style="padding: 20rpx 0 0 20rpx;"> <view style="padding: 20rpx 0 0 20rpx">
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/logo_banner.png" width="108" height="16" bgColor="#f1f6ff00"></up-image> <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/logo_banner.png"
width="108" height="16" bgColor="#f1f6ff00"></up-image>
<view class="logo_banner_title">TB聚合商城</view> <view class="logo_banner_title">TB聚合商城</view>
<view class="logo_banner_msg">全民共创共享的电商平台</view> <view class="logo_banner_msg">全民共创共享的电商平台</view>
</view> </view>
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/logo_banner2.png" width="140" height="98" <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/logo_banner2.png" width="140"
bgColor="#f1f6ff00"></up-image> height="98" bgColor="#f1f6ff00"></up-image>
</view> </view>
<!-- 分类 --> <!-- 分类 -->
<view class="home_sort_warp"> <view class="home_sort_warp">
<view class="sort_comm_warp" v-if="sortList && sortList.length !== 0 && isBlockedDate"> <view class="sort_comm_warp" v-if="sortList && sortList.length !== 0 && isBlockedDate">
<view v-for="item in sortList" :key="item.id" class="sort_item_comm" @click="jumpSort(item)"> <view v-for="item in sortList" :key="item.id" class="sort_item_comm" @click="jumpSort(item)">
<up-image :src="item.icon" width="40" height="32" bgColor="#f1f6ff00"></up-image> <up-image :src="item.icon" width="40" height="32" bgColor="#f1f6ff00"></up-image>
<view class="sort_item_title_comm">{{ item.name }}</view> <view class="sort_item_title_comm">{{ item.name }}</view>
</view> </view>
</view> </view>
<view v-else class="not_order_warp"> <view v-else class="not_order_warp">
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/not_order.png" width="80" height="80" <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/not_order.png" width="80"
bgColor="#f1f6ff00"></up-image> height="80" bgColor="#f1f6ff00"></up-image>
<view class="not_order_msg_warp">暂无分类</view> <view class="not_order_msg_warp">暂无分类</view>
</view> </view>
</view> </view>
<!-- 带灰色背景的内容 --> <!-- 带灰色背景的内容 -->
<view class="home_content_warp"> <view class="home_content_warp">
<!-- 爆款专区--> <!-- 爆款专区-->
<view class="product_comm hx_warp" @click="onJumpYou" v-if="faddishProduct && faddishProduct.length !== 0"> <view class="product_comm hx_warp" @click="onJumpYou"
v-if="faddishProduct && faddishProduct.length !== 0">
<view class="product_title"> <view class="product_title">
<view class="product_title_left"> <view class="product_title_left">
<text class="product_title_yp">信任桥优品</text> <text class="product_title_yp">信任桥优品</text>
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/youxuan.png" width="10" height="10" bgColor="#f1f6ff00"></up-image> <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/youxuan.png"
<text style="margin-left: 6rpx;color: #FFFFFF;">品牌5折秒杀福利</text> width="10" height="10" bgColor="#f1f6ff00"></up-image>
<text style="margin-left: 6rpx; color: #ffffff">品牌5折秒杀福利</text>
</view> </view>
<view class="product_title_f" style="font-weight: bold;" > <view class="product_title_f" style="font-weight: bold">
<text style="">立即抢购</text> <text style="">立即抢购</text>
<view style="margin: 6rpx 0 0 6rpx;"><up-image src="/static/common/right_y_st3.png" width="12" height="12" <view style="margin: 6rpx 0 0 6rpx"><up-image src="/static/common/right_y_st3.png"
bgColor="#f1f6ff00"></up-image></view> width="12" height="12" bgColor="#f1f6ff00"></up-image></view>
</view> </view>
</view> </view>
<view <view :class="faddishProduct && faddishProduct.length > 2
:class="faddishProduct && faddishProduct.length > 2 ? 'product_content product_content2' : 'product_content'"> ? 'product_content product_content2'
: 'product_content'
">
<up-loading-icon :show="productLoading"></up-loading-icon> <up-loading-icon :show="productLoading"></up-loading-icon>
<view :class="faddishProduct && faddishProduct.length > 2 ? 'product_item2' : 'product_item'" <view :class="faddishProduct && faddishProduct.length > 2
v-for="item in faddishProduct" :key="item.id" @click.stop="jumpInfo(item)"> ? 'product_item2'
: 'product_item'
" v-for="item in faddishProduct" :key="item.id" @click.stop="jumpInfo(item)">
<up-image :src="item.url" width="100%" height="130" bgColor="#f1f6ff00" shape="square" <up-image :src="item.url" width="100%" height="130" bgColor="#f1f6ff00" shape="square"
radius='15'></up-image> radius="15"></up-image>
<view class="product_f_item"> <view class="product_f_item">
<view class="product_f_item_name">{{ item.title }}</view> <view class="product_f_item_name">{{ item.title }}</view>
<view class="product_f_item_price product_f_item_price_hx">优选价{{ item.price }}元</view> <view class="product_f_item_price product_f_item_price_hx">优选价{{ item.price }}元</view>
@@ -104,12 +112,14 @@
<view>好物随心兑</view> <view>好物随心兑</view>
<view class="content_msg_but"> <view class="content_msg_but">
立即抢购 立即抢购
<view style="margin-top: 6rpx;margin-left: 4rpx;"><up-image src="/static/common/right_y.png" <view style="margin-top: 6rpx; margin-left: 4rpx"><up-image
width="10" height="10" bgColor="#f1f6ff00"></up-image></view> src="/static/common/right_y.png" width="10" height="10"
bgColor="#f1f6ff00"></up-image></view>
</view> </view>
</view> </view>
</view> </view>
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/min_card_jfdh_2.png" width="66" height="66" bgColor="#f1f6ff00"></up-image> <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/min_card_jfdh_2.png"
width="66" height="66" bgColor="#f1f6ff00"></up-image>
</view> </view>
<!-- 红包抽奖 --> <!-- 红包抽奖 -->
<view class="min_card_item" @click="jumpTurntable"> <view class="min_card_item" @click="jumpTurntable">
@@ -120,12 +130,14 @@
<view>现金红包等你拿!</view> <view>现金红包等你拿!</view>
<view class="content_msg_but"> <view class="content_msg_but">
立即抢购 立即抢购
<view style="margin-top: 6rpx;margin-left: 4rpx;"><up-image src="/static/common/right_y.png" <view style="margin-top: 6rpx; margin-left: 4rpx"><up-image
width="10" height="10" bgColor="#f1f6ff00"></up-image></view> src="/static/common/right_y.png" width="10" height="10"
bgColor="#f1f6ff00"></up-image></view>
</view> </view>
</view> </view>
</view> </view>
<up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/min_card_hbcj_2.png" width="66" height="66" bgColor="#f1f6ff00"></up-image> <up-image src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/home/min_card_hbcj_2.png"
width="66" height="66" bgColor="#f1f6ff00"></up-image>
</view> </view>
</view> </view>
<!-- 好物优选 --> <!-- 好物优选 -->
@@ -135,20 +147,24 @@
<text class="product_title_z">平价专区</text> <text class="product_title_z">平价专区</text>
<text class="product_title_zk">4折起</text> <text class="product_title_zk">4折起</text>
</view> </view>
<view class="product_title_f" style="color: #7632FF;"> <view class="product_title_f" style="color: #7632ff">
<text style="">立即抢购</text> <text style="">立即抢购</text>
<view style="margin: 6rpx 0 0 6rpx;"><up-image src="/static/common/right_y_st4.png" width="10" height="10" <view style="margin: 6rpx 0 0 6rpx"><up-image src="/static/common/right_y_st4.png"
bgColor="#f1f6ff00"></up-image></view> width="10" height="10" bgColor="#f1f6ff00"></up-image></view>
</view> </view>
</view> </view>
<view class="product_tips">平价专区 抢到就是赚到!</view> <view class="product_tips">平价专区 抢到就是赚到!</view>
<view <view :class="yxProduct && yxProduct.length > 3
:class="yxProduct && yxProduct.length > 3 ? 'product_content_yx product_content2' : 'product_content_yx'"> ? 'product_content_yx product_content2'
: 'product_content_yx'
">
<up-loading-icon :show="productLoading"></up-loading-icon> <up-loading-icon :show="productLoading"></up-loading-icon>
<view :class="yxProduct && yxProduct.length < 4 ? 'product_item_yx product_item_yx2' : 'product_item_yx'" <view :class="yxProduct && yxProduct.length < 4
v-for="item in yxProduct" :key="item.id"> ? 'product_item_yx product_item_yx2'
: 'product_item_yx'
" v-for="item in yxProduct" :key="item.id">
<up-image :src="item.url" width="100%" height="80" bgColor="#f1f6ff00" shape="square" <up-image :src="item.url" width="100%" height="80" bgColor="#f1f6ff00" shape="square"
radius='10'></up-image> radius="10"></up-image>
<!-- <view class="product_f_item"> <!-- <view class="product_f_item">
<view class="product_f_item_name">{{item.title}}</view> <view class="product_f_item_name">{{item.title}}</view>
<view class="product_f_item_price product_f_item_price_yx">优选价{{item.adPrice}}元</view> <view class="product_f_item_price product_f_item_price_yx">优选价{{item.adPrice}}元</view>
@@ -159,12 +175,11 @@
<!-- 为您精选 --> <!-- 为您精选 -->
<choiceness /> <choiceness />
</view> </view>
</view> </view>
<!-- 暂未开放 --> <!-- 暂未开放 -->
<up-modal :show="openShow" :showConfirmButton="false"> <up-modal :show="openShow" :showConfirmButton="false">
<view class="slot-content"> <view class="slot-content">
<view class="close_warp" @click="openShow = false;"> <view class="close_warp" @click="openShow = false">
<up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image> <up-image src="/static/common/close.png" width="20" height="20" bgColor="#f1f6ff00"></up-image>
</view> </view>
<view class="content_"> <view class="content_">
@@ -172,7 +187,7 @@
<view class="content_2">暂未开放</view> <view class="content_2">暂未开放</view>
</view> </view>
<view class="but_"> <view class="but_">
<view class="but_copy" @click="openShow = false;">确定</view> <view class="but_copy" @click="openShow = false">确定</view>
</view> </view>
</view> </view>
</up-modal> </up-modal>
@@ -184,12 +199,16 @@
<up-overlay :show="bannerShow"> <up-overlay :show="bannerShow">
<view class="up_content" @tap.stop> <view class="up_content" @tap.stop>
<view class="uni-banner"> <view class="uni-banner">
<view class="close_btn" @click="bannerShow = false;"></view> <view class="close_btn" @click="bannerShow = false"></view>
<view class="banner_box"> <view class="banner_box">
<view class="conter">{{ updateApkObj.content }}</view> <view class="conter">{{ updateApkObj.content }}</view>
<view class="banner_foot" v-if="!bannerPercentageShow"> <view class="banner_foot" v-if="!bannerPercentageShow">
<button @click="goUpdate(updateApkObj, platformType)" class="banner_foot_button">立即更新</button> <button @click="goUpdate(updateApkObj, platformType)" class="banner_foot_button">
<view @click="bannerShow = false;" class="banner_foot_button_no" v-if="!updateApkObj.isForce">暂不更新</view> 立即更新
</button>
<view @click="bannerShow = false" class="banner_foot_button_no"
v-if="!updateApkObj.isForce">暂不更新
</view>
</view> </view>
<view v-else> <view v-else>
<up-line-progress :percentage="bannerPercentage" activeColor="#a85cfa"></up-line-progress> <up-line-progress :percentage="bannerPercentage" activeColor="#a85cfa"></up-line-progress>
@@ -201,177 +220,240 @@
</view> </view>
</view> </view>
</up-overlay> </up-overlay>
<!-- 公告弹窗 -->
<up-overlay :show="newsShow">
<view class="up_content" @tap.stop>
<view class="uni-banner-news">
<view class="close_btn" @click="newsShow = false"></view>
<view class="banner_box">
<view class="banner_box-title">{{ newsList[0].title }}</view>
<view class="banner_box-subTitle">{{ newsList[0].subTitle }}</view>
<view class="banner_box-btn" @click="jumpNewSearch">查看</view>
</view>
</view>
</view>
</up-overlay>
<HomePopup :show="homeShow" :dataObj="curData" @jumpShop="onJumpShop"></HomePopup> <HomePopup :show="homeShow" :dataObj="curData" @jumpShop="onJumpShop"></HomePopup>
</view> </view>
</template> </template>
<script> <script>
import { getGoodsDetail } from "@/api/product.js"; import { getGoodsDetail } from "@/api/product.js";
import choiceness from '@/components/choiceness/choiceness.vue'; import choiceness from "@/components/choiceness/choiceness.vue";
import { searchList } from '@/api/product.js'; import { searchList } from "@/api/product.js";
import { getCascadeCategory, checkAppVersion, getCarouselImage } from '@/api/common.js';
import { SEARCH_TYPE, APP_PAGE_TYPE } from '@/utils/enumUtils.js'
import CustomTabBar from '@/components/custom-tab-bar.vue'; // 引入自定义组件路径可能需要根据项目结构调整
import dayjs from 'dayjs';
import useTabber from "tabber-component";
import { comparisonVersionHandler } from '@/utils/index.js';
import HomePopup from '@/components/common/home-popup.vue'
import { import {
SHARE_URL, getCascadeCategory,
} from "@/utils/config.js"; checkAppVersion,
getCarouselImage,
} from "@/api/common.js";
import { SEARCH_TYPE, APP_PAGE_TYPE } from "@/utils/enumUtils.js";
import CustomTabBar from "@/components/custom-tab-bar.vue"; // 引入自定义组件路径可能需要根据项目结构调整
import dayjs from "dayjs";
import useTabber from "tabber-component";
import { getNewsList } from "@/api/news.js";
import { comparisonVersionHandler } from "@/utils/index.js";
import HomePopup from "@/components/common/home-popup.vue";
import { SHARE_URL } from "@/utils/config.js";
export default { export default {
components: { choiceness, CustomTabBar,HomePopup }, components: { choiceness, CustomTabBar, HomePopup },
data() { data() {
return { return {
swiperList: [ swiperList: [],
],
currentNum: 0, currentNum: 0,
sortList: [], sortList: [],
languageShow: false,// 语言选项 languageShow: false, // 语言选项
languageList: [ languageList: [
{ {
name: '中文', name: "中文",
key: "CN" key: "CN",
}, { },
name: '英文', {
key: "EN" name: "英文",
key: "EN",
}, },
], ],
currentLanguage: {}, currentLanguage: {},
yxProduct: [],// 好物优选列表 yxProduct: [], // 好物优选列表
faddishProduct: [],// 爆款专区 faddishProduct: [], // 爆款专区
hotList: [],// 热门 hotList: [], // 热门
productLoading: false, productLoading: false,
openShow: false, openShow: false,
platformType: null,// 当前设备信息 platformType: null, // 当前设备信息
bannerShow: false, // 是否需要強制更新app bannerShow: false, // 是否需要強制更新app
type: '', // 设备类型 android:2, ios:1 type: "", // 设备类型 android:2, ios:1
updateApkObj: {}, // 后台数据 updateApkObj: {}, // 后台数据
bannerPercentageShow: false,// 是否显示进度条 bannerPercentageShow: false, // 是否显示进度条
bannerPercentage: 0,// 进度条 bannerPercentage: 0, // 进度条
curId:null, curId: null,
curData:null, curData: null,
homeShow:false homeShow: false,
newsList: [], // 公告列表
} newsShow: false, // 是否显示公告弹窗
};
}, },
onShow() { onShow() {
/*#ifdef APP-PLUS*/ /*#ifdef APP-PLUS*/
uni.hideTabBar({ uni.hideTabBar({
animation: false animation: false,
}) });
/*#endif*/ /*#endif*/
// 获取设备是安卓还是ios // 获取设备是安卓还是ios
const appUpdate = uni.getStorageSync('platform'); const appUpdate = uni.getStorageSync("platform");
const versionUpdateTime = uni.getStorageSync("versionUpdateTime"); const versionUpdateTime = uni.getStorageSync("versionUpdateTime");
// #ifdef APP-PLUS // #ifdef APP-PLUS
console.log("上次更新时间 versionUpdateTime", dayjs(versionUpdateTime).format("YYYY-MM-DD HH:mm:ss")); console.log(
"上次更新时间 versionUpdateTime",
dayjs(versionUpdateTime).format("YYYY-MM-DD HH:mm:ss")
);
console.log("当前时间戳", dayjs().format("YYYY-MM-DD HH:mm:ss")); console.log("当前时间戳", dayjs().format("YYYY-MM-DD HH:mm:ss"));
const time1 = dayjs(versionUpdateTime);// 上一次更新的时间 const time1 = dayjs(versionUpdateTime); // 上一次更新的时间
const time2 = dayjs(); const time2 = dayjs();
const diff = time2.diff(time1); const diff = time2.diff(time1);
if (!versionUpdateTime || diff > 5 * 60 * 1000) { if (!versionUpdateTime || diff > 5 * 60 * 1000) {
this.platformType = appUpdate == "android" ? "ANDROID" : "IOS";
this.platformType = appUpdate == 'android' ? 'ANDROID' : 'IOS'; this.checkUpdate(); // 判断是否需要更新
this.checkUpdate(); // 判断是否需要更新
} else { } else {
this.onClipboard(); this.onClipboard();
} }
// #endif // #endif
this.getSortList(); this.getSortList();
this.querySearchList(SEARCH_TYPE.SOMETHING);// 好物专区 this.querySearchList(SEARCH_TYPE.SOMETHING); // 好物专区
this.querySearchList(SEARCH_TYPE.EXPLOSIVE);// 爆单专区 this.querySearchList(SEARCH_TYPE.EXPLOSIVE); // 爆单专区
this.getCarouselImage(); this.getCarouselImage();
this.onNews(); // 获取公告
}, },
onLoad(){ onLoad() { },
}, mounted() { },
mounted() {
},
methods: { methods: {
onJumpShop(){ // 获取公告
jumpNewSearch(type) {
if (type === 'list') {
uni.navigateTo({url:"/pages/login_package/announcement/announcement"});
return;
}
uni.setStorageSync("isReadNews", this.newsList[0].id);
uni.navigateTo({ uni.navigateTo({
url:`/pages/other_package/productInfo/productInfo?id=${this.curId}` url:
}) "/pages/login_package/announcement-detail/announcement-detail?id=" +
this.newsList[0].id,
});
},
onNews() {
getNewsList({
category: 2,
type: 0,
page: 1,
pageSize: 10,
}).then((res) => {
console.log("获取公告", res);
if (res.bizcode === 100) {
this.newsList = res.data.entitys || [];
console.log(this.newsList);
const id = uni.getStorageSync("isReadNews");
this.newsShow = false;
if (id != this.newsList[0].id && this.newsList[0].isPop === 1) {
this.newsShow = true;
}
}
});
},
// 查看详情
onJumpNews() {
uni.navigateTo({
url: `/pages/login_package/news/news?id=${this.newsList[0].id}`,
});
},
onJumpShop() {
uni.navigateTo({
url: `/pages/other_package/productInfo/productInfo?id=${this.curId}`,
});
this.curId = null; this.curId = null;
this.curData = null; this.curData = null;
this.homeShow = false; this.homeShow = false;
}, },
onClipboard(){ onClipboard() {
let _this = this; let _this = this;
uni.getClipboardData({ uni.getClipboardData({
success: function(res) { success: function (res) {
// http://localhost:5173/#/pages/other_package/productInfo/productInfo?id=1038 // http://localhost:5173/#/pages/other_package/productInfo/productInfo?id=1038
console.log(res.data); // 剪贴板内容 console.log(res.data); // 剪贴板内容
if(res.data.indexOf(`${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=`) != -1){ if (
res.data.indexOf(
`${SHARE_URL}/#/pages/other_package/productInfo/productInfo?id=`
) != -1
) {
uni.showModal({ uni.showModal({
title:'', title: "",
content:'当前APP想要粘贴商品详情,是否继续?', content: "当前APP想要粘贴商品详情,是否继续?",
success:(res1=>{ success: (res1) => {
if(res1.confirm){ if (res1.confirm) {
let id = res.data.match(/=(.*?)\s/); let id = res.data.match(/=(.*?)\s/);
_this.curId = Number(id[1]); _this.curId = Number(id[1]);
_this.getShop(); _this.getShop();
uni.setClipboardData({ uni.setClipboardData({
data: '', data: "",
}); });
} }
}), },
fail:(res2=>{ fail: (res2) => {
uni.setClipboardData({ uni.setClipboardData({
data: '', data: "",
}); });
}) },
}) });
} }
}, },
fail: function(err) { fail: function (err) {
console.error('获取剪贴板内容失败', err); console.error("获取剪贴板内容失败", err);
} },
}); });
}, },
getShop(){ getShop() {
const params = { const params = {
id: this.curId, id: this.curId,
}; };
getGoodsDetail(params).then(res=>{ getGoodsDetail(params).then((res) => {
this.curData = res.data; this.curData = res.data;
this.homeShow = true; this.homeShow = true;
}); });
}, },
onJumpYou(){ onJumpYou() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/rwa_package/shop/you-shop' url: "/pages/rwa_package/shop/you-shop",
}) });
}, },
checkUpdate() { checkUpdate() {
const self = this, const self = this,
localAppVersonName = uni.getStorageSync('version'), localAppVersonName = uni.getStorageSync("version"),
localAppVerson = uni.getStorageSync('versionCode'); localAppVerson = uni.getStorageSync("versionCode");
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, function (widgetInfo) { plus.runtime.getProperty(plus.runtime.appid, function (widgetInfo) {
const params = { const params = {
terminal: self.platformType, terminal: self.platformType,
versionCode: localAppVerson, versionCode: localAppVerson,
} };
console.log("wgt更新-0", params) console.log("wgt更新-0", params);
checkAppVersion(params).then(res => { checkAppVersion(params).then((res) => {
console.log("wgt更新-1", res) console.log("wgt更新-1", res);
if (res && res.bizcode === 100) { if (res && res.bizcode === 100) {
const data = res.data || {}; const data = res.data || {};
// app大版本更新,versionName:1.0.1 versionCode:102 // app大版本更新,versionName:1.0.1 versionCode:102
if (data && Object.keys(data).length !== 0 && comparisonVersionHandler(localAppVerson, data.versionCode)) { if (
uni.hideTabBar() // 隐藏首页底部tabbar 按钮 data &&
Object.keys(data).length !== 0 &&
comparisonVersionHandler(localAppVerson, data.versionCode)
) {
uni.hideTabBar(); // 隐藏首页底部tabbar 按钮
self.updateApkObj = data; self.updateApkObj = data;
self.bannerShow = true; // 显示弹窗 self.bannerShow = true; // 显示弹窗
return; return;
} else { } else {
console.log("wgt更新-2");
console.log("wgt更新-2")
self.onClipboard(); self.onClipboard();
return; return;
} }
@@ -384,37 +466,46 @@ export default {
// 安装 // 安装
goUpdate(updateApkObj, platformType) { goUpdate(updateApkObj, platformType) {
const self = this; const self = this;
if (platformType == 'ANDROID') { if (platformType == "ANDROID") {
// 弹出系统等待对话框 // 弹出系统等待对话框
var dtask = plus.downloader.createDownload(updateApkObj.downloadUrl, {}, function (d, status) { var dtask = plus.downloader.createDownload(
// 下载完成 updateApkObj.downloadUrl,
if (status == 200) { {},
plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename), { force: true }, function (resp) { function (d, status) {
// 直接重启APP // 下载完成
uni.setStorageSync('versionUpdateTime', dayjs().valueOf()); // 记录升级的时间 if (status == 200) {
plus.runtime.restart(); plus.runtime.install(
}, function (error) { plus.io.convertLocalFileSystemURL(d.filename),
console.log("error", error); { force: true },
function (resp) {
// 直接重启APP
uni.setStorageSync("versionUpdateTime", dayjs().valueOf()); // 记录升级的时间
plus.runtime.restart();
},
function (error) {
console.log("error", error);
uni.showToast({
title: error.message,
mask: false,
duration: 1500,
});
}
);
} else {
self.bannerPercentageShow = false;
uni.showToast({ uni.showToast({
title: error.message, title: "更新失败",
mask: false, mask: false,
duration: 1500 duration: 1500,
}); });
}); }
} else {
self.bannerPercentageShow = false;
uni.showToast({
title: '更新失败',
mask: false,
duration: 1500
});
} }
}); );
try { try {
dtask.start(); // 开启下载的任务 dtask.start(); // 开启下载的任务
let prg = 0; let prg = 0;
this.bannerPercentageShow = true; this.bannerPercentageShow = true;
dtask.addEventListener('statechanged', function (task, status) { dtask.addEventListener("statechanged", function (task, status) {
// 给下载任务设置一个监听 并根据状态 做操作 // 给下载任务设置一个监听 并根据状态 做操作
switch (task.state) { switch (task.state) {
case 1: case 1:
@@ -422,12 +513,16 @@ export default {
case 2: case 2:
break; break;
case 3: case 3:
prg = parseInt((parseFloat(task.downloadedSize) / parseFloat(task.totalSize)) * 100); prg = parseInt(
(parseFloat(task.downloadedSize) /
parseFloat(task.totalSize)) *
100
);
self.bannerPercentage = prg; self.bannerPercentage = prg;
break; break;
case 4: case 4:
plus.nativeUI.closeWaiting(); plus.nativeUI.closeWaiting();
self.bannerShow = false; // 显示弹窗 self.bannerShow = false; // 显示弹窗
break; break;
} }
}); });
@@ -435,12 +530,13 @@ export default {
console.log("更新失败-03err", err); console.log("更新失败-03err", err);
plus.nativeUI.closeWaiting(); plus.nativeUI.closeWaiting();
uni.showToast({ uni.showToast({
title: '更新失败-03', title: "更新失败-03",
mask: false, mask: false,
duration: 1500 duration: 1500,
}); });
} }
} else if (platformType == 'IOS') { // ios跳转到app store } else if (platformType == "IOS") {
// ios跳转到app store
plus.runtime.openURL(updateApkObj.downloadUrl); plus.runtime.openURL(updateApkObj.downloadUrl);
} }
}, },
@@ -449,40 +545,41 @@ export default {
async getCarouselImage() { async getCarouselImage() {
const params = { const params = {
pageUi: APP_PAGE_TYPE.HOME, pageUi: APP_PAGE_TYPE.HOME,
} };
const resp = await getCarouselImage(params); const resp = await getCarouselImage(params);
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
const data = resp.data || []; const data = resp.data || [];
this.swiperList = data.length !== 0 ? data.map(obj => obj.carouselImage) : []; this.swiperList =
data.length !== 0 ? data.map((obj) => obj.carouselImage) : [];
} }
}, },
jumpIntegral() { jumpIntegral() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/rwa_package/shop/fen-shop', url: "/pages/rwa_package/shop/fen-shop",
}) });
}, },
jumpTurntable() { jumpTurntable() {
// uni.navigateTo({ // uni.navigateTo({
// url: '/pages/other_package/turntable/turntable?backPath=home', // url: '/pages/other_package/turntable/turntable?backPath=home',
// }) // })
uni.navigateTo({ uni.navigateTo({
url: '/pages/other_package/nine-grid/nine-grid?backPath=home', url: "/pages/other_package/nine-grid/nine-grid?backPath=home",
}) });
}, },
jumpPrdference() { jumpPrdference() {
uni.switchTab({ uni.switchTab({
url: '/pages/supply_chain/supply_chain', url: "/pages/supply_chain/supply_chain",
}) });
}, },
jumpWelcome() { jumpWelcome() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login_package/welcome/welcome', url: "/pages/login_package/welcome/welcome",
}) });
}, },
jumpSearch() { jumpSearch() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/rwa_package/dongjian/search', url: "/pages/rwa_package/dongjian/search",
}) });
}, },
/** /**
* 查询商品列表 * 查询商品列表
@@ -492,14 +589,16 @@ export default {
const params = { const params = {
type, type,
page: 1, page: 1,
isRecomm:true, isRecomm: true,
pageSize: type === SEARCH_TYPE.SOMETHING ? 4 : 3, pageSize: type === SEARCH_TYPE.SOMETHING ? 4 : 3,
} };
const resp = await searchList(params); const resp = await searchList(params);
if (resp && resp.bizcode === 100) { if (resp && resp.bizcode === 100) {
if (type === SEARCH_TYPE.SOMETHING) {// 好物优选 if (type === SEARCH_TYPE.SOMETHING) {
// 好物优选
this.yxProduct = resp.data; this.yxProduct = resp.data;
} else if (type === SEARCH_TYPE.EXPLOSIVE) {// 爆单专区 } else if (type === SEARCH_TYPE.EXPLOSIVE) {
// 爆单专区
this.faddishProduct = resp.data; this.faddishProduct = resp.data;
} }
} }
@@ -516,25 +615,25 @@ export default {
}, },
// 跳转到分类栏目 // 跳转到分类栏目
jumpSort(item) { jumpSort(item) {
uni.setStorageSync('sortId', item.id); uni.setStorageSync("sortId", item.id);
uni.switchTab({// 首页 uni.switchTab({
url: '/pages/sort/sort', // 首页
}) url: "/pages/sort/sort",
});
}, },
// 跳转到商品详情 // 跳转到商品详情
jumpInfo(item) { jumpInfo(item) {
uni.navigateTo({ uni.navigateTo({
url: '/pages/other_package/productInfo/productInfo?id=' + item.id, url: "/pages/other_package/productInfo/productInfo?id=" + item.id,
}) });
} },
}, },
computed: { computed: {
isBlockedDate() { isBlockedDate() {
return !useTabber(13); return !useTabber(13);
} },
} },
};
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@@ -543,15 +642,16 @@ export default {
height: calc(100vh - env(safe-area-inset-bottom)); // 是底部的导航栏高度 height: calc(100vh - env(safe-area-inset-bottom)); // 是底部的导航栏高度
overflow: auto; overflow: auto;
position: relative; position: relative;
&.iosplatformType{
height:100vh; &.iosplatformType {
height: 100vh;
} }
} }
.home_header_warp { .home_header_warp {
// background-color: #AC2A29FF; // background-color: #AC2A29FF;
// background: linear-gradient(0deg, $app-bj, #AC2A29FF); // background: linear-gradient(0deg, $app-bj, #AC2A29FF);
background: linear-gradient(270deg, #AF39C4 0%, #7732FF 100%); background: linear-gradient(270deg, #af39c4 0%, #7732ff 100%);
height: 500rpx; height: 500rpx;
padding: 100rpx 30rpx 0rpx; padding: 100rpx 30rpx 0rpx;
} }
@@ -562,6 +662,7 @@ export default {
.header_title_warp { .header_title_warp {
display: flex; display: flex;
align-items: center;
margin-bottom: 30rpx; margin-bottom: 30rpx;
padding: 0 30rpx; padding: 0 30rpx;
} }
@@ -581,7 +682,12 @@ export default {
background: #ffffff30; background: #ffffff30;
border-radius: 24rpx; border-radius: 24rpx;
background: linear-gradient(270deg, #ae39c5, #7932fe) 2 2; background: linear-gradient(270deg, #ae39c5, #7932fe) 2 2;
}
.chart_img {
width: 50rpx;
height: 50rpx;
margin-left: 15rpx;
} }
.search_msg_warp { .search_msg_warp {
@@ -596,7 +702,7 @@ export default {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 0 30rpx; padding: 0 30rpx;
color: #FFFFFF; color: #ffffff;
.logo_banner_title { .logo_banner_title {
font-weight: bold; font-weight: bold;
@@ -644,16 +750,16 @@ export default {
.product_comm { .product_comm {
border-radius: 30rpx; border-radius: 30rpx;
padding: 10rpx; padding: 10rpx;
color: #FFFFFF; color: #ffffff;
margin-top: 20rpx; margin-top: 20rpx;
} }
.yx_warp { .yx_warp {
background: linear-gradient(270deg, #FDEFFF 0%, #EDE3FF 100%); background: linear-gradient(270deg, #fdefff 0%, #ede3ff 100%);
} }
.hx_warp { .hx_warp {
background: linear-gradient(270deg, #B164FB 0%, $app-zt-color 100%); background: linear-gradient(270deg, #b164fb 0%, $app-zt-color 100%);
} }
.product_title { .product_title {
@@ -666,14 +772,14 @@ export default {
.product_title_yp { .product_title_yp {
font-weight: 800; font-weight: 800;
font-size: 36rpx; font-size: 36rpx;
color: #FFFFFF; color: #ffffff;
margin-right: 10rpx; margin-right: 10rpx;
} }
.product_title_z { .product_title_z {
font-weight: 800; font-weight: 800;
font-size: 36rpx; font-size: 36rpx;
color: #333333FF; color: #333333ff;
margin-right: 10rpx; margin-right: 10rpx;
} }
@@ -692,7 +798,7 @@ export default {
.product_title_f { .product_title_f {
font-size: 20rpx; font-size: 20rpx;
color: #FFFFFF; color: #ffffff;
margin-left: 10rpx; margin-left: 10rpx;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -704,7 +810,7 @@ export default {
} }
.product_content { .product_content {
background-color: #FFFFFF; background-color: #ffffff;
padding: 20rpx; padding: 20rpx;
border-radius: 24rpx; border-radius: 24rpx;
display: flex; display: flex;
@@ -740,9 +846,9 @@ export default {
bottom: 0; bottom: 0;
width: calc(100% - 40rpx); width: calc(100% - 40rpx);
height: 66rpx; height: 66rpx;
background: #F0E7FE; background: #f0e7fe;
border-radius: 0rpx 0rpx 12rpx 12rpx; border-radius: 0rpx 0rpx 12rpx 12rpx;
border: 1rpx solid #FFFFFF; border: 1rpx solid #ffffff;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
font-size: 18rpx; font-size: 18rpx;
color: #000000; color: #000000;
@@ -762,24 +868,24 @@ export default {
.product_f_item_price { .product_f_item_price {
text-align: center; text-align: center;
border-radius: 10rpx; border-radius: 10rpx;
color: #FFFFFF; color: #ffffff;
margin-top: 10rpx; margin-top: 10rpx;
padding: 2rpx 0; padding: 2rpx 0;
} }
.product_f_item_price_yx { .product_f_item_price_yx {
background: #FFBA41; background: #ffba41;
} }
.product_f_item_price_hx { .product_f_item_price_hx {
background: linear-gradient(270deg, #AF39C4 0%, #7732FF 100%); background: linear-gradient(270deg, #af39c4 0%, #7732ff 100%);
} }
.product_tips { .product_tips {
font-size: 24rpx; font-size: 24rpx;
line-height: 40rpx; line-height: 40rpx;
margin-left: 20rpx; margin-left: 20rpx;
background: linear-gradient(180deg, #B039C2 0%, #8B34E9 23%, #7632FF 100%); background: linear-gradient(180deg, #b039c2 0%, #8b34e9 23%, #7632ff 100%);
-webkit-background-clip: text; -webkit-background-clip: text;
color: transparent; color: transparent;
display: inline-block; display: inline-block;
@@ -797,7 +903,7 @@ export default {
border-radius: 30rpx; border-radius: 30rpx;
opacity: 0.8; opacity: 0.8;
border-radius: 16rpx; border-radius: 16rpx;
border: 1rpx solid #DFDFDF; border: 1rpx solid #dfdfdf;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
} }
@@ -823,14 +929,12 @@ export default {
align-items: center; align-items: center;
margin-top: 20rpx; margin-top: 20rpx;
} }
} }
} }
// 热门榜 // 热门榜
.hot_warp { .hot_warp {
background: #FFFFFF; background: #ffffff;
border-radius: 30rpx; border-radius: 30rpx;
padding: 20rpx; padding: 20rpx;
margin-top: 20rpx; margin-top: 20rpx;
@@ -858,7 +962,7 @@ export default {
} }
.good__msg_warp { .good__msg_warp {
background: #FFF8F3; background: #fff8f3;
/* border-radius: 18rpx; */ /* border-radius: 18rpx; */
border-top: 2rpx solid $app-zt-color; border-top: 2rpx solid $app-zt-color;
border-right: 2rpx solid $app-zt-color; border-right: 2rpx solid $app-zt-color;
@@ -939,4 +1043,67 @@ export default {
} }
} }
} }
.uni-banner-news {
width: 540rpx;
margin: 0 auto;
background: url(https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new-home.png) no-repeat;
background-size: 100% 100%;
.close_btn {
position: absolute;
top: 0;
right: 0;
width: 48rpx;
height: 48rpx;
}
.banner_box-news {
height: 700rpx;
// padding:40rpx;
width: 90%;
}
.banner_box-title {
font-weight: 500;
font-size: 16px;
color: #333333;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/* 下面两行是为了兼容老版本 Firefox */
line-clamp: 2;
box-orient: vertical;
margin-top: 250rpx;
}
.banner_box-subTitle {
font-size: 14px;
color: #868686;
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 3;
/* 下面两行是为了兼容老版本 Firefox */
line-clamp: 3;
box-orient: vertical;
margin-top: 30rpx;
}
.banner_box-btn {
width: 240px;
height: 40px;
background: linear-gradient(270deg, #af39c4 0%, #7732ff 100%);
border-radius: 8px;
font-weight: 500;
font-size: 16px;
color: #ffffff;
display: flex;
justify-content: center;
align-items: center;
position: fixed;
bottom: 60rpx;
}
}
</style> </style>
@@ -0,0 +1,100 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header title="系统公告" :isReturn="true" @return="onReturnClick" />
<view class="setting-view">
<view class="name-box-title">
<view class="value">{{ newsDetail.title }}</view>
<view class="name-box-time">{{ formatDate(newsDetail.ctdate) }}</view>
</view>
<view class="name-box">
<view class="value" v-html="newsDetail.content"></view>
</view>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import Header from "@/components/common/header.vue";
import TopSafe from "@/components/common/top-safe.nvue";
import { getNewsDetail } from "@/api/news.js";
import { formatDate } from "@/utils/index.js";
export default {
components: { Header, TopSafe },
data() {
return {
newsDetail: {},
};
},
onShow() {},
onLoad(option) {
if (option && option.id) {
this.getNewsDetail(Number(option.id));
}
},
methods: {
formatDate,
async getNewsDetail(id) {
const params = {
id,
};
const resp = await getNewsDetail(params);
if (resp && resp.bizcode === 100) {
this.newsDetail = resp.data || {};
}
},
onReturnClick() {
uni.navigateTo({url:"/pages/login_package/announcement/announcement"});
},
},
};
</script>
<style lang="scss" scoped>
.bottom-btn {
width: 100%;
margin-bottom: 92rpx;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
}
.setting-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));
overflow-y: auto;
padding: 0 32rpx;
box-sizing: border-box;
position: relative;
background-color: #fff;
.name-box-title {
border-bottom: 1rpx solid #eaeaea;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
.value {
font-weight: 500;
font-size: 40rpx;
color: #333333;
}
.name-box-time {
font-size: 28rpx;
color: #666666;
}
}
.name-box {
width: 100%;
border-radius: 16rpx;
overflow-y: auto;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-content: flex-start;
box-sizing: border-box;
}
}
</style>
@@ -0,0 +1,141 @@
<template>
<view class="content">
<TopSafe></TopSafe>
<Header :title="name" :isReturn="true" @return="onReturnClick">
<!-- <template v-slot:right>
<img
src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/newClear.png"
alt=""
class="clear_but"
/>
</template> -->
</Header>
<view class="setting-view">
<view
class="news_content_item"
v-for="(item, index) in dataList"
:key="index"
@click="onJumpShop(item.id)"
>
<image
class="news_content_item_img"
src="https://cex-pub.s3.ap-southeast-1.amazonaws.com/static/new-logo.png"
mode="aspectFill"
></image>
<view class="news_content_item_warp">
<view class="news_content_item_title">{{ item.title }}</view>
<view class="news_content_item_content">{{
formatDate(item.ctdate)
}}</view>
</view>
</view>
</view>
<up-toast ref="uToastRef"></up-toast>
</view>
</template>
<script>
import Header from "@/components/common/header.vue";
import TopSafe from "@/components/common/top-safe.nvue";
import { getNewsList } from "@/api/news.js";
import { formatDate } from "@/utils/index.js";
export default {
components: { Header, TopSafe },
data() {
return {
dataList: [],
name: "系统公告",
};
},
onShow() {},
onLoad() {
this.getSearchList();
},
methods: {
formatDate,
async getSearchList() {
getNewsList({
category: 2,
type: 0,
page: 1,
pageSize: 1000,
}).then((res) => {
console.log("获取公告", res);
if (res.bizcode === 100) {
this.dataList = res.data.entitys || [];
console.log(this.dataList);
}
});
},
onJumpShop(id) {
uni.setStorageSync("isReadNews", this.dataList[0].id);
uni.navigateTo({
url:
"/pages/login_package/announcement-detail/announcement-detail?id=" +
id,
});
},
// 返回
onReturnClick() {
uni.switchTab({
url:'/pages/home/home'
})
},
},
};
</script>
<style lang="scss" scoped>
.clear_but{
width: 44rpx;
height: 44rpx;
}
.setting-view {
width: 100%;
height: calc(100% - 88rpx - var(--status-bar-height));
display: flex;
background-color: #fff;
flex-direction: column;
align-items: center;
overflow-y: auto;
box-sizing: border-box;
position: relative;
.news_content_item {
display: flex;
align-items: center;
padding: 0 32rpx;
width:calc(100% - 64rpx);
height: 128rpx;
.news_content_item_img {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
margin-right: 10rpx;
}
.news_content_item_warp {
.news_content_item_title {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
/* 下面两行是为了兼容老版本 Firefox */
line-clamp: 1;
box-orient: vertical;
font-size: 28rpx;
color: #333333;
}
.news_content_item_content {
font-size: 12px;
color: #999999;
margin-top: 4rpx;
}
}
}
}
</style>
+1 -1
View File
@@ -576,7 +576,7 @@ export default {
align-items: cneter; align-items: cneter;
border-radius: 16rpx 16rpx 0 0; border-radius: 16rpx 16rpx 0 0;
background-color: #F8F8F8; background-color: #F8F8F8;
borer:1rpx solid #F8F8F8; border:1rpx solid #F8F8F8;
.head-one{ .head-one{
width:134rpx; width:134rpx;
height:100%; height:100%;
+1 -1
View File
@@ -310,7 +310,7 @@ export default {
.box-head{ .box-head{
width:100%; width:100%;
height:80rpx; height:80rpx;
min-heihgt:80rpx; min-height:80rpx;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
.box-head-view{ .box-head-view{