Authored by 邱骏

Merge branch 'develop' of http://git.yoho.cn/fe/yoho-limited-sell-miniapp into develop

... ... @@ -18,7 +18,7 @@ const config = {
apiParams: {
client_type: 'miniapp',
private_key: 'b43890b0a296ff3c7b8c260ca763980b',
app_version: '6.6.0',
app_version: '6.7.0',
miniapp_version: '0.0.1'
},
unionType: '', // 渠道号
... ...
import api from '../../common/api';
import config from '../../common/config';
export default {
/**
* 商品信息
... ... @@ -116,5 +118,22 @@ export default {
method: 'app.passport.signinByOpenID'
}
});
},
getParamsFromAppCode(code) {
return api.get({
url: '/wechat/miniapp/getMiniAppRealParam',
data: {
md5Param: code
}
}).then(result => {
if (result.code === 200) {
if (result.data) {
return JSON.parse(result.data);
}
}
}).catch(e => {
console.log('error', e);
});
}
};
... ...
... ... @@ -96,6 +96,7 @@ Page(Object.assign({
uid: '',
originUid: '',
originUnionID: '',
scene: '',
limitProductType: LIMIT_TYPE.ASSIST,
showStatus: SHOW_STATUS.SHARE,
... ... @@ -134,25 +135,50 @@ Page(Object.assign({
let originUnionID = options.originUnionID ? options.originUnionID : '';
let uid = app.getUid();
let scene = '';
// let uid = '349709';
// originUid = '500027570';
if (options && options.scene && options.scene.length === 32) {
scene = options.scene;
}
this.setData({
limitProductCode,
originUid,
originUnionID,
uid,
originUnionID
scene
});
yas = new Yas(app); // 实例化埋点
yas.pageOpenReport();
},
loadDataFromCode() {
return detailModel.getParamsFromAppCode(this.data.scene).then(json => {
if (json) {
let limitProductCode = json.limitProductCode ? json.limitProductCode : '';
let originUid = json.originUid ? json.originUid : '';
let originUnionID = json.originUnionID ? json.originUnionID : '';
this.setData({
limitProductCode,
originUid,
originUnionID,
});
}
});
},
onShow() {
setTimeout(() => {
app = app || getApp();
if (this.data.scene) {
this.loadDataFromCode().then(() => {
this.init();
});
} else {
this.init();
}
}, app ? 0 : 1000);
},
onShareAppMessage: function(res) {
... ...
... ... @@ -105,6 +105,7 @@
</block>
<block wx:elif="{{showStatus === 2 || showStatus === 7}}">
<block wx:if="{{productSourceType === 1}}">
<action-bar>
<view class="bottom1-action">
<view class="action-btn disable">立即购买</view>
... ... @@ -112,6 +113,18 @@
</action-bar>
</block>
<block wx:if="{{productSourceType === 2}}">
<action-bar>
<view class="top-assist-action">
<view class="top-title" >当前活动已结束</view>
<view class="top-action1">
<view class="top-ok" bindtap="goList">查看其他活动</view>
</view>
</view>
</action-bar>
</block>
</block>
<block wx:elif="{{showStatus === 3}}">
<action-bar>
<view class="top-assist-action">
... ... @@ -124,12 +137,24 @@
</block>
<block wx:elif="{{showStatus === 4}}">
<block wx:if="{{productSourceType === 1}}">
<action-bar>
<view class="bottom1-action">
<view class="action-btn ok" bindtap="buyNow">立即购买</view>
</view>
</action-bar>
</block>
<block wx:if="{{productSourceType === 2}}">
<action-bar>
<view class="top-assist-action">
<view class="top-title" >当前活动已结束</view>
<view class="top-action1">
<view class="top-ok" bindtap="goList">查看其他活动</view>
</view>
</view>
</action-bar>
</block>
</block>
<block wx:elif="{{showStatus === 5}}">
<action-bar>
... ... @@ -212,6 +237,7 @@
<action-bar>
<view class="bottom1-action">
<view class="action-btn2 disable">即将开售</view>
<view class="action-btn" bindtap="goQueueList">查看排队详情</view>
</view>
</action-bar>
</block>
... ...