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