Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mallapp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
mallapp
Commits
2a3b0e8c
Commit
2a3b0e8c
authored
Mar 23, 2021
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/viitto/mallapp
parents
4970e874
e8982379
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
801 additions
and
87 deletions
+801
-87
range-slider.vue
pages/kotra/components/range-slider.vue
+391
-0
identification.vue
pages/kotra/identification.vue
+410
-87
No files found.
pages/kotra/components/range-slider.vue
0 → 100644
View file @
2a3b0e8c
<
template
>
<view
class=
"range-slider"
:style=
"'width:' + width + 'rpx;height:' + height + 'rpx'"
>
<view
class=
"range-bar"
:style=
"'width:100%;height:' + barHeight + 'rpx'"
>
<view
class=
"range-bar-bg"
:style=
"'background-color:' + backgroundColor + ''"
></view>
<view
class=
"range-bar-progress"
:style=
"'margin-left:' + progressBarLeft + 'rpx;width:' + progressBarWidth + 'rpx;background-color:' + activeColor + ''"
></view>
</view>
<view
class=
"block"
:class=
"
{ active: isMinActive }"
:style="'width:' + blockSize + 'rpx;height:' + blockSize + 'rpx;margin-left:' + minBlockLeft + 'rpx;'"
@touchstart="_onBlockTouchStart"
@touchmove.stop="_onBlockTouchMove"
@touchend="_onBlockTouchEnd"
:data-left="minBlockLeft"
data-tag="minBlock"
>
<slot
name=
"minBlock"
></slot>
</view>
<view
class=
"block"
:class=
"
{ active: isMaxActive }"
:style="'width:' + blockSize + 'rpx;height:' + blockSize + 'rpx;margin-left:' + maxBlockLeft + 'rpx;'"
@touchstart="_onBlockTouchStart"
@touchmove.stop="_onBlockTouchMove"
@touchend="_onBlockTouchEnd"
:data-left="maxBlockLeft"
data-tag="maxBlock"
>
<slot
name=
"maxBlock"
></slot>
</view>
</view>
</
template
>
<
script
>
/**
* range-slider v1.0.6
*/
const
_windowWidth
=
uni
.
getSystemInfoSync
().
windowWidth
;
export
default
{
data
()
{
return
{
isMinActive
:
false
,
isMaxActive
:
false
,
//#ifdef H5
MAX_LENGTH
:
294
,
maxBlockLeft
:
300
,
//#endif
// #ifndef H5
MAX_LENGTH
:
700
,
maxBlockLeft
:
350
,
// #endif
minBlockLeft
:
0
,
progressBarLeft
:
0
,
progressBarWidth
:
350
,
originalMinValue
:
0
,
originalMaxValue
:
0
};
},
components
:
{},
props
:
{
//组件宽度
width
:
{
type
:
Number
,
default
:
750
},
//组件高度
height
:
{
type
:
Number
,
default
:
100
},
//滑块大小
blockSize
:
{
type
:
Number
,
default
:
50
},
//区间进度条高度
barHeight
:
{
type
:
Number
,
default
:
5
},
//背景条颜色
backgroundColor
:
{
type
:
String
,
default
:
'#e9e9e9'
},
//已选择的颜色
activeColor
:
{
type
:
String
,
default
:
'#1aad19'
},
//最小值
min
:
{
type
:
Number
,
default
:
0
},
//最大值
max
:
{
type
:
Number
,
default
:
100
},
//设置初始值
values
:
{
type
:
Array
,
default
:
function
()
{
return
[
0
,
100
];
}
},
//步长值
step
:
{
type
:
Number
,
default
:
1
},
//live模式,是否动态更新
liveMode
:
{
type
:
Boolean
,
default
:
true
}
},
created
:
function
()
{
//使用自定义组件编译模式时,支持生命周期为:created
this
.
_refresh
();
},
onLoad
:
function
(
option
)
{
//不使用自定义组件编译模式时,支持生命周期为:onload
this
.
_refresh
();
},
onUnload
:
function
()
{},
watch
:
{
//组件宽度
width
:
function
(
newVal
,
oldVal
,
changedPath
)
{
var
that
=
this
;
if
(
newVal
!=
that
.
width
)
{
this
.
_refresh
();
}
},
//滑块大小
blockSize
:
function
(
newVal
,
oldVal
,
changedPath
)
{
var
that
=
this
;
if
(
newVal
!=
that
.
blockSize
)
{
this
.
_refresh
();
}
},
//最小值
min
:
function
(
newVal
,
oldVal
,
changedPath
)
{
var
that
=
this
;
if
(
newVal
!=
that
.
min
)
{
that
.
_refresh
();
}
},
//最大值
max
:
function
(
newVal
,
oldVal
,
changedPath
)
{
var
that
=
this
;
if
(
newVal
!=
that
.
max
)
{
that
.
_refresh
();
}
},
//设置初始值
values
:
function
(
newVal
,
oldVal
,
changedPath
)
{
var
that
=
this
;
var
values
=
that
.
values
;
console
.
log
(
'refresh'
,
newVal
,
oldVal
);
if
(
that
.
_isValuesValid
(
newVal
)
&&
that
.
_isValuesValid
(
values
))
{
if
(
values
[
0
]
!=
oldVal
[
0
]
||
values
[
1
]
!=
oldVal
[
1
])
that
.
_refresh
();
}
}
},
methods
:
{
//补0
_pad
:
function
(
num
,
n
)
{
return
Array
(
n
-
(
''
+
num
).
length
+
1
).
join
(
0
)
+
num
;
},
_pxToRpx
:
function
(
px
)
{
return
(
750
*
px
)
/
_windowWidth
;
},
_onBlockTouchStart
:
function
(
e
)
{
let
tag
=
e
.
target
.
dataset
.
tag
;
if
(
tag
==
'minBlock'
||
tag
==
'maxBlock'
)
{
this
.
isMinActive
=
tag
==
'minBlock'
;
this
.
isMaxActive
=
tag
==
'maxBlock'
;
//兼容h5平台及某版本微信
if
(
e
.
hasOwnProperty
(
'changedTouches'
))
{
this
.
_blockDownX
=
e
.
changedTouches
[
0
].
pageX
;
}
else
{
this
.
_blockDownX
=
e
.
pageX
;
}
//#ifdef H5
this
.
_blockLeft
=
parseFloat
(
e
.
target
.
dataset
.
left
);
//#endif
// #ifndef H5
this
.
_blockLeft
=
e
.
target
.
dataset
.
left
;
// #endif
this
.
_curBlock
=
e
.
target
.
dataset
.
tag
;
}
},
_onBlockTouchMove
:
function
(
e
)
{
let
tag
=
e
.
target
.
dataset
.
tag
;
if
(
tag
==
'minBlock'
||
tag
==
'maxBlock'
)
{
var
that
=
this
;
var
values
=
that
.
_calculateValues
(
e
);
that
.
_refreshProgressBar
(
values
[
2
],
values
[
3
]);
that
.
_refreshBlock
(
values
[
2
],
values
[
3
]);
//拖动时也触发事件
var
eventDetail
=
{
minValue
:
this
.
formatNumber
(
values
[
0
],
this
.
step
),
maxValue
:
this
.
formatNumber
(
values
[
1
],
this
.
step
),
fromUser
:
true
,
originalValue
:
{
minValue
:
values
[
0
],
maxValue
:
values
[
1
]
}
};
this
.
originalMinValue
=
values
[
0
];
this
.
originalMaxValue
=
values
[
1
];
var
eventOption
=
{};
//
if
(
this
.
liveMode
)
that
.
$emit
(
'rangechange'
,
eventDetail
,
eventOption
);
}
},
_onBlockTouchEnd
:
function
(
e
)
{
let
tag
=
e
.
target
.
dataset
.
tag
;
this
.
isMinActive
=
false
;
this
.
isMaxActive
=
false
;
if
(
tag
==
'minBlock'
||
tag
==
'maxBlock'
)
{
var
that
=
this
;
var
values
=
that
.
_calculateValues
(
e
.
mp
.
changedTouches
[
0
]);
that
.
_refreshProgressBar
(
values
[
2
],
values
[
3
]);
that
.
_refreshBlock
(
values
[
2
],
values
[
3
]);
var
eventDetail
=
{
minValue
:
this
.
formatNumber
(
values
[
0
],
this
.
step
),
maxValue
:
this
.
formatNumber
(
values
[
1
],
this
.
step
),
fromUser
:
true
,
originalValue
:
{
minValue
:
values
[
0
],
maxValue
:
values
[
1
]
}
};
this
.
originalMinValue
=
values
[
0
];
this
.
originalMaxValue
=
values
[
1
];
var
eventOption
=
{};
that
.
$emit
(
'rangechange'
,
eventDetail
,
eventOption
);
}
},
_isValuesValid
:
function
(
values
)
{
return
values
!=
null
&&
values
!=
undefined
&&
values
.
length
==
2
;
},
/**
* 根据手势计算相关数据
*/
_calculateValues
:
function
(
e
)
{
var
pageX
=
e
.
pageX
;
//兼容h5平台
if
(
e
.
hasOwnProperty
(
'changedTouches'
))
{
pageX
=
e
.
changedTouches
[
0
].
pageX
;
}
var
that
=
this
;
var
moveLength
=
pageX
-
that
.
_blockDownX
;
var
left
=
that
.
_blockLeft
+
that
.
_pxToRpx
(
moveLength
);
left
=
Math
.
max
(
0
,
left
);
left
=
Math
.
min
(
left
,
that
.
MAX_LENGTH
);
var
minBlockLeft
=
that
.
minBlockLeft
;
var
maxBlockLeft
=
that
.
maxBlockLeft
;
if
(
that
.
_curBlock
==
'minBlock'
)
{
minBlockLeft
=
left
;
}
else
{
maxBlockLeft
=
left
;
}
var
range
=
that
.
max
-
that
.
min
;
var
minLeft
=
Math
.
min
(
minBlockLeft
,
maxBlockLeft
);
var
maxLeft
=
Math
.
max
(
minBlockLeft
,
maxBlockLeft
);
var
minValue
=
(
minLeft
/
that
.
MAX_LENGTH
)
*
range
+
that
.
min
;
var
maxValue
=
(
maxLeft
/
that
.
MAX_LENGTH
)
*
range
+
that
.
min
;
return
[
minValue
,
maxValue
,
minLeft
,
maxLeft
];
},
/**
* 计算滑块坐标
*/
_calculateBlockLeft
:
function
(
minValue
,
maxValue
)
{
var
that
=
this
;
var
blockSize
=
that
.
blockSize
;
var
range
=
that
.
max
-
that
.
min
;
var
minLeft
=
((
minValue
-
that
.
min
)
/
range
)
*
that
.
MAX_LENGTH
;
var
maxLeft
=
((
maxValue
-
that
.
min
)
/
range
)
*
that
.
MAX_LENGTH
;
return
[
minLeft
,
maxLeft
];
},
/**
* 刷新进度条视图
*/
_refreshProgressBar
:
function
(
minBlockLeft
,
maxBlockLeft
)
{
var
that
=
this
;
var
blockSize
=
that
.
blockSize
;
that
.
progressBarLeft
=
minBlockLeft
+
blockSize
/
2
;
that
.
progressBarWidth
=
Math
.
abs
(
maxBlockLeft
-
minBlockLeft
);
},
/**
* 刷新滑块视图
*/
_refreshBlock
:
function
(
minBlockLeft
,
maxBlockLeft
)
{
var
that
=
this
;
that
.
minBlockLeft
=
minBlockLeft
;
that
.
maxBlockLeft
=
maxBlockLeft
;
},
/**
* 刷新整个视图
*/
_refresh
:
function
()
{
var
that
=
this
;
var
MAX_LENGTH
=
that
.
width
-
that
.
blockSize
;
that
.
MAX_LENGTH
=
MAX_LENGTH
;
that
.
maxBlockLeft
=
MAX_LENGTH
;
that
.
progressBarWidth
=
MAX_LENGTH
;
var
values
=
that
.
values
;
if
(
this
.
originalMinValue
&&
this
.
originalMinValue
)
{
values
=
[
this
.
originalMinValue
||
values
[
0
],
this
.
originalMaxValue
||
values
[
1
]];
}
if
(
that
.
_isValuesValid
(
values
))
{
values
[
0
]
=
Math
.
max
(
that
.
min
,
values
[
0
]);
values
[
0
]
=
Math
.
min
(
values
[
0
],
that
.
max
);
values
[
1
]
=
Math
.
max
(
that
.
min
,
values
[
1
]);
values
[
1
]
=
Math
.
min
(
values
[
1
],
that
.
max
);
var
leftValues
=
that
.
_calculateBlockLeft
(
values
[
0
],
values
[
1
]);
that
.
_refreshProgressBar
(
leftValues
[
0
],
leftValues
[
1
]);
that
.
_refreshBlock
(
leftValues
[
0
],
leftValues
[
1
]);
}
},
formatNumber
(
num
,
step
)
{
//格式化数字,保留几位小数
let
stepStr
=
''
+
step
;
let
index
=
stepStr
.
indexOf
(
'.'
);
let
len
=
index
>
-
1
?
stepStr
.
length
-
index
-
1
:
0
;
let
offestNum
=
parseInt
(
1
+
Array
((
''
+
len
).
length
+
1
).
join
(
0
))
*
0.1
;
let
tmpNum
=
num
*
offestNum
;
return
((
parseInt
(
tmpNum
/
step
+
(
step
>
1
?
1
:
step
)
*
0.5
)
*
step
)
/
offestNum
).
toFixed
(
len
);
}
}
};
</
script
>
<
style
>
.range-slider
{
position
:
relative
;
}
.range-bar
{
position
:
absolute
;
}
.range-bar
{
position
:
absolute
;
top
:
50%
;
transform
:
translate
(
0
,
-50%
);
border-radius
:
10000
rpx
;
}
.range-bar-bg
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
border-radius
:
10000
rpx
;
}
.range-bar-progress
{
position
:
absolute
;
width
:
100%
;
height
:
100%
;
background-color
:
blueviolet
;
}
.block
{
position
:
absolute
;
top
:
50%
;
transform
:
translate
(
0
,
-50%
);
background
:
#fff
;
border-radius
:
50%
;
box-shadow
:
0
rpx
0
rpx
6
rpx
#ccc
;
}
.block.active
{
transform
:
translate
(
0
,
-50%
)
scale
(
1.5
);
}
</
style
>
pages/kotra/identification.vue
View file @
2a3b0e8c
...
...
@@ -19,9 +19,18 @@
<view
class=
"con1"
v-if=
"item.type==1"
>
<input
class=
"input"
type=
"text"
v-model=
"dataOne[item.file]"
:placeholder=
"item.text"
placeholder-style=
"color: #CECECEFF"
/>
</view>
<view
class=
"con2"
v-if=
"item.type==2"
>
<image
:src=
"businessLicense"
class=
"conImage"
mode=
"widthFix"
@
click=
"chooseImg"
></image>
<!-- 未上传成功 -->
<image
:src=
"businessLicenseDemo"
v-if=
"!businessLicenseUploadIsSuccess"
class=
"conImage"
mode=
"widthFix"
@
click=
"chooseImg"
></image>
<!-- 上传成功 -->
<image
:src=
"dataOne.BusinessLicense"
v-if=
"businessLicenseUploadIsSuccess"
class=
"conImage"
mode=
"heightFix"
></image>
<view
class=
"reupload"
v-if=
"businessLicenseUploadIsSuccess"
@
click=
"chooseImg"
>
重新上传
</view>
</view>
</view>
</view>
...
...
@@ -33,15 +42,26 @@
{{
item
.
name
}}
</view>
<view
class=
"con1"
v-if=
"item.type==1"
>
<input
class=
"input"
type=
"text"
v-model=
"data[item.file]"
:placeholder=
"item.text"
<input
class=
"input"
type=
"text"
v-model=
"data
Two
[item.file]"
:placeholder=
"item.text"
placeholder-style=
"color: #CECECEFF"
/>
</view>
<view
class=
"con3"
v-if=
"item.type==2"
>
<u-number-box
:input-width=
"100"
:input-height=
"60"
bg-color=
"#F70027"
input-width=
"480"
>
</u-number-box>
<view
class=
"numberBbox"
>
<image
class=
"numberImg"
:src=
"reduceIcon"
mode=
"widthFix"
@
click=
"reduce"
></image>
<input
class=
"numberInput"
type=
"number"
disabled
v-model
.
number=
"dataTwo[item.file]"
/>
<image
class=
"numberImg"
:src=
"addIcon"
mode=
"widthFix"
@
click=
"add"
></image>
</view>
</view>
<view
class=
"con3"
v-if=
"item.type==3"
>
<u-slider
class=
"slider"
v-model=
"data[item.file]"
></u-slider>
<!-- 区间滑块 -->
<rangeSlider
:width=
"592"
:height=
"120"
:liveMode=
"true"
background-color=
"#DADCE6D9"
:block-size=
"36"
active-color=
"#F95771FF"
:min=
"rangeSliderMin"
:max=
"rangeSliderMax"
:values=
"builtArea"
@
rangechange=
"rangechange"
></rangeSlider>
<view
class=
"rangeSliderNum"
>
<text>
{{
rangeSliderMin
}}
</text>
<text>
{{
rangeSliderMax
}}
</text>
</view>
</view>
<view
class=
"con4"
v-if=
"item.type==4"
>
<view
class=
"customTypeBox"
>
...
...
@@ -65,23 +85,35 @@
{{
item
.
name
}}
</view>
<view
class=
"con1"
v-if=
"item.type==1"
>
<input
class=
"input"
type=
"text"
v-model=
"data[item.file]"
:placeholder=
"item.text"
<input
class=
"input"
type=
"text"
v-model=
"data
Three
[item.file]"
:placeholder=
"item.text"
placeholder-style=
"color: #CECECEFF"
/>
</view>
<view
class=
"con2"
v-if=
"item.type==2"
>
<u-radio-group
v-model=
"goodsTypeValue"
>
<u-radio
v-for=
"(item1, index1) in goodsType"
:key=
"index1"
:name=
"item1.Name"
>
{{
item1
.
Name
}}
<view
class=
"con6"
v-if=
"item.type==2"
>
<u-radio-group
v-model=
"dataThree[item.file]"
>
<u-radio
v-for=
"(item1, index1) in goodsType"
:key=
"index1"
:name=
"item1.Name"
shape=
"circle"
@
change=
"radioChange"
>
<image
:src=
"goodsTypeImg[item1.Id]"
mode=
"widthFix"
class=
"goodsTypeImg"
></image>
</u-radio>
</u-radio-group>
</view>
<view
class=
"con3"
v-if=
"item.type==3"
>
<!-- 区间滑块 -->
<rangeSlider
:width=
"592"
:height=
"120"
:liveMode=
"true"
background-color=
"#DADCE6D9"
:block-size=
"36"
active-color=
"#F95771FF"
:min=
"rangeSliderMin"
:max=
"rangeSliderMax"
:values=
"AreaRequire"
@
rangechange=
"AreaRequireChange"
></rangeSlider>
<view
class=
"rangeSliderNum"
>
<text>
{{
AreaRequireMin
}}
</text>
<text>
{{
AreaRequireMax
}}
</text>
</view>
</view>
</view>
</view>
</view>
<view
class=
"butBox"
>
<image
:src=
"nextIcon"
class=
"next"
mode=
"widthFix"
@
click=
"nextStep"
></image>
<view
class=
"butBox"
@
click=
"nextStep"
>
<image
:src=
"nextIcon"
class=
"next"
mode=
"widthFix"
v-if=
"step!=3"
></image>
<text
v-if=
"step==3"
>
完成
</text>
</view>
<view
class=
"skip"
v-if=
"step==
2
"
>
<view
class=
"skip"
v-if=
"step==
3
"
>
<text
@
click=
"nextStep"
>
跳过
</text>
</view>
</view>
...
...
@@ -89,7 +121,11 @@
</
template
>
<
script
>
import
rangeSlider
from
"./components/range-slider.vue"
export
default
{
components
:
{
rangeSlider
},
data
()
{
return
{
step
:
1
,
...
...
@@ -99,40 +135,38 @@
nextSepName
:
"第2步"
,
stepOneList
:
[{
name
:
"营业执照 (点击图片上传营业执照)"
,
src
:
""
,
file
:
""
,
type
:
2
},
{
name
:
"企业名称"
,
text
:
"请输入企业名称"
,
file
:
""
,
file
:
"
CompanyName
"
,
type
:
1
},
{
name
:
"统一社会信用代码"
,
text
:
"输入18位社会信用代码"
,
file
:
""
,
file
:
"
UnifiedCode
"
,
type
:
1
},
{
name
:
"法人代表"
,
text
:
"请输入法人姓名"
,
file
:
""
,
file
:
"
LegalPerson
"
,
type
:
1
},
{
name
:
"联系电话"
,
text
:
"请输入11位手机或者带区号座机号码"
,
file
:
""
,
file
:
"
Mobile
"
,
type
:
1
},
],
//type=1:输入框,2:步进器,3:多选
stepTwoList
:
[{
name
:
"品牌名称"
,
text
:
"请输入品牌
全名
"
,
file
:
""
,
text
:
"请输入品牌
名称
"
,
file
:
"
BrandName
"
,
type
:
1
},
{
name
:
"店铺数量"
,
text
:
""
,
file
:
""
,
file
:
"
ShopNum
"
,
type
:
2
},
{
name
:
"店铺面积"
,
...
...
@@ -141,13 +175,13 @@
type
:
3
},
{
name
:
"品牌定位"
,
text
:
"请输入品牌
全名
"
,
file
:
""
,
text
:
"请输入品牌
定位
"
,
file
:
"
FullBrandName
"
,
type
:
1
},
{
name
:
"客户群体"
,
text
:
""
,
file
:
""
,
file
:
"
CustomerType
"
,
type
:
4
,
}],
addCustomType
:
""
,
//添加客户群体
...
...
@@ -155,12 +189,12 @@
stepThreeList
:
[{
name
:
"扩店区域"
,
text
:
"请输入品牌全名"
,
file
:
""
,
file
:
"
StoreExpansion
"
,
type
:
1
},
{
name
:
"商品性质"
,
text
:
""
,
file
:
""
,
file
:
"
ProjectType
"
,
type
:
2
},
{
name
:
"面积要求"
,
...
...
@@ -170,11 +204,47 @@
}],
goodsType
:
[],
//商品性质
goodsTypeValue
:
""
,
businessLicense
:
""
,
//营业执照
access_token
:
""
,
businessLicenseDemo
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/upLoadDemo.png"
,
//营业执照占位图片
businessLicenseUploadIsSuccess
:
false
,
//营业执照是否上传成功
access_token
:
""
,
//百度ai平台token
dataOne
:
{
}
CompanyId
:
0
,
CompanyName
:
""
,
BusinessLicense
:
""
,
//营业执照
UnifiedCode
:
""
,
LegalPerson
:
""
,
Mobile
:
""
,
CompanyStatus
:
2
},
dataTwo
:
{
CompanyId
:
0
,
BrandName
:
""
,
ShopNum
:
0
,
BuiltUpArea
:
""
,
EndBuiltUpArea
:
""
,
FullBrandName
:
""
,
CustomerType
:
""
,
},
reduceIcon
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/reduceIcon.png"
,
addIcon
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/addIcon.png"
,
builtArea
:
[
1
,
100
],
//店铺面积
rangeSliderMin
:
0
,
//区间滑块最小值
rangeSliderMax
:
100
,
//区间滑块最大值
dataThree
:
{
StoreExpansion
:
""
,
//扩展区域
ProjectType
:
""
,
//商品性质
AreaRequirement
:
""
,
//面积要求
EndAreaRequirement
:
""
,
//面积要求
},
goodsTypeImg
:
{
1
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-baihuo.png"
,
2
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-shappingmall.png"
,
3
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-center.png"
,
4
:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/goodstype-other.png"
},
AreaRequire
:[],
AreaRequireMin
:
0
,
AreaRequireMax
:
100
,
}
},
methods
:
{
...
...
@@ -203,18 +273,6 @@
}
})
},
// 新增企业资料
SetCompany
(
data
)
{
let
parms
=
{
url
:
"/api/AppletTrade/SetCompany"
,
...
data
}
this
.
request2
(
parms
,
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
console
.
log
(
res
)
}
})
},
//选择营业执照照片
chooseImg
()
{
let
that
=
this
...
...
@@ -223,25 +281,48 @@
sizeType
:
[
'original'
,
'compressed'
],
//可以指定是原图还是压缩图,默认二者都有
sourceType
:
[
'album'
],
//从相册选择
success
:
function
(
res
)
{
console
.
log
(
res
)
that
.
businessLicense
=
res
.
tempFilePaths
[
0
]
wx
.
getFileSystemManager
().
readFile
({
filePath
:
res
.
tempFilePaths
[
0
],
encoding
:
'base64'
,
//编码格式
success
:(
ans
)
=>
{
console
.
log
(
ans
)
}
success
:
(
ans
)
=>
{
that
.
getImgInfo
(
ans
.
data
,
that
.
access_token
,
(
_res
)
=>
{
console
.
log
(
"getImgInfo"
,
_res
)
if
(
_res
.
data
.
direction
==
1
)
{
//未定义,图片类型错误
wx
.
showToast
({
title
:
'图片类型错误!'
,
icon
:
'none'
,
duration
:
1000
})
}
else
{
let
data
=
_res
.
data
.
words_result
that
.
upFile
(
res
.
tempFilePaths
[
0
],
(
uploadRes
)
=>
{
that
.
dataOne
.
BusinessLicense
=
JSON
.
parse
(
uploadRes
.
data
).
data
that
.
businessLicenseUploadIsSuccess
=
true
that
.
dataOne
.
CompanyName
=
data
.
单位名称
.
words
that
.
dataOne
.
LegalPerson
=
data
.
法人
.
words
that
.
dataOne
.
UnifiedCode
=
data
.
社会信用代码
.
words
})
}
})
},
})
that
.
getImgInfo
(
res
.
tempFilePaths
[
0
])
//
}
});
},
//提取营业执照信息
getImgInfo
(
data
)
{
getImgInfo
(
data
,
token
,
resCall
)
{
let
that
=
this
uni
.
request
({
url
:
'https://aip.baidubce.com/rest/2.0/ocr/v1/business_license?access_token='
+
that
.
access_token
,
url
:
'https://aip.baidubce.com/rest/2.0/ocr/v1/business_license?access_token='
+
token
,
method
:
'POST'
,
header
:
{
'Content-Type'
:
'application/x-www-form-urlencoded'
...
...
@@ -250,13 +331,45 @@
image
:
data
,
},
success
(
res
)
{
console
.
log
(
111
,
res
)
console
.
log
(
res
)
resCall
(
res
)
},
fail
(
res
)
{
}
})
},
//图片上传
upFile
(
img
,
resCall
)
{
var
that
=
this
;
wx
.
showLoading
({
title
:
'上传中'
})
let
MallBaseId
=
uni
.
getStorageSync
(
"mall_UserInfo"
).
MallBaseId
?
uni
.
getStorageSync
(
"mall_UserInfo"
)
.
MallBaseId
:
1
;
let
action
=
that
.
host2
+
'/api/File/UploadTencent?MallBaseId='
+
MallBaseId
uni
.
uploadFile
({
url
:
action
,
filePath
:
img
,
name
:
'file'
,
formData
:
{
user
:
'test'
},
success
:
(
uploadFileRes
)
=>
{
uni
.
hideLoading
()
resCall
(
uploadFileRes
)
},
fail
:
function
(
res
)
{
that
.
businessLicenseUploadIsSuccess
=
false
wx
.
showToast
({
title
:
'上传失败!'
,
icon
:
'none'
,
duration
:
1000
})
}
});
},
//获取百度ai平台token
getAccess_token
()
{
let
that
=
this
;
uni
.
request
({
...
...
@@ -268,35 +381,160 @@
},
method
:
'GET'
,
success
(
res
)
{
console
.
log
(
res
)
that
.
access_token
=
res
.
data
.
access_token
console
.
log
(
that
.
access_token
)
},
fail
(
e
)
{}
})
},
//步骤一
stepOne
()
{
let
parms
=
{
url
:
"/api/AppletTrade/SetCompany"
,
data
:
this
.
dataOne
}
this
.
request2
(
parms
,
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
dataOne
.
CompanyId
=
res
.
data
.
CompanyId
this
.
stepName
=
"第2步 品牌信息"
this
.
nextSepName
=
"第3步"
this
.
step
++
this
.
percent
+=
this
.
percent
}
})
},
// 步骤二
stepTwo
()
{
this
.
dataTwo
.
CompanyId
=
this
.
dataOne
.
CompanyId
this
.
dataTwo
.
BuiltUpArea
=
this
.
builtArea
[
0
]
this
.
dataTwo
.
EndBuiltUpArea
=
this
.
builtArea
[
1
]
let
ids
=
[]
this
.
customList
.
map
((
e
)
=>
{
if
(
e
.
checked
)
{
ids
.
push
(
e
.
Id
)
}
})
this
.
dataTwo
.
CustomerType
=
ids
.
toString
()
let
parms
=
{
url
:
"/api/AppletTrade/SetBrand"
,
data
:
this
.
dataTwo
}
this
.
request2
(
parms
,
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
stepName
=
"第3步 扩店需求"
this
.
nextSepName
=
"完成"
this
.
step
++
this
.
percent
+=
this
.
percent
}
})
},
//步骤三
stepThree
(){
this
.
dataThree
.
CompanyId
=
this
.
dataOne
.
CompanyId
this
.
dataThree
.
AreaRequirement
=
this
.
AreaRequire
[
0
]
this
.
dataThree
.
EndAreaRequirement
=
this
.
AreaRequire
[
1
]
let
parms
=
{
url
:
"/api/AppletTrade/SetBrand"
,
data
:
this
.
dataThree
}
this
.
request2
(
parms
,
(
res
)
=>
{
console
.
log
(
"333"
)
if
(
res
.
resultCode
==
1
)
{
this
.
stepName
=
"第3步 扩店需求"
this
.
nextSepName
=
"完成"
this
.
step
++
this
.
percent
+=
this
.
percent
}
})
},
//下一步
nextStep
()
{
console
.
log
(
this
.
step
)
if
(
this
.
step
<
3
&&
this
.
percent
<=
100
)
{
this
.
step
++
this
.
percent
+=
this
.
percent
if
(
this
.
step
==
1
)
{
this
.
stepName
=
"第1步 企业基础资料"
this
.
nextSepName
=
"第2步"
console
.
log
(
"..."
,
this
.
step
)
if
(
this
.
dataOne
.
CompanyStatus
==
2
||
undefined
||
""
)
{
this
.
stepOne
()
}
else
{
this
.
stepName
=
"第2步 品牌信息"
this
.
nextSepName
=
"第3步"
this
.
step
++
this
.
percent
+=
this
.
percent
}
}
else
if
(
this
.
step
==
2
)
{
this
.
stepName
=
"第2步 品牌信息"
this
.
nextSepName
=
"第3步"
if
(
this
.
dataOne
.
CompanyStatus
==
2
||
undefined
||
""
)
{
this
.
stepTwo
()
}
else
{
this
.
stepName
=
"第3步 扩店需求"
this
.
nextSepName
=
"完成"
this
.
step
++
this
.
percent
+=
this
.
percent
}
}
else
if
(
this
.
step
==
3
)
{
this
.
stepName
=
"第3步 扩店需求"
this
.
nextSepName
=
"完成"
console
.
log
(
"..."
,
this
.
step
)
this
.
stepThree
()
// if (this.dataOne.CompanyStatus == 2) {
// this.stepThree()
// } else {
// }
}
}
},
chooseType
(
item
)
{
chooseType
(
item
)
{
//选择客户群体
item
.
checked
=
!
item
.
checked
},
rangechange
(
e
)
{
this
.
builtArea
[
0
]
=
parseInt
(
e
.
minValue
)
this
.
builtArea
[
1
]
=
parseInt
(
e
.
maxValue
)
console
.
log
(
this
.
builtArea
)
},
reduce
()
{
if
(
this
.
dataTwo
.
ShopNum
>
0
)
{
this
.
dataTwo
.
ShopNum
--
}
else
{
this
.
dataTwo
.
ShopNum
=
0
}
},
add
()
{
this
.
dataTwo
.
ShopNum
++
},
// 获取公司认证信息
getUserCompany
()
{
let
that
=
this
let
parms
=
{
url
:
"/api/AppletTrade/GetUserCompany"
,
}
this
.
request2
(
parms
,
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
this
.
dataOne
=
res
.
data
this
.
businessLicenseUploadIsSuccess
=
true
// if(res.data.CompanyStatus==2){
that
.
getUserCompanyBrand
(
res
.
data
.
CompanyId
)
// }
}
})
},
// 根据公司id获取公司品牌
getUserCompanyBrand
(
id
)
{
let
parms
=
{
url
:
"/api/AppletTrade/GetUserCompanyBrand"
,
data
:
{
CompanyId
:
id
}
}
this
.
request2
(
parms
,
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
}
})
},
radioChange
(
e
)
{
console
.
log
(
e
,
this
.
dataThree
);
},
AreaRequireChange
(
e
){
this
.
AreaRequire
[
0
]
=
parseInt
(
e
.
minValue
)
this
.
AreaRequire
[
1
]
=
parseInt
(
e
.
maxValue
)
}
},
...
...
@@ -304,6 +542,7 @@
this
.
getCustomerTypeEnumList
()
this
.
GetProjectTypeEnumList
()
this
.
getAccess_token
()
this
.
getUserCompany
()
}
}
</
script
>
...
...
@@ -372,47 +611,65 @@
.con1
{
height
:
60rpx
;
border-bottom
:
1rpx
solid
#DADCE6
;
padding-bottom
:
24rpx
;
.input
{
font-size
:
32rpx
;
font-family
:
PingFang
SC
;
font-weight
:
bold
;
color
:
#000000
;
border-bottom
:
1rpx
solid
#DADCE6
;
padding-bottom
:
24rpx
;
}
}
.con2
{
position
:
relative
;
.conImage
{
width
:
590rpx
;
height
:
367rpx
;
background
:
linear-gradient
(
0deg
,
rgba
(
31
,
31
,
31
,
0
.92
)
,
rgba
(
31
,
31
,
31
,
0
));
// border: 1rpx solid #000000;
}
.reupload
{
width
:
185rpx
;
height
:
60rpx
;
background-color
:
#F70027
;
border-radius
:
20rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
28rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
position
:
absolute
;
left
:
50%
;
transform
:
translateX
(
-50%
);
bottom
:
40rpx
;
}
}
.con3
{
border-bottom
:
1rpx
solid
#DADCE6
;
//
border-bottom: 1rpx solid #DADCE6;
padding-bottom
:
24rpx
;
position
:
relative
;
// display: flex;
// justify-content: space-between;
.slider
{
width
:
100%
;
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
9
;
}
.numberBbox
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
.slider1
{
width
:
100%
;
position
:
absolute
;
top
:
0
;
left
:
0
;
z-index
:
8
;
.numberImg
{
width
:
38rpx
;
height
:
38rpx
;
}
.numberInput
{
margin
:
0
10rpx
;
flex-grow
:
5
;
text-align
:
center
;
}
}
}
...
...
@@ -423,8 +680,8 @@
.customTypeBox
{
display
:
flex
;
flex-wrap
:
wrap
;
justify-content
:
space-between
;
margin-bottom
:
4
0rpx
;
//
justify-content: space-between;
margin-bottom
:
2
0rpx
;
.customName
{
width
:
110rpx
;
...
...
@@ -439,9 +696,29 @@
font-size
:
28rpx
;
font-weight
:
bold
;
color
:
#000000
;
margin-right
:
50rpx
;
margin-bottom
:
20rpx
;
}
&
:nth-child
(
4n
)>
.customName
{
margin-right
:
0rpx
!
important
;
}
}
}
.con6
{
display
:
flex
;
flex-wrap
:
wrap
;
.goodsTypeImg
{
width
:
278rpx
;
height
:
144rpx
;
background-color
:
#232323
;
opacity
:
0
.6
;
border-radius
:
18rpx
;
margin-bottom
:
30rpx
;
}
}
}
}
...
...
@@ -455,6 +732,12 @@
background-color
:
#F70027
;
box-shadow
:
0rpx
4rpx
40rpx
0rpx
rgba
(
249
,
54
,
85
,
0
.58
);
border-radius
:
20rpx
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
font-size
:
28rpx
;
font-weight
:
bold
;
color
:
#FFFFFF
;
.next
{
width
:
100%
;
...
...
@@ -474,4 +757,44 @@
color
:
#F70027
!
important
;
border
:
none
!
important
;
}
// 修改滑块样式
/
deep
/
.block
{
background-color
:
#FFFFFF
;
border
:
4rpx
solid
#F70027
;
box-shadow
:
0rpx
0rpx
10rpx
0rpx
rgba
(
232
,
76
,
100
,
0
.74
);
border-radius
:
10rpx
;
}
.rangeSliderNum
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
font-size
:
32rpx
;
font-weight
:
bold
;
color
:
#000000
;
}
/
deep
/
.u-radio-group
{
display
:
flex
;
flex-wrap
:
wrap
;
}
/
deep
/
.u-radio-group
:nth-child
(
2n
)>
.u-radio
{
margin-right
:
0rpx
;
}
/
deep
/
.u-radio
{
position
:
relative
;
width
:
278rpx
;
border-radius
:
18rpx
;
margin-right
:
30rpx
;
}
/
deep
/
.u-radio__icon-wrap
{
position
:
absolute
;
top
:
17rpx
;
right
:
17rpx
;
z-index
:
10
;
}
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment