Showing
14 changed files
with
456 additions
and
105 deletions
src/common/helpers.js
0 → 100644
1 | +module.exports = { | ||
2 | + image(url, width, height, mode, quality) { | ||
3 | + mode = _.isNumber(mode) ? mode : 2; | ||
4 | + url = url || ''; | ||
5 | + url = url.replace(/{width}/g, width).replace(/{height}/g, height).replace(/{mode}/g, mode); | ||
6 | + if (url.indexOf('imageView2') > 0) { | ||
7 | + quality = _.isNumber(quality) ? quality : 90; | ||
8 | + url += '/q/' + quality; | ||
9 | + } | ||
10 | + return url.replace('http:', ''); | ||
11 | + } | ||
12 | +} |
1 | -let api = require('../common/create-api'); | 1 | +import config from '../common/config'; |
2 | +import api from '../common/create-api'; | ||
2 | 3 | ||
3 | module.exports = { | 4 | module.exports = { |
4 | - queryHelper(param) { | ||
5 | - return api.get('helper/queryHelper', param, { | 5 | + getWechatShareCode(params) { |
6 | + return api.get('', Object.assign({ | ||
7 | + method: 'app.passport.getWechatShareCode' | ||
8 | + }, params), { | ||
6 | defaults: { | 9 | defaults: { |
7 | - baseURL: 'imApi' | 10 | + baseURL: config.yohoApi |
8 | } | 11 | } |
9 | }); | 12 | }); |
10 | }, | 13 | }, |
11 | - queryAllCommonPhrase(param) { | ||
12 | - return api.get('commonphrase/queryAllCommonPhrase', param, { | ||
13 | - defaults: { | ||
14 | - baseURL: 'imApi' | ||
15 | - } | 14 | + getWechatConsultant(params) { |
15 | + // api.get('/erp/wechatCs/getWechatConsultant', params); | ||
16 | + | ||
17 | + return new Promise(function(resolve, reject) { | ||
18 | + return resolve({ | ||
19 | + "alg": "SALT_MD5", | ||
20 | + "code": 200, | ||
21 | + "data": { | ||
22 | + "groupName": "其他顾问分组", | ||
23 | + "machineCode": "99001182249951", | ||
24 | + "staffName": "刘忙", | ||
25 | + "wechatCode": "yoho2w1qb", | ||
26 | + "wechatMobile": "13770769602", | ||
27 | + "wechatNickName": "红柚", | ||
28 | + "wechatUid": 500032152, | ||
29 | + "yohoMobile": "13770769602" | ||
30 | + }, | ||
31 | + "md5": "7541dd607cef8dc3345d2ce0af7ce1c4", | ||
32 | + "message": "操作成功" | ||
33 | + }) | ||
16 | }); | 34 | }); |
17 | }, | 35 | }, |
18 | - queryAllCommonLink(param) { | ||
19 | - return api.get('/commonlink/queryAllCommonLink', param, { | ||
20 | - defaults: { | ||
21 | - baseURL: 'imApi' | ||
22 | - } | 36 | + getUserInfo(params) { |
37 | + // api.get('/erp/wechatCs/getUserInfo', params); | ||
38 | + | ||
39 | + return new Promise(function(resolve, reject) { | ||
40 | + return resolve({ | ||
41 | + "alg": "SALT_MD5", | ||
42 | + "code": 200, | ||
43 | + "data": { | ||
44 | + "birthday": "1995-08-20", | ||
45 | + "createTimeStr": "2018-04-27 00:28:50", | ||
46 | + "mobile": "13365289763", | ||
47 | + "nickName": "admire102", | ||
48 | + "user_uid": 500031572, | ||
49 | + "vipLevel": "0", | ||
50 | + "yearCost": "0" | ||
51 | + }, | ||
52 | + "md5": "216a47d172dfc195d992a3151df7c3a0", | ||
53 | + "message": "操作成功" | ||
54 | + }) | ||
55 | + }); | ||
56 | + }, | ||
57 | + bindWechatCSAndUser(params) { | ||
58 | + // api.get('/erp/wechatCs/bindWechatCSAndUser', params); | ||
59 | + | ||
60 | + return new Promise(function(resolve, reject) { | ||
61 | + return resolve({ | ||
62 | + "alg": "SALT_MD5", | ||
63 | + "code": 200, | ||
64 | + "data": [], | ||
65 | + "md5": "6d729d4b35f10fc73531210bd7ecff91", | ||
66 | + "message": "操作成功" | ||
67 | + }) | ||
23 | }); | 68 | }); |
69 | + }, | ||
70 | + updateUserReminder(params) { | ||
71 | + // api.get('/erp/wechatCs/updateUserReminder', params); | ||
72 | + | ||
73 | + return new Promise(function(resolve, reject) { | ||
74 | + return resolve({ | ||
75 | + "alg": "SALT_MD5", | ||
76 | + "code": 200, | ||
77 | + "data": [], | ||
78 | + "md5": "6d729d4b35f10fc73531210bd7ecff91", | ||
79 | + "message": "操作成功" | ||
80 | + }) | ||
81 | + }); | ||
82 | + }, | ||
83 | + getUserUid(params) { | ||
84 | + // api.get('/erp/wechatCs/getUserUid', params); | ||
85 | + | ||
86 | + return new Promise(function(resolve, reject) { | ||
87 | + return resolve({ | ||
88 | + "alg": "SALT_MD5", | ||
89 | + "code": 200, | ||
90 | + "data": 500031572, | ||
91 | + "md5": "86ac2ee7339487d6211c7629a4ef5432", | ||
92 | + "message": "操作成功" | ||
93 | + }) | ||
94 | + }); | ||
95 | + }, | ||
96 | + getOrderList(params) { | ||
97 | + return api.get('/erp-gateway/erp/order/getOrderList', params); | ||
98 | + }, | ||
99 | + getChangeList(params) { | ||
100 | + return api.get('/erp-gateway/erp/order/getChangeList', params); | ||
101 | + }, | ||
102 | + getRefundList(params) { | ||
103 | + return api.get('/erp-gateway/erp/order/getRefundList', params); | ||
24 | } | 104 | } |
25 | } | 105 | } |
1 | <template> | 1 | <template> |
2 | <ul class="base-info-list"> | 2 | <ul class="base-info-list"> |
3 | - <li v-for="(item,index) in list" :key="index"><span class="label">{{item.label}}:</span>{{item.value}}</li> | 3 | + <li v-for="(item,index) in list" :key="index"><span class="label">{{item.label}}:</span>{{item.value}}</li> |
4 | </ul> | 4 | </ul> |
5 | </template> | 5 | </template> |
6 | 6 | ||
@@ -9,8 +9,8 @@ export default { | @@ -9,8 +9,8 @@ export default { | ||
9 | name: 'baseInfoList', | 9 | name: 'baseInfoList', |
10 | props: { | 10 | props: { |
11 | list: { | 11 | list: { |
12 | - type: Array, | ||
13 | - default: [] | 12 | + type: Object, |
13 | + default: {} | ||
14 | } | 14 | } |
15 | } | 15 | } |
16 | } | 16 | } |
@@ -20,7 +20,7 @@ export default { | @@ -20,7 +20,7 @@ export default { | ||
20 | name: 'coupon', | 20 | name: 'coupon', |
21 | data() { | 21 | data() { |
22 | return { | 22 | return { |
23 | - more: 'http://www.baidu.com' | 23 | + more: 'http://admin.portal.yohobuy.com/market/queryCoupon/index#page=1' |
24 | }; | 24 | }; |
25 | }, | 25 | }, |
26 | mounted() { | 26 | mounted() { |
src/pages/home/components/data-null.vue
0 → 100644
1 | +<template> | ||
2 | + <div class="data-null"> | ||
3 | + <slot name="cont"></slot> | ||
4 | + </div> | ||
5 | +</template> | ||
6 | + | ||
7 | +<script> | ||
8 | +export default { | ||
9 | + name: 'dataNull' | ||
10 | +} | ||
11 | +</script> | ||
12 | + | ||
13 | +<style lang="scss" scoped> | ||
14 | + .data-null { | ||
15 | + text-align: center; | ||
16 | + padding: 80px 0; | ||
17 | + font-size: 14px; | ||
18 | + } | ||
19 | +</style> | ||
20 | + |
1 | <template> | 1 | <template> |
2 | <div class="exchange-container"> | 2 | <div class="exchange-container"> |
3 | <Tabs :tabs="tabs" @change-tabs="changeTabs"></Tabs> | 3 | <Tabs :tabs="tabs" @change-tabs="changeTabs"></Tabs> |
4 | - <NavTitle :more="more"> | ||
5 | - <template slot="title">{{getTitleCont}}</template> | 4 | + <NavTitle :more="tabObj[curTabs].more"> |
5 | + <template slot="title">{{tabObj[curTabs].title}}</template> | ||
6 | </NavTitle> | 6 | </NavTitle> |
7 | - <Modal class="list-cont"> | 7 | + <Modal v-for="(item, index) in tabObj[curTabs].data" :key="index" class="list-cont"> |
8 | <template slot="label"> | 8 | <template slot="label"> |
9 | - <div class="original-order-code" v-if="curTabs === '换货'">原订单号:2222</div> | ||
10 | - <div class="order-code" :class="{lg: curTabs === '退货'}">订单号:11111</div> | 9 | + <div class="original-order-code" v-if="curTabs === '换货'">原订单号:{{item.sourceOrderCode}}</div> |
10 | + <div class="order-code" :class="{lg: curTabs === '退货'}">订单号:{{item.orderCode}}</div> | ||
11 | </template> | 11 | </template> |
12 | <template slot="cont"> | 12 | <template slot="cont"> |
13 | <div class="order-cont" > | 13 | <div class="order-cont" > |
14 | - <div class="goods-info"> | ||
15 | - <img src="//img11.static.yhbimg.com/goodsimg/2018/10/22/18/012502918a8149f76a74ebcab5971437c6.jpg?imageMogr2/thumbnail/750x750/background/d2hpdGU=/position/center/quality/80"> | 14 | + <div v-for="(goods, key) in item.goodsList" :key="key" class="goods-info"> |
15 | + <img :src="fomartImg(goods.goodsImage, 77, 104)"> | ||
16 | <div class="right"> | 16 | <div class="right"> |
17 | - <div class="goods-name">AIR JORDAN 1 x OFF-WHITE CHICAGO THE TEN 芝加哥</div> | 17 | + <div class="goods-name">{{goods.productName}}</div> |
18 | <div class="number"> | 18 | <div class="number"> |
19 | - <span class="skn">SKN:</span> | ||
20 | - <span class="sku">SKU:</span> | 19 | + <span class="skn">SKN:{{goods.productSkn}}</span> |
20 | + <span class="sku">SKU:{{goods.productSku}}</span> | ||
21 | </div> | 21 | </div> |
22 | - <div class="remark">备注:</div> | 22 | + <div class="remark">备注:{{goods.remark}}</div> |
23 | </div> | 23 | </div> |
24 | </div> | 24 | </div> |
25 | <div class="user-info"> | 25 | <div class="user-info"> |
26 | - <div class="item"><span class="item-label">收货人:</span></div> | ||
27 | - <div class="item"><span class="item-label">手机号:</span></div> | ||
28 | - <div class="item" v-if="curTabs === '退货'"><span class="item-label">退款金额:</span></div> | ||
29 | - <div class="item" v-if="curTabs === '退货'"><span class="item-label">退款方式:</span></div> | ||
30 | - <div class="item"><span class="item-label">申请类型:</span></div> | ||
31 | - <div class="item"><span class="item-label">申请人:</span></div> | ||
32 | - <div class="item"><span class="item-label">当前状态:</span></div> | ||
33 | - <div class="item address"><span class="item-label">地址:</span></div> | 26 | + <template v-if="curTabs === '退货'"> |
27 | + <div class="item"><span class="item-label">退款金额:</span>¥{{item.returnAmountText}}</div> | ||
28 | + <div class="item"><span class="item-label">退款方式:</span>{{item.returnAmountModeName}}</div> | ||
29 | + </template> | ||
30 | + <template v-if="curTabs === '换货'"> | ||
31 | + <div class="item"><span class="item-label">收货人:</span>{{item.deliveryAddressBO.consignee}}</div> | ||
32 | + <div class="item"><span class="item-label">手机号:</span>{{item.deliveryAddressBO.mobile}}</div> | ||
33 | + </template> | ||
34 | + <div class="item"><span class="item-label">申请类型:</span>{{item.refundChangeModeName}}</div> | ||
35 | + <div class="item"><span class="item-label">申请人:</span>{{item.applicant}}</div> | ||
36 | + <div class="item"><span class="item-label">当前状态:</span>{{item.statusName}}</div> | ||
37 | + <div class="item address" v-if="curTabs === '换货'"><span class="item-label">地址:</span>{{item.deliveryAddressBO.address}}</div> | ||
34 | </div> | 38 | </div> |
35 | </div> | 39 | </div> |
36 | </template> | 40 | </template> |
37 | - </Modal> | 41 | + </Modal> |
42 | + <dataNull v-if="tabObj[curTabs].haveData"> | ||
43 | + <template slot="cont">暂无{{curTabs}}信息</template> | ||
44 | + </dataNull> | ||
38 | </div> | 45 | </div> |
39 | </template> | 46 | </template> |
40 | 47 | ||
@@ -42,33 +49,85 @@ | @@ -42,33 +49,85 @@ | ||
42 | import Tabs from './tabs'; | 49 | import Tabs from './tabs'; |
43 | import Modal from './modal'; | 50 | import Modal from './modal'; |
44 | import NavTitle from './nav-title'; | 51 | import NavTitle from './nav-title'; |
52 | +import dataNull from './data-null'; | ||
45 | import homeModel from '../../../models/home'; | 53 | import homeModel from '../../../models/home'; |
54 | +import {image} from '../../../common/helpers'; | ||
46 | 55 | ||
47 | export default { | 56 | export default { |
48 | name: 'exchange', | 57 | name: 'exchange', |
58 | + props: ['uid'], | ||
49 | data() { | 59 | data() { |
50 | return { | 60 | return { |
51 | - tabs: ['换货', '退货'], | ||
52 | curTabs: '换货', | 61 | curTabs: '换货', |
53 | - more: 'http://www.baidu.com' | 62 | + tabObj: { |
63 | + '换货': { | ||
64 | + title: '最近10笔换货订单', | ||
65 | + haveData: true, | ||
66 | + data: [], | ||
67 | + more: 'http://erp.yohobuy.com/customer/exchange/index' | ||
68 | + }, | ||
69 | + '退货': { | ||
70 | + title: '最近10笔退货订单', | ||
71 | + haveData: true, | ||
72 | + data: [], | ||
73 | + more: 'http://erp.yohobuy.com/customer/returned/index' | ||
74 | + } | ||
75 | + } | ||
54 | }; | 76 | }; |
55 | }, | 77 | }, |
56 | mounted() { | 78 | mounted() { |
79 | + this.getChangeList(); | ||
57 | }, | 80 | }, |
58 | computed: { | 81 | computed: { |
59 | - getTitleCont() { | ||
60 | - return this.curTabs === '换货' ? '最近10笔换货订单' : '最近10笔退货订单'; | 82 | + tabs() { |
83 | + return Object.keys(this.tabObj); | ||
61 | } | 84 | } |
62 | }, | 85 | }, |
63 | methods: { | 86 | methods: { |
87 | + fomartImg(url, width, height, mode, quality) { | ||
88 | + return image(url, width, height, mode, quality); | ||
89 | + }, | ||
64 | changeTabs(item) { | 90 | changeTabs(item) { |
65 | this.curTabs = item; | 91 | this.curTabs = item; |
92 | + | ||
93 | + if (item === '换货' && this.tabObj[item].haveData) { | ||
94 | + this.getChangeList(); | ||
95 | + } | ||
96 | + | ||
97 | + if (item === '退货' && this.tabObj[item].haveData) { | ||
98 | + this.getRefundList(); | ||
99 | + } | ||
100 | + }, | ||
101 | + getChangeList() { | ||
102 | + homeModel.getChangeList({ | ||
103 | + uid: this.uid, | ||
104 | + page: 1, | ||
105 | + limit: 10 | ||
106 | + }).then(ret => { | ||
107 | + if (ret && ret.code === 200) { | ||
108 | + this.tabObj['换货'].data = ret.data && ret.data.list || []; | ||
109 | + this.tabObj['换货'].haveData = ret.data && ret.data.list && ret.data.list.length === 0; | ||
110 | + } | ||
111 | + }); | ||
112 | + }, | ||
113 | + getRefundList() { | ||
114 | + homeModel.getRefundList({ | ||
115 | + uid: this.uid, | ||
116 | + page: 1, | ||
117 | + limit: 10 | ||
118 | + }).then(ret => { | ||
119 | + if (ret && ret.code === 200) { | ||
120 | + this.tabObj['退货'].data = ret.data && ret.data.list || []; | ||
121 | + this.tabObj['退货'].haveData = ret.data && ret.data.list && ret.data.list.length === 0; | ||
122 | + } | ||
123 | + }); | ||
66 | } | 124 | } |
67 | }, | 125 | }, |
68 | components: { | 126 | components: { |
69 | Tabs, | 127 | Tabs, |
70 | Modal, | 128 | Modal, |
71 | - NavTitle | 129 | + NavTitle, |
130 | + dataNull | ||
72 | } | 131 | } |
73 | } | 132 | } |
74 | </script> | 133 | </script> |
@@ -77,10 +136,12 @@ export default { | @@ -77,10 +136,12 @@ export default { | ||
77 | .exchange-container { | 136 | .exchange-container { |
78 | .original-order-code { | 137 | .original-order-code { |
79 | float: left; | 138 | float: left; |
139 | + font-size: 14px; | ||
80 | } | 140 | } |
81 | 141 | ||
82 | .order-code { | 142 | .order-code { |
83 | float: right; | 143 | float: right; |
144 | + font-size: 14px; | ||
84 | } | 145 | } |
85 | 146 | ||
86 | .lg { | 147 | .lg { |
@@ -89,7 +150,12 @@ export default { | @@ -89,7 +150,12 @@ export default { | ||
89 | 150 | ||
90 | .list-cont { | 151 | .list-cont { |
91 | padding-bottom: 20px; | 152 | padding-bottom: 20px; |
153 | + margin-bottom: 15px; | ||
92 | background: #fff; | 154 | background: #fff; |
155 | + | ||
156 | + &:last-child { | ||
157 | + margin-bottom: 0; | ||
158 | + } | ||
93 | } | 159 | } |
94 | 160 | ||
95 | .goods-info { | 161 | .goods-info { |
@@ -115,6 +181,7 @@ export default { | @@ -115,6 +181,7 @@ export default { | ||
115 | overflow: hidden; | 181 | overflow: hidden; |
116 | font-family: PingFang-SC-Medium; | 182 | font-family: PingFang-SC-Medium; |
117 | font-size: 18px; | 183 | font-size: 18px; |
184 | + min-height: 50px; | ||
118 | } | 185 | } |
119 | 186 | ||
120 | .number { | 187 | .number { |
@@ -147,15 +214,16 @@ export default { | @@ -147,15 +214,16 @@ export default { | ||
147 | height: auto; | 214 | height: auto; |
148 | overflow: hidden; | 215 | overflow: hidden; |
149 | font-family: PingFang-SC-Regular; | 216 | font-family: PingFang-SC-Regular; |
150 | - font-size: 18px; | 217 | + font-size: 15px; |
151 | width: 100%; | 218 | width: 100%; |
152 | border-top: 1px solid #EAEBEB; | 219 | border-top: 1px solid #EAEBEB; |
153 | padding: 0 20px; | 220 | padding: 0 20px; |
221 | + box-sizing: border-box; | ||
154 | 222 | ||
155 | .item { | 223 | .item { |
156 | width: 50%; | 224 | width: 50%; |
157 | float: left; | 225 | float: left; |
158 | - line-height: 30px; | 226 | + line-height: 30px; |
159 | line-height: 25px; | 227 | line-height: 25px; |
160 | margin-top: 15px; | 228 | margin-top: 15px; |
161 | } | 229 | } |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <span class="title"> | 3 | <span class="title"> |
4 | <slot name="title"></slot> | 4 | <slot name="title"></slot> |
5 | </span> | 5 | </span> |
6 | - <a :href="more" class="more" v-if="more != ''"> </a> | 6 | + <a :href="more" class="more" v-if="more != ''" target="_blank"> </a> |
7 | </div> | 7 | </div> |
8 | </template> | 8 | </template> |
9 | 9 |
@@ -3,53 +3,118 @@ | @@ -3,53 +3,118 @@ | ||
3 | <NavTitle :more="more"> | 3 | <NavTitle :more="more"> |
4 | <template slot="title">最近10笔订单</template> | 4 | <template slot="title">最近10笔订单</template> |
5 | </NavTitle> | 5 | </NavTitle> |
6 | - <Modal class="order-list"> | 6 | + <Modal class="order-list" v-for="(item, index) in orderList" :key="index"> |
7 | <template slot="label"> | 7 | <template slot="label"> |
8 | - <div class="time">2018-10-31 16:51:22</div> | ||
9 | - <div class="order-code">订单号:11111</div> | 8 | + <div class="time">{{item.pay_expire}}</div> |
9 | + <div class="order-code">订单号:{{item.order_code}}</div> | ||
10 | </template> | 10 | </template> |
11 | <template slot="cont"> | 11 | <template slot="cont"> |
12 | - <div class="order-cont" > | ||
13 | - <div class="goods-info"> | ||
14 | - <img src="//img11.static.yhbimg.com/goodsimg/2018/10/22/18/012502918a8149f76a74ebcab5971437c6.jpg?imageMogr2/thumbnail/750x750/background/d2hpdGU=/position/center/quality/80"> | 12 | + <div class="order-cont"> |
13 | + <div v-for="(goods, goodsIndex) in item.order_goods" :key="goodsIndex" class="goods-info"> | ||
14 | + <img :src="fomartImg(goods.goods_image, 78, 103)"> | ||
15 | <div class="right"> | 15 | <div class="right"> |
16 | - <div class="goods-name">AIR JORDAN 1 x OFF-WHITE CHICAGO THE TEN 芝加哥</div> | 16 | + <div class="goods-name">{{goods.product_name}}</div> |
17 | <div class="number"> | 17 | <div class="number"> |
18 | - <span class="goods-price red">¥859</span> | ||
19 | - <span class="goods-num">数量:1</span> | 18 | + <span class="goods-price red">¥{{goods.real_pay_price}}</span> |
19 | + <span class="goods-num">数量:{{goods.buy_number}}</span> | ||
20 | </div> | 20 | </div> |
21 | </div> | 21 | </div> |
22 | </div> | 22 | </div> |
23 | <div class="order-info"> | 23 | <div class="order-info"> |
24 | - <div class="item"><span class="item-label">订单金额:</span></div> | ||
25 | - <div class="item"><span class="item-label">订单状态:</span></div> | ||
26 | - <div class="item"><span class="item-label">订单来源:</span></div> | 24 | + <div class="item"><span class="item-label">订单金额:</span>¥{{item.amount}}</div> |
25 | + <div class="item"><span class="item-label">订单状态:</span>{{item.status_str}}</div> | ||
26 | + <div class="item"><span class="item-label">订单来源:</span>{{orderType(item.order_type)}}</div> | ||
27 | </div> | 27 | </div> |
28 | </div> | 28 | </div> |
29 | </template> | 29 | </template> |
30 | - </Modal> | 30 | + </Modal> |
31 | + <dataNull v-if="orderList.length === 0"> | ||
32 | + <template slot="cont">暂无订单信息</template> | ||
33 | + </dataNull> | ||
31 | </div> | 34 | </div> |
32 | </template> | 35 | </template> |
33 | 36 | ||
34 | <script> | 37 | <script> |
35 | import Modal from './modal'; | 38 | import Modal from './modal'; |
36 | import NavTitle from './nav-title'; | 39 | import NavTitle from './nav-title'; |
40 | +import dataNull from './data-null'; | ||
37 | import homeModel from '../../../models/home'; | 41 | import homeModel from '../../../models/home'; |
42 | +import {image} from '../../../common/helpers'; | ||
43 | + | ||
44 | +const sourceList = { | ||
45 | + '0': '测试订单', | ||
46 | + '1': '有货订单', | ||
47 | + '2': '内购订单', | ||
48 | + '3': 'IPhone订单', | ||
49 | + '4': '安卓订单', | ||
50 | + '5': '淘宝B店订单', | ||
51 | + '6': 'Wap站', | ||
52 | + '7': '换货订单', | ||
53 | + '8': '淘宝C店订单', | ||
54 | + '9': '淘宝LAL店订单', | ||
55 | + '10': '一号店', | ||
56 | + '11': '京东', | ||
57 | + '12': '京东闪购店', | ||
58 | + '13': '京东lal闪购店', | ||
59 | + '14': '物色', | ||
60 | + '15': 'bj天猫店', | ||
61 | + '16': 'intotherainbow旗舰店', | ||
62 | + '17': '微信商城', | ||
63 | + '18': 'BLK-IPhone订单', | ||
64 | + '19': 'BLK安卓订单', | ||
65 | + '20': 'BLK-PC订单', | ||
66 | + '21': 'BLK-Wap订单', | ||
67 | + '22': '测试订单', | ||
68 | + '23': '苏宁', | ||
69 | + '24': '微信小程序', | ||
70 | + '30': '残次网站订单', | ||
71 | + '60': '南京艾尚YOHO!Store', | ||
72 | + '61': 'YOHOOD仓库', | ||
73 | + '62': '南京艾尚YOHO!Kids', | ||
74 | + '63': '红人分销', | ||
75 | + '64': '品牌主体小程序', | ||
76 | + '65': '有货主体品牌小程序', | ||
77 | + '66': '上海奕欧来Outlet', | ||
78 | + '67': '上海K11POP-UP STORE' | ||
79 | +}; | ||
38 | 80 | ||
39 | export default { | 81 | export default { |
40 | name: 'orderList', | 82 | name: 'orderList', |
83 | + props: ['uid'], | ||
41 | data() { | 84 | data() { |
42 | return { | 85 | return { |
43 | - more: 'http://www.baidu.com' | 86 | + more: 'http://erp.yohobuy.com/orders/orders/index', |
87 | + orderList: [] | ||
44 | }; | 88 | }; |
45 | }, | 89 | }, |
46 | mounted() { | 90 | mounted() { |
91 | + this.getOrderList(); | ||
47 | }, | 92 | }, |
48 | methods: { | 93 | methods: { |
94 | + fomartImg(url, width, height, mode, quality) { | ||
95 | + return image(url, width, height, mode, quality); | ||
96 | + }, | ||
97 | + orderType(type) { | ||
98 | + return sourceList[type]; | ||
99 | + }, | ||
100 | + getOrderList() { | ||
101 | + homeModel.getOrderList({ | ||
102 | + type: 1, | ||
103 | + uid: this.uid, | ||
104 | + page: 1, | ||
105 | + limit: 10, | ||
106 | + debug: true | ||
107 | + }).then(ret => { | ||
108 | + if (ret && ret.code === 200) { | ||
109 | + this.orderList = ret.data && ret.data.order_list || []; | ||
110 | + } | ||
111 | + }); | ||
112 | + } | ||
49 | }, | 113 | }, |
50 | components: { | 114 | components: { |
51 | Modal, | 115 | Modal, |
52 | - NavTitle | 116 | + NavTitle, |
117 | + dataNull | ||
53 | } | 118 | } |
54 | } | 119 | } |
55 | </script> | 120 | </script> |
@@ -128,17 +193,16 @@ export default { | @@ -128,17 +193,16 @@ export default { | ||
128 | 193 | ||
129 | .order-info { | 194 | .order-info { |
130 | border-top: 1px solid #EAEBEB; | 195 | border-top: 1px solid #EAEBEB; |
131 | - margin-top: 10px; | ||
132 | padding: 10px 20px; | 196 | padding: 10px 20px; |
133 | font-family: PingFang-SC-Regular; | 197 | font-family: PingFang-SC-Regular; |
134 | - font-size: 18px; | 198 | + font-size: 16px; |
135 | height: auto; | 199 | height: auto; |
136 | overflow: hidden; | 200 | overflow: hidden; |
137 | 201 | ||
138 | 202 | ||
139 | .item { | 203 | .item { |
140 | font-family: PingFang-SC-Regular; | 204 | font-family: PingFang-SC-Regular; |
141 | - font-size: 18px; | 205 | + font-size: 16px; |
142 | width: 50%; | 206 | width: 50%; |
143 | float: left; | 207 | float: left; |
144 | line-height: 25px; | 208 | line-height: 25px; |
1 | <template> | 1 | <template> |
2 | <div class="user-info-container"> | 2 | <div class="user-info-container"> |
3 | <ModalHaveTitle class="notes" :title="'用户备忘录'"> | 3 | <ModalHaveTitle class="notes" :title="'用户备忘录'"> |
4 | - <textarea name="" id="" placeholder="备忘录(非必填)"></textarea> | 4 | + <textarea name="" id="" placeholder="备忘录(非必填)" v-model="reminder"></textarea> |
5 | <NavButton :text="'更新备忘录'" @click-btn="updateNote"></NavButton> | 5 | <NavButton :text="'更新备忘录'" @click-btn="updateNote"></NavButton> |
6 | </ModalHaveTitle> | 6 | </ModalHaveTitle> |
7 | 7 | ||
8 | 8 | ||
9 | - <ModalHaveTitle class="bind-user" :title="'绑定用户'"> | ||
10 | - <div class="label">用户微信号:</div> | 9 | + <ModalHaveTitle class="bind-user" :title="'绑定用户'" v-if="showBind"> |
10 | + <div class="label">用户微信号:{{userCode}}</div> | ||
11 | <div class="search"> | 11 | <div class="search"> |
12 | - <input type="text" value="" placeholder="用户UID查询(请输入有货手机号/订单编号)"> | ||
13 | - <span class="search-btn"></span> | 12 | + <input type="text" value="" placeholder="用户UID查询(请输入有货手机号)" v-model="phone"> |
13 | + <span class="search-btn" @click="searchUid"></span> | ||
14 | </div> | 14 | </div> |
15 | - <input type="text" value="" placeholder="用户UID" class="input-uid"> | ||
16 | - <textarea name="" id="" placeholder="备注(非必填)"></textarea> | 15 | + <input type="text" value="" placeholder="用户UID" class="input-uid" v-model="userUid"> |
16 | + <textarea name="" id="" placeholder="备注(非必填)" v-model="remarks"></textarea> | ||
17 | <NavButton :text="'绑定用户'" @click-btn="bindUser"></NavButton> | 17 | <NavButton :text="'绑定用户'" @click-btn="bindUser"></NavButton> |
18 | </ModalHaveTitle> | 18 | </ModalHaveTitle> |
19 | 19 | ||
20 | - <ModalHaveTitle class="user-base-info" :title="'用户基本信息'"> | 20 | + <ModalHaveTitle class="user-base-info" :title="'用户基本信息'" v-if="showUserInfo"> |
21 | <BaseInfoList :list="userInfo"></BaseInfoList> | 21 | <BaseInfoList :list="userInfo"></BaseInfoList> |
22 | </ModalHaveTitle> | 22 | </ModalHaveTitle> |
23 | </div> | 23 | </div> |
@@ -31,27 +31,95 @@ import BaseInfoList from './base-info-list'; | @@ -31,27 +31,95 @@ import BaseInfoList from './base-info-list'; | ||
31 | 31 | ||
32 | export default { | 32 | export default { |
33 | name: 'userInfo', | 33 | name: 'userInfo', |
34 | + props: ['wechatUid', 'userCode'], | ||
34 | data() { | 35 | data() { |
35 | return { | 36 | return { |
36 | - userInfo: [ | ||
37 | - {label: '用户UID', value: ''}, | ||
38 | - {label: '昵称', value: ''}, | ||
39 | - {label: '手机号', value: ''}, | ||
40 | - {label: '注册', value: ''}, | ||
41 | - {label: '生日', value: ''}, | ||
42 | - {label: '等级', value: ''}, | ||
43 | - {label: '365天累计消费', value: ''} | ||
44 | - ] | 37 | + userInfo: { |
38 | + user_uid: {label: '用户UID', value: ''}, | ||
39 | + nickName: {label: '昵称', value: ''}, | ||
40 | + mobile: {label: '手机号', value: ''}, | ||
41 | + createTimeStr: {label: '注册', value: ''}, | ||
42 | + birthday: {label: '生日', value: ''}, | ||
43 | + vipLevel: {label: '等级', value: ''}, | ||
44 | + yearCost: {label: '365天累计消费', value: ''} | ||
45 | + }, | ||
46 | + showUserInfo: false, | ||
47 | + showBind: false, | ||
48 | + userUid: '', | ||
49 | + remarks: '', | ||
50 | + reminder: '', | ||
51 | + phone: '' | ||
45 | }; | 52 | }; |
46 | }, | 53 | }, |
47 | mounted() { | 54 | mounted() { |
55 | + this.getUserInfo(); | ||
48 | }, | 56 | }, |
49 | methods: { | 57 | methods: { |
58 | + getUserInfo() { | ||
59 | + homeModel.getUserInfo({userCode: this.userCode, wechat_uid: this.wechatUid}).then(ret => { | ||
60 | + if (ret && ret.code === 200) { | ||
61 | + let data = ret.data || {}; | ||
62 | + | ||
63 | + Object.keys(data).forEach((item, key) => { | ||
64 | + this.userInfo[item].value = data[item]; | ||
65 | + }); | ||
66 | + this.showUserInfo = true; | ||
67 | + this.showBind = false; | ||
68 | + this.$emit('get-user-uid', ret.data.user_uid); | ||
69 | + } | ||
70 | + | ||
71 | + if (ret && ret.code === 403) { | ||
72 | + this.showUserInfo = false; | ||
73 | + this.showBind = true; | ||
74 | + } | ||
75 | + }); | ||
76 | + }, | ||
77 | + isPoneAvailable(str) { | ||
78 | + let myreg=/^[1][3,4,5,7,8][0-9]{9}$/; | ||
79 | + | ||
80 | + if (!myreg.test(str)) { | ||
81 | + return false; | ||
82 | + } else { | ||
83 | + return true; | ||
84 | + } | ||
85 | + }, | ||
50 | updateNote() { | 86 | updateNote() { |
51 | console.log('update note') | 87 | console.log('update note') |
88 | + homeModel.updateUserReminder({ | ||
89 | + user_uid: this.userUid, | ||
90 | + wechat_uid: this.wechatUid, | ||
91 | + reminder: this.reminder | ||
92 | + }).then(ret => { | ||
93 | + console.log(ret) | ||
94 | + }); | ||
52 | }, | 95 | }, |
53 | bindUser() { | 96 | bindUser() { |
54 | console.log('bind user') | 97 | console.log('bind user') |
98 | + homeModel.bindWechatCSAndUser({ | ||
99 | + user_uid: this.userUid, | ||
100 | + wechat_uid: this.wechatUid, | ||
101 | + user_code: this.userCode, | ||
102 | + remarks: this.remarks, | ||
103 | + reminder: this.reminder | ||
104 | + }).then(ret => { | ||
105 | + console.log(ret) | ||
106 | + if (ret && ret.code === 200) { | ||
107 | + this.getUserInfo(); | ||
108 | + } | ||
109 | + }); | ||
110 | + }, | ||
111 | + searchUid() { | ||
112 | + if (this.isPoneAvailable(this.phone)) { | ||
113 | + homeModel.getUserUid({ | ||
114 | + profile: this.phone | ||
115 | + }).then(ret => { | ||
116 | + if (ret && ret.code === 200) { | ||
117 | + this.userUid = ret.data || ''; | ||
118 | + } | ||
119 | + }); | ||
120 | + } else { | ||
121 | + alert('手机号输入不正确'); | ||
122 | + } | ||
55 | } | 123 | } |
56 | }, | 124 | }, |
57 | components: { | 125 | components: { |
@@ -105,14 +173,14 @@ input:-ms-input-placeholder { | @@ -105,14 +173,14 @@ input:-ms-input-placeholder { | ||
105 | } | 173 | } |
106 | 174 | ||
107 | .notes { | 175 | .notes { |
176 | + border-bottom: 1px solid #EAEBEB; | ||
177 | + | ||
108 | textarea { | 178 | textarea { |
109 | height: 130px; | 179 | height: 130px; |
110 | } | 180 | } |
111 | } | 181 | } |
112 | 182 | ||
113 | .bind-user { | 183 | .bind-user { |
114 | - border-top: 1px solid #EAEBEB; | ||
115 | - | ||
116 | .search { | 184 | .search { |
117 | width: 100%; | 185 | width: 100%; |
118 | background: #F3F3F3; | 186 | background: #F3F3F3; |
@@ -13,18 +13,16 @@ | @@ -13,18 +13,16 @@ | ||
13 | @click="changeMenu(item.text)">{{item.text}}</span> | 13 | @click="changeMenu(item.text)">{{item.text}}</span> |
14 | </div> | 14 | </div> |
15 | 15 | ||
16 | - <Knowledge v-if="curMenu === '知识库'"></Knowledge> | ||
17 | - <OrderList v-if="curMenu === '订单信息'"></OrderList> | ||
18 | - <Exchange v-if="curMenu === '退换货'"></Exchange> | 16 | + <OrderList v-if="curMenu === '订单信息'" :uid="userUid"></OrderList> |
17 | + <Exchange v-if="curMenu === '退换货'" :uid="userUid"></Exchange> | ||
19 | <Coupon v-if="curMenu === '优惠券'"></Coupon> | 18 | <Coupon v-if="curMenu === '优惠券'"></Coupon> |
20 | - <UserInfo v-if="curMenu === '用户信息'"></UserInfo> | 19 | + <UserInfo v-if="curMenu === '用户信息'" :wechatUid="serviceInfo.wechatUid.value" :userCode="userCode" @get-user-uid="getUserUid"></UserInfo> |
21 | <Tip :text="tipCont" :hasClose="tipClose" :show="tipShow" @change-tip-status="changeTipStatus"></Tip> | 20 | <Tip :text="tipCont" :hasClose="tipClose" :show="tipShow" @change-tip-status="changeTipStatus"></Tip> |
22 | </div> | 21 | </div> |
23 | </template> | 22 | </template> |
24 | 23 | ||
25 | <script> | 24 | <script> |
26 | import BaseInfoList from './components/base-info-list'; | 25 | import BaseInfoList from './components/base-info-list'; |
27 | -import Knowledge from './components/knowledge'; | ||
28 | import OrderList from './components/order-list'; | 26 | import OrderList from './components/order-list'; |
29 | import Exchange from './components/exchange'; | 27 | import Exchange from './components/exchange'; |
30 | import Coupon from './components/coupon'; | 28 | import Coupon from './components/coupon'; |
@@ -33,6 +31,7 @@ import NavButton from './components/nav-button'; | @@ -33,6 +31,7 @@ import NavButton from './components/nav-button'; | ||
33 | import ModalHaveTitle from './components/modal-have-title'; | 31 | import ModalHaveTitle from './components/modal-have-title'; |
34 | import Tip from './components/tip'; | 32 | import Tip from './components/tip'; |
35 | import Clipboard from 'clipboard'; | 33 | import Clipboard from 'clipboard'; |
34 | +import homeModel from '../../models/home'; | ||
36 | 35 | ||
37 | export default { | 36 | export default { |
38 | name: 'Home', | 37 | name: 'Home', |
@@ -42,26 +41,62 @@ export default { | @@ -42,26 +41,62 @@ export default { | ||
42 | {text: '用户信息'}, | 41 | {text: '用户信息'}, |
43 | {text: '订单信息'}, | 42 | {text: '订单信息'}, |
44 | {text: '退换货'}, | 43 | {text: '退换货'}, |
45 | - {text: '优惠券'}, | ||
46 | - {text: '知识库'} | 44 | + {text: '优惠券'} |
47 | ], | 45 | ], |
48 | curMenu: '用户信息', | 46 | curMenu: '用户信息', |
49 | - serviceInfo: [ | ||
50 | - {label: '微信号', value: ''}, | ||
51 | - {label: '微信昵称', value: ''}, | ||
52 | - {label: '微信手机号', value: ''}, | ||
53 | - {label: '机器码', value: ''}, | ||
54 | - {label: '有货账号', value: ''}, | ||
55 | - {label: '有货UID', value: ''}, | ||
56 | - {label: '所属分组', value: ''}, | ||
57 | - {label: '运营人员', value: ''} | ||
58 | - ], | 47 | + serviceInfo: { |
48 | + wechatCode: {label: '微信号', value: ''}, | ||
49 | + wechatNickName: {label: '微信昵称', value: ''}, | ||
50 | + wechatMobile: {label: '微信手机号', value: ''}, | ||
51 | + machineCode: {label: '机器码', value: ''}, | ||
52 | + yohoMobile: {label: '有货账号', value: ''}, | ||
53 | + wechatUid: {label: '有货UID', value: ''}, | ||
54 | + groupName: {label: '所属分组', value: ''}, | ||
55 | + staffName: {label: '运营人员', value: ''} | ||
56 | + }, | ||
59 | tipCont: '复制成功', | 57 | tipCont: '复制成功', |
60 | tipShow: false, | 58 | tipShow: false, |
61 | - tipClose: false | 59 | + tipClose: false, |
60 | + wechatCode: this.queryString().operator, | ||
61 | + userCode: this.queryString().friend, | ||
62 | + shareCode: '', | ||
63 | + userUid: '' | ||
62 | }; | 64 | }; |
63 | }, | 65 | }, |
66 | + mounted() { | ||
67 | + homeModel.getWechatConsultant({wechatCode: this.wechatCode}).then(ret => { | ||
68 | + if (ret && ret.code === 200) { | ||
69 | + let data = ret.data || {}; | ||
70 | + | ||
71 | + Object.keys(data).forEach((item, key) => { | ||
72 | + this.serviceInfo[item].value = data[item]; | ||
73 | + }); | ||
74 | + | ||
75 | + this.getWechatShareCode(data.wechatUid || ''); | ||
76 | + } | ||
77 | + }); | ||
78 | + }, | ||
64 | methods: { | 79 | methods: { |
80 | + queryString() { | ||
81 | + let vars = [], hash; | ||
82 | + let hashes = window.location.search.slice(1).split('&'); | ||
83 | + | ||
84 | + for (let i = 0; i < hashes.length; i++) { | ||
85 | + hash = hashes[i].split('='); | ||
86 | + vars.push(hash[0]); | ||
87 | + vars[hash[0]] = hash[1]; | ||
88 | + } | ||
89 | + return vars; | ||
90 | + }, | ||
91 | + getWechatShareCode(wechatUid) { | ||
92 | + wechatUid = 500031262; | ||
93 | + | ||
94 | + homeModel.getWechatShareCode({ | ||
95 | + uid: wechatUid | ||
96 | + }).then(ret => { | ||
97 | + console.log(ret) | ||
98 | + }); | ||
99 | + }, | ||
65 | changeMenu(item) { | 100 | changeMenu(item) { |
66 | this.curMenu = item; | 101 | this.curMenu = item; |
67 | }, | 102 | }, |
@@ -69,7 +104,7 @@ export default { | @@ -69,7 +104,7 @@ export default { | ||
69 | let that = this; | 104 | let that = this; |
70 | let clipboard = new Clipboard('.copy-link', { | 105 | let clipboard = new Clipboard('.copy-link', { |
71 | text: function() { | 106 | text: function() { |
72 | - return '有货有赚'; | 107 | + return this.shareCode; |
73 | } | 108 | } |
74 | }); | 109 | }); |
75 | 110 | ||
@@ -92,11 +127,14 @@ export default { | @@ -92,11 +127,14 @@ export default { | ||
92 | }, | 127 | }, |
93 | changeTipStatus(item) { | 128 | changeTipStatus(item) { |
94 | this.tipShow = item; | 129 | this.tipShow = item; |
130 | + }, | ||
131 | + getUserUid(uid) { | ||
132 | + console.log(uid) | ||
133 | + this.userUid = uid; | ||
95 | } | 134 | } |
96 | }, | 135 | }, |
97 | components: { | 136 | components: { |
98 | BaseInfoList, | 137 | BaseInfoList, |
99 | - Knowledge, | ||
100 | OrderList, | 138 | OrderList, |
101 | Exchange, | 139 | Exchange, |
102 | Coupon, | 140 | Coupon, |
-
Please register or login to post a comment