Commit 8d762988 authored by 李超鹏's avatar 李超鹏

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

parents 8c8010f8 84d0ff86
...@@ -584,7 +584,7 @@ ...@@ -584,7 +584,7 @@
.picker { .picker {
position: fixed; position: fixed;
z-index: $z-index; z-index: $z-index;
background: rgba(255, 255, 255, 0); background: rgba(0, 0, 0, 0.1);
left: 0; left: 0;
top: 0; top: 0;
width: 100%; width: 100%;
......
...@@ -7,21 +7,30 @@ ...@@ -7,21 +7,30 @@
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages "pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/index/index", "path": "pages/photo/product",
"style": { "style": {
"navigationBarTitleText": "下单" "navigationBarTitleText": "选择产品"
} }
}, },
{
"path": "pages/photo/try",
"style": {
"navigationBarTitleText": "拍照"
}
},
{ {
"path": "pages/photo/product", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "选择产品" "navigationBarTitleText": "下单"
} }
}, },
{ {
"path": "pages/photo/detail", "path": "pages/photo/detail",
"style": { "style": {
...@@ -52,12 +61,7 @@ ...@@ -52,12 +61,7 @@
}, },
{
"path": "pages/photo/try",
"style": {
"navigationBarTitleText": "拍照"
}
},
......
...@@ -164,7 +164,13 @@ ...@@ -164,7 +164,13 @@
} }
}, },
onLoad() { onLoad(e) {
//+ '?orderId=' + this.orderId + '&toWhere=detail'
if(e && e.toWhere){
this.toWhere(e)
}
this.icon_location = getApp().globalData.icon_location this.icon_location = getApp().globalData.icon_location
this.icon_notice = getApp().globalData.icon_index_notice this.icon_notice = getApp().globalData.icon_index_notice
this.icon_agree_yes = getApp().globalData.icon_agree_yes this.icon_agree_yes = getApp().globalData.icon_agree_yes
...@@ -225,7 +231,16 @@ ...@@ -225,7 +231,16 @@
doNothing:function(){}, doNothing:function(){},
toWhere: function(e){
if(e.toWhere == 'detail' && e.orderId){
uni.navigateTo({
url: '/pages/take/detail'
+'?orderId='+e.orderId,
})
}
},
nameInput(e){ nameInput(e){
this.name = e.detail.value this.name = e.detail.value
......
...@@ -14,25 +14,37 @@ ...@@ -14,25 +14,37 @@
export default { export default {
data() { data() {
return { return {
code:'',
brandList:[] brandList:[]
} }
}, },
onLoad(e) { onLoad(e) {
if(e && e.code){
this.code = e.code
}
this.getBrandList() this.getBrandList()
}, },
methods: { methods: {
getBrandList: function () { getBrandList: function () {
this.brandList = [
{ this.$u.cloudApi.getBrand({product_code:this.code}).then(res =>{
'title':'广汽', console.log(res,"品牌")
'id':0
},
{
'title':'比亚迪',
'id':1
} }
] )
// this.brandList = [
// {
// 'title':'广汽',
// 'id':0
// },
// {
// 'title':'比亚迪',
// 'id':1
// }
// ]
}, },
//选择 点击 //选择 点击
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<text class="topTitle">选择产品</text> <text class="topTitle">选择产品</text>
<view class=""> <view class="">
<view class="itemView u-m-t-80" v-for="(item,ikey) in productList":key="ikey"> <view class="itemView u-m-t-80" v-for="(item,ikey) in productList":key="ikey">
<text class="itemTitle" @click="itemClick(item)">{{item.title}}</text> <text class="itemTitle" @click="itemClick(item)">{{item.name}}</text>
</view> </view>
</view> </view>
...@@ -14,15 +14,42 @@ ...@@ -14,15 +14,42 @@
export default { export default {
data() { data() {
return { return {
productList:[] productList:[],
code:'',
} }
}, },
onLoad(e) { onLoad(e) {
this.getProductList() this.getProductList()
}, },
methods: { methods: {
getProductList: function(){ getProductList: function(){
let that = this
this.$u.cloudApi.getAllProduct().then(res =>{
console.log('获取产品数据:')
console.log(res)
if(res.result.data){
that.productList = res.result.data
}
})
/*
const db = uniCloud.database({
spaceId: 'tcb-nikbzhlwnpd5n913e1c5e-50f4bbo'
})
const collection = db.collection("config").where({type: "brand"}).get()
console.log('collection:')
console.log(collection)
this.productList = [ this.productList = [
{ {
'title':'新风机', 'title':'新风机',
...@@ -33,12 +60,16 @@ ...@@ -33,12 +60,16 @@
'id':1 'id':1
} }
] ]
*/
}, },
//选择 点击 //选择 点击
itemClick: function (item) { itemClick: function (item) {
if(item.code){
this.code = item.code
}
uni.navigateTo({ uni.navigateTo({
url:'/pages/photo/brand' url:'/pages/photo/brand' + '?code=' + this.code
}) })
}, },
......
This diff is collapsed.
...@@ -139,6 +139,28 @@ ...@@ -139,6 +139,28 @@
:show-seconds="true" :show-seconds="true"
@confirm="onSelected" @confirm="onSelected"
@cancel="onSelected" /> @cancel="onSelected" />
<w-picker
:visible.sync="is_MACHINE_CODE_picker_show"
mode="selector"
value=""
default-type="label"
:default-props="MACHINE_CODE_defaultProps"
:options="MACHINE_CODE_list"
@confirm="MACHINE_CODEonConfirm($event,'selector')"
@cancel="MACHINE_CODEonCancel"
ref="selector"
></w-picker>
<view class="shadowBackView" v-if="isInputShow">
<view class="inputCenterView">
<view class="closeView">
<image class="closeIcon" @click="popCloseClick()" :src="icon_close_new" mode=""></image>
</view>
<textarea class="inputView" v-model="inputContent" value="" placeholder="请输入机身条码" placeholder-style='color:#CCCCCC;font-size:28rpx;'/>
<view class="inputConfirmView" @click="inputConfirmClick">
<text class="inputConfirmText">确 认</text>
</view>
</view>
</view>
<!--template> <!--template>
<u-select v-model="is_SPECIFICATIONS_picker_show" mode="single-column" :list="list" @confirm="confirm"></u-select> <u-select v-model="is_SPECIFICATIONS_picker_show" mode="single-column" :list="list" @confirm="confirm"></u-select>
...@@ -170,6 +192,7 @@ ...@@ -170,6 +192,7 @@
orderServiceType:'', orderServiceType:'',
orderInfo:{}, orderInfo:{},
currentIndex:0, currentIndex:0,
currentItem:null,
TimeID:-1, TimeID:-1,
//产品规格 相关 //产品规格 相关
...@@ -202,6 +225,18 @@ ...@@ -202,6 +225,18 @@
date: '2020/01/01', date: '2020/01/01',
value: '', value: '',
//机身扫码相关
is_MACHINE_CODE_picker_show:false,
MACHINE_CODE_defaultProps:{
label:"name",
value:"id"
},
MACHINE_CODE_list:[{'name':'相机扫码','id':0},{'name':'手动输入','id':1}],
isInputShow:false,
icon_close_new:'',
inputContent:'',
//处理措施 相关 //处理措施 相关
measure_showContent:'', measure_showContent:'',
measure_measureTypeName:'', measure_measureTypeName:'',
...@@ -221,7 +256,7 @@ ...@@ -221,7 +256,7 @@
}, },
onLoad(e) { onLoad(e) {
this.icon_close_new = getApp().globalData.icon_close_new
this.getTopInfo(e) this.getTopInfo(e)
//this.getConfig() //this.getConfig()
...@@ -399,7 +434,25 @@ ...@@ -399,7 +434,25 @@
photoArray.forEach(item => { photoArray.forEach(item => {
var imageURL = getApp().globalData.domain_Name + '/wxh-sts-rest' + item var imageURL = getApp().globalData.domain_Name + '/wxh-sts-rest' + item
this.photoList.push(imageURL) console.log('原有的图片路径拼接:' + imageURL)
uni.getImageInfo({
src: imageURL, //服务器返回的图片地址
success: res => {
this.photoList.push(res.path)
this.photo_tempFilePaths.push(res.path)
console.log('原有图片:')
console.log('photoList数组个数:'+this.photoList.length)
console.log('photo_tempFilePaths数组个数:'+this.photo_tempFilePaths.length)
},
fail: function(res) {
uni.showToast({
icon:'none',
title:'URL图片格式不正确'
})
}
})
//this.photoList.push(imageURL)
}) })
// console.log('之前填写过的 照片数组:') // console.log('之前填写过的 照片数组:')
...@@ -453,7 +506,10 @@ ...@@ -453,7 +506,10 @@
//机器条码 MACHINE_CODE //机器条码 MACHINE_CODE
if(item.fieldsType == 'MACHINE_CODE'){ if(item.fieldsType == 'MACHINE_CODE'){
this.scanCode(item,ikey) this.currentIndex = ikey
this.currentItem = item
this.is_MACHINE_CODE_picker_show = true
//this.scanCode(item,ikey)
} }
//日期 DATE //日期 DATE
...@@ -604,7 +660,7 @@ ...@@ -604,7 +660,7 @@
//产品规格 取消选择 //产品规格 取消选择
SPECIFICATIONSonCancel(){ SPECIFICATIONSonCancel(){
console.log('产品规格 取消选择') //console.log('产品规格 取消选择')
}, },
//"fieldsOptions":"{\"specificationId\":10006,\"specificationName\":\"变频3P\"}","sort":2} //"fieldsOptions":"{\"specificationId\":10006,\"specificationName\":\"变频3P\"}","sort":2}
...@@ -704,14 +760,50 @@ ...@@ -704,14 +760,50 @@
console.log('产品型号 取消选择') console.log('产品型号 取消选择')
}, },
//机身条码 确认选择
MACHINE_CODEonConfirm(res,type){
this.result=res;
// console.log('机身条码 确认选择')
// console.log(res.result)
// console.log(res.value)
if(res.result == '相机扫码'){
this.scanCode(this.currentItem,this.currentIndex)
}
if(res.result == '手动输入'){
this.isInputShow = true
}
},
//机身条码 取消选择
MACHINE_CODEonCancel(){
//console.log('机身条码 取消选择')
},
popCloseClick: function(){
this.isInputShow = false
},
inputConfirmClick: function(){
// console.log('手动输入 确定')
// console.log('手动输入 条码:' + this.inputContent)
this.isInputShow = false
this.updateInfo(this.currentIndex,'MACHINE_CODE',this.inputContent)
},
//机身条码 //机身条码
scanCode: function (item,ikey) { scanCode: function (item,ikey) {
let that = this let that = this
uni.scanCode({ uni.scanCode({
scanType: ['barCode'], scanType: ['barCode'],
success: function (res) { success: function (res) {
console.log('条码类型:' + res.scanType); // console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result); // console.log('条码内容:' + res.result);
that.updateInfo(ikey,'MACHINE_CODE',res.result) that.updateInfo(ikey,'MACHINE_CODE',res.result)
} }
}); });
...@@ -870,8 +962,17 @@ ...@@ -870,8 +962,17 @@
//获取照片信息 //获取照片信息
getImageInfo: function(res) { getImageInfo: function(res) {
console.log('获取照片信息')
console.log('photo_tempFilePaths数组个数:'+this.photo_tempFilePaths.length)
if(this.photo_tempFilePaths && this.photo_tempFilePaths.length>0){
res.tempFilePaths.forEach(item => {
this.photo_tempFilePaths.push(item)
})
}else{
this.photo_tempFilePaths = res.tempFilePaths
}
this.photo_tempFilePaths = res.tempFilePaths
//this.photo_tempFilePaths.push(res.tempFilePaths) //this.photo_tempFilePaths.push(res.tempFilePaths)
let that = this let that = this
...@@ -904,6 +1005,20 @@ ...@@ -904,6 +1005,20 @@
async photoUpload(){ async photoUpload(){
let that = this let that = this
console.log('照片上传')
console.log('photo_tempFilePaths数组个数:'+this.photo_tempFilePaths.length)
this.photo_tempFilePaths.forEach(item => {
console.log('每张照片的路径:')
console.log(item)
})
//return
// console.log('照片上传 数量 :') // console.log('照片上传 数量 :')
// console.log(this.photo_tempFilePaths.length) // console.log(this.photo_tempFilePaths.length)
// console.log(this.photo_tempFilePaths) // console.log(this.photo_tempFilePaths)
...@@ -923,7 +1038,6 @@ ...@@ -923,7 +1038,6 @@
//新增images参数 //新增images参数
for(let i = 0;i < this.photo_tempFilePaths.length; i++) { for(let i = 0;i < this.photo_tempFilePaths.length; i++) {
uni.uploadFile({ uni.uploadFile({
url: getApp().globalData.domain_Name url: getApp().globalData.domain_Name
...@@ -986,6 +1100,7 @@ ...@@ -986,6 +1100,7 @@
icon:'none', icon:'none',
title:'照片上传失败' title:'照片上传失败'
}) })
console.log(res)
} }
}); });
} }
...@@ -1641,7 +1756,7 @@ ...@@ -1641,7 +1756,7 @@
.clickRightView{ .clickRightView{
background-color: #FFFFFF; background-color: #FFFFFF;
width: 40%; width: 60%;
display: flex; display: flex;
flex-direction: row-reverse; flex-direction: row-reverse;
align-items: center; align-items: center;
...@@ -1654,11 +1769,16 @@ ...@@ -1654,11 +1769,16 @@
} }
.clickContent{ .clickContent{
margin-right: 20rpx; padding-right: 20rpx;
font-size: 28rpx; font-size: 28rpx;
color: #333333; color: #333333;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow:ellipsis;
} }
.inputTypeView{ .inputTypeView{
background-color: #FFFFFF; background-color: #FFFFFF;
width: 100%; width: 100%;
...@@ -1770,9 +1890,59 @@ ...@@ -1770,9 +1890,59 @@
height: 100%; height: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center;
} }
.inputCenterView{
background-color: #FFFFFF;
width: 600rpx;
height: 600rpx;
margin-top: 300rpx;
border-radius: 10rpx;
}
.closeView{
background-color: #FFFFFF;
width: 100%;
height: 80rpx;
display: flex;
flex-direction: row-reverse;
align-items: center;
}
.closeIcon{
background-color: #FFFFFF;
margin-right: 14rpx;
width: 30rpx;
height: 30rpx;
}
.inputView{
background-color: #FFFFFF;
margin-top: 30rpx;
margin-left: 30rpx;
width: 540rpx;
height: 300rpx;
border: 2rpx solid #CCCCCC;
}
.inputConfirmView{
background-color: #2272FF;
margin-top: 40rpx;
margin-left: 80rpx;
width: 440rpx;
height: 80rpx;
display: flex;
align-items: center;
justify-content: center;
}
.inputConfirmText{
color: #FFFFFF;
font-size: 32rpx;
font-weight: bold;
}
</style> </style>
...@@ -231,6 +231,16 @@ ...@@ -231,6 +231,16 @@
}, },
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/take/index',
success(){},
fail(){}
}
return shareObj
},
methods: { methods: {
...@@ -1121,8 +1131,7 @@ ...@@ -1121,8 +1131,7 @@
} }
.shadowBackView{ .shadowBackView{
background-color: rgba(0,0,0,0.5); background-color: rgba(0,0,0,0.2);
position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
......
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