Commit 79c94119 authored by Morson's avatar Morson

Merge branch 'master' of https://git.banshouhui.com/lijundan/self-support

# Conflicts:
#	src/pages.json
parents 2287d568 85492f30
......@@ -116,7 +116,7 @@
},
confirm() {
if(this.pass) {
this.$emit('confirm')
this.$emit('change')
} else {
let data = this.listData.find((item, index) => {
return item.pass == false;
......
<!-- ******************* 单个下拉选择 ******************* -->
<template>
<view class="xh-select">
<view class="xh-select" :style="{'width': fieldsWidth}">
<u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"></u-input>
<u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select>
......@@ -68,7 +68,10 @@
'font-size':'26rpx',
'height': '76rpx'
}
}
},
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
},
},
watch: {},
mounted() {},
......
<!-- ******************* 单级/多级 选择 ******************* -->
<template>
<view class="picker-box">
<view class="picker-box" :style="{'width': fieldsWidth}">
<view class="u-flex u-row-between text-view" @click="openPicker">
<view class="txt u-flex-1 text-title">{{text||''}}</view>
<u-icon class="input-icon" color="#2272FF" :name="showPicker ? 'arrow-up' : 'arrow-down'"></u-icon>
......@@ -68,7 +68,10 @@
val = data[0].measureTypeName + "-" + data[0].measureName
}
return val
}
},
fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%'
},
},
watch: {
specificationId(val, oldVal){
......
......@@ -99,7 +99,16 @@
return {
timeout: false,
timestamp: 0,
orderType: 0
/** orderType
0 待接单、
1 待预约、
2 待签到、
3 待完工、
4 审核中、
5 异常单、
6 已完工
*/
orderType: 0
};
},
computed: {
......@@ -124,7 +133,7 @@
return this.buttonStyles[2]
}
},
showCountTime() {
showCountTime() { // ((待预约、 待签到、 待完工) || (待接单 && 业务类型非抢单)) && 有超过时间点
return ([1, 2, 3].indexOf(this.orderType) != -1 || (this.orderType == 0 && this.orderData
.orderBusinessType != 'R')) && this.orderData.currentOverTime
},
......
......@@ -58,7 +58,7 @@ export default {
imgList[res.fileIndex]
self.imgList = imgList
// 多文件上传每个文件进度条
console.log(res,'res---onProgressUpdate')
//console.log(res,'res---onProgressUpdate')
},
onEachUpdate(res){
// 多文件上传每个文件上传成功触发
......@@ -67,7 +67,7 @@ export default {
imgList[res.fileIndex].src = uploader.qiniuTokenObj.visitPrefix + res.url
}
self.imgList = imgList
console.log(res,'res---onEachUpdate')
//console.log(res,'res---onEachUpdate')
},
cardType: category,
...config
......@@ -75,8 +75,8 @@ export default {
// 不需要进度条等可直接获取
let res = await uploader.qnImgUpload(options)
console.log(self.imgList,'self.imgList')
console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
// console.log(self.imgList,'self.imgList')
// console.log(uploader,uploader.qiniuTokenObj,'qiniuTokenObj')
// let imgList = res.map(item=>{
// return {
// key:item,
......
......@@ -91,11 +91,11 @@ export default {
}
qiniuUploader.upload(params, (res) => {
console.log(res,'res')
console.log(res,'res111')
let inLen = self.maximum - fileList.length
if (inLen > 0) {
item.src = file
item.key = res.key || res.src
item.key = res.url
self.fileMaps.push(item);
self.keys.push(item.key)
if(submit) {
......
......@@ -172,6 +172,16 @@
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#F4F5F7"
}
},
{
"path" : "material",
"style" :
{
"navigationBarTitleText": "勘察材料",
"enablePullDownRefresh": false,
"navigationBarBackgroundColor":"#FFFFFF"
}
}
]
},
......
......@@ -397,66 +397,63 @@
nextStep() {
if (this.tabIndex < this.list.length - 1) {
this.tabIndex++
this.arr = []
this.scrollRightTop = 0
this.leftMenuStatus(0)
this.arr = []
this.$nextTick(function() {
this.getMenuItemTop()
})
}
},
typeToComponentType(type) {
let formType = ''
if (type) {
// 将fieldType类型统一转换为公共组件判定类型
type = type.toLocaleLowerCase()
switch (type) {
case 'text':
case 'password':
case 'textarea':
case 'number':
case 'decimal':
case 'double':
case 'integer':
formType = 'input'
break
case 'multiinput':
formType = 'multiinput'
break;
case 'select':
case 'specifications':
formType = 'select'
break
case 'radio':
formType = 'radio'
break
case 'checkbox':
formType = 'checkbox'
break
case 'file':
case 'photos':
formType = 'file'
break
case 'location':
formType = 'location'
break
case 'scan':
formType = 'scan'
break
case 'picker':
case 'mutipicker':
formType = 'picker'
break
case 'service_measures':
formType = 'servicemeasure'
break
case 'time':
case 'date':
formType = 'time'
break
}
}
typeToComponentType(type) {
// 将fieldType类型统一转换为公共组件判定类型
let formType = ''
type = type.toLocaleLowerCase()
switch (type) {
case 'text':
formType = 'input'
break
case 'password':
case 'textarea':
case 'number':
case 'decimal':
case 'double':
case 'integer':
formType = 'input'
break
case 'multiinput':
formType = 'multiinput'
break;
case 'select':
case 'specifications':
formType = 'select'
break
case 'radio':
formType = 'radio'
break
case 'checkbox':
formType = 'checkbox'
break
case 'file':
case 'photos':
formType = 'file'
break
case 'location':
formType = 'location'
break
case 'scan':
formType = 'scan'
break
case 'picker':
case 'mutipicker':
formType = 'picker'
break
case 'service_measures':
formType = 'servicemeasure'
break
case 'time':
case 'date':
formType = 'time'
break
}
return formType
},
// ------------------------- 以下方法为展示滚动切换 -------------------------
......
<template>
<view class="mtr-content">
<view class="content-view">
<!-- 材料列表 -->
<view class="mtr-tab">
<u-table align="center" border-color="#FFFFFF" color="#333333" font-size="rpx" :th-style="thStyle"
padding="0">
<u-tr class="u-tr">
<u-th class="u-th content-tab-th" v-for="(value, key) in titles" :key="key" width="auto">
<text :class="['tab-th-txt', {'left': key == firstKey}]">{{value}}</text>
</u-th>
</u-tr>
<view class="line-view"></view>
<u-tr class="u-tr" v-for="(item, index) in list" :key="index">
<u-td class="u-td" v-for="(value, key) in titles" :key="key">
<text :class="['tab-th-txt', {'left': key == firstKey}]">{{item[key]}}</text>
</u-td>
</u-tr>
</u-table>
</view>
<!-- 其他 -->
<view class="mtr-other">
<view class="line-view"></view>
<view class="other-space">
<text>其他</text>
<image class="image-view" :src="addImage" @click="handleAdd"></image>
</view>
<view v-if="other.length > 0" class="other-content">
<view class="other-space" v-for="(item, index) in other" :key="index">
<view class="input-view">
<view class="other-space">
<text class="input-title">说明:</text>
<view class="input-content">
<u-input v-model="item.title" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
<view class="other-space">
<text class="input-title">金额:</text>
<view class="input-content">
<u-input v-model="item.value" type="number" :clearable="false" placeholder-style="color:#999999;font-size:26rpx" />
</view>
</view>
</view>
<image class="image-view" :src="subtractImage" @click="handleSubtract"></image>
</view>
</view>
<view class="other-space">
<text>超出金额</text>
<text>{{money}}元</text>
</view>
</view>
</view>
<!-- 底部确定按钮 -->
<view class="bottom-view">
<u-button class="sure-button" type="primary" shape="circle" @click="handleSure" :custom-style="buttonStyle">
确定
</u-button>
</view>
</view>
</template>
<script>
export default {
data() {
return {
list: [], // 材料列表
other: [], // 其他列表
};
},
computed: {
buttonStyle() {
return {
width: "600rpx",
height: "104rpx",
"font-size": "32rpx",
"font-weight": "bold",
};
},
titles() {
return {
name: '材料名称',
unit: '单位',
freeAmount: '免费量',
price: '单价/元',
consumption: '预计用量'
}
},
thStyle() {
return {
'font-weight': 'bold'
}
},
firstKey() {
return Object.keys(this.titles)[0]
},
subtractImage() {
return process.uniEnv.qn_base_url + 'qxiao.png'
},
addImage() {
return process.uniEnv.qn_base_url + 'tianjia.png'
},
money() { // 总额
var amount = 0
for (var item of this.list) {
if (Number(item.consumption) && Number(item.freeAmount) && Number(item.price)) {
amount += Math.max(Number(item.consumption) - Number(item.freeAmount), 0) * Number(item.price)
}
}
for (var item of this.other) {
if (item.value && Number(item.value)) {
amount += Number(item.value)
}
}
return amount
}
},
created() {
// 测试数据
console.log('0000')
for (var i = 0; i < 20; i++) {
this.list.push({
name: '开关发大法师放大范德萨发大水',
unit: '个',
freeAmount: '1',
price: '45.0',
consumption: '4',
})
}
},
methods: {
/* 其他添加新的 */
handleAdd() {
this.other.push({
title: '',
value: ''
})
},
/* 其他删除某个 */
handleSubtract(index) {
this.other.splice(index, 1)
},
handleSure() {
// 返回总额money
}
}
}
</script>
<style lang="scss" scoped>
.mtr-content {
display: flex;
flex-direction: column;
background-color: #F4F5F7;
height: 100vh;
.content-view {
padding: 30rpx 30rpx 60rpx 30rpx;
margin: 20rpx 30rpx;
border-radius: 12rpx;
background-color: #FFFFFF;
height: 100%;
overflow: auto;
.line-view {
background-color: #F4F5F7;
height: 2rpx;
margin: 20rpx 0;
}
.mtr-tab {
.tab-th-txt {
background-color: #FFFFFF;
padding: 10rpx 0;
&.left {
text-align: left;
}
}
}
.mtr-other {
.other-space {
display: flex;
justify-content: space-between;
align-items: center;
}
.other-content {
margin-bottom: 30rpx;
}
.input-view {
padding: 10rpx 30rpx;
width: 100%;
border-radius: 12rpx;
border: 1px #F4F5F7 solid;
margin-bottom: 30rpx;
.input-title {
width: 80rpx;
flex-shrink: 0;
color: #333333;
font-size: 26rpx;
}
.input-content {
width: 100%;
}
}
.image-view {
width: 52rpx;
height: 52rpx;
flex-shrink: 0;
margin: 30rpx 0 30rpx 30rpx;
}
}
}
.bottom-view {
margin-bottom: 44rpx;
margin-top: 10rpx;
height: 104rpx;
}
}
</style>
......@@ -39,7 +39,7 @@ uploader.getQnToken = function(params) {
*region: 地区 默认为:ECN
*/
resolve({
visitPrefix: data.host || globalUrl.qn_asset_url,
visitPrefix: data.host,
token: data.token || '',
folderPath: data.folderPath || '',
region: "ECN"
......
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