Commit e7fff6f2 authored by 和慭琛's avatar 和慭琛

部分接口对接 部分UI高保真还原

parent 6c8aa5b9
...@@ -6,17 +6,18 @@ ...@@ -6,17 +6,18 @@
*/ */
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/photo/product", "path": "pages/photo/list",
"style": { "style": {
"navigationBarTitleText": "选择产品" "navigationBarTitleText": "规范展示"
} }
}, },
{ {
"path": "pages/photo/try", "path": "pages/photo/product",
"style": { "style": {
"navigationBarTitleText": "拍照" "navigationBarTitleText": "选择产品"
} }
}, },
...@@ -31,20 +32,25 @@ ...@@ -31,20 +32,25 @@
{ {
"path": "pages/photo/detail", "path": "pages/photo/try",
"style": { "style": {
"navigationBarTitleText": "图片展示" "navigationBarTitleText": "拍照"
} }
}, },
{ {
"path": "pages/photo/list", "path": "pages/photo/detail",
"style": { "style": {
"navigationBarTitleText": "规范展示" "navigationBarTitleText": "图片展示"
} }
}, },
...@@ -53,6 +59,10 @@ ...@@ -53,6 +59,10 @@
{ {
"path": "pages/photo/brand", "path": "pages/photo/brand",
"style": { "style": {
......
<template> <template>
<view class="backView"> <view class="backView">
<text class="topTitle">选择产品</text> <text class="topTitle"> {{product}} > 选择产品</text>
<view class=""> <view class="u-p-b-48">
<view class="itemView u-m-t-80" v-for="(item,ikey) in brandList":key="ikey"> <view class="itemView u-m-t-48" v-for="(item,ikey) in brandList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.title}}</text> <text class="itemTitle" @click="itemClick(item)">{{item.name}}</text>
</view> </view>
</view> </view>
...@@ -14,14 +14,21 @@ ...@@ -14,14 +14,21 @@
export default { export default {
data() { data() {
return { return {
code:'', product_code:'',
brandList:[] brandList:[],
brand_code:'',
product:'',
brand:'',
} }
}, },
onLoad(e) { onLoad(e) {
if(e && e.code){ if(e && e.product_code){
this.code = e.code this.product_code = e.product_code
}
if(e && e.product){
this.product = e.product
} }
this.getBrandList() this.getBrandList()
...@@ -30,27 +37,37 @@ ...@@ -30,27 +37,37 @@
getBrandList: function () { getBrandList: function () {
this.$u.cloudApi.getBrand({product_code:this.code}).then(res =>{ let that = this
console.log(res,"品牌")
this.$u.cloudApi.getBrand({product_code:this.product_code}).then(res =>{
console.log('获取品牌数据:')
console.log(res)
if(res.result.data){
that.brandList = res.result.data
}
} }
) )
// this.brandList = [
// {
// 'title':'广汽',
// 'id':0
// },
// {
// 'title':'比亚迪',
// 'id':1
// }
// ]
}, },
//选择 点击 //选择 点击
itemClick: function (item) { itemClick: function (item) {
if(item.product_code){
this.brand_code = item.code
}
if(item.name){
this.brand = item.name
}
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/list' url:'/pages/photo/list'
+ '?brand_code=' + this.brand_code
+ '&brand=' + this.brand
+ '&product=' + this.product,
}) })
}, },
...@@ -74,21 +91,27 @@ ...@@ -74,21 +91,27 @@
} }
.topTitle{ .topTitle{
margin-top: 80rpx; margin-top: 192rpx;
font-size: 32rpx; font-size: 32rpx;
} }
.itemView{ .itemView{
background-color: #999999; background-color: #FFFFFF;
width: 400rpx; width: 548rpx;
height: 80rpx; height: 96rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
} }
.itemTitle{ .itemTitle{
font-size: 28rpx; font-size: 32rpx;
font-weight:bold;
} }
</style> </style>
<template> <template>
<view class="backView"> <view class="backView">
<text class="topTitle">{{topTitle}}</text> <view class="topView">
<view :class="activeTop == ikey ? 'topItemView whiteBackColor' : 'topItemView FAbackColor' " @click="topItemClick(ikey,item)" v-for="(item,ikey) in topList":key="ikey">
<text class="topActiveItemTitle" v-if="activeTop == ikey">{{item.title}}</text>
<text class="topItemTitle" v-if="activeTop != ikey">{{item.title}}</text>
</view>
</view>
<!--text class="topTitle">{{topTitle}}</text>
<view class="centerBackView"> <view class="centerBackView">
<view class="leftView"> <view class="leftView">
<view class="leftItemView" @click="leftItemClick(item,ikey)" v-for="(item,ikey) in leftList":key="ikey"> <view class="leftItemView" @click="leftItemClick(item,ikey)" v-for="(item,ikey) in leftList":key="ikey">
...@@ -18,7 +24,7 @@ ...@@ -18,7 +24,7 @@
</view> </view>
</view> </view>
</view> </view>
</view> </view-->
</view> </view>
</template> </template>
...@@ -26,18 +32,59 @@ ...@@ -26,18 +32,59 @@
export default { export default {
data() { data() {
return { return {
topList:[],
topTitle:'', topTitle:'',
activeTop:0,
leftList:[], leftList:[],
rightList:[], rightList:[],
brand_code:'',
product:'',
brand:'',
} }
}, },
onLoad(e) { onLoad(e) {
this.topTitle = '充电桩-北汽'
if(e && e.brand_code){
this.brand_code = e.brand_code
}
if(e && e.product){
this.product = e.product
}
if(e && e.brand){
this.brand = e.brand
uni.setNavigationBarTitle({
title: this.brand
});
}
this.topList = [
{'title':'安装阶段'},
{'title':'勘察部分'},
{'title':'一一阶段'},
{'title':'二二阶段'},
{'title':'三三阶段'},
{'title':'四四阶段'},
]
this.topTitle = this.product + '-' + this.brand
this.getLeftData() this.getLeftData()
}, },
methods: { methods: {
getLeftData: function (){ getLeftData: function (){
this.$u.cloudApi.getstandard({brand_code:this.brand_code}).then(res =>{
console.log('获取规范标准数据:')
console.log(res)
})
this.leftList = [ this.leftList = [
{'title':'回单','id':0}, {'title':'回单','id':0},
{'title':'回单','id':1}, {'title':'回单','id':1},
...@@ -71,6 +118,11 @@ ...@@ -71,6 +118,11 @@
] ]
}, },
//顶部点击
topItemClick: function (ikey,item) {
this.activeTop = ikey
},
//左侧点击 //左侧点击
leftItemClick: function (item,ikey) { leftItemClick: function (item,ikey) {
this.getRightData() this.getRightData()
...@@ -185,6 +237,44 @@ ...@@ -185,6 +237,44 @@
height: 80%; height: 80%;
} }
.topView{
background-color: #007AFF;
height: 96rpx;
display: flex;
flex-direction: row;
}
.topItemView{
width: 210rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
}
.whiteBackColor{
background-color: #FFFFFF;
}
.FAbackColor{
background-color: #FAFAFA;
}
.topItemTitle{
font-size: 32rpx;
color: #999999;
}
.topActiveItemTitle{
font-size: 32rpx;
font-weight: bold;
color: #333333;
}
......
<template> <template>
<view class="backView"> <view class="backView">
<text class="topTitle">选择产品</text> <text class="topTitle">选择产品</text>
<view class=""> <view class="u-p-b-48">
<view class="itemView u-m-t-80" v-for="(item,ikey) in productList":key="ikey"> <view class="itemView u-m-t-48" v-for="(item,ikey) in productList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.name}}</text> <text class="itemTitle" @click="itemClick(item)">{{item.name}}</text>
</view> </view>
</view> </view>
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
data() { data() {
return { return {
productList:[], productList:[],
code:'', product_code:'',
product:'',
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -39,37 +40,25 @@ ...@@ -39,37 +40,25 @@
}) })
/*
const db = uniCloud.database({
spaceId: 'tcb-nikbzhlwnpd5n913e1c5e-50f4bbo'
})
const collection = db.collection("config").where({type: "brand"}).get()
console.log('collection:')
console.log(collection)
this.productList = [
{
'title':'新风机',
'id':0
},
{
'title':'充电桩',
'id':1
}
]
*/
}, },
//选择 点击 //选择 点击
itemClick: function (item) { itemClick: function (item) {
if(item.code){ if(item.code){
this.code = item.code this.product_code = item.code
}
if(item.name){
this.product = item.name
} }
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/brand' + '?code=' + this.code url:'/pages/photo/brand'
+ '?product_code=' + this.product_code
+ '&product=' + this.product,
}) })
}, },
...@@ -93,22 +82,26 @@ ...@@ -93,22 +82,26 @@
} }
.topTitle{ .topTitle{
margin-top: 80rpx; margin-top: 192rpx;
font-size: 32rpx; font-size: 32rpx;
} }
.itemView{ .itemView{
background-color: #999999; background-color: #FFFFFF;
width: 400rpx; width: 548rpx;
height: 80rpx; height: 96rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
} }
.itemTitle{ .itemTitle{
font-size: 28rpx; font-size: 32rpx;
font-weight:bold;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment