Merge branch 'wwz_x' of e.coding.net:g-cphe0354/xiaochengxusaomadiancan/cashier_weapp into wwz_d
This commit is contained in:
53
App.vue
53
App.vue
@@ -10,8 +10,7 @@
|
|||||||
uni.cache.set('NAME', '零点八零');
|
uni.cache.set('NAME', '零点八零');
|
||||||
this.userlogin()
|
this.userlogin()
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad() {},
|
||||||
},
|
|
||||||
onShow: function() {
|
onShow: function() {
|
||||||
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
||||||
|
|
||||||
@@ -19,40 +18,32 @@
|
|||||||
onHide: function() {
|
onHide: function() {
|
||||||
// console.log('App Hide');
|
// console.log('App Hide');
|
||||||
},
|
},
|
||||||
methods:{
|
methods: {
|
||||||
async userlogin(reslange) {
|
userlogin() {
|
||||||
var resdataa = reslange
|
|
||||||
uni.login({
|
uni.login({
|
||||||
provider: 'weixin',
|
provider: 'weixin',
|
||||||
success: async (data) => {
|
success: (data) => {
|
||||||
try {
|
uni.getUserInfo({
|
||||||
uni.getUserInfo({
|
provider: 'weixin',
|
||||||
provider: 'weixin',
|
success: (infoRes) => {
|
||||||
success: async (infoRes) => {
|
uni.cache.set('weixincode', data.code);
|
||||||
uni.cache.set('weixincode', data.code);
|
let res = this.api.userwxlogin({
|
||||||
let res = await this.api.userwxlogin({
|
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
rawData: infoRes.rawData,
|
||||||
rawData: infoRes.rawData,
|
})
|
||||||
// signature: infoRes.signature,
|
if (res.code == 0) {
|
||||||
// iv: infoRes.detail.iv,
|
uni.cache.set('token', res.data.token);
|
||||||
// encryptedData: infoRes.detail
|
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||||
// .encryptedData
|
.miniAppOpenId)
|
||||||
})
|
uni.cache.set('userInfo', res.data.userInfo);
|
||||||
if (res.code == 0) {
|
}
|
||||||
uni.cache.set('token', res.data.token);
|
},
|
||||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
fail: (err) => {}
|
||||||
.miniAppOpenId)
|
});
|
||||||
uni.cache.set('userInfo', res.data.userInfo);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
fail: (err) => {}
|
|
||||||
});
|
|
||||||
} catch (e) {}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<!-- 占位符导航栏 -->
|
<!-- 占位符导航栏 -->
|
||||||
<navseat :opacity='false' :title='"歌曲列表"' :titleshow='true' :heightshow='true' :namecolor='"#fff"' :iconshow='false'></navseat>
|
<navseat :opacity='false' :title='"歌曲列表"' :titleshow='true' :heightshow='true' :namecolor='"#fff"'
|
||||||
|
:iconshow='false'></navseat>
|
||||||
<view class="search flex-between">
|
<view class="search flex-between">
|
||||||
<view class="searchinput flex-between">
|
<view class="searchinput flex-between">
|
||||||
<input type="text" class="searchinput_input" placeholder-style="color:#FFFFFF" @input="onInput"
|
<input type="text" class="searchinput_input" placeholder-style="color:#FFFFFF" @input="onInput"
|
||||||
@@ -25,8 +26,10 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<image style="margin:32rpx auto;" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/nomore.png"
|
<image style="margin:100rpx auto 32rpx auto;"
|
||||||
v-if="is_end" mode="aspectFill"></image>
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/nomore.png" v-if="is_end"
|
||||||
|
mode="aspectFill"></image>
|
||||||
|
|
||||||
<u-loadmore :status="form.status" loadmore-text="上滑加载更多" @loadmore="loadmorelang" fontSize="28"
|
<u-loadmore :status="form.status" loadmore-text="上滑加载更多" @loadmore="loadmorelang" fontSize="28"
|
||||||
color="#999" iconSize="28" />
|
color="#999" iconSize="28" />
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<navseat :opacity='false' :title='"点单记录"' :titleshow='true' :heightshow='true' :namecolor='"#fff"'
|
<navseat :opacity='false' :title='"点单记录"' :titleshow='true' :heightshow='true' :namecolor='"#fff"'
|
||||||
iconcolor="#fff" @Topdistance='Topdistance'>
|
iconcolor="#fff" @Topdistance='Topdistance'>
|
||||||
</navseat>
|
</navseat>
|
||||||
<view class="content">
|
<view class="content" :style="{'height':Height}">
|
||||||
<scroll-view scroll-y="true" style="width:100%;" :style="{'height':Height}" show-scrollbar="false"
|
<scroll-view scroll-y="true" style="width:100%;" :style="{'height':Height}" show-scrollbar="false"
|
||||||
@scrolltolower="lower">
|
@scrolltolower="lower">
|
||||||
<view class="scrollview" :style="{'height':Height}">
|
<view class="scrollview" :style="{'height':Height}">
|
||||||
@@ -28,11 +28,9 @@
|
|||||||
</view>
|
</view>
|
||||||
<image class="contentboxafter" src="" mode=""></image>
|
<image class="contentboxafter" src="" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex-colum" v-if="is_end" :style="{'height':Height}">
|
<image style="margin:100rpx auto 32rpx auto;"
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/background.png"
|
src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/nomore.png" v-if="is_end"
|
||||||
mode="aspectFill"></image>
|
mode="aspectFill"></image>
|
||||||
<u-loadmore :status="form.status" fontSize="28" color="#999" iconSize="28" />
|
|
||||||
</view>
|
|
||||||
<view style="padding: 32rpx 0;">
|
<view style="padding: 32rpx 0;">
|
||||||
<u-loadmore :status="form.status" fontSize="28" color="#999" iconSize="28" />
|
<u-loadmore :status="form.status" fontSize="28" color="#999" iconSize="28" />
|
||||||
</view>
|
</view>
|
||||||
@@ -69,8 +67,8 @@
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.Topdistance()
|
// this.Topdistance()
|
||||||
}, 200)
|
}, 500)
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.cashierService()
|
this.cashierService()
|
||||||
@@ -149,7 +147,6 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/background.png);
|
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/chooseasong/background.png);
|
||||||
background-size: 100% 100%;
|
background-size: 100% 100%;
|
||||||
overflow: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
@@ -157,8 +154,10 @@
|
|||||||
z-index: 99;
|
z-index: 99;
|
||||||
padding: 32rpx 28rpx 0rpx 28rpx;
|
padding: 32rpx 28rpx 0rpx 28rpx;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.scrollview {
|
.scrollview {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
.contentbox:nth-child(1) {
|
.contentbox:nth-child(1) {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
<text class="contentboxitemlefttextone">点餐</text>
|
<text class="contentboxitemlefttextone">点餐</text>
|
||||||
<text class="contentboxitemlefttexttow">在线点不排队</text>
|
<text class="contentboxitemlefttexttow">在线点不排队</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="contentboxitemright" @click="scanCodehandle(1)">
|
<view class="contentboxitemright" >
|
||||||
<view class="contentboxitemright_item flex-between">
|
<view class="contentboxitemright_item flex-between" @click="scanCodehandle(1)">
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png" mode="aspectFill">
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png" mode="aspectFill">
|
||||||
</image>
|
</image>
|
||||||
<view class="contentboxitemright_itembox flex-colum">
|
<view class="contentboxitemright_itembox flex-colum">
|
||||||
|
|||||||
@@ -294,15 +294,16 @@
|
|||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
this.form.status = 'loading';
|
this.form.status = 'loading';
|
||||||
this.form.page = ++this.form.page;
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (this.form.page == 1) {
|
if (this.form.page == 1) {
|
||||||
|
console.log(111)
|
||||||
this.list = res.data.list
|
this.list = res.data.list
|
||||||
} else {
|
} else {
|
||||||
|
console.log(222)
|
||||||
this.list = [...this.list, ...res.data.list];
|
this.list = [...this.list, ...res.data.list];
|
||||||
}
|
}
|
||||||
this.form.status = 'loading';
|
this.form.page = ++this.form.page;
|
||||||
if (res.data.pageNum == res.data.pages) {
|
if (this.form.page > res.data.pages) {
|
||||||
this.form.status = 'nomore';
|
this.form.status = 'nomore';
|
||||||
} else {
|
} else {
|
||||||
this.form.status = 'loading';
|
this.form.status = 'loading';
|
||||||
|
|||||||
@@ -78,9 +78,9 @@
|
|||||||
<view class="name">
|
<view class="name">
|
||||||
{{ item1.name }}
|
{{ item1.name }}
|
||||||
</view>
|
</view>
|
||||||
<view class="namess" v-if="item1.suit>1">
|
<!-- <view class="namess" v-if="item1.suit>1">
|
||||||
{{ item1.suit }}
|
{{ item1.suit }}
|
||||||
</view>
|
</view> -->
|
||||||
<view class="price-wrap">
|
<view class="price-wrap">
|
||||||
<view class="price">
|
<view class="price">
|
||||||
<text class="i">¥</text>
|
<text class="i">¥</text>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="cart-wrap" v-if="cartListsdatashow">
|
<view class="cart-wrap">
|
||||||
<view class="cart-content">
|
<view class="cart-content">
|
||||||
<view class="left">
|
<view class="left">
|
||||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/icon_cart.png"
|
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/icon_cart.png"
|
||||||
@@ -366,7 +366,7 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.cartListsdatashow = msg.data.length == 0 ? false : true
|
// this.cartListsdatashow = msg.data.length == 0 ? false : true
|
||||||
switch (msg.type) {
|
switch (msg.type) {
|
||||||
case 'sku': // sku 数量 查询这个商品的价格和数量
|
case 'sku': // sku 数量 查询这个商品的价格和数量
|
||||||
this.$set(this, 'amountcartNumber', msg.amount)
|
this.$set(this, 'amountcartNumber', msg.amount)
|
||||||
|
|||||||
Reference in New Issue
Block a user