6***@qq.com
6***@qq.com
  • 发布:2022-07-26 19:05
  • 更新:2022-07-27 19:26
  • 阅读:254

【报Bug】Nvue 图片IOS有显示不出

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 12.12.1

HBuilderX类型: 正式

HBuilderX版本号: 3.4.18

手机系统: iOS

手机系统版本号: iOS 15

手机厂商: 苹果

手机机型: iphone11

页面类型: nvue

vue版本: vue2

打包方式: 云端

项目创建方式: HBuilderX

示例代码:
<template> <view class="tabs"> <view class="wrapper" elevation="2px"> <simpleStatusBar></simpleStatusBar> <view class="nav"> <view class="title"> <view v-for="(item, index) in nviewTab" :key="index" @click="tabBarsClick(index, item)"> <text class="title-text"

class="[tabBarsCurr == index ? 'title-text-curr' : '']">{{ item.title }}</text> </view>
</view>
</view>

</view>  

<view class="new-home-top-nav">  
    <scroll-view class="category-scroll" :scroll-left="navScorllLeft" scroll-direction="horizontal"  
show-scrollbar="false" :scroll-x="true"> <view class="category-tab-item" :ref="'navItem' + index" v-for="(item, index) in carteTab" :key="index" id="item.id" @click="ontabtap(index,item)"> <text class="category-tab-item-title"

class="currentTab == index ? 'category-tab-item-title-active' : ''">{{ item.title }}</text> </view>
</scroll-view>
</view>

<swiper :current="currentTab" class="swiper-box" :duration="300" @change="changSlider">  
    <swiper-item class="swiper-item" v-for="(tab, index1) in carteTab" :key="index1">  
        <list class="scroll-v list" scroll-y enableBackToTop="true" :show-scrollbar="false"  
            @scrolltolower="loadMore(index1)" scroll-with-animation enable-back-to-top  
            @loadmore="loadMore(index1)">  
            <cstRefresh @refresh="onrefresh(index1)" :ref="'swiperItemRef_' + index1"  

refreshing="tab.refreshing" @pullingdown="onpullingdown" :refreshText="tab.refreshText"> </cstRefresh>

            <cell class="" style="" v-if="tab.product.length > 0 &&tabBarsCurr==0">  
                <view class="cp-content">  
                    <view class="cp-xiangmu" v-for="(val, pindex) in tab.product" @click="showShare(val)">  
                        <image src="http://bgcdn.echoapp.cn/e9672f20b5313db5/60efc95eb2fe4d2a.jpg" class="cp_tupian"  
                            placeholder="/static/img/ic_default_placeholder.png"></image>  
                    </view>  
                </view>  

            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==1"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white" v-if="false">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons s-border-radius " src="/static/img/logo.png"></image>  
                        <view class="s-list-content head-content">  
                            <text class="is-size-14 s-bold">{{ val.show_name }}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{ val.show_time }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val.goods_numiid,1)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  
                <view class="s-margins s-border-radius-small s-bg-white">  

                    <!-- <view class="s-ceil s-padding goods_title"  
                        v-if="val.short_name != '' && val.short_name != null">  
                        <text class="find-title-txt">{{ val.short_name }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.circle_content }}</text>  
                    </view> -->  

                    <view class="s-ceil s-padding goods_title" v-if="val.picture && val.picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.picture"  

key="picIndex" @click="previewImage({ urllist: val['picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem" mode="widthFix"></image>
</view>

                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title" v-if="val.video">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card">  
                                <video :src="val.video" id="myVideo" class="video"  
                                    @timeupdate='video_time_update' :poster="val.cover"></video>  
                            </view>  
                        </view>  
                    </view>  

                    <view class="s-ceil s-padding s-body goods_title">  
                        <view class="find-txt-comment">  
                            <!-- 下单地址{点击复制文案后自动生成短网址} -->  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{val.content}}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding find-head-content">  
                        <image v-if="false" class="s-list-icons s-border-radius " src="/static/img/logo.png">  
                        </image>  
                        <view class="s-list-content head-content" v-if="false">  
                            <text  
                                class="is-size-14 s-bold">{{ val.shop_name ? val.shop_name : val.show_name ? val.show_name : '' }}</text>  
                            <text  
                                class="is-size-12 s-ellipsis s-black9">{{ val.update_time ? val.update_time : val.addtime }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheetVide(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                </view>  
            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==2"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons1  " :src="val.picture[0]" @click="toWeb(val.link)"></image>  
                        <view class="s-list-content head-content" @click="toWeb(val.link)">  
                            <text class="is-size-14 s-bold">{{val.content}}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{val.addtime}}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  

            </cell>  

            <cell class="tui-refresh">  

                <text class="refresh-text">{{ tab.loadingText }}</text>  
            </cell>  
        </list>  
    </swiper-item>  
</swiper>  
<uni-popup ref="popup" type="bottom">  
    <view  
        style="height: 250rpx;background-color: #FFFFFF;border-top-left-radius: 30rpx;border-top-right-radius: 30rpx;">  
        <view style="display: flex;flex-direction: row;justify-content: space-around;margin-top: 60rpx;" mode="widthFix">  
            <view style="margin: 0 auto;display: flex;align-items: center;" @click="shareWx">  
                <image src="../../static/icon_wechat.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享微信好友</text>  
            </view>  
            <view style="margin: 0 auto;display: flex;align-items: center;"  @click="sharePy">  
                <image src="../../static/icon_wechatpy.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享朋友圈</text>  
            </view>  
        </view>  
    </view>  
</uni-popup>  

</view>
</template>

<script>
import simpleStatusBar from '@/components/simple-pro/simple-statusBar.nvue';
import cstRefresh from '@/components/huahuasheng/nvue/hhs-refresh.nvue';
import vTabs from '@/components/v-tabs/v-tabs.vue';
import HttpRequest from '@/common/httpRequest.js';
import HttpCache from '@/common/cache.js';
var appHelper = getApp().globalData;
var request = appHelper.request;

import helper from '@/common/helper.js';  
var nviewTab = [];  
const clipboard = weex.requireModule('clipboard');  
const dom = weex.requireModule('dom');  
import share from '@/common/app-plus/simple-share.js';  
import {  
    mapState,  
    mapMutations  
} from 'vuex';  
let selectInfo = null;  
export default {  
    data() {  
        return {  
            navScorllLeft: 0,  
            video_time_update_status: true,  
            current: 0,  
            nviewTab: [{  
                    title: '海报',  
                    type: '0',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0 //0无效果 1加载中 2没有了  
                },  
                {  
                    title: '视频',  
                    type: '1',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                },  
                {  
                    title: '文章',  
                    type: '2',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                }  
            ],  
            tabBarsCurr: 0, //大分类  
            currentTab: 0, //小分类  
            pulling: false,  
            spinChain: {},  
            detail: {},  
            carteTab: [],  
            shareType: 1,  
            carteValue: 0, //小分类  
            shareValue:{},  
            type:0  
        };  
    },  
    computed: {  
        ...mapState(['hasLogin', 'userinfo', 'openid'])  
    },  
    components: {  
        simpleStatusBar,  
        cstRefresh,  
        vTabs  
    },  
    created() {  
        this.init();  
        uni.$on('find-share-popup', event => {  
            this.findShareResult(event);  
        });  
    },  
    destroyed() {  
        uni.$off('find-share-popup', function(data) {  
            console.log('移除 find-share-popup 自定义事件');  
        });  
    },  
    methods: {  
        // 播放进度变化时触发  
        shareWx(){  
            this.shareType =1  
            this.shareWxTo()  
        },  
        sharePy(){  
            this.shareType =2  
            this.shareWxTo()  
        },  
        showSheet(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =0  
            this.$refs.popup.open('top')  
        },  
        showSheetVide(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =1  
            this.$refs.popup.open('top')  
        },  

        video_time_update(e) {  
            // e.detail.duration 为视频总长度,在没有加载到视频的时候总长度为 -0.0001  
            // 当获取到视频长度后进入if  
            if (this.video_time_update_status && e.detail.duration > 0) {  
                // 第一次进入if 关闭更新状态,防止循环暂停  
                this.video_time_update_status = false;  
                // 获取视频  
                let videoContext = uni.createVideoContext('myVideo');  
                // 暂停视频  
                videoContext.pause();  
            }  
        },  
        toWeb(e) {  
            console.log(e)  
            uni.navigateTo({  
                url: "/pages/special/baoyang?url=" + e  
            })  
        },  
        shareWxTo() {  
            var e = this.shareValue  

            if(this.type==0){  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    })  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    });  
                }  
            }else{  
                console.log(this.shareType)  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                }  
            }  
        },  
        async ontabtap(index, item) {  
            console.log(item)  
            this.carteValue = item.id  
            this.currentTab = index  
            this.getList();  
        },  
        async init() {  
            console.log(222)  
            let {  
                data  
            } = await HttpRequest.post('find/cate', {  
                type: this.tabBarsCurr  
            });  
            // this.na  
            let arr = [];  
            data.forEach(item => {  
                arr.push({  
                    title: item.name,  
                    id: item.id,  
                    type: 'jd',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                })  
            });  
            this.carteTab = arr;  
            console.log(this.carteTab)  
            this.getList();  
        },  
        pageScrollTo() {  
            var ref = 'swiperItemRef_' + this.tabBarsCurr;  
            const el = this.$refs[ref];  
            dom.scrollToElement(el, {});  
        },  
        tabBarsClick(index) {  
            this.tabBarsCurr = index;  
            this.init();  
        },  
        switchTab(index) {  
            this.tabBarsCurr = index;  

            this.getList()  
            // if (this.nviewTab[index].product.length === 0) {  
            //  this.getList(index);  
            // }  
        },  
        changSlider(e) {  
            let index = e.target.current || e.detail.current;  
            this.currentTab = index  
            this.getList();  
            // this.switchTab(index);  

        },  
        async getList(type) {  
            let activeTab = this.carteTab[this.currentTab];  
            activeTab.loadingText = '数据加载中...';  
            try {  

                let param = {  
                    page: activeTab.page,  
                    cate_id: activeTab.id,  
                    type: this.tabBarsCurr  

                }  
                console.log(type)  
                console.log(param)  
                const result = await request.post('find/product_interest_circle', param);  
                console.log(result)  
                if (result.code == 200) {  
                    if (result.data.length > 0) {  
                        console.log(activeTab)  
                        activeTab.loadingText = '加载完成';  
                        if (activeTab.page == 1) {  
                            activeTab.product = result.data;  
                        } else {  
                            activeTab.product = activeTab.product.concat(result.data);  
                        }  
                    } else {  
                        activeTab.loadingText = '没有更多了';  
                    }  
                    console.log(this.carteTab)  
                } else {  
                    activeTab.loadingText = '没有更多了';  
                }  
            } catch (e) {  
                activeTab.loadingText = '网络繁忙';  
            }  
            if (type == 'refreshData') {  
                this.pulling = true;  
                activeTab.refreshing = false;  
                activeTab.refreshText = '已刷新';  
                setTimeout(() => {  
                    // TODO fix ios和Android 动画时间相反问题  
                    this.pulling = false;  
                }, 500);  
            }  
        },  
        onrefresh(e) {  
            var tab = this.carteTab[this.currentTab];  
            if (!tab.refreshFlag) {  
                return;  
            }  
            tab.refreshing = true;  
            tab.refreshText = '正在刷新...';  
            tab.page = 1;  
            this.getList('refreshData');  
        },  
        onpullingdown(e) {  
            var tab = this.carteTab[this.currentTab];  
            console.log("=====")  
            console.log(e)  
            if (tab.refreshing || this.pulling) {  
                return;  
            }  
            if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {  
                tab.refreshFlag = true;  
                tab.refreshText = '释放立即刷新';  
            } else {  
                tab.refreshFlag = false;  
                tab.refreshText = '下拉可以刷新';  
            }  
        },  
        loadMore(e) {  
            let activeTab = this.nviewTab[this.tabBarsCurr];  
            activeTab.page = activeTab.page + 1;  
            this.getList(this.tabBarsCurr);  
        },  
        findShareResult(event) {  
            if (!this.hasLogin) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
                uni.navigateTo({  
                    url: '/pages/member/ucenter/signIn'  
                });  
                return false;  
            }  
            // 监听分享按钮  

            switch (event.type) {  
                case 'weixin':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxImage(shareData, this.shareResult);  
                    break;  
                case 'pengyouquan':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']],  
                        scene: 'WXSenceTimeline',  
                        title: selectInfo['val'].copy_comment || '我在' + selectInfo['val'].show_name +  
                            '发现了一款特价宝贝',  

                        href: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxContentImage(shareData, this.shareResult);  
                    break;  
                case 'saveImage':  
                    this.saveImageShare(selectInfo['urllist'][selectInfo['picIndex']]);  
                    break;  
                default:  
                    break;  
            }  
        },  
        shareResult(ret) {  
            console.log(ret);  
            uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            if (ret.code == 1) {  
                this.selectInfo = {};  
                uni.showToast({  
                    title: '分享成功',  
                    icon: 'success'  
                });  
            } else {  
                uni.showToast({  
                    title: '分享失败',  
                    icon: 'error'  
                });  
            }  
        },  
        saveImageShare(image, hideSub) {  
            if (hideSub == undefined) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            }  

            uni.showLoading({  
                title: '图片下载中...',  
                mask: true  
            });  
            selectInfo = null;  
            // 保存图片在本地 并分享  
            uni.downloadFile({  
                url: image,  
                success: res => {  
                    uni.hideLoading();  
                    if (res.statusCode == 200) {  
                        uni.saveImageToPhotosAlbum({  
                            filePath: res.tempFilePath,  
                            success: res => {  
                                uni.showToast({  
                                    title: '图片保存成功,赶快分享给好友吧~',  
                                    icon: 'none'  
                                });  
                            },  
                            fail: err => {  
                                uni.showToast({  
                                    title: 'emmm .. 图片保存失败',  
                                    icon: 'none'  
                                });  
                            }  
                        });  
                        console.log(res);  
                    } else {  
                        uni.showToast({  
                            title: '网络不佳...下载图片失败~',  
                            icon: 'none'  
                        });  
                    }  
                },  
                fail: error => {  
                    uni.hideLoading();  
                    uni.showToast({  
                        title: '网络不佳...下载图片失败~',  
                        icon: 'none'  
                    });  
                }  
            });  
        },  
        saveImage(event) {  
            console.log(event);  
        },  
        copyComment(e) {  
            // this.getGoodsInfo(e, 1,goods_type);  
            uni.setClipboardData({  
                data: e.content,  
                success: () => {  
                    uni.showToast({  
                        title: "复制成功"  
                    })  
                }  
            });  

        },  
        showShare(e) {  
            console.log(e, 'xxxx');  
            // this.getGoodsInfo(e, 0, goods_type);  

            uni.navigateTo({  
                url: '/pages/find/share_profits?data=' + encodeURIComponent(JSON.stringify(e))  
            });  

            // uni.getSubNVueById('findShare').show('slide-in-bottom');  
        },  
        async getGoodsInfo(goods_numiid, type, goods_type) {  
            console.log(goods_numiid)  
            const res = await request.post('items/info', {  
                itemid: goods_numiid,  
                goods_type: goods_type  
            });  
            if (res.code == 200) {  
                console.log(res)  
                var info = res.data.info;  

                console.log(info);  

                const detail = info;  
                this.detail = detail;  

                var spinChain = this.spinChain;  
                spinChain = await this.getSpinChainInfo(detail, type);  

                console.log(spinChain);  
                if (type == 0) {  
                    uni.navigateTo({  
                        url: `/pages/detail/share_profits?itemid=${goods_numiid}`  
                    });  
                }  

            } else {  
                console.log(res);  
                uni.showToast({  
                    title: res.msg || '获取商品详情失败',  
                    icon: 'none'  
                });  

            }  
        },  
        /**  
         * 商品转链  
         */  
        async getSpinChainInfo(detail, type) {  

            console.log(detail);  
            var post = {  
                itemid: detail.goods_numiid,  
                coupon_link: detail.coupon_link,  
                goods_type: detail.goods_type,  
                seller_id: detail.seller_id,  
                coupon_id: detail.coupon_id,  
                goods_picture: detail.goods_picture,  
                goods_title: detail.goods_title,  
                shopName: detail.shop_name,  
                uid: this.$store.state.openid  
            };  
            console.log(post);  
            helper.showLoading();  
            const res = await request.post('items/createBuyLink', post);  
            console.log(res);  
            helper.hideLoading();  
            if (res.code && res.code == 200) {  
                //return false;  
                detail.coupon_link = res.data.coupon_link;  
                detail.tbpwd = res.data.tbpwd;  
                detail.h5Url = res.data.shortUrl;  
                if (detail.goods_type == 3) {  
                    detail.h5Url = res.data.shortUrl;  
                    detail.coupon_link = res.data.shortUrl;  
                } else if (detail.goods_type == 4) {  
                    detail.coupon_link = res.data.open_weixin_app;  
                    detail.h5Url = res.data.open_weixin_app;  
                }  
                var userdata = this.$store.state.userinfo;  
                console.log(detail);  

                userdata.yqcode = this.$store.state.userinfo.yqcode;  

                var createWenan = helper.createWenan(userdata, detail);  
                console.log(detail);  
                var spinChain = {  
                    wenan: createWenan.goods.wenan,  
                    data: createWenan.goods.data  
                };  
                if (type == 1) {  
                    clipboard.setString(createWenan.goods.wenan);  
                    uni.showToast({  
                        title: '文案复制成功',  
                        icon: 'none'  
                    });  
                }  
                this.spinChain = spinChain;  
                console.log(res.data);  
                return res.data;  
            } else {  
                uni.showToast({  
                    title: res.msg || '口令生成失败 请稍后再试',  
                    icon: 'none'  
                });  
                return false;  
            }  
        },  
        previewImage(e) {  

            e.urllist.map(item => {  
                var hasHttp = item.substr(0, 7).toLowerCase();  
                if (hasHttp === 'http://') {  
                    return item;  
                }  
                var hasHttps = item.substr(0, 8).toLowerCase();  
                if (hasHttps === 'https://') {  
                    return item;  
                }  
                return 'http:' + item;  
            });  
            console.log(e);  
            selectInfo = e;  
            uni.previewImage({  
                urls: e.urllist,  
                current: e.picIndex,  
                loop: true,  
                longPressActions: {  
                    itemList: ['保存图片', '保存全部'],  
                    success: res => {  
                        if (res.tapIndex == 0) {  
                            this.saveImageShare(e.urllist[res.index], true);  
                        } else {  
                            e.urllist.forEach(item => {  
                                this.saveImageShare(item, true);  
                            });  
                        }  
                    }  
                }  
            });  
        }  
    }  
};  

