瀏覽代碼

cancelorder

xujing 5 年之前
父節點
當前提交
bd559f9571

+ 4
- 4
config/dev.js 查看文件

5
   defineConstants: {
5
   defineConstants: {
6
     // HOST: '"http://47.101.36.130:8085"',//测试
6
     // HOST: '"http://47.101.36.130:8085"',//测试
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    HOST: '"https://dev.pawoma.cn"',//测试
9
-    WSS_HOST: '"wss://dev.pawoma.cn"',
8
+    // HOST: '"https://dev.pawoma.cn"',//测试
9
+    // WSS_HOST: '"wss://dev.pawoma.cn"',
10
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
10
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
11
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
11
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
12
     // HOST: '"https://lt.pawoma.cn"',
12
     // HOST: '"https://lt.pawoma.cn"',
13
     // WSS_HOST: '"wss://lt.pawoma.cn"',
13
     // WSS_HOST: '"wss://lt.pawoma.cn"',
14
-    // HOST: '"http://192.168.2.52:8080"',
15
-    // WSS_HOST: '"ws://192.168.2.52:8080"',
14
+    HOST: '"http://192.168.2.52:8080"',
15
+    WSS_HOST: '"ws://192.168.2.52:8080"',
16
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
16
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
17
     OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
17
     OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
18
     Version: 'V3.5.12'
18
     Version: 'V3.5.12'

+ 4
- 4
config/prod.js 查看文件

3
     NODE_ENV: '"production"'
3
     NODE_ENV: '"production"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    // HOST: '"http://192.168.2.52:8080"',
7
-    // WSS_HOST: '"ws://192.168.2.52:8080"',
8
-    HOST: '"https://dev.pawoma.cn"',// 新测试
9
-    WSS_HOST: '"wss://dev.pawoma.cn"',
6
+    HOST: '"http://192.168.2.52:8080"',
7
+    WSS_HOST: '"ws://192.168.2.52:8080"',
8
+    // HOST: '"https://dev.pawoma.cn"',// 新测试
9
+    // WSS_HOST: '"wss://dev.pawoma.cn"',
10
     // HOST: '"https://lt.pawoma.cn"',
10
     // HOST: '"https://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
12
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',

+ 2
- 2
src/onlineSelling/components/ConsultantItem/index.js 查看文件

9
   return (
9
   return (
10
     <View className="card-item" style={style}>
10
     <View className="card-item" style={style}>
11
       <Image src={data.photo || data.avatar} className='avatar' ></Image>
11
       <Image src={data.photo || data.avatar} className='avatar' ></Image>
12
-      <View className="name">{data.name}<Image src={require('@/assets/person/card.png')} className='card' ></Image>{type == 'raiseProfile' && <View className="tip">您的专属置业顾问</View>}</View>
12
+      <View className="name">{data.name || data.userName}<Image src={require('@/assets/person/card.png')} className='card' ></Image>{type == 'raiseProfile' && <View className="tip">您的专属置业顾问</View>}</View>
13
       <View className="phone">{data.phone}</View>
13
       <View className="phone">{data.phone}</View>
14
       {!type && <View className="home">主页</View>}
14
       {!type && <View className="home">主页</View>}
15
-      {type == 'raiseProfile' && <View className="contact">联系我<Text className="right-icon"></Text></View>}
15
+      {type == 'raiseProfile' && <View className="contact" onClick={props.contactClick}>联系我<Text className="right-icon"></Text></View>}
16
     </View >
16
     </View >
17
   );
17
   );
18
 }
18
 }

+ 1
- 1
src/onlineSelling/components/RaiseCard/index.js 查看文件

46
   }
46
   }
47
   return (
47
   return (
48
     <View className="housecard" style={props.style} >
48
     <View className="housecard" style={props.style} >
49
-      <View className="head">
49
+      <View className="head" onClick={props.handleCard}>
50
         {thumb ? <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" /> :
50
         {thumb ? <Image className="thumb" src={transferImage((buildingImgList)[0].url)} mode="aspectFit" /> :
51
           <Text style="font-size:26rpx;color:#666">暂无户型图</Text>
51
           <Text style="font-size:26rpx;color:#666">暂无户型图</Text>
52
         }
52
         }

+ 2
- 2
src/onlineSelling/pages/detail/resultPage.js 查看文件

9
   ({ user }) => ({ ...user })
9
   ({ user }) => ({ ...user })
10
 )
10
 )
