Your Name 3 jaren geleden
bovenliggende
commit
b52c6aa99c

+ 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: '"http://127.0.0.1:8080"',
7
-    // HOST: '"http://sgl-v2-test.njyunzhi.com"',
6
+    // HOST: '"http://127.0.0.1:8080"',
7
+    HOST: '"http://sgl-v2-test.njyunzhi.com"',
8 8
     OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
9 9
   },
10 10
   mini: {},

+ 1
- 1
config/prod.js Bestand weergeven

@@ -3,7 +3,7 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
-    HOST: '"https://sgl-v2-test.njyunzhi.com"',
6
+    HOST: '"https://sgl-v2.njyunzhi.com"',
7 7
     OSS: '"yz-shigongli.oss-accelerate.aliyuncs.com"',
8 8
   },
9 9
   mini: {},

+ 1
- 1
project.config.json Bestand weergeven

@@ -2,7 +2,7 @@
2 2
   "miniprogramRoot": "./dist",
3 3
   "projectname": "miniapp",
4 4
   "description": "十公里",
5
-  "appid": "wx835627a9b9b3932a",
5
+  "appid": "wx06a7372d48d56843",
6 6
   "setting": {
7 7
     "urlCheck": true,
8 8
     "es6": false,

+ 30
- 2
src/components/CouponCard/Media/Header.jsx Bestand weergeven

@@ -1,4 +1,5 @@
1
-import React from 'react'
1
+import React, { useEffect, useState } from 'react'
2
+import Taro from '@tarojs/taro'
2 3
 import { View, Image } from '@tarojs/components'
3 4
 import BadgeTag from '@/components/BadgeTag'
4 5
 import Cashback from '../Cashback'
@@ -9,12 +10,39 @@ export default (props) => {
9 10
 
10 11
   const enableCashback = cashback !== undefined && cashback !== null
11 12
 
13
+  // // 为了解决苹果手机上图片不显示问题
14
+  // const [imgUrl, setImgUrl] = useState()
15
+  // useEffect(() => {
16
+  //   if (image) {
17
+  //     Taro.downloadFile({
18
+  //       url: image,
19
+  //       success: res => setImgUrl(res.tempFilePath),
20
+  //       fail: err => {
21
+  //         console.error(err)
22
+  //         setImgUrl(image)
23
+  //       }
24
+  //     })
25
+  //   } else {
26
+  //     setImgUrl()
27
+  //   }
28
+  // }, [image])
29
+  // const handleError = (e) => {
30
+  //   console.error('-------image----->', image)
31
+  //   console.error(e)
32
+  // }
33
+
34
+  const backImage = {
35
+    background: `url('${image}') no-repeat`,
36
+    backgroundSize: '100%',
37
+  }
38
+
12 39
   return (
13 40
     <View className='coupun-media_header'>
14 41
       {enableCashback && <Cashback money={cashback} style={{ marginTop: '-10px' }} />}
15 42
       <View className='coupun-media_thumb'>
16 43
         <BadgeTag type={badge} />
17
-        <Image src={image} webp />
44
+        {/* <Image src={image} webp mode='widthFix'onError={handleError} /> */}
45
+        <View className='image' style={backImage}></View>
18 46
       </View>
19 47
     </View>
20 48
   )

+ 1
- 1
src/components/CouponCard/Media/style.less Bestand weergeven

@@ -18,7 +18,7 @@
18 18
     position: relative;
19 19
     overflow: hidden;
20 20
 
21
-    & > image {
21
+    & > .image {
22 22
       width: 100%;
23 23
       height: 100%;
24 24
       display: block;

+ 8
- 4
src/components/CustomNav/index.jsx Bestand weergeven

@@ -9,7 +9,7 @@ import gobackWhite from '@/assets/icons/comm/goback_white.png'
9 9
 import './style.less'
10 10
 
11 11
 export default (props) => {
12
-  const { bgImg, logo, title = '首页', home } = props
12
+  const { bgImg, logo, title = '首页', home, noback } = props
13 13
 
14 14
   // 菜单胶囊
15 15
   const menuBound = useMemo(() => Taro.getMenuButtonBoundingClientRect(), [])
@@ -86,9 +86,13 @@ export default (props) => {
86 86
           {
87 87
             !logo && !home && (
88 88
               <view className='custom-nav-bar-action-btns'>
89
-                <view className='custom-nav-bar-action-part' onClick={handleAction}>
90
-                  <image src={bgImg ? gobackWhite : gobackBlack} mode='aspectFit' />
91
-                </view>
89
+                {
90
+                  !noback && (
91
+                    <view className='custom-nav-bar-action-part' onClick={handleAction}>
92
+                      <image src={bgImg ? gobackWhite : gobackBlack} mode='aspectFit' />
93
+                    </view>
94
+                  )
95
+                }
92 96
                 <view className='custom-nav-bar-action-part' onClick={goHome}>
93 97
                   <image src={bgImg ? homeWhite : homeBlack} mode='aspectFit' />
94 98
                 </view>