| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- /*
- * 全局注入器
- */
- let page = {
- data() {
- return {
-
- }
- },
- methods: {
-
- },
- onLoad(options) {
- if (!this.$u.test.isEmpty(options.activityId)) {
- console.log("**********************activityId",options.activityId);
- this.$u.api.activity.detail({id: options.activityId}).then(res => {
- let userId=uni.getStorageSync("userId")
- console.log("**********************userId",userId);
- if (!this.$u.test.isEmpty(userId)) {
- let link=window.location.href
- if (link.indexOf("?")!=-1) {
- link=link+"&agenterId="+userId
- }else{
- link=link+"?agenterId="+userId
- }
- let obj={
- link,
- title:res.shareTitle,
- desc:res.shareDesc,
- imgUrl: res.shareImg
- }
- console.log("**********************obj",obj);
- this.$shareConfig(obj,this)
- }
- if (!this.$u.test.isEmpty(options.agenterId)) {
- uni.setStorageSync("agenterId",options.agenterId)
- let url=window.location.href
- let len=url.indexOf("agenterId=")-1
- let tmp= url.substring(0,len)
- window.location.href=tmp
- }
- })
- }else{
- let userId=uni.getStorageSync("userId")
- if (!this.$u.test.isEmpty(userId)) {
- let link=window.location.href
- if (link.indexOf("?")!=-1) {
- link=link+"&agenterId="+userId
- }else{
- link=link+"?agenterId="+userId
- }
- let obj={
- link,
- title: '',
- desc: link,
- }
- this.$shareConfig(obj,this)
- }
- if (!this.$u.test.isEmpty(options.agenterId)) {
- uni.setStorageSync("agenterId",options.agenterId)
- }
- }
- }
- }
- export default page
|