Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mini_own
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
geruidan
mini_own
Commits
8f97d51b
Commit
8f97d51b
authored
Mar 12, 2025
by
geruidan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加auth自动注册,到首页并支付
parent
779f5e24
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
101 additions
and
38 deletions
+101
-38
env.js
env.js
+3
-6
manifest.json
manifest.json
+2
-2
pages.json
pages.json
+13
-11
pages/h5/auth.vue
pages/h5/auth.vue
+14
-9
pages/h5/index.vue
pages/h5/index.vue
+23
-8
pages/index/cart.vue
pages/index/cart.vue
+46
-2
No files found.
env.js
View file @
8f97d51b
...
...
@@ -10,12 +10,9 @@ export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量
export
const
MAP_KEY
=
'
426ebc3f1bbaced***89ee6061a98
'
;
//高德地图开发者Web服务key,逆坐标解析
export
const
HAS_LIVE
=
false
//后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播
// http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code}
// export const MALL_ID ="194433411100614";
// export const COMPANY_ID ="00000753";
// export const APP_ID = "wx93aba63d96157302"; //小程序APPID
// export const APP_KEY = "a20511dcfd6b07114afacbb482b2e7e0"; //勿改
export
const
MALL_ID
=
"
133507311100590
"
;
export
const
COMPANY_ID
=
"
202203282
"
;
export
const
MALL_ID
=
"
120939311101327
"
;
//中会汇豪泰
export
const
COMPANY_ID
=
"
2025030401
"
;
export
const
APP_ID
=
"
wx60c6530c49c52ff7
"
;
//小程序APPID
export
const
APP_KEY
=
"
a20511dcfd6b07114afacbb482b2e7e0
"
;
//勿改
...
...
manifest.json
View file @
8f97d51b
...
...
@@ -57,9 +57,9 @@
"appid"
:
"wx60c6530c49c52ff7"
,
"setting"
:
{
"urlCheck"
:
true
,
"minified"
:
tru
e
,
"minified"
:
fals
e
,
"es6"
:
true
,
"postcss"
:
fals
e
,
"postcss"
:
tru
e
,
"ignoreDevUnusedFiles"
:
false
,
"ignoreUploadUnusedFiles"
:
false
},
...
...
pages.json
View file @
8f97d51b
{
"easycom"
:
{
//
"^u-(.*)"
:
"uview-ui/components/u-$1/u-$1.vue"
"^u-(.*)"
:
"uview-ui/components/u-$1/u-$1.vue"
//
"^mpShop-(.*)"
:
"@/components/mpShop-$1/mpShop-$1.vue"
},
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path"
:
"pages/index/defalutScreen"
,
"name"
:
"defalutScreen"
,
...
...
@@ -16,22 +16,23 @@
}
},
{
"path"
:
"pages/index/ca
rt
"
,
"name"
:
"ca
rt
"
,
"path"
:
"pages/index/ca
tegory
"
,
"name"
:
"ca
tegory
"
,
"style"
:
{
"navigationBarTitleText"
:
"
购物车
"
,
"navigationBarTitleText"
:
"
分类
"
,
"enablePullDownRefresh"
:
false
}
},
{
"path"
:
"pages/index/ca
tegory
"
,
"name"
:
"ca
tegory
"
,
"path"
:
"pages/index/ca
rt
"
,
"name"
:
"ca
rt
"
,
"style"
:
{
"navigationBarTitleText"
:
"
分类
"
,
"navigationBarTitleText"
:
"
购物车
"
,
"enablePullDownRefresh"
:
false
}
}
...
...
@@ -44,7 +45,7 @@
"path"
:
"auth"
,
"name"
:
"auth"
,
"style"
:
{
"navigationBarTitleText"
:
"首页
122
"
,
"navigationBarTitleText"
:
"首页"
,
"enablePullDownRefresh"
:
false
}
},{
...
...
@@ -73,7 +74,8 @@
"name"
:
"index"
,
"style"
:
{
"navigationBarTitleText"
:
"首页"
,
"enablePullDownRefresh"
:
false
"enablePullDownRefresh"
:
false
,
"navigationStyle"
:
"default"
//
默认样式,会显示返回图标
}
}]
},
...
...
pages/h5/auth.vue
View file @
8f97d51b
<
template
>
<view
class=
""
>
啊急急急急急急
</view>
</
template
>
...
...
@@ -32,7 +30,9 @@
path
:
"
/pages/h5/index
"
,
appointPage
:
'
personalCenter
'
,
authCode
:
''
,
//authCode
h5Url
:
'
https://wx.zhonghuihaotai.com/webpage/wxdist/index.html#/productList?searchFlag=1&goodsName=名字
'
h5Url
:
'
https://wx.zhonghuihaotai.com/webpage/wxdist/index.html#/
'
,
//传递参数1
backMiniProgram
:
''
//回退到小程序的参数
}
},
computed
:
{
...
...
@@ -46,9 +46,8 @@
this
.
butDis
=
true
if
(
this
.
unregistered
&&
!
this
.
loading
)
{
let
h5url
=
encodeURIComponent
(
this
.
h5Url
);
console
.
log
(
'
加密
'
+
h5url
)
uni
.
navigateTo
({
url
:
`
${
this
.
path
}
?h5Url=
${
h5url
}
`
uni
.
redirectTo
({
url
:
`
${
this
.
path
}
?h5Url=
${
h5url
}
&backMiniProgram=
${
this
.
backMiniProgram
}
`
})
...
...
@@ -212,13 +211,18 @@
this
.
showPrivacy
=
false
}
},
onHide
()
{},
onUnload
()
{
},
onShow
()
{
this
.
butDis
=
false
this
.
butTips
=
"
马上进入
"
// uni.hideTabBar();
},
onReady
()
{
onReady
()
{
// this.authCode = this.$Route.query.authCode;
this
.
authCode
=
this
.
$Route
.
query
.
authCode
;
// this.backMiniProgram = this.$Route.query.backMiniProgram;
this
.
backMiniProgram
=
this
.
$Route
.
query
.
backMiniProgram
wx
.
clearStorage
();
if
(
COMPANY_ID
)
{
//配置了COMPANY_ID用COMPANY_ID 。否则用router上的COMPANY_ID
this
.
companyId
=
COMPANY_ID
...
...
@@ -241,7 +245,8 @@
// }
// },
onLoad
(
option
){
console
.
log
(
"
先走
"
)
}
...
...
pages/h5/index.vue
View file @
8f97d51b
...
...
@@ -19,10 +19,12 @@
appointPage
:
''
,
getMsg
:
""
,
goodsId
:
''
,
h5Url
:
''
h5Url
:
''
,
backMiniProgram
:
''
//回退到上个页的but
}
}
,
onReady
(){
this
.
backMiniProgram
=
this
.
$Route
.
query
.
backMiniProgram
// this.webUrl = "https://wx.zhonghuihaotai.com/webpage/wxdist/index.html#/?mallId=134581110000230&companyId=00000310&time="+new Date().getTime()
},
methods
:{
...
...
@@ -38,9 +40,9 @@
let
time
=
new
Date
().
getTime
();
if
(
this
.
h5Url
)
{
if
(
this
.
h5Url
.
indexOf
(
'
?
'
)
>-
1
){
this
.
webUrl
=
`
${
this
.
h5Url
}
&mallId=
${
MALL_ID
}
&companyId=
${
COMPANY_ID
}
&time=
${
time
}
&sfCode=
${
code
}
`
this
.
webUrl
=
`
${
this
.
h5Url
}
&mallId=
${
MALL_ID
}
&companyId=
${
COMPANY_ID
}
&time=
${
time
}
&sfCode=
${
code
}
&authMode=force
`
}
else
{
this
.
webUrl
=
`
${
this
.
h5Url
}
?mallId=
${
MALL_ID
}
&companyId=
${
COMPANY_ID
}
&time=
${
time
}
&sfCode=
${
code
}
`
this
.
webUrl
=
`
${
this
.
h5Url
}
?mallId=
${
MALL_ID
}
&companyId=
${
COMPANY_ID
}
&time=
${
time
}
&sfCode=
${
code
}
&authMode=force
`
}
}
else
{
this
.
webUrl
=
`
${
BASE_URL
}
/webpage/wxdist/index.html#/
${
this
.
appointPage
?
this
.
appointPage
:
""
}
?mallId=
${
MALL_ID
}
&companyId=
${
COMPANY_ID
}
&time=
${
time
}
&sfCode=
${
code
}
&authMode=force&goodsId=
${
this
.
goodsId
}
`
...
...
@@ -51,11 +53,17 @@
}
},
onLoad
(
option
){
this
.
appointPage
=
option
.
appointPage
?
option
.
appointPage
:
""
;
//指定页面
let
h5Url
=
decodeURIComponent
(
decodeURIComponent
(
option
.
h5Url
));
this
.
h5Url
=
option
.
h5Url
?
h5Url
:
""
;
this
.
goodsId
=
option
.
goodsId
this
.
saveMiniCode
();
console
.
log
(
"
option
"
)
console
.
log
(
option
)
if
(
option
){
this
.
appointPage
=
option
.
appointPage
?
option
.
appointPage
:
""
;
//指定页面
let
h5Url
=
decodeURIComponent
(
decodeURIComponent
(
option
.
h5Url
));
this
.
h5Url
=
option
.
h5Url
?
h5Url
:
""
;
this
.
backMiniProgram
=
option
.
backMiniProgram
?
option
.
backMiniProgram
:
''
;
this
.
goodsId
=
option
.
goodsId
this
.
saveMiniCode
();
}
},
// onShareAppMessage(res){
// let path = "pages/index/defalutScreen"
...
...
@@ -68,6 +76,13 @@
// },
onLaunch
(){
},
onUnload
(){
// uni.reLaunch({
// url:'/pages/index/xx'
// })
}
...
...
pages/index/cart.vue
View file @
8f97d51b
<
template
>
<view>
购物车
</view>
</
template
>
\ No newline at end of file
<view
class=
""
>
<view
@
click=
"handleMsg"
>
跳转小程序
{{
authCode
}}
</view>
<!--
<input
class=
"uni-input"
style=
"border:2px solid #ddd;"
v-model=
"authCode"
placeholder=
"自动获得焦点"
/>
-->
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
authCode
:
''
,
backMiniProgram
:
'
/pages/index/category
'
,
backAppId
:
''
}
},
methods
:{
handleMsg
(){
// backMiniProgram:'/pages/index/category'//参考格式
// authCode:'xx',
// appId:'小程序appid'
uni
.
navigateToMiniProgram
({
appId
:
'
wx60c6530c49c52ff7
'
,
// 目标小程序的 appId
path
:
`/pages/h5/auth?authCode=
${
this
.
authCode
}
&backMiniProgram=
${
this
.
backMiniProgram
}
&backAppId=
${
this
.
backAppId
}
`
,
// 可选,跳转的目标页面路径
envVersion
:
'
trial
'
,
// 可选,目标小程序的版本:'develop'、'trial'、'release'
success
(
res
)
{
console
.
log
(
'
跳转成功
'
,
res
);
uni
.
showToast
({
title
:
"
跳转成功
"
,
duration
:
2000
,
icon
:
'
none
'
});
},
fail
(
err
)
{
uni
.
showToast
({
title
:
"
跳转失败
"
,
duration
:
2000
,
icon
:
'
none
'
});
console
.
error
(
'
跳转失败
'
,
err
);
}
});
}
}
}
</
script
>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment