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
ab44b0ff
Commit
ab44b0ff
authored
Oct 25, 2019
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善导购
parent
a40e3013
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
278 additions
and
31 deletions
+278
-31
guiderCard.js
src/palette/guiderCard.js
+54
-0
image-example.js
src/palette/image-example.js
+9
-9
project.config.json
src/project.config.json
+2
-2
home.js
src/shoppingGuid/page/pages/home/home.js
+2
-2
qrcode.js
src/shoppingGuid/page/pages/qrcode/qrcode.js
+63
-4
qrcode.json
src/shoppingGuid/page/pages/qrcode/qrcode.json
+4
-1
qrcode.wxml
src/shoppingGuid/page/pages/qrcode/qrcode.wxml
+11
-0
qrcode.wxss
src/shoppingGuid/page/pages/qrcode/qrcode.wxss
+38
-3
userInfo.js
src/shoppingGuid/page/pages/userInfo/userInfo.js
+50
-4
userInfo.wxml
src/shoppingGuid/page/pages/userInfo/userInfo.wxml
+1
-1
userList.js
src/shoppingGuid/page/pages/userList/userList.js
+36
-2
welcomGuider.js
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.js
+5
-2
welfare.js
src/shoppingGuid/page/pages/welfare/welfare.js
+3
-1
No files found.
src/palette/guiderCard.js
0 → 100644
View file @
ab44b0ff
export
default
class
GuiderCard
{
palette
(
qrcodeUrl
,
uLogo
,
uName
)
{
return
({
width
:
'750rpx'
,
height
:
'850rpx'
,
background
:
'#ffffff'
,
views
:
[
{
type
:
'image'
,
url
:
qrcodeUrl
,
css
:
{
width
:
'350rpx'
,
height
:
'350rpx'
,
left
:
'200rpx'
,
top
:
'100rpx'
,
borderRadius
:
'10rpx'
,
}
},
{
type
:
'image'
,
url
:
uLogo
,
css
:
{
width
:
'180rpx'
,
height
:
'180rpx'
,
left
:
'285rpx'
,
top
:
'460rpx'
,
borderRadius
:
'90rpx'
,
}
},
{
type
:
'text'
,
text
:
uName
,
css
:
{
fontSize
:
'30rpx'
,
left
:
'320rpx'
,
top
:
'660rpx'
,
color
:
'#333333'
,
fontWeight
:
'bold'
,
},
},
{
type
:
'text'
,
text
:
'我是导购,享用更多福利请使用微信扫码加我哦~'
,
css
:
{
fontSize
:
'24rpx'
,
left
:
'120rpx'
,
bottom
:
'50rpx'
,
color
:
'#999999'
,
},
},
],
});
}
}
src/palette/image-example.js
View file @
ab44b0ff
...
@@ -23,15 +23,15 @@ export default class ImageExample {
...
@@ -23,15 +23,15 @@ export default class ImageExample {
bottom
:
'43rpx'
,
bottom
:
'43rpx'
,
}
}
},
},
//
{
{
//
type: 'text',
type
:
'text'
,
//
text: '设置height为auto',
text
:
'设置height为auto'
,
//
css: {
css
:
{
//
left: '210rpx',
left
:
'210rpx'
,
//
top: '780rpx',
top
:
'780rpx'
,
//
fontSize: '30rpx',
fontSize
:
'30rpx'
,
//
},
},
//
},
},
],
],
});
});
}
}
...
...
src/project.config.json
View file @
ab44b0ff
...
@@ -39,7 +39,7 @@
...
@@ -39,7 +39,7 @@
"list"
:
[]
"list"
:
[]
},
},
"miniprogram"
:
{
"miniprogram"
:
{
"current"
:
16
,
"current"
:
54
,
"list"
:
[
"list"
:
[
{
{
"id"
:
-1
,
"id"
:
-1
,
...
@@ -404,7 +404,7 @@
...
@@ -404,7 +404,7 @@
"id"
:
54
,
"id"
:
54
,
"name"
:
"会员详情"
,
"name"
:
"会员详情"
,
"pathName"
:
"shoppingGuid/page/pages/userInfo/userInfo"
,
"pathName"
:
"shoppingGuid/page/pages/userInfo/userInfo"
,
"query"
:
"id=70000000001348
0
"
"query"
:
"id=70000000001348
1
"
},
},
{
{
"id"
:
-1
,
"id"
:
-1
,
...
...
src/shoppingGuid/page/pages/home/home.js
View file @
ab44b0ff
...
@@ -102,9 +102,9 @@ wxService.page({
...
@@ -102,9 +102,9 @@ wxService.page({
},
},
//跳转到会员
//跳转到会员
onTapToMember
(){
onTapToMember
(){
wx
.
redirect
To
({
wx
.
navigate
To
({
url
:
'/shoppingGuid/page/pages/selectUsers/selectUsers'
,
url
:
'/shoppingGuid/page/pages/selectUsers/selectUsers'
,
})
})
;
},
},
/**
/**
...
...
src/shoppingGuid/page/pages/qrcode/qrcode.js
View file @
ab44b0ff
// shoppingGuid/page/pages/qrcode/qrcode.js
// shoppingGuid/page/pages/qrcode/qrcode.js
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
wxService
=
require
(
'../../../../utils/wxService'
)
import
GuiderCard
from
'../../../../palette/guiderCard'
;
const
app
=
getApp
();
const
app
=
getApp
();
wxService
.
page
({
wxService
.
page
({
/**
/**
* 页面的初始数据
* 页面的初始数据
*/
*/
// https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/demo_qrcode.png
// https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png
data
:
{
data
:
{
codeImg
:
''
,
codeImg
:
''
,
avator
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png'
,
avator
:
''
,
name
:
''
name
:
''
,
template
:
{},
cardImg
:
''
},
},
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
onLoad
:
function
(
options
)
{
onLoad
:
function
(
options
)
{
console
.
log
(
'uinfo----'
,
wx
.
getStorageSync
(
'guidBaseInfo'
))
console
.
log
(
'guidInfo----'
,
wx
.
getStorageSync
(
'guidInfo'
))
const
currentEnv
=
wx
.
getStorageSync
(
'_qyWeChat'
);
const
currentEnv
=
wx
.
getStorageSync
(
'_qyWeChat'
);
if
(
currentEnv
)
{
if
(
currentEnv
)
{
this
.
getEnterpriseQrcode
();
this
.
getEnterpriseQrcode
();
...
@@ -86,6 +93,26 @@ wxService.page({
...
@@ -86,6 +93,26 @@ wxService.page({
});
});
},
},
//保存名片按钮
onTapSaveCardToColumn
(){
if
(
!
this
.
data
.
codeImg
){
wx
.
showToast
({
title
:
'导购二维码不存在'
,
icon
:
'none'
});
return
;
}
let
avatar
=
this
.
data
.
avator
?
this
.
data
.
avator
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png'
;
wx
.
showLoading
({
title
:
'图片生成中...'
,
});
this
.
setData
({
template
:
new
GuiderCard
().
palette
(
this
.
data
.
codeImg
,
avatar
,
this
.
data
.
name
)
});
},
/**
/**
* 生命周期函数--监听页面显示
* 生命周期函数--监听页面显示
*/
*/
...
@@ -93,6 +120,38 @@ wxService.page({
...
@@ -93,6 +120,38 @@ wxService.page({
},
},
//生成二维码后
onImgOK
(
e
)
{
console
.
log
(
'生成成功!'
,
e
);
let
imgUrl
=
e
.
detail
.
path
;
wx
.
saveImageToPhotosAlbum
({
filePath
:
imgUrl
,
success
(
res
)
{
wx
.
hideLoading
();
setTimeout
(()
=>
{
wx
.
showToast
({
title
:
'保存成功,请前往相册查看~'
,
icon
:
'none'
},
2000
)
})
},
fail
(
err
)
{
console
.
log
(
err
)
let
txt
=
'保存失敗'
;
if
(
err
.
errMsg
==
'saveImageToPhotosAlbum:fail auth deny'
)
{
txt
=
'获取相册授权失败'
}
wx
.
hideLoading
();
setTimeout
(()
=>
{
wx
.
showToast
({
title
:
txt
,
icon
:
'none'
},
2000
)
})
}
});
},
/**
/**
...
...
src/shoppingGuid/page/pages/qrcode/qrcode.json
View file @
ab44b0ff
{
{
"navigationBarTitleText"
:
"对外名片"
,
"navigationBarTitleText"
:
"对外名片"
,
"usingComponents"
:
{}
"usingComponents"
:
{
"painter"
:
"/component/painter/painter"
}
}
}
\ No newline at end of file
src/shoppingGuid/page/pages/qrcode/qrcode.wxml
View file @
ab44b0ff
...
@@ -6,3 +6,14 @@
...
@@ -6,3 +6,14 @@
<text class='name'>{{name}}</text>
<text class='name'>{{name}}</text>
</view>
</view>
</view>
</view>
<!-- 底部操作按钮 -->
<view class='bottom-operator' bindtap='onTapSaveCardToColumn'>
<icon type='download' size='16' color="rgb(0, 145, 255)"></icon>保存名片到相册
</view>
<!-- 预览 -->
<view class='preview'>
<painter palette="{{template}}" bind:imgOK="onImgOK" />
</view>
src/shoppingGuid/page/pages/qrcode/qrcode.wxss
View file @
ab44b0ff
...
@@ -3,6 +3,8 @@ page{
...
@@ -3,6 +3,8 @@ page{
background: #f2f2f2;
background: #f2f2f2;
box-sizing: border-box;
box-sizing: border-box;
-webkit-box-sizing: border-box;
-webkit-box-sizing: border-box;
overflow: hidden;
position: relative;
}
}
view{
view{
...
@@ -18,21 +20,22 @@ view{
...
@@ -18,21 +20,22 @@ view{
.qrcode .card{
.qrcode .card{
width: 100%;
width: 100%;
height: auto;
height: auto;
padding: 30rpx;
padding:
100rpx
30rpx;
background: #ffffff;
background: #ffffff;
border-radius: 10rpx;
border-radius: 10rpx;
border: 12rpx solid rgba(0, 145, 255, 0.46);
/* border: 12rpx solid rgba(0, 145, 255, 0.46); */
box-shadow: 0 0 20rpx 8rpx rgba(0, 145, 255, 0.46);
display: flex;
display: flex;
flex-direction: column;
flex-direction: column;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
padding-bottom: 100rpx;
}
}
.qrcode .card .g-qrcode{
.qrcode .card .g-qrcode{
width: 320rpx;
width: 320rpx;
height: 320rpx;
height: 320rpx;
margin-bottom: 40rpx;
margin-bottom: 40rpx;
border-radius: 10rpx;
}
}
.qrcode .card .g-logo{
.qrcode .card .g-logo{
...
@@ -47,3 +50,34 @@ view{
...
@@ -47,3 +50,34 @@ view{
color: #333333;
color: #333333;
font-weight: bold;
font-weight: bold;
}
}
/* 底部操作按钮 */
.bottom-operator{
position: fixed;
bottom: 20rpx;
left: 0;
width: 100%;
height: 80rpx;
display: flex;
align-items: center;
padding: 0 30rpx;
justify-content: center;
color: #666666;
font-size: 28rpx;
}
.bottom-operator icon{
margin-right: 10rpx;
}
.bottom-operator:active{
opacity: 0.7;
}
.preview{
width: 100%;
height: 100vh;
background: #ffffff;
position: absolute;
transform: translateX(-100%);
}
\ No newline at end of file
src/shoppingGuid/page/pages/userInfo/userInfo.js
View file @
ab44b0ff
...
@@ -43,12 +43,15 @@ wxService.page({
...
@@ -43,12 +43,15 @@ wxService.page({
let
memberId
=
options
.
id
;
let
memberId
=
options
.
id
;
this
.
data
.
memberId
=
memberId
;
this
.
data
.
memberId
=
memberId
;
this
.
getMemberFind
(
memberId
);
this
.
getMemberFind
(
memberId
);
let
currentUserInfo
=
wx
.
getStorageSync
(
'
_baseUser
Info'
);
let
currentUserInfo
=
wx
.
getStorageSync
(
'
guidBase
Info'
);
let
userInfo
=
wx
.
getStorageSync
(
'
_user
Info'
);
let
userInfo
=
wx
.
getStorageSync
(
'
guid
Info'
);
if
(
currentUserInfo
.
member
){
if
(
currentUserInfo
.
member
){
if
(
!
currentUserInfo
.
member
.
name
){
if
(
!
currentUserInfo
.
member
.
qiyeInfo
.
name
){
currentUserInfo
.
member
.
name
=
userInfo
.
nickName
;
currentUserInfo
.
member
.
name
=
userInfo
.
nickName
;
}
}
else
{
currentUserInfo
.
member
.
name
=
currentUserInfo
.
member
.
qiyeInfo
.
name
;
}
}
}
if
(
currentUserInfo
){
if
(
currentUserInfo
){
...
@@ -82,7 +85,12 @@ wxService.page({
...
@@ -82,7 +85,12 @@ wxService.page({
onShow
:
function
()
{},
onShow
:
function
()
{},
//获取用户总消费额
//获取用户总消费额
getMemberTotalConsumeAmount
(
memberId
){
getMemberTotalConsumeAmount
(
memberId
){
wxService
.
get
(
`/sale/trade/tradeMemberCalcByMemberId?memberId=
${
memberId
}
`
).
then
(
res
=>
{
this
.
data
.
total
.
totalConsume
=
res
.
data
.
data
.
totalConsume
?
res
.
data
.
data
.
totalConsume
:
0
;
this
.
setData
({
total
:
this
.
data
.
total
});
})
},
},
//获取优惠券信息
//获取优惠券信息
getMemberCoupon
(
memberId
){
getMemberCoupon
(
memberId
){
...
@@ -344,6 +352,44 @@ wxService.page({
...
@@ -344,6 +352,44 @@ wxService.page({
})
})
},
},
//立即回访
onTapReCall
(){
const
currentEnv
=
wx
.
getStorageSync
(
'_qyWeChat'
);
if
(
currentEnv
)
{
let
qiyeExternalUserid
=
this
.
data
.
memberInfo
.
qiyeExternalUserid
;
let
guidInfo
=
wx
.
getStorageSync
(
'guidBaseInfo'
),
guidQiyeUserId
=
guidInfo
.
member
.
qiyeInfo
.
userid
;
if
(
!
qiyeExternalUserid
)
{
wx
.
showToast
({
title
:
'该会员还不是您的好友,请先加好友!'
,
icon
:
'none'
});
return
;
}
wx
.
qy
.
openEnterpriseChat
({
userIds
:
guidQiyeUserId
,
//参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
externalUserIds
:
qiyeExternalUserid
,
// 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
groupName
:
''
,
// 必填,会话名称。单聊时该参数传入空字符串""即可。
success
:
function
(
res
)
{
},
fail
:
function
(
res
)
{
// 失败处理
wx
.
showToast
({
title
:
'创建会话失败,请稍后再试!'
,
icon
:
'none'
});
}
});
}
else
{
wx
.
showToast
({
title
:
'请在企业微信中使用'
,
icon
:
'none'
});
}
},
//打电话
//打电话
handelPhoneCall
(
e
)
{
handelPhoneCall
(
e
)
{
const
{
phone
}
=
e
.
currentTarget
.
dataset
;
const
{
phone
}
=
e
.
currentTarget
.
dataset
;
...
...
src/shoppingGuid/page/pages/userInfo/userInfo.wxml
View file @
ab44b0ff
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
data-phone="{{memberInfo.mobile}}"
data-phone="{{memberInfo.mobile}}"
bindtap="handelPhoneCall" mode='widthFix'></image>
bindtap="handelPhoneCall" mode='widthFix'></image>
</view>
</view>
<view class='u-item-rg'
data-phone="{{memberInfo.mobile}}" bindtap="handelPhoneCall">立即联系
</view>
<view class='u-item-rg'
bindtap='onTapReCall'>立即回访
</view>
</view>
</view>
<view class='u-items'>
<view class='u-items'>
<view class='u-item-lf'>
<view class='u-item-lf'>
...
...
src/shoppingGuid/page/pages/userList/userList.js
View file @
ab44b0ff
...
@@ -65,9 +65,43 @@ wxService.page({
...
@@ -65,9 +65,43 @@ wxService.page({
},
},
//回访
//回访
onTapRecall
(
e
){
onTapRecall
(
e
){
let
item
=
e
.
currentTarget
.
dataset
.
item
;
const
currentEnv
=
wx
.
getStorageSync
(
'_qyWeChat'
);
console
.
log
(
item
)
// wmfen5DwAA5WDE7CBEa_qgIva_cUlAyw 杨辰的外部联系人userid
if
(
currentEnv
){
let
guidInfo
=
wx
.
getStorageSync
(
'guidBaseInfo'
),
guidQiyeUserId
=
guidInfo
.
member
.
qiyeInfo
.
userid
;
let
qiyeExternalUserid
=
e
.
currentTarget
.
dataset
.
item
.
qiyeExternalUserid
;
if
(
!
qiyeExternalUserid
)
{
wx
.
showToast
({
title
:
'该会员还不是您的好友,请先加好友!'
,
icon
:
'none'
});
return
;
}
wx
.
qy
.
openEnterpriseChat
({
userIds
:
guidQiyeUserId
,
//参与会话的企业成员列表,格式为userid1;userid2;...,用分号隔开。
externalUserIds
:
qiyeExternalUserid
,
// 参与会话的外部联系人列表,格式为userId1;userId2;…,用分号隔开。
groupName
:
''
,
// 必填,会话名称。单聊时该参数传入空字符串""即可。
success
:
function
(
res
)
{
},
fail
:
function
(
res
)
{
// 失败处理
wx
.
showToast
({
title
:
'创建会话失败,请稍后再试!'
,
icon
:
'none'
});
}
});
}
else
{
wx
.
showToast
({
title
:
'请在企业微信中使用'
,
icon
:
'none'
});
}
},
},
/**
/**
...
...
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.js
View file @
ab44b0ff
...
@@ -20,8 +20,8 @@ wxService.page({
...
@@ -20,8 +20,8 @@ wxService.page({
title
:
'检查登录状态..'
,
title
:
'检查登录状态..'
,
});
});
this
.
qyLogin
();
//
this.qyLogin();
return
;
//
return ;
//先判断是是不是已经登录了
//先判断是是不是已经登录了
let
currentUserInfo
=
wx
.
getStorageSync
(
'guidBaseInfo'
);
let
currentUserInfo
=
wx
.
getStorageSync
(
'guidBaseInfo'
);
...
@@ -34,6 +34,7 @@ wxService.page({
...
@@ -34,6 +34,7 @@ wxService.page({
});
});
},
},
fail
:
res
=>
{
//失效了
fail
:
res
=>
{
//失效了
console
.
log
(
'check session fail , starting login ----'
)
this
.
qyLogin
();
this
.
qyLogin
();
}
}
});
});
...
@@ -52,6 +53,8 @@ wxService.page({
...
@@ -52,6 +53,8 @@ wxService.page({
code
:
res
.
code
code
:
res
.
code
});
});
console
.
log
(
'企业登录ok,code -------'
,
res
.
code
);
this
.
jscode2session
(
res
.
code
);
this
.
jscode2session
(
res
.
code
);
},
},
fail
:
res
=>
{
fail
:
res
=>
{
...
...
src/shoppingGuid/page/pages/welfare/welfare.js
View file @
ab44b0ff
...
@@ -157,7 +157,9 @@ wxService.page({
...
@@ -157,7 +157,9 @@ wxService.page({
let
tentacleId
=
res
.
id
;
let
tentacleId
=
res
.
id
;
let
inner_id
=
Integer
.
digit
(
item
.
productId
,
10
,
64
);
let
inner_id
=
Integer
.
digit
(
item
.
productId
,
10
,
64
);
let
inner_tentacleId
=
Integer
.
digit
(
tentacleId
,
10
,
64
);
let
inner_tentacleId
=
Integer
.
digit
(
tentacleId
,
10
,
64
);
var
path
=
'pages/productDetail/productDetail'
+
'?i='
+
inner_id
+
'&t='
+
inner_tentacleId
;
// var path = 'pages/productDetail/productDetail' + '?i=' + inner_id + '&t=' + inner_tentacleId;
let
path
=
'pages/productDetail/productDetail'
;
console
.
log
(
'推荐商品path-----'
,
path
)
//打开企业微信通讯录选择会员
//打开企业微信通讯录选择会员
wx
.
qy
.
shareToExternalContact
({
wx
.
qy
.
shareToExternalContact
({
appid
:
app
.
globalData
.
appId
,
//小程序的appid
appid
:
app
.
globalData
.
appId
,
//小程序的appid
...
...
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