Commit 1bf70585 authored by Facius's avatar Facius

Merge branch 'dev-1.4.3' into test

parents 09e358de c4508d5a
(function () { ;(function() {
let NODE_ENV = 'test'; // dev:开发环境 | test:测试环境 | prod:生产环境 let NODE_ENV = 'prod' // dev:开发环境 | test:测试环境 | prod:生产环境
let ENV_VAR = null; let ENV_VAR = null
let VERSION_NUMBER = '1.3.13';//版本号 let VERSION_NUMBER = '1.3.19' //版本号
//小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频 //小程序是否审核通过,参数配置在ucenter库version表,对应版本号的is_audit设置为1,将显示学习视频
if (process.env.NODE_ENV === "development") { if (process.env.NODE_ENV === 'development') {
if (NODE_ENV === 'dev') { if (NODE_ENV === 'dev') {
ENV_VAR = require('./.env.dev.js'); ENV_VAR = require('./.env.dev.js')
} else if (NODE_ENV === 'test') { } else if (NODE_ENV === 'test') {
ENV_VAR = require('./.env.test.js'); ENV_VAR = require('./.env.test.js')
} else if (NODE_ENV === 'prod') { } else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js'); ENV_VAR = require('./.env.prod.js')
} }
// 百度地图AK,请勿删除 // 百度地图AK,请勿删除
ENV_VAR['bmapAK'] = 'G1wPip2Oj62NnoUctXhiE1faZVHbeo2A' ENV_VAR['bmapAK'] = 'G1wPip2Oj62NnoUctXhiE1faZVHbeo2A'
} else if (process.env.NODE_ENV === "production") { } else if (process.env.NODE_ENV === 'production') {
if (NODE_ENV === 'test') { if (NODE_ENV === 'test') {
ENV_VAR = require('./.env.test.js'); ENV_VAR = require('./.env.test.js')
} else if (NODE_ENV === 'prod') { } else if (NODE_ENV === 'prod') {
ENV_VAR = require('./.env.prod.js'); ENV_VAR = require('./.env.prod.js')
} }
// 百度地图AK,请勿删除 // 百度地图AK,请勿删除
ENV_VAR['bmapAK'] = 'lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI' ENV_VAR['bmapAK'] = 'lF1HoyXdiv4uZx6TrGQEZs48F5y8kEHI'
} }
if (ENV_VAR) { if (ENV_VAR) {
process.uniEnv = {}; process.uniEnv = {}
process.uniEnv['node_env'] = NODE_ENV; process.uniEnv['node_env'] = NODE_ENV
process.uniEnv['version_number'] = VERSION_NUMBER; process.uniEnv['version_number'] = VERSION_NUMBER
for (let key in ENV_VAR) { for (let key in ENV_VAR) {
process.uniEnv[key] = ENV_VAR[key]; process.uniEnv[key] = ENV_VAR[key]
} }
} }
})(); })()
<!-- ******************* 多选框 ******************* --> <!-- ******************* 多选框 ******************* -->
<template> <template>
<view class="list"> <view class="list">
<view v-for="(item,index) in settings" :key="index" <view
:class="{'txt':true,'active':checkStatus(item.key)}" @click="setValue(item.key)">{{item.label}} v-for="(item, index) in settings"
:key="index"
:class="{ txt: true, active: checkStatus(item.key) }"
@click="setValue(item.key)"
>{{ item.label }}
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import arrMixin from './arrMixin' import arrMixin from './arrMixin'
export default { export default {
name: 'XhRadio', name: 'XhRadio',
components: {}, components: {},
mixins: [arrMixin], mixins: [arrMixin],
props: {}, props: {},
filters:{}, filters: {},
data() { data() {
return {} return {}
}, },
computed: { computed: {
settings() { settings() {
return this.item.fieldsOptions || [] return this.item.fieldsOptions || []
} },
}, },
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
checkStatus(item){ checkStatus(item) {
if(!item){ if (!item) {
return false return false
} }
const dataValue = this.dataValue const dataValue = this.dataValue
let flag = Array.isArray(dataValue) && dataValue.indexOf(item)>-1 let flag = Array.isArray(dataValue) && dataValue.indexOf(item) > -1
return flag return flag
}, },
setValue(txt) { setValue(txt) {
if (this.disabled) return
const dataValue = this.dataValue || [] const dataValue = this.dataValue || []
let idx = dataValue.indexOf(txt) let idx = dataValue.indexOf(txt)
if (idx > -1) { if (idx > -1) {
dataValue.splice(idx,1) dataValue.splice(idx, 1)
} else { } else {
dataValue.push(txt) dataValue.push(txt)
} }
this.dataValue = dataValue this.dataValue = dataValue
this.valueChange(this.dataValue) this.valueChange(this.dataValue)
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.list { .list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
.txt{ .txt {
color:#333; color: #333;
padding:10rpx 30rpx; padding: 10rpx 30rpx;
margin: 10rpx; margin: 10rpx;
background: #F4F5F7; background: #f4f5f7;
border-radius: 10rpx; border-radius: 10rpx;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
line-height: 50rpx; line-height: 50rpx;
max-width: 46%; max-width: 46%;
align-items: center; align-items: center;
&.active{ &.active {
background-color: #2272FF; background-color: #2272ff;
color:#fff; color: #fff;
}
} }
} }
}
</style> </style>
...@@ -3,9 +3,26 @@ ...@@ -3,9 +3,26 @@
<view> <view>
<view class="file-box"> <view class="file-box">
<view class="pics u-flex u-flex-wrap"> <view class="pics u-flex u-flex-wrap">
<view class="img-list" v-for="(item,index) in imgList" :key="index"> <view class="img-list" v-for="(item, index) in imgList" :key="index">
<u-image class="pic" width="160" height="160" :src="item.path ? item.path : item.src + '?imageView2/1/w/100/h/100/q/75'" :border-radius="10" @click.stop="prviewImage(item,index)" fade lazy-load ></u-image> <u-image
<view class="icon-del-box" @click.stop="delFile(index)"> class="pic"
width="160"
height="160"
:src="
item.path
? item.path
: item.src + '?imageView2/1/w/100/h/100/q/75'
"
:border-radius="10"
@click.stop="prviewImage(item, index)"
fade
lazy-load
></u-image>
<view
class="icon-del-box"
v-if="!disabled"
@click.stop="delFile(index)"
>
<view class="icon-del"></view> <view class="icon-del"></view>
<view class="icon-del rotate"></view> <view class="icon-del rotate"></view>
</view> </view>
...@@ -22,48 +39,48 @@ ...@@ -22,48 +39,48 @@
</template> </template>
<script> <script>
import arrMixin from './arrMixin' import arrMixin from './arrMixin'
import baseFile from '@/components/upload/index'; import baseFile from '@/components/upload/index'
import takePhoto from '@/components/take/index.vue' import takePhoto from '@/components/take/index.vue'
// import uploader from '@/plugins/uploader/index.js' // import uploader from '@/plugins/uploader/index.js'
export default { export default {
name: 'XhFiles', name: 'XhFiles',
components: { components: {
'take-photo': takePhoto 'take-photo': takePhoto,
}, },
mixins: [arrMixin,baseFile], mixins: [arrMixin, baseFile],
props: { props: {
files: { files: {
type: Array, type: Array,
}, },
partnerCompanyId: { partnerCompanyId: {
type: String, type: String,
default: '' default: '',
}, },
categoryId: { categoryId: {
type: String, type: String,
default: '' default: '',
}, },
brandId: { brandId: {
type: String, type: String,
default: '' default: '',
}, },
}, },
filters:{}, filters: {},
data() { data() {
return { return {
maskShow:false, maskShow: false,
list: [ list: [
{ {
text: '相册' text: '相册',
}, },
{ {
text: '拍照' text: '拍照',
} },
], ],
takeStatus: false, takeStatus: false,
currentItemDate:{}, currentItemDate: {},
} }
}, },
computed: { computed: {
...@@ -75,9 +92,11 @@ ...@@ -75,9 +92,11 @@
}, },
}, },
mounted() { mounted() {
if(this.value){ if (this.value) {
this.imgList = this.value.filter(v => v).map(img =>{ this.imgList = this.value
return {src:img ? img : ''} .filter((v) => v)
.map((img) => {
return { src: img ? img : '' }
}) })
this.setValue() this.setValue()
} }
...@@ -85,18 +104,18 @@ ...@@ -85,18 +104,18 @@
methods: { methods: {
setTmpValue(values) { setTmpValue(values) {
this.imgList = this.imgList.concat(values) this.imgList = this.imgList.concat(values)
const dataValue = this.imgList.map(v => v.src) const dataValue = this.imgList.map((v) => v.src)
this.valueChange(dataValue) this.valueChange(dataValue)
}, },
setValue() { setValue() {
const dataValue = this.imgList.map(item => item.src) const dataValue = this.imgList.map((item) => item.src)
this.valueChange(dataValue) this.valueChange(dataValue)
}, },
prviewImage(item, index) { prviewImage(item, index) {
uni.previewImage({ uni.previewImage({
urls: [item.path ? item.path : item.src], urls: [item.path ? item.path : item.src],
current: index current: index,
}); })
}, },
delFile(index) { delFile(index) {
this.imgList.splice(index, 1) this.imgList.splice(index, 1)
...@@ -197,22 +216,20 @@ ...@@ -197,22 +216,20 @@
} }
}); });
}*/ }*/
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.img-list {
.img-list {
position: relative; position: relative;
margin: 8rpx; margin: 8rpx;
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
.pic{ .pic {
// margin-right: 15rpx; // margin-right: 15rpx;
// margin-bottom: 15rpx; // margin-bottom: 15rpx;
&:nth-child(3n){ &:nth-child(3n) {
margin-right: 0; margin-right: 0;
} }
} }
...@@ -245,18 +262,18 @@ ...@@ -245,18 +262,18 @@
position: absolute; position: absolute;
transform: rotate(90deg); transform: rotate(90deg);
} }
} }
// .list { // .list {
// display: flex; // display: flex;
// .txt { // .txt {
// color: #666; // color: #666;
// padding: 10rpx; // padding: 10rpx;
// &.active { // &.active {
// background-color: red; // background-color: red;
// color: #fff; // color: #fff;
// } // }
// } // }
// } // }
</style> </style>
...@@ -3,23 +3,23 @@ ...@@ -3,23 +3,23 @@
<view> <view>
<view class="list u-flex u-row-between"> <view class="list u-flex u-row-between">
<image class="item-image" :src="mixingImage" v-if="item.required"></image> <image class="item-image" :src="mixingImage" v-if="item.required"></image>
<view class="u-m-r-20">{{item.fieldsTitle}}</view> <view class="u-m-r-20">{{ item.fieldsTitle }}</view>
<view class="u-flex-1 location-name" @click="getLocation"> <view class="u-flex-1 location-name" @click="getLocation">
<u-icon name="map" color="#2979ff" size="30"></u-icon>自动定位 <u-icon name="map" color="#2979ff" size="30"></u-icon>自动定位
</view> </view>
</view> </view>
<view class="u-flex-1 location">{{valueTxt || '正在获取中...'}}</view> <view class="u-flex-1 location">{{ valueTxt || '正在获取中...' }}</view>
</view> </view>
</template> </template>
<script> <script>
import arrMixin from './arrMixin' import arrMixin from './arrMixin'
export default { export default {
name: 'XhLocation', name: 'XhLocation',
components: {}, components: {},
mixins: [arrMixin], mixins: [arrMixin],
props: {}, props: {},
filters:{}, filters: {},
data() { data() {
return {} return {}
}, },
...@@ -27,14 +27,19 @@ ...@@ -27,14 +27,19 @@
valueTxt() { valueTxt() {
let str = '' let str = ''
const dataValue = this.dataValue const dataValue = this.dataValue
if(dataValue && dataValue.length>1){ if (dataValue && dataValue.length > 1) {
str = '经度:'+dataValue[0].toFixed(4)+','+'纬度:'+dataValue[1].toFixed(4) str =
'经度:' +
dataValue[0].toFixed(4) +
',' +
'纬度:' +
dataValue[1].toFixed(4)
} }
return str return str
}, },
mixingImage() { mixingImage() {
return process.uniEnv.qn_base_url + 'mixing.png' return process.uniEnv.qn_base_url + 'mixing.png'
} },
}, },
watch: {}, watch: {},
created() { created() {
...@@ -42,6 +47,7 @@ ...@@ -42,6 +47,7 @@
}, },
methods: { methods: {
getLocation() { getLocation() {
if (this.disabled) return
let self = this let self = this
const dataValue = this.dataValue || [] const dataValue = this.dataValue || []
const waterInfo = this.waterInfo const waterInfo = this.waterInfo
...@@ -53,34 +59,34 @@ ...@@ -53,34 +59,34 @@
self.dataValue = dataValue self.dataValue = dataValue
self.setValue(dataValue) self.setValue(dataValue)
}, },
fail(err) {} fail(err) {},
}); })
}, },
setValue(txt) { setValue(txt) {
this.valueChange(this.dataValue) this.valueChange(this.dataValue)
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.required { .required {
padding-right: 10rpx; padding-right: 10rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
color: #fa3534; color: #fa3534;
} }
.item-image { .item-image {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
margin-right: 10rpx; margin-right: 10rpx;
} }
.location-name { .location-name {
color: #2272FF; color: #2272ff;
text-align: right; text-align: right;
} }
.location { .location {
background: #F4F5F7; background: #f4f5f7;
padding: 10rpx 20rpx; padding: 10rpx 20rpx;
border-radius: 12rpx; border-radius: 12rpx;
} }
</style> </style>
<!-- ******************* 多个输入框 ******************* --> <!-- ******************* 多个输入框 ******************* -->
<template> <template>
<view class="u-flex u-flex-wrap"> <view class="u-flex u-flex-wrap">
<u-input class="input-item" v-for="(item,index) in inputOptions" v-model="item.value" @input="val=>{getValue(item)}" type="text" :key="index" :border="true" :placeholder="item.placeholder" /> <u-input
class="input-item"
v-for="(item, index) in inputOptions"
v-model="item.value"
@input="
(val) => {
getValue(item)
}
"
type="text"
:key="index"
:border="true"
:placeholder="item.placeholder"
:disabled="disabled"
/>
</view> </view>
</template> </template>
<script> <script>
import objMixin from './objMixin' import objMixin from './objMixin'
export default { export default {
name: 'XhMultiInput', name: 'XhMultiInput',
components: {}, components: {},
mixins: [objMixin], mixins: [objMixin],
...@@ -18,32 +32,32 @@ ...@@ -18,32 +32,32 @@
computed: { computed: {
inputOptions() { inputOptions() {
let options = this.item.inputOptions || [] let options = this.item.inputOptions || []
let result = options.map(item => { let result = options.map((item) => {
return { return {
...item, ...item,
value: '' value: '',
} }
}) })
return result return result
} },
}, },
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
getValue(item){ getValue(item) {
let currentValue = {} let currentValue = {}
currentValue[item.fieldsName] = item.value currentValue[item.fieldsName] = item.value
// 以key,value的对象形式传递 // 以key,value的对象形式传递
this.valueChange(currentValue) this.valueChange(currentValue)
} },
} },
} }
</script> </script>
<style scoped> <style scoped>
.input-item{ .input-item {
width: 31%; width: 31%;
margin: 5rpx; margin: 5rpx;
background: #F4F5F7; background: #f4f5f7;
} }
</style> </style>
...@@ -6,31 +6,37 @@ ...@@ -6,31 +6,37 @@
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> </view>
<view class="u-flex"> <view class="u-flex">
<u-input class="u-flex-1 input-item" v-model="dataValue" @input="valueChange" type="text" /> <u-input
class="u-flex-1 input-item"
v-model="dataValue"
@input="valueChange"
type="text"
:disabled="disabled"
/>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin' import stringMixin from './stringMixin'
export default { export default {
name: 'XhScan', name: 'XhScan',
components: {}, components: {},
mixins: [stringMixin], mixins: [stringMixin],
props: {}, props: {},
filters:{}, filters: {},
data() { data() {
return {} return {}
}, },
computed: { computed: {},
},
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
scanCode(type){ scanCode(type) {
if (this.disabled) return
const self = this const self = this
uni.scanCode({ uni.scanCode({
success: function (res) { success: function(res) {
let result = res.result let result = res.result
if (result.substring(0, 4) === 'http') { if (result.substring(0, 4) === 'http') {
let arr = result.split('/#/') let arr = result.split('/#/')
...@@ -39,22 +45,22 @@ ...@@ -39,22 +45,22 @@
} }
self.dataValue = result self.dataValue = result
self.valueChange(result) self.valueChange(result)
} },
}); })
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.required { .required {
padding-right: 10rpx; padding-right: 10rpx;
font-size: 28rpx; font-size: 28rpx;
line-height: 40rpx; line-height: 40rpx;
color: #fa3534; color: #fa3534;
} }
.input-item{ .input-item {
background: #F4F5F7; background: #f4f5f7;
border-radius: 12rpx; border-radius: 12rpx;
padding-left: 20rpx; padding-left: 20rpx;
} }
</style> </style>
<!-- ******************* 单个下拉选择 ******************* --> <!-- ******************* 单个下拉选择 ******************* -->
<template> <template>
<view class="xh-select" :style="{'width': fieldsWidth}"> <view class="xh-select" :style="{ width: fieldsWidth }">
<!-- <u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle" <!-- <u-input :value="text" disabled @click="show=true" :placeholder="placeholder" :placeholder-style="placeholderStyle"
:custom-style="customStyle" :clearable="false"></u-input> :custom-style="customStyle" :clearable="false"></u-input>
<u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select> <u-select :list="settings" v-model="show" @confirm="actionSheetCallback" safe-area-inset-bottom></u-select>
<u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> --> <u-icon class="input-icon" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> -->
<view class="u-flex u-row-between picker-common"> <view class="u-flex u-row-between picker-common">
<picker mode="selector" :value="index" range-key="label" :range="settings" @click="show = true" @change="pickerChange" class="u-flex-1"> <picker
<view class="txt">{{text || '请选择'}}</view> mode="selector"
:value="index"
range-key="label"
:range="settings"
@click="show = true"
@change="pickerChange"
class="u-flex-1"
:disabled="disabled"
>
<view class="txt">{{ text || '请选择' }}</view>
</picker> </picker>
<u-icon class="input-icon" color="#2272FF" :name="show ? 'arrow-up' : 'arrow-down'"></u-icon> <u-icon
class="input-icon"
color="#2272FF"
:name="show ? 'arrow-up' : 'arrow-down'"
></u-icon>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin' import stringMixin from './stringMixin'
export default { export default {
name: 'XhSelect', name: 'XhSelect',
components: {}, components: {},
mixins: [stringMixin], mixins: [stringMixin],
props: { props: {
placeholder: { placeholder: {
type: String, type: String,
default: '请选择' default: '请选择',
}, },
width: { // 例如:454rpx width: {
// 例如:454rpx
type: String, type: String,
default: '100%' default: '100%',
} },
}, },
data() { data() {
return { return {
show: false, show: false,
index: '' index: '',
} }
}, },
computed: { computed: {
...@@ -48,19 +62,21 @@ ...@@ -48,19 +62,21 @@
settings() { settings() {
let result = [] let result = []
let settings = this.item.fieldsOptions || [] let settings = this.item.fieldsOptions || []
result = settings.map(item => { result = settings.map((item) => {
return { return {
label: item.label, label: item.label,
value: item.key, value: item.key,
color: '#333333', color: '#333333',
fontSize: 26 fontSize: 26,
} }
}) })
return result return result
}, },
text(){ text() {
let option = this.item.fieldsOptions.find(a=>{return a.key === this.dataValue}) let option = this.item.fieldsOptions.find((a) => {
return option?option.label:'' return a.key === this.dataValue
})
return option ? option.label : ''
}, },
placeholderStyle() { placeholderStyle() {
return 'color:#999999;font-size:26rpx' return 'color:#999999;font-size:26rpx'
...@@ -69,16 +85,16 @@ ...@@ -69,16 +85,16 @@
return { return {
'background-color': '#F4F5F7', 'background-color': '#F4F5F7',
'border-radius': '12rpx', 'border-radius': '12rpx',
'color': '#333333', color: '#333333',
'padding-left': '20rpx', 'padding-left': '20rpx',
'padding-right': '60rpx', 'padding-right': '60rpx',
'width': this.width, width: this.width,
'font-size':'26rpx', 'font-size': '26rpx',
'height': '76rpx' height: '76rpx',
} }
}, },
fieldsWidth() { fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%' return this.item.fieldsWidth ? this.item.fieldsWidth + 'rpx' : '100%'
}, },
}, },
watch: {}, watch: {},
...@@ -95,23 +111,23 @@ ...@@ -95,23 +111,23 @@
this.dataValue = id this.dataValue = id
this.valueChange(id) this.valueChange(id)
}, },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.xh-select { .xh-select {
position: relative; position: relative;
.input-icon { .input-icon {
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
top: 26rpx; top: 26rpx;
color: #2272FF; color: #2272ff;
} }
} }
.picker-common { .picker-common {
min-height: 35px; min-height: 35px;
background-color: #F4F5F7; background-color: #f4f5f7;
border-radius: 6px; border-radius: 6px;
color: #333333; color: #333333;
padding-left: 10px; padding-left: 10px;
...@@ -124,5 +140,5 @@ ...@@ -124,5 +140,5 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
} }
</style> </style>
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
:value="index" :value="index"
range-key="label" range-key="label"
:range="settings" :range="settings"
:disabled="disabled"
@click="showPicker = true" @click="showPicker = true"
@change="pickerChange" @change="pickerChange"
class="txt u-flex-1" class="txt u-flex-1"
> >
<view>{{ text || "请选择" }}</view> <view>{{ text || '请选择' }}</view>
</picker> </picker>
<u-icon <u-icon
class="input-icon" class="input-icon"
...@@ -30,9 +31,9 @@ ...@@ -30,9 +31,9 @@
</template> </template>
<script> <script>
import objMixin from "./objMixin"; import objMixin from './objMixin'
export default { export default {
name: "XhPicker", name: 'XhPicker',
components: {}, components: {},
mixins: [objMixin], mixins: [objMixin],
props: { props: {
...@@ -40,17 +41,17 @@ export default { ...@@ -40,17 +41,17 @@ export default {
defaultSelector: { defaultSelector: {
type: Array, type: Array,
default() { default() {
return [0]; return [0]
}, },
}, },
// 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容 // 当 range 是一个 Array<Object> 时,通过 range-key 来指定 Object 中 key 的值作为选择器显示内容
rangeKey: { rangeKey: {
type: String, type: String,
default: "label", default: 'label',
}, },
value: { value: {
type: String, type: String,
default: "{}", default: '{}',
}, },
orderId: { orderId: {
type: Number, type: Number,
...@@ -62,11 +63,11 @@ export default { ...@@ -62,11 +63,11 @@ export default {
}, },
specificationId: { specificationId: {
type: String, type: String,
default: "0", default: '0',
}, },
orderServiceType: { orderServiceType: {
type: String, type: String,
default: "安装", default: '安装',
}, },
}, },
filters: {}, filters: {},
...@@ -76,47 +77,47 @@ export default { ...@@ -76,47 +77,47 @@ export default {
showPicker: false, showPicker: false,
settings: [], settings: [],
measure: [], measure: [],
index: "", index: '',
}; }
}, },
computed: { computed: {
text() { text() {
let val = ""; let val = ''
if (this.value) { if (this.value) {
let data = JSON.parse(this.value); let data = JSON.parse(this.value)
val = data[0].measureTypeName + "-" + data[0].measureName; val = data[0].measureTypeName + '-' + data[0].measureName
} }
return val; return val
}, },
fieldsWidth() { fieldsWidth() {
return this.item.fieldsWidth ? this.item.fieldsWidth + "rpx" : "100%"; return this.item.fieldsWidth ? this.item.fieldsWidth + 'rpx' : '100%'
}, },
}, },
watch: { watch: {
specificationId(val, oldVal) { specificationId(val, oldVal) {
this.initComponent(); this.initComponent()
}, },
}, },
mounted() { mounted() {
this.isNotMulti = this.orderServiceType === "安装"; this.isNotMulti = this.orderServiceType === '安装'
this.initComponent(); this.initComponent()
}, },
methods: { methods: {
openPicker() { openPicker() {
if (this.specificationId === "0") { if (this.specificationId === '0') {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: "请先选择规格", title: '请先选择规格',
type: "error", type: 'error',
}); })
return; return
} }
this.showPicker = true; this.showPicker = true
}, },
initComponent() { initComponent() {
if (this.isNotMulti) { if (this.isNotMulti) {
this.initMeasure(); this.initMeasure()
} else { } else {
this.initSymptoms(); this.initSymptoms()
} }
}, },
initSymptoms() { initSymptoms() {
...@@ -133,50 +134,50 @@ export default { ...@@ -133,50 +134,50 @@ export default {
categoryId: this.categoryId, categoryId: this.categoryId,
specificationId: this.specificationId, specificationId: this.specificationId,
orderServiceTypeText: this.orderServiceType, orderServiceTypeText: this.orderServiceType,
}; }
this.$u.api.getMeasureV2(param).then(res => { this.$u.api.getMeasureV2(param).then((res) => {
if (res.code == 200) { if (res.code == 200) {
let result = []; let result = []
for (let key in res.data) { for (let key in res.data) {
this.measure = res.data[key].measureExtendDtos; this.measure = res.data[key].measureExtendDtos
res.data[key].measureExtendDtos.map((item, index) => { res.data[key].measureExtendDtos.map((item, index) => {
result.push({ id: item.measureId, label: item.measureName }); result.push({ id: item.measureId, label: item.measureName })
}); })
} }
if (this.orderServiceType === "安装") { if (this.orderServiceType === '安装') {
this.settings = result; this.settings = result
} else { } else {
this.settings[2] = result; this.settings[2] = result
} }
} else { } else {
console.log(res.message, "查询措施失败"); console.log(res.message, '查询措施失败')
} }
}); })
} }
}, },
pickerConfirm(data) { pickerConfirm(data) {
let result = []; let result = []
if (this.isMulti) { if (this.isMulti) {
// 维修 // 维修
} else { } else {
// 安装 // 安装
result.push(this.measure[data[0]]); result.push(this.measure[data[0]])
} }
this.valueChange(JSON.stringify(result)); this.valueChange(JSON.stringify(result))
}, },
pickerChange(data) { pickerChange(data) {
this.showPicker = false; this.showPicker = false
this.index = data.detail.value; this.index = data.detail.value
let result = []; let result = []
if (this.isMulti) { if (this.isMulti) {
// 维修 // 维修
} else { } else {
// 安装 // 安装
result.push(this.measure[this.index]); result.push(this.measure[this.index])
} }
this.valueChange(JSON.stringify(result)); this.valueChange(JSON.stringify(result))
}, },
columnchange(data) { columnchange(data) {
// // 树列改变时进行联动操作 // // 树列改变时进行联动操作
...@@ -185,7 +186,7 @@ export default { ...@@ -185,7 +186,7 @@ export default {
// this.settings.splice(column+1,1,arr) // this.settings.splice(column+1,1,arr)
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.picker-common { .picker-common {
......
...@@ -23,66 +23,67 @@ ...@@ -23,66 +23,67 @@
</template> </template>
<script> <script>
import arrMixin from "./arrMixin"; import arrMixin from './arrMixin'
export default { export default {
name: "XhInput", // 新建 input name: 'XhInput', // 新建 input
components: {}, components: {},
mixins: [arrMixin], mixins: [arrMixin],
props: { props: {
placeholder: { placeholder: {
type: String, type: String,
default: "请输入", default: '请输入',
}, },
orderId: { orderId: {
type: String, type: String,
default: "请输入", default: '请输入',
}, },
}, },
data() { data() {
return { return {
maxlength: 140, maxlength: 140,
}; }
}, },
computed: { computed: {
mixingImage() { mixingImage() {
return process.uniEnv.qn_base_url + "mixing.png"; return process.uniEnv.qn_base_url + 'mixing.png'
}, },
arrowText() { arrowText() {
if(this.$u.test.isEmpty(this.dataValue)) return "请选择"; if (this.$u.test.isEmpty(this.dataValue)) return '请选择'
if(this.item.fieldsName == "materialList") { if (this.item.fieldsName == 'materialList') {
let hasMate = false let hasMate = false
var newData = this.dataValue.find((item) => { var newData = this.dataValue.find((item) => {
if(!this.$u.test.isEmpty(item.useLength)) { if (!this.$u.test.isEmpty(item.useLength)) {
hasMate = true hasMate = true
return item.useLength != '0' return item.useLength != '0'
} }
}) })
if(hasMate && this.$u.test.isEmpty(newData)) return "请选择" if (hasMate && this.$u.test.isEmpty(newData)) return '请选择'
} }
return "已选择"; return '已选择'
}, },
}, },
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
toMaterialPage() { toMaterialPage() {
let self = this; if (this.disabled) return
let self = this
uni.navigateTo({ uni.navigateTo({
url: url:
"pages/order/material?orderId=" + 'pages/order/material?orderId=' +
this.orderId + this.orderId +
"&fieldName=" + '&fieldName=' +
this.item.fieldsName, this.item.fieldsName,
// 接口调用成功的回调函数,即跳转到B页面 test.vue 后的回调函数 // 接口调用成功的回调函数,即跳转到B页面 test.vue 后的回调函数
success: function (res) { success: function(res) {
// 通过eventChannel向被打开页面传送数据 // 通过eventChannel向被打开页面传送数据
res.eventChannel.emit("showMaterialData", self.dataValue); res.eventChannel.emit('showMaterialData', self.dataValue)
}, },
}); })
}, },
}, },
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
<!-- ******************* 单个下拉选择 ******************* --> <!-- ******************* 单个下拉选择 ******************* -->
<template> <template>
<view class="xh-specifications" :style="{'width': fieldsWidth}"> <view class="xh-specifications" :style="{ width: fieldsWidth }">
<view class="u-flex u-row-between picker-common" @click="$u.throttle(handleClick, 500)"> <view
<view>{{text || '请选择'}}</view> class="u-flex u-row-between picker-common"
@click="$u.throttle(handleClick, 500)"
>
<view>{{ text || '请选择' }}</view>
<u-icon class="input-icon" color="#2272FF" name="arrow-down"></u-icon> <u-icon class="input-icon" color="#2272FF" name="arrow-down"></u-icon>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import stringMixin from './stringMixin' import stringMixin from './stringMixin'
export default { export default {
name: 'XhSpecifications', name: 'XhSpecifications',
components: {}, components: {},
mixins: [stringMixin], mixins: [stringMixin],
props: { props: {
placeholder: { placeholder: {
type: String, type: String,
default: '请选择' default: '请选择',
}, },
width: { // 例如:454rpx width: {
// 例如:454rpx
type: String, type: String,
default: '100%' default: '100%',
}, },
type: { type: {
type: String, type: String,
default: 'text' default: 'text',
}, },
}, },
data() { data() {
return { return {}
}
}, },
computed: { computed: {
fieldsWidth() { // 后台返回宽度就用后台的 fieldsWidth() {
return this.item.fieldsWidth ? (this.item.fieldsWidth + 'rpx') : '100%' // 后台返回宽度就用后台的
return this.item.fieldsWidth ? this.item.fieldsWidth + 'rpx' : '100%'
},
text() {
// 根据选中的key显示
let option = this.item.fieldsOptions.find((a) => {
return a.key === this.dataValue
})
return option ? option.label : ''
}, },
text(){ // 根据选中的key显示
let option = this.item.fieldsOptions.find(a=>{return a.key === this.dataValue})
return option?option.label:''
}
}, },
watch: {}, watch: {},
mounted() {}, mounted() {},
methods: { methods: {
handleClick() { handleClick() {
var pages = getCurrentPages(); if (this.disabled) return
var pages = getCurrentPages()
if (pages.length >= 1) { if (pages.length >= 1) {
var page = pages[pages.length - 1]; var page = pages[pages.length - 1]
page.info = this.item // 给下个页面传递数据 page.info = this.item // 给下个页面传递数据
} }
uni.navigateTo({ // 把选中的key传给下个页面 uni.navigateTo({
url: 'pages/order/specification?selectedId=' + this.dataValue // 把选中的key传给下个页面
url: 'pages/order/specification?selectedId=' + this.dataValue,
}) })
} },
} },
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.xh-specifications { .xh-specifications {
position: relative; position: relative;
.input-icon { .input-icon {
position: absolute; position: absolute;
right: 20rpx; right: 20rpx;
top: 26rpx; top: 26rpx;
color: #2272FF; color: #2272ff;
} }
} }
.picker-common { .picker-common {
min-height: 35px; min-height: 35px;
background-color: #F4F5F7; background-color: #f4f5f7;
border-radius: 6px; border-radius: 6px;
color: #333333; color: #333333;
padding-left: 10px; padding-left: 10px;
...@@ -83,5 +92,5 @@ ...@@ -83,5 +92,5 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
} }
</style> </style>
...@@ -7,8 +7,14 @@ ...@@ -7,8 +7,14 @@
</view> --> </view> -->
<!-- <u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker> --> <!-- <u-picker :params="params" v-model="showPicker" mode="time" @confirm="pickerConfirm"></u-picker> -->
<view class="u-flex u-row-between"> <view class="u-flex u-row-between">
<picker mode="date" :value="dataValue" @change="bindDateChange" class="txt u-flex-1"> <picker
<view>{{dataValue || '请选择时间'}}</view> mode="date"
:value="dataValue"
@change="bindDateChange"
class="txt u-flex-1"
:disabled="disabled"
>
<view>{{ dataValue || '请选择时间' }}</view>
</picker> </picker>
<u-icon name="arrow-right" color="#666" size="28"></u-icon> <u-icon name="arrow-right" color="#666" size="28"></u-icon>
</view> </view>
...@@ -16,8 +22,8 @@ ...@@ -16,8 +22,8 @@
</template> </template>
<script> <script>
import stringMixin from './stringMixin' import stringMixin from './stringMixin'
export default { export default {
components: {}, components: {},
mixins: [stringMixin], mixins: [stringMixin],
props: {}, props: {},
...@@ -51,10 +57,9 @@ ...@@ -51,10 +57,9 @@
const value = e.target.value const value = e.target.value
this.dataValue = value this.dataValue = value
this.valueChange(value) this.valueChange(value)
} },
} },
} }
</script> </script>
<style> <style></style>
</style>
...@@ -131,6 +131,7 @@ ...@@ -131,6 +131,7 @@
if (this.operate) { if (this.operate) {
const latitude = this.order.contactAddressLatitud //res.latitude; const latitude = this.order.contactAddressLatitud //res.latitude;
const longitude = this.order.contactAddressLongitud //res.longitude; const longitude = this.order.contactAddressLongitud //res.longitude;
getApp().track("order_open_location", { address: address });
uni.openLocation({ uni.openLocation({
latitude: Number(latitude), latitude: Number(latitude),
longitude: Number(longitude), longitude: Number(longitude),
...@@ -142,6 +143,7 @@ ...@@ -142,6 +143,7 @@
}, },
phoneToCustomer(phone) { // 联系客户 phoneToCustomer(phone) { // 联系客户
if (this.operate) { if (this.operate) {
getApp().track("order_make_phone_call", { phone: phone });
uni.makePhoneCall({ uni.makePhoneCall({
phoneNumber: phone, //仅为示例 phoneNumber: phone, //仅为示例
complete() {} complete() {}
......
This diff is collapsed.
...@@ -72,29 +72,43 @@ ...@@ -72,29 +72,43 @@
return return
} }
let path = '' let path = ''
let pass = true
if(photo.tempPath.origin && photo?.waterSetting?.hasOrigin){ if(photo.tempPath.origin && photo?.waterSetting?.hasOrigin){
// 保存原图到本地 // 保存原图到本地
path = photo.tempPath.origin path = photo.tempPath.origin
let result = await this.saveLocal(path) await this.saveLocal(path).then(res => {
if(result){
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '已将照片原图保存到本地相册' title: '已将照片原图保存到本地相册'
}) })
}).catch(e => {
uni.showToast({
icon: 'none',
title: e
})
pass = false
that.$parent.goBack()
})
} }
} // 如果用户不同意保存到相册
if(!pass) return
if(photo.tempPath.mixWater){ if(photo.tempPath.mixWater){
// 保存水印处理图片到本地 // 保存水印处理图片到本地
path = photo.tempPath.mixWater path = photo.tempPath.mixWater
let result1 = await this.saveLocal(path) this.saveLocal(path).then(res => {
if(result1){
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: '已将水印图片保存到本地相册' title: '已将水印图片保存到本地相册'
}) })
resolve() resolve()
} }).catch(e => {
uni.showToast({
icon: 'none',
title: e
})
that.$parent.goBack()
})
} }
}) })
}, },
...@@ -105,9 +119,26 @@ ...@@ -105,9 +119,26 @@
success() { success() {
resolve(true) resolve(true)
}, },
fail() { fail(e) {
uni.showModal({
content: '拒绝授权将无法保存图片到本地,是否去设置打开?',
confirmText: "确认",
cancelText: '取消',
success(res) {
if (res.confirm) {
wx.openSetting({
success(res) {
resolve(true)
}
})
} else if(res.cancel) {
reject('保存失败') reject('保存失败')
} }
},
fail() {
}
})
}
}) })
}) })
}, },
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<u-image :src="partsImage(info.images)" width="200rpx" height="200rpx" /> <u-image :src="partsImage(info.images)" width="200rpx" height="200rpx" />
</view> </view>
<view class="u-flex right-content"> <view class="u-flex right-content">
<view class="right-content-name">{{ info.name }}</view> <view class="right-content-name u-line-2">{{ info.name }}</view>
<view class="right-content-desc">{{ info.remark }}</view> <view class="right-content-desc u-line-2">{{ info.remark }}</view>
<view class="u-flex right-content-opera"> <view class="u-flex right-content-opera">
<view class="no" v-if="info.stock"> <view class="no" v-if="info.stock">
可用{{ info.stock }}件 可用{{ info.stock }}件
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
overflow: hidden; overflow: hidden;
.right-img { .right-img {
padding-right: 20rpx; padding-right: 20rpx;
align-self: baseline;
} }
.right-content { .right-content {
flex: 1; flex: 1;
...@@ -91,8 +92,6 @@ ...@@ -91,8 +92,6 @@
font-size: 32rpx; font-size: 32rpx;
color: #333; color: #333;
font-weight: bold; font-weight: bold;
height: 48rpx;
overflow: hidden;
} }
.right-content-desc { .right-content-desc {
font-size: 24rpx; font-size: 24rpx;
......
...@@ -268,12 +268,6 @@ ...@@ -268,12 +268,6 @@
t() t()
}, },
cameraError(e) { cameraError(e) {
const {
errMsg
} = e.detail
if (errMsg !== 'insertCamera:fail auth deny') {
return
}
this.showSettingModal('camera') this.showSettingModal('camera')
}, },
//获取位置 //获取位置
...@@ -329,9 +323,12 @@ ...@@ -329,9 +323,12 @@
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
self.openSetting() self.openSetting()
} else if(res.cancel) {
if (type === 'camera' || type === 'location') self.goBack()
} }
}, },
fail() {} fail() {
}
}) })
}, },
openSetting() { openSetting() {
...@@ -346,6 +343,8 @@ ...@@ -346,6 +343,8 @@
// 位置授权成功 // 位置授权成功
self.authSetting.location = true self.authSetting.location = true
self.getLocation() self.getLocation()
} else {
self.showSettingModal('location')
} }
if (res.authSetting['scope.camera']) { if (res.authSetting['scope.camera']) {
self.authSetting.camera = true self.authSetting.camera = true
......
...@@ -749,6 +749,7 @@ export default { ...@@ -749,6 +749,7 @@ export default {
}, },
// 安装文件 // 安装文件
goToDocument() { goToDocument() {
getApp().track("learn_goToDocument", {})
this.$u.route({ this.$u.route({
url: 'pages/order/document', url: 'pages/order/document',
}) })
...@@ -826,6 +827,10 @@ export default { ...@@ -826,6 +827,10 @@ export default {
}, },
//跳转到播放 //跳转到播放
goPlay(info) { goPlay(info) {
getApp().track("learn_allPlayCounts", {courseId: info.id})
if(info.title === "小程序使用指南") {
getApp().track("learn_guidePlayCounts", {courseId: info.id})
}
uni.navigateTo({ uni.navigateTo({
url: url:
"/pages/learn/section?section_id=" + "/pages/learn/section?section_id=" +
...@@ -834,13 +839,14 @@ export default { ...@@ -834,13 +839,14 @@ export default {
info.id, info.id,
}); });
}, },
//跳转到 //跳转到消息详情页
bbb(e) { bbb(e) {
var news = { var news = {
body: e.body, body: e.body,
title: e.title, title: e.title,
create_at: e.create_at, create_at: e.create_at,
}; };
getApp().track("learn_goToMessage", {})
let that = this; let that = this;
wx.navigateTo({ wx.navigateTo({
url: "/pages/learn/news-details", url: "/pages/learn/news-details",
......
This diff is collapsed.
...@@ -77,6 +77,7 @@ export default { ...@@ -77,6 +77,7 @@ export default {
}); });
}, },
goBaidu(a) { goBaidu(a) {
getApp().track("mine_lookContract", {url: a})
getApp().globalData.contractUrl = a; getApp().globalData.contractUrl = a;
wx.navigateTo({ wx.navigateTo({
url: "./out", url: "./out",
......
This diff is collapsed.
...@@ -642,9 +642,11 @@ ...@@ -642,9 +642,11 @@
this.clickFeedback() this.clickFeedback()
break break
case 2: case 2:
getApp().track("order_errorSign", {orderId: this.orderId})
this.take() this.take()
break break
case 3: case 3:
getApp().track("order_scenePhotoClick", {orderId: this.orderId})
this.scenePhotoClick() this.scenePhotoClick()
break break
case 4: case 4:
...@@ -763,6 +765,10 @@ ...@@ -763,6 +765,10 @@
}, },
// 去业务材料页面 // 去业务材料页面
handleClickFile() { handleClickFile() {
getApp().track("order_click_view_files", {
brandId: this.order.lianbaoBrandId,
partnerCompanyId: this.order.partnerCompanyId
})
this.$u.route({url: 'pages/order/document' + '?partnerCompanyId=' + this.order.partnerCompanyId + '&brandId=' + this.order.lianbaoBrandId}) this.$u.route({url: 'pages/order/document' + '?partnerCompanyId=' + this.order.partnerCompanyId + '&brandId=' + this.order.lianbaoBrandId})
}, },
trackOrder() { trackOrder() {
...@@ -788,6 +794,10 @@ ...@@ -788,6 +794,10 @@
this.centerBtnDisabled = true this.centerBtnDisabled = true
}, },
clickFeedback(){ clickFeedback(){
getApp().track("order_clickFeedback", {
orderId: this.order.orderId,
categoryId: this.order.categoryId
})
// 过程反馈 // 过程反馈
uni.navigateTo({ uni.navigateTo({
url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.bottomButtonText != '预约' ? '1' : '0') url: 'pages/order/feedback?orderId='+this.order.orderId+'&categoryId='+this.order.categoryId+'&showGY=' + (this.bottomButtonText != '预约' ? '1' : '0')
......
This diff is collapsed.
...@@ -357,6 +357,10 @@ export default { ...@@ -357,6 +357,10 @@ export default {
} }
self.submiting = true; self.submiting = true;
getApp().track("order_feedback_submitForm", {
reasonType: self.trace.reasonType,
traceDate: self.traceDate
})
let params = this.$u.deepClone(self.trace); let params = this.$u.deepClone(self.trace);
if(self.trace.reasonType != '改约') { if(self.trace.reasonType != '改约') {
if(self.timeItem && self.timeItem.pkey && self.traceDate){ if(self.timeItem && self.timeItem.pkey && self.traceDate){
......
...@@ -85,7 +85,10 @@ ...@@ -85,7 +85,10 @@
searchOrder(index) { searchOrder(index) {
this.search.pageNumber = 1 this.search.pageNumber = 1
this.loadStaus = 'loading'; this.loadStaus = 'loading';
if(this.search.keyword) {
getApp().track('search_order', {keyword: this.search.keyword});
this.getOrderList() this.getOrderList()
}
}, },
// 页面数据 // 页面数据
getOrderList(event) { getOrderList(event) {
......
...@@ -224,6 +224,7 @@ export default { ...@@ -224,6 +224,7 @@ export default {
if(!this.validateForm()) { if(!this.validateForm()) {
return false return false
} }
getApp().track("parts_application_submitParts", {})
const address = this.addressInfo const address = this.addressInfo
let params = { let params = {
applyType: '1', applyType: '1',
......
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