Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
shidongli 2023-09-22 15:26:52 +08:00
commit 65694347aa
7 changed files with 317 additions and 86 deletions

View File

@ -32,7 +32,7 @@
行为积分
</view>
</view>
<view class="item" @tap='gohealthybeans'>
<view class="item" @tap='gointegral'>
<view class="number">
0
</view>
@ -148,12 +148,44 @@
</template>
<script>
import {
mapActions
} from "vuex";
import {
appPersonal,
} from '@/api/pages/myinformation/myinformation.js';
import {
existPatientInfo
} from '@/api/pages/startup/index.js'
import {
createMobileToken
} from '@/api/pages/login/index.js'
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
baseurl: '',
appPersonallist: null, //
timer: null,
list: {},
// bjimg: '',
};
},
onShow() {
// this.bjimg = baseurl + '/profile/appletPicture/inviteFriendsOne.png'
let that = this
this.baseurl = baseurl
this.myInfo()
const value = uni.getStorageSync('patientId');
if (value) {} else {
that.appPersonallist = null
that.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
})
}
},
methods: {
//
goorder(index, item) {
@ -186,14 +218,150 @@
url: '/pagesB/managefamily/managefamily'
})
},
gocoupon() {
uni.navigateTo({
url: '/pagesB/coupon/coupon'
gohealthybeans() {
uni.navigateTo({})
},
remove() {
let that = this
const value = uni.getStorageSync('patientId');
if (value) {
uni.showModal({
title: '提示',
content: '确认要退出此账号吗',
success: function(res) {
if (res.confirm) {
uni.clearStorageSync();
that.$refs.uToast.show({
title: '退出账号成功',
type: 'success',
duration: '1000'
})
createMobileToken().then(res => {
uni.setStorageSync("token", res.data.token)
})
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.switchTab({
url: '/pages/homepage/homepage'
})
}, 1000)
}
}
});
} else {
that.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000'
})
}
},
removes() {
this.appPersonallist = null
uni.removeStorageSync('patientId');
uni.removeStorageSync('openid');
uni.removeStorageSync('phone');
uni.removeStorageSync('Refresh');
uni.navigateBack({
delta: 1
})
},
gohealthybeans() {
//
myInfo() {
var that = this
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
existPatientInfo(value).then(res => {
if (res.code == 200 && res.msg == 'LOGIN') {
appPersonal(value2).then(Response => {
if (Response.code == 200) {
that.appPersonallist = Response.data
if (!that.appPersonallist.integral) {
that.appPersonallist.integral = 0
}
that.appPersonallist.homeLatitude = Number(that.appPersonallist
.homeLatitude)
that.appPersonallist.homeLongitude = Number(that.appPersonallist
.homeLongitude)
} else if (Response.code == 9999) {} else {
that.removes();
}
})
} else {
that.removes();
}
})
} else {
that.removes();
}
},
updatainfo() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: `/pages/modify/modify`
})
} else {
this.gologin();
}
},
//
gonursestation() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/Nursingstationserviceorder/Nursingstationserviceorder'
})
} else {
this.gologin();
}
},
//
gologin() {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
url: '/pages/login/login'
})
},
//
gocoupon() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/coupon/coupon'
})
} else {
this.gologin();
}
},
//
...mapActions(["integralopenPopup"]),
gointegral() {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
// this.integralopenPopup();
setTimeout(e => {
uni.navigateTo({
url: `/pagesB/healthybeans/healthybeans?integral=${this.appPersonallist.integral}`
})
}, 0)
} else {
this.gologin();
}
},
//
goHealthrecords() {
uni.navigateTo({
url: '/pagesB/healthybeans/healthybeans'
url: '/pages/Healthrecords/Healthrecords'
})
},
}

View File

