diff --git a/src/components/getPhoneModal/index.tsx b/src/components/getPhoneModal/index.tsx index 2c2aa55..5073908 100644 --- a/src/components/getPhoneModal/index.tsx +++ b/src/components/getPhoneModal/index.tsx @@ -40,6 +40,23 @@ export default function GetPhoneNumber({ onClose, scene = null, modalVisible, on }, 0) }; + // 消息推送授权 + const publicNotice = () => { + Taro.requestSubscribeMessage({ + tmplIds: ['F5kG9ryTuf3U09liOVIqqZDDEwNwiuWbLPPdoVpKPWI', 'cnMggWGwr0_cVw7Hf_fg3u74EDJdA0b4e56Ioy-Vr_Q'], + success (res) { + + }, + fail (err) { + Taro.showToast({ + title: err, + duration: 2000, + icon: 'error' + }); + } + }) + } + const handleGetUserPhone = (e: any) => { console.log('注册接口:',e.detail, Taro.getStorageSync('othersInviteCode')) @@ -63,6 +80,8 @@ export default function GetPhoneNumber({ onClose, scene = null, modalVisible, on Taro.setStorageSync('UserToken', res.data.token) Taro.removeStorageSync('othersInviteCode') + publicNotice() + if(scene){ Taro.request({ url: 'https://interapi.jm-kid.com/api/product/exchange', diff --git a/src/pages/Home/index.tsx b/src/pages/Home/index.tsx index 2b1a71c..7659cb6 100644 --- a/src/pages/Home/index.tsx +++ b/src/pages/Home/index.tsx @@ -299,8 +299,7 @@ export default function Home() { else{ //已订阅,跳转详情页 Taro.navigateTo({ - url: index ? '/pages/CollectionDetail/index?id=' + item.prdt_id : '/pages/Share/index' - // url: '/pages/Share/index' + url: '/pages/Share/index' }) } } diff --git a/src/pages/UserHome/index.tsx b/src/pages/UserHome/index.tsx index 2204198..b45bf8e 100644 --- a/src/pages/UserHome/index.tsx +++ b/src/pages/UserHome/index.tsx @@ -168,6 +168,25 @@ export default function UserHome() { // } // }) + // 消息推送授权 + const publicNotice = (url) => { + Taro.requestSubscribeMessage({ + tmplIds: ['F5kG9ryTuf3U09liOVIqqZDDEwNwiuWbLPPdoVpKPWI', 'cnMggWGwr0_cVw7Hf_fg3u74EDJdA0b4e56Ioy-Vr_Q'], + success (res) { + Taro.navigateTo({ + url: url, + }) + }, + fail (err) { + Taro.showToast({ + title: err, + duration: 2000, + icon: 'error' + }); + } + }) + } + const handlePush = (index: number,url: string) => { if(!Taro.getStorageSync('UserToken')){ setisLoginOpen(true) @@ -178,6 +197,9 @@ export default function UserHome() { } else if (index === 2) { // 兑换码 setisUserExchangeModalOpen(true) + } else if (index === 4) { + // 联系客服 + publicNotice(url) } else { Taro.navigateTo({ url: url,