Commit 0b185588 by 张立顺

28号bug修复

1 parent bfac1e9d
......@@ -10,19 +10,27 @@ Component({
item: {
type: Object,
observer(n) {
// 如果是喜报和战报就跳过图片生成
if (n.type == 'warReport') {
// n.posterUrl
return this.setData({
poster: n.posterUrl,
show: true
})
}
n.posterUrl &&
this.checkUrl()
.then(result => {
result &&
this.setData({
poster: result,
show: true
})
})
.catch(err => {
console.log(err)
this.begin()
})
.then(result => {
result &&
this.setData({
poster: result,
show: true
})
})
.catch(err => {
console.log(err)
this.begin()
})
}
},
scrollImg: {
......@@ -46,23 +54,18 @@ Component({
methods: {
// 图片缓存 有取小程序缓存图片
checkUrl() {
let {
item: postObj
} = this.data
console.log('checkUrl')
let { item: postObj } = this.data
const fileList = wx.$storage.get('fileList') || [],
fn = wx.getFileSystemManager(),
{
findKey
} = this.data
{ findKey } = this.data
return new Promise((resolve, reject) => {
// return reject()
if (fileList.length) {
fn.readdir({
dirPath: wx.env.USER_DATA_PATH,
success({
files
}) {
success({ files }) {
let obj = fileList.find(e => e[findKey] === postObj[findKey])
const poster = files.find(s => obj?.path.includes(s))
wx.hideLoading()
......@@ -96,9 +99,7 @@ Component({
})
},
begin() {
let {
item
} = this.data
let { item } = this.data
item.posterUrl && this.getImageInfo(item)
},
check(n) {
......@@ -125,9 +126,7 @@ Component({
})
},
async init(n, ImgWidth, ImgHeight) {
const {
findKey
} = this.data
const { findKey } = this.data
// debugger
// const {pixelRatio} = wx.getWindowInfo()
let actualWidth = 247 //默认宽度
......@@ -159,9 +158,7 @@ Component({
},
this
),
{
userInfo
} = wx.$storage.get(),
{ userInfo } = wx.$storage.get(),
merchantName = userInfo.merchantName.length > 12 ? `${userInfo.merchantName.substring(0, 12)}...` : userInfo.merchantName
console.log(merchantName)
// console.log(n.activityName)
......@@ -169,19 +166,21 @@ Component({
textList = []
// debugger
if (n.type == 'warReport') {
imageList = [{
x: 0,
y: 0,
width: actualWidth + 32,
height: actualHeight + 82,
url: n.posterUrl
}]
imageList = [
{
x: 0,
y: 0,
width: actualWidth + 32,
height: actualHeight + 82,
url: n.posterUrl
}
]
textList = []
} else {
n.activityName = n.activityName.length > 12 ? `${n.activityName.substring(0, 12)}...` : n.activityName
imageList = [{
imageList = [
{
x: 0,
y: 0,
width: 279,
......@@ -196,7 +195,8 @@ Component({
url: n.posterUrl
}
]
textList = [{
textList = [
{
x: 12,
y: 14,
fontSize: 14,
......@@ -304,10 +304,8 @@ Component({
})
},
longpress() {
let {
_item_
} = this.data
this.triggerEvent('longtouch', _item_)
let { item } = this.data
this.triggerEvent('longtouch', item)
}
}
})
\ No newline at end of file
})
......@@ -25,6 +25,7 @@
box-sizing: border-box;
width: 500rpx;
max-height: 68%;
// height: 68%;
// height: 1108rpx;
overflow: scroll;
border-radius: 8rpx 8rpx 0 0;
......
......@@ -8,6 +8,7 @@
<scroll-view scroll-y scroll-x="false" style="height: 100%">
<!-- mode="widthFix" -->
<image
onload
src="{{poster}}"
mode="widthFix"
show-menu-by-longpress
......@@ -26,6 +27,7 @@
bindlongpress="longpress" />
</scroll-view>
<!-- </view> -->
`
</block>
</view>
<view class="btn">
......
......@@ -89,7 +89,8 @@ Component({
},
showPoster(e) {
const { item } = e.currentTarget.dataset
let updatedTime = deleteSecond(item.updatedTime)
let updatedTime = deleteSecond(item.createdTime)
this.setData({
// findKey: 'crowdFundActivityId',
posterItem: {
......
......@@ -34,7 +34,7 @@
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
time="{{item.createdTime}}">
<view class="warReportBox" wx:if="{{item.messageType == 2}}">
<view class="item">
<view class="label">当前产值</view>
......@@ -83,7 +83,7 @@
wx:key='index'
merchantName="{{item.merchantName}}"
messageType="{{item.messageType}}"
time="{{item.updatedTime}}">
time="{{item.createdTime}}">
<view wx:if="{{item.messageType == 1}}">
<view class="cell">
<view class="label">活动名称:</view>
......@@ -108,11 +108,11 @@
</view>
<view class="cell" wx:if="{{item.messageType == 5}}">
<view class="label">新车交付场景:</view>
<view class="value">{{item.productName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
<view class="cell" wx:if="{{item.messageType == 6}}">
<view class="label">0~12个月场景:</view>
<view class="value">{{item.activityName}}</view>
<view class="value">{{item.activityName||item.productName}}</view>
</view>
</msg-box>
</scroll-view>
......
......@@ -101,7 +101,7 @@
</view>
</view>
<!-- -->
<crowdfund-poster wx:show="{{!guideShow}}" item="{{posterItem}}" />
<crowdfund-poster wx:if="{{!guideShow}}" item="{{posterItem}}" />
<!-- 全屏视频组件 -->
<FullscreenVideo id="videocomp" src="{{videoSrc}}" title="{{videoTitle}}" />
......@@ -50,10 +50,12 @@ Component({
})
},
onBindRefresh() {
this.clientRefresh(true)
},
clientRefresh(isPull = false) {
this.getPMerchantInfo()
console.log('clientRefresh');
this.setData({
['pageObj.currentPage']: 1,
list: []
......
{
"appid": "wx24ebae5768e74138",
"appid": "wx2c28337db96364d2",
"projectname": "business-assistant",
"compileType": "miniprogram",
"packOptions": {
......
......@@ -153,6 +153,8 @@ export function setPrice(price) {
}
export function deleteSecond(time) {
console.log(time)
if (!time.length) return ''
time = time.split(' ')
let moth = time[0].split('-')
let hour = time[1].split(':')
......
......@@ -17,7 +17,7 @@ const systemInfo = wx.getSystemInfoSync()
const manual = false
const release = false
let index = 2
let index = 3
// 判断小程序环境
// develop:开发版(正常开发工具,测试时)
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!