Commit 0b185588 by 张立顺

28号bug修复

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