Browse Source

首页

dev_des
1054425342@qq.com 2 months ago
parent
commit
90766478be
  1. 334
      components/Book.vue
  2. 150
      pages/index/iSoul.vue
  3. 4
      static/js/request.js

334
components/Book.vue

@ -0,0 +1,334 @@
<template>
<view class="product-section">
<view class="title-section">
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
"
@click="handleMoreClick"
>
<text class="title">EPIC SOUL阅读体</text>
</div>
</view>
<!-- 轮播容器 -->
<view class="carousel-container">
<!-- 左箭头 -->
<view
class="nav-arrow left-arrow"
@click="prevSlide"
v-if="list.length > 1 && currentIndex > 0"
>
<uni-icons size="16" color="white" type="left" />
</view>
<!-- 轮播内容 -->
<scroll-view
class="carousel-scroll"
scroll-x="true"
:show-scrollbar="false"
:enhanced="true"
:scroll-with-animation="true"
:scroll-left="scrollLeft"
@scroll="onScroll"
@scrollend="onScrollEnd"
>
<view class="carousel-content">
<view
class="carousel-item"
v-for="(item, index) in list"
:key="index"
@click="gotoUrlNew(item)"
v-if="item && item.image"
>
<view class="issue-card">
<!-- 背景图片 -->
<image
class="card-bg"
:src="showImg(item.image)"
mode="aspectFill"
></image>
</view>
</view>
<!-- 无数据时的提示 -->
<view v-if="!list || list.length === 0" class="no-data">
<text>暂无数据</text>
</view>
</view>
</scroll-view>
<!-- 右箭头 -->
<view
class="nav-arrow right-arrow"
@click="nextSlide"
v-if="list.length > 1 && currentIndex < list.length - 1"
>
<uni-icons size="16" color="white" type="arrowright" />
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [],
currentIndex: 0,
scrollLeft: 0,
itemWidth: 224, // 207rpx + 30rpx margin
JDSU_IMG_URL: "https://epic.js-dyyj.com",
};
},
mounted() {
this.getList();
},
methods: {
getList() {
this.Post(
{
type_id: 3,
offset: 0,
limit: 10, //
},
"/api/article/getArticleByType"
).then((res) => {
if (res.data && res.data.length > 0) {
this.list = res.data;
//
this.currentIndex = 0;
this.scrollLeft = 0;
}
});
},
//
showImg(img) {
if (!img) return "";
if (img.indexOf("https://") != -1 || img.indexOf("http://") != -1) {
return img;
} else {
return this.JDSU_IMG_URL + img;
}
},
//
prevSlide() {
if (!this.validateData()) return;
if (this.list.length > 1) {
this.currentIndex =
this.currentIndex > 0 ? this.currentIndex - 1 : this.list.length - 1;
this.$nextTick(() => {
this.scrollToCurrentItem();
});
}
},
//
nextSlide() {
if (!this.validateData()) return;
if (this.list.length > 1) {
this.currentIndex =
this.currentIndex < this.list.length - 1 ? this.currentIndex + 1 : 0;
this.$nextTick(() => {
this.scrollToCurrentItem();
});
}
},
//
scrollToCurrentItem() {
//
if (this.currentIndex < 0) {
this.currentIndex = 0;
}
if (this.currentIndex >= this.list.length) {
this.currentIndex = this.list.length - 1;
}
const scrollPosition = this.currentIndex * this.itemWidth;
this.scrollLeft = scrollPosition;
},
//
onScroll(e) {
const scrollLeft = e.detail.scrollLeft;
const index = Math.round(scrollLeft / this.itemWidth);
if (
index !== this.currentIndex &&
index >= 0 &&
index < this.list.length
) {
this.currentIndex = index;
}
},
//
onScrollEnd(e) {
const scrollLeft = e.detail.scrollLeft;
const index = Math.round(scrollLeft / this.itemWidth);
//
this.currentIndex = Math.max(0, Math.min(index, this.list.length - 1));
this.$nextTick(() => {
this.scrollToCurrentItem();
});
},
//
handleItemClick(item) {
console.log("点击了卡片:", item);
//
},
//
validateData() {
if (!this.list || this.list.length === 0) {
this.currentIndex = 0;
this.scrollLeft = 0;
return false;
}
//
if (this.currentIndex < 0) {
this.currentIndex = 0;
}
if (this.currentIndex >= this.list.length) {
this.currentIndex = this.list.length - 1;
}
return true;
},
},
};
</script>
<style lang="scss" scoped>
.product-section {
width: 100%;
background-color: #fffdd6;
padding: 40rpx 25rpx;
margin: 30rpx 0;
border-radius: 40rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1),
0 0 0 1rpx rgba(255, 255, 255, 0.2) inset;
}
//
.carousel-container {
position: relative;
width: 100%;
height: 368rpx;
display: flex;
align-items: center;
justify-content: center;
}
//
.carousel-scroll {
width: 100%;
height: 100%;
white-space: nowrap;
}
//
.carousel-content {
display: flex;
align-items: center;
height: 100%;
min-width: max-content;
}
//
.carousel-item {
flex-shrink: 0;
width: 210rpx;
height: 368rpx;
margin: 0 7rpx;
will-change: transform;
}
//
.issue-card {
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
//
.card-bg {
width: 100%;
height: 100%;
}
//
.nav-arrow {
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 60rpx;
height: 60rpx;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 3;
transition: all 0.3s ease;
backdrop-filter: blur(10rpx);
&:hover {
background: rgba(255, 255, 255, 0.3);
transform: translateY(-50%) scale(1.1);
}
&.left-arrow {
left: 0rpx;
}
&.right-arrow {
right: 0rpx;
}
}
.arrow-icon {
font-size: 32rpx;
color: #ffffff;
font-weight: bold;
text-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.3);
}
//
.no-data {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 368rpx;
color: #999;
font-size: 28rpx;
}
//
.title-section {
display: inline-block;
padding: 0rpx 0 30rpx;
width: 100%;
.title {
font-size: 34rpx;
font-weight: bold;
color: #000000;
}
.more-btn {
font-size: 26rpx;
color: #000000;
margin-left: 35rpx;
}
}
</style>

