Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
meihua-island-book
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-12-22 17:43:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
81ccb244e897b17861114bd48387a13978c36ecf
81ccb244
1 parent
2079b411
处理详情页分享跳转问题,首页封面图从系统参数里面取的问题
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
19 deletions
src/api/index.js
src/app.js
src/assets/images/top@2x.png
src/pages/auth/index.vue
src/pages/detail/index.config.js
src/pages/detail/index.vue
src/pages/index/index.vue
src/pages/my/index.less
src/api/index.js
View file @
81ccb24
/*
* @Date: 2023-12-22 10:29:37
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-22 1
1:28:17
* @LastEditTime: 2023-12-22 1
6:35:54
* @FilePath: /meihuaApp/src/api/index.js
* @Description: 文件描述
*/
...
...
@@ -12,6 +12,7 @@ const Api = {
SEND_SMS_CODE
:
'/srv/?a=room_order&t=send_sms_code'
,
SHOW_SESSION
:
'/srv/?a=room_order&t=show_session'
,
SAVE_CUSTOMER_INFO
:
'/srv/?a=room_order&t=save_customer_info'
,
SYS_PARAM
:
'/srv/?a=room_order&t=sys_param'
,
}
/**
...
...
@@ -41,3 +42,9 @@ export const showMyInfoAPI = (params) => fn(fetch.get(Api.SHOW_SESSION, params))
* @returns
*/
export
const
saveCustomerInfoAPI
=
(
params
)
=>
fn
(
fetch
.
post
(
Api
.
SAVE_CUSTOMER_INFO
,
params
));
/**
* @description: 获取系统参数
* @returns
*/
export
const
sysParamAPI
=
(
params
)
=>
fn
(
fetch
.
get
(
Api
.
SYS_PARAM
,
params
));
...
...
src/app.js
View file @
81ccb24
/*
* @Date: 2023-12-14 17:45:15
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-22
09:28:22
* @LastEditTime: 2023-12-22
17:41:53
* @FilePath: /meihuaApp/src/app.js
* @Description: 文件描述
*/
...
...
@@ -16,15 +16,22 @@ const App = createApp({
onLaunch
(
options
)
{
// 未授权状态跳转授权页面,首页不需要权限
const
path
=
options
.
path
;
const
query
=
options
.
query
;
// 缓存没有权限的地址
const
router
=
routerStore
();
router
.
add
(
path
);
// if (path !== 'pages/index/index' && !wx.getStorageSync("sessionid")) {
if
(
!
wx
.
getStorageSync
(
"sessionid"
))
{
console
.
warn
(
"没有权限"
);
Taro
.
navigateTo
({
url
:
'./pages/auth/index'
,
})
if
(
path
===
'pages/detail/index'
)
{
Taro
.
navigateTo
({
url
:
`./pages/auth/index?url=
${
path
}
&id=
${
query
.
id
}
&start_date=
${
query
.
start_date
}
&end_date=
${
query
.
end_date
}
`
,
})
}
else
{
Taro
.
navigateTo
({
url
:
'./pages/auth/index?url='
+
path
,
})
}
}
},
onShow
(
options
)
{},
...
...
src/assets/images/top@2x.png
0 → 100644
View file @
81ccb24
117 KB
src/pages/auth/index.vue
View file @
81ccb24
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-22 1
5:07:20
* @LastEditTime: 2023-12-22 1
7:41:02
* @FilePath: /meihuaApp/src/pages/auth/index.vue
* @Description: 文件描述
-->
...
...
@@ -58,13 +58,17 @@ export default {
// url: '../apxUserInfo/index'
// })
// }
// console.warn(getCurrentPageParam());
// Taro.reLaunch({
// url: getCurrentPageParam().url
// })
Taro.reLaunch({
url: '/pages/index/index'
})
// TAG:处理分享跳转问题
const params = getCurrentPageParam();
if (getCurrentPageParam().url === 'pages/detail/index') { // 详情页的分享跳转处理
Taro.reLaunch({
url: `../../${params.url}?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}`
})
} else { // 其他页面分享跳首页
Taro.reLaunch({
url: `/pages/index/index`
})
}
Taro.hideLoading();
}
} else {
...
...
src/pages/detail/index.config.js
View file @
81ccb24
/*
* @Date: 2023-12-15 13:57:34
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-
15 13:57:50
* @LastEditTime: 2023-12-
22 17:05:58
* @FilePath: /meihuaApp/src/pages/detail/index.config.js
* @Description: 文件描述
*/
...
...
@@ -9,4 +9,5 @@ export default {
navigationBarTitleText
:
'房间详情'
,
usingComponents
:
{
},
enableShareAppMessage
:
true
}
...
...
src/pages/detail/index.vue
View file @
81ccb24
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-2
1 16:49:40
* @LastEditTime: 2023-12-2
2 17:38:15
* @FilePath: /meihuaApp/src/pages/detail/index.vue
* @Description: 房间详情页面
-->
...
...
@@ -192,5 +192,39 @@ import mixin from '@/utils/mixin';
export default {
name: "detailPage",
mixins: [mixin.init],
onShareAppMessage(options) {
let params = getCurrentPageParam();
// 设置菜单中的转发按钮触发转发事件时的转发内容
var shareObj = {
title: "梅花岛-房间详情", // 默认是小程序的名称(可以写slogan等)
path: `pages/detail/index?id=${params.id}&start_date=${params.start_date}&end_date=${params.end_date}`, // 默认是当前页面,必须是以‘/'开头的完整路径
imageUrl: '', //自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径,支持PNG及JPG,不传入 imageUrl 则使用默认截图。显示图片长宽比是 5:4
success: function (res) {
// 转发成功之后的回调
if (res.errMsg == 'shareAppMessage:ok') {
//
}
},
fail: function () {
// 转发失败之后的回调
if (res.errMsg == 'shareAppMessage:fail cancel') {
// 用户取消转发
} else if (res.errMsg == 'shareAppMessage:fail') {
// 转发失败,其中 detail message 为详细失败信息
}
},
complete: function () {
// 转发结束之后的回调(转发成不成功都会执行)
}
}
// 来自页面内的按钮的转发
// if (options.from == 'button') {
// var eData = options.target.dataset;
// // 此处可以修改 shareObj 中的内容
// shareObj.path = '/pages/goods/goods?goodId=' + eData.id;
// }
// 返回shareObj
return shareObj;
}
};
</script>
...
...
src/pages/index/index.vue
View file @
81ccb24
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-22 1
5:31:12
* @LastEditTime: 2023-12-22 1
7:09:11
* @FilePath: /meihuaApp/src/pages/index/index.vue
* @Description: 首页
-->
...
...
@@ -9,7 +9,7 @@
<view class="index-page">
<scroll-view :style="scrollStyle" :scroll-y="true" :scroll-top="scrollTop" :scroll-with-animation="true" @scroll="onScroll" @scrolltoupper="onScrollToUpper" @scrolltolower="onScrollToLower">
<view class="index-cover">
<image :style="coverStyle" mode="aspectFill"
src="https://cdn.ipadbiz.cn/meihua/banner1@2x.png
" />
<image :style="coverStyle" mode="aspectFill"
:src="banner_url
" />
<view @tap="onArrowDown" class="cover-arrow">
<IconFont color="#f9f9f9" size="30" name="joy-smile" class="nut-icon-am-jump nut-icon-am-infinite"></IconFont>
</view>
...
...
@@ -50,6 +50,7 @@ import "./index.less";
// import { activityHomeAPI } from '@/api/Host/index'
import { $ } from '@tarojs/extend'
import mixin from '@/utils/mixin';
import { sysParamAPI } from '@/api/index'
export default {
name: "indexPage",
...
...
@@ -128,7 +129,7 @@ export default {
};
},
},
mounted () {
async
mounted () {
// 设置首页封面高度
const windowHeight = wx.getSystemInfoSync().windowHeight;
setTimeout(async () => {
...
...
@@ -142,9 +143,14 @@ export default {
status: 'enable'
})
}
const { code, data } = await sysParamAPI();
if (code) {
this.banner_url = data.home_banner ? data.home_banner : 'https://cdn.ipadbiz.cn/meihua/banner1@2x.png';
}
},
data() {
return {
banner_url: '',
indexCoverHeight: 0,
scrollTop: 0,
room_list: [],
...
...
src/pages/my/index.less
View file @
81ccb24
...
...
@@ -3,7 +3,9 @@
position: relative;
display: flex;
align-items: center;
background-color: #3a2013;
// background-color: #3a2013;
background-image: url('https://cdn.ipadbiz.cn/meihua/top@2x.png');
background-size: cover;
color: #fff;
padding: 40rpx 0 40rpx 25rpx;
.user-info {
...
...
Please
register
or
login
to post a comment