Browse Source

cancelorder

xujing 5 years ago
parent
commit
bd559f9571

+ 4
- 4
config/dev.js View File

@@ -5,14 +5,14 @@ module.exports = {
5 5
   defineConstants: {
6 6
     // HOST: '"http://47.101.36.130:8085"',//测试
7 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 10
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
11 11
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
12 12
     // HOST: '"https://lt.pawoma.cn"',
13 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 16
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
17 17
     OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
18 18
     Version: 'V3.5.12'

+ 4
- 4
config/prod.js View File

@@ -3,10 +3,10 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 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 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12 12
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',

+ 2
- 2
src/onlineSelling/components/ConsultantItem/index.js View File

@@ -9,10 +9,10 @@ export default function CConsultantItem(props) {
9 9
   return (
10 10
     <View className="card-item" style={style}>
11 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 13
       <View className="phone">{data.phone}</View>
14 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 16
     </View >
17 17
   );
18 18
 }

+ 1
- 1
src/onlineSelling/components/RaiseCard/index.js View File

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

+ 2
- 2
src/onlineSelling/pages/detail/resultPage.js View File

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

+ 5
- 8
src/onlineSelling/pages/raiseMoney/index.js View File

@@ -289,16 +289,13 @@ export default class raiseMoney extends Component {
289 289
           paySign: res.sign,
290 290
 
291 291
           success(res) {
292
-            // TODO 缴费成功
293
-
294
-            // 调用远程接口
295
-
296
-
297 292
             // 最后
298 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 301
             reject()
@@ -322,7 +319,7 @@ export default class raiseMoney extends Component {
322 319
 
323 320
       // 缴费
324 321
       case 3:
325
-        this.makePay()
322
+        this.makePay().then()
326 323
         return;
327 324
 
328 325
       //

+ 78
- 33
src/onlineSelling/pages/raiseProfile/index.js View File

@@ -8,12 +8,13 @@ import ConsultantItem from '../../components/ConsultantItem/index'
8 8
 import NamedIcon from '../../components/NamedIcon'
9 9
 import RaiseCard from '../../components/RaiseCard'
10 10
 import { queryRaiseDetail } from '@/services/project'
11
-
12
-
11
+import { connect } from '@tarojs/redux'
12
+import * as noticeType from '@/constants/common.js'
13 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 18
   config = {
18 19
     navigationBarTitleText: '认筹单',
19 20
   }
@@ -22,7 +23,9 @@ export default class extends Component {
22 23
     buildingId: '',
23 24
     raiseDeatil: {},
24 25
     houseList: [],
25
-    raiseOrder: {}
26
+    raiseOrder: {},
27
+    orderDetail: {},
28
+    refundOrder: {},
26 29
   }
27 30
 
28 31
   componentWillMount() {
@@ -33,6 +36,8 @@ export default class extends Component {
33 36
         raiseDeatil: res.taRaiseRecord || {},
34 37
         houseList: res.houseList || [],
35 38
         raiseOrder: res.taRaise || {},
39
+        orderDetail: res.taOrder || {},
40
+        refundOrder: res.refundOrder || {},
36 41
       })
37 42
     })
38 43
   }
@@ -77,6 +82,7 @@ export default class extends Component {
77 82
 
78 83
   // 取消认购原因
79 84
   renderCancelReason() {
85
+    const { raiseDeatil } = this.state;
80 86
     return (
81 87
       <Block>
82 88
         <View className="cancelReason flexSpace">
@@ -85,8 +91,7 @@ export default class extends Component {
85 91
           </View>
86 92
           <View className="flexSpace-item" style="margin-left: 20px">
87 93
             <View>认筹单作废原因:</View>
88
-            <View className="gray">认筹单作废原因作废原因原因认筹单作废原因作废原因原因
89
-              认筹单作废原因作废原因原因认筹单作废原因作废原因原因</View>
94
+            <View className="gray">{raiseDeatil.invalidReason}</View>
90 95
           </View>
91 96
         </View>
92 97
         <View className="hr"></View>
@@ -112,53 +117,93 @@ export default class extends Component {
112 117
           </View>
113 118
           <View className="flexSpace-fixed">
114 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 121
           </View>
117 122
         </View>
118 123
         <View className="hr"></View>
119 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 171
   render() {
124
-    const { buildingId, raiseDeatil } = this.state;
172
+    const { buildingId, raiseDeatil, orderDetail, refundOrder } = this.state;
173
+
125 174
 
126 175
     // 认筹信息
127 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 183
     const payInfo = [
135 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 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 200
     const otherInfo = [
152 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 208
     return (
164 209
       <View className="raiseProfilePage">
@@ -169,12 +214,12 @@ export default class extends Component {
169 214
           {raiseDeatil.payStatus == 'unpaid' && this.renderUnpayNotice()}
170 215
           <View>
171 216
             <CellBlock dataset={raiseInfo} />
172
-            <ConsultantItem
173
-              data={consultantInfo}
217
+            {raiseDeatil.consultantInfo && <ConsultantItem
218
+              data={raiseDeatil.consultantInfo}
174 219
               type="raiseProfile"
175 220
               style="height:140rpx;margin-bottom:0rpx;width:690rpx"
176
-              onClick={this.handleItemClick}>
177
-            </ConsultantItem>
221
+              contactClick={() => this.handleChatClick(raiseDeatil.consultantInfo)}
222
+            />}
178 223
             <View className="hr" />
179 224
             {raiseDeatil.payStatus == 'paid' &&
180 225
               <Block>