Commit 56c96f1c4e0e40355919596f9cbe105b9b5400e8

Authored by zhiyangdu
1 parent 0b66a275

mall模版增打开app后面参数获取

Showing 1 changed file with 30 additions and 18 deletions
src/pages/mall/mall.vue
1 1 <template>
2 2 <!-- <div class="mall-box" :style="'margin-top:'+ ($parent.isBack ? 62 : 10)+'px'"> -->
3   - <div class="mall-box">
  3 + <div class="mall-box">
4 4 <!-- 下拉刷新 -->
5 5 <!-- <van-pull-refresh v-model="isLoading" pulling-text="下拉刷新..." loosing-text="释放刷新" loading-text="加载中..." success-text="刷新成功" @refresh="onRefresh"> -->
6 6 <!-- nav -->
... ... @@ -14,7 +14,7 @@
14 14 >
15 15 </call-app-box>
16 16 <back-box
17   - v-if="$parent.isBack && $parent.isCNLive.value"
  17 + v-if="$parent.isBack && isCNLive.value"
18 18 class="back-box"
19 19 :style="'padding-top: ' + $parent.top.value + 'px'"
20 20 @back="back"
... ... @@ -23,7 +23,11 @@
23 23 </back-box>
24 24 <!--轮播-->
25 25 <swiper
26   - :style="'margin-top:'+ ($parent.isBack ? 62 : 10)+'px'"
  26 + :style="
  27 + 'margin-top:' +
  28 + ($parent.isBack && isCNLive.value ? 62 : 10) +
  29 + 'px'
  30 + "
27 31 v-if="banner"
28 32 :swipers="banner"
29 33 :options="{
... ... @@ -160,22 +164,30 @@ export default {
160 164 }
161 165 },
162 166 mounted() {
163   - // 唤起详情页
164   - if (typeof this.$parent.getOpenApp === "function") {
165   - this.$parent.getOpenApp({
166   - type: 38,
167   - id: this.$route.query.id || 0,
168   - url: ""
169   - });
170   - }
  167 + if (this.$parent.isBack) {
  168 + // 唤起详情页
  169 + if (typeof this.$parent.getOpenApp === "function") {
  170 + this.$parent.getOpenApp({
  171 + type: 38,
  172 + id: this.$route.query.id || 0,
  173 + url: ""
  174 + });
  175 + }
171 176  
172   - // 分享详情页
173   - if (typeof this.$parent.getShareData === "function") {
174   - this.$parent.getShareData({
175   - type: 38,
176   - id: this.$route.query.id || 0,
177   - url: ""
178   - });
  177 + // 分享详情页
  178 + if (typeof this.$parent.getShareData === "function") {
  179 + this.$parent.getShareData({
  180 + type: 38,
  181 + id: this.$route.query.id || 0,
  182 + url: ""
  183 + });
  184 + }
  185 + let schemeParams = this.$parent.schemeParams;
  186 + // 判断如果是分享链接没有isBack=true在后面加上isBack=true;为了在app内打开可以展示
  187 + if (!schemeParams.isBack) {
  188 + // 设置参数
  189 + this.$parent.schemeParams = this.$parent.schemeParams + "isBack=true";
  190 + }
179 191 }
180 192 },
181 193 methods: {
... ...