Commit 61257b89 authored by Facius's avatar Facius

首页、列表页的界面修改

parent 01df1405
...@@ -5,7 +5,20 @@ ...@@ -5,7 +5,20 @@
}, },
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "扳手会工单规范",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
}
},
{
"path": "pages/photo/index",
"style": {
"navigationBarTitleText": "拍照小工具首页"
}
},
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
...@@ -117,18 +130,7 @@ ...@@ -117,18 +130,7 @@
"navigationBarTitleText": "工单详情" "navigationBarTitleText": "工单详情"
} }
}, },
{
"path": "pages/photo/index",
"style": {
"navigationBarTitleText": "拍照小工具首页"
}
},
{
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "扳手会工单规范"
}
},
{ {
"path": "pages/photo/take", "path": "pages/photo/take",
"style": { "style": {
...@@ -160,7 +162,9 @@ ...@@ -160,7 +162,9 @@
{ {
"path": "pages/photo/list", "path": "pages/photo/list",
"style": { "style": {
"navigationBarTitleText": "规范展示" "navigationBarTitleText": "规范展示",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
} }
}, },
......
...@@ -100,7 +100,11 @@ ...@@ -100,7 +100,11 @@
} }
if(e && e.current_count){ if(e && e.current_count){
this.current_count = e.current_count this.done_count = e.current_count
}
if(e && e.current_count){
this.current_count = Math.max(e.current_count - 1, 0)
} }
if(e && e.images){ if(e && e.images){
......
<template> <template>
<view class="backView"> <view class="backView">
<view class="topView"> <view class="topView">
<view :class="activeTop == ikey ? 'topItemView whiteBackColor' : 'topItemView FAbackColor' " @click="topItemClick(ikey,item)" v-for="(item,ikey) in dataList":key="ikey"> <view class="topItemView" @click="topItemClick(ikey,item)" v-for="(item,ikey) in dataList":key="ikey">
<text class="topActiveItemTitle" v-if="activeTop == ikey">{{item.type}}</text> <text :class="['ph-lst-top-index', activeTop == ikey ? 'active-index-text' : 'index-text']">{{ ikey + 1 }}</text>
<text class="topItemTitle" v-if="activeTop != ikey">{{item.type}}</text> <text :class="activeTop == ikey ? 'topActiveItemTitle' : 'topItemTitle'">{{item.type}}</text>
</view> </view>
</view> </view>
<view class="rightView"> <view class="rightView">
<view class="right-view-title">拍照项有:</view>
<template <template
v-for="(item,ikey) in rightList" v-for="(item,ikey) in rightList"
> >
<view :class="['rightItemView',item.clickable ? 'FAbackColor' : '']" @click="rightItemClick(item,ikey)" :key="ikey"> <view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey">
<view :class=" item.images ? 'rightContentView width_50' : 'rightContentView width_100' "> <view class="['rightContentView', item.images.length > 0 ? 'gray666Color' : 'rightTitle']">
<text :class=" item.clickable ? 'gray999Color rightTitle u-m-t-30 u-m-l-30' : 'rightTitle u-m-t-30 u-m-l-30' ">{{item.name}} ({{item.image_count}}张)</text> <text class="ph-lst-item-index">{{ ikey + 1 }}</text>
<text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> <text class="">{{item.name}} ({{item.image_count}}张)</text>
<cover-image class="ph-list-item-arrow" src="/static/photo/arrow.png"></cover-image>
<!-- <text class="rightContent u-m-t-14 u-m-l-30 u-p-b-30">{{item.describe}}</text> -->
</view> </view>
<view class="rightImageView" v-if="item.images"> <view class="rightImageView" v-if="item.images">
<image class="rightImage" :src="item.images[0]" mode=""></image> <image class="rightImage" v-for="(image, index) in item.images" :src="image" :key="image" @click="handleClickImage(item, image, index)" mode=""></image>
</view> </view>
</view> </view>
</template> </template>
...@@ -121,29 +124,41 @@ ...@@ -121,29 +124,41 @@
uni.pageScrollTo({scrollTop: 0, duration: 0}); uni.pageScrollTo({scrollTop: 0, duration: 0});
}, },
//右侧点击 // 点击图片
rightItemClick: function (item,ikey) { handleClickImage(item, image, index) {
// for (let i = 0; i < this.rightList.length; i++) {
// var subItem = this.rightList[i]
// if(i == ikey){
// subItem.isClicked = true
// }
// }
// item.clickable = true
this.$set(this.rightList[ikey],'clickable',true)
var current_image = item.images[0]
var current_count = 1
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/detail' url:'/pages/photo/detail'
+'?current_image=' + current_image +'?current_image=' + image
+'&image_count=' + item.image_count +'&image_count=' + item.image_count
+'&current_count=' + current_count +'&current_count=' + (index + 1)
+'&images=' + JSON.stringify(item.images) +'&images=' + JSON.stringify(item.images)
+'&title=' + item.name, +'&title=' + item.name,
}) })
}, },
//右侧点击
rightItemClick: function (item,ikey) {
// // for (let i = 0; i < this.rightList.length; i++) {
// // var subItem = this.rightList[i]
// // if(i == ikey){
// // subItem.isClicked = true
// // }
// // }
// // item.clickable = true
// this.$set(this.rightList[ikey],'clickable',true)
// var current_image = item.images[0]
// var current_count = 1
// uni.navigateTo({
// url:'/pages/photo/detail'
// +'?current_image=' + current_image
// +'&image_count=' + item.image_count
// +'&current_count=' + current_count
// +'&images=' + JSON.stringify(item.images)
// +'&title=' + item.name,
// })
},
} }
} }
...@@ -174,49 +189,79 @@ ...@@ -174,49 +189,79 @@
width: 100%; width: 100%;
} }
.leftView{ .ph-lst-top-index {
background-color: #FFFFFF; font-size: 26rpx;
width: 20%; font-weight: bold;
display: flex; color: #FFFFFF;
flex-direction: column; border-radius: 8rpx;
background-color: #999999;
width: 36rpx;
height: 36rpx;
line-height: 36rpx;
text-align: center;
} }
.leftItemView{ .active-index-text {
display: flex; background-color:#2272FF;
align-items: center;
justify-content: center;
width: 100%;
height: 80rpx;
border-bottom: 2rpx solid #F3F3F3;
} }
.index-text {
.leftItemText{ background-color:#999999;
font-size: 28rpx;
} }
.rightView{ .rightView{
background-color: #FFFFFF; background-color: #F4F5F7;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-top: 96rpx; margin: 100rpx;
} }
.rightItemView{ .right-view-title {
width: 100%; font-size: 36rpx;
display: flex; font-weight: bold;
flex-direction: row; height: 104rpx;
justify-content: space-between; line-height: 104rpx;
border-bottom: 20rpx solid #F3F3F3; margin-left: 30rpx;
} }
.rightItemView{
/* width: 100%; */
/* display: flex; */
/* flex-direction: row; */
/* justify-content: space-between; */
/* border-bottom: 20rpx solid #F3F3F3; */
margin: 0rpx 30rpx 20rpx 30rpx;
padding: 36rpx 30rpx 18rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
}
.ph-lst-item-index {
font-size: 28rpx;
font-weight: bold;
border-radius: 4rpx;
width: 34rpx;
height: 34rpx;
line-height: 30rpx;
text-align: center;
border-width: 1px;
border-style: solid;
margin-right: 10rpx;
}
.rightContentView{ .rightContentView{
display: flex; display: flex;
flex-direction: column; align-items: center;
border-left: 2rpx solid #F3F3F3; width: 100%;
/* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */
}
.ph-list-item-arrow {
position: absolute;
width: 56rpx;
height: 56rpx;
right: 30rpx;
} }
.rightActiveContentView{ /* .rightActiveContentView{
background-color: #4CD964; background-color: #4CD964;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
...@@ -230,70 +275,69 @@ ...@@ -230,70 +275,69 @@
.width_100{ .width_100{
width: 100%; width: 100%;
} } */
.rightTitle{ .rightTitle{
font-size: 32rpx; font-size: 30rpx;
color: #4D87EA; color: #2272FF;
} }
.rightContent{ .rightContent{
font-size: 28rpx; font-size: 30rpx;
color: #333333; color: #333333;
line-height: 40rpx; line-height: 40rpx;
} }
.rightImageView{ .rightImageView{
width: 300rpx; /* width: 300rpx; */
height: 320rpx; /* height: 320rpx; */
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: flex-start;
flex-wrap: wrap;
margin-top: 26rpx;
} }
.rightImage{ .rightImage{
background-color: #F3F3F3; background-color: #F3F3F3;
width: 240rpx; width: 116rpx;
height: 240rpx; height: 116rpx;
margin: 0rpx 12rpx 12rpx 0rpx;
} }
.topView{ .topView{
background-color: #FAFAFA; background-color: #FAFAFA;
width: 100%; width: 100%;
height: 96rpx; height: 100rpx;
position: fixed; position: fixed;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.topItemView{ .topItemView{
width: 210rpx; /* width: 210rpx; */
height: 96rpx; height: 100rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} -webkit-flex: 1;
flex: 1;
.whiteBackColor{
background-color: #FFFFFF; background-color: #FFFFFF;
} }
.FAbackColor{
background-color: #FAFAFA;
}
.topItemTitle{ .topItemTitle{
font-size: 32rpx; font-size: 36rpx;
color: #999999; color: #999999;
font-weight: bold;
padding-left: 30rpx; padding-left: 30rpx;
} }
.topActiveItemTitle{ .topActiveItemTitle{
font-size: 32rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
color: #333333; color: #2272FF;
padding-left: 30rpx; padding-left: 30rpx;
} }
...@@ -301,8 +345,9 @@ ...@@ -301,8 +345,9 @@
background-color: #4CD964; background-color: #4CD964;
} }
.gray999Color{ .gray666Color{
color: #999999; color: #666666;
border-color: #666666;
} }
......
<template> <template>
<view class="backView"> <view class="backView">
<text class="topTitle">选择产品</text> <view class="ph-pr-arr" v-for="(dataItem, index) in list" :key="index">
<view class="u-p-b-48"> <template v-if="dataItem.data.length > 0">
<view class="itemView u-m-t-48" @click="itemClick(item)" v-for="(item,ikey) in productList":key="ikey"> <view class="topTitle"><text>{{ dataItem.title }}</text></view>
<view class="ph-pr-content" >
<view :class="param[item.type + '_code'] === item.code ? 'select-item-view' : 'item-view'"
@click="itemClick(item)" v-for="(item,ikey) in dataItem.data" :key="item.code">
<text class="itemTitle">{{item.name}}</text> <text class="itemTitle">{{item.name}}</text>
</view> </view>
</view> </view>
</template>
</view>
<button class="ph-pr-button" type="primary" @click="handleClick"
:style="selectedAll ? 'background-color: #2272FF;' : 'background-color: #D1D4D4;'">下一步</button>
</view> </view>
</template> </template>
...@@ -14,9 +20,35 @@ ...@@ -14,9 +20,35 @@
export default { export default {
data() { data() {
return { return {
productList:[], productList: [],
product_code:'', sysList: [],
product:'', brandList: [],
product_code: '',
product: '',
param: {
brand_code: '',
brand: '',
product_code: '',
product: ''
},
selectedAll: false,
}
},
computed: {
list() {
return [{
title: '请选择类别',
data: this.productList
},
{
title: '请选择系统',
data: this.sysList
},
{
title: '请选择品牌',
data: this.brandList
}
]
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -24,63 +56,108 @@ ...@@ -24,63 +56,108 @@
this.getProductList() this.getProductList()
}, },
onShareAppMessage(res) { onShareAppMessage(res) {
let shareObj = { let shareObj = {
title: '', title: '',
path: '/pages/photo/product', path: '/pages/photo/product',
imageUrl: '', imageUrl: '',
success(){}, success() {},
fail(){} fail() {}
} }
return shareObj return shareObj
}, },
methods: { methods: {
getProductList: function(){ getProductList: function() {
let that = this let that = this
this.$u.cloudApi.getAllProduct().then(res =>{ this.$u.cloudApi.getAllProduct().then(res => {
console.log('获取产品数据:') console.log('获取产品数据:')
console.log(res) console.log(res)
if(res.result && res.result.data){ if (res.result && res.result.data) {
that.productList = res.result.data that.productList = res.result.data
} }
}) })
}, },
//选择 点击 //选择 点击
itemClick: function (item) { itemClick: function(item) {
switch (item.type) {
if(item.code){ case 'product':
this.product_code = item.code this.initSelect()
this.param.product_code = item.code
this.param.product = item.name
this.$u.cloudApi.getBrand({
product_code: this.param.product_code
}).then(res => {
console.log('获取品牌数据:', res)
if (res.result.data) {
res.result.data.filter((value) => {
value.type = 'brand'
})
this.brandList = res.result.data
this.changeSelectedAll()
} }
})
if(item.name){ break
this.product = item.name default:
this.param.brand_code = item.code
this.param.brand = item.name
this.changeSelectedAll()
} }
// uni.navigateTo({
// url: '/pages/photo/brand' +
// '?product_code=' + this.param.product_code +
// '&product=' + this.param.product,
// })
},
// 点击下一步
handleClick() {
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/brand' url: '/pages/photo/list' +
+ '?product_code=' + this.product_code '?brand_code=' + this.param.brand_code +
+ '&product=' + this.product, '&brand=' + this.param.brand +
'&product_code=' + this.param.product_code +
'&product=' + this.param.product,
}) })
}, },
// 修改下一步按钮是否可以点击
changeSelectedAll() {
for (var item in this.param) {
if (!this.param[item]) {
this.selectedAll = false
return
}
}
this.selectedAll = true
},
// 初始化选择
initSelect() {
this.param = {
brand_code: '',
brand: '',
product_code: '',
product: ''
}
this.brandList = []
this.selectedAll = false
}
} }
} }
</script> </script>
<style> <style>
.backView {
.backView{
background-color: #FAFAFA; background-color: #FAFAFA;
position: absolute; position: absolute;
top: 0; top: 0;
...@@ -89,29 +166,73 @@ ...@@ -89,29 +166,73 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
height: 100%;
} }
.topTitle{ .topTitle {
margin-top: 192rpx; margin-top: 50rpx;
font-size: 32rpx; padding-left: 30rpx;
font-size: 36rpx;
font-weight: bold;
color: #333333;
}
.ph-pr-content {
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
width: 100%;
padding: 22rpx 22rpx;
} }
.itemView{ .ph-pr-arr {
width: 100%;
}
.item-view {
background-color: #FFFFFF; background-color: #FFFFFF;
width: 548rpx; /* width: 548rpx; */
height: 96rpx; margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
border-style: solid; border-style: solid;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05); box-shadow: 0px 2px 7px 0px rgba(0, 0, 0, 0.05);
border-width: 0rpx; border-width: 0rpx;
border-radius: 12rpx;
font-size: 26rpx;
color: #666666;
} }
.itemTitle{ .select-item-view {
font-size: 32rpx; background-color: #2272FF;
font-weight:bold; margin: 0rpx 8rpx 24rpx 8rpx;
/* flex: 1 1 0%;
max-width: 33%; */
width: 222rpx;
height: 76rpx;
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;
border-radius: 12rpx;
font-size: 26rpx;
color: #FFFFFF;
} }
.ph-pr-button {
position: absolute;
bottom: 76rpx;
border-radius: 52rpx;
height: 104rpx;
font-size: 32rpx;
width: 600rpx;
line-height: 104rpx;
}
</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