Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas
/
mini-program
/
ai-card
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 9532421d
authored
Sep 09, 2022
by
chenwq
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
计算
1 parent
cc86ae95
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
21 deletions
pages/addTransform/addTransform/addTransform.js
pages/addTransform/addTransform/addTransform.wxml
pages/addTransform/addTransform/addTransform.wxss
pages/addTransform/components/Card/Card.js
pages/addTransform/components/Card/Card.wxml
pages/addTransform/constant/data.js
pages/addTransform/addTransform/addTransform.js
View file @
9532421
...
@@ -10,6 +10,10 @@ Page({
...
@@ -10,6 +10,10 @@ Page({
sales
:
100
,
sales
:
100
,
count
:
1
count
:
1
},
},
actualForm
:
{
sales
:
100
,
count
:
1
},
IMGURL
:
wx
.
$imgUrl
,
IMGURL
:
wx
.
$imgUrl
,
height
:
'calc(100vh - 100rpx)'
,
height
:
'calc(100vh - 100rpx)'
,
tagIndex
:
0
,
tagIndex
:
0
,
...
@@ -128,5 +132,8 @@ Page({
...
@@ -128,5 +132,8 @@ Page({
handleConfirm
()
{
handleConfirm
()
{
console
.
log
(
'提交---'
)
console
.
log
(
'提交---'
)
this
.
setData
({
actualForm
:
this
.
data
.
editForm
})
}
}
})
})
\ No newline at end of file
\ No newline at end of file
pages/addTransform/addTransform/addTransform.wxml
View file @
9532421
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<view class="tips">预估收益根据您的新车销量 {{ editForm.sales }}台 测算所得</view>
<view class="tips">预估收益根据您的新车销量 {{ editForm.sales }}台 测算所得</view>
</view>
</view>
<view wx:for="{{cardList}}" wx:key="index">
<view wx:for="{{cardList}}" wx:key="index">
<card cardForm="{{item}}" bindclick="handleCardClick"></card>
<card cardForm="{{item}}"
actualForm="{{actualForm}}" sales="{{sales}}"
bindclick="handleCardClick"></card>
</view>
</view>
</view>
</view>
</add-tab-view>
</add-tab-view>
...
...
pages/addTransform/addTransform/addTransform.wxss
View file @
9532421
...
@@ -57,7 +57,7 @@ page {
...
@@ -57,7 +57,7 @@ page {
width: 256rpx;
width: 256rpx;
border: 2rpx solid #E6E6E6;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
border-radius: 4rpx;
padding:
12rpx
20rpx;
padding:
0
20rpx;
}
}
.suffix {
.suffix {
...
...
pages/addTransform/components/Card/Card.js
View file @
9532421
...
@@ -6,9 +6,22 @@ Component({
...
@@ -6,9 +6,22 @@ Component({
properties
:
{
properties
:
{
cardForm
:
{
cardForm
:
{
type
:
Object
,
type
:
Object
,
value
:
{}
observer
(
n
)
{
this
.
setData
({
cardForm
:
n
})
}
}
},
},
actualForm
:
{
type
:
Object
,
observer
(
n
)
{
this
.
setData
({
actualForm
:
n
})
this
.
calcProfit
()
}
}
},
/**
/**
* 组件的初始数据
* 组件的初始数据
...
@@ -39,7 +52,6 @@ Component({
...
@@ -39,7 +52,6 @@ Component({
},
},
},
},
ready
()
{
ready
()
{
},
},
/**
/**
* 组件的方法列表
* 组件的方法列表
...
@@ -48,5 +60,22 @@ Component({
...
@@ -48,5 +60,22 @@ Component({
handleClick
()
{
handleClick
()
{
this
.
triggerEvent
(
'click'
,
this
.
data
.
cardForm
)
this
.
triggerEvent
(
'click'
,
this
.
data
.
cardForm
)
},
},
calcProfit
()
{
var
targetItem
=
this
.
data
.
cardForm
let
sales
=
+
this
.
data
.
actualForm
.
sales
let
defaultPrice
=
+
targetItem
.
priceList
[
0
].
value
if
(
targetItem
.
detailAttrName
)
{
switch
(
targetItem
.
detailAttrName
)
{
case
'digitRight'
:
targetItem
.
profit
=
sales
*
0.5
*
defaultPrice
*
12
break
default
:
break
}
}
this
.
setData
({
cardForm
:
targetItem
})
},
}
}
})
})
pages/addTransform/components/Card/Card.wxml
View file @
9532421
...
@@ -13,10 +13,11 @@
...
@@ -13,10 +13,11 @@
</view>
</view>
</view>
</view>
<view class="flex-space card-row">
<view class="flex-space card-row">
<view>
<view
wx:if="{{cardForm.profit}}"
>
<text class="m-r-8">预估收益</text>
<text class="m-r-8">预估收益</text>
<text class="profit-txt">¥{{cardForm.profit}}</text>
<text class="profit-txt">¥{{cardForm.profit}}</text>
</view>
</view>
<view wx:else="">暂无预估收益,敬请期待</view>
<view class="profit-jump">产品介绍<text class="arrow"></text></view>
<view class="profit-jump">产品介绍<text class="arrow"></text></view>
</view>
</view>
</view>
</view>
...
...
pages/addTransform/constant/data.js
View file @
9532421
...
@@ -13,9 +13,10 @@ var tabList = [{
...
@@ -13,9 +13,10 @@ var tabList = [{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'2000'
value
:
'2000'
}],
}],
profit
:
'
88
0'
profit
:
'
120000
0'
},
{
},
{
proName
:
'汽车太阳膜'
,
proName
:
'汽车太阳膜'
,
detailAttrName
:
'sunMembrane'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'membrane'
,
type
:
'membrane'
,
priceList
:
[{
priceList
:
[{
...
@@ -23,7 +24,7 @@ var tabList = [{
...
@@ -23,7 +24,7 @@ var tabList = [{
value
:
'1500'
value
:
'1500'
},
{
},
{
name
:
'豪华品牌'
,
name
:
'豪华品牌'
,
value
:
'2
5
00'
value
:
'2
0
00'
}],
}],
profit
:
'1260'
profit
:
'1260'
}]
}]
...
@@ -35,20 +36,22 @@ var tabList = [{
...
@@ -35,20 +36,22 @@ var tabList = [{
},
},
cardList
:
[{
cardList
:
[{
proName
:
'漆面保护膜'
,
proName
:
'漆面保护膜'
,
detailAttrName
:
'paintMembrane'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'membrane'
,
type
:
'membrane'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'
9
0'
value
:
'
1300
0'
}],
}],
profit
:
'880'
profit
:
'880'
},
{
},
{
proName
:
'改色膜'
,
proName
:
'改色膜'
,
detailAttrName
:
'colorMembrane'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'membrane'
,
type
:
'membrane'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'
9
0'
value
:
'
500
0'
}],
}],
profit
:
'880'
profit
:
'880'
}]
}]
...
@@ -59,34 +62,38 @@ var tabList = [{
...
@@ -59,34 +62,38 @@ var tabList = [{
imgUrl
:
'addTransform/card/deliver/introduce.png'
imgUrl
:
'addTransform/card/deliver/introduce.png'
},
},
cardList
:
[{
cardList
:
[{
proName
:
'镀晶等美容项目'
,
proName
:
'数字化美容'
,
detailAttrName
:
'digitBeauty'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'beauty'
,
type
:
'beauty'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'
200
0'
value
:
'
35
0'
}],
}],
profit
:
'880'
profit
:
'880'
},
{
},
{
proName
:
'360全包脚垫'
,
proName
:
'座椅通风'
,
detailAttrName
:
'chair'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'light'
,
type
:
'light'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'
20
00'
value
:
'
5
00'
}],
}],
profit
:
'880'
profit
:
'880'
},
{
},
{
proName
:
'AR导航'
,
proName
:
'AR导航'
,
detailAttrName
:
'ar'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'light'
,
type
:
'light'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'
20
00'
value
:
'
16
00'
}],
}],
profit
:
'880'
profit
:
'880'
},
{
},
{
proName
:
'氛围灯'
,
proName
:
'氛围灯'
,
detailAttrName
:
'lamp'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'light'
,
type
:
'light'
,
priceList
:
[{
priceList
:
[{
...
@@ -96,11 +103,12 @@ var tabList = [{
...
@@ -96,11 +103,12 @@ var tabList = [{
profit
:
'880'
profit
:
'880'
},
{
},
{
proName
:
'360全景导航'
,
proName
:
'360全景导航'
,
detailAttrName
:
'navigation'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'light'
,
type
:
'light'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'2
0
00'
value
:
'2
5
00'
}],
}],
profit
:
'880'
profit
:
'880'
}]
}]
...
@@ -116,25 +124,26 @@ var tabList = [{
...
@@ -116,25 +124,26 @@ var tabList = [{
type
:
'service'
,
type
:
'service'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'2
0
00'
value
:
'2
5
00'
}],
}],
profit
:
'880'
profit
:
null
},
{
},
{
proName
:
'金融车贷'
,
proName
:
'金融车贷'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'service'
,
type
:
'service'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'2000'
value
:
'2000
0
'
}],
}],
profit
:
'880'
profit
:
null
},
{
},
{
proName
:
'镀晶等美容项目'
,
proName
:
'数字化美容'
,
detailAttrName
:
'digitBeauty'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
imgUrl
:
'addTransform/card/deliver/card-0.png'
,
type
:
'beauty'
,
type
:
'beauty'
,
priceList
:
[{
priceList
:
[{
name
:
'均客单价'
,
name
:
'均客单价'
,
value
:
'
200
0'
value
:
'
35
0'
}],
}],
profit
:
'880'
profit
:
'880'
}]
}]
...
@@ -325,6 +334,17 @@ var addDatailObj = {
...
@@ -325,6 +334,17 @@ var addDatailObj = {
videoList
:
[{
videoList
:
[{
url
:
'addTransform/detail/video.mp4'
url
:
'addTransform/detail/video.mp4'
}]
}]
},
sunMembrane
:
{
imgList
:
[{
url
:
'addTransform/card/deliver/introduce.png'
},
{
url
:
'addTransform/card/deliver/card-0.png'
}],
text
:
'太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜太阳膜。'
,
videoList
:
[{
url
:
'addTransform/detail/video.mp4'
}]
}
}
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment