吃个甘蔗嚼一年 3 年 前
コミット
2cb3aed687

+ 69
- 0
src/components/add-tips/index.js ファイルの表示

@@ -0,0 +1,69 @@
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
+      let rect = wx.getMenuButtonBoundingClientRect ? wx.getMenuButtonBoundingClientRect() : null
30
+      let { screenWidth } = wx.getSystemInfoSync()
31
+      this.setData({
32
+        navbarHeight: rect.bottom,
33
+        arrowR: screenWidth - rect.right + rect.width * 3 / 4 - 5,
34
+        bodyR: screenWidth - rect.right
35
+      })
36
+      this.startTimer = setTimeout(() => {
37
+        this.setData({
38
+          SHOW_TOP: true
39
+        })
40
+      }, this.data.delay * 1000)
41
+      this.duraTimer = setTimeout(() => {
42
+        this.shrink();
43
+      }, (this.data.duration + this.data.delay) * 1000)
44
+    },
45
+    detached: function () {
46
+      if (this.startTimer) clearTimeout(this.startTimer)
47
+      if (this.duraTimer) clearTimeout(this.duraTimer)
48
+    },
49
+  },
50
+  data: {
51
+    SHOW_TOP: false
52
+  },
53
+  methods: {
54
+    hidden: function () {
55
+      wx.setStorageSync(STORAGE_KEY, true)
56
+      this.shrink()
57
+    },
58
+    shrink: function () {
59
+      this.animate('#add-tips', [
60
+        { scale: [1, 1] },
61
+        { scale: [0, 0], ease: 'ease', transformOrigin: `calc(600rpx - ${this.data.arrowR}px) 1%` }
62
+      ], 500, function () {
63
+        this.setData({
64
+          SHOW_TOP: false
65
+        })
66
+      }.bind(this))
67
+    }
68
+  }
69
+})

+ 3
- 0
src/components/add-tips/index.json ファイルの表示

@@ -0,0 +1,3 @@
1
+{
2
+  "component": true
3
+}

+ 7
- 0
src/components/add-tips/index.wxml ファイルの表示

@@ -0,0 +1,7 @@
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}}px;"></view>
3
+  <view class='body' bindtap='hidden' style="margin-right:{{bodyR}}px;">
4
+    <image src="{{logo}}" class="logo"></image>
5
+    <view class="tips">选择"添加到我的小程序",使用更便捷</view>
6
+  </view>
7
+</view>

+ 47
- 0
src/components/add-tips/index.wxss ファイルの表示

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

+ 3
- 1
src/layouts/Loading.jsx ファイルの表示

@@ -22,7 +22,9 @@ export default (props) => {
22 22
           position: 'absolute',
23 23
           left: '-4vh',
24 24
           textAlign: 'center',
25
-          opacity: '0.8'
25
+          opacity: '0.8',
26
+          animation: ' logo-opacity 2s linear infinite',
27
+
26 28
         }}
27 29
       >
28 30
         收集人间美好

+ 132
- 129
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx ファイルの表示

