张延森 4 years ago
parent
commit
4747ccb204
3 changed files with 31 additions and 12 deletions
  1. BIN
      src/assets/img/loading.gif
  2. 25
    12
      src/components/Spin/index.jsx
  3. 6
    0
      src/pages/ShouYe/index.jsx

BIN
src/assets/img/loading.gif View File


+ 25
- 12
src/components/Spin/index.jsx View File

1
 import React from 'react'
1
 import React from 'react'
2
 import { View } from '@tarojs/components'
2
 import { View } from '@tarojs/components'
3
-import './index.less'
3
+// import './index.less'
4
 
4
 
5
 const cubeLen = 9
5
 const cubeLen = 9
6
 
6
 
7
+const inCenter = {
8
+  display: 'block',
9
+  width: '40vw',
10
+  height: '40vw',
11
+  margin: '15vh auto'
12
+}
13
+
7
 export default props => {
14
 export default props => {
8
 
15
 
9
   const color = props.color || '#9e1068'
16
   const color = props.color || '#9e1068'
10
   const tipText = props.tips || 'LOADING'
17
   const tipText = props.tips || 'LOADING'
11
   const cubeStyle = { backgroundColor: color }
18
   const cubeStyle = { backgroundColor: color }
12
-  const tipStyle = { color }
19
+  const tipStyle = { color, textAlign: 'center', marginTop: '-18vh' }
13
 
20
 
14
   return (
21
   return (
15
     <>
22
     <>
16
       {
23
       {
17
         props.loading ? (
24
         props.loading ? (
18
-          <View className='cubes-box'>
19
-            <View className='cubes'>
20
-              {
21
-                new Array(cubeLen).fill(0).map((_, inx) => (
22
-                  <View key={inx} class={`sk-cube sk-cube${inx + 1}`} style={cubeStyle}></View>
23
-                ))
24
-              }
25
-            </View>
26
-            <View className='cubes-tip' style={tipStyle}>{tipText}</View>
27
-          </View>
25
+          <view style={inCenter}>
26
+            <image style={{width: '100%'}} src={require('@/assets/img/loading.gif').default} mode="aspectFit" alt=""/>
27
+            <view style={tipStyle}>{tipText}</view>
28
+          </view>
28
         ) : props.children
29
         ) : props.children
30
+        // (
31
+        //   <View className='cubes-box'>            
32
+        //     <View className='cubes'>
33
+        //       {
34
+        //         new Array(cubeLen).fill(0).map((_, inx) => (
35
+        //           <View key={inx} class={`sk-cube sk-cube${inx + 1}`} style={cubeStyle}></View>
36
+        //         ))
37
+        //       }
38
+        //     </View>
39
+        //     <View className='cubes-tip' style={tipStyle}>{tipText}</View>
40
+        //   </View>
41
+        // ) : props.children
29
       }
42
       }
30
     </>
43
     </>
31
   )
44
   )

+ 6
- 0
src/pages/ShouYe/index.jsx View File

9
 import Taro from '@tarojs/taro'
9
 import Taro from '@tarojs/taro'
10
 import Page from '@/layouts'
10
 import Page from '@/layouts'
11
 import nav2detail from '@/utils/nav2detail'
11
 import nav2detail from '@/utils/nav2detail'
12
+import { getShareObject } from '@/utils/share'
12
 import '@/assets/css/reset.less'
13
 import '@/assets/css/reset.less'
13
 import '@/assets/css/iconfont.less'
14
 import '@/assets/css/iconfont.less'
14
 import './index.less'
15
 import './index.less'
144
     }
145
     }
145
   }
146
   }
146
 
147
 
148
+  // 分享转发
149
+  Taro.useShareAppMessage(() => {
150
+    return getShareObject({ title: '远道智慧社区' }, user)
151
+  })
152
+
147
   return (
153
   return (
148
     <Page>
154
     <Page>
149
       <view className='ShouYe flex-v'>
155
       <view className='ShouYe flex-v'>