|
|
@@ -30,10 +30,10 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
|
|
|
return;
|
|
|
});
|
|
|
*/
|
|
|
- var promise = Enterprise.getEnterpriseAdminInfo({enuu : enUU}, {}).$promise;
|
|
|
+ var promise = Enterprise.getEnterPriseTelOrAdminTel({enuu : enUU}, {}).$promise;
|
|
|
|
|
|
return promise.then(function (data) {
|
|
|
- return data.userTel;
|
|
|
+ return data.data.entel || data.data.adminTel;
|
|
|
}, function () {
|
|
|
return 0;
|
|
|
});
|
|
|
@@ -58,7 +58,7 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
|
|
|
return promise.then(function (enterprise) {
|
|
|
return {
|
|
|
enUU: enterprise.uu,
|
|
|
- name: enterprise.enName
|
|
|
+ name: enterprise.ehnName
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -113,7 +113,7 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
|
|
|
this.getAdminInfo = getAdminInfo;
|
|
|
}]);
|
|
|
|
|
|
- module.controller('ChatContactCtrl', ['$rootScope', 'ChatBusinessLayer', 'toaster','Enterprise', function ($rootScope, ChatBusinessLayer, toaster, Enterprise) {
|
|
|
+ module.controller('ChatContactCtrl', ['$rootScope', '$scope', 'ChatBusinessLayer', 'toaster','Enterprise', function ($rootScope, $scope, ChatBusinessLayer, toaster, Enterprise) {
|
|
|
|
|
|
var vm = this;
|
|
|
vm.param = {};
|
|
|
@@ -134,26 +134,38 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
|
|
|
* @param userType 联系人用户类型
|
|
|
*/
|
|
|
function contactWithOther(phone, enUU, userType) {
|
|
|
- //获得窗口的垂直位置
|
|
|
- var iTop = (window.screen.availHeight - 30 - 780) / 2;
|
|
|
- //获得窗口的水平位置
|
|
|
- var iLeft = (window.screen.availWidth - 10 - 1030) / 2;
|
|
|
- if (!/^1\d{10}$/.test(phone)){
|
|
|
- ChatBusinessLayer.getAdminInfo(enUU).then(function (userTel) {
|
|
|
- phone = userTel;
|
|
|
+ // //获得窗口的垂直位置
|
|
|
+ // var iTop = (window.screen.availHeight - 30 - 780) / 2;
|
|
|
+ // //获得窗口的水平位置
|
|
|
+ // var iLeft = (window.screen.availWidth - 10 - 1030) / 2;
|
|
|
+ // if (!/^1\d{10}$/.test(phone)){
|
|
|
+ if (!phone){
|
|
|
+ ChatBusinessLayer.getAdminInfo(enUU).then(function (tel) {
|
|
|
+ phone = tel;
|
|
|
/*if (!/^1\d{10}$/.test(phone)){
|
|
|
toaster.pop('warning', '该店铺暂无管理员电话号码!');
|
|
|
return;
|
|
|
}*/
|
|
|
- console.log(phone, enUU, userType,iTop,iLeft);
|
|
|
- startChat(phone,enUU,userType,iTop,iLeft);
|
|
|
+ openChatBox(phone);
|
|
|
+ // startChat(phone,enUU,userType,iTop,iLeft);
|
|
|
});
|
|
|
}else {
|
|
|
- startChat(phone,enUU,userType,iTop,iLeft);
|
|
|
+ openChatBox(phone);
|
|
|
+ // startChat(phone,enUU,userType,iTop,iLeft);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- var startChat= function (phone,enUU,userType,iTop,iLeft) {
|
|
|
+ $scope.showLinkBox = false;
|
|
|
+ var openChatBox = function (phone) {
|
|
|
+ $scope.phone = phone || '-';
|
|
|
+ $scope.showLinkBox = true;
|
|
|
+ console.log(phone);
|
|
|
+ }
|
|
|
+ $scope.setShowLinkBox = function (flag) {
|
|
|
+ $scope.showLinkBox = flag;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*var startChat= function (phone,enUU,userType,iTop,iLeft) {
|
|
|
if ($rootScope.newTab){
|
|
|
$rootScope.newTab.close();
|
|
|
}
|
|
|
@@ -182,7 +194,7 @@ define([ 'common/query/chat', 'common/query/enterprise' ], function() {
|
|
|
toaster.pop('warning', '对方没有开通客服系统,请联系官方客服!');
|
|
|
});
|
|
|
$rootScope.newTab = newTab;
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
}]);
|
|
|
|