11
 
11
 
12
-export default class Index extends Component {
12
+export default class resultPage extends Component {
13
   config = {
13
   config = {
14
     navigationBarTitleText: '',
14
     navigationBarTitleText: '',
15
   }
15
   }
77
         {type != 'add' && <View className="status">{status == 1 ? '取消成功' : status == 2 ? '正在处理' : '取消失败'}</View>}
77
         {type != 'add' && <View className="status">{status == 1 ? '取消成功' : status == 2 ? '正在处理' : '取消失败'}</View>}
78
         <View className="tip" style="margin-bottom:10rpx">{statusText}</View>
78
         <View className="tip" style="margin-bottom:10rpx">{statusText}</View>
79
         {statusText2 && <View className="tip">{statusText2}</View>}
79
         {statusText2 && <View className="tip">{statusText2}</View>}
80
-        <ContactConsultant  buildingId={buildingId} style=" position: absolute;bottom: 8vh;" />
80
+        <ContactConsultant buildingId={buildingId} style=" position: absolute;bottom: 8vh;" />
81
       </View>
81
       </View>
82
 
82
 
83
     );
83
     );

+ 5
- 8
src/onlineSelling/pages/raiseMoney/index.js 查看文件

289
           paySign: res.sign,
289
           paySign: res.sign,
290
 
290
 
291
           success(res) {
291
           success(res) {
292
-            // TODO 缴费成功
293
-
294
-            // 调用远程接口
295
-
296
-
297
             // 最后
292
             // 最后
298
             resolve()
293
             resolve()
299
           },
294
           },
300
-          fail(res) {
301
-            // TODO 缴费失败
295
+          fail(err) {
296
+            console.log(err, "errrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr")
297
+
298
+            cancelOrder(params).then(res => { })
302
 
299
 
303
             // 然后
300
             // 然后
304
             reject()
301
             reject()
322
 
319
 
323
       // 缴费
320
       // 缴费
324
       case 3:
321
       case 3:
325
-        this.makePay()
322
+        this.makePay().then()
326
         return;
323
         return;
327
 
324
 
328
       //
325
       //

+ 78
- 33
src/onlineSelling/pages/raiseProfile/index.js 查看文件

8
 import NamedIcon from '../../components/NamedIcon'
8
 import NamedIcon from '../../components/NamedIcon'
9
 import RaiseCard from '../../components/RaiseCard'
9
 import RaiseCard from '../../components/RaiseCard'
10
 import { queryRaiseDetail } from '@/services/project'
10
 import { queryRaiseDetail } from '@/services/project'
11
-
12
-
11
+import { connect } from '@tarojs/redux'
12
+import * as noticeType from '@/constants/common.js'
13
 import './index.scss'
13
 import './index.scss'
14
-import consultant from 'dist/components/consultant'
15
 
14
 
16
-export default class extends Component {
15
+@connect(({ user }) => ({ user }))
16
+
17
+export default class Raise extends Component {
17
   config = {
18
   config = {
18
     navigationBarTitleText: '认筹单',
19
     navigationBarTitleText: '认筹单',
19
   }
20
   }
22
     buildingId: '',
23
     buildingId: '',
23
     raiseDeatil: {},
24
     raiseDeatil: {},
24
     houseList: [],
25
     houseList: [],
25
-    raiseOrder: {}
26
+    raiseOrder: {},
27
+    orderDetail: {},
28
+    refundOrder: {},
26
   }
29
   }
27
 
30
 
28
   componentWillMount() {
31
   componentWillMount() {
33
         raiseDeatil: res.taRaiseRecord || {},
36
         raiseDeatil: res.taRaiseRecord || {},
34
         houseList: res.houseList || [],
37
         houseList: res.houseList || [],
35
         raiseOrder: res.taRaise || {},
38
         raiseOrder: res.taRaise || {},
39
+        orderDetail: res.taOrder || {},
40
+        refundOrder: res.refundOrder || {},
36
       })
41
       })
37
     })
42
     })
38
   }
43
   }
77
 
82
 
78
   // 取消认购原因
83
   // 取消认购原因
