Commit 412c0b29 by 张立顺

样式修改

1 parent b9bda942
......@@ -10,7 +10,7 @@ Component({
type: Object,
observer(n) {
console.log(n, '=================')
this.init(n)
this.getImageInfo(n)
}
}
},
......@@ -18,26 +18,39 @@ Component({
/**
* 组件的初始数据
*/
data: {
},
data: {},
/**
* 组件的方法列表
*/
methods: {
async init(n) {
getImageInfo(n, width, height) {
let that = this
wx.getImageInfo({
src: n.posterUrl,
success: function (res) {
console.log(res)
// w = res.width
// h = res.height
that.init(n, res.width, res.height)
}
})
},
async init(n, ImgWidth, ImgHeight) {
wx.$api.showLoading()
const drawfun = new Draw({
width: 279,
height: 554
}, this),
{
userInfo
} = wx.$storage.get(),
const drawfun = new Draw(
{
width: 279,
height: 554
},
this
),
{ userInfo } = wx.$storage.get(),
merchantName = userInfo.merchantName.length > 12 ? `${userInfo.merchantName.substring(0, 12)}...` : userInfo.merchantName,
res = await drawfun.begin({
imageList: [{
imageList: [
{
x: 0,
y: 0,
width: 279,
......@@ -52,7 +65,8 @@ Component({
url: n.posterUrl
}
],
textList: [{
textList: [
{
x: 12,
y: 14,
fontSize: 14,
......@@ -84,7 +98,7 @@ Component({
opacity: 0.5
}
}
],
]
})
console.log(res)
wx.hideLoading()
......@@ -95,10 +109,10 @@ Component({
},
download() {
const filePath = this.data.poster,
_this = this
_this = this
wx.saveImageToPhotosAlbum({
filePath,
success(){
success() {
wx.$api.showToast('保存成功')
},
fail(err) {
......@@ -120,4 +134,4 @@ Component({
})
}
}
})
\ No newline at end of file
})
......@@ -19,7 +19,7 @@ Component({
},
formData: {
type: Object,
value: () => { }
value: () => {}
},
scenePriceList: {
type: Array,
......@@ -32,19 +32,25 @@ Component({
*/
data: {
IMGURL: IMG_URL,
custSceneList: [{
title: '新车洽谈场景',
subTitle: '1.0新车权益销售'
}, {
title: '新车交付场景',
subTitle: '1.1新车精品升级'
}, {
title: '0-12个月',
subTitle: '1.2新车线上转化'
}, {
title: '12个月以上',
subTitle: '1.3存量用户众筹'
}]
openedIcon: `${IMG_URL}/output/openedIcon.png`,
custSceneList: [
{
title: '新车洽谈场景',
subTitle: '1.0新车权益销售'
},
{
title: '新车交付场景',
subTitle: '1.1新车精品升级'
},
{
title: '0-12个月',
subTitle: '1.2新车线上转化'
},
{
title: '12个月以上',
subTitle: '1.3存量用户众筹'
}
]
},
/**
......
......@@ -7,7 +7,7 @@
bindtap="handleClick"
data-idx="{{index + 1}}">
<view wx:if="{{hasOpenIcon && formData['scene' + (index + 1)] && sceneActive != (index + 1)}}" class="open-icon">
已开通
<image src="{{openedIcon}}" webp></image>
</view>
<image wx:if="{{formData['scene' + (index + 1)]}}" class="scene-img" src="{{IMGURL}}output/caract0{{index + 1}}.png?v={{img_version}}" />
<view wx:else class="no-open-img">
......
......@@ -41,7 +41,11 @@
.open-icon {
box-sizing: border-box;
position: absolute;
left: 0.5rpx;
top: 0;
right: 0;
width: 78rpx;
height: 78rpx;
/* left: 0.5rpx;
top: 0.5rpx;
width: 56rpx;
height: 32rpx;
......@@ -50,7 +54,7 @@
border-radius: 6rpx 0 8rpx 0;
font-size: 16rpx;
color: #EF971E;
padding: 4rpx;
padding: 4rpx; */
}
/* 已开通 - end */
......
......@@ -84,7 +84,7 @@ Component({
},
pickSheet(e) {
let that = this
let { index } = e.currentTarget.dataset
let { index, item } = e.currentTarget.dataset
let { dataObj, userInfo, list } = this.data
const itemList = ['本月', '本日', '累计']
wx.showActionSheet({
......@@ -111,7 +111,7 @@ Component({
.getMerchantById(params)
.then(result => {
console.log(result)
that.setMerchantObj(index, result, itemList[res.tapIndex])
that.setMerchantObj(index, result, itemList[res.tapIndex], item)
})
.catch(err => {})
......@@ -237,7 +237,7 @@ Component({
})
})
},
setMerchantObj(index, item, selectName) {
setMerchantObj(index, item, selectName, oldItem) {
console.log(item)
item = item[0]
let obj = {}
......@@ -247,9 +247,11 @@ Component({
obj.merchantName = item?.merchantName
// obj.merchantId = item
obj.startInd =
oldItem.startInd ||
item?.sceneList.findIndex(item => {
return item != null
}) || -1
}) ||
-1
obj.showNothingSceneCon = obj.startInd == -1
obj.showList = item?.sceneList || []
// obj.norList = type?obj.
......
......@@ -27,7 +27,11 @@
<view class="merchantDataStatistics-con">
<view class="contitle">
<view class="name">{{item.merchantName}}</view>
<view class="select" data-index="{{index}}" bind:tap="pickSheet">
<view
class="select"
data-index="{{index}}"
data-item="{{item}}"
bind:tap="pickSheet">
<view>{{item.selectName||'累计'}}</view>
<image
class="arrow {{isAct?'isAct':''}}"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!