Ver código fonte

Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev

Your Name 3 anos atrás
pai
commit
522e3c6a8d

+ 1
- 1
src/components/add-tips/index.wxss Ver arquivo

6
   justify-content: flex-end;
6
   justify-content: flex-end;
7
   align-items: flex-end;
7
   align-items: flex-end;
8
   flex-direction: column;
8
   flex-direction: column;
9
-  width: 600px;
9
+  /* width: 600px; */
10
 }
10
 }
11
 .arrow {
11
 .arrow {
12
   width: 0;
12
   width: 0;

+ 72
- 0
src/components/add-tipsFood/index.js Ver arquivo

1
+
2
+const STORAGE_KEY = 'PLUG-ADD-MYAPP-KEY'
3
+Component({
4
+  properties: {
5
+    name: {
6
+      type: String,
7
+      value: '测试'
8
+    },
9
+    duration: {
10
+      type: Number,
11
+      value: 10
12
+    },
13
+    delay: {
14
+      type: Number,
15
+      value: 2
16
+    },
17
+    logo: {
18
+      type: String,
19
+      value: 'https://cdn.blog.makergyt.com/mini/assets/component-add_tips.png'
20
+    },
21
+    custom: {
22
+      type: Boolean,
23
+      value: false
24
+    }
25
+  },
26
+  lifetimes: {
27
+    attached: function () {
28
+      if (wx.getStorageSync(STORAGE_KEY)) return;
29
+      //取胶囊位置
30
+      let rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null
31
+      //取屏幕宽度
32
+      let { screenWidth } = wx.getSystemInfoSync()
33
+      this.setData({
34
+        navbarHeight: rect.bottom,
35
+        arrowR: screenWidth - rect.right + rect.width * 0.5 / 1 - 20,
36
+        bodyR: screenWidth - rect.right
37
+      })
38
+      this.startTimer = setTimeout(() => {
39
+        this.setData({
40
+          SHOW_TOP: true
41
+        })
42
+      }, this.data.delay * 1000)
43
+      this.duraTimer = setTimeout(() => {
44
+        this.shrink();
45
+      }, (this.data.duration + this.data.delay) * 1000)
46
+    },
47
+    detached: function () {
48
+      if (this.startTimer) clearTimeout(this.startTimer)
49
+      if (this.duraTimer) clearTimeout(this.duraTimer)
50
+    },
51
+  },
52
+  data: {
53
+    SHOW_TOP: false
54
+  },
55
+  methods: {
56
+    hiddenButton: function () {
57
+      // wx.setStorageSync(STORAGE_KEY, true)
58
+      this.shrink()
59
+    },
60
+    shrink: function () {
61
+      this.animate('#add-tips', [
62
+        { scale: [1, 1] },
63
+        { scale: [0, 0], ease: 'ease', transformOrigin: `calc(600rpx - ${this.data.arrowR}px) 2%` }
64
+      ], 500, function () {
65
+        this.setData({
66
+          SHOW_TOP: false
67
+        })
68
+      }.bind(this))
69
+    }
70
+  }
71
+})
72
+

+ 3
- 0
src/components/add-tipsFood/index.json Ver arquivo

1
+{
2
+  "component": true
3
+}

+ 7
- 0
src/components/add-tipsFood/index.wxml Ver arquivo

1
+<view class="box" wx:if="{{SHOW_TOP}}" style="top:{{custom?navbarHeight:0}}px;" id="add-tips">
2
+  <view class='arrow' style="margin-right:{{arrowR}}vw;"></view>
3
+  <view class='body' bindtap='hiddenButton' style="margin-right:{{bodyR}}px;">
4
+    <image src="{{logo}}" class="logo"></image>
5
+    <view class="tips">更多美食优惠点这里</view>
6
+  </view>
7
+</view>

+ 53
- 0
src/components/add-tipsFood/index.wxss Ver arquivo

1
+.box {
2
+  position: absolute;
3
+  left: 0;
4
+  z-index: 999;
5
+  display: flex;
6
+  justify-content: flex-end;
7
+  align-items: flex-end;
8
+  flex-direction: column;
9
+  margin-left: 20px;
10
+}
11
+.arrow {
12
+  width: 0;
13
+  height: 0;
14
+  border-width: 18px;
15
+  border-style: solid;
16
+  border-color: transparent transparent rgba(252, 156, 87, 0.9) transparent;
17
+}
18
+.body {
19
+  background-color: rgba(252, 156, 87, 0.9);
20
+  border-radius: 15rpx;
21
+  display: -webkit-flex;
22
+  display: -ms-flexbox;
23
+  display: flex;
24
+  -webkit-align-items: center;
25
+  -ms-flex-align: center;
26
+  align-items: center;
27
+  -webkit-justify-content: center;
28
+  -ms-flex-pack: center;
29
+  justify-content: center;
30
+  padding: 20rpx 20rpx;
31
+  width: 318px;
32
+  height: 20px;
33
+}
34
+.tips {
35
+  flex: 1;
36
+  color: #fff;
37
+  font-size: 30px;
38
+  /* font-weight: 700; */
39
+}
40
+.logo {
41
+  height: 35px;
42
+  width: 35px;
43
+  border-radius: 8px;
44
+  margin-right: 10px;
45
+}
46
+
47
+.button-view {
48
+  color: #04b040;
49
+  text-align: center;
50
+  font-size: 20px;
51
+  /* line-height: 22px; */
52
+  display: initial;
53
+}

+ 12
- 12
src/hotel/pages/landlord/addRoom/addRoom.jsx Ver arquivo

173
       <view className='index-navbar'>
173
       <view className='index-navbar'>
174
         <CustomNav title={hotelName} />
174
         <CustomNav title={hotelName} />
175
       </view>
175
       </view>
176
-      <view className='roomDetail' style={{ height: '100%', overflow: "hidden", }} >
177
-        <scroll-view scrollY style={{ height: '100%' }}>
176
+      <view className='roomDetail' style={{ height: '100%', display: 'flex', flexDirection: 'column', overflow: 'hidden' }} >
177
+        <scroll-view scrollY style={{ height: '100%', position: 'relative', overflow: "hidden", flex: 'auto' }}>
178
           <View id='det'>
178
           <View id='det'>
179
             <Popup show={showCutover} onClose={onClose}>
179
             <Popup show={showCutover} onClose={onClose}>
180
               <View className='editword'>
180
               <View className='editword'>
237
               </mp-cell>
237
               </mp-cell>
238
             </mp-cells>
238
             </mp-cells>
239
             {roomId ? <>
239
             {roomId ? <>
240
-                <view className='weui-cells__title'>其他指引</view>
241
-                {
242
-                  extend == '' ? null :
243
-                    <>
244
-                      {extend.map((item) => (
245
-                        <Extend key={item.extId} item={item} setReset={setReset} />
246
-                      ))}
247
-                    </>
248
-                }
240
+              <view className='weui-cells__title'>其他指引</view>
241
+              {
242
+                extend == '' ? null :
243
+                  <>
244
+                    {extend.map((item) => (
245
+                      <Extend key={item.extId} item={item} setReset={setReset} />
246
+                    ))}
247
+                  </>
248
+              }
249
             </> : null
249
             </> : null
250
             }
250
             }
251
           </mp-form>
251
           </mp-form>
260
             </View>
260
             </View>
261
           </> : null
261
           </> : null
262
           }
262
           }
