1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/liujiexu-nail_customer_entry

В этом репозитории не указан файл с открытой лицензией (LICENSE). При использовании обратитесь к конкретному описанию проекта и его зависимостям в коде.
Клонировать/Скачать
request.js 3.7 КБ
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
liu Отправлено 20.08.2021 10:44 34745df
const B_data = require('./data');
const http = require('./http');
export default {
authCode: null,
data: {},
XMdata: [],
XMID: 0,
my_XM: {},
KhInfo: {},
pageSize: 15, //下拉列表
pageId: 1, //列表页
//获取code
sent: function () {
var _ = this;
dd.getAuthCode({
success: (res) => {
console.log('res.authCode->', res);
_.authCode = res.authCode;
dd.httpRequest({
url: 'http://new-crm.heimadc.com//userdingtalk/getUserInfoByCode?code=' + res.authCode + '',
success(res) {
console.log(res.data)
_.xxx(res);
},
fal(fal) {
dd.showToast({
type: 'fail ',
content: '登陆未连接',
duration: 3000,
success: () => { },
});
}
})
},
fail: (err) => {
dd.alert({ content: JSON.stringify(err) })
}
});
},
//登录
xxx: function (res) {
let _ = this;
console.log("------------------",res);
dd.showLoading({ content: '登录中...' });
// 'JobNumber':'hm203120','debug':'martymei_debug' 'JobNumber':res.data.data.JobNumber
http.request('/userinfo/getUserInfo', null,{'JobNumber':res.data.data.JobNumber}, function (res) {
if (res.data.code == 200) {
dd.hideLoading();
_.data = res;
for (var i = 0; i < res.data.data.list.length; i++) {
_.XMdata.push(res.data.data.list[i]);
}
_.xiangmu();
} else {
dd.showToast({
type: 'fail ',
content: res.data.message,
duration: 3000,
success: () => { },
});
}
},
function (fail) {
dd.showToast({
type: 'fail ',
content: '网络错误!',
duration: 3000,
success: () => { },
});
})
},
//获取项目信息
xiangmu: function () {
var _ = this;
dd.getStorage({
key: 'index',
success: function (res) {
if (res.data == null) {
_.my_XM = _.XMdata[_.XMID];
}
else {
if (res.data.index < _.XMdata.length) {
_.my_XM = _.XMdata[res.data.index];
}
else {
_.my_XM = _.XMdata[_.XMID];
}
}
console.log('_.my_mx', _.my_XM);
// reLaunch redirectTo
dd.redirectTo({ url: '/pages/navbar/home' })
},
fail: function (res) {
dd.alert({ content: res.errorMessage });
}
});
},
customer: function (success = null) { //获取客户信息
let _ = this;
dd.showLoading({ content: '加载中...' });
http.request('/customer/getList', null, { 'token': _.my_XM.token, 'pageSize': this.pageSize, 'pageId': this.pageId }, function (res) {
if (res.data.data.length) {
console.log("获取客户信息", res);
console.log("pageid", _.pageId);
res.data.data.length >= 15 ? _.pageId++ : _.pageId++;
var arr = [];
for (var p in res.data.data) {
arr.push(res.data.data[p]);
if (arr[p]['记录日期']) {
arr[p]['记录日期'] = res.data.data[p]['记录日期'].substring(0, 16);
}
}
B_data.Kh_data.push(...arr);
dd.hideLoading();
success(res);
}
else {
dd.hideLoading();
dd.showToast({
type: 'fail ',
content: '全部加载完成!',
duration: 3000,
success: () => { },
})
}
}, function (fil) {
dd.showToast({
type: 'fail ',
content: '网络错误!',
duration: 3000,
success: () => { },
});
})
},
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/liujiexu-nail_customer_entry.git
git@api.gitlife.ru:oschina-mirror/liujiexu-nail_customer_entry.git
oschina-mirror
liujiexu-nail_customer_entry
liujiexu-nail_customer_entry
master