Commit 61257b89 authored by Facius's avatar Facius

首页、列表页的界面修改

parent 01df1405
...@@ -4,8 +4,21 @@ ...@@ -4,8 +4,21 @@
"^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue" "^u-(.*)": "@/uview-ui/components/u-$1/u-$1.vue"
}, },
"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,
// })
},
} }
} }
...@@ -173,50 +188,80 @@ ...@@ -173,50 +188,80 @@
margin-top: 80rpx; margin-top: 80rpx;
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; */
} }
.rightActiveContentView{ .ph-list-item-arrow {
position: absolute;
width: 56rpx;
height: 56rpx;
right: 30rpx;
}
/* .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>
<text class="itemTitle">{{item.name}}</text> <view class="ph-pr-content" >
</view> <view :class="param[item.type + '_code'] === item.code ? 'select-item-view' : 'item-view'"
</view> @click="itemClick(item)" v-for="(item,ikey) in dataItem.data" :key="item.code">
<text class="itemTitle">{{item.name}}</text>
</view> </view>
</template> </view>
</template>
<script> </view>
export default { <button class="ph-pr-button" type="primary" @click="handleClick"
data() { :style="selectedAll ? 'background-color: #2272FF;' : 'background-color: #D1D4D4;'">下一步</button>
return { </view>
productList:[], </template>
product_code:'',
product:'', <script>
} export default {
}, data() {
onLoad(e) { return {
getApp().trackPage('选择产品页') productList: [],
this.getProductList() sysList: [],
brandList: [],
}, product_code: '',
product: '',
onShareAppMessage(res) { param: {
let shareObj = { brand_code: '',
title: '', brand: '',
path: '/pages/photo/product', product_code: '',
imageUrl: '', product: ''
success(){}, },
fail(){} selectedAll: false,
} }
return shareObj },
}, computed: {
methods: { list() {
return [{
getProductList: function(){ title: '请选择类别',
data: this.productList
let that = this },
{
this.$u.cloudApi.getAllProduct().then(res =>{ title: '请选择系统',
console.log('获取产品数据:') data: this.sysList
console.log(res) },
if(res.result && res.result.data){ {
that.productList = res.result.data title: '请选择品牌',
} data: this.brandList
}
}) ]
}
},
onLoad(e) {
getApp().trackPage('选择产品页')
this.getProductList()
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/photo/product',
imageUrl: '',
success() {},
fail() {}
}
return shareObj
},
methods: {
getProductList: function() {
let that = this
this.$u.cloudApi.getAllProduct().then(res => {
console.log('获取产品数据:')
console.log(res)
if (res.result && res.result.data) {
that.productList = res.result.data
}
})
},
//选择 点击
itemClick: function(item) {
switch (item.type) {
case 'product':
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()
}
})
break
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({
url: '/pages/photo/list' +
'?brand_code=' + this.param.brand_code +
'&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
}, },
//选择 点击 // 初始化选择
itemClick: function (item) { initSelect() {
this.param = {
brand_code: '',
if(item.code){ brand: '',
this.product_code = item.code product_code: '',
product: ''
} }
this.brandList = []
if(item.name){ this.selectedAll = false
this.product = item.name }
} }
}
uni.navigateTo({ </script>
url:'/pages/photo/brand'
+ '?product_code=' + this.product_code <style>
+ '&product=' + this.product, .backView {
}) background-color: #FAFAFA;
}, position: absolute;
top: 0;
left: 0;
width: 100%;
} display: flex;
} flex-direction: column;
</script> align-items: center;
height: 100%;
<style> }
.backView{ .topTitle {
background-color: #FAFAFA; margin-top: 50rpx;
position: absolute; padding-left: 30rpx;
top: 0; font-size: 36rpx;
left: 0; font-weight: bold;
width: 100%; color: #333333;
display: flex; }
flex-direction: column;
align-items: center; .ph-pr-content {
} display: flex;
flex-wrap: wrap;
.topTitle{ justify-content: flex-start;
margin-top: 192rpx; width: 100%;
font-size: 32rpx; padding: 22rpx 22rpx;
}
}
.ph-pr-arr {
.itemView{ width: 100%;
background-color: #FFFFFF; }
width: 548rpx;
height: 96rpx; .item-view {
display: flex; background-color: #FFFFFF;
align-items: center; /* width: 548rpx; */
justify-content: center; margin: 0rpx 8rpx 24rpx 8rpx;
border-style: solid; /* flex: 1 1 0%;
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05); max-width: 33%; */
border-width: 0rpx; width: 222rpx;
} height: 76rpx;
display: flex;
.itemTitle{ align-items: center;
font-size: 32rpx; justify-content: center;
font-weight:bold; 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: #666666;
}
.select-item-view {
background-color: #2272FF;
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