Authored by 黄敬囿

Merge branch 'feature/inventory' into 'master'

Feature/inventory



See merge request !17
... ... @@ -64,6 +64,7 @@ App({
yas.report('YB_LAUNCH_APP');
let scene = options ? options.scene : '';
this.globalData.currentScene = scene;
},
onShow: function(options) {
... ... @@ -71,6 +72,7 @@ App({
verify.gen(); // 此处返回是是 Promise,需要调用接口的业务,最好在 then 里边执行
let scene = options ? options.scene : '';
this.globalData.currentScene = scene;
// wx.getLocation({}); // 获取位置信息
... ... @@ -122,12 +124,13 @@ App({
});
let shareParams = {};
if (options && options.query) {
for (var Key in options.query) {
shareParams[Key] = options.query[Key];
}
}
yas.report('YB_SHARE_UNION_TYPE', shareParams)
yas.report('YB_SHARE_UNION_TYPE', shareParams);
yas.report('YB_ENTER_FOREGROUND'); // 系统-程序切换置前台上报
if (this.reportData.awakeReported === false) {
... ... @@ -238,10 +241,11 @@ App({
});
setTimeout(() => {
let uid = user.uid;
this.setUserUnionType(uid);
}, 1000);
},
getUserUnionType() {
return this.globalData.userUnionType;
... ...
... ... @@ -22,5 +22,6 @@
"debug": true,
"navigateToMiniProgramAppIdList": [
"wx084ab813d88c594b"
]
}
],
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...
... ... @@ -17,9 +17,11 @@ export function getQRCodeSource(code) {
if (data.code === 200) {
if (data.data) {
let resultJson = JSON.parse(data.data);
if (resultJson) {
let app = getApp();
let yas = new Yas(app);
yas.report('YB_SHARE_UNION_TYPE', resultJson);
}
return resultJson;
... ...
... ... @@ -133,9 +133,11 @@ export default {
if (result.code === 200) {
if (result.data) {
let resultJson = JSON.parse(result.data);
if(resultJson){
if (resultJson) {
let app = getApp();
let yas = new Yas(app);
yas.report('YB_SHARE_UNION_TYPE', resultJson);
}
return resultJson;
... ...
... ... @@ -140,7 +140,7 @@ Page({
}
that.setData({
listData: list,
footText: '暂无更多内容'
footText: list.length > 0 ? '':'暂无更多内容'
});
}
});
... ... @@ -156,7 +156,7 @@ Page({
title: '',
content: '请打开有货APP参与活动',
showCancel: false
})
});
return;
}
... ... @@ -173,7 +173,7 @@ Page({
router.go('userCenter');
},
goToRule: function (e) {
goToRule: function(e) {
router.goUrl('https://activity.yoho.cn/feature/2593.html?share_id=5035&title=限定频道说明');
}
});
... ...
let timer;
Component({
properties: {
type: String,
current: {
type: Number,
observer: '_dataChange'
},
begin: Number,
end: Number
},
data: {
label: '',
days: '',
hours: '',
minutes: '',
seconds: '',
diff: '',
fullContent: ''
properties: {
type: String,
current: {
type: Number,
observer: '_dataChange'
},
pageLifetimes: {
show() {
console.log('show');
},
hide() {
console.log('hide');
clearInterval(timer);
}
begin: Number,
end: Number
},
data: {
label: '',
days: '',
hours: '',
minutes: '',
seconds: '',
diff: '',
fullContent: ''
},
pageLifetimes: {
show() {
console.log('show');
},
methods: {
_dataChange() {
const {current, begin, end} = this.data;
hide() {
console.log('hide');
clearInterval(timer);
}
},
methods: {
_dataChange() {
const {current, begin, end} = this.data;
let label = '距开售';
let label = '距开售';
// if (current && begin && end) {
// label = begin - current > 0 ? '距离活动开始' : '距离活动结束';
// }
// if (current && begin && end) {
// label = begin - current > 0 ? '距离活动开始' : '距离活动结束';
// }
this.data.diff = Math.abs(begin - current > 0 ? begin - current : end - current);
if (timer) {
clearInterval(timer);
}
this.tick(label);
this.data.diff = Math.abs(begin - current > 0 ? begin - current : end - current);
if (timer) {
clearInterval(timer);
}
this.tick(label);
timer = setInterval(() => {
this.tick(label);
--this.data.diff;
if (this.data.diff < 0) {
clearInterval(timer);
this.triggerEvent('endcountdown', {
isEnd: current - begin > 0
});
}
}, 1000);
},
tick(label) {
let diff = this.data.diff;
let days = Math.floor(diff / (24 * 3600));
timer = setInterval(() => {
this.tick(label);
--this.data.diff;
if (this.data.diff < 0) {
clearInterval(timer);
this.triggerEvent('endcountdown', {
isEnd: current - begin > 0
});
}
}, 1000);
},
tick(label) {
let diff = this.data.diff;
let days = Math.floor(diff / (24 * 3600));
days = days > 9 ? days : '0' + days;
days = days > 9 ? days : '0' + days;
let leave1 = diff % (24 * 3600);
let hours = Math.floor(leave1 / (3600));
let leave1 = diff % (24 * 3600);
let hours = Math.floor(leave1 / (3600));
hours = hours > 9 ? hours : '0' + hours;
hours = hours > 9 ? hours : '0' + hours;
let leave2 = leave1 % 3600;
let minutes = Math.floor(leave2 / 60);
let leave2 = leave1 % 3600;
let minutes = Math.floor(leave2 / 60);
minutes = minutes > 9 ? minutes : '0' + minutes;
minutes = minutes > 9 ? minutes : '0' + minutes;
let seconds = leave2 % 60;
let seconds = leave2 % 60;
seconds = seconds > 9 ? seconds : '0' + seconds;
seconds = seconds > 9 ? seconds : '0' + seconds;
// let fullContent = label + ' ' + days + ' 天 ' + hours + ':' + minutes + ':' + seconds;
let fullContent = days + ' :' + hours + ' :' + minutes;
// let fullContent = label + ' ' + days + ' 天 ' + hours + ':' + minutes + ':' + seconds;
let fullContent = days + ' :' + hours + ' :' + minutes;
this.setData({
label,
days,
hours,
minutes,
seconds,
fullContent
});
}
this.setData({
label,
days,
hours,
minutes,
seconds,
fullContent
});
}
}
});
... ...
... ... @@ -78,7 +78,10 @@ const QUEUE_SUCCESS = {
REPEAT: 2,
FULL: 3
};
const OFFLINE_STATUS = {
OFFLINE: 1,
OFFLINE_OVER: 0
}
const YB_TO_ASSIST_C = 'YB_TO_ASSIST_C';
const YB_ASSIST_SUCCESS_L = 'YB_ASSIST_SUCCESS_L';
const YB_INVITE_ASSIST_C = 'YB_INVITE_ASSIST_C';
... ... @@ -104,6 +107,7 @@ Page(Object.assign({
limitProductType: LIMIT_TYPE.ASSIST,
showStatus: SHOW_STATUS.SHARE,
offlineStatus: OFFLINE_STATUS.OFFLINE_OVER,
queueType: QUEUE_TYPE.READY,
productSourceType: PRODUCT_SOURCE_TYPE.SHARE,
assistStatus: ASSIST_STATUS.UN_ASSIST,
... ... @@ -141,7 +145,7 @@ Page(Object.assign({
let limitProductCode = query.limitProductCode ? query.limitProductCode : '';
let originUid = parseInt(query.originUid ? query.originUid : '0', 10);
let originUnionID = query.originUnionID ? query.originUnionID : '';
let uid = app.getUid();
let scene = '';
... ... @@ -342,7 +346,7 @@ Page(Object.assign({
if (res.data.defaultUrl) {
defaultImage = res.data.defaultUrl;
}
this.setData({
defaultImage
});
... ... @@ -400,6 +404,7 @@ Page(Object.assign({
saleTime: res.data.saleTime ? res.data.saleTime : '',
reminderNum: res.data.reminderNum ? res.data.reminderNum : 0,
limitProductType: res.data.limitProductType ? res.data.limitProductType : 4,
offlineStatus: res.data.offlineStatus ? res.data.offlineStatus : 0,
showStatus: res.data.showStatus ? res.data.showStatus : 0,
assistLimit: res.data.helpLimit ? res.data.helpLimit : 0,
queueType: res.data.queueType ? res.data.queueType : QUEUE_TYPE.READY,
... ... @@ -410,7 +415,7 @@ Page(Object.assign({
isNew: res.data.isNew ? res.data.isNew : '',
currentTime: res.data.currentTime ? res.data.currentTime : '',
oldSaleTime: res.data.oldSaleTime ? res.data.oldSaleTime : '',
isApp: res.data.isApp=='Y' ? true : false,
isApp: res.data.isApp == 'Y' ? true : false,
});
} else {
return Promise.reject();
... ... @@ -525,7 +530,7 @@ Page(Object.assign({
title: '',
content: '请打开有货APP参与活动',
showCancel: false
})
});
return;
}
... ... @@ -579,7 +584,7 @@ Page(Object.assign({
if ((this.data.avatarList.length + 1) === this.data.assistLimit) {
detailModel.getLimitCode(this.data.originUid, this.data.limitProductCode);
}
} else if (result.code === 520) {//此限定商品分享助力只限新客!
} else if (result.code === 520) { // 此限定商品分享助力只限新客!
wx.hideLoading();
wx.showModal({
title: '提示',
... ... @@ -605,7 +610,8 @@ Page(Object.assign({
}).catch(this.showError.bind(this));
},
//帮ta助力
// 帮ta助力
queueAction() {
let userInfo = app.getUserInfo();
... ... @@ -627,7 +633,7 @@ Page(Object.assign({
helpUserImgUrl: userInfo.wechat.avatarUrl ? userInfo.wechat.avatarUrl : '',
limitProductCode: this.data.limitProductCode
}).then(result => {
if (result.code === 520) {//此限定商品分享助力只限新客!
if (result.code === 520) { // 此限定商品分享助力只限新客!
wx.hideLoading();
wx.showModal({
title: '提示',
... ... @@ -694,9 +700,9 @@ Page(Object.assign({
duration: 3000
});
}
})
});
}
})
});
},
assistCancel() {
this.reload();
... ... @@ -742,7 +748,7 @@ Page(Object.assign({
title: '',
content: '请打开有货APP参与活动',
showCancel: false
})
});
return;
}
router.go('queueIndex', Object.assign({
... ... @@ -761,15 +767,15 @@ Page(Object.assign({
});
},
goApp : function(e) {
goApp: function(e) {
},
launchAppError: function (e) {
launchAppError: function(e) {
wx.showToast({
title: '打开失败!您可能未安装Yoho!Buy官方APP,请下载后再尝试。',
icon: 'none',
duration: 3000
})
});
},
goLogin(login = 1) {
... ... @@ -862,13 +868,15 @@ Page(Object.assign({
}
});
},
//用户是否关注过有货服务号
// 用户是否关注过有货服务号
getUserWechatRelateInfo() {
if (!this.data.uid) {
return Promise.resolve();
}
let uid = this.data.uid;
return detailModel.getUserWechatRelateInfo(uid).then(result => {
if (result.code === 200 && result.data.isSubscribe) {
this.setData({
... ...
... ... @@ -68,7 +68,11 @@
<action-bar wx:if="{{assistStatus === 1 || assistStatus === 3}}">
<form bindsubmit="assistShare" report-submit='true'>
<view class="bottom1-action">
<button class="as-bottom ok" formType="submit">{{isNew=='Y' ? '邀请新用户助力获取限购码' : '邀请好友助力获取限购码'}}</button>
<block wx:if="{{offlineStatus === 1}}">
<button class="as-bottom ok1" formType="submit">{{isNew=='Y' ? '邀请新用户助力获取限购码' : '邀请好友助力获取限购码'}}
<text class="buy-tip"> (线下购买专用)</text></button>
</block>
<button wx:else class="as-bottom ok" formType="submit">{{isNew=='Y' ? '邀请新用户助力获取限购码' : '邀请好友助力获取限购码'}}</button>
<view class="help-wrapper" bindtap="goHelp">
<image class="help" src="../../../static/images/XD_q_ic@3x.png"></image>
</view>
... ... @@ -252,7 +256,7 @@
</action-bar>
<block wx:else></block>
</block>
</block>
</block>
</block>
... ...
... ... @@ -183,7 +183,15 @@
.ok {
background-color: #d0021b;
}
.ok1 {
color: #222;
background-color: #B29674;
}
.buy-tip {
font-size: 24rpx;
line-height: 30rpx;
}
.cancel {
background-color: #b0b0b0;
}
... ...
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}
\ No newline at end of file
... ...