Commit c8a0e37e6c7f5359e942d3f58226efdfcb8015ad

Authored by yvan.ni
1 parent dc854fcf

有历史档案才显示历史按钮

packageD/pages/AI-test-skin/index/aiskin.js
@@ -43,7 +43,7 @@ Page({ @@ -43,7 +43,7 @@ Page({
43 * 生命周期函数--监听页面显示 43 * 生命周期函数--监听页面显示
44 */ 44 */
45 onShow: function () { 45 onShow: function () {
46 - 46 + this.getHistoryData();
47 }, 47 },
48 48
49 /** 49 /**
@@ -124,6 +124,27 @@ Page({ @@ -124,6 +124,27 @@ Page({
124 func(); 124 func();
125 } 125 }
126 }) 126 })
  127 + },
  128 +
  129 + async getHistoryData() {
  130 + if (!getApp().globalData.user_id) return false;
  131 + if (this.data.show_his) return false;
  132 +
  133 + let history = this.data.history;
  134 + let url = `/api/weshop/face/storeSkinface/page`;
  135 + const { data: res } = await request.promiseGet(url, {
  136 + isShowLoading: true,
  137 + data: {
  138 + store_id: setting.stoid,
  139 + user_id: os.user_id,
  140 + page: 1,
  141 + pageSize:1,
  142 + }
  143 + });
  144 + // initChart.setOption(option);
  145 + if (res.code == 0 && res.data.pageData.length > 0) {
  146 + this.setData({show_his:1})
  147 + }
127 } 148 }
128 149
129 150
packageD/pages/AI-test-skin/index/aiskin.wxml
1 <view class="container1"> 1 <view class="container1">
2 - <view class="history"> 2 + <view class="history" wx:if="{{show_his}}">
3 <cover-view style="padding: 0 6rpx 0 25rpx;" bindtap="goto" data-url="/packageD/pages/AI-test-skin/history_record/history_record">历史档案</cover-view> 3 <cover-view style="padding: 0 6rpx 0 25rpx;" bindtap="goto" data-url="/packageD/pages/AI-test-skin/history_record/history_record">历史档案</cover-view>
4 <text class="iconfont icon-arrow_right"></text> 4 <text class="iconfont icon-arrow_right"></text>
5 </view> 5 </view>