<template>
  <view :class="showNotice == false ? 'scenic_warp' : 'scenic_warp active'" class="scenic_warp">
    <!-- 头部模糊部分 -->
    <view class="det_top">
      <image :src="logo" class="pic_swp_bg" mode="aspectFill"></image>
    </view>
    <!-- 黑色遮罩 -->
    <view class="top_zhe"></view>
    <!-- 头部地址与天气 -->
    <!-- <view class="dly_flex mmd_top"> -->
    <!-- 地址切换 -->
    <view class="sec_name_unit agn_left mmd_dl">
      <view class="cur-input">
        <text>{{ info.sname }}</text>
      </view>
      <!-- <view class="dl_1">
        <text>{{ info.slevel }}</text>
      </view> -->
    </view>
<!--    天气-->
   <!-- <view class="sec_whe_unit agn_right mmd_dl mmd_whe">
      <image :src="weatherImgUrl" class="mmd_icon"></image>
      <text v-if="weather != null" class="dl_2">{{ weather.cond_txt_d }}</text>
      <view v-if="weather != null" class="dl_1">{{ weather.tmp_min }}℃~{{ weather.tmp_max }}℃</view>
    </view> -->
    <!-- 轮播图 -->
    <view class="mmd_scol">
      <view class="uni-margin-wrap">
        <swiper :autoplay="autoplay_sce" :duration="duration_sce" :indicator-dots="indicatorDots_sce" :interval="interval_sce"
                class="swiper_jqu">
          <swiper-item v-for="(item, index) in pic_list" :key="index">
            <view class="">
              <image :src="item" class="swiper_tup br_radius" mode="aspectFill"></image>
            </view>
          </swiper-item>
        </swiper>
      </view>
    </view>

    <!-- 功能键 -->
    <view class="mode_com mt_1">
      <view class="inx_ht_warp dly_flex tol_2_warp sec_tol">
       <!-- <view class="sec_tol_unit" @tap="qierlingurl(info.url_720)">
          <image class="sec_tol_pic" mode="scaleToFill" src="https://www.lbgjtoa.com/appImg/icon-left.jpg"></image>
          <view class="gjz_box">
            <text class="ht_text">720全景</text>
            <view class="hn_text">全方位观览</view>
          </view>
        </view> -->
        <view class="sec_tol_unit" @click="wisdomGuide()">
          <image class="sec_tol_pic" mode="scaleToFill" src="https://www.lbgjtoa.com/appImg/icon-right.jpg"></image>
          <view class="gjz_box">
            <text class="ht_text">智慧导览</text>
            <view class="hn_text">智能导航景区</view>
          </view>
        </view>
      </view>
    </view>
    <view v-if="info.soundpath != null && info.soundpath != ''" class="mode_com mt_1">
      <view class="dly_flex_c sce_voe">
        <view id="audioTest" class="sec_whe_unit">
          <button :class="[open < stop ? 'btn_play' : 'btn_play btn_open']" @tap="play(info.soundpath)">播放</button>
          <button :class="[open > stop ? 'btn_stop ' : 'btn_stop btn_open']" @tap="stops(info.soundpath)">停止</button>
        </view>
        <view class="sec_name_unit">
          <text class="sev_t control_1">{{ info.sname }}音频</text>
          <view class="slider_sec">
            <slider :value="audioTime" activeColor="#11C966" block-size="12" @change="sliderChange"/>
          </view>
          <view class="mssj_adr">{{ current }}</view>
        </view>
      </view>
    </view>

    <!-- 分割线 -->
    <view class="shadow_fg"></view>
    <!-- 音频 -->
    <view class="mode_com mt_1"></view>
    <!-- 简介 -->
    <view class="mode_com mt_1">
      <text class="tit_com">简介</text>
      <view class="sce_jianj">
        <view class="btn_shouq">
          <text v-if="flag">查看更多</text>
          <text v-if="!flag">收起</text>
          <text :class="[zhankai < shouqi ? 'btn_down' : 'btn_up btn_open']" @tap="opens()">展开</text>
          <text :class="[zhankai > shouqi ? 'btn_up' : 'btn_down btn_open']" @tap="retract()">收起</text>
        </view>
        <view :class="[zhankai > shouqi ? 'lvdh_inf ' : 'lvdh_inf h_define']">
          <!-- class="h_define" 固定高度 -->
          <mp-html :content="info.sdescribe"/>
          <!-- <mp-html :content="info.sdescribe" :loading="loading" @preview="preview" @navigate="navigate" /> -->
        </view>
      </view>
    </view>

    <!-- 景区地址 -->
    <view class="mode_com mt_1">
      <text class="tit_com">景区地址</text>
      <view class="dly_flex_c secdt_tck mt_1">
        <view class="sec_name_unit">
          <text class="cot_adr" style="margin-right: 20rpx">{{ info.saddress }}</text>
        </view>
        <view class="agn_right sec_whe_unit">
          <button class="btn_com btn_daoh" @click="daohang">导航</button>
        </view>
      </view>
      <view class="secdt_tips">
        <view class="secdt_adr dly_flex_c" @tap="tel(info.smobile)">
          <image class="adr_pic" src="../../../static/images/icon_phe.png"
                 style="position: relative; top: 6rpx"></image>
          <text class="w_adr">景区电话</text>
          <text class="cot_adr2">{{ info.smobile }}</text>
          <!-- 电话号码上加拨打功能 -->
        </view>
        <view class="secdt_adr dly_flex">
          <image class="adr_pic" src="../../../static/images/icon_time.png"></image>
          <text class="w_adr">营业时间</text>
          <text class="cot_adr">{{ info.businesstime }}</text>
        </view>
        <view class="secdt_adr dly_flex">
          <image class="adr_pic" src="../../../static/images/icn_ticket.png"></image>
          <text class="w_adr">门票价格</text>
					<text class="cot_adr">{{info.sprice}}</text>
        </view>
        <view class="secdt_adr dly_flex">
          <image class="adr_pic" src="../../../static/images/icon_max.png"></image>
          <text class="w_adr">最大承载量</text>
					<text class="cot_adr">{{info.maxPerson}}人</text>
        </view>
      </view>
    </view>

    <!-- 景区门票 -->

    <!-- 热门景区 -->
    <view class="mode_com mdd_jj">
      <text class="tit_com">热门景点</text>
    </view>
    <view class="pd_scl_new">
      <view class="mmd_s_hot">
        <!-- <scroll-view class="scroll-view_s" scroll-x="true" @scroll="scroll" scroll-left="">
          <view @click="goToScenicDetail(item.guid)" class="scroll-view-item_s" v-for="(item,index) in scenicList" :key="index"
           :item-id="index" :data-year="index">
            <image class="mmd_jq_pic" :src="item.slogo" mode="aspectFill"></image>
            <text class="mmd_s_txt">{{item.sname}}</text>
            <text class="mmd_s_adr">{{item.sname}}</text>
          </view>
        </scroll-view> -->
        <scroll-view class="scroll-view_s" scroll-left="" scroll-x="true" @scroll="scroll">
          <view :style="width" class="yx_warp_3">
            <!--width: 210%; 应改为动态计算得出 基数为70% *n-->
            <view class="dly_flex mud_hot_box">
              <!-- 此处循环 -->
              <view v-for="(item, index) in scenicList" :key="index" class="b_tol_ipt"
                    @click="goToScenicDetail(item.guid)">
                <view class="scroll-view-item_s">
                  <image :src="rootPaht + item.logo" class="mmd_jq_pic" mode="aspectFill"></image>
                  <text class="mmd_s_txt">{{ item.title }}</text>
                </view>
              </view>
            </view>
          </view>
        </scroll-view>
      </view>
    </view>

    <!-- 人流量情况 -->
   <!-- <view v-if="isShowFlow" class="mode_com mt_1">
      <text class="tit_com">游览舒适度</text>
      <view class="jqdg_liu amt_30">
        <view class="">
          <image :src="'../../../static/animg/' + flowImg" class="liu_img" mode="aspectFill"></image>
        </view>
        <view :class="flowStyle">舒适度指数：{{ flowState }}</view>

      </view>
    </view> -->

    <!-- 攻略 -->
    <!-- <view class="mode_com mt_1">
      <text class="tit_com">景区游玩攻略</text>
      <text v-if="listDatas.length == 0 || listDatas == undefined" class="mssj_adr">暂无数据</text>
      <view class="inx_ht_warp glue_warp secdt_glue" v-for="(itemName, index) in listDatas" :key="index">
        <view class="fod_sp_box" @tap="gotomethod(itemName.guid)">
          <view class="msimg_wrp"><image :src="itemName.logo" class="pic_shop" mode="aspectFill"></image></view>
          <view class="mssj_box">
            <text class="mssj_tit">{{ itemName.mtitle }}</text>
          </view>
        </view>
      </view>
    </view> -->
   <!-- <view class="mode_com mt_1">
      <text class="tit_com">景区游玩攻略</text>
      <text v-if="listDatas.length == 0 || listDatas == undefined" class="mssj_adr">暂无数据</text>
      <view v-for="(itemName, index) in listDatas" :key="index" class="inx_ht_warp glue_warp secdt_glue">
        <view class="fod_sp_box" @tap="gotomethod(itemName.guid)">
          <view class="msimg_wrp">
            <image :src="itemName.logo" class="pic_shop" mode="aspectFill"></image>
          </view>
          <view class="mssj_box">
            <text class="mssj_tit">{{ itemName.mtitle }}</text>
            <text class="mssj_adr">{{ itemName.mcontent }}</text>
          </view>
        </view>
      </view>
    </view> -->
    <!-- 评论 -->

    <!-- 联系我们 弹框 -->

    <!-- 服务保障 弹框 -->

    <!-- 购买须知 弹框 -->
  </view>
</template>

<script>
import uniRate from '@/components/uni-rate/uni-rate2.vue';
import aes from '@/common/aes.js';

export default {
  components: {
    uniRate,
  },
  onLoad(options) {
    var that = this;
    this.$util.getNetworkType(
        function (res) {
          if (res.networkType === 'none') {
            uni.showToast({
              title: that.$param.netMsg,
              icon: 'none',
              duration: 2000
            });
            that.netType = false;
          }
        },
        function () {
          uni.showToast({
            title: that.$param.netMsg,
            icon: 'none',
            duration: 2000
          });
          that.netType = false;
        }
    );
    if (!that.netType) {
      return;
    }

    this.$util.hideLoadingByTime();
    // #ifdef H5
    const oMeta = document.createElement('meta');
    oMeta.httpEquiv = 'Cache-Control';
    oMeta.content = 'no-cache, no-store, must-revalidate';
    document.getElementsByTagName('head')[0].appendChild(oMeta);
    if (this.$wechat.isWechat()) {
      this.isZb = false;
    }
    // #endif

    // this.requestLocation();
    that.$util.saveOperatorLog(that, 'SCENIC', options.guid);
    //正常进入详情
    uni.showLoading({
      title: '加载中',
      mask: true
    });
    this.guid = options.guid;
    this.detailInfo(options.guid);
    this.getIsShow();

    this.getScenicListGuids();
  },
  onUnload() {
    this.stops(this.info.soundpath);
  },
  onShow() {
    this.param.page = 1;
    this.getComment();
  },
  onReady() {
    // setTimeout(function() {
    // 	uni.hideLoading();
    // }, 500);
    // // #ifdef MP-WEIXIN
    // const oMeta = document.createElement('meta');
    // oMeta.httpEquiv = "Cache-Control";
    // oMeta.content = "no-cache, no-store, must-revalidate"
    // document.getElementsByTagName('head')[0].appendChild(oMeta);
    // // #endif
  },
  data() {
    return {
      guid: '167',
      indicatorDots_sce: true,
      zhankai: 0,
      shouqi: 1,
      open: 0,
      stop: 1,
      autoplay_sce: true,
      interval_sce: 4000,
      duration_sce: 500,
      pic_url: this.$config.ROOTPATH,
      rootPaht: this.$config.ROOTPATH,
      comments: [],
      pic_list: [],
      info: {},
      weather: {},
      listDatas: [],
      tickeTlist: [],
      param: {
        page: 1,
        noData: !1,
        loading: !1,
        finished: !1
      },
      peoplesnum: {},
      logo: '',
      soundlength: 0,
      AudioContext: uni.createInnerAudioContext(),
      isShow: true,
      weatherImgUrl: '',
      flag: true,
      total: '00:00',
      current: '00:00',
      seektime: 0,
      audioTime: 0,
      isZb: true,
      isShowBuy: 'YES',

      // // 门票
      showNotice: false,
      markers: [],
      notice: '',
      ticketSellprice: '',
      ticketPrice: '',
      suitid: '',
      isspecial: '',
      isToDingDanType: false,
      tapDate: '',
      showSever: false,
      score: '', //评论分数 数据初始化
      showContact: false,
      sid: '',
      scenicDetail: {},
      isShowLink_st: 'YES',
      isShowFlow: false,
      flowImg: '',
      flowState: '',
      flowStyle: 'agn_center liu_txt amt_30',
      netType: true,
      scenicList: []
    };
  },
  methods: {
    requestLocation: function () {
      var that = this;
      this.$util.bindGpsObj(that);
      this.$util.getLocation(
          function (res) {
            if (that.$wechat.isWechat()) {
              that.$param.clat = res.latitude;
              that.$param.clng = res.longitude;
              uni.hideLoading();
            }
          },
          function () {
            console.log('location error---');
          }
      );
    },
    callGpsSuccess: function (lat, lng) {
    },
    callGpsFail: function () {
    },
    preventHandler() {
      return;
    },

    getIsShow: function () {
      this.$Request.post(this.$config.getYbsjSysParam, {}).then((res) => {
        var d = res.data;
        this.isShowBuy = d.is_show_buy;
      });
    },
    getScenicListGuids: function () {
      var data = {
        key: this.$param.userkey
      };
      this.$Request.post(this.$config.getScenicListByGuidss, data).then((res) => {
        this.scenicList = res.data;
      });
    },
    detailInfo: function (guid) {
      /* var that = this;
        var data = {
          key: this.$param.userkey+'_scenic_' + guid
        };
        this.$Request.post(this.$config.getRedisData, data).then(res => {
          console.log("Redis景区")
          console.log(res);
          if(res.status == 200){
            //所有的数据
            var initData = res.data;
          }else{ */
      this.getScDetail(guid);
      /* 	}
        }); */
    },
    gotomethod: function (guid) {
      uni.navigateTo({
        url: `/sunPackIndex/method/methoddetail/methoddetail?guid=` + guid + ``
      });
    },
    getScDetail: function (guid) {
      let this_ = this
      var data = {
        guid: guid,
        userkey: this.$param.userkey
      };
      this.$Request.post(this.$config.scenicDetial, data).then((res) => {
        console.log(res, '0-0-0-0');
        this.info = res.data;
        this.tickeTlist = res.data.ticketlist;
        this.logo = this.$config.ROOTPATH + res.data.slogo;
        var pic_list = res.data.imgList;
        if (pic_list != null) {
          for (var i = 0; i < pic_list.length; i++) {
            pic_list[i] = '' + this.pic_url + pic_list[i];
          }
        }
        this.pic_list = pic_list;
        // if (res.data.controlInfo.cyjcScenicUuid != '' && res.data.controlInfo.cyjcScenicUuid != null) {
        // 	//this.comment(res.data.controlInfo.cyjcScenicUuid);
        // 	if (res.data.controlInfo.isPeopleFlow == 'YES') {
        // 		this.isShowFlow = true;
        // 		this.getScenicVolume(res.data.controlInfo.cyjcScenicUuid);
        // 	}
        // } else {
        // 	this.isShow = false;
        // }
        this.getDuration(this.info.soundpath, res.data.sfunc);
        // this.getMethod(res.data.region);
        this_.getMethodList();
        uni.hideLoading();
      });
    },
    getWeather: function (region) {
      var myAmapFun = new amap.AMapWX({key:'e2ee6a41e07306db2214f0edfa86f73a'});
      myAmapFun.getWeather({
        success: function(data){
          //成功回调
          console.log(data,'success')
        },
        fail: function(info){
          //失败回调
          console.log(info,'fail')
        }
      })
      // var data = {
      //   region: region
      // };
      // this.$Request.post(this.$config.getWeather, data).then((res) => {
      //   this.weather = res.data;
      //   if (this.weather.cond_txt_d.indexOf('雷') != -1) {
      //     this.weatherImgUrl = '../../../static/images/whe_lei.png';
      //   } else if (this.weather.cond_txt_d.indexOf('雨') != -1) {
      //     this.weatherImgUrl = '../../../static/images/whe_yu.png';
      //   } else if (this.weather.cond_txt_d.indexOf('雾') != -1) {
      //     this.weatherImgUrl = '../../../static/images/whe_wu.png';
      //   } else if (this.weather.cond_txt_d.indexOf('阴') != -1) {
      //     this.weatherImgUrl = '../../../static/images/whe_yin.png';
      //   } else if (this.weather.cond_txt_d.indexOf('雪') != -1) {
      //     this.weatherImgUrl = '../../../static/images/whe_xu.png';
      //   } else if (this.weather.cond_txt_d.indexOf('晴') != -1) {
      //     this.weatherImgUrl = '../../../static/images/whe_sun.png';
      //   } else {
      //     this.weatherImgUrl = '../../../static/images/whe_cloudy.png';
      //   }
      // });
    },
    getComment: function () {
      var that = this;
      var data = {
        dataid: this.guid,
        type: 'SCENIC',
        userkey: this.$param.userkey,
        pageno: this.param.page,
        pagesize: 5
      };
      this.$Request.post(this.$config.getCommentFromMobile, data).then((res) => {
        var commentList = res.data.commentList;
        this.peoplesnum = res.data.commentCountMap;
        if (commentList == null || commentList.length <= 0) {
          that.isShow = false;
        } else {
          var dataListLen = commentList.length;
          if (dataListLen > 0) {
            for (var i = 0; i < dataListLen; i++) {
              var date = that.getMyDate(commentList[i].createtime);
              commentList[i].createtime = date;
              that.comments.push(commentList[i]);
            }
            that.isShow = true;
          }
          if (that.param.page == 1) {
            that.comments = commentList;
          }
        }
      });
    },
    getMethodList: function () {
      var that = this;
      var url = this.$config.getMessageInfoFormFilter;
      var data = {
        type: this.$param.methodType,
        userkey: this.$param.userkey,
        pageSize: 6
        // region:this.region
      };
      this.$Request.post(url, data).then((res) => {
        console.log(res, '2');
        var listDatas = this.listDatas,
            dataListLen = res.data.length;
        for (var i = 0; i < dataListLen; i++) {
          var item = {
            guid: res.data[i].guid,
            logo: this.rootPaht + res.data[i].logo,
            mtitle: res.data[i].title,
            sendtime: res.data[i].sendtime,
            browsenum: res.data[i].browsenum,
            mcontent: this.delHtmlTag(res.data[i].content)
          };
          this.listDatas.push(item);
        }
      });
    },
    getMethod: function (region) {
      var requestData = {
        pageno: '1',
        pageSize: '5',
        sort: '2',
        region: region,
        type: this.$param.methodType,
        userkey: this.$param.userkey,
        scenicid: this.guid
      };
      this.$Request.post(this.$config.getMessageInfoFormFilter, requestData).then((res) => {
        console.log(res, '2');
        var listDatas = this.listDatas,
            dataListLen = res.data.length;
        for (var i = 0; i < dataListLen; i++) {
          var item = {
            guid: res.data[i].guid,
            logo: this.rootPaht + res.data[i].logo,
            mtitle: res.data[i].title,
            sendtime: res.data[i].sendtime,
            browsenum: res.data[i].browsenum,
            mcontent: this.delHtmlTag(res.data[i].content)
          };
          this.listDatas.push(item);
        }
      });
    },
    opens: function () {
      (this.zhankai = 1), (this.shouqi = 0), (this.flag = false);
    },
    retract: function () {
      (this.zhankai = 0), (this.shouqi = 1), (this.flag = true);
    },
    // comment: function(uuid) {
    // 	var data = {
    // 		pageno: this.param.page,
    // 		sceniccode: uuid,
    // 		pagesize: 5
    // 	};
    // 	if (data.sceniccode == '') {
    // 		this.isShow = false;
    // 	}
    // 	this.$Request.post(this.$config.scenicgoodlist, data).then(res => {
    // 		if (res.data == null || res.data.length <= 0) {
    // 			this.isShow = false;
    // 		} else {
    // 			var dataListLen = res.data.length;
    // 			if (
    // 				(dataListLen == data.pagesize
    // 					? (this.param.page += 1)
    // 					: (this.param.page = 1 && 0 == dataListLen ? (this.param.noData = true) : (this.param.finished = true)),
    // 				(this.param.loading = false),
    // 				dataListLen > 0)
    // 			) {
    // 				for (var i = 0; i < dataListLen; i++) {
    // 					var item = {
    // 						criticism_user: res.data[i].criticism_user,
    // 						criticism_content: res.data[i].criticism_content,
    // 						criticism_time: res.data[i].criticism_time,
    // 						grade: res.data[i].grade
    // 					};
    // 					if (item.grade.toString().indexOf('.') == -1) {
    // 						item.grade = item.grade + '.0';
    // 					}
    // 					this.comments.push(item);
    // 				}
    // 			}
    // 		}
    // 	});
    // 	this.peopleNum(uuid);
    // },
    /* peopleNum: function(sceniccode) {
      var data = {
        sceniccode: sceniccode
      };
      this.$Request.post(this.$config.totalnumAndPj, data).then(res => {
        if (res.data.length > 0) {
          this.peoplesnum = res.data[0];
        }
      });
    }, */
    qierlingurl: function (url) {
      if (url.length > 10 && url != '') {
        // if(url.indexOf("https") != -1){
        var r = this.$base64.encode(url);
        uni.navigateTo({
          url: '/sunPackIndex/scenic/scenicdetial/url720/url720?url=' + r
        });
        /* }else{
          window.location.href = url;
        } */
      } else {
        uni.showModal({
          title: '提示',
          content: '敬请期待',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定');
            } else if (res.cancel) {
              console.log('用户点击取消');
            }
          }
        });
      }
      // window.location.href =url;
    },
    wisdomGuide: function () {
      uni.switchTab({
        url: '/pages/daolan/zhdl'
      });
    },

    liveBeauty: function (guid) {
      if (this.info.controlInfo.isLive == 'YES') {
        Android.gotoDetial('LIVEVIDEO', guid + '');
      } else {
        uni.showModal({
          title: '提示',
          content: '暂无直播',
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定');
            } else if (res.cancel) {
              console.log('用户点击取消');
            }
          }
        });
      }
    },
    goToScenicDetail: function (guid) {
      //Android.gotoDetial("SCENIC", guid + "");
      debugger
      uni.navigateTo({
        url: '/sunPackIndex/amusement/amusementdetail/amusementdetail?guid=' + guid
      });
    },
    play: function (soundpath) {
      if (soundpath == '' || soundpath == null) {
        this.total = '--';
        uni.showModal({
          title: '提示',
          content: '本景区暂无音频',
          showCancel: false,
          success: function (res) {
            if (res.confirm) {
              console.log('用户点击确定');
            } else if (res.cancel) {
              console.log('用户点击取消');
            }
          }
        });
      } else {
        var that = this;
        this.open = 1;
        this.stop = 0;
        this.AudioContext.autoplay = true;
        this.AudioContext.src = this.$config.ROOTPATH + soundpath;
        this.AudioContext.play();
        var i = 1;
        this.AudioContext.onTimeUpdate(() => {
          /* 				console.log('进度更新了总进度为：'+parseInt(that.AudioContext.duration)+'当前进度为：'+parseInt(that.AudioContext.currentTime));
           */
          setTimeout(() => {
            this.getParseInt(that.AudioContext.currentTime);
          }, 1000);
        });
        if (this.seektime > 0 && this.seektime != null && this.seektime != '') {
          this.AudioContext.seek(this.seektime);
        }
      }
    },
    getParseInt: function (current) {
      /* console.log('总:'+parseInt(this.AudioContext.duration)+'当前:'+this.current); */
      if (parseInt(current) == parseInt(this.AudioContext.duration)) {
        this.stops(this.info.soundpath);
        this.audioTime = 0;
        this.AudioContext.stop();
      } else {
        this.audioTime = parseInt((current / this.AudioContext.duration) * 100);
        //this.current = parseInt(current);
        this.seektime = parseInt(current);
        var b = this.$util.secsToStr(parseInt(current));
        this.current = b;
      }

      /* this.current=parseInt(this.AudioContext.duration);*/
    },
    getDuration: function (soundpath, dur) {
      if (soundpath == '' || soundpath == null) {
        this.total = '--';
      } else {
        this.total = this.$util.secsToStr(Number(dur));
        this.AudioContext.autoplay = false;
        this.AudioContext.src = this.$config.ROOTPATH + soundpath;
        /* this.AudioContext.duration=Number(dur); */
        /* this.getTimeOut(); */
      }
    },
    getTimeOut: function () {
      setTimeout(() => {
        /* console.log(this.AudioContext.duration); */
        var total = parseInt(this.AudioContext.duration);
        if (isNaN(total)) {
          this.total = '--';
          this.current = '--';
          this.getTimeOut();
        } else {
          var a = this.$util.secsToStr(total);
          /* 	console.log(a); */
          this.total = a;
        }
      }, 1000);
    },
    sliderChange: function (e) {
      var a = parseInt(((e.detail.value - 1) / 100) * this.AudioContext.duration);
      this.AudioContext.seek(a);
    },
    stops: function (soundpath) {
      this.open = 0;
      this.stop = 1;
      this.AudioContext.pause();
    },

    delHtmlTag: function (str) {
      if (str != undefined && str != null) {
        var temp = str.replace(/<\/?.+?>/g, '');
        var result = temp.replace(/ /g, '');
        return result.replace(/&nbsp;/gi, '');
      }
    },
    daohang() {
			console.log(this.info)
      // if (this.$wechat.isWechat()) {
      // var mapParam = {
      // 	latitude: this.info.lat,
      // 	longitude: this.info.lng,
      // 	scale: 18,
      // 	name: this.info.sname,
      // 	address: this.info.saddress
      // };
      // this.$util.openLocation(mapParam);
      // return;
      // }
      wx.openLocation({
        latitude: Number(this.info.lat),
        longitude: Number(this.info.lng),
        scale: 16,
        name: '邢台海洋馆',
        address: '',
        success(data) {
          console.log(data);
        },
        fail(err) {
          console.log(err);
        }
      });
    },
    viewMore: function () {
      //console.log(this.param.page);
      this.param.page++;
      /* this.comment(	this.info.controlInfo.cyjcScenicUuid); */
      //this.comment(uuid);
      this.getComment();
    },
    tel: function (tels) {
      uni.makePhoneCall({
        phoneNumber: tels //仅为示例
      });
    },
    getScenicDetail: function (sid) {
      var api_token = this.$MD5.hexMD5('APIgetSpotInfolvyou');
      var sendData = {
        api_token: api_token,
        productaid: sid
      };
      var data = {
        data: JSON.stringify(sendData),
        url: this.$config.getSpotInfo
      };
      this.$Request.post(this.$config.getAittoData, data).then((res) => {
        this.scenicDetail = res.data;
        /* var item = {
            latitude: this.scenicDetail.lat,
            longitude: this.scenicDetail.lng,
          }
          this.markers.push(item);
          this.score=res.data.comment.score / res.data.comment.num;
          this.latitude=res.data.lat; //要去的纬度-地址
          this.longitude=res.data.lng; //要去的经度-地址
          this.address= res.data.address;
          this.title= res.data.title;
          this.noticeData=res.data.ticketinfo;
          this.couponData=res.data.discountInfo ? res.data.discountInfo : [];
          this.showCoupon=res.data.userDiscount ? true : false; */
      });
    },
    callBackMethod: function () {
      uni.hideLoading();
    },
    // 门票详情
    showNoticeBtn: function (e) {
      this.showNotice = true;
      var view = e.currentTarget.dataset;
      //this.notice = view.notice;
      var regex = /style="[^=>]*"([(\s+\w+=)|>])/g;
      this.notice = view.notice.replace(regex, '$1'); //使用正则去掉富文本中的所有style样式
      (this.ticketSellprice = view.sellprice), (this.ticketPrice = view.price), (this.suitid = view.suitid), (this.isspecial = view.isspecial);
    },
    closeNoticeBtn: function () {
      this.showNotice = false;
    },
    showSeverBtn: function () {
      this.showSever = true;
    },
    closeSeverBtn: function () {
      this.showSever = false;
    },
    showContactBtn: function () {
      this.showContact = true;
    },
    closeContactBtn: function () {
      this.showContact = false;
    },
    /**
     * 拨打客服电话 函数
     */
    getMobile: function () {
      uni.makePhoneCall({
        phoneNumber: '18630172332'
      });
    },
    getTel: function () {
      uni.makePhoneCall({
        phoneNumber: '0311-87885822'
      });
    },
    goToComment: function () {
      if (this.$util.isBlack(uni.getStorageSync('unionid'))) {
        uni.switchTab({
          url: '/pages/personcenter/personcenter'
        });
      } else {
        uni.navigateTo({
          url: '/pages/myComment/form/form?guid=' + this.guid + '&commentType=SCENIC&cname=' + this.info.sname
        });
      }
    },
    getScenicVolume: function (uuid) {
      var data = {
        scenicUUID: uuid
      };
      this.$Request.post(this.$config.getScenicVolume, data).then((res) => {
        if (res.data != null && res.data.length > 0) {
          this.flowStyle = 'agn_center liu_txt amt_30';
          var flowData = res.data[0];
          var currentcount = flowData.currentcount;
          var maxload = flowData.maxload;
          currentcount = parseFloat(currentcount);
          maxload = parseFloat(maxload);
          var percentage = maxload <= 0 ? 0 : Math.round((currentcount / maxload) * 10000) / 100.0;
          if (percentage == 0) {
            this.flowStyle = 'agn_center liu_txt amt_30 liu_green';
            this.flowImg = 'liu_1.png';
            this.flowState = '舒适';
          } else if (percentage < 21) {
            this.flowStyle = 'agn_center liu_txt amt_30 liu_green';
            this.flowImg = 'liu_1.png';
            this.flowState = '舒适';
          } else if (percentage > 20 && percentage < 41) {
            this.flowStyle = 'agn_center liu_txt amt_30 liu_green';
            this.flowImg = 'liu_2.png';
            this.flowState = '舒适';
          } else if (percentage > 40 && percentage < 61) {
            this.flowImg = 'liu_3.png';
            this.flowState = '适中';
          } else if (percentage > 60 && percentage < 81) {
            this.flowStyle = 'agn_center liu_txt amt_30 liu_red';
            this.flowImg = 'liu_4.png';
            this.flowState = '适中';
          } else if (percentage > 80) {
            this.flowStyle = 'agn_center liu_txt amt_30 liu_red';
            this.flowImg = 'liu_5.png';
            this.flowState = '拥挤';
          }
        } else {
          this.flowStyle = 'agn_center liu_txt amt_30 liu_hui';
          this.flowImg = 'liu_hui.png';
          this.flowState = '暂无最新数据';
        }
      });
    },
    getMyDate: function (str) {
      var oDate = new Date(str),
          oYear = oDate.getFullYear(),
          oMonth = oDate.getMonth() + 1,
          oDay = oDate.getDate(),
          oHour = oDate.getHours(),
          oMin = oDate.getMinutes(),
          oSen = oDate.getSeconds(),
          oTime = oYear + '-' + this.addZero(oMonth) + '-' + this.addZero(oDay) + ' ' + this.addZero(oHour) + ':' + this.addZero(oMin) + ':' + this.addZero(oSen);
      return oTime;
    },
    //补零操作
    addZero: function (num) {
      if (parseInt(num) < 10) {
        num = '0' + num;
      }
      return num;
    },
    goToCommentDetail: function (guid) {
      uni.navigateTo({
        url: '/pages/myComment/detail/detail?guid=' + guid + '&type=visitor'
      });
    }
  }
};
</script>

<style>
@import '../../../static/css/common.css';
@import '../../cate/destinations.css';
@import url('../../../pages/index/index.css');
@import url('scenicdetial.css');

page {
  background: none;
}

.liu_hui {
  color: #cbcbcb !important;
}

.liu_green {
  color: #07b800 !important;
}

.liu_red {
  color: #ef0a0a !important;
}

.slider_sec {
  width: 450 rpx;
  height: 100%;
}

.slider_sec slider {
  width: 95%;
  margin-left: 2%;
  margin-right: 0;
  margin-top: 10 rpx;
  margin-bottom: 0;
}

/* 景区门票 */
.active {
  overflow: hidden;
  /* height: 100vh !important; */
}

.dialog-mask {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.cur-input {
  opacity: 0.99;
}

.fod_sp_box {
  display: flex;
  margin-top: 40 rpx; /*border-bottom: 2rpx solid #eee;*/
}

.msimg_wrp {
  position: relative;
}

.zsj_jb {
  display: inline-block;
  padding: 10 rpx 20 rpx;
  background: #fec901;
  color: #fff;
  position: absolute;
  left: 0;
  top: 0;
  font-size: 24 rpx;
  border-radius: 10 rpx 0 10 rpx 0;
}

.pic_shop {
  width: 160 rpx!important;
  height: 200 rpx!important;
  box-shadow: rgba(0, 0, 0, .1) 0 0 20 rpx;
  border-radius: 10 rpx;
}

.mssj_box {
  flex: 1;
  padding-left: 20 rpx;
}

.mssj_tit {
  font-size: 32 rpx;
  color: #333;
  font-weight: 700;
  display: block;
  text-overflow: ellipsis;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  display: -webkit-box;
  overflow: hidden;
}

.mssj_adr {
  color: #666;
  font-size: 28 rpx;
  font-weight: normal;
  line-height: 44 rpx;
  overflow: hidden;
  padding: 10 rpx 30 rpx 0 0;
  text-overflow: ellipsis;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  display: -webkit-box;
}
</style>
