feat(auth): access token 缩到 2 小时 + refresh token 机制 #3
@@ -101,6 +101,7 @@ Component({
|
|||||||
reportDetail: null,
|
reportDetail: null,
|
||||||
proInfo: null,
|
proInfo: null,
|
||||||
saving: false,
|
saving: false,
|
||||||
|
posterSaving: false,
|
||||||
},
|
},
|
||||||
observers: {
|
observers: {
|
||||||
show: function (show) {
|
show: function (show) {
|
||||||
|
|||||||
@@ -198,7 +198,14 @@ module.exports.sel = function (map, key, index, def) {
|
|||||||
<view class="bold">健康状态:{{poster ? poster.headline : '稳定成长'}}</view>
|
<view class="bold">健康状态:{{poster ? poster.headline : '稳定成长'}}</view>
|
||||||
<view class="muted" style="font-size:24rpx;margin-top:20rpx">生成自:肉垫计划</view>
|
<view class="muted" style="font-size:24rpx;margin-top:20rpx">生成自:肉垫计划</view>
|
||||||
</view>
|
</view>
|
||||||
<button class="btn btn-primary btn-block" style="margin-top:28rpx" bindtap="close">保存 / 分享卡片</button>
|
<view class="sheet-actions" style="margin-top:28rpx">
|
||||||
|
<button class="btn btn-ghost" open-type="share">分享给朋友</button>
|
||||||
|
<button class="btn btn-primary" bindtap="onSavePoster" disabled="{{posterSaving}}">
|
||||||
|
{{posterSaving ? '生成中…' : '保存到相册'}}
|
||||||
|
</button>
|
||||||
|
</view>
|
||||||
|
<!-- 离屏画布:海报要存成图片才能进相册。不能用 display:none,否则取不到节点 -->
|
||||||
|
<canvas type="2d" id="posterCanvas" class="poster-canvas"></canvas>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<!-- 报告详情 -->
|
<!-- 报告详情 -->
|
||||||
|
|||||||
@@ -79,3 +79,6 @@
|
|||||||
margin-left:var(--sp-1);font-size:var(--fs-cap);font-weight:var(--fw-b);
|
margin-left:var(--sp-1);font-size:var(--fs-cap);font-weight:var(--fw-b);
|
||||||
color:var(--primary-ink);background:var(--primary-soft);padding:2rpx var(--sp-1);border-radius:var(--r-full);
|
color:var(--primary-ink);background:var(--primary-soft);padding:2rpx var(--sp-1);border-radius:var(--r-full);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 离屏画布:挪到可视区外而不是 display:none,否则 selectorQuery 取不到节点 */
|
||||||
|
.poster-canvas{position:fixed;left:-9999rpx;top:0;width:600rpx;height:840rpx}
|
||||||
|
|||||||
@@ -62,9 +62,12 @@ Page({
|
|||||||
wx.navigateTo({ url: '/pages/ai/ai' });
|
wx.navigateTo({ url: '/pages/ai/ai' });
|
||||||
},
|
},
|
||||||
onShareAppMessage() {
|
onShareAppMessage() {
|
||||||
return { title: '看看我家毛孩子的成长报告', path: '/pages/report/report' };
|
// 带上宠物名,转发出去别人一眼知道是谁家的
|
||||||
|
const n = (this.data.pet && this.data.pet.name) || '我家毛孩子';
|
||||||
|
return { title: `${n} 的成长报告`, path: '/pages/report/report' };
|
||||||
},
|
},
|
||||||
onShareTimeline() {
|
onShareTimeline() {
|
||||||
return { title: '看看我家毛孩子的成长报告' };
|
const n = (this.data.pet && this.data.pet.name) || '我家毛孩子';
|
||||||
|
return { title: `${n} 的成长报告` };
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user