Commit 22a5f284 by songbingqi

修复部分bug

parent cd89bfe0
<template> <template>
<div> <div>
<u-popup :show="show" :round="10" mode="bottom" @close="close" :safeAreaInsetBottom="false" zIndex="10078" :customStyle="popupStyle"> <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">
<div class="order_flow" > <view class="mainBox" id="mainBox">
<div class="code">取单码 {{ orderInfo.orderNum }}</div> <div class="order_flow" >
<!-- <image mode="scaleToFill" :src="qrCode" class="qr_code"></image> --> <div class="code">取单码 {{ orderInfo.orderNum }}</div>
<div class="qr_code_readly" v-if="!showMask"> <!-- <image mode="scaleToFill" :src="qrCode" class="qr_code"></image> -->
<image mode="scaleToFill" :src="qrCode" class="qr"></image> <div class="qr_code_readly" v-if="!showMask">
</div> <image mode="scaleToFill" :src="qrCode" class="qr"></image>
<div class="qr_code" v-else> </div>
<image mode="aspectFit" :src="'/static/imgs/erweimazhedang.png'" class="qr"></image> <div class="qr_code" v-else>
</div> <image mode="aspectFit" :src="'/static/imgs/erweimazhedang.png'" class="qr"></image>
<view class="status_text" v-if="showMask">——制作完成后才能扫哦——</view> </div>
<div class="flow_describe" :style="{'padding-top':(!showMask)?'48rpx':'80rpx'}"> <view class="status_text" v-if="showMask">——制作完成后才能扫哦——</view>
<view class="title">扫码流程</view> <div class="flow_describe" :style="{'padding-top':(!showMask)?'48rpx':'80rpx'}">
<image :mode="'aspectFit'" class="flow_img" :src="'/static/imgs/saomaliucheng.png'"></image> <view class="title">扫码流程</view>
</div> <image :mode="'aspectFit'" class="flow_img" :src="'/static/imgs/saomaliucheng.png'"></image>
</div>
</div> </div>
<div class="flow_describe_tips"> <div class="flow_describe_tips">
<view class="title">注意事项</view> <view class="title">注意事项</view>
<view class="text"> <view class="text">
...@@ -28,6 +29,8 @@ ...@@ -28,6 +29,8 @@
<view>5.有问题或对出品任何不满意请联系客服</view> <view>5.有问题或对出品任何不满意请联系客服</view>
</view> </view>
</div> </div>
</view>
</view> </view>
</u-popup> </u-popup>
</div> </div>
...@@ -44,7 +47,6 @@ export default { ...@@ -44,7 +47,6 @@ export default {
clientYEnd:0, clientYEnd:0,
bigBox:{}, bigBox:{},
popupStyle:{ popupStyle:{
'top':'0rpx',
'transform':'translate(0rpx, 0rpx)' 'transform':'translate(0rpx, 0rpx)'
} }
} }
...@@ -81,7 +83,7 @@ export default { ...@@ -81,7 +83,7 @@ export default {
} }
} }
}, },
onLoad() { mounted() {
}, },
methods: { methods: {
...@@ -89,8 +91,8 @@ export default { ...@@ -89,8 +91,8 @@ export default {
this.clientYStart = e.changedTouches[0].clientY this.clientYStart = e.changedTouches[0].clientY
}, },
move(e) { move(e) {
// this.clientYEnd = e.changedTouches[0].clientY; this.clientYEnd = e.changedTouches[0].clientY;
// const val = parseInt((this.clientYStart-this.clientYEnd)) const val = parseInt((this.clientYStart-this.clientYEnd))
// if(val<0){ // if(val<0){
// this.popupStyle.transform = `translateY(${-val}px)` // this.popupStyle.transform = `translateY(${-val}px)`
// } // }
...@@ -104,6 +106,7 @@ export default { ...@@ -104,6 +106,7 @@ export default {
this.close() this.close()
}else{ }else{
console.log('滑动了:'+val + ',回到顶部') console.log('滑动了:'+val + ',回到顶部')
this.popupStyle['animationDuration'] = '2s';
this.popupStyle.transform = 'translate(0rpx, 0rpx)' this.popupStyle.transform = 'translate(0rpx, 0rpx)'
} }
// this.popupStyle.top = val+'rpx' // this.popupStyle.top = val+'rpx'
...@@ -115,7 +118,7 @@ export default { ...@@ -115,7 +118,7 @@ export default {
this.show = false; this.show = false;
}, },
open(data, path) { open(data, path) {
// this.popupStyle.transform = 'translate(0rpx, 0rpx)' this.popupStyle.transform = 'translate(0rpx, 0rpx)'
this.show = true; this.show = true;
this.orderInfo = data; this.orderInfo = data;
// console.log("order:"+JSON.stringify(this.orderInfo)); // console.log("order:"+JSON.stringify(this.orderInfo));
...@@ -180,6 +183,7 @@ export default { ...@@ -180,6 +183,7 @@ export default {
background: #F7F7F7; background: #F7F7F7;
border-radius: 10px 10px 0px 0px; border-radius: 10px 10px 0px 0px;
overflow: auto; overflow: auto;
height: 94vh;
z-index: 10078 !important; 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 { ...@@ -119,11 +119,14 @@ export default {
// 从订阅消息进入 // 从订阅消息进入
this.option = JSON.stringify(option) this.option = JSON.stringify(option)
const { orderId } = option const { orderId } = option
let Authorization = uni.getStorageSync('Authorization')
console.log(Authorization)
if(orderId){ if(orderId){
oId = orderId if(!Authorization){
if(!this.userms){
uni.switchTab({ url: '/pages/order/order' }) uni.switchTab({ url: '/pages/order/order' })
return return
}else{
oId = orderId
} }
}else{ }else{
oId = uni.getStorageSync('orderId'); oId = uni.getStorageSync('orderId');
......
...@@ -55,11 +55,13 @@ ...@@ -55,11 +55,13 @@
style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" /> style="background:#fff;width: 200px;height: 200px; display:block; left:-800rpx;position:absolute;" />
<show-toast ref="toast"/> <show-toast ref="toast"/>
<taBar select="0"></taBar> <taBar select="0"></taBar>
<!-- <TestPopup /> -->
<ShopCar ref="shopbar" /> <ShopCar ref="shopbar" />
</view> </view>
</template> </template>
<script> <script>
import MenuAssembly from '@/components/menuAssembly' import MenuAssembly from '@/components/menuAssembly'
import TestPopup from '@/components/TestPopup/index.vue'
import AreaPicker from '@/components/AreaPicker/index.vue' import AreaPicker from '@/components/AreaPicker/index.vue'
import User from '@/request/user' import User from '@/request/user'
import ShopCar from '../../components/shopCar/shopCar.vue' import ShopCar from '../../components/shopCar/shopCar.vue'
...@@ -71,7 +73,7 @@ import Order from '@/request/order' ...@@ -71,7 +73,7 @@ import Order from '@/request/order'
import OrderQrCode from '@/components/OrderQrCode' import OrderQrCode from '@/components/OrderQrCode'
import QRCode from '@/utils/qrCode' import QRCode from '@/utils/qrCode'
export default { export default {
components: { ShopCar, MenuAssembly, OrderQrCode, AreaPicker }, components: { ShopCar, MenuAssembly, OrderQrCode, AreaPicker, TestPopup },
data() { data() {
return { return {
shopInfo: { name: '请选择' },// 店铺信息 shopInfo: { name: '请选择' },// 店铺信息
...@@ -231,7 +233,7 @@ export default { ...@@ -231,7 +233,7 @@ export default {
// 加入购物车数据 // 加入购物车数据
async getallNum(item, category) { async getallNum(item, category) {
let itemCopy = JSON.parse(JSON.stringify(item)); 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 {data} = await Order.checkSku({skuId:sku.skuId})
const {state,goods} = data.data 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); 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