263
-          <Button className='button-OK' onClick={sumbit}>确定</Button>
264
         </scroll-view>
263
         </scroll-view>
264
+        <Button className='button-OK' onClick={sumbit}>确定</Button>
265
       </view>
265
       </view>
266
     </view>
266
     </view>
267
   )
267
   )

+ 3
- 5
src/hotel/pages/landlord/addRoom/addRoom.less Ver arquivo

54
       }
54
       }
55
     }
55
     }
56
   }
56
   }
57
-
57
+}
58
   .button-OK {
58
   .button-OK {
59
-    height: 92px;
59
+    flex: none;
60
     background: #274291;
60
     background: #274291;
61
-    margin: 60px 0 30px 0;
61
+    margin: 30px 0 20px 0;
62
     letter-spacing: 5px;
62
     letter-spacing: 5px;
63
     line-height: 92px;
63
     line-height: 92px;
64
     border-radius: 12px;
64
     border-radius: 12px;
66
     font-weight: bold;
66
     font-weight: bold;
67
     color: #fff;
67
     color: #fff;
68
   }
68
   }
69
-
70
-}

+ 0
- 2
src/pages/MineUserAll/AllOrder/index.jsx Ver arquivo

43
 
43
 
44
 
44
 
45
   const handleTabClick = (index) => {
45
   const handleTabClick = (index) => {
46
-    console.log('------tab-----event--------', index)
47
     setActiveTab(index)
46
     setActiveTab(index)
48
 
47
 
49
   }
48
   }
50
 
49
 
51
-  console.log('------setActiveTab--------', activeTab)
52
 
50
 
