This commit is contained in:
曹辉 2023-04-04 17:14:06 +08:00
parent fc4f260631
commit 1471a1f0fa
7 changed files with 113 additions and 87 deletions

View File

@ -1,13 +1,14 @@
import request from "../request.js"
//密码
export function appLogin(phonenumber, stationPersonPassword) {
//登录
export function getPersonWeChatUserInfo(loginCode, phoneCode) {
return request({
url: `/nurseApp/personLogin/appLogin?phonenumber=${phonenumber}&stationPersonPassword=${stationPersonPassword}`,
method: 'POST'
url: `/nurseApplet/personLogin/getPersonWeChatUserInfo?loginCode=${loginCode}&phoneCode=${phoneCode}`,
method: 'GET'
})
}
export function createMobileToken() {
return request({
url: `/nurseApplet/authorization/createMobileToken`,

View File

@ -16,9 +16,7 @@ var request = function(config) {
success(res) {
if (res.data.code == 9999) {
uni.removeStorageSync('token');
// uni.reLaunch({
// url: '/pages/login/login'
// })
uni.removeStorageSync('nursePersonId');
uni.showModal({
title: "登录提示",
content: '登录失效,请重新登录',
@ -29,13 +27,13 @@ var request = function(config) {
})
} else if (res1.cancel) {
uni.reLaunch({
url: '/pages/homepage/homepage'
url: '/pages/startup/startup'
})
}
},
fail(err1) {
uni.reLaunch({
url: '/pages/homepage/homepage'
url: '/pages/startup/startup'
})
}
})

View File

@ -9,29 +9,38 @@
<view class="top">
本月收益(
</view>
<view class="center">
<view class="center" v-if="toppricerlist.monthOrderTotalPrice>=0">
{{toppricerlist.monthOrderTotalPrice}}
</view>
<view class="center" v-else>
0
</view>
<view class="bottom">
<view class="bottomitem">
<view class="text">
今日收益()
</view>
<view class="price">
<view class="price" v-if="toppricerlist.todayOrderPrice>=0">
{{toppricerlist.todayOrderPrice}}
</view>
<view class="price" v-else>
0
</view>
</view>
<view class="bottomitem">
<view class="text">
累计总收益()
</view>
<view class="price">
<view class="price" v-if="toppricerlist.orderTotalPrice>=0">
{{toppricerlist.orderTotalPrice}}
</view>
<view class="price" v-else>
0
</view>
</view>
</view>
</view>
<view class="list">
<view class="list" v-if="Detailslist.length>0">
<view class="item" v-for="(item,index) in Detailslist" :key="index">
<view class="time">
{{item.serviceDate}} {{item.serviceStartTime}}
@ -45,6 +54,9 @@
</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'>
<view class="timemask">
<view class="tabs">
@ -81,7 +93,7 @@
},
data() {
return {
nursePersonId: 35, //id
nursePersonId: null, //id
tiemmask: false, //
timeparams: { //picker
year: true,
@ -108,9 +120,14 @@
};
},
onShow() {
this.nowtime();
this.personRevenueinfo();
this.personRevenueDetailsinfo();
var that = this
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nursePersonId = value
that.personRevenueinfo();
that.personRevenueDetailsinfo();
} else {}
that.nowtime();
},
methods: {
//

View File

@ -25,7 +25,7 @@
</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="title">
<view class="text">
@ -68,6 +68,9 @@
</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" />
</view>
</template>
@ -82,7 +85,7 @@
data() {
return {
baseurl: null,
nursePersonId: 35, //id
nursePersonId: null, //id
orderStatus: '', //COMPLETE NOT_FINISH
pageNum: 1,
pageSize: 10,
@ -180,11 +183,11 @@
onShow() { //
this.baseurl = baseurl
var that = this
// const value = uni.getStorageSync('nursePersonId');
// if (value) {
// that.nursePersonId = value
this.selectMissioninfo();
// }
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nursePersonId = value
that.selectMissioninfo();
} else {}
},
onReachBottom() { //
if (this.missionlist.length >= this.total) {} else {

View File

@ -12,69 +12,65 @@
</template>
<script>
import {
appLogin,
getPersonWeChatUserInfo,
createMobileToken
} from '@/api/login/index.js'
export default {
data() {
return {
checked: false,
phonenumber: '',
password: '',
userId: '',
phonecode: '',
logincode: '',
timer: null,
};
},
//
onLoad(options) {
if (options.phonenumber && options.password) {
this.phonenumber = options.phonenumber
this.password = options.password
}
},
onLoad(options) {},
methods: {
getPhoneNumberp(val) {
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();
}
});
}
},
login() {
var that = this
appLogin(this.phonenumber, this.password).then(res => {
console.log(res)
getPersonWeChatUserInfo(this.logincode, this.phonecode).then(res => {
if (res.code == 200) {
uni.setStorageSync("phonenumber", that.phonenumber)
uni.setStorageSync("password", that.password)
uni.setStorageSync("nursePersonId", res.data.nursePersonId)
that.$refs.uToast.show({
uni.setStorageSync("nursePersonId", res.data.nurseStationPersonId)
this.$refs.uToast.show({
title: '登录成功',
type: 'success',
duration: '1500'
})
setTimeout(() => {
uni.reLaunch({
url: '/pages/homepage/homepage',
if (this.timer) {
clearTimeout(this.timer)
}
this.timer = setTimeout(e => {
uni.navigateBack({
delta: 1
})
}, 1500);
}, 500)
} else {
that.$refs.uToast.show({
title: res.msg,
type: 'error'
this.$refs.uToast.show({
title: '登录失败',
type: 'error',
duration: '1500'
})
}
})
},
//
pwdlogin() {
uni.removeStorageSync('token');
var that = this
createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token)
that.login();
})
},
//
goregister() {
uni.navigateTo({
url: '/pages/register/register'
})
},
forgetpassword() {
uni.navigateTo({
url: `/pages/forgotPassword/forgotPassword?phonenumber=${this.phonenumber}`
that.login()
})
},
},

View File

@ -86,7 +86,7 @@
data() {
return {
beijingurl: null, //
nursePersonId: 34, //id
nursePersonId: null, //id
baseurl: null, //url
Personallist: null, //
}
@ -95,25 +95,30 @@
this.beijingurl = baseurl + '/profile/nursePersonAppletPicture/person_center.png'
this.baseurl = baseurl;
let that = this
// const value = uni.getStorageSync('nursePersonId');
// if (value) {
// this.nursePersonId = value
that.myInfo()
// }
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nursePersonId = value
that.myInfo()
} else {}
},
onLoad(options) {},
methods: {
//
tapstatus(item) {
var obj = {
id: this.nursePersonId,
workStatus: item
}
updateNursePersonWorkStatus(obj).then(res => {
if (res.code == 200) {
this.myInfo()
const value = uni.getStorageSync('nursePersonId');
if (value) {
var obj = {
id: this.nursePersonId,
workStatus: item
}
})
updateNursePersonWorkStatus(obj).then(res => {
if (res.code == 200) {
this.myInfo()
}
})
} else {
this.gologin();
}
},
myInfo() {
nurseAppletPersonCenter(this.nursePersonId).then(res => {
@ -133,11 +138,6 @@
}
})
},
updatainfo() {
uni.navigateTo({
url: `/pages/Modifyinformation/Modifyinformation`
})
},
//
gologin() {
uni.navigateTo({
@ -152,8 +152,22 @@
},
//
goMyBenefits() {
uni.navigateTo({
url: '/pages/MyBenefits/MyBenefits'
const value = uni.getStorageSync('nursePersonId');
if (value) {
uni.navigateTo({
url: '/pages/MyBenefits/MyBenefits'
})
} else {
this.gologin();
}
},
//
gologin() {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
url: '/pages/login/login'
})
},
}

View File

@ -2,7 +2,7 @@
<view class="app">
<image src="../../static/logo.png" mode=""></image>
<view class="title">
泉医到家
泉医助手
</view>
<u-toast ref="uToast" />
</view>
@ -30,9 +30,6 @@
url: '/pages/homepage/homepage',
})
}, 2000);
// const value = uni.getStorageSync('phonenumber');
// const value2 = uni.getStorageSync('password');
// if (value && value2) {} else {}
}
},
}