@@ -87,8 +87,8 @@ export default withLayout((props) => {
87 87
       refundReason: explain,
88 88
     }).then((res) => {
89 89
       Taro.hideLoading();
90
-        Taro.navigateTo({ url: '/pages/MineUserAll/AllOrder/index?tabJump=0' })
91
-        Taro.showToast({
90
+      Taro.navigateTo({ url: '/pages/MineUserAll/AllOrder/index?tabJump=0' })
91
+      Taro.showToast({
92 92
         title: "退款成功",
93 93
         icon: "none",
94 94
         duration: 3000,
@@ -110,151 +110,154 @@ export default withLayout((props) => {
110 110
   }, [list]);
111 111
 
112 112
   return (
113
-    <view>      
113
+    <view>
114 114
       <view className='index-navbar'>
115 115
         <CustomNav title='售后退款' />
116 116
       </view>
117
-      <View className='box-content'>
118
-      <scroll-view scroll-y style='height: calc(100vh - 65px);' >
119 117
 
120
-        <view className='Refund-Content-box'>
118
+      <View className='box-content '>
119
+        <scroll-view scroll-y style='height: calc(100vh - 65px);' >
121 120
 
122
-          <view className='title-image'>
123
-            <image
124
-              mode='scaleToFill'
125
-              className='title-image-cup'
126
-              src={BlackSpot}
127
-            />
128
-            <text className='title-title-boss'>商品信息</text>
121
+          <view className='Refund-Content-box'>
122
+
123
+            <view className='title-image'>
124
+              <image
125
+                mode='scaleToFill'
126
+                className='title-image-cup'
127
+                src={BlackSpot}
128
+              />
129
+              <text className='title-title-boss'>商品信息</text>
130
+            </view>
129 131
           </view>
130
-        </view>
131
-        {/* 商品信息结束 */}
132
-        <view>
133
-          {(list || []).map((item) => {
134
-            return (
135
-              <view class='wrapper' key={item.orderId}>
136
-                <view class='left-complete-one'>
137
-                  <image className='left-image-1' src={ProCard_hot}></image>
138
-                  <view className='left-viewText'>
139
-                    返现¥{formatPrice(item.cashback)}
140
-                  </view>
141
-                  <view className='title-image'>
142
-                    <image
143
-                      className='image-1'
144
-                      mode='scaleToFill'
145
-                      src={item.poster}
146
-                    ></image>
147
-                    <image className='image-2' src={food}></image>
148
-                  </view>
149
-                  <view className='title-content'>
150
-                    <view className='Pro-title'>
151
-                      <view className='title-text'>
152
-                        {item.packageDescription}
132
+          {/* 商品信息结束 */}
133
+          <view>
134
+            {(list || []).map((item) => {
135
+              return (
136
+                <view class='wrapper' key={item.orderId}>
137
+                  <view class='left-complete-one'>
138
+                    <image className='left-image-1' src={ProCard_hot}></image>
139
+                    <view className='left-viewText'>
140
+                      返现¥{formatPrice(item.cashback)}
141
+                    </view>
142
+                    <view className='title-image'>
143
+                      <image
144
+                        className='image-1'
145
+                        mode='scaleToFill'
146
+                        src={item.poster}
147
+                      ></image>
148
+                      <image className='image-2' src={food}></image>
149
+                    </view>
150
+                    <view className='title-content'>
151
+                      <view className='Pro-title'>
152
+                        <view className='title-text'>
153
+                          {item.packageDescription}
154
+                          <text className='title-money-2'>
155
+                            数量:{item.amount}张
156
+                          </text>
157
+                        </view>
158
+                      </view>
159
+                      <text className='title-money'>
160
+                        ¥{formatPrice(item.unitPrice)}元
153 161
                         <text className='title-money-2'>
154
-                          数量:{item.amount}张
162
+                          门市价{formatPrice(item.standardPrice)}元
155 163
                         </text>
156
-                      </view>
157
-                    </view>
158
-                    <text className='title-money'>
159
-                      ¥{formatPrice(item.unitPrice)}元
160
-                      <text className='title-money-2'>
161
-                        门市价{formatPrice(item.standardPrice)}元
162 164
                       </text>
163
-                    </text>
164
-                    <view className='title-time'>
165
-                      有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
166
-                      {formatTime(item.endTime, "yyyy/MM/dd")}
165
+                      <view className='title-time'>
166
+                        有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
167
+                        {formatTime(item.endTime, "yyyy/MM/dd")}
168
+                      </view>
167 169
                     </view>
168 170
                   </view>
171
+                  <view class='right-complete-two'>
172
+                    <view className='right-content'></view>
173
+                  </view>
169 174
                 </view>
170
-                <view class='right-complete-two'>
171
-                  <view className='right-content'></view>
172
-                </view>
173
-              </view>
174
-            );
175
-          })}
176
-        </view>
175
+              );
176
+            })}
177
+          </view>
177 178
 
178
-        {/* 卡片结束 */}
179
-        <view className='Refund-Content-box'>
180
-          <view className='title-image'>
181
-            <image
182
-              mode='scaleToFill'
183
-              className='title-image-cup'
184
-              src={BlackSpot}
185
-            />
186
-            <text className='title-title-boss'>退款原因</text>
179
+          {/* 卡片结束 */}
180
+          <view className='Refund-Content-box'>
181
+            <view className='title-image'>
182
+              <image
183
+                mode='scaleToFill'
184
+                className='title-image-cup'
185
+                src={BlackSpot}
186
+              />
187
+              <text className='title-title-boss'>退款原因</text>
188
+            </view>
189
+            {/* 退款结束 */}
190
+          </view>
191
+          <view className='Refund-content'>
192
+            {options.map((x) => {
193
+              return (
194
+                <text
195
+                  className={`Refund-star-view${x.key} ${checkeds.indexOf(x.key) > -1
196
+                    ? "bg2"
197
+                    : `Refund-star-view${x.key}`
198
+                    }`}
199
+                  key={x.key}
200
+                  onClick={() => viewOK(x)}
201
+                >
202
+                  {x.title}
203
+                </text>
204
+              );
205
+            })}
187 206
           </view>
188
-          {/* 退款结束 */}
189
-        </view>
190
-        <view className='Refund-content'>
191
-          {options.map((x) => {
192
-            return (
193
-              <text
194
-                className={`Refund-star-view${x.key} ${checkeds.indexOf(x.key) > -1
195
-                  ? "bg2"
196
-                  : `Refund-star-view${x.key}`
197
-                  }`}
198
-                key={x.key}
199
-                onClick={() => viewOK(x)}
200
-              >
201
-                {x.title}
202
-              </text>
203
-            );
204
-          })}
205
-        </view>
206 207
 
207
-        <view className='Refund-Content-box'>
208
-          <view className='title-image'>
209
-            <image
210
-              mode='scaleToFill'
211
-              className='title-image-cup'
212
-              src={BlackSpot}
208
+          <view className='Refund-Content-box'>
209
+            <view className='title-image'>
210
+              <image
211
+                mode='scaleToFill'
212
+                className='title-image-cup'
213
+                src={BlackSpot}
214
+              />
215
+              <text className='title-title-boss'>退款说明</text>
216
+            </view>
217
+          </view>
218
+          <view class='section'>
219
+            <Textarea
220
+              placeholder='请补充退款说明(选填)!'
221
+              onInput={(e) => setExplain(e.detail.value)}
222
+              confirm-type='done'
213 223
             />
214
-            <text className='title-title-boss'>退款说明</text>
215 224
           </view>
216
-        </view>
217
-        <view class='section'>
218
-          <Textarea
219
-            placeholder='请补充退款说明(选填)!'
220
-            onInput={(e) => setExplain(e.detail.value)}
221
-            confirm-type='done'
222
-          />
223
-        </view>
224
-        <view className='money-title'>
225
-          实付金额:{" "}
226
-          <text className='money-name'>{formatPrice(totalPrice.charges)}元</text>
227
-        </view>
228
-        <view className='money-title'>
229
-          已获返现:{" "}
230
-          <text className='money-name'>{formatPrice(totalPrice.cashback)}元</text>
231
-        </view>
232
-        <view className='money-title'>
233
-          退款金额:{" "}
234
-          <text className='money-name'>{formatPrice(totalPrice.refundPrice)}元</text>
235
-        </view>
236
-        <view className='ul-li-text'>
237
-          <view className='ul-li-view'></view>
238
-          <text className='ul-li-textname'>退款金额不可修改</text>
239
-        </view>
240
-        <view className='ul-li-text'>
241
-          <view className='ul-li-view'></view>
242
-          <text className='ul-li-textname'>
243
-            下单获得返现金额,会在退款时被扣除;
244
-          </text>
245
-        </view>
246
-        <view className='ul-li-text'>
247
-          <view className='ul-li-view'></view>
248
-          <text className='ul-li-textname'>退款将在七个工作日内原路退还。</text>
249
-        </view>
225
+          <view className='money-title'>
226
+            实付金额:{" "}
227
+            <text className='money-name'>{formatPrice(totalPrice.charges)}元</text>
228
+          </view>
229
+          <view className='money-title'>
230
+            已获返现:{" "}
231
+            <text className='money-name'>{formatPrice(totalPrice.cashback)}元</text>
232
+          </view>
233
+          <view className='money-title'>
234
+            退款金额:{" "}
235
+            <text className='money-name'>{formatPrice(totalPrice.refundPrice)}元</text>
236
+          </view>
237
+          <view className='ul-li-text'>
238
+            <view className='ul-li-view'></view>
239
+            <text className='ul-li-textname'>退款金额不可修改;</text>
240
+          </view>
241
+          <view className='ul-li-text'>
242
+            <view className='ul-li-view'></view>
243
+            <text className='ul-li-textname'>
244
+              下单获得返现金额,会在退款时被扣除;
245
+            </text>
246
+          </view>
247
+          <view className='ul-li-text'>
248
+            <view className='ul-li-view'></view>
249
+            <text className='ul-li-textname'>退款将在七个工作日内原路退还。</text>
250
+          </view>
251
+
252
+          <view className='button-info'>
253
+            <Button className='button-box' onClick={() => onRefund()}>
254
+              提交申请
255
+            </Button>
256
+          </view>
257
+        </scroll-view>
258
+
259
+      </View>
250 260
 
251
-        <view className='button-info'>
252
-          <Button className='button-box' onClick={() => onRefund()}>
253
-            提交申请
254
-          </Button>
255
-        </view>
256
-      </scroll-view>
257
-</View>
258 261
     </view >
259 262
   );
260 263
 });

+ 1
- 1
src/pages/MineUserAll/RefundMoney/CheckRefund/style.less ファイルの表示

@@ -116,7 +116,7 @@
116 116
             //必须要
117 117
             -webkit-line-clamp: 1;
118 118
             -webkit-box-orient: vertical;
119
-             /* 多出文本省略号代替 */
119
+            /* 多出文本省略号代替 */
120 120
             text-align: left;
121 121
             font-size: 24px;
122 122
           }

+ 1
- 0
src/pages/index/index.config.js ファイルの表示

@@ -11,5 +11,6 @@ export default {
11 11
     "mp-cells": "weui-miniprogram/cells/cells",
12 12
     "mp-dialog": "weui-miniprogram/dialog/dialog",
13 13
     "mp-slideview": "weui-miniprogram/slideview/slideview",
14
+    "add-tips": "../../components/add-tips/index"
14 15
   }
15 16
 }

+ 5
- 4
src/pages/index/index.jsx ファイルの表示

@@ -1,7 +1,7 @@
1 1
 
2 2
 
3 3
 import React, { useState, useEffect } from 'react'
4
-import { useDidShow } from '@tarojs/taro'
4
+import Taro, { useDidShow } from '@tarojs/taro'
5 5
 import CustomNav from '@/components/CustomNav'
6 6
 import logo from '@/assets/icons/comm/logo_small.png'
7 7
 import { getHotelDetail } from '@/services/landlord'
@@ -49,9 +49,7 @@ export default withLayout((props) => {
49 49
     }
50 50
   }, [tab])
51 51
 
52
-  useEffect(() => {
53 52
 
54
-  }, [])
55 53
 
56 54
   useEffect(() => {
57 55
     if (roomId) {
@@ -72,9 +70,12 @@ export default withLayout((props) => {
72 70
 
73 71
   }, [roomId, hotelId])
74 72
 
75
-
76 73
   return (
77 74
     <view className='page-index'>
75
+      <add-tips
76
+        logo={logo}
77
+        custom
78
+        duration={-1} />
78 79
       <view className='index-navbar'>
79 80
         <CustomNav logo={titleLogo} title={titleRoom} />
80 81
       </view>