Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
intel_promotion_uniapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
intel_promotion_uniapp
Commits
d2bfb2ee
Commit
d2bfb2ee
authored
Jun 18, 2024
by
杨硕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对接接口
parent
09ce0d2f
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
189 additions
and
50 deletions
+189
-50
config.js
common/config.js
+2
-1
http.interceptor.js
common/http.interceptor.js
+4
-4
passwordLogin.vue
login/login/passwordLogin.vue
+6
-1
package-lock.json
package-lock.json
+25
-0
package.json
package.json
+1
-0
pages.json
pages.json
+13
-1
index.vue
pages/menu/index.vue
+42
-11
list.vue
pages/order/list.vue
+2
-2
profile.vue
pages/user/profile.vue
+4
-4
setting.vue
setting/setting/setting.vue
+73
-19
updatePwd.vue
setting/setting/updatePwd.vue
+16
-6
index.js
store/index.js
+1
-1
No files found.
common/config.js
View file @
d2bfb2ee
...
@@ -3,5 +3,6 @@ export default {
...
@@ -3,5 +3,6 @@ export default {
// baseApi: 'http://linjiashop.microapp.store/prod-api' //调用演示环境
// baseApi: 'http://linjiashop.microapp.store/prod-api' //调用演示环境
// baseApi:'/prod-api'//web生产
// baseApi:'/prod-api'//web生产
// baseApi: 'https://qf.91isoft.com/cshop'//本地测试
// baseApi: 'https://qf.91isoft.com/cshop'//本地测试
baseApi
:
'http://192.168.1.29:8081'
//本地测试
// baseApi: 'http://192.168.10.9:8099'//本地测试
baseApi
:
'http://127.0.0.1:8099'
}
}
common/http.interceptor.js
View file @
d2bfb2ee
...
@@ -40,6 +40,7 @@ const install = (Vue, vm) => {
...
@@ -40,6 +40,7 @@ const install = (Vue, vm) => {
}
}
// 响应拦截,判断状态码是否通过
// 响应拦截,判断状态码是否通过
Vue
.
prototype
.
$u
.
http
.
interceptor
.
response
=
(
res
)
=>
{
Vue
.
prototype
.
$u
.
http
.
interceptor
.
response
=
(
res
)
=>
{
console
.
log
(
"请求数据"
,
res
);
// 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
// 如果把originalData设置为了true,这里得到将会是服务器返回的所有的原始数据
// 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
// 判断可能变成了res.statueCode,或者res.data.code之类的,请打印查看结果
if
(
res
.
code
==
200
)
{
if
(
res
.
code
==
200
)
{
...
@@ -47,8 +48,8 @@ const install = (Vue, vm) => {
...
@@ -47,8 +48,8 @@ const install = (Vue, vm) => {
return
res
.
data
;
return
res
.
data
;
}
else
{
}
else
{
//todo 统一处理错误信息
//todo 统一处理错误信息
if
(
res
.
m
sg
){
if
(
res
.
m
essage
){
Vue
.
prototype
.
$u
.
toast
(
res
.
m
sg
);
Vue
.
prototype
.
$u
.
toast
(
res
.
m
essage
);
return
false
;
return
false
;
}
}
return
false
;
return
false
;
...
@@ -57,12 +58,11 @@ const install = (Vue, vm) => {
...
@@ -57,12 +58,11 @@ const install = (Vue, vm) => {
//异常统一处理
//异常统一处理
Vue
.
prototype
.
$u
.
http
.
interceptor
.
error
=
(
res
)
=>
{
Vue
.
prototype
.
$u
.
http
.
interceptor
.
error
=
(
res
)
=>
{
console
.
log
(
'error'
,
res
);
console
.
log
(
'error'
,
res
);
if
(
res
.
statusC
ode
==
401
){
if
(
res
.
c
ode
==
401
){
//跳转至登录页面
//跳转至登录页面
Vue
.
prototype
.
$u
.
route
(
'/login/login/passwordLogin'
);
Vue
.
prototype
.
$u
.
route
(
'/login/login/passwordLogin'
);
return
true
;
return
true
;
}
else
{
}
else
{
if
(
res
.
data
.
message
){
if
(
res
.
data
.
message
){
Vue
.
prototype
.
$u
.
toast
(
res
.
data
.
message
);
Vue
.
prototype
.
$u
.
toast
(
res
.
data
.
message
);
return
false
;
return
false
;
...
...
login/login/passwordLogin.vue
View file @
d2bfb2ee
...
@@ -103,7 +103,12 @@
...
@@ -103,7 +103,12 @@
})
})
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
console
.
log
(
"err"
,
res
)
console
.
log
(
"err"
,
res
)
this
.
$u
.
toast
(
res
.
message
)
if
(
res
.
code
===
401
)
{
this
.
$u
.
toast
(
"账号或密码错误"
)
}
else
{
this
.
$u
.
toast
(
res
.
message
)
}
})
})
},
},
getCode
(){
getCode
(){
...
...
package-lock.json
View file @
d2bfb2ee
...
@@ -4,6 +4,21 @@
...
@@ -4,6 +4,21 @@
"lockfileVersion"
:
1
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"requires"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
"@vant/popperjs"
:
{
"version"
:
"1.3.0"
,
"resolved"
:
"https://registry.npmmirror.com/@vant/popperjs/-/popperjs-1.3.0.tgz"
,
"integrity"
:
"sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw=="
},
"@vant/use"
:
{
"version"
:
"1.6.0"
,
"resolved"
:
"https://registry.npmmirror.com/@vant/use/-/use-1.6.0.tgz"
,
"integrity"
:
"sha512-PHHxeAASgiOpSmMjceweIrv2AxDZIkWXyaczksMoWvKV2YAYEhoizRuk/xFnKF+emUIi46TsQ+rvlm/t2BBCfA=="
},
"@vue/shared"
:
{
"version"
:
"3.4.29"
,
"resolved"
:
"https://registry.npmmirror.com/@vue/shared/-/shared-3.4.29.tgz"
,
"integrity"
:
"sha512-hQ2gAQcBO/CDpC82DCrinJNgOHI2v+FA7BDW4lMSPeBpQ7sRe2OLHWe5cph1s7D8DUQAwRt18dBDfJJ220APEA=="
},
"call-bind"
:
{
"call-bind"
:
{
"version"
:
"1.0.7"
,
"version"
:
"1.0.7"
,
"resolved"
:
"https://registry.npmmirror.com/call-bind/-/call-bind-1.0.7.tgz"
,
"resolved"
:
"https://registry.npmmirror.com/call-bind/-/call-bind-1.0.7.tgz"
,
...
@@ -137,6 +152,16 @@
...
@@ -137,6 +152,16 @@
"object-inspect"
:
"^1.13.1"
"object-inspect"
:
"^1.13.1"
}
}
},
},
"vant"
:
{
"version"
:
"4.9.1"
,
"resolved"
:
"https://registry.npmmirror.com/vant/-/vant-4.9.1.tgz"
,
"integrity"
:
"sha512-p7iAKJyACYVwrmrkf3COmbuvzjHrFJ+FAmlyOWbxTS2ovkRs+tNKYjX2iibAl4XnHXBQD+qpX0ogUqE3jE7Isg=="
,
"requires"
:
{
"@vant/popperjs"
:
"^1.3.0"
,
"@vant/use"
:
"^1.6.0"
,
"@vue/shared"
:
"^3.4.27"
}
},
"vue-i18n"
:
{
"vue-i18n"
:
{
"version"
:
"8.20.0"
,
"version"
:
"8.20.0"
,
"resolved"
:
"https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.20.0.tgz"
,
"resolved"
:
"https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.20.0.tgz"
,
...
...
package.json
View file @
d2bfb2ee
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
"
crypto-js
"
:
"
^4.2.0
"
,
"
crypto-js
"
:
"
^4.2.0
"
,
"
jsencrypt
"
:
"
^3.3.2
"
,
"
jsencrypt
"
:
"
^3.3.2
"
,
"
qs
"
:
"
^6.12.1
"
,
"
qs
"
:
"
^6.12.1
"
,
"
vant
"
:
"
^4.9.1
"
,
"
vue-i18n
"
:
"
^8.20.0
"
,
"
vue-i18n
"
:
"
^8.20.0
"
,
"
wxmp-rsa
"
:
"
^2.1.0
"
"
wxmp-rsa
"
:
"
^2.1.0
"
}
}
...
...
pages.json
View file @
d2bfb2ee
...
@@ -44,7 +44,19 @@
...
@@ -44,7 +44,19 @@
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"订单"
"navigationBarTitleText"
:
"订单"
}
}
},
{
},
{
"path"
:
"pages/myArticle/index"
,
"style"
:
{
"navigationBarTitleText"
:
"我的文章"
}
},{
"path"
:
"pages/myVedio/index"
,
"style"
:
{
"navigationBarTitleText"
:
"我的视频"
}
},
{
"path"
:
"pages/order/detail"
,
"path"
:
"pages/order/detail"
,
"style"
:
{
"style"
:
{
"navigationBarTitleText"
:
"订单详情"
"navigationBarTitleText"
:
"订单详情"
...
...
pages/menu/index.vue
View file @
d2bfb2ee
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
:scroll-into-view=
"itemId"
>
:scroll-into-view=
"itemId"
>
<view
v-for=
"(item,index) in tabbar"
:key=
"index"
class=
"u-tab-item"
:class=
"[current == index ? 'u-tab-item-active' : '']"
<view
v-for=
"(item,index) in tabbar"
:key=
"index"
class=
"u-tab-item"
:class=
"[current == index ? 'u-tab-item-active' : '']"
@
tap
.
stop=
"swichMenu(index)"
>
@
tap
.
stop=
"swichMenu(index)"
>
<text
class=
"u-line-1"
>
{{
item
}}
</text>
<text
class=
"u-line-1"
>
{{
item
.
name
}}
</text>
</view>
</view>
</scroll-view>
</scroll-view>
<scroll-view
:scroll-top=
"scrollRightTop"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
>
<scroll-view
:scroll-top=
"scrollRightTop"
scroll-y
scroll-with-animation
class=
"right-box"
@
scroll=
"rightScroll"
>
...
@@ -22,8 +22,8 @@
...
@@ -22,8 +22,8 @@
</view>
</view>
<view
class=
"item-container"
>
<view
class=
"item-container"
>
<view
class=
"thumb-box"
v-for=
"(item1, index1) in item.children"
:key=
"index1"
@
click=
"toCategory(item1)"
>
<view
class=
"thumb-box"
v-for=
"(item1, index1) in item.children"
:key=
"index1"
@
click=
"toCategory(item1)"
>
<image
class=
"item-menu-image"
:src=
"
pic2
"
mode=
""
></image>
<image
class=
"item-menu-image"
:src=
"
item1.path
"
mode=
""
></image>
<view
class=
"item-menu-name"
>
{{
item1
.
nam
e
}}
</view>
<view
class=
"item-menu-name"
>
{{
item1
.
title
||
item1
.
videoTitl
e
}}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
menuHeight
:
0
,
// 左边菜单的高度
menuHeight
:
0
,
// 左边菜单的高度
menuItemHeight
:
0
,
// 左边菜单item的高度
menuItemHeight
:
0
,
// 左边菜单item的高度
itemId
:
''
,
// 栏目右边scroll-view用于滚动的id
itemId
:
''
,
// 栏目右边scroll-view用于滚动的id
tabbar
:
[
'文章'
,
'视频'
],
tabbar
:
[],
menuItemPos
:
[],
menuItemPos
:
[],
arr
:
[],
arr
:
[],
scrollRightTop
:
0
,
// 右边栏目scroll-view的滚动条高度
scrollRightTop
:
0
,
// 右边栏目scroll-view的滚动条高度
...
@@ -55,17 +55,43 @@
...
@@ -55,17 +55,43 @@
}
}
},
},
onLoad
()
{
onLoad
()
{
},
onShow
()
{
this
.
init
()
this
.
init
()
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
console
.
log
(
"vuex_unit"
,
this
.
vuex_unit
)
const
token
=
this
.
vuex_token
const
unitList
=
this
.
vuex_unit
if
(
token
===
''
||
token
===
null
){
this
.
$u
.
get
(
'cmsvideo/miniProgram/listByClassification?page=1&rows=10&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
this
.
$u
.
route
({
url
:
'/login/login/passwordLogin'
// this.tabbar = temp
})
})
}
else
{
this
.
getMenuItemTop
()
const
unitList
=
this
.
vuex_unit
console
.
log
(
"vuex_unit"
,
this
.
vuex_unit
)
this
.
tabbar
=
[]
//视频
this
.
$u
.
get
(
'cmsvideo/miniProgram/listByClassification?page=1&rows=10&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
const
videoChild
=
res
.
records
const
video
=
{
'name'
:
'视频'
,
"children"
:
videoChild
}
this
.
tabbar
.
push
(
video
)
})
//文章
this
.
$u
.
get
(
'cmsnews/miniProgram/listByClassification?page=1&rows=10&unitId='
+
unitList
[
0
].
businessId
).
then
(
res
=>
{
const
videoChild
=
res
.
records
const
video
=
{
'name'
:
'文章'
,
"children"
:
videoChild
}
this
.
tabbar
.
push
(
video
)
})
this
.
getMenuItemTop
()
}
},
},
toSearch
()
{
toSearch
()
{
this
.
$u
.
route
({
this
.
$u
.
route
({
...
@@ -302,6 +328,11 @@
...
@@ -302,6 +328,11 @@
font-family
:
Source
Han
Sans
CN-Regular
,
Source
Han
Sans
CN
;
font-family
:
Source
Han
Sans
CN-Regular
,
Source
Han
Sans
CN
;
font-weight
:
400
;
font-weight
:
400
;
color
:
#333333
;
color
:
#333333
;
overflow
:
hidden
;
-webkit-line-clamp
:
2
;
text-overflow
:
ellipsis
;
display
:
-
webkit-box
;
-webkit-box-orient
:
vertical
;
}
}
.item-container
{
.item-container
{
...
...
pages/order/list.vue
View file @
d2bfb2ee
<
template
>
<
template
>
<view>
<view>
<view
class=
"wrap"
>
<view
class=
"wrap"
>
<view
class=
"u-tabs-box"
>
<
!--
<
view
class=
"u-tabs-box"
>
<u-tabs-swiper
activeColor=
"#f29100"
ref=
"tabs"
:list=
"list"
:current=
"current"
@
change=
"change"
:is-scroll=
"false"
<u-tabs-swiper
activeColor=
"#f29100"
ref=
"tabs"
:list=
"list"
:current=
"current"
@
change=
"change"
:is-scroll=
"false"
swiperWidth=
"750"
></u-tabs-swiper>
swiperWidth=
"750"
></u-tabs-swiper>
</view>
</view>
-->
<swiper
class=
"swiper-box"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
<swiper
class=
"swiper-box"
:current=
"swiperCurrent"
@
transition=
"transition"
@
animationfinish=
"animationfinish"
>
<swiper-item
class=
"swiper-item"
>
<swiper-item
class=
"swiper-item"
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
>
<scroll-view
scroll-y
style=
"height: 100%;width: 100%;"
@
scrolltolower=
"reachBottom"
>
...
...
pages/user/profile.vue
View file @
d2bfb2ee
...
@@ -9,10 +9,10 @@
...
@@ -9,10 +9,10 @@
<view
class=
"u-flex user-box"
>
<view
class=
"u-flex user-box"
>
<view
class=
"u-m-r-10"
>
<view
class=
"u-m-r-10"
>
<!--
<u-avatar
v-if=
"vuex_user.nickName == '未登录'"
size=
"140"
></u-avatar>
-->
<!--
<u-avatar
v-if=
"vuex_user.nickName == '未登录'"
size=
"140"
></u-avatar>
-->
<image
v-if=
"vuex_user.nickName == '未登录'"
src=
"../../static/img/image/wode_logo_default@2x.png"
<image
src=
"../../static/img/image/wode_logo_default@2x.png"
class=
"avaterimage"
></image>
class=
"avaterimage"
></image>
<!--
<u-avatar
v-if=
"vuex_user.nickName !== '未登录'"
:src=
"vuex_avatar"
size=
"140"
></u-avatar>
-->
<!--
<u-avatar
v-if=
"vuex_user.nickName !== '未登录'"
:src=
"vuex_avatar"
size=
"140"
></u-avatar>
-->
<
image
v-if=
"vuex_user.nickName !== '未登录'"
:src=
"vuex_avatar"
class=
"avaterimage"
></image
>
<
!--
<image
v-if=
"vuex_user.nickName !== '未登录'"
:src=
"vuex_avatar"
class=
"avaterimage"
></image>
--
>
</view>
</view>
<view
class=
"toptitlelist"
>
<view
class=
"toptitlelist"
>
<view
class=
"toptitlelist1"
>
{{
vuex_user
.
name
}}
</view>
<view
class=
"toptitlelist1"
>
{{
vuex_user
.
name
}}
</view>
...
@@ -30,14 +30,14 @@
...
@@ -30,14 +30,14 @@
<!--
<u-cell-group>
<!--
<u-cell-group>
<u-cell-item
icon=
"list"
title=
"我的订单"
@
click=
"openPage('/pages/order/list')"
></u-cell-item>
<u-cell-item
icon=
"list"
title=
"我的订单"
@
click=
"openPage('/pages/order/list')"
></u-cell-item>
</u-cell-group>
-->
</u-cell-group>
-->
<view
class=
"card"
@
click=
"openPage('/pages/
order/list
')"
>
<view
class=
"card"
@
click=
"openPage('/pages/
myArticle/index
')"
>
<image
src=
"../../static/img/image/wode_icon_dingdan@2x.png"
class=
"leftimage"
></image>
<image
src=
"../../static/img/image/wode_icon_dingdan@2x.png"
class=
"leftimage"
></image>
<view
class=
"cardtitle"
>
<view
class=
"cardtitle"
>
<span>
我的文章
</span>
<span>
我的文章
</span>
</view>
</view>
<image
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
class=
"rightimage"
></image>
<image
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
class=
"rightimage"
></image>
</view>
</view>
<view
class=
"card"
@
click=
"openPage('
/pages/order/list
')"
>
<view
class=
"card"
@
click=
"openPage('
pages/myVedio/index
')"
>
<image
src=
"../../static/img/image/wode_icon_dingdan@2x.png"
class=
"leftimage"
></image>
<image
src=
"../../static/img/image/wode_icon_dingdan@2x.png"
class=
"leftimage"
></image>
<view
class=
"cardtitle"
>
<view
class=
"cardtitle"
>
<span>
我的视频
</span>
<span>
我的视频
</span>
...
...
setting/setting/setting.vue
View file @
d2bfb2ee
<
template
>
<
template
>
<view
class=
"wrap"
>
<view
class=
"wrap"
>
<view
class=
"card1"
@
click=
"openPage('/setting/setting/updateAvatar')"
>
<
!--
<
view
class=
"card1"
@
click=
"openPage('/setting/setting/updateAvatar')"
>
<image
src=
"../../static/image/shezhi_icon_touxiang@2x.png"
class=
"settingimage"
></image>
<image
src=
"../../static/image/shezhi_icon_touxiang@2x.png"
class=
"settingimage"
></image>
<view
class=
"settingtitle"
>
头像
</view>
<view
class=
"settingtitle"
>
头像
</view>
<image
class=
"settingimage1"
:src=
"vuex_avatar"
></image>
<image
class=
"settingimage1"
:src=
"vuex_avatar"
></image>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
</view>
</view>
-->
<view
class=
"card2"
@
click=
"updateNickName"
>
<view
class=
"card2"
@
click=
"updateNickName"
>
<image
src=
"../../static/image/shezhi_icon_xingming@2x.png"
class=
"settingimage"
></image>
<image
src=
"../../static/image/shezhi_icon_xingming@2x.png"
class=
"settingimage"
></image>
<view
class=
"settingtitle"
>
姓名
</view>
<view
class=
"settingtitle"
>
姓名
</view>
<view
class=
"righttitle1"
>
{{
user
.
n
ickN
ame
}}
</view>
<view
class=
"righttitle1"
>
{{
user
.
name
}}
</view>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
</view>
</view>
<view
class=
"card
3
"
@
click=
"updateGender"
>
<view
class=
"card
1
"
@
click=
"updateGender"
>
<image
src=
"../../static/image/shezhi_icon_xingbie@2x.png"
class=
"settingimage"
></image>
<image
src=
"../../static/image/shezhi_icon_xingbie@2x.png"
class=
"settingimage"
></image>
<view
class=
"settingtitle"
>
性别
</view>
<view
class=
"settingtitle"
>
性别
</view>
<view
class=
"righttitle1"
>
{{
user
.
genderStr
}}
</view>
<view
class=
"righttitle1"
>
{{
user
.
genderStr
}}
</view>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
</view>
</view>
<view
class=
"card"
>
<view
class=
"card"
>
<view
class=
"card3"
@
click=
"updateUnit"
>
<image
src=
"../../static/image/shezhi_icon_genghuanshouji@2x.png"
class=
"settingimage"
></image>
<view
class=
"settingtitle"
>
商家
</view>
<view
class=
"unitTitle"
>
{{
unitName
}}
</view>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
</view>
<view
class=
"card1"
@
click=
"openPage('/setting/setting/updatePwd')"
>
<view
class=
"card1"
@
click=
"openPage('/setting/setting/updatePwd')"
>
<image
src=
"../../static/image/shezhi_icon_xiugaimima@2x.png"
class=
"settingimage"
></image>
<image
src=
"../../static/image/shezhi_icon_xiugaimima@2x.png"
class=
"settingimage"
></image>
<view
class=
"settingtitle"
>
修改密码
</view>
<view
class=
"settingtitle"
>
修改密码
</view>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
</view>
</view>
<view
class=
"card3"
@
click=
"todo('/setting/setting/updateMobile')"
>
<image
src=
"../../static/image/shezhi_icon_genghuanshouji@2x.png"
class=
"settingimage"
></image>
<view
class=
"settingtitle"
>
更换手机
</view>
<view
class=
"righttitle1"
>
{{
user
.
mobile
}}
</view>
<image
class=
"settingrightimage"
src=
"../../static/img/image/wode_icon_jiantou@2x.png"
></image>
</view>
</view>
</view>
...
@@ -51,6 +51,8 @@
...
@@ -51,6 +51,8 @@
<u-action-sheet
:list=
"gender.list"
v-model=
"gender.show"
:cancel-btn=
"false"
@
click=
"submitGender"
>
<u-action-sheet
:list=
"gender.list"
v-model=
"gender.show"
:cancel-btn=
"false"
@
click=
"submitGender"
>
</u-action-sheet>
</u-action-sheet>
<u-action-sheet
:list=
"unit.list"
v-model=
"unit.show"
:cancel-btn=
"false"
@
click=
"submitUnit"
>
</u-action-sheet>
</view>
</view>
...
@@ -65,6 +67,7 @@
...
@@ -65,6 +67,7 @@
user
:
{
user
:
{
genderIcon
:
'man'
,
genderIcon
:
'man'
,
},
},
unitName
:
''
,
gender
:
{
gender
:
{
show
:
false
,
show
:
false
,
list
:
[{
list
:
[{
...
@@ -75,6 +78,11 @@
...
@@ -75,6 +78,11 @@
value
:
'female'
value
:
'female'
}]
}]
},
},
unit
:
{
show
:
false
,
list
:
[]
},
unitList
:
[],
nickName
:
{
nickName
:
{
show
:
false
,
show
:
false
,
value
:
''
value
:
''
...
@@ -83,17 +91,18 @@
...
@@ -83,17 +91,18 @@
},
},
onLoad
()
{
onLoad
()
{
this
.
init
();
this
.
init
();
this
.
unitName
=
this
.
vuex_unit
[
0
].
unitName
},
},
methods
:
{
methods
:
{
init
()
{
init
()
{
const
user
=
this
.
vuex_user
;
const
user
=
this
.
vuex_user
;
if
(
user
.
nickName
!==
'未登录'
)
{
if
(
user
.
nickName
!==
'未登录'
)
{
if
(
user
.
gender
==
'female'
)
{
if
(
user
.
gender
==
1
)
{
user
.
genderStr
=
'女'
;
user
.
genderStr
=
'女'
;
user
.
genderIcon
=
'woman'
;
user
.
genderIcon
=
'woman'
;
}
}
if
(
user
.
gender
==
'male'
)
{
if
(
user
.
sex
==
0
)
{
user
.
genderStr
=
'男'
;
user
.
genderStr
=
'男'
;
user
.
genderIcon
=
'man'
;
user
.
genderIcon
=
'man'
;
...
@@ -133,6 +142,23 @@
...
@@ -133,6 +142,23 @@
updateGender
()
{
updateGender
()
{
this
.
gender
.
show
=
true
;
this
.
gender
.
show
=
true
;
},
},
updateUnit
()
{
this
.
unit
.
show
=
true
//获取用户所在商家信息
this
.
$u
.
get
(
'/sysunit/getUnitInfo'
).
then
(
ref
=>
{
console
.
log
(
"ref"
,
ref
)
// this.$u.vuex('vuex_unit',ref)
this
.
unit
.
list
=
[]
this
.
unitList
=
ref
ref
.
forEach
(
item
=>
{
const
unitList
=
{
text
:
item
.
unitName
,
value
:
item
.
businessId
}
this
.
unit
.
list
.
push
(
unitList
)
})
})
},
submitGender
(
index
)
{
submitGender
(
index
)
{
let
selData
=
this
.
gender
.
list
[
index
];
let
selData
=
this
.
gender
.
list
[
index
];
this
.
$u
.
post
(
'user/updateGender/'
+
selData
.
value
).
then
(
res
=>
{
this
.
$u
.
post
(
'user/updateGender/'
+
selData
.
value
).
then
(
res
=>
{
...
@@ -153,15 +179,28 @@
...
@@ -153,15 +179,28 @@
this
.
$u
.
toast
(
'修改成功'
);
this
.
$u
.
toast
(
'修改成功'
);
});
});
},
},
submitUnit
(
index
){
const
unit
=
this
.
unit
.
list
[
index
]
console
.
log
(
"unit"
,
unit
)
this
.
unitName
=
unit
.
text
const
unitListChoose
=
this
.
unitList
.
find
(
item
=>
item
.
businessId
===
unit
.
value
)
console
.
log
(
"unitListChoose"
,
unitListChoose
);
const
unitListChooseList
=
[]
unitListChooseList
.
push
(
unitListChoose
)
this
.
$u
.
vuex
(
'vuex_unit'
,
unitListChooseList
)
// this.$u.vuex("vuex_unit",unitListChooseList)
},
logout
()
{
logout
()
{
// uni.clearStorage()
this
.
$u
.
vuex
(
'vuex_token'
,
''
)
this
.
$u
.
vuex
(
'vuex_token'
,
''
)
this
.
$u
.
vuex
(
'vuex_avatar'
,
''
)
this
.
$u
.
vuex
(
'vuex_avatar'
,
''
)
this
.
$u
.
vuex
(
'vuex_user'
,
{
this
.
$u
.
vuex
(
'vuex_user'
,
{
nickName
:
'未登录'
nickName
:
'未登录'
});
});
this
.
$u
.
vuex
(
'vuex_unit'
,[])
this
.
$u
.
route
({
this
.
$u
.
route
({
url
:
'
/login/login/passwordLogin
'
,
url
:
'
pages/user/profile
'
,
params
:
{}
params
:
{}
})
})
},
},
...
@@ -188,10 +227,10 @@
...
@@ -188,10 +227,10 @@
}
}
.card1
{
.card1
{
height
:
128rpx
;
height
:
128rpx
;
margin
:
30rpx
30rpx
0
30rpx
;
margin
:
0
30rpx
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
border-radius
:
12px
12px
0px
0
px
;
border-radius
:
0px
0px
12px
12
px
;
background
:
#FFFFFF
;
background
:
#FFFFFF
;
padding
:
0
30rpx
;
padding
:
0
30rpx
;
position
:
relative
;
position
:
relative
;
...
@@ -200,21 +239,36 @@
...
@@ -200,21 +239,36 @@
.card2
{
.card2
{
height
:
128rpx
;
height
:
128rpx
;
margin-bottom
:
0px
;
margin-bottom
:
0px
;
margin
:
0rpx
30rpx
;
margin
:
30rpx
30rpx
0rpx
30rpx
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
border-radius
:
0px
0
px
0px
0px
;
border-radius
:
12px
12
px
0px
0px
;
background
:
#FFFFFF
;
background
:
#FFFFFF
;
padding
:
0
30rpx
;
padding
:
0
30rpx
;
position
:
relative
;
position
:
relative
;
}
}
.unitTitle
{
max-width
:
55%
;
position
:
absolute
;
right
:
82rpx
;
font-size
:
16px
;
font-family
:
Source
Han
Sans
CN-Regular
,
Source
Han
Sans
CN
;
font-weight
:
400
;
color
:
#666666
;
overflow
:
hidden
;
-webkit-line-clamp
:
1
;
text-overflow
:
ellipsis
;
display
:
-
webkit-box
;
-webkit-box-orient
:
vertical
;
// text-align: right;
}
.card3
{
.card3
{
height
:
128rpx
;
height
:
128rpx
;
margin
:
0rpx
30rpx
;
margin
:
30rpx
30rpx
0
30rpx
;
display
:
flex
;
display
:
flex
;
align-items
:
center
;
align-items
:
center
;
border-radius
:
0px
0px
12px
12
px
;
border-radius
:
12px
12px
0px
0
px
;
background
:
#FFFFFF
;
background
:
#FFFFFF
;
padding
:
0
30rpx
;
padding
:
0
30rpx
;
position
:
relative
;
position
:
relative
;
...
...
setting/setting/updatePwd.vue
View file @
d2bfb2ee
<
template
>
<
template
>
<view
class=
"wrap"
>
<view
class=
"wrap"
>
<view
class=
"content"
>
<view
class=
"content"
>
<u-field
v-model=
"oldPassword"
type=
"password"
label=
"旧密码"
placeholder=
"请填写旧密码"
>
</u-field>
<u-field
v-model=
"password"
type=
"password"
label=
"新密码"
placeholder=
"请填写新密码"
>
<u-field
v-model=
"password"
type=
"password"
label=
"新密码"
placeholder=
"请填写新密码"
>
</u-field>
</u-field>
<u-field
v-model=
"rePassword"
type=
"password"
label=
"
重复密码"
placeholder=
"请重复填写新
密码"
>
<u-field
v-model=
"rePassword"
type=
"password"
label=
"
确认密码"
placeholder=
"请填写确认
密码"
>
</u-field>
</u-field>
<u-field
v-model=
"smsCode"
label=
"验证码"
placeholder=
"请填写验证码"
>
<
!--
<
u-field
v-model=
"smsCode"
label=
"验证码"
placeholder=
"请填写验证码"
>
<u-button
size=
"mini"
slot=
"right"
type=
"success"
:disabled=
"smsCodeDisabled"
@
click=
"getSmsCode"
>
{{
codeText
}}
</u-button>
<u-button
size=
"mini"
slot=
"right"
type=
"success"
:disabled=
"smsCodeDisabled"
@
click=
"getSmsCode"
>
{{
codeText
}}
</u-button>
</u-field>
</u-field>
-->
</view>
</view>
<view
class=
"u-m-t-20 u-p-20"
>
<view
class=
"u-m-t-20 u-p-20"
>
...
@@ -21,6 +23,7 @@
...
@@ -21,6 +23,7 @@
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
oldPassword
:
''
,
tel
:
''
,
tel
:
''
,
password
:
''
,
password
:
''
,
rePassword
:
''
,
rePassword
:
''
,
...
@@ -48,10 +51,17 @@
...
@@ -48,10 +51,17 @@
this
.
$u
.
toast
(
'前后密码不一致'
);
this
.
$u
.
toast
(
'前后密码不一致'
);
return
;
return
;
}
}
this
.
$u
.
post
(
'user/updatePassword_v2/'
+
this
.
password
+
'/'
+
this
.
smsCode
).
then
(
res
=>
{
this
.
$u
.
put
(
'/system/user/updatePwd?oldPassword='
+
this
.
oldPassword
+
'&newPassword='
+
this
.
password
).
then
(
res
=>
{
this
.
$u
.
vuex
(
'vuex_token'
,
''
)
this
.
$u
.
vuex
(
'vuex_avatar'
,
''
)
this
.
$u
.
vuex
(
'vuex_user'
,
{
nickName
:
'未登录'
});
this
.
$u
.
vuex
(
'vuex_unit'
,[])
this
.
$u
.
route
({
this
.
$u
.
route
({
type
:
'switchTab
'
,
url
:
'/login/login/passwordLogin
'
,
url
:
'/pages/user/profile'
params
:
{}
})
})
}).
catch
(
res
=>
{
}).
catch
(
res
=>
{
console
.
log
(
"err"
,
res
);
console
.
log
(
"err"
,
res
);
...
...
store/index.js
View file @
d2bfb2ee
...
@@ -43,7 +43,7 @@ const store = new Vuex.Store({
...
@@ -43,7 +43,7 @@ const store = new Vuex.Store({
vuex_version
:
'1.0.1'
,
vuex_version
:
'1.0.1'
,
vuex_demo
:
'绛紫'
,
vuex_demo
:
'绛紫'
,
vuex_avatar
:
lifeData
.
vuex_avatar
?
lifeData
.
vuex_avatar
:
'/static/img/nav/user.png'
,
vuex_avatar
:
lifeData
.
vuex_avatar
?
lifeData
.
vuex_avatar
:
'/static/img/nav/user.png'
,
vuex_unit
:
[],
vuex_unit
:
lifeData
.
vuex_unit
?
lifeData
.
vuex_unit
:
[],
// 自定义tabbar数据
// 自定义tabbar数据
vuex_tabbar
:
[{
vuex_tabbar
:
[{
iconPath
:
"/static/uview/example/component.png"
,
iconPath
:
"/static/uview/example/component.png"
,
...
...
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