Authored by 毕凯

Merge branch 'feature/storeHome'

Showing 50 changed files with 1701 additions and 2 deletions
'use strict';
const headerModel = require('../../../doraemon/models/header');
const storeHomeModel = require('../models/store-home');
exports.photography = (req, res, next) => {
let responseData = {
module: 'activity',
page: 'store-photography',
pageHeader: headerModel.setNav({
navTitle: '个人中心'
}),
width750: true,
localCss: true,
};
let params = {
uid: req.user.uid,
shopType: 3
};
req.ctx(storeHomeModel).baseInfo(params).then(result => {
res.render('store-home/photography', Object.assign(responseData, result));
}).catch(next);
};
exports.coffee = (req, res, next) => {
let responseData = {
module: 'activity',
page: 'store-coffee',
pageHeader: headerModel.setNav({
navTitle: '个人中心'
}),
width750: true,
localCss: true,
};
let params = {
uid: req.user.uid,
shopType: 1
};
req.ctx(storeHomeModel).baseInfo(params).then(result => {
res.render('store-home/coffee', Object.assign(responseData, result));
}).catch(next);
};
exports.green = (req, res, next) => {
let responseData = {
module: 'activity',
page: 'store-green',
pageHeader: headerModel.setNav({
navTitle: '个人中心'
}),
width750: true,
localCss: true,
};
let params = {
uid: req.user.uid,
shopType: 2
};
req.ctx(storeHomeModel).baseInfo(params).then(result => {
res.render('store-home/green', Object.assign(responseData, result));
}).catch(next);
};
exports.history = (req, res, next) => {
let responseData = {
module: 'activity',
page: 'store-history',
pageHeader: headerModel.setNav({
navTitle: '消费明细'
}),
width750: true,
localCss: true,
};
let params = {
uid: req.user.uid,
shopType: req.query.shopType
};
req.ctx(storeHomeModel).history(params).then(result => {
res.render('store-home/history', Object.assign(responseData, result));
}).catch(next);
};
exports.moreHistory = (req, res, next) => {
let params = {
uid: req.user.uid,
page: req.query.page,
shopType: req.query.shopType,
};
req.ctx(storeHomeModel).history(params).then(result => {
res.json(result);
}).catch(next);
};
exports.ewm = (req, res) => {
let responseData = {
module: 'activity',
page: 'store-ewm',
pageHeader: headerModel.setNav({
navTitle: '我的二维码'
}),
width750: true,
localCss: true,
};
res.render('store-home/ewm', responseData);
};
exports.coupon = (req, res, next) => {
let responseData = {
module: 'activity',
page: 'store-coupon',
pageHeader: headerModel.setNav({
navTitle: '我的优惠卷'
}),
width750: true,
localCss: true,
};
let params = {
uid: req.user.uid,
shopType: req.query.shopType
};
req.ctx(storeHomeModel).baseInfo(params).then(result => {
res.render('store-home/coupon', Object.assign(responseData, result));
}).catch(next);
};
exports.modify = (req, res, next) => {
let params = {
uid: req.user.uid,
nickName: req.query.nickName,
gender: req.query.gender,
birthday: req.query.birthday
};
req.ctx(storeHomeModel).modify(params).then((result) => {
res.json(result);
}).catch(next);
};
... ...
'use strict';
const camelCase = global.yoho.camelCase;
const _ = require('lodash');
class storeHome extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
_userInfo(params) {
let options = {
data: {
method: 'extend.trade.userinfo',
uid: params.uid,
shop_type: params.shopType
},
param: {
code: 200
}
};
return this.get(options).then(result => {
return result;
});
}
baseInfo(params) {
return Promise.all([
this._userInfo(params)
]).then(result => {
if (_.get(result, '[0].data')) {
let coffee = result[0].data.vip_type === 1;
let green = result[0].data.vip_type === 2;
let photography = result[0].data.vip_type === 3;
Object.assign(result[0].data, {
photography: photography,
coffee: coffee,
green: green,
process: this.getProcess(result[0].data.cousume_amount, result[0].data.vip_type)
});
result[0].data.gender = result[0].data.gender === '1' ? '男' : '女';
if (result[0].data.babyInfo) {
let thisGender = result[0].data.babyInfo.gender;
result[0].data.gender = (thisGender === '1' ? '男' : '女');
result[0].data.otherGender = (thisGender === '1' ? '女' : '男');
if (result[0].data.gender === '男') {
result[0].data.genderId = 1;
result[0].data.otherGenderId = 2;
} else {
result[0].data.genderId = 2;
result[0].data.otherGenderId = 1;
}
}
result = camelCase(result[0].data);
}
return result;
});
}
history(params) {
let options = {
data: {
method: 'extend.trade.consumelist',
uid: params.uid,
shop_type: params.shopType,
page: params.page || 1,
limit: 20
},
param: {
code: 200
}
};
return this.get(options).then(result => {
let resu = {
list: []
};
if (_.get(result, 'data.consume_list')) {
let build = [];
_.forEach(result.data.consume_list, val => {
build.push({
amount: val.trade_amount,
date: val.trade_date,
title: val.trade_title
});
});
resu.list = build;
}
return resu;
});
}
modify(params) {
let options = {
data: {
method: 'extend.trade.editBabyInfo',
uid: params.uid,
nick_name: params.nickName,
gender: params.gender,
birthday: params.birthday
},
param: {
code: 200
}
};
return this.get(options).then(result => {
return result;
});
}
getProcess(amount, type) {
let process = 0;
switch (type) {
case 1:
if (amount < 0) {
amount = 0;
}
if (amount > 2000) {
amount = 2000;
}
process = (amount / 2000) * 100;
return process;
case 2:
amount -= 1000;
if (amount < 0) {
amount = 0;
}
if (amount > 4000) {
amount = 4000;
}
process = (amount / 4000) * 100;
return process;
case 3:
if (amount < 0) {
amount = 0;
}
if (amount > 10000) {
amount = 10000;
}
process = (amount / 10000) * 100;
return process;
default:
return process;
}
}
}
module.exports = storeHome;
... ...
... ... @@ -55,6 +55,8 @@ const expand = require(`${cRoot}/expand-new`);
const freeMail = require(`${cRoot}/free-mail`);
const storeHome = require(`${cRoot}/store-home`);
// routers
router.get('/demo', demo.index);
... ... @@ -281,4 +283,13 @@ router.get('/free-mail/list', auth, freeMail.freeMailList); // 免邮券列表
router.get('/free-mail/verify', auth, freeMail.receiveVerify); // 免邮券领取验证
router.get('/free-mail/verifyCoupon', auth, freeMail.receiveCoupon); // 免邮券领取
router.get('/store-home/photography', auth, storeHome.photography); // 线下店个人中心-摄影
router.get('/store-home/coffee', auth, storeHome.coffee); // 线下店个人中心-咖啡
router.get('/store-home/green', auth, storeHome.green); // 线下店个人中心-绿植
router.get('/store-home/history', auth, storeHome.history); // 线下店个人中心-消费明细
router.get('/store-home/ewm', auth, storeHome.ewm); // 线下店个人中心-二维码
router.get('/store-home/coupon', auth, storeHome.coupon); // 线下店个人中心-优惠卷
router.get('/store-home/moreHistory', auth, storeHome.moreHistory); // 线下店个人中心-更多记录
router.get('/store-home/modify', auth, storeHome.modify); // 线下店个人中心-修改宝宝信息
module.exports = router;
... ...
<div class="store-home">
{{> store-home/user-info}}
{{> store-home/yoho-family}}
</div>
\ No newline at end of file
... ...
<div class="store-home">
<div class="coupon-list">
{{# coupons}}
<div class="coupon-item">
<div class="coupon-title eps">{{couponName}}</div>
<div class="coupon-main">
<div class="left">
<p class="price">{{couponAmount}}</p>
<p class="limit">{{useLimit}}</p>
</div>
<div class="right">
<p class="date">{{validateDate}}</p>
<p class="detail-btn">详细信息
<span class="iconfont up">&#xe615;</span>
<span class="iconfont down">&#xe616;</span>
</p>
</div>
</div>
<div class="coupon-foot">
<div class="dot-line">
<div class="left-dot"></div>
<div class="right-dot"></div>
<p></p>
</div>
<p>{{explains}}</p>
</div>
</div>
{{/ coupons}}
</div>
</div>
\ No newline at end of file
... ...
<div class="store-home">
<div class="ewm-bg">
<div class="ewm-main">
<img class="user-pic" src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3996494032,1106789965&fm=117&gp=0.jpg" />
<p>KRIS WU</p>
<div class="ewm-pic"></div>
</div>
</div>
</div>
\ No newline at end of file
... ...
<div class="store-home">
{{> store-home/user-info}}
{{> store-home/yoho-family}}
</div>
\ No newline at end of file
... ...
<div class="store-home">
<ul class="his-ul">
{{# list}}
<li class="item">
<div class="tip">
<p class="name">{{title}}</p>
<p class="time">{{date}}</p>
</div>
<div class="price">¥{{amount}}</div>
</li>
{{/ list}}
</ul>
</div>
\ No newline at end of file
... ...
<div class="store-home">
{{> store-home/user-info}}
<div class="edit-title">编辑宝宝资料</div>
<ul class="list">
<li class="list-item">
<span class="title">宝宝昵称</span>
<span class="iconfont">&#xe604;</span>
<input class="s-title baby-name modify" type="text" value="{{babyInfo/nickName}}" />
</li>
<li class="list-item">
<span class="title">宝宝生日</span>
<span class="iconfont">&#xe604;</span>
<span class="date-c">
<input class="s-title baby-birthday modify" type="date" value="{{babyInfo/birthDay}}" />
</span>
</li>
<li class="list-item">
<span class="title">宝宝性别</span>
<span class="iconfont">&#xe604;</span>
<div class="select-c">
<select class="s-title baby-gender modify">
<option value="{{genderId}}">{{gender}}</option>
<option value="{{otherGenderId}}">{{otherGender}}</option>
</select>
</div>
</li>
</ul>
{{> store-home/yoho-family}}
</div>
\ No newline at end of file
... ...
<div class="bg-pic">
<div class="pic {{#if coffee}}coffee{{/if}} {{#if photography}}photography{{/if}} {{#if green}}green{{/if}}">
<div class="cover"></div>
</div>
<div class="base-info">
<div class="left">
<div class="user">
<span class="name">{{nickName}}</span>
<span class="vip vip-{{vipLevel}}"></span>
</div>
<div class="tel">{{mobile}}</div>
</div>
<div class="right">
<div class="ewm-c">
<a class="ewm" href="//m.yohobuy.com/home/newQrcode"></a>
</div>
<div class="id hide">ID:475247198</div>
</div>
</div>
</div>
<div class="user-info">
<div class="logo {{#if coffee}}coffee{{/if}} {{#if photography}}photography{{/if}} {{#if green}}green{{/if}}"></div>
<ul class="info-list">
<li>
<div class="left">消费金额</div>
<a class="right"{{#if cousumeAmount}} href="//m.yohobuy.com/activity/store-home/history?shopType={{vipType}}"{{/if}}>¥{{cousumeAmount}}
{{#if cousumeAmount}}
<span class="iconfont">&#xe604;</span>
{{/if}}
</a>
</li>
<li>
<div class="left">消费次数</div>
<div class="right">{{cousumeNum}}</div>
</li>
<li>
<div class="left">我的积分</div>
<div class="right">{{creditPoints}}</div>
</li>
</ul>
<div class="process-c">
<div class="process-line">
<div style="width: {{process}}%;"></div>
</div>
<ul class="level-c" data-vip="{{vipLevel}}">
<li class="disable">
<div class="dot"></div>
<span class="vip vip-1"></span>
<div class="price">¥{{#if coffee}}0{{/if}}{{#if photography}}0{{/if}}{{#if green}}1000{{/if}}</div>
</li>
<li class="disable">
<div class="dot"></div>
<span class="vip vip-2"></span>
<div class="price">¥{{#if coffee}}800{{/if}}{{#if photography}}5000{{/if}}{{#if green}}3000{{/if}}</div>
</li>
<li class="disable">
<div class="dot"></div>
<span class="vip vip-3"></span>
<div class="price">¥{{#if coffee}}2000{{/if}}{{#if photography}}10000{{/if}}{{#if green}}5000{{/if}}</div>
</li>
</ul>
</div>
<ul class="list coupon">
<a href="//m.yohobuy.com/activity/store-home/coupon?shopType={{vipType}}">
<li class="list-item">
<span class="title">我的优惠券</span>
<span class="iconfont">&#xe604;</span>
<span class="s-title">{{couponsNum}}</span>
</li>
</a>
</ul>
</div>
<div class="edit-title hide">编辑资料</div>
<ul class="list hide">
<li class="list-item">
<span class="title">昵称</span>
<span class="iconfont">&#xe604;</span>
<span class="s-title">{{nickName}}</span>
</li>
<li class="list-item">
<span class="title">生日</span>
<span class="iconfont">&#xe604;</span>
<span class="s-title">{{birthDay}}</span>
</li>
<li class="list-item">
<span class="title">性别</span>
<span class="iconfont">&#xe604;</span>
<span class="s-title">{{gender}}</span>
</select>
</li>
</ul>
\ No newline at end of file
... ...
<ul class="list hide">
<li class="list-item">
<span class="title">YOHO!FAMILY</span>
<span class="iconfont">&#xe604;</span>
<span class="s-title"></span>
</li>
</ul>
\ No newline at end of file
... ...
'use script';
const headerModel = require('../../../doraemon/models/header'); // 头部model
const newQrcodeModel = require('../models/newQrcode');
exports.index = (req, res, next) => {
let responseData = {
module: 'home',
page: 'new-qrcode',
pageHeader: headerModel.setNav({
navTitle: '我的二维码'
}),
title: '我的二维码',
width750: true,
localCss: true
};
let params = {
uid: req.user.uid
};
req.ctx(newQrcodeModel).index(params).then(result => {
res.render('new-qrcode', Object.assign(responseData, result));
}).catch(next);
};
exports.reload = (req, res, next) => {
let params = {
uid: req.user.uid
};
req.ctx(newQrcodeModel).getToken(params).then(result => {
res.json(result);
}).catch(next);
};
... ...
'use strict';
const _ = require('lodash');
const api = global.yoho.API;
class newQrcode extends global.yoho.BaseModel {
constructor(ctx) {
super(ctx);
}
userInfo(params) {
if (params.uid) {
return api.get('', {
method: 'app.passport.profile',
uid: params.uid
}, {
code: 200
});
} else {
return Promise.resolve({});
}
}
getCode(params) {
if (params.uid) {
return api.get('', {
method: 'app.invitecode.my',
uid: params.uid
}, {
code: 200
});
} else {
return Promise.resolve({});
}
}
getToken(params) {
return api.get('', {
method: 'app.twoDimen.getCode',
uid: params.uid,
}).then(result => {
return (result && result.data && result.data.code) || '';
});
}
index(params) {
return api.all([
this.userInfo(params),
this.getCode(params),
this.getToken(params)
]).then(result => {
let resu = {};
if (_.get(result, '[0]data')) {
resu = result[0].data;
}
if (_.get(result, '[1]data')) {
resu.trendWord = result[1].data.trendWord || result[1].data.inviteCode;
}
if (_.get(result, '[2]')) {
resu.token = result[2];
}
return resu;
});
}
}
module.exports = newQrcode;
... ...
... ... @@ -32,6 +32,8 @@ const refund = require(`${cRoot}/refund`);
const exchange = require(`${cRoot}/exchange`);
const tideCommand = require(`${cRoot}/tide-command`);
const newQrcode = require(`${cRoot}/newQrcode`);
// const myDetail = require(`${cRoot}/myDetail);
... ... @@ -176,4 +178,7 @@ router.post('/return/exchange/cancel-apply', auth, exchange.cancelApply); // AJA
router.get('/return/exchange/refreshDelivery', auth, exchange.refreshDelivery); // 获取商品的退换货方式
router.get('/tide-command', auth, tideCommand.tideCommand); // 设置潮流口令
router.get('/newQrcode', auth, newQrcode.index); // 新二维码页面
router.get('/newQrcode/reload', auth, newQrcode.reload); // 刷新二维码页面
module.exports = router;
... ...
<div class="new-qrcode-c">
<div class="qrcode-body">
<div class="toper">
<div class="user-pic">
<div class="avatar user-avatar"{{#if head_ico}} style="background-image:url({{image2 head_ico mode=2 h=100 w=100 q=90}})"{{/if}}></div>
<div class="level level-{{vip_info/cur_level}}"></div>
</div>
<div class="user-info">
<div class="name eps">{{nickname}}</div>
<div class="passcode">
{{#if trendWord}}
<div class="dot">#&nbsp;</div>
<div class="auto-scroll">
<div class="scroll-words go-scroll">{{trendWord}}</div>
</div>
<div class="dot">&nbsp;#</div>
{{/if}}
</div>
</div>
</div>
<div class="qrcode-pic" data-qr="{{token}}">
<div class="qrcode-avatar user-avatar"{{#if head_ico}} style="background-image:url({{image2 head_ico mode=2 h=100 w=100 q=90}})"{{/if}}></div>
</div>
<div class="invite hide">
<span>邀请好友扫一扫完成注册,现金券赚不停</span>
<span class="iconfont">&#xe639;</span>
</div>
</div>
<div class="reload-c">
<div class="reload"><span class="iconfont">&#xe733;</span>点击刷新二维码</div>
</div>
</div>
\ No newline at end of file
... ...
{
"name": "m-yohobuy-node",
"version": "6.0.22",
"version": "6.0.23",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
No preview for this file type
... ... @@ -258,6 +258,9 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="shanchu" unicode="&#58956;" d="M911.36 725.333333l-242.346667 0L669.013333 848.213333c0 27.306667-20.48 47.786667-47.786667 47.786667L375.466667 896c-27.306667 0-47.786667-20.48-47.786667-47.786667L327.68 725.333333 81.92 725.333333C54.613333 725.333333 34.133333 704.853333 34.133333 677.546667s20.48-47.786667 47.786667-47.786667L375.466667 629.76l242.346667 0 293.546667 0c27.306667 0 47.786667 20.48 47.786667 47.786667S938.666667 725.333333 911.36 725.333333zM423.253333 725.333333 423.253333 797.013333l146.773333 0L570.026667 725.333333 423.253333 725.333333zM764.586667 578.56c-27.306667 0-47.786667-20.48-47.786667-47.786667l0-559.786667L276.48-29.013333 276.48 530.773333c0 27.306667-20.48 47.786667-47.786667 47.786667s-47.786667-20.48-47.786667-47.786667l0-610.986667c0-27.306667 20.48-47.786667 47.786667-47.786667l535.893333 0c27.306667 0 47.786667 20.48 47.786667 47.786667L812.373333 530.773333C815.786667 558.08 791.893333 578.56 764.586667 578.56zM447.146667 66.56 447.146667 455.68c0 27.306667-20.48 47.786667-47.786667 47.786667s-47.786667-20.48-47.786667-47.786667l0-389.12c0-27.306667 20.48-47.786667 47.786667-47.786667S447.146667 39.253333 447.146667 66.56zM645.12 66.56 645.12 455.68c0 27.306667-20.48 47.786667-47.786667 47.786667S546.133333 482.986667 546.133333 455.68l0-389.12c0-27.306667 20.48-47.786667 47.786667-47.786667S645.12 39.253333 645.12 66.56z" horiz-adv-x="1024" />
<glyph glyph-name="facebook" unicode="&#58958;" d="M435.959 524.089l0-96.095-76.888 0 0-115.239 76.888 0 0-268.953 115.26 0L551.219 312.755l115.281 0L666.5 427.994l-115.26 0 0 76.867c0 23.064 15.369 38.413 38.372 38.413l76.888 0 0 115.26-96.136 0C497.416 658.535 435.959 597.078 435.959 524.089L435.959 524.089zM512.032 861.888C248.096 861.888 34.144 648 34.144 384c0-263.936 213.952-477.888 477.888-477.888S989.856 120.128 989.856 384C989.856 648 775.968 861.888 512.032 861.888zM830.496 65.472c-41.344-41.344-89.472-73.856-143.104-96.512-55.488-23.488-114.432-35.392-175.296-35.392-60.8 0-119.808 11.904-175.36 35.392-53.632 22.656-101.824 55.104-143.168 96.512-41.344 41.344-73.856 89.6-96.512 143.232C73.504 264.128 61.6 323.2 61.6 384s11.904 119.744 35.392 175.296c22.656 53.632 55.168 101.76 96.512 143.168 41.344 41.344 89.536 73.856 143.168 96.512 55.552 23.424 114.56 35.392 175.36 35.392 60.864 0 119.808-11.968 175.296-35.392 53.632-22.656 101.76-55.168 143.104-96.512 41.344-41.408 73.856-89.536 96.64-143.168 23.424-55.488 35.392-114.432 35.392-175.296s-12.032-119.936-35.392-175.296C904.352 155.136 871.84 106.88 830.496 65.472z" horiz-adv-x="1024" />
<glyph glyph-name="wenhao" unicode="&#59033;" d="M512 886.272c-277.504 0-502.272-224.768-502.272-502.272s224.768-502.272 502.272-502.272 502.272 224.768 502.272 502.272S789.504 886.272 512 886.272zM520.704-14.848c-45.568 0-82.432 36.864-82.432 82.432 0 45.568 36.864 82.432 82.432 82.432 45.568 0 82.432-36.864 82.432-82.432C603.648 22.528 566.272-14.848 520.704-14.848zM737.792 477.184c-11.264-23.552-33.28-50.688-67.072-83.456-37.376-35.84-52.736-52.736-59.392-60.928-7.68-9.728-13.824-20.992-17.408-34.816-4.096-14.336-6.144-35.328-5.632-61.44l0.512-30.72-141.824 0 0 30.208c0 37.376 3.072 67.072 9.216 90.112 6.656 24.064 16.384 45.568 29.696 63.488 12.288 16.896 32.768 39.936 62.464 71.168 33.792 34.816 47.104 51.712 51.712 59.904 3.072 5.12 8.192 16.896 8.192 44.544 0 18.944-6.656 35.328-20.48 50.688-13.312 14.336-33.28 20.992-60.928 20.992-81.408 0-92.672-58.368-92.672-115.712l0-30.208-142.336 0 1.024 30.72c1.536 48.128 7.168 84.48 17.92 111.104 10.752 27.136 28.672 51.712 52.224 73.216 23.04 20.992 49.664 36.352 77.824 46.08 28.16 9.728 57.856 14.336 88.576 14.336 62.976 0 116.736-18.944 159.744-56.832l0 0c43.52-38.912 66.048-90.624 66.048-154.112C755.2 527.872 749.568 501.248 737.792 477.184z" horiz-adv-x="1024" />
... ... @@ -339,6 +342,18 @@ t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-
<glyph glyph-name="sanjiao2-center-view-copy" unicode="&#59183;" d="M511.999488 140.58653800000013L72.8374 755.413462 951.1626 755.413462Z" horiz-adv-x="1024" />
<glyph glyph-name="gm" unicode="&#59184;" d="M192.86016 414.72a30.72 30.72 0 0 0-30.72 30.72l0.02048 23.87968C163.98336 665.37472 324.03456 824.32 520.54016 824.32h13.66016c197.61152 0 358.4-160.78848 358.4-358.4v-47.77984h-61.44V465.92c0 163.7376-133.2224 296.96-296.96 296.96h-13.66016c-163.7376 0-296.96-133.2224-296.96-296.96v-20.48a30.72 30.72 0 0 0-30.72-30.72zM541.85984-101.53984h-13.66016a30.72 30.72 0 1 0 0 61.44h13.66016c163.7376 0 296.96 103.13728 296.96 229.92896h61.44v-8.37632c0-1.59744-0.12288-3.15392-0.36864-4.68992-8.43776-154.624-165.7856-278.30272-358.03136-278.30272zM200.54016 155.29984h-13.66016A105.94304 105.94304 0 0 0 81.05984 261.12v102.4a105.94304 105.94304 0 0 0 105.82016 105.82016h13.66016A105.94304 105.94304 0 0 0 306.36032 363.52v-102.4a105.96352 105.96352 0 0 0-105.82016-105.82016z m-13.66016 252.60032A44.4416 44.4416 0 0 1 142.49984 363.52v-102.4a44.4416 44.4416 0 0 1 44.38016-44.38016h13.66016A44.4416 44.4416 0 0 1 244.92032 261.12v102.4a44.4416 44.4416 0 0 1-44.38016 44.38016h-13.66016zM869.13024 155.29984h-13.66016A105.92256 105.92256 0 0 0 749.6704 261.12v102.4a105.92256 105.92256 0 0 0 105.79968 105.82016h13.66016A105.94304 105.94304 0 0 0 974.9504 363.52v-102.4a105.96352 105.96352 0 0 0-105.82016-105.82016z m-13.66016 252.60032A44.4416 44.4416 0 0 1 811.1104 363.52v-102.4a44.4416 44.4416 0 0 1 44.35968-44.38016h13.66016A44.4416 44.4416 0 0 1 913.5104 261.12v102.4a44.4416 44.4416 0 0 1-44.38016 44.38016h-13.66016zM614.7072-60.37504l-83.57888-9.76896a20.54144 20.54144 0 0 0-22.71232 17.96096l-3.64544 31.232a20.54144 20.54144 0 0 0 17.96096 22.71232l83.57888 9.76896a20.54144 20.54144 0 0 0 22.71232-17.96096l3.64544-31.232a20.52096 20.52096 0 0 0-17.96096-22.71232zM528.73216-101.00736a51.28192 51.28192 0 0 0-50.83136 45.24032l-3.64544 31.232a50.83136 50.83136 0 0 0 10.71104 37.70368 50.95424 50.95424 0 0 0 34.22208 19.10784l83.53792 9.78944a51.34336 51.34336 0 0 0 56.81152-44.9536l3.66592-31.17056a51.28192 51.28192 0 0 0-44.87168-56.79104l-0.04096-0.02048-83.57888-9.76896a49.07008 49.07008 0 0 0-5.98016-0.36864z m85.99552 40.63232h0.2048-0.2048z m-78.27456 32.80896l1.26976-10.87488 63.24224 7.3728-1.26976 10.89536-63.24224-7.39328z" horiz-adv-x="1024" />
<glyph glyph-name="edit1" unicode="&#59185;" d="M512 896a512 512 0 1 1 512-512A512 512 0 0 1 512 896z m148.992-146.176l97.024-97.024a43.264 43.264 0 0 0 1.28-61.184l-51.2-51.2-163.84 156.16 55.552 55.552a43.264 43.264 0 0 0 61.184-2.304z m-406.528-435.2l29.184 109.056a56.32 56.32 0 0 0 18.944 28.928l2.048 2.56 195.84 197.12 164.864-153.6-201.728-201.728-3.328-2.56-2.816-3.584a56.064 56.064 0 0 0-27.136-15.104l-107.264-28.672a56.32 56.32 0 0 0-69.12 69.12z m540.928-179.2a25.6 25.6 0 0 0-25.6-25.6h-512a25.6 25.6 0 0 0-25.6 25.6v10.24a25.6 25.6 0 0 0 25.6 25.6h512a25.6 25.6 0 0 0 25.6-25.6z" horiz-adv-x="1024" />
<glyph glyph-name="yoho-coin" unicode="&#59186;" d="M512 153.6h-40.96a195.87072 195.87072 0 0 0-45.4656 5.34528l14.29504 59.76064a134.5536 134.5536 0 0 1 31.15008-3.66592h40.96c73.40032 0 133.12 59.71968 133.12 133.12V592.40448h61.44V348.16c0.02048-107.27424-87.26528-194.56-194.53952-194.56zM512 296.96c-107.27424 0-194.56 87.28576-194.56 194.56v101.56032h61.44v-101.56032c0-73.40032 59.71968-133.12 133.12-133.12s133.12 59.71968 133.12 133.12v103.1168h61.44v-103.1168c0-107.27424-87.28576-194.56-194.56-194.56zM512-51.2c-242.7904 0-440.32 197.5296-440.32 440.32S269.2096 829.44 512 829.44s440.32-197.5296 440.32-440.32-197.5296-440.32-440.32-440.32z m0 819.2c-208.91648 0-378.88-169.96352-378.88-378.88s169.96352-378.88 378.88-378.88 378.88 169.96352 378.88 378.88S720.91648 768 512 768z" horiz-adv-x="1024" />
<glyph glyph-name="sx" unicode="&#59187;" d="M810.72128 293.49888a40.89856 40.89856 0 0 1-55.27552-17.28512 237.42464 237.42464 0 0 0-81.08032-89.04704 237.6704 237.6704 0 0 0-239.06304-11.07968 235.7248 235.7248 0 0 0-116.36736 139.34592 235.58144 235.58144 0 0 0 16.24064 180.81792 235.6224 235.6224 0 0 0 139.34592 116.34688 235.4176 235.4176 0 0 0 180.81792-16.26112l1.04448-0.59392-0.94208-0.16384a40.98048 40.98048 0 0 1 13.47584-80.81408l99.75808 16.65024a40.96 40.96 0 0 1 33.66912 47.14496l-16.62976 99.75808a40.96 40.96 0 0 1-80.81408-13.47584l0.49152-2.90816c-4.01408 2.33472-7.92576 4.8128-12.06272 6.98368a316.94848 316.94848 0 0 1-243.24096 21.87264 316.86656 316.86656 0 0 1-187.45344-156.54912C181.02272 378.368 241.43872 185.1392 397.312 103.5264a318.42304 318.42304 0 0 1 147.92704-36.31104c60.60032 0 121.05728 17.16224 173.62944 51.15904a319.13984 319.13984 0 0 1 109.1584 119.84896 40.96 40.96 0 0 1-17.3056 55.27552z" horiz-adv-x="1024" />
</font>
... ...
No preview for this file type
No preview for this file type
{{# list}}
<li class="item">
<div class="tip">
<p class="name">{{title}}</p>
<p class="time">{{date}}</p>
</div>
<div class="price">¥{{amount}}</div>
</li>
{{/ list}}
\ No newline at end of file
... ...
require('activity/store-home.page.css');
const Photography = require('./store-home/index');
new Photography();
... ...
require('activity/store-home.page.css');
import $ from 'yoho-jquery';
import Page from 'yoho-page';
class StoreCoupon extends Page {
constructor() {
super();
this.selector = {
$toggleBtn: $('.detail-btn'),
};
this.init();
}
init() {
this.bindEvents();
}
bindEvents() {
this.selector.$toggleBtn.on('click', this.toggle.bind(this));
}
toggle(e) {
let $this = $(e.currentTarget);
$this.parents('.coupon-item').find('.coupon-foot').toggle().find('.up').toggle().find('.down').toggle();
}
}
$(() => {
new StoreCoupon();
});
... ...
require('activity/store-home.page.css');
import Page from 'yoho-page';
import $ from 'yoho-jquery';
import 'yoho-jquery-qrcode';
class PersonDetail extends Page {
constructor() {
super();
this.selector = {
$ewm: $('.ewm-pic')
};
this.init();
}
init() {
this.selector.$ewm.qrcode({
render: 'canvas', // 显示方式,canvas,image和div
text: '20364534', // 二维码的内容
size: parseInt(420, 10), // 大小
ecLevel: 'H', // 纠错级别
});
}
}
$(() => {
new PersonDetail();
});
... ...
require('activity/store-home.page.css');
const Photography = require('./store-home/index');
new Photography();
... ...
require('activity/store-home.page.css');
import $ from 'yoho-jquery';
import Page from 'yoho-page';
import historyRender from 'activity/store-home/history.hbs';
class History extends Page {
constructor() {
super();
this.page = 1;
this.loading = false;
this.selector = {
$hisUl: $('.his-ul')
};
this.view = {
historyRender
};
this.init();
}
init() {
$(window).scroll(() => {
window.requestAnimationFrame(this.scrollHandler.bind(this));
});
}
scrollHandler() {
if (($(window).scrollTop() + $(window).height() >= $(document).height() * 0.8)) {
this.doMore();
}
}
doMore() {
if (!this.end && !this.loading) {
this.page++;
this.moreList(this.page);
}
}
moreList() {
this.loading = true;
this.ajax({
url: '/activity/store-home/moreHistory',
data: {
page: this.page,
shopType: window.queryString.shopType
},
}).then(result => {
if (result && result.list.length > 0) {
this.selector.$hisUl.append(this.view.historyRender(result));
this.loading = false;
} else {
this.end = true;
}
}).catch(error => {
console.error(error);
});
}
}
$(() => {
new History();
});
... ...
import $ from 'yoho-jquery';
import Page from 'yoho-page';
import tip from 'plugin/tip';
import yoho from 'yoho-app';
class Photography extends Page {
constructor() {
super();
this.selector = {
$levelC: $('.level-c'),
$modifyInp: $('.s-title.modify'),
$nickName: $('.s-title.baby-name'),
$gender: $('.s-title.baby-gender'),
$birthday: $('.s-title.baby-birthday'),
$noDate: $('.s-title.modify[type!=date]'),
};
this.init();
}
init() {
this.bindEvents();
let vipLevel = this.selector.$levelC.data('vip');
this.selector.$levelC.find(`li:lt(${vipLevel})`).removeClass('disable');
}
bindEvents() {
if (yoho.isWechat) {
this.selector.$modifyInp.on('change', this.modifyInp.bind(this));
} else {
this.selector.$noDate.on('change', this.modifyInp.bind(this));
this.selector.$birthday.on('blur', this.modifyInp.bind(this));
}
}
modifyInp() {
this.ajax({
url: '/activity/store-home/modify',
data: {
nickName: this.selector.$nickName.val(),
gender: this.selector.$gender.val(),
birthday: this.selector.$birthday.val()
},
}).then(result => {
if (result && result.code === 200) {
location.href = location.href;
} else {
tip.show(result.message);
}
}).catch(error => {
tip.show(error);
});
}
}
module.exports = Photography;
... ...
require('activity/store-home.page.css');
const Photography = require('./store-home/index');
new Photography();
... ...
import 'home/new-qrcode.page.css';
import $ from 'yoho-jquery';
import Page from 'yoho-page';
import 'yoho-jquery-qrcode';
class NewQrcode extends Page {
constructor() {
super();
this.selector = {
$qrcodePic: $('.qrcode-pic'),
$autoScroll: $('.auto-scroll'),
$scrollWords: $('.scroll-words'),
$reload: $('.reload')
};
this.qrText = '';
this.auto = '';
this.init();
}
init() {
this.drawQrcode();
this.autoScroll();
this.bindEvents();
this.autoReload();
}
bindEvents() {
this.selector.$reload.on('click', this.reload.bind(this));
}
autoReload() {
this.auto = setInterval(() => {
this.reload();
}, 110 * 1000); // 110秒自动刷新一次
}
reload() {
this.ajax({
url: '/home/newQrcode/reload',
}).then(result => {
if (result) {
this.qrText = result;
this.selector.$qrcodePic.find('canvas').remove();
this.drawQrcode();
clearInterval(this.auto);
this.autoReload();
}
}).catch(error => {
console.error(error);
});
}
drawQrcode() {
this.selector.$qrcodePic.qrcode({
render: 'canvas', // 显示方式,canvas,image和div
text: this.qrText || this.selector.$qrcodePic.data('qr'), // 二维码的内容
size: parseInt(420, 10), // 大小
ecLevel: 'H', // 纠错级别
});
}
autoScroll() {
let containerWidth = this.selector.$autoScroll.width();
let innerWidth = this.selector.$scrollWords.width();
if (innerWidth <= (containerWidth + 1)) {
this.selector.$scrollWords.removeClass('go-scroll');
}
}
}
$(() => {
new NewQrcode();
});
... ...
... ... @@ -72,7 +72,7 @@ let functions = {
if (!yoho.isLogin()) {
let preInfo = `${sku}_${skn}_${buyNum}`;
let actCkOpthn = {
path: '/',
path: '/product',
expires: 1
};
... ...
... ... @@ -43,6 +43,7 @@ yoho = {
qs && qs.app_version || cookie.get('app_version'),
isiOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(navigator.userAgent || ''),
isAndroid: /Android/i.test(navigator.userAgent || ''),
isWechat: /micromessenger/i.test(navigator.userAgent || ''),
/**
* JS 与 APP 共享的对象
... ...
body,
html {
background-color: #f0f0f0;
}
input {
padding: 0;
}
input::-webkit-clear-button {
width: 0;
}
input::-webkit-calendar-picker-indicator {
width: 0;
}
::-webkit-input-placeholder {
color: #b0b0b0;
}
:-moz-placeholder {
color: #b0b0b0;
}
::-moz-placeholder {
color: #b0b0b0;
}
:-ms-input-placeholder {
color: #b0b0b0;
}
.store-home {
position: relative;
.eps {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.edit-title {
font-size: 24px;
color: #b0b0b0;
padding: 0 30px;
margin: 15px 0;
}
.vip {
width: 70px;
height: 30px;
display: inline-block;
}
.vip-1 {
background-image: url("/activity/store-home/vip1.png");
}
.vip-2 {
background-image: url("/activity/store-home/vip2.png");
}
.vip-3 {
background-image: url("/activity/store-home/vip3.png");
}
.list {
clear: both;
padding: 0 30px;
background-color: #fff;
margin-bottom: 20px;
.list-item {
line-height: 88px;
height: 88px;
background-color: #fff;
border-bottom: solid 1px #e0e0e0;
position: relative;
.name {
font-size: 30px;
}
.s-title {
float: right;
font-size: 28px;
height: 60px;
line-height: 60px;
margin: 14px 15px 14px 0;
text-align: right;
color: #b0b0b0;
border: 0;
background: none;
option {
text-align: right;
}
&.change {
color: #000;
}
}
select.s-title {
direction: rtl;
}
.iconfont {
float: right;
font-size: 28px;
color: #b0b0b0;
width: 30px;
}
.date-c {
direction: ltr;
position: absolute;
top: 0;
right: 30px;
height: 88px;
width: 220px;
overflow: hidden;
input {
direction: rtl;
position: absolute;
top: 0;
left: -57px;
width: 300px;
}
}
.select-c {
position: absolute;
top: 0;
right: 30px;
white-space: nowrap;
overflow: hidden;
direction: ltr;
width: 60px;
height: 88px;
select {
position: absolute;
top: 0;
right: -5px;
}
}
&:last-child {
border-bottom: 0;
}
}
}
.bg-pic {
position: relative;
.pic {
width: 100%;
height: 355px;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
.cover {
width: 100%;
height: 100%;
background-color: #000;
opacity: 0.6;
}
&.photography {
background-image: resolve("activity/store-home/photography-bg.jpg");
}
&.green {
background-image: resolve("activity/store-home/green-bg.jpg");
}
&.coffee {
background-image: resolve("activity/store-home/coffee-bg.jpg");
}
}
.base-info {
padding: 0 30px;
position: absolute;
top: 0;
left: 0;
color: #fff;
width: 100%;
padding-top: 70px;
line-height: 60px;
.left {
width: 50%;
float: left;
.user {
font-size: 38px;
}
.tel {
font-size: 24px;
}
}
.right {
width: 50%;
float: right;
text-align: right;
.ewm {
width: 35px;
height: 35px;
background-image: url("/activity/store-home/ewm.png");
display: inline-block;
vertical-align: middle;
}
.id {
font-size: 24px;
}
}
.name {
margin-right: 10px;
}
}
}
.user-info {
width: 690px;
background-color: #fff;
margin: -130px auto 0;
position: relative;
padding-top: 40px;
.logo {
&.coffee {
width: 120px;
height: 120px;
background-image: url("/activity/store-home/coffee.png");
margin: 0 auto;
}
&.photography {
width: 120px;
height: 120px;
background-image: url("/activity/store-home/photography.png");
margin: 0 auto;
}
&.green {
width: 120px;
height: 120px;
background-image: url("/activity/store-home/green.png");
margin: 0 auto;
}
}
.info-list {
margin-top: 15px;
font-size: 24px;
line-height: 60px;
.left {
width: 50%;
float: left;
text-align: right;
padding: 0 25px;
}
.right {
width: 50%;
float: right;
padding: 0 25px;
.iconfont {
color: #b0b0b0;
font-size: 18px;
}
}
}
.process-c {
position: relative;
padding-top: 30px;
clear: both;
.process-line {
width: 578px;
height: 2px;
background-color: #e0e0e0;
margin: 0 auto;
div {
background-color: #000;
height: 100%;
}
}
.level-c {
width: 598px;
margin: -9px auto 0;
li {
float: left;
width: 289px;
margin-bottom: 20px;
}
li:last-child {
width: 20px;
}
.dot {
width: 20px;
height: 20px;
background-color: #000;
border-radius: 50%;
margin-bottom: 17px;
}
.vip {
margin-left: -25px;
}
.price {
width: 100px;
margin-left: -40px;
text-align: center;
font-size: 23px;
line-height: 45px;
}
}
}
.coupon {
border-top: solid 1px #e0e0e0;
margin: 0 22px;
padding: 0;
.list-item {
padding: 0;
}
}
}
.disable {
.vip-1 {
background-image: url("/activity/store-home/vip1-1.png");
}
.vip-2 {
background-image: url("/activity/store-home/vip2-1.png");
}
.vip-3 {
background-image: url("/activity/store-home/vip3-1.png");
}
.dot {
background-color: #e0e0e0 !important;
}
.price {
color: #b0b0b0;
}
}
.his-ul {
padding: 0 25px;
background-color: #fff;
.item {
height: 100px;
border-bottom: solid 1px #e0e0e0;
background-color: #fff;
padding: 5px 0;
&:last-child {
border: 0;
}
.tip {
width: 500px;
float: left;
.name {
font-size: 26px;
line-height: 50px;
height: 50px;
}
.time {
font-size: 22px;
color: #b0b0b0;
line-height: 40px;
}
}
.price {
width: 200px;
float: left;
line-height: 90px;
text-align: right;
font-size: 30px;
}
}
}
.ewm-bg {
background-color: #333;
padding: 132px 0 350px;
.ewm-main {
width: 600px;
height: 785px;
background-color: #fff;
margin: 0 auto;
padding-top: 50px;
.user-pic {
width: 100px;
height: 100px;
border-radius: 50%;
margin: 0 auto;
}
p {
line-height: 95px;
font-size: 34px;
text-align: center;
}
.ewm-pic {
width: 420px;
height: 420px;
margin: 40px auto 0;
canvas {
width: 100%;
}
}
}
}
.coupon-list {
.coupon-item {
margin: 18px auto 33px;
width: 690px;
.coupon-title {
width: 690px;
height: 91px;
background-image: url("/activity/store-home/coupon-title.png");
background-color: #fff;
font-size: 30px;
color: #fff;
line-height: 91px;
padding: 0 30px;
}
.coupon-main {
height: 180px;
background-color: #fff;
padding: 25px 0;
}
.left {
width: 219px;
float: left;
border-right: solid 1px #e0e0e0;
}
.price {
font-size: 80px;
line-height: 80px;
text-align: center;
}
.limit {
font-size: 22px;
color: #b0b0b0;
text-align: center;
line-height: 22px;
margin-top: 20px;
}
.right {
width: 470px;
float: left;
padding-left: 25px;
font-size: 24px;
line-height: 24px;
}
.date {
font-size: 24px;
margin-bottom: 75px;
}
.iconfont {
color: #b0b0b0;
}
.iconfont.up {
display: none;
}
.coupon-foot {
display: none;
position: relative;
padding: 8px 25px;
line-height: 50px;
font-size: 24px;
background-color: #fff;
}
.dot-line {
div {
width: 20px;
height: 20px;
background-color: #f0f0f0;
border-radius: 50%;
position: absolute;
top: -20px;
}
p {
width: 630px;
border-bottom: dashed 1px #b4b4b4;
position: absolute;
top: -10px;
}
.left-dot {
left: -10px;
}
.right-dot {
right: -10px;
}
}
}
}
}
... ...
body,
html {
background-image: linear-gradient(#131313, #3e3e3e);
background-repeat: no-repeat;
background-color: #3e3e3e;
}
.new-qrcode-c {
width: 750px;
overflow: hidden;
position: relative;
.eps {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-avatar {
background-image: resolve("home/index/user-avatar.png");
}
.qrcode-body {
width: 560px;
height: 784px;
border-radius: 6px;
background-color: #fff;
margin: 100px auto 213px;
padding: 50px;
.toper {
height: 100px;
.user-pic {
width: 100px;
height: 100px;
float: left;
position: relative;
.level {
width: 60px;
height: 25px;
position: absolute;
bottom: -12px;
left: 20px;
}
.level-1 {
background-image: url("/home/new-qrcode/vip-1.png");
}
.level-2 {
background-image: url("/home/new-qrcode/vip-2.png");
}
.level-3 {
background-image: url("/home/new-qrcode/vip-3.png");
}
}
.avatar {
width: 100%;
height: 100%;
background-position: center center;
background-size: contain;
border-radius: 50%;
overflow: hidden;
}
.user-info {
width: 360px;
height: 100px;
float: left;
padding-left: 20px;
color: #444;
}
.name {
line-height: 50px;
font-size: 34px;
}
.passcode {
line-height: 50px;
font-size: 28px;
div {
float: left;
}
.tip {
width: 20px;
}
.dot {
width: 30px;
}
.dot:last-child {
text-align: right;
}
.auto-scroll {
max-width: 280px;
height: 50px;
overflow: hidden;
position: relative;
}
.scroll-words {
position: relative;
top: 0;
left: 0;
white-space: nowrap;
}
.go-scroll {
animation-name: autoScroll;
animation-duration: 5s;
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
animation-delay: 2s;
}
}
}
.qrcode-pic {
width: 460px;
height: 460px;
margin: 47px auto 0;
position: relative;
canvas {
width: 460px;
height: 460px;
}
.qrcode-avatar {
width: 110px;
height: 110px;
position: absolute;
top: 50%;
left: 50%;
margin-top: -55px;
margin-left: -55px;
background-position: center center;
background-size: contain;
border-radius: 50%;
overflow: hidden;
border: solid 5px #fff;
}
}
.invite {
margin-top: 30px;
span {
font-size: 24px;
color: #444;
}
}
}
.reload-c {
width: 750px;
height: 90px;
line-height: 90px;
background-color: #333;
position: fixed;
bottom: 0;
left: 0;
.reload {
position: absolute;
bottom: 0;
left: 50%;
font-size: 24px;
color: #b0b0b0;
width: 200px;
line-height: 90px;
margin-left: -100px;
text-align: center;
span {
font-size: 40px;
color: #eee;
position: absolute;
top: 0;
left: -30px;
}
}
}
}
@keyframes autoScroll {
from {
left: 0;
}
to {
left: -180px;
}
}
... ...