Commit 412c0b29 by 张立顺

样式修改

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