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
06f36166
Commit
06f36166
authored
Oct 25, 2019
by
谢中龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导购相关
parent
292a06cc
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
223 additions
and
79 deletions
+223
-79
userCenter.wxml
src/pages/userCenter/userCenter.wxml
+1
-1
achievement.js
src/shoppingGuid/page/pages/achievement/achievement.js
+19
-16
home.js
src/shoppingGuid/page/pages/home/home.js
+6
-0
home.wxml
src/shoppingGuid/page/pages/home/home.wxml
+1
-1
qrcode.js
src/shoppingGuid/page/pages/qrcode/qrcode.js
+72
-34
qrcode.json
src/shoppingGuid/page/pages/qrcode/qrcode.json
+2
-0
qrcode.wxml
src/shoppingGuid/page/pages/qrcode/qrcode.wxml
+7
-1
qrcode.wxss
src/shoppingGuid/page/pages/qrcode/qrcode.wxss
+49
-2
userList.js
src/shoppingGuid/page/pages/userList/userList.js
+2
-0
welcomGuider.js
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.js
+39
-14
welcomGuider.json
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.json
+2
-1
welcomGuider.wxml
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.wxml
+1
-5
welfare.js
src/shoppingGuid/page/pages/welfare/welfare.js
+17
-2
Http.js
src/utils/Http.js
+5
-2
No files found.
src/pages/userCenter/userCenter.wxml
View file @
06f36166
...
...
@@ -32,7 +32,7 @@
</block>
<view class="cell-me">
<cell bind:startmessage='startmessage' isMask="0" styleType="
1
" blockStyle="button" buttonText="0" bind:completemessage="completemessage" plugid='c9918b9af349c100b285d1b9a4d19ec6' />
<cell bind:startmessage='startmessage' isMask="0" styleType="
2
" blockStyle="button" buttonText="0" bind:completemessage="completemessage" plugid='c9918b9af349c100b285d1b9a4d19ec6' />
</view>
</view>
...
...
src/shoppingGuid/page/pages/achievement/achievement.js
View file @
06f36166
...
...
@@ -44,7 +44,7 @@ wxService.page({
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
let
currentUserInfo
=
wx
.
getStorageSync
(
'
_baseUser
Info'
);
let
currentUserInfo
=
wx
.
getStorageSync
(
'
guidBase
Info'
);
if
(
!
currentUserInfo
)
{
//未登录成功
wx
.
redirectTo
({
url
:
'/shoppingGuid/page/pages/welcomGuider/welcomGuider'
,
...
...
@@ -52,11 +52,14 @@ wxService.page({
return
;
}
let
userInfo
=
wx
.
getStorageSync
(
'
_user
Info'
);
let
userInfo
=
wx
.
getStorageSync
(
'
guid
Info'
);
if
(
currentUserInfo
.
member
)
{
if
(
!
currentUserInfo
.
member
.
name
)
{
if
(
!
currentUserInfo
.
member
.
qiyeInfo
.
name
)
{
currentUserInfo
.
member
.
name
=
userInfo
.
nickName
;
}
else
{
currentUserInfo
.
member
.
name
=
currentUserInfo
.
member
.
qiyeInfo
.
name
;
}
}
this
.
setData
({
...
...
@@ -66,20 +69,20 @@ wxService.page({
//获取导购业绩
// this.echartsComponnet = this.selectComponent('#barChart');
this
.
getGuidAchievement
();
let
series
=
[
{
name
:
'本月'
,
color
:
'rgba(0,145,255,0.2)'
,
data
:
[
10
,
15
,
100
],
},
{
name
:
'累计'
,
color
:
'rgba(0, 145, 255, 1)'
,
data
:
[
20
,
30
,
300
],
}
];
//
let series = [
//
{
//
name: '本月',
//
color: 'rgba(0,145,255,0.2)',
//
data: [10, 15, 100],
//
},
//
{
//
name: '累计',
//
color: 'rgba(0, 145, 255, 1)',
//
data: [20, 30, 300],
//
}
//
];
this
.
initBarChart
(
series
);
//
this.initBarChart(series);
},
...
...
src/shoppingGuid/page/pages/home/home.js
View file @
06f36166
...
...
@@ -87,6 +87,12 @@ wxService.page({
current
==
1
?
this
.
getRecruitRanking
()
:
this
.
getStoreRanking
()
});
},
//跳转到我的招募码
onTapShowMyQrcode
(){
wx
.
navigateTo
({
url
:
'/shoppingGuid/page/pages/qrcode/qrcode'
,
})
},
// 回到商城
onTapToMall
(){
...
...
src/shoppingGuid/page/pages/home/home.wxml
View file @
06f36166
...
...
@@ -4,7 +4,7 @@
<view class='main-container'>
<!-- top -->
<view class='top-icons'>
<view class='icon-item'>
<view class='icon-item'
bindtap='onTapShowMyQrcode'
>
<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/home_qrcode.png' mode='aspectFit' />
<view class='icon-title'>招募码</view>
</view>
...
...
src/shoppingGuid/page/pages/qrcode/qrcode.js
View file @
06f36166
// shoppingGuid/page/pages/qrcode/qrcode.js
Page
({
const
wxService
=
require
(
'../../../../utils/wxService'
)
const
app
=
getApp
();
wxService
.
page
({
/**
* 页面的初始数据
*/
data
:
{
codeImg
:
''
,
avator
:
'https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/biaka_default_u_logo.png'
,
name
:
''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
const
currentEnv
=
wx
.
getStorageSync
(
'_qyWeChat'
);
if
(
currentEnv
)
{
this
.
getEnterpriseQrcode
();
this
.
getAvator
();
this
.
getName
();
}
else
{
//不是在企业微信内打开的 提示信息
wx
.
showToast
({
title
:
'请在企业微信内打开!'
,
icon
:
'none'
});
}
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady
:
function
()
{
//获取员工名称
getName
(){
let
currentUserInfo
=
wx
.
getStorageSync
(
'guidBaseInfo'
);
if
(
!
currentUserInfo
)
{
//未登录成功
wx
.
redirectTo
({
url
:
'/shoppingGuid/page/pages/welcomGuider/welcomGuider'
,
});
return
;
}
let
userInfo
=
wx
.
getStorageSync
(
'guidInfo'
);
let
name
=
''
;
if
(
currentUserInfo
.
member
)
{
if
(
!
currentUserInfo
.
member
.
qiyeInfo
.
name
)
{
name
=
userInfo
.
nickName
;
}
else
{
name
=
currentUserInfo
.
member
.
qiyeInfo
.
name
;
}
}
this
.
setData
({
name
:
name
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow
:
function
()
{
//获取企业二维码
getEnterpriseQrcode
(){
wx
.
qy
.
getQrCode
({
success
:
res
=>
{
console
.
log
(
'获取员工二维码---'
,
res
)
this
.
setData
({
codeImg
:
res
.
qrCode
});
},
fail
:
res
=>
{
console
.
log
(
'获取员工二维码失败---'
,
res
)
}
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide
:
function
()
{
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload
:
function
()
{
//获取头像
getAvator
(){
wx
.
qy
.
getAvatar
({
success
:
res
=>
{
console
.
log
(
'获取员工二头像---'
,
res
)
this
.
setData
({
avator
:
res
.
avatar
});
},
fail
:
res
=>
{
console
.
log
(
'获取员工头像失败---'
,
res
)
}
});
},
/**
*
页面相关事件处理函数--监听用户下拉动作
*
生命周期函数--监听页面显示
*/
on
PullDownRefresh
:
function
()
{
on
Show
:
function
()
{
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom
:
function
()
{
},
/**
* 用户点击右上角分享
...
...
src/shoppingGuid/page/pages/qrcode/qrcode.json
View file @
06f36166
{
"navigationBarTitleText"
:
"对外名片"
,
"usingComponents"
:
{}
}
\ No newline at end of file
src/shoppingGuid/page/pages/qrcode/qrcode.wxml
View file @
06f36166
<!--shoppingGuid/page/pages/qrcode/qrcode.wxml-->
<text>shoppingGuid/page/pages/qrcode/qrcode.wxml</text>
<view class='qrcode'>
<view class='card'>
<image class='g-qrcode' mode='aspectFit' src='{{codeImg}}'></image>
<image class='g-logo' mode='aspectFit' src='{{avator}}'></image>
<text class='name'>{{name}}</text>
</view>
</view>
src/shoppingGuid/page/pages/qrcode/qrcode.wxss
View file @
06f36166
/* shoppingGuid/page/pages/qrcode/qrcode.wxss */
\ No newline at end of file
/* shoppingGuid/page/pages/qrcode/qrcode.wxss */
page{
background: #f2f2f2;
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
view{
box-sizing: border-box;
-webkit-box-sizing: border-box;
}
.qrcode{
padding: 50rpx;
}
.qrcode .card{
width: 100%;
height: auto;
padding: 30rpx;
background: #ffffff;
border-radius: 10rpx;
border: 12rpx solid rgba(0, 145, 255, 0.46);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 100rpx;
}
.qrcode .card .g-qrcode{
width: 320rpx;
height: 320rpx;
margin-bottom: 40rpx;
}
.qrcode .card .g-logo{
width: 140rpx;
height: 140rpx;
margin-bottom: 25rpx;
border-radius: 50%;
}
.qrcode .card .name{
font-size: 36rpx;
color: #333333;
font-weight: bold;
}
src/shoppingGuid/page/pages/userList/userList.js
View file @
06f36166
...
...
@@ -66,6 +66,8 @@ wxService.page({
//回访
onTapRecall
(
e
){
let
item
=
e
.
currentTarget
.
dataset
.
item
;
console
.
log
(
item
)
},
/**
...
...
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.js
View file @
06f36166
...
...
@@ -8,18 +8,46 @@ wxService.page({
*/
data
:
{
code
:
null
,
jsCodeSession
:
{}
jsCodeSession
:
{},
btnIsDisabled
:
true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad
:
function
(
options
)
{
wx
.
showLoading
({
title
:
'检查登录状态..'
,
});
this
.
qyLogin
();
return
;
//先判断是是不是已经登录了
let
currentUserInfo
=
wx
.
getStorageSync
(
'guidBaseInfo'
);
let
userInfo
=
wx
.
getStorageSync
(
'guidInfo'
);
if
(
currentUserInfo
){
wx
.
qy
.
checkSession
({
success
:
res
=>
{
wx
.
redirectTo
({
url
:
'/shoppingGuid/page/pages/home/home'
,
});
},
fail
:
res
=>
{
//失效了
this
.
qyLogin
();
}
});
}
else
{
this
.
qyLogin
();
}
},
//企业微信登录
qyLogin
(){
const
currentEnv
=
wx
.
getStorageSync
(
'_qyWeChat'
);
if
(
currentEnv
)
{
wx
.
qy
.
login
({
success
:
res
=>
{
console
.
log
(
'企业微信登录获取code---'
,
res
.
code
);
this
.
setData
({
code
:
res
.
code
});
...
...
@@ -31,33 +59,31 @@ wxService.page({
}
})
}
else
{
else
{
//不是在企业微信内打开的 提示信息
wx
.
showToast
({
title
:
'请在企业微信内打开!'
,
icon
:
'none'
});
}
},
//获取session_key
jscode2session
(
code
){
wxService
.
post
(
`/member/qiyeweixin/jscode2session?brandId=
${
app
.
globalData
.
brandId
}
&code=
${
code
}
`
).
then
(
r
=>
{
console
.
log
(
'jscode2session ----'
,
r
);
this
.
setData
({
jsCodeSession
:
r
.
data
.
data
,
btnIsDisabled
:
false
,
});
})
},
//获取企业微信信息
onTapGetEnterpriseUserInfo
(){
const
currentEnv
=
wx
.
getStorageSync
(
'_qyWeChat'
);
if
(
currentEnv
){
wx
.
qy
.
getEnterpriseUserInfo
({
success
:
res
=>
{
console
.
log
(
'获取企业微信信息为----'
,
res
)
this
.
getGuidUserInfo
(
res
);
},
fail
:
err
=>
{
...
...
@@ -72,28 +98,27 @@ wxService.page({
icon
:
'none'
});
}
},
//授权获取用户信息之后
getGuidUserInfo
(
userInfo
){
wx
.
showLoading
({
title
:
'正在登录..'
,
});
//判断是在企业微信中登录
let
param
=
{
code
:
this
.
data
.
code
,
wechatInfo
:
userInfo
,
brandId
:
app
.
globalData
.
brandId
,
deviceid
:
this
.
data
.
jsCodeSession
.
deviceid
,
userid
:
this
.
data
.
jsCodeSession
.
userid
,
corpid
:
this
.
data
.
jsCodeSession
.
corpid
,
sessionKey
:
this
.
data
.
jsCodeSession
.
session_key
,
};
console
.
log
(
'调用企业微信登录接口参数----------'
,
param
)
wxService
.
post
(
'/member/qiyeweixin/minaLogin'
,
param
).
then
(
r
=>
{
console
.
log
(
r
)
wx
.
setStorageSync
(
'guidInfo'
,
userInfo
);
wx
.
setStorageSync
(
'token'
,
r
.
data
.
data
.
token
);
console
.
log
(
'login token -----'
,
r
.
data
.
data
.
token
)
let
qiyeLoginUserInfo
=
r
.
data
.
data
;
wx
.
setStorageSync
(
'guidBaseInfo'
,
qiyeLoginUserInfo
);
wx
.
hideLoading
();
wx
.
redirectTo
({
url
:
'/shoppingGuid/page/pages/home/home'
,
});
...
...
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.json
View file @
06f36166
{
"navigationBarTitleText"
:
"欢迎
您,导购
"
,
"navigationBarTitleText"
:
"欢迎
你
"
,
"usingComponents"
:
{}
}
\ No newline at end of file
src/shoppingGuid/page/pages/welcomGuider/welcomGuider.wxml
View file @
06f36166
<!--shoppingGuid/page/pages/welcomGuider/welcomGuider.wxml-->
<view class='login'>
<image src='https://bigaka-xie.oss-cn-shanghai.aliyuncs.com/welcom.png' mode='widthFix'></image>
<!-- <button type='primary'
bindgetuserinfo="getGuidUserInfo"
open-type='getUserInfo'>
立即进入</button> -->
<button type='primary' bindtap='onTapGetEnterpriseUserInfo'>立即进入</button>
<button type='primary' bindtap='onTapGetEnterpriseUserInfo' disabled='{{btnIsDisabled}}'>立即进入</button>
<button class='enter-mall' bindtap='onTapToMall'>进入商城</button>
</view>
src/shoppingGuid/page/pages/welfare/welfare.js
View file @
06f36166
...
...
@@ -101,6 +101,7 @@ wxService.page({
id
:
item
.
couponId
,
url
:
item
.
imageBg
}
let
tentacleInfo
=
{
content
:
JSON
.
stringify
(
content
),
contentId
:
item
.
couponId
,
...
...
@@ -122,7 +123,6 @@ wxService.page({
imgUrl
:
item
.
imageBg
,
//小程序消息的封面图
page
:
path
,
//小程序消息打开后的路径
success
:
function
(
r
)
{
//todo:
wx
.
showToast
({
title
:
'发送成功!'
});
...
...
@@ -134,6 +134,7 @@ wxService.page({
}
});
},
//立即推荐商品给用户
onTapToRecommandProduct
(
e
){
let
item
=
e
.
currentTarget
.
dataset
.
item
;
...
...
@@ -179,7 +180,21 @@ wxService.page({
// 先不管触点 测试调用企业微信接口
// let inner_id = Integer.digit(item.productId, 10, 64);
// var path = 'pages/productDetail/productDetail' + '?i=' + inner_id;
// this.openQyContact(item, path);
// wx.qy.shareToExternalContact({
// appid: app.globalData.appId,//小程序的appid
// title: item.productName, //小程序消息的title
// imgUrl: item.productImgUrl,//小程序消息的封面图
// page: path, //小程序消息打开后的路径
// success: function (res) {
// //todo:
// wx.showToast({
// title: '推荐成功!'
// });
// },
// fail: function (err) {
// console.log('error---------------', err);
// }
// });
},
...
...
src/utils/Http.js
View file @
06f36166
...
...
@@ -114,8 +114,11 @@ class Http {
post
(
url
,
parmas
,
channel
)
{
let
baseUserInfo
=
wx
.
getStorageSync
(
'_baseUserInfo'
)
console
.
log
(
'--------------header-----------------'
,
this
.
getTentacle
())
if
(
baseUserInfo
){
let
guideUserInfo
=
wx
.
getStorageSync
(
'guidBaseInfo'
);
// console.log('--------------header-----------------', this.getTentacle())
// console.log('--------------token-----------------', this.getToken())
if
(
baseUserInfo
||
guideUserInfo
){
return
this
.
request
({
url
,
method
:
'POST'
,
...
...
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