Commit b109ef70 by 张立顺

bug修复

1 parent 612d808f
...@@ -46,17 +46,23 @@ Component({ ...@@ -46,17 +46,23 @@ Component({
methods: { methods: {
// 图片缓存 有取小程序缓存图片 // 图片缓存 有取小程序缓存图片
checkUrl() { checkUrl() {
let { item: postObj } = this.data let {
item: postObj
} = 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({ files }) { success({
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()
...@@ -90,7 +96,9 @@ Component({ ...@@ -90,7 +96,9 @@ Component({
}) })
}, },
begin() { begin() {
let { item } = this.data let {
item
} = this.data
item.posterUrl && this.getImageInfo(item) item.posterUrl && this.getImageInfo(item)
}, },
check(n) { check(n) {
...@@ -117,7 +125,9 @@ Component({ ...@@ -117,7 +125,9 @@ Component({
}) })
}, },
async init(n, ImgWidth, ImgHeight) { async init(n, ImgWidth, ImgHeight) {
const { findKey } = this.data const {
findKey
} = this.data
// debugger // debugger
// const {pixelRatio} = wx.getWindowInfo() // const {pixelRatio} = wx.getWindowInfo()
let actualWidth = 247 //默认宽度 let actualWidth = 247 //默认宽度
...@@ -139,7 +149,7 @@ Component({ ...@@ -139,7 +149,7 @@ Component({
width: actualWidth + 32, width: actualWidth + 32,
height: actualHeight + 82 height: actualHeight + 82
}) })
n.activityName = n.activityName.length > 12 ? `${n.activityName.substring(0, 12)}...` : n.activityName
const drawfun = new Draw( // 大画布 const drawfun = new Draw( // 大画布
{ {
// height: 554 // height: 554
...@@ -149,13 +159,29 @@ Component({ ...@@ -149,13 +159,29 @@ 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)
let imageList = [],
textList = []
// debugger // debugger
let imageList = [
{
if (n.type == 'warReport') {
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 = [{
x: 0, x: 0,
y: 0, y: 0,
width: 279, width: 279,
...@@ -170,8 +196,7 @@ Component({ ...@@ -170,8 +196,7 @@ Component({
url: n.posterUrl url: n.posterUrl
} }
] ]
let textList = [ textList = [{
{
x: 12, x: 12,
y: 14, y: 14,
fontSize: 14, fontSize: 14,
...@@ -204,18 +229,6 @@ Component({ ...@@ -204,18 +229,6 @@ Component({
} }
} }
] ]
if (n.type == 'warReport') {
imageList = [
{
x: 0,
y: 0,
width: actualWidth + 32,
height: actualHeight + 82,
url: n.posterUrl
}
]
textList = []
} }
let res = await drawfun.begin({ let res = await drawfun.begin({
...@@ -278,6 +291,7 @@ Component({ ...@@ -278,6 +291,7 @@ Component({
}) })
}, },
hide() { hide() {
console.log('hide')
this.setData({ this.setData({
show: false, show: false,
poster: '' poster: ''
...@@ -290,7 +304,9 @@ Component({ ...@@ -290,7 +304,9 @@ Component({
}) })
}, },
longpress() { longpress() {
let { _item_ } = this.data let {
_item_
} = this.data
this.triggerEvent('longtouch', _item_) this.triggerEvent('longtouch', _item_)
} }
} }
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
<!-- catchtouchmove="noScroll" catchtouchmove="noScroll" --> <!-- catchtouchmove="noScroll" catchtouchmove="noScroll" -->
<view class="layout"> <view class="layout">
<view class="bg" bindtap="hide" /> <view class="bg" bindtap="hide" />
<view class="poster {{item.type == 'warReport'?'pd':''}}" style="height:{{height}}"> <!-- style="height:{{height}}" -->
<view class="poster {{item.type == 'warReport'?'pd':''}}">
<block wx:if="{{scrollImg}}"> <block wx:if="{{scrollImg}}">
<scroll-view scroll-y scroll-x="false" style="height: 100%"> <scroll-view scroll-y scroll-x="false" style="height: 100%">
<!-- mode="widthFix" -->
<image <image
src="{{poster}}" src="{{poster}}"
mode="widthFix" mode="widthFix"
...@@ -15,10 +17,10 @@ ...@@ -15,10 +17,10 @@
</block> </block>
<block wx:else> <block wx:else>
<!-- <view class="poster {{item.type == 'warReport'?'pd':''}}"> --> <!-- <view class="poster {{item.type == 'warReport'?'pd':''}}"> -->
<!-- mode="widthFix" -->
<scroll-view scroll-y scroll-x="false" style="height: 100%"> <scroll-view scroll-y scroll-x="false" style="height: 100%">
<image <image
src="{{poster}}" src="{{poster}}"
class="poster"
mode="widthFix" mode="widthFix"
show-menu-by-longpress show-menu-by-longpress
bindlongpress="longpress" /> bindlongpress="longpress" />
......
// packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js // packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.js
import wxqrcode from '~/utils/lib/wxqrcode' import wxqrcode from '~/utils/lib/wxqrcode'
import { import { IMG_URL } from '~/utils/constantData'
IMG_URL import { deleteSecond } from '~/utils/format'
} from '~/utils/constantData'
import outputApi from '~/api/outputApi/index' import outputApi from '~/api/outputApi/index'
const IMAGES = Object.freeze({ const IMAGES = Object.freeze({
download: `${IMG_URL}/output/download.webp` download: `${IMG_URL}/output/download.webp`
...@@ -14,7 +13,7 @@ Component({ ...@@ -14,7 +13,7 @@ Component({
properties: { properties: {
orderObj: { orderObj: {
type: Object, type: Object,
value: () => { }, value: () => {},
observer(n) { observer(n) {
n && this.dealStaffList() n && this.dealStaffList()
} }
...@@ -33,7 +32,8 @@ Component({ ...@@ -33,7 +32,8 @@ Component({
IMAGES, IMAGES,
isShowTip: true, isShowTip: true,
isShowPoster: false, isShowPoster: false,
orderFormList: [{ orderFormList: [
{
label: '总场次', label: '总场次',
name: 'totalNum' name: 'totalNum'
}, },
...@@ -124,9 +124,7 @@ Component({ ...@@ -124,9 +124,7 @@ Component({
}) })
}, },
handleMore(e) { handleMore(e) {
var { var { idx } = e.currentTarget.dataset
idx
} = e.currentTarget.dataset
var list = this.data.orderObj var list = this.data.orderObj
var item = list.activityList[idx] var item = list.activityList[idx]
list.activityList[idx].showStaffList = list.activityList[idx].showStaffList.concat(item.staffList.length > 10 ? item.staffList.slice(0, 10) : item.staffList) list.activityList[idx].showStaffList = list.activityList[idx].showStaffList.concat(item.staffList.length > 10 ? item.staffList.slice(0, 10) : item.staffList)
...@@ -136,9 +134,7 @@ Component({ ...@@ -136,9 +134,7 @@ Component({
}) })
}, },
handleCopy(e) { handleCopy(e) {
var { var { idx } = e.currentTarget.dataset
idx
} = e.currentTarget.dataset
var currentItem = this.data.orderObj.activityList[idx] var currentItem = this.data.orderObj.activityList[idx]
var qr = wxqrcode.createQrCodeImg(currentItem.activityUrl) var qr = wxqrcode.createQrCodeImg(currentItem.activityUrl)
const base64src = function (base64data) { const base64src = function (base64data) {
...@@ -168,7 +164,7 @@ Component({ ...@@ -168,7 +164,7 @@ Component({
path: obj.path path: obj.path
}) })
}, },
fail() { } fail() {}
}) })
}) })
}, },
...@@ -177,93 +173,101 @@ Component({ ...@@ -177,93 +173,101 @@ Component({
// wx.$router.jumpH5(item.activityUrl) // wx.$router.jumpH5(item.activityUrl)
}, },
async download(e) { async download(e) {
const { const { item } = e.currentTarget.dataset
item // posterObj = this.selectComponent('#crowdPoster'),
} = e.currentTarget.dataset, // { options } = wx.$router.getPageInstance()
posterObj = this.selectComponent('#crowdPoster'), const { options } = wx.$router.getPageInstance()
{ options } = wx.$router.getPageInstance() // console.log(options)
console.log(options) // try {
try { // let flag = await posterObj.check(item)
let flag = await posterObj.check(item) // posterObj.setData({
posterObj.setData({ // poster: flag,
poster: flag, // show: true
show: true // })
}) // } catch (error) {
} catch (error) {
wx.$api.showLoading('加载中...') wx.$api.showLoading('加载中...')
outputApi.getPosterUrl({ outputApi
.getPosterUrl({
id: item.activityId id: item.activityId
}).then(res => { })
.then(res => {
item.posterUrl = res item.posterUrl = res
this.setData({ this.setData({
crowdPosterItem: item, crowdPosterItem: item,
isShowTip: false isShowTip: false
}) })
}).catch(() => { })
.catch(() => {
wx.$api.showToast('下载海报失败') wx.$api.showToast('下载海报失败')
}) })
} // }
}, },
/**长按海报 */ /**长按海报 */
async longtouch(e) { async longtouch(e) {
console.log('长按海报', e) console.log('长按海报', e)
let { let { activityId } = e.detail
activityId
} = e.detail
const res = await outputApi.reportPosterTrack({ const res = await outputApi.reportPosterTrack({
activityId activityId
}) })
this.triggerEvent('posterTrack') this.triggerEvent('posterTrack')
}, },
/**长按战报/喜报 */ /**长按战报/喜报 */
async handlePosterTouch(e) { async handlePosterTouch(e) {},
},
/**战报 */ /**战报 */
handleReport(e) { handleReport(e) {
const { const { item, idx } = e.currentTarget.dataset
item, wx.$api.showLoading('战报生成中')
idx outputApi
} = e.currentTarget.dataset .getNewReportUrl({ activityId: item.activityId })
wx.$api.showLoading("战报生成中") .then(res => {
outputApi.getNewReportUrl({ activityId: item.activityId }).then(res => {
// console.log(res) // console.log(res)
if (!res.url) { if (!res.url) {
wx.$api.showToast('战报生成失败') wx.$api.showToast('战报生成失败')
return true return true
} }
var posterItem = { var posterItem = {
...item,
posterUrl: res.url, posterUrl: res.url,
date: res.updatedDate updatedTime:deleteSecond( res.updatedDate) ,
type : 'warReport'
} }
this.setData({ this.setData({
posterItem: posterItem, crowdPosterItem: posterItem,
isShowPoster: true isShowTip: false
}) })
wx.$api.hideLoading() wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem }) this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
}).catch(() => { })
.catch(() => {
wx.$api.showToast('下载战报失败') wx.$api.showToast('下载战报失败')
}).finally(() => { })
.finally(() => {
wx.$api.hideLoading() wx.$api.hideLoading()
}) })
}, },
/**喜报 */ /**喜报 */
handleXiReport(e) { handleXiReport(e) {
const { const { item } = e.currentTarget.dataset
item console.log(item);
} = e.currentTarget.dataset
if (!item.goodUrl) { if (!item.goodUrl) {
wx.$api.showToast('喜报生成失败') wx.$api.showToast('喜报生成失败')
return true return true
} }
// console.log(item);
// debugger
var posterItem = { var posterItem = {
...item,
posterUrl: item.goodUrl, posterUrl: item.goodUrl,
date: item.goodReportDate // date: item.goodReportDate,
updatedTime:deleteSecond( item.goodReportDate) ,
type : 'warReport'
} }
this.setData({ this.setData({
posterItem: posterItem, // posterItem: posterItem,
isShowPoster: true // isShowPoster: true,
crowdPosterItem: posterItem,
isShowTip: false
}) })
} }
} }
......
...@@ -23,7 +23,12 @@ ...@@ -23,7 +23,12 @@
<view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view> <view class="down-tips" wx:if="{{index == 0 && isShowTip}}">下载活动海报分享给门店开展活动</view>
</view> </view>
<view class="content"> <view class="content">
<view class="content-row" wx:for="{{merchantFormList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> <view
class="content-row"
wx:for="{{merchantFormList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="content-label">{{subItem.label}}</view> <view class="content-label">{{subItem.label}}</view>
<view class="content-txt {{subItem.className}}"> <view class="content-txt {{subItem.className}}">
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text> <text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
...@@ -34,20 +39,26 @@ ...@@ -34,20 +39,26 @@
<view class="content-rank" wx:if="{{item.showStaffList.length}}"> <view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-title">员工任务排名</view> <view class="rank-title">员工任务排名</view>
<view class="rank-table"> <view class="rank-table">
<view wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> <view
wx:for="{{item.showStaffList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="rank"> <view class="rank">
<view class="rank-left"> <view class="rank-left">
<view class="rank-num">{{idx + 1}}</view> <view class="rank-num">{{idx + 1}}</view>
<view class="rank-head"> <view class="rank-head">
<glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp"></glsx-image> <glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp" />
<image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}"></image> <image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}" />
<glsx-image wx:else src="output/icon-head.webp"></glsx-image> <glsx-image wx:else src="output/icon-head.webp" />
</view> </view>
<view class="rank-content"> <view class="rank-content">
<view class="rank-row"> <view class="rank-row">
<text wx:if="{{subItem.goodUrl}}" class="rank-row-name" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}{{}}</text> <text wx:if="{{subItem.goodUrl}}" class="rank-row-name" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}{{}}</text>
<text wx:else class="name-disabled">{{subItem.shareName}}</text> <text wx:else class="name-disabled" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text>
<view class="down-tips" wx:if="{{orderObj.staffIdx == index && idx == 0}}">点击员工姓名看喜报</view> <view class="down-tips" wx:if="{{orderObj.staffIdx == index && idx == 0}}">
点击员工姓名看喜报
</view>
<text class="rank-row-dept">{{subItem.departmentName || ''}}</text> <text class="rank-row-dept">{{subItem.departmentName || ''}}</text>
</view> </view>
<view class="rank-row"> <view class="rank-row">
...@@ -56,23 +67,32 @@ ...@@ -56,23 +67,32 @@
</view> </view>
</view> </view>
</view> </view>
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}</view> <view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">
¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}
</view>
<view wx:else class="rank-price">暂无业绩</view> <view wx:else class="rank-price">暂无业绩</view>
</view> </view>
</view> </view>
<view wx:if="{{item.staffList.length}}" class="btn-more" bindtap="handleMore" data-idx="{{index}}"> <view
<glsx-image class="icon-more" src="output/icon-more.webp"></glsx-image> wx:if="{{item.staffList.length}}"
class="btn-more"
bindtap="handleMore"
data-idx="{{index}}">
<glsx-image class="icon-more" src="output/icon-more.webp" />
</view> </view>
</view> </view>
</view> </view>
<!-- 诊断 --> <!-- 诊断 -->
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}"> <view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view class="suggest-title"># 活动诊断</view> <view class="suggest-title"># 活动诊断</view>
<view class="suggest-txt"> <view class="suggest-txt">{{item.suggestTxt}}推荐以下建议:</view>
{{item.suggestTxt}}推荐以下建议:
</view>
<view class="suggest-block"> <view class="suggest-block">
<view class="suggest-step" wx:for="{{item.suggestList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> <view
class="suggest-step"
wx:for="{{item.suggestList}}"
wx:for-item="subItem"
wx:for-index="idx"
wx:key="idx">
<view class="step-label">建议{{idx + 1}}</view> <view class="step-label">建议{{idx + 1}}</view>
<view class="step-txt">{{subItem}}</view> <view class="step-txt">{{subItem}}</view>
</view> </view>
...@@ -80,8 +100,12 @@ ...@@ -80,8 +100,12 @@
</view> </view>
<!-- 战报 --> <!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}"> <view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view class="report-left" bindtap="handleReport" data-item="{{item}}" data-idx="{{index}}"> <view
<glsx-image class="icon-report" src="output/icon-report.webp"></glsx-image> class="report-left"
bindtap="handleReport"
data-item="{{item}}"
data-idx="{{index}}">
<glsx-image class="icon-report" src="output/icon-report.webp" />
生成最新战报 生成最新战报
</view> </view>
<view wx:if="{{item.reportDate}}">最新更新:{{item.reportDate}}</view> <view wx:if="{{item.reportDate}}">最新更新:{{item.reportDate}}</view>
...@@ -89,5 +113,14 @@ ...@@ -89,5 +113,14 @@
</view> </view>
</view> </view>
</view> </view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
<poster posterItem="{{posterItem}}" id="poster" show="{{isShowPoster}}" bindlongtouch="handlePosterTouch" />
\ No newline at end of file \ No newline at end of file
<crowdfund-poster
item="{{crowdPosterItem}}"
id="crowdPoster"
scrollImg="{{false}}"
bindlongtouch="longtouch" />
<!-- <poster
posterItem="{{posterItem}}"
id="poster"
show="{{isShowPoster}}"
bindlongtouch="handlePosterTouch" /> -->
...@@ -3,7 +3,6 @@ import outputApi from '~/api/outputApi/index' ...@@ -3,7 +3,6 @@ import outputApi from '~/api/outputApi/index'
import { IMG_URL } from '~/utils/constantData' import { IMG_URL } from '~/utils/constantData'
import { getNowMonth } from '~/utils/format' import { getNowMonth } from '~/utils/format'
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -18,15 +17,20 @@ Page({ ...@@ -18,15 +17,20 @@ Page({
scene4: null scene4: null
}, },
sceneActive: 4, sceneActive: 4,
scenePriceList: [{ scenePriceList: [
total: 0.00 {
}, { total: 0.0
total: 0.00 },
}, { {
total: 0.00 total: 0.0
}, { },
total: 0.00 {
}], total: 0.0
},
{
total: 0.0
}
],
// 活动内容 // 活动内容
scrollLeft: 0, scrollLeft: 0,
activityActive: 0, activityActive: 0,
...@@ -82,9 +86,9 @@ Page({ ...@@ -82,9 +86,9 @@ Page({
setCurActivity() { setCurActivity() {
this.setData({ this.setData({
activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + (this.data.sceneActive)])), activityList: JSON.parse(JSON.stringify(this.data.sceneActivityObj['scene' + this.data.sceneActive])),
// productStatus:0未申请;1申请中;2已开通;3:已结束 // productStatus:0未申请;1申请中;2已开通;3:已结束
isShowData: [2, 3].includes(+this.data.sceneActivityObj['scene' + (this.data.sceneActive)][this.data.activityActive].productStatus) isShowData: [2, 3].includes(+this.data.sceneActivityObj['scene' + this.data.sceneActive][this.data.activityActive].productStatus)
}) })
// activityActive为0时,触发置顶(左) // activityActive为0时,触发置顶(左)
if (this.data.activityActive == 0) { if (this.data.activityActive == 0) {
...@@ -226,7 +230,7 @@ Page({ ...@@ -226,7 +230,7 @@ Page({
var actCodeList = actList.map(item => item.productCode) var actCodeList = actList.map(item => item.productCode)
var curTotal = 0 var curTotal = 0
var otherTotal = 0 var otherTotal = 0
var otherScene = isFirst ? 2 : (this.data.sceneActive == 2 ? 3 : 2) var otherScene = isFirst ? 2 : this.data.sceneActive == 2 ? 3 : 2
res.forEach(item => { res.forEach(item => {
var idx = actCodeList.findIndex(i => i == item.productCode) var idx = actCodeList.findIndex(i => i == item.productCode)
if (idx != -1) { if (idx != -1) {
...@@ -252,11 +256,11 @@ Page({ ...@@ -252,11 +256,11 @@ Page({
} }
// 总金额 // 总金额
this.setData({ this.setData({
['scenePriceList[' + (isFirst ? 1 : (this.data.sceneActive - 1)) + '].total']: curTotal.toFixed(2) ['scenePriceList[' + (isFirst ? 1 : this.data.sceneActive - 1) + '].total']: curTotal.toFixed(2)
}) })
if (isChangeOtherTotal) { if (isChangeOtherTotal) {
this.setData({ this.setData({
['scenePriceList[' + (isFirst ? 2 : (otherScene - 1)) + '].total']: otherTotal.toFixed(2) ['scenePriceList[' + (isFirst ? 2 : otherScene - 1) + '].total']: otherTotal.toFixed(2)
}) })
} }
!isFirst && this.setCurActivity() !isFirst && this.setCurActivity()
...@@ -289,7 +293,9 @@ Page({ ...@@ -289,7 +293,9 @@ Page({
getActivityRevenue(isFirst = false) { getActivityRevenue(isFirst = false) {
wx.showLoading() wx.showLoading()
var params = this.dealSearchStatus() var params = this.dealSearchStatus()
outputApi.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params }).then(res => { outputApi
.getActivityRevenue({ merchantId: this.data.merchantInfo.merchantId, ...params })
.then(res => {
// console.log(this.data.sceneActivityObj, '++++++') // console.log(this.data.sceneActivityObj, '++++++')
var actList = this.data.sceneActivityObj['scene' + (isFirst ? 4 : this.data.sceneActive)] var actList = this.data.sceneActivityObj['scene' + (isFirst ? 4 : this.data.sceneActive)]
var total = 0 var total = 0
...@@ -306,12 +312,12 @@ Page({ ...@@ -306,12 +312,12 @@ Page({
let shareFlag = false let shareFlag = false
curItem.activityList.forEach((k, kIdx) => { curItem.activityList.forEach((k, kIdx) => {
// 员工喜报 // 员工喜报
if(curItem.staffIdx == -1 && k.staffList?.length && k.staffList[0].imageUrl) { if (curItem.staffIdx == -1 && k.staffList?.length && k.staffList[0].imageUrl) {
curItem.staffIdx = kIdx curItem.staffIdx = kIdx
} }
// 分享按钮判断shareStatus:活动分享状态 0:未分享 1:已分享 // 分享按钮判断shareStatus:活动分享状态 0:未分享 1:已分享
if (k.activityStatus == 2 && k.shareStatus == 0) { if (k.activityStatus == 2 && k.shareStatus == 0) {
curItem.shareBtnIdx = shareFlag ? -1 : (kIdx + '') curItem.shareBtnIdx = shareFlag ? -1 : kIdx + ''
shareFlag = true shareFlag = true
} }
// 时间 // 时间
...@@ -382,7 +388,8 @@ Page({ ...@@ -382,7 +388,8 @@ Page({
this.setData({ this.setData({
['scenePriceList[3].total']: total.toFixed(2) ['scenePriceList[3].total']: total.toFixed(2)
}) })
}).finally(() => { })
.finally(() => {
wx.hideLoading() wx.hideLoading()
}) })
}, },
...@@ -391,35 +398,36 @@ Page({ ...@@ -391,35 +398,36 @@ Page({
async handleBtnShare(e) { async handleBtnShare(e) {
const idx = this.data.activityList[this.data.activityActive].outputData.shareBtnIdx const idx = this.data.activityList[this.data.activityActive].outputData.shareBtnIdx
const item = this.data.activityList[this.data.activityActive].outputData.activityList[idx] const item = this.data.activityList[this.data.activityActive].outputData.activityList[idx]
const posterObj = this.selectComponent('#crowdPoster') // const posterObj = this.selectComponent('#crowdPoster')
const { options } = wx.$router.getPageInstance() const { options } = wx.$router.getPageInstance()
try { // try {
let flag = await posterObj.check(item) // let flag = await posterObj.check(item)
posterObj.setData({ // posterObj.setData({
poster: flag, // poster: flag,
show: true // show: true
}) // })
} catch (error) { // } catch (error) {
wx.$api.showLoading('加载中...') wx.$api.showLoading('加载中...')
outputApi.getPosterUrl({ outputApi
.getPosterUrl({
id: item.activityId id: item.activityId
}).then(res => { })
.then(res => {
item.posterUrl = res item.posterUrl = res
this.setData({ this.setData({
crowdPosterItem: item, crowdPosterItem: item,
isShowTip: false isShowTip: false
}) })
}).catch(() => { })
.catch(() => {
wx.$api.showToast('下载海报失败') wx.$api.showToast('下载海报失败')
}) })
} // }
}, },
/**长按海报 */ /**长按海报 */
async longtouch(e) { async longtouch(e) {
console.log('长按海报', e) console.log('长按海报', e)
let { let { activityId } = e.detail
activityId
} = e.detail
const res = await outputApi.reportPosterTrack({ const res = await outputApi.reportPosterTrack({
activityId activityId
}) })
...@@ -467,7 +475,7 @@ Page({ ...@@ -467,7 +475,7 @@ Page({
*/ */
onReady() { onReady() {
wx.setNavigationBarTitle({ wx.setNavigationBarTitle({
title: this.data.merchantInfo.merchantName, title: this.data.merchantInfo.merchantName
}) })
} }
}) })
...@@ -66,4 +66,4 @@ ...@@ -66,4 +66,4 @@
</view> </view>
</view> </view>
</view> </view>
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{false}}" bindlongtouch="longtouch" />
\ No newline at end of file \ No newline at end of file
<crowdfund-poster item="{{crowdPosterItem}}" id="crowdPoster" scrollImg="{{true}}" bindlongtouch="longtouch" />
\ No newline at end of file \ No newline at end of file
// pages/apply/apply.js
const navStyle = 'background-color: transparent;'
import { IMG_URL } from '~/utils/constantData.js'
import applyApi from '~/api/applyApi/index'
// `${IMG_URL}index/car2.png`,
//本地图片路径
let IMG_URLLocal = '../../images/'
Page({
/**
* 页面的初始数据
*/
data: {
navStyle,
IMG_URL,
carObj: {
name: '',
model: '',
selNum: '',
contact: '',
phone: ''
}
},
// navbar高度设置
navbarReady(e) {
let { height, statusBarHeight } = e.detail
this.setData({
tabBarStyle: height / 2 + statusBarHeight
// headerHeight: height / 2 + statusBarHeight + 88*2
})
},
// 提交信息
applyFn() {
let { name } = this.data.carObj
console.log('name: ', name)
if (!name) {
wx.pro.showToast({
title: '请输入开店名称',
icon: 'error'
})
return
}
this.submitForm()
// console.log(123)
},
submitForm() {
let { carObj, clueId } = this.data
let { userInfo } = wx.$storage.get()
let MerchantInfo = userInfo.subLoginUser
let params = {
serviceMerchantId: MerchantInfo.merchantId,
serviceMerchantName: MerchantInfo.merchantName,
serviceMerchantPhone: MerchantInfo.phone,
merchantContact: carObj.contact,
phone: carObj.phone,
applyMerchantName: carObj.name,
carType: carObj.model,
baseCustomer: carObj.selNum,
clueId
}
// return wx.$api.showToast('申请成功')
applyApi
.merchantApply(params)
.then(result => {
console.log(result)
if (result) {
wx.$api.showToast('申请成功')
setTimeout(() => {
wx.$router.back(page => {
let node = page.selectComponent('#indexclue')
node && node.getClueInit()
})
}, 1000)
}
})
.catch(err => {})
},
bindinputFn(e) {
// console.log("e: ", e);
let name = e.currentTarget.dataset.name
let content = e.detail.value
this.setData({
[`carObj.${name}`]: content
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {},
onRoute(params) {
// 线索id
this.setData({
clueId: params
})
// console.log('params: ', params)
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
})
{
"usingComponents": {},
"navigationStyle": "custom",
"onReachBottomDistance": 10,
"enablePullDownRefresh": true
}
\ No newline at end of file \ No newline at end of file
/* pages/apply/apply.wxss */
page {
background: white;
height: 100%;
position: relative;
}
.apply {
.head {
width: 100%;
}
.introduce {
height: 360rpx;
}
.content {
padding: 16px 17px 0;
.item{
}
.top{
display: flex;
align-items: center;
.line{
width: 3px;
height: 14px;
background:var(--btnColor);
}
.title{
margin-left: 8px;
font-weight: 500;
font-size: 18px;
color: #323436;
}
}
.inp-wrap{
.title{
margin-top: 8px;
margin-bottom: 8px;
font-weight: 500;
font-size: 14px;
color: #323436;
.point{
color: #F35251;
}
}
.inp{
padding: 7px 12px;
border: 1px solid #E3E4E8;
border-radius: 2px;
}
.inp-placeholder {
font-family: PingFangSC-Regular;
font-size: 24rpx;
color: #8A8C90;
}
}
}
.btn {
width: 648rpx;
font-weight: 500;
font-size: 17px;
color: #ffffff;
background: var(--btnColor);
position: absolute;
bottom: 40rpx;
left: 50%;
transform: translateX(-50%);
}
}
<!-- pages/apply/apply.wxml -->
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请业务
</navigation-bar>
<view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/apply-bg.png" />
<view class="content" hover-class="none" hover-stop-propagation>
<view class="top">
<view class="line" hover-class="none" hover-stop-propagation="false" />
<view class="title" hover-class="none" hover-stop-propagation="false">开通门店账号</view>
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false" style="margin-top: 32rpx;">
开店名称
<text class="point">*</text>
</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.name}}" bindinput="bindinputFn" data-name="name" maxlength="{{30}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面车型</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.model}}" bindinput="bindinputFn" data-name="model" maxlength="{{30}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">店面新车销量/基盘客户</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.selNum}}" bindinput="bindinputFn" data-name="selNum" maxlength="{{30}}" placeholder="请输入30个字符以内" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">门店联系人</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.contact}}" bindinput="bindinputFn" data-name="contact" placeholder="请输入联系人" />
</view>
<view class="inp-wrap">
<view class="title" hover-class="none" hover-stop-propagation="false">联系人手机号</view>
<input class="inp" placeholder-class="inp-placeholder" value="{{carObj.phone}}" bindinput="bindinputFn" data-name="phone" placeholder="请输入手机号" />
</view>
</view>
<button class="btn" bindtap="applyFn">提交开店信息</button>
</view>
\ No newline at end of file \ No newline at end of file
{ {
"appid": "wx2c28337db96364d2", "appid": "wx24ebae5768e74138",
"projectname": "business-assistant", "projectname": "business-assistant",
"compileType": "miniprogram", "compileType": "miniprogram",
"packOptions": { "packOptions": {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!