Commit 22a5f284 by songbingqi

修复部分bug

parent cd89bfe0
<template>
<div>
<u-popup :show="show" :round="10" mode="bottom" @close="close" :safeAreaInsetBottom="false" zIndex="10078" :customStyle="popupStyle">
<view class="bigBox" :style="{'height':'94vh'}" @touchstart="start" @touchmove="move" @touchend="end" ref="op">
<view class="bigBox" :style="{'margin-top':'-20rpx'}" @touchstart="start" @touchmove.stop.prevent="move" @touchend="end" ref="op">
<view class="mainBox" id="mainBox">
<div class="order_flow" >
<div class="code">取单码 {{ orderInfo.orderNum }}</div>
<!-- <image mode="scaleToFill" :src="qrCode" class="qr_code"></image> -->
......@@ -29,6 +30,8 @@
</view>
</div>
</view>
</view>
</u-popup>
</div>
</template>
......@@ -44,7 +47,6 @@ export default {
clientYEnd:0,
bigBox:{},
popupStyle:{
'top':'0rpx',
'transform':'translate(0rpx, 0rpx)'
}
}
......@@ -81,7 +83,7 @@ export default {
}
}
},
onLoad() {
mounted() {
},
methods: {
......@@ -89,8 +91,8 @@ export default {
this.clientYStart = e.changedTouches[0].clientY
},
move(e) {
// this.clientYEnd = e.changedTouches[0].clientY;
// const val = parseInt((this.clientYStart-this.clientYEnd))
this.clientYEnd = e.changedTouches[0].clientY;
const val = parseInt((this.clientYStart-this.clientYEnd))
// if(val<0){
// this.popupStyle.transform = `translateY(${-val}px)`
// }
......@@ -104,6 +106,7 @@ export default {
this.close()
}else{
console.log('滑动了:'+val + ',回到顶部')
this.popupStyle['animationDuration'] = '2s';
this.popupStyle.transform = 'translate(0rpx, 0rpx)'
}
// this.popupStyle.top = val+'rpx'
......@@ -115,7 +118,7 @@ export default {
this.show = false;
},
open(data, path) {
// this.popupStyle.transform = 'translate(0rpx, 0rpx)'
this.popupStyle.transform = 'translate(0rpx, 0rpx)'
this.show = true;
this.orderInfo = data;
// console.log("order:"+JSON.stringify(this.orderInfo));
......@@ -180,6 +183,7 @@ export default {
background: #F7F7F7;
border-radius: 10px 10px 0px 0px;
overflow: auto;
height: 94vh;
z-index: 10078 !important;
}
......
<template>
<view>
<view class="popup_box" id="popup_box" :animation="animationData" :style="[positionStyle]" @touchstart="start" @touchmove.stop.prevent="move" @touchend="end" >
<!-- <button @click="hidden">隐藏</button> -->
</view>
</view>
</template>
<script>
export default {
data(){
return {
f_info:{},
clientYStart:0,
clientYEnd:0,
positionStyle: {
'--position-top': 0
},
animation:'',
animationData: {},
}
},
mounted() {
this.animation = uni.createAnimation()
const query = uni.createSelectorQuery().in(this);
query.select('#popup_box').boundingClientRect(data => {
this.f_info = data;
console.log(data)
}).exec();
},
methods:{
hidden(){
console.log(123)
},
start(e) {
this.clientYStart = e.changedTouches[0].clientY
},
move(e) {
this.clientYEnd = e.changedTouches[0].clientY;
const val = parseInt((this.clientYStart-this.clientYEnd))
this.positionStyle['--position-top'] = -val+'rpx'
},
end(e) {
this.clientYEnd = e.changedTouches[0].clientY;
const val = parseInt((this.clientYStart-this.clientYEnd))
console.log(val)
if(val<-300){
console.log('滑动了:'+val + ',关闭')
}else{
console.log('滑动了:'+val + ',回到顶部')
this.positionStyle['--position-top'] = 0+'rpx'
}
}
}
}
</script>
<style lang="scss" scoped>
.popup_box {
border: 1px solid gray;
height: 94vh;
position: fixed;
bottom: 0rpx;
width: 100%;
z-index: 10079;
background: red;
transform: translateY(var(--position-top));
}
</style>
\ No newline at end of file
......@@ -119,11 +119,14 @@ export default {
// 从订阅消息进入
this.option = JSON.stringify(option)
const { orderId } = option
let Authorization = uni.getStorageSync('Authorization')
console.log(Authorization)
if(orderId){
oId = orderId
if(!this.userms){
if(!Authorization){
uni.switchTab({ url: '/pages/order/order' })
return
}else{
oId = orderId
}
}else{
oId = uni.getStorageSync('orderId');
......
......@@ -55,11 +55,13 @@
style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" />
<show-toast ref="toast"/>
<taBar select="0"></taBar>
<!-- <TestPopup /> -->
<ShopCar ref="shopbar" />
</view>
</template>
<script>
import MenuAssembly from '@/components/menuAssembly'
import TestPopup from '@/components/TestPopup/index.vue'
import AreaPicker from '@/components/AreaPicker/index.vue'
import User from '@/request/user'
import ShopCar from '../../components/shopCar/shopCar.vue'
......@@ -71,7 +73,7 @@ import Order from '@/request/order'
import OrderQrCode from '@/components/OrderQrCode'
import QRCode from '@/utils/qrCode'
export default {
components: { ShopCar, MenuAssembly, OrderQrCode, AreaPicker },
components: { ShopCar, MenuAssembly, OrderQrCode, AreaPicker, TestPopup },
data() {
return {
shopInfo: { name: '请选择' },// 店铺信息
......@@ -231,7 +233,7 @@ export default {
// 加入购物车数据
async getallNum(item, category) {
let itemCopy = JSON.parse(JSON.stringify(item));
const sku = itemCopy.skus.find(v => v.isDefault == 1 && v.state != 2) || itemCopy.skus.find(v => v.isDefault == 0 && v.state != 2);
const sku = itemCopy.skus.find(v => v.isDefault == 1);
const {data} = await Order.checkSku({skuId:sku.skuId})
const {state,goods} = data.data
const newsku = goods.skus.find(v => v.isDefault == 1 && v.state != 2) || goods.skus.find(v => v.isDefault == 0 && v.state != 2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment