...
|
...
|
@@ -19,6 +19,7 @@ Page({ |
|
|
isPlay: false,
|
|
|
content_1: "",
|
|
|
content_2: "",
|
|
|
srcList: [],
|
|
|
},
|
|
|
changeIndicatorDots(e) {
|
|
|
this.setData({
|
...
|
...
|
@@ -65,29 +66,45 @@ Page({ |
|
|
this.setData({ isPlay: !this.data.isPlay });
|
|
|
},
|
|
|
//视频暂停
|
|
|
clickStop() {
|
|
|
this.setData({ isPlay: false });
|
|
|
},
|
|
|
// clickStop() {
|
|
|
// this.setData({ isPlay: false });
|
|
|
// },
|
|
|
swiperChange: function (e) { //切换轮播图
|
|
|
this.setData({
|
|
|
currentSwiper: e.detail.current
|
|
|
})
|
|
|
},
|
|
|
/**
|
|
|
* 预览图片
|
|
|
*/
|
|
|
previewImage: function (e) {
|
|
|
console.log(111);
|
|
|
// var current = e.target.dataset.src;
|
|
|
wx.previewImage({
|
|
|
//current: current, // 当前显示图片的http链接
|
|
|
urls: this.data.srcList // 需要预览的图片http链接列表
|
|
|
})
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
onLoad: function (options) {
|
|
|
|
|
|
// console.log(options);
|
|
|
let url = '/portal/Api/category';
|
|
|
let data = {
|
|
|
categoryId: options.id,
|
|
|
};
|
|
|
let srcListArr = [];
|
|
|
app.post(url, data).then((res) => {
|
|
|
// console.log('res', res);
|
|
|
for (var index in res.image) {
|
|
|
res.image[index].type = "image";
|
|
|
}
|
|
|
for (var x = 0; x < res.image.length; x++) {
|
|
|
srcListArr.push(res.image[x].url);
|
|
|
}
|
|
|
if (res.video_type == true) {
|
|
|
res.image.splice(0, 0, {
|
|
|
url: res.video,
|
...
|
...
|
@@ -95,12 +112,16 @@ Page({ |
|
|
video_img: res.video_img,
|
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
this.setData({
|
|
|
imgUrls: res.image,
|
|
|
data: res,
|
|
|
srcList: srcListArr,
|
|
|
content_1: res.content_1,
|
|
|
content_2: res.content_2,
|
|
|
});
|
|
|
// console.log(srcListArr);
|
|
|
WxParse.wxParse('content_1', 'html', this.data.content_1, this, 5);
|
|
|
WxParse.wxParse('content_2', 'html', this.data.content_2, this, 5);
|
|
|
}).catch((err) => {
|
...
|
...
|
@@ -120,7 +141,9 @@ Page({ |
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
onShow: function () {
|
|
|
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: '案例详情',
|
|
|
})
|
|
|
},
|
|
|
|
|
|
/**
|
...
|
...
|
|