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 @@
.picker {
position: fixed;
z-index: $z-index;
background: rgba(255, 255, 255, 0);
background: rgba(0, 0, 0, 0.1);
left: 0;
top: 0;
width: 100%;
......
......@@ -7,21 +7,30 @@
"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
{
"path": "pages/index/index",
"path": "pages/photo/product",
"style": {
"navigationBarTitleText": "下单"
"navigationBarTitleText": "选择产品"
}
},
{
"path": "pages/photo/try",
"style": {
"navigationBarTitleText": "拍照"
}
},
{
"path": "pages/photo/product",
"path": "pages/index/index",
"style": {
"navigationBarTitleText": "选择产品"
"navigationBarTitleText": "下单"
}
},
{
"path": "pages/photo/detail",
"style": {
......@@ -52,12 +61,7 @@
},
{
"path": "pages/photo/try",
"style": {
"navigationBarTitleText": "拍照"
}
},
......
......@@ -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_notice = getApp().globalData.icon_index_notice
this.icon_agree_yes = getApp().globalData.icon_agree_yes
......@@ -225,7 +231,16 @@
doNothing:function(){},
toWhere: function(e){
if(e.toWhere == 'detail' && e.orderId){
uni.navigateTo({
url: '/pages/take/detail'
+'?orderId='+e.orderId,
})
}
},
nameInput(e){
this.name = e.detail.value
......
......@@ -14,25 +14,37 @@
export default {
data() {
return {
code:'',
brandList:[]
}
},
onLoad(e) {
if(e && e.code){
this.code = e.code
}
this.getBrandList()
},
methods: {
getBrandList: function () {
this.brandList = [
{
'title':'广汽',
'id':0
},
{
'title':'比亚迪',
'id':1
this.$u.cloudApi.getBrand({product_code:this.code}).then(res =>{
console.log(res,"品牌")
}
]
)
// this.brandList = [
// {
// 'title':'广汽',
// 'id':0
// },
// {
// 'title':'比亚迪',
// 'id':1
// }
// ]
},
//选择 点击
......
......@@ -3,7 +3,7 @@
<text class="topTitle">选择产品</text>
<view class="">
<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>
......@@ -14,15 +14,42 @@
export default {
data() {
return {
productList:[]
productList:[],
code:'',
}
},
onLoad(e) {
this.getProductList()
},
methods: {
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 = [
{
'title':'新风机',
......@@ -33,12 +60,16 @@
'id':1
}
]
*/
},
//选择 点击
itemClick: function (item) {
if(item.code){
this.code = item.code
}
uni.navigateTo({
url:'/pages/photo/brand'
url:'/pages/photo/brand' + '?code=' + this.code
})
},
......
This diff is collapsed.
......@@ -139,6 +139,28 @@
:show-seconds="true"
@confirm="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>
<u-select v-model="is_SPECIFICATIONS_picker_show" mode="single-column" :list="list" @confirm="confirm"></u-select>
......@@ -170,6 +192,7 @@
orderServiceType:'',
orderInfo:{},
currentIndex:0,
currentItem:null,
TimeID:-1,
//产品规格 相关
......@@ -202,6 +225,18 @@
date: '2020/01/01',
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_measureTypeName:'',
......@@ -221,7 +256,7 @@
},
onLoad(e) {
this.icon_close_new = getApp().globalData.icon_close_new
this.getTopInfo(e)
//this.getConfig()
......@@ -399,7 +434,25 @@
photoArray.forEach(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('之前填写过的 照片数组:')
......@@ -453,7 +506,10 @@
//机器条码 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
......@@ -604,7 +660,7 @@
//产品规格 取消选择
SPECIFICATIONSonCancel(){
console.log('产品规格 取消选择')
//console.log('产品规格 取消选择')
},
//"fieldsOptions":"{\"specificationId\":10006,\"specificationName\":\"变频3P\"}","sort":2}
......@@ -704,14 +760,50 @@
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) {
let that = this
uni.scanCode({
scanType: ['barCode'],
success: function (res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
// console.log('条码类型:' + res.scanType);
// console.log('条码内容:' + res.result);
that.updateInfo(ikey,'MACHINE_CODE',res.result)
}
});
......@@ -870,8 +962,17 @@
//获取照片信息
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)
let that = this
......@@ -904,6 +1005,20 @@
async photoUpload(){
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(this.photo_tempFilePaths.length)
// console.log(this.photo_tempFilePaths)
......@@ -923,7 +1038,6 @@
//新增images参数
for(let i = 0;i < this.photo_tempFilePaths.length; i++) {
uni.uploadFile({
url: getApp().globalData.domain_Name
......@@ -986,6 +1100,7 @@
icon:'none',
title:'照片上传失败'
})
console.log(res)
}
});
}
......@@ -1641,7 +1756,7 @@
.clickRightView{
background-color: #FFFFFF;
width: 40%;
width: 60%;
display: flex;
flex-direction: row-reverse;
align-items: center;
......@@ -1654,11 +1769,16 @@
}
.clickContent{
margin-right: 20rpx;
padding-right: 20rpx;
font-size: 28rpx;
color: #333333;
display: block;
overflow: hidden;
white-space: nowrap;
text-overflow:ellipsis;
}
.inputTypeView{
background-color: #FFFFFF;
width: 100%;
......@@ -1770,9 +1890,59 @@
height: 100%;
display: flex;
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>
......@@ -231,6 +231,16 @@
},
onShareAppMessage(res) {
let shareObj = {
title: '',
path: '/pages/take/index',
success(){},
fail(){}
}
return shareObj
},
methods: {
......@@ -1121,8 +1131,7 @@
}
.shadowBackView{
background-color: rgba(0,0,0,0.5);
position: absolute;
background-color: rgba(0,0,0,0.2);
top: 0;
left: 0;
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