فهرست منبع

首页样式改

liujiaxin 1 ماه پیش
والد
کامیت
0b7ea0ea77

+ 1 - 1
manifest.json

@@ -52,7 +52,7 @@
     "quickapp" : {},
     /* 小程序特有相关 */
     "mp-weixin" : {
-        "appid" : "wxcfd4cd6e2375e42f",
+        "appid" : "wxec95e303998c5515",
         "setting" : {
             "urlCheck" : false
         },

+ 48 - 1
package-lock.json

@@ -1,8 +1,55 @@
 {
   "name": "zhongkmall_user_app",
   "version": "1.0.0",
-  "lockfileVersion": 1,
+  "lockfileVersion": 2,
   "requires": true,
+  "packages": {
+    "": {
+      "name": "zhongkmall_user_app",
+      "version": "1.0.0",
+      "license": "ISC",
+      "dependencies": {
+        "crypto-js": "^4.2.0",
+        "dayjs": "^1.11.13",
+        "uview-ui": "^2.0.38",
+        "vuex": "^4.1.0"
+      }
+    },
+    "node_modules/@vue/devtools-api": {
+      "version": "6.6.4",
+      "resolved": "https://registry.npmmirror.com/@vue/devtools-api/-/devtools-api-6.6.4.tgz",
+      "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g=="
+    },
+    "node_modules/crypto-js": {
+      "version": "4.2.0",
+      "resolved": "https://registry.npmmirror.com/crypto-js/-/crypto-js-4.2.0.tgz",
+      "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q=="
+    },
+    "node_modules/dayjs": {
+      "version": "1.11.19",
+      "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.19.tgz",
+      "integrity": "sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw=="
+    },
+    "node_modules/uview-ui": {
+      "version": "2.0.38",
+      "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.38.tgz",
+      "integrity": "sha512-6egHDf9lXHKpG3hEjRE0vMx4+VWwKk/ReTf5x18KrIKqdvdPRqO3+B8Unh7vYYwrIxzAWIlmhZ9RJpKI/4UqPQ==",
+      "engines": {
+        "HBuilderX": "^3.1.0"
+      }
+    },
+    "node_modules/vuex": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmmirror.com/vuex/-/vuex-4.1.0.tgz",
+      "integrity": "sha512-hmV6UerDrPcgbSy9ORAtNXDr9M4wlNP4pEFKye4ujJF8oqgFFuxDCdOLS3eNoRTtq5O3hoBDh9Doj1bQMYHRbQ==",
+      "dependencies": {
+        "@vue/devtools-api": "^6.0.0-beta.11"
+      },
+      "peerDependencies": {
+        "vue": "^3.2.0"
+      }
+    }
+  },
   "dependencies": {
     "@vue/devtools-api": {
       "version": "6.6.4",

+ 9 - 6
pages/home/components/GoodsCard.vue

@@ -16,6 +16,7 @@
 				</view>
 				<view class="meta-row" v-if="item.sales != null || item.positiveRating != null">
 					<text class="sales" v-if="item.sales != null">已售{{ item.sales }}</text>
+					<text>I</text>
 					<text class="good-rate" v-if="item.positiveRating != null">好评{{ item.positiveRating }}%</text>
 				</view>
 			</view>
@@ -139,16 +140,18 @@ export default {
 .meta-row {
 	display: flex;
 	align-items: center;
-	gap: 25rpx;
+	gap: 8rpx;
 	margin-top: 8rpx;
-}
-.sales,
-.good-rate {
 	font-size: 28rpx;
 	color: #999;
 }
+// .sales,
+// .good-rate {
+// 	font-size: 28rpx;
+// 	color: #999;
+// }
 .sales{
-	border-right: 1rpx solid #e5e5e5; /* 右侧竖线 */
-	padding-right: 14rpx; /* 竖线与文字的间距 */
+	// border-right: 1rpx solid #e5e5e5; /* 右侧竖线 */
+	// padding-right: 14rpx; /* 竖线与文字的间距 */
 }
 </style>

+ 1 - 1
pages/home/components/GoodsList.vue

@@ -41,7 +41,7 @@ export default {
 .list-column {
 	display: flex;
 	flex-direction: column;
-	gap: 20rpx;
+	gap: 24rpx;
 }
 .list-item {
 	width: 100%;

+ 123 - 39
pages/home/components/RecommendSection.vue

@@ -8,22 +8,23 @@
 
 		<view class="recommend-layout">
 			<!-- 左侧:直播卡片轮播,自动滚动 + 可手动左右滑动,右上角 当前index/总数量 -->
-			<view class="block-left-wrap" v-if="liveList.length > 0">
-				<swiper
-					class="live-swiper"
-					:current="liveCurrent"
-					circular :indicator-dots="true" :autoplay="true" :interval="3000" :duration="1000"
-					indicator-color="rgba(255, 255, 255, 0.6)" indicator-active-color="#ffffff"
-					@change="onLiveSwiperChange"
-				>
+			<view class="block-left-wrap" v-if="liveList.length > 0" @click="onLive">
+				<swiper class="live-swiper" :current="liveCurrent" circular :indicator-dots="false" :autoplay="true"
+					:interval="3000" :duration="1000" indicator-color="rgba(255, 255, 255, 0.6)"
+					indicator-active-color="#ffffff" @change="onLiveSwiperChange">
 					<!-- <swiper-item v-for="(item, idx) in liveList" :key="idx" @click="onLiveClick(item)">
 						<view class="block-left">
 							<view class="x-c" :class="['block-label', isLiving(item) ? 'live' : 'replay']">
-								<image class="w24 h24" :src="isLiving(item)?'/static/images/live.gif':'/static/images/replay.png'" mode="aspectFill"></image>
-								{{ isLiving(item) ? '直播中' : '回放中' }}
+								<image class="w24 h24"
+									:src="isLiving(item) ? '/static/images/live.gif' : '/static/images/replay.png'"
+									mode="aspectFill"></image>
+								{{ isLiving(item) ? '直播中' : '回放' }}
 							</view>
 							<image class="block-img" :src="item.liveImgUrl" mode="aspectFill"></image>
-							<view class="block-title one-t">{{ item.liveName }}</view>
+							<view class="block-tit">
+								<image class="item-avatar" src="/static/logo.png" mode="aspectFill"></image>
+								<view class="item-title one-t">{{ item.liveName }}</view>
+							</view>
 						</view>
 					</swiper-item> -->
 					<swiper-item>
@@ -33,6 +34,10 @@
 						</view>
 					</swiper-item>
 				</swiper>
+				<!-- <view class="swiper-dots" v-if="liveList.length > 1">
+					<text v-for="(dot, index) in liveList.length" :key="'live-dot-' + index"
+						:class="liveCurrent === index ? 'dot-active' : 'dot'"></text>
+				</view> -->
 			</view>
 
 			<!-- 右侧:上 绿色有机,下 上新推荐 -->
@@ -46,16 +51,13 @@
 						</view>
 					</view>
 					<view class="block-small-body">
-						<view
-							class="small-item"
-							v-for="(item, i) in (green || []).slice(0, 2)"
-							:key="'g'+i"
-							@click.stop="onItemClick(item, 'green')"
-						>
+						<view class="small-item" v-for="(item, i) in (green || []).slice(0, 2)" :key="'g' + i"
+							@click.stop="onItemClick(item, 'green')">
 							<image class="small-thumb" :src="item.image || item.imageUrl" mode="aspectFill"></image>
 							<view>
 								<text class="unit">¥</text>
-								<text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2) }}</text>
+								<text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2)
+									}}</text>
 							</view>
 						</view>
 					</view>
@@ -69,18 +71,15 @@
 						</view>
 					</view>
 					<view class="block-small-body">
-						<view
-							class="small-item"
-							v-for="(item, i) in (hot || []).slice(0, 2)"
-							:key="'h'+i"
-							@click.stop="onItemClick(item, 'hot')"
-						>
+						<view class="small-item" v-for="(item, i) in (hot || []).slice(0, 2)" :key="'h' + i"
+							@click.stop="onItemClick(item, 'hot')">
 							<image class="small-thumb" :src="item.image || item.imageUrl" mode="aspectFill"></image>
 							<view>
 								<text class="unit">¥</text>
-								<text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2) }}</text>
+								<text class="small-price" v-if="item.price != null">{{ Number(item.price).toFixed(2)
+									}}</text>
 							</view>
-							
+
 						</view>
 					</view>
 				</view>
@@ -116,6 +115,12 @@ export default {
 		}
 	},
 	methods: {
+	onLive(){
+		uni.showToast({
+			title: '暂无课程',
+			icon: 'none'
+		})
+	},
 		onLiveSwiperChange(e) {
 			this.liveCurrent = e.detail.current
 		},
@@ -142,57 +147,66 @@ export default {
 
 <style lang="scss" scoped>
 .recommend-section {
-	margin: 24rpx;
+	margin: 30rpx 24rpx 40rpx;
 }
+
 .score-row {
 	display: flex;
 	align-items: center;
 	margin-bottom: 16rpx;
 	font-size: 26rpx;
 }
+
 .score-label {
 	color: #666;
 	margin-right: 12rpx;
 }
+
 .score-value {
 	color: #333;
 	font-weight: 600;
 }
+
 .recommend-layout {
 	display: flex;
 	gap: 20rpx;
 }
+
 .block-left-wrap {
-	flex:1;
+	flex: 1;
 	// width: 340rpx;
 	flex-shrink: 0;
 	// height: 420rpx;
-	border-radius: 16rpx;
+	border-radius: 24rpx;
 	overflow: hidden;
+	position: relative;
 }
+
 .live-swiper {
 	width: 100%;
 	height: 100%;
 }
+
 .block-left {
 	width: 100%;
 	height: 100%;
-	border-radius: 16rpx;
 	overflow: hidden;
 	background: #f5f5f5;
 	position: relative;
 }
+
 .live-index-badge {
 	position: absolute;
 	top: 0;
 	right: 0;
 	z-index: 2;
-	background: rgba(0,0,0,0.5);
+	background: rgba(0, 0, 0, 0.5);
 	color: #fff;
 	font-size: 22rpx;
 	padding: 8rpx 16rpx;
 	border-radius: 0 0 0 12rpx;
 }
+
 .block-label {
 	position: absolute;
 	top: 20rpx;
@@ -201,12 +215,14 @@ export default {
 	color: #fff;
 	font-size: 24rpx;
 	padding: 8rpx 20rpx;
-	background: linear-gradient( 135deg, #FF5267 0%, #FF233C 100%);
+	background: linear-gradient(135deg, #FF5267 0%, #FF233C 100%);
 	border-radius: 0rpx 8rpx 8rpx 0rpx;
-	image{
+
+	image {
 		margin-right: 4rpx;
 	}
 }
+
 // .block-label.live {
 // 	background: #E5212B;
 // }
@@ -218,16 +234,67 @@ export default {
 	height: 100%;
 	display: block;
 }
+
 .block-title {
 	position: absolute;
 	bottom: 0;
 	left: 0;
 	right: 0;
-	background: rgba(0,0,0,0.45);
+	background: rgba(0, 0, 0, 0.45);
 	color: #fff;
 	font-size: 26rpx;
 	padding: 16rpx 16rpx 50rpx;
 }
+.block-tit {
+	display: flex;
+	align-items: center;
+	position: absolute;
+	bottom: 0;
+	left: 0;
+	right: 0;
+	background: rgba(0, 0, 0, 0.45);
+	color: #fff;
+	font-size: 26rpx;
+	padding: 16rpx 16rpx 50rpx;
+
+	.item-avatar {
+		width: 40rpx;
+		height: 40rpx;
+		border-radius: 50%;
+		margin-right: 10rpx;
+	}
+
+	.item-title {
+		font-size: 32rpx;
+		color: #FFFFFF;
+		line-height: 44rpx;
+	}
+}
+.swiper-dots {
+	display: flex;
+	position: absolute;
+	left: 50%;
+	transform: translateX(-50%);
+	bottom: 12rpx;
+	z-index: 3;
+	gap: 6rpx;
+}
+
+.dot {
+	width: 8rpx;
+	height: 8rpx;
+	background: #FFFFFF;
+	opacity: 0.7;
+	border-radius: 4rpx;
+}
+
+.dot-active {
+	width: 16rpx;
+	height: 8rpx;
+	background: #FFFFFF;
+	border-radius: 4rpx;
+}
+
 .block-right {
 	flex: 1;
 	display: flex;
@@ -235,65 +302,82 @@ export default {
 	gap: 20rpx;
 	min-width: 0;
 }
+
 .block-small {
 	flex: 1;
-	background: linear-gradient( 180deg, #FFC7A7 0%, #FFF8F3 36.36%, #FFFFFF 100%);
-	border-radius: 16rpx;
+	background: linear-gradient(180deg, #FFC7A7 0%, #FFF8F3 36.36%, #FFFFFF 100%);
+	border-radius: 24rpx;
 	overflow: hidden;
 	padding: 16rpx;
-	&:last-child{
-		background: linear-gradient( 180deg, #FFC5C5 0%, #FFF5F5 36.36%, #FFFFFF 100%);
+
+	&:last-child {
+		background: linear-gradient(180deg, #FFC5C5 0%, #FFF5F5 36.36%, #FFFFFF 100%);
 	}
 }
+
 .block-small-head {
 	display: flex;
 	align-items: center;
 	justify-content: space-between;
 	margin-bottom: 18rpx;
 }
+
 .block-small-title {
 	font-size: 28rpx;
 	font-weight: 600;
 }
+
 .green {
 	color: #FF5B25;
 }
+
 .hot {
 	color: #FF485D;
 }
+
 .more {
 	display: flex;
 	align-items: center;
 	font-size: 28rpx;
-	text{
+
+	text {
 		margin-right: 5rpx;
 	}
+
 	// color: #999;
 }
+
 .arrow {
 	margin-left: 4rpx;
 	font-size: 28rpx;
 }
+
 .block-small-body {
 	display: flex;
 	// gap: 16rpx;
 }
+
 .small-item {
 	flex: 1;
 	display: flex;
 	flex-direction: column;
 	align-items: center;
 }
+
 .small-thumb {
 	width: 110rpx;
 	height: 110rpx;
 	border-radius: 10rpx;
 }
+
 .unit {
+	font-weight: 600;
 	font-size: 20rpx;
 	color: #FF233C;
 	margin-top: 8rpx;
+	margin-right: 4rpx;
 }
+
 .small-price {
 	font-size: 32rpx;
 	font-weight: 600;

+ 5 - 4
pages/home/components/SearchBar.vue

@@ -40,7 +40,8 @@ export default {
 		marginTop:{ type: String, default: '' },
 		searchIcon: {
 			type: String,
-			default: 'https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/search.png'
+			// default: 'https://jnlzjk-1323137866.cos.ap-chongqing.myqcloud.com/shop/images/search.png',
+			default: '/static/images/search.png'
 		},
 		cartIcon: {
 			type: String,
@@ -64,7 +65,7 @@ export default {
 	top: 0;
 	left: 0;
 	right: 0;
-	z-index: 100;
+	z-index: 10000;
 }
 .top-title .name {
 	font-size: 36rpx;
@@ -88,8 +89,8 @@ export default {
 	margin-right: 20rpx;
 }
 .icon-search {
-	width: 36rpx;
-	height: 36rpx;
+	width: 44rpx;
+	height: 44rpx;
 	margin-right: 16rpx;
 }
 .search-cont input {

+ 1 - 1
pages/home/newindex.vue

@@ -33,7 +33,7 @@
 		<CategoryTags :tags="categoryTagsData" @selectClick="onCategoryTagsSelect" />
 
 
-		<!-- 推荐区块:左侧直播卡(直播中/回放)+ 右上绿色有机 + 右下上新推荐 -->
+		<!-- 推荐区块:左侧直播卡(直播中/回放)+ 右上绿色有机 + 右下上新推荐 -->
 		<RecommendSection
 			:live="recommendData.live"
 			:green="recommendData.green"

BIN
static/images/search.png