Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
高淑倩
7-Eleven
Commits
d7b0256e
Commit
d7b0256e
authored
May 12, 2020
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改客服聊天
parent
1555f235
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
25 deletions
+61
-25
app.js
src/app.js
+5
-1
index.js
src/config/index.js
+2
-2
productDetail.js
src/pages/productDetail/productDetail.js
+31
-9
productDetail.wxml
src/pages/productDetail/productDetail.wxml
+5
-2
project.config.json
src/project.config.json
+4
-3
paymentStatus.js
src/subPackage/page/pages/paymentStatus/paymentStatus.js
+10
-8
wxService.js
src/utils/wxService.js
+4
-0
No files found.
src/app.js
View file @
d7b0256e
...
...
@@ -43,11 +43,15 @@ App({
// console.log(err);
}
//
this.loginSilently();
this
.
loginSilently
();
},
loginSilently
()
{
var
_this
=
this
;
if
(
wx
.
getStorageSync
(
'_baseUserInfo'
)){
return
;
}
wx
.
login
({
success
:
(
res
)
=>
{
wx
.
setStorageSync
(
'_loginCode'
,
res
.
code
);
...
...
src/config/index.js
View file @
d7b0256e
...
...
@@ -6,7 +6,7 @@
// 修改 BRANCH_ID 为对应的商户id
// app.js 中brandId 修改为对应
const
PROJECT_ENV
=
'
dev
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
const
PROJECT_ENV
=
'
test
'
// 生产 prod, 开发 dev, 测试 test , 测试门户 test_store, 预生产 pre
//仅生产环境时 配置 :
//3001 3001 , wx313ec36b710125d4 有直播
//2006 泰华 , wx40fec8944623c8b3 有直播
...
...
@@ -25,7 +25,7 @@ const PROJECT_ENV = 'dev' // 生产 prod, 开发 dev, 测试 test , 测试门户
//2992 山东盛联微商城 wx53dedc202ae0d0c2
//2002 巴黎贝甜 wx21968cb3a486d4ab
const
BRANCH_ID
=
100
1
const
BRANCH_ID
=
100
2
const
isMall
=
true
// const needMock = '' //
...
...
src/pages/productDetail/productDetail.js
View file @
d7b0256e
...
...
@@ -169,17 +169,39 @@ wxService.page({
this
.
data
.
productId
=
this
.
options
.
id
;
}
this
.
setData
({
udesk
:
{
nick_name
:
app
.
globalData
.
userInfo
?
app
.
globalData
.
userInfo
.
memberId
:
''
,
avatar
:
app
.
globalData
.
userInfo
?
app
.
globalData
.
userInfo
.
avatarUrl
:
''
}
})
this
.
getProInfo
()
this
.
getOpenStatus
()
this
.
data
.
currentShareContent
=
null
this
.
data
.
currentShareContent
=
null
;
this
.
setUDeskInfo
();
},
//设置uDeskinfo
setUDeskInfo
(){
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
if
(
baseUserInfo
){
let
cellphones
=
[];
this
.
data
.
udesk
.
nick_name
=
baseUserInfo
.
member
.
name
;
this
.
data
.
udesk
.
avatar
=
app
.
globalData
.
userInfo
.
avatarUrl
;
let
customer_info
=
{
cellphones
:
[],
};
customer_info
.
cellphones
=
[[
""
,
baseUserInfo
.
member
.
mobile
]];
this
.
data
.
udesk
.
customer_info
=
JSON
.
stringify
(
customer_info
);
this
.
setData
({
udesk
:
this
.
data
.
udesk
});
}
else
{
this
.
setData
({
udesk
:
{
nick_name
:
app
.
globalData
.
userInfo
?
app
.
globalData
.
userInfo
.
memberId
:
''
,
avatar
:
app
.
globalData
.
userInfo
?
app
.
globalData
.
userInfo
.
avatarUrl
:
''
,
cellphones
:
[],
}
})
}
},
//获取商品详情
...
...
src/pages/productDetail/productDetail.wxml
View file @
d7b0256e
...
...
@@ -130,8 +130,11 @@
report-submit
name='home'
>
<button class="get-formId--btn footer-icon" open-type="contact" session-from="udesk|{{udesk.nick_name}}|{{udesk.avatar}}"
send-message-title="{{productInfo.productName}}" show-message-card="true" send-message-img="{{productInfo.indexUrl}}">
<button class="get-formId--btn footer-icon" open-type="contact"
session-from="udesk|{{udesk.nick_name}}|{{udesk.avatar}}|customer^{{udesk.customer_info}}"
send-message-title="{{productInfo.productName}}"
show-message-card="true"
send-message-img="{{productInfo.indexUrl}}">
<image src="https://hwimagecdn.ihotwind.cn/hotwind-mini/images/hotnewicon/bottom-kefu.png" mode="widthFix"></image>
<view class="tab-text">客服</view>
</button>
...
...
src/project.config.json
View file @
d7b0256e
...
...
@@ -13,7 +13,7 @@
},
"compileType"
:
"miniprogram"
,
"libVersion"
:
"2.8.2"
,
"appid"
:
"wx
c3b64b09b1d3dfc2
"
,
"appid"
:
"wx
ac09792264c49b5c
"
,
"projectname"
:
"%E5%BE%AE%E5%95%86%E5%9F%8E"
,
"debugOptions"
:
{
"hidedInDevtools"
:
[]
...
...
@@ -266,10 +266,10 @@
"scene"
:
null
},
{
"id"
:
3
4
,
"id"
:
3
3
,
"name"
:
"支付状态"
,
"pathName"
:
"subPackage/page/pages/paymentStatus/paymentStatus"
,
"query"
:
"status=
F
&amount=333"
,
"query"
:
"status=
S
&amount=333"
,
"scene"
:
null
},
{
...
...
@@ -664,6 +664,7 @@
"id"
:
-1
,
"name"
:
"领券中心"
,
"pathName"
:
"subPackage/page/pages/couponCenter/couponCenter"
,
"query"
:
""
,
"scene"
:
null
}
]
...
...
src/subPackage/page/pages/paymentStatus/paymentStatus.js
View file @
d7b0256e
...
...
@@ -46,7 +46,7 @@ wxService.page({
},
()
=>
{
// 当前用户是否关注公众号
this
.
getMemberSubscribe
()
this
.
loginUpdateStroage
()
// 登录更新plus缓存
//
this.loginUpdateStroage() // 登录更新plus缓存
})
// 动态设置title
...
...
@@ -86,13 +86,15 @@ wxService.page({
getMemberSubscribe
()
{
const
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
const
{
openid
}
=
baseUserInfo
.
member
wxService
.
post
(
`/member/subscribe?openid=
${
openid
}
`
).
then
(
res
=>
{
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
// 0 未关注 1 已关注
this
.
setData
({
isSubscribe
:
data
==
0
?
false
:
true
})
wxService
.
get
(
`/member/subscribe?openid=
${
openid
}
`
).
then
(
res
=>
{
if
(
res
){
const
{
result
,
data
}
=
res
.
data
if
(
result
==
0
)
{
// 0 未关注 1 已关注
this
.
setData
({
isSubscribe
:
data
==
0
?
false
:
true
})
}
}
})
},
...
...
src/utils/wxService.js
View file @
d7b0256e
...
...
@@ -595,6 +595,7 @@ class WXService extends Http {
page
(
config
)
{
const
_self
=
this
// 当前是否有用户信息
config
.
data
.
currentHasUserInfo
=
false
;
//当前用户是否有手机号
...
...
@@ -624,6 +625,8 @@ class WXService extends Http {
//默认
config
.
data
.
loading
=
true
;
config
.
data
.
udesk
=
{};
const
CONFIG_PAPGE
=
{
onLoad
:
function
(...
args
)
{
const
page
=
this
...
...
@@ -688,6 +691,7 @@ class WXService extends Http {
//调用接口
_self
.
getTentacleContentByTentacleId
(
id
);
}
config
.
onLoad
&&
config
.
onLoad
.
apply
(
page
,
args
);
},
/**
...
...
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