Commit 6051d3d1 by 前端

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

2 parents ffd5f106 1d0dec53
......@@ -50,4 +50,12 @@ module.exports = {
...data
});
},
// 历史订单列表
getQuotationList(data) {
return http.post({
method: 'dj.api.smartcarlife.vehicle.damage.upgrade.quotation.page',
projectName: 'boutique',
...data
})
}
};
<template>
<view class="content">
<view class="wn-canvas">
<template v-if="false">
<template v-if="showPenBox">
<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>
</template>
<template v-if="showPenBox">
<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>
</template>
<image
v-if="isLandScape"
src="./img/color.png"
......@@ -64,8 +64,8 @@
>
<canvas
class="board-canvas"
canvas-id="drawCanvas"
disable-scroll="true"
:canvas-id="canvasId"
:disable-scroll="drawStatus"
@touchstart="touchStart"
@touchmove="touchMove"
@touchend="touchEnd"
......@@ -78,11 +78,11 @@
>
</view>
</view>
<color
<!-- <color
:colorShow="colorShow"
@colorPickTap="colorPickTapHandler"
></color>
<view
></color> -->
<!-- <view
class="btn-box"
v-if="showSave"
>
......@@ -90,7 +90,7 @@
type="primary"
@click="saveImage"
>保存</button>
</view>
</view> -->
</view>
</template>
......@@ -113,7 +113,7 @@ export default {
mode: "pen", //操作模式
currentColor: "red", //当前画笔颜色
bgColor: "#fff", //画板背景颜色
lineWidth: 20, //画笔粗细 px
lineWidth: 3, //画笔粗细 px
lastRect: {}, //运动轨迹最后一个方形
lastCircle: {}, //运动轨迹最后一个圆形
//工具箱
......@@ -194,7 +194,7 @@ export default {
toolsShow: true,
isLandScape: false, //是否横屏
aspectRatio: 1,//图片宽高比
showPenBox: false
showPenBox: false
};
},
......@@ -215,18 +215,27 @@ export default {
type: Boolean,
default: false
},
drawStatus: Boolean
drawStatus: Boolean,
canvasId: {
type: String,
default: 'drawCanvas'
}
},
mounted (opt) {
this.drawContext = uni.createCanvasContext('drawCanvas', this);
this.drawContext = uni.createCanvasContext(this.canvasId, this);
this.initBoard();
},
watch: {
'drawImage' (n) {
if (n) this.initBoard()
}
},
methods: {
colorShowHandel () {
this.colorShow = !this.colorShow;
},
chooseTools (item) {
console.log(item);
// console.log(item);
this.colorShow = false;
if (item.key == "back") {
//撤回
......@@ -248,9 +257,9 @@ export default {
this.colorShowHandel()
}
if(item.key == 'line'){
this.showPenBox = !this.showPenBox
}
if (item.key == 'line') {
this.showPenBox = !this.showPenBox
}
if (item.key == "download") {
//下载
this.downloadHandle()
......@@ -269,7 +278,7 @@ export default {
this.toolsShow = !this.toolsShow
},
penWidthChange (e) {
this.lineWidth = e.detail.value;
if (e?.detail?.value) this.lineWidth = e.detail.value;
this.drawContext.setLineWidth(this.lineWidth);
},
//开始绘制曲线
......@@ -493,7 +502,7 @@ export default {
x,
y
} = e.touches[0]
console.log("开始touch");
// console.log("开始touch");
switch (this.mode) {
case "pen":
this.penBegin(x, y)
......@@ -537,7 +546,7 @@ export default {
} = e.touches[0]
this.lastX = x;
this.lastY = y;
console.log("touch移动");
// console.log("touch移动");
switch (this.mode) {
case "pen":
this.drawPen(x, y)
......@@ -576,7 +585,7 @@ export default {
x,
y
} = e.changedTouches[0]
console.log("touch结束");
// console.log("touch结束");
switch (this.mode) {
case "pen":
this.lineEnd()
......@@ -674,7 +683,7 @@ export default {
//选择画笔颜色
colorPickTapHandler (obj) {
console.log('我点击的颜色:' + JSON.stringify(obj));
// console.log('我点击的颜色:' + JSON.stringify(obj));
this.colorShow = false;
this.tools.forEach(item => {
item.active = false;
......@@ -695,18 +704,18 @@ export default {
}
if (this.saveImageType == 2 || this.saveImageType == 3) {
uni.canvasToTempFilePath({
canvasId: 'drawCanvas',
canvasId: this.canvasId,
success: function (res) {
console.log('回调参数:' + JSON.stringify(res));
// console.log('回调参数:' + JSON.stringify(res));
// 在H5平台下,tempFilePath 为 base64
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: function (res) {
console.log('成功回调参数:' + JSON.stringify(res));
// console.log('成功回调参数:' + JSON.stringify(res));
that.$emit("dowmloadSuc", JSON.stringify(res))
},
fail: function (res) {
console.log('失败回调参数:' + JSON.stringify(res));
// console.log('失败回调参数:' + JSON.stringify(res));
that.$emit("dowmloadErr", JSON.stringify(res))
}
});
......@@ -721,9 +730,9 @@ export default {
that.saveImageUrl()
} else {
uni.canvasToTempFilePath({
canvasId: 'drawCanvas',
canvasId: this.canvasId,
success: function (res) {
console.log(res);
// console.log(res);
that.$emit("saveImage", res.tempFilePath)
}
}, this)
......@@ -741,7 +750,7 @@ export default {
this.drawContext.draw();
this.drawHistory()
uni.canvasToTempFilePath({
canvasId: 'drawCanvas',
canvasId: this.canvasId,
success: function (res) {
that.$emit("saveImage", res.tempFilePath)
}
......@@ -794,13 +803,12 @@ export default {
} else {
this.isLandScape = false
}
console.log(this.isLandScape);
// console.log(this.isLandScape);
let imageInfoObj = (await uni.getImageInfo({
src: this.drawImage
}))[1] || {};
console.log(imageInfoObj);
// console.log(imageInfoObj);
this.aspectRatio = imageInfoObj.width / imageInfoObj.height;
if (this.isUnderBkg) {
this.bgColor = "rgba(0,0,0,0)"
......@@ -810,9 +818,8 @@ export default {
this.drawContext.setLineCap('round') // 让线条圆润
this.drawContext.strokeStyle = this.currentColor; //设置画笔颜色
this.drawContext.setLineWidth(this.lineWidth); //设置画笔粗细
//设置背景
this.$nextTick(() => {
this.penWidthChange()
this.drawContext.setLineWidth(this.lineWidth)
this.fillBackground();
})
}
......@@ -821,7 +828,7 @@ export default {
</script>
<style lang="scss">
.content {
.wn-canvas {
height: 100%;
width: 100%;
box-sizing: border-box;
......@@ -838,16 +845,16 @@ export default {
}
.pen-box {
position: absolute;
top: 0;
left: 0;
background-color: #fff;
position: absolute;
top: 0;
left: 0;
background-color: #fff;
display: flex;
justify-content: space-around;
align-items: center;
height: 3rem;
z-index: 2;
width: 100%;
z-index: 2;
width: 100%;
.pen {
width: 3rem;
border-radius: 0.2rem;
......@@ -897,10 +904,14 @@ export default {
}
}
.under-image {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-size: cover;
background-repeat: no-repeat;
z-index: -1;
}
/* 竖屏 */
......
......@@ -4,26 +4,24 @@
},
"pages": [
{
"path": "pages/informationEntry/informationEntry",
"path": "pages/common/login",
"style": {
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
"navigationStyle": "custom"
}
},
{
"path": "pages/common/login",
"path": "pages/home/home",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "pages/home/home",
"path": "pages/informationEntry/informationEntry",
"style": {
"navigationStyle": "custom"
"navigationBarTitleText": "信息录入",
"enablePullDownRefresh": false
}
},
{
"path": "pages/detail/detail",
"style": {
......
......@@ -203,8 +203,9 @@ export default {
this.jumpPage(item)
},
jumpPage (item) {
console.log(item)
let { openSceneArr, selectIndex } = this,
{ shopMerchantName, shopMerchantId } = item,
{ merchantName: shopMerchantName, merchantId: shopMerchantId } = item,
userInfo = uni.$storage.get('userInfo')
if (!openSceneArr?.length && !userInfo?.isSuper) return wx.$util.showToast('暂无开通业务,请联系总部管理员')
uni.$storage.set('userInfo', {
......
......@@ -19,8 +19,14 @@
:maxlength="i.maxlength"
/>
</template>
<template>
<template v-else>
<view class="select">
<uni-icons
class="arrow"
type="down"
:size="16"
></uni-icons>
</view>
</template>
</view>
</view>
......@@ -35,7 +41,8 @@
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
drawStatus
:canvasId="`c-1-${index}`"
:drawStatus="penSwitch"
></wnCanvas>
</view>
</template>
......@@ -44,11 +51,10 @@
</template>
<script type='text/ecmascript-6'>
import Tabs from './Tabs.vue'
export default {
components: { Tabs },
props: {
views: Array
views: Array,
penSwitch: Boolean
},
name: 'Media_1',
data () {
......@@ -84,9 +90,7 @@ export default {
mounted () {
},
methods: {
changeView (index) {
},
}
}
</script>
......@@ -100,8 +104,7 @@ export default {
left: 0;
top: 0;
width: 100%;
height: 864rpx;
background-color: #096;
height: 432rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
......@@ -109,6 +112,7 @@ export default {
overflow: hidden;
position: relative;
z-index: 1;
min-height: calc(100vh - 272rpx);
.title {
font-weight: 500;
font-size: 48rpx;
......@@ -116,17 +120,51 @@ export default {
padding: 32rpx 0;
text-align: center;
}
.form{
.form {
display: flex;
flex-wrap: wrap;
gap: 28rpx 0;
&-item{
padding: 30rpx 0;
&-item {
flex: 50%;
display: flex;
align-items: center;
.value{}
color: #292d33;
font-size: 32rpx;
box-sizing: border-box;
padding-right: 64rpx;
.label {
margin-left: auto;
flex-shrink: 0;
}
.value {
width: 828rpx;
height: 80rpx;
border: 2rpx solid #e8e8ea;
background: #ffffff;
margin-left: 32rpx;
box-sizing: border-box;
padding: 0 40rpx;
input,
.select {
width: 100%;
height: 100%;
}
.select {
display: flex;
align-items: center;
.arrow {
margin-left: auto;
}
}
}
}
}
.view {
position: relative;
z-index: 2;
margin-top: 36rpx;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-2.png" />
</view>
<view class="content">
<view class="title">问界·商城延保价格明细</view>
<tabs
:list="views"
@tabclick="changeView"
/>
<view class="canvas-box">
<template v-for="(i,index) in views">
<view
:key="index"
v-show="viewIndex == index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-2-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import Tabs from './Tabs.vue'
export default {
components: { Tabs },
props: {
views: Array,
penSwitch: Boolean
},
name: 'Media_2',
data () {
return {
viewIndex: 0
}
},
mounted () {
},
methods: {
changeView (index) {
console.log()
this.viewIndex = index
},
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 146rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 368rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-5.png" />
</view>
<view class="content">
<view class="canvas-box">
<template v-for="(i,index) in views">
<view
:key="index"
v-show="viewIndex == index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-3-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
views: Array,
penSwitch: Boolean
},
name: 'Media_3',
data () {
return {
viewIndex: 0
}
},
mounted () {
},
methods: {
changeView (index) {
console.log()
this.viewIndex = index
},
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 146rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 368rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-4.png" />
</view>
<view class="content">
<view class="title">问界·汽车产品三包凭证</view>
<tabs
:list="views"
@tabclick="changeView"
/>
<view class="canvas-box">
<template v-for="(i,index) in views">
<view
:key="index"
v-show="viewIndex == index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-4-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import Tabs from './Tabs.vue'
export default {
components: { Tabs },
props: {
views: Array,
penSwitch: Boolean
},
name: 'Media_4',
data () {
return {
viewIndex: 0
}
},
mounted () {
},
methods: {
changeView (index) {
console.log()
this.viewIndex = index
},
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 146rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 368rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-5.png" />
</view>
<view class="content">
<view class="canvas-box">
<template v-for="(i,index) in views">
<view
:key="index"
v-show="viewIndex == index"
>
<wnCanvas
saveImageType="3"
:drawImage="i.detailUrl"
:isUnderBkg="true"
:drawStatus="penSwitch"
:canvasId="`c-5-${index}`"
></wnCanvas>
</view>
</template>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
export default {
props: {
views: Array,
penSwitch: Boolean
},
name: 'Media_5',
data () {
return {
viewIndex: 0
}
},
mounted () {
},
methods: {
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 146rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 368rpx;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
}
}
</style>
\ No newline at end of file
<template>
<view class="layout">
<view class="bg">
<glsx-image src="media/bg-6.png" />
</view>
<view class="content">
<view class="title">历史成交记录</view>
<Tabs :list="list" @tabclick="tabclick" />
<view class="card-list">
<uni-grid :column="3" :show-border="false" :square="false">
<uni-grid-item v-for="item in historyList" :key="item.id">
<view class="card-item">
<view class="name">{{ item.customerName }}</view>
<view class="goods-name">{{ item.goodsName }}</view>
<view class="card-info"><view>车架号</view><view>{{ item.carVin || 4654651 }}</view></view>
<view class="card-info"><view>工单号</view><view>{{ item.orderId }}</view></view>
<view class="card-info"><view>订单时间</view><view>{{ item.createdTime }}</view></view>
<view class="card-info"><view>交易流水号</view><view>{{ item.transactionNo }}</view></view>
<view class="card-info"><view>支付方式</view><glsx-image class="pay-type" :src="`media/${payType[item.payType]}.png`" /></view>
<view class="card-info"><view>实收金额</view><view class="price">¥{{ item.equityPrice }}</view></view>
</view>
</uni-grid-item>
</uni-grid>
</view>
</view>
</view>
</template>
<script type='text/ecmascript-6'>
import Tabs from './Tabs.vue';
export default {
name: 'Media_6',
props: {
},
components: {Tabs},
data () {
return {
list: [
{
tabName: '问界 M5',
value: 'M5'
},
{
tabName: '问界 M7',
value: 'M7'
},
{
tabName: '问界 M9',
value: 'M9'
}
],
historyList: [],
payType: {
1: 'icon-weixin',
2: 'icon-shop'
},
goodsName: 'M5',
shopMerchantId: ''
}
},
mounted () {
const { shopMerchantId } = uni.$storage.get("userInfo");
this.shopMerchantId = shopMerchantId
this.getQuotationList();
},
methods: {
async getQuotationList() {
const {goodsName, shopMerchantId} = this
const data = await uni.$api.commonApi.getQuotationList({
currentPage: 1,
pageSize: 18,
merchantId: shopMerchantId,
orderStatus: 3,
goodsName
})
this.historyList = data.list
},
tabclick(index) {
console.log(index, '======')
this.goodsName = this.list[index].value
this.getQuotationList()
}
}
}
</script>
<style scoped lang='scss'>
.layout {
padding-top: 136rpx;
position: relative;
.bg {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 176rpx;
background-color: #096;
}
.content {
border-radius: 40rpx 40rpx 0 0;
background: linear-gradient(180deg, #f7f9fc 0%, #f7f9fc 100%);
overflow: hidden;
position: relative;
z-index: 1;
.title {
font-weight: 500;
font-size: 48rpx;
color: #1a1a1a;
padding: 32rpx 0;
text-align: center;
}
.card-list {
margin: 0 72rpx;
.card-item {
margin: 16rpx auto;
padding: 24rpx 40rpx;
width: 664rpx;
// height: 440rpx;
background: #FFFFFF;
border: 2rpx solid #DCE0E6;
border-radius: 16rpx;
.name {
font-weight: 500;
font-size: 32rpx;
color: #1A1A1A;
margin-bottom: 16rpx;
}
.goods-name {
margin-bottom: 16rpx;
font-weight: 500;
font-size: 32rpx;
color: #2C66F7;
}
.card-info {
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: #999999;
line-height: 32rpx;
margin-bottom: 16rpx;
.pay-type {
width: 32rpx;
height: 32rpx;
}
.price {
font-weight: 600;
font-size: 36rpx;
color: #14CC68;
}
}
}
}
}
}
</style>
\ No newline at end of file
......@@ -6,7 +6,7 @@
:key="index"
@click="tabClick(index)"
>
{{item}}
{{item.tabName}}
</view>
</template>
</view>
......@@ -27,6 +27,7 @@ export default {
},
methods: {
tabClick (index) {
this.tabIndex = index
this.$emit('tabclick', index)
}
}
......
......@@ -76,12 +76,12 @@ export default {
icon: 'tool/4.png'
},
{
id: 5,
id: 6,
label: '历史成交',
icon: 'tool/5.png'
},
{
id: 6,
id: 5,
label: '质保升级',
icon: 'tool/6.png'
}
......@@ -103,8 +103,7 @@ export default {
.tool-box {
position: fixed;
right: 40rpx;
top: 50%;
transform: translateY(-50%);
top: 5%;
z-index: 998;
width: 128rpx;
.btn {
......@@ -130,6 +129,7 @@ export default {
.hideIcon {
height: 0;
overflow: hidden;
opacity: 0;
.icon {
height: 0;
margin-bottom: 0;
......
......@@ -3,12 +3,19 @@
* @Author: huyue
* @Date: 2024-04-08 11:30:30
* @LastEditors: huyue
* @LastEditTime: 2024-04-08 20:43:15
* @LastEditTime: 2024-04-09 14:48:03
-->
<template>
<view class="detail-box">
<view class="nav-bar">
<view class="back" @click="back">
<view
class="back"
@click="back"
>
<uni-icons
type="left"
:size="32"
></uni-icons>
</view>
</view>
<tool-box
......@@ -16,8 +23,28 @@
@choose="choose"
@finish="open"
/>
<media_1 :views="mediaList" />
<view :class="['view',{showView:id == 1}]">
<media_1 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 2}]">
<media_2 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 3}]">
<media_3 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 4}]">
<media_4 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 5}]">
<media_5 :views="mediaList" :penSwitch="type != 'preview' && drawStatus" />
</view>
<view :class="['view',{showView:id == 6}]">
<media_6 :views="mediaList" />
</view>
<pay-pop ref="pay"></pay-pop>
<view class="pen-box">
<glsx-image src="media" />
</view>
</view>
</template>
<script>
......@@ -25,14 +52,21 @@ import payPop from './components/payPop.vue';
import ToolBox from './components/ToolBox.vue'
import myClick from "@/mixin/click";
import Media_1 from './components/Media_1.vue'
import Media_2 from './components/Media_2.vue'
import Media_3 from './components/Media_3.vue'
import Media_4 from './components/Media_4.vue'
import Media_5 from './components/Media_5.vue'
import Media_6 from './components/Media_6.vue'
import GlsxImage from '../../components/GlsxImage.vue';
export default {
components: { ToolBox, payPop, Media_1 },
components: { ToolBox, payPop, Media_1, Media_2, Media_3, Media_4, Media_5, Media_6, GlsxImage },
mixins: [myClick],
data () {
return {
type: 'preview',
id: '',
mediaList: []
mediaList: [],
drawStatus:false
};
},
onLoad (options) {
......@@ -46,7 +80,8 @@ export default {
},
/**切换素材 */
choose (e) {
console.log(e)
this.id = e.id
this.getFindSoureDetail(e.id)
},
async getFindSoureDetail (id) {
try {
......@@ -55,21 +90,24 @@ export default {
}
},
back(){
back () {
uni.navigateBack()
}
},
};
</script>
<style scoped lang="scss">
.nav-bar{
.detail-box {
position: relative;
}
.nav-bar {
position: fixed;
width: 100%;
height: 96rpx;
left: 0;
top: 48rpx;
z-index: 2;
.back{
z-index: 9;
.back {
height: 100%;
aspect-ratio: 1/1;
display: flex;
......@@ -77,4 +115,19 @@ export default {
justify-content: center;
}
}
.view {
position: absolute;
z-index: -1;
opacity: 0;
left: 0;
top: 0;
display: none;
}
.showView {
display: block;
z-index: 2;
opacity: 1;
width: 100%;
height: 100%;
}
</style>
......@@ -2,8 +2,8 @@
* @Description: 首页
* @Author: huyue
* @Date: 2024-04-07 14:39:40
* @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2024-04-09 14:37:11
* @LastEditors: huyue
* @LastEditTime: 2024-04-09 15:23:43
-->
<template>
<view class="container">
......@@ -33,7 +33,7 @@
src="home/icon-addr.png"
mode="scaleToFill"
/>
<view class="addr-text">{{ userInfo.merchantName }}</view>
<view class="addr-text">{{ userInfo.shopMerchantName }}</view>
</view>
</view>
</view>
......@@ -92,7 +92,7 @@ export default {
id: "",
};
},
onLoad(options) {
mounted() {
this.userInfo = uni.$storage.get("userInfo");
this.getSoure();
},
......
## 1.4.0(2021-11-19)
- 优化 组件UI,并提供设计资源,详见:[https://uniapp.dcloud.io/component/uniui/resource](https://uniapp.dcloud.io/component/uniui/resource)
- 文档迁移,详见:[https://uniapp.dcloud.io/component/uniui/uni-grid](https://uniapp.dcloud.io/component/uniui/uni-grid)
## 1.3.2(2021-11-09)
- 新增 提供组件设计资源,组件样式调整
## 1.3.1(2021-07-30)
- 优化 vue3下事件警告的问题
## 1.3.0(2021-07-13)
- 组件兼容 vue3,如何创建vue3项目,详见 [uni-app 项目支持 vue3 介绍](https://ask.dcloud.net.cn/article/37834)
## 1.2.4(2021-05-12)
- 新增 组件示例地址
## 1.2.3(2021-02-05)
- 调整为uni_modules目录规范
<template>
<view v-if="width" :style="'width:'+width+';'+(square?'height:'+width:'')" class="uni-grid-item">
<view :class="{ 'uni-grid-item--border': showBorder, 'uni-grid-item--border-top': showBorder && index < column, 'uni-highlight': highlight }"
:style="{'border-right-color': borderColor ,'border-bottom-color': borderColor ,'border-top-color': borderColor }"
class="uni-grid-item__box" @click="_onClick">
<slot />
</view>
</view>
</template>
<script>
/**
* GridItem 宫格
* @description 宫格组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=27
* @property {Number} index 子组件的唯一标识 ,点击gird会返回当前的标识
*/
export default {
name: 'UniGridItem',
inject: ['grid'],
props: {
index: {
type: Number,
default: 0
}
},
data() {
return {
column: 0,
showBorder: true,
square: true,
highlight: true,
left: 0,
top: 0,
openNum: 2,
width: 0,
borderColor: '#e5e5e5'
}
},
created() {
this.column = this.grid.column
this.showBorder = this.grid.showBorder
this.square = this.grid.square
this.highlight = this.grid.highlight
this.top = this.hor === 0 ? this.grid.hor : this.hor
this.left = this.ver === 0 ? this.grid.ver : this.ver
this.borderColor = this.grid.borderColor
this.grid.children.push(this)
// this.grid.init()
this.width = this.grid.width
},
beforeDestroy() {
this.grid.children.forEach((item, index) => {
if (item === this) {
this.grid.children.splice(index, 1)
}
})
},
methods: {
_onClick() {
this.grid.change({
detail: {
index: this.index
}
})
}
}
}
</script>
<style lang="scss" scoped>
.uni-grid-item {
/* #ifndef APP-NVUE */
height: 100%;
display: flex;
/* #endif */
/* #ifdef H5 */
cursor: pointer;
/* #endif */
}
.uni-grid-item__box {
/* #ifndef APP-NVUE */
display: flex;
width: 100%;
/* #endif */
position: relative;
flex: 1;
flex-direction: column;
// justify-content: center;
// align-items: center;
}
.uni-grid-item--border {
position: relative;
/* #ifdef APP-NVUE */
border-bottom-color: #D2D2D2;
border-bottom-style: solid;
border-bottom-width: 0.5px;
border-right-color: #D2D2D2;
border-right-style: solid;
border-right-width: 0.5px;
/* #endif */
/* #ifndef APP-NVUE */
z-index: 0;
border-bottom: 1px #D2D2D2 solid;
border-right: 1px #D2D2D2 solid;
/* #endif */
}
.uni-grid-item--border-top {
position: relative;
/* #ifdef APP-NVUE */
border-top-color: #D2D2D2;
border-top-style: solid;
border-top-width: 0.5px;
/* #endif */
/* #ifndef APP-NVUE */
border-top: 1px #D2D2D2 solid;
z-index: 0;
/* #endif */
}
.uni-highlight:active {
background-color: #f1f1f1;
}
</style>
<template>
<view class="uni-grid-wrap">
<view :id="elId" ref="uni-grid" class="uni-grid" :class="{ 'uni-grid--border': showBorder }" :style="{ 'border-left-color':borderColor}">
<slot />
</view>
</view>
</template>
<script>
// #ifdef APP-NVUE
const dom = uni.requireNativePlugin('dom');
// #endif
/**
* Grid 宫格
* @description 宫格组件
* @tutorial https://ext.dcloud.net.cn/plugin?id=27
* @property {Number} column 每列显示个数
* @property {String} borderColor 边框颜色
* @property {Boolean} showBorder 是否显示边框
* @property {Boolean} square 是否方形显示
* @property {Boolean} Boolean 点击背景是否高亮
* @event {Function} change 点击 grid 触发,e={detail:{index:0}},index 为当前点击 gird 下标
*/
export default {
name: 'UniGrid',
emits:['change'],
props: {
// 每列显示个数
column: {
type: Number,
default: 3
},
// 是否显示边框
showBorder: {
type: Boolean,
default: true
},
// 边框颜色
borderColor: {
type: String,
default: '#D2D2D2'
},
// 是否正方形显示,默认为 true
square: {
type: Boolean,
default: true
},
highlight: {
type: Boolean,
default: true
}
},
provide() {
return {
grid: this
}
},
data() {
const elId = `Uni_${Math.ceil(Math.random() * 10e5).toString(36)}`
return {
elId,
width: 0
}
},
created() {
this.children = []
},
mounted() {
this.$nextTick(()=>{
this.init()
})
},
methods: {
init() {
setTimeout(() => {
this._getSize((width) => {
this.children.forEach((item, index) => {
item.width = width
})
})
}, 50)
},
change(e) {
this.$emit('change', e)
},
_getSize(fn) {
// #ifndef APP-NVUE
uni.createSelectorQuery()
.in(this)
.select(`#${this.elId}`)
.boundingClientRect()
.exec(ret => {
this.width = parseInt((ret[0].width - 1) / this.column) + 'px'
fn(this.width)
})
// #endif
// #ifdef APP-NVUE
dom.getComponentRect(this.$refs['uni-grid'], (ret) => {
this.width = parseInt((ret.size.width - 1) / this.column) + 'px'
fn(this.width)
})
// #endif
}
}
}
</script>
<style lang="scss" scoped>
.uni-grid-wrap {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex: 1;
flex-direction: column;
/* #ifdef H5 */
width: 100%;
/* #endif */
}
.uni-grid {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
// flex: 1;
flex-direction: row;
flex-wrap: wrap;
}
.uni-grid--border {
position: relative;
/* #ifdef APP-NVUE */
border-left-color: #D2D2D2;
border-left-style: solid;
border-left-width: 0.5px;
/* #endif */
/* #ifndef APP-NVUE */
z-index: 1;
border-left: 1px #D2D2D2 solid;
/* #endif */
}
</style>
{
"id": "uni-grid",
"displayName": "uni-grid 宫格",
"version": "1.4.0",
"description": "Grid 宫格组件,提供移动端常见的宫格布局,如九宫格。",
"keywords": [
"uni-ui",
"uniui",
"九宫格",
"表格"
],
"repository": "https://github.com/dcloudio/uni-ui",
"engines": {
"HBuilderX": ""
},
"directories": {
"example": "../../temps/example_temps"
},
"dcloudext": {
"category": [
"前端组件",
"通用组件"
],
"sale": {
"regular": {
"price": "0.00"
},
"sourcecode": {
"price": "0.00"
}
},
"contact": {
"qq": ""
},
"declaration": {
"ads": "无",
"data": "无",
"permissions": "无"
},
"npmurl": "https://www.npmjs.com/package/@dcloudio/uni-ui"
},
"uni_modules": {
"dependencies": ["uni-scss","uni-icons"],
"encrypt": [],
"platforms": {
"cloud": {
"tcb": "y",
"aliyun": "y"
},
"client": {
"App": {
"app-vue": "y",
"app-nvue": "y"
},
"H5-mobile": {
"Safari": "y",
"Android Browser": "y",
"微信浏览器(Android)": "y",
"QQ浏览器(Android)": "y"
},
"H5-pc": {
"Chrome": "y",
"IE": "y",
"Edge": "y",
"Firefox": "y",
"Safari": "y"
},
"小程序": {
"微信": "y",
"阿里": "y",
"百度": "y",
"字节跳动": "y",
"QQ": "y"
},
"快应用": {
"华为": "u",
"联盟": "u"
},
"Vue": {
"vue2": "y",
"vue3": "y"
}
}
}
}
}
## Grid 宫格
> **组件名:uni-grid**
> 代码块: `uGrid`
宫格组件。
### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-grid)
#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!