150
pages/index/iSoul.vue

@ -40,11 +40,6 @@
<view class="user-id" v-if="userInfo.redBookId"
>ID{{ userInfo.redBookId || "123456" }}</view
>
<!-- <view class="location">
<text class="location-icon">📍</text>
<text>IP属地{{ userInfo.location || "上海" }}</text>
<text class="info-icon"></text>
</view> -->
</view>
</view>
@ -75,14 +70,14 @@
</view>
</view>
<!-- 权益兑换入口 -->
<view class="exchange-entry" @click="showExchangePopup">
<!-- <view class="exchange-entry" @click="showExchangePopup">
<view class="exchange-icon">🎁</view>
<view class="exchange-text">权益兑换</view>
</view>
</view> -->
</view>
</view>
<!-- 待激活的Agent -->
<view class="agent-section">
<view class="agent-section" v-if="false">
<view class="agent-header">
<view class="agent-title">待激活的Agent</view>
</view>
@ -118,9 +113,26 @@
<text>私信</text>
</view>
</view> -->
<view class="action-box">
<image
@click="showExchangePopup"
:src="showImg('/uploads/20250822/7f18265ca351dfd2d6477322b17c1751.png')"
style="width: 233rpx;height: 43rpx;"
></image>
<view class="column-divider"></view>
<image
:src="showImg('/uploads/20250822/53718d0d8a655ac33d7197ad11a32f98.png')"
style="width: 200rpx;height: 43rpx;"
></image>
</view>
<!-- 数字资产权益 -->
<view class="digital-assets">
<view class="memorial-divider" style="margin-bottom: 0;">
<view class="divider-line"></view>
<view class="divider-text">数字资产权益</view>
<view class="divider-line"></view>
</view>
<!-- 有数据时显示滑动卡片 -->
<view v-if="assetList.length > 0" class="asset-scroll-container">
<scroll-view
@ -150,8 +162,8 @@
class="asset-action"
style="flex-direction: row; padding: 20rpx"
>
<text class="action-text">{{ asset.actionText }}</text>
<text class="action-arrow"></text>
<text class="action-text-order">{{ asset.actionText }}</text>
<text class="action-arrow-order"></text>
</view>
</view>
</view>
@ -173,21 +185,17 @@
</view>
<!-- 底部操作按钮 -->
<view class="asset-actions">
<view class="asset-action active" @click="handleAssetAction('待使用')">
<view class="action-icon red"></view>
<view class="goods-actions">
<view class="goods-action " @click="handleAssetAction('待使用')">
<text>待使用</text>
</view>
<view class="asset-action" @click="handleAssetAction('待收货')">
<view class="action-icon gray"></view>
<view class="goods-action" @click="handleAssetAction('待收货')">
<text>待收货</text>
</view>
<view class="asset-action" @click="handleAssetAction('已完成')">
<view class="action-icon gray"></view>
<view class="goods-action" @click="handleAssetAction('已完成')">
<text>已完成</text>
</view>
<view class="asset-action" @click="handleAssetAction('售后/退款')">
<view class="action-icon gray"></view>
<view class="goods-action" @click="handleAssetAction('售后/退款')">
<text>售后/退款</text>
</view>
</view>
@ -205,22 +213,18 @@
></image>
<view class="goods-actions">
<view
class="goods-action active"
class="goods-action "
@click="handleGoodsAction('购物车')"
>
<view class="action-icon red"></view>
<text>购物车</text>
</view>
<view class="goods-action" @click="handleGoodsAction('待发货')">
<view class="action-icon gray"></view>
<text>待发货</text>
</view>
<view class="goods-action" @click="handleGoodsAction('退货/退款')">
<view class="action-icon gray"></view>
<text>退货/退款</text>
</view>
<view class="goods-action" @click="handleGoodsAction('评价')">
<view class="action-icon gray"></view>
<text>评价</text>
</view>
</view>
@ -333,6 +337,15 @@
确认兑换
</button>
</view>
<view class="popup-actions-bottom">
<view class="" style="color: #77F3F9;">
如何查找兑换码
</view>
<view class="">
前往君到苏州平台<text style="color: #77F3F9;margin: 0 10rpx;">>></text>
我的权益订单<text style="color: #77F3F9;margin: 0 10rpx;">>></text>复制权益码
</view>
</view>
</view>
</view>
</uni-popup>
@ -454,7 +467,7 @@ export default {
"/uploads/20250729/42598a2dcf4c9a6f8c6e122e54b65c4f.png",
badge: "待使用",
name: item.goodsTitle || "数字资产权益",
desc: item.type==1?'您的专属数字资产':item.type==2?'IP资源商品': item.skuName,
desc: item.type==1?'IP数字资产':item.type==2?'IP周边': item.skuName,
actionText:item.type==1?'去查看':item.type==2?'去预约': "去核销",
status: "待使用",
...item, //
@ -1074,28 +1087,28 @@ view {
}
.asset-badge {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
background: linear-gradient(135deg, #fffdb7 0%, #97fffa 100%);
color: black;
font-size: 20rpx;
padding: 6rpx 12rpx;
border-radius: 16rpx;
display: inline-block;
margin-bottom: 12rpx;
font-weight: 500;
box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
}
.asset-name {
font-size: 28rpx;
font-weight: bold;
font-size: 26rpx;
font-weight: 500;
margin-bottom: 6rpx;
line-height: 1.3;
}
.asset-desc {
font-size: 22rpx;
color: rgba(255, 255, 255, 0.8);
font-size: 34rpx;
color: white;
margin-bottom: 16rpx;
font-weight: bold;
line-height: 1.4;
}
@ -1103,7 +1116,7 @@ view {
display: flex;
align-items: center;
justify-content: space-between;
background: rgba(255, 255, 255, 0.1);
background: linear-gradient(135deg, #fffdb7e6 0%, #97fffab5 100%);
border-radius: 20rpx;
padding: 10rpx 16rpx;
backdrop-filter: blur(10rpx);
@ -1112,10 +1125,10 @@ view {
min-width: 0;
}
.action-text {
font-size: 24rpx;
font-weight: 500;
color: white;
.action-text-order {
font-size: 26rpx;
font-weight: bold;
color: black;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
@ -1129,6 +1142,14 @@ view {
flex-shrink: 0;
margin-left: 8rpx;
}
.action-arrow-order{
font-size: 26rpx;
font-weight: bold;
color: black;
transition: transform 0.3s ease;
flex-shrink: 0;
margin-left: 8rpx;
}
.asset-card:active .action-arrow {
transform: translateX(6rpx);
@ -1138,7 +1159,6 @@ view {
.asset-card-old {
border-radius: 20rpx;
overflow: hidden;
margin-bottom: 20rpx;
}
/* 底部操作按钮 */
@ -1150,20 +1170,9 @@ view {
font-size: 25rpx;
}
.asset-action {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
padding: 0 10rpx;
font-size: 24rpx;
color: #666;
position: relative;
}
.asset-action.active {
color: #ff4757;
}
.action-icon {
width: 36rpx;
@ -1225,8 +1234,8 @@ view {
flex-direction: column;
align-items: center;
padding: 20rpx 10rpx;
font-size: 24rpx;
color: #666;
font-size: 26rpx;
color: #000000;
}
.goods-action.active {
@ -1254,9 +1263,9 @@ view {
.divider-text {
padding: 0 30rpx;
font-size: 28rpx;
font-size: 30rpx;
color: #000000;
font-weight: 500;
font-weight: bold;
white-space: nowrap;
}
@ -1310,7 +1319,7 @@ view {
}
.single-badge {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
background: linear-gradient(135deg, #77F3F9 0%, #764ba2 100%);
color: white;
font-size: 22rpx;
padding: 8rpx 16rpx;
@ -1524,7 +1533,7 @@ view {
box-sizing: border-box;
&:focus {
border-color: #667eea;
border-color: #77F3F9;
}
}
@ -1553,11 +1562,32 @@ view {
.cancel-btn {
background: #f5f5f5;
color: #666;
color: #77F3F9;
}
.confirm-btn {
background: #667eea;
color: #ffffff;
background: #77F3F9;
color: #000000;
}
.column-divider {
width: 2rpx;
height: 60rpx;
background: rgba(0, 0, 0, 0.1);
margin: 35rpx 16rpx;
flex-shrink: 0;
}
.action-box{
display: flex;
align-items: center;
justify-content: space-around;
padding: 20rpx 40rpx 0;
}
.popup-actions-bottom{
color: #989898;
font-weight: bold;
font-size: 28rpx;
margin-top: 30rpx;
margin-bottom: 30rpx;
}
</style>

4
static/js/request.js

@ -7,8 +7,8 @@ const DEV_API_URL = 'https://epic.js-dyyj.com';
// const PROD_API_URL = 'https://epic.js-dyyj.com';
const PROD_API_URL = 'https://epic.new.js-dyyj.com';
const NEWAPIURL = process.env.NODE_ENV === 'development' ? DEV_API_URL : PROD_API_URL;
// const DEV_API_URL_DES = 'http://192.168.124.118:8083/xcx';
const DEV_API_URL_DES = 'https://des.js-dyyj.com/xcx';
const DEV_API_URL_DES = 'http://192.168.124.118:8083/xcx';
// const DEV_API_URL_DES = 'https://des.js-dyyj.com/xcx';
const PROD_API_URL_DES = 'https://des.js-dyyj.com/xcx';
const NEWAPIURL_DES = process.env.NODE_ENV === 'development' ? DEV_API_URL_DES : PROD_API_URL_DES;
const getToken = () => {

Loading…
Cancel
Save