Commit 268c6669 authored by wangxuelai's avatar wangxuelai

'分享海报生成日签修改未完成成长记录和成就海报'

parent d7363f84
import {
LocalStorage,
scenQueryGet
scenQueryGet,
newScenQueryGet
} from '../../../utilities/index.js';
import {
userShow,
......@@ -45,14 +46,23 @@ Page({
*/
onLoad: function (options) {
if (options.scene) {
let sceneQuery = scenQueryGet(options.scene);
const {t, ctd, d,p} = sceneQuery;
this.setData({
tid: t,
consumerId: ctd,
d: d || '',
p:p || ''
})
let sceneQuery = newScenQueryGet(options.scene);
if (sceneQuery.type == 1) {
const {t, ctd, d,p} = sceneQuery.queryObj;
this.setData({
tid: t,
consumerId: ctd,
d: d || '',
p:p || ''
})
} else if (sceneQuery.type == 2) {
this.setData({
tid: sceneQuery.queryObj[2],
consumerId: sceneQuery.queryObj[1],
d: '',
p: sceneQuery.queryObj[0]
})
}
} else {
const {
tid,
......@@ -65,6 +75,7 @@ Page({
d: d || ''
})
}
console.log(this.data.p, this.data.p);
this.getThemeDetail();
},
......@@ -121,7 +132,7 @@ Page({
},
getThemeDetail () {
wx.showLoading();
if(this.data.p){
if(this.data.p != 0){
unlockmodesdetail( this.data.tid).then((res) => {
const {code, data} = res;
wx.hideLoading();
......@@ -228,7 +239,7 @@ Page({
}
},
goThemeIndex () {
if(this.data.p){
if(this.data.p != 0){
wx.reLaunch({
url: `/src/pages/morethemeindex/index?id=${this.data.themeDetail.class_id}&tid=${this.data.tid}`
})
......
......@@ -28,7 +28,8 @@ import {
audioorigin,
scenQueryGet,
LocalStorage,
imagify
imagify,
newScenQueryGet
} from '../../../utilities/index.js';
import {
unlockmodesdetail,
......@@ -160,19 +161,27 @@ Page({
const launchOptions = wx.getLaunchOptionsSync();
const visitor = LocalStorage.getItem('visitor');
if (options.scene) {
let sceneQuery = scenQueryGet(options.scene);
const {
t,
c,
p
} = sceneQuery;
if (p == 7) {}
this.setData({
tid: t,
cid: c,
isQrcodeIn: true
})
// let sceneQuery = scenQueryGet(options.scene);
let sceneQuery = newScenQueryGet(options.scene);
if (sceneQuery.type == 1) {
const {
t,
c,
p
} = sceneQuery.queryObj;
if (p == 7) {}
this.setData({
tid: t,
cid: c,
isQrcodeIn: true
})
} else if (sceneQuery.type == 2) {
this.setData({
tid: sceneQuery.queryObj[1],
cid: sceneQuery.queryObj[0],
isQrcodeIn: true
})
}
} else {
const {
tid,
......
......@@ -2,7 +2,8 @@ import {
LocalStorage,
scenQueryGet,
audioorigin,
imagify
imagify,
newScenQueryGet
} from '../../../utilities/index.js';
import {
wxPreviewImage
......@@ -63,13 +64,20 @@ Page({
onLoad: function (options) { // Do some initialize when page load.
const that = this;
if (options.scene) {
let sceneQuery = scenQueryGet(options.scene);
const {
t,
} = sceneQuery;
this.setData({
tid: t || 0
})
let sceneQuery = newScenQueryGet(options.scene);
if (sceneQuery.type == 1) {
const {
t,
} = sceneQuery.queryObj;
this.setData({
tid: t || 0
})
} else if (sceneQuery.type == 2) {
this.setData({
tid: sceneQuery.queryObj[0] || 0
})
}
} else {
const {
tid
......
......@@ -365,6 +365,27 @@ function scenQueryGet(str) {
}
return queryObj;
}
function newScenQueryGet(str) {
let _str = decodeURIComponent(str);
if (_str.indexOf('_') != -1) { // 海报生成新的scene
let queryArr = _str.split('_');
return {
type: 2,
queryObj: queryArr
};
} else { // 老的海报生成方式
let queryArr = _str.split('&');
let queryObj = {};
for (let i = 0, _length = queryArr.length; i < _length; i++) {
let arr = queryArr[i].split('=');
queryObj[arr[0]] = arr[1]
}
return {
type: 1,
queryObj
};
}
}
// 违规词
function matchBlacklist(text) {
const matched = [];
......@@ -548,4 +569,5 @@ export {
mediaimagify,
transformOssVideofy,
deepCopy,
newScenQueryGet,
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment