Commit 23e277e4dc12bec4ea87bf83f2f195d82daccc5a

Authored by zhiyangdu
1 parent 055ffba5

站外直接拉起APP

src/pages/goodDetails/goodDetails.vue
@@ -170,35 +170,43 @@ export default { @@ -170,35 +170,43 @@ export default {
170 * @param {Object} item [数据对象] 170 * @param {Object} item [数据对象]
171 */ 171 */
172 toDetail (item) { 172 toDetail (item) {
173 - // 跳转封装  
174 - if (typeof this.$parent.gotoDetail === 'function') { 173 + if (this.isCNLive.value) {
  174 + // 跳转封装
  175 + if (typeof this.$parent.gotoDetail === 'function') {
175 176
176 - // 设置跳转参数  
177 - let params = {  
178 - type: '5',  
179 - to: window.location.origin + '/html/select_good/1/#/goodDetails?goodsId' + item.id + "&uid" + this.getStore("uid"),  
180 - shop_type: ''  
181 - }; 177 + // 设置跳转参数
  178 + let params = {
  179 + type: '5',
  180 + to: window.location.origin + '/html/select_good/1/#/goodDetails?goodsId' + item.id + "&uid" + this.getStore("uid"),
  181 + shop_type: ''
  182 + };
182 183
183 - // 页面跳转  
184 - this.$parent.gotoDetail(params); 184 + // 页面跳转
  185 + this.$parent.gotoDetail(params);
  186 + }
  187 + } else {
  188 + this.$parent.callApps();
185 } 189 }
186 }, 190 },
187 // 兑换 191 // 兑换
188 exchange () { 192 exchange () {
189 - // 提示用积分兑换兑换  
190 - let options = {  
191 - title: "",  
192 - message: "确定使用" + this.goodsInfo.num + "积分兑换?",  
193 - confirmButtonText: "确定",  
194 - confirmButtonCallback: this.addIntegralOrderconfirm,  
195 - showCancelButton: true,  
196 - cancelButtonText: "取消"  
197 - };  
198 - // 调用showModal层参数  
199 - this.$set(this.$parent, "showOptions", options);  
200 - // 显示通用浮层  
201 - this.$parent.$refs.showModal.showLayer(); 193 + if (this.isCNLive.value) {
  194 + // 提示用积分兑换兑换
  195 + let options = {
  196 + title: "",
  197 + message: "确定使用" + this.goodsInfo.num + "积分兑换?",
  198 + confirmButtonText: "确定",
  199 + confirmButtonCallback: this.addIntegralOrderconfirm,
  200 + showCancelButton: true,
  201 + cancelButtonText: "取消"
  202 + };
  203 + // 调用showModal层参数
  204 + this.$set(this.$parent, "showOptions", options);
  205 + // 显示通用浮层
  206 + this.$parent.$refs.showModal.showLayer();
  207 + } else {
  208 + this.$parent.callApps();
  209 + }
202 }, 210 },
203 // 确定兑换回调 211 // 确定兑换回调
204 addIntegralOrderconfirm () { 212 addIntegralOrderconfirm () {
src/pages/pointsMall/pointsMall.vue
@@ -12,14 +12,14 @@ @@ -12,14 +12,14 @@
12 <!-- pl --> 12 <!-- pl -->
13 <div class="pl" :class="{'is-open-app': $parent.isOpenApp.value, 'hide': $route.query.hideBack == true}"></div> 13 <div class="pl" :class="{'is-open-app': $parent.isOpenApp.value, 'hide': $route.query.hideBack == true}"></div>
14 <div class="main_box"> 14 <div class="main_box">
15 - <back-box  
16 - v-if="isCNLive.value"  
17 - :class="{'hide': $route.query.hideBack == true}"  
18 - class="back-box"  
19 - :style="'padding-top: ' + $parent.top.value + 'px'"  
20 - @back="back"  
21 - :backs="backs">  
22 - </back-box> 15 + <back-box
  16 + v-if="isCNLive.value"
  17 + :class="{'hide': $route.query.hideBack == true}"
  18 + class="back-box"
  19 + :style="'padding-top: ' + $parent.top.value + 'px'"
  20 + @back="back"
  21 + :backs="backs">
  22 + </back-box>
23 <div class="top_main"> 23 <div class="top_main">
24 <!-- 头部 --> 24 <!-- 头部 -->
25 <div class="top"> 25 <div class="top">
@@ -156,23 +156,27 @@ export default { @@ -156,23 +156,27 @@ export default {
156 * @param {Object} item [数据对象] 156 * @param {Object} item [数据对象]
157 */ 157 */
158 anchor (item) { 158 anchor (item) {
159 - // 判断锚点是否存在  
160 - if (item.ref && typeof this.$refs === 'object' && typeof this.$refs[item.ref] === 'object') { 159 + if (this.isCNLive.value) {
  160 + // 判断锚点是否存在
  161 + if (item.ref && typeof this.$refs === 'object' && typeof this.$refs[item.ref] === 'object') {
161 162
162 - // 根据头部设置锚点位置  
163 - let safeDistance = 0; 163 + // 根据头部设置锚点位置
  164 + let safeDistance = 0;
164 165
165 - // 判断是否有callApp组件  
166 - if (typeof this.$refs.callApp === 'object') {  
167 - safeDistance += this.$refs.callApp.$el.clientHeight;  
168 - } 166 + // 判断是否有callApp组件
  167 + if (typeof this.$refs.callApp === 'object') {
  168 + safeDistance += this.$refs.callApp.$el.clientHeight;
  169 + }
169 170
170 - // 判断是否有backBox组件  
171 - if (typeof this.$refs.backBox === 'object') {  
172 - safeDistance += this.$refs.backBox.$el.clientHeight;  
173 - } 171 + // 判断是否有backBox组件
  172 + if (typeof this.$refs.backBox === 'object') {
  173 + safeDistance += this.$refs.backBox.$el.clientHeight;
  174 + }
174 175
175 - document.documentElement.scrollTop = document.body.scrollTop = this.$refs[item.ref].offsetTop - safeDistance - (20 * ((document.documentElement.clientWidth || document.body.clientWidth) / 750)); 176 + document.documentElement.scrollTop = document.body.scrollTop = this.$refs[item.ref].offsetTop - safeDistance - (20 * ((document.documentElement.clientWidth || document.body.clientWidth) / 750));
  177 + }
  178 + } else {
  179 + this.$parent.callApps();
176 } 180 }
177 }, 181 },
178 /** 182 /**
@@ -180,12 +184,16 @@ export default { @@ -180,12 +184,16 @@ export default {
180 * @param {Object} item [数据对象] 184 * @param {Object} item [数据对象]
181 */ 185 */
182 toExchangeRecord () { 186 toExchangeRecord () {
183 - this.$router.push({  
184 - path: '/pointsExchangeRecords',  
185 - query: {  
186 - uid: this.getStore("uid"),  
187 - }  
188 - }) 187 + if (this.isCNLive.value) {
  188 + this.$router.push({
  189 + path: '/pointsExchangeRecords',
  190 + query: {
  191 + uid: this.getStore("uid"),
  192 + }
  193 + })
  194 + } else {
  195 + this.$parent.callApps();
  196 + }
189 }, 197 },
190 /** 198 /**
191 * 跳转赚取积分页面 199 * 跳转赚取积分页面
@@ -202,6 +210,8 @@ export default { @@ -202,6 +210,8 @@ export default {
202 // 跳转到原生的任务列表 210 // 跳转到原生的任务列表
203 window.obj.jumpClientIntegralList(); 211 window.obj.jumpClientIntegralList();
204 } 212 }
  213 + } else {
  214 + this.$parent.callApps();
205 } 215 }
206 }, 216 },
207 /** 217 /**
@@ -209,14 +219,18 @@ export default { @@ -209,14 +219,18 @@ export default {
209 * @param {Object} item [数据对象] 219 * @param {Object} item [数据对象]
210 */ 220 */
211 toDetail (item) { 221 toDetail (item) {
212 - // 判断通用跳转函数是否存在  
213 - this.$router.push({  
214 - path: '/goodDetails',  
215 - query: {  
216 - goodsId: item.id,  
217 - uid: this.getStore("uid")  
218 - }  
219 - }) 222 + if (this.isCNLive.value) {
  223 + // 判断通用跳转函数是否存在
  224 + this.$router.push({
  225 + path: '/goodDetails',
  226 + query: {
  227 + goodsId: item.id,
  228 + uid: this.getStore("uid")
  229 + }
  230 + })
  231 + } else {
  232 + this.$parent.callApps();
  233 + }
220 }, 234 },
221 /** 235 /**
222 * 分享 236 * 分享