diff --git a/app.json b/app.json index 4a170e8..fe26c90 100644 --- a/app.json +++ b/app.json @@ -70,8 +70,8 @@ "text": "消息" }, { - "pagePath": "pages/seller/index", - "text": "货源" + "pagePath": "pages/settlement/index", + "text": "入驻" }, { "pagePath": "pages/favorites/index", diff --git a/pages/chat-detail/index.js b/pages/chat-detail/index.js index 97efe75..abe1a97 100644 --- a/pages/chat-detail/index.js +++ b/pages/chat-detail/index.js @@ -2,6 +2,24 @@ const API = require('../../utils/api.js'); Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 实时聊天,商务沟通', + path: '/pages/chat-detail/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 实时聊天,商务沟通', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + // 页面状态标志,用于检测页面是否已卸载 isUnloaded: false, diff --git a/pages/chat/index.js b/pages/chat/index.js index 18e96da..2ea6325 100644 --- a/pages/chat/index.js +++ b/pages/chat/index.js @@ -2,6 +2,24 @@ const API = require('../../utils/api.js'); Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 轻松交流,合作共赢', + path: '/pages/chat/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 轻松交流,合作共赢', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + data: { chatList: [], searchKeyword: '', diff --git a/pages/cooperation/index.js b/pages/cooperation/index.js index cda09b9..8754547 100644 --- a/pages/cooperation/index.js +++ b/pages/cooperation/index.js @@ -70,12 +70,23 @@ Page({ }; }, + /** + * 用户点击右上角分享到朋友圈 + */ + onShareTimeline: function () { + return { + title: '招商合作 - 又鸟蛋平台', + query: '', + imageUrl: '' + }; + }, + /** * 拨打电话 */ makePhoneCall: function () { wx.makePhoneCall({ - phoneNumber: '138XXXXXXXX', + phoneNumber: '18280108971', success: function () { console.log('拨打电话成功'); }, diff --git a/pages/create-supply/index.js b/pages/create-supply/index.js index 7365a8b..2cf9bb2 100644 --- a/pages/create-supply/index.js +++ b/pages/create-supply/index.js @@ -5,6 +5,24 @@ const API = require('../../utils/api.js'); Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 发布货源,轻松销售', + path: '/pages/create-supply/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 发布货源,轻松销售', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + /** * 页面的初始数据 */ diff --git a/pages/customer-service/detail/index.js b/pages/customer-service/detail/index.js index e439587..1950f96 100644 --- a/pages/customer-service/detail/index.js +++ b/pages/customer-service/detail/index.js @@ -225,5 +225,17 @@ Page({ path: `/pages/customer-service/detail/index?id=${customerData?.id}`, imageUrl: '' }; + }, + + /** + * 用户点击右上角分享到朋友圈 + */ + onShareTimeline: function () { + const { customerData } = this.data; + return { + title: `${customerData?.alias || '优秀客服'} - 鸡蛋贸易平台`, + query: `id=${customerData?.id}`, + imageUrl: '' + }; } }); diff --git a/pages/customer-service/index.js b/pages/customer-service/index.js index 90ddc92..a6a4ca5 100644 --- a/pages/customer-service/index.js +++ b/pages/customer-service/index.js @@ -1,6 +1,24 @@ // pages/customer-service/index.js const api = require('../../utils/api'); Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 专业客服,服务贴心', + path: '/pages/customer-service/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 专业客服,服务贴心', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + // 客服数据,将从后端动态获取 data: { customerServices: [], diff --git a/pages/evaluate/index.js b/pages/evaluate/index.js index f2a413c..1bec4f7 100644 --- a/pages/evaluate/index.js +++ b/pages/evaluate/index.js @@ -3,6 +3,24 @@ const api = require('../../utils/api.js'); Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 智能估价,专业分析', + path: '/pages/evaluate/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 智能估价,专业分析', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + data: { evaluateStep: 1, fromPreviousStep: false, // 用于标记是否从下一步返回 diff --git a/pages/favorites/index.js b/pages/favorites/index.js index 841eb9d..d818754 100644 --- a/pages/favorites/index.js +++ b/pages/favorites/index.js @@ -135,11 +135,29 @@ Page({ }, + /** + * 用户点击右上角分享 + */ /** * 用户点击右上角分享 */ onShareAppMessage() { + return { + title: '我的收藏 - 又鸟蛋平台', + path: '/pages/favorites/index', + imageUrl: '' + }; + }, + /** + * 用户点击右上角分享到朋友圈 + */ + onShareTimeline() { + return { + title: '我的收藏 - 又鸟蛋平台', + query: '', + imageUrl: '' + }; }, /** diff --git a/pages/goods-detail/goods-detail.js b/pages/goods-detail/goods-detail.js index 57e9e1a..5dbc74c 100644 --- a/pages/goods-detail/goods-detail.js +++ b/pages/goods-detail/goods-detail.js @@ -65,6 +65,28 @@ function extractProvince(region) { } Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + const goodsDetail = this.data.goodsDetail || {}; + const title = goodsDetail.name ? `优质鸡蛋 - ${goodsDetail.name}` : '优质鸡蛋货源'; + return { + title: title, + path: `/pages/goods-detail/goods-detail?productId=${goodsDetail.id || goodsDetail.productId}`, + imageUrl: goodsDetail.imageUrls && goodsDetail.imageUrls.length > 0 ? goodsDetail.imageUrls[0] : '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + const goodsDetail = this.data.goodsDetail || {}; + const title = goodsDetail.name ? `优质鸡蛋 - ${goodsDetail.name}` : '优质鸡蛋货源'; + return { + title: title, + query: `productId=${goodsDetail.id || goodsDetail.productId}`, + imageUrl: goodsDetail.imageUrls && goodsDetail.imageUrls.length > 0 ? goodsDetail.imageUrls[0] : '/images/你有好蛋.png' + } + }, + data: { goodsDetail: {}, // 当前商品详情 showImagePreview: false, // 控制图片预览弹窗显示 diff --git a/pages/index/index.js b/pages/index/index.js index 2e92a52..a370986 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -1150,7 +1150,7 @@ Page({ // 跳转到我要卖蛋页面 navigateToSettlement: function() { - wx.navigateTo({ + wx.switchTab({ url: '/pages/settlement/index' }) }, diff --git a/pages/message-list/index.js b/pages/message-list/index.js index a971513..4214da6 100644 --- a/pages/message-list/index.js +++ b/pages/message-list/index.js @@ -1,6 +1,24 @@ // pages/message-list/index.js const API = require('../../utils/api.js'); Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 消息通知,及时沟通', + path: '/pages/message-list/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 消息通知,及时沟通', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + data: { messageList: [], userInfo: {}, diff --git a/pages/notopen/index.js b/pages/notopen/index.js index f3043a5..413bfa2 100644 --- a/pages/notopen/index.js +++ b/pages/notopen/index.js @@ -1,4 +1,22 @@ Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 功能敬请期待', + path: '/pages/notopen/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 功能敬请期待', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + /** * 页面的初始数据 */ diff --git a/pages/profile/index.js b/pages/profile/index.js index 75d944d..73d8fc9 100644 --- a/pages/profile/index.js +++ b/pages/profile/index.js @@ -1,5 +1,23 @@ // pages/profile/index.js Page({ + // 分享给朋友/群聊 + onShareAppMessage() { + return { + title: '鸡蛋贸易平台 - 个人中心,查看我的信息', + path: '/pages/profile/index', + imageUrl: '/images/你有好蛋.png' + } + }, + + // 分享到朋友圈 + onShareTimeline() { + return { + title: '鸡蛋贸易平台 - 个人中心,查看我的信息', + query: '', + imageUrl: '/images/你有好蛋.png' + } + }, + data: { userInfo: {}, userType: '', diff --git a/pages/publish/index.js b/pages/publish/index.js index 43e5058..5bdf1e0 100644 --- a/pages/publish/index.js +++ b/pages/publish/index.js @@ -529,5 +529,27 @@ Page({ this.setData({ images: images }); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + return { + title: '发布商品 - 又鸟蛋平台', + path: '/pages/publish/index', + imageUrl: '' + }; + }, + + /** + * 用户点击右上角分享到朋友圈 + */ + onShareTimeline: function () { + return { + title: '发布商品 - 又鸟蛋平台', + query: '', + imageUrl: '' + }; } }); \ No newline at end of file diff --git a/pages/settlement/index.js b/pages/settlement/index.js index 76d0c1b..d38ee26 100644 --- a/pages/settlement/index.js +++ b/pages/settlement/index.js @@ -1462,5 +1462,27 @@ Page({ showCooperationHelp: false, selectedCooperationDetail: null }); + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + return { + title: '合作入驻 - 又鸟蛋平台', + path: '/pages/settlement/index', + imageUrl: '' + }; + }, + + /** + * 用户点击右上角分享到朋友圈 + */ + onShareTimeline: function () { + return { + title: '合作入驻 - 又鸟蛋平台', + query: '', + imageUrl: '' + }; } }); \ No newline at end of file diff --git a/pages/settlement/index.json b/pages/settlement/index.json index 043cc34..19146bf 100644 --- a/pages/settlement/index.json +++ b/pages/settlement/index.json @@ -1,5 +1,4 @@ { "usingComponents": {}, - "navigationBarTitleText": "立即入驻", - "navigationBarBackButtonText": "返回" + "navigationBarTitleText": "立即入驻" } \ No newline at end of file diff --git a/pages/settlement/index.wxml b/pages/settlement/index.wxml index cffebca..1e9f7c4 100644 --- a/pages/settlement/index.wxml +++ b/pages/settlement/index.wxml @@ -7,7 +7,6 @@ 成为供应商 完成入驻后即可发布货源,开展鸡蛋贸易 - @@ -261,6 +260,8 @@ + + diff --git a/pages/settlement/index.wxss b/pages/settlement/index.wxss index f064266..a1e1351 100644 --- a/pages/settlement/index.wxss +++ b/pages/settlement/index.wxss @@ -120,6 +120,12 @@ page { padding-bottom: env(safe-area-inset-bottom); } +/* 底部空白区域样式 - 防止按钮被底部遮挡 */ +.bottom-spacer { + height: 100rpx; /* 预留底部空间,避免按钮被遮挡 */ + width: 100%; +} + /* iOS特殊优化 */ @supports (-webkit-touch-callout: none) { .form-input {