@ -183,22 +183,22 @@
</view>
</template>
<script>
// import {
// signIn,
// selectPatientSignIn,
// selectExchangeGoods,
// integralGoodsOrder
// } from '@/api/integral/index.js'
// import {
// inviteFriends
// } from '@/api/Personal/Personal.js';
// import {
// goodPatientInfo
// } from '@/api/modifyAddress/modifyAddress.js';
// import {
// AppIdentification
// } from '@/api/AppIdentification/index.js'
import baseurl from '../../api/baseurl';
import {
signIn,
selectPatientSignIn,
selectExchangeGoods,
integralGoodsOrder
} from '@/api/pagesB/integral/index.js'
import {
inviteFriends
} from '@/api/pages/myinformation/myinformation.js';
import {
goodPatientInfo
} from '@/api/pagesB/modifyAddress/modifyAddress.js';
import {
AppIdentification
} from '@/api/pagesB/AppIdentification/index.js'
import baseurl from '@/api/baseurl';
import rCanvas from "@/components/r-canvas/r-canvas.vue"
export default {
components: {
@ -255,63 +255,63 @@
};
},
onLoad(options) {},
// onShow() {
// this.baseurl = baseurl
// this.pageNum = 1
// this.selectExchangeGoodsinfo();
// this.baseurl = baseurl
// this.yapqingbeijingimg = baseurl + '/profile/appletPicture/inviteFriendsTwo.png'
// var that = this
// const value = uni.getStorageSync('patientId');
// if (value) {
// that.patientId = value
// that.updata.patientId = value
// that.selectPatientSignInifo();
// that.user();
// AppIdentification(value).then(res => {
// if (res.code == 200) {
// if (res.data.loginFlag) {
// that.loginFlag = true
// }
// }
// })
// goodPatientInfo(value).then(res => {
// if (res.code == 200) {
// if (res.data.length > 0) {
// var user = res.data.filter(e => e.id == that.userid)
// if (user.length >= 1) {
// that.updata.receiver = user[0].receiveName
// that.updata.receiveAddress = user[0].areaName + user[0].receiveAddress
// that.updata.phone = user[0].receivePhone
// that.userid = user[0].id
// } else {
// that.updata.receiver = res.data[0].receiveName
// that.updata.receiveAddress = res.data[0].areaName + res.data[0].receiveAddress
// that.updata.phone = res.data[0].receivePhone
// that.userid = res.data[0].id
// }
// }
// }
// })
// } else {
// that.$refs.uToast.show({
// title: ',',
// type: 'error',
// duration: '2000',
// })
// }
// let useritem = null
// uni.$on('updata', function(data) {
// if (data.useritem) {
// useritem = JSON.parse(data.useritem)
// that.updata.receiver = useritem.receiveName
// that.updata.phone = useritem.receivePhone
// that.updata.receiveAddress = useritem.areaName + useritem.receiveAddress
// that.userid = useritem.id
// }
// uni.$off('updata')
// })
// },
onShow() {
this.baseurl = baseurl
this.pageNum = 1
this.selectExchangeGoodsinfo();
this.baseurl = baseurl
this.yapqingbeijingimg = baseurl + '/profile/appletPicture/inviteFriendsTwo.png'
var that = this
const value = uni.getStorageSync('patientId');
if (value) {
that.patientId = value
that.updata.patientId = value
that.selectPatientSignInifo();
that.user();
AppIdentification(value).then(res => {
if (res.code == 200) {
if (res.data.loginFlag) {
that.loginFlag = true
}
}
})
goodPatientInfo(value).then(res => {
if (res.code == 200) {
if (res.data.length > 0) {
var user = res.data.filter(e => e.id == that.userid)
if (user.length >= 1) {
that.updata.receiver = user[0].receiveName
that.updata.receiveAddress = user[0].areaName + user[0].receiveAddress
that.updata.phone = user[0].receivePhone
that.userid = user[0].id
} else {
that.updata.receiver = res.data[0].receiveName
that.updata.receiveAddress = res.data[0].areaName + res.data[0].receiveAddress
that.updata.phone = res.data[0].receivePhone
that.userid = res.data[0].id
}
}
}
})
} else {
that.$refs.uToast.show({
title: '未登录,请先登录',
type: 'error',
duration: '2000',
})
}
let useritem = null
uni.$on('updata', function(data) {
if (data.useritem) {
useritem = JSON.parse(data.useritem)
that.updata.receiver = useritem.receiveName
that.updata.phone = useritem.receivePhone
that.updata.receiveAddress = useritem.areaName + useritem.receiveAddress
that.userid = useritem.id
}
uni.$off('updata')
})
},
methods: {
yaoqingshowtrue() {
this.yaoqingshow = true
@ -654,4 +654,4 @@
<style lang="scss">
@import "./healthybeans.scss";
</style>
</style>

View File

@ -191,7 +191,7 @@
} from '@/api/pagesB/integral/index.js'
import {
inviteFriends
} from '@/api/pagesB/Personal/Personal.js';
} from '@/api/pages/myinformation/myinformation.js';
import {
goodPatientInfo
} from '@/api/pagesB/modifyAddress/modifyAddress.js';