53
   return (
51
   return (
54
     <view className='page-index box-content'>
52
     <view className='page-index box-content'>

+ 2
- 0
src/pages/details/foodDetails/foodDetails.config.js Ver arquivo

5
   enableShareAppMessage: true,
5
   enableShareAppMessage: true,
6
   usingComponents: {
6
   usingComponents: {
7
     "mp-dialog": "weui-miniprogram/dialog/dialog",
7
     "mp-dialog": "weui-miniprogram/dialog/dialog",
8
+    "add-tipsFood": "../../../components/add-tipsFood/index"
9
+
8
   }
10
   }
9
 }
11
 }

+ 26
- 3
src/pages/details/foodDetails/foodDetails.jsx Ver arquivo

28
 import useSave from "@/utils/hooks/useSave";
28
 import useSave from "@/utils/hooks/useSave";
29
 import useLike from "@/utils/hooks/useLike";
29
 import useLike from "@/utils/hooks/useLike";
30
 import Extend from "../components/Extend/extend";
30
 import Extend from "../components/Extend/extend";
31
+import logo from "./laba.png";
32
+
31
 import "./foodDetails.less";
33
 import "./foodDetails.less";
32
 
34
 
33
 export default withLayout((props) => {
35
 export default withLayout((props) => {
34
   const { router, person, location } = props;
36
   const { router, person, location } = props;
35
   const { id, subOrderId, scene } = props.router.params;
37
   const { id, subOrderId, scene } = props.router.params;
36
 
38
 
39
+
37
   useEffect(() => {
40
   useEffect(() => {
38
     if (id && (scene || subOrderId)) {
41
     if (id && (scene || subOrderId)) {
39
       getVerifyTargetList({
42
       getVerifyTargetList({
65
   const [isSaved, toggleSave] = useSave(detail.isSaved, "shop", id);
68
   const [isSaved, toggleSave] = useSave(detail.isSaved, "shop", id);
66
   const [isLike, toggleLike] = useLike(detail.isLike, "shop", id);
69
   const [isLike, toggleLike] = useLike(detail.isLike, "shop", id);
67
 
70
 
71
+  //引导显隐
72
+  const [guidance, setGuidance] = useState('shareOff')
73
+  //引导显隐
74
+
75
+  useEffect(() => {
76
+    if (router.params.scene || router.params.enterType === "share") {
77
+      setGuidance('shareOn')
78
+    }
79
+  }, [router.params.enterType, router.params.scene])
80
+
81
+
82
+
83
+
84
+
85
+
68
   //本店指南
86
   //本店指南
69
   const [extend, setExtend] = useState([]);
87
   const [extend, setExtend] = useState([]);
70
 
88
 
80
   const log = useRef("");
98
   const log = useRef("");
81
   const lat = useRef("");
99
   const lat = useRef("");
82
 
100
 
83
-
84
   const handlePhone = () => {
101
   const handlePhone = () => {
85
     if (!detail.phone) {
102
     if (!detail.phone) {
86
       Taro.showToast({
103
       Taro.showToast({
120
 
137
 
121
   // 分享
138
   // 分享
122
   useShareAppMessage(() => {
139
   useShareAppMessage(() => {
140
+    // setShareAppMessage('shareOff')
123
     return {
141
     return {
124
       title: detail.shopName,
142
       title: detail.shopName,
125
-      path: `/pages/details/foodDetails/foodDetails?id=${id}&subOrderId=${subOrderId}`,
143
+      path: `/pages/details/foodDetails/foodDetails?id=${id}&subOrderId=${subOrderId}&enterType=share`,
126
       imageUrl: detail.poster,
144
       imageUrl: detail.poster,
145
+
127
     };
146
     };
128
   });
147
   });
129
- const [isScroll,setScroll]=useState(true)
148
+  const [isScroll, setScroll] = useState(true)
130
   return (
149
   return (
131
     <view className='page-index'>
150
     <view className='page-index'>
151
+      {
152
+        guidance === 'shareOn' && (<add-tipsFood logo={logo} custom duration={-1} />)
153
+      }
154
+      {/* <add-tipsFood custom duration={-1} /> */}
132
       <view className='index-navbar'>
155
       <view className='index-navbar'>
133
         <CustomNav title='十公里' />
156
         <CustomNav title='十公里' />
134
       </view>
157
       </view>

BIN
src/pages/details/foodDetails/laba.png Ver arquivo


+ 1
- 0
src/pages/index/index.jsx Ver arquivo

22
 
22
 
23
 export default withLayout((props) => {
23
 export default withLayout((props) => {
24
   const { router, person, location } = props
24
   const { router, person, location } = props
25
+  console.log("🚀 ~ file: index.jsx ~ line 25 ~ withLayout ~ router", router)
25
   let { roomId, roomOrderId } = router.params
26
   let { roomId, roomOrderId } = router.params
26
   const { roomId: rid } = useModel('hotel')
27
   const { roomId: rid } = useModel('hotel')
27
 
28