Commit 7d4d90fb by 前端

Merge branch 'v1.0.1' of http://192.168.3.233:8090/glsx/gl_tape into v1.0.1

2 parents 15ead3de 79001e16
......@@ -11,17 +11,25 @@ module.exports = {
// 查询接待素材
findSoureList() {
return http.post({
<<<<<<< HEAD
method: "dj.api.smartcarlife.recepiton.soure.findSoureList",
sessionId: "b5e0a471-a2cd-4020-a522-72bcd68d6da7",
=======
method: 'dj.api.smartcarlife.recepiton.soure.findSoureList',
>>>>>>> 79001e1604b966c94fa05e300a023cc7b6fc1f1a
projectName: "boutique",
});
},
// 查询门店支付配置
findPayInfo(data) {
return http.post({
<<<<<<< HEAD
method:
"dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId",
sessionId: "b5e0a471-a2cd-4020-a522-72bcd68d6da7",
=======
method: 'dj.api.smartcarlife.recepiton.pay.findPayInfoConfigListByMerchantId',
>>>>>>> 79001e1604b966c94fa05e300a023cc7b6fc1f1a
projectName: "boutique",
...data,
});
......
......@@ -27,4 +27,22 @@ module.exports = {
...data,
})
},
/**获取帐号列表 */
getListSelectAccount (data = {}) {
data.projectName = 'boutique'
return http.fetch('dj.api.smartcarlife.workWechat.listSelectAccount', data)
},
/**选择帐号登陆 */
selectAccountLogin (data) {
data.projectName = 'boutique'
return http.fetch('dj.api.smartcarlife.workWechat.selectAccountLogin', data)
},
// 获取园区店开通的场景入口
getYqMerchantSceneConfigAPI(data) {
data.projectName = 'boutique'
return http.post({
method: 'dj.api.smartcarlife.select.openScene.info',
...data,
})
},
}
\ No newline at end of file
<template>
<view class="color" :class="{'color-show': colorShow}">
<view class="color-section">
<view @click="colorPickAction(item)" :style="{backgroundColor: item.color}" v-for="(item, index) in colorArr" :key="index" class="color-item">
<text class="color-title">{{item.index}}</text>
</view>
</view>
</view>
</template>
<script>
export default {
props: {
colorShow: {
type: Boolean,
default () {
return false;
}
}
},
data () {
return {
colorArr: [
{
color: '#7f2a3f',
index: '01'
}, {
color: '#e24187',
index: '03'
}, {
color: '#f5305d',
index: '04'
}, {
color: '#de4156',
index: '05'
}, {
color: '#fe42cd',
index: '06'
}, {
color: '#f48b9a',
index: '07'
}, {
color: '#ec8191',
index: '08'
}, {
color: '#f9aeb5',
index: '09'
}, {
color: '#f21d5f',
index: '10'
}, {
color: '#cc3739',
index: '11'
}, {
color: '#dd5047',
index: '12'
}, {
color: '#e24187',
index: '13'
}, {
color: '#fa6449',
index: '14'
}, {
color: '#e8495b',
index: '15'
}, {
color: '#fb7162',
index: '16'
}, {
color: '#f6afd1',
index: '17'
}, {
color: '#fbb6b9',
index: '18'
}, {
color: '#db6f27',
index: '21'
}, {
color: '#ed702e',
index: '22'
}, {
color: '#f99627',
index: '23'
}, {
color: '#eb8926',
index: '24'
}, {
color: '#edc3aa',
index: '25'
}, {
color: '#e1d8cf',
index: '26'
}, {
color: '#deebc5',
index: '27'
}, {
color: '#fccdc7',
index: '28'
}, {
color: '#dbbdd2',
index: '29'
}, {
color: '#e8a321',
index: '31'
}, {
color: '#db6f27',
index: '32'
}, {
color: '#edb74b',
index: '33'
}, {
color: '#e8b741',
index: '34'
}, {
color: '#fef052',
index: '35'
}, {
color: '#ffd684',
index: '36'
}, {
color: '#e2d958',
index: '37'
}, {
color: '#e2e5d0',
index: '38'
}, {
color: '#ba9431',
index: '41'
}, {
color: '#797f5d',
index: '42'
}, {
color: '#536d50',
index: '43'
}, {
color: '#d8b53f',
index: '44'
}, {
color: '#d4c172',
index: '45'
}, {
color: '#32b75c',
index: '46'
}, {
color: '#90D15B',
index: '47'
}, {
color: '#c5d52a',
index: '48'
}, {
color: '#e8e098',
index: '49'
}, {
color: '#1b6661',
index: '50'
}, {
color: '#3b4f4d',
index: '51'
}, {
color: '#336559',
index: '52'
}, {
color: '#01776e',
index: '53'
}, {
color: '#2e7662',
index: '54'
}, {
color: '#439877',
index: '55'
}, {
color: '#0ba066',
index: '56'
}, {
color: '#318488',
index: '57'
}, {
color: '#6fd3c9',
index: '58'
}, {
color: '#b9d3ac',
index: '59'
}, {
color: '#0e898e',
index: '61'
}, {
color: '#317194',
index: '62'
}, {
color: '#029bc7',
index: '63'
}, {
color: '#2a8ec9',
index: '64'
}, {
color: '#57c9d3',
index: '65'
}, {
color: '#65b3df',
index: '67'
}, {
color: '#8bd0d7',
index: '68'
}, {
color: '#4B4881',
index: '69'
}, {
color: '#77A1CB',
index: '70'
}, {
color: '#3051BB',
index: '71'
}, {
color: '#2E41A7',
index: '72'
}, {
color: '#704CAE',
index: '73'
}, {
color: '#385BD1',
index: '74'
}, {
color: '#E0DFED',
index: '75'
}, {
color: '#A6BDE9',
index: '76'
}, {
color: '#B3B9DD',
index: '77'
}, {
color: '#7942A8',
index: '81'
}, {
color: '#8F52BA',
index: '82'
}, {
color: '#9680C0',
index: '83'
}, {
color: '#CD82BB',
index: '84'
}, {
color: '#8E2A80',
index: '85'
}, {
color: '#E24CB0',
index: '86'
}, {
color: '#CC2A75',
index: '87'
}, {
color: '#ED89D2',
index: '88'
}, {
color: '#F562B6',
index: '89'
}, {
color: '#8B3B32',
index: '91'
}, {
color: '#593A35',
index: '92'
}, {
color: '#7A3C2D',
index: '93'
}, {
color: '#7D2E21',
index: '94'
}, {
color: '#935A47',
index: '95'
}, {
color: '#A05047',
index: '96'
}, {
color: '#E39476',
index: '97'
}, {
color: '#4E3F3C',
index: '98'
}, {
color: '#5A4939',
index: '99'
}, {
color: '#EDE8EC',
index: '100'
}, {
color: '#C0813A',
index: '101'
}, {
color: '#77432E',
index: '102'
}, {
color: '#C17748',
index: '103'
}, {
color: '#C7AC39',
index: '104'
}, {
color: '#DBA179',
index: '107'
}, {
color: '#D8D3D0',
index: '109'
}, {
color: '#091A22',
index: '120'
}, {
color: '#CA3A32',
index: '121'
}, {
color: '#FAAB60',
index: '122'
}, {
color: '#CADEAD',
index: '123'
}, {
color: '#C7D858',
index: '124'
}, {
color: '#F264D0',
index: '125'
}, {
color: '#F77ADC',
index: '126'
}, {
color: '#FAE7D9',
index: '131'
}, {
color: '#E6D9D1',
index: '132'
}, {
color: '#EBCDB1',
index: '133'
}, {
color: '#E2DCCC',
index: '134'
}, {
color: '#FAD9D2',
index: '135'
}, {
color: '#E1C2BD',
index: '136'
}, {
color: '#E5BBCF',
index: '137'
}, {
color: '#F7BACC',
index: '138'
}, {
color: '#E9CBC1',
index: '139'
}, {
color: '#EBB89F',
index: '140'
}, {
color: '#E6D09E',
index: '141'
}, {
color: '#E2B78D',
index: '142'
}, {
color: '#D1E4EB',
index: '143'
}, {
color: '#B9D9EE',
index: '144'
}, {
color: '#CFD0E2',
index: '145'
}, {
color: '#CECFF0',
index: '146'
}, {
color: '#D6C3E3',
index: '147'
}, {
color: '#E3F0C5',
index: '163'
}, {
color: '#DAD792',
index: '164'
}, {
color: '#D4D4BC',
index: '166'
}, {
color: '#C0D0AB',
index: '167'
}, {
color: '#D7C6A8',
index: '169'
}, {
color: '#D9E9E8',
index: '171'
}, {
color: '#B4E0C7',
index: '172'
}, {
color: '#D6E2BA',
index: '173'
}, {
color: '#E3E5D0',
index: '174'
}, {
color: '#C1D39A',
index: '175'
}, {
color: '#AFE4E6',
index: '178'
}, {
color: '#92DDE2',
index: '179'
}, {
color: '#DBE0E6',
index: '182'
}, {
color: '#8FBFF0',
index: '183'
}, {
color: '#9DCDE1',
index: '185'
}, {
color: '#BBC4BF',
index: '196'
}, {
color: '#E484A9',
index: '198'
}, {
color: '#BBC4BF',
index: 'GG3'
}, {
color: '#494A4C',
index: 'CG9'
}, {
color: '#C2CEDA',
index: 'BG1'
}, {
color: '#C1C3D3',
index: 'BG3'
}, {
color: '#8696A3',
index: 'BG5'
}, {
color: '#646A76',
index: 'BG7'
}, {
color: '#415361',
index: 'BG9'
}, {
color: '#DFDEE3',
index: 'WG.5'
}, {
color: '#CBC6CC',
index: 'WG1'
}, {
color: '#B6B0B2',
index: 'WG2'
}, {
color: '#C5BBBA',
index: 'WG3'
}, {
color: '#958A92',
index: 'WG4'
}, {
color: '#837477',
index: 'WG5'
}, {
color: '#8A7E7E',
index: 'WG6'
}, {
color: '#4D4342',
index: 'WG9'
}
]
}
},
methods: {
colorPickAction (color) {
this.$emit('colorPickTap', color);
}
}
}
</script>
<style lang="scss">
.color {
position: absolute;
left: 0;
bottom: 0;
right: 0;
// top: 8rem;
display: none;
z-index: 10;
width: 100vw;
.color-section {
display: flex;
flex-wrap: wrap;
.color-item {
width: 10%;
aspect-ratio: 1;
display: flex;
justify-content: center;
align-items: center;
.color-title {
color: #fff;
font-size: $uni-font-size-sm;
}
}
}
}
.color-show {
background-color: rgba(0, 0, 0, .6);
display: block;
}
</style>
<template>
<view class="content">
<view class="pen-box">
<view class="pen" :style="{backgroundColor: currentColor, height: lineWidth+'px'}"></view>
<slider min="1" max="20" :value="lineWidth" block-size="20" activeColor="#84f876" class="pen-slider"
@change="penWidthChange" />
<view class="pen-txt">{{lineWidth}}px</view>
</view>
<image v-if="isLandScape" src="./img/color.png" mode="" class="draw-logo" @click="showTools" ></image>
<view class="tools-box" v-if="toolsShow">
<view class="tools">
<view class="tools-item " v-for="(item,index) in tools" :key="index">
<button open-type="share" v-if="item.key == 'share'"
style="background-color: rgba(0,0,0,0);padding: 0;border-radius: none;line-height: 0;borderColor:rgba(0,0,0,0);">
<image class="tools-icon" :src="item.active?item.item.activeUrl:item.url" mode="aspectFit">
</image>
</button>
<image @click="chooseTools(item)" v-else :src="item.active?item.activeUrl:item.url"
class="tools-icon"></image>
<!-- <text>{{item.title}}</text> -->
</view>
</view>
</view>
<view class="canvas-box" :style="{aspectRatio:aspectRatio}">
<canvas class="board-canvas" canvas-id="drawCanvas" disable-scroll="true" @touchstart="touchStart"
@touchmove="touchMove" @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>
</view>
<color :colorShow="colorShow" @colorPickTap="colorPickTapHandler"></color>
<view class="btn-box" v-if="showSave">
<button type="primary" @click="saveImage">保存</button>
</view>
</view>
</template>
<script>
import color from "./color.vue"
export default {
name: "canvas",
components: {
color
},
data() {
return {
colorShow: false, //显示颜色
drawContext: null, //画板对象
historyList: [], //路径历史
startX: 0, //起始坐标
startY: 0,
lastX: 0,
lastY: 0,
mode: "pen", //操作模式
currentColor: "#000", //当前画笔颜色
bgColor: "#fff", //画板背景颜色
lineWidth: 2, //画笔粗细 px
lastRect: {}, //运动轨迹最后一个方形
lastCircle: {}, //运动轨迹最后一个圆形
//工具箱
tools: [{
title: "清空",
key: "clear",
url: require("./img/clear.png"),
activeUrl: require("./img/clear.png")
},
{
title: "撤回",
key: "back",
url: require("./img/back.png"),
activeUrl: require("./img/back.png")
},
{
title: "橡皮",
key: "eraser",
url: require("./img/eraser.png"),
activeUrl: require("./img/eraser-active.png")
},
{
title: "颜色",
key: "color",
url: require("./img/color.png"),
activeUrl: require("./img/color-active.png")
},
{
title: "画笔",
key: "pen",
url: require("./img/pen.png"),
activeUrl: require("./img/pen-active.png"),
active: true
},
{
title: "直线",
key: "line",
url: require("./img/line.png"),
activeUrl: require("./img/line-active.png")
},
{
title: "圆形",
key: "circle",
url: require("./img/circle.png"),
activeUrl: require("./img/circle-active.png")
},
{
title: "方形",
key: "rect",
url: require("./img/rect.png"),
activeUrl: require("./img/rect-active.png")
},
{
title: "实圆",
key: "circle-fill",
url: require("./img/circle-fill.png"),
activeUrl: require("./img/circle-fill-active.png")
},
{
title: "实方",
key: "rect-fill",
url: require("./img/rect-fill.png"),
activeUrl: require("./img/rect-fill-active.png")
},
{
title: "下载",
key: "download",
url: require("./img/download.png"),
activeUrl: require("./img/download.png")
},
{
title: "分享",
key: "share",
url: require("./img/share.png"),
activeUrl: require("./img/share.png")
}
],
toolsShow: true,
isLandScape: false, //是否横屏
aspectRatio: 1,//图片宽高比
};
},
props: {
showSave: { //是否显示保存按钮
type: Boolean,
default: false
},
drawImage: { //背景图片
type: String,
default: ""
},
saveImageType: { //保存图片的类型 1、保存地址 2、保存到本地图片 3、既保存地址 又保存图片
type: String,
default: "1"
},
isUnderBkg: { //背景图片是否在画板下边,在下边则无法被擦除
type: Boolean,
default: false
}
},
mounted(opt) {
this.drawContext = uni.createCanvasContext('drawCanvas', this);
this.initBoard();
},
methods: {
colorShowHandel() {
this.colorShow = !this.colorShow;
},
chooseTools(item) {
console.log(item);
this.colorShow = false;
if (item.key == "back") {
//撤回
this.backHandle()
return;
}
if (item.key == "clear") {
//清空
this.clearBoard()
return
}
if (item.key == "eraser") {
this.drawContext.strokeStyle = this.bgColor;
}
if (item.key == "color") {
//选择颜色
this.colorShowHandel()
}
if (item.key == "download") {
//下载
this.downloadHandle()
return;
}
this.mode = item.key;
this.tools.forEach((i, j) => {
i.active = false
if (item.key == i.key) {
i.active = true;
}
})
},
showTools() {
this.toolsShow = !this.toolsShow
},
penWidthChange(e) {
this.lineWidth = e.detail.value;
this.drawContext.setLineWidth(this.lineWidth);
},
//开始绘制曲线
penBegin(x, y) {
this.begin = true;
this.drawContext.beginPath()
this.startX = x;
this.startY = y;
this.drawContext.moveTo(this.startX, this.startY)
this.drawPen(x, y);
},
// 绘制线条中间添加点
drawPen(x, y) {
this.drawContext.moveTo(this.startX, this.startY)
this.drawContext.lineTo(x, y);
this.drawContext.stroke();
this.startX = x;
this.startY = y;
},
// 开始绘制线条 (直线)
lineBegin(x, y) {
this.begin = true;
this.startX = x;
this.startY = y;
},
//画直线
lineDraw(x, y) {
this.drawContext.beginPath()
this.drawContext.moveTo(this.startX, this.startY)
this.drawContext.lineTo(x, y);
this.drawContext.stroke();
this.drawContext.draw(true);
},
// 绘制线条结束
lineEnd() {
this.drawContext.closePath();
this.begin = false;
},
//实心方形开始绘制
rectFillBegin(x, y) {
this.begin = true;
this.drawContext.beginPath()
this.startX = x;
this.startY = y;
},
//方形开始绘制
rectBegin(x, y) {
this.begin = true;
this.drawContext.beginPath()
this.startX = x;
this.startY = y;
},
//实心圆形开始绘制
circleFillBegin(x, y) {
this.begin = true;
this.drawContext.beginPath()
this.startX = x;
this.startY = y;
},
//圆形开始绘制
circleBegin(x, y) {
this.begin = true;
this.drawContext.beginPath()
this.startX = x;
this.startY = y;
},
/**
* 这里是画实体矩形
*/
drawRectFill(x, y, isReverse = true) {
let width = (x - this.startX) ? (x - this.startX) : (this.startX - x);
let height = (y - this.startY) ? (y - this.startY) : (this.startY - y);
this.drawContext.rect(this.startX, this.startY, width, height);
this.drawContext.setFillStyle(this.currentColor);
this.drawContext.fill();
this.draw(isReverse);
},
/**
* 这里是画空心矩形
* 方法是根据四个坐标点画
* 四条线进行连接
*/
drawRect(x, y, isReverse = true) {
let pointLT = {};
let pointRB = {};
let pointRT = {};
let pointLB = {};
let center = {};
pointLT.X = (this.startX <= x) ? this.startX : x;
pointLT.Y = (this.startY <= y) ? this.startY : y;
pointRB.X = (this.startX >= x) ? this.startX : x;
pointRB.Y = (this.startY >= y) ? this.startY : y;
pointRT.X = pointRB.X;
pointRT.Y = pointLT.Y;
pointLB.X = pointLT.X;
pointLB.Y = pointRB.Y;
let width = (x - this.startX) ? (x - this.startX) : (this.startX - x);
let height = (y - this.startY) ? (y - this.startY) : (this.startY - y);
this.drawContext.rect(this.startX, this.startY, width, height);
this.drawContext.setStrokeStyle(this.currentColor);
this.drawContext.stroke();
this.draw(isReverse);
this.lastRect = {
x: this.startX,
y: this.startY,
width: Math.abs(width),
height: Math.abs(height),
pointLT: pointLT
}
this.clearLastRect()
},
clearLastRect() {
this.drawContext.clearRect(this.lastRect.pointLT.X + this.lineWidth / 2, this.lastRect.pointLT
.Y + this
.lineWidth / 2, this.lastRect.width - this.lineWidth, this.lastRect.height - this
.lineWidth);
},
clearLastCircle(x, y, r, cxt) {
//(x,y)为要清除的圆的圆心,r为半径,cxt为context
var stepClear = 1; //别忘记这一步
clearArc(x, y, r);
function clearArc(x, y, radius) {
var calcWidth = radius - stepClear;
var calcHeight = Math.sqrt(radius * radius - calcWidth * calcWidth);
var posX = x - calcWidth;
var posY = y - calcHeight;
var widthX = 2 * calcWidth;
var heightY = 2 * calcHeight;
if (stepClear <= radius) {
cxt.clearRect(posX, posY, widthX, heightY);
stepClear += 1;
clearArc(x, y, radius);
}
}
},
/**
* 这里是画
* 实心圆
*/
drawCircleFill(x, y, isReverse = true) {
let pointLT = {};
let pointRB = {};
let pointRT = {};
let pointLB = {};
let center = {};
pointLT.X = (this.startX <= x) ? this.startX : x;
pointLT.Y = (this.startY <= y) ? this.startY : y;
pointRB.X = (this.startX >= x) ? this.startX : x;
pointRB.Y = (this.startY >= y) ? this.startY : y;
pointRT.X = pointRB.X;
pointRT.Y = pointLT.Y;
pointLB.X = pointLT.X;
pointLB.Y = pointRB.Y;
center.X = (pointRB.X + pointLT.X) / 2;
center.Y = (pointRB.Y + pointLT.Y) / 2;
let dx = pointRB.X - pointLT.X;
let dy = pointRB.Y - pointLT.Y;
let r = Math.sqrt(dx * dx + dy * dy) / 2;
this.drawContext.arc(center.X, center.Y, r, 0, 2 * Math.PI);
this.drawContext.setFillStyle(this.currentColor);
this.drawContext.fill();
this.draw(isReverse);
},
/**
* 这里是画
* 空心圆
*/
drawCircle(x, y, isReverse = true) {
let pointLT = {};
let pointRB = {};
let center = {};
pointLT.X = (this.startX <= x) ? this.startX : x;
pointLT.Y = (this.startY <= y) ? this.startY : y;
pointRB.X = (this.startX >= x) ? this.startX : x;
pointRB.Y = (this.startY >= y) ? this.startY : y;
center.X = (pointRB.X + pointLT.X) / 2;
center.Y = (pointRB.Y + pointLT.Y) / 2;
let dx = pointRB.X - pointLT.X;
let dy = pointRB.Y - pointLT.Y;
let r = Math.sqrt(dx * dx + dy * dy) / 2;
this.drawContext.arc(center.X, center.Y, r, 0, 2 * Math.PI);
this.drawContext.stroke();
this.drawContext.beginPath();
this.drawContext.arc(center.X, center.Y, r - this.lineWidth / 2, 0, 2 * Math.PI);
this.drawContext.setFillStyle(this.bgColor);
this.drawContext.fill();
this.draw(isReverse);
this.clearLastCircle(center.X, center.Y, r - this.lineWidth / 2, this.drawContext);
},
//开始touch
touchStart(e) {
let {
x,
y
} = e.touches[0]
console.log("开始touch");
switch (this.mode) {
case "pen":
this.penBegin(x, y)
break;
case "eraser":
this.penBegin(x, y)
break;
case "line":
this.lineBegin(x, y)
break;
case "rect":
this.rectBegin(x, y)
break;
case "circle":
this.circleBegin(x, y)
break;
case "rect-fill":
this.rectFillBegin(x, y)
break;
case "circle-fill":
this.circleFillBegin(x, y)
break;
}
//新增一次历史轨迹
this.historyList.push({
style: {
color: this.currentColor,
width: this.lineWidth
},
coordinates: [{
type: e.type,
mode: this.mode,
x: e.touches[0].x,
y: e.touches[0].y
}]
})
},
//touch移动
touchMove(e) {
let {
x,
y
} = e.touches[0]
this.lastX = x;
this.lastY = y;
console.log("touch移动");
switch (this.mode) {
case "pen":
this.drawPen(x, y)
this.draw(true);
break;
case "eraser":
this.drawPen(x, y)
this.draw(true);
break;
case "line":
this.draw(true);
return;
break;
case "rect":
this.drawRect(x, y)
break;
case "circle":
this.drawCircle(x, y)
break;
case "rect-fill":
this.drawRectFill(x, y)
break;
case "circle-fill":
this.drawCircleFill(x, y)
break;
}
//最后一次历史中新增运动轨迹
this.historyList[this.historyList.length - 1].coordinates.push({
type: e.type,
mode: this.mode,
x,
y
})
},
//touch结束
touchEnd(e) {
let {
x,
y
} = e.changedTouches[0]
console.log("touch结束");
switch (this.mode) {
case "pen":
this.lineEnd()
break;
case "eraser":
this.drawContext.setFillStyle(this.currentColor)
this.lineEnd()
break;
case "line":
this.historyList[this.historyList.length - 1].coordinates.push({
type: e.type,
mode: this.mode,
x,
y
})
this.lineDraw(x, y)
this.lineEnd()
break;
case "rect":
this.drawRect(x, y, true);
break;
case "circle":
this.drawCircle(x, y)
break;
case "rect-fill":
this.drawRectFill(x, y)
break;
case "circle-fill":
this.drawCircleFill(x, y)
break;
}
},
//撤回
backHandle() {
this.drawContext.draw()
this.historyList.pop(); //删除最后一步
this.drawHistory();
},
drawHistory() {
//遍历历史轨迹重新绘制
this.historyList.forEach((item, index) => {
this.drawContext.beginPath()
this.drawContext.setLineCap('round')
this.drawContext.setStrokeStyle(item.style.color)
this.drawContext.setLineWidth(item.style.width)
item.coordinates.forEach(it => {
if (it.type == 'touchstart') {
this.switchModeToLine(it.mode, 1, it.x, it.y)
} else {
this.switchModeToLine(it.mode, 2, it.x, it.y)
}
})
this.drawContext.stroke()
})
this.drawContext.draw(true)
},
//重新绘制历史画面 mode:操作模式 type:touch类型(1:开始touch、2:touch中或结束touch)
switchModeToLine(mode, type, x, y) {
this.drawContext.setFillStyle(this.currentColor)
if (mode == "pen") {
if (type == "1") {
this.drawContext.moveTo(x, y)
} else {
this.drawContext.lineTo(x, y)
}
} else if (mode == "eraser") {
this.drawContext.setFillStyle(this.bgColor)
if (type == "1") {
this.startX = x
this.startY = y
} else {
this.lineDraw(x, y, true)
}
} else if (mode == "line") {
if (type == "1") {
this.startX = x
this.startY = y
} else {
this.lineDraw(x, y, true)
}
} else if (mode == "rect") {
if (type == "1") {
this.startX = x
this.startY = y
} else {
this.drawRect(x, y, true)
}
} else if (mode == "circle") {
if (type == "1") {
this.startX = x
this.startY = y
} else {
this.drawCircle(x, y, true)
}
} else if (mode == "rect-fill") {
if (type == "1") {
this.startX = x
this.startY = y
} else {
this.drawRectFill(x, y, true)
}
} else if (mode == "circle-fill") {
if (type == "1") {
this.startX = x
this.startY = y
} else {
this.drawCircleFill(x, y, true)
}
}
},
//选择画笔颜色
colorPickTapHandler(obj) {
console.log('我点击的颜色:' + JSON.stringify(obj));
this.colorShow = false;
this.tools.forEach(item => {
item.active = false;
if (item.key === 'pen') {
this.mode = 'pen'
item.active = true;
}
})
this.currentColor = obj.color;
this.drawContext.strokeStyle = obj.color;
},
//下载图片
downloadHandle() {
let that = this;
if (this.saveImageType == 1 || this.saveImageType == 3) {
this.saveImage()
}
if (this.saveImageType == 2 || this.saveImageType == 3) {
uni.canvasToTempFilePath({
canvasId: 'drawCanvas',
success: function(res) {
console.log('回调参数:' + JSON.stringify(res));
// 在H5平台下,tempFilePath 为 base64
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function(res) {
console.log('成功回调参数:' + JSON.stringify(res));
that.$emit("dowmloadSuc", JSON.stringify(res))
},
fail: function(res) {
console.log('失败回调参数:' + JSON.stringify(res));
that.$emit("dowmloadErr", JSON.stringify(res))
}
});
}
}, this)
}
},
//返回图片地址 @filePath
saveImage() {
let that = this
if (this.isUnderBkg) {
that.saveImageUrl()
} else {
uni.canvasToTempFilePath({
canvasId: 'drawCanvas',
success: function(res) {
console.log(res);
that.$emit("saveImage", res.tempFilePath)
}
}, this)
}
},
saveImageUrl() {
const query = uni.createSelectorQuery().in(this);
let that = this;
query.select('.canvas-box').boundingClientRect(data => {
this.drawContext.setFillStyle(this.bgColor);
this.drawContext.fillRect(0, 0, data.width, data.height); //TODO context的宽和高待定
this.drawContext.fill();
this.drawContext.drawImage(this.drawImage, 0, 0, data.width, data.height);
this.drawContext.draw();
this.drawHistory()
uni.canvasToTempFilePath({
canvasId: 'drawCanvas',
success: function(res) {
that.$emit("saveImage", res.tempFilePath)
}
}, this)
}).exec();
},
// canvas设置背景颜色
fillBackground() {
const query = uni.createSelectorQuery().in(this);
query.select('.canvas-box').boundingClientRect(data => {
this.drawContext.setFillStyle(this.bgColor);
this.drawContext.fillRect(0, 0, data.width, data.height); //TODO context的宽和高待定
this.drawContext.fill();
if (this.drawImage && !this.isUnderBkg) {
this.drawContext.drawImage(this.drawImage, 0, 0, data.width, data.height);
}
this.drawContext.draw();
}).exec();
},
// 绘制canvas
// isReverse: 是否保留之前的像素
draw(isReverse = false, cb) {
this.drawContext.draw(isReverse, () => {
if (cb && typeof(cb) == "function") {
cb();
}
});
},
setBoardMode(key) {
this.tools.forEach(i => {
i.active = false;
if (i.key == key) {
i.active = true;
this.mode = key
}
})
},
//清空画板
clearBoard() {
this.historyList = [];
this.drawContext.draw()
},
async initBoard() {
const systemInfo = uni.getSystemInfoSync();
if(systemInfo.screenWidth>systemInfo.screenHeight){
this.isLandScape = true
}else{
this.isLandScape = false
}
console.log(this.isLandScape);
let imageInfoObj = (await uni.getImageInfo({
src: this.drawImage
}))[1] || {};
console.log(imageInfoObj);
this.aspectRatio = imageInfoObj.width / imageInfoObj.height;
if (this.isUnderBkg) {
this.bgColor = "rgba(0,0,0,0)"
} else {
this.bgColor = "rgb(255,255,255)"
}
this.drawContext.setLineCap('round') // 让线条圆润
this.drawContext.strokeStyle = this.currentColor; //设置画笔颜色
this.drawContext.setLineWidth(this.lineWidth); //设置画笔粗细
//设置背景
this.$nextTick(() => {
this.fillBackground();
})
}
}
}
</script>
<style lang="scss">
.content {
height: 100%;
width: 100%;
box-sizing: border-box;
position: relative;
.draw-logo {
width: 1.8rem;
height: 1.8rem;
box-sizing: border-box;
position: fixed;
right: 0.1rem;
top: 0.5rem;
z-index: 10;
}
.pen-box {
display: flex;
justify-content: space-around;
align-items: center;
height: 3rem;
.pen {
width: 3rem;
border-radius: 0.2rem;
}
.pen-slider {
width: 60%;
}
.pen-txt {
font-size: 1.2rem;
}
}
.tools-box {
.tools {
display: flex;
justify-content: space-between;
align-items: center;
background-color: white;
border-radius: 0.2rem 0 0 0.2rem;
.tools-item {
display: flex;
align-items: center;
justify-content: center;
font-size: 0.8rem;
.tools-icon {
width: 1.2rem;
height: 1.2rem;
}
text {
width: 2rem;
}
}
}
}
.btn-box {
position: fixed;
bottom: 1.2rem;
margin: 0 auto;
width: 33%;
left: 0;
right: 0;
}
}
.under-image {
width: 100%;
height: 100%;
background-size: cover ;
background-repeat: no-repeat;
}
/* 竖屏 */
@media screen and (orientation: portrait) {
.tools-box {
.tools {
height: 3rem;
flex-wrap: wrap;
.tools-item {
width: 8%;
}
}
}
.canvas-box {
width: 100vw;
position: relative;
.board-canvas {
height: 100%;
width: 100%;
position: absolute;
background: rgba(0, 0, 0, 0);
}
}
}
/* 横屏 */
@media screen and (orientation: landscape) {
.tools-box {
position: fixed;
height: 80vh;
z-index: 10;
overflow: auto;
right: 0;
.tools {
width: 1.8rem;
flex-direction: column;
.tools-item {
width: 100%;
margin: 0.4rem 0;
}
}
}
.canvas-box {
//width: calc(100% - 2rem);
width: 100%;
//margin-right: 2.2rem;
position: relative;
.board-canvas {
height: 100%;
width: 100%;
position: absolute;
background: rgba(0, 0, 0, 0);
}
}
}
</style>
import loginMixin from './loginMixin'
module.exports = {
loginMixin
}
export default {
methods: {
// 获取园区店下4s店数据
get4SStoreList (loginUserObj) {
let { merchantId, isSuper, uuid } = loginUserObj
uni.$api.userApi.getSceneMerchantRefStoreList({
merchantId: isSuper ? undefined : merchantId,
staffUUID: isSuper ? undefined : uuid
}).then(result => {
// 超管跳过选择4s店
let userInfo = uni.$storage.get('userInfo') || {}
if (isSuper) {
let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName: merchantName,
shopMerchantId: merchantId
})
uni.redirectTo({
url: '/pages/home/home'
})
return
}
// 仅一家4s店
if (result?.length == 1) {
let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName: merchantName,
shopMerchantId: merchantId,
default4SStoreInfo: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: merchantId,
merchantName: merchantName
}
})
uni.redirectTo({
url: '/pages/home/home'
})
} else if (!result?.length) {
return uni.showToast({
title: '园区店关联的4s店商户账号无效,请联系总部管理员',
icon: 'none',
})
} else uni.navigateTo({
url: '/pages/common/merchantList'
})
})
},
}
}
\ No newline at end of file
......@@ -4,17 +4,18 @@
},
"pages": [
{
"path": "pages/common/login",
"path": "pages/home/home",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/home/home",
"path": "pages/common/login",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/detail/detail",
"style": {
......
<template>
<div>
</div>
<view class="layout">
<view class="search-box">
<view class="search-input">
<template v-if="!edit">
<view
:class="['input', `${searchValue ? '' : 'placeholder'}`]"
@click="open"
>
<template v-if="searchValue">
{{searchValue}}
</template>
<template v-else>
<image class="icon"></image>
请输入门店名称/商户号搜索
</template>
</view>
</template>
<template v-else>
<input
type="text"
class="input"
v-model="searchValue"
:focus='inputFocus'
confirm-type="search"
@blur="search"
@confirm="search"
/>
</template>
</view>
</view>
<scroll-view
class="list"
scroll-y
:key="selectedUuid"
>
<!-- height: calc(100% - {{copyLoginUserInfoList && copyLoginUserInfoList.length >= 10 ? 120 : 50}}rpx); -->
<template v-if="flag">
<template v-if="loginUserInfoList">
<template v-for="(item,index) in loginUserInfoList">
<view
:key="index"
:class="['items', `${item.active ? 'active' : ''}` ]"
@click="chooseAccount(item)"
>
<view class="right">
<view :class="['midle', midle(item)]">
{{item.isSuper==true?'超管':item.userType==1?'商户':(item.loginRole == 3 ? '督导' : item.loginRole == 4 ? '驻店' : '员工')}}
</view>
</view>
<view class="left">
<view class="name">
{{item.merchantName}}
</view>
<view class="shop_no">
商户号:{{item.merchantId}}
</view>
</view>
</view>
</template>
</template>
<template v-else>
// style="height: calc(100vh - {{isFullSucreen ? '159' :'125'}}px)"
<view
class="list-not"
@click="getListSelectAccount"
>
点击刷新
</view>
</template>
</template>
<view class="scrollSpase"></view>
</scroll-view>
<view class="content" style="width:100%;height:800px;">
<!-- <wnCanvas
saveImageType="3"
@saveImage="saveImage"
:drawImage="drawImage"
:isUnderBkg="true"
@dowmloadErr='dowmloadErr'
@dowmloadSuc="dowmloadSuc"
></wnCanvas> -->
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
import { loginMixin } from '@/mixin'
import wnCanvas from '../../components/Canvas/wn-canvas.vue'
export default {
mixins: [loginMixin],
components: {
wnCanvas
},
name: '',
data () {
return {
searchValue: '',
edit: false,
copyLoginUserInfoList: [],
loginRole: {
1: '超管',
2: '商户号',
3: '区域督导',
4: '驻店负责人'
},
selectedUuid: '',
requestFlag: false,
loginUserInfoList: [],
flag: false
}
},
onLoad () {
this.getListSelectAccount()
},
mounted () {
},
methods: {
getListSelectAccount () {
uni.showLoading()
uni.$api.userApi.getListSelectAccount().then(res => {
uni.hideLoading()
let { code, data, message } = res
if (code == 0) {
let { loginUserInfoList, sessionId } = data
uni.$storage.set('sessionId', sessionId);
this.loginUserInfoList = loginUserInfoList
this.copyLoginUserInfoList = loginUserInfoList
} else uni.showToast({
title: message,
icon: 'none',
});
this.flag = true
})
},
chooseAccount (item) {
let { loginUserInfoList } = this
loginUserInfoList.map(i => {
i.active = false
if (i.uuid == item?.uuid) i.active = true
return i
})
this.loginUserInfoList = loginUserInfoList
this.selectedUuid = item.uuid
this.choiceAccountLogin()
},
async choiceAccountLogin () {
let { loginUserInfoList } = this,
id = null
loginUserInfoList.map(e => {
if (e.active) id = e.uuid
})
if (!id) {
uni.showToast({
title: '请选择账号',
icon: 'none',
});
return
}
// 清空4s店数据
// app.globalData.storeListRange = []
this.selectAccountLogin(id)
},
selectAccountLogin (id) {
if (this.requestFlag) return
this.requestFlag = true
uni.showLoading()
uni.$api.userApi.selectAccountLogin({ id }).then(res => {
uni.hideLoading()
this.requestFlag = false
let { data, message } = res,
[userInfo] = data.loginUserInfoList
if (data){
uni.$storage.set('userInfo', userInfo);
this.get4SStoreList(userInfo)
}
else uni.showToast({
title: message,
icon: 'none',
});
})
},
search () {
this.edit = false
this.searchEvent()
},
// 搜索过滤
searchEvent () {
let { searchValue, copyLoginUserInfoList, selectedUuid } = this
copyLoginUserInfoList.map(val => {
val.active = false
if (val.uuid == selectedUuid) val.active = true
return val
})
let filterArr = copyLoginUserInfoList.filter(val => val.merchantName.includes(searchValue) || val.merchantId == searchValue) || []
this.loginUserInfoList = filterArr
if (!searchValue) this.loginUserInfoList = copyLoginUserInfoList
},
mounted () {
open () {
this.edit = true
this.inputFocus = true
},
methods: {
midle (item) {
return item.isSuper == true ? 'midle_1' : item.userType == 1 ? 'midle_2' : (item.loginRole == 3 ? 'midle_3' : item.loginRole == 4 ? 'midle_4' : 'midle_5')
},
saveImage (url) {
//画板返回的图片地址
console.log(url);
},
dowmloadErr (err) {
//下载图片失败时的回调
console.log(err);
},
dowmloadSuc (res) {
//下载图片成功时的回调
console.log(res);
}
}
}
</script>
<style scoped lang='scss'>
.layout {
padding: 32rpx 24rpx 0;
font-size: 28rpx;
color: #333;
letter-spacing: 0;
background: #f7f8fa;
box-sizing: border-box;
height: 100vh;
.search-box {
.search-input {
width: 100%;
height: 72rpx;
background: #fff;
border-radius: 38rpx;
padding-left: 24rpx;
box-sizing: border-box;
margin-bottom: 32rpx;
color: #333;
.input {
display: flex;
align-items: center;
height: 100%;
width: 100%;
}
.icon {
width: 28rpx;
height: 28rpx;
margin-right: 10rpx;
}
.placeholder {
color: #c8c9cc;
}
}
}
.list {
height: calc(100% - 50rpx);
.scrollSpase {
height: 70rpx;
}
}
.items {
width: 100%;
height: 160rpx;
background: #ffffff;
border-radius: 16rpx;
margin-top: 32rpx;
padding: 32rpx;
display: flex;
align-items: center;
box-sizing: border-box;
border: 6rpx solid #fff;
.left {
width: 65%;
display: flex;
flex-flow: column;
justify-content: center;
.name {
font-weight: 500;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
color: #181a1f;
}
.shop_no {
font-weight: 400;
font-size: 24rpx;
margin-top: 16rpx;
color: #999ea8;
}
}
.right {
flex-shrink: 0;
display: flex;
align-items: center;
.midle {
font-size: 28rpx;
font-weight: 600;
width: 96rpx;
height: 96rpx;
border-radius: 8rpx;
margin-right: 30rpx;
display: flex;
align-items: center;
justify-content: center;
}
.midle_1 {
color: #f24724;
background-color: #f247241a;
}
.midle_2 {
color: #ff9d0a;
/* border: var(--fontSize2) solid #FF9D0A; */
background-color: #ff9d0a1a;
}
.midle_3 {
color: #347bff;
/* border: var(--fontSize2) solid #347BFF; */
background-color: #347bff1a;
}
.midle_4 {
color: #35c376;
/* border: var(--fontSize2) solid #35C376; */
background-color: #35c3761a;
}
.midle_5 {
color: #35c376;
/* border: var(--fontSize2) solid #35C376; */
background-color: #35c3761a;
}
.icon {
width: 40rpx;
height: 40rpx;
}
}
}
.active {
border: 6rpx solid #347bff;
}
}
</style>
\ No newline at end of file
......@@ -45,8 +45,10 @@
</icon>
</view>
</template>
<!-- :class="['code-btn', { 'code-disabled': count }]" -->
<view @click="getSmsCode">{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
<view
:class="['code-btn', `${count? 'code-disabled' :''}`]"
@click="getSmsCode"
>{{ count ? `重新发送(${count}s)` : '获取验证码' }}</view>
</view>
<button
class="btn"
......@@ -153,61 +155,7 @@ export default {
url: '/pages/common/accountItems'
})
},
// 获取园区店下4s店数据
get4SStoreList (loginUserObj) {
let { merchantId, isSuper, uuid } = loginUserObj
uni.$api.userApi.getSceneMerchantRefStoreList({
merchantId: isSuper ? undefined : merchantId,
staffUUID: isSuper ? undefined : uuid
}).then(result => {
// 超管跳过选择4s店
let userInfo = uni.$storage.get('userInfo') || {}
if (isSuper) {
let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName: merchantName,
shopMerchantId: merchantId
})
uni.redirectTo({
url: '/pages/home/home'
})
return
}
// 仅一家4s店
if (result?.length == 1) {
let { merchantName, merchantId } = result[0]
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName: merchantName,
shopMerchantId: merchantId,
default4SStoreInfo: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: merchantId,
merchantName: merchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: merchantId,
merchantName: merchantName
}
})
uni.redirectTo({
url: '/pages/home/home'
})
} else if (!result?.length) {
return uni.showToast({
title: '园区店关联的4s店商户账号无效,请联系总部管理员',
icon: 'none',
})
} else uni.navigateTo({
url: '/pages/common/merchantList'
})
})
},
},
};
</script>
......
<template>
<div>
</div>
<view class="layout">
<!-- <view class="search-box">
<view class='select_box'>
<view
class='select'
@click='selectTap'
>
<view class='select_text'>{{selectData[selectIndex]}}</view>
<image
:class="['select_img', {select_img_rotate:showSelect}]"
src='/images/back.png'
></image>
</view>
<view
class='option_box'
v-if="showSelect"
>
<view
:class="['option', { active:selectIndex == index}]"
v-for="(item,index) in selectData"
:key="index"
@click='optionTap(index)'
>{{item}}</view>
</view>
<view
class="mask_class"
v-if="showSelect"
@click="closeSelect"
></view>
</view>
<view class="search-input">
<image
src="/images/search.png"
class="search-icon"
/>
<input
type="text"
:placeholder="selectIndex == 0 ? '搜索门店名称/商户号' : '请输入客户姓名/手机号搜索'"
class="input"
confirm-type="search"
v-model="searchValue"
placeholder-class="input-placeholder"
bindconfirm="inputConfifm"
/>
<template v-if="searchValue">
<image
src="/images/clear.png"
class="search-clear"
bindtap="clearInputText"
/>
</template>
</view>
</view> -->
<!-- 搜门店 -->
<scroll-view
v-if="loginUserInfoList.length && selectIndex == 0"
class="list"
scroll-y
style="height: calc(100% - 120rpx);"
>
<template v-if="flag">
<template v-for="(item,index) in loginUserInfoList">
<view
:key="index"
:class="['items' ,{active:item.active}]"
@click="chooseAccount(item)"
>
<view class="left">
<!-- <view class="icon">
<image src="{{IMG_URL}}/store_icon_bg.png" />
</view> -->
<view class="text_box">
<view class="name"></view>{{item.merchantName}}
<view class="text_no">商户号:{{item.merchantId}}</view>
</view>
</view>
</view>
</template>
</template>
<view class="scrollSpase"></view>
</scroll-view>
<!-- 搜客户 -->
<!-- <scroll-view
v-else-if="customStoreList.length && selectIndex == 1"
class="list"
scroll-y
style="height: calc(100% - 120rpx);"
bindscrolltolower="scrollonReachBottom"
>
<template v-for="(item,index) in customStoreList">
<view
:key="index"
:class="['items custom_items ',{active:item.active}]"
@click="chooseAccount(index,item,1)"
>
<view class="left">
<view class="icon">
<image src="{{IMG_URL}}/user_avatar.png" />
</view>
<view class="text_box">
<view class="custom_text">
<view>
<text class="custom_name">{{item.customer.customerName}}</text>
<text class="custom_phone">{{item.customer.customerPhone}}</text>
</view>
<view :class="['status_text',`status_text_${item.listStatus}`]">{{statusText[item.listStatus]}}</view>
</view>
<view class="name">{{item.merchantName}}</view>
<view
class="text_no"
v-if="item.merchantId"
>商户号:{{item.merchantId}}</view>
</view>
</view>
</view>
</template>
</scroll-view> -->
<template v-else>
<view class="list_not">
<!-- <image
class="list_nothing_img {{customSearchFlag ? '' : 'big_list_nothing_img'}}"
src="{{IMG_URL}}/{{customSearchFlag ? 'no_data_bg' : 'search_icon_bg'}}.png"
mode=""
/> -->
<view class="list_not_text">{{customSearchFlag ? '您搜索的内容暂无结果' : '快去搜索看看'}}</view>
</view>
</template>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
name: '',
data () {
return {
export default {
name: '',
data () {
return {
loginUserInfoList: [],
copyLoginUserInfoList: [],
selectIndex: 0,
selectData: ['搜门店', '搜客户'],
showSelect: false,
searchValue: '',
customSearchFlag: false,
customStoreList: [],
jumpPageFlag: false,
openSceneArr: []
}
},
onLoad () {
this.getMerchantList()
this.getSceneArr()
},
methods: {
getSceneArr () {
let userInfo = uni.$storage.get('userInfo')
// 超管开通全部场景
if (userInfo?.isSuper) return
uni.showLoading()
// 获取4s店关联场景数据
uni.$api.userApi.getYqMerchantSceneConfigAPI({
yqMerchantId: userInfo?.subLoginUser?.merchantId,
merchantId: userInfo?.shopMerchantId
}).then(result => {
uni.hideLoading()
this.openSceneArr = result.map(val => { if (val.sceneOpenFlag == 0) return val.scene }) || []
})
},
getMerchantList () {
let userInfo = uni.$storage.get('userInfo')
let params = {
merchantId: userInfo?.isSuper ? '' : userInfo?.merchantId,
staffUUID: userInfo?.isSuper ? '' : userInfo?.uuid
}
uni.$api.userApi.getSceneMerchantRefStoreList(params).then(result => {
this.loginUserInfoList = result
this.copyLoginUserInfoList = result
this.flag = true
}).catch(err => {
console.log(err)
})
},
mounted () {
chooseAccount (item, type) {
if (this.jumpPageFlag) return
this.jumpPageFlag = true
let { loginUserInfoList, customStoreList, selectIndex } = this
let listArr = selectIndex == 0 ? loginUserInfoList : customStoreList
listArr.map(i => {
i.active = false
// 搜客户
if (type == 1) {
if (i.id == item.id) {
i.active = true
}
} else { // 搜门店
if (i.merchantId == item?.merchantId) {
i.active = true
}
}
return i
})
this.loginUserInfoList = listArr
this.customStoreList = listArr
this.jumpPage(item)
},
jumpPage (item) {
let { openSceneArr, selectIndex } = this,
{ shopMerchantName, shopMerchantId } = item,
userInfo = uni.$storage.get('userInfo')
if (!openSceneArr?.length && !userInfo?.isSuper) return wx.$util.showToast('暂无开通业务,请联系总部管理员')
uni.$storage.set('userInfo', {
...userInfo,
shopMerchantName,
shopMerchantId,
default4SStoreInfo: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
},
default4SStoreInfo_crowdFunding: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
},
default4SStoreInfo_newCarConversion: {
merchantId: shopMerchantId,
merchantName: shopMerchantName
}
})
// uni.$storage.rm('dateStaffPop')
this.jumpPageFlag = false
if (selectIndex == 0) { // 搜门店
uni.reLaunch({
url: '/pages/home/home'
})
} else { // 搜客户
if (!openSceneArr.includes(0)) return wx.$util.showToast('暂未开通精品升级场景')
// 进入精品升级场景 工单/预约详情
}
},
methods: {
}
}
}
</script>
<style scoped lang='scss'>
.layout {
padding: 32rpx 24rpx 0;
font-size: 28rpx;
color: #333;
letter-spacing: 0;
background: #f7f8fa;
box-sizing: border-box;
height: 100vh;
.search-box {
width: 100%;
height: 72rpx;
padding-left: 24rpx;
box-sizing: border-box;
margin-bottom: 32rpx;
color: #333;
display: flex;
position: sticky;
top: 0;
left: 0;
z-index: 1009;
box-sizing: border-box;
.select_box {
width: 200rpx;
display: flex;
flex-flow: column;
align-items: center;
justify-content: center;
font-size: 24rpx;
color: #999999;
.select {
width: 140rpx;
display: flex;
align-items: center;
.select_text {
font-size: 28rpx;
color: #181a1f;
}
.select_img {
transform: rotate(-90deg);
width: 32rpx;
height: 32rpx;
flex-shrink: 0;
margin-left: 6rpx;
}
.select_img_rotate {
transform: rotate(90deg);
}
}
.option_box {
position: absolute;
z-index: 200;
top: 100rpx;
left: 32rpx;
width: 194rpx;
box-sizing: border-box;
background: #ffffff;
box-shadow: 0 6rpx 12rpx 0 #0000000d;
height: 176rpx;
border-radius: 16rpx;
.option {
display: block;
height: 88rpx;
line-height: 88rpx;
text-align: center;
color: #333333;
overflow: hidden;
&:first-child {
border-radius: 16rpx 16rpx 0 0;
}
&:last-child {
border-radius: 0 0 16rpx 16rpx;
}
}
.active {
background: #347bff1a;
color: #347bff;
}
&::after {
height: 0;
width: 0;
content: "";
position: absolute;
border: 14rpx solid transparent;
border-right: 14rpx solid #ffffff;
top: calc(-1 * 24rpx);
left: 88rpx;
z-index: -1;
transform: rotate(90deg);
}
&::before {
height: 0;
width: 0;
content: "";
position: absolute;
border: 14rpx solid transparent;
border-right: 14rpx solid #ffffff;
top: calc(-1 * 24rpx);
left: 88rpx;
z-index: -1;
transform: rotate(90deg);
}
}
}
.search-input {
width: 100%;
height: 72rpx;
display: flex;
align-items: center;
background: #ffffff;
border-radius: var(--fontSize38);
.search-icon {
width: 28rpx;
height: 28rpx;
margin: 0 var(--fontSize10) 0 var(--fontSize26);
}
.search-clear {
width: var(--fontSize36);
height: var(--fontSize36);
padding: var(--fontSize10);
margin: 0 var(--fontSize26) 0 var(--fontSize10);
}
.input {
font-size: 28rpx;
width: calc(100% - var(--fontSize136));
height: 28rpx;
}
.input-placeholder {
color: rgba(200, 201, 204, 0.89);
}
}
.search {
width: var(--fontSize144);
height: 100%;
color: #666;
box-sizing: border-box;
padding: 0 24rpx;
.text-center {
font-size: 24rpx;
/* background-color: #f7f7f7; */
border-radius: 12rpx;
width: 100%;
height: 50rpx;
color: #888;
.search-filter {
margin-left: 6rpx;
width: 24rpx;
height: 24rpx;
}
}
}
}
.list {
.scrollSpase {
height: 70rpx;
}
.items {
width: 100%;
background: #ffffff;
border-radius: 16rpx;
margin-top: 32rpx;
padding: 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
&:first-child {
margin-top: 0;
}
}
}
}
</style>
\ No newline at end of file
......@@ -3,16 +3,18 @@
* @Author: huyue
* @Date: 2024-04-08 11:30:30
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 16:23:30
* @LastEditTime: 2024-04-08 17:20:55
-->
<template>
<view>
详情页
<button @click="open">打开弹窗</button>
<uni-popup ref="popup" type="bottom" border-radius="16px 16px 0 0">
<uni-popup ref="popup" type="bottom" :mask-click="false" border-radius="16px 16px 0 0">
<view class="popup-wrapper">
<view class="popup-box">
<view class="payment-title">付款二维码</view>
<view class="payment-title">付款二维码
<view class="icon-close" @click="close">×</view>
</view>
<view class="popup-content">
<view class="tab-list">
<view
......@@ -22,21 +24,29 @@
@click="handleSwitchTab(item)"
>{{ item.name }}</view
>
<!-- <view class="tab-item qr-code active">扫码支付</view>
<view class="tab-item corporate">对公账户</view> -->
</view>
<view class="payment-content">
<view v-show="payActive === 1" class="qr-code-content">
<!-- <image :src="payInfo.storePaymentQrcodeUrl" mode="aspectFit" /> -->
<image
<image class="qr-code-img" :src="payInfo.storePaymentQrcodeUrl" mode="scaleToFill" />
<!-- <image
class="qr-code-img"
src="https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png"
mode="scaleToFill"
/>
/> -->
<view class="qr-code-info">扫码付款,支持多渠道付款</view>
</view>
<view v-show="payActive === 2">
DDDD
<view v-show="payActive === 2" class="corporate-content">
<image
class="bank-logo"
src="https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png"
mode="scaleToFill"
/>
<view class="bank-info">
<view class="bank-item" v-for="item in accountList" :key="item.field">
<text class="bank-label">{{item.label}}:</text>
<view class="bank-value">{{ accountInfo[item.field] }}</view>
</view>
</view>
</view>
</view>
</view>
......@@ -57,12 +67,36 @@ const PAYMENT_TYPE = [
type: 2,
},
];
const ACCOUT_LIST = [
{
label: '公司名称',
field: 'companyName'
},
{
label: '基本账户',
field: 'basicAccount'
},
{
label: '支行账号',
field: 'paymentType'
},
{
label: '一般账户',
field: 'generalAccount'
},
{
label: '支付账户',
field: 'paymentAccount'
}
]
export default {
data() {
return {
payInfo: {},
payActive: 1,
accountInfo: {},
payActive: 2,
paymentType: PAYMENT_TYPE,
accountList: ACCOUT_LIST
};
},
onLoad(options) {
......@@ -79,42 +113,49 @@ export default {
},
// 查询门店支付配置
async findPayInfo() {
this.payInfo = (
await uni.$api.commonApi.findPayInfo({
const data = await uni.$api.commonApi.findPayInfo({
merchantId: 44209880,
})
).find((item) => item.paymentType == 1);
this.payInfo = data.find((item) => item.paymentType == 1);
this.accountInfo = data.find((item) => item.paymentType == 2);
},
open() {
// 通过组件定义的ref调用uni-popup方法 ,如果传入参数 ,type 属性将失效 ,仅支持 ['top','left','bottom','right','center']
this.$refs.popup.open("top");
this.$refs.popup.open("bottom");
this.findPayInfo();
},
close() {
this.$refs.popup.close();
}
},
};
</script>
<style scoped lang="scss">
// .popup-wrapper {
// position: relative;
// height: 100vh;
// }
.popup-box {
// position: absolute;
// bottom: 0;
// width: 100%;
// display: flex;
// flex-direction: column;
position: relative;
margin-top: 286rpx;
background-color: #f8f9f9;
min-height: 1154rpx;
height: 1160rpx;
padding-bottom: 30rpx;
.payment-title {
position: relative;
width: 100%;
height: 96rpx;
padding: 24rpx 0 26rpx;
text-align: center;
border-bottom: 1px solid #e8e8e8;
.icon-close {
position: absolute;
right: 0;
top: 0;
width: 160rpx;
height: 96rpx;
font-size: 50rpx;
text-align: right;
padding-right: 20rpx;
line-height: 96rpx;
}
}
}
.popup-content {
......@@ -162,9 +203,52 @@ export default {
color: #1a1a1a;
}
}
.corporate-content {
width: 1080rpx;
background-color: #fff;
border-radius: 24rpx;
.bank-logo {
width: 100%;
height: 136rpx;
}
.bank-info {
font-weight: 500;
font-size: 32rpx;
padding: 27rpx 80rpx 39rpx;
.bank-item {
display: flex;
align-items: center;
margin-bottom: 16rpx;
&:last-child {
margin-bottom: 0;
}
.bank-label {
color: #6C6C70;
line-height: 94rpx;
}
.bank-value {
box-sizing: border-box;
background-color: #F8F9F9;
border-radius: 8rpx;
width: 740rpx;
height: 80rpx;
line-height: 80rpx;
padding-left: 24rpx;
font-weight: 500;
font-size: 32rpx;
color: #1A1A1A;
letter-spacing: 0;
}
}
}
}
}
}
.payment-done {
position: absolute;
bottom: 30rpx;
left: 50%;
transform: translateX(-50%);
width: calc(100% - 240rpx);
height: 80rpx;
font-weight: 500;
......@@ -172,9 +256,6 @@ export default {
color: #ffffff;
text-align: center;
line-height: 80rpx;
// padding: 18rpx 0;
margin: 112rpx 120rpx 30rpx;
// margin-top: auto;
background-color: #2c66f7;
border-radius: 40rpx;
}
......
......@@ -3,7 +3,7 @@
* @Author: huyue
* @Date: 2024-04-07 14:39:40
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 14:51:14
* @LastEditTime: 2024-04-08 16:44:42
-->
<template>
<view class="container">
......@@ -58,7 +58,15 @@
export default {
data() {
return {
moduleList: []
moduleList: [
{
id: 1,
sort: 1,
thumbnail: "https://glsk-oss.oss-cn-shenzhen.aliyuncs.com/quality/11.png",
title: "问界三包政策",
type: 1,
}
]
};
},
onLoad(options) {
......@@ -135,7 +143,7 @@ export default {
}
.store-addr {
display: flex;
align-items: flex-start;
align-items: stretch;
padding: 0 16rpx 60rpx;
margin-top: 38rpx;
.icon-addr {
......@@ -148,6 +156,7 @@ export default {
color: #6C6C70;
word-wrap: break-word;
white-space: normal;
line-height: 32rpx;
}
}
}
......
......@@ -11,6 +11,7 @@ export const STORAGE_OBJECTkEY = {
DEFAULT_GET_STORAGEKEY,
mock_data: "mock_data",
storageFile: "storageFile",
userInfo: 'userInfo'
};
// 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!