Merge branch 'develop' of http://git.yoho.cn/fe/yoho-limited-sell-miniapp into develop
Showing
4 changed files
with
76 additions
and
5 deletions
@@ -18,7 +18,7 @@ const config = { | @@ -18,7 +18,7 @@ const config = { | ||
18 | apiParams: { | 18 | apiParams: { |
19 | client_type: 'miniapp', | 19 | client_type: 'miniapp', |
20 | private_key: 'b43890b0a296ff3c7b8c260ca763980b', | 20 | private_key: 'b43890b0a296ff3c7b8c260ca763980b', |
21 | - app_version: '6.6.0', | 21 | + app_version: '6.7.0', |
22 | miniapp_version: '0.0.1' | 22 | miniapp_version: '0.0.1' |
23 | }, | 23 | }, |
24 | unionType: '', // 渠道号 | 24 | unionType: '', // 渠道号 |
1 | import api from '../../common/api'; | 1 | import api from '../../common/api'; |
2 | 2 | ||
3 | +import config from '../../common/config'; | ||
4 | + | ||
3 | export default { | 5 | export default { |
4 | /** | 6 | /** |
5 | * 商品信息 | 7 | * 商品信息 |
@@ -116,5 +118,22 @@ export default { | @@ -116,5 +118,22 @@ export default { | ||
116 | method: 'app.passport.signinByOpenID' | 118 | method: 'app.passport.signinByOpenID' |
117 | } | 119 | } |
118 | }); | 120 | }); |
121 | + }, | ||
122 | + | ||
123 | + getParamsFromAppCode(code) { | ||
124 | + return api.get({ | ||
125 | + url: '/wechat/miniapp/getMiniAppRealParam', | ||
126 | + data: { | ||
127 | + md5Param: code | ||
128 | + } | ||
129 | + }).then(result => { | ||
130 | + if (result.code === 200) { | ||
131 | + if (result.data) { | ||
132 | + return JSON.parse(result.data); | ||
133 | + } | ||
134 | + } | ||
135 | + }).catch(e => { | ||
136 | + console.log('error', e); | ||
137 | + }); | ||
119 | } | 138 | } |
120 | }; | 139 | }; |
@@ -96,6 +96,7 @@ Page(Object.assign({ | @@ -96,6 +96,7 @@ Page(Object.assign({ | ||
96 | uid: '', | 96 | uid: '', |
97 | originUid: '', | 97 | originUid: '', |
98 | originUnionID: '', | 98 | originUnionID: '', |
99 | + scene: '', | ||
99 | 100 | ||
100 | limitProductType: LIMIT_TYPE.ASSIST, | 101 | limitProductType: LIMIT_TYPE.ASSIST, |
101 | showStatus: SHOW_STATUS.SHARE, | 102 | showStatus: SHOW_STATUS.SHARE, |
@@ -134,25 +135,50 @@ Page(Object.assign({ | @@ -134,25 +135,50 @@ Page(Object.assign({ | ||
134 | let originUnionID = options.originUnionID ? options.originUnionID : ''; | 135 | let originUnionID = options.originUnionID ? options.originUnionID : ''; |
135 | 136 | ||
136 | let uid = app.getUid(); | 137 | let uid = app.getUid(); |
138 | + let scene = ''; | ||
137 | 139 | ||
138 | - // let uid = '349709'; | ||
139 | - // originUid = '500027570'; | 140 | + if (options && options.scene && options.scene.length === 32) { |
141 | + scene = options.scene; | ||
142 | + } | ||
140 | 143 | ||
141 | this.setData({ | 144 | this.setData({ |
142 | limitProductCode, | 145 | limitProductCode, |
143 | originUid, | 146 | originUid, |
147 | + originUnionID, | ||
144 | uid, | 148 | uid, |
145 | - originUnionID | 149 | + scene |
146 | }); | 150 | }); |
147 | 151 | ||
148 | yas = new Yas(app); // 实例化埋点 | 152 | yas = new Yas(app); // 实例化埋点 |
149 | - | ||
150 | yas.pageOpenReport(); | 153 | yas.pageOpenReport(); |
151 | }, | 154 | }, |
155 | + | ||
156 | + loadDataFromCode() { | ||
157 | + return detailModel.getParamsFromAppCode(this.data.scene).then(json => { | ||
158 | + if (json) { | ||
159 | + let limitProductCode = json.limitProductCode ? json.limitProductCode : ''; | ||
160 | + let originUid = json.originUid ? json.originUid : ''; | ||
161 | + let originUnionID = json.originUnionID ? json.originUnionID : ''; | ||
162 | + | ||
163 | + this.setData({ | ||
164 | + limitProductCode, | ||
165 | + originUid, | ||
166 | + originUnionID, | ||
167 | + }); | ||
168 | + } | ||
169 | + }); | ||
170 | + }, | ||
152 | onShow() { | 171 | onShow() { |
153 | setTimeout(() => { | 172 | setTimeout(() => { |
154 | app = app || getApp(); | 173 | app = app || getApp(); |
174 | + | ||
175 | + if (this.data.scene) { | ||
176 | + this.loadDataFromCode().then(() => { | ||
155 | this.init(); | 177 | this.init(); |
178 | + }); | ||
179 | + } else { | ||
180 | + this.init(); | ||
181 | + } | ||
156 | }, app ? 0 : 1000); | 182 | }, app ? 0 : 1000); |
157 | }, | 183 | }, |
158 | onShareAppMessage: function(res) { | 184 | onShareAppMessage: function(res) { |
@@ -105,6 +105,7 @@ | @@ -105,6 +105,7 @@ | ||
105 | </block> | 105 | </block> |
106 | 106 | ||
107 | <block wx:elif="{{showStatus === 2 || showStatus === 7}}"> | 107 | <block wx:elif="{{showStatus === 2 || showStatus === 7}}"> |
108 | + <block wx:if="{{productSourceType === 1}}"> | ||
108 | <action-bar> | 109 | <action-bar> |
109 | <view class="bottom1-action"> | 110 | <view class="bottom1-action"> |
110 | <view class="action-btn disable">立即购买</view> | 111 | <view class="action-btn disable">立即购买</view> |
@@ -112,6 +113,18 @@ | @@ -112,6 +113,18 @@ | ||
112 | </action-bar> | 113 | </action-bar> |
113 | </block> | 114 | </block> |
114 | 115 | ||
116 | + <block wx:if="{{productSourceType === 2}}"> | ||
117 | + <action-bar> | ||
118 | + <view class="top-assist-action"> | ||
119 | + <view class="top-title" >当前活动已结束</view> | ||
120 | + <view class="top-action1"> | ||
121 | + <view class="top-ok" bindtap="goList">查看其他活动</view> | ||
122 | + </view> | ||
123 | + </view> | ||
124 | + </action-bar> | ||
125 | + </block> | ||
126 | + </block> | ||
127 | + | ||
115 | <block wx:elif="{{showStatus === 3}}"> | 128 | <block wx:elif="{{showStatus === 3}}"> |
116 | <action-bar> | 129 | <action-bar> |
117 | <view class="top-assist-action"> | 130 | <view class="top-assist-action"> |
@@ -124,12 +137,24 @@ | @@ -124,12 +137,24 @@ | ||
124 | </block> | 137 | </block> |
125 | 138 | ||
126 | <block wx:elif="{{showStatus === 4}}"> | 139 | <block wx:elif="{{showStatus === 4}}"> |
140 | + <block wx:if="{{productSourceType === 1}}"> | ||
127 | <action-bar> | 141 | <action-bar> |
128 | <view class="bottom1-action"> | 142 | <view class="bottom1-action"> |
129 | <view class="action-btn ok" bindtap="buyNow">立即购买</view> | 143 | <view class="action-btn ok" bindtap="buyNow">立即购买</view> |
130 | </view> | 144 | </view> |
131 | </action-bar> | 145 | </action-bar> |
132 | </block> | 146 | </block> |
147 | + <block wx:if="{{productSourceType === 2}}"> | ||
148 | + <action-bar> | ||
149 | + <view class="top-assist-action"> | ||
150 | + <view class="top-title" >当前活动已结束</view> | ||
151 | + <view class="top-action1"> | ||
152 | + <view class="top-ok" bindtap="goList">查看其他活动</view> | ||
153 | + </view> | ||
154 | + </view> | ||
155 | + </action-bar> | ||
156 | + </block> | ||
157 | + </block> | ||
133 | 158 | ||
134 | <block wx:elif="{{showStatus === 5}}"> | 159 | <block wx:elif="{{showStatus === 5}}"> |
135 | <action-bar> | 160 | <action-bar> |
@@ -212,6 +237,7 @@ | @@ -212,6 +237,7 @@ | ||
212 | <action-bar> | 237 | <action-bar> |
213 | <view class="bottom1-action"> | 238 | <view class="bottom1-action"> |
214 | <view class="action-btn2 disable">即将开售</view> | 239 | <view class="action-btn2 disable">即将开售</view> |
240 | + <view class="action-btn" bindtap="goQueueList">查看排队详情</view> | ||
215 | </view> | 241 | </view> |
216 | </action-bar> | 242 | </action-bar> |
217 | </block> | 243 | </block> |
-
Please register or login to post a comment