收藏
回答

wx-open-launch-weapp vue 中ios端不展示?

<template>
  <div class="wallet-stage" v-if="data">
    <a class="btn-deposit" @click="goLink('transaction')">我的流水</a>
    <div class="balance">
      <img :src="iconWallet" />
      <div class="text">我的余额</div>
      <div class="money">
        <span>¥{{data.balance | money(2,'0') }}</span>
        <img v-if="activity" src="../../assets/ic_discount_b.png" />
      </div>
      <wx-open-launch-weapp id="launch-btn" username="gh_edb8ff053060" path="pages/Detail/PileDetail.html">
        <script type="text/wxtag-template">
          <style>.btn { padding: 12px }</style>
              <button class="btn">打开小程序</button>
            </script>
      </wx-open-launch-weapp>
      <div class="instruction">说明:(本金:¥{{data.principalBalance|money(2,'0')}} 赠送:¥{{data.giftBalance|money(2,'0')}})</div>
      <button v-if="!banRecharge" class="btn btn-primary" @click="goLink('recharge')">我要充值</button>
    </div>
  </div>
</template>


<script>
import { get, apiPath } from "api";
const iconWallet = require("../../assets/icon_wallet_big.png");
const iconNone = require("../../assets/icon_none.png");


module.exports = {
  data() {
    return {
      iconWallet,
      iconNone,
      data: { balance: 0 },
      activity: null,
      banRecharge: false
    };
  },


  created: function () {
    this.getData();
  },


  methods: {
    getData() {
      let that = this;
      get(apiPath.user.balance, null, true).then(
        res => {
          this.data = res.data.user;
          this.activity = res.data.balanceActivity;
          this.banRecharge = res.data.banRecharge;
          this.$store.dispatch("setUserBalance", this.data);
        },
        res => {
          that.$toast(res.msg);
        }
      );
    },
    scroll(e) {
      let height = Math.floor(
        $(e.target)[0].scrollHeight - $(e.target).height()
      );
      let scrollTop = Math.floor($(e.target)[0].scrollTop);
      let page = this.pager.page;
      if (scrollTop >= height && page < this.pager.total) {
        this.pager.page = page + 1;
        this.getData();
      }
    },
    goLink(path) {
      WECHAT_APP.sdk.push(this.$router, {
        name: path,
        query: {
          from: "account"
        }
      });
    }
  }
};
</script>


<style lang="scss" scoped>
@import "../../scss/config.scss";
@import "../../scss/extend.scss";


.wallet-stage {
  position: absolute;
  width: 100%;
  height: 100%;
  /*
  background: $bg-lightest-color;
  */
  display: flex;
  flex-flow: column;
  a.btn-deposit {
    position: absolute;
    right: rem(15px);
    top: rem(25px);
    z-index: 2;
    display: none;


    color: $primary-color;
    font-size: rem(13px);
    line-height: rem(14px);
    text-decoration: none;


    border-bottom: 1px solid $primary-color;
  }
  & > div {
    background: #fff;
    /*
    margin-top: rem(10px);
    border-top: 1px solid $border-color;
    border-bottom: 1px solid $border-color;
    */
  }
  .balance {
    padding: rem(90px) rem(20px) rem(20px) rem(20px);
    line-height: 1;
    color: $grey-dark;
    text-align: center;
    width: 100%;
    img {
      width: rem(70px);
      height: rem(70px);
    }
    .text {
      font-size: rem(14px);
      margin-top: rem(15px);
    }
    .money {
      position: relative;
      margin-top: rem(10px);
      margin-bottom: rem(10px);
      font-size: rem(35px);
      font-family: Verdana;
      img {
        position: absolute;
        width: 57px;
        height: 18px;
        margin-left: 5px;
        margin-top: 5px;
      }
    }
    .instruction {
      font-size: rem(10px);
      color: $grey-light;
      text-align: center;
      margin-bottom: rem(30px);
    }
    .btn {
      width: 100%;
    }
  }
  .balance-list {
    position: relative;
    color: $grey-dark;
    line-height: 1;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-flow: column;
    .header {
      padding: 0 rem(15px);
      font-size: rem(14px);
      border-bottom: 1px solid $border-color;
      height: rem(40px);
      line-height: rem(40px);
      span {
        font-size: rem(12px);
      }
    }
    .list-box {
      flex: 1;
      overflow-y: auto;
      ul {
        padding-left: rem(15px);
        border-bottom: 1px solid $border-color;
        li {
          position: relative;
          padding: rem(11px) 0;
          border-top: 1px solid rgba(255, 255, 255, 0);
          border-bottom: 1px solid $border-light-color;
          .text {
            div {
              line-height: 18px;
            }
            .time {
              margin-top: rem(5px);
              font-size: rem(13px);
              line-height: 1;
              color: $grey-light;
            }
          }
          .money {
            position: absolute;
            right: rem(15px);
            top: 50%;
            transform: translate(0, -50%);
            color: $red-light;
            &.isAdd {
              color: $green-light;
            }
          }
          &:last-child {
            border-color: rgba(255, 255, 255, 0);
          }
        }
      }
    }
    .balance-list-empty {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
      color: $grey-light;
      img {
        width: rem(90px);
        height: rem(90px);
        margin-bottom: rem(10px);
      }
    }
  }
}
</style>

https://th.goiot.net/#/wallet?from=account&serviceId=1209792912645160960
最后一次编辑于  2021-08-30
回答关注问题邀请回答
收藏

1 个回答

  • 社区技术运营专员--阳光
    社区技术运营专员--阳光
    2021-08-31
    https://th.goiot.net/#/wallet?from=account&serviceId=1209792912645160960这个链接吗?怎么复现呢
    


    2021-08-31
    有用
    回复
登录 后发表内容