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" 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`,

View File

@ -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'
}) })
} }
}) })

View File

@ -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: {
// //

View File

@ -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 {

View File

@ -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}`
}) })
}, },
}, },

View File

@ -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'
})
}, },
} }
} }

View File

@ -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 {}
} }
}, },
} }