123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <template>
- <app-layout>
- <view>
- <app-card-detail :list="list"></app-card-detail>
- </view>
- </app-layout>
- </template>
- <script>
- import appCardDetail from '../components/app-card-detail.vue';
- import {mapState} from "vuex";
- export default {
- components: {appCardDetail},
- data() {
- return {
- list: null,
- }
- },
- computed: {
- ...mapState({
- cardImg: state => state.mallConfig.__wxapp_img.card,
- })
- },
- methods: {
- getList(id) {
- let that = this;
- that.$showLoading({
- text: '加载中...'
- });
- that.$request({
- url: that.$api.card.detailsp,
- data: {
- cardId: id,
- },
- }).then(response=>{
- that.$hideLoading();
- if(response.code === 0) {
- that.list = response.data.card;
- } else {
- uni.showToast({
- title: response.msg,
- icon: 'none',
- duration: 1000,
- });
- }
- }).catch(() => {
- that.$hideLoading();
- });
- },
- },
- onLoad(options) {
- this.getList(options.id);
- },
- onShareAppMessage(object) {
- return this.$shareAppMessage({
- title: this.list.app_share_title ? this.list.app_share_title : '送你一张碎屏险,赶快来领取吧',
- imageUrl: this.list.app_share_pic ? this.list.app_share_pic : this.cardImg.img_card_2,
- path: '/pages/card/give/give',
- params: {
- card_id: this.list.id
- }
- });
- },
- }
- </script>
|