1111
This commit is contained in:
5
App.vue
5
App.vue
@@ -2,12 +2,11 @@
|
|||||||
import config from "common/config.js";
|
import config from "common/config.js";
|
||||||
export default {
|
export default {
|
||||||
globalData: {
|
globalData: {
|
||||||
wxSilentLoginURL: config.baseUrl+"/v1/app/wxuser/wxSilentLogin",
|
wxSilentLoginURL: config.baseUrl + "/lpkcustomer/wxSilentLogin",
|
||||||
|
sid: ""
|
||||||
},
|
},
|
||||||
onLaunch: function() {
|
onLaunch: function() {
|
||||||
|
|
||||||
this.WxSilentLogin()
|
this.WxSilentLogin()
|
||||||
|
|
||||||
},
|
},
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
console.log('App Show')
|
console.log('App Show')
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
* loginTimeoutPage = "/pages/login/index", // 登录超时或失效的情况下,跳转到的登录页面
|
* loginTimeoutPage = "/pages/login/index", // 登录超时或失效的情况下,跳转到的登录页面
|
||||||
*/
|
*/
|
||||||
module.exports = {
|
module.exports = {
|
||||||
baseUrl: 'http://192.168.1.193:7201',
|
baseUrl: 'http://192.168.0.108:7201',
|
||||||
// baseUrl: 'https://jianguan.yyundong.com',
|
// baseUrl: 'https://jianguan.yyundong.com',
|
||||||
// baseUrl: 'http://jianguan.yyundong.com/api',
|
// baseUrl: 'http://jianguan.yyundong.com/api',
|
||||||
tokenName: "Authorization", // 请求头中token的名字,与服务器端对应
|
tokenName: "Authorization", // 请求头中token的名字,与服务器端对应
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import request from '@/utils/requester.js'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
login: (params = {}) => request.post("/wxmpapi/sysuser/login", params),
|
login: (params = {}) => request.post("/wxmpapi/sysuser/login", params),
|
||||||
|
wxBindMobile: (params = {}) => request.post("/lpkcustomer/wxBindMobile", params),
|
||||||
sayhello: (params = {}) => request.get("/sayb", params),
|
sayhello: (params = {}) => request.get("/sayb", params),
|
||||||
getSalesReport: (params = {}) => request.get("/system/reportCenter/getSalesReport", params),
|
getSalesReport: (params = {}) => request.get("/system/reportCenter/getSalesReport", params),
|
||||||
getGoodsOnWay: (params = {}) => request.get("/system/reportCenter/getGoodsOnWay", params),
|
getGoodsOnWay: (params = {}) => request.get("/system/reportCenter/getGoodsOnWay", params),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
const wxSilentLogin = () => {
|
const wxSilentLogin = () => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
wx.login({
|
wx.login({
|
||||||
@@ -30,35 +29,19 @@ const wxSilentLogin = () => {
|
|||||||
if (res.statusCode == 200) {
|
if (res.statusCode == 200) {
|
||||||
if (!res.data.success) {
|
if (!res.data.success) {
|
||||||
|
|
||||||
// if (res.data.code == 500) {
|
if (res.data.code == "110") {
|
||||||
// uni.showModal({
|
console.log(res.data.data);
|
||||||
// title: '温馨提示',
|
|
||||||
// content: '您的平台应用未被授权,请联系工作人员。',
|
|
||||||
// showCancel: false,
|
|
||||||
// success: function(res) {
|
|
||||||
// if (res.confirm) {
|
|
||||||
// wx.exitMiniProgram({
|
|
||||||
// success: function() {},
|
|
||||||
// fail: function() {}
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// console.log('点击了取消')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (res.data.code == 100) {
|
|
||||||
// 未绑定用户
|
// 未绑定用户
|
||||||
|
// uni.navigateTo({
|
||||||
|
// url: '/pages/index/BindPhone?openid=' +
|
||||||
|
// res.data.data.wxMpOpenid
|
||||||
|
// })
|
||||||
|
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '../index/BindPhone?openid=' +
|
url: '/pages/index/BindPhone?openid=' +
|
||||||
res.data.data.openid+"&unionid="+
|
res.data.data.wxMpOpenid
|
||||||
res.data.data.unionid
|
|
||||||
})
|
})
|
||||||
// }
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@@ -74,11 +57,16 @@ const wxSilentLogin = () => {
|
|||||||
getApp().globalData.mobile = res.data.data
|
getApp().globalData.mobile = res.data.data
|
||||||
.mobile
|
.mobile
|
||||||
|
|
||||||
getApp().globalData.isAdmin = res.data.data.isAdmin
|
getApp().globalData.isAdmin = res.data.data
|
||||||
getApp().globalData.orgSidPath = res.data.data.orgSidPath
|
.isAdmin
|
||||||
getApp().globalData.orgNamePath = res.data.data.orgNamePath
|
getApp().globalData.orgSidPath = res.data.data
|
||||||
getApp().globalData.organizationSid = res.data.data.organizationSid
|
.orgSidPath
|
||||||
getApp().globalData.headImage = res.data.data.headImage
|
getApp().globalData.orgNamePath = res.data.data
|
||||||
|
.orgNamePath
|
||||||
|
getApp().globalData.organizationSid = res.data
|
||||||
|
.data.organizationSid
|
||||||
|
getApp().globalData.headImage = res.data.data
|
||||||
|
.headImage
|
||||||
|
|
||||||
getApp().globalData.isLogin = true
|
getApp().globalData.isLogin = true
|
||||||
|
|
||||||
|
|||||||
22
pages.json
22
pages.json
@@ -15,7 +15,16 @@
|
|||||||
"scrollIndicator": false //禁用原生导航栏,
|
"scrollIndicator": false //禁用原生导航栏,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "pages/index/index",
|
||||||
|
"style": {
|
||||||
|
"navigationBarTitleText": "绑定账号",
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"app-plus": {
|
||||||
|
"scrollIndicator": false //禁用原生导航栏,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"globalStyle": {
|
"globalStyle": {
|
||||||
@@ -31,19 +40,10 @@
|
|||||||
"backgroundColor": "#ffffff",
|
"backgroundColor": "#ffffff",
|
||||||
"list": [{
|
"list": [{
|
||||||
"pagePath": "pages/card/card",
|
"pagePath": "pages/card/card",
|
||||||
"iconPath": "static/home_n.png",
|
|
||||||
"selectedIconPath": "static/home_s.png",
|
|
||||||
"text": "首页"
|
"text": "首页"
|
||||||
}, {
|
}, {
|
||||||
"pagePath": "pages/index/msg",
|
"pagePath": "pages/index/index",
|
||||||
"iconPath": "static/msg_n.png",
|
|
||||||
"selectedIconPath": "static/msg_s.png",
|
|
||||||
"text": "通知"
|
"text": "通知"
|
||||||
}, {
|
|
||||||
"pagePath": "pages/index/me",
|
|
||||||
"iconPath": "static/me_n.png",
|
|
||||||
"selectedIconPath": "static/me_s.png",
|
|
||||||
"text": "我的"
|
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
"uniIdRouter": {}
|
"uniIdRouter": {}
|
||||||
|
|||||||
@@ -19,10 +19,10 @@
|
|||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<view class="inputRow">
|
<!-- <view class="inputRow">
|
||||||
<image src="../../static/baseIcon/code.png" mode="aspectFill" class="drawableLeft"></image>
|
<image src="../../static/baseIcon/code.png" mode="aspectFill" class="drawableLeft"></image>
|
||||||
<input type="number" @input="codeText" maxlength="6" placeholder="请输入验证码" class="input" />
|
<input type="number" @input="codeText" maxlength="6" placeholder="请输入验证码" class="input" />
|
||||||
</view>
|
</view> -->
|
||||||
|
|
||||||
|
|
||||||
<view class="btn" @click="next">
|
<view class="btn" @click="next">
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isShow:true,
|
isShow: true,
|
||||||
// 状态栏高度
|
// 状态栏高度
|
||||||
statusBarHeight: 0,
|
statusBarHeight: 0,
|
||||||
// 导航栏高度
|
// 导航栏高度
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
mobile: '',
|
mobile: '',
|
||||||
openid: '',
|
openid: '',
|
||||||
code: '',
|
code: '',
|
||||||
unionid:""
|
unionid: ""
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -63,16 +63,6 @@
|
|||||||
created() {
|
created() {
|
||||||
//获取手机状态栏高度
|
//获取手机状态栏高度
|
||||||
this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
|
this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'];
|
||||||
|
|
||||||
this.$bus.$on('isShow', msg => {
|
|
||||||
//这里获取到http工具js文件中传过来的wholeSpin值
|
|
||||||
console.log("isShows>>>>>", msg)
|
|
||||||
|
|
||||||
this.isShow = msg
|
|
||||||
|
|
||||||
console.log("isShows>>>>>", this.isShow)
|
|
||||||
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
/* #ifdef MP-WEIXIN */
|
/* #ifdef MP-WEIXIN */
|
||||||
@@ -91,33 +81,33 @@
|
|||||||
var mobileLength = this.page.mobile.length;
|
var mobileLength = this.page.mobile.length;
|
||||||
var codeLength = this.page.code.length;
|
var codeLength = this.page.code.length;
|
||||||
if (mobileLength == 0) {
|
if (mobileLength == 0) {
|
||||||
this.Toast("请输入手机号")
|
uni.showToast({
|
||||||
return;
|
icon: 'error',
|
||||||
}
|
title: '手机号不能为空'
|
||||||
if (codeLength == 0) {
|
})
|
||||||
this.Toast("验证码不能为空")
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let _this = this
|
let _this = this
|
||||||
console.log('1111', _this.page)
|
console.log('1111', _this.page)
|
||||||
_this.$api.wxBindMobile(_this.page).then((resp) => {
|
_this.$api.wxBindMobile(_this.page).then((resp) => {
|
||||||
// if (resp.success) {
|
// if (resp.success) {
|
||||||
console.log('1111', resp)
|
console.log('1111', resp)
|
||||||
|
|
||||||
getApp().globalData.username = resp.userName
|
getApp().globalData.sid = resp
|
||||||
getApp().globalData.token = resp.token
|
// getApp().globalData.token = resp.token
|
||||||
getApp().globalData.sid = resp.sid
|
// getApp().globalData.sid = resp.sid
|
||||||
getApp().globalData.mobile = resp.mobile
|
// getApp().globalData.mobile = resp.mobile
|
||||||
getApp().globalData.isLogin = true
|
// getApp().globalData.isLogin = true
|
||||||
|
|
||||||
// _this.WritePreference("sysUserSid", res.data)
|
// _this.WritePreference("sysUserSid", res.data)
|
||||||
// _this.WritePreference("isLogin", true)
|
// _this.WritePreference("isLogin", true)
|
||||||
// getApp().globalData.isLogin = true
|
// getApp().globalData.isLogin = true
|
||||||
// getApp().globalData.sysUserSid = res.data
|
// getApp().globalData.sysUserSid = res.data
|
||||||
|
|
||||||
uni.navigateBack({
|
uni.switchTab({
|
||||||
delta: 10,
|
url: '/pages/card/card'
|
||||||
});
|
})
|
||||||
|
|
||||||
// uni.switchTab({
|
// uni.switchTab({
|
||||||
// url: '/pages/home/WorkFragment'
|
// url: '/pages/home/WorkFragment'
|
||||||
@@ -179,7 +169,7 @@
|
|||||||
send(e) { //发送验证码
|
send(e) { //发送验证码
|
||||||
console.log(e);
|
console.log(e);
|
||||||
this.isShow = e.success
|
this.isShow = e.success
|
||||||
console.log("this.isShow",this.isShow);
|
console.log("this.isShow", this.isShow);
|
||||||
|
|
||||||
},
|
},
|
||||||
codeText(e) {
|
codeText(e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user