From 7234a8bfdc91571bb1e5d4fad66cdd5a445712ee Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期二, 29 七月 2025 10:45:04 +0800
Subject: [PATCH] 页面调整
---
pages/kitchen/KitchenVideo.vue | 20 +++++
pages.json | 3
pages/mine/im/index.vue | 1
pages/mine/address/add.vue | 7 -
pages/video/video-goods-detail.vue | 5 +
pages/health/healthVideo.vue | 73 +++++++++++++++++-
pages/cusbar/cart/cartList.vue | 17 ++--
pages/tabbar/index/home.vue | 81 ++++++++++++++++++-
pages/commodity-square/commoditySquare.vue | 25 +++++
9 files changed, 206 insertions(+), 26 deletions(-)
diff --git a/pages.json b/pages.json
index 269850f..c24f49c 100644
--- a/pages.json
+++ b/pages.json
@@ -2005,7 +2005,8 @@
"componentPlaceholder": {
"u-navbar": "view",
"u-search": "view",
- "u-image": "view"
+ "u-image": "view",
+ "u-icon": "view"
}
}
}
diff --git a/pages/commodity-square/commoditySquare.vue b/pages/commodity-square/commoditySquare.vue
index 1e52bcf..3d35583 100644
--- a/pages/commodity-square/commoditySquare.vue
+++ b/pages/commodity-square/commoditySquare.vue
@@ -16,7 +16,7 @@
</scroll-view>
</view>
- <view class="goodsInfos" >
+ <view class="goodsInfos" style="position: relative;">
<scroll-view :scroll-y="true" :show-scrollbar="false" style="height: 100%;" @scrolltolower="loadMoreData()">
<view class="goodsItem" v-for="item in goodsList" :key="item.id"
@@ -58,6 +58,10 @@
</view>
</view>
</scroll-view>
+ </view>
+ <view @click="gotoCardList()" style="position: absolute;bottom: 120rpx; right: 32rpx;">
+ <div class="settlement" >鍘昏喘鐗╄溅缁撶畻</div>
+ </view>
</view>
</view>
@@ -87,6 +91,8 @@
},
data() {
return {
+ canGoToCarList:false,
+ nums:10,
searchInfo: '',
//鍟嗗搧鍒楄〃
goodsList: [],
@@ -114,6 +120,11 @@
}
},
methods: {
+ gotoCardList(){
+ uni.navigateTo({
+ url:'/pages/cusbar/cart/cartList'
+ })
+ },
addCardNum(e, id) {
this.goodsList.forEach(item => {
if (item.id === id) {
@@ -269,6 +280,7 @@
const cardInfos = await getCarts();
// 澶勭悊璐墿杞︿俊鎭�
let cardMap = new Map();
+ this.canGoToCarList = cardInfos.data.result.cartList.length>0
cardInfos.data.result.cartList.forEach(item => {
item.skuList.forEach(sku => {
@@ -333,7 +345,16 @@
overflow: hidden;
}
-
+ .settlement {
+ width: 180rpx;
+ height: 70rpx;
+ line-height: 70rpx;
+ background: linear-gradient(91deg, $light-color 1%, $aider-light-color 99%);
+ border-radius: 900rpx;
+ text-align: center;
+ color: #fff;
+ margin-right: 10rpx;
+ }
.navigatorMenue {
margin-left: -32rpx;
diff --git a/pages/cusbar/cart/cartList.vue b/pages/cusbar/cart/cartList.vue
index 5978190..183d6d8 100644
--- a/pages/cusbar/cart/cartList.vue
+++ b/pages/cusbar/cart/cartList.vue
@@ -240,15 +240,16 @@
*/
onShow() {
this.deleteShow ? (this.deleteShow = false) : true;
- if (this.$refs.swiperAction) {
- this.$refs.swiperAction.forEach((item, index) => {
- item.show = false;
- });
+ this.getCardData();
+ // if (this.$refs.swiperAction) {
+ // this.$refs.swiperAction.forEach((item, index) => {
+ // item.show = false;
+ // });
+ // this.getCardData();
+ // } else {
+ // this.getCardData();
+ // }
- this.getCardData();
- } else {
- this.getCardData();
- }
},
methods: {
/**
diff --git a/pages/health/healthVideo.vue b/pages/health/healthVideo.vue
index c77bfdb..610d5c8 100644
--- a/pages/health/healthVideo.vue
+++ b/pages/health/healthVideo.vue
@@ -375,18 +375,38 @@
},
onLoad(option) {
this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
+ let queryParam = this.videoQuery;
+ if (option.q) {
+ // 鍙岄噸瑙g爜锛氬井淇″URL杩涜浜嗕袱娆$紪鐮�
+ const decodedUrl = decodeURIComponent(decodeURIComponent(option.q));
+ console.log('鍘熷URL:', decodedUrl);
+
+ // 瑙f瀽URL涓殑鏌ヨ鍙傛暟
+ const params = this.parseUrlParams(decodedUrl);
+ const shareType = params.shareType;
+ const videoId = params.videoId;
+ queryParam.videoId = videoId
+ queryParam.shareType = shareType
+ console.log('瑙f瀽鍙傛暟:', { shareType, videoId });
+ }
const token = storage.getAccessToken();
if (! token) {
this.wxSilentLogin(() => {
- this.loadVideos();
// 鍒ゆ柇鏄笉鏄偣鍑诲垎浜摼鎺ヨ繘鏉ョ殑
if (option.userId && option.videoId) {
+ queryParam.videoId = option.videoId
// 淇濆瓨鍒嗕韩鐐瑰嚮璁板綍
saveShareClickRecord({refId: option.videoId, shareUserId: option.userId})
}
+ this.loadVideos(queryParam);
})
} else {
- this.loadVideos();
+ if (option.userId && option.videoId) {
+ queryParam.videoId = option.videoId
+ // 淇濆瓨鍒嗕韩鐐瑰嚮璁板綍
+ saveShareClickRecord({refId: option.videoId, shareUserId: option.userId})
+ }
+ this.loadVideos(queryParam);
}
},
onShareAppMessage(e) {
@@ -410,6 +430,23 @@
}
},
methods: {
+ // 瑙f瀽URL鍙傛暟
+ parseUrlParams(url) {
+ const params = {};
+ // 澶勭悊鍙兘瀛樺湪鐨刪ash锛堝鏋滄湁鐨勮瘽锛�
+ const cleanUrl = url.split('#')[0];
+ const queryStr = cleanUrl.split('?')[1] || '';
+
+ queryStr.split('&').forEach(pair => {
+ const [key, value] = pair.split('=');
+ if (key) {
+ // 濡傛灉鍊煎瓨鍦紝鍒欒В鐮侊紝鍚﹀垯璁句负绌哄瓧绗︿覆
+ params[key] = value ? decodeURIComponent(value) : '';
+ }
+ });
+
+ return params;
+ },
// 鏌ヨ褰撳墠瑙嗛鐨勫叧鑱旇棰戯紙鎸備簡鍚屼竴鍟嗗搧鐨勶級
async getGoodsSimilarly() {
if (this.similarlyLoading || this.similarlyNomore) return Promise.resolve();;
@@ -739,10 +776,38 @@
},
// 鍔犺浇瑙嗛鏁版嵁
- async loadVideos() {
+ async loadVideos(param) {
if (this.loading || this.videoNoMore) return;
this.loading = true;
+ if(param){
+ getHealthRecommendVideos(this.videoQuery).then(res => {
+ // 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
+ const data = res.data.data.map(item => {
+ return {
+ ...item,
+ updateKey: item.id
+ }
+ })
+ if (this.videoQuery.pageNumber === 1) {
+ this.videoList = data;
+ } else {
+ this.videoList = [
+ ...this.videoList,
+ ...data.filter(
+ (newItem) => !this.videoList.some((oldItem) => oldItem.id === newItem.id)
+ ),
+ ];
+ }
+ this.loading = false;
+ if(data.length < this.videoQuery.pageSize) {
+ this.videoNoMore = true;
+ return;
+ }
+ this.videoQuery.pageNumber++;
+
+ })
+ }else{
getHealthRecommendVideos(this.videoQuery).then(res => {
// 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
const data = res.data.data.map(item => {
@@ -768,7 +833,7 @@
}
this.videoQuery.pageNumber++;
- })
+ })}
},
// 婊戝姩鍒囨崲瑙嗛
diff --git a/pages/kitchen/KitchenVideo.vue b/pages/kitchen/KitchenVideo.vue
index ccecf6a..fd8de35 100644
--- a/pages/kitchen/KitchenVideo.vue
+++ b/pages/kitchen/KitchenVideo.vue
@@ -413,6 +413,26 @@
console.log('-------------leftHeight------------------------>',this.leftHeight)
this.getKitchenTypeList();
this.loadVideos();
+ },
+ onShareAppMessage(e) {
+ const userInfo = storage.getUserInfo();
+ if(!userInfo) {
+ console.log("鏈櫥褰曚笉鑳藉垎浜�");
+ return
+ }
+ const videoInfo = e.target.dataset.obj;
+ // 淇濆瓨鍒嗕韩璁板綍
+ const data = {
+ shareType: 'video',
+ refId: videoInfo.id,
+ shareUser: userInfo.id
+ }
+ saveShare(data)
+ return {
+ title: videoInfo.title,
+ path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
+ imageUrl: videoInfo.coverUrl
+ }
},
methods: {
// 鏌ヨ褰撳墠瑙嗛鐨勫叧鑱旇棰戯紙鎸備簡鍚屼竴鍟嗗搧鐨勶級
diff --git a/pages/mine/address/add.vue b/pages/mine/address/add.vue
index b2d8df2..b57c855 100644
--- a/pages/mine/address/add.vue
+++ b/pages/mine/address/add.vue
@@ -3,9 +3,9 @@
<div class="uForm">
<u-form :border-bottom="false" :model="form" ref="uForm" :error-type="['toast']" :rule="rules">
<!-- #ifndef H5 -->
- <view class="selectAddress" @click="clickUniMap">
+<!-- <view class="selectAddress" @click="clickUniMap">
閫夋嫨鏀惰揣鍦板潃
- </view>
+ </view> -->
<!-- #endif -->
<u-form-item class="border" label="鏀惰揣浜�" label-width="130" prop="name">
<u-input v-model="form.name" clearable placeholder="璇疯緭鍏ユ敹璐т汉濮撳悕" />
@@ -35,7 +35,7 @@
<m-city :provinceData="list" headTitle="鍖哄煙閫夋嫨" ref="cityPicker" @funcValue="getpickerParentValue" pickerSize="4">
</m-city>
- <uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" />
+ <!-- <uniMap v-if="mapFlag" @close="closeMap" @callback="callBackAddress" /> -->
</div>
</view>
</template>
@@ -125,7 +125,6 @@
// 閫夋嫨鍦板潃鍚庢暟鎹殑鍥炶皟
callBackAddress(val) {
- console.log(val)
uni.showLoading({
title: "鍔犺浇涓�",
});
diff --git a/pages/mine/im/index.vue b/pages/mine/im/index.vue
index 4d69a33..ddfadc1 100644
--- a/pages/mine/im/index.vue
+++ b/pages/mine/im/index.vue
@@ -269,7 +269,6 @@
this.getTalk(options.userId)
}
-
// this.ws.connect();
this.sokcet();
},
diff --git a/pages/tabbar/index/home.vue b/pages/tabbar/index/home.vue
index a3fe2dc..dca4875 100644
--- a/pages/tabbar/index/home.vue
+++ b/pages/tabbar/index/home.vue
@@ -380,19 +380,43 @@
this.startHidenTime = Date.now()
},
onLoad(option) {
+ console.log('-----------鍒嗕韩鍑虹殑鏁版嵁---------->',option)
+ //澶勭悊鎵爜鍑烘潵鐨勮棰�
this.marginBottom = uni.getSystemInfoSync().safeAreaInsets.bottom
+ // 妫�鏌ユ槸鍚﹀瓨鍦╭鍙傛暟
+ let queryParam = this.videoQuery;
+ if (option.q) {
+ // 鍙岄噸瑙g爜锛氬井淇″URL杩涜浜嗕袱娆$紪鐮�
+ const decodedUrl = decodeURIComponent(decodeURIComponent(option.q));
+ console.log('鍘熷URL:', decodedUrl);
+
+ // 瑙f瀽URL涓殑鏌ヨ鍙傛暟
+ const params = this.parseUrlParams(decodedUrl);
+ const shareType = params.shareType;
+ const videoId = params.videoId;
+ queryParam.videoId = videoId
+ console.log('瑙f瀽鍙傛暟:', { shareType, videoId });
+ }
const token = storage.getAccessToken();
if (! token) {
this.wxSilentLogin(() => {
- this.loadVideos();
// 鍒ゆ柇鏄笉鏄偣鍑诲垎浜摼鎺ヨ繘鏉ョ殑
if (option.userId && option.videoId) {
+ queryParam.videoId = option.videoId
// 淇濆瓨鍒嗕韩鐐瑰嚮璁板綍
saveShareClickRecord({refId: option.videoId, shareUserId: option.userId})
}
+ console.log('------------------------>',queryParam)
+ this.loadVideos(queryParam);
})
} else {
- this.loadVideos();
+ if (option.userId && option.videoId) {
+ queryParam.videoId = option.videoId
+ // 淇濆瓨鍒嗕韩鐐瑰嚮璁板綍
+ saveShareClickRecord({refId: option.videoId, shareUserId: option.userId})
+ }
+ console.log('------------------------2>',queryParam)
+ this.loadVideos(queryParam);
}
},
onShareAppMessage(e) {
@@ -412,10 +436,26 @@
return {
title: videoInfo.title,
path: `/pages/tabbar/index/home?videoId=${videoInfo.id}&userId=${userInfo.id}`,
- imageUrl: videoInfo.coverUrl
}
},
- methods: {
+ methods: {
+ // 瑙f瀽URL鍙傛暟
+ parseUrlParams(url) {
+ const params = {};
+ // 澶勭悊鍙兘瀛樺湪鐨刪ash锛堝鏋滄湁鐨勮瘽锛�
+ const cleanUrl = url.split('#')[0];
+ const queryStr = cleanUrl.split('?')[1] || '';
+
+ queryStr.split('&').forEach(pair => {
+ const [key, value] = pair.split('=');
+ if (key) {
+ // 濡傛灉鍊煎瓨鍦紝鍒欒В鐮侊紝鍚﹀垯璁句负绌哄瓧绗︿覆
+ params[key] = value ? decodeURIComponent(value) : '';
+ }
+ });
+
+ return params;
+ },
// 鏌ヨ褰撳墠瑙嗛鐨勫叧鑱旇棰戯紙鎸備簡鍚屼竴鍟嗗搧鐨勶級
async getGoodsSimilarly() {
if (this.similarlyLoading || this.similarlyNomore) return Promise.resolve();;
@@ -753,10 +793,38 @@
},
// 鍔犺浇瑙嗛鏁版嵁
- async loadVideos() {
+ async loadVideos(param) {
if (this.loading || this.videoNoMore) return;
this.loading = true;
-
+ if(param){
+ getRecommendVideos(param).then(res => {
+ // 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
+ const data = res.data.data.map(item => {
+ return {
+ ...item,
+ updateKey: item.id
+ }
+ })
+ if (this.videoQuery.pageNumber === 1) {
+ this.videoList = data;
+ } else {
+ this.videoList = [
+ ...this.videoList,
+ ...data.filter(
+ (newItem) => !this.videoList.some((oldItem) => oldItem.id === newItem.id)
+ ),
+ ];
+
+ }
+ this.loading = false;
+ if(res.data.data.length < this.videoQuery.pageSize) {
+ this.videoNoMore = true;
+ return;
+ }
+ this.videoQuery.pageNumber++;
+
+ })
+ }else{
getRecommendVideos(this.videoQuery).then(res => {
// 鏂板涓�涓瓧娈电敤浜庡惊鐜椂鐨刱ey
const data = res.data.data.map(item => {
@@ -784,6 +852,7 @@
this.videoQuery.pageNumber++;
})
+ }
},
// 婊戝姩鍒囨崲瑙嗛
diff --git a/pages/video/video-goods-detail.vue b/pages/video/video-goods-detail.vue
index a8fc8a1..62ae3a8 100644
--- a/pages/video/video-goods-detail.vue
+++ b/pages/video/video-goods-detail.vue
@@ -53,6 +53,11 @@
this.getGoodsList();
},
methods: {
+ selectGoods(goods,id){
+ uni.navigateTo({
+ url: `/pages/product/goods?id=${goods.id}&goodsId=${goods.goodsId}`
+ })
+ },
// 鑾峰彇鍟嗗搧鍒楄〃
async getGoodsList() {
getGoodsDetail(this.videoId).then(res => {
--
Gitblit v1.8.0