...
|
...
|
@@ -7,17 +7,11 @@ import { |
|
|
openAuthorizeSettings,
|
|
|
} from '../../utils/login';
|
|
|
import { getQRCodeSource } from '../../libs/miniQRCodeRoute';
|
|
|
import { Toast } from '../../vendors/zanui/index';
|
|
|
import { Toast } from '../../vendors/zanui/index';
|
|
|
import router from './router/router';
|
|
|
import { wrapperName } from './helper';
|
|
|
import { formatImageUrl } from '../../utils/util';
|
|
|
import { formatImageUrl, fomartCountdownTime } from '../../utils/util';
|
|
|
import { jumpByUrl } from '../../libs/urlRoute';
|
|
|
import {
|
|
|
yasReport,
|
|
|
YB_PAGE_OPEN_L,
|
|
|
YB_LUCK_DT_GDS_C,
|
|
|
YB_LUCK_DT_JOIN_C,
|
|
|
} from '../../libs/yas';
|
|
|
import { yasReport, YB_PAGE_OPEN_L, YB_LUCK_DT_JOIN_C } from '../../libs/yas';
|
|
|
|
|
|
const ACTIVITY = {
|
|
|
UNKNOWN: 0,
|
...
|
...
|
@@ -77,7 +71,9 @@ Page( |
|
|
shareFlag: false,
|
|
|
notice: {},
|
|
|
lottery: {},
|
|
|
remainingTime: '',
|
|
|
formatTimeList: [],
|
|
|
isCountdownEnd: false,
|
|
|
timeId: null,
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -299,20 +295,17 @@ Page( |
|
|
actPrizeId: this.data.actPrizeId,
|
|
|
};
|
|
|
|
|
|
return this.service.getYohoodDetail(params)
|
|
|
.then((r1) => {
|
|
|
return this.service
|
|
|
.getYohoodDetail(params)
|
|
|
.then(r1 => {
|
|
|
wx.hideLoading();
|
|
|
if (r1.code === 200 && r1.data) {
|
|
|
let product = r1.data;
|
|
|
|
|
|
|
|
|
let qrcode = this.service.getQrCode({
|
|
|
shareUid: app.getUid(),
|
|
|
actPrizeId: this.data.actPrizeId || product.id || '',
|
|
|
});
|
|
|
|
|
|
this._getMineCode(product.id);
|
|
|
|
|
|
this._formatCountdownTime(product.remaining);
|
|
|
|
|
|
this.setData({
|
|
|
product: product,
|
|
|
actPrizeId: this.data.actPrizeId || product.id || '',
|
...
|
...
|
@@ -332,6 +325,30 @@ Page( |
|
|
});
|
|
|
},
|
|
|
|
|
|
_formatCountdownTime(remaining) {
|
|
|
if (this.data.timeId || !remaining) {
|
|
|
return;
|
|
|
}
|
|
|
// 初始化倒计时时间
|
|
|
const formatTimeList = fomartCountdownTime(remaining);
|
|
|
this.setData({
|
|
|
formatTimeList,
|
|
|
});
|
|
|
const timeId = setInterval(() => {
|
|
|
if (this.data.isCountdownEnd) {
|
|
|
this.changeActionStatus();
|
|
|
clearInterval(timeId);
|
|
|
}
|
|
|
remaining--;
|
|
|
const formatTimeList = fomartCountdownTime(remaining);
|
|
|
this.setData({
|
|
|
formatTimeList,
|
|
|
timeId,
|
|
|
isCountdownEnd: formatTimeList.join('') === '000000',
|
|
|
});
|
|
|
}, 1000);
|
|
|
},
|
|
|
|
|
|
_fetchParams(code) {
|
|
|
return getQRCodeSource(code).then(result => {
|
|
|
this.setData({
|
...
|
...
|
@@ -387,7 +404,7 @@ Page( |
|
|
return this.data.myPrizeCount > 0;
|
|
|
},
|
|
|
|
|
|
changeActionStatus(isStart) {
|
|
|
changeActionStatus() {
|
|
|
wx.showLoading({
|
|
|
mask: true,
|
|
|
});
|
...
|
...
|
@@ -454,7 +471,9 @@ Page( |
|
|
},
|
|
|
onShareAppMessage(res) {
|
|
|
let params = {
|
|
|
TITLE: `有货UFO在Yohood现场搞事情,点一下可原价购买${this.data.product.name}`,
|
|
|
TITLE: `有货UFO在Yohood现场搞事情,点一下可原价购买${
|
|
|
this.data.product.name
|
|
|
}`,
|
|
|
DESC: '我在YOHOOD发现一个不错的商品赶快来看看吧!',
|
|
|
};
|
|
|
this.setData({
|
...
|
...
|
@@ -471,7 +490,9 @@ Page( |
|
|
return {
|
|
|
title: params.TITLE, // 分享标题
|
|
|
desc: params.DESC, // 分享描述
|
|
|
path: `/pages/zeroSell/originalPriceSell?actPrizeId=${this.data.product.id}`,
|
|
|
path: `/pages/zeroSell/originalPriceSell?actPrizeId=${
|
|
|
this.data.product.id
|
|
|
}`,
|
|
|
};
|
|
|
} else if (res.from === 'button') {
|
|
|
// 用户点击分享按钮
|
...
|
...
|
|