View File

@ -229,7 +229,7 @@
if (res.data.loginFlag) {
that.usershow = false
uni.navigateTo({
url: `/pages/confirmation/confirmation?price=${item.consultingFee}&hospitalPersonId=${item.id}&&personName=${item.personName}`
url: `/pagesB/confirmation/confirmation?price=${item.consultingFee}&hospitalPersonId=${item.id}&&personName=${item.personName}`
})
} else {
that.usershow = true
@ -254,7 +254,7 @@
goinformation() {
this.usershow = false
uni.navigateTo({
url: '/pages/information/information'
url: '/pagesB/information/information'
})
},
goConsultationDetails() {

View File

@ -112,7 +112,7 @@
import baseurl from '@/api/baseurl.js'
import {
appPersonal,
} from '@/api/pagesB/Personal/Personal.js';
} from '@/api/pages/myinformation/myinformation.js';
import {
getSubordinateRegions,
} from '@/api/pagesB/modifyAddress/modifyAddress.js';
@ -434,4 +434,4 @@
<style lang="scss">
@import "./modify.scss"
</style>
</style>

63
store/index.js Normal file
View File

@ -0,0 +1,63 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const store = new Vuex.Store({
state: {
//公共的变量这里的变量不能随便修改只能通过触发mutations的方法才能改变
},
mutations: {
//相当于同步的操作
//点击确认
subscribesuccess(state) {
wx.requestSubscribeMessage({
tmplIds: [
'-IxZeEkkXFhoSwGtBHbipKQ6kjEmkdTkswKeOypSsNQ',
'e1JRZaw1OfTz2b6X9DTqqaJtV4rXEt7uhwXoZLDb_eA',
'nUB9HRbqQXOVuTpkKBIHMgzWlNq6touzxf5QYBiMkbU',
],
success(res) {},
fail(err) {},
complete(scc) {}
})
},
integralsubscribesuccess(state) {
wx.requestSubscribeMessage({
tmplIds: [
'S_c9bR4znSWpXg-6ACIMn7AkaR11dzo113XM8w4CKz0'
],
success(res) {},
fail(err) {},
complete(scc) {}
})
},
},
actions: {
//相当于异步的操作,不能直接改变state的值只能通过触发mutations的方法才能改变
integralopenPopup(contxt) {
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
wx.getSetting({
withSubscriptions: true, // 是否获取用户订阅消息的订阅状态默认false不返回
success(res) {
if (res.authSetting['scope.subscribeMessage']) {} else {
//因为没有选择总是保持,所以需要调起授权弹窗再次授权
contxt.commit('integralsubscribesuccess')
}
}
})
},
// 是否设置过授权
openPopup(contxt) {
// 获取用户的当前设置,判断是否点击了“总是保持以上,不在询问”
wx.getSetting({
withSubscriptions: true, // 是否获取用户订阅消息的订阅状态默认false不返回
success(res) {
if (res.authSetting['scope.subscribeMessage']) {} else {
//因为没有选择总是保持,所以需要调起授权弹窗再次授权
contxt.commit('subscribesuccess')
}
}
})
},
}
})
export default store