Authored by 肖亚东

获取服务器数据更新逻辑

... ... @@ -151,7 +151,7 @@ Page({
let limitProductCode = e.currentTarget.dataset.code;
let isApp = e.currentTarget.dataset.isApp;
if (isApp === 'Y') {
if (isApp == 'Y') {
wx.showModal({
title: '',
content: '请去有货APP参加',
... ...
... ... @@ -20,10 +20,10 @@
<view class='list-container'>
<block wx:for='{{listData}}' wx:key='index' wx:for-item='nowList'>
<block wx:if='{{index === tabSelected}}'>
<view class='item-container' wx:for='{{nowList.limitProductVoList}}' wx:key="listItem.id" wx:for-item='listItem' wx:for-index="index" data-id='{{listItem.id}}' data-code='{{listItem.limitProductCode}}' bindtap='navigateToDetail'>
<view class='item-container' wx:for='{{nowList.limitProductVoList}}' wx:key="listItem.id" wx:for-item='listItem' wx:for-index="index" data-id='{{listItem.id}}' data-code='{{listItem.limitProductCode}}' data-is-app='{{listItem.isApp}}' bindtap='navigateToDetail'>
<image src="{{helper.image(listItem.defaultUrl, 690, 460, 1)}}"></image>
<image wx:if="{{index < 5}}" src="../../static/images/no{{index+1}}@3x.png" class="rank" />
<image wx:if="{{isHot == 'Y'}}" src="../../static/images/hot@3x.png" class="rank" />
<image wx:if="{{tabSelected == 1 && index < 5}}" src="../../static/images/no{{index+1}}@3x.png" class="rank" />
<image wx:if="{{tabSelected == 0 && listItem.hotFlag}}" src="../../static/images/hot@3x.png" class="rank" />
<image wx:if="{{listItem.isApp == 'Y'}}" src="../../static/images/app_only@3x.png" class="app_only" />
<view class='item-content'>
<text class='item-name'>{{listItem.productName}}</text>
... ...
... ... @@ -41,6 +41,8 @@ Component({
if (timer) {
clearInterval(timer);
}
this.tick(label);
timer = setInterval(() => {
this.tick(label);
--this.data.diff;
... ... @@ -73,7 +75,7 @@ Component({
seconds = seconds > 9 ? seconds : '0' + seconds;
// let fullContent = label + ' ' + days + ' 天 ' + hours + ':' + minutes + ':' + seconds;
let fullContent = hours + ' :' + minutes + ' :' + seconds;
let fullContent = days + ' :' + hours + ' :' + minutes;
this.setData({
label,
... ...
... ... @@ -231,7 +231,12 @@ Page(Object.assign({
});
},
onShow() {},
onShow() {
this.init().then(() => {
this._showRepeat();
});
},
onShareAppMessage: function(res) {
let params = {
TITLE: this.data.productName,
... ... @@ -406,7 +411,9 @@ Page(Object.assign({
snapData,
productSourceType,
isFollowedServiceNumber,
isNew: res.data.isNew,
isNew: res.data.isNew ? res.data.isNew : '',
currentTime: res.data.currentTime ? res.data.currentTime : '',
oldSaleTime: res.data.oldSaleTime ? res.data.oldSaleTime : '',
});
} else {
return Promise.reject();
... ...
<import src="../../../vendors/zanui/actionsheet/index.wxml" />
<wxs src="../../../wxs/helper.wxs" module="helper" />
<block wx:if="{{beginTime > currentTime}}">
<count-down-by-now current="1551921200" begin="1551931200"></count-down-by-now>
<block wx:if="{{oldSaleTime > currentTime}}">
<count-down-by-now current="{{currentTime}}" begin="{{oldSaleTime}}"></count-down-by-now>
</block>
<image class="detail-banner-image" src="{{helper.image(defaultImage, 750, 470, 1)}}"></image>
... ...