Commit d5594dd5 authored by 小耗子's avatar 小耗子

修改企业

parent e5901262
...@@ -10,6 +10,6 @@ export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量 ...@@ -10,6 +10,6 @@ export const IMG_URL = 'http://file.shopro.top' //全局网络图片地址变量
export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析 export const MAP_KEY = '426ebc3f1bbaced***89ee6061a98'; //高德地图开发者Web服务key,逆坐标解析
export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播 export const HAS_LIVE = false //后台是否开通直播权限,根据情况在manifest.json中,开启注释相应组件的引入,pages.json中打开直播
// http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code} // http://172.18.1.66:9001/api/a1/mall/homePage/mp?code={前端传入的code}
export const MALL_ID ="101277511100685"; export const MALL_ID ="179480211100680";
export const COMPANY_ID ="2023053102"; export const COMPANY_ID ="2023053102";
\ No newline at end of file
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
"quickapp" : {}, "quickapp" : {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxbcd69823dff3146e", "appid" : "wxebbbc2cc63e9d74e",
"setting" : { "setting" : {
"urlCheck" : true, "urlCheck" : true,
"minified" : false, "minified" : false,
......
...@@ -5,14 +5,6 @@ ...@@ -5,14 +5,6 @@
}, },
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path" : "pages/user/enterprise",
"name":"enterprise",
"style" :
{
"navigationBarTitleText": "选择企业",
"enablePullDownRefresh": false
}
},{
"path" : "pages/index/defalutScreen", "path" : "pages/index/defalutScreen",
"style" : "style" :
{ {
...@@ -104,6 +96,15 @@ ...@@ -104,6 +96,15 @@
"navigationBarTitleText": "京东比价", "navigationBarTitleText": "京东比价",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},
{
"path" : "pages/user/enterprise",
"name":"enterprise",
"style" :
{
"navigationBarTitleText": "选择企业",
"enablePullDownRefresh": false
}
} }
], ],
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<view class="screen-container"> <view class="screen-container">
<image class="bg" src="../../static/img/screen/screen-bg.png" mode="scaleToFill" /> <image class="bg" src="../../static/img/screen/screen-bg.png" mode="scaleToFill" />
<button :disabled="loading" @click="enter" class="btn"> <!-- :disabled="loading" -->
<button @click="enter" class="btn">
马上进入 马上进入
</button> </button>
</view> </view>
...@@ -37,26 +38,37 @@ ...@@ -37,26 +38,37 @@
...mapGetters(['userInfo', 'todayNum']) ...mapGetters(['userInfo', 'todayNum'])
}, },
methods: { methods: {
...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo']), ...mapActions(['getPhoneNumber', 'registerInfoFn', 'authCheck', 'getUserInfo','enterprise']),
// 马上进入 // 马上进入
enter() { enter() {
if (this.unregistered && !this.loading) { // if (this.unregistered && !this.loading) {
uni.navigateTo({ // uni.navigateTo({
url: '/pages/h5/index', // url: '/pages/h5/index',
}) // })
}else{ // }else{
this.getInfoPhoneNumber() console.log("x2")
}}, this.getInfoPhoneNumber(e)
// }
},
// 获取手机号 // 获取手机号
async getInfoPhoneNumber(e) { async getInfoPhoneNumber(e) {
// let number = await this.getPhoneNumber(e); console.log(e)
let register = await this.registerInfoFn(); let number = await this.getPhoneNumber(e);
if (register) { //注册成功 let list = await this.enterprise()
this.unregistered = true; console.log(list)
uni.navigateTo({ if(list.length == 1) {
url: '/pages/h5/index', let register = await this.registerInfoFn(list[0].companyId);
}) }else{
} }
// let number = await this.getPhoneNumber(e);
// let register = await this.registerInfoFn();
// if (register) { //注册成功
// this.unregistered = true;
// uni.navigateTo({
// url: '/pages/h5/index',
// })
// }
}, },
async auth() { async auth() {
let auth = await this.authCheck(); let auth = await this.authCheck();
......
...@@ -18,7 +18,8 @@ const state = { ...@@ -18,7 +18,8 @@ const state = {
}, },
wxCode:'', wxCode:'',
todayNum:0, todayNum:0,
sessionStatus:false sessionStatus:false,
enterpriseList:[]//企业列表
} }
const getters = { const getters = {
...@@ -27,7 +28,9 @@ const getters = { ...@@ -27,7 +28,9 @@ const getters = {
todayNum: state => state.todayNum, todayNum: state => state.todayNum,
wxCode: state=> state.wxCode, wxCode: state=> state.wxCode,
sessionStatus: state=> state.sessionStatus, sessionStatus: state=> state.sessionStatus,
mallId: state=>state.mallId mallId: state=>state.mallId,
enterpriseList:state=>state.enterpriseList,
} }
const actions = { const actions = {
...@@ -142,7 +145,7 @@ const actions = { ...@@ -142,7 +145,7 @@ const actions = {
}) })
}, },
// 注册用户 // 注册用户
registerInfoFn({commit,state},e){ registerInfoFn({commit,state},companyId){
return new Promise((resolve,reject) => { return new Promise((resolve,reject) => {
// if(!state.registerInfo.mobile){ // if(!state.registerInfo.mobile){
// uni.showToast({ // uni.showToast({
...@@ -151,18 +154,36 @@ const actions = { ...@@ -151,18 +154,36 @@ const actions = {
// icon:'none' // icon:'none'
// }); // });
// } // }
http('user.register', state.registerInfo).then(res => { state.registerInfo.companyId = companyId
if (res.code==0||res.code==3761) { conosole.log(state.registerInfo)
resolve(1); // http('user.register', state.registerInfo).then(res => {
} else{ // if (res.code==0||res.code==3761) {
uni.showToast({ // resolve(1);
title: res.msg, // } else{
duration: 2000, // uni.showToast({
icon:'none' // title: res.msg,
}); // duration: 2000,
reject(res.data); // icon:'none'
// });
// reject(res.data);
// }
// })
})
},
// 获取企业
enterprise({commit,state},e){
return new Promise((resolve,reject) => {
let that = this;
http('user.companysList').then(res => {
if (!res.code) {
this.enterpriseList = res.data;
resolve(this.enterpriseList);
}else{
resolve([]);
this.enterpriseList = []
uni.showToast(res.msg);
} }
}) });
}) })
}, },
// 查询步数 // 查询步数
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment