Authored by lijing

订单完成页

/**
* 支付成功页
* @author: jing.li<jing.li@yoho.cn>
* @date: 2016/10/25
*/
'use strict';
const mRoot = '../models';
const payModel = require(`${mRoot}/pay`);
const headerModel = require('../../../doraemon/models/header'); // 头部model
const payCod = (req, res, next) => {
let headerData = headerModel.setNav({
navTitle: '支付成功'
});
let responseData = {
pageHeader: headerData,
module: 'cart',
page: 'pay',
title: '支付成功'
};
let contentCode = '05afedf76886d732573f10f7451a1703';
payModel.getPayCod(contentCode).then(result => {
res.render('pay/pay-cod', Object.assign(responseData, result));
}).catch(next);
};
module.exports = {
payCod
};
... ...
/**
* sub app channel
* sub app guang
* @author: Bi Kai<kai.bi@yoho.cn>
* @date: 2016/05/09
*/
var express = require('express');
var express = require('express'),
path = require('path');
var app = express();
// set view engin
var doraemon = path.join(__dirname, '../../doraemon/views'); // parent view root
app.on('mount', function(parent) {
delete parent.locals.settings; // 不继承父 App 的设置
Object.assign(app.locals, parent.locals);
});
app.use(global.yoho.hbs({
extname: '.hbs',
defaultLayout: 'layout',
layoutsDir: doraemon,
partialsDir: path.join(__dirname, './views/partial'),
views: path.join(__dirname, 'views/action'),
helpers: global.yoho.helpers
}));
// for zookeeper, inject locals
app.use((req, res, next) => {
req.app.locals.wap = app.locals.wap;
... ...
/**
* 支付成功页
* @author: jing.li<jing.li@yoho.cn>
* @date: 2016/10/25
*/
'use strict';
const serviceAPI = global.yoho.ServiceAPI;
// 资源位
const getPayCod = (contentCode) => {
return serviceAPI.get('operations/api/v5/resource/get', {
content_code: contentCode
}).then((result) => {
let resu = {
banner: []
};
if (result && result.code === 200) {
resu.banner = result.data;
} else {
logger.error('banner is not 200');
resu = {};
}
return resu;
});
};
module.exports = {
getPayCod
};
... ...
... ... @@ -10,7 +10,9 @@ const express = require('express');
const router = express.Router();
const cRoot = './controllers';
const countController = require(`${cRoot}/count`);
const payController = require(`${cRoot}/pay`);
router.get('/index/count', countController.cartCount);
router.get('/paySuccess/payCod', payController.payCod);// 支付成功,货到付款
module.exports = router;
... ...
<div class="pay-success">
<div class="top-tip">
<div class="img-c"></div>
<p class="ok-tip">订单提交成功</p>
<p class="left-tip">您需要在收货时向售货员支付¥69.00</p>
</div>
<div class="info-table-c">
<table class="info-table">
<tr>
<td>订单编号</td>
<td>123456789</td>
</tr>
<tr>
<td>付款金额</td>
<td>¥69.00</td>
</tr>
<tr>
<td>付款方式</td>
<td>货到付款</td>
</tr>
</table>
</div>
<div class="btn-c">
<a>随便逛逛</a>
<a>查看订单</a>
</div>
{{# banner}}
{{#data}}
<a href="{{url}}" class="ad-pic" alt="{{alt}}">
<img src="{{image src 640 200}}" />
</a>
{{/data}}
{{/banner}}
{{> home/maybe-like}}
</div>
... ...

1.18 KB | W: | H:

3.51 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
var $ = require('yoho-jquery'),
lazyLoad = require('yoho-jquery-lazyload');
require('../common');
lazyLoad($('img.lazy'));
function getGender() {
return window.cookie('_Channel') || 'boys';
}
require('../channel/maybe-like')(getGender());
if ($('#goods-list').length === 0) {
$('.maybe-like').hide();
}
... ...
.pay-success {
width: 100%;
overflow: hidden;
position: relative;
background-color: #f0f0f0;
.top-tip {
width: 100%;
height: 240px;
border-bottom: solid 1px #e0e0e0;
text-align: center;
background-color: #fff;
.img-c {
margin-top: 25px;
width: 102px;
height:102px;
background: resolve('cart/pay-ok.png') no-repeat;
background-size: 100% 100%;
display: inline-block;
}
.ok-tip {
font-size: 24px;
color: #d0021b;
line-height: 60px;
}
.left-tip {
font-size: 19px;
color: #b0b0b0;
}
}
.info-table-c {
height: 160px;
border-bottom: solid 1px #e0e0e0;
padding: 20px 25px;
background-color: #fff;
table {
width: 100%;
tr {
height: 40px;
}
td {
font-size: 24px;
color: #444444;
}
td:nth-child(2) {
text-align: right;
}
}
}
.btn-c {
width: 100%;
height: 102px;
background-color: #fff;
border-bottom: solid 1px #e0e0e0;
padding: 0 25px;
a {
width: 270px;
height: 53px;
border: solid 2px #444;
display: block;
float: left;
line-height: 53px;
text-align: center;
border-radius: 5px;
box-sizing:border-box;
-moz-box-sizing:border-box;
margin-top: 24px;
font-size: 24px;
color: #444;
}
a:nth-child(2) {
margin-left: 50px;
}
}
.ad-pic {
width: 100%;
height: 200px;
display: block;
background-color: #fff;
margin: 25px 0;
}
}
\ No newline at end of file
... ...
... ... @@ -27,3 +27,4 @@
@import "cart/chose-panel";
@import "home/index";
@import "me/index";
@import "cart/pay-success"
... ...