Commit 6f00cff2 authored by 刘文虎's avatar 刘文虎
parents c2d42b79 f867451d
Pipeline #2909 canceled with stages
...@@ -14,7 +14,7 @@ export async function getCollectionCode(data) { ...@@ -14,7 +14,7 @@ export async function getCollectionCode(data) {
export async function setCollectionCode(data) { export async function setCollectionCode(data) {
return request({ return request({
url: `/rest/collectionCode`, url: `/rest/collectionCode`,
method: 'POSt', method: 'POST',
data, data,
noLoading: true noLoading: true
}) })
...@@ -28,4 +28,34 @@ export async function getBusinessCard(data) { ...@@ -28,4 +28,34 @@ export async function getBusinessCard(data) {
data, data,
noLoading: true noLoading: true
}) })
}
// 查询名片操作履历
export async function getBusinessCardRecord(data) {
return request({
url: `/rest/businessCard/viewRecord`,
method: 'GET',
data,
noLoading: true
})
}
// 名片操作统计
export async function operateStatistics(data) {
return request({
url: `/rest/businessCard/operateStatistics`,
method: 'GET',
data,
noLoading: true
})
}
// 新增更新名片
export async function editBusinessCard(data) {
return request({
url: `/rest/businessCard`,
method: 'POST',
data,
noLoading: true
})
} }
\ No newline at end of file
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
</view> </view>
<view class="content-view"> <view class="content-view">
<view class="top-view"> <view class="top-view">
<view class="title-view">{{ info.title }}</view> <view class="title-view">{{ info. frontTitle }}</view>
</view> </view>
<view class="name-view">{{ info.name }}</view> <view class="name-view">{{ info.name }}</view>
<view class="info-view"> <view class="info-view">
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<template v-else-if="isBlue"> <template v-else-if="isBlue">
<view class="content-view"> <view class="content-view">
<view class="top-view top-blue"> <view class="top-view top-blue">
<view class="title-view title-blue">{{ info.title }}</view> <view class="title-view title-blue">{{ info. frontTitle }}</view>
<view <view
class="right-view" class="right-view"
hover-class="u-hover-class" hover-class="u-hover-class"
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</view> </view>
</view> </view>
<view class="bottom-view"> <view class="bottom-view">
<view class="title-view">{{ info.title }}</view> <view class="title-view">{{ info. frontTitle }}</view>
</view> </view>
</template> </template>
</view> </view>
...@@ -110,17 +110,17 @@ export default { ...@@ -110,17 +110,17 @@ export default {
return this.baseUrl + 'muban1zhengmian@3x.png' return this.baseUrl + 'muban1zhengmian@3x.png'
}, },
isGreen() { isGreen() {
return this.info.type == 'green' return this.info. coverUrl == 'green'
}, },
isBlue() { isBlue() {
return this.info.type == 'blue' return this.info. coverUrl == 'blue'
}, },
isBlack() { isBlack() {
return this.info.type == 'black' return this.info. coverUrl == 'black'
}, },
// green 绿;blue 蓝;black 黑; // green 绿;blue 蓝;black 黑;
settings() { settings() {
switch (this.info.type) { switch (this.info. coverUrl) {
case 'green': case 'green':
return { return {
color: '#02A074', color: '#02A074',
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
:clearable="false" :clearable="false"
:custom-style="customStyle" :custom-style="customStyle"
:placeholder-style="placeholderStyle" :placeholder-style="placeholderStyle"
v-model="form.phone" v-model="form.address"
placeholder="填写地址" placeholder="填写地址"
/> />
</u-form-item> </u-form-item>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
:clearable="false" :clearable="false"
:custom-style="customStyle" :custom-style="customStyle"
:placeholder-style="placeholderStyle" :placeholder-style="placeholderStyle"
v-model="form.title" v-model="form.frontTitle"
@input="handleInput" @input="handleInput"
placeholder="填写正面标题,不超过12个字" placeholder="填写正面标题,不超过12个字"
/> />
...@@ -61,13 +61,16 @@ ...@@ -61,13 +61,16 @@
<view <view
:class=" :class="
'image-view ' + 'image-view ' +
(form.currentIndex == index ? 'is-select' : '') (form.coverUrl == types[index] ? 'is-select' : '')
" "
@click="handleClickSelect(index)" @click="handleClickSelect(index)"
> >
<image :src="item[0]"></image> <image :src="item[0]"></image>
</view> </view>
<view class="top-image-view" v-if="form.currentIndex == index"> <view
class="top-image-view"
v-if="form.coverUrl == types[index]"
>
<image :src="yixuanzemubanImage"></image> <image :src="yixuanzemubanImage"></image>
</view> </view>
<view <view
...@@ -90,7 +93,7 @@ ...@@ -90,7 +93,7 @@
:clearable="false" :clearable="false"
:custom-style="customStyle" :custom-style="customStyle"
:placeholder-style="placeholderStyle" :placeholder-style="placeholderStyle"
v-model="form.phone" v-model="form.backTitle"
placeholder="填写正面标题,不超过12个字" placeholder="填写正面标题,不超过12个字"
/> />
</u-form-item> </u-form-item>
...@@ -104,7 +107,7 @@ ...@@ -104,7 +107,7 @@
:clearable="false" :clearable="false"
:custom-style="customAreaStyle" :custom-style="customAreaStyle"
:placeholder-style="placeholderStyle" :placeholder-style="placeholderStyle"
v-model="form.phone" v-model="form.backContext"
placeholder="填写服务内容 举例:家电维修安装、清洗服" placeholder="填写服务内容 举例:家电维修安装、清洗服"
/> />
</view> </view>
...@@ -117,35 +120,41 @@ ...@@ -117,35 +120,41 @@
:custom-style="customConFirm" :custom-style="customConFirm"
@click="handleClickSure" @click="handleClickSure"
:disabled="!canConfirm" :disabled="!canConfirm"
:loading="buttonLoading"
> >
<view class="confirm-view">确定</view> <view class="confirm-view">确定</view>
</u-button> </u-button>
</view> </view>
<PopImage :visible.sync="visible" :images="currentImages"/> <PopImage :visible.sync="visible" :images="currentImages" />
</view> </view>
</template> </template>
<script> <script>
import NavbarRight from '@/components/navbar-right' import NavbarRight from '@/components/navbar-right'
import PopImage from '@/components/pop-image' import PopImage from '@/components/pop-image'
import { editbusinessCard } from '@/api/card/index.js'
export default { export default {
components: { components: {
NavbarRight, NavbarRight,
PopImage PopImage,
}, },
data() { data() {
return { return {
loading: false, loading: false,
info: {}, cardId: '',
form: { form: {
date: '', address: '',
time: '', backContext: '',
currentIndex: 0, backTitle: '',
coverUrl: 'green',
frontTitle: '',
name: '',
phone: '',
}, },
maxlength: 12, maxlength: 12,
visible: false, visible: false,
currentImages: [] currentImages: [],
} }
}, },
computed: { computed: {
...@@ -155,11 +164,14 @@ export default { ...@@ -155,11 +164,14 @@ export default {
yixuanzemubanImage() { yixuanzemubanImage() {
return this.baseUrl + 'yixuanzemuban@3x.png' return this.baseUrl + 'yixuanzemuban@3x.png'
}, },
types() {
return ['green', 'blue', 'black']
},
templates() { templates() {
return [ return [
[this.baseUrl + '1zhengmian@3x.png',this.baseUrl + '1fanmian@3x.png'], [this.baseUrl + '1zhengmian@3x.png', this.baseUrl + '1fanmian@3x.png'],
[this.baseUrl + '2zhengmian@3x.png',this.baseUrl + '2fanmian@3x.png'], [this.baseUrl + '2zhengmian@3x.png', this.baseUrl + '2fanmian@3x.png'],
[this.baseUrl + '3zhengmian@3x.png',this.baseUrl + '3fanmian@3x.png'], [this.baseUrl + '3zhengmian@3x.png', this.baseUrl + '3fanmian@3x.png'],
] ]
}, },
dianjiyulanImage() { dianjiyulanImage() {
...@@ -191,35 +203,42 @@ export default { ...@@ -191,35 +203,42 @@ export default {
{ {
required: true, required: true,
message: '请填写姓名', message: '请填写姓名',
trigger: ['change', 'blur'], // trigger: ['change', 'blur'],
}, },
], ],
phone: [ phone: [
{ {
required: true, required: true,
message: '请填写电话', message: '请填写电话',
trigger: ['change', 'blur'], // trigger: ['change', 'blur'],
}, },
], ],
address: [ address: [
{ {
required: true, required: true,
message: '请填写地址', message: '请填写地址',
trigger: ['change', 'blur'], // trigger: ['change', 'blur'],
}, },
], ],
title: [ frontTitle: [
{ {
required: true, required: true,
message: '请填写正面标题', message: '请填写正面标题',
trigger: ['change', 'blur'], // trigger: ['change', 'blur'],
}, },
], ],
backTitle: [ backTitle: [
{ {
required: true, required: true,
message: '填写背面标题', message: '填写背面标题',
trigger: ['change', 'blur'], // trigger: ['change', 'blur'],
},
],
backContext: [
{
required: true,
message: '填写背面标题',
// trigger: ['change', 'blur'],
}, },
], ],
} }
...@@ -233,18 +252,20 @@ export default { ...@@ -233,18 +252,20 @@ export default {
} }
}, },
canConfirm() { canConfirm() {
console.log( for (var item in this.form) {
'---------canConfirm------------', console.log('------canConfirm------', item)
this.form.name && this.form.a if (!this.form[item]) {
) return false
return this.form.name && this.form.a }
}
return true
}, },
}, },
onLoad(options) { onLoad(options) {
if (options && options.billId) { if (options && options.cardId) {
this.billId = options.billId this.cardId = options.cardId
this.loading = true this.loading = true
this.init() this.getBusinessCard()
} }
}, },
onReady() { onReady() {
...@@ -253,40 +274,57 @@ export default { ...@@ -253,40 +274,57 @@ export default {
onUnload() {}, onUnload() {},
onShow() {}, onShow() {},
methods: { methods: {
init() { getBusinessCard() {
this.loading = false this.loading = true
this.form = {} getBusinessCard()
.then((res) => {
var data = res.data
if (data) {
this.form = {
id: res.id,
address: res.data,
backContext: res.backContext,
backTitle: res.backTitle,
coverUrl: res.coverUrl,
frontTitle: res.frontTitle,
name: res.name,
phone: res.phone,
}
}
this.loading = false
})
.catch((res) => {
this.loading = false
})
},
editbusinessCard() {
this.buttonLoading = true
editbusinessCard(this.form)
.then((res) => {
if (res.data) {
this.buttonLoading = false
uni.$emit('card-refresh')
this.$u.route({
type: 'back',
})
}
})
.catch((res) => {
this.loading = false
})
}, },
previewTemplate(index) { previewTemplate(index) {
this.visible = true
this.currentImages = this.templates[index] this.currentImages = this.templates[index]
this.visible = true
// uni.previewImage({
// urls: this.templates,
// current: index,
// longPressActions: {
// success: function (data) {
// console.log(
// '选中了第' +
// (data.tapIndex + 1) +
// '个按钮,第' +
// (data.index + 1) +
// '张图片'
// )
// },
// fail: function (err) {
// console.log(err.errMsg)
// },
// },
// })
}, },
handleClickSelect(index) { handleClickSelect(index) {
this.form.currentIndex = index this.form.coverUrl = this.types[index]
}, },
handleClickSure() { handleClickSure() {
this.$refs.uForm.validate((valid) => { this.$refs.uForm.validate((valid) => {
if (valid) { if (valid) {
console.log('验证通过') console.log('验证通过')
this.editbusinessCard()
} else { } else {
console.log('验证失败') console.log('验证失败')
} }
...@@ -296,7 +334,7 @@ export default { ...@@ -296,7 +334,7 @@ export default {
// 直接给input设maxlength输入拼音的时候有影响 // 直接给input设maxlength输入拼音的时候有影响
if (event.length > this.maxlength) { if (event.length > this.maxlength) {
this.$nextTick(() => { this.$nextTick(() => {
this.form.title = event.substring(0, this.maxlength) this.form.frontTitle = event.substring(0, this.maxlength)
}) })
} }
}, },
......
This diff is collapsed.
...@@ -186,7 +186,6 @@ export default { ...@@ -186,7 +186,6 @@ export default {
receivableAmount: '', receivableAmount: '',
actualAmount: '', actualAmount: '',
repairTime: '', repairTime: '',
partTime: '',
address: '', address: '',
latitude: '', latitude: '',
longitude: '', longitude: '',
...@@ -343,7 +342,6 @@ export default { ...@@ -343,7 +342,6 @@ export default {
receivableAmount: data.receivableAmount, receivableAmount: data.receivableAmount,
actualAmount: data.actualAmount, actualAmount: data.actualAmount,
repairTime: data.repairTime, repairTime: data.repairTime,
partTime: data.partTime,
address: data.address, address: data.address,
latitude: data.latitude, latitude: data.latitude,
longitude: data.longitude, longitude: data.longitude,
...@@ -403,6 +401,8 @@ export default { ...@@ -403,6 +401,8 @@ export default {
if (res.code == 0) { if (res.code == 0) {
if (this.billId) { if (this.billId) {
uni.$emit('maintain-bill-detail') uni.$emit('maintain-bill-detail')
} else {
uni.$emit('maintain-bill-list')
} }
this.billId = res.data this.billId = res.data
this.toParticulars() this.toParticulars()
......
...@@ -440,8 +440,7 @@ export default { ...@@ -440,8 +440,7 @@ export default {
}) })
.then((res) => { .then((res) => {
if (res.code == 0) { if (res.code == 0) {
uni.$off('maintain-bill-detail') uni.$emit('maintain-bill-list')
uni.$emit('maintain-bill-detail')
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '删除成功', title: '删除成功',
type: 'success', type: 'success',
......
...@@ -173,14 +173,14 @@ export default { ...@@ -173,14 +173,14 @@ export default {
}, },
}, },
onLoad() { onLoad() {
uni.$on('maintain-bill-detail', (res) => { uni.$on('maintain-bill-list', (res) => {
this.reloadList() this.reloadList()
}) })
this._freshing = false this._freshing = false
this.reloadList() this.reloadList()
}, },
onUnload() { onUnload() {
uni.$off('maintain-bill-detail') uni.$off('maintain-bill-list')
}, },
onShow() {}, onShow() {},
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