79
   renderCancelReason() {
84
   renderCancelReason() {
85
+    const { raiseDeatil } = this.state;
80
     return (
86
     return (
81
       <Block>
87
       <Block>
82
         <View className="cancelReason flexSpace">
88
         <View className="cancelReason flexSpace">
85
           </View>
91
           </View>
86
           <View className="flexSpace-item" style="margin-left: 20px">
92
           <View className="flexSpace-item" style="margin-left: 20px">
87
             <View>认筹单作废原因:</View>
93
             <View>认筹单作废原因:</View>
88
-            <View className="gray">认筹单作废原因作废原因原因认筹单作废原因作废原因原因
89
-              认筹单作废原因作废原因原因认筹单作废原因作废原因原因</View>
94
+            <View className="gray">{raiseDeatil.invalidReason}</View>
90
           </View>
95
           </View>
91
         </View>
96
         </View>
92
         <View className="hr"></View>
97
         <View className="hr"></View>
112
           </View>
117
           </View>
113
           <View className="flexSpace-fixed">
118
           <View className="flexSpace-fixed">
114
             <Text className="a-line">认筹金额</Text>
119
             <Text className="a-line">认筹金额</Text>
115
-            <Text className="a-line price">{raiseOrder.raisePrice}元</Text>
120
+            <Text className="a-line price">{this.regFenToYuan(raiseOrder.raisePrice)}元</Text>
116
           </View>
121
           </View>
117
         </View>
122
         </View>
118
         <View className="hr"></View>
123
         <View className="hr"></View>
119
       </Block>
124
       </Block>
120
     )
125
     )
121
   }
126
   }
