Commit 6ce9009e authored by 李超鹏's avatar 李超鹏

Merge remote-tracking branch 'origin/dev-photo-v2' into dev-photo-v2

parents 6bcf931f 9ed6abef
<template> <template>
<view class="backView"> <view class="backView">
<view class="topView"> <view class="topView">
<view class="topItemView" @click="topItemClick(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey"> <view :class="['topItemView', {'active':activeTop===ikey}]" @click="handleTopItemChange(ikey,item)" v-for="(item,ikey) in dataList" :key="ikey">
<text <text
:class="['ph-lst-top-index', activeTop == ikey ? 'active-index-text' : 'index-text']">{{ ikey + 1 }}</text> :class="['ph-lst-top-index', {'active':activeTop===ikey}]">{{ ikey + 1 }}</text>
<text :class="activeTop == ikey ? 'topActiveItemTitle' : 'topItemTitle'">{{item.type}}</text> <text class="topItemTitle">{{item.type}}</text>
</view> </view>
</view> </view>
<view class="rightView"> <view class="rightView">
<view class="right-view-title">拍照项有:</view> <view class="right-view-title">拍照项有:</view>
<template v-for="(item,ikey) in rightList"> <template v-for="(item,ikey) in rightList">
<view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey"> <view class="rightItemView" @click="rightItemClick(item,ikey)" :key="ikey">
<view :class="['rightContentView', item.images.length > 0 ? 'gray666Color' : 'rightTitle']"> <view :class="['rightContentView', {'active':item.images.length > 0}]">
<text class="ph-lst-item-index">{{ ikey + 1 }}</text> <text class="ph-lst-item-index">{{ ikey + 1 }}</text>
<text class="">{{item.name}} ({{item.image_count}}张)</text> <text class="">{{item.name}} ({{item.image_count}}张)</text>
<image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image> <image class="ph-list-item-arrow" src="/static/photo/arrow.png"></image>
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</view> </view>
<view class="rightImageView" v-if="item.images"> <view class="rightImageView" v-if="item.images">
<image class="rightImage" v-for="(image, index) in item.images" :src="image" :key="image" <image class="rightImage" v-for="(image, index) in item.images" :src="image" :key="image"
@click="handleClickImage(item, image, index)" mode=""></image> @click.stop="handleClickImage(item, index)" mode=""></image>
</view> </view>
</view> </view>
</template> </template>
...@@ -89,23 +89,23 @@ ...@@ -89,23 +89,23 @@
}).then(res => { }).then(res => {
console.log('获取规范标准数据:') console.log('获取规范标准数据:')
console.log(res) console.log(res)
if (res.result && res.result.length) { if (res && res.result) {
that.handleData(res) that.handleData(res.result)
} }
}) })
}, },
handleData: function(res) { handleData: function(result) {
const globalData = getApp().globalData const globalData = getApp().globalData
globalData.photo.productList = res.result globalData.photo.productList = result
this.dataList = res.result this.dataList = result
var item = res.result[0] var item = result[0]
this.rightList = item.list this.rightList = item.list
}, },
//顶部点击 //顶部点击
topItemClick: function(ikey, item) { handleTopItemChange: function(ikey, item) {
this.activeTop = ikey this.activeTop = ikey
this.rightList = item.list this.rightList = item.list
uni.pageScrollTo({ uni.pageScrollTo({
...@@ -115,15 +115,7 @@ ...@@ -115,15 +115,7 @@
}, },
// 点击图片 // 点击图片
handleClickImage(item, image, index) { handleClickImage(item, index) {
// uni.navigateTo({
// url: '/pages/photo/detail' +
// '?current_image=' + image +
// '&image_count=' + item.images.length +
// '&current_count=' + (index + 1) +
// '&images=' + JSON.stringify(item.images) +
// '&title=' + item.name,
// })
uni.previewImage({ uni.previewImage({
urls: item.images, urls: item.images,
current:index current:index
...@@ -132,24 +124,6 @@ ...@@ -132,24 +124,6 @@
//右侧点击 //右侧点击
rightItemClick: function(item, ikey) { 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/standard'
// // +'?current_image=' + current_image
// // +'&image_count=' + item.image_count
// // +'&current_count=' + current_count
// // +'&images=' + JSON.stringify(item.images)
// // +'&title=' + item.name,
// })
console.log(item,'item') console.log(item,'item')
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
photo.currentItem = item photo.currentItem = item
...@@ -195,13 +169,10 @@ ...@@ -195,13 +169,10 @@
text-align: center; text-align: center;
} }
.active-index-text { .ph-lst-top-index.active {
background-color: #2272FF; background-color: #2272FF;
} }
.index-text {
background-color: #999999;
}
.rightView { .rightView {
background-color: #F4F5F7; background-color: #F4F5F7;
...@@ -248,9 +219,15 @@ ...@@ -248,9 +219,15 @@
.rightContentView { .rightContentView {
display: flex; display: flex;
align-items: center; align-items: center;
width: 100%; width: 100%;
font-size: 30rpx;
color: #2272FF;
/* flex-direction: column; */ /* flex-direction: column; */
/* border-left: 2rpx solid #F3F3F3; */ /* border-left: 2rpx solid #F3F3F3; */
}
.rightContentView.active {
color: #666666;
border-color: #666666;
} }
.ph-list-item-arrow { .ph-list-item-arrow {
...@@ -260,27 +237,6 @@ ...@@ -260,27 +237,6 @@
right: 30rpx; right: 30rpx;
} }
/* .rightActiveContentView{
background-color: #4CD964;
display: flex;
flex-direction: column;
border-left: 2rpx solid #F3F3F3;
}
.width_50{
width: 480rpx;
}
.width_100{
width: 100%;
} */
.rightTitle {
font-size: 30rpx;
color: #2272FF;
}
.rightContent { .rightContent {
font-size: 30rpx; font-size: 30rpx;
color: #333333; color: #333333;
...@@ -323,30 +279,21 @@ ...@@ -323,30 +279,21 @@
justify-content: center; justify-content: center;
-webkit-flex: 1; -webkit-flex: 1;
flex: 1; flex: 1;
background-color: #FFFFFF; background-color: #FFFFFF;
color: #999999;
}
.topItemView.active {
color: #2272FF;
} }
.topItemTitle { .topItemTitle {
font-size: 36rpx;
color: #999999;
font-weight: bold;
padding-left: 30rpx;
}
.topActiveItemTitle {
font-size: 36rpx; font-size: 36rpx;
font-weight: bold; font-weight: bold;
color: #2272FF;
padding-left: 30rpx; padding-left: 30rpx;
} }
.greenBackColor { .greenBackColor {
background-color: #4CD964; background-color: #4CD964;
} }
.gray666Color {
color: #666666;
border-color: #666666;
}
</style> </style>
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
</view> </view>
</template> </template>
</view> </view>
<button class="ph-pr-button" type="primary" @click="handleClick" <button class="ph-pr-button" type="primary" @click="handleClick" :disabled="!selectedAll"
:style="selectedAll ? 'background-color: #2272FF;' : 'background-color: #D1D4D4;'">下一步</button> :style="buttonStyle">下一步</button>
</view> </view>
</template> </template>
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
data: this.brandList data: this.brandList
} }
] ]
},
buttonStyle() {
return this.selectedAll ? 'color: #FFFFFF;background-color: #2272FF;' :
'color: #FFFFFF;background-color: #D1D4D4;'
} }
}, },
onLoad(e) { onLoad(e) {
...@@ -143,8 +147,8 @@ ...@@ -143,8 +147,8 @@
handleClick() { handleClick() {
// 点击下一步设置全局拍照品牌品类 // 点击下一步设置全局拍照品牌品类
const globalData = getApp().globalData const globalData = getApp().globalData
let keys = ['brandId','brandName','classifyId','systemId'] let keys = ['brandId', 'brandName', 'classifyId', 'systemId']
keys.map(key=>{ keys.map(key => {
globalData.photo.product[key] = this[key] || this.param[key] globalData.photo.product[key] = this[key] || this.param[key]
}) })
uni.navigateTo({ uni.navigateTo({
......
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