|
|
@ -82,6 +82,29 @@ Object.defineProperty(Vue.prototype, '$yroute', { |
|
|
|
Vue.prototype.$VUE_APP_RESOURCES_URL = VUE_APP_RESOURCES_URL |
|
|
|
Vue.prototype.$VUE_APP_RESOURCES_URL = VUE_APP_RESOURCES_URL |
|
|
|
Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL |
|
|
|
Vue.prototype.$VUE_APP_API_URL = VUE_APP_API_URL |
|
|
|
Vue.component('cu-custom', cuCustom); |
|
|
|
Vue.component('cu-custom', cuCustom); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
|
|
|
|
// App平台编译的代码
|
|
|
|
|
|
|
|
Vue.prototype.$deviceType = 'app' |
|
|
|
|
|
|
|
store.commit('updateDevicetype', 'app') |
|
|
|
|
|
|
|
Vue.prototype.$platform = uni.getSystemInfoSync().platform |
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
|
|
|
|
// 微信小程序编译的代码
|
|
|
|
|
|
|
|
Vue.prototype.$deviceType = 'routine' |
|
|
|
|
|
|
|
store.commit('updateDevicetype', 'routine') |
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// !!! ps 不建议在 template 中使用 $deviceType 去判断当前环境,很有可能出现 $deviceType 为 undefined 导致判断出错的问题,可以在 script 模块中正常使用
|
|
|
|
|
|
|
|
// 建议通过 store 去获取 $deviceType 可以保证 template 中取到的值有效
|
|
|
|
|
|
|
|
// import { mapState, mapMutations, mapActions } from 'vuex';
|
|
|
|
|
|
|
|
// computed: {
|
|
|
|
|
|
|
|
// ...mapState(['$deviceType'])
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef H5
|
|
|
|
// #ifdef H5
|
|
|
|
// H5编译的代码
|
|
|
|
// H5编译的代码
|
|
|
|
|
|
|
|
|
|
|
@ -102,8 +125,6 @@ import { |
|
|
|
} from '@/libs/wechat' |
|
|
|
} from '@/libs/wechat' |
|
|
|
|
|
|
|
|
|
|
|
import { isWeixin } from '@/utils' |
|
|
|
import { isWeixin } from '@/utils' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const CACHE_KEY = "clear_0.0.1"; |
|
|
|
const CACHE_KEY = "clear_0.0.1"; |
|
|
|
|
|
|
|
|
|
|
|
if (!cookie.has(CACHE_KEY)) { |
|
|
|
if (!cookie.has(CACHE_KEY)) { |
|
|
@ -122,56 +143,36 @@ if (urlSpread !== undefined) { |
|
|
|
cookie.set("spread", urlSpread || 0); |
|
|
|
cookie.set("spread", urlSpread || 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vue.prototype.wechat = wechat |
|
|
|
async function init() { |
|
|
|
Vue.prototype.clearAuthStatus = clearAuthStatus |
|
|
|
|
|
|
|
Vue.prototype.oAuth = oAuth |
|
|
|
|
|
|
|
Vue.prototype.auth = auth |
|
|
|
|
|
|
|
Vue.prototype.toAuth = toAuth |
|
|
|
|
|
|
|
Vue.prototype.pay = pay |
|
|
|
|
|
|
|
Vue.prototype.openAddress = openAddress |
|
|
|
|
|
|
|
Vue.prototype.openShareAll = openShareAll |
|
|
|
|
|
|
|
Vue.prototype.openShareAppMessage = openShareAppMessage |
|
|
|
|
|
|
|
Vue.prototype.openShareTimeline = openShareTimeline |
|
|
|
|
|
|
|
Vue.prototype.wechatEvevt = wechatEvevt |
|
|
|
|
|
|
|
Vue.prototype.ready = ready |
|
|
|
|
|
|
|
Vue.prototype.wxShowLocation = wxShowLocation |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef H5
|
|
|
|
|
|
|
|
// H5编译的代码
|
|
|
|
// 判断是否是微信浏览器
|
|
|
|
// 判断是否是微信浏览器
|
|
|
|
if (isWeixin()) { |
|
|
|
if (isWeixin()) { |
|
|
|
Vue.prototype.$deviceType = 'weixin' |
|
|
|
Vue.prototype.$deviceType = 'weixin' |
|
|
|
store.commit('updateDevicetype', 'weixin') |
|
|
|
store.commit('updateDevicetype', 'weixin') |
|
|
|
let wechat = await wechat() |
|
|
|
let wechatInit = await wechat() |
|
|
|
if (wechat) { |
|
|
|
console.log(wechatInit) |
|
|
|
|
|
|
|
if (wechatInit) { |
|
|
|
await oAuth() |
|
|
|
await oAuth() |
|
|
|
|
|
|
|
app.$mount() |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Vue.prototype.$deviceType = 'weixinh5' |
|
|
|
Vue.prototype.$deviceType = 'weixinh5' |
|
|
|
store.commit('updateDevicetype', 'weixinh5') |
|
|
|
store.commit('updateDevicetype', 'weixinh5') |
|
|
|
} |
|
|
|
app.$mount() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef APP-PLUS
|
|
|
|
} |
|
|
|
// App平台编译的代码
|
|
|
|
|
|
|
|
Vue.prototype.$deviceType = 'app' |
|
|
|
|
|
|
|
store.commit('updateDevicetype', 'app') |
|
|
|
|
|
|
|
Vue.prototype.$platform = uni.getSystemInfoSync().platform |
|
|
|
|
|
|
|
// #endif
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
// #ifdef MP-WEIXIN
|
|
|
|
// #ifndef H5
|
|
|
|
// 微信小程序编译的代码
|
|
|
|
app.$mount() |
|
|
|
Vue.prototype.$deviceType = 'routine' |
|
|
|
|
|
|
|
store.commit('updateDevicetype', 'routine') |
|
|
|
|
|
|
|
// #endif
|
|
|
|
// #endif
|
|
|
|
|
|
|
|
|
|
|
|
// !!! ps 不建议在 template 中使用 $deviceType 去判断当前环境,很有可能出现 $deviceType 为 undefined 导致判断出错的问题,可以在 script 模块中正常使用
|
|
|
|
} |
|
|
|
// 建议通过 store 去获取 $deviceType 可以保证 template 中取到的值有效
|
|
|
|
|
|
|
|
// import { mapState, mapMutations, mapActions } from 'vuex';
|
|
|
|
|
|
|
|
// computed: {
|
|
|
|
|
|
|
|
// ...mapState(['$deviceType'])
|
|
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.$mount() |
|
|
|
init() |
|
|
|