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

View File

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

View File

@ -66,7 +66,7 @@
</view> </view>
<view hidden="{{!worksImg}}"> <view hidden="{{!worksImg}}">
<swiper current="{{currentIndex}}" wx:if="{{haveData}}" bindchange="changeCurrent"> <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"> <swiper-item class="scrollView img-box">
<view> <view>
<image class="{{allIndex==index?'allActive':''}}" data-index="{{index}}" bindtap="chooseImg" mode="widthFix" src="{{item.img_thumb}}" lazy-load></image> <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 = { let obj = {
name: item.name, name: item.name,
id: item.id, id: item.id,
imgSrc: 'https://fenggu.scdxtc.cn' + item.release_img, imgSrc: urlPath.host + item.release_img,
img_thumb: 'https://fenggu.scdxtc.cn' + item.img_thumb, img_thumb: urlPath.host + item.img_thumb,
userId: item.user_id, userId: item.user_id,
time: item.create_time, time: item.create_time,
isShare: item.production_id //0未分享 isShare: item.production_id //0未分享