Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
J
jd-vx-app
Project
Project
Details
Activity
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
Administrator
jd-vx-app
Commits
9c9f96a9
Commit
9c9f96a9
authored
Aug 22, 2022
by
肖健
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/v1.0.0' into v1.0.0
parents
f858ecd5
feccd1cd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
567 additions
and
543 deletions
+567
-543
api.js
common/api/api.js
+1
-1
main.vue
pages/main.vue
+14
-1
moveCar.vue
pages/moveCar.vue
+2
-0
personal.vue
pages/personal.vue
+548
-541
shop.vue
pages/shop.vue
+2
-0
No files found.
common/api/api.js
View file @
9c9f96a9
...
@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => {
...
@@ -64,7 +64,7 @@ const httpTokenRequest = (opts, data) => {
// console.log(33333333333,res[1])
// console.log(33333333333,res[1])
if
(
res
[
1
].
data
.
code
==
401
){
if
(
res
[
1
].
data
.
code
==
401
){
uni
.
removeStorageSync
(
'userToken'
)
uni
.
removeStorageSync
(
'userToken'
)
uni
.
navigate
To
({
uni
.
redirect
To
({
url
:
"/pages/login/index/index?failure=401"
url
:
"/pages/login/index/index?failure=401"
})
})
return
;
return
;
...
...
pages/main.vue
View file @
9c9f96a9
...
@@ -85,6 +85,7 @@
...
@@ -85,6 +85,7 @@
},
},
methods
:
{
methods
:
{
tabChange
(
index
)
{
tabChange
(
index
)
{
uni
.
setStorageSync
(
'tabbar'
,
index
)
let
that
=
this
let
that
=
this
switch
(
index
)
{
switch
(
index
)
{
case
0
:
case
0
:
...
@@ -333,6 +334,7 @@
...
@@ -333,6 +334,7 @@
duration
:
2000
duration
:
2000
});
});
// 判断是否扫码进入
// 判断是否扫码进入
that
.
scene
=
uni
.
getStorageSync
(
'scene'
)
that
.
scene
=
uni
.
getStorageSync
(
'scene'
)
// console.log(that.scene,"微信扫码进入")
// console.log(that.scene,"微信扫码进入")
...
@@ -358,8 +360,19 @@
...
@@ -358,8 +360,19 @@
icon
:
'none'
,
icon
:
'none'
,
duration
:
2000
duration
:
2000
});
});
}
}
})
})
}
else
{
let
routerLogin
=
uni
.
getStorageSync
(
'routerLogin'
)
let
tabbar
=
uni
.
getStorageSync
(
'tabbar'
)
if
(
tabbar
){
this
.
tabChange
(
tabbar
)
}
if
(
routerLogin
){
uni
.
redirectTo
({
url
:
routerLogin
})
}
}
}
}
else
{
}
else
{
...
...
pages/moveCar.vue
View file @
9c9f96a9
...
@@ -56,6 +56,8 @@
...
@@ -56,6 +56,8 @@
methods
:
{
methods
:
{
goUrl
(
vo
)
{
goUrl
(
vo
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
vo
.
url
)
if
(
!
token
)
{
if
(
!
token
)
{
// uni.navigateTo({
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=1'
// url: '/pages/binding/index?url=/pages/main&index=1'
...
...
pages/personal.vue
View file @
9c9f96a9
...
@@ -3,26 +3,26 @@
...
@@ -3,26 +3,26 @@
* @Description: 个人中心
* @Description: 个人中心
-->
-->
<
template
>
<
template
>
<view
class=
""
v-if=
"show"
>
<view
class=
""
v-if=
"show"
>
<view
class=
"personal"
>
<view
class=
"personal"
>
<div
class=
"ps__bg"
>
<div
class=
"ps__bg"
>
<div
class=
"ps__title"
></div>
<div
class=
"ps__title"
></div>
<div
class=
"ps__info"
>
<div
class=
"ps__info"
>
<div
class=
"info__cover"
>
<div
class=
"info__cover"
>
<image
v-if=
"avatar"
:src=
"avatar"
/>
<image
v-if=
"avatar"
:src=
"avatar"
/>
<image
v-else
src=
"@/static/my/my2.jpg"
/>
<image
v-else
src=
"@/static/my/my2.jpg"
/>
</div>
</div>
<div>
<div>
<div
class=
"info__name"
>
{{
userInfo
.
nickName
||
'默认昵称'
}}
</div>
<div
class=
"info__name"
>
{{
userInfo
.
nickName
||
'默认昵称'
}}
</div>
<div
class=
"view__info"
@
click=
"editInfo"
>
<div
class=
"view__info"
@
click=
"editInfo"
>
查看个人主页或编辑资料
查看个人主页或编辑资料
<span>
<span>
<image
src=
"@/static/my/my7.png"
>
<image
src=
"@/static/my/my7.png"
>
</span>
</span>
</div>
</div>
</div>
</div>
</div>
</div>
<!--
<div
class=
"ps__shop"
>
<!--
<div
class=
"ps__shop"
>
<div
class=
"shop__tab"
>
<div
class=
"shop__tab"
>
<div
class=
"tab__top"
>
<div
class=
"tab__top"
>
<span>
商品订单
</span>
<span>
商品订单
</span>
...
@@ -41,544 +41,551 @@
...
@@ -41,544 +41,551 @@
</div>
</div>
</div>
</div>
</div>
-->
</div>
-->
</div>
</div>
<div
class=
"ps__list"
>
<div
class=
"ps__list"
>
<div
class=
"list__item"
v-for=
"(vo,inx) in menu"
:key=
"inx"
@
click=
"goUrl(vo)"
>
<div
class=
"list__item"
v-for=
"(vo,inx) in menu"
:key=
"inx"
@
click=
"goUrl(vo)"
>
<div
class=
"list__left"
>
<div
class=
"list__left"
>
<image
:src=
"vo.icon"
alt=
""
srcset=
""
>
<image
:src=
"vo.icon"
alt=
""
srcset=
""
>
{{
vo
.
title
}}
{{
vo
.
title
}}
</div>
</div>
<div
class=
"list__right"
>
<div
class=
"list__right"
>
<image
src=
"@/static/my/my5.png"
alt=
""
srcset=
""
>
<image
src=
"@/static/my/my5.png"
alt=
""
srcset=
""
>
</div>
</div>
</div>
</div>
</div>
</div>
<div
class=
"ps__btn"
v-if=
"logoutFlag"
@
click=
"loginOut"
>
退出登录
</div>
<div
class=
"ps__btn"
v-if=
"logoutFlag"
@
click=
"loginOut"
>
退出登录
</div>
</view>
<u-gap
bgColor=
"transparent"
height=
"70"
></u-gap>
</view>
</view>
<u-gap
bgColor=
"transparent"
height=
"70"
></u-gap>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
let
plugin
=
requirePlugin
(
'loginPlugin'
);
let
plugin
=
requirePlugin
(
'loginPlugin'
);
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
show
:
false
,
show
:
false
,
logoutFlag
:
true
,
logoutFlag
:
true
,
menu
:
[
menu
:
[
// {
// {
// icon: require("@/static/my/my01.png"),
// icon: require("@/static/my/my01.png"),
// title: "我的订单",
// title: "我的订单",
// url: "",
// url: "",
// type:"jd"
// type:"jd"
// },
// },
// {
// {
// icon: require("@/static/my/my12.png"),
// icon: require("@/static/my/my12.png"),
// title: "我的地址",
// title: "我的地址",
// url: "/pagesD/pages/personal/myAddress"
// url: "/pagesD/pages/personal/myAddress"
// },
// },
{
{
icon
:
require
(
"@/static/my/my8.png"
),
icon
:
require
(
"@/static/my/my8.png"
),
title
:
"使用帮助"
,
title
:
"使用帮助"
,
url
:
"/pagesD/pages/personal/help"
url
:
"/pagesD/pages/personal/help"
},
},
{
{
icon
:
require
(
"@/static/my/my1.png"
),
icon
:
require
(
"@/static/my/my1.png"
),
title
:
"常见问题"
,
title
:
"常见问题"
,
url
:
"/pagesD/pages/personal/asking"
url
:
"/pagesD/pages/personal/asking"
},
},
{
{
icon
:
require
(
"@/static/my/my11.png"
),
icon
:
require
(
"@/static/my/my11.png"
),
title
:
"问题反馈"
,
title
:
"问题反馈"
,
url
:
"/pagesD/pages/personal/ask"
url
:
"/pagesD/pages/personal/ask"
},
},
{
{
icon
:
require
(
"@/static/my/my15.png"
),
icon
:
require
(
"@/static/my/my15.png"
),
title
:
"微信通知设置"
,
title
:
"微信通知设置"
,
url
:
""
url
:
""
},
},
],
],
items
:
[{
items
:
[{
title
:
'待发货'
,
title
:
'待发货'
,
icon
:
require
(
'@/static/my/my2.jpg'
),
icon
:
require
(
'@/static/my/my2.jpg'
),
page
:
0
page
:
0
},
},
{
{
title
:
'待收货'
,
title
:
'待收货'
,
icon
:
require
(
'@/static/my/my3.png'
),
icon
:
require
(
'@/static/my/my3.png'
),
page
:
2
page
:
2
},
{
},
{
title
:
'已完成'
,
title
:
'已完成'
,
icon
:
require
(
'@/static/my/my14.png'
),
icon
:
require
(
'@/static/my/my14.png'
),
page
:
3
page
:
3
},
{
},
{
title
:
'退款/售后'
,
title
:
'退款/售后'
,
icon
:
require
(
'@/static/my/my9.png'
),
icon
:
require
(
'@/static/my/my9.png'
),
page
:
4
page
:
4
}
}
],
],
//用户信息
//用户信息
userInfo
:
null
,
userInfo
:
null
,
//头像
//头像
avatar
:
''
,
avatar
:
''
,
}
}
},
},
methods
:
{
methods
:
{
loginOut
()
{
loginOut
()
{
let
opts
=
{
let
opts
=
{
url
:
'/logout'
,
url
:
'/logout'
,
method
:
'post'
method
:
'post'
};
};
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
code
==
200
)
{
uni
.
removeStorageSync
(
'userToken'
)
uni
.
removeStorageSync
(
'userToken'
)
uni
.
removeStorageSync
(
'xcxIndexPath'
)
uni
.
removeStorageSync
(
'xcxIndexPath'
)
// uni.removeStorageSync('openid')
// uni.removeStorageSync('openid')
plugin
.
logout
().
then
((
res
)
=>
{
plugin
.
logout
().
then
((
res
)
=>
{
// console.jdLoginLog(res, 'logoutres');
// console.jdLoginLog(res, 'logoutres');
uni
.
reLaunch
({
uni
.
reLaunch
({
url
:
'/pages/main'
url
:
'/pages/main'
});
});
});
});
}
else
{
}
else
{
uni
.
showToast
({
uni
.
showToast
({
title
:
res
.
data
.
msg
,
title
:
res
.
data
.
msg
,
icon
:
'none'
,
icon
:
'none'
,
duration
:
2000
duration
:
2000
});
});
}
})
},
goOrder
(
current
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
uni
.
removeStorageSync
(
'routerLogin'
)
if
(
!
token
)
{
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
uni
.
navigateTo
({
url
:
"/pages/login/index/index?returnPage="
+
returnPage
+
'&pageType='
+
pageType
})
return
;
}
}
})
},
goOrder
(
current
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
){
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/login/index/index?returnPage="
+
returnPage
+
'&pageType='
+
pageType
url
:
'/pagesD/pages/personal/myOrder?current='
+
current
})
});
return
;
},
}
goUrl
(
vo
)
{
uni
.
navigateTo
({
let
token
=
uni
.
getStorageSync
(
'userToken'
);
url
:
'/pagesD/pages/personal/myOrder?current='
+
current
uni
.
removeStorageSync
(
'routerLogin'
)
});
uni
.
setStorageSync
(
'routerLogin'
,
vo
.
url
)
},
if
(
!
token
)
{
goUrl
(
vo
)
{
// uni.navigateTo({
let
token
=
uni
.
getStorageSync
(
'userToken'
);
// url: '/pages/binding/index?url=/pages/main&index=4'
if
(
!
token
){
// })
// uni.navigateTo({
let
returnPage
=
'/pages/main'
;
// url: '/pages/binding/index?url=/pages/main&index=4'
let
pageType
=
"reLaunch"
// })
uni
.
navigateTo
({
let
returnPage
=
'/pages/main'
;
url
:
"/pages/login/index/index?returnPage="
+
returnPage
let
pageType
=
"reLaunch"
})
return
;
}
if
(
vo
.
type
==
"jd"
)
{
uni
.
navigateToMiniProgram
({
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
''
,
// 目标小程序的页面路径
extraData
:
{
// 需要携带的参数
},
success
(
res
)
{
// 打开成功
}
})
return
;
}
if
(
vo
.
title
!=
'微信通知设置'
)
{
uni
.
navigateTo
({
url
:
vo
.
url
});
}
else
{
this
.
openMsg
()
}
},
editInfo
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
'/pagesD/pages/personal/userInfo'
)
if
(
!
token
)
{
// uni.navigateTo({
// url: '/pages/binding/index?url=/pages/main&index=4'
// })
uni
.
navigateTo
({
url
:
'/pages/login/index/index'
})
return
;
}
uni
.
navigateTo
({
uni
.
navigateTo
({
url
:
"/pages/login/index/index?returnPage="
+
returnPage
+
'&pageType='
+
pageType
url
:
'/pagesD/pages/personal/userInfo'
});
},
async
getUserInfo
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
if
(
!
token
)
{
this
.
logoutFlag
=
false
return
}
this
.
logoutFlag
=
true
let
opts
=
{
url
:
'/app/user/info'
,
method
:
'get'
};
await
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
userInfo
=
res
.
data
.
data
if
(
this
.
userInfo
.
avatar
)
{
this
.
avatar
=
this
.
userInfo
.
avatar
}
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
})
return
;
},
}
openMsg
()
{
if
(
vo
.
type
==
"jd"
){
var
that
=
this
;
uni
.
navigateToMiniProgram
({
let
nc_templateid
=
that
.
nc_templateid
;
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
path
:
''
,
// 目标小程序的页面路径
wx
.
getSetting
({
extraData
:
{
// 需要携带的参数
withSubscriptions
:
true
,
//是否获取用户订阅消息的订阅状态,默认false不返回
},
success
(
res
)
{
success
(
res
)
{
// 打开成功
if
(
that
.
is_authorization
)
{
wx
.
openSetting
({
withSubscriptions
:
true
,
});
}
else
{
if
(
res
.
subscriptionsSetting
[
nc_templateid
]
==
"reject"
)
{
//用户点击了“总是保持以上,不再询问”
wx
.
showModal
({
title
:
"温馨提示"
,
content
:
"检测到您没有开启订阅消息的权限,是否去设置?"
,
success
:
function
(
modal
)
{
if
(
modal
.
confirm
)
{
// 点击肯定
wx
.
openSetting
({
withSubscriptions
:
true
,
});
that
.
is_authorization
=
true
;
uni
.
setStorageSync
(
"is_authorization"
,
true
);
}
else
{
uni
.
showToast
({
title
:
"您已拒绝订阅消息授权,无法接收通知"
,
icon
:
"error"
,
});
that
.
is_authorization
=
false
;
}
},
});
}
else
{
// 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
// var templateid = that.setting.templateid.map(item => item.tempid);
let
tmpid
=
[
nc_templateid
];
uni
.
requestSubscribeMessage
({
tmplIds
:
tmpid
,
success
(
res
)
{
if
(
res
[
tmpid
[
0
]]
==
"accept"
)
{
uni
.
showToast
({
title
:
"订阅成功"
,
icon
:
"none"
,
});
that
.
is_authorization
=
true
;
uni
.
setStorageSync
(
"is_authorization"
,
true
);
}
else
{
uni
.
showToast
({
title
:
"您拒绝订阅消息授权,无法接收通知"
,
icon
:
"none"
,
});
that
.
is_authorization
=
false
;
}
},
fail
:
(
res
)
=>
{
wx
.
showModal
({
title
:
"温馨提示"
,
content
:
"检测到您没有开启订阅消息的权限,是否去设置?"
,
success
:
function
(
modal
)
{
if
(
modal
.
confirm
)
{
// 点击肯定
wx
.
openSetting
({
withSubscriptions
:
true
,
});
that
.
is_authorization
=
true
;
uni
.
setStorageSync
(
"is_authorization"
,
true
);
}
else
{
uni
.
showToast
({
title
:
"您已拒绝订阅消息授权,无法接收通知"
,
icon
:
"error"
,
});
that
.
is_authorization
=
false
;
}
},
});
},
});
}
}
},
});
},
},
mounted
()
{
setTimeout
(()
=>
{
this
.
show
=
true
},
100
);
this
.
getUserInfo
()
},
onReady
:
function
()
{
uni
.
setNavigationBarTitle
({
title
:
'个人中心'
});
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.personal
{
.ps__bg
{
background
:
url('http://euzhi.com/my15.png')
no-repeat
;
background-size
:
cover
;
z-index
:
999
;
padding-bottom
:
50rpx
;
.ps__title
{
font-size
:
40rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#FFFFFF
;
text-align
:
center
;
padding-top
:
40rpx
;
}
.ps__info
{
padding
:
65rpx
40rpx
30rpx
40rpx
;
display
:
flex
;
align-items
:
center
;
position
:
relative
;
.info__cover
{
width
:
130rpx
;
height
:
130rpx
;
background
:
url('@/static/my/my10.png')
no-repeat
;
background-size
:
contain
;
margin-right
:
32rpx
;
image
{
width
:
130rpx
;
height
:
130rpx
;
border-radius
:
50%
;
}
}
})
}
return
;
.info__name
{
font-size
:
38rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#FFFFFF
;
opacity
:
0
.96
;
margin-bottom
:
28rpx
;
}
.view__info
{
font-size
:
30rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#FFFFFF
;
opacity
:
0
.96
;
display
:
flex
;
align-items
:
center
;
span
{
position
:
absolute
;
right
:
40rpx
;
image
{
width
:
16rpx
;
height
:
26rpx
;
}
}
}
}
}
if
(
vo
.
title
!=
'微信通知设置'
)
{
uni
.
navigateTo
({
.ps__shop
{
url
:
vo
.
url
padding
:
0
40rpx
;
});
}
else
{
.shop__tab
{
this
.
openMsg
()
padding
:
30rpx
;
}
background
:
#FFFFFF
;
box-shadow
:
0rpx
0rpx
28rpx
1rpx
rgba
(
232
,
232
,
232
,
0
.16
);
},
border-radius
:
20rpx
;
editInfo
()
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
.tab__top
{
if
(
!
token
){
display
:
flex
;
// uni.navigateTo({
align-items
:
center
;
// url: '/pages/binding/index?url=/pages/main&index=4'
justify-content
:
space-between
;
// })
margin-bottom
:
20rpx
;
uni
.
navigateTo
({
url
:
'/pages/login/index/index'
>
span
{
})
font-size
:
34rpx
;
return
;
font-family
:
PingFang
SC
;
}
font-weight
:
bold
;
uni
.
navigateTo
({
color
:
#333333
;
url
:
'/pagesD/pages/personal/userInfo'
}
});
},
.tab__all
{
async
getUserInfo
()
{
font-size
:
26rpx
;
let
token
=
uni
.
getStorageSync
(
'userToken'
);
font-family
:
PingFang
SC
;
if
(
!
token
){
font-weight
:
500
;
this
.
logoutFlag
=
false
color
:
#999999
;
return
}
image
{
let
opts
=
{
width
:
11rpx
;
url
:
'/app/user/info'
,
height
:
18rpx
;
method
:
'get'
padding-left
:
20rpx
;
};
}
await
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
}
if
(
res
.
data
.
code
==
200
)
{
}
this
.
userInfo
=
res
.
data
.
data
if
(
this
.
userInfo
.
avatar
){
.tab__bottom
{
this
.
avatar
=
this
.
userInfo
.
avatar
display
:
flex
;
}
align-items
:
center
;
}
else
{
justify-content
:
space-between
;
uni
.
showToast
({
padding-top
:
20rpx
;
title
:
res
.
data
.
msg
,
icon
:
'none'
,
.tab__item
{
duration
:
2000
font-size
:
28rpx
;
});
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#666666
;
width
:
25%
;
text-align
:
center
;
image
{
width
:
60rpx
;
height
:
49rpx
;
margin-bottom
:
10rpx
;
}
}
}
}
}
}
.ps__list
{
background
:
#FFFFFF
;
box-shadow
:
0rpx
0rpx
28rpx
1rpx
rgba
(
232
,
232
,
232
,
0
.16
);
border-radius
:
20rpx
;
// margin-top: 20rpx;
position
:
relative
;
top
:
-20rpx
;
.list__item
{
position
:
relative
;
padding
:
26rpx
40rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.list__left
{
font-size
:
32rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#333333
;
display
:
flex
;
align-items
:
center
;
image
{
width
:
28rpx
;
height
:
28rpx
;
margin-right
:
34rpx
;
}
}
}
})
},
openMsg
()
{
var
that
=
this
;
let
nc_templateid
=
that
.
nc_templateid
;
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
wx
.
getSetting
({
withSubscriptions
:
true
,
//是否获取用户订阅消息的订阅状态,默认false不返回
success
(
res
)
{
if
(
that
.
is_authorization
)
{
wx
.
openSetting
({
withSubscriptions
:
true
,
});
}
else
{
if
(
res
.
subscriptionsSetting
[
nc_templateid
]
==
"reject"
)
{
//用户点击了“总是保持以上,不再询问”
wx
.
showModal
({
title
:
"温馨提示"
,
content
:
"检测到您没有开启订阅消息的权限,是否去设置?"
,
success
:
function
(
modal
)
{
if
(
modal
.
confirm
)
{
// 点击肯定
wx
.
openSetting
({
withSubscriptions
:
true
,
});
that
.
is_authorization
=
true
;
uni
.
setStorageSync
(
"is_authorization"
,
true
);
}
else
{
uni
.
showToast
({
title
:
"您已拒绝订阅消息授权,无法接收通知"
,
icon
:
"error"
,
});
that
.
is_authorization
=
false
;
}
},
});
}
else
{
// 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
// var templateid = that.setting.templateid.map(item => item.tempid);
let
tmpid
=
[
nc_templateid
];
uni
.
requestSubscribeMessage
({
tmplIds
:
tmpid
,
success
(
res
)
{
if
(
res
[
tmpid
[
0
]]
==
"accept"
)
{
uni
.
showToast
({
title
:
"订阅成功"
,
icon
:
"none"
,
});
that
.
is_authorization
=
true
;
uni
.
setStorageSync
(
"is_authorization"
,
true
);
}
else
{
uni
.
showToast
({
title
:
"您拒绝订阅消息授权,无法接收通知"
,
icon
:
"none"
,
});
that
.
is_authorization
=
false
;
}
},
fail
:
(
res
)
=>
{
wx
.
showModal
({
title
:
"温馨提示"
,
content
:
"检测到您没有开启订阅消息的权限,是否去设置?"
,
success
:
function
(
modal
)
{
if
(
modal
.
confirm
)
{
// 点击肯定
wx
.
openSetting
({
withSubscriptions
:
true
,
});
that
.
is_authorization
=
true
;
uni
.
setStorageSync
(
"is_authorization"
,
true
);
}
else
{
uni
.
showToast
({
title
:
"您已拒绝订阅消息授权,无法接收通知"
,
icon
:
"error"
,
});
that
.
is_authorization
=
false
;
}
},
});
},
});
}
}
},
});
},
},
mounted
()
{
setTimeout
(()
=>
{
this
.
show
=
true
},
100
);
this
.
getUserInfo
()
},
onReady
:
function
()
{
uni
.
setNavigationBarTitle
({
title
:
'个人中心'
});
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.list__right
{
.personal
{
.ps__bg
{
image
{
background
:
url('http://euzhi.com/my15.png')
no-repeat
;
width
:
11rpx
;
background-size
:
cover
;
height
:
18rpx
;
z-index
:
999
;
}
padding-bottom
:
50rpx
;
}
}
.ps__title
{
font-size
:
40rpx
;
.
list__item
:
:
before
{
font-family
:
PingFang
SC
;
content
:
''
;
font-weight
:
bold
;
position
:
absolute
;
color
:
#FFFFFF
;
right
:
0
;
text-align
:
center
;
bottom
:
0
;
padding-top
:
40rpx
;
width
:
650rpx
;
}
height
:
1rpx
;
background
:
rgba
(
0
,
0
,
0
,
.1
);
.ps__info
{
}
padding
:
65rpx
40rpx
30rpx
40rpx
;
display
:
flex
;
// .list__item:nth-of-type(2) {
align-items
:
center
;
// .list__left {
position
:
relative
;
// image {
// width: 29rpx;
.info__cover
{
// height: 25rpx;
width
:
130rpx
;
// margin-right: 32rpx;
height
:
130rpx
;
// }
background
:
url('@/static/my/my10.png')
no-repeat
;
// }
background-size
:
contain
;
// }
margin-right
:
32rpx
;
// .list__item:nth-of-type(3) {
image
{
// .list__left {
width
:
130rpx
;
// image {
height
:
130rpx
;
// width: 28rpx;
border-radius
:
50%
;
// height: 28rpx;
}
// margin-right: 33rpx;
}
// }
// }
.info__name
{
// }
font-size
:
38rpx
;
font-family
:
PingFang
SC
;
// .list__item:nth-of-type(4) {
font-weight
:
bold
;
// .list__left {
color
:
#FFFFFF
;
// image {
opacity
:
0
.96
;
// width: 28rpx;
margin-bottom
:
28rpx
;
// height: 28rpx;
}
// margin-right: 33rpx;
// }
.view__info
{
// }
font-size
:
30rpx
;
// }
font-family
:
PingFang
SC
;
font-weight
:
500
;
// .list__item:last-child {
color
:
#FFFFFF
;
// .list__left {
opacity
:
0
.96
;
// image {
display
:
flex
;
// width: 28rpx;
align-items
:
center
;
// height: 28rpx;
// margin-right: 33rpx;
span
{
// }
position
:
absolute
;
// }
right
:
40rpx
;
// }
image
{
.list__item
:nth-last-of-type
(
1
)
::before
{
width
:
16rpx
;
content
:
''
;
height
:
26rpx
;
background
:
transparent
}
}
}
}
}
}
.ps__btn
{
margin-top
:
20rpx
;
.ps__shop
{
width
:
100%
;
padding
:
0
40rpx
;
height
:
100rpx
;
background
:
#FFFFFF
;
.shop__tab
{
box-shadow
:
0rpx
0rpx
28rpx
1rpx
rgba
(
232
,
232
,
232
,
0
.16
);
padding
:
30rpx
;
border-radius
:
20rpx
;
background
:
#FFFFFF
;
text-align
:
center
;
box-shadow
:
0rpx
0rpx
28rpx
1rpx
rgba
(
232
,
232
,
232
,
0
.16
);
line-height
:
100rpx
;
border-radius
:
20rpx
;
font-size
:
32rpx
;
font-family
:
PingFang
SC
;
.tab__top
{
font-weight
:
500
;
display
:
flex
;
color
:
#666666
;
align-items
:
center
;
}
justify-content
:
space-between
;
}
margin-bottom
:
20rpx
;
>
span
{
font-size
:
34rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#333333
;
}
.tab__all
{
font-size
:
26rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#999999
;
image
{
width
:
11rpx
;
height
:
18rpx
;
padding-left
:
20rpx
;
}
}
}
.tab__bottom
{
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
padding-top
:
20rpx
;
.tab__item
{
font-size
:
28rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#666666
;
width
:
25%
;
text-align
:
center
;
image
{
width
:
60rpx
;
height
:
49rpx
;
margin-bottom
:
10rpx
;
}
}
}
}
}
}
.ps__list
{
background
:
#FFFFFF
;
box-shadow
:
0rpx
0rpx
28rpx
1rpx
rgba
(
232
,
232
,
232
,
0
.16
);
border-radius
:
20rpx
;
// margin-top: 20rpx;
position
:
relative
;
top
:
-20rpx
;
.list__item
{
position
:
relative
;
padding
:
26rpx
40rpx
;
display
:
flex
;
align-items
:
center
;
justify-content
:
space-between
;
.list__left
{
font-size
:
32rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#333333
;
display
:
flex
;
align-items
:
center
;
image
{
width
:
28rpx
;
height
:
28rpx
;
margin-right
:
34rpx
;
}
}
.list__right
{
image
{
width
:
11rpx
;
height
:
18rpx
;
}
}
}
.
list__item
:
:
before
{
content
:
''
;
position
:
absolute
;
right
:
0
;
bottom
:
0
;
width
:
650rpx
;
height
:
1rpx
;
background
:
rgba
(
0
,
0
,
0
,
.1
);
}
// .list__item:nth-of-type(2) {
// .list__left {
// image {
// width: 29rpx;
// height: 25rpx;
// margin-right: 32rpx;
// }
// }
// }
// .list__item:nth-of-type(3) {
// .list__left {
// image {
// width: 28rpx;
// height: 28rpx;
// margin-right: 33rpx;
// }
// }
// }
// .list__item:nth-of-type(4) {
// .list__left {
// image {
// width: 28rpx;
// height: 28rpx;
// margin-right: 33rpx;
// }
// }
// }
// .list__item:last-child {
// .list__left {
// image {
// width: 28rpx;
// height: 28rpx;
// margin-right: 33rpx;
// }
// }
// }
.list__item
:nth-last-of-type
(
1
)
::before
{
content
:
''
;
background
:
transparent
}
}
.ps__btn
{
margin-top
:
20rpx
;
width
:
100%
;
height
:
100rpx
;
background
:
#FFFFFF
;
box-shadow
:
0rpx
0rpx
28rpx
1rpx
rgba
(
232
,
232
,
232
,
0
.16
);
border-radius
:
20rpx
;
text-align
:
center
;
line-height
:
100rpx
;
font-size
:
32rpx
;
font-family
:
PingFang
SC
;
font-weight
:
500
;
color
:
#666666
;
}
}
</
style
>
</
style
>
pages/shop.vue
View file @
9c9f96a9
...
@@ -166,6 +166,8 @@ export default {
...
@@ -166,6 +166,8 @@ export default {
},
},
goDetail
(
id
,
link
)
{
goDetail
(
id
,
link
)
{
let
token
=
uni
.
getStorageSync
(
'userToken'
);
let
token
=
uni
.
getStorageSync
(
'userToken'
);
uni
.
removeStorageSync
(
'routerLogin'
)
uni
.
setStorageSync
(
'routerLogin'
,
false
)
if
(
!
token
){
if
(
!
token
){
let
returnPage
=
'/pages/main'
;
let
returnPage
=
'/pages/main'
;
let
pageType
=
"reLaunch"
let
pageType
=
"reLaunch"
...
...
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