diff --git a/api/user/userApi.js b/api/user/userApi.js index 6da7e59..e4702dd 100644 --- a/api/user/userApi.js +++ b/api/user/userApi.js @@ -433,3 +433,34 @@ export function ownerRegiter(_data){ } +export function wechatLogin(_data) { + + return new Promise((resolve, reject) => { + requestNoAuth({ + url: url.phoneWechatLogin, + method: "POST", + data: _data, //动态数据 + success: function(res) { + let _json = res.data; + if (_json.code != 0) { + reject(_json.msg); + return; + } + //todo 保存业主信息 + uni.setStorageSync("userInfo",_json.data); + uni.setStorageSync("currentCommunityInfo",{ + communityId:_json.data.communityId, + communityName:_json.data.communityName, + sCommunityTel:_json.data.communityTel, + communityQrCode:_json.data.communityQrCode + }); + resolve(_json.data); + }, + fail: function(e) { + reject(e); + } + }); + }) +} + + diff --git a/components/my/my-menu.vue b/components/my/my-menu.vue index 835a39a..d515c7b 100644 --- a/components/my/my-menu.vue +++ b/components/my/my-menu.vue @@ -12,7 +12,7 @@ - + diff --git a/components/user/wechat-login.vue b/components/user/wechat-login.vue new file mode 100644 index 0000000..661b9e8 --- /dev/null +++ b/components/user/wechat-login.vue @@ -0,0 +1,125 @@ + + + + + \ No newline at end of file diff --git a/conf/config.js b/conf/config.js index b95ac5a..7cbfe94 100644 --- a/conf/config.js +++ b/conf/config.js @@ -15,7 +15,7 @@ const baseUrl = '/'; // #ifndef H5 //服务器域名 小程序 或者 app 时 后端地址 -const baseUrl = 'http://wuye.heyiiot.com/'; +const baseUrl = 'http://127.0.0.1:8008/'; // #endif let commonBaseUrl = 'http://wuye.heyiiot.com/'; diff --git a/constant/url.js b/constant/url.js index 629c267..4f7ae7f 100644 --- a/constant/url.js +++ b/constant/url.js @@ -8,6 +8,7 @@ export default { loginUrl: baseUrl + 'app/loginWx', getWxPhoto: baseUrl + 'app/getWxPhoto', loginOwnerUrl: baseUrl + 'app/loginOwner', + phoneWechatLogin: baseUrl + "app/login.phoneWechatLogin", areaUrl: baseUrl + "app/area.listAreas", GetNoticeListUrl: baseUrl + 'app/notice.listNotices', //公告接口 saveOwnerRepair: baseUrl + 'app/ownerRepair.saveOwnerRepair', //报修 @@ -15,7 +16,7 @@ export default { saveOwner: baseUrl + 'app/owner.saveOwnerMember', //家庭成员列表 queryOwnerMembers: baseUrl + 'app/owner.queryAppOwnerMembers', //投诉建议列表 listComplaints: baseUrl + 'app/complaint.queryUserComplaints', //添加投诉建议 - listComplaintEvent: baseUrl + 'app/complaint.listComplaintEvent', //添加投诉建议 + listComplaintEvent: baseUrl + 'app/complaint.listPhoneComplaintEvent', //添加投诉建议 saveComplaintAppraise: baseUrl + 'app/complaintAppraise.saveComplaintAppraise', //添加投诉建议 listComplaintType: baseUrl + 'app/complaint.queryPhoneComplaintType', //查询投诉类型 diff --git a/manifest.json b/manifest.json index 58af070..7ae099e 100644 --- a/manifest.json +++ b/manifest.json @@ -59,7 +59,7 @@ "quickapp" : {}, "mp-weixin" : { "usingComponents" : true, - "appid" : "wx0a08dd8124d7f04f", + "appid" : "wx702e87d56708f858", "setting" : { "urlCheck" : false, "es6" : false diff --git a/pages.json b/pages.json index 2a78db5..e5fa548 100644 --- a/pages.json +++ b/pages.json @@ -1119,12 +1119,12 @@ }, - { - "pagePath": "pages/mall/mall", - "text": "商圈", - "iconPath": "static/images/market.png", - "selectedIconPath": "static/images/market-selected.png" - }, + // { + // "pagePath": "pages/mall/mall", + // "text": "商圈", + // "iconPath": "static/images/market.png", + // "selectedIconPath": "static/images/market-selected.png" + // }, { "pagePath": "pages/my/my", diff --git a/pages/homemaking/homemaking.vue b/pages/homemaking/homemaking.vue index 3ef939c..9c2d7d3 100644 --- a/pages/homemaking/homemaking.vue +++ b/pages/homemaking/homemaking.vue @@ -1,7 +1,7 @@ diff --git a/pages/login/login.vue b/pages/login/login.vue index d162597..7afa7c0 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -23,17 +23,23 @@ 验证码 - - - - - {{phoneLoginName}} + + + + + + + {{phoneLoginName}} + 注册 + + @@ -60,7 +66,8 @@ getWAppId, saveWAppId, getLoginFlag - } from '@/lib/java110/utils/StorageUtil.js' + } from '@/lib/java110/utils/StorageUtil.js'; + import wechatLogin from '@/components/user/wechat-login.vue'; const constant = context.constant; const factory = context.factory; @@ -90,6 +97,14 @@ if (wAppId) { uni.setStorageSync(constant.mapping.W_APP_ID, wAppId); } + // #ifdef MP-WEIXIN + setTimeout(function(){ + that.$refs.wechatLoginRef._initWechatLogin(); + },1000) + // #endif + }, + components:{ + wechatLogin }, methods: { _doLogin: function() { diff --git a/pages/login/register.vue b/pages/login/register.vue index b10c371..07d1bbc 100644 --- a/pages/login/register.vue +++ b/pages/login/register.vue @@ -28,7 +28,7 @@ - + diff --git a/pages/my/myHouse.vue b/pages/my/myHouse.vue index 330b1c4..0b0cfab 100644 --- a/pages/my/myHouse.vue +++ b/pages/my/myHouse.vue @@ -34,6 +34,7 @@ import { getCommunityId } from '../../api/community/communityApi.js'; + import {getRooms} from '@/api/room/roomApi.js'; import context from '../../lib/java110/Java110Context.js'; const constant = context.constant;