Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8e2c4e9a
authored
Oct 17, 2022
by
杨北旺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
个人中心联调
1 parent
07a2ea43
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
260 additions
and
143 deletions
api/mineApi/index.js
api/mineApi/mineApi.js
app.js
packageMine/pages/editBasicInfo/index.js
packageMine/pages/settingName/index.js
packageMine/pages/withdrawal/index.js
packageMine/pages/withdrawalNote/index.js
packageMine/pages/withdrawalNote/index.wxml
pages/tab/index/index.js
pages/tab/mine/components/listInfo/listInfo.js
pages/tab/mine/components/listInfo/listInfo.wxml
pages/tab/mine/components/userInfo/userInfo.js
pages/tab/mine/components/userInfo/userInfo.wxml
pages/tab/mine/mine.js
pages/tab/mine/mine.wxml
project.private.config.json
utils/constantData.js
utils/request/environment.js
api/mineApi/index.js
0 → 100644
View file @
8e2c4e9
import
MineApi
from
'./mineApi.js'
export
default
new
MineApi
()
\ No newline at end of file
api/mineApi/mineApi.js
0 → 100644
View file @
8e2c4e9
import
api
from
'~/utils/request/request'
const
{
appId
}
=
wx
.
getAccountInfoSync
().
miniProgram
class
MineApi
{
// 获取积分详情
getScoreDetailApi
(
data
)
{
return
api
.
post
(
{
method
:
'stoassistant.api.score.detail'
,
...
data
})
}
// 提现记录
getWithdrawalListApi
(
data
)
{
return
api
.
post
(
{
method
:
'stoassistant.api.withdrawal.list'
,
...
data
})
}
// 提现
WithdrawalApi
(
data
)
{
return
api
.
post
(
{
method
:
'stoassistant.api.withdrawal.insert'
,
...
data
},
true
)
}
// 获取员工详情
getStaffDetailApi
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.sso.wechat.account.staff.detail'
,
...
data
,
})
}
// 更新员工信息
updateStaffDetailApi
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.sso.wechat.account.staff.update'
,
...
data
})
}
// 退出登录
logoutApi
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.sso.wechat.applets.logout'
,
...
data
,
},
true
)
}
// 微信绑定
wechatBindApi
(
data
)
{
return
api
.
post
(
{
method
:
'scrm.api.sso.wechat.account.binding.openId'
,
...
data
,
},
true
)
}
}
export
default
MineApi
\ No newline at end of file
app.js
View file @
8e2c4e9
// app.js
import
util
from
'./utils/util'
import
wxApi
from
'./utils/utils_wx'
import
'~/router/routerBefore'
//
import '~/router/routerBefore'
import
router
from
'./router/index'
import
{
setSystem_info
}
from
'~/utils/cache/storageApi'
...
...
packageMine/pages/editBasicInfo/index.js
View file @
8e2c4e9
import
MineApi
from
'~/api/mineApi/index'
Page
({
data
:
{
list_fill
:
[
{
...
...
@@ -38,24 +38,32 @@ Page({
},]
},
onConfirm
(
e
)
{
let
{
value
}
=
e
.
detail
this
.
setData
({
'list_fill[1].value'
:
value
.
name
,
showModal
:
false
,
'user.seriseName'
:
value
.
name
},()
=>
{
wx
.
$eventbus
.
emit
(
'SETTING'
,{
user
:
this
.
data
.
user
})
let
{
value
}
=
e
.
detail
let
{
user
}
=
this
.
data
let
para
=
{
id
:
user
.
bussinessId
,
platformEntrance
:
'STORE_ASSISTANT'
,
department
:
value
.
id
}
MineApi
.
updateStaffDetailApi
(
para
).
then
(
res
=>
{
this
.
setData
({
'list_fill[1].value'
:
value
.
name
,
showModal
:
false
,
'user.seriseName'
:
value
.
name
},
()
=>
{
wx
.
$eventbus
.
emit
(
'SETTING'
)
})
})
},
clickRow
(
e
)
{
const
{
index
,
name
}
=
e
.
currentTarget
.
dataset
const
{
index
,
name
}
=
e
.
currentTarget
.
dataset
if
(
index
==
1
)
{
this
.
setData
({
showModal
:
true
})
return
}
wx
.
$router
.
go
(
'packageMine.settingName.index'
,
{
name
})
wx
.
$router
.
go
(
'packageMine.settingName.index'
,
{
name
,
user
:
this
.
data
.
user
})
},
onClose
()
{
...
...
@@ -64,12 +72,12 @@ Page({
})
},
toComfirm
()
{
},
onShow
(
options
){
onShow
(
options
)
{
},
onRoute
(
options
)
{
let
{
list_fill
,
list_disable
}
=
this
.
data
if
(
options
.
user
)
{
let
{
list_fill
,
list_disable
}
=
this
.
data
if
(
options
.
user
)
{
let
user
=
options
.
user
list_fill
[
0
].
value
=
user
.
nickName
list_fill
[
1
].
value
=
user
.
seriseName
...
...
@@ -81,7 +89,7 @@ Page({
user
})
}
}
...
...
packageMine/pages/settingName/index.js
View file @
8e2c4e9
import
MineApi
from
'~/api/mineApi/index'
Page
({
data
:
{
nickName
:
''
},
...
...
@@ -12,17 +11,26 @@ Page({
})
},
comfirm
(){
if
(
!
this
.
data
.
nickName
)
return
wx
.
$api
.
showToast
(
'请输入名字'
)
wx
.
$eventbus
.
emit
(
'SETTING'
,{
user
:{
nickName
:
this
.
data
.
nickName
}})
wx
.
$router
.
back
((
p
)
=>
{
p
.
setData
({
'list_fill[0].value'
:
this
.
data
.
nickName
,
})
},
1
)
const
{
user
,
nickName
}
=
this
.
data
if
(
!
nickName
)
return
wx
.
$api
.
showToast
(
'请输入名字'
)
let
para
=
{
id
:
user
.
bussinessId
,
platformEntrance
:
'STORE_ASSISTANT'
,
staffName
:
nickName
}
MineApi
.
updateStaffDetailApi
(
para
).
then
(
res
=>
{
wx
.
$eventbus
.
emit
(
'SETTING'
)
wx
.
$router
.
back
((
p
)
=>
{
p
.
setData
({
'list_fill[0].value'
:
nickName
,
})
},
1
)
})
},
onRoute
(
options
)
{
this
.
setData
({
nickName
:
options
.
name
nickName
:
options
.
name
,
user
:
options
.
user
})
},
...
...
packageMine/pages/withdrawal/index.js
View file @
8e2c4e9
import
{
IMG_URL
}
from
'~/utils/constantData'
import
MineApi
from
'~/api/mineApi/index'
Page
({
data
:
{
IMGURL
:
IMG_URL
,
withdrawalScore
:
0
,
...
...
@@ -11,7 +10,14 @@ Page({
let
{
sumbitScore
}
=
this
.
data
if
(
!
sumbitScore
)
return
wx
.
$api
.
showToast
(
'请输入提现积分'
)
if
(
sumbitScore
==
0
)
return
wx
.
$api
.
showToast
(
'提现积分不能为0'
)
wx
.
$router
.
go
(
'packageMine.withdrawalSuccess.index'
)
MineApi
.
WithdrawalApi
({
withdrawalScore
:
sumbitScore
}).
then
(
res
=>
{
if
(
res
.
code
==
0
){
wx
.
$eventbus
.
emit
(
'REFRESH_WITHDRALWAL'
)
wx
.
$router
.
go
(
'packageMine.withdrawalSuccess.index'
)
}
else
{
wx
.
$api
.
showToast
(
res
.
message
)
}
})
},
onRoute
(
options
)
{
this
.
setData
({
...
...
packageMine/pages/withdrawalNote/index.js
View file @
8e2c4e9
import
{
IMG_URL
}
from
'~/utils/constantData'
import
MineApi
from
'~/api/mineApi/index'
Page
({
data
:
{
IMGURL
:
IMG_URL
,
STATUSICON
:[
'wait'
,
'comlpete'
,
'fail'
],
listData
:[
{
num
:
110
,
status
:
0
,
},
{
num
:
1100
,
status
:
1
,
},
{
num
:
11000
,
status
:
2
,
},
]
listData
:[]
},
onRoute
(
options
){
// let para = {
// status
// }
MineApi
.
getWithdrawalListApi
().
then
(
res
=>
{
if
(
res
&&
res
.
length
){
res
.
map
(
item
=>
{
if
(
item
.
status
==
3
){
item
.
iconType
=
1
}
else
{
item
.
iconType
=
0
}
return
item
})
}
this
.
setData
({
listData
:
res
||
[]
})
})
}
})
\ No newline at end of file
packageMine/pages/withdrawalNote/index.wxml
View file @
8e2c4e9
...
...
@@ -2,22 +2,23 @@
<view class="title_widget flex_sc">
<view class="text_1">提现记录</view>
<view class="text_2 marlf8">·</view>
<view class="text_2">
80
</view>
<view class="text_2">
{{listData.length}}
</view>
</view>
<view class="list">
<block wx:for="{{listData}}" wx:key="index">
<view class="element">
<image mode="widthFix" class="bgicon" src="{{IMGURL}}status_{{STATUSICON[item.
status
]}}.png" />
<image mode="widthFix" class="bgicon" src="{{IMGURL}}status_{{STATUSICON[item.
iconType
]}}.png" />
<view class="posi_wrap">
<view class="avatar_info flex_sc">
<image mode="aspectFill" class="icon" src="{{IMGURL}}discovery_prod1.png" />
<view class="nameText">百晓生</view>
<image wx:if="{{item.wechatAvatarUrl}}" mode="aspectFill" class="icon" src="{{item.wechatAvatarUrl}}" />
<image wx:else mode="aspectFill" class="icon" src="{{IMGURL}}default_avatar.png" />
<view class="nameText">{{item.wechatNickName || ''}}</view>
</view>
<view class="countText">-{{item.
num
}}</view>
<view class="countText">-{{item.
withdrawalScore
}}</view>
<view class="line"></view>
<view class="date_wrap flex_scb">
<view class="dateText">申请时间:
2022-10-12 17:32
</view>
<view wx:if="{{item.
status}}" class="dateText">完成时间:2022-10-12 17:32
</view>
<view class="dateText">申请时间:
{{item.withdrawalTime}}
</view>
<view wx:if="{{item.
iconType}}" class="dateText">完成时间:{{item.successTime || ''}}
</view>
</view>
</view>
</view>
...
...
pages/tab/index/index.js
View file @
8e2c4e9
...
...
@@ -202,8 +202,8 @@ Page({
},
getData
()
{
this
.
getActivityList
(
1
)
this
.
getActivityList
(
2
)
//
this.getActivityList(1)
//
this.getActivityList(2)
},
getActivityList
(
num
)
{
...
...
pages/tab/mine/components/listInfo/listInfo.js
View file @
8e2c4e9
import
{
IMG_URL
}
from
'~/utils/constantData'
import
MineApi
from
'~/api/mineApi/index'
Component
({
options
:
{
addGlobalClass
:
true
},
properties
:
{
},
/**
...
...
@@ -12,63 +13,39 @@ Component({
*/
data
:
{
IMGURL
:
IMG_URL
,
listData
:
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
listData
:
[
]
},
/**
* 组件的方法列表
*/
methods
:
{
getWithdrawalData
(){
let
data
=
{
score
:{
currentScore
:
1000
,
totalReWardScore
:
59895557
,
totalWithdrawalScore
:
4546546
},
list
:[
{
infoName
:
'充值赠送'
,
updatedTime
:
'2022-10-13 17:03:20'
,
withdrawalScore
:
100
,
type
:
0
},
{
infoName
:
'购买商品'
,
updatedTime
:
'2022-10-13 17:03:20'
,
withdrawalScore
:
100
,
type
:
-
1
},
{
infoName
:
'购买商品'
,
updatedTime
:
'2022-10-13 17:03:20'
,
withdrawalScore
:
100
,
type
:
-
1
getWithdrawalData
()
{
MineApi
.
getScoreDetailApi
().
then
(
res
=>
{
wx
.
hideLoading
();
let
data
=
{
score
:
{
currentScore
:
res
.
currentScore
,
totalReWardScore
:
res
.
totalRewardScore
,
totalWithdrawalScore
:
res
.
totalWithdrawalScore
},
{
infoName
:
'购买商品'
,
updatedTime
:
'2022-10-13 17:03:20'
,
withdrawalScore
:
100
,
type
:
-
1
},
{
infoName
:
'购买商品'
,
updatedTime
:
'2022-10-13 17:03:20'
,
withdrawalScore
:
100
,
type
:
-
1
},
]
}
wx
.
$eventbus
.
emit
(
'WITHDRALWAL'
,
data
.
score
.
currentScore
)
this
.
setData
({
score
:
data
.
score
,
listData
:
data
.
list
,
list
:
res
.
scoreList
}
wx
.
$eventbus
.
emit
(
'WITHDRALWAL'
,
data
.
score
.
currentScore
)
this
.
setData
({
score
:
data
.
score
,
listData
:
data
.
list
,
})
})
}
},
lifetimes
:
{
attached
()
{
this
.
getWithdrawalData
()
wx
.
$eventbus
.
on
(
'REFRESH_WITHDRALWAL'
,()
=>
{
wx
.
$api
.
showLoading
()
this
.
getWithdrawalData
()
})
}
}
})
pages/tab/mine/components/listInfo/listInfo.wxml
View file @
8e2c4e9
...
...
@@ -26,7 +26,7 @@
<view class="date">{{item.updatedTime}}</view>
<view class="price {{item.type==0?'':'blackColor'}}">
<text class="mini">{{item.type==0?'+':'-'}}</text>
<text>{{item.
withdrawal
Score}}</text>
<text>{{item.
reward
Score}}</text>
</view>
</view>
</block>
...
...
pages/tab/mine/components/userInfo/userInfo.js
View file @
8e2c4e9
import
{
IMG_URL
}
from
'~/utils/constantData'
import
MineApi
from
'~/api/mineApi/index'
Component
({
options
:
{
addGlobalClass
:
true
...
...
@@ -17,21 +18,18 @@ Component({
toEditPage
()
{
wx
.
$router
.
go
(
'packageMine.editBasicInfo.index'
,
{
user
:
this
.
data
.
user
})
},
// toAddEvent() {
// wx.$eventbus.on('SETTING', (res) => {
// let user = this.data.user
// if (res) {
// Object.assign(user, res.user)
// this.setData({
// user
// })
// }
// })
// }
toLogout
(){
MineApi
.
logoutApi
().
then
(
res
=>
{
wx
.
$storage
.
rm
(
'sessionId'
)
wx
.
reLaunch
({
url
:
'/pages/authentication/login/login'
,
});
})
}
},
lifetimes
:
{
attached
()
{
// this.toAddEvent()
}
}
})
pages/tab/mine/components/userInfo/userInfo.wxml
View file @
8e2c4e9
...
...
@@ -9,7 +9,8 @@
</wxs>
<view style="{{boxStyle}}" class="userInfo_widget">
<view class="wrap flex_sc">
<image mode="aspectFill" class="header_icon" src="{{user.headImgUrl}}" />
<image wx:if="{{user.headImgUrl}}" mode="aspectFill" class="header_icon" src="{{user.headImgUrl}}" />
<image wx:else mode="aspectFill" class="header_icon" src="{{IMGURL}}default_avatar.png" />
<view class="info_text">
<view class="label flex_sc">
<text>{{strSubstr.getString(user.nickName)}}</text>
...
...
@@ -29,7 +30,7 @@
</view>
</view>
</view>
<view class="logout flex_cc">退出登录</view>
<view class="logout flex_cc"
bind:tap="toLogout"
>退出登录</view>
</view>
<view class="store_widget flex_cc">
<view class="flex_sc label">
...
...
pages/tab/mine/mine.js
View file @
8e2c4e9
const
navStyle
=
"background-color: transparent;"
;
import
MineApi
from
'~/api/mineApi/index'
import
USERAPI
from
'~/api/usersApi/index'
const
DEPARTMENTLIST
=
[
'销售部'
,
'售后部'
,
'客服部'
,
'续保部'
,]
Page
({
/**
* 页面的初始数据
*/
data
:
{
navStyle
,
showModal
:
false
showModal
:
false
,
},
navbarReady
(
e
)
{
let
{
...
...
@@ -21,29 +24,10 @@ Page({
navStyle
:
e
.
scrollTop
>=
38
?
""
:
navStyle
,
});
},
getUserInfo
()
{
const
USERINFO
=
{
headImgUrl
:
'https://img02.glsx.com.cn/weapp/resource/miniprogram/store-assistant/default_avatar.png'
,
nickName
:
'小黄鸭'
,
phone
:
'18269441444'
,
seriseName
:
'销售部'
,
merchantName
:
'广联数科4S店广联数科4S店广联数科4S店广联数科4S店'
,
brandName
:
'绑定的名称名称'
,
bindStatus
:
0
}
this
.
setData
({
user
:
USERINFO
})
},
toAddEvent
()
{
wx
.
$eventbus
.
on
(
'SETTING'
,
(
res
)
=>
{
let
user
=
this
.
data
.
user
if
(
res
)
{
Object
.
assign
(
user
,
res
.
user
)
this
.
setData
({
user
})
}
this
.
getStaffInfo
()
})
},
toShowBindModal
(
e
)
{
...
...
@@ -51,13 +35,70 @@ Page({
showModal
:
e
.
detail
})
},
toCloseModal
(){
toCloseModal
()
{
this
.
setData
({
showModal
:
false
showModal
:
false
})
},
async
toBindWechat
(
e
)
{
console
.
log
(
e
);
if
(
e
.
detail
.
errMsg
===
"getPhoneNumber:ok"
)
{
wx
.
$api
.
showLoading
()
const
{
encryptedData
,
iv
,
code
}
=
e
.
detail
USERAPI
.
wxCodeLogin
().
then
(
res
=>
{
let
{
user
}
=
this
.
data
let
para
=
{
code
,
encryptedData
,
iv
,
platformEntrance
:
'STORE_ASSISTANT'
,
userType
:
user
.
userType
,
staffPhone
:
user
.
phone
,
merchantId
:
user
.
merchantId
,
loginToken
:
res
.
data
,
id
:
user
.
bussinessId
}
MineApi
.
wechatBindApi
(
para
).
then
(
res
=>
{
wx
.
hideLoading
();
this
.
getStaffInfo
()
})
})
}
},
getStaffInfo
()
{
const
userStorage
=
wx
.
$storage
.
get
(
'userInfo'
)
let
para
=
{
id
:
userStorage
.
bussinessId
}
MineApi
.
getStaffDetailApi
(
para
).
then
(
res
=>
{
const
temp
=
this
.
handleUserInfo
(
res
)
this
.
setData
({
user
:
temp
})
})
},
handleUserInfo
(
data
)
{
const
userStorage
=
wx
.
$storage
.
get
(
'userInfo'
)
const
storage
=
{
merchantId
:
userStorage
.
merchantId
,
userType
:
userStorage
.
userType
,
merchantName
:
userStorage
.
merchantName
,
phone
:
userStorage
.
phone
,
}
const
{
id
,
staffPhone
,
phone
,
department
,
weChatNickName
,
weChatAvatarUrl
,
weChatOpenId
,
staffName
}
=
data
const
USERINFO
=
{
headImgUrl
:
weChatAvatarUrl
,
nickName
:
staffName
,
seriseName
:
DEPARTMENTLIST
[
department
-
1
],
brandName
:
weChatNickName
||
phone
||
staffPhone
,
bindStatus
:
weChatOpenId
?
1
:
0
,
bussinessId
:
id
,
...
storage
}
return
USERINFO
},
onLoad
:
function
(
options
)
{
this
.
get
User
Info
()
this
.
get
Staff
Info
()
this
.
toAddEvent
()
},
...
...
pages/tab/mine/mine.wxml
View file @
8e2c4e9
...
...
@@ -18,5 +18,5 @@
<van-popup bind:click-overlay="toCloseModal" show="{{ showModal }}" custom-class="popclass" position="bottom" custom-style="height: 35%">
<view class="modal_title">提示</view>
<view class="modal_tip">您未绑定微信,请先完成绑定</view>
<button class="modal_btn">去绑定</button>
<button class="modal_btn"
open-type="getPhoneNumber" catch:tap="toCloseModal" bindgetphonenumber="toBindWechat"
>去绑定</button>
</van-popup>
\ No newline at end of file
project.private.config.json
View file @
8e2c4e9
{
"setting"
:
{
"compileHotReLoad"
:
tru
e
,
"compileHotReLoad"
:
fals
e
,
"urlCheck"
:
false
,
"lazyloadPlaceholderEnable"
:
true
},
...
...
utils/constantData.js
View file @
8e2c4e9
...
...
@@ -9,5 +9,5 @@ export const STORAGE_OBJECTkEY = {
sessionId
:
'sessionId'
,
userInfo
:
'userInfo'
,
system_info
:
'systemInfo'
,
app_title
:
'appTitle'
app_title
:
'appTitle'
,
}
utils/request/environment.js
View file @
8e2c4e9
...
...
@@ -53,7 +53,9 @@ const pathEnum = {
material
:
'/rop-scrm-marketing/'
,
//素材
sop
:
'/rop-scrm-sop/'
,
customercollect
:
'/rop-scrm-bigdatautil/'
,
drac
:
'/rop-scrm-entmicro/'
drac
:
'/rop-scrm-entmicro/'
,
withdrawal
:
'/rop-scrm-stoassistant/'
,
score
:
'/rop-scrm-stoassistant/'
}
const
defaultMerchantId
=
{
ip
:
'44184606'
,
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment