master
chen 2021-12-13 17:49:19 +08:00
parent 8c9c72e3d1
commit bc6576943c
7 changed files with 37 additions and 26 deletions

View File

@ -1,6 +1,6 @@
// var host = "https://vote.daiguanyun.com";
var host = "https://vote.daiguanyun.com";
// var host = "http://192.168.2.15:8810";
var host = "https://fenggu.scdxtc.cn";
// var host = "https://fenggu.scdxtc.cn";
var config = {
host:host,
getopenid: host + "/index/getOpenId",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 KiB

BIN
img/background/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 KiB

View File

@ -38,7 +38,8 @@ Page({
worksImg:false,
creat_close:true,
currentIndex:0,
worksBox:false
worksBox:false,
isloading:false
},
// 下一个
nextEv(){
@ -74,19 +75,21 @@ Page({
this.setData({funBox:true,worksBox:false,creat_close:true})
},
chooseTitle(e) {
let that = this;
if (that.data.titleIndex != e.currentTarget.dataset.index) {
that.setData({
allIndex: '-1'
if(this.data.isloading==false) {
let that = this;
if (that.data.titleIndex != e.currentTarget.dataset.index) {
that.setData({
allIndex: '-1'
})
}
this.setData({
titleIndex: e.currentTarget.dataset.index,
showBtn: true,
worksImg:true,
currentIndex:0
})
this.getBottleWidgets(that.data.titlelist[that.data.titleIndex].id);
}
this.setData({
titleIndex: e.currentTarget.dataset.index,
showBtn: true,
worksImg:true,
currentIndex:0
})
this.getBottleWidgets(that.data.titlelist[that.data.titleIndex].id);
},
chooseImg(e) {
let that = this;
@ -168,7 +171,7 @@ Page({
wx.setStorageSync('token', res.data.data.token);
wx.setStorageSync('username', res.data.data.user.wx_name);
that.setBackGroundImg({
url: '../../img/background/1.png'
url: '../../img/background/3.png'
});
that.getBottleCategories();
}
@ -512,7 +515,7 @@ Page({
let newRes = JSON.parse(res.data);
if(newRes.code==0){
wx.downloadFile({
url: 'https://fenggu.scdxtc.cn' + newRes.data.src,
url: urlPath.host + newRes.data.src,
success: (res) => {
wx.showShareImageMenu({
path: res.tempFilePath,
@ -633,7 +636,7 @@ Page({
if(newIndex==0){
console.log(newIndex);
wx.downloadFile({
url: 'https://fenggu.scdxtc.cn' + newRes.data.src,
url: urlPath.host + newRes.data.src,
success: (res) => {
wx.showShareImageMenu({
path: res.tempFilePath,
@ -743,7 +746,7 @@ Page({
this.setData({
titlelist: res.data.data
})
this.getBottleWidgets(res.data.data[0].id);
// this.getBottleWidgets(res.data.data[0].id);
}
}
}
@ -751,6 +754,10 @@ Page({
},
// 获取标题下的图片
getBottleWidgets(id) {
this.setData({
isloading:true,
allList: []
})
wx.request({
url: urlPath.getBottleWidgets,
method: 'post',
@ -766,19 +773,22 @@ Page({
})
let newArr = [];
res.data.data.forEach(item => {
let url = 'https://fenggu.scdxtc.cn' + item.img;
this.downLoadImg(url, 'https://fenggu.scdxtc.cn' + item.img);
let url = urlPath.host + item.img;
this.downLoadImg(url, urlPath.host + item.img);
let obj = {
id: item.id,
name: item.name,
img: 'https://fenggu.scdxtc.cn' + item.img,
img_thumb:'https://fenggu.scdxtc.cn' + item.img_thumb,
img: urlPath.host + item.img,
img_thumb:urlPath.host + item.img_thumb,
}
newArr.push(obj)
})
this.setData({
allList: newArr,
})
this.setData({
isloading:false
})
} else {
// wx.showToast({
// title:'无内容',

View File

@ -1,3 +1,4 @@
{
"usingComponents": {}
"usingComponents": {},
"disableScroll":true
}

View File

@ -66,7 +66,7 @@
</view>
<view hidden="{{!worksImg}}">
<swiper current="{{currentIndex}}" wx:if="{{haveData}}" bindchange="changeCurrent">
<block wx:for="{{allList}}" wx:key="*this">
<block wx:for="{{allList}}" wx:key="index">
<swiper-item class="scrollView img-box">
<view>
<image class="{{allIndex==index?'allActive':''}}" data-index="{{index}}" bindtap="chooseImg" mode="widthFix" src="{{item.img_thumb}}" lazy-load></image>

View File

@ -47,8 +47,8 @@ Page({
let obj = {
name: item.name,
id: item.id,
imgSrc: 'https://fenggu.scdxtc.cn' + item.release_img,
img_thumb: 'https://fenggu.scdxtc.cn' + item.img_thumb,
imgSrc: urlPath.host + item.release_img,
img_thumb: urlPath.host + item.img_thumb,
userId: item.user_id,
time: item.create_time,
isShare: item.production_id //0未分享