Browse Source

用户详情

xiuli.gao 2 years ago
parent
commit
3d2c13ed02

BIN
.DS_Store


+ 0 - 1
project/src/components/customOperate/sideTool/userPortrait.vue

@@ -5,7 +5,6 @@
5 5
       <el-button type="primary" size="mini" @click="copy">复制链接</el-button>
6 6
       <div class="f12 line18 lMar8 c-FE9">
7 7
         <p>*上下拖动列表可调节信息位置</p>
8
-        <p>*请先设置好客户信息后复制链接</p>
9 8
       </div>
10 9
     </div>
11 10
     <div class="flex-start" style=" margin-top: 20px;">

File diff suppressed because it is too large
+ 1 - 0
qwh5/dist/css/agreement.3ed8f786.css


File diff suppressed because it is too large
+ 0 - 1
qwh5/dist/css/agreement.67fda234.css


File diff suppressed because it is too large
+ 0 - 1
qwh5/dist/css/app.43958aba.css


File diff suppressed because it is too large
+ 1 - 0
qwh5/dist/css/app.97ef9e53.css


File diff suppressed because it is too large
+ 1 - 0
qwh5/dist/css/userPortrait.01d3d5be.css


File diff suppressed because it is too large
+ 0 - 1
qwh5/dist/css/userPortrait.403554cc.css


File diff suppressed because it is too large
+ 1 - 1
qwh5/dist/index.html


File diff suppressed because it is too large
+ 0 - 1
qwh5/dist/js/app.39500963.js


File diff suppressed because it is too large
+ 1 - 0
qwh5/dist/js/app.81c56343.js


File diff suppressed because it is too large
+ 0 - 48
qwh5/dist/js/chunk-vendors.00cb521f.js


File diff suppressed because it is too large
+ 48 - 0
qwh5/dist/js/chunk-vendors.fe55b378.js


File diff suppressed because it is too large
+ 1 - 0
qwh5/dist/js/userPortrait.1d6499a9.js


File diff suppressed because it is too large
+ 0 - 1
qwh5/dist/js/userPortrait.9fa546fd.js


+ 21 - 0
qwh5/package-lock.json

@@ -27,6 +27,7 @@
27 27
         "@vue/cli-plugin-typescript": "~5.0.0",
28 28
         "@vue/cli-plugin-vuex": "~5.0.0",
29 29
         "@vue/cli-service": "~5.0.0",
30
+        "postcss-px-to-viewport": "^1.1.1",
30 31
         "typescript": "~4.5.5"
31 32
       }
32 33
     },
@@ -8377,6 +8378,16 @@
8377 8378
         "postcss": "^8.2.15"
8378 8379
       }
8379 8380
     },
8381
+    "node_modules/postcss-px-to-viewport": {
8382
+      "version": "1.1.1",
8383
+      "resolved": "https://registry.npmjs.org/postcss-px-to-viewport/-/postcss-px-to-viewport-1.1.1.tgz",
8384
+      "integrity": "sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==",
8385
+      "dev": true,
8386
+      "dependencies": {
8387
+        "object-assign": ">=4.0.1",
8388
+        "postcss": ">=5.0.2"
8389
+      }
8390
+    },
8380 8391
     "node_modules/postcss-reduce-initial": {
8381 8392
       "version": "5.1.0",
8382 8393
       "resolved": "https://registry.npmmirror.com/postcss-reduce-initial/-/postcss-reduce-initial-5.1.0.tgz",
@@ -17166,6 +17177,16 @@
17166 17177
         "postcss-value-parser": "^4.2.0"
17167 17178
       }
17168 17179
     },
17180
+    "postcss-px-to-viewport": {
17181
+      "version": "1.1.1",
17182
+      "resolved": "https://registry.npmjs.org/postcss-px-to-viewport/-/postcss-px-to-viewport-1.1.1.tgz",
17183
+      "integrity": "sha512-2x9oGnBms+e0cYtBJOZdlwrFg/mLR4P1g2IFu7jYKvnqnH/HLhoKyareW2Q/x4sg0BgklHlP1qeWo2oCyPm8FQ==",
17184
+      "dev": true,
17185
+      "requires": {
17186
+        "object-assign": ">=4.0.1",
17187
+        "postcss": ">=5.0.2"
17188
+      }
17189
+    },
17169 17190
     "postcss-reduce-initial": {
17170 17191
       "version": "5.1.0",
17171 17192
       "resolved": "https://registry.npmmirror.com/postcss-reduce-initial/-/postcss-reduce-initial-5.1.0.tgz",

+ 1 - 0
qwh5/package.json

@@ -26,6 +26,7 @@
26 26
     "@vue/cli-plugin-typescript": "~5.0.0",
27 27
     "@vue/cli-plugin-vuex": "~5.0.0",
28 28
     "@vue/cli-service": "~5.0.0",
29
+    "postcss-px-to-viewport": "^1.1.1",
29 30
     "typescript": "~4.5.5"
30 31
   }
31 32
 }

+ 14 - 0
qwh5/postcss.config.js

@@ -0,0 +1,14 @@
1
+module.exports = {
2
+  plugins: {
3
+    autoprefixer: {},
4
+    'postcss-px-to-viewport': {
5
+      viewportWidth: 375,
6
+      unitPrecision: 5,
7
+      viewportUnit: 'vw',
8
+      selectorBlackList: ['.ignore', '.hairlines'],
9
+      minPixelValue: 1,
10
+      mediaQuery: false,
11
+      exclude: /node_modules/
12
+    }
13
+  }
14
+}

+ 2 - 2
qwh5/src/main.ts

@@ -5,7 +5,7 @@ import store from './store'
5 5
 import ElementPlus from 'element-plus'
6 6
 import 'element-plus/dist/index.css'
7 7
 // import * as ElementPlusIconsVue from '@element-plus/icons-vue'
8
-import { Icon, Loading, Popover } from 'vant';
8
+import { Icon, Loading, Popover, List } from 'vant';
9 9
 import 'vant/lib/index.css';
10 10
 import './styles/index.scss'
11 11
 import axios from './utils/axios';
@@ -16,7 +16,7 @@ const app = createApp(App)
16 16
 //   app.component(key, component)
17 17
 // }
18 18
 
19
-app.use(Popover).use(Loading).use(Icon).use(ElementPlus).use(store).use(router).mount('#app')
19
+app.use(List).use(Popover).use(Loading).use(Icon).use(ElementPlus).use(store).use(router).mount('#app')
20 20
 
21 21
 app.config.globalProperties.$axios = axios;//全局挂载方法
22 22
 app.config.globalProperties.$getWxConfig = getWxConfig;//全局挂载方法

+ 7 - 2
qwh5/src/utils/getWxConfig.ts

@@ -1,11 +1,16 @@
1 1
 import axios from './axios';
2 2
 import { getQueryString } from './common'
3
-function getAuthInfo(cb) {//jsapi通用授权数据
3
+function getAuthInfo(cb?: any, redirect_url?: any) {//jsapi通用授权数据
4 4
   axios.post('/api/h5/auth/commonAuthData', {
5 5
     corpid: getQueryString('corpid'),
6 6
     url: location.href.split('#')[0],
7 7
   }).then((res: any) => {
8
-    initQYConfig(res.rst, cb);
8
+    if (redirect_url) {//构造网页授权链接回调
9
+      redirect_url(res.rst)
10
+    }
11
+    if (cb) {
12
+      initQYConfig(res.rst, cb);
13
+    }
9 14
   }).catch((err) => {
10 15
     console.log(err, 'err')
11 16
   })

+ 45 - 22
qwh5/src/views/userPortrait.vue

@@ -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
 }