Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop
Showing
15 changed files
with
446 additions
and
104 deletions
@@ -25,8 +25,8 @@ module.exports = { | @@ -25,8 +25,8 @@ module.exports = { | ||
25 | }); | 25 | }); |
26 | }, | 26 | }, |
27 | 27 | ||
28 | - /* 获取品牌介绍 */ | ||
29 | - getBrandIntro: (req, res) => { | 28 | + /* 获取品牌店铺介绍 */ |
29 | + getShopInfo: (req, res) => { | ||
30 | brandModel.getBrandData({ | 30 | brandModel.getBrandData({ |
31 | domain: req.query.domain, | 31 | domain: req.query.domain, |
32 | uid: req.user.uid | 32 | uid: req.user.uid |
@@ -86,8 +86,8 @@ module.exports = { | @@ -86,8 +86,8 @@ module.exports = { | ||
86 | /* 收藏店铺 */ | 86 | /* 收藏店铺 */ |
87 | collectShop: (req, res) => { | 87 | collectShop: (req, res) => { |
88 | brandModel.collectShopData({ | 88 | brandModel.collectShopData({ |
89 | - shopId: req.query.shopId, | ||
90 | - favId: req.query.favId, | 89 | + shopId: req.body.shopId, |
90 | + favId: req.body.favId, | ||
91 | uid: req.user.uid, | 91 | uid: req.user.uid, |
92 | type: 'shop' | 92 | type: 'shop' |
93 | }).then(result => { | 93 | }).then(result => { |
@@ -5,11 +5,14 @@ | @@ -5,11 +5,14 @@ | ||
5 | * Time: 13:51 | 5 | * Time: 13:51 |
6 | */ | 6 | */ |
7 | 'use strict'; | 7 | 'use strict'; |
8 | +const path = require('path'); | ||
8 | const api = global.yoho.API; | 9 | const api = global.yoho.API; |
9 | const helpers = global.yoho.helpers; | 10 | const helpers = global.yoho.helpers; |
10 | const brandApi = require('./brand-api'); | 11 | const brandApi = require('./brand-api'); |
11 | const logger = global.yoho.logger; | 12 | const logger = global.yoho.logger; |
12 | const _ = require('lodash'); | 13 | const _ = require('lodash'); |
14 | +const processProductList = require(path.join(global.utils, '/beautify/product')).processProductList; | ||
15 | +const camelCase = global.yoho.camelCase; | ||
13 | 16 | ||
14 | /** | 17 | /** |
15 | * 处理品牌一览品牌列表数据 | 18 | * 处理品牌一览品牌列表数据 |
@@ -84,8 +87,7 @@ const getBrandData = params => { | @@ -84,8 +87,7 @@ const getBrandData = params => { | ||
84 | showBrandLogo: false, | 87 | showBrandLogo: false, |
85 | brandLogo: subResult[0].data.shop_logo, | 88 | brandLogo: subResult[0].data.shop_logo, |
86 | brandName: subResult[0].data.shop_name, | 89 | brandName: subResult[0].data.shop_name, |
87 | - brandIntro: subResult[0].data.shop_intro, | ||
88 | - showMore: false | 90 | + brandIntro: subResult[0].data.shop_intro |
89 | }); | 91 | }); |
90 | return finalResult; | 92 | return finalResult; |
91 | } else { | 93 | } else { |
@@ -112,9 +114,18 @@ const getBrandData = params => { | @@ -112,9 +114,18 @@ const getBrandData = params => { | ||
112 | const getBrandShopGoodsData = params => { | 114 | const getBrandShopGoodsData = params => { |
113 | let finalResult = {}; | 115 | let finalResult = {}; |
114 | 116 | ||
115 | - /* TODO 获取店铺商品暂时没有接口 */ | ||
116 | return api.all([brandApi.getBrandShopGoodsOriginData(params)]).then(result => { | 117 | return api.all([brandApi.getBrandShopGoodsOriginData(params)]).then(result => { |
118 | + if (result[0].code === 200) { | ||
119 | + Object.assign(finalResult, { | ||
120 | + data: { | ||
121 | + productList: processProductList(result[0].data.productList) | ||
122 | + } | ||
123 | + }); | ||
124 | + } else { | ||
125 | + logger.error('getBrandShopGoodsOriginData api code no 200'); | ||
126 | + } | ||
117 | 127 | ||
128 | + return camelCase(finalResult); | ||
118 | }); | 129 | }); |
119 | }; | 130 | }; |
120 | 131 | ||
@@ -124,15 +135,8 @@ const getBrandShopGoodsData = params => { | @@ -124,15 +135,8 @@ const getBrandShopGoodsData = params => { | ||
124 | * @returns {*|Promise.<TResult>} | 135 | * @returns {*|Promise.<TResult>} |
125 | */ | 136 | */ |
126 | const collectShopData = params => { | 137 | const collectShopData = params => { |
127 | - let finalResult = {}; | ||
128 | - | ||
129 | - /* TODO 收藏店铺接口返回状态处理*/ | ||
130 | return api.all([brandApi.collectShopOriginData(params)]).then(result => { | 138 | return api.all([brandApi.collectShopOriginData(params)]).then(result => { |
131 | - if (result[0].code === 200) { | ||
132 | - | ||
133 | - } else { | ||
134 | - logger.error('collectShopOriginData api code no 200'); | ||
135 | - } | 139 | + return result[0]; |
136 | }); | 140 | }); |
137 | }; | 141 | }; |
138 | 142 | ||
@@ -248,5 +252,6 @@ module.exports = { | @@ -248,5 +252,6 @@ module.exports = { | ||
248 | getBrandShopGoodsData, | 252 | getBrandShopGoodsData, |
249 | getBrandListData, | 253 | getBrandListData, |
250 | getCateListData, | 254 | getCateListData, |
251 | - getCateResource | 255 | + getCateResource, |
256 | + collectShopData | ||
252 | }; | 257 | }; |
@@ -17,14 +17,14 @@ router.get('/', channel.index); // 首页 | @@ -17,14 +17,14 @@ router.get('/', channel.index); // 首页 | ||
17 | router.get('/channel/resources.json', channel.resources); // 资源位接口 | 17 | router.get('/channel/resources.json', channel.resources); // 资源位接口 |
18 | router.get('/channel/goods.json', channel.goods); // 首页查询商品列表 | 18 | router.get('/channel/goods.json', channel.goods); // 首页查询商品列表 |
19 | router.get('/brand', brand.index); // 店铺首页 | 19 | router.get('/brand', brand.index); // 店铺首页 |
20 | -router.get('/get-brand-intro', brand.getBrandIntro); // 店铺介绍 | 20 | +router.get('/get-shop-info', brand.getShopInfo); // 店铺介绍 |
21 | router.post('/get-brand-shop-goods', brand.getBrandShopGoods); // 店铺介绍 | 21 | router.post('/get-brand-shop-goods', brand.getBrandShopGoods); // 店铺介绍 |
22 | router.get('/brand-list', brand.brandList); // 品牌列表页 | 22 | router.get('/brand-list', brand.brandList); // 品牌列表页 |
23 | router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据 | 23 | router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据 |
24 | router.get('/brand-share', brand.brandShare); // 获取品牌列表数据 | 24 | router.get('/brand-share', brand.brandShare); // 获取品牌列表数据 |
25 | 25 | ||
26 | router.get('/cate-resource', brand.cateResource); // 品类资源位页面 | 26 | router.get('/cate-resource', brand.cateResource); // 品类资源位页面 |
27 | -router.get('/collect-shop', brand.collectShop); // 收藏品牌店铺 | 27 | +router.post('/collect-shop', brand.collectShop); // 收藏品牌店铺 |
28 | router.get('/cate', brand.cate); // 全部分类 | 28 | router.get('/cate', brand.cate); // 全部分类 |
29 | router.get('/get-cate-list', brand.getCateList); // 全部分类数据列表 | 29 | router.get('/get-cate-list', brand.getCateList); // 全部分类数据列表 |
30 | 30 |
@@ -124,6 +124,26 @@ const order = { | @@ -124,6 +124,26 @@ const order = { | ||
124 | module: 'home', | 124 | module: 'home', |
125 | page: 'order' | 125 | page: 'order' |
126 | }); | 126 | }); |
127 | + }, | ||
128 | + | ||
129 | + // 订单-物流 | ||
130 | + logistic: (req, res) => { | ||
131 | + res.render('order-logistic', { | ||
132 | + module: 'home', | ||
133 | + page: 'order-logistic', | ||
134 | + title: '物流详情' | ||
135 | + }); | ||
136 | + }, | ||
137 | + | ||
138 | + // API- 订单-物流 | ||
139 | + getOrderLogisticdate: (req, res) => { | ||
140 | + orderModel.getOrderLogisticdate({ | ||
141 | + uid: req.user.uid || '', | ||
142 | + type: req.query.type || '', | ||
143 | + order_code: req.query.orderCode | ||
144 | + }).then(result => { | ||
145 | + res.json(result); | ||
146 | + }); | ||
127 | } | 147 | } |
128 | }; | 148 | }; |
129 | 149 |
@@ -9,6 +9,7 @@ const api = global.yoho.API; | @@ -9,6 +9,7 @@ const api = global.yoho.API; | ||
9 | 9 | ||
10 | // const serviceAPI = global.yoho.ServiceAPI; | 10 | // const serviceAPI = global.yoho.ServiceAPI; |
11 | const camelCase = global.yoho.camelCase; | 11 | const camelCase = global.yoho.camelCase; |
12 | +const _ = require('lodash'); | ||
12 | 13 | ||
13 | /** | 14 | /** |
14 | * 获取订单列表数据 | 15 | * 获取订单列表数据 |
@@ -89,3 +90,33 @@ exports.deleteOrder = (orderCode, uid) => { | @@ -89,3 +90,33 @@ exports.deleteOrder = (orderCode, uid) => { | ||
89 | return result; | 90 | return result; |
90 | }); | 91 | }); |
91 | }; | 92 | }; |
93 | + | ||
94 | +/** | ||
95 | + * 查看订单物流详情 | ||
96 | + * @param {[int]} order_code 订单号 | ||
97 | + * @param {[int]} uid 用户uid | ||
98 | + * @param {[string]} type 退换货物流(退货:refund,换货:change) | ||
99 | + * @return {[array]} | ||
100 | + */ | ||
101 | +exports.getOrderLogisticdate = (params) => { | ||
102 | + let method; | ||
103 | + | ||
104 | + if (_.isEmpty(params.order_code)) { | ||
105 | + return []; | ||
106 | + } | ||
107 | + | ||
108 | + // getNewExpress:退换货物流,li:订单物流 | ||
109 | + method = _.indexOf(['refund', 'change'], params.type) >= 0 ? | ||
110 | + 'app.express.getNewExpress' : 'app.express.li'; | ||
111 | + | ||
112 | + return api.get('', Object.assign({ | ||
113 | + method: method | ||
114 | + }, params)).then(result => { | ||
115 | + | ||
116 | + if (result.code === 200) { | ||
117 | + return result.data; | ||
118 | + } | ||
119 | + | ||
120 | + return []; | ||
121 | + }); | ||
122 | +}; |
@@ -51,4 +51,7 @@ router.get('/exchange/order', exchange.order); | @@ -51,4 +51,7 @@ router.get('/exchange/order', exchange.order); | ||
51 | router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们 | 51 | router.get('/about-us', home.aboutUs); // 个人中心 - 关于我们 |
52 | 52 | ||
53 | 53 | ||
54 | +router.get('/logistic', order.logistic); // 个人中心 - 订单物流详情页面 | ||
55 | +router.get('/get-order-logistic-date', order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据 | ||
56 | + | ||
54 | module.exports = router; | 57 | module.exports = router; |
apps/home/views/action/order-logistic.hbs
0 → 100644
public/js/home/order-logistic.page.js
0 → 100644
@@ -11,10 +11,6 @@ | @@ -11,10 +11,6 @@ | ||
11 | 11 | ||
12 | const tip = require('common/tip'); | 12 | const tip = require('common/tip'); |
13 | 13 | ||
14 | -window.yohoWapInterface = { | ||
15 | - headerRightTopBtn: function() {} | ||
16 | -}; | ||
17 | - | ||
18 | const yoho = { | 14 | const yoho = { |
19 | /** | 15 | /** |
20 | * 判断是否是 APP | 16 | * 判断是否是 APP |
@@ -28,7 +24,7 @@ const yoho = { | @@ -28,7 +24,7 @@ const yoho = { | ||
28 | 24 | ||
29 | /** | 25 | /** |
30 | * 跳转至指定index的tab(从0开始) | 26 | * 跳转至指定index的tab(从0开始) |
31 | - * @param args 传递给 APP 的参数 | 27 | + * @param args 传递给 APP 的参数 {"index":tab_index} |
32 | * @param success 调用成功的回调方法 | 28 | * @param success 调用成功的回调方法 |
33 | * @param fail 调用失败的回调方法 | 29 | * @param fail 调用失败的回调方法 |
34 | */ | 30 | */ |
@@ -45,7 +41,7 @@ const yoho = { | @@ -45,7 +41,7 @@ const yoho = { | ||
45 | 41 | ||
46 | /** | 42 | /** |
47 | * 跳转至登陆页面 | 43 | * 跳转至登陆页面 |
48 | - * @param args 传递给 APP 的参数 | 44 | + * @param args 传递给 APP 的参数 {""} |
49 | * @param success 调用成功的回调方法 | 45 | * @param success 调用成功的回调方法 |
50 | * @param fail 调用失败的回调方法 | 46 | * @param fail 调用失败的回调方法 |
51 | */ | 47 | */ |
@@ -61,8 +57,42 @@ const yoho = { | @@ -61,8 +57,42 @@ const yoho = { | ||
61 | }, | 57 | }, |
62 | 58 | ||
63 | /** | 59 | /** |
60 | + * 退出登录,清除本地用户数据 | ||
61 | + * @param args {""} | ||
62 | + * @param success | ||
63 | + * @param fail | ||
64 | + */ | ||
65 | + goLogout(args, success, fail) { | ||
66 | + if (this.isApp) { | ||
67 | + window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, { | ||
68 | + method: 'go.loginout', | ||
69 | + arguments: args | ||
70 | + }); | ||
71 | + } else { | ||
72 | + tip('暂不支持,请在BLK应用中打开'); | ||
73 | + } | ||
74 | + }, | ||
75 | + | ||
76 | + /** | ||
77 | + * 设置shoppingkey | ||
78 | + * @param args 传递给 APP 的参数 {"shoppingkey":""} | ||
79 | + * @param success 调用成功的回调方法 | ||
80 | + * @param fail 调用失败的回调方法 | ||
81 | + */ | ||
82 | + goShopingKey(args, success, fail) { | ||
83 | + if (this.isApp) { | ||
84 | + window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, { | ||
85 | + method: 'go.shoppingkey', | ||
86 | + arguments: args | ||
87 | + }); | ||
88 | + } else { | ||
89 | + tip('暂不支持,请在BLK应用中打开'); | ||
90 | + } | ||
91 | + }, | ||
92 | + | ||
93 | + /** | ||
64 | * 跳转至购物车页面 | 94 | * 跳转至购物车页面 |
65 | - * @param args 传递给 APP 的参数 | 95 | + * @param args 传递给 APP 的参数 {""} |
66 | * @param success 调用成功的回调方法 | 96 | * @param success 调用成功的回调方法 |
67 | * @param fail 调用失败的回调方法 | 97 | * @param fail 调用失败的回调方法 |
68 | */ | 98 | */ |
@@ -78,8 +108,8 @@ const yoho = { | @@ -78,8 +108,8 @@ const yoho = { | ||
78 | }, | 108 | }, |
79 | 109 | ||
80 | /** | 110 | /** |
81 | - * 跳转至地址管理页面 | ||
82 | - * @param args 传递给 APP 的参数 | 111 | + * 跳转地址页面 1:地址选择页面 2:地址管理页面 |
112 | + * @param args 传递给 APP 的参数 {"type":"1"} | ||
83 | * @param success 调用成功的回调方法 | 113 | * @param success 调用成功的回调方法 |
84 | * @param fail 调用失败的回调方法 | 114 | * @param fail 调用失败的回调方法 |
85 | */ | 115 | */ |
@@ -95,8 +125,8 @@ const yoho = { | @@ -95,8 +125,8 @@ const yoho = { | ||
95 | }, | 125 | }, |
96 | 126 | ||
97 | /** | 127 | /** |
98 | - * 跳转至图片浏览页面 | ||
99 | - * @param args 传递给 APP 的参数 | 128 | + * 跳转至图片浏览页面;images:浏览图片的url index:点击的图片序号 |
129 | + * @param args 传递给 APP 的参数 {"images":[imgUrl1,imgUrl2...],"index":"1"} | ||
100 | * @param success 调用成功的回调方法 | 130 | * @param success 调用成功的回调方法 |
101 | * @param fail 调用失败的回调方法 | 131 | * @param fail 调用失败的回调方法 |
102 | */ | 132 | */ |
@@ -113,7 +143,7 @@ const yoho = { | @@ -113,7 +143,7 @@ const yoho = { | ||
113 | 143 | ||
114 | /** | 144 | /** |
115 | * 跳转至新页面(页面内容为html) | 145 | * 跳转至新页面(页面内容为html) |
116 | - * @param args 传递给 APP 的参数 | 146 | + * @param args 传递给 APP 的参数 {"url":""} |
117 | * @param success 调用成功的回调方法 | 147 | * @param success 调用成功的回调方法 |
118 | * @param fail 调用失败的回调方法 | 148 | * @param fail 调用失败的回调方法 |
119 | */ | 149 | */ |
@@ -130,7 +160,7 @@ const yoho = { | @@ -130,7 +160,7 @@ const yoho = { | ||
130 | 160 | ||
131 | /** | 161 | /** |
132 | * 跳转至支付页面 | 162 | * 跳转至支付页面 |
133 | - * @param args 传递给 APP 的参数 | 163 | + * @param args 传递给 APP 的参数 {"orderid":"098768"} |
134 | * @param success 调用成功的回调方法 | 164 | * @param success 调用成功的回调方法 |
135 | * @param fail 调用失败的回调方法 | 165 | * @param fail 调用失败的回调方法 |
136 | */ | 166 | */ |
@@ -146,8 +176,8 @@ const yoho = { | @@ -146,8 +176,8 @@ const yoho = { | ||
146 | }, | 176 | }, |
147 | 177 | ||
148 | /** | 178 | /** |
149 | - * 回到上一个原生界面 | ||
150 | - * @param args | 179 | + * 返回上一级页面 |
180 | + * @param args {} | ||
151 | * @param success | 181 | * @param success |
152 | * @param fail | 182 | * @param fail |
153 | */ | 183 | */ |
@@ -164,7 +194,7 @@ const yoho = { | @@ -164,7 +194,7 @@ const yoho = { | ||
164 | 194 | ||
165 | /** | 195 | /** |
166 | * 分享 | 196 | * 分享 |
167 | - * @param args | 197 | + * @param args {"title":"标题","des":"描述","img":"icon地址","url":"网页地址"} |
168 | * @param success | 198 | * @param success |
169 | * @param fail | 199 | * @param fail |
170 | */ | 200 | */ |
@@ -180,12 +210,46 @@ const yoho = { | @@ -180,12 +210,46 @@ const yoho = { | ||
180 | }, | 210 | }, |
181 | 211 | ||
182 | /** | 212 | /** |
213 | + * 跳转到搜索页面 | ||
214 | + * @param args {} | ||
215 | + * @param success | ||
216 | + * @param fail | ||
217 | + */ | ||
218 | + goSearch(args, success, fail) { | ||
219 | + if (this.isApp) { | ||
220 | + window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, { | ||
221 | + method: 'go.search', | ||
222 | + arguments: args | ||
223 | + }); | ||
224 | + } else { | ||
225 | + tip('暂不支持,请在BLK应用中打开'); | ||
226 | + } | ||
227 | + }, | ||
228 | + | ||
229 | + /** | ||
230 | + * 跳转到设置页面 | ||
231 | + * @param args {} | ||
232 | + * @param success | ||
233 | + * @param fail | ||
234 | + */ | ||
235 | + goSetting(args, success, fail) { | ||
236 | + if (this.isApp) { | ||
237 | + window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, { | ||
238 | + method: 'go.setting', | ||
239 | + arguments: args | ||
240 | + }); | ||
241 | + } else { | ||
242 | + tip('暂不支持,请在BLK应用中打开'); | ||
243 | + } | ||
244 | + }, | ||
245 | + | ||
246 | + /** | ||
183 | * 原生调用 JS 方法 | 247 | * 原生调用 JS 方法 |
184 | * @param name 方法名 | 248 | * @param name 方法名 |
185 | * @param callback 回调 | 249 | * @param callback 回调 |
186 | */ | 250 | */ |
187 | addNativeMethod(name, callback) { | 251 | addNativeMethod(name, callback) { |
188 | - window.yohoWapInterface[name] = callback; | 252 | + window.yohoInterface[name] = callback; |
189 | } | 253 | } |
190 | }; | 254 | }; |
191 | 255 |
1 | <template> | 1 | <template> |
2 | - <brand-top v-bind:share-data="shareData"></brand-top> | ||
3 | - <brand-shop-top></brand-shop-top> | 2 | + <brand-top-bar v-bind:share-data="shareData"></brand-top-bar> |
3 | + <brand-shop-top v-bind:shop-info="shopInfo"></brand-shop-top> | ||
4 | <goods-list v-bind:data="productList"></goods-list> | 4 | <goods-list v-bind:data="productList"></goods-list> |
5 | <drawer v-ref:drawer> | 5 | <drawer v-ref:drawer> |
6 | <filter :config.once="filterConfig"></filter> | 6 | <filter :config.once="filterConfig"></filter> |
@@ -9,10 +9,11 @@ | @@ -9,10 +9,11 @@ | ||
9 | 9 | ||
10 | <script> | 10 | <script> |
11 | const $ = require('yoho-jquery'); | 11 | const $ = require('yoho-jquery'); |
12 | + const qs = require('yoho-qs'); | ||
12 | const bus = require('common/vue-bus'); | 13 | const bus = require('common/vue-bus'); |
13 | const tip = require('common/tip'); | 14 | const tip = require('common/tip'); |
14 | - const brandTop = require('channel/brand-top.vue'); | ||
15 | - const brandShopTop = require('channel/brand-shop-top.vue'); | 15 | + const brandTopBar = require('channel/brand-top-bar.vue'); // 顶部栏,包括返回、收藏店铺、分享,打开筛选页面 |
16 | + const brandShopTop = require('channel/brand-shop-top.vue'); // 店铺头部信息 | ||
16 | const goodsList = require('product/list.vue'); | 17 | const goodsList = require('product/list.vue'); |
17 | const drawer = require('product/drawer.vue'); | 18 | const drawer = require('product/drawer.vue'); |
18 | const filter = require('product/filter.vue'); | 19 | const filter = require('product/filter.vue'); |
@@ -22,11 +23,10 @@ | @@ -22,11 +23,10 @@ | ||
22 | module.exports = { | 23 | module.exports = { |
23 | data() { | 24 | data() { |
24 | return { | 25 | return { |
25 | - shareData: { | ||
26 | - title: 'BLK', | ||
27 | - link: 'm.blk.com', | ||
28 | - img: 'https://img11.static.yhbimg.com/brandLogo/2016/04/13/15/010eb8606c1072fd2e769c62567d3bbe93.png?imageView2/2/w/140/h/140' | ||
29 | - }, | 26 | + domain: qs.domain, |
27 | + shareData: {}, // 分享相关数据 | ||
28 | + shopInfo: {}, // 店铺介绍相关数据 | ||
29 | + | ||
30 | sortConfig: global.sortConfig, | 30 | sortConfig: global.sortConfig, |
31 | filterConfig: global.filterConfig, | 31 | filterConfig: global.filterConfig, |
32 | 32 | ||
@@ -45,6 +45,10 @@ | @@ -45,6 +45,10 @@ | ||
45 | }; | 45 | }; |
46 | }, | 46 | }, |
47 | watch: { | 47 | watch: { |
48 | + domain: function() { | ||
49 | + this.getShopInfo(); | ||
50 | + }, | ||
51 | + | ||
48 | /* sort 和 filter 改变 都会触发 重新搜索 (想象成清空所有分页) */ | 52 | /* sort 和 filter 改变 都会触发 重新搜索 (想象成清空所有分页) */ |
49 | sort: function() { | 53 | sort: function() { |
50 | this.research(); | 54 | this.research(); |
@@ -54,6 +58,28 @@ | @@ -54,6 +58,28 @@ | ||
54 | } | 58 | } |
55 | }, | 59 | }, |
56 | methods: { | 60 | methods: { |
61 | + | ||
62 | + /* 获取店铺简介相关数据 */ | ||
63 | + getShopInfo() { | ||
64 | + $.get({ | ||
65 | + url: '/get-shop-info', | ||
66 | + data: { domain: this.domain } | ||
67 | + }).done(result => { | ||
68 | + if (result) { | ||
69 | + this.shopInfo = result; | ||
70 | + this.shopInfo.showBrandInfo = true; | ||
71 | + this.shareData = { | ||
72 | + title: result.brandName, | ||
73 | + link: '/brand-share?domain=' + this.domain, | ||
74 | + img: result.brandBg | ||
75 | + }; | ||
76 | + } else { | ||
77 | + this.shopInfo.showBrandInfo = false; | ||
78 | + } | ||
79 | + }).fail(() => { | ||
80 | + tip('网络错误'); | ||
81 | + }); | ||
82 | + }, | ||
57 | getProductList() { | 83 | getProductList() { |
58 | let data = {}; | 84 | let data = {}; |
59 | 85 | ||
@@ -106,14 +132,16 @@ | @@ -106,14 +132,16 @@ | ||
106 | } | 132 | } |
107 | }, | 133 | }, |
108 | components: { | 134 | components: { |
109 | - brandTop, | 135 | + brandTopBar, |
110 | brandShopTop, | 136 | brandShopTop, |
111 | goodsList, | 137 | goodsList, |
112 | drawer, | 138 | drawer, |
113 | filter | 139 | filter |
114 | }, | 140 | }, |
115 | created() { | 141 | created() { |
116 | - this.search(); | 142 | + this.getShopInfo(); |
143 | + | ||
144 | +// this.search(); | ||
117 | bus.$on('list.paging', function() { | 145 | bus.$on('list.paging', function() { |
118 | this.search(); | 146 | this.search(); |
119 | }); | 147 | }); |
1 | <template> | 1 | <template> |
2 | - <div v-if="showBrandInfo" class="brand-top-box" v-bind:style="{ 'background-image': `url(${brandIntro.brandBg})` }"> | 2 | + <div v-if="shopInfo.showBrandInfo" class="brand-top-box" v-bind:style="{ 'background-image': `url(${shopInfo.brandBg})` }"> |
3 | <div class="brand-bottom"> | 3 | <div class="brand-bottom"> |
4 | - <img v-if="brandIntro.showBrandLogo" v-lazy="brandIntro.brandLogo" alt="{{ brandIntro.brandName }}"> | ||
5 | - <div v-else class="brand-title">{{ brandIntro.brandName }}</div> | 4 | + <img v-if="shopInfo.showBrandLogo" v-lazy="brandIntro.brandLogo" alt="{{ shopInfo.brandName }}"> |
5 | + <div v-else class="brand-title">{{ shopInfo.brandName }}</div> | ||
6 | <hr> | 6 | <hr> |
7 | - <div v-show="showMore" transition="brand-intro" v-bind:class="{ 'brand-short': !showMore }">{{ brandIntro.brandIntro }}</div> | 7 | + <div v-show="showMore" transition="brand-intro" v-bind:class="{ 'brand-short': !showMore }">{{ shopInfo.brandIntro }}</div> |
8 | </div> | 8 | </div> |
9 | <div v-if="!showMore" class="showmore expand" @click="introTrans()"><span class="icon"></span></div> | 9 | <div v-if="!showMore" class="showmore expand" @click="introTrans()"><span class="icon"></span></div> |
10 | <div v-else class="showmore collapse" @click="introTrans()"><span class="icon"></span></div> | 10 | <div v-else class="showmore collapse" @click="introTrans()"><span class="icon"></span></div> |
@@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
42 | transition: all 0.3s ease; | 42 | transition: all 0.3s ease; |
43 | font-size: 16px; | 43 | font-size: 16px; |
44 | line-height: 32px; | 44 | line-height: 32px; |
45 | - width: 82%; | 45 | + width: 90%; |
46 | height: 220px; | 46 | height: 220px; |
47 | overflow-y: auto; | 47 | overflow-y: auto; |
48 | } | 48 | } |
@@ -57,7 +57,7 @@ | @@ -57,7 +57,7 @@ | ||
57 | display: -webkit-box !important; | 57 | display: -webkit-box !important; |
58 | font-size: 16px; | 58 | font-size: 16px; |
59 | line-height: 32px; | 59 | line-height: 32px; |
60 | - width: 82%; | 60 | + width: 90%; |
61 | text-overflow: ellipsis; | 61 | text-overflow: ellipsis; |
62 | overflow-y: hidden; | 62 | overflow-y: hidden; |
63 | display: -webkit-box; | 63 | display: -webkit-box; |
@@ -77,47 +77,21 @@ | @@ -77,47 +77,21 @@ | ||
77 | } | 77 | } |
78 | </style> | 78 | </style> |
79 | <script> | 79 | <script> |
80 | - const $ = require('yoho-jquery'); | ||
81 | - const tip = require('common/tip'); | ||
82 | - const qs = require('yoho-qs'); | ||
83 | - | ||
84 | module.exports = { | 80 | module.exports = { |
81 | + props: { | ||
82 | + shopInfo: { | ||
83 | + type: Object | ||
84 | + } | ||
85 | + }, | ||
85 | data() { | 86 | data() { |
86 | return { | 87 | return { |
87 | - brandIntro: {}, | ||
88 | - showMore: false, | ||
89 | - showBrandInfo: false | 88 | + showMore: false |
90 | }; | 89 | }; |
91 | }, | 90 | }, |
92 | - watch: { | ||
93 | - domain() { | ||
94 | - this.getShopIntro(); | ||
95 | - } | ||
96 | - }, | ||
97 | methods: { | 91 | methods: { |
98 | - getShopIntro() { | ||
99 | - let data = { | ||
100 | - domain: qs.domain | ||
101 | - }; | ||
102 | - | ||
103 | - $.ajax({ | ||
104 | - url: '/get-brand-intro', | ||
105 | - data: data | ||
106 | - }).then(result => { | ||
107 | - if (result) { | ||
108 | - this.showBrandInfo = true; | ||
109 | - this.brandIntro = result; | ||
110 | - } | ||
111 | - }).fail(() => { | ||
112 | - tip('网络错误'); | ||
113 | - }); | ||
114 | - }, | ||
115 | introTrans() { | 92 | introTrans() { |
116 | this.showMore = this.showMore !== true; | 93 | this.showMore = this.showMore !== true; |
117 | } | 94 | } |
118 | - }, | ||
119 | - created() { | ||
120 | - this.getShopIntro(); | ||
121 | } | 95 | } |
122 | }; | 96 | }; |
123 | </script> | 97 | </script> |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <div class="top-box clearfix"> | 2 | <div class="top-box clearfix"> |
3 | <span class="icon back" @click="goBack()"></span> | 3 | <span class="icon back" @click="goBack()"></span> |
4 | <div class="right"> | 4 | <div class="right"> |
5 | - <span class="icon" v-bind:class="{'favorite': isFav}" @click="collectShop()"></span> | 5 | + <span class="icon" v-bind:class="{'favorite': shareData.isFav}" @click="collectShop()"></span> |
6 | <span class="icon share" @click="goShare()"></span> | 6 | <span class="icon share" @click="goShare()"></span> |
7 | <span class="icon filter" @click="showFilter()"></span> | 7 | <span class="icon filter" @click="showFilter()"></span> |
8 | </div> | 8 | </div> |
@@ -59,32 +59,30 @@ | @@ -59,32 +59,30 @@ | ||
59 | }, | 59 | }, |
60 | methods: { | 60 | methods: { |
61 | goShare() { | 61 | goShare() { |
62 | - | ||
63 | - // TODO 这边应该需要一个分享后的页面链接,需要与 APP 确定分享要传的参数 | ||
64 | - let link = this.shareData.title + | ||
65 | - this.shareData.link + | ||
66 | - this.shareData.img; | ||
67 | - | ||
68 | - yoho.goShare({link: link}, function() {}, function() {}); | 62 | + yoho.goShare(this.shareData, function() {}, function() {}); |
69 | }, | 63 | }, |
70 | goBack() { | 64 | goBack() { |
71 | yoho.goBack({}, function() {}, function() {}); | 65 | yoho.goBack({}, function() {}, function() {}); |
72 | }, | 66 | }, |
67 | + | ||
68 | + /* 收藏或者取消收藏店铺 */ | ||
73 | collectShop() { | 69 | collectShop() { |
74 | 70 | ||
75 | /* TODO 获取数据策略待确定 */ | 71 | /* TODO 获取数据策略待确定 */ |
76 | let data = { | 72 | let data = { |
77 | shopId: this.shareData.shopId, | 73 | shopId: this.shareData.shopId, |
78 | - favId: this.shareData.shopId, | ||
79 | isFav: this.shareData.isFav | 74 | isFav: this.shareData.isFav |
80 | }; | 75 | }; |
81 | 76 | ||
82 | - $.ajax({ | 77 | + $.post({ |
83 | url: '/collect-shop', | 78 | url: '/collect-shop', |
84 | data: data | 79 | data: data |
85 | }).done(result => { | 80 | }).done(result => { |
86 | - | ||
87 | - /* TODO 处理收藏状态 */ | 81 | + if (result.code === 200) { |
82 | + this.shareData.isFav = this.shareData.isFav !== true; | ||
83 | + } else { | ||
84 | + tip('网络错误'); | ||
85 | + } | ||
88 | }).fail(() => { | 86 | }).fail(() => { |
89 | tip('网络错误'); | 87 | tip('网络错误'); |
90 | }); | 88 | }); |
@@ -15,8 +15,7 @@ | @@ -15,8 +15,7 @@ | ||
15 | data() { | 15 | data() { |
16 | return { | 16 | return { |
17 | page: 'brand', | 17 | page: 'brand', |
18 | - contentCode: contentCode.brand[qs.brand || 'men'], | ||
19 | - channel: qs.channel | 18 | + contentCode: contentCode.cate[qs.channel || 'men'] |
20 | }; | 19 | }; |
21 | }, | 20 | }, |
22 | components: { | 21 | components: { |
1 | <template> | 1 | <template> |
2 | - <button @click="yoho.goTap()">跳转 TAP</button> | ||
3 | - <button @click="yoho.goLogin()">跳转登录</button> | 2 | + <button @click='yoho.goTap({"index":2})'>TAP</button> |
3 | + <button @click="yoho.goLogin()">登录</button> | ||
4 | + <button @click="yoho.goLogout()">退出登录</button> | ||
5 | + <button @click='yoho.goShopingKey("shoppingkey":"123456789")'>设置ShopingKey</button> | ||
4 | <button @click="yoho.goShopingCart()">跳转购物车</button> | 6 | <button @click="yoho.goShopingCart()">跳转购物车</button> |
5 | - <button @click="yoho.goAddress()">跳转地址管理列表</button> | ||
6 | - <button @click="yoho.goImageBrowser()">跳转图片浏览</button> | ||
7 | - <button @click="yoho.goNewPage()">跳转新的 WAP 页面</button> | ||
8 | - <button @click="yoho.goPay()">跳转支付页面</button> | 7 | + <button @click='yoho.goAddress({"type":"1"})'>地址选择页面</button> |
8 | + <button @click='yoho.goAddress({"type":"2"})'>地址管理页面</button> | ||
9 | + <button @click='yoho.goImageBrowser({"images":["http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg"], {"index": "1"})'>图片浏览</button> | ||
10 | + <button @click='yoho.goNewPage("url":"http://m.yohoblk.com")'>新页面</button> | ||
11 | + <button @click="yoho.goPay()">支付</button> | ||
12 | + <button @click="yoho.goBack()">返回</button> | ||
13 | + <button @click='yoho.goShare({"title":"标题","des":"描述","img":"http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg","url":"http://m.yohoblk.com"})'>分享</button> | ||
14 | + <button @click='yoho.goSearch()'>搜索</button> | ||
15 | + <button @click='yoho.goSetting()'>设置</button> | ||
9 | </template> | 16 | </template> |
10 | <style> | 17 | <style> |
11 | button { | 18 | button { |
public/vue/home/order-logistic.vue
0 → 100644
1 | +<template> | ||
2 | +<div class="logistic-page yoho-page"> | ||
3 | + <div class="overview"> | ||
4 | + <div class="left" > | ||
5 | + <a href="{{logisticDate.url}}"> | ||
6 | + <img class="icon" v-bind:src="logo" /> | ||
7 | + </a> | ||
8 | + </div> | ||
9 | + <div class="right"> | ||
10 | + <div> | ||
11 | + <span class='info'>物流公司:</span> | ||
12 | + <span >{{logisticDate.caption}}</span> | ||
13 | + </div> | ||
14 | + <div> | ||
15 | + <span class='info'>快递单号:</span> | ||
16 | + <span>{{logisticDate.express_number}}</span> | ||
17 | + </div> | ||
18 | + </div> | ||
19 | + </div><!--end overview--> | ||
20 | + | ||
21 | + <div class="title"> | ||
22 | + <span>物流详情</span> | ||
23 | + </div> | ||
24 | + | ||
25 | + <div class="detail"> | ||
26 | + <div class="timeline-box" v-for="(index, detail) in logisticDate.express_detail"> | ||
27 | + <span class="timeline-node"></span> | ||
28 | + <div class="timeline-info"> | ||
29 | + <div class="timeline-info-row"> | ||
30 | + {{detail.accept_address}} | ||
31 | + </div> | ||
32 | + <div class="timeline-info-row"> | ||
33 | + {{detail.acceptTime}} | ||
34 | + </div> | ||
35 | + </div> | ||
36 | + </div> | ||
37 | + </div><!--end detail--> | ||
38 | + | ||
39 | +</div><!--end logistic-page--> | ||
40 | +</template> | ||
41 | + | ||
42 | +<style> | ||
43 | +$logistic_gray: #f0f0f0; | ||
44 | +$border_color_strong: #e5e5e5; | ||
45 | +$border_color_light: #eee; | ||
46 | + | ||
47 | +.logistic-page { | ||
48 | + background-color: $logistic_gray; | ||
49 | + | ||
50 | + .overview { | ||
51 | + height: 120px; | ||
52 | + line-height: 120px; | ||
53 | + width: 100%; | ||
54 | + margin-bottom: 40px; | ||
55 | + background-color: #fff; | ||
56 | + color: #464646; | ||
57 | + border-bottom: 1px solid $border_color_strong; | ||
58 | + | ||
59 | + .left { | ||
60 | + width: 19%; | ||
61 | + float: left; | ||
62 | + text-align: center; | ||
63 | + height: 100%; | ||
64 | + | ||
65 | + .icon { | ||
66 | + width: 88px; | ||
67 | + height: 88px; | ||
68 | + margin: 0 auto; | ||
69 | + background-size: 100%; | ||
70 | + background-repeat: no-repeat; | ||
71 | + background-position: center; | ||
72 | + margin-top: 16px; | ||
73 | + } | ||
74 | + } | ||
75 | + | ||
76 | + .right { | ||
77 | + width: 81%; | ||
78 | + float: left; | ||
79 | + padding-top: 20px; | ||
80 | + padding-bottom: 20px; | ||
81 | + height: 80px; | ||
82 | + | ||
83 | + div { | ||
84 | + height: 40px; | ||
85 | + line-height: 44px; | ||
86 | + color: #595959; | ||
87 | + font-size: 24px; | ||
88 | + } | ||
89 | + } | ||
90 | + | ||
91 | + .info { | ||
92 | + padding-right: 4px; | ||
93 | + } | ||
94 | + } | ||
95 | + | ||
96 | + .title { | ||
97 | + height: 112px; | ||
98 | + line-height: 112px; | ||
99 | + background-color: #fff; | ||
100 | + padding-left: 40px; | ||
101 | + font-size: 40px; | ||
102 | + } | ||
103 | + | ||
104 | + .detail { | ||
105 | + background-color: #fff; | ||
106 | + padding-left: 80px; | ||
107 | + margin-bottom: 40px; | ||
108 | + } | ||
109 | + | ||
110 | + .timeline-box { | ||
111 | + border-left: 1px solid $border_color_strong; | ||
112 | + position: relative; | ||
113 | + padding-left: 52px; | ||
114 | + } | ||
115 | + | ||
116 | + .timeline-node { | ||
117 | + position: absolute; | ||
118 | + top: 32px; | ||
119 | + left: -9.04444px; | ||
120 | + display: inline-block; | ||
121 | + width: 16.4px; | ||
122 | + height: 16.4px; | ||
123 | + background-color: $border_color_strong; | ||
124 | + border-radius: 100%; | ||
125 | + } | ||
126 | + | ||
127 | + .timeline-box:first-child { | ||
128 | + .timeline-node { | ||
129 | + background-color: #989898; | ||
130 | + } | ||
131 | + | ||
132 | + .timeline-info-row { | ||
133 | + color: #606060; | ||
134 | + } | ||
135 | + } | ||
136 | + | ||
137 | + .timeline-info { | ||
138 | + padding: 20px 0; | ||
139 | + border-bottom: 1px solid $border_color_strong; | ||
140 | + } | ||
141 | + | ||
142 | + .timeline-box:last-child { | ||
143 | + .timeline-info { | ||
144 | + border: none; | ||
145 | + } | ||
146 | + } | ||
147 | + | ||
148 | + .timeline-info-row { | ||
149 | + min-height: 40px; | ||
150 | + line-height: 40px; | ||
151 | + font-size: 28px; | ||
152 | + color: #bababa; | ||
153 | + padding-right: 32px; | ||
154 | + } | ||
155 | +} | ||
156 | +</style> | ||
157 | + | ||
158 | + | ||
159 | +<script> | ||
160 | + const $ = require('yoho-jquery'); | ||
161 | + const qs = require('yoho-qs'); | ||
162 | + const tip = require('common/tip'); | ||
163 | + | ||
164 | + module.exports = { | ||
165 | + props: [], | ||
166 | + data() { | ||
167 | + return { | ||
168 | + logisticDate: [], | ||
169 | + logo: '' | ||
170 | + }; | ||
171 | + }, | ||
172 | + methods: { | ||
173 | + getLogisticDate() { | ||
174 | + let data = { | ||
175 | + orderCode: qs.order_code || '', | ||
176 | + type: qs.type || '', | ||
177 | + }; | ||
178 | + | ||
179 | + $.ajax({ | ||
180 | + url: '/home/get-order-logistic-date', | ||
181 | + data: data | ||
182 | + }).then(result => { | ||
183 | + this.logisticDate = result; | ||
184 | + if (result && result.logo) { | ||
185 | + this.logo = result.logo; | ||
186 | + } | ||
187 | + }).fail(() => { | ||
188 | + tip('网络错误'); | ||
189 | + }); | ||
190 | + } | ||
191 | + }, | ||
192 | + created() { | ||
193 | + this.getLogisticDate(); | ||
194 | + } | ||
195 | + }; | ||
196 | +</script> | ||
197 | + | ||
198 | + |
-
Please register or login to post a comment