商品信息

// 全局定义
var app = getApp();
var baseUrl = app.globalData.host;

var arr = [];
Page({
    
      

    /**
     * 页面的初始数据
     */
    data: {
        interval2: 4000,
        duration: 2000,
        activeColor: "#fff",

        page_select: "page",
        jb: true,
        jc: true,
        showToast: '',

        t1m: '',
        t1b: '',
        tl: '',
        
        swiperImg: [],
        pt: '',
        titel: '',
        quan: '',
        fanLi: '',
        yuanJia: '',
        quanHou: '',
        link: '链接',//link or tkl
        links: '',

        fa: '',
        list_z: [],
        gq: '',
        sx: '',
        xjxx: '',
        tips: '',
    },

   

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
        //展示数据
        if(options!=null){
            var that = this;
            arr = options.data.split(",");

            //TH
            if(arr.length>=10){
                that.setData({
                    pt: arr[0],
                    titel: arr[1],
                    quan: arr[2],
                    fanLi: arr[3],
                    yuanJia: arr[4],
                    quanHou: arr[5],
                    links: arr[6],
                    icon: arr[7],

                    swiperImg: arr[8].split("|")
                });
                if(arr[0]==that.data.t1m || arr[0]==that.data.t1b){
                    that.setData({
                        link: that.data.tl
                    });
                }
            //BH
            }else{
                that.setData({
                    pt: arr[0],
                    titel: arr[1],
                    links: arr[4],
                    swiperImg: arr[6].split("|")
                });
                if(arr[0]==that.data.t1m || arr[0]==that.data.t1b){
                    that.setData({
                        link: that.data.tl
                    });
                }
            }
        }else{
            //请求数据
        }

        //zd
        var that = this;
        wx.request({
            url: baseUrl+'/stbh/xcx/zd',
            header: {},
            method: 'GET',
            dataType: 'json',
            responseType: 'text',
            success: function (res) {
                var zds = res.data.data;
                console.log(zds);
                that.setData({
                    t1b: zds.t1b,
                    t1m: zds.t1m,
                    tl: zds.tl,
                    gq: zds.gq,
                    sx: zds.sx,
                    list_z: zds.jb.split(","),
                    xjxx: zds.xjxx,
                    tips: zds.tips

                });
            },
        });

    },

    /**
     * 举报
     */
    juBao: function () {
        this.setData({
            page_select: "page2",
            jb: false
        })
    },
    /**
     * 取消
     */
    quXiao: function () {
        this.setData({
            page_select: "page",
            jb: true
        });
    },

    /**
     * 教你
     */
    jiaoCheng:function(){
        this.setData({
            page_select: "page2",
            jc: false
        })
    },
    /**
     * 取消
     */
    quXiao_jc: function () {
        this.setData({
            page_select: "page",
            jc: true
        });
    },

    /**自定义提示框(显示1.5秒后消失)*/
    showToast: function () {
        this.setData({
            showToast: true
        });
        setTimeout(() => {
            this.setData({
                showToast: false
            });
        },1000);
    },

    /**
     * 路子
     */
    link: function (e) {
        wx.setClipboardData({
            data: this.data.links,
            success: function (res) {
                wx.getClipboardData({
                    success: function (res) {
                        wx.showToast({
                            title: '复制成功'
                        })
                    }
                })
            }
        })
    },

    // 走
    th_lin: function (e) {
        wx.setClipboardData({
            data: e.currentTarget.dataset.tkl,
            success: function (res) {
                wx.getClipboardData({
                    success: function (res) {
                        wx.showToast({
                            title: '复制成功'
                        })
                    }
                })
            }
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击分享
     */
    onShareAppMessage: function (res) {
        
    }


      
 

})

 



  
    
      {{toastText}}
    
  



  
    
    
      
        
            
                
              
        
      
    

    
    
      {{pt}}\t{{titel}}
      
        {{quan}}{{fanLi}}{{yuanJia}}{{quanHou}}
      
      
      
        {{list_z[0]}}
        
      
    
  


  
  
    
      
        
        {{link}}
      
    
    
    
    
    
    
  


 

/* 自定义提示框 */
.box1 {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  position: fixed;
  z-index: 999;
}
.window {
  width: 50%;
  padding: 20rpx;
  background: rgba(0, 0, 0, .5);
  border-radius: 20rpx;
}
.text2 {
  color: #fff;
  text-align: center;
}

.page{
  background-color: #fff;
}
.page2{
  background-color: rgb(192, 185, 185);
}

/* 图片 */
.top{
  margin-top: 3px;
}
.top swiper{
  height: 240px;
}
swiper image{
 
  width: 750rpx;
}
/* 描述 */
.title{
  margin: 0.2em 0.2em;
  padding: 0.2em 0.2em;
  display: -webkit-box;
  overflow: hidden;/*超出一行文字自动隐藏 */
  text-overflow: ellipsis;/*文字隐藏后添加省略号*/
  word-wrap: break-word;
  white-space: normal !important;/*强制不换行 */
  -webkit-line-clamp: 2;/*多余2行的部分以省略号显示*/
  -webkit-box-orient: vertical;
}
.pt{
  color: white;
  background-color: #ff6633;
  display: inline;
  border-radius: 5px;
  font-size: 12px;
}

.price{
  margin-left: 0.2em;
}
.price .l3,.l2,.l4{
  margin-left: 7px;
}
.l1{
  color: #ff6633;
}
.l4{
  color: #ff6633;
}
.l2{
  color: gray;
  text-decoration:line-through;
}
.sss{
  font-size: 10px;
  margin-top: 4em;
}

.left_btn{
  position: fixed;
  color: blue;
  left: 0.8em;
  margin-top: -2em;
}
.right_btn{
  position: fixed;
  right: 0.8em;
  color: blue;
  margin-top: -2em;
}

/* 列表详情 */
.info{
  width: 750rpx;
  height: 100%;
}
.li {
  margin: 0.4em 0.8em;
  padding: 0.2em 0.2em;
  display: flex;
  justify-content: space-around;
  width: 92%;
  height: 225rpx;
  font-size:14px;
  margin-bottom: 3.5em;
}

.bg-gray{
  background-color: rgb(255, 255, 255)!important;
  border-bottom: 1rpx solid  #fff!important;
}
.img{
  width: 100px;
  height: 110px;
  
}
.price1{
  margin-top: 10px;
}
.price{
  display: inline;
}
.price view{
  display: inline;
}
.price .l3,.l2{
  margin-left: 7px;
}
.l1{
  color: #ff6633;
}
.l2{
  color: gray;
}
::-webkit-scrollbar{/*隐藏滚动条*/
width: 0;
height: 0;
color: transparent;
}
.pt{
  color: white;
  background-color: #ff6633;
  display: inline;
  border-radius: 5px;
  font-size: 12px;
}
/* 底部 */
.lj{
  position: fixed;
  bottom: 2px;
  color: white;
  background-color: #ff6633;
  width: 50%;
  margin-right: 50%;
  height: 2.2em;
  border-radius: 15rpx;
  font-weight: bold;
}

.rivend{
  position: fixed;
  bottom: 2px;
  color: white;
  background-color: #00EE76;
  width: 50%;
  margin-left: 50%;
  height: 2.2em;
  border-radius: 15rpx;
  font-weight: bold;
}
.jb_btn{
  position: fixed;
  bottom: 0.5em;
  color: blue;
  background-color: white;
  width: 84%;
  text-align: center;
  margin-left: 8%;
  line-height: 1em;
  border-radius: 15rpx;
  z-index: 999;
}
.jb_btn_{
  margin-top: 1em;
  border-bottom:1px solid rgb(167, 163, 163);
  height: 2em;
}
.quXiao{
  margin-top: 1em;
  border-bottom:1px solid grey;
  height: 2em;
}
.buttom_btn{
  display:flex;
  justify-content: center;
  
}

商品信息_第1张图片

  "pages": [

    "pages/sy/sy",

    "pages/wd/wd",

    "to2pages/productInfo/productInfo"

  ],

你可能感兴趣的:(微信小序)