Commit 5d20b40f authored by 李超鹏's avatar 李超鹏

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

parents 6b1ced5d d12246c4
.DS_Store .DS_Store
node_modules/ node_modules/
dist/ dist/
.hbuilderx/
npm-debug.log* npm-debug.log*
yarn-debug.log* yarn-debug.log*
yarn-error.log* yarn-error.log*
......
{ // launch.json 配置了启动调试时相关设置,configurations下节点名称可为 app-plus/h5/mp-weixin/mp-baidu/mp-alipay/mp-qq/mp-toutiao/mp-360/
// launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
"version": "0.0",
"configurations": [{
"type": "uniCloud",
"default": {
"launchtype": "remote"
}
}
]
}
...@@ -100,7 +100,18 @@ ...@@ -100,7 +100,18 @@
settleRecommend:'', settleRecommend:'',
navHeight:0, //导航栏高度 navHeight:0, //导航栏高度
rpxScreenHeight:0,// 照相视框高度 rpxScreenHeight:0,// 照相视框高度
//拍照相关数据
photo:{
product:{
brandId:'', // 品牌id
brandName:'', // 品牌名称
classifyId:'', // 分类id
systemId:'', // 系统id
},
productList:[],
currentItem:null, // 选择的某一项
}
}, },
onLaunch: function() { onLaunch: function() {
...@@ -134,6 +145,7 @@ ...@@ -134,6 +145,7 @@
// this.globalData.screenHeight = a.screenHeight; // this.globalData.screenHeight = a.screenHeight;
this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90 this.globalData.navHeight = a.statusBarHeight / a.screenWidth * 750 + 90
this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750 this.globalData.rpxScreenHeight = a.screenHeight / a.screenWidth * 750
this.globalData.screenHeight = a.screenHeight
} catch (a) {} } catch (a) {}
}, },
//检查更新 //检查更新
......
<template>
<view class="standard-box" v-if="currentItem">
<swiper class="swiper-box" :current="swiperCurrent" @transition="transition" @animationfinish="animationfinish">
<swiper-item class="swiper-item" key="swiper1">
<view class="title">
拍照要求
</view>
<view class="txt-box" >
<view class="txt" v-for="(txt,index) in currentItem.main_point" :key="index">
{{index+1}}. {{txt}}
</view>
<view class="txt tips">
注意:{{currentItem.note}}
</view>
</view>
</swiper-item>
<swiper-item class="swiper-item" v-for="(src, index) in swiperList" :key="index">
<cover-image @click="previewImage(index)" class="icon" mode="aspectFit" :src="src"></cover-image>
</swiper-item>
</swiper>
<view class="tab-box">
<u-tabs-swiper bg-color="transparent" inactive-color="#999"
ref="uTabs" :list="tabList" :current="current"
@change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
</view>
</view>
</template>
<script>
export default {
name:"photo-standard",
props:{
currentItem:{
type: Object,
default () {
return {
images: [],
}
}
},
},
data() {
return {
tabList: [{
name: '十年'
}, {
name: '青春'
}, {
name: '之约'
}],
swiperList:[{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就111111111111',
},{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就222222',
},{
title:'记录的距离大家零点九零杰拉德杰拉德建立的连接就333333',
},],
// 因为内部的滑动机制限制,请将tabs组件和swiper组件的current用不同变量赋值
current: 0, // tabs组件的current值,表示当前活动的tab选项
swiperCurrent: 0, // swiper组件的current值,表示当前那个swiper-item是活动的
height:0,
}
},
watch:{
"currentItem.images"(val){
if(val.length>0){
this.changeList(val)
// let swiperList = JSON.parse(JSON.stringify(val))
// let len = tabs.length
// let tabList = [{name:'拍照要求'}].concat(Array.from({name:'示意图'},len))
// console.log(tabList,'tabList')
}
},
},
created() {
// getApp().trackPage('照片预览页')
// console.log(e, 'e')
// if (e.img) {
// this.images = [e.img]
// }
// console.log(this.images, 'this.images')
},
mounted(){
this.changeList(this.currentItem.images)
this.getSwiperHeight()
},
methods: {
changeList(list){
let swiperList = JSON.parse(JSON.stringify(list))
let len = list.length
let 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(){
const globalData = getApp().globalData
this.height = globalData.screenHeight*2 - globalData.navHeight - 200
},
previewImage(index){
uni.previewImage({
current:index,
urls:this.swiperList,
})
},
// tabs通知swiper切换
tabsChange(index) {
this.swiperCurrent = index;
},
// swiper-item左右移动,通知tabs的滑块跟随移动
transition(e) {
// console.log(e.detail,'e.detail-transition')
let dx = e.detail.dx;
this.$refs.uTabs.setDx(dx);
},
// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
// swiper滑动结束,分别设置tabs和swiper的状态
animationfinish(e) {
// console.log(e.detail,'e.detail-animationfinish')
let current = e.detail.current;
this.$refs.uTabs.setFinishCurrent(current);
this.swiperCurrent = current;
this.current = current;
},
// scroll-view到底部加载更多
onreachBottom() {
}
}
}
</script>
<style lang="scss">
.standard-box{
position: absolute;
left:0;right:0;
/* height: calc(100vh - 240rpx); */
z-index: 100;
bottom:240rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.swiper-box{
width: 690rpx;
min-height: 690rpx;
margin-bottom: 150rpx;
border-radius: 12rpx;
background-color: #fff;
}
.tab-box{
position: absolute;
bottom:0;
left:30rpx;
right:30rpx;
}
.swiper-item{
box-sizing: border-box;
// width:690rpx;
padding:30rpx;
.title{
margin-top:20rpx;
font-weight: bold;
line-height: 50rpx;
color:#333;
font-size: 36rpx;
}
.txt-box{
max-height: 560rpx;
overflow: auto;
}
.txt{
white-space: normal;
padding-top:26rpx;
line-height: 34rpx;
color:#666;
font-size: 28rpx;
&.tips{
padding-bottom:26rpx;
color:#D73400
}
}
}
/* .pic {
display: block;
width: 100%;
height: auto;
}
.scroll-view_H {
white-space: nowrap;
width: 750rpx;
height: 300rpx;
}
.view-content {
display: flex;
} */
</style>
...@@ -67,7 +67,9 @@ ...@@ -67,7 +67,9 @@
"mp-weixin" : { "mp-weixin" : {
"appid" : "wxd1d6eede324b0465", "appid" : "wxd1d6eede324b0465",
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false,
"es6" : true,
"minified" : true
}, },
"usingComponents" : true, "usingComponents" : true,
"permission" : { "permission" : {
......
...@@ -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": {
...@@ -139,7 +141,6 @@ ...@@ -139,7 +141,6 @@
"disableScroll": true "disableScroll": true
} }
}, },
{ {
"path": "pages/photo/detail", "path": "pages/photo/detail",
"style": { "style": {
...@@ -160,7 +161,9 @@ ...@@ -160,7 +161,9 @@
{ {
"path": "pages/photo/list", "path": "pages/photo/list",
"style": { "style": {
"navigationBarTitleText": "规范展示" "navigationBarTitleText": "规范展示",
"navigationBarBackgroundColor":"#FFFFFF",
"backgroundColor":"#F4F5F7"
} }
}, },
...@@ -275,8 +278,8 @@ ...@@ -275,8 +278,8 @@
"path": "pages/settle/index", //启动页面,必选 "path": "pages/settle/index", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
},{ },{
"name": "拍照小工具", //模式名称 "name": "拍照-规范", //模式名称
"path": "pages/photo/take", //启动页面,必选 "path": "pages/photo/product", //启动页面,必选
"query": "" //启动参数,在页面的onLoad函数里面得到 "query": "" //启动参数,在页面的onLoad函数里面得到
},{ },{
"name": "基本信息", //模式名称 "name": "基本信息", //模式名称
......
...@@ -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){
......
This diff is collapsed.
<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 v-for="(item,ikey) in dataItem.data"
</view> :class="param[dataItem.type] === item._id ? 'select-item-view' : 'item-view'"
@click="itemClick(dataItem.type, item)" :key="item._id">
</view> <text class="itemTitle">{{item.name}}</text>
</template> </view>
</view>
<script> </template>
export default { </view>
data() { <button class="ph-pr-button" type="primary" @click="handleClick"
return { :style="selectedAll ? 'background-color: #2272FF;' : 'background-color: #D1D4D4;'">下一步</button>
productList:[], </view>
product_code:'', </template>
product:'',
} <script>
}, export default {
onLoad(e) { data() {
getApp().trackPage('选择产品页') return {
this.getProductList() classifyList: [],
systemList: [],
}, brandList: [],
param: {
onShareAppMessage(res) { classifyId: '',
let shareObj = { systemId: '',
title: '', brandId: '',
path: '/pages/photo/product', },
imageUrl: '', brandName: '',
success(){}, selectedAll: false,
fail(){} }
} },
return shareObj computed: {
}, list() {
methods: { return [{
title: '请选择类别',
getProductList: function(){ type: 'classifyId',
data: this.classifyList
let that = this },
{
this.$u.cloudApi.getAllProduct().then(res =>{ title: '请选择系统',
console.log('获取产品数据:') type: 'systemId',
console.log(res) data: this.systemList
if(res.result && res.result.data){ },
that.productList = res.result.data {
} title: '请选择品牌',
type: 'brandId',
}) data: this.brandList
}
]
}, }
},
//选择 点击 onLoad(e) {
itemClick: function (item) { getApp().trackPage('选择产品页')
this.getclassifyList()
if(item.code){ },
this.product_code = item.code onShareAppMessage(res) {
} let shareObj = {
title: '',
if(item.name){ path: '/pages/photo/product',
this.product = item.name imageUrl: '',
} success() {},
fail() {}
uni.navigateTo({ }
url:'/pages/photo/brand' return shareObj
+ '?product_code=' + this.product_code },
+ '&product=' + this.product, methods: {
})
}, getclassifyList: function() {
let that = this
} this.$u.cloudApi.getClassifyDictionary().then(res => {
} console.log('获取产品数据:')
</script> console.log(res)
if (res.result && res.result.data) {
<style> that.classifyList = res.result.data
that.param.classifyId = that.classifyList[0]._id
.backView{ that.$u.cloudApi.getRelationDictionary({
background-color: #FAFAFA; "classify_id": that.param.classifyId,
position: absolute; "field": "system_id"
top: 0; }).then(res1 => {
left: 0; that.systemList = res1.result
width: 100%; })
display: flex; }
flex-direction: column;
align-items: center; })
} },
.topTitle{ //选择 点击
margin-top: 192rpx; itemClick: function(type, item) {
font-size: 32rpx;
switch (type) {
} case 'classifyId':
this.param = {
.itemView{ classifyId: item._id,
background-color: #FFFFFF; systemId: '',
width: 548rpx; brandId: ''
height: 96rpx; }
display: flex; this.selectedAll = false
align-items: center; this.systemList = []
justify-content: center; this.brandList = []
border-style: solid; this.$u.cloudApi.getRelationDictionary({
box-shadow:0px 2px 7px 0px rgba(0, 0, 0, 0.05); "classify_id": this.param.classifyId,
border-width: 0rpx; "field": "system_id"
} }).then(res => {
this.systemList = res.result
.itemTitle{ })
font-size: 32rpx; break
font-weight:bold; case 'systemId':
} this.param = {
classifyId: this.param.classifyId,
systemId: item._id,
brandId: ''
}
this.selectedAll = false
this.brandList = []
this.$u.cloudApi.getRelationDictionary({
"classify_id": this.param.classifyId,
"system_id": this.param.systemId,
"field": "brand_id"
}).then(res => {
console.log('获取品牌数据:', res)
this.brandList = res.result
})
break
case 'brandId':
this.param.brandId = item._id
this.selectedAll = true
this.brandName = item.name
break
default:
break
}
},
// 点击下一步
handleClick() {
// 点击下一步设置全局拍照品牌品类
const globalData = getApp().globalData
let keys = ['brandId','brandName','classifyId','systemId']
keys.map(key=>{
globalData.photo.product[key] = this[key] || this.param[key]
})
uni.navigateTo({
url: '/pages/photo/list' +
'?brandId=' + this.param.brandId +
'&brand=' + this.brandName +
'&classifyId=' + this.param.systemId +
'&systemId=' + this.param.systemId,
})
}
}
}
</script>
<style>
.backView {
background-color: #FAFAFA;
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100%;
}
.topTitle {
margin-top: 50rpx;
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;
}
.ph-pr-arr {
width: 100%;
}
.item-view {
background-color: #FFFFFF;
/* width: 548rpx; */
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: #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>
This diff is collapsed.
take-order/static/photo/icon-light.png

1.67 KB | W: | H:

take-order/static/photo/icon-light.png

1.58 KB | W: | H:

take-order/static/photo/icon-light.png
take-order/static/photo/icon-light.png
take-order/static/photo/icon-light.png
take-order/static/photo/icon-light.png
  • 2-up
  • Swipe
  • Onion skin
take-order/static/photo/icon-switch.png

1.77 KB | W: | H:

take-order/static/photo/icon-switch.png

1.46 KB | W: | H:

take-order/static/photo/icon-switch.png
take-order/static/photo/icon-switch.png
take-order/static/photo/icon-switch.png
take-order/static/photo/icon-switch.png
  • 2-up
  • Swipe
  • Onion skin
take-order/static/photo/icon-take.png

8.88 KB | W: | H:

take-order/static/photo/icon-take.png

6.18 KB | W: | H:

take-order/static/photo/icon-take.png
take-order/static/photo/icon-take.png
take-order/static/photo/icon-take.png
take-order/static/photo/icon-take.png
  • 2-up
  • Swipe
  • Onion skin
{
"name": "saveImage",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"user-common": {
"version": "file:../common/user-common"
}
}
}
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay" <swiper :current="elCurrent" @change="change" @animationfinish="animationfinish" :interval="interval" :circular="circular" :duration="duration" :autoplay="autoplay"
:previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :previous-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'" :next-margin="effect3d ? effect3dPreviousMargin + 'rpx' : '0'"
:style="{ :style="{
height: height + 'rpx' height: heightString
}"> }">
<swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index"> <swiper-item class="u-swiper-item" v-for="(item, index) in list" :key="index">
<view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{ <view class="u-list-image-wrap" @tap.stop.prevent="listClick(index)" :class="[uCurrent != index ? 'u-list-scale' : '']" :style="{
...@@ -207,6 +207,9 @@ ...@@ -207,6 +207,9 @@
// 因为uni的swiper组件的current参数只接受Number类型,这里做一个转换 // 因为uni的swiper组件的current参数只接受Number类型,这里做一个转换
elCurrent() { elCurrent() {
return Number(this.current); return Number(this.current);
},
heightString() {
return typeof this.height === 'number' && this.height !== 0 ? (this.height + 'rpx') : this.height
} }
}, },
methods: { methods: {
......
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