122
-
127
+  handleChatClick(item) {
128
+
129
+    const { user: { userInfo: { miniApp: { tpls }, person: { personId, nickname, name } } } } = this.props
130
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
131
+    wx.requestSubscribeMessage({
132
+      tmplIds: [tplId],
133
+      success(res) {
134
+      },
135
+      fail(res) {
136
+
137
+      },
138
+      complete() {
139
+        Taro.navigateTo({
140
+          url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.consultantPersonId}&receiverName=${encodeURIComponent(item.name || item.nickname || item.userName)}`
141
+        })
142
+      }
143
+    })
144
+  }
145
+  toDecimal2 = (x) => {
146
+    var f = parseFloat(x);
147
+    if (isNaN(f)) {
148
+      return false;
149
+    }
150
+    var f = Math.round(x * 100) / 100;
151
+    var s = f.toString();
152
+    var rs = s.indexOf('.');
153
+    if (rs < 0) {
154
+      rs = s.length;
155
+      s += '.';
156
+    }
157
+    while (s.length <= rs + 2) {
158
+      s += '0';
159
+    }
160
+    return s;
161
+  }
162
+  regFenToYuan = (fen) => {
163
+    var num = fen;
164
+    num = fen * 0.01;
165
+    num += '';
166
+    var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
167
+    num = num.replace(reg, '$1');
168
+    num = this.toDecimal2(num)
169
+    return num
170
+  };
123
   render() {
171
   render() {
124
-    const { buildingId, raiseDeatil } = this.state;
172
+    const { buildingId, raiseDeatil, orderDetail, refundOrder } = this.state;
173
+
125
 
174
 
126
     // 认筹信息
175
     // 认筹信息
127
     const raiseInfo = [
176
     const raiseInfo = [
128
-      { head: '认筹人', body: `${raiseDeatil.name || ''}`, },
129
-      { head: '身份证号', body: `${raiseDeatil.idcard || ''}` },
130
-      { head: '手机号', body: `${raiseDeatil.tel || ''}` },
177
+      { head: '认筹人', body: raiseDeatil.name || '', },
178
+      { head: '身份证号', body: raiseDeatil.idcard || '' },
179
+      { head: '手机号', body: raiseDeatil.tel || '' },
131
     ]
180
     ]
132
 
181
 
133
     // 缴费信息
182
     // 缴费信息
134
     const payInfo = [
183
     const payInfo = [
135
       { head: '缴费方式', body: `${raiseDeatil.payType == 'onLine' ? '线上缴费' : '线下缴费'}` },
184
       { head: '缴费方式', body: `${raiseDeatil.payType == 'onLine' ? '线上缴费' : '线下缴费'}` },
136
-      { head: '实际支付费用', body: '234元' },
137
-      { head: '缴费成功时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
185
+      { head: '实际支付费用', body: this.regFenToYuan(orderDetail.totalFee) },
186
+      { head: '缴费成功时间', body: dayjs(orderDetail.payTime).format('YYYY/MM/DD HH:mm:ss') },
138
     ]
187
     ]
139
 
188
 
140
     // 退费信息
189
     // 退费信息
141
     const refundInfo = [
190
     const refundInfo = [
142
-      { head: '退费状态', body: '退费中/退费完成' },
143
-      { head: '退费结果', body: '成功/失败' },
144
-      { head: '退费发起时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
145
-      { head: '实退费用', body: '234元' },
146
-      { head: '退费到账时间', body: dayjs('2020-2-28 17:12:48').format('YYYY/MM/DD HH:mm:ss') },
147
-      { head: '退费原因', desc: '无效原因无效原因无效原因无效原因无效原因无效原因无效原因无效原因无效原因无效原因' },
191
+      { head: '退费状态', body: refundOrder.payStatus == 'refunded' ? '退费完成' : '退费中' },
192
+      { head: '退费结果', body: refundOrder.payStatus == 'refunded' ? '成功' : '失败' },
193
+      { head: '退费发起时间', body: dayjs(refundOrder.createDate).format('YYYY/MM/DD HH:mm:ss') },
194
+      { head: '实退费用', body: this.regFenToYuan(refundOrder.totalFee) },
195
+      { head: '退费到账时间', body: dayjs(refundOrder.payTime).format('YYYY/MM/DD HH:mm:ss') },
196
+      { head: '退费原因', desc: raiseDeatil.refundReason },
148
     ]
197
     ]
149
 
198
 
150
     // 其他信息
199
     // 其他信息
151
     const otherInfo = [
200
     const otherInfo = [
152
       { head: '其他信息', body: '供核对数据使用' },
201
       { head: '其他信息', body: '供核对数据使用' },
153
-      { head: '认筹单编号', body: `${raiseDeatil.raiseRecordId}`, action: true },
154
-      { head: '缴费单编号', body: '234567890-09876543456', action: true, hide: `${raiseDeatil.payStatus == 'paid' ? false : true}` },
155
-      { head: '退费单编号', body: '234567890-09876543423', action: true, hide: `${raiseDeatil.payStatus == 'refunded' ? false : true}` },
202
+      { head: '认筹单编号', body: raiseDeatil.raiseRecordId || '', action: true },
203
+      { head: '缴费单编号', body: orderDetail.tradeNo || '', action: true, hide: raiseDeatil.payStatus != 'paid' },
204
+      { head: '退费单编号', body: refundOrder.refundNo || '', action: true, hide: raiseDeatil.payStatus != 'refunded' },
156
     ]
205
     ]
157
-    const consultantInfo = {
158
-      name: '哈哈哈1',
159
-      phone: '138541369741',
160
-      avatar: 'http://img5.imgtn.bdimg.com/it/u=3299138037,391931528&fm=26&gp=0.jpg'
161
-    }
206
+
162
 
207
 
163
     return (
208
     return (
164
       <View className="raiseProfilePage">
209
       <View className="raiseProfilePage">
169
           {raiseDeatil.payStatus == 'unpaid' && this.renderUnpayNotice()}
214
           {raiseDeatil.payStatus == 'unpaid' && this.renderUnpayNotice()}
170
           <View>
215
           <View>
171
             <CellBlock dataset={raiseInfo} />
216
             <CellBlock dataset={raiseInfo} />
172
-            <ConsultantItem
173
-              data={consultantInfo}
217
+            {raiseDeatil.consultantInfo && <ConsultantItem
218
+              data={raiseDeatil.consultantInfo}
174
               type="raiseProfile"
219
               type="raiseProfile"
175
               style="height:140rpx;margin-bottom:0rpx;width:690rpx"
220
               style="height:140rpx;margin-bottom:0rpx;width:690rpx"
176
-              onClick={this.handleItemClick}>
177
-            </ConsultantItem>
221
+              contactClick={() => this.handleChatClick(raiseDeatil.consultantInfo)}
222
+            />}
178
             <View className="hr" />
223
             <View className="hr" />
179
             {raiseDeatil.payStatus == 'paid' &&
224
             {raiseDeatil.payStatus == 'paid' &&
180
               <Block>
225
               <Block>