支付宝兼容,排队预约修改,订单逻辑修改

This commit is contained in:
GaoHao
2024-09-24 15:22:34 +08:00
parent 861e97b775
commit 5f03e44701
31 changed files with 823 additions and 737 deletions

View File

@@ -58,7 +58,9 @@
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
uni.cache.set('tableCode', tableCode)
if (tableCode) {
uni.pro.navigateTo('order_food/order_food')
uni.pro.navigateTo('order_food/order_food', {
tableCode: tableCode,
})
}
},
fail:( res) =>{

View File

@@ -236,7 +236,7 @@
</view>
<indexs v-if="showindex == 'shopIndex'" :shopExtend="shopExtend" :usershopUserinfo='usershopUserinfo' :userInfo='userInfo'></indexs>
<indexs v-if="showindex == 'shopIndex'" :shopExtend="shopExtend" :shopUserInfo='shopUserInfo' ></indexs>
<popupad id="popupad" :forceUpdate='forceUpdate' :showPosition="'home'"></popupad>
</view>
</view>
@@ -265,7 +265,6 @@
data() {
return {
showindex: "",
userInfo: {},//个人信息
NAME: uni.cache.get('NAME'),
timersetInterval: '0', //定时器
isFixedTop: false, //吸顶是否显示
@@ -305,7 +304,7 @@
categoryList: [],
subCategoryList: [], //二级菜单数据
// 登录后店铺信息
usershopUserinfo:{},
shopUserInfo:{},
popupadList: [], //广告数据
forceUpdate: false,
shopExtend: null,
@@ -368,10 +367,9 @@
"userId": uni.cache.get('userInfo').id,
})
if (res.code == 0) {
this.usershopUserinfo = res.data
uni.cache.set('shopUserInfo',this.usershopUserinfo)
this.shopUserInfo = res.data
uni.cache.set('shopUserInfo',this.shopUserInfo)
}
this.loginwxuserInfo() //个人信息接口
if ( uni.cache.get('forceUpdate') == 1) {
this.forceUpdate = !this.forceUpdate;
}
@@ -442,17 +440,7 @@
this.shopExtend = res.data;
}
},
// 个人信息
async loginwxuserInfo() {
let res = await this.api.loginwxuserInfo({
userId: uni.cache.get('userInfo').id
})
if (res.code == 0) {
uni.cache.set('userInfo', res.data);
this.userInfo = uni.cache.get('userInfo')
}
},
closeproductlist() {
this.showproductlist = false
// console.log('close');

View File

@@ -9,7 +9,7 @@
<text class="contentboxitemlefttexttow">在线点不排队</text>
</view>
<view class="contentboxitemright">
<view class="contentboxitemright_item flex-between" @click="scanCodehandle(1)">
<view class="contentboxitemright_item flex-between" @click="memberindex('member/memberdetails')">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xvip.png" mode="aspectFill">
</image>
<view class="contentboxitemright_itembox flex-colum">
@@ -17,7 +17,7 @@
<text>入会享权益</text>
</view>
</view>
<view class="contentboxitemright_item flex-between" @click="memberindex(0)">
<view class="contentboxitemright_item flex-between" @click="memberindex('member/index')">
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/Xchong.png"
mode="aspectFill"></image>
<view class="contentboxitemright_itembox flex-colum">
@@ -34,10 +34,12 @@
<script>
export default {
data() {
return {};
return {
userInfo: null,
};
},
props: {
usershopUserinfo: {
shopUserInfo: {
type: Object,
default () {
return {
@@ -46,12 +48,6 @@
}
}
},
userInfo: {
type: Object,
default () {
return {}
}
},
shopExtend: {
type: Object,
default () {
@@ -59,51 +55,34 @@
}
},
},
mounted() {
this.userInfo = uni.cache.get('userInfo');
},
methods: {
scanCodehandle(i) {
setTimeout(()=>{
uni.cache.set('forceUpdate',2)
},200)
if (i == 0) {
uni.scanCode({
success: (res) => {
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
uni.cache.set('tableCode', tableCode)
if (tableCode) {
uni.pro.navigateTo('order_food/order_food', {
// shopId_id: uni.cache.get('shopId'),
})
}
},
fail: () => {
uni.scanCode({
success: (res) => {
let tableCode = this.getQueryString(decodeURIComponent(res.result), 'code')
uni.cache.set('tableCode', tableCode)
if (tableCode) {
uni.pro.navigateTo('order_food/order_food', {
tableCode: tableCode,
})
// uni.pro.navigateTo('/pagesOrder/orderAMeal/index')
}
})
} else {
uni.pro.navigateTo('member/memberdetails', {
shopId_id: uni.cache.get('shopId'),
})
}
},
memberindex(i) {
console.log(2)
if (i == 0) {
uni.pro.navigateTo('member/index', {
shopId: uni.cache.get('shopId'),
type: 'index',
})
} else {
let data = {
shopName: this.usershopUserinfo.shopName,
amount: this.usershopUserinfo.amount,
shopId: uni.cache.get('shopId')
},
fail: () => {
}
uni.navigateTo({
url: '/pages/pay_code/pay_code?shopInfo=' + JSON.stringify(data)
})
}
})
},
memberindex(url) {
uni.pro.navigateTo(url, {
shopId: uni.cache.get('shopId'),
type: 'index',
})
},
getQueryString(url, name) { //解码
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
@@ -114,30 +93,6 @@
return null;
},
// / 更换头像
onChooseAvatar(e) {
uni.showLoading({
title: '上传中',
mask: true
})
console.log(e.detail.avatarUrl)
let file = e.detail.avatarUrl;
uploadImage(file, 'avatar',
result => {
//将上传后的图片以对象官方要求的格式的形式存入uni-file-picker的value值imageValueimageValue值的结构为数组包对象用于图片回显
// let objAge = {
// 'url': result,
// 'extname': 'png',
// 'name': 'imgss.png'
// };
// this.userlist.avatar.push(objAge)
this.userInfo.avatar = result
console.log(this.userInfo.avatar)
uni.hideLoading()
}, result => {
uni.hideLoading()
})
},
}
};