1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
| let $api = require('../../utils/ajaxFn.js');
| const app = getApp()
| Page({
| data: {
| value: '',
| merchantList: [],//商户列表
| },
| onLoad() {
| this.setData({
| userStyle: app.userStyle
| })
| $api.ajax(
| '/sib/xcx/login/getUserMgrInfo',
| 'POST',
| (res) => {
| this.setData({
| merchantList: res.data.body.merchantList
| })
| this.data.merchantList.forEach(element => {
| element.storeList.forEach(e => {
| if (e.id == app.lastLoginMgrId) {
| this.setData({
| value: e.id
| })
| }
| })
| });
| },
| (err) => {
|
| },
| true
| )
|
| },
| radioChange(value) {
| this.setData({
| value: value.detail.value
| })
| },
| loginUser() {
| $api.ajax(
| '/sib/xcx/login/mgrLogin',
| 'POST',
| (res) => {
| app.userInfo = res.data.body
| app.lastLoginMgrId = res.data.body.id
| my.reLaunch ({
| url: '/pages/home/home'
| });
| },
| err => {},
| true,
| {
| mgrId: this.data.value
| }
| )
| }
| });
|
|