Commit 1c851e71 authored by Facius's avatar Facius

Merge branch 'dev-photo-v2' of https://git.banshouhui.com/heyinchen/take_order into dev-photo-v2

parents 141b1fab 5d20b40f
<template> <template>
<cover-view class="standard-box" > <view class="standard-box" v-if="currentItem">
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish"> <swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item" key="swiper1"> <swiper-item class="swiper-item" key="swiper1">
<view class="title"> <view class="title">
拍照要求 拍照要求
</view> </view>
<view class="txt-box"> <view class="txt-box" >
<view class="txt"> <view class="txt" v-for="(txt,index) in currentItem.main_point" :key="index">
1.充电桩必须通电,可看到电源指示灯亮 {{index+1}}. {{txt}}
</view> </view>
<view class="txt tips"> <view class="txt tips">
注意:人桩合影必须上传至少两张相片,一张 注意:{{currentItem.note}}
</view> </view>
</view> </view>
</swiper-item> </swiper-item>
<swiper-item class="swiper-item" v-for="(src, index) in swiperList" :key="index"> <swiper-item class="swiper-item" v-for="(src, index) in swiperList" :key="index">
<cover-image bindtap="previewImage(item,index)" class="icon" mode="aspectFit" :src="src"></cover-image> <cover-image @click="previewImage(index)" class="icon" mode="aspectFit" :src="src"></cover-image>
</swiper-item> </swiper-item>
</swiper> </swiper>
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
ref="uTabs" :list="tabList" :current="current" ref="uTabs" :list="tabList" :current="current"
@change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper> @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view> </view>
</cover-view> </view>
</template> </template>
<script> <script>
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
watch:{ watch:{
"currentItem.images"(val){ "currentItem.images"(val){
if(val.length>0){ if(val.length>0){
this.changeList() this.changeList(val)
// let swiperList = JSON.parse(JSON.stringify(val)) // let swiperList = JSON.parse(JSON.stringify(val))
// let len = tabs.length // let len = tabs.length
// let tabList = [{name:'拍照要求'}].concat(Array.from({name:'示意图'},len)) // let tabList = [{name:'拍照要求'}].concat(Array.from({name:'示意图'},len))
...@@ -87,11 +87,20 @@ ...@@ -87,11 +87,20 @@
this.getSwiperHeight() this.getSwiperHeight()
}, },
methods: { methods: {
changeList(){ changeList(list){
let swiperList = JSON.parse(JSON.stringify(val)) let swiperList = JSON.parse(JSON.stringify(list))
let len = tabs.length let len = list.length
let tabList = [{name:'拍照要求'}].concat(Array.from({name:'示意图'},len)) let tabList = []
console.log(tabList,'tabList') for(let i=0;i<len;i++){
let item = {
name:'示意图' + (i + 1)
}
tabList.push(item)
}
tabList = [{name:'拍照要求'}].concat(tabList)
this.swiperList = swiperList
this.tabList = tabList
}, },
getSwiperHeight(){ getSwiperHeight(){
const globalData = getApp().globalData const globalData = getApp().globalData
...@@ -100,7 +109,7 @@ ...@@ -100,7 +109,7 @@
previewImage(index){ previewImage(index){
uni.previewImage({ uni.previewImage({
current:index, current:index,
urls:[], urls:this.swiperList,
}) })
}, },
// tabs通知swiper切换 // tabs通知swiper切换
...@@ -172,6 +181,7 @@ ...@@ -172,6 +181,7 @@
overflow: auto; overflow: auto;
} }
.txt{ .txt{
white-space: normal;
padding-top:26rpx; padding-top:26rpx;
line-height: 34rpx; line-height: 34rpx;
color:#666; color:#666;
......
...@@ -86,13 +86,7 @@ ...@@ -86,13 +86,7 @@
this.waterInfo.date = this.getTime() this.waterInfo.date = this.getTime()
this.getLocation() this.getLocation()
this.getMarkPath() this.getMarkPath()
console.log(standard,'standard') this.currentItem = photo.currentItem
// this.getSystemInfo()
// uni.setNavigationBarColor({
// frontColor: '#FFFFFF',
// backgroundColor: '#333333',
// })
//this.address = ''
}, },
compute: {}, compute: {},
watch: { watch: {
......
'use strict'; 'use strict';
exports.main = async (event, context) => { exports.main = async (event, context) => {
const field_name = event.field
const param = { const param = {
"classify_id": event.classify_id, "classify_id": event.classify_id,
"system_id": event.system_id, "system_id": event.system_id,
...@@ -11,7 +9,6 @@ exports.main = async (event, context) => { ...@@ -11,7 +9,6 @@ exports.main = async (event, context) => {
let res = await db.collection("standardV2").aggregate().match(param).group({ let res = await db.collection("standardV2").aggregate().match(param).group({
_id: "$" + event.field _id: "$" + event.field
}).end(); }).end();
res = await db.collection('dictionary').field({ res = await db.collection('dictionary').field({
"_id": true, "_id": true,
"name": true "name": true
......
'use strict';
exports.main = async (event, context) => {
//event为客户端上传的参数
const db = uniCloud.database()
let res = await db.collection("standardV2").field({"classify_id": true, "system_id": true, "brand_id": true}).get();
let data = {}
let id = []
res.data.map(item => {
id.push(item.classify_id)
id.push(item.system_id)
id.push(item.brand_id)
if (data[item.classify_id]) {
if (data[item.classify_id][item.system_id]) {
if (data[item.classify_id][item.system_id].indexOf(item.brand_id) < 0)
data[item.classify_id][item.system_id].push(item.brand_id)
} else {
data[item.classify_id][item.system_id] = [item.brand_id]
}
} else {
let obj = {}
obj[item.system_id] = [item.brand_id]
data[item.classify_id] = obj
}
})
let dic = await db.collection("dictionary").where({
_id: db.command.in(id)
}).get()
let dic_data = {}
dic.data.map(item => {
dic_data[item._id] = item.name
})
let result = []
for (let first in data) {
let secondArr = []
for (let second in data[first]) {
let thirdArr = []
data[first][second].map(third => {
thirdArr.push({id: third, name: dic_data[third]})
})
secondArr.push({id: second, name: dic_data[second], child: thirdArr})
}
result.push({id: first, name: dic_data[first], child: secondArr})
}
return result;
};
...@@ -77,7 +77,8 @@ ...@@ -77,7 +77,8 @@
"classify_id": "79550af260555cc20afb34146966a2c4", "classify_id": "79550af260555cc20afb34146966a2c4",
"system_id": "79550af260555cc20afb34156c94b32c", "system_id": "79550af260555cc20afb34156c94b32c",
"brand_id": "79550af260555cc20afb3417731a827c", "brand_id": "79550af260555cc20afb3417731a827c",
"describe": "已经报装新能源专用电表,不用签此放弃声明,且不用上传", "main_point": ["图片清晰","图片正对"],
"note":"已经报装新能源专用电表,不用签此放弃声明,且不用上传",
"image_count": "1", "image_count": "1",
"images": "https://cloud-bak.banshouhui.com/FkxetdqtVgCN_Xz53w6KqQsEC3K-", "images": "https://cloud-bak.banshouhui.com/FkxetdqtVgCN_Xz53w6KqQsEC3K-",
"name": "不需要报装声明(不需要报装必填)", "name": "不需要报装声明(不需要报装必填)",
...@@ -88,7 +89,8 @@ ...@@ -88,7 +89,8 @@
"classify_id": "79550af260555cc20afb34146966a2c4", "classify_id": "79550af260555cc20afb34146966a2c4",
"system_id": "79550af260555cc20afb34156c94b32c", "system_id": "79550af260555cc20afb34156c94b32c",
"brand_id": "79550af260555cc20afb341875d0f7ba", "brand_id": "79550af260555cc20afb341875d0f7ba",
"describe": "已经报装新能源专用电表,不用签此放弃声明,且不用上传", "main_point": [],
"note":"已经报装新能源专用电表,不用签此放弃声明,且不用上传",
"image_count": "1", "image_count": "1",
"images": "https://cloud-bak.banshouhui.com/FkxetdqtVgCN_Xz53w6KqQsEC3K-", "images": "https://cloud-bak.banshouhui.com/FkxetdqtVgCN_Xz53w6KqQsEC3K-",
"name": "不需要报装声明(不需要报装必填)", "name": "不需要报装声明(不需要报装必填)",
...@@ -133,7 +135,11 @@ ...@@ -133,7 +135,11 @@
"bsonType": "string", "bsonType": "string",
"description": "名称" "description": "名称"
}, },
"describe": { "main_point":{
"bsonType": "array",
"description": "描述、要求"
},
"note": {
"bsonType": "string", "bsonType": "string",
"description": "描述、要求" "description": "描述、要求"
}, },
......
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