| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- const LOGIN_LIST = ['pages/mine/mine']
- /*
- * 全局注入器
- */
- let page = {
- data() {
- return {
- }
- },
- computed: {
- //ios底部安全区域
- safeAreaBottom() {
- let info = uni.getSystemInfoSync()
- let safe = 20
- if (
- info && ['devtools', 'ios'].includes(info.platform) &&
- info.statusBarHeight > safe
- ) {
- return info.statusBarHeight - safe + 'px'
- }
- return 0
- },
- formatTime(){
- return (data,format='yyyy-mm-dd')=>{
- // yyyy-mm-dd hh:MM:ss
- return this.$u.timeFormat(this.$dateTime.getTime(data),format)
- }
- },
- numberNull(){
- return data=>{
- if (data == -1 || this.$isEmpty(data)) {
- return 0
- }
- return data
- }
- }
- },
- onLoad(options) {
- },
- onShow() {
- let currentPage = this.$util.getCurrentRoute()
- if (LOGIN_LIST.includes(currentPage)) {
- this.login()
- }
- },
- methods: {
- init(){
- console.log("登录成功,初始化数");
- },
- // 登录 begin
- showLogin(notToast=false) {
- this.$refs.login.show(notToast)
- },
- signIn(resp) {
- //获取数据
- this.init()
- },
- async login(e) {
- if (this.$isEmpty(this.vuex_userId)) {
- this.showLogin()
- return
- }
- //获取数据
- this.init()
- //获取手机号
- if (this.$isEmpty(this.vuex_phone)&&this.$config.isAuthPhone) {
- this.$refs.login.showPhoneModal()
- }
- },
- async checkIsCmcc(){
- if (this.$isEmpty(this.vuex_phone)) {
- return
- }
- let params={
- phone:this.vuex_phone
- }
- let res=await this.$api.CMCC.isCMCC(params)
- console.log(res,"res....");
- return res.data.data
- },
- phoneSuccess(){
- console.log('手机号获取成功>>>>>>>>');
- },
- // 登录 end
- },
- }
- export default page
|