Commit 22c4ebea authored by 李俊赕's avatar 李俊赕

Merge branch 'dev-photo-tools' of...

Merge branch 'dev-photo-tools' of https://git.banshouhui.com/heyinchen/take_order into dev-photo-tools
parents a564e11c e7fff6f2
......@@ -6,17 +6,18 @@
*/
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/photo/product",
"path": "pages/photo/list",
"style": {
"navigationBarTitleText": "选择产品"
"navigationBarTitleText": "规范展示"
}
},
{
"path": "pages/photo/try",
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "拍照"
"navigationBarTitleText": "选择产品"
}
},
......@@ -31,20 +32,25 @@
{
"path": "pages/photo/detail",
"path": "pages/photo/try",
"style": {
"navigationBarTitleText": "图片展示"
"navigationBarTitleText": "拍照"
}
},
{
"path": "pages/photo/list",
"path": "pages/photo/detail",
"style": {
"navigationBarTitleText": "规范展示"
"navigationBarTitleText": "图片展示"
}
},
......@@ -53,6 +59,10 @@
{
"path": "pages/photo/brand",
"style": {
......
<template>
<view class="backView">
<text class="topTitle">选择产品</text>
<view class="">
<view class="itemView u-m-t-80" v-for="(item,ikey) in brandList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.title}}</text>
<text class="topTitle"> {{product}} > 选择产品</text>
<view class="u-p-b-48">
<view class="itemView u-m-t-48" v-for="(item,ikey) in brandList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.name}}</text>
</view>
</view>
......@@ -14,14 +14,21 @@
export default {
data() {
return {
code:'',
brandList:[]
product_code:'',
brandList:[],
brand_code:'',
product:'',
brand:'',
}
},
onLoad(e) {
if(e && e.code){
this.code = e.code
if(e && e.product_code){
this.product_code = e.product_code
}
if(e && e.product){
this.product = e.product
}
this.getBrandList()
......@@ -30,27 +37,37 @@
getBrandList: function () {
this.$u.cloudApi.getBrand({product_code:this.code}).then(res =>{
console.log(res,"品牌")
let that = this
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) {
if(item.product_code){
this.brand_code = item.code
}
if(item.name){
this.brand = item.name
}
uni.navigateTo({
url:'/pages/photo/list'
+ '?brand_code=' + this.brand_code
+ '&brand=' + this.brand
+ '&product=' + this.product,
})
},
......@@ -74,21 +91,27 @@
}
.topTitle{
margin-top: 80rpx;
margin-top: 192rpx;
font-size: 32rpx;
}
.itemView{
background-color: #999999;
width: 400rpx;
height: 80rpx;
background-color: #FFFFFF;
width: 548rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
}
.itemTitle{
font-size: 28rpx;
font-size: 32rpx;
font-weight:bold;
}
</style>
<template>
<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="leftView">
<view class="leftItemView" @click="leftItemClick(item,ikey)" v-for="(item,ikey) in leftList":key="ikey">
......@@ -18,7 +24,7 @@
</view>
</view>
</view>
</view>
</view-->
</view>
</template>
......@@ -26,18 +32,59 @@
export default {
data() {
return {
topList:[],
topTitle:'',
activeTop:0,
leftList:[],
rightList:[],
brand_code:'',
product:'',
brand:'',
}
},
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()
},
methods: {
getLeftData: function (){
this.$u.cloudApi.getstandard({brand_code:this.brand_code}).then(res =>{
console.log('获取规范标准数据:')
console.log(res)
})
this.leftList = [
{'title':'回单','id':0},
{'title':'回单','id':1},
......@@ -71,6 +118,11 @@
]
},
//顶部点击
topItemClick: function (ikey,item) {
this.activeTop = ikey
},
//左侧点击
leftItemClick: function (item,ikey) {
this.getRightData()
......@@ -185,6 +237,44 @@
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>
<view class="backView">
<text class="topTitle">选择产品</text>
<view class="">
<view class="itemView u-m-t-80" v-for="(item,ikey) in productList":key="ikey">
<view class="u-p-b-48">
<view class="itemView u-m-t-48" v-for="(item,ikey) in productList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.name}}</text>
</view>
</view>
......@@ -15,7 +15,8 @@
data() {
return {
productList:[],
code:'',
product_code:'',
product:'',
}
},
onLoad(e) {
......@@ -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) {
if(item.code){
this.code = item.code
this.product_code = item.code
}
if(item.name){
this.product = item.name
}
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 @@
}
.topTitle{
margin-top: 80rpx;
margin-top: 192rpx;
font-size: 32rpx;
}
.itemView{
background-color: #999999;
width: 400rpx;
height: 80rpx;
background-color: #FFFFFF;
width: 548rpx;
height: 96rpx;
display: flex;
align-items: center;
justify-content: center;
border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx;
}
.itemTitle{
font-size: 28rpx;
font-size: 32rpx;
font-weight:bold;
}
</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