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
5782232f
Commit
5782232f
authored
Jul 13, 2022
by
lijiongliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提示修改
parent
152a3170
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
440 additions
and
381 deletions
+440
-381
api.js
common/api/api.js
+3
-3
home-new.vue
pages/home-new.vue
+7
-2
main.vue
pages/main.vue
+11
-6
moveCar.vue
pages/moveCar.vue
+1
-2
personal.vue
pages/personal.vue
+8
-2
shop.vue
pages/shop.vue
+6
-1
loveCar.vue
pagesB/pages/move-car/loveCar.vue
+1
-0
moveCarDetail.vue
pagesB/pages/move-car/moveCarDetail.vue
+5
-0
myRecord.vue
pagesB/pages/move-car/myRecord.vue
+217
-217
oneMoveCar.vue
pagesB/pages/move-car/oneMoveCar.vue
+1
-1
search.vue
pagesC/pages/shop/search.vue
+1
-1
asking.vue
pagesD/pages/personal/asking.vue
+6
-0
help.vue
pagesD/pages/personal/help.vue
+152
-143
userInfo.vue
pagesD/pages/personal/userInfo.vue
+21
-3
No files found.
common/api/api.js
View file @
5782232f
//
const baseUrl = 'https://r.ucaret.cn/test-api'; // 开发地址
const
baseUrl
=
'http://4v7u6z.natappfree.cc'
;
// 开发地址
const
baseUrl
=
'https://r.ucaret.cn/test-api'
;
// 开发地址
//
const baseUrl = 'http://4v7u6z.natappfree.cc'; // 开发地址
// const baseUrl = 'https://jduniapp.uzosp.com'; // 线上地址
const
httpRequest
=
(
opts
,
data
)
=>
{
let
httpDefaultOpts
=
{
...
...
@@ -61,7 +61,7 @@ const httpTokenRequest = (opts, data) => {
let
promise
=
new
Promise
(
function
(
resolve
,
reject
)
{
uni
.
request
(
httpDefaultOpts
).
then
(
(
res
)
=>
{
console
.
log
(
33333333333
,
res
[
1
])
//
console.log(33333333333,res[1])
if
(
res
[
1
].
data
.
code
==
401
){
uni
.
removeStorageSync
(
'userToken'
)
uni
.
navigateTo
({
...
...
pages/home-new.vue
View file @
5782232f
...
...
@@ -97,7 +97,7 @@
}
else
{
sku
=
100025676611
}
console
.
log
(
sku
,
777777777
)
//
console.log(sku,777777777)
uni
.
navigateToMiniProgram
({
appId
:
'wx91d27dbf599dff74'
,
// 跳转目标小程序的id
path
:
'pages/item/detail/detail?sku='
+
sku
,
// 目标小程序的页面路径
...
...
@@ -258,6 +258,11 @@
imgList
.
push
(
e
)
})
this
.
list5
=
imgList
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
});
}
})
},
...
...
@@ -314,7 +319,7 @@
},
},
created
()
{
this
.
getMoveCode
()
//
this.getMoveCode()
this
.
getRotationList
()
},
mounted
()
{
...
...
pages/main.vue
View file @
5782232f
...
...
@@ -49,7 +49,7 @@
})
},
onShareAppMessage
(
res
)
{
console
.
log
(
res
,
111111
)
//
console.log(res,111111)
if
(
res
.
from
===
'menu'
)
{
return
{
title
:
'京东汽车挪车牌'
,
...
...
@@ -105,7 +105,7 @@
that
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
let
xcxIndexPath
=
res
.
data
.
data
.
xcxIndexPath
console
.
log
(
xcxIndexPath
,
path
,
'扫一扫进入'
)
//
console.log(xcxIndexPath,path,'扫一扫进入')
if
(
xcxIndexPath
)
{
xcxIndexPath
=
path
.
replace
(
xcxIndexPath
,
''
).
replace
(
"?"
,
''
)
...
...
@@ -211,6 +211,11 @@
if
(
res
.
data
.
code
==
200
)
{
that
.
openid
=
res
.
data
.
data
.
openid
uni
.
setStorageSync
(
'openid'
,
that
.
openid
);
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
});
}
})
},
...
...
@@ -292,7 +297,7 @@
message
}
=
res
;
if
(
!
token
)
{
console
.
log
(
res
,
"pin_key失效"
)
//
console.log(res,"pin_key失效")
uni
.
navigateTo
({
url
:
"/pages/login/index/index"
})
...
...
@@ -324,7 +329,7 @@
// 判断是否扫码进入
that
.
scene
=
uni
.
getStorageSync
(
'scene'
)
console
.
log
(
that
.
scene
,
"微信扫码进入"
)
//
console.log(that.scene,"微信扫码进入")
if
(
that
.
scene
)
{
//获取二维码携带的参数
//扫码后得到的参数
...
...
@@ -366,7 +371,7 @@
})
}
else
{
// 判断是否扫码进入
console
.
log
(
"扫码进入但是未登录"
)
//
console.log("扫码进入但是未登录")
if
(
option
&&
option
.
scene
)
{
uni
.
setStorageSync
(
'scene'
,
decodeURIComponent
(
option
.
scene
))
let
returnPage
=
'/pages/main'
;
...
...
@@ -379,7 +384,7 @@
}
else
{
// 判断是否扫码进入
if
(
option
&&
option
.
scene
)
{
console
.
log
(
option
.
scene
,
"扫码一登录"
)
//
console.log(option.scene,"扫码一登录")
//获取二维码携带的参数
//扫码后得到的参数
that
.
scene
=
decodeURIComponent
(
option
.
scene
)
...
...
pages/moveCar.vue
View file @
5782232f
...
...
@@ -96,7 +96,7 @@
}
that
.
http
.
httpTokenRequest
(
opts
,
param
).
then
(
res
=>
{
console
.
log
(
res
,
"扫码通知车主"
)
//
console.log(res, "扫码通知车主")
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
.
bindFlag
)
{
that
.
gotoMoveCar
(
scene
)
...
...
@@ -107,7 +107,6 @@
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
icon
:
'error'
,
})
}
})
...
...
pages/personal.vue
View file @
5782232f
...
...
@@ -136,7 +136,7 @@ export default {
uni
.
removeStorageSync
(
'xcxIndexPath'
)
// uni.removeStorageSync('openid')
plugin
.
logout
().
then
((
res
)
=>
{
console
.
jdLoginLog
(
res
,
'logoutres'
);
//
console.jdLoginLog(res, 'logoutres');
uni
.
reLaunch
({
url
:
'/pages/main'
});
...
...
@@ -234,7 +234,13 @@ export default {
if
(
this
.
userInfo
.
avatar
){
this
.
avatar
=
this
.
userInfo
.
avatar
}
}
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
},
openMsg
()
{
...
...
pages/shop.vue
View file @
5782232f
...
...
@@ -88,7 +88,7 @@ export default {
methods
:
{
scroll
:
function
(
e
)
{
this
.
old
.
scrollTop
=
e
.
detail
.
scrollTop
console
.
log
(
this
.
old
.
scrollTop
);
//
console.log(this.old.scrollTop);
},
goTop
()
{
this
.
scrollTop
=
this
.
old
.
scrollTop
...
...
@@ -118,6 +118,11 @@ export default {
}
else
{
// 加载失败
this
.
$refs
.
list
.
loadFail
()
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
},
this
.
$u
.
random
(
100
,
1000
));
...
...
pagesB/pages/move-car/loveCar.vue
View file @
5782232f
...
...
@@ -116,6 +116,7 @@ export default {
});
let
opts
=
{
url
:
'/app/vehicleAdmin/list'
,
method
:
'get'
};
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
// console.log(res,222222)
if
(
res
.
statusCode
==
200
)
{
uni
.
hideLoading
()
this
.
carList
=
res
.
data
||
[]
...
...
pagesB/pages/move-car/moveCarDetail.vue
View file @
5782232f
...
...
@@ -75,6 +75,11 @@ export default {
}
list
.
push
({
title
:
"绑定手机号"
,
value
:
data
.
userMobile
})
this
.
items
=
list
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"none"
,
});
}
})
},
...
...
pagesB/pages/move-car/myRecord.vue
View file @
5782232f
This diff is collapsed.
Click to expand it.
pagesB/pages/move-car/oneMoveCar.vue
View file @
5782232f
...
...
@@ -270,7 +270,7 @@
//查询挪车码失败
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
"
error
"
,
icon
:
"
none
"
,
});
}
})
...
...
pagesC/pages/shop/search.vue
View file @
5782232f
...
...
@@ -55,7 +55,7 @@ export default {
let
searchCondition
=
{
searchVal
:
this
.
keyword
}
console
.
log
(
searchCondition
,
222222222
)
//
console.log(searchCondition,222222222)
let
opts
=
{
url
:
'/app/index/mall/list'
,
method
:
'get'
};
this
.
http
.
httpRequest
(
opts
,
searchCondition
).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
...
...
pagesD/pages/personal/asking.vue
View file @
5782232f
...
...
@@ -45,6 +45,12 @@ export default {
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
this
.
askingList
=
res
.
data
.
data
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
},
...
...
pagesD/pages/personal/help.vue
View file @
5782232f
...
...
@@ -3,157 +3,166 @@
* @Description: 帮助使用
-->
<
template
>
<view
class=
"appCotent"
>
<div
class=
"hlep"
>
<!--
<u-cell-group>
<view
class=
"appCotent"
>
<div
class=
"hlep"
>
<!--
<u-cell-group>
<u-cell
title=
"设置消息订阅"
:isLink=
"true"
@
click=
"openMsg()"
></u-cell>
</u-cell-group>
-->
<image
v-if=
"image"
:src=
"image"
/>
<image
v-else
src=
"@/static/my/help.png"
/>
</div>
</view>
<image
v-if=
"image"
:src=
"image"
/>
<image
v-else
src=
"@/static/my/help.png"
/>
</div>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
image
:
''
,
//是否订阅消息
is_authorization
:
uni
.
getStorageSync
(
'is_authorization'
),
}
},
methods
:
{
getHelpInfo
()
{
let
opts
=
{
url
:
'/app/user/help'
,
method
:
'get'
};
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
.
imgPath
!=
''
)
{
this
.
image
=
res
.
data
.
data
.
imgPath
}
}
})
},
//获取消息订阅
openMsg
()
{
var
that
=
this
;
let
nc_templateid
=
that
.
nc_templateid
;
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
wx
.
getSetting
({
withSubscriptions
:
true
,
//是否获取用户订阅消息的订阅状态,默认false不返回
success
(
res
)
{
if
(
that
.
is_authorization
)
{
export
default
{
data
()
{
return
{
image
:
''
,
//是否订阅消息
is_authorization
:
uni
.
getStorageSync
(
'is_authorization'
),
}
},
methods
:
{
getHelpInfo
()
{
let
opts
=
{
url
:
'/app/user/help'
,
method
:
'get'
};
this
.
http
.
httpTokenRequest
(
opts
,
{}).
then
(
res
=>
{
if
(
res
.
data
.
code
==
200
)
{
if
(
res
.
data
.
data
.
imgPath
!=
''
)
{
this
.
image
=
res
.
data
.
data
.
imgPath
}
}
else
{
uni
.
showToast
({
title
:
res
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
},
//获取消息订阅
openMsg
()
{
var
that
=
this
;
let
nc_templateid
=
that
.
nc_templateid
;
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
wx
.
getSetting
({
withSubscriptions
:
true
,
//是否获取用户订阅消息的订阅状态,默认false不返回
success
(
res
)
{
if
(
that
.
is_authorization
)
{
}
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
;
}
},
});
},
});
}
}
},
});
},
//改变消息订阅
changeMessages
()
{
wx
.
openSetting
({
withSubscriptions
:
true
,
});
// if(!this.is_authorization){
// wx.openSetting({
// withSubscriptions: true,
// });
// this.is_authorization = false;
// uni.setStorageSync("is_authorization", false);
// }else{
// wx.openSetting({
// withSubscriptions: true,
// });
// this.is_authorization = false;
// uni.setStorageSync("is_authorization", false);
// }
},
},
onShow
()
{
this
.
getHelpInfo
()
//this.openMsg()
},
}
}
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
;
}
},
});
},
});
}
}
},
});
},
//改变消息订阅
changeMessages
()
{
wx
.
openSetting
({
withSubscriptions
:
true
,
});
// if(!this.is_authorization){
// wx.openSetting({
// withSubscriptions: true,
// });
// this.is_authorization = false;
// uni.setStorageSync("is_authorization", false);
// }else{
// wx.openSetting({
// withSubscriptions: true,
// });
// this.is_authorization = false;
// uni.setStorageSync("is_authorization", false);
// }
},
},
onShow
()
{
this
.
getHelpInfo
()
//this.openMsg()
},
}
</
script
>
<
style
lang=
"scss"
scoped
>
.hlep
{
padding
:
0rpx
0
;
height
:
1092rpx
;
.hlep
{
padding
:
0rpx
0
;
height
:
1092rpx
;
image
{
height
:
100%
;
width
:
100%
;
}
}
</
style
>
\ No newline at end of file
image
{
height
:
100%
;
width
:
100%
;
}
}
</
style
>
pagesD/pages/personal/userInfo.vue
View file @
5782232f
...
...
@@ -163,7 +163,13 @@ export default {
this
.
http
.
httpTokenRequest
(
opts
,
userInfoItem
).
then
(
response
=>
{
if
(
response
.
data
.
code
==
200
)
{
}
}
else
{
uni
.
showToast
({
title
:
response
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
}
});
...
...
@@ -185,7 +191,13 @@ export default {
this
.
http
.
httpTokenRequest
(
opts
,
userInfoItem
).
then
(
response
=>
{
if
(
response
.
data
.
code
==
200
)
{
}
}
else
{
uni
.
showToast
({
title
:
response
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
}
});
...
...
@@ -208,7 +220,13 @@ export default {
that
.
http
.
httpTokenRequest
(
opts
,
userInfoItem
).
then
(
response
=>
{
if
(
response
.
data
.
code
==
200
)
{
this
.
getUserInfo
()
}
}
else
{
uni
.
showToast
({
title
:
response
.
data
.
msg
,
icon
:
'none'
,
duration
:
2000
});
}
})
}
});
...
...
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