Merge remote-tracking branch 'origin/master'
# Conflicts: # manifest.json # sheep/platform/provider/wechat/miniProgram.jspull/100/head
commit
22b62d2b22
|
|
@ -184,7 +184,7 @@
|
||||||
"versionCode": 100
|
"versionCode": 100
|
||||||
},
|
},
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"appid": "wx66186af0759f47c9",
|
"appid": "wx9a0a5b259d852380",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false,
|
"urlCheck": false,
|
||||||
"minified": true,
|
"minified": true,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import third from '@/sheep/api/migration/third';
|
||||||
import AuthUtil from '@/sheep/api/member/auth';
|
import AuthUtil from '@/sheep/api/member/auth';
|
||||||
import SocialApi from '@/sheep/api/member/social';
|
import SocialApi from '@/sheep/api/member/social';
|
||||||
import UserApi from '@/sheep/api/member/user';
|
import UserApi from '@/sheep/api/member/user';
|
||||||
|
|
@ -9,7 +10,7 @@ let subscribeEventList = [];
|
||||||
// 加载微信小程序
|
// 加载微信小程序
|
||||||
function load() {
|
function load() {
|
||||||
checkUpdate();
|
checkUpdate();
|
||||||
getSubscribeTemplate();
|
// getSubscribeTemplate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 微信小程序静默授权登陆
|
// 微信小程序静默授权登陆
|
||||||
|
|
@ -162,15 +163,15 @@ const checkUpdate = async (silence = true) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
// 获取订阅消息模板
|
// 获取订阅消息模板
|
||||||
async function getSubscribeTemplate() {
|
// async function getSubscribeTemplate() {
|
||||||
const { code, data } = await SocialApi.getSubscribeTemplateList();
|
// const { code, data } = await third.wechat.getSubscribeTemplateList();
|
||||||
if (code === 0) {
|
// if (code === 0) {
|
||||||
subscribeEventList = data;
|
// subscribeEventList = data;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 订阅消息
|
// 订阅消息
|
||||||
function subscribeMessage(event, callback= undefined) {
|
function subscribeMessage(event) {
|
||||||
let tmplIds = [];
|
let tmplIds = [];
|
||||||
if (typeof event === 'string') {
|
if (typeof event === 'string') {
|
||||||
const temp = subscribeEventList.find(item => item.title.includes(event));
|
const temp = subscribeEventList.find(item => item.title.includes(event));
|
||||||
|
|
@ -190,10 +191,6 @@ function subscribeMessage(event, callback= undefined) {
|
||||||
|
|
||||||
uni.requestSubscribeMessage({
|
uni.requestSubscribeMessage({
|
||||||
tmplIds,
|
tmplIds,
|
||||||
success: ()=>{
|
|
||||||
// 不管是拒绝还是同意都触发
|
|
||||||
callback && callback()
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue