|
@@ -88,21 +88,21 @@
|
88
|
88
|
</div>
|
89
|
89
|
</div>
|
90
|
90
|
</div>
|
91
|
|
- <div class="order_con" v-if="user_tab==2">
|
|
91
|
+ <van-list v-model:loading="order_loading" class="order_con" v-if="user_tab==2" :finished="order_finished" finished-text="没有更多了" @load="get_h5CustomerOrderList" :immediate-check="false">
|
92
|
92
|
<noData v-if="h5CustomerOrderList.length<=0"></noData>
|
93
|
93
|
<table class="tableCon" v-else>
|
94
|
94
|
<thead>
|
95
|
95
|
<tr>
|
96
|
96
|
<th>订单ID</th>
|
97
|
|
- <th style="width: 250px">商品</th>
|
98
|
|
- <th style="width: 200px">创建时间</th>
|
99
|
|
- <th style="width: 250px">付款状态</th>
|
100
|
|
- <th style="width: 200px">订单金额</th>
|
|
97
|
+ <th style="width: 25%">商品</th>
|
|
98
|
+ <th style="width: 20%">创建时间</th>
|
|
99
|
+ <th style="width: 15%">付款状态</th>
|
|
100
|
+ <th style="width: 15%">订单金额</th>
|
101
|
101
|
</tr>
|
102
|
102
|
</thead>
|
103
|
103
|
<template v-if="tableData&&tableData.length>0">
|
104
|
104
|
<tbody>
|
105
|
|
- <tr v-for="(item,) in h5CustomerOrderList">
|
|
105
|
+ <tr v-for="(item) in h5CustomerOrderList" :key="item.order_id">
|
106
|
106
|
<td>{{item.order_id}} </td>
|
107
|
107
|
<td>{{item.playlet_name}} </td>
|
108
|
108
|
<td>{{item.created_ts}}</td>
|
|
@@ -111,8 +111,8 @@
|
111
|
111
|
</tr>
|
112
|
112
|
</tbody>
|
113
|
113
|
</template>
|
114
|
|
- </table>
|
115
|
|
- </div>
|
|
114
|
+ </table>
|
|
115
|
+ </van-list>
|
116
|
116
|
</div>
|
117
|
117
|
</div>
|
118
|
118
|
</div>
|
|
@@ -157,25 +157,31 @@ export default {
|
157
|
157
|
const pageLoading = ref(false)
|
158
|
158
|
const showPopover = ref(false)
|
159
|
159
|
const getUserInfoFlag = ref(true)//获取企微用户授权,是否被允许
|
|
160
|
+ const order_loading = ref(false)
|
|
161
|
+ const order_finished = ref(false);
|
|
162
|
+ const page = ref(0)
|
|
163
|
+ const page_size = ref(20)
|
|
164
|
+ const total = ref(-1)
|
|
165
|
+ const pages = ref(0)
|
160
|
166
|
const configInfo = reactive({
|
161
|
|
- // corpid:'',
|
162
|
|
- // external_userid:'',
|
163
|
|
- // user_id:'',
|
164
|
|
- corpid:'ww27940915d8fbfbe6',
|
165
|
|
- external_userid:'wm5xsRBwAAC_qqbdzn-IVkN5ojRwM1qQ',
|
166
|
|
- user_id:'8a82d12ae22e0cedd81ae297a2e7c1fa'
|
|
167
|
+ corpid:'',
|
|
168
|
+ external_userid:'',
|
|
169
|
+ user_id:'',
|
|
170
|
+ // corpid:'ww27940915d8fbfbe6',
|
|
171
|
+ // external_userid:'wm5xsRBwAAC_qqbdzn-IVkN5ojRwM1qQ',
|
|
172
|
+ // user_id:'8a82d12ae22e0cedd81ae297a2e7c1fa'
|
167
|
173
|
})
|
168
|
174
|
onBeforeMount(() => {//组件挂载之前
|
169
|
|
- pageLoading.value = true;
|
170
|
|
- get_data_init()
|
171
|
|
- return;
|
|
175
|
+ // pageLoading.value = true;
|
|
176
|
+ // get_data_init()
|
|
177
|
+ // return;
|
172
|
178
|
if(getQueryString('againJump')){
|
173
|
179
|
configInfo.corpid = getQueryString('corpid')
|
174
|
180
|
getWxConfig(()=>{
|
175
|
181
|
getCurExternalContact()//获取企业外部联系人ID
|
176
|
182
|
});
|
177
|
183
|
}else{//获取用户信息
|
178
|
|
- getWxConfig((authInfo)=>{
|
|
184
|
+ getWxConfig('',(authInfo)=>{
|
179
|
185
|
let redirect_uri = encodeURIComponent(window.location.href+'&againJump=true')
|
180
|
186
|
let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${authInfo.corpid}&redirect_uri=${redirect_uri}&response_type=code&scope=snsapi_base&state=1&agentid=${authInfo.agent_id}#wechat_redirect`;
|
181
|
187
|
let link = document.createElement("a");
|
|
@@ -260,16 +266,30 @@ export default {
|
260
|
266
|
}
|
261
|
267
|
function get_h5CustomerOrderList(){//客户画像-订单
|
262
|
268
|
return new Promise((resolve,reject)=>{
|
|
269
|
+ // 数据全部加载完成
|
|
270
|
+ if (total.value != -1 && page.value >= pages.value) {
|
|
271
|
+ order_finished.value = true;
|
|
272
|
+ resolve('')
|
|
273
|
+ return
|
|
274
|
+ }
|
|
275
|
+ page.value = page.value + 1;
|
263
|
276
|
(proxy as any).$axios.get("/api/h5/portrait/h5CustomerOrderList", {
|
264
|
277
|
corpid:configInfo.corpid,
|
265
|
278
|
external_userid:configInfo.external_userid,
|
266
|
279
|
user_id:configInfo.user_id,
|
267
|
|
- page:1,
|
268
|
|
- page_size:20,
|
|
280
|
+ page: page.value,
|
|
281
|
+ page_size: page_size.value,
|
269
|
282
|
},true).then((res) => {
|
270
|
283
|
//请求成功
|
271
|
284
|
let data = res.rst;
|
272
|
|
- h5CustomerOrderList.value = data.data;
|
|
285
|
+ if(page.value == 1){
|
|
286
|
+ h5CustomerOrderList.value = []
|
|
287
|
+ }
|
|
288
|
+ h5CustomerOrderList.value = h5CustomerOrderList.value.concat(data.data);
|
|
289
|
+ total.value = data.pageInfo.total;
|
|
290
|
+ pages.value = data.pageInfo.pages;
|
|
291
|
+ // 加载状态结束
|
|
292
|
+ order_loading.value = false;
|
273
|
293
|
resolve('')
|
274
|
294
|
}).catch( err => {
|
275
|
295
|
console.log(err,'err')
|
|
@@ -340,10 +360,13 @@ export default {
|
340
|
360
|
h5CustomerOrderList,
|
341
|
361
|
showPopover,
|
342
|
362
|
getUserInfoFlag,
|
|
363
|
+ order_loading,
|
|
364
|
+ order_finished,
|
343
|
365
|
confirm_tag,
|
344
|
366
|
onBeforeClose,
|
345
|
367
|
_closeTag,
|
346
|
|
- getCurExternalContact
|
|
368
|
+ getCurExternalContact,
|
|
369
|
+ get_h5CustomerOrderList
|
347
|
370
|
}
|
348
|
371
|
},
|
349
|
372
|
}
|