</script>

<style>
.cp_tupian {
width: 350rpx;
border-radius: 10rpx;
}

.cp-biaoti {  
    font-size: 14px;  
    color: gray;  
    overflow: hidden;  
    white-space: nowrap;  
    text-overflow: ellipsis;  
}  

.cp-xiangmu {  
    width: 350rpx;  
    margin: 10rpx;  
    background-color: #FFFFFF;  
    box-sizing: border-box;  
    border-radius: 10rpx;  
}  

.cp-content {  
    justify-content: space-between;  
    margin: 0 auto;  
    text-align: center;  
    display: flex;  
    flex-direction: row;  
    flex-wrap: wrap;  
}  

/*分类*/  
.category-scroll {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  

    text-align: center;  
    width: 300rpx;  
}  

.category-tab-item-title {  
    width: 300rpx;  
    text-align: center;  
    color: #565656;  
    color: rgba(255, 255, 255, 0.65);  
    padding: 0 10rpx;  
    font-size: 32rpx;  
    height: 80rpx;  

    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.new-home-top-nav {  
    flex-direction: row;  
    flex-wrap: nowrap;  
    height: 80rpx;  
}  

.new-home-top-nav-move {  
    width: 100rpx;  
    text-align: center;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.new-home-top-nav-move-text {  
    width: 100rpx;  
    color: #de0101;  
    font-size: 34rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-weight: bold;  
    text-align: center;  
}  

.findTop {  
    position: fixed;  
    right: 20rpx;  
    bottom: 40rpx;  
    width: 80rpx;  
    height: 80rpx;  
    border-radius: 1000rpx;  
    text-align: center;  
    background-color: rgba(51, 51, 51, 0.7);  
}  

.findTop-text {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    text-align: center;  
    color: #ffffff;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  
    text-align: center;  
    width: 180rpx;  
}  

.category-tab-item-title {  
    width: 180rpx;  
    text-align: center;  
    color: #565656;  
    //color: rgba(255, 255, 255, 0.65);  
    font-size: 32rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.status-bar {  
    height: 50rpx;  
    flex: 1;  
    background-color: red;  
}  

.tabs {  
    flex: 1;  
    flex-direction: column;  
    overflow: hidden;  
    background-color: #f5f5f5;  
}  

.wrapper {  
    background-color: #ffffff;  
    flex-direction: column;  
    border-bottom-width: 1px;  
    border-bottom-style: solid;  
    border-bottom-color: #f6f6f6;  
}  

.nav {  
    width: 750rpx;  
    /*  flex: 1; */  
    height: 88rpx;  
    line-height: 88rpx;  
    justify-content: center;  
    align-items: center;  
}  

.title {  
    width: 540rpx;  
    justify-content: center;  
    flex-direction: row;  
    background-color: #f2f2f2;  
    border-radius: 50rpx;  
}  

.title-text {  
    width: 180rpx;  
    align-items: center;  
    color: #99a2a8;  
    padding-top: 10rpx;  
    padding-bottom: 10rpx;  
    font-size: 28rpx;  
    text-align: center;  
}  

.title-text-curr {  
    color: white;  
    border-radius: 50rpx;  
    background-color: #fa0000;  
}  

.s-tab-content {  
    width: 750px;  
    flex-direction: row;  
    flex: 1;  
}  

.tui-loading {  
    height: 60rpx;  
    width: 60rpx;  
    color: #999999;  
}  

.tui-refresh {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
    align-items: center;  
    justify-content: center;  
}  

.refresh-text {  
    text-align: center;  
    font-size: 26rpx;  
    color: #999999;  
}  

.swiper-box {  
    flex: 1;  
}  

.swiper-item {  
    flex: 1;  
    flex-direction: row;  
}  

.scroll-v {  
    flex: 1;  
    flex-direction: column;  
    width: 750rpx;  
}  

.head-image {  
    margin-left: 20rpx;  
}  

.head-content {  
    padding-left: 15rpx;  
}  

.share-btn {  
    background-color: #fceded;  
    padding: 7rpx 20rpx;  
    border-radius: 100rpx;  
}  

.share-btn-num {  
    font-size: 28rpx;  
    color: #fa0000;  
}  

.s-margins {  
    margin: 10rpx;  
}  

.find-head-content {  
    border-bottom-width: 2rpx;  
    border-bottom-style: dashed;  
    border-bottom-color: #f8f8f8;  
}  

.find-title-txt {  
    width: 750rpx;  
    text-overflow: ellipsis;  
    overflow: hidden;  
    font-size: 30rpx;  
    color: #333;  
}  

.find-title-txt-content {  
    width: 700rpx;  
    text-overflow: ellipsis;  
    line-height: 50rpx;  
    font-size: 28rpx;  
    color: #333333;  
}  

.find-txt-comment {  
    width: 700rpx;  
    background-color: #f7f7f7;  
    border-radius: 10rpx;  
    padding: 5rpx;  
}  

.find-txt-comment-richtext {  
    width: 690rpx;  
    background-color: #f7f7f7;  
    color: #666666;  
    font-size: 25rpx;  
}  

.copy-wenan-btn {  
    align-items: flex-end;  
    padding-bottom: 10rpx;  
    padding-right: 10rpx;  
}  

.copy-wenan-btn-text {  
    padding: 5rpx;  
    background-image: linear-gradient(to left, #f8e0dd, #f8e0dd);  
    color: #fa0000;  
    padding: 3rpx 10rpx;  
    border-radius: 10rpx;  
    width: 140rpx;  
    font-size: 23rpx;  
    text-align: center;  
}  

.goods_pictureItem {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItem_0 {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItemOne {  
    width: 380rpx;  
    height: 380rpx;  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.has-border {  
    border-width: 2rpx;  
    border-style: dashed;  
    border-color: #007aff;  
}  

.s-list-icons {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-list-icons1 {  
    width: 120rpx;  
    height: 120rpx;  
    margin-top: 20rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-ceil {  
    padding: 25rpx 0;  
    border-bottom-width: 1rpx;  
    border-bottom-style: solid;  
    border-bottom-color: #E9E9E9;  
    align-items: center;  
    flex-direction: row;  
    flex-wrap: nowrap;  
}  

.s-list-content {  
    flex: 1;  
    width: 700rpx;  
}  

</style>

操作步骤:
<template> <view class="tabs"> <view class="wrapper" elevation="2px"> <simpleStatusBar></simpleStatusBar> <view class="nav"> <view class="title"> <view v-for="(item, index) in nviewTab" :key="index" @click="tabBarsClick(index, item)"> <text class="title-text"

class="[tabBarsCurr == index ? 'title-text-curr' : '']">{{ item.title }}</text> </view>
</view>
</view>

</view>  

<view class="new-home-top-nav">  
    <scroll-view class="category-scroll" :scroll-left="navScorllLeft" scroll-direction="horizontal"  
show-scrollbar="false" :scroll-x="true"> <view class="category-tab-item" :ref="'navItem' + index" v-for="(item, index) in carteTab" :key="index" id="item.id" @click="ontabtap(index,item)"> <text class="category-tab-item-title"

class="currentTab == index ? 'category-tab-item-title-active' : ''">{{ item.title }}</text> </view>
</scroll-view>
</view>

<swiper :current="currentTab" class="swiper-box" :duration="300" @change="changSlider">  
    <swiper-item class="swiper-item" v-for="(tab, index1) in carteTab" :key="index1">  
        <list class="scroll-v list" scroll-y enableBackToTop="true" :show-scrollbar="false"  
            @scrolltolower="loadMore(index1)" scroll-with-animation enable-back-to-top  
            @loadmore="loadMore(index1)">  
            <cstRefresh @refresh="onrefresh(index1)" :ref="'swiperItemRef_' + index1"  

refreshing="tab.refreshing" @pullingdown="onpullingdown" :refreshText="tab.refreshText"> </cstRefresh>

            <cell class="" style="" v-if="tab.product.length > 0 &&tabBarsCurr==0">  
                <view class="cp-content">  
                    <view class="cp-xiangmu" v-for="(val, pindex) in tab.product" @click="showShare(val)">  
                        <image src="http://bgcdn.echoapp.cn/e9672f20b5313db5/60efc95eb2fe4d2a.jpg" class="cp_tupian"  
                            placeholder="/static/img/ic_default_placeholder.png"></image>  
                    </view>  
                </view>  

            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==1"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white" v-if="false">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons s-border-radius " src="/static/img/logo.png"></image>  
                        <view class="s-list-content head-content">  
                            <text class="is-size-14 s-bold">{{ val.show_name }}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{ val.show_time }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val.goods_numiid,1)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  
                <view class="s-margins s-border-radius-small s-bg-white">  

                    <!-- <view class="s-ceil s-padding goods_title"  
                        v-if="val.short_name != '' && val.short_name != null">  
                        <text class="find-title-txt">{{ val.short_name }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.circle_content }}</text>  
                    </view> -->  

                    <view class="s-ceil s-padding goods_title" v-if="val.picture && val.picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.picture"  

key="picIndex" @click="previewImage({ urllist: val['picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem" mode="widthFix"></image>
</view>

                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title" v-if="val.video">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card">  
                                <video :src="val.video" id="myVideo" class="video"  
                                    @timeupdate='video_time_update' :poster="val.cover"></video>  
                            </view>  
                        </view>  
                    </view>  

                    <view class="s-ceil s-padding s-body goods_title">  
                        <view class="find-txt-comment">  
                            <!-- 下单地址{点击复制文案后自动生成短网址} -->  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{val.content}}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding find-head-content">  
                        <image v-if="false" class="s-list-icons s-border-radius " src="/static/img/logo.png">  
                        </image>  
                        <view class="s-list-content head-content" v-if="false">  
                            <text  
                                class="is-size-14 s-bold">{{ val.shop_name ? val.shop_name : val.show_name ? val.show_name : '' }}</text>  
                            <text  
                                class="is-size-12 s-ellipsis s-black9">{{ val.update_time ? val.update_time : val.addtime }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheetVide(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                </view>  
            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==2"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons1  " :src="val.picture[0]" @click="toWeb(val.link)"></image>  
                        <view class="s-list-content head-content" @click="toWeb(val.link)">  
                            <text class="is-size-14 s-bold">{{val.content}}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{val.addtime}}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  

            </cell>  

            <cell class="tui-refresh">  

                <text class="refresh-text">{{ tab.loadingText }}</text>  
            </cell>  
        </list>  
    </swiper-item>  
</swiper>  
<uni-popup ref="popup" type="bottom">  
    <view  
        style="height: 250rpx;background-color: #FFFFFF;border-top-left-radius: 30rpx;border-top-right-radius: 30rpx;">  
        <view style="display: flex;flex-direction: row;justify-content: space-around;margin-top: 60rpx;" mode="widthFix">  
            <view style="margin: 0 auto;display: flex;align-items: center;" @click="shareWx">  
                <image src="../../static/icon_wechat.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享微信好友</text>  
            </view>  
            <view style="margin: 0 auto;display: flex;align-items: center;"  @click="sharePy">  
                <image src="../../static/icon_wechatpy.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享朋友圈</text>  
            </view>  
        </view>  
    </view>  
</uni-popup>  

</view>
</template>

<script>
import simpleStatusBar from '@/components/simple-pro/simple-statusBar.nvue';
import cstRefresh from '@/components/huahuasheng/nvue/hhs-refresh.nvue';
import vTabs from '@/components/v-tabs/v-tabs.vue';
import HttpRequest from '@/common/httpRequest.js';
import HttpCache from '@/common/cache.js';
var appHelper = getApp().globalData;
var request = appHelper.request;

import helper from '@/common/helper.js';  
var nviewTab = [];  
const clipboard = weex.requireModule('clipboard');  
const dom = weex.requireModule('dom');  
import share from '@/common/app-plus/simple-share.js';  
import {  
    mapState,  
    mapMutations  
} from 'vuex';  
let selectInfo = null;  
export default {  
    data() {  
        return {  
            navScorllLeft: 0,  
            video_time_update_status: true,  
            current: 0,  
            nviewTab: [{  
                    title: '海报',  
                    type: '0',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0 //0无效果 1加载中 2没有了  
                },  
                {  
                    title: '视频',  
                    type: '1',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                },  
                {  
                    title: '文章',  
                    type: '2',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                }  
            ],  
            tabBarsCurr: 0, //大分类  
            currentTab: 0, //小分类  
            pulling: false,  
            spinChain: {},  
            detail: {},  
            carteTab: [],  
            shareType: 1,  
            carteValue: 0, //小分类  
            shareValue:{},  
            type:0  
        };  
    },  
    computed: {  
        ...mapState(['hasLogin', 'userinfo', 'openid'])  
    },  
    components: {  
        simpleStatusBar,  
        cstRefresh,  
        vTabs  
    },  
    created() {  
        this.init();  
        uni.$on('find-share-popup', event => {  
            this.findShareResult(event);  
        });  
    },  
    destroyed() {  
        uni.$off('find-share-popup', function(data) {  
            console.log('移除 find-share-popup 自定义事件');  
        });  
    },  
    methods: {  
        // 播放进度变化时触发  
        shareWx(){  
            this.shareType =1  
            this.shareWxTo()  
        },  
        sharePy(){  
            this.shareType =2  
            this.shareWxTo()  
        },  
        showSheet(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =0  
            this.$refs.popup.open('top')  
        },  
        showSheetVide(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =1  
            this.$refs.popup.open('top')  
        },  

        video_time_update(e) {  
            // e.detail.duration 为视频总长度,在没有加载到视频的时候总长度为 -0.0001  
            // 当获取到视频长度后进入if  
            if (this.video_time_update_status && e.detail.duration > 0) {  
                // 第一次进入if 关闭更新状态,防止循环暂停  
                this.video_time_update_status = false;  
                // 获取视频  
                let videoContext = uni.createVideoContext('myVideo');  
                // 暂停视频  
                videoContext.pause();  
            }  
        },  
        toWeb(e) {  
            console.log(e)  
            uni.navigateTo({  
                url: "/pages/special/baoyang?url=" + e  
            })  
        },  
        shareWxTo() {  
            var e = this.shareValue  

            if(this.type==0){  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    })  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    });  
                }  
            }else{  
                console.log(this.shareType)  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                }  
            }  
        },  
        async ontabtap(index, item) {  
            console.log(item)  
            this.carteValue = item.id  
            this.currentTab = index  
            this.getList();  
        },  
        async init() {  
            console.log(222)  
            let {  
                data  
            } = await HttpRequest.post('find/cate', {  
                type: this.tabBarsCurr  
            });  
            // this.na  
            let arr = [];  
            data.forEach(item => {  
                arr.push({  
                    title: item.name,  
                    id: item.id,  
                    type: 'jd',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                })  
            });  
            this.carteTab = arr;  
            console.log(this.carteTab)  
            this.getList();  
        },  
        pageScrollTo() {  
            var ref = 'swiperItemRef_' + this.tabBarsCurr;  
            const el = this.$refs[ref];  
            dom.scrollToElement(el, {});  
        },  
        tabBarsClick(index) {  
            this.tabBarsCurr = index;  
            this.init();  
        },  
        switchTab(index) {  
            this.tabBarsCurr = index;  

            this.getList()  
            // if (this.nviewTab[index].product.length === 0) {  
            //  this.getList(index);  
            // }  
        },  
        changSlider(e) {  
            let index = e.target.current || e.detail.current;  
            this.currentTab = index  
            this.getList();  
            // this.switchTab(index);  

        },  
        async getList(type) {  
            let activeTab = this.carteTab[this.currentTab];  
            activeTab.loadingText = '数据加载中...';  
            try {  

                let param = {  
                    page: activeTab.page,  
                    cate_id: activeTab.id,  
                    type: this.tabBarsCurr  

                }  
                console.log(type)  
                console.log(param)  
                const result = await request.post('find/product_interest_circle', param);  
                console.log(result)  
                if (result.code == 200) {  
                    if (result.data.length > 0) {  
                        console.log(activeTab)  
                        activeTab.loadingText = '加载完成';  
                        if (activeTab.page == 1) {  
                            activeTab.product = result.data;  
                        } else {  
                            activeTab.product = activeTab.product.concat(result.data);  
                        }  
                    } else {  
                        activeTab.loadingText = '没有更多了';  
                    }  
                    console.log(this.carteTab)  
                } else {  
                    activeTab.loadingText = '没有更多了';  
                }  
            } catch (e) {  
                activeTab.loadingText = '网络繁忙';  
            }  
            if (type == 'refreshData') {  
                this.pulling = true;  
                activeTab.refreshing = false;  
                activeTab.refreshText = '已刷新';  
                setTimeout(() => {  
                    // TODO fix ios和Android 动画时间相反问题  
                    this.pulling = false;  
                }, 500);  
            }  
        },  
        onrefresh(e) {  
            var tab = this.carteTab[this.currentTab];  
            if (!tab.refreshFlag) {  
                return;  
            }  
            tab.refreshing = true;  
            tab.refreshText = '正在刷新...';  
            tab.page = 1;  
            this.getList('refreshData');  
        },  
        onpullingdown(e) {  
            var tab = this.carteTab[this.currentTab];  
            console.log("=====")  
            console.log(e)  
            if (tab.refreshing || this.pulling) {  
                return;  
            }  
            if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {  
                tab.refreshFlag = true;  
                tab.refreshText = '释放立即刷新';  
            } else {  
                tab.refreshFlag = false;  
                tab.refreshText = '下拉可以刷新';  
            }  
        },  
        loadMore(e) {  
            let activeTab = this.nviewTab[this.tabBarsCurr];  
            activeTab.page = activeTab.page + 1;  
            this.getList(this.tabBarsCurr);  
        },  
        findShareResult(event) {  
            if (!this.hasLogin) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
                uni.navigateTo({  
                    url: '/pages/member/ucenter/signIn'  
                });  
                return false;  
            }  
            // 监听分享按钮  

            switch (event.type) {  
                case 'weixin':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxImage(shareData, this.shareResult);  
                    break;  
                case 'pengyouquan':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']],  
                        scene: 'WXSenceTimeline',  
                        title: selectInfo['val'].copy_comment || '我在' + selectInfo['val'].show_name +  
                            '发现了一款特价宝贝',  

                        href: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxContentImage(shareData, this.shareResult);  
                    break;  
                case 'saveImage':  
                    this.saveImageShare(selectInfo['urllist'][selectInfo['picIndex']]);  
                    break;  
                default:  
                    break;  
            }  
        },  
        shareResult(ret) {  
            console.log(ret);  
            uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            if (ret.code == 1) {  
                this.selectInfo = {};  
                uni.showToast({  
                    title: '分享成功',  
                    icon: 'success'  
                });  
            } else {  
                uni.showToast({  
                    title: '分享失败',  
                    icon: 'error'  
                });  
            }  
        },  
        saveImageShare(image, hideSub) {  
            if (hideSub == undefined) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            }  

            uni.showLoading({  
                title: '图片下载中...',  
                mask: true  
            });  
            selectInfo = null;  
            // 保存图片在本地 并分享  
            uni.downloadFile({  
                url: image,  
                success: res => {  
                    uni.hideLoading();  
                    if (res.statusCode == 200) {  
                        uni.saveImageToPhotosAlbum({  
                            filePath: res.tempFilePath,  
                            success: res => {  
                                uni.showToast({  
                                    title: '图片保存成功,赶快分享给好友吧~',  
                                    icon: 'none'  
                                });  
                            },  
                            fail: err => {  
                                uni.showToast({  
                                    title: 'emmm .. 图片保存失败',  
                                    icon: 'none'  
                                });  
                            }  
                        });  
                        console.log(res);  
                    } else {  
                        uni.showToast({  
                            title: '网络不佳...下载图片失败~',  
                            icon: 'none'  
                        });  
                    }  
                },  
                fail: error => {  
                    uni.hideLoading();  
                    uni.showToast({  
                        title: '网络不佳...下载图片失败~',  
                        icon: 'none'  
                    });  
                }  
            });  
        },  
        saveImage(event) {  
            console.log(event);  
        },  
        copyComment(e) {  
            // this.getGoodsInfo(e, 1,goods_type);  
            uni.setClipboardData({  
                data: e.content,  
                success: () => {  
                    uni.showToast({  
                        title: "复制成功"  
                    })  
                }  
            });  

        },  
        showShare(e) {  
            console.log(e, 'xxxx');  
            // this.getGoodsInfo(e, 0, goods_type);  

            uni.navigateTo({  
                url: '/pages/find/share_profits?data=' + encodeURIComponent(JSON.stringify(e))  
            });  

            // uni.getSubNVueById('findShare').show('slide-in-bottom');  
        },  
        async getGoodsInfo(goods_numiid, type, goods_type) {  
            console.log(goods_numiid)  
            const res = await request.post('items/info', {  
                itemid: goods_numiid,  
                goods_type: goods_type  
            });  
            if (res.code == 200) {  
                console.log(res)  
                var info = res.data.info;  

                console.log(info);  

                const detail = info;  
                this.detail = detail;  

                var spinChain = this.spinChain;  
                spinChain = await this.getSpinChainInfo(detail, type);  

                console.log(spinChain);  
                if (type == 0) {  
                    uni.navigateTo({  
                        url: `/pages/detail/share_profits?itemid=${goods_numiid}`  
                    });  
                }  

            } else {  
                console.log(res);  
                uni.showToast({  
                    title: res.msg || '获取商品详情失败',  
                    icon: 'none'  
                });  

            }  
        },  
        /**  
         * 商品转链  
         */  
        async getSpinChainInfo(detail, type) {  

            console.log(detail);  
            var post = {  
                itemid: detail.goods_numiid,  
                coupon_link: detail.coupon_link,  
                goods_type: detail.goods_type,  
                seller_id: detail.seller_id,  
                coupon_id: detail.coupon_id,  
                goods_picture: detail.goods_picture,  
                goods_title: detail.goods_title,  
                shopName: detail.shop_name,  
                uid: this.$store.state.openid  
            };  
            console.log(post);  
            helper.showLoading();  
            const res = await request.post('items/createBuyLink', post);  
            console.log(res);  
            helper.hideLoading();  
            if (res.code && res.code == 200) {  
                //return false;  
                detail.coupon_link = res.data.coupon_link;  
                detail.tbpwd = res.data.tbpwd;  
                detail.h5Url = res.data.shortUrl;  
                if (detail.goods_type == 3) {  
                    detail.h5Url = res.data.shortUrl;  
                    detail.coupon_link = res.data.shortUrl;  
                } else if (detail.goods_type == 4) {  
                    detail.coupon_link = res.data.open_weixin_app;  
                    detail.h5Url = res.data.open_weixin_app;  
                }  
                var userdata = this.$store.state.userinfo;  
                console.log(detail);  

                userdata.yqcode = this.$store.state.userinfo.yqcode;  

                var createWenan = helper.createWenan(userdata, detail);  
                console.log(detail);  
                var spinChain = {  
                    wenan: createWenan.goods.wenan,  
                    data: createWenan.goods.data  
                };  
                if (type == 1) {  
                    clipboard.setString(createWenan.goods.wenan);  
                    uni.showToast({  
                        title: '文案复制成功',  
                        icon: 'none'  
                    });  
                }  
                this.spinChain = spinChain;  
                console.log(res.data);  
                return res.data;  
            } else {  
                uni.showToast({  
                    title: res.msg || '口令生成失败 请稍后再试',  
                    icon: 'none'  
                });  
                return false;  
            }  
        },  
        previewImage(e) {  

            e.urllist.map(item => {  
                var hasHttp = item.substr(0, 7).toLowerCase();  
                if (hasHttp === 'http://') {  
                    return item;  
                }  
                var hasHttps = item.substr(0, 8).toLowerCase();  
                if (hasHttps === 'https://') {  
                    return item;  
                }  
                return 'http:' + item;  
            });  
            console.log(e);  
            selectInfo = e;  
            uni.previewImage({  
                urls: e.urllist,  
                current: e.picIndex,  
                loop: true,  
                longPressActions: {  
                    itemList: ['保存图片', '保存全部'],  
                    success: res => {  
                        if (res.tapIndex == 0) {  
                            this.saveImageShare(e.urllist[res.index], true);  
                        } else {  
                            e.urllist.forEach(item => {  
                                this.saveImageShare(item, true);  
                            });  
                        }  
                    }  
                }  
            });  
        }  
    }  
};  

</script>

<style>
.cp_tupian {
width: 350rpx;
border-radius: 10rpx;
}

.cp-biaoti {  
    font-size: 14px;  
    color: gray;  
    overflow: hidden;  
    white-space: nowrap;  
    text-overflow: ellipsis;  
}  

.cp-xiangmu {  
    width: 350rpx;  
    margin: 10rpx;  
    background-color: #FFFFFF;  
    box-sizing: border-box;  
    border-radius: 10rpx;  
}  

.cp-content {  
    justify-content: space-between;  
    margin: 0 auto;  
    text-align: center;  
    display: flex;  
    flex-direction: row;  
    flex-wrap: wrap;  
}  

/*分类*/  
.category-scroll {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  

    text-align: center;  
    width: 300rpx;  
}  

.category-tab-item-title {  
    width: 300rpx;  
    text-align: center;  
    color: #565656;  
    color: rgba(255, 255, 255, 0.65);  
    padding: 0 10rpx;  
    font-size: 32rpx;  
    height: 80rpx;  

    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.new-home-top-nav {  
    flex-direction: row;  
    flex-wrap: nowrap;  
    height: 80rpx;  
}  

.new-home-top-nav-move {  
    width: 100rpx;  
    text-align: center;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.new-home-top-nav-move-text {  
    width: 100rpx;  
    color: #de0101;  
    font-size: 34rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-weight: bold;  
    text-align: center;  
}  

.findTop {  
    position: fixed;  
    right: 20rpx;  
    bottom: 40rpx;  
    width: 80rpx;  
    height: 80rpx;  
    border-radius: 1000rpx;  
    text-align: center;  
    background-color: rgba(51, 51, 51, 0.7);  
}  

.findTop-text {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    text-align: center;  
    color: #ffffff;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  
    text-align: center;  
    width: 180rpx;  
}  

.category-tab-item-title {  
    width: 180rpx;  
    text-align: center;  
    color: #565656;  
    //color: rgba(255, 255, 255, 0.65);  
    font-size: 32rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.status-bar {  
    height: 50rpx;  
    flex: 1;  
    background-color: red;  
}  

.tabs {  
    flex: 1;  
    flex-direction: column;  
    overflow: hidden;  
    background-color: #f5f5f5;  
}  

.wrapper {  
    background-color: #ffffff;  
    flex-direction: column;  
    border-bottom-width: 1px;  
    border-bottom-style: solid;  
    border-bottom-color: #f6f6f6;  
}  

.nav {  
    width: 750rpx;  
    /*  flex: 1; */  
    height: 88rpx;  
    line-height: 88rpx;  
    justify-content: center;  
    align-items: center;  
}  

.title {  
    width: 540rpx;  
    justify-content: center;  
    flex-direction: row;  
    background-color: #f2f2f2;  
    border-radius: 50rpx;  
}  

.title-text {  
    width: 180rpx;  
    align-items: center;  
    color: #99a2a8;  
    padding-top: 10rpx;  
    padding-bottom: 10rpx;  
    font-size: 28rpx;  
    text-align: center;  
}  

.title-text-curr {  
    color: white;  
    border-radius: 50rpx;  
    background-color: #fa0000;  
}  

.s-tab-content {  
    width: 750px;  
    flex-direction: row;  
    flex: 1;  
}  

.tui-loading {  
    height: 60rpx;  
    width: 60rpx;  
    color: #999999;  
}  

.tui-refresh {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
    align-items: center;  
    justify-content: center;  
}  

.refresh-text {  
    text-align: center;  
    font-size: 26rpx;  
    color: #999999;  
}  

.swiper-box {  
    flex: 1;  
}  

.swiper-item {  
    flex: 1;  
    flex-direction: row;  
}  

.scroll-v {  
    flex: 1;  
    flex-direction: column;  
    width: 750rpx;  
}  

.head-image {  
    margin-left: 20rpx;  
}  

.head-content {  
    padding-left: 15rpx;  
}  

.share-btn {  
    background-color: #fceded;  
    padding: 7rpx 20rpx;  
    border-radius: 100rpx;  
}  

.share-btn-num {  
    font-size: 28rpx;  
    color: #fa0000;  
}  

.s-margins {  
    margin: 10rpx;  
}  

.find-head-content {  
    border-bottom-width: 2rpx;  
    border-bottom-style: dashed;  
    border-bottom-color: #f8f8f8;  
}  

.find-title-txt {  
    width: 750rpx;  
    text-overflow: ellipsis;  
    overflow: hidden;  
    font-size: 30rpx;  
    color: #333;  
}  

.find-title-txt-content {  
    width: 700rpx;  
    text-overflow: ellipsis;  
    line-height: 50rpx;  
    font-size: 28rpx;  
    color: #333333;  
}  

.find-txt-comment {  
    width: 700rpx;  
    background-color: #f7f7f7;  
    border-radius: 10rpx;  
    padding: 5rpx;  
}  

.find-txt-comment-richtext {  
    width: 690rpx;  
    background-color: #f7f7f7;  
    color: #666666;  
    font-size: 25rpx;  
}  

.copy-wenan-btn {  
    align-items: flex-end;  
    padding-bottom: 10rpx;  
    padding-right: 10rpx;  
}  

.copy-wenan-btn-text {  
    padding: 5rpx;  
    background-image: linear-gradient(to left, #f8e0dd, #f8e0dd);  
    color: #fa0000;  
    padding: 3rpx 10rpx;  
    border-radius: 10rpx;  
    width: 140rpx;  
    font-size: 23rpx;  
    text-align: center;  
}  

.goods_pictureItem {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItem_0 {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItemOne {  
    width: 380rpx;  
    height: 380rpx;  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.has-border {  
    border-width: 2rpx;  
    border-style: dashed;  
    border-color: #007aff;  
}  

.s-list-icons {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-list-icons1 {  
    width: 120rpx;  
    height: 120rpx;  
    margin-top: 20rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-ceil {  
    padding: 25rpx 0;  
    border-bottom-width: 1rpx;  
    border-bottom-style: solid;  
    border-bottom-color: #E9E9E9;  
    align-items: center;  
    flex-direction: row;  
    flex-wrap: nowrap;  
}  

.s-list-content {  
    flex: 1;  
    width: 700rpx;  
}  

</style>

预期结果:
<template> <view class="tabs"> <view class="wrapper" elevation="2px"> <simpleStatusBar></simpleStatusBar> <view class="nav"> <view class="title"> <view v-for="(item, index) in nviewTab" :key="index" @click="tabBarsClick(index, item)"> <text class="title-text"

class="[tabBarsCurr == index ? 'title-text-curr' : '']">{{ item.title }}</text> </view>
</view>
</view>

</view>  

<view class="new-home-top-nav">  
    <scroll-view class="category-scroll" :scroll-left="navScorllLeft" scroll-direction="horizontal"  
show-scrollbar="false" :scroll-x="true"> <view class="category-tab-item" :ref="'navItem' + index" v-for="(item, index) in carteTab" :key="index" id="item.id" @click="ontabtap(index,item)"> <text class="category-tab-item-title"

class="currentTab == index ? 'category-tab-item-title-active' : ''">{{ item.title }}</text> </view>
</scroll-view>
</view>

<swiper :current="currentTab" class="swiper-box" :duration="300" @change="changSlider">  
    <swiper-item class="swiper-item" v-for="(tab, index1) in carteTab" :key="index1">  
        <list class="scroll-v list" scroll-y enableBackToTop="true" :show-scrollbar="false"  
            @scrolltolower="loadMore(index1)" scroll-with-animation enable-back-to-top  
            @loadmore="loadMore(index1)">  
            <cstRefresh @refresh="onrefresh(index1)" :ref="'swiperItemRef_' + index1"  

refreshing="tab.refreshing" @pullingdown="onpullingdown" :refreshText="tab.refreshText"> </cstRefresh>

            <cell class="" style="" v-if="tab.product.length > 0 &&tabBarsCurr==0">  
                <view class="cp-content">  
                    <view class="cp-xiangmu" v-for="(val, pindex) in tab.product" @click="showShare(val)">  
                        <image src="http://bgcdn.echoapp.cn/e9672f20b5313db5/60efc95eb2fe4d2a.jpg" class="cp_tupian"  
                            placeholder="/static/img/ic_default_placeholder.png"></image>  
                    </view>  
                </view>  

            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==1"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white" v-if="false">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons s-border-radius " src="/static/img/logo.png"></image>  
                        <view class="s-list-content head-content">  
                            <text class="is-size-14 s-bold">{{ val.show_name }}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{ val.show_time }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val.goods_numiid,1)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  
                <view class="s-margins s-border-radius-small s-bg-white">  

                    <!-- <view class="s-ceil s-padding goods_title"  
                        v-if="val.short_name != '' && val.short_name != null">  
                        <text class="find-title-txt">{{ val.short_name }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.circle_content }}</text>  
                    </view> -->  

                    <view class="s-ceil s-padding goods_title" v-if="val.picture && val.picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.picture"  

key="picIndex" @click="previewImage({ urllist: val['picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem" mode="widthFix"></image>
</view>

                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title" v-if="val.video">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card">  
                                <video :src="val.video" id="myVideo" class="video"  
                                    @timeupdate='video_time_update' :poster="val.cover"></video>  
                            </view>  
                        </view>  
                    </view>  

                    <view class="s-ceil s-padding s-body goods_title">  
                        <view class="find-txt-comment">  
                            <!-- 下单地址{点击复制文案后自动生成短网址} -->  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{val.content}}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding find-head-content">  
                        <image v-if="false" class="s-list-icons s-border-radius " src="/static/img/logo.png">  
                        </image>  
                        <view class="s-list-content head-content" v-if="false">  
                            <text  
                                class="is-size-14 s-bold">{{ val.shop_name ? val.shop_name : val.show_name ? val.show_name : '' }}</text>  
                            <text  
                                class="is-size-12 s-ellipsis s-black9">{{ val.update_time ? val.update_time : val.addtime }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheetVide(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                </view>  
            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==2"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons1  " :src="val.picture[0]" @click="toWeb(val.link)"></image>  
                        <view class="s-list-content head-content" @click="toWeb(val.link)">  
                            <text class="is-size-14 s-bold">{{val.content}}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{val.addtime}}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  

            </cell>  

            <cell class="tui-refresh">  

                <text class="refresh-text">{{ tab.loadingText }}</text>  
            </cell>  
        </list>  
    </swiper-item>  
</swiper>  
<uni-popup ref="popup" type="bottom">  
    <view  
        style="height: 250rpx;background-color: #FFFFFF;border-top-left-radius: 30rpx;border-top-right-radius: 30rpx;">  
        <view style="display: flex;flex-direction: row;justify-content: space-around;margin-top: 60rpx;" mode="widthFix">  
            <view style="margin: 0 auto;display: flex;align-items: center;" @click="shareWx">  
                <image src="../../static/icon_wechat.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享微信好友</text>  
            </view>  
            <view style="margin: 0 auto;display: flex;align-items: center;"  @click="sharePy">  
                <image src="../../static/icon_wechatpy.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享朋友圈</text>  
            </view>  
        </view>  
    </view>  
</uni-popup>  

</view>
</template>

<script>
import simpleStatusBar from '@/components/simple-pro/simple-statusBar.nvue';
import cstRefresh from '@/components/huahuasheng/nvue/hhs-refresh.nvue';
import vTabs from '@/components/v-tabs/v-tabs.vue';
import HttpRequest from '@/common/httpRequest.js';
import HttpCache from '@/common/cache.js';
var appHelper = getApp().globalData;
var request = appHelper.request;

import helper from '@/common/helper.js';  
var nviewTab = [];  
const clipboard = weex.requireModule('clipboard');  
const dom = weex.requireModule('dom');  
import share from '@/common/app-plus/simple-share.js';  
import {  
    mapState,  
    mapMutations  
} from 'vuex';  
let selectInfo = null;  
export default {  
    data() {  
        return {  
            navScorllLeft: 0,  
            video_time_update_status: true,  
            current: 0,  
            nviewTab: [{  
                    title: '海报',  
                    type: '0',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0 //0无效果 1加载中 2没有了  
                },  
                {  
                    title: '视频',  
                    type: '1',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                },  
                {  
                    title: '文章',  
                    type: '2',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                }  
            ],  
            tabBarsCurr: 0, //大分类  
            currentTab: 0, //小分类  
            pulling: false,  
            spinChain: {},  
            detail: {},  
            carteTab: [],  
            shareType: 1,  
            carteValue: 0, //小分类  
            shareValue:{},  
            type:0  
        };  
    },  
    computed: {  
        ...mapState(['hasLogin', 'userinfo', 'openid'])  
    },  
    components: {  
        simpleStatusBar,  
        cstRefresh,  
        vTabs  
    },  
    created() {  
        this.init();  
        uni.$on('find-share-popup', event => {  
            this.findShareResult(event);  
        });  
    },  
    destroyed() {  
        uni.$off('find-share-popup', function(data) {  
            console.log('移除 find-share-popup 自定义事件');  
        });  
    },  
    methods: {  
        // 播放进度变化时触发  
        shareWx(){  
            this.shareType =1  
            this.shareWxTo()  
        },  
        sharePy(){  
            this.shareType =2  
            this.shareWxTo()  
        },  
        showSheet(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =0  
            this.$refs.popup.open('top')  
        },  
        showSheetVide(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =1  
            this.$refs.popup.open('top')  
        },  

        video_time_update(e) {  
            // e.detail.duration 为视频总长度,在没有加载到视频的时候总长度为 -0.0001  
            // 当获取到视频长度后进入if  
            if (this.video_time_update_status && e.detail.duration > 0) {  
                // 第一次进入if 关闭更新状态,防止循环暂停  
                this.video_time_update_status = false;  
                // 获取视频  
                let videoContext = uni.createVideoContext('myVideo');  
                // 暂停视频  
                videoContext.pause();  
            }  
        },  
        toWeb(e) {  
            console.log(e)  
            uni.navigateTo({  
                url: "/pages/special/baoyang?url=" + e  
            })  
        },  
        shareWxTo() {  
            var e = this.shareValue  

            if(this.type==0){  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    })  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    });  
                }  
            }else{  
                console.log(this.shareType)  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                }  
            }  
        },  
        async ontabtap(index, item) {  
            console.log(item)  
            this.carteValue = item.id  
            this.currentTab = index  
            this.getList();  
        },  
        async init() {  
            console.log(222)  
            let {  
                data  
            } = await HttpRequest.post('find/cate', {  
                type: this.tabBarsCurr  
            });  
            // this.na  
            let arr = [];  
            data.forEach(item => {  
                arr.push({  
                    title: item.name,  
                    id: item.id,  
                    type: 'jd',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                })  
            });  
            this.carteTab = arr;  
            console.log(this.carteTab)  
            this.getList();  
        },  
        pageScrollTo() {  
            var ref = 'swiperItemRef_' + this.tabBarsCurr;  
            const el = this.$refs[ref];  
            dom.scrollToElement(el, {});  
        },  
        tabBarsClick(index) {  
            this.tabBarsCurr = index;  
            this.init();  
        },  
        switchTab(index) {  
            this.tabBarsCurr = index;  

            this.getList()  
            // if (this.nviewTab[index].product.length === 0) {  
            //  this.getList(index);  
            // }  
        },  
        changSlider(e) {  
            let index = e.target.current || e.detail.current;  
            this.currentTab = index  
            this.getList();  
            // this.switchTab(index);  

        },  
        async getList(type) {  
            let activeTab = this.carteTab[this.currentTab];  
            activeTab.loadingText = '数据加载中...';  
            try {  

                let param = {  
                    page: activeTab.page,  
                    cate_id: activeTab.id,  
                    type: this.tabBarsCurr  

                }  
                console.log(type)  
                console.log(param)  
                const result = await request.post('find/product_interest_circle', param);  
                console.log(result)  
                if (result.code == 200) {  
                    if (result.data.length > 0) {  
                        console.log(activeTab)  
                        activeTab.loadingText = '加载完成';  
                        if (activeTab.page == 1) {  
                            activeTab.product = result.data;  
                        } else {  
                            activeTab.product = activeTab.product.concat(result.data);  
                        }  
                    } else {  
                        activeTab.loadingText = '没有更多了';  
                    }  
                    console.log(this.carteTab)  
                } else {  
                    activeTab.loadingText = '没有更多了';  
                }  
            } catch (e) {  
                activeTab.loadingText = '网络繁忙';  
            }  
            if (type == 'refreshData') {  
                this.pulling = true;  
                activeTab.refreshing = false;  
                activeTab.refreshText = '已刷新';  
                setTimeout(() => {  
                    // TODO fix ios和Android 动画时间相反问题  
                    this.pulling = false;  
                }, 500);  
            }  
        },  
        onrefresh(e) {  
            var tab = this.carteTab[this.currentTab];  
            if (!tab.refreshFlag) {  
                return;  
            }  
            tab.refreshing = true;  
            tab.refreshText = '正在刷新...';  
            tab.page = 1;  
            this.getList('refreshData');  
        },  
        onpullingdown(e) {  
            var tab = this.carteTab[this.currentTab];  
            console.log("=====")  
            console.log(e)  
            if (tab.refreshing || this.pulling) {  
                return;  
            }  
            if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {  
                tab.refreshFlag = true;  
                tab.refreshText = '释放立即刷新';  
            } else {  
                tab.refreshFlag = false;  
                tab.refreshText = '下拉可以刷新';  
            }  
        },  
        loadMore(e) {  
            let activeTab = this.nviewTab[this.tabBarsCurr];  
            activeTab.page = activeTab.page + 1;  
            this.getList(this.tabBarsCurr);  
        },  
        findShareResult(event) {  
            if (!this.hasLogin) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
                uni.navigateTo({  
                    url: '/pages/member/ucenter/signIn'  
                });  
                return false;  
            }  
            // 监听分享按钮  

            switch (event.type) {  
                case 'weixin':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxImage(shareData, this.shareResult);  
                    break;  
                case 'pengyouquan':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']],  
                        scene: 'WXSenceTimeline',  
                        title: selectInfo['val'].copy_comment || '我在' + selectInfo['val'].show_name +  
                            '发现了一款特价宝贝',  

                        href: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxContentImage(shareData, this.shareResult);  
                    break;  
                case 'saveImage':  
                    this.saveImageShare(selectInfo['urllist'][selectInfo['picIndex']]);  
                    break;  
                default:  
                    break;  
            }  
        },  
        shareResult(ret) {  
            console.log(ret);  
            uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            if (ret.code == 1) {  
                this.selectInfo = {};  
                uni.showToast({  
                    title: '分享成功',  
                    icon: 'success'  
                });  
            } else {  
                uni.showToast({  
                    title: '分享失败',  
                    icon: 'error'  
                });  
            }  
        },  
        saveImageShare(image, hideSub) {  
            if (hideSub == undefined) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            }  

            uni.showLoading({  
                title: '图片下载中...',  
                mask: true  
            });  
            selectInfo = null;  
            // 保存图片在本地 并分享  
            uni.downloadFile({  
                url: image,  
                success: res => {  
                    uni.hideLoading();  
                    if (res.statusCode == 200) {  
                        uni.saveImageToPhotosAlbum({  
                            filePath: res.tempFilePath,  
                            success: res => {  
                                uni.showToast({  
                                    title: '图片保存成功,赶快分享给好友吧~',  
                                    icon: 'none'  
                                });  
                            },  
                            fail: err => {  
                                uni.showToast({  
                                    title: 'emmm .. 图片保存失败',  
                                    icon: 'none'  
                                });  
                            }  
                        });  
                        console.log(res);  
                    } else {  
                        uni.showToast({  
                            title: '网络不佳...下载图片失败~',  
                            icon: 'none'  
                        });  
                    }  
                },  
                fail: error => {  
                    uni.hideLoading();  
                    uni.showToast({  
                        title: '网络不佳...下载图片失败~',  
                        icon: 'none'  
                    });  
                }  
            });  
        },  
        saveImage(event) {  
            console.log(event);  
        },  
        copyComment(e) {  
            // this.getGoodsInfo(e, 1,goods_type);  
            uni.setClipboardData({  
                data: e.content,  
                success: () => {  
                    uni.showToast({  
                        title: "复制成功"  
                    })  
                }  
            });  

        },  
        showShare(e) {  
            console.log(e, 'xxxx');  
            // this.getGoodsInfo(e, 0, goods_type);  

            uni.navigateTo({  
                url: '/pages/find/share_profits?data=' + encodeURIComponent(JSON.stringify(e))  
            });  

            // uni.getSubNVueById('findShare').show('slide-in-bottom');  
        },  
        async getGoodsInfo(goods_numiid, type, goods_type) {  
            console.log(goods_numiid)  
            const res = await request.post('items/info', {  
                itemid: goods_numiid,  
                goods_type: goods_type  
            });  
            if (res.code == 200) {  
                console.log(res)  
                var info = res.data.info;  

                console.log(info);  

                const detail = info;  
                this.detail = detail;  

                var spinChain = this.spinChain;  
                spinChain = await this.getSpinChainInfo(detail, type);  

                console.log(spinChain);  
                if (type == 0) {  
                    uni.navigateTo({  
                        url: `/pages/detail/share_profits?itemid=${goods_numiid}`  
                    });  
                }  

            } else {  
                console.log(res);  
                uni.showToast({  
                    title: res.msg || '获取商品详情失败',  
                    icon: 'none'  
                });  

            }  
        },  
        /**  
         * 商品转链  
         */  
        async getSpinChainInfo(detail, type) {  

            console.log(detail);  
            var post = {  
                itemid: detail.goods_numiid,  
                coupon_link: detail.coupon_link,  
                goods_type: detail.goods_type,  
                seller_id: detail.seller_id,  
                coupon_id: detail.coupon_id,  
                goods_picture: detail.goods_picture,  
                goods_title: detail.goods_title,  
                shopName: detail.shop_name,  
                uid: this.$store.state.openid  
            };  
            console.log(post);  
            helper.showLoading();  
            const res = await request.post('items/createBuyLink', post);  
            console.log(res);  
            helper.hideLoading();  
            if (res.code && res.code == 200) {  
                //return false;  
                detail.coupon_link = res.data.coupon_link;  
                detail.tbpwd = res.data.tbpwd;  
                detail.h5Url = res.data.shortUrl;  
                if (detail.goods_type == 3) {  
                    detail.h5Url = res.data.shortUrl;  
                    detail.coupon_link = res.data.shortUrl;  
                } else if (detail.goods_type == 4) {  
                    detail.coupon_link = res.data.open_weixin_app;  
                    detail.h5Url = res.data.open_weixin_app;  
                }  
                var userdata = this.$store.state.userinfo;  
                console.log(detail);  

                userdata.yqcode = this.$store.state.userinfo.yqcode;  

                var createWenan = helper.createWenan(userdata, detail);  
                console.log(detail);  
                var spinChain = {  
                    wenan: createWenan.goods.wenan,  
                    data: createWenan.goods.data  
                };  
                if (type == 1) {  
                    clipboard.setString(createWenan.goods.wenan);  
                    uni.showToast({  
                        title: '文案复制成功',  
                        icon: 'none'  
                    });  
                }  
                this.spinChain = spinChain;  
                console.log(res.data);  
                return res.data;  
            } else {  
                uni.showToast({  
                    title: res.msg || '口令生成失败 请稍后再试',  
                    icon: 'none'  
                });  
                return false;  
            }  
        },  
        previewImage(e) {  

            e.urllist.map(item => {  
                var hasHttp = item.substr(0, 7).toLowerCase();  
                if (hasHttp === 'http://') {  
                    return item;  
                }  
                var hasHttps = item.substr(0, 8).toLowerCase();  
                if (hasHttps === 'https://') {  
                    return item;  
                }  
                return 'http:' + item;  
            });  
            console.log(e);  
            selectInfo = e;  
            uni.previewImage({  
                urls: e.urllist,  
                current: e.picIndex,  
                loop: true,  
                longPressActions: {  
                    itemList: ['保存图片', '保存全部'],  
                    success: res => {  
                        if (res.tapIndex == 0) {  
                            this.saveImageShare(e.urllist[res.index], true);  
                        } else {  
                            e.urllist.forEach(item => {  
                                this.saveImageShare(item, true);  
                            });  
                        }  
                    }  
                }  
            });  
        }  
    }  
};  

</script>

<style>
.cp_tupian {
width: 350rpx;
border-radius: 10rpx;
}

.cp-biaoti {  
    font-size: 14px;  
    color: gray;  
    overflow: hidden;  
    white-space: nowrap;  
    text-overflow: ellipsis;  
}  

.cp-xiangmu {  
    width: 350rpx;  
    margin: 10rpx;  
    background-color: #FFFFFF;  
    box-sizing: border-box;  
    border-radius: 10rpx;  
}  

.cp-content {  
    justify-content: space-between;  
    margin: 0 auto;  
    text-align: center;  
    display: flex;  
    flex-direction: row;  
    flex-wrap: wrap;  
}  

/*分类*/  
.category-scroll {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  

    text-align: center;  
    width: 300rpx;  
}  

.category-tab-item-title {  
    width: 300rpx;  
    text-align: center;  
    color: #565656;  
    color: rgba(255, 255, 255, 0.65);  
    padding: 0 10rpx;  
    font-size: 32rpx;  
    height: 80rpx;  

    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.new-home-top-nav {  
    flex-direction: row;  
    flex-wrap: nowrap;  
    height: 80rpx;  
}  

.new-home-top-nav-move {  
    width: 100rpx;  
    text-align: center;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.new-home-top-nav-move-text {  
    width: 100rpx;  
    color: #de0101;  
    font-size: 34rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-weight: bold;  
    text-align: center;  
}  

.findTop {  
    position: fixed;  
    right: 20rpx;  
    bottom: 40rpx;  
    width: 80rpx;  
    height: 80rpx;  
    border-radius: 1000rpx;  
    text-align: center;  
    background-color: rgba(51, 51, 51, 0.7);  
}  

.findTop-text {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    text-align: center;  
    color: #ffffff;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  
    text-align: center;  
    width: 180rpx;  
}  

.category-tab-item-title {  
    width: 180rpx;  
    text-align: center;  
    color: #565656;  
    //color: rgba(255, 255, 255, 0.65);  
    font-size: 32rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.status-bar {  
    height: 50rpx;  
    flex: 1;  
    background-color: red;  
}  

.tabs {  
    flex: 1;  
    flex-direction: column;  
    overflow: hidden;  
    background-color: #f5f5f5;  
}  

.wrapper {  
    background-color: #ffffff;  
    flex-direction: column;  
    border-bottom-width: 1px;  
    border-bottom-style: solid;  
    border-bottom-color: #f6f6f6;  
}  

.nav {  
    width: 750rpx;  
    /*  flex: 1; */  
    height: 88rpx;  
    line-height: 88rpx;  
    justify-content: center;  
    align-items: center;  
}  

.title {  
    width: 540rpx;  
    justify-content: center;  
    flex-direction: row;  
    background-color: #f2f2f2;  
    border-radius: 50rpx;  
}  

.title-text {  
    width: 180rpx;  
    align-items: center;  
    color: #99a2a8;  
    padding-top: 10rpx;  
    padding-bottom: 10rpx;  
    font-size: 28rpx;  
    text-align: center;  
}  

.title-text-curr {  
    color: white;  
    border-radius: 50rpx;  
    background-color: #fa0000;  
}  

.s-tab-content {  
    width: 750px;  
    flex-direction: row;  
    flex: 1;  
}  

.tui-loading {  
    height: 60rpx;  
    width: 60rpx;  
    color: #999999;  
}  

.tui-refresh {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
    align-items: center;  
    justify-content: center;  
}  

.refresh-text {  
    text-align: center;  
    font-size: 26rpx;  
    color: #999999;  
}  

.swiper-box {  
    flex: 1;  
}  

.swiper-item {  
    flex: 1;  
    flex-direction: row;  
}  

.scroll-v {  
    flex: 1;  
    flex-direction: column;  
    width: 750rpx;  
}  

.head-image {  
    margin-left: 20rpx;  
}  

.head-content {  
    padding-left: 15rpx;  
}  

.share-btn {  
    background-color: #fceded;  
    padding: 7rpx 20rpx;  
    border-radius: 100rpx;  
}  

.share-btn-num {  
    font-size: 28rpx;  
    color: #fa0000;  
}  

.s-margins {  
    margin: 10rpx;  
}  

.find-head-content {  
    border-bottom-width: 2rpx;  
    border-bottom-style: dashed;  
    border-bottom-color: #f8f8f8;  
}  

.find-title-txt {  
    width: 750rpx;  
    text-overflow: ellipsis;  
    overflow: hidden;  
    font-size: 30rpx;  
    color: #333;  
}  

.find-title-txt-content {  
    width: 700rpx;  
    text-overflow: ellipsis;  
    line-height: 50rpx;  
    font-size: 28rpx;  
    color: #333333;  
}  

.find-txt-comment {  
    width: 700rpx;  
    background-color: #f7f7f7;  
    border-radius: 10rpx;  
    padding: 5rpx;  
}  

.find-txt-comment-richtext {  
    width: 690rpx;  
    background-color: #f7f7f7;  
    color: #666666;  
    font-size: 25rpx;  
}  

.copy-wenan-btn {  
    align-items: flex-end;  
    padding-bottom: 10rpx;  
    padding-right: 10rpx;  
}  

.copy-wenan-btn-text {  
    padding: 5rpx;  
    background-image: linear-gradient(to left, #f8e0dd, #f8e0dd);  
    color: #fa0000;  
    padding: 3rpx 10rpx;  
    border-radius: 10rpx;  
    width: 140rpx;  
    font-size: 23rpx;  
    text-align: center;  
}  

.goods_pictureItem {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItem_0 {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItemOne {  
    width: 380rpx;  
    height: 380rpx;  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.has-border {  
    border-width: 2rpx;  
    border-style: dashed;  
    border-color: #007aff;  
}  

.s-list-icons {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-list-icons1 {  
    width: 120rpx;  
    height: 120rpx;  
    margin-top: 20rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-ceil {  
    padding: 25rpx 0;  
    border-bottom-width: 1rpx;  
    border-bottom-style: solid;  
    border-bottom-color: #E9E9E9;  
    align-items: center;  
    flex-direction: row;  
    flex-wrap: nowrap;  
}  

.s-list-content {  
    flex: 1;  
    width: 700rpx;  
}  

</style>

实际结果:
<template> <view class="tabs"> <view class="wrapper" elevation="2px"> <simpleStatusBar></simpleStatusBar> <view class="nav"> <view class="title"> <view v-for="(item, index) in nviewTab" :key="index" @click="tabBarsClick(index, item)"> <text class="title-text"

class="[tabBarsCurr == index ? 'title-text-curr' : '']">{{ item.title }}</text> </view>
</view>
</view>

</view>  

<view class="new-home-top-nav">  
    <scroll-view class="category-scroll" :scroll-left="navScorllLeft" scroll-direction="horizontal"  
show-scrollbar="false" :scroll-x="true"> <view class="category-tab-item" :ref="'navItem' + index" v-for="(item, index) in carteTab" :key="index" id="item.id" @click="ontabtap(index,item)"> <text class="category-tab-item-title"

class="currentTab == index ? 'category-tab-item-title-active' : ''">{{ item.title }}</text> </view>
</scroll-view>
</view>

<swiper :current="currentTab" class="swiper-box" :duration="300" @change="changSlider">  
    <swiper-item class="swiper-item" v-for="(tab, index1) in carteTab" :key="index1">  
        <list class="scroll-v list" scroll-y enableBackToTop="true" :show-scrollbar="false"  
            @scrolltolower="loadMore(index1)" scroll-with-animation enable-back-to-top  
            @loadmore="loadMore(index1)">  
            <cstRefresh @refresh="onrefresh(index1)" :ref="'swiperItemRef_' + index1"  

refreshing="tab.refreshing" @pullingdown="onpullingdown" :refreshText="tab.refreshText"> </cstRefresh>

            <cell class="" style="" v-if="tab.product.length > 0 &&tabBarsCurr==0">  
                <view class="cp-content">  
                    <view class="cp-xiangmu" v-for="(val, pindex) in tab.product" @click="showShare(val)">  
                        <image src="http://bgcdn.echoapp.cn/e9672f20b5313db5/60efc95eb2fe4d2a.jpg" class="cp_tupian"  
                            placeholder="/static/img/ic_default_placeholder.png"></image>  
                    </view>  
                </view>  

            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==1"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white" v-if="false">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons s-border-radius " src="/static/img/logo.png"></image>  
                        <view class="s-list-content head-content">  
                            <text class="is-size-14 s-bold">{{ val.show_name }}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{ val.show_time }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val.goods_numiid,1)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  
                <view class="s-margins s-border-radius-small s-bg-white">  

                    <!-- <view class="s-ceil s-padding goods_title"  
                        v-if="val.short_name != '' && val.short_name != null">  
                        <text class="find-title-txt">{{ val.short_name }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.circle_content }}</text>  
                    </view> -->  

                    <view class="s-ceil s-padding goods_title" v-if="val.picture && val.picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.picture"  

key="picIndex" @click="previewImage({ urllist: val['picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem" mode="widthFix"></image>
</view>

                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title" v-if="val.video">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card">  
                                <video :src="val.video" id="myVideo" class="video"  
                                    @timeupdate='video_time_update' :poster="val.cover"></video>  
                            </view>  
                        </view>  
                    </view>  

                    <view class="s-ceil s-padding s-body goods_title">  
                        <view class="find-txt-comment">  
                            <!-- 下单地址{点击复制文案后自动生成短网址} -->  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{val.content}}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding find-head-content">  
                        <image v-if="false" class="s-list-icons s-border-radius " src="/static/img/logo.png">  
                        </image>  
                        <view class="s-list-content head-content" v-if="false">  
                            <text  
                                class="is-size-14 s-bold">{{ val.shop_name ? val.shop_name : val.show_name ? val.show_name : '' }}</text>  
                            <text  
                                class="is-size-12 s-ellipsis s-black9">{{ val.update_time ? val.update_time : val.addtime }}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheetVide(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                </view>  
            </cell>  
            <cell class="s-page-wrapper" v-if="tab.product.length > 0 &&tabBarsCurr==2"  
                v-for="(val, pindex) in tab.product" :key="pindex">  
                <view class="s-margins s-border-radius-small s-bg-white">  
                    <view class="s-ceil s-padding find-head-content">  
                        <image class="s-list-icons1  " :src="val.picture[0]" @click="toWeb(val.link)"></image>  
                        <view class="s-list-content head-content" @click="toWeb(val.link)">  
                            <text class="is-size-14 s-bold">{{val.content}}</text>  
                            <text class="is-size-12 s-ellipsis s-black9">{{val.addtime}}</text>  
                        </view>  
                        <view class="share-btn" @click="showSheet(val)">  
                            <text class="share-btn-num cs-iconfont">&#xe7e7;一键分享</text>  
                        </view>  
                    </view>  
                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_title != '' && val.goods_title != null">  
                        <text class="find-title-txt">{{ val.goods_title }}</text>  
                    </view>  
                    <view class="s-ceil s-padding  goods_title">  
                        <text class="find-title-txt-content">{{ val.copy_content }}</text>  
                    </view>  

                    <view class="s-ceil s-padding goods_title"  
                        v-if="val.goods_picture && val.goods_picture.length > 0">  
                        <view class="s-rows s-wrap s-body">  
                            <view class="goods_picture-card" v-for="(picItem, picIndex) in val.goods_picture"  

key="picIndex" @click="previewImage({ urllist: val['goods_picture'], picIndex: picIndex, val: val })">
<image :src="picItem" class="goods_pictureItem"
placeholder="/static/img/ic_default_placeholder_220.png"></image>
</view>
</view>
</view>

                    <view class="s-ceil s-padding s-body goods_title" v-if="val.copy_comment">  
                        <view class="find-txt-comment">  
                            <text  
                                class="find-title-txt-content find-txt-comment-richtext">{{ val.copy_comment }}</text>  
                            <view class="copy-wenan-btn"><text class="copy-wenan-btn-text cs-iconfont"  
                                    @click="copyComment(val.goods_numiid,1)">&#xe618;复制文案</text></view>  
                        </view>  
                    </view>  
                </view>  

            </cell>  

            <cell class="tui-refresh">  

                <text class="refresh-text">{{ tab.loadingText }}</text>  
            </cell>  
        </list>  
    </swiper-item>  
</swiper>  
<uni-popup ref="popup" type="bottom">  
    <view  
        style="height: 250rpx;background-color: #FFFFFF;border-top-left-radius: 30rpx;border-top-right-radius: 30rpx;">  
        <view style="display: flex;flex-direction: row;justify-content: space-around;margin-top: 60rpx;" mode="widthFix">  
            <view style="margin: 0 auto;display: flex;align-items: center;" @click="shareWx">  
                <image src="../../static/icon_wechat.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享微信好友</text>  
            </view>  
            <view style="margin: 0 auto;display: flex;align-items: center;"  @click="sharePy">  
                <image src="../../static/icon_wechatpy.png" style="width: 100rpx;" mode="widthFix"></image>  
                <text style="color: #666666;font-size: 28rpx;margin-top: 8rpx;">分享朋友圈</text>  
            </view>  
        </view>  
    </view>  
</uni-popup>  

</view>
</template>

<script>
import simpleStatusBar from '@/components/simple-pro/simple-statusBar.nvue';
import cstRefresh from '@/components/huahuasheng/nvue/hhs-refresh.nvue';
import vTabs from '@/components/v-tabs/v-tabs.vue';
import HttpRequest from '@/common/httpRequest.js';
import HttpCache from '@/common/cache.js';
var appHelper = getApp().globalData;
var request = appHelper.request;

import helper from '@/common/helper.js';  
var nviewTab = [];  
const clipboard = weex.requireModule('clipboard');  
const dom = weex.requireModule('dom');  
import share from '@/common/app-plus/simple-share.js';  
import {  
    mapState,  
    mapMutations  
} from 'vuex';  
let selectInfo = null;  
export default {  
    data() {  
        return {  
            navScorllLeft: 0,  
            video_time_update_status: true,  
            current: 0,  
            nviewTab: [{  
                    title: '海报',  
                    type: '0',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0 //0无效果 1加载中 2没有了  
                },  
                {  
                    title: '视频',  
                    type: '1',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                },  
                {  
                    title: '文章',  
                    type: '2',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                }  
            ],  
            tabBarsCurr: 0, //大分类  
            currentTab: 0, //小分类  
            pulling: false,  
            spinChain: {},  
            detail: {},  
            carteTab: [],  
            shareType: 1,  
            carteValue: 0, //小分类  
            shareValue:{},  
            type:0  
        };  
    },  
    computed: {  
        ...mapState(['hasLogin', 'userinfo', 'openid'])  
    },  
    components: {  
        simpleStatusBar,  
        cstRefresh,  
        vTabs  
    },  
    created() {  
        this.init();  
        uni.$on('find-share-popup', event => {  
            this.findShareResult(event);  
        });  
    },  
    destroyed() {  
        uni.$off('find-share-popup', function(data) {  
            console.log('移除 find-share-popup 自定义事件');  
        });  
    },  
    methods: {  
        // 播放进度变化时触发  
        shareWx(){  
            this.shareType =1  
            this.shareWxTo()  
        },  
        sharePy(){  
            this.shareType =2  
            this.shareWxTo()  
        },  
        showSheet(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =0  
            this.$refs.popup.open('top')  
        },  
        showSheetVide(e) {  
            console.log(e)  
            this.shareValue  = e  
            this.type =1  
            this.$refs.popup.open('top')  
        },  

        video_time_update(e) {  
            // e.detail.duration 为视频总长度,在没有加载到视频的时候总长度为 -0.0001  
            // 当获取到视频长度后进入if  
            if (this.video_time_update_status && e.detail.duration > 0) {  
                // 第一次进入if 关闭更新状态,防止循环暂停  
                this.video_time_update_status = false;  
                // 获取视频  
                let videoContext = uni.createVideoContext('myVideo');  
                // 暂停视频  
                videoContext.pause();  
            }  
        },  
        toWeb(e) {  
            console.log(e)  
            uni.navigateTo({  
                url: "/pages/special/baoyang?url=" + e  
            })  
        },  
        shareWxTo() {  
            var e = this.shareValue  

            if(this.type==0){  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    })  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 0,  
                        href: e.link,  
                        title: e.content,  
                        summary: e.content,  
                        imageUrl: e.picture[0],  
                        success: function(res) {  
                            console.log("success:" + JSON.stringify(res));  
                        },  
                        fail: function(err) {  
                            console.log("fail:" + JSON.stringify(err));  
                        }  
                    });  
                }  
            }else{  
                console.log(this.shareType)  
                if (this.shareType == 1) {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneSession",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                } else {  
                    uni.share({  
                        provider: "weixin",  
                        scene: "WXSceneTimeline",  
                        type: 4,  
                        title: e.content,  
                        mediaUrl: e.video,  
                        success: function(res) {  
                            console.log(res)  
                        },  
                        fail: function(err) {  
                            console.log(err)  
                        }  
                    });  
                }  
            }  
        },  
        async ontabtap(index, item) {  
            console.log(item)  
            this.carteValue = item.id  
            this.currentTab = index  
            this.getList();  
        },  
        async init() {  
            console.log(222)  
            let {  
                data  
            } = await HttpRequest.post('find/cate', {  
                type: this.tabBarsCurr  
            });  
            // this.na  
            let arr = [];  
            data.forEach(item => {  
                arr.push({  
                    title: item.name,  
                    id: item.id,  
                    type: 'jd',  
                    product: [], // 存放数据  
                    showView: 'default',  
                    refreshing: false,  
                    refreshText: '下拉可以刷新',  
                    loadingText: '加载中...',  
                    page: 1,  
                    limit: 10,  
                    isLoading: 0  
                })  
            });  
            this.carteTab = arr;  
            console.log(this.carteTab)  
            this.getList();  
        },  
        pageScrollTo() {  
            var ref = 'swiperItemRef_' + this.tabBarsCurr;  
            const el = this.$refs[ref];  
            dom.scrollToElement(el, {});  
        },  
        tabBarsClick(index) {  
            this.tabBarsCurr = index;  
            this.init();  
        },  
        switchTab(index) {  
            this.tabBarsCurr = index;  

            this.getList()  
            // if (this.nviewTab[index].product.length === 0) {  
            //  this.getList(index);  
            // }  
        },  
        changSlider(e) {  
            let index = e.target.current || e.detail.current;  
            this.currentTab = index  
            this.getList();  
            // this.switchTab(index);  

        },  
        async getList(type) {  
            let activeTab = this.carteTab[this.currentTab];  
            activeTab.loadingText = '数据加载中...';  
            try {  

                let param = {  
                    page: activeTab.page,  
                    cate_id: activeTab.id,  
                    type: this.tabBarsCurr  

                }  
                console.log(type)  
                console.log(param)  
                const result = await request.post('find/product_interest_circle', param);  
                console.log(result)  
                if (result.code == 200) {  
                    if (result.data.length > 0) {  
                        console.log(activeTab)  
                        activeTab.loadingText = '加载完成';  
                        if (activeTab.page == 1) {  
                            activeTab.product = result.data;  
                        } else {  
                            activeTab.product = activeTab.product.concat(result.data);  
                        }  
                    } else {  
                        activeTab.loadingText = '没有更多了';  
                    }  
                    console.log(this.carteTab)  
                } else {  
                    activeTab.loadingText = '没有更多了';  
                }  
            } catch (e) {  
                activeTab.loadingText = '网络繁忙';  
            }  
            if (type == 'refreshData') {  
                this.pulling = true;  
                activeTab.refreshing = false;  
                activeTab.refreshText = '已刷新';  
                setTimeout(() => {  
                    // TODO fix ios和Android 动画时间相反问题  
                    this.pulling = false;  
                }, 500);  
            }  
        },  
        onrefresh(e) {  
            var tab = this.carteTab[this.currentTab];  
            if (!tab.refreshFlag) {  
                return;  
            }  
            tab.refreshing = true;  
            tab.refreshText = '正在刷新...';  
            tab.page = 1;  
            this.getList('refreshData');  
        },  
        onpullingdown(e) {  
            var tab = this.carteTab[this.currentTab];  
            console.log("=====")  
            console.log(e)  
            if (tab.refreshing || this.pulling) {  
                return;  
            }  
            if (Math.abs(e.pullingDistance) > Math.abs(e.viewHeight)) {  
                tab.refreshFlag = true;  
                tab.refreshText = '释放立即刷新';  
            } else {  
                tab.refreshFlag = false;  
                tab.refreshText = '下拉可以刷新';  
            }  
        },  
        loadMore(e) {  
            let activeTab = this.nviewTab[this.tabBarsCurr];  
            activeTab.page = activeTab.page + 1;  
            this.getList(this.tabBarsCurr);  
        },  
        findShareResult(event) {  
            if (!this.hasLogin) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
                uni.navigateTo({  
                    url: '/pages/member/ucenter/signIn'  
                });  
                return false;  
            }  
            // 监听分享按钮  

            switch (event.type) {  
                case 'weixin':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxImage(shareData, this.shareResult);  
                    break;  
                case 'pengyouquan':  
                    var shareData = {  
                        imageUrl: selectInfo['urllist'][selectInfo['picIndex']],  
                        scene: 'WXSenceTimeline',  
                        title: selectInfo['val'].copy_comment || '我在' + selectInfo['val'].show_name +  
                            '发现了一款特价宝贝',  

                        href: selectInfo['urllist'][selectInfo['picIndex']]  
                    };  
                    share.wxContentImage(shareData, this.shareResult);  
                    break;  
                case 'saveImage':  
                    this.saveImageShare(selectInfo['urllist'][selectInfo['picIndex']]);  
                    break;  
                default:  
                    break;  
            }  
        },  
        shareResult(ret) {  
            console.log(ret);  
            uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            if (ret.code == 1) {  
                this.selectInfo = {};  
                uni.showToast({  
                    title: '分享成功',  
                    icon: 'success'  
                });  
            } else {  
                uni.showToast({  
                    title: '分享失败',  
                    icon: 'error'  
                });  
            }  
        },  
        saveImageShare(image, hideSub) {  
            if (hideSub == undefined) {  
                uni.getSubNVueById('findShare').hide('slide-out-bottom');  
            }  

            uni.showLoading({  
                title: '图片下载中...',  
                mask: true  
            });  
            selectInfo = null;  
            // 保存图片在本地 并分享  
            uni.downloadFile({  
                url: image,  
                success: res => {  
                    uni.hideLoading();  
                    if (res.statusCode == 200) {  
                        uni.saveImageToPhotosAlbum({  
                            filePath: res.tempFilePath,  
                            success: res => {  
                                uni.showToast({  
                                    title: '图片保存成功,赶快分享给好友吧~',  
                                    icon: 'none'  
                                });  
                            },  
                            fail: err => {  
                                uni.showToast({  
                                    title: 'emmm .. 图片保存失败',  
                                    icon: 'none'  
                                });  
                            }  
                        });  
                        console.log(res);  
                    } else {  
                        uni.showToast({  
                            title: '网络不佳...下载图片失败~',  
                            icon: 'none'  
                        });  
                    }  
                },  
                fail: error => {  
                    uni.hideLoading();  
                    uni.showToast({  
                        title: '网络不佳...下载图片失败~',  
                        icon: 'none'  
                    });  
                }  
            });  
        },  
        saveImage(event) {  
            console.log(event);  
        },  
        copyComment(e) {  
            // this.getGoodsInfo(e, 1,goods_type);  
            uni.setClipboardData({  
                data: e.content,  
                success: () => {  
                    uni.showToast({  
                        title: "复制成功"  
                    })  
                }  
            });  

        },  
        showShare(e) {  
            console.log(e, 'xxxx');  
            // this.getGoodsInfo(e, 0, goods_type);  

            uni.navigateTo({  
                url: '/pages/find/share_profits?data=' + encodeURIComponent(JSON.stringify(e))  
            });  

            // uni.getSubNVueById('findShare').show('slide-in-bottom');  
        },  
        async getGoodsInfo(goods_numiid, type, goods_type) {  
            console.log(goods_numiid)  
            const res = await request.post('items/info', {  
                itemid: goods_numiid,  
                goods_type: goods_type  
            });  
            if (res.code == 200) {  
                console.log(res)  
                var info = res.data.info;  

                console.log(info);  

                const detail = info;  
                this.detail = detail;  

                var spinChain = this.spinChain;  
                spinChain = await this.getSpinChainInfo(detail, type);  

                console.log(spinChain);  
                if (type == 0) {  
                    uni.navigateTo({  
                        url: `/pages/detail/share_profits?itemid=${goods_numiid}`  
                    });  
                }  

            } else {  
                console.log(res);  
                uni.showToast({  
                    title: res.msg || '获取商品详情失败',  
                    icon: 'none'  
                });  

            }  
        },  
        /**  
         * 商品转链  
         */  
        async getSpinChainInfo(detail, type) {  

            console.log(detail);  
            var post = {  
                itemid: detail.goods_numiid,  
                coupon_link: detail.coupon_link,  
                goods_type: detail.goods_type,  
                seller_id: detail.seller_id,  
                coupon_id: detail.coupon_id,  
                goods_picture: detail.goods_picture,  
                goods_title: detail.goods_title,  
                shopName: detail.shop_name,  
                uid: this.$store.state.openid  
            };  
            console.log(post);  
            helper.showLoading();  
            const res = await request.post('items/createBuyLink', post);  
            console.log(res);  
            helper.hideLoading();  
            if (res.code && res.code == 200) {  
                //return false;  
                detail.coupon_link = res.data.coupon_link;  
                detail.tbpwd = res.data.tbpwd;  
                detail.h5Url = res.data.shortUrl;  
                if (detail.goods_type == 3) {  
                    detail.h5Url = res.data.shortUrl;  
                    detail.coupon_link = res.data.shortUrl;  
                } else if (detail.goods_type == 4) {  
                    detail.coupon_link = res.data.open_weixin_app;  
                    detail.h5Url = res.data.open_weixin_app;  
                }  
                var userdata = this.$store.state.userinfo;  
                console.log(detail);  

                userdata.yqcode = this.$store.state.userinfo.yqcode;  

                var createWenan = helper.createWenan(userdata, detail);  
                console.log(detail);  
                var spinChain = {  
                    wenan: createWenan.goods.wenan,  
                    data: createWenan.goods.data  
                };  
                if (type == 1) {  
                    clipboard.setString(createWenan.goods.wenan);  
                    uni.showToast({  
                        title: '文案复制成功',  
                        icon: 'none'  
                    });  
                }  
                this.spinChain = spinChain;  
                console.log(res.data);  
                return res.data;  
            } else {  
                uni.showToast({  
                    title: res.msg || '口令生成失败 请稍后再试',  
                    icon: 'none'  
                });  
                return false;  
            }  
        },  
        previewImage(e) {  

            e.urllist.map(item => {  
                var hasHttp = item.substr(0, 7).toLowerCase();  
                if (hasHttp === 'http://') {  
                    return item;  
                }  
                var hasHttps = item.substr(0, 8).toLowerCase();  
                if (hasHttps === 'https://') {  
                    return item;  
                }  
                return 'http:' + item;  
            });  
            console.log(e);  
            selectInfo = e;  
            uni.previewImage({  
                urls: e.urllist,  
                current: e.picIndex,  
                loop: true,  
                longPressActions: {  
                    itemList: ['保存图片', '保存全部'],  
                    success: res => {  
                        if (res.tapIndex == 0) {  
                            this.saveImageShare(e.urllist[res.index], true);  
                        } else {  
                            e.urllist.forEach(item => {  
                                this.saveImageShare(item, true);  
                            });  
                        }  
                    }  
                }  
            });  
        }  
    }  
};  

</script>

<style>
.cp_tupian {
width: 350rpx;
border-radius: 10rpx;
}

.cp-biaoti {  
    font-size: 14px;  
    color: gray;  
    overflow: hidden;  
    white-space: nowrap;  
    text-overflow: ellipsis;  
}  

.cp-xiangmu {  
    width: 350rpx;  
    margin: 10rpx;  
    background-color: #FFFFFF;  
    box-sizing: border-box;  
    border-radius: 10rpx;  
}  

.cp-content {  
    justify-content: space-between;  
    margin: 0 auto;  
    text-align: center;  
    display: flex;  
    flex-direction: row;  
    flex-wrap: wrap;  
}  

/*分类*/  
.category-scroll {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  

    text-align: center;  
    width: 300rpx;  
}  

.category-tab-item-title {  
    width: 300rpx;  
    text-align: center;  
    color: #565656;  
    color: rgba(255, 255, 255, 0.65);  
    padding: 0 10rpx;  
    font-size: 32rpx;  
    height: 80rpx;  

    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.new-home-top-nav {  
    flex-direction: row;  
    flex-wrap: nowrap;  
    height: 80rpx;  
}  

.new-home-top-nav-move {  
    width: 100rpx;  
    text-align: center;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.new-home-top-nav-move-text {  
    width: 100rpx;  
    color: #de0101;  
    font-size: 34rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-weight: bold;  
    text-align: center;  
}  

.findTop {  
    position: fixed;  
    right: 20rpx;  
    bottom: 40rpx;  
    width: 80rpx;  
    height: 80rpx;  
    border-radius: 1000rpx;  
    text-align: center;  
    background-color: rgba(51, 51, 51, 0.7);  
}  

.findTop-text {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    text-align: center;  
    color: #ffffff;  
}  

.category-tab-item {  
    flex-wrap: nowrap;  
    text-align: center;  
    width: 180rpx;  
}  

.category-tab-item-title {  
    width: 180rpx;  
    text-align: center;  
    color: #565656;  
    //color: rgba(255, 255, 255, 0.65);  
    font-size: 32rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
}  

.category-tab-item-title-active {  
    color: #de0101;  
    border-bottom-color: #de0101;  
    border-bottom-width: 4rpx;  
}  

.status-bar {  
    height: 50rpx;  
    flex: 1;  
    background-color: red;  
}  

.tabs {  
    flex: 1;  
    flex-direction: column;  
    overflow: hidden;  
    background-color: #f5f5f5;  
}  

.wrapper {  
    background-color: #ffffff;  
    flex-direction: column;  
    border-bottom-width: 1px;  
    border-bottom-style: solid;  
    border-bottom-color: #f6f6f6;  
}  

.nav {  
    width: 750rpx;  
    /*  flex: 1; */  
    height: 88rpx;  
    line-height: 88rpx;  
    justify-content: center;  
    align-items: center;  
}  

.title {  
    width: 540rpx;  
    justify-content: center;  
    flex-direction: row;  
    background-color: #f2f2f2;  
    border-radius: 50rpx;  
}  

.title-text {  
    width: 180rpx;  
    align-items: center;  
    color: #99a2a8;  
    padding-top: 10rpx;  
    padding-bottom: 10rpx;  
    font-size: 28rpx;  
    text-align: center;  
}  

.title-text-curr {  
    color: white;  
    border-radius: 50rpx;  
    background-color: #fa0000;  
}  

.s-tab-content {  
    width: 750px;  
    flex-direction: row;  
    flex: 1;  
}  

.tui-loading {  
    height: 60rpx;  
    width: 60rpx;  
    color: #999999;  
}  

.tui-refresh {  
    width: 750rpx;  
    height: 80rpx;  
    flex-direction: row;  
    align-items: center;  
    justify-content: center;  
}  

.refresh-text {  
    text-align: center;  
    font-size: 26rpx;  
    color: #999999;  
}  

.swiper-box {  
    flex: 1;  
}  

.swiper-item {  
    flex: 1;  
    flex-direction: row;  
}  

.scroll-v {  
    flex: 1;  
    flex-direction: column;  
    width: 750rpx;  
}  

.head-image {  
    margin-left: 20rpx;  
}  

.head-content {  
    padding-left: 15rpx;  
}  

.share-btn {  
    background-color: #fceded;  
    padding: 7rpx 20rpx;  
    border-radius: 100rpx;  
}  

.share-btn-num {  
    font-size: 28rpx;  
    color: #fa0000;  
}  

.s-margins {  
    margin: 10rpx;  
}  

.find-head-content {  
    border-bottom-width: 2rpx;  
    border-bottom-style: dashed;  
    border-bottom-color: #f8f8f8;  
}  

.find-title-txt {  
    width: 750rpx;  
    text-overflow: ellipsis;  
    overflow: hidden;  
    font-size: 30rpx;  
    color: #333;  
}  

.find-title-txt-content {  
    width: 700rpx;  
    text-overflow: ellipsis;  
    line-height: 50rpx;  
    font-size: 28rpx;  
    color: #333333;  
}  

.find-txt-comment {  
    width: 700rpx;  
    background-color: #f7f7f7;  
    border-radius: 10rpx;  
    padding: 5rpx;  
}  

.find-txt-comment-richtext {  
    width: 690rpx;  
    background-color: #f7f7f7;  
    color: #666666;  
    font-size: 25rpx;  
}  

.copy-wenan-btn {  
    align-items: flex-end;  
    padding-bottom: 10rpx;  
    padding-right: 10rpx;  
}  

.copy-wenan-btn-text {  
    padding: 5rpx;  
    background-image: linear-gradient(to left, #f8e0dd, #f8e0dd);  
    color: #fa0000;  
    padding: 3rpx 10rpx;  
    border-radius: 10rpx;  
    width: 140rpx;  
    font-size: 23rpx;  
    text-align: center;  
}  

.goods_pictureItem {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItem_0 {  
    width: 160rpx;  
    /* height: 160rpx; */  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.goods_pictureItemOne {  
    width: 380rpx;  
    height: 380rpx;  
    border-radius: 20rpx;  
    background-color: #f8f8f8;  
    margin: 8rpx;  
}  

.has-border {  
    border-width: 2rpx;  
    border-style: dashed;  
    border-color: #007aff;  
}  

.s-list-icons {  
    width: 80rpx;  
    height: 80rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-list-icons1 {  
    width: 120rpx;  
    height: 120rpx;  
    margin-top: 20rpx;  
    line-height: 80rpx;  
    font-size: 50rpx;  
}  

.s-ceil {  
    padding: 25rpx 0;  
    border-bottom-width: 1rpx;  
    border-bottom-style: solid;  
    border-bottom-color: #E9E9E9;  
    align-items: center;  
    flex-direction: row;  
    flex-wrap: nowrap;  
}  

.s-list-content {  
    flex: 1;  
    width: 700rpx;  
}  

</style>

bug描述:

苹果真机图片有时候加载不出来

2022-07-26 19:05 负责人:无 分享
已邀请:
DCloud_UNI_WZF

DCloud_UNI_WZF

安卓正常吗?在 swiper外使用正常吗?如有可复现demo,请上传附件,谢谢~

DCloud_UNI_WZF

DCloud_UNI_WZF

安卓正常吗?在 swiper外使用正常吗?如有可复现demo,请上传附件,谢谢~

  • 6***@qq.com (作者)

    安卓加载正常,苹果加载有时候图片出不来,容易闪退

    2022-07-27 10:04

  • DCloud_UNI_WZF

    回复 6***@qq.com: 是否是网络问题呢,使用其他图片资源依然有该问题吗

    2022-07-27 10:09

  • 6***@qq.com (作者)

    回复 DCloud_UNI_WZF: 不应该的,同一环境,安卓没有问题,附件已经上传,麻烦看看

    2022-07-27 10:18

6***@qq.com

6***@qq.com (作者)

附件

  • DCloud_UNI_WZF

    你做一个最简可复现demo 上传,而不是把你项目传上来,你这项目在我这运行就报很多错,我也不知道你说的加载不出来的图片在哪里

    2022-07-27 10:45

天生DR

天生DR - 天生我材必有用

直接贴图片链接吧

该问题目前已经被锁定, 无法添加新回复