This commit is contained in:
parent
0de026c34a
commit
a0baa5b59a
53
App.vue
53
App.vue
|
|
@ -10,8 +10,7 @@
|
|||
uni.cache.set('NAME', '零点八零');
|
||||
this.userlogin()
|
||||
},
|
||||
onLoad(){
|
||||
},
|
||||
onLoad() {},
|
||||
onShow: function() {
|
||||
this.$store.dispatch("HeightActions"); //获取随时获取页面的高度
|
||||
|
||||
|
|
@ -19,40 +18,32 @@
|
|||
onHide: function() {
|
||||
// console.log('App Hide');
|
||||
},
|
||||
methods:{
|
||||
async userlogin(reslange) {
|
||||
var resdataa = reslange
|
||||
methods: {
|
||||
userlogin() {
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: async (data) => {
|
||||
try {
|
||||
uni.getUserInfo({
|
||||
provider: 'weixin',
|
||||
success: async (infoRes) => {
|
||||
uni.cache.set('weixincode', data.code);
|
||||
let res = await this.api.userwxlogin({
|
||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||
rawData: infoRes.rawData,
|
||||
// signature: infoRes.signature,
|
||||
// iv: infoRes.detail.iv,
|
||||
// encryptedData: infoRes.detail
|
||||
// .encryptedData
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
}
|
||||
},
|
||||
fail: (err) => {}
|
||||
});
|
||||
} catch (e) {}
|
||||
success: (data) => {
|
||||
uni.getUserInfo({
|
||||
provider: 'weixin',
|
||||
success: (infoRes) => {
|
||||
uni.cache.set('weixincode', data.code);
|
||||
let res = this.api.userwxlogin({
|
||||
code: uni.cache.get('weixincode'), //临时登录凭证
|
||||
rawData: infoRes.rawData,
|
||||
})
|
||||
if (res.code == 0) {
|
||||
uni.cache.set('token', res.data.token);
|
||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||
.miniAppOpenId)
|
||||
uni.cache.set('userInfo', res.data.userInfo);
|
||||
}
|
||||
},
|
||||
fail: (err) => {}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
<text class="contentboxitemlefttextone">点餐</text>
|
||||
<text class="contentboxitemlefttexttow">在线点不排队</text>
|
||||
</view>
|
||||
<view class="contentboxitemright" @click="scanCodehandle(1)">
|
||||
<view class="contentboxitemright_item flex-between">
|
||||
<view class="contentboxitemright" >
|
||||
<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>
|
||||
<view class="contentboxitemright_itembox flex-colum">
|
||||
|
|
|
|||
|
|
@ -294,15 +294,16 @@
|
|||
return false;
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
this.form.page = ++this.form.page;
|
||||
setTimeout(() => {
|
||||
if (this.form.page == 1) {
|
||||
console.log(111)
|
||||
this.list = res.data.list
|
||||
} else {
|
||||
console.log(222)
|
||||
this.list = [...this.list, ...res.data.list];
|
||||
}
|
||||
this.form.status = 'loading';
|
||||
if (res.data.pageNum == res.data.pages) {
|
||||
this.form.page = ++this.form.page;
|
||||
if (this.form.page > res.data.pages) {
|
||||
this.form.status = 'nomore';
|
||||
} else {
|
||||
this.form.status = 'loading';
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@
|
|||
<view class="name">
|
||||
{{ item1.name }}
|
||||
</view>
|
||||
<view class="namess" v-if="item1.suit>1">
|
||||
<!-- <view class="namess" v-if="item1.suit>1">
|
||||
{{ item1.suit }}
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="price-wrap">
|
||||
<view class="price">
|
||||
<text class="i">¥</text>
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cart-wrap" v-if="cartListsdatashow">
|
||||
<view class="cart-wrap">
|
||||
<view class="cart-content">
|
||||
<view class="left">
|
||||
<image class="icon" src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/icon_cart.png"
|
||||
|
|
@ -366,7 +366,7 @@
|
|||
return false;
|
||||
}
|
||||
} else {
|
||||
this.cartListsdatashow = msg.data.length == 0 ? false : true
|
||||
// this.cartListsdatashow = msg.data.length == 0 ? false : true
|
||||
switch (msg.type) {
|
||||
case 'sku': // sku 数量 查询这个商品的价格和数量
|
||||
this.$set(this, 'amountcartNumber', msg.amount)
|
||||
|
|
|
|||
Loading…
Reference in New Issue