Commit 35318a16 by 李伟康

commit v1.0.2

1 parent d1dd7eae
......@@ -71,12 +71,21 @@
@touchend="touchEnd"
></canvas>
<!-- <image :src="drawImage" class="under-image" mode="" v-if="isUnderBkg"></image> -->
<view
class="under-image"
v-if="isUnderBkg"
:style="{backgroundImage:`URL(${drawImage})`,aspectRatio:aspectRatio}"
>
</view>
<template v-if="aspectRatio">
<view
class="under-image"
:style="{backgroundImage:`URL(${drawImage})`,aspectRatio:aspectRatio}"
>
</view>
</template>
<template v-else>
<view class="skeleton-box"></view>
</template>
<!-- <image class="under-image" :src="drawImage"
mode="scaleToFill"
/> -->
</view>
<!-- <color
:colorShow="colorShow"
......@@ -193,7 +202,7 @@ export default {
],
toolsShow: true,
isLandScape: false, //是否横屏
aspectRatio: 1,//图片宽高比
aspectRatio: null,//图片宽高比
showPenBox: false
};
......@@ -211,16 +220,17 @@ export default {
type: String,
default: "1"
},
isUnderBkg: { //背景图片是否在画板下边,在下边则无法被擦除
type: Boolean,
default: false
},
drawStatus: Boolean,
canvasId: {
type: String,
default: 'drawCanvas'
}
},
computed: {
watchStatus () {
return this.$store.state.user.canvasStatus
},
},
mounted (opt) {
this.drawContext = uni.createCanvasContext(this.canvasId, this);
this.initBoard();
......@@ -228,7 +238,14 @@ export default {
watch: {
'drawImage' (n) {
if (n) this.initBoard()
}
},
watchStatus: {
immediate: true,
handler (newval) {
console.log(newval)
if(newval) this.clearBoard()
}
},
},
methods: {
colorShowHandel () {
......@@ -315,6 +332,7 @@ export default {
},
// 绘制线条结束
lineEnd () {
console.log(this.startX, this.startY)
this.drawContext.closePath();
this.begin = false;
},
......@@ -810,8 +828,9 @@ export default {
src: this.drawImage
}))[1] || {};
// console.log(imageInfoObj);
this.aspectRatio = imageInfoObj.width / imageInfoObj.height;
console.log(imageInfoObj);
if (this.isUnderBkg) {
this.bgColor = "rgba(0,0,0,0)"
} else {
......@@ -914,6 +933,7 @@ export default {
background-size: cover;
background-repeat: no-repeat;
z-index: -1;
will-change: transform;
}
/* 竖屏 */
......
......@@ -18,7 +18,8 @@
{
"path": "pages/home/home",
"style": {
"navigationStyle": "custom"
"navigationStyle": "custom",
"disableSwipeBack":true
}
},
{
......
......@@ -2,24 +2,29 @@
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
}
},
mounted () {
setTimeout(()=>{
uni.reLaunch({
url:'/pages/common/login'
})
},100)
},
methods: {
export default {
name: '',
data () {
return {
}
},
mounted () {
uni.showLoading()
let userInfo = uni.$storage.get('userInfo')
uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
if (res.code == 0 && userInfo) uni.reLaunch({
url: '/pages/home/home'
})
else uni.reLaunch({
url: '/pages/common/login'
})
})
},
methods: {
}
}
</script>
<style scoped lang='scss'>
</style>
\ No newline at end of file
......@@ -49,20 +49,13 @@ export default {
mixins: [loginMixin],
data () {
return {
mobile: '',
code: '',
mobile: '15816539334',
code: '1',
count: '',
};
},
onLoad (options) {
uni.showLoading()
let userInfo = uni.$storage.get('userInfo')
uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
if (res.code == 0 && userInfo) uni.reLaunch({
url: '/pages/home/home'
})
})
},
methods: {
/**获取验证码 */
......
......@@ -209,7 +209,10 @@ export default {
let { openSceneArr, selectIndex } = this,
{ merchantName: shopMerchantName, merchantId: shopMerchantId } = item,
userInfo = uni.$storage.get('userInfo')
if (!openSceneArr?.length && !userInfo?.isSuper) return wx.$util.showToast('暂无开通业务,请联系总部管理员')
if (!openSceneArr?.length && !userInfo?.isSuper) return uni.showToast({
title:'暂无开通业务,请联系总部管理员',
icon:'none'
})
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName,
......@@ -234,7 +237,10 @@ export default {
url: '/pages/home/home'
})
} else { // 搜客户
if (!openSceneArr.includes(0)) return wx.$util.showToast('暂未开通精品升级场景')
if (!openSceneArr.includes(0)) return uni.showToast({
title:'暂未开通精品升级场景',
icon:'none'
})
// 进入精品升级场景 工单/预约详情
}
......
......@@ -34,7 +34,7 @@
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:canvasId="`c-1-${index}`"
:drawStatus="penSwitch"
></wnCanvas>
......
......@@ -9,6 +9,7 @@
<tabs
:list="views"
@tabclick="changeView"
ref="tabs"
/>
</template>
<view class="canvas-box">
......@@ -21,7 +22,7 @@
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-2-${index}`"
></wnCanvas>
......
......@@ -13,7 +13,7 @@
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-3-${index}`"
></wnCanvas>
......
......@@ -9,6 +9,8 @@
<tabs
:list="views"
@tabclick="changeView"
ref="tabs"
/>
</template>
<view class="canvas-box">
......@@ -21,7 +23,7 @@
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-4-${index}`"
></wnCanvas>
......
......@@ -13,7 +13,7 @@
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-5-${index}`"
></wnCanvas>
......
......@@ -22,19 +22,26 @@ export default {
name: 'Tabs',
props: {
list: Array,
show: {
type: Boolean,
default: true
}
},
data () {
return {
tabIndex: 0,
borderLeft: 'display: none;',
borderLeft: 'display:none;',
}
},
mounted () {
setTimeout(() => {
this.setBorderLeft()
}, 300)
this.init()
},
methods: {
init () {
setTimeout(() => {
this.setBorderLeft()
}, 300)
},
tabClick (index) {
this.tabIndex = index
this.$emit('tabclick', index)
......@@ -46,6 +53,7 @@ export default {
query
.select(`#tab-${tabIndex}`)
.boundingClientRect((data) => {
console.log(data)
this.borderLeft = `left:${data.left}px;`
setTimeout(() => {
this.borderLeft += `display:block;`
......@@ -70,13 +78,14 @@ export default {
width: 384rpx;
height: 80rpx;
background: #ffffff;
// border: 2rpx solid #dce0e6;
border: 2rpx solid #fff;
font-size: 32rpx;
color: #292d33;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.15s;
}
.active {
// border: 4rpx solid #292d33;
......@@ -95,4 +104,12 @@ export default {
z-index: 3;
}
}
.skeleton-box{
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: #000;
}
</style>
\ No newline at end of file
......@@ -21,8 +21,21 @@
></uni-icons>
</view>
</view>
<view :class="['view', { showView: id == 1 }]">
<template v-for="index in 6">
<view
:class="['view', { showView: id == index }]"
:key="index"
>
<component
:is="'media_' + index"
:views="media[index]"
:penSwitch="penSwitch"
:show="id == 6"
:ref="'media'+index"
/>
</view>
</template>
<!-- <view :class="['view', { showView: id == 1 }]">
<media_1
:views="media[1]"
:penSwitch="penSwitch"
......@@ -58,7 +71,7 @@
ref="history"
:show="id == 6"
/>
</view>
</view> -->
<pay-pop ref="pay"></pay-pop>
<template v-if="type != 'preview'">
<tool-box
......@@ -73,22 +86,14 @@
<view :class="['sprite-icon', `${!drawStatus ? 'icon-pen' : 'icon-pen-active'}`]"> </view>
</view>
</template>
<MessageBox
:popupW="704"
ref="finish"
@cancel="$refs.finish.close()"
@confirm="done"
content="是否返回首页并结束本次接待"
confirmBtnText="确认"
></MessageBox>
<MessageBox
<!-- <MessageBox
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
></MessageBox> -->
<MessageBox
ref="payRef"
@cancel="done"
......@@ -97,6 +102,7 @@
content="若客户成交,请点击付款方式协助客户完成后续流程。"
confirmBtnText="选择付款方式"
cancelBtnText="完成接待"
></MessageBox>
</view>
</template>
......@@ -123,10 +129,16 @@ export default {
Media_6,
},
mixins: [myClick],
props: {
id: [String, Number],
media: Object,
type: {
type: String,
default: 'preview'
}
},
data () {
return {
type: "preview",
id: "",
media: {
1: [],
2: [],
......@@ -143,24 +155,26 @@ export default {
return this.type != 'preview' && this.drawStatus
}
},
onLoad (options) {
console.log(options);
this.type = options.type;
this.id = options.id;
this.getFindSoureDetail(options.id);
},
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
if (this.type != "preview") this.$refs.finish.open();
return true;
}
// 其他情况允许正常返回
return false;
},
// onLoad (options) {
// console.log(options);
// this.type = options.type;
// this.id = options.id;
// if (options.type != 'preview') this.media = uni.$storage.get('mediaList')
// else this.getFindSoureDetail(options.id);
// },
// onBackPress (options) {
// if (options.from === "backbutton") {
// // 物理返回按钮触发
// // 阻止默认行为,即不执行页面返回
// if (this.type != "preview") this.$refs.finish.open();
// return true;
// }
// // 其他情况允许正常返回
// return false;
// },
async onReachBottom () {
this.$refs.history.getQuotationList();
if (this.id == 6) this.$refs.media6[0].getQuotationList();
},
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
......@@ -169,9 +183,13 @@ export default {
},
/**切换素材 */
choose (e) {
if(this.id == 1) this.$refs.media1.closeAllPopup()
if (this.id == 1) this.$refs.media1[0].closeAllPopup()
this.id = e.id;
this.getFindSoureDetail(e.id);
if (e.id == 2 || e.id == 4) {
console.log(this.$refs[`media${e.id}`][0].$refs)
this.$refs[`media${e.id}`][0].$refs.tabs.init()
}
// this.getFindSoureDetail(e.id);
},
async getFindSoureDetail (id) {
try {
......@@ -187,21 +205,16 @@ export default {
console.log(error);
}
},
// 完成接待
done () {
this.stopAudio();
uni.navigateBack();
this.setReceptionStatus(0);
},
// 选择付款方式
toPay () {
this.$refs.pay.show();
},
back () {
if (this.type != "preview") return this.$refs.finish.open();
this.$store.dispatch("clearCustomerInfo");
uni.navigateBack();
this.$emit('back')
},
done () {
this.$emit('done')
}
},
};
</script>
......@@ -225,18 +238,21 @@ export default {
}
}
.view {
position: absolute;
position: fixed;
width: 100%;
height: 100%;
z-index: -1;
left: 0;
top: 0;
display: none;
left: 0;
visibility: hidden;
// display: none;
}
.showView {
position: absolute;
z-index: 1;
display: block;
animation: show-content-left 0.15s;
visibility: visible;
// display: block;
animation: show-content-left 0.15s forwards;
}
.pen-box {
position: fixed;
......@@ -255,12 +271,10 @@ export default {
}
@keyframes show-content-left {
0% {
transform: translateX(1000%);
box-shadow: 0 8rpx 22rpx 0 #00000029;
left: 100%;
}
100% {
transform: translateX(0);
box-shadow: 0 8rpx 22rpx 0 #00000029;
left: 0;
}
}
</style>
......@@ -6,107 +6,157 @@
* @LastEditTime: 2024-04-11 14:26:25
-->
<template>
<view class="container" @click="handleTouchStart()">
<view class="left-side">
<!-- 左侧内容 -->
<view class="user-info">
<view class="user-avatar sprite-icon icon-icon-avatar"></view>
<view
class="container"
@click="handleTouchStart()"
>
<view :class="['home',{show:!id}]">
<view class="left-side">
<!-- 左侧内容 -->
<view class="user-info">
<view class="user-avatar sprite-icon icon-icon-avatar"></view>
<view class="user-name">{{ userInfo.name }}</view>
<view class="user-position">延保专员</view>
</view>
<view class="left-footer">
<view class="logout" @click="logout">
<view class="icon-logout sprite-icon icon-icon-logout"></view>
<view>退出</view>
<view class="user-name">{{ userInfo.name }}</view>
<view class="user-position">延保专员</view>
</view>
<view class="store-addr">
<view class="icon-addr sprite-icon icon-icon-addr"></view>
<view class="left-footer">
<view
class="logout"
@click="logout"
>
<view class="icon-logout sprite-icon icon-icon-logout"></view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
</view>
</view>
<view class="right-side">
<!-- 右侧内容 -->
<view class="home-title">客户接待</view>
<view class="start" @click="start">
<view class="icon-start sprite-icon icon-icon-handshake"></view>
<view>退出</view>
</view>
<view class="store-addr">
<view class="icon-addr sprite-icon icon-icon-addr"></view>
<view class="start-text">开始接待</view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
</view>
</view>
<!-- 各模块入口list -->
<view class="module-list">
<view class="right-side">
<!-- 右侧内容 -->
<view class="home-title">客户接待</view>
<view
class="module-item"
v-for="item in moduleList"
:key="item.id"
@click="toDetail(item)"
class="start"
@click="start"
>
<image class="module-img" :src="item.thumbnail" mode="scaleToFill" />
<view class="module-name">{{ item.title }}</view>
<view class="icon-start sprite-icon icon-icon-handshake"></view>
<view class="start-text">开始接待</view>
</view>
<!-- 各模块入口list -->
<view class="module-list">
<view
class="module-item"
v-for="item in moduleList"
:key="item.id"
@click="toDetail(item)"
>
<image
class="module-img"
:src="item.thumbnail"
mode="scaleToFill"
/>
<view class="module-name">{{ item.title }}</view>
</view>
</view>
<!-- 未点击开始接待,弹窗 -->
<MessageBox
ref="previewRef"
@cancel="cancel"
@confirm="preview"
:popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」"
confirmBtnText="预览素材"
></MessageBox>
<MessageBox
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
</view>
<!-- 未点击开始接待,弹窗 -->
<MessageBox
ref="previewRef"
@cancel="cancel"
@confirm="preview"
:popupW="704"
content="直接点击素材可进行预览,若面向车主展示,请点击「开始接待」"
confirmBtnText="预览素材"
></MessageBox>
<MessageBox
ref="tipBox"
@cancel="tipCancel"
@confirm="tipConfirm"
content="系统检测到您在当前页面停留较久,是否仍在客户接待中?"
cancelBtnText="否"
confirmBtnText="是"
></MessageBox>
</view>
<view :class="['detail',{show:id}]">
<detail
:id.sync="id"
:media="mediaList"
:type.sync="type"
@back="back"
@done="done"
/>
</view>
<MessageBox
:popupW="704"
ref="finish"
@cancel="$refs.finish.close()"
@confirm="done"
content="是否返回首页并结束本次接待"
confirmBtnText="确认"
></MessageBox>
</view>
</template>
<script>
import myClick from "@/mixin/click";
import detail from '../detail/detail'
import { mapMutations } from "vuex";
export default {
mixins: [myClick],
data() {
components: { detail },
data () {
return {
moduleList: [
// {
// id: 1,
// sort: 1,
// thumbnail:
// "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png",
// title: "问界三包政策",
// type: 1,
// },
],
moduleList: [],
userInfo: {},
id: "",
mediaList: {},
type: '',
chooseItem: {}
};
},
mounted() {
mounted () {
this.userInfo = uni.$storage.get("userInfo");
},
onShow() {
onBackPress (options) {
if (options.from === "backbutton") {
// 物理返回按钮触发
// 阻止默认行为,即不执行页面返回
this.back()
return true;
}
// 其他情况允许正常返回
return false;
},
onShow () {
this.getSoure();
},
methods: {
...mapMutations("audio", ["setReceptionStatus"]),
// 查询素材
async getSoure() {
this.moduleList = await uni.$api.commonApi.findSoureList();
async getSoure () {
const moduleList = await uni.$api.commonApi.findSoureList();
this.moduleList = moduleList
let mediaList = {}
moduleList.map(async e => {
if (e.id != 6) {
const list = await uni.$api.commonApi.getFindSoureDetail({ id: e.id })
mediaList[e.id] = list
uni.$storage.set('mediaList', mediaList)
this.mediaList = mediaList
}
})
},
start() {
start () {
this.startAudio();
uni.navigateTo({
url: `../detail/detail?id=${this.moduleList[0].id}&type=edit`,
});
this.id = this.moduleList[0].id
this.type = 'edit'
},
// 退出
logout() {
logout () {
uni.$storage.rm("userInfo");
uni.$storage.rm("sessionId");
this.stopAudio();
......@@ -114,33 +164,70 @@ export default {
url: "/pages/common/login",
});
},
toDetail(item) {
if (this.isStart) {
uni.navigateTo({
url: `../detail/detail?id=${item.id}&type=edit`,
});
} else {
this.id = item.id;
this.$refs.previewRef.open();
}
toDetail (item) {
this.chooseItem = item
this.$refs.previewRef.open();
},
cancel() {
cancel () {
this.$refs.previewRef.close();
},
preview() {
let { id } = this;
uni.navigateTo({
url: `../detail/detail?type=preview&id=${id}`,
});
preview () {
let { id } = this.chooseItem;
this.type = 'preview'
this.id = id
this.$refs.previewRef.close();
},
// 完成接待
done () {
// this.stopAudio();
// uni.navigateBack();
this.id = ''
this.type = ''
this.$store.dispatch("clearCanvas",true);
// this.setReceptionStatus(0);
},
back () {
if (!this.id) return uni.navigateBack()
if (this.type != "preview") return this.$refs.finish.open();
this.$store.dispatch("clearCustomerInfo");
this.id = ''
this.type = ''
},
},
};
</script>
<style scoped lang="scss">
.container {
display: flex;
height: 100vh;
position: relative;
.home,
.detail {
position: fixed;
width: 100%;
height: 100%;
z-index: -1;
top: 0;
left: 0;
visibility: hidden;
}
.home {
display: flex;
height: 100vh;
}
.show {
position: absolute;
z-index: 1;
visibility: visible;
// display: block;
animation: show-content-left 0.15s forwards;
}
}
@keyframes show-content-left {
0% {
left: 100%;
}
100% {
left: 0;
}
}
.left-side {
display: flex;
......
......@@ -17,6 +17,8 @@ export default {
salesUuid: "",
staffName: "",
},
canvasStatus:false
};
},
mutations: {
......@@ -47,5 +49,8 @@ export default {
clearCustomerInfo({ commit }) {
commit("clearCustomerInfo");
},
clearCanvas({state}, value = false){
state.canvasStatus = value
}
},
};
......@@ -11,7 +11,8 @@ export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY,
mock_data: "mock_data",
storageFile: "storageFile",
userInfo: 'userInfo'
userInfo: 'userInfo',
mediaList: 'mediaList'
};
// export const IMG_VERSION = async () => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!