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
9c5a6abe
Commit
9c5a6abe
authored
Jun 07, 2023
by
小耗子
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改企业
parent
0de602de
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
86 deletions
+68
-86
pages/index/defalutScreen.vue
pages/index/defalutScreen.vue
+18
-20
pages/user/enterprise.vue
pages/user/enterprise.vue
+33
-49
shopro/store/modules/user.js
shopro/store/modules/user.js
+17
-17
static/img/user/enterprise_icon.png
static/img/user/enterprise_icon.png
+0
-0
static/img/user/enterprise_icon1.png
static/img/user/enterprise_icon1.png
+0
-0
static/img/user/enterprise_icon2.png
static/img/user/enterprise_icon2.png
+0
-0
No files found.
pages/index/defalutScreen.vue
View file @
9c5a6abe
...
...
@@ -41,34 +41,32 @@
...
mapActions
([
'
getPhoneNumber
'
,
'
registerInfoFn
'
,
'
authCheck
'
,
'
getUserInfo
'
,
'
enterprise
'
]),
// 马上进入
enter
()
{
// if (this.unregistered && !this.loading) {
// uni.navigateTo({
// url: '/pages/h5/index',
// })
// }else{
console
.
log
(
"
x2
"
)
this
.
getInfoPhoneNumber
(
e
)
// }
if
(
this
.
unregistered
&&
!
this
.
loading
)
{
uni
.
navigateTo
({
url
:
'
/pages/h5/index
'
,
})
}
else
{
this
.
getInfoPhoneNumber
()
}
},
// 获取手机号
async
getInfoPhoneNumber
(
e
)
{
console
.
log
(
e
)
let
number
=
await
this
.
getPhoneNumber
(
e
);
let
list
=
await
this
.
enterprise
()
console
.
log
(
list
)
if
(
list
.
length
==
1
)
{
let
register
=
await
this
.
registerInfoFn
(
list
[
0
].
companyId
);
if
(
register
)
{
//注册成功
this
.
unregistered
=
true
;
uni
.
navigateTo
({
url
:
'
/pages/h5/index
'
,
})
}
}
else
{
uni
.
navigateTo
({
url
:
'
/pages/user/enterprise
'
,
})
}
// let number = await this.getPhoneNumber(e);
// let register = await this.registerInfoFn();
// if (register) { //注册成功
// this.unregistered = true;
// uni.navigateTo({
// url: '/pages/h5/index',
// })
// }
},
async
auth
()
{
let
auth
=
await
this
.
authCheck
();
...
...
@@ -165,7 +163,7 @@
this
.
getAuth
();
},
onShareAppMessage
(
res
){
return
{
return
{
path
:
'
pages/index/defalutScreen
'
}
}
...
...
pages/user/enterprise.vue
View file @
9c5a6abe
<
template
>
<view
class=
"enterprise-boxs"
>
<view
class=
"enterprise-ul"
>
<view
class=
"enterprice-li"
>
<view
class=
"enterprice-li"
v-for=
"item in enterpriseList"
:key=
"item.companyId"
@
click=
"selectEnterprise(item)"
>
<view
class=
"lf"
>
米粒优选商城
{{
item
.
businessName
}}
<view
class=
"icon-tips"
>
标
<!--
<image
class=
"enterprise_icon"
src=
"../../static/img/user/enterprise_icon.png"
mode=
"widthFix"
></image>
-->
<image
class=
"enterprise_icon"
src=
"../../static/img/user/enterprise_icon1.png"
mode=
"widthFix"
></image>
<text
class=
"tips"
>
欢迎访问
</text>
</view>
</view>
<view
class=
"rt"
>
<u-icon
name=
"arrow-right"
color=
"#2979ff"
size=
"28"
></u-icon>
</view>
</view>
<view
class=
"enterprice-li"
>
<view
class=
"lf"
>
米粒优选商城
<view
class=
"icon-tips"
>
标
<text
class=
"tips"
>
欢迎访问
</text>
</view>
</view>
<view
class=
"rt"
>
<u-icon
name=
"arrow-right"
color=
"#2979ff"
size=
"28"
></u-icon>
<!--
<u-icon
name=
"arrow-right"
color=
"#2979ff"
size=
"28"
></u-icon>
-->
<image
class=
"next_icon2"
src=
"../../static/img/user/enterprise_icon2.png"
mode=
"widthFix"
></image>
</view>
</view>
</view>
<image
class=
"bg"
src=
"../../static/img/user/bg.png"
mode=
"scaleToFill"
></image>
<!--
<view
v-for=
"item in list"
:key=
"item.companyId"
@
click=
"selectEnterprise(item)"
>
{{
item
.
businessName
}}
</view>
-->
</view>
</
template
>
<
script
>
/**
* loginType 1需要注册页,0不需要,直接注册
* mallType 1开放、封闭
* mallType 1开放、
0
封闭
* registerPageType
* 此字段是当loginType为普通登录时有意义
0-页面有 手机号+验证码
...
...
@@ -44,9 +32,14 @@
3-页面有 礼品卡+密码
4-页面有 手机号验证码+姓名+工号
*/
import
{
mapActions
,
mapGetters
}
from
'
vuex
'
import
http
from
'
@/shopro/request/index
'
export
default
{
computed
:
{
...
mapGetters
([
'
enterpriseList
'
])
},
data
()
{
return
{
...
...
@@ -60,48 +53,31 @@
}
},
onLoad
()
{
this
.
companysList
()
this
.
enterprise
()
console
.
log
(
this
.
enterpriseList
)
},
onShow
(){
uni
.
hideHomeButton
()
},
methods
:
{
/**
* 获取企业列表
*/
companysList
(){
let
that
=
this
;
console
.
log
(
http
)
http
(
'
user.companysList
'
).
then
(
res
=>
{
if
(
!
res
.
code
)
{
this
.
list
=
res
.
data
}
else
{
that
.
$u
.
toast
(
res
.
msg
);
}
});
},
...
mapActions
([
'
enterprise
'
,
'
registerInfoFn
'
]),
/**
* 选择企业
*/
selectEnterprise
(
item
){
async
selectEnterprise
(
item
){
console
.
log
(
item
)
if
(
item
.
loginType
){
//1需要注册页
}
else
{
//不需要注册
this
.
registerInfo
.
companyId
=
item
.
companyId
http
(
'
user.register
'
,
this
.
registerInfo
).
then
(
res
=>
{
if
(
!
res
.
code
)
{
this
.
list
=
res
.
data
;
// this.$Router.push({ path: '/pages/index/category' });
uni
.
redirectTo
({
url
:
'
/pages/index/category
'
,
})
}
else
{
that
.
$u
.
toast
(
res
.
msg
);
}
})
let
register
=
await
this
.
registerInfoFn
(
item
.
companyId
);
if
(
register
)
{
//注册成功
uni
.
navigateTo
({
url
:
'
/pages/h5/index
'
,
})
}
}
}
}
...
...
@@ -128,15 +104,23 @@
font-weight
:
bold
;
.icon-tips
{
margin-top
:
10rpx
;
.enterprise_icon
{
width
:
24rpx
;
margin-right
:
10rpx
;
}
.tips
{
font-size
:
24rpx
;
color
:
#7f7f7f
;
font-weight
:
normal
;
vertical-align
:
text-top
;
}
}
}
.rt
{
width
:
50rpx
;
.next_icon2
{
width
:
48rpx
;
}
}
}
}
...
...
shopro/store/modules/user.js
View file @
9c5a6abe
...
...
@@ -29,7 +29,7 @@ const getters = {
wxCode
:
state
=>
state
.
wxCode
,
sessionStatus
:
state
=>
state
.
sessionStatus
,
mallId
:
state
=>
state
.
mallId
,
enterpriseList
:
state
=>
state
.
enterpriseList
,
enterpriseList
:
state
=>
state
.
enterpriseList
}
...
...
@@ -155,32 +155,32 @@ const actions = {
// });
// }
state
.
registerInfo
.
companyId
=
companyId
conosole
.
log
(
state
.
registerInfo
)
// http('user.register', state.registerInfo).then(res => {
// if (res.code==0||res.code==3761) {
// resolve(1);
// } else{
// uni.showToast({
// title: res.msg,
// duration: 2000,
// icon:'none'
// });
// reject(res.data);
// }
// })
http
(
'
user.register
'
,
state
.
registerInfo
).
then
(
res
=>
{
if
(
res
.
code
==
0
||
res
.
code
==
3761
)
{
resolve
(
1
);
}
else
{
uni
.
showToast
({
title
:
res
.
msg
,
duration
:
2000
,
icon
:
'
none
'
});
reject
(
res
.
data
);
}
})
})
},
// 获取企业
enterprise
({
commit
,
state
},
e
){
this
.
enterpriseList
=
[]
return
new
Promise
((
resolve
,
reject
)
=>
{
let
that
=
this
;
http
(
'
user.companysList
'
).
then
(
res
=>
{
if
(
!
res
.
code
)
{
this
.
enterpriseList
=
res
.
data
;
resolve
(
this
.
enterpriseList
);
state
.
enterpriseList
=
res
.
data
;
resolve
(
res
.
data
);
}
else
{
resolve
([]);
this
.
enterpriseList
=
[]
state
.
enterpriseList
=
[];
uni
.
showToast
(
res
.
msg
);
}
});
...
...
static/img/user/enterprise_icon.png
0 → 100644
View file @
9c5a6abe
1.33 KB
static/img/user/enterprise_icon1.png
0 → 100644
View file @
9c5a6abe
1.26 KB
static/img/user/enterprise_icon2.png
0 → 100644
View file @
9c5a6abe
1.56 KB
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