Merge branch 'wwz_x' of https://e.coding.net/g-cphe0354/xiaochengxusaomadiancan/cashier_weapp into gaohao
This commit is contained in:
@@ -58,22 +58,26 @@
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
titleshow: {//标题是否显示
|
titleshow: { //标题是否显示
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
heightshow: {//是否要占位高度
|
heightshow: { //是否要占位高度
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
iconshow: {//返回键是否显示
|
iconshow: { //返回键是否显示
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
iconcolor:{//返回键颜色
|
iconcolor: { //返回键颜色
|
||||||
type: String,
|
type: String,
|
||||||
default: '#000'
|
default: '#000'
|
||||||
},
|
},
|
||||||
|
navigateBacknavtitle: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
HeighT() { //手机类型的尺寸
|
HeighT() { //手机类型的尺寸
|
||||||
@@ -95,7 +99,11 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
clicknavigateBack() {
|
clicknavigateBack() {
|
||||||
uni.navigateBack()
|
if (this.navigateBacknavtitle) {
|
||||||
|
this.$emit('navigateBacknav')
|
||||||
|
} else {
|
||||||
|
uni.navigateBack()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,11 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 顶部面板 -->
|
<!-- 顶部面板 -->
|
||||||
<view class="top--panel">
|
<view class="top--panel">
|
||||||
<navseat :opacity='opacity' :titleshow='true'></navseat>
|
<navseat :opacity='opacity' :titleshow='true' @navigateBacknav='navigateBacknav' :navigateBacknavtitle='true'></navseat>
|
||||||
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 -->
|
<!-- 顶部面板,可添加所需要放在页面顶部的内容代码。比如banner图 -->
|
||||||
<image class="panelimgbackground" :src="shopInfo.storeInfo.coverImg||'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png'" mode="aspectFill">
|
<image class="panelimgbackground"
|
||||||
|
:src="shopInfo.storeInfo.coverImg||'https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png'"
|
||||||
|
mode="aspectFill">
|
||||||
</image>
|
</image>
|
||||||
<view class="panelone">
|
<view class="panelone">
|
||||||
{{ shopInfo.storeInfo.shopName }}
|
{{ shopInfo.storeInfo.shopName }}
|
||||||
@@ -393,6 +395,10 @@
|
|||||||
this.fixedtrue = true
|
this.fixedtrue = true
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
uni.pageScrollTo({
|
||||||
|
scrollTop: 0,
|
||||||
|
duration: 0
|
||||||
|
});
|
||||||
console.log(!uni.cache.get('token'))
|
console.log(!uni.cache.get('token'))
|
||||||
if (!uni.cache.get('token')) {
|
if (!uni.cache.get('token')) {
|
||||||
uni.login({
|
uni.login({
|
||||||
@@ -427,6 +433,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
navigateBacknav() {
|
||||||
|
uni.pro.switchTab('index/index')
|
||||||
|
},
|
||||||
getQueryString(url, name) { //解码
|
getQueryString(url, name) { //解码
|
||||||
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
|
||||||
var r = url.substr(1).match(reg)
|
var r = url.substr(1).match(reg)
|
||||||
@@ -469,26 +478,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取商品数据
|
|
||||||
*/
|
|
||||||
async productqueryProduct() {
|
|
||||||
let res = await this.api.productqueryProduct({
|
|
||||||
"shopId": uni.cache.get('shopUser'),
|
|
||||||
"productGroupId": ''
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.shopProductList = res.data;
|
|
||||||
if (this.cartLists && this.cartLists.data && this.cartLists.data.length >= 0) {
|
|
||||||
this.setNumber()
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
this.getElementTop();
|
|
||||||
}, 100);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品数量增加/减少
|
* 商品数量增加/减少
|
||||||
* @param {Object} item
|
* @param {Object} item
|
||||||
@@ -832,18 +821,41 @@
|
|||||||
this.socketTicket.send(data);
|
this.socketTicket.send(data);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 获取商品数据
|
||||||
|
*/
|
||||||
|
async productqueryProduct() {
|
||||||
|
let res = await this.api.productqueryProduct({
|
||||||
|
"shopId": uni.cache.get('shopUser'),
|
||||||
|
"productGroupId": ''
|
||||||
|
})
|
||||||
|
if (res.code == 0) {
|
||||||
|
this.shopProductList = res.data;
|
||||||
|
if (this.cartLists && this.cartLists.data && this.cartLists.data.length >= 0) {
|
||||||
|
this.setNumber()
|
||||||
|
}
|
||||||
|
this.scrollTopSize = 0
|
||||||
|
this.scrollHeight = 1000
|
||||||
|
this.topArr = []
|
||||||
|
setTimeout(() => {
|
||||||
|
this.getElementTop();
|
||||||
|
}, 500);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/* 获取元素顶部信息 */
|
/* 获取元素顶部信息 */
|
||||||
getElementTop() {
|
getElementTop() {
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
let view = uni.createSelectorQuery().selectAll('.main-item');
|
let view = uni.createSelectorQuery().selectAll('.main-item');
|
||||||
view.boundingClientRect(async data => {
|
view.boundingClientRect(async data => {
|
||||||
|
console.log(data, 840)
|
||||||
resolve(data);
|
resolve(data);
|
||||||
}).exec();
|
}).exec();
|
||||||
this.$u.getRect('.scroll-panel').then(res => {
|
this.$u.getRect('.scroll-panel').then(res => {
|
||||||
this.scrollTopSize = res.top; //元素距离顶部的距离
|
this.scrollTopSize = res.top; //元素距离顶部的距离
|
||||||
})
|
})
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
|
console.log(res, 111)
|
||||||
let topArr = res.map((item) => {
|
let topArr = res.map((item) => {
|
||||||
return item.top; /* 减去滚动容器距离顶部的距离 加导航栏高度*/
|
return item.top; /* 减去滚动容器距离顶部的距离 加导航栏高度*/
|
||||||
});
|
});
|
||||||
@@ -876,14 +888,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const lastElement = this.topArr[this.topArr.length - 1];
|
const lastElement = this.topArr[this.topArr.length - 1];
|
||||||
const currentElement = this.topArr[this.leftIndex];
|
const currentElement = this.topArr[index];
|
||||||
const diff = lastElement - currentElement;
|
const diff = lastElement - currentElement;
|
||||||
console.log(diff)
|
console.log(diff)
|
||||||
// if (diff > this.scrollHeight) {
|
if (diff > this.scrollHeight) {
|
||||||
this.leftIndex = (index < 0 ? 0 : index);
|
this.leftIndex = (index < 0 ? 0 : index);
|
||||||
// } else {
|
} else {
|
||||||
// this.leftIndex = this.leftIndex
|
this.leftIndex = this.leftIndex
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* 左侧导航点击 */
|
/* 左侧导航点击 */
|
||||||
@@ -892,9 +904,7 @@
|
|||||||
scrollTop: this.topArr[index] - this.HeighT,
|
scrollTop: this.topArr[index] - this.HeighT,
|
||||||
duration: 0
|
duration: 0
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
this.leftIndex = index
|
||||||
this.leftIndex = index
|
|
||||||
}, 500)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -957,6 +967,7 @@
|
|||||||
font-size: 24rpx;
|
font-size: 24rpx;
|
||||||
color: #999999;
|
color: #999999;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
|
|
||||||
.paneltheretext {
|
.paneltheretext {
|
||||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
@@ -985,6 +996,7 @@
|
|||||||
.panelfive {
|
.panelfive {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 0 20rpx;
|
padding: 0 20rpx;
|
||||||
|
|
||||||
.panelfive_list {
|
.panelfive_list {
|
||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user