1 files added
5 files modified
| | |
| | | uni.clearStorageSync() |
| | | uni.setStorageSync('userInfor', JSON.stringify(result.data)) |
| | | uni.setStorageSync('tonken', result.data.token) |
| | | uni.setStorageSync('openId', result.data.openId) |
| | | getDic() |
| | | this.$isResolve() |
| | | } else { |
| | |
| | | // import * as common from './utils/common' // 公共文件 |
| | | import store from './store/index.js' |
| | | import storage from './utils/storage' // 缓存文件 |
| | | import share from './utils/share.js' // 导入并挂载全局的分享方法 |
| | | import '.env.js' |
| | | // 定义全局 |
| | | Vue.prototype.$store = store |
| | |
| | | }) |
| | | app.$mount() |
| | | import uView from '@/uni_modules/uview-ui' |
| | | Vue.use(uView) |
| | | Vue.use(uView) |
| | | Vue.mixin(share) |
| | |
| | | console.log('option', option) |
| | | //option为object类型,会序列化上个页面传递的参数 |
| | | this.basicInfor = JSON.parse(option.infor) |
| | | this.share.title = '交办单信息' |
| | | }, |
| | | onBackPress(e) { |
| | | uni.navigateBack({ |
| | |
| | | this.showTabBar = data.data.showTabBar |
| | | this.$refs.agencyPage.getContaminateList() |
| | | }) |
| | | this.share.title = this.title |
| | | }, |
| | | methods: { |
| | | getData() { |
| | |
| | | if (index === 2) { |
| | | this.isShow = false |
| | | this.title = '我的' |
| | | this.share.title = this.title |
| | | } |
| | | if (index === 0) { |
| | | this.isShow = true |
| | | this.title = '首页' |
| | | this.share.title = this.title |
| | | this.$nextTick(() => { |
| | | this.getData() |
| | | }) |
| | |
| | | console.log('openId', value) |
| | | if (value) { |
| | | this.logining(value) |
| | | console.log('openId', openId) |
| | | } |
| | | }, |
| | | logining(openId) { |
New file |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | // 默认的全局分享内容(待测试) |
| | | share: { |
| | | title: '分享', |
| | | path: '/pages/index/index', // 全局分享的路径 |
| | | imageUrl: '', // 全局分享的图片(可本地可网络) |
| | | } |
| | | } |
| | | }, |
| | | // 定义全局分享 |
| | | // 1.发送给朋友 |
| | | onShareAppMessage(res) { |
| | | // 获取加载的页面 |
| | | let pages = getCurrentPages(), |
| | | // 获取当前页面的对象 |
| | | page = pages[pages.length - 1] |
| | | // console.log("获取加载的页面", pages); |
| | | this.share.path = `/${page.route}` |
| | | if (page.options.infor) { |
| | | this.share.path = `/${page.route}?infor=${page.options.infor}` |
| | | } |
| | | console.log('page.options', page.options) |
| | | return { |
| | | title: this.share.title, |
| | | path: this.share.path, |
| | | imageUrl: this.share.imageUrl, |
| | | } |
| | | }, |
| | | // //2.分享到朋友圈 |
| | | // onShareTimeline(res) { |
| | | // return { |
| | | // title: this.share.title, |
| | | // path: this.share.path, |
| | | // imageUrl: this.share.imageUrl, |
| | | // } |
| | | // }, |
| | | } |