Authored by huangyi

修正用户标签为空

修正客服点击复制url不刷新
... ... @@ -21,6 +21,7 @@ const redbagPage = async(req, res, next) => {
userInfo.data.rewardType = false;
}
}
return res.render('red-envelope/redbag-cs', {
pageHeader: headerModel.setNav({
navTitle: '添加潮流顾问'
... ...
... ... @@ -24,15 +24,20 @@
</div>
{{/if}}
<div class="wx-account-info">
<div id="hasCode" style="display:{{#if userInfo.submitWechat}}block;{{else}}none;{{/if}}">已提交微信号:<span id="wxCode">{{userInfo.userWechatCode}}</span></div>
<div id="hasCode" style="display:{{#if userInfo.submitWechat}}block;{{else}}none;{{/if}}">
已提交微信号:<span id="wxCode">{{userInfo.userWechatCode}}</span></div>
<div id="noCode" style="display:{{#if userInfo.submitWechat}}none;{{else}}block;{{/if}}">未提交微信</div>
</div>
</div>
<div class="user-label">
<div class="title">用户标签</div>
<div>
{{#if userInfo.tag_address}}
<span class="label">{{userInfo.tag_address}}</span>
{{/if}}
{{#if userInfo.tag_createTime}}
<span class="label">{{userInfo.tag_createTime}}</span>
{{/if}}
</div>
</div>
<div class="relation-list">
... ...
... ... @@ -18,6 +18,19 @@ let channels = {
lifestyle: 4
};
exports.getShareCode = async(req, res, next) =>{
try {
let shareCode = await req.ctx(newHomeModel).getShareCode(req.user.uid);
let shareUrl = '/activity/red-envelope/index?shareCode=' + shareCode.data;
return res.json({result: true, code: 200, data: shareUrl});
} catch (e) {
return next(e);
}
};
exports.index = async(req, res, next) => {
let responseData = {
isLogin: req.user.uid ? true : false,
... ...
... ... @@ -188,7 +188,7 @@ router.get('/return/exchange/refreshDelivery', auth, exchange.refreshDelivery);
router.get('/tide-command', auth, tideCommand.tideCommand); // 设置潮流口令
router.get('/', newHome.index); // 新个人中心首页
router.get('/getCodeUrl', auth, newHome.getShareCode);
router.get('/family', auth, disableBFCache, family.familyIndex); // family首页
router.get('/family/vipDetailData', auth, family.familyVip); // 获取VIP信息
... ...
... ... @@ -38,19 +38,27 @@ class NewHome extends Page {
}
copyShareUrl() {
this.selector.$wxcs.click(function() {
this.selector.$wxcs.click(()=> {
let clipboard = new Clipboard('#wxcs', {
text: ()=> {
return location.origin + $(this).attr('data-url');
text: () => {
return location.origin + this.selector.$wxcs.attr('data-url');
}
});
clipboard.on('success', function(e) {
clipboard.on('success', (e) => {
e.clearSelection();
tip.show('复制分享地址成功');
$.ajax({
method: 'get',
url: '/home/getCodeUrl',
success: (data) => {
console.log(data);
this.selector.$wxcs.attr('data-url', data.data);
}
});
});
clipboard.on('error', function() {
clipboard.on('error', () => {
tip.show('复制失败');
});
... ...