justTest.js 3.35 KB
// pages/justTest/justTest.js
// let livePlayer = requirePlugin('live-player-plugin');


var t = require("../../utils/util.js"),
  ut = t,
  e = require("../../utils/common.js"),
  a = require("../../utils/wxParse/wxParse.js"),
  s = getApp(),
  i = s.request,
  rq = i,
  oo = s.globalData,
  o = s.globalData.setting,
  os = o;
var utils = require('../../utils/util.js'),ut=utils;
var regeneratorRuntime = require('../../utils/runtime.js');

Page({

  /**
   * 页面的初始数据
   */
  data: {
    gid: "",
    stoid: o.stoid,
    url: o.url,
    resourceUrl: o.resourceUrl,
    iurl: o.imghost,
    defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
    data: null,
    openSpecModal: !1,
    openPromModal: !1,
    supportPageScroll: !1,

    //联系电话
    mobile: '',
    bconfig:null,
    sales_rules:1,

    t_time:null,
	card_field:"",
	dp_price:0,
	cut_price:0,
	open_ind_store:1,
	goodsInputNum:1,
	g_buy_num: null,
  sele_collocation:null,
  


  photoUrl: "https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1003256280,1176261798&fm=26&gp=0.jpg",
    //(用来控制显示哪个按钮) false表示还没首次进行弹框授权,或者已经授权了;true表示在首次授权弹框时拒绝授权,或者在设置页面还是拒绝了授权
    isAuthSavePhoto: false
  },





  sendRequest: function () {
   
   
  
     //调用接口判断是不是会员
     getApp().request.promiseGet("/api/weshop/wx/livelist/page",{
      data:{store_id: 1}
  }).then(res=>{
       console.log(res);
      // if(res.data.code==0){
      //   getApp().globalData.guide_id=res.data.data.id;
      // }
    })
   
  },
  // nav: function () {
  //   wx.redirectTo({
  //     url: '/packageA/pages/liveStream/liveStream'
  //   })
  // },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

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

  },

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

  },

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

  },

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

  },

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

  },

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

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },




  saveImage() {
    wx.showLoading({
      title: '保存中...', 
      mask: true,
    });
    wx.downloadFile({
      url:
  'http://upload.jianshu.io/admin_banners/web_images/4435/c1d3ca63353c8bd527f0d781605516cb5b266d02.jpg?imageMogr2/auto-orient/strip|imageView2/1/w/1250/h/540',
      success: function(res) {
        if (res.statusCode === 200) {
          let img = res.tempFilePath;
          wx.saveImageToPhotosAlbum({
            filePath: img,
            success(res) {
              wx.showToast({
                title: '保存成功',
                icon: 'success',
                duration: 2000
              });
            },
            fail(res) {
              wx.showToast({
                title: '保存失败',
                icon: 'success',
                duration: 2000
              });
            }
          });
        }
      }
    });
  },



  live() {}


})