yvette 5 years ago
parent
commit
43ac7364f1
  1. 34
      pages/pbService/appreciate/index.js
  2. 4
      pages/pbService/appreciate/index.wxml

34
pages/pbService/appreciate/index.js

@ -6,6 +6,7 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
imgInfo:null,
videoTags:[], videoTags:[],
type:2, type:2,
picTags:[], picTags:[],
@ -14,13 +15,20 @@ Page({
page_no:1, page_no:1,
total:1, total:1,
list:[], list:[],
isTest:true isTest:true,
isIos:false
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
console.log()
if(wx.getSystemInfoSync().system.indexOf('iOS')!=-1){
this.setData({
isIos:true
})
}
commonApi._post("pbservice/Other/getClientConfig",{ commonApi._post("pbservice/Other/getClientConfig",{
unique_key:"wechatxcx" unique_key:"wechatxcx"
}).then(res=>{ }).then(res=>{
@ -103,15 +111,17 @@ Page({
gotoDetail:function(e){ gotoDetail:function(e){
let info = e.currentTarget.dataset.info; let info = e.currentTarget.dataset.info;
if(this.data.type==2) { if(this.data.type==2) {
commonApi.user_post("pbservice/Other/autoupload",{ if(this.data.isIos==false){
url:info.Pic this.setData({
}).then(res=>{ imgInfo:info
console.log(res) })
}
else {
wx.previewImage({ wx.previewImage({
urls: [res.data.url], urls: [info.Pic],
current:res.data.url current:info.pic
}) })
}) }
return; return;
} }
info = JSON.stringify(info); info = JSON.stringify(info);
@ -120,6 +130,14 @@ Page({
url: 'info/index?info='+info, url: 'info/index?info='+info,
}) })
}, },
closeImg:function(){
this.setData({
imgInfo:null
})
},
preventTouchMove:function(){
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成

4
pages/pbService/appreciate/index.wxml

@ -18,4 +18,8 @@
<view class="title textOver">{{item.Name}}</view> <view class="title textOver">{{item.Name}}</view>
<view class="subtitle textOver">{{item.CatalogName || item.Tag}}</view> <view class="subtitle textOver">{{item.CatalogName || item.Tag}}</view>
</view> </view>
</view>
<view class="mask" wx:if="{{imgInfo}}" catchtouchmove="preventTouchMove">
<view class="mask-bg" bindtap="closeImg"></view>
<image bindtap="closeImg" style="width:100%;height:100%;display:block" src="{{imgInfo.Pic}}" mode="aspectFit"></image>
</view> </view>
Loading…
Cancel
Save