Commit b109ef70 by 张立顺

bug修复

1 parent 612d808f
...@@ -12,17 +12,17 @@ Component({ ...@@ -12,17 +12,17 @@ Component({
observer(n) { observer(n) {
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,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,73 +159,76 @@ Component({ ...@@ -149,73 +159,76 @@ 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, x: 0,
y: 0, y: 0,
width: 279, width: actualWidth + 32,
height: 66, height: actualHeight + 82,
url: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/poster-bg.png'
},
{
x: 16,
y: 70,
width: actualWidth,
height: actualHeight,
url: n.posterUrl url: n.posterUrl
} }]
] textList = []
let textList = [ } else {
{ n.activityName = n.activityName.length > 12 ? `${n.activityName.substring(0, 12)}...` : n.activityName
x: 12, imageList = [{
y: 14,
fontSize: 14,
color: '#2D2D33',
text: merchantName,
textBaseline: 'top'
},
{
x: 12,
y: 36,
fontSize: 14,
color: '#1B233D',
text: n.activityName,
textBaseline: 'top',
fontWeight: 500
},
{
x: 14 + drawfun.getTextWidth(n.activityName, 14) + 9,
y: 37,
fontSize: 10,
color: '#4466F0',
text: '众筹',
textBaseline: 'top',
border: {
width: 1,
color: '#4466F0',
radius: 2,
padding: [2, 5],
opacity: 0.5
}
}
]
if (n.type == 'warReport') {
imageList = [
{
x: 0, x: 0,
y: 0, y: 0,
width: actualWidth + 32, width: 279,
height: actualHeight + 82, height: 66,
url: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/output/poster-bg.png'
},
{
x: 16,
y: 70,
width: actualWidth,
height: actualHeight,
url: n.posterUrl url: n.posterUrl
} }
] ]
textList = [] textList = [{
x: 12,
y: 14,
fontSize: 14,
color: '#2D2D33',
text: merchantName,
textBaseline: 'top'
},
{
x: 12,
y: 36,
fontSize: 14,
color: '#1B233D',
text: n.activityName,
textBaseline: 'top',
fontWeight: 500
},
{
x: 14 + drawfun.getTextWidth(n.activityName, 14) + 9,
y: 37,
fontSize: 10,
color: '#4466F0',
text: '众筹',
textBaseline: 'top',
border: {
width: 1,
color: '#4466F0',
radius: 2,
padding: [2, 5],
opacity: 0.5
}
}
]
} }
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,8 +304,10 @@ Component({ ...@@ -290,8 +304,10 @@ Component({
}) })
}, },
longpress() { longpress() {
let { _item_ } = this.data let {
_item_
} = this.data
this.triggerEvent('longtouch', _item_) this.triggerEvent('longtouch', _item_)
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -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,19 +32,20 @@ Component({ ...@@ -33,19 +32,20 @@ Component({
IMAGES, IMAGES,
isShowTip: true, isShowTip: true,
isShowPoster: false, isShowPoster: false,
orderFormList: [{ orderFormList: [
label: '总场次', {
name: 'totalNum' label: '总场次',
}, name: 'totalNum'
{ },
label: '总订单', {
name: 'totalOrderCount' label: '总订单',
}, name: 'totalOrderCount'
{ },
label: '成交金额', {
name: 'totalAmount', label: '成交金额',
prefix: '¥' name: 'totalAmount',
} prefix: '¥'
}
], ],
merchantFormList: [ merchantFormList: [
{ {
...@@ -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,94 +173,102 @@ Component({ ...@@ -177,94 +173,102 @@ 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
outputApi.getPosterUrl({ .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({ }
posterItem: posterItem, this.setData({
isShowPoster: true crowdPosterItem: posterItem,
isShowTip: false
})
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
})
.catch(() => {
wx.$api.showToast('下载战报失败')
})
.finally(() => {
wx.$api.hideLoading()
}) })
wx.$api.hideLoading()
this.triggerEvent('handleZhanReport', { item: item, idx: idx, posterItem: posterItem })
}).catch(() => {
wx.$api.showToast('下载战报失败')
}).finally(() => {
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
}) })
} }
} }
})
\ No newline at end of file \ No newline at end of file
})
<!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml --> <!-- packageOutput/pages/summary/components/outputCrowdfund/outputCrowdfund.wxml -->
<wxs src="../../index.wxs" module="filter" /> <wxs src="../../index.wxs" module="filter" />
<view class="crowdfund-layout"> <view class="crowdfund-layout">
<view class="box order"> <view class="box order">
<view class="order-block" wx:for="{{orderFormList}}" wx:key="index"> <view class="order-block" wx:for="{{orderFormList}}" wx:key="index">
<view class="order-txt font-number"> <view class="order-txt font-number">
<text wx:if="{{item.prefix}}">{{item.prefix}}</text> <text wx:if="{{item.prefix}}">{{item.prefix}}</text>
{{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}} {{filter.money_three_for_two_thousands(orderObj[item.name] || 0.00)}}
</view> </view>
<view class="order-label">{{item.label}}</view> <view class="order-label">{{item.label}}</view>
</view> </view>
</view> </view>
<view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index"> <view class="box merchant" wx:for="{{orderObj.activityList}}" wx:key="index">
<view class="head"> <view class="head">
<!-- text-hide --> <!-- text-hide -->
<view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}"> <view class=" head-title" bindtap="handleJumpH5" data-item="{{item}}">
{{item.activityName}} {{item.activityName}}
</view> </view>
<view class="head-link" bindtap="download" data-item="{{item}}"> <view class="head-link" bindtap="download" data-item="{{item}}">
<image src="{{IMAGES.download}}" class="downloadIcon" webp></image> <image src="{{IMAGES.download}}" class="downloadIcon" webp></image>
母链海报 母链海报
</view> </view>
<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
<view class="content-label">{{subItem.label}}</view> class="content-row"
<view class="content-txt {{subItem.className}}"> wx:for="{{merchantFormList}}"
<text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text> wx:for-item="subItem"
{{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}} wx:for-index="idx"
</view> wx:key="idx">
</view> <view class="content-label">{{subItem.label}}</view>
<!-- 排名 --> <view class="content-txt {{subItem.className}}">
<view class="content-rank" wx:if="{{item.showStaffList.length}}"> <text wx:if="{{subItem.prefix}}">{{subItem.prefix}}</text>
<view class="rank-title">员工任务排名</view> {{subItem.isNumber ? filter.money_three_for_two_thousands(item[subItem.name]) : item[subItem.name]}}
<view class="rank-table"> </view>
<view wx:for="{{item.showStaffList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> </view>
<view class="rank"> <!-- 排名 -->
<view class="rank-left"> <view class="content-rank" wx:if="{{item.showStaffList.length}}">
<view class="rank-num">{{idx + 1}}</view> <view class="rank-title">员工任务排名</view>
<view class="rank-head"> <view class="rank-table">
<glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp"></glsx-image> <view
<image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}"></image> wx:for="{{item.showStaffList}}"
<glsx-image wx:else src="output/icon-head.webp"></glsx-image> wx:for-item="subItem"
</view> wx:for-index="idx"
<view class="rank-content"> wx:key="idx">
<view class="rank-row"> <view class="rank">
<text wx:if="{{subItem.goodUrl}}" class="rank-row-name" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}{{}}</text> <view class="rank-left">
<text wx:else class="name-disabled">{{subItem.shareName}}</text> <view class="rank-num">{{idx + 1}}</view>
<view class="down-tips" wx:if="{{orderObj.staffIdx == index && idx == 0}}">点击员工姓名看喜报</view> <view class="rank-head">
<text class="rank-row-dept">{{subItem.departmentName || ''}}</text> <glsx-image wx:if="{{subItem.shareType == 1}}" class="icon-wechat" src="output/icon-wechat.webp" />
</view> <image wx:if="{{subItem.imageUrl}}" src="{{subItem.imageUrl}}" />
<view class="rank-row"> <glsx-image wx:else src="output/icon-head.webp" />
<text class="rank-row-txt">访客<text class="font-number">{{subItem.browseCount || 0}}</text>人</text> </view>
<text class="rank-row-txt">成交<text class="font-number">{{subItem.dealCount || 0}}</text>单</text> <view class="rank-content">
</view> <view class="rank-row">
</view> <text wx:if="{{subItem.goodUrl}}" class="rank-row-name" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}{{}}</text>
</view> <text wx:else class="name-disabled" bindtap="handleXiReport" data-item="{{subItem}}">{{subItem.shareName}}</text>
<view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}</view> <view class="down-tips" wx:if="{{orderObj.staffIdx == index && idx == 0}}">
<view wx:else class="rank-price">暂无业绩</view> 点击员工姓名看喜报
</view> </view>
</view> <text class="rank-row-dept">{{subItem.departmentName || ''}}</text>
<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> <view class="rank-row">
</view> <text class="rank-row-txt">访客<text class="font-number">{{subItem.browseCount || 0}}</text>人</text>
</view> <text class="rank-row-txt">成交<text class="font-number">{{subItem.dealCount || 0}}</text>单</text>
</view> </view>
<!-- 诊断 --> </view>
<view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}"> </view>
<view class="suggest-title"># 活动诊断</view> <view wx:if="{{subItem.totalAmount}}" class="rank-price txt-red font-number">
<view class="suggest-txt"> ¥ {{filter.money_three_for_two_thousands(subItem.totalAmount || 0.00)}}
{{item.suggestTxt}}推荐以下建议: </view>
</view> <view wx:else class="rank-price">暂无业绩</view>
<view class="suggest-block"> </view>
<view class="suggest-step" wx:for="{{item.suggestList}}" wx:for-item="subItem" wx:for-index="idx" wx:key="idx"> </view>
<view class="step-label">建议{{idx + 1}}</view> <view
<view class="step-txt">{{subItem}}</view> wx:if="{{item.staffList.length}}"
</view> class="btn-more"
</view> bindtap="handleMore"
</view> data-idx="{{index}}">
<!-- 战报 --> <glsx-image class="icon-more" src="output/icon-more.webp" />
<view class="new-report" wx:if="{{item.activityStatus != 1}}"> </view>
<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> </view>
生成最新战报 <!-- 诊断 -->
</view> <view class="content-suggest" wx:if="{{item.activityStatus == 2 && item.suggestTxtList.length}}">
<view wx:if="{{item.reportDate}}">最新更新:{{item.reportDate}}</view> <view class="suggest-title"># 活动诊断</view>
</view> <view class="suggest-txt">{{item.suggestTxt}}推荐以下建议:</view>
</view> <view class="suggest-block">
</view> <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-txt">{{subItem}}</view>
</view>
</view>
</view>
<!-- 战报 -->
<view class="new-report" wx:if="{{item.activityStatus != 1}}">
<view
class="report-left"
bindtap="handleReport"
data-item="{{item}}"
data-idx="{{index}}">
<glsx-image class="icon-report" src="output/icon-report.webp" />
生成最新战报
</view>
<view wx:if="{{item.reportDate}}">最新更新:{{item.reportDate}}</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" /> -->
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
"output-transform": "../components//outputTransform/outputTransform", "output-transform": "../components//outputTransform/outputTransform",
"output-crowdfund": "../components/outputCrowdfund/outputCrowdfund" "output-crowdfund": "../components/outputCrowdfund/outputCrowdfund"
} }
}
\ No newline at end of file \ No newline at end of file
}
...@@ -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!