Bladeren bron

静态页面

1002884655 3 jaren geleden
bovenliggende
commit
e4933ee0ec

+ 2
- 2
config/dev.js Bestand weergeven

@@ -3,8 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"https://xlk.njyz.tech"',
7
-    // HOST: '"https://xlj.newlandsh.com"',
6
+    // HOST: '"https://xlk.njyz.tech"',
7
+    HOST: '"https://xlj.newlandsh.com"',
8 8
     // HOST: '"http://127.0.0.1:8081"',
9 9
     WSS_HOST: '"wss://xlk.njyz.tech"',
10 10
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',

+ 1
- 1
config/prod.js Bestand weergeven

@@ -10,7 +10,7 @@ module.exports = {
10 10
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11 11
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
12 12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',
13
-    Version: '"V0.0.42-20210812"'
13
+    Version: '"V0.0.45-20210812"'
14 14
   },
15 15
   mini: {},
16 16
   h5: {

+ 7
- 0
src/components/ChatIcon/index.jsx Bestand weergeven

@@ -1,6 +1,7 @@
1 1
 import { useEffect, useState } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import { MovableArea, MovableView } from '@tarojs/components'
4
+import { showSubscribeMessage, MESSAGE_TYPE } from '@/utils/subscribeMessage'
4 5
 import './style.scss'
5 6
 
6 7
 export default function ChatIcon(props) {
@@ -8,6 +9,12 @@ export default function ChatIcon(props) {
8 9
   const [PageX] = useState(Taro.getSystemInfoSync().windowWidth - 60)
9 10
   const [PageY] = useState(Taro.getSystemInfoSync().windowHeight - 60)
10 11
 
12
+  const handleClick = () => {
13
+    showSubscribeMessage(MESSAGE_TYPE.NOTICE).then((res) => {
14
+      //
15
+    })
16
+  }
17
+
11 18
   return (
12 19
     <MovableArea className='components ChatIcon'>
13 20
       <MovableView className='MoveItem' x={PageX} y={PageY} direction='all'>

+ 0
- 1
src/layout/index.js Bestand weergeven

@@ -34,7 +34,6 @@ export default (ChildComponent) => (props) => {
34 34
   const [authPhone, authAvatar, authPage] = useAuth(person, page)
35 35
   const [shareTimelineVisible, setShareTimelineVisible] = useState(false)
36 36
 
37
-
38 37
   const { id } = router.params
39 38
   const showConsultant = page.shortcut && page.shortcut.consultant
40 39
 

+ 1
- 1
src/pages/index/index.jsx Bestand weergeven

@@ -65,7 +65,7 @@ export default withLayout((props) => {
65 65
 
66 66
   return (
67 67
     <view className='Page Index'>
68
-      <ChatIcon></ChatIcon>
68
+      {/* <ChatIcon></ChatIcon> */}
69 69
       {/* <ShareToCircle visible></ShareToCircle> */}
70 70
       <ScrollView scroll-y>
71 71
         <view className='PageContent'>

+ 1
- 1
src/pages/mine/index.jsx Bestand weergeven

@@ -15,7 +15,7 @@ import MineMenuList from './tabData'
15 15
 const defaultRuleImage = 'https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/index-icon18.jpg'
16 16
 
17 17
 const version = `版本: ${Version}`
18
-const copyRight = `云致科技 @ ${(new Date()).getFullYear()}`
18
+const copyRight = `技术支持: 云致科技 @ ${(new Date()).getFullYear()}`
19 19
 
20 20
 export default withLayout(() => {
21 21
 

+ 13
- 1
src/utils/chatDate.js Bestand weergeven

@@ -1,4 +1,5 @@
1 1
 
2
+import Taro from '@tarojs/taro'
2 3
 
3 4
 export const MILLISECONDS_A_SECOND = 1e3
4 5
 export const MILLISECONDS_A_MINUTE = 60 * MILLISECONDS_A_SECOND
@@ -16,9 +17,20 @@ export const diff = (dt1, dt2) => {
16 17
   return [bw, day, hour, min, sec]
17 18
 }
18 19
 
20
+export function getDateByStr(dtStr) {
21
+  if (!dtStr) return undefined;
22
+
23
+  const t = dtStr.split(/[-T :]/);
24
+
25
+  return new Date(t[0], t[1]-1, t[2], t[3] || 0, t[4] || 0, t[5] || 0)
26
+}
27
+
19 28
 //例子 getDateFormat(new Date().valueOf(),true,'yyyy/M/d')
20 29
 export function formatDate(dt, fmt) {
21
-  const date = new Date(dt)
30
+  if (!dt) return dt;
31
+
32
+  // 解决苹果手机不能正常初始化的问题
33
+  const date = typeof dt === 'string' ? getDateByStr(dt) : new Date(dt);
22 34
 
23 35
   var o = {
24 36
     "M+": date.getMonth() + 1, //月份

+ 20
- 0
src/utils/subscribeMessage.js Bestand weergeven

@@ -0,0 +1,20 @@
1
+import Taro from '@tarojs/taro'
2
+import store from '../store'
3
+
4
+export const MESSAGE_TYPE = {
5
+  NOTICE: 'notice',
6
+}
7
+
8
+export function showSubscribeMessage (messageType) {
9
+  const { user } = store.getState()
10
+  const { miniApp = {} } = (user || {}).userInfo || {}
11
+
12
+  const tmplIds = (miniApp.tpls || []).filter(x => x.tplType === messageType).map(x => x.tplId)
13
+  if (tmplIds.length > 0) {
14
+    return new Promise((resolve) => {
15
+      Taro.requestSubscribeMessage({ tmplIds, fail: (e) => { console.error(e) }, complete: resolve })
16
+    })
17
+  } else {
18
+    return Promise.resolve()
19
+  }
20
+}