更新优化
This commit is contained in:
@@ -16,7 +16,6 @@ export default {
|
|||||||
accountPay(data) {
|
accountPay(data) {
|
||||||
return uni.api.get("/pay/accountPay", data);
|
return uni.api.get("/pay/accountPay", data);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 下单
|
// 下单
|
||||||
creatGroupOrder(data) {
|
creatGroupOrder(data) {
|
||||||
return uni.api.post("/groupOrderInfo/creatGroupOrder", data);
|
return uni.api.post("/groupOrderInfo/creatGroupOrder", data);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<u-image :src="src" :radius="radius" :width="width" :height="height" :fade="false"></u-image>
|
<u-image :src="src" :radius="radius" :width="width" :height="height" :fade="false" :lazy-load="true" slot="loading"></u-image>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -54,9 +54,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
// 忘记支付密码
|
// 忘记支付密码
|
||||||
gopaypassword() {
|
gopaypassword() {
|
||||||
uni.pro.navigateTo('/pages/user/repairpassword', {
|
uni.pro.navigateTo('/pages/user/repairpassword')
|
||||||
// shopId_id: uni.cache.get('shopUser')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 唤起键盘
|
* 唤起键盘
|
||||||
|
|||||||
@@ -66,7 +66,6 @@
|
|||||||
return {
|
return {
|
||||||
banners: [require('@/static/banner1.png')],
|
banners: [require('@/static/banner1.png')],
|
||||||
footerBanners: [require('@/static/footer_banner1.png')],
|
footerBanners: [require('@/static/footer_banner1.png')],
|
||||||
shopUser: {},
|
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
shopInfo:{}
|
shopInfo:{}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -290,7 +290,6 @@
|
|||||||
url: '/pages/order_food/order_food'
|
url: '/pages/order_food/order_food'
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
// uni.cache.set('shopUser', res.data.shopUser);
|
|
||||||
uni.pro.switchTab('index/index')
|
uni.pro.switchTab('index/index')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,7 +340,6 @@
|
|||||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||||
.miniAppOpenId)
|
.miniAppOpenId)
|
||||||
uni.cache.set('userInfo', res.data.userInfo);
|
uni.cache.set('userInfo', res.data.userInfo);
|
||||||
// uni.cache.set('shopUser', res.data.shopUser);
|
|
||||||
if (this.types == 0) {
|
if (this.types == 0) {
|
||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/order_food/order_food'
|
url: '/pages/order_food/order_food'
|
||||||
|
|||||||
@@ -72,7 +72,6 @@
|
|||||||
uni.cache.set('miniAppOpenId', res.data.userInfo
|
uni.cache.set('miniAppOpenId', res.data.userInfo
|
||||||
.miniAppOpenId)
|
.miniAppOpenId)
|
||||||
uni.cache.set('userInfo', res.data.userInfo);
|
uni.cache.set('userInfo', res.data.userInfo);
|
||||||
uni.cache.set('shopUser', res.data.shopUser);
|
|
||||||
uni.pro.switchTab('index/index')
|
uni.pro.switchTab('index/index')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
shopUser: {},
|
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
shopInfo:{}
|
shopInfo:{}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,7 +25,8 @@
|
|||||||
<!-- <image :src="require('')" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
|
<!-- <image :src="require('')" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
|
||||||
<view class="listrigth">
|
<view class="listrigth">
|
||||||
<view>{{item.biz_name}}</view>
|
<view>{{item.biz_name}}</view>
|
||||||
<view :class="[checkIn(item.biz_code)?'colorStyle':'']">{{checkIn(item.biz_code)?'+':'-'}}{{item.amount}}</view>
|
<view :class="[item.type == '+'?'colorStyle':'']">{{item.type}}{{item.amount}}
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="listrigth2">
|
<view class="listrigth2">
|
||||||
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
|
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
|
||||||
@@ -60,9 +61,9 @@
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 检测是否包含In
|
// 检测是否包含In
|
||||||
checkIn(str) {
|
checkIn(str) {
|
||||||
let reg = RegExp(/In/)
|
let reg = RegExp(/In/)
|
||||||
return str.match(reg)
|
return str.match(reg)
|
||||||
},
|
},
|
||||||
async getlist() {
|
async getlist() {
|
||||||
if (this.active == 1) {
|
if (this.active == 1) {
|
||||||
@@ -155,9 +156,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.listrigth {
|
.listrigth {
|
||||||
.colorStyle{
|
.colorStyle {
|
||||||
color: #FF7127;
|
color: #FF7127;
|
||||||
}
|
}
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<text class="towcontentitemtowetext">VIP{{userInfo.code || '无'}}</text>
|
<text class="towcontentitemtowetext">VIP{{userInfo.code || '无'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="towcontentitevip">
|
<view class="towcontentitevip">
|
||||||
VIP{{userInfo.is_vip}}
|
VIP{{userInfo.isVip}}
|
||||||
</view>
|
</view>
|
||||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/erweima.png" class="imgStyle" mode=""
|
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/erweima.png" class="imgStyle" mode=""
|
||||||
@click="clickEvent"></image>
|
@click="clickEvent"></image>
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
|
||||||
console.log(e, '调试2')
|
|
||||||
this.shopId = e.shopId
|
this.shopId = e.shopId
|
||||||
if (e.type == 'list') { //从列表进来的
|
if (e.type == 'list') { //从列表进来的
|
||||||
this.paygetShopByMember(e.shopId)
|
this.paygetShopByMember(e.shopId)
|
||||||
@@ -51,13 +49,13 @@
|
|||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
userId: uni.cache.get('userInfo').id,
|
userId: uni.cache.get('userInfo').id,
|
||||||
shopId: w
|
shopId: this.shopId
|
||||||
})
|
})
|
||||||
this.userInfo = res.data.list[0]
|
this.userInfo = res.data.list[0]
|
||||||
},
|
},
|
||||||
async paygetActive(shopid) {
|
async paygetActive() {
|
||||||
let res = await this.api.paygetActive({
|
let res = await this.api.paygetActive({
|
||||||
shopId: shopid,
|
shopId: this.shopId,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10
|
pageSize: 10
|
||||||
})
|
})
|
||||||
@@ -80,7 +78,11 @@
|
|||||||
shopId: this.shopId, // 判断显示哪家的作品,
|
shopId: this.shopId, // 判断显示哪家的作品,
|
||||||
amount: this.amount // 判断显示哪家的作品,
|
amount: this.amount // 判断显示哪家的作品,
|
||||||
})
|
})
|
||||||
if (res) {
|
if (res.code == 0) {
|
||||||
|
uni.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
mask: true
|
||||||
|
})
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
provider: 'wxpay', //支付类型-固定值
|
provider: 'wxpay', //支付类型-固定值
|
||||||
@@ -94,11 +96,16 @@
|
|||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "支付成功"
|
title: "支付成功"
|
||||||
})
|
})
|
||||||
|
uni.hideLoading()
|
||||||
setTimeout(res => {
|
setTimeout(res => {
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
}, 500)
|
}, 500)
|
||||||
},
|
},
|
||||||
|
fail: (res) => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
uni.hideLoading()
|
||||||
// #endif
|
// #endif
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -40,15 +40,17 @@
|
|||||||
size: 10, //页容量
|
size: 10, //页容量
|
||||||
status: 'loadmore',
|
status: 'loadmore',
|
||||||
},
|
},
|
||||||
userId:null
|
userId: uni.cache.get('userInfo').id
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
|
||||||
this.userId = uni.cache.get('userInfo').id
|
|
||||||
// this.paygetShopByMember()
|
|
||||||
},
|
|
||||||
onShow() {
|
onShow() {
|
||||||
this.paygetShopByMember()
|
this.list = []
|
||||||
|
this.form = {
|
||||||
|
page: 1, //页数
|
||||||
|
size: 10, //页容量
|
||||||
|
status: 'loadmore',
|
||||||
|
},
|
||||||
|
this.paygetShopByMember()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
this.paygetShopByMember()
|
this.paygetShopByMember()
|
||||||
@@ -84,10 +86,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
eeInfo(item) {
|
eeInfo(item) {
|
||||||
|
|
||||||
uni.pro.navigateTo('member/memberdetails', {
|
uni.pro.navigateTo('member/memberdetails', {
|
||||||
shopId_id: item.shopId,
|
shopId_id: item.shopId
|
||||||
type: 'list'
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
<text>账单明细</text>
|
<text>账单明细</text>
|
||||||
<uni-icons type="right" style="color: #333;" size="20"></uni-icons>
|
<uni-icons type="right" style="color: #333;" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
<view @click="goUrl('member/index')">
|
<view @click="goUrlinfo('member/index')">
|
||||||
<text>会员充值</text>
|
<text>会员充值</text>
|
||||||
<uni-icons type="right" style="color: #333;" size="20"></uni-icons>
|
<uni-icons type="right" style="color: #333;" size="20"></uni-icons>
|
||||||
</view>
|
</view>
|
||||||
@@ -20,31 +20,26 @@
|
|||||||
<script>
|
<script>
|
||||||
import card from './components/card.vue'
|
import card from './components/card.vue'
|
||||||
export default {
|
export default {
|
||||||
components:{card},
|
components: {
|
||||||
|
card
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
info:null,
|
shopId_id: null,
|
||||||
inputshow: 0,
|
inputshow: 0,
|
||||||
memberlist: {},
|
memberlist: {},
|
||||||
listdata: [],
|
listdata: [],
|
||||||
amount: '',
|
amount: '',
|
||||||
shopUser: {},
|
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.info = e
|
console.log(e)
|
||||||
if (e.type == 'list') { //从列表进来的
|
this.shopId_id = e.shopId_id
|
||||||
this.paygetShopByMember(e.shopId_id)
|
|
||||||
} else {
|
|
||||||
this.paygetShopByMember(e.shopId_id)
|
|
||||||
}
|
|
||||||
|
|
||||||
// this.paygetActive() //列表
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.paygetShopByMember(this.info.shopId_id)
|
this.paygetShopByMember(this.shopId_id)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async paygetShopByMember(w) {
|
async paygetShopByMember(w) {
|
||||||
@@ -56,71 +51,21 @@
|
|||||||
})
|
})
|
||||||
this.userInfo = res.data.list[0]
|
this.userInfo = res.data.list[0]
|
||||||
},
|
},
|
||||||
async paygetActive() {
|
|
||||||
let res = await this.api.paygetActive({
|
|
||||||
shopId: uni.cache.get('shopUser'),
|
|
||||||
page: 1,
|
|
||||||
pageSize: 10
|
|
||||||
})
|
|
||||||
try {
|
|
||||||
this.listdata = res.data.list
|
|
||||||
this.amount = res.data.list[0].minNum
|
|
||||||
} catch (e) {
|
|
||||||
//TODO handle the exception
|
|
||||||
}
|
|
||||||
},
|
|
||||||
async userbalancerechangesub() {
|
|
||||||
if (this.amount == null || this.amount == '') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '金额不能为空',
|
|
||||||
icon: 'none'
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let res = await this.api.paymemeberIn({
|
|
||||||
shopId: uni.cache.get('shopUser'), // 判断显示哪家的作品,
|
|
||||||
amount: this.amount // 判断显示哪家的作品,
|
|
||||||
})
|
|
||||||
if (res) {
|
|
||||||
// #ifdef MP-WEIXIN
|
|
||||||
uni.requestPayment({
|
|
||||||
provider: 'wxpay', //支付类型-固定值
|
|
||||||
partnerid: res.data.appId, // 微信支付商户号
|
|
||||||
timeStamp: res.data.timeStamp, // 时间戳(单位:秒)
|
|
||||||
nonceStr: res.data.nonceStr, // 随机字符串
|
|
||||||
package: res.data.package, // 固定值
|
|
||||||
signType: res.data.signType, //固定值
|
|
||||||
paySign: res.data.paySign, //签名
|
|
||||||
success: (res) => {
|
|
||||||
uni.showToast({
|
|
||||||
title: "支付成功"
|
|
||||||
})
|
|
||||||
setTimeout(res => {
|
|
||||||
uni.navigateBack()
|
|
||||||
}, 1000)
|
|
||||||
},
|
|
||||||
fail: (err) => {
|
|
||||||
uni.showToast({
|
|
||||||
icon: 'none',
|
|
||||||
title: '支付失败'
|
|
||||||
})
|
|
||||||
setTimeout(res => {
|
|
||||||
uni.hideLoading()
|
|
||||||
}, 1000)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
// #endif
|
|
||||||
}
|
|
||||||
},
|
|
||||||
clickinput(a, b) {
|
clickinput(a, b) {
|
||||||
console.log(a, b)
|
console.log(a, b)
|
||||||
this.inputshow = b
|
this.inputshow = b
|
||||||
this.amount = a.minNum
|
this.amount = a.minNum
|
||||||
},
|
},
|
||||||
goUrl(url){
|
goUrl(url) {
|
||||||
uni.pro.navigateTo(url,this.userInfo)
|
uni.pro.navigateTo(url, this.userInfo)
|
||||||
},
|
},
|
||||||
|
goUrlinfo(url) {
|
||||||
|
uni.pro.navigateTo(url, {
|
||||||
|
shopId: this.shopId_id,
|
||||||
|
type: 'list'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -47,8 +47,6 @@
|
|||||||
<text class="status" v-if="item.status == 'unsend'">
|
<text class="status" v-if="item.status == 'unsend'">
|
||||||
<text>待发货</text>
|
<text>待发货</text>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
|
|
||||||
<text class="status" v-if="item.status == 'closed'">
|
<text class="status" v-if="item.status == 'closed'">
|
||||||
<text>订单完成</text>
|
<text>订单完成</text>
|
||||||
</text>
|
</text>
|
||||||
@@ -62,7 +60,7 @@
|
|||||||
<text>退单</text>
|
<text>退单</text>
|
||||||
</text>
|
</text>
|
||||||
<text class="status" v-if="item.status == 'cancelled'">
|
<text class="status" v-if="item.status == 'cancelled'">
|
||||||
<text>取消订单</text>
|
<text>已取消</text>
|
||||||
</text>
|
</text>
|
||||||
<text class="status" v-if="item.status == 'merge'">
|
<text class="status" v-if="item.status == 'merge'">
|
||||||
<text>合台</text>
|
<text>合台</text>
|
||||||
@@ -81,8 +79,8 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="total">
|
<view class="total" v-if="item.status != 'cancelled'">
|
||||||
<text class="t">{{item.status == 'unpaid' || item.status == 'paying'?'需':'已'}}付款</text>
|
<text class="t">{{item.description}}</text>
|
||||||
<text class="i">¥</text>
|
<text class="i">¥</text>
|
||||||
<text class="num">{{item.orderAmount}}</text>
|
<text class="num">{{item.orderAmount}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -209,6 +207,7 @@
|
|||||||
} else {
|
} else {
|
||||||
this.active = (this.tabs.findIndex((item) => item.type == this.useStorage.get('orderType')));
|
this.active = (this.tabs.findIndex((item) => item.type == this.useStorage.get('orderType')));
|
||||||
}
|
}
|
||||||
|
this.swiperCurrent = ''
|
||||||
this.init_fn()
|
this.init_fn()
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
@@ -354,7 +353,8 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
padding:0 10rpx;
|
padding: 0 10rpx;
|
||||||
|
|
||||||
.navtabone {
|
.navtabone {
|
||||||
// margin-left: -10rpx;
|
// margin-left: -10rpx;
|
||||||
width: 166rpx;
|
width: 166rpx;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
<text class="title">
|
<text class="title">
|
||||||
<text>{{listinfo.name}}</text>
|
<text>{{listinfo.name}}</text>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<text class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<text class="status" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||||
<text> 待支付 </text>
|
<text> 待支付 </text>
|
||||||
</text>
|
</text>
|
||||||
@@ -25,7 +24,7 @@
|
|||||||
<text>退单</text>
|
<text>退单</text>
|
||||||
</text>
|
</text>
|
||||||
<text class="status" v-if="listinfo.status == 'cancelled'">
|
<text class="status" v-if="listinfo.status == 'cancelled'">
|
||||||
<text>取消订单</text>
|
<text>已取消</text>
|
||||||
</text>
|
</text>
|
||||||
<text class="status" v-if="listinfo.status == 'merge'">
|
<text class="status" v-if="listinfo.status == 'merge'">
|
||||||
<text>合台</text>
|
<text>合台</text>
|
||||||
@@ -38,7 +37,8 @@
|
|||||||
<text class="tag" v-if="listinfo.sendType == 'takeself'">自提</text>
|
<text class="tag" v-if="listinfo.sendType == 'takeself'">自提</text>
|
||||||
<text class="tag" v-if="listinfo.sendType == 'table'">堂食</text>
|
<text class="tag" v-if="listinfo.sendType == 'table'">堂食</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="number-wrap" v-if="listinfo.status != 'unpaid' && listinfo.status != 'paying'&& listinfo.status != 'cancelled'">
|
<view class="number-wrap"
|
||||||
|
v-if="listinfo.status != 'unpaid' && listinfo.status != 'paying'&& listinfo.status != 'cancelled'">
|
||||||
<text class="t">取餐号</text>
|
<text class="t">取餐号</text>
|
||||||
<text class="number">{{listinfo.tableName}}</text>
|
<text class="number">{{listinfo.tableName}}</text>
|
||||||
</view>
|
</view>
|
||||||
@@ -48,8 +48,9 @@
|
|||||||
<text class="title">
|
<text class="title">
|
||||||
<text>点单详情</text>
|
<text>点单详情</text>
|
||||||
</text>
|
</text>
|
||||||
|
|
||||||
<view style="display: flex;align-items: center;" v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
<view style="display: flex;align-items: center;"
|
||||||
|
v-if="listinfo.status == 'unpaid' || listinfo.status == 'paying'">
|
||||||
<!-- <text style="font-size:24rpx;">支付时间:</text> -->
|
<!-- <text style="font-size:24rpx;">支付时间:</text> -->
|
||||||
<uni-countdown :show-day="false" color="#ff0000" border-color="#00B26A" splitorColor="#000"
|
<uni-countdown :show-day="false" color="#ff0000" border-color="#00B26A" splitorColor="#000"
|
||||||
:font-size="14" :hour="0" :minute="listinfo.expiredMinutes" :second="listinfo.expiredSeconds" />
|
:font-size="14" :hour="0" :minute="listinfo.expiredMinutes" :second="listinfo.expiredSeconds" />
|
||||||
@@ -135,12 +136,9 @@
|
|||||||
async onLoad(e) {
|
async onLoad(e) {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
this.orderId = e.orderId
|
this.orderId = e.orderId
|
||||||
this.orderorderInfo()
|
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.orderId) {
|
this.orderorderInfo()
|
||||||
this.orderorderInfo()
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onUnload() {
|
onUnload() {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
@@ -196,33 +194,28 @@
|
|||||||
signType: res.data.signType, //固定值
|
signType: res.data.signType, //固定值
|
||||||
paySign: res.data.paySign, //签名
|
paySign: res.data.paySign, //签名
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
uni.hideLoading()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: "支付成功"
|
title: "支付成功"
|
||||||
})
|
})
|
||||||
setTimeout(res => {
|
setTimeout(res => {
|
||||||
|
uni.hideLoading()
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/order/order'
|
url: '/pages/order/order'
|
||||||
});
|
});
|
||||||
}, 2000)
|
}, 500)
|
||||||
this.paymodfiyOrderInfo()
|
this.paymodfiyOrderInfo()
|
||||||
// uni.redirectTo({
|
|
||||||
// url: "/pages/mall/order/ordersuccess?id=" + datareslane.data
|
|
||||||
// .order_id,
|
|
||||||
// });
|
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.hideLoading()
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
title: '支付失败'
|
title: '支付失败'
|
||||||
})
|
})
|
||||||
|
|
||||||
setTimeout(res => {
|
setTimeout(res => {
|
||||||
|
uni.hideLoading()
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: '/pages/order/order'
|
url: '/pages/order/order'
|
||||||
});
|
});
|
||||||
}, 2000)
|
}, 500)
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -220,7 +220,6 @@
|
|||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
// console.log(e, 140)
|
// console.log(e, 140)
|
||||||
this.$store.dispatch("set_shopid"); //获取shapid
|
|
||||||
let res = JSON.parse(e.tableId)
|
let res = JSON.parse(e.tableId)
|
||||||
this.listinfo.detailList = res
|
this.listinfo.detailList = res
|
||||||
this.listinfo.amount = e.amount // 算完了的价格
|
this.listinfo.amount = e.amount // 算完了的价格
|
||||||
|
|||||||
@@ -183,24 +183,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
/** 扫码支付逻辑
|
|
||||||
* 进入该页面调用一次获取用户信息的接口
|
|
||||||
* 扫码后,未登录去登录
|
|
||||||
* 登录后,链接wx接口拿到列表
|
|
||||||
* 下单后,通过切换微信\余额两种支付方式
|
|
||||||
* : 余额支付:点击立即付款,获取userinfo中的字段,是否设置支付密码。未设置去设置
|
|
||||||
* 如果设置发送数据,通过wx接口获取creatdorder返回,调用支付密码。。。
|
|
||||||
* 输入完支付密码后,接口返回
|
|
||||||
* 微信支付
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* 接口/pay/accountPay
|
|
||||||
* 返回 code 都为0
|
|
||||||
* data -> 1 支付成功
|
|
||||||
* -> 2 余额不足
|
|
||||||
* ->3 未设置支付密码,(前后都做。根据userinfo的ispws做判断的。
|
|
||||||
**/
|
|
||||||
import webSocketUtils from '@/common/js/websocket.js'
|
import webSocketUtils from '@/common/js/websocket.js'
|
||||||
import payPassword from '@/components/payPassword.vue'
|
import payPassword from '@/components/payPassword.vue'
|
||||||
export default {
|
export default {
|
||||||
@@ -231,39 +213,19 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onUnload() {
|
onUnload() {
|
||||||
// uni.switchTab({
|
|
||||||
// url: '/pages/order/order'
|
|
||||||
// })
|
|
||||||
uni.$off('getMessage')
|
uni.$off('getMessage')
|
||||||
this.ispws = false
|
this.ispws = false
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
|
||||||
this.listinfo = JSON.parse(e.tablelist)
|
this.listinfo = JSON.parse(e.tablelist)
|
||||||
// 获取余额
|
|
||||||
// this.getAount()
|
|
||||||
// 获取用户信息,判断是否设置支付密码
|
|
||||||
this.getuserinfo()
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
onShow() {
|
onShow() {
|
||||||
// this.$store.dispatch("set_shopid"); //获取shapid
|
// 获取余额
|
||||||
this.getAount()
|
this.getAount()
|
||||||
this.getuserinfo()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getuserinfo() {
|
|
||||||
let res = await this.api.loginwxuserInfo({
|
|
||||||
userId: uni.cache.get('userInfo').id
|
|
||||||
})
|
|
||||||
if (res.code == 0) {
|
|
||||||
uni.cache.set('userInfo', res.data);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
groupChange(n) {
|
groupChange(n) {
|
||||||
this.radiovalue1 = n
|
this.radiovalue1 = n
|
||||||
uni.cache.set('radiovalue1', n)
|
|
||||||
},
|
},
|
||||||
async getcoupon() {
|
async getcoupon() {
|
||||||
let res = await this.api.userCoupon({
|
let res = await this.api.userCoupon({
|
||||||
@@ -276,12 +238,10 @@
|
|||||||
},
|
},
|
||||||
async getAount() {
|
async getAount() {
|
||||||
let res = await this.api.shopUserInfo({
|
let res = await this.api.shopUserInfo({
|
||||||
// shopId:店铺ID
|
"shopId": uni.cache.get('shopUser'),
|
||||||
"shopId": this.$store.state.shopId,
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
|
|
||||||
this.amountVIP = res.data
|
this.amountVIP = res.data
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -293,35 +253,16 @@
|
|||||||
})
|
})
|
||||||
this.socketTicket.Close()
|
this.socketTicket.Close()
|
||||||
uni.$off('getMessage')
|
uni.$off('getMessage')
|
||||||
console.log(msg, 'socke返回数据')
|
|
||||||
|
|
||||||
} else if (msg.type == 'createOrder') {
|
} else if (msg.type == 'createOrder') {
|
||||||
console.log(msg, 'createOrder执行')
|
|
||||||
this.listinfoid = msg.data.id //下单需要的id
|
this.listinfoid = msg.data.id //下单需要的id
|
||||||
this.orderInfo = msg.data
|
this.orderInfo = msg.data
|
||||||
if (this.radiovalue1 == 1) {
|
if (this.radiovalue1 == 1) {
|
||||||
this.showpopupclickdds() //微信支付
|
// this.showpopupclickdds() //微信支付
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handlemessage() {
|
|
||||||
console.log(this.socketTicket, 'detail页面')
|
|
||||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
|
||||||
// this.socketTicket = new webSocketUtils(
|
|
||||||
// `${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
|
|
||||||
// 5000)
|
|
||||||
|
|
||||||
this.socketTicket = new webSocketUtils(
|
|
||||||
`${uni.conf.baseUrlwws}`,
|
|
||||||
5000, {
|
|
||||||
tableId: uni.cache.get('tableCode'),
|
|
||||||
shopId: uni.cache.get('shopUser'),
|
|
||||||
userId: uni.cache.get('userInfo').id,
|
|
||||||
"type": "connect",
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
// 数据处理
|
// 数据处理
|
||||||
socketSendMsg(data) {
|
socketSendMsg(data) {
|
||||||
if (this.socketTicket) {
|
if (this.socketTicket) {
|
||||||
@@ -351,54 +292,13 @@
|
|||||||
orderId: this.listinfo.id,
|
orderId: this.listinfo.id,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
creactorder() {
|
|
||||||
let data = { //定义socket数据传参
|
|
||||||
"skuId": '',
|
|
||||||
"num": '', //数量
|
|
||||||
"type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
|
||||||
"couponsId": this.emitorderfoodform.id ? this.emitorderfoodform.id : '', //优惠券ID,
|
|
||||||
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
|
||||||
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
|
||||||
"productId": '', //商品id
|
|
||||||
"shopId": this.$store.state.shopId,
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
|
||||||
// tableId:uni.cache.get('tableCode')
|
|
||||||
}
|
|
||||||
let res = 0
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.listinfoid = msg.data.id //下单需要的id
|
|
||||||
this.orderInfo = msg.data
|
|
||||||
if (this.radiovalue1 == 1) {
|
|
||||||
this.showpopupclickdds() //微信支付
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 去结算
|
|
||||||
showpopupclick() {
|
|
||||||
let data = { //定义socket数据传参
|
|
||||||
"skuId": '',
|
|
||||||
"num": '', //数量
|
|
||||||
"type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”,
|
|
||||||
"couponsId": this.emitorderfoodform.id ? this.emitorderfoodform.id : '', //优惠券ID,
|
|
||||||
"isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用),
|
|
||||||
"isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买)
|
|
||||||
"productId": '', //商品id
|
|
||||||
"shopId": this.$store.state.shopId,
|
|
||||||
"userId": uni.cache.get('userInfo').id,
|
|
||||||
// tableId:uni.cache.get('tableCode')
|
|
||||||
}
|
|
||||||
this.socketSendMsg(data)
|
|
||||||
},
|
|
||||||
// 去充值
|
// 去充值
|
||||||
goRecharge() {
|
goRecharge() {
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
uni.pro.navigateTo('/pages/member/index', {
|
||||||
shopId: this.amountVIP.shopId
|
shopId: uni.cache.get('shopUser')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
showpopupclickdd() {
|
showpopupclickdd() {
|
||||||
|
|
||||||
|
|
||||||
// radiovalue1为1是微信支付
|
// radiovalue1为1是微信支付
|
||||||
if (this.radiovalue1 == 1) {
|
if (this.radiovalue1 == 1) {
|
||||||
this.showpopupclickdds() //微信支付
|
this.showpopupclickdds() //微信支付
|
||||||
@@ -426,10 +326,10 @@
|
|||||||
orderId: this.listinfo.id
|
orderId: this.listinfo.id
|
||||||
}) //判断是否支付成功
|
}) //判断是否支付成功
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
// uni.showLoading({
|
uni.showLoading({
|
||||||
// title: '加载中',
|
title: '加载中',
|
||||||
// mask: true
|
mask: true
|
||||||
// })
|
})
|
||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
// 微信支付还是余额支付
|
// 微信支付还是余额支付
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
@@ -451,14 +351,19 @@
|
|||||||
uni.cache.set('shopUser', '') //删除shopUser
|
uni.cache.set('shopUser', '') //删除shopUser
|
||||||
_this.paymodfiyOrderInfo()
|
_this.paymodfiyOrderInfo()
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/order/order_detail?orderId=' + _this
|
url: '/pages/order/order_detail?orderId=' +
|
||||||
|
_this
|
||||||
.listinfo.id
|
.listinfo.id
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
fail: () => {
|
||||||
|
uni.hideLoading()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
// #endif
|
// #endif
|
||||||
|
uni.hideLoading()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 余额支付
|
// 余额支付
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<view id="wrapper">
|
<view id="wrapper">
|
||||||
|
<view v-if="fixedtrue"
|
||||||
|
style="height: 100vh; width: 100%; position: fixed; z-index: 999; top: 0; left: 0; background-color: #fff; display: flex; justify-content: center; align-items: center;">
|
||||||
|
<u-loadmore status="loading" fontSize="50" iconSize="30"/>
|
||||||
|
</view>
|
||||||
<view class="nav-wrap" :class="{ 'is-fixed': isFixed }"
|
<view class="nav-wrap" :class="{ 'is-fixed': isFixed }"
|
||||||
:style="{ paddingTop: `${menuInfo.top}px`, paddingBottom: `${paddingBtmSize}px` }">
|
:style="{ paddingTop: `${menuInfo.top}px`, paddingBottom: `${paddingBtmSize}px` }">
|
||||||
<view class="content" :style="{ height: `${menuInfo.height}px`, paddingLeft: `${paddingBtmSize}px` }">
|
<view class="content" :style="{ height: `${menuInfo.height}px`, paddingLeft: `${paddingBtmSize}px` }">
|
||||||
@@ -103,7 +107,7 @@
|
|||||||
mode="aspectFit" @click="showCart = !showCart">
|
mode="aspectFit" @click="showCart = !showCart">
|
||||||
</image>
|
</image>
|
||||||
<text class="i">¥</text>
|
<text class="i">¥</text>
|
||||||
<text class="num">{{cartLists.amount}}</text>
|
<text class="num">{{cartLists.amount||'0.00'}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="btn" @tap="$u.debounce(orderdetail, 500)">
|
<view class="btn" @tap="$u.debounce(orderdetail, 500)">
|
||||||
<text class="t">提交订单</text>
|
<text class="t">提交订单</text>
|
||||||
@@ -254,7 +258,8 @@
|
|||||||
socketTicket: null,
|
socketTicket: null,
|
||||||
amountcartNumber: 0,
|
amountcartNumber: 0,
|
||||||
skuidsearch: '', //
|
skuidsearch: '', //
|
||||||
salePrice: '' //钱数
|
salePrice: '' ,//钱数
|
||||||
|
fixedtrue:true
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@@ -312,8 +317,6 @@
|
|||||||
code: uni.cache.get('tableCode')
|
code: uni.cache.get('tableCode')
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
let time = new Date
|
|
||||||
console.log(time, '时间戳')
|
|
||||||
uni.cache.set('shopUser', res.data)
|
uni.cache.set('shopUser', res.data)
|
||||||
this.handlemessage()
|
this.handlemessage()
|
||||||
this.productqueryProduct() //list 数据
|
this.productqueryProduct() //list 数据
|
||||||
@@ -372,10 +375,6 @@
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'queryCart': //待提交
|
case 'queryCart': //待提交
|
||||||
// let queryCart = JSON.stringify(msg.data)
|
|
||||||
// uni.pro.navigateTo('order_detail/order_detail', {
|
|
||||||
// tableId: JSON.stringify(msg.data)
|
|
||||||
// })
|
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/order_detail/order_detail?tableId=' + JSON.stringify(msg.data) +
|
url: '/pages/order_detail/order_detail?tableId=' + JSON.stringify(msg.data) +
|
||||||
'&amount=' + msg.amount
|
'&amount=' + msg.amount
|
||||||
@@ -389,9 +388,6 @@
|
|||||||
if (item.skuId == this.skuidsearch) {
|
if (item.skuId == this.skuidsearch) {
|
||||||
nums = item.number
|
nums = item.number
|
||||||
}
|
}
|
||||||
// else {
|
|
||||||
// this.$set(this, 'amountcartNumber', 0)
|
|
||||||
// }
|
|
||||||
})
|
})
|
||||||
this.$set(this, 'amountcartNumber', nums)
|
this.$set(this, 'amountcartNumber', nums)
|
||||||
} else {
|
} else {
|
||||||
@@ -500,6 +496,7 @@
|
|||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.shopList = res.data
|
this.shopList = res.data
|
||||||
|
this.fixedtrue = false
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.countTitleTopNum();
|
this.countTitleTopNum();
|
||||||
});
|
});
|
||||||
@@ -606,7 +603,6 @@
|
|||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopUser'),
|
||||||
"userId": uni.cache.get('userInfo').id,
|
"userId": uni.cache.get('userInfo').id,
|
||||||
}
|
}
|
||||||
this.$store.dispatch("set_shopid"); //获取shapid
|
|
||||||
uni.$u.debounce(this.socketSendMsg(data), 500)
|
uni.$u.debounce(this.socketSendMsg(data), 500)
|
||||||
},
|
},
|
||||||
orderfoodindex() {
|
orderfoodindex() {
|
||||||
|
|||||||
@@ -186,8 +186,6 @@
|
|||||||
</view> -->
|
</view> -->
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|
||||||
<!-- <view class="bottomcontent flex-between">
|
<!-- <view class="bottomcontent flex-between">
|
||||||
<view class="bottomcontent_texttop flex-start">
|
<view class="bottomcontent_texttop flex-start">
|
||||||
附近推荐
|
附近推荐
|
||||||
|
|||||||
@@ -129,10 +129,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async getAount() {
|
async getAount(shopUser) {
|
||||||
let res = await this.api.shopUserInfo({
|
let res = await this.api.shopUserInfo({
|
||||||
// shopId:店铺ID
|
// shopId:店铺ID
|
||||||
"shopId": this.$store.state.shopId,
|
"shopId": shopUser,
|
||||||
"userId": uni.cache.get('userInfo').id
|
"userId": uni.cache.get('userInfo').id
|
||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
@@ -161,7 +161,8 @@
|
|||||||
setTimeout(res => {
|
setTimeout(res => {
|
||||||
uni.redirectTo({
|
uni.redirectTo({
|
||||||
url: '/pages/order/successful?orderId=' + this
|
url: '/pages/order/successful?orderId=' + this
|
||||||
.listinfoid.id + '&orderInfo=' + JSON.stringify(orderInfo)+'&radiovalue1=' + this.radiovalue1
|
.listinfoid.id + '&orderInfo=' + JSON.stringify(
|
||||||
|
orderInfo) + '&radiovalue1=' + this.radiovalue1
|
||||||
});
|
});
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
@@ -258,9 +259,8 @@
|
|||||||
})
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.info = res.data
|
this.info = res.data
|
||||||
uni.cache.set('shopUser', res.data.shopId);
|
|
||||||
// 获取余额
|
// 获取余额
|
||||||
this.getAount()
|
this.getAount(res.data.shopId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -194,7 +194,6 @@
|
|||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
},
|
},
|
||||||
clickinfo(item, index) {
|
clickinfo(item, index) {
|
||||||
console.log(item, '调试121')
|
|
||||||
switch (item.jumpType) {
|
switch (item.jumpType) {
|
||||||
case 'scan': //特殊处理点击
|
case 'scan': //特殊处理点击
|
||||||
switch (item.value) {
|
switch (item.value) {
|
||||||
|
|||||||
Reference in New Issue
Block a user