修改
This commit is contained in:
parent
fc4f260631
commit
1471a1f0fa
@ -1,13 +1,14 @@
|
|||||||
import request from "../request.js"
|
import request from "../request.js"
|
||||||
|
|
||||||
//密码
|
//登录
|
||||||
export function appLogin(phonenumber, stationPersonPassword) {
|
export function getPersonWeChatUserInfo(loginCode, phoneCode) {
|
||||||
return request({
|
return request({
|
||||||
url: `/nurseApp/personLogin/appLogin?phonenumber=${phonenumber}&stationPersonPassword=${stationPersonPassword}`,
|
url: `/nurseApplet/personLogin/getPersonWeChatUserInfo?loginCode=${loginCode}&phoneCode=${phoneCode}`,
|
||||||
method: 'POST'
|
method: 'GET'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function createMobileToken() {
|
export function createMobileToken() {
|
||||||
return request({
|
return request({
|
||||||
url: `/nurseApplet/authorization/createMobileToken`,
|
url: `/nurseApplet/authorization/createMobileToken`,
|
||||||
|
|||||||
@ -16,9 +16,7 @@ var request = function(config) {
|
|||||||
success(res) {
|
success(res) {
|
||||||
if (res.data.code == 9999) {
|
if (res.data.code == 9999) {
|
||||||
uni.removeStorageSync('token');
|
uni.removeStorageSync('token');
|
||||||
// uni.reLaunch({
|
uni.removeStorageSync('nursePersonId');
|
||||||
// url: '/pages/login/login'
|
|
||||||
// })
|
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: "登录提示",
|
title: "登录提示",
|
||||||
content: '登录失效,请重新登录',
|
content: '登录失效,请重新登录',
|
||||||
@ -29,13 +27,13 @@ var request = function(config) {
|
|||||||
})
|
})
|
||||||
} else if (res1.cancel) {
|
} else if (res1.cancel) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/homepage/homepage'
|
url: '/pages/startup/startup'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fail(err1) {
|
fail(err1) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/homepage/homepage'
|
url: '/pages/startup/startup'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -9,29 +9,38 @@
|
|||||||
<view class="top">
|
<view class="top">
|
||||||
本月收益(元)
|
本月收益(元)
|
||||||
</view>
|
</view>
|
||||||
<view class="center">
|
<view class="center" v-if="toppricerlist.monthOrderTotalPrice>=0">
|
||||||
{{toppricerlist.monthOrderTotalPrice}}
|
{{toppricerlist.monthOrderTotalPrice}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="center" v-else>
|
||||||
|
0
|
||||||
|
</view>
|
||||||
<view class="bottom">
|
<view class="bottom">
|
||||||
<view class="bottomitem">
|
<view class="bottomitem">
|
||||||
<view class="text">
|
<view class="text">
|
||||||
今日收益(元)
|
今日收益(元)
|
||||||
</view>
|
</view>
|
||||||
<view class="price">
|
<view class="price" v-if="toppricerlist.todayOrderPrice>=0">
|
||||||
{{toppricerlist.todayOrderPrice}}
|
{{toppricerlist.todayOrderPrice}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="price" v-else>
|
||||||
|
0
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="bottomitem">
|
<view class="bottomitem">
|
||||||
<view class="text">
|
<view class="text">
|
||||||
累计总收益(元)
|
累计总收益(元)
|
||||||
</view>
|
</view>
|
||||||
<view class="price">
|
<view class="price" v-if="toppricerlist.orderTotalPrice>=0">
|
||||||
{{toppricerlist.orderTotalPrice}}
|
{{toppricerlist.orderTotalPrice}}
|
||||||
</view>
|
</view>
|
||||||
|
<view class="price" v-else>
|
||||||
|
0
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="list">
|
</view>
|
||||||
|
<view class="list" v-if="Detailslist.length>0">
|
||||||
<view class="item" v-for="(item,index) in Detailslist" :key="index">
|
<view class="item" v-for="(item,index) in Detailslist" :key="index">
|
||||||
<view class="time">
|
<view class="time">
|
||||||
{{item.serviceDate}} {{item.serviceStartTime}}
|
{{item.serviceDate}} {{item.serviceStartTime}}
|
||||||
@ -45,6 +54,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="" style="margin-top: 100rpx;">
|
||||||
|
<u-empty text="暂无收益详细" mode="list" icon-size='240' font-size='32'></u-empty>
|
||||||
|
</view>
|
||||||
<u-popup v-model="tiemmask" mode='bottom' :closeable='true' :safe-area-inset-bottom='true'>
|
<u-popup v-model="tiemmask" mode='bottom' :closeable='true' :safe-area-inset-bottom='true'>
|
||||||
<view class="timemask">
|
<view class="timemask">
|
||||||
<view class="tabs">
|
<view class="tabs">
|
||||||
@ -81,7 +93,7 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
nursePersonId: 35, //护理员id
|
nursePersonId: null, //护理员id
|
||||||
tiemmask: false, //遮罩层
|
tiemmask: false, //遮罩层
|
||||||
timeparams: { //时间picker
|
timeparams: { //时间picker
|
||||||
year: true,
|
year: true,
|
||||||
@ -108,9 +120,14 @@
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.nowtime();
|
var that = this
|
||||||
this.personRevenueinfo();
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
this.personRevenueDetailsinfo();
|
if (value) {
|
||||||
|
that.nursePersonId = value
|
||||||
|
that.personRevenueinfo();
|
||||||
|
that.personRevenueDetailsinfo();
|
||||||
|
} else {}
|
||||||
|
that.nowtime();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//收益详细
|
//收益详细
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="items">
|
<view class="items" v-if="missionlist.length>0">
|
||||||
<view class="item" v-for="(item,index) in missionlist" @click.stop='gotaskDetails(item)'>
|
<view class="item" v-for="(item,index) in missionlist" @click.stop='gotaskDetails(item)'>
|
||||||
<view class="title">
|
<view class="title">
|
||||||
<view class="text">
|
<view class="text">
|
||||||
@ -68,6 +68,9 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
<view v-else class="" style="margin-top: 100rpx;">
|
||||||
|
<u-empty text="暂无工单" mode="list" icon-size='240' font-size='32'></u-empty>
|
||||||
|
</view>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
@ -82,7 +85,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
baseurl: null,
|
baseurl: null,
|
||||||
nursePersonId: 35, //护理员id
|
nursePersonId: null, //护理员id
|
||||||
orderStatus: '', //COMPLETE 已完成 NOT_FINISH 未完成
|
orderStatus: '', //COMPLETE 已完成 NOT_FINISH 未完成
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
@ -180,11 +183,11 @@
|
|||||||
onShow() { //加载的时候执行(没有次数限制)
|
onShow() { //加载的时候执行(没有次数限制)
|
||||||
this.baseurl = baseurl
|
this.baseurl = baseurl
|
||||||
var that = this
|
var that = this
|
||||||
// const value = uni.getStorageSync('nursePersonId');
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
// if (value) {
|
if (value) {
|
||||||
// that.nursePersonId = value
|
that.nursePersonId = value
|
||||||
this.selectMissioninfo();
|
that.selectMissioninfo();
|
||||||
// }
|
} else {}
|
||||||
},
|
},
|
||||||
onReachBottom() { //下滑加载
|
onReachBottom() { //下滑加载
|
||||||
if (this.missionlist.length >= this.total) {} else {
|
if (this.missionlist.length >= this.total) {} else {
|
||||||
|
|||||||
@ -12,69 +12,65 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
appLogin,
|
getPersonWeChatUserInfo,
|
||||||
createMobileToken
|
createMobileToken
|
||||||
} from '@/api/login/index.js'
|
} from '@/api/login/index.js'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
checked: false,
|
phonecode: '',
|
||||||
phonenumber: '',
|
logincode: '',
|
||||||
password: '',
|
timer: null,
|
||||||
userId: '',
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
//获取到传值
|
//获取到传值
|
||||||
onLoad(options) {
|
onLoad(options) {},
|
||||||
if (options.phonenumber && options.password) {
|
methods: {
|
||||||
this.phonenumber = options.phonenumber
|
getPhoneNumberp(val) {
|
||||||
this.password = options.password
|
let that = this;
|
||||||
|
if (val.detail.code) {
|
||||||
|
that.phonecode = val.detail.code
|
||||||
|
wx.login({
|
||||||
|
provider: 'weixin',
|
||||||
|
success: function(loginRes) {
|
||||||
|
that.logincode = loginRes.code
|
||||||
|
that.pwdlogin();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
|
||||||
login() {
|
login() {
|
||||||
var that = this
|
getPersonWeChatUserInfo(this.logincode, this.phonecode).then(res => {
|
||||||
appLogin(this.phonenumber, this.password).then(res => {
|
|
||||||
console.log(res)
|
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
uni.setStorageSync("phonenumber", that.phonenumber)
|
uni.setStorageSync("nursePersonId", res.data.nurseStationPersonId)
|
||||||
uni.setStorageSync("password", that.password)
|
this.$refs.uToast.show({
|
||||||
uni.setStorageSync("nursePersonId", res.data.nursePersonId)
|
|
||||||
that.$refs.uToast.show({
|
|
||||||
title: '登录成功',
|
title: '登录成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
duration: '1500'
|
duration: '1500'
|
||||||
})
|
})
|
||||||
setTimeout(() => {
|
if (this.timer) {
|
||||||
uni.reLaunch({
|
clearTimeout(this.timer)
|
||||||
url: '/pages/homepage/homepage',
|
}
|
||||||
|
this.timer = setTimeout(e => {
|
||||||
|
uni.navigateBack({
|
||||||
|
delta: 1
|
||||||
})
|
})
|
||||||
}, 1500);
|
}, 500)
|
||||||
} else {
|
} else {
|
||||||
that.$refs.uToast.show({
|
this.$refs.uToast.show({
|
||||||
title: res.msg,
|
title: '登录失败',
|
||||||
type: 'error'
|
type: 'error',
|
||||||
|
duration: '1500'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//密码登录
|
|
||||||
pwdlogin() {
|
pwdlogin() {
|
||||||
|
uni.removeStorageSync('token');
|
||||||
var that = this
|
var that = this
|
||||||
createMobileToken().then(res => {
|
createMobileToken().then(res => {
|
||||||
uni.setStorageSync("token", res.data.token)
|
uni.setStorageSync("token", res.data.token)
|
||||||
that.login();
|
that.login()
|
||||||
})
|
|
||||||
},
|
|
||||||
//跳转注册页
|
|
||||||
goregister() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/register/register'
|
|
||||||
})
|
|
||||||
},
|
|
||||||
forgetpassword() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/forgotPassword/forgotPassword?phonenumber=${this.phonenumber}`
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -86,7 +86,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
beijingurl: null, //背景
|
beijingurl: null, //背景
|
||||||
nursePersonId: 34, //护理员id
|
nursePersonId: null, //护理员id
|
||||||
baseurl: null, //url
|
baseurl: null, //url
|
||||||
Personallist: null, //获取个人信息
|
Personallist: null, //获取个人信息
|
||||||
}
|
}
|
||||||
@ -95,16 +95,18 @@
|
|||||||
this.beijingurl = baseurl + '/profile/nursePersonAppletPicture/person_center.png'
|
this.beijingurl = baseurl + '/profile/nursePersonAppletPicture/person_center.png'
|
||||||
this.baseurl = baseurl;
|
this.baseurl = baseurl;
|
||||||
let that = this
|
let that = this
|
||||||
// const value = uni.getStorageSync('nursePersonId');
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
// if (value) {
|
if (value) {
|
||||||
// this.nursePersonId = value
|
that.nursePersonId = value
|
||||||
that.myInfo()
|
that.myInfo()
|
||||||
// }
|
} else {}
|
||||||
},
|
},
|
||||||
onLoad(options) {},
|
onLoad(options) {},
|
||||||
methods: {
|
methods: {
|
||||||
//点击状态
|
//点击状态
|
||||||
tapstatus(item) {
|
tapstatus(item) {
|
||||||
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
|
if (value) {
|
||||||
var obj = {
|
var obj = {
|
||||||
id: this.nursePersonId,
|
id: this.nursePersonId,
|
||||||
workStatus: item
|
workStatus: item
|
||||||
@ -114,6 +116,9 @@
|
|||||||
this.myInfo()
|
this.myInfo()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.gologin();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
myInfo() {
|
myInfo() {
|
||||||
nurseAppletPersonCenter(this.nursePersonId).then(res => {
|
nurseAppletPersonCenter(this.nursePersonId).then(res => {
|
||||||
@ -133,11 +138,6 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
updatainfo() {
|
|
||||||
uni.navigateTo({
|
|
||||||
url: `/pages/Modifyinformation/Modifyinformation`
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//跳登录
|
//跳登录
|
||||||
gologin() {
|
gologin() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
@ -152,9 +152,23 @@
|
|||||||
},
|
},
|
||||||
//我的收益
|
//我的收益
|
||||||
goMyBenefits() {
|
goMyBenefits() {
|
||||||
|
const value = uni.getStorageSync('nursePersonId');
|
||||||
|
if (value) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/MyBenefits/MyBenefits'
|
url: '/pages/MyBenefits/MyBenefits'
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.gologin();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//去登陆
|
||||||
|
gologin() {
|
||||||
|
this.$refs.uToast.show({
|
||||||
|
title: '您未登录,请先登录',
|
||||||
|
type: 'error',
|
||||||
|
duration: '1000',
|
||||||
|
url: '/pages/login/login'
|
||||||
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<view class="app">
|
<view class="app">
|
||||||
<image src="../../static/logo.png" mode=""></image>
|
<image src="../../static/logo.png" mode=""></image>
|
||||||
<view class="title">
|
<view class="title">
|
||||||
泉医到家
|
泉医助手
|
||||||
</view>
|
</view>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
</view>
|
</view>
|
||||||
@ -30,9 +30,6 @@
|
|||||||
url: '/pages/homepage/homepage',
|
url: '/pages/homepage/homepage',
|
||||||
})
|
})
|
||||||
}, 2000);
|
}, 2000);
|
||||||
// const value = uni.getStorageSync('phonenumber');
|
|
||||||
// const value2 = uni.getStorageSync('password');
|
|
||||||
// if (value && value2) {} else {}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user