|
@@ -29,7 +29,7 @@
|
29
|
29
|
</div>
|
30
|
30
|
</div>
|
31
|
31
|
</div>
|
32
|
|
- {{curExternalContactInfo}}
|
|
32
|
+ {{self_url}}
|
33
|
33
|
<div class="sidePadding marginTop6">
|
34
|
34
|
<div class="titleBox">
|
35
|
35
|
<div class="title">客户标签</div>
|
|
@@ -119,7 +119,8 @@ import tag from '@/components/tag.vue'
|
119
|
119
|
import noData from '@/components/noData.vue'
|
120
|
120
|
import { Dialog,Toast } from 'vant';
|
121
|
121
|
import getWxConfig from '@/utils/getWxConfig';
|
122
|
|
-import {ref, onMounted, getCurrentInstance} from "vue";
|
|
122
|
+import {ref, onMounted, onBeforeMount, getCurrentInstance} from "vue";
|
|
123
|
+import { getQueryString } from '@/utils/common'
|
123
|
124
|
export default {
|
124
|
125
|
components: {
|
125
|
126
|
noData,
|
|
@@ -137,17 +138,32 @@ export default {
|
137
|
138
|
const updataTag = ref([])
|
138
|
139
|
const h5CustomerDynamicList = ref([])
|
139
|
140
|
const h5CustomerOrderList = ref([])
|
140
|
|
- const curExternalContactInfo = ref(null)
|
141
|
|
- const configInfo = {
|
142
|
|
- corpid:'wwc8d3e33f8e096671',
|
143
|
|
- external_userid:'wmezvKNwAAF17OWc13Hg6X0ob31ijZmg',
|
144
|
|
- user_id:'bc85094e2cfd56a8bd6cd726bd98b14b'
|
145
|
|
- }
|
146
|
|
- onMounted(() => {//组件挂载之前
|
147
|
|
- getWxConfig(()=>{
|
148
|
|
- console.log('hhhh')
|
149
|
|
- getCurExternalContact()
|
150
|
|
- });
|
|
141
|
+ const configInfo = ref(null)
|
|
142
|
+ const self_url = ref()
|
|
143
|
+ // const configInfo = {
|
|
144
|
+ // corpid:'wwc8d3e33f8e096671',
|
|
145
|
+ // external_userid:'wmezvKNwAAF17OWc13Hg6X0ob31ijZmg',
|
|
146
|
+ // user_id:'bc85094e2cfd56a8bd6cd726bd98b14b'
|
|
147
|
+ // }
|
|
148
|
+ onBeforeMount(() => {//组件挂载之前
|
|
149
|
+ if(getQueryString('againJump')){
|
|
150
|
+ getWxConfig(()=>{
|
|
151
|
+ self_url.value = window.location.href
|
|
152
|
+ getCurExternalContact()//获取企业外部联系人ID
|
|
153
|
+ });
|
|
154
|
+ }else{//获取用户信息
|
|
155
|
+ getWxConfig((authInfo)=>{
|
|
156
|
+ let url = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${authInfo.corpid}&redirect_uri=${window.location.href+'&againJump=true'}&response_type=code&scope=snsapi_base&state=&agentid=${authInfo.agent_id}#wechat_redirect`;
|
|
157
|
+ let link = document.createElement("a");
|
|
158
|
+ link.href = url;
|
|
159
|
+ document.body.appendChild(link);
|
|
160
|
+ link.click();
|
|
161
|
+ document.body.removeChild(link);
|
|
162
|
+ });
|
|
163
|
+ }
|
|
164
|
+ });
|
|
165
|
+ onMounted(() => {//DOM挂载完成
|
|
166
|
+
|
151
|
167
|
|
152
|
168
|
// (proxy as any).$getAuthInfo(()=>{
|
153
|
169
|
// console.log('hhhh')
|
|
@@ -178,9 +194,9 @@ export default {
|
178
|
194
|
return v.tag_md5
|
179
|
195
|
});
|
180
|
196
|
(proxy as any).$axios.post("/api/h5/portrait/h5CustomerTagUpdate", {
|
181
|
|
- corpid:configInfo.corpid,
|
182
|
|
- external_userid:configInfo.external_userid,
|
183
|
|
- user_id:configInfo.user_id,
|
|
197
|
+ corpid:configInfo.value.value.corpid,
|
|
198
|
+ external_userid:configInfo.value.external_userid,
|
|
199
|
+ user_id:configInfo.value.user_id,
|
184
|
200
|
selected_tag_id_list:selected_tag_id_list
|
185
|
201
|
},true).then((res) => {
|
186
|
202
|
tag_visible.value = false;
|
|
@@ -191,9 +207,9 @@ export default {
|
191
|
207
|
}
|
192
|
208
|
function get_user_info(){//获取客户信息
|
193
|
209
|
(proxy as any).$axios.get("/api/h5/portrait/customerDetail", {
|
194
|
|
- corpid:configInfo.corpid,
|
195
|
|
- external_userid:configInfo.external_userid,
|
196
|
|
- user_id:configInfo.user_id,
|
|
210
|
+ corpid:configInfo.value.corpid,
|
|
211
|
+ external_userid:configInfo.value.external_userid,
|
|
212
|
+ user_id:configInfo.value.user_id,
|
197
|
213
|
},true).then((res) => {
|
198
|
214
|
//请求成功
|
199
|
215
|
let data = res.rst;
|
|
@@ -206,9 +222,9 @@ export default {
|
206
|
222
|
}
|
207
|
223
|
function get_h5CustomerDynamicList(){//客户画像-动态
|
208
|
224
|
(proxy as any).$axios.get("/api/h5/portrait/h5CustomerDynamicList",{
|
209
|
|
- corpid:configInfo.corpid,
|
210
|
|
- external_userid:configInfo.external_userid,
|
211
|
|
- user_id:configInfo.user_id,
|
|
225
|
+ corpid:configInfo.value.corpid,
|
|
226
|
+ external_userid:configInfo.value.external_userid,
|
|
227
|
+ user_id:configInfo.value.user_id,
|
212
|
228
|
},true).then((res) => {
|
213
|
229
|
//请求成功
|
214
|
230
|
let data = res.rst;
|
|
@@ -219,9 +235,9 @@ export default {
|
219
|
235
|
}
|
220
|
236
|
function get_h5CustomerOrderList(){//客户画像-订单
|
221
|
237
|
(proxy as any).$axios.get("/api/h5/portrait/h5CustomerOrderList", {
|
222
|
|
- corpid:configInfo.corpid,
|
223
|
|
- external_userid:configInfo.external_userid,
|
224
|
|
- user_id:configInfo.user_id,
|
|
238
|
+ corpid:configInfo.value.corpid,
|
|
239
|
+ external_userid:configInfo.value.external_userid,
|
|
240
|
+ user_id:configInfo.value.user_id,
|
225
|
241
|
page:1,
|
226
|
242
|
page_size:20,
|
227
|
243
|
},true).then((res) => {
|
|
@@ -232,13 +248,14 @@ export default {
|
232
|
248
|
console.log(err,'err')
|
233
|
249
|
})
|
234
|
250
|
}
|
|
251
|
+ function wx_getuserinfo(){//获取访问用户身份
|
|
252
|
+
|
|
253
|
+ }
|
235
|
254
|
function getCurExternalContact(){//获取当前外部联系人userid
|
236
|
255
|
wx.invoke('getCurExternalContact', {
|
237
|
256
|
}, function(res){
|
238
|
|
- curExternalContactInfo.value = res;
|
239
|
257
|
if(res.err_msg == "getCurExternalContact:ok"){
|
240
|
|
- console.log(res);
|
241
|
|
-
|
|
258
|
+ configInfo.value.external_userid = res.userId;
|
242
|
259
|
}else {
|
243
|
260
|
//错误处理
|
244
|
261
|
}
|
|
@@ -255,18 +272,10 @@ export default {
|
255
|
272
|
userInfo,
|
256
|
273
|
h5CustomerDynamicList,
|
257
|
274
|
h5CustomerOrderList,
|
258
|
|
- curExternalContactInfo,
|
|
275
|
+ self_url,
|
259
|
276
|
confirm_tag,
|
260
|
277
|
onBeforeClose,
|
261
|
278
|
_closeTag,
|
262
|
|
- theadList: [
|
263
|
|
- { name: '订单ID', width: '28%' },
|
264
|
|
- { name: '商品' },
|
265
|
|
- { name: '创建时间' },
|
266
|
|
- { name: '付款状态' },
|
267
|
|
- { name: '订单金额' },
|
268
|
|
- ],
|
269
|
|
- orderList: [{ "order_id": "62322a7c89ae2416ab9cda4", "pay_money": 9.9, "created_ts": "2022-05-02 23:03", "pay_status": 1, "playlet_name": "极品仙婿" }],
|
270
|
279
|
}
|
271
|
280
|
},
|
272
|
281
|
}
|