优化问题
This commit is contained in:
parent
66e15baaee
commit
cb7d853707
|
|
@ -19,24 +19,24 @@ class webSocketUtils {
|
|||
});
|
||||
} catch (e) {
|
||||
console.log('catch');
|
||||
this.reconnect();
|
||||
// this.reconnect();
|
||||
}
|
||||
}
|
||||
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||
connectSocketInit (data) {
|
||||
console.log(data,"初始化")
|
||||
console.log(data,"初始化")
|
||||
this.data = data;
|
||||
// console.log('this.url==', this.url);
|
||||
// console.log('this.params==', this.params);
|
||||
console.log('this.url==', this.url);
|
||||
this.socketTask = uni.connectSocket({
|
||||
url: this.url,
|
||||
success: () => {
|
||||
console.log('正准备建立websocket中...');
|
||||
uni.hideLoading();
|
||||
// uni.hideLoading();
|
||||
// 返回实例
|
||||
return this.socketTask;
|
||||
},
|
||||
});
|
||||
console.log('this.params==', this.params);
|
||||
this.socketTask.onOpen((res) => {
|
||||
this.connectNum = 1;
|
||||
console.log('WebSocket连接正常!');
|
||||
|
|
@ -48,7 +48,7 @@ class webSocketUtils {
|
|||
clearInterval(this.heartbeatInterval);
|
||||
this.is_open_socket = true;
|
||||
this.canReconnect = true;
|
||||
this.start();
|
||||
// this.start();
|
||||
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||
this.socketTask.onMessage((e) => {
|
||||
// 字符串转json
|
||||
|
|
@ -71,7 +71,7 @@ class webSocketUtils {
|
|||
title: `网络连接失败,正尝试第${this.connectNum}次连接`,
|
||||
icon: 'none',
|
||||
});
|
||||
this.reconnect();
|
||||
// this.reconnect();
|
||||
this.connectNum += 1;
|
||||
} else {
|
||||
// uni.$emit('connectError');
|
||||
|
|
@ -91,7 +91,7 @@ class webSocketUtils {
|
|||
|
||||
this.is_open_socket = false;
|
||||
if (this.canReconnect) {
|
||||
this.reconnect();
|
||||
// this.reconnect();
|
||||
this.canReconnect = false;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -12,11 +12,11 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="navTop">
|
||||
<view @click="clickEvent(1)">
|
||||
<view @click="clickEvent(1)" :class="[active==1?'fonts':'']">
|
||||
余额明细
|
||||
<view :class="[active==1?'xian':'']" style="left: 36rpx;"> </view>
|
||||
</view>
|
||||
<view @click="clickEvent(2)">
|
||||
<view @click="clickEvent(2)" :class="[active==2?'fonts':'']">
|
||||
积分明细
|
||||
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
|
||||
</view>
|
||||
|
|
@ -25,11 +25,11 @@
|
|||
<!-- <image :src="require('')" style="width: 76rpx;height: 76rpx;float: left;" mode=""></image> -->
|
||||
<view class="listrigth">
|
||||
<view>{{item.biz_name}}</view>
|
||||
<view>+{{item.amount}}</view>
|
||||
<view :class="[item.biz_code=='accountGroupPay'?'':'colorStyle']">{{item.biz_code=='accountGroupPay'?'-':'+'}}{{item.amount}}</view>
|
||||
</view>
|
||||
<view class="listrigth2">
|
||||
<view>{{item.create_time}}</view>
|
||||
<view>充值成功</view>
|
||||
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
|
||||
<view>余额:{{item.balance}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
|
@ -84,8 +84,9 @@
|
|||
|
||||
<style scoped lang="less">
|
||||
.bild {
|
||||
height: 488rpx;
|
||||
height: 320rpx;
|
||||
background-image: url('https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/czmxbg.png');
|
||||
background-size: 750rpx 320rpx;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
|
|
@ -113,19 +114,23 @@
|
|||
justify-content: space-around;
|
||||
align-items: center;
|
||||
color: #333;
|
||||
margin-top: -50rpx;
|
||||
margin-top: -60rpx;
|
||||
padding: 0 120rpx;
|
||||
|
||||
.fonts {
|
||||
font-size: 34rpx;
|
||||
}
|
||||
|
||||
>view {
|
||||
position: relative;
|
||||
|
||||
.xian {
|
||||
width: 58rpx;
|
||||
height: 6rpx;
|
||||
background: #F1CB66;
|
||||
background: #FFAA62;
|
||||
border-radius: 2rpx 2rpx 2rpx 2rpx;
|
||||
position: absolute;
|
||||
bottom: -6rpx;
|
||||
bottom: -16rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -133,6 +138,7 @@
|
|||
|
||||
.listStyle {
|
||||
padding: 28rpx;
|
||||
padding-top: 50rpx;
|
||||
width: 100%;
|
||||
|
||||
.listrigth,
|
||||
|
|
@ -140,10 +146,13 @@
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-left: 32rpx;
|
||||
// padding-left: 32rpx;
|
||||
}
|
||||
|
||||
.listrigth {
|
||||
.colorStyle{
|
||||
color: #FF7127;
|
||||
}
|
||||
>view {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<view class="towcontentitem">
|
||||
<view class="towcontentitemone flex-start">
|
||||
<image class="towcontentitemoneimage" :src="userInfo.logo" mode="aspectFill"></image>
|
||||
<view class="towcontentitemonetext flex-colum-start">
|
||||
<text class="towcontentitemonetextone">{{userInfo.chainName || '暂无昵称'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemthere flex-start">
|
||||
余额:<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text>
|
||||
|
||||
</view>
|
||||
<view class="towcontentitemtow flex-between">
|
||||
<text class="towcontentitemtowetext">VIP{{userInfo.code || '无'}}</text>
|
||||
</view>
|
||||
<view class="towcontentitevip">
|
||||
VIP{{userInfo.is_vip}}
|
||||
</view>
|
||||
<image src="https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/erweima.png" class="imgStyle" mode=""
|
||||
@click="clickEvent"></image>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: ['userInfo'],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
methods: {
|
||||
clickEvent() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/pay_code/pay_code?shopInfo='+JSON.stringify(this.userInfo)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.towcontentitem {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
padding: 32rpx;
|
||||
border-radius: 12rpx;
|
||||
background: linear-gradient(126deg, #FFFBF2 0%, #F2D093 100%);
|
||||
border-radius: 12rpx 12rpx 12rpx 12rpx;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 68rpx;
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 240rpx;
|
||||
height: 232rpx;
|
||||
background: url(https://czg-qr-order.oss-cn-beijing.aliyuncs.com/member.png) no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.towcontentitemimage {
|
||||
top: 0;
|
||||
left: 0;
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 12rpx;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.towcontentitemone {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
|
||||
.towcontentitemoneimage {
|
||||
width: 76rpx;
|
||||
height: 76rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.towcontentitemonetext {
|
||||
height: 76rpx;
|
||||
margin-left: 16rpx;
|
||||
|
||||
.towcontentitemonetextone {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: 500;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.towcontentitemonetexttow {
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #422A07;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.towcontentitemprogressa {
|
||||
padding: 8rpx 44rpx;
|
||||
z-index: 10;
|
||||
position: relative;
|
||||
margin-top: 54rpx;
|
||||
}
|
||||
|
||||
.towcontentitemtow {
|
||||
margin-top: 84rpx;
|
||||
z-index: 10;
|
||||
font-size: 24rpx;
|
||||
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
||||
font-weight: 400;
|
||||
color: #422A07;
|
||||
}
|
||||
|
||||
.towcontentitevip {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
width: 92rpx;
|
||||
height: 40rpx;
|
||||
font-size: 20rpx;
|
||||
background: #F4C380;
|
||||
border-radius: 0rpx 12rpx 0rpx 12rpx;
|
||||
text-align: center;
|
||||
line-height: 40rpx;
|
||||
color: #fff;
|
||||
font-family: Source Han Sans CN-Medium;
|
||||
font-weight: Medium;
|
||||
|
||||
}
|
||||
|
||||
.towcontentitemthere {
|
||||
margin-left: 92rpx;
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: Medium;
|
||||
font-size: 24rpx;
|
||||
color: #333333;
|
||||
|
||||
.towcontentitemtheretext {
|
||||
font-family: Source Han Sans CN, Source Han Sans CN;
|
||||
font-weight: bold;
|
||||
font-size: 36rpx;
|
||||
color: #333333;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.imgStyle {
|
||||
width: 54rpx;
|
||||
height: 52rpx;
|
||||
position: absolute;
|
||||
right: 50rpx;
|
||||
bottom: 30rpx;
|
||||
// border: 2px solid #fff;
|
||||
z-index: 666;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,23 +1,6 @@
|
|||
<template>
|
||||
<view class="content">
|
||||
<view class="towcontentitem">
|
||||
<view class="towcontentitemone flex-start">
|
||||
<image class="towcontentitemoneimage" :src="userInfo.logo" mode="aspectFill"></image>
|
||||
<view class="towcontentitemonetext flex-colum-start">
|
||||
<text class="towcontentitemonetextone">{{userInfo.chainName || '暂无昵称'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemthere flex-start">
|
||||
余额:<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text>
|
||||
|
||||
</view>
|
||||
<view class="towcontentitemtow flex-between">
|
||||
<text class="towcontentitemtowetext">vip{{userInfo.code || '无'}}</text>
|
||||
</view>
|
||||
<view class="towcontentitevip">
|
||||
vip{{userInfo.is_vip}}
|
||||
</view>
|
||||
</view>
|
||||
<card :userInfo="userInfo"></card>
|
||||
<view class="therecontent">
|
||||
<input type="number" v-model="amount" placeholder="自定义金额">
|
||||
</view>
|
||||
|
|
@ -37,7 +20,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import card from './components/card.vue'
|
||||
export default {
|
||||
components:{card},
|
||||
data() {
|
||||
return {
|
||||
inputshow: 0,
|
||||
|
|
@ -51,11 +36,11 @@
|
|||
onLoad(e) {
|
||||
console.log(e,'调试2')
|
||||
if (e.type == 'list') {//从列表进来的
|
||||
this.paygetShopByMember(e.shopId_id)
|
||||
this.paygetShopByMember(e.shopId)
|
||||
}else{
|
||||
this.paygetShopByMember(e.shopId_id)
|
||||
this.paygetShopByMember(e.shopId)
|
||||
}
|
||||
this.paygetActive(e.shopId_id) //列表
|
||||
this.paygetActive(e.shopId) //列表
|
||||
},
|
||||
methods: {
|
||||
async paygetShopByMember(w) {
|
||||
|
|
|
|||
|
|
@ -1,24 +1,7 @@
|
|||
<template>
|
||||
<!-- 会员详情 -->
|
||||
<view class="content">
|
||||
<view class="towcontentitem">
|
||||
<view class="towcontentitemone flex-start">
|
||||
<image class="towcontentitemoneimage" :src="userInfo.logo" mode="aspectFill"></image>
|
||||
<view class="towcontentitemonetext flex-colum-start">
|
||||
<text class="towcontentitemonetextone">{{userInfo.chainName || '暂无昵称'}}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="towcontentitemthere flex-start">
|
||||
余额:<text class="towcontentitemtheretext">{{userInfo.amount || '0.00'}}</text>
|
||||
|
||||
</view>
|
||||
<view class="towcontentitemtow flex-between">
|
||||
<text class="towcontentitemtowetext">vip{{userInfo.code || '无'}}</text>
|
||||
</view>
|
||||
<view class="towcontentitevip">
|
||||
vip{{userInfo.is_vip}}
|
||||
</view>
|
||||
</view>
|
||||
<card :userInfo="userInfo"></card>
|
||||
<view class="memberdetailsStyle">
|
||||
<text>会员详情</text>
|
||||
<view @click="goUrl('member/billDetails')">
|
||||
|
|
@ -35,7 +18,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import card from './components/card.vue'
|
||||
export default {
|
||||
components:{card},
|
||||
data() {
|
||||
return {
|
||||
info:null,
|
||||
|
|
|
|||
|
|
@ -94,7 +94,8 @@
|
|||
支付方式
|
||||
</view>
|
||||
<view class="">
|
||||
<u-radio-group v-model="radiovalue1" iconPlacement="right" :size="28" placement="column">
|
||||
<u-radio-group v-model="radiovalue1" iconPlacement="right" @change="groupChange" :size="28"
|
||||
placement="column">
|
||||
<u-radio activeColor="#ffd158" name="1">
|
||||
<view class="dfs">
|
||||
<image style="width:44rpx;height:44rpx"
|
||||
|
|
@ -177,7 +178,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 支付密码 -->
|
||||
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-show="ispws"></payPassword>
|
||||
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-if="ispws"></payPassword>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -215,13 +216,10 @@
|
|||
|
||||
onUnload() {
|
||||
uni.$off('getMessage')
|
||||
// uni.showToast({
|
||||
// title: this.radiovalue1 + '-110',
|
||||
// duration:5000
|
||||
// })
|
||||
this.ispws = false
|
||||
|
||||
},
|
||||
onLoad(e) {
|
||||
|
||||
// console.log(e, 140)
|
||||
let res = JSON.parse(e.tableId)
|
||||
this.listinfo.detailList = res
|
||||
|
|
@ -254,6 +252,11 @@
|
|||
})
|
||||
},
|
||||
methods: {
|
||||
groupChange(n) {
|
||||
// console.log('groupChange', n);
|
||||
this.radiovalue1 = n
|
||||
uni.cache.set('radiovalue1',n)
|
||||
},
|
||||
// fangdouevent() {
|
||||
// this.$u.debounce(() => {
|
||||
// this.showpopupclick()
|
||||
|
|
@ -269,6 +272,7 @@
|
|||
}
|
||||
},
|
||||
async getAount() {
|
||||
console.log(uni.cache.get('userInfo'), '余额中userId不显示打印')
|
||||
let res = await this.api.shopUserInfo({
|
||||
// shopId:店铺ID
|
||||
"shopId": uni.cache.get('shopUser'),
|
||||
|
|
@ -280,7 +284,6 @@
|
|||
}
|
||||
},
|
||||
getMessage(msg) {
|
||||
|
||||
if (msg.status != 'success') {
|
||||
uni.showToast({
|
||||
title: msg.msg,
|
||||
|
|
@ -288,23 +291,17 @@
|
|||
})
|
||||
this.socketTicket.Close()
|
||||
uni.$off('getMessage')
|
||||
return false;
|
||||
} else {
|
||||
switch (msg.type) {
|
||||
case 'createOrder': //去结算
|
||||
this.listinfoid = msg.data.id //下单需要的id
|
||||
this.orderInfo = msg.data
|
||||
this.showpopupclickdd()
|
||||
// let item = JSON.stringify(msg.data)
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/order_detail/order_detail?tableId=' + item
|
||||
// });
|
||||
break;
|
||||
}
|
||||
console.log(msg, 'socke返回数据')
|
||||
|
||||
} else if (msg.type == 'createOrder') {
|
||||
console.log(msg, 'createOrder执行')
|
||||
this.listinfoid = msg.data.id //下单需要的id
|
||||
this.orderInfo = msg.data
|
||||
this.showpopupclickdd()
|
||||
}
|
||||
},
|
||||
handlemessage() {
|
||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
// 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)
|
||||
|
|
@ -358,65 +355,14 @@
|
|||
// 去充值
|
||||
goRecharge() {
|
||||
uni.pro.navigateTo('/pages/member/index', {
|
||||
shopId_id: uni.cache.get('shopUser')
|
||||
shopId_id: this.amountVIP.shopId
|
||||
})
|
||||
},
|
||||
|
||||
async showpopupclickdd(i) {
|
||||
showpopupclickdd(i) {
|
||||
console.log(this.radiovalue1, 'radiovalue1的值')
|
||||
if (this.radiovalue1 == 1) {
|
||||
let res = await this.api.payorderPay({
|
||||
orderId: this.listinfoid
|
||||
}) //判断是否支付成功
|
||||
if (res.code == 0) {
|
||||
// uni.showLoading({
|
||||
// title: '加载中',
|
||||
// mask: true
|
||||
// })
|
||||
// #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: "支付成功"
|
||||
})
|
||||
uni.cache.set('shopUser', '') //删除shopUser
|
||||
this.paymodfiyOrderInfo()
|
||||
setTimeout(res => {
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/successful?orderId=' + this
|
||||
.listinfoid + '&orderInfo=' + JSON.stringify(
|
||||
this.orderInfo) + '&payType' + this
|
||||
.radiovalue1
|
||||
});
|
||||
}, 1000)
|
||||
// uni.redirectTo({
|
||||
// url: "/pages/mall/order/ordersuccess?id=" + datareslane.data
|
||||
// .order_id,
|
||||
// });
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败'
|
||||
})
|
||||
uni.hideLoading()
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/order/order_detail?orderId=' + this.listinfoid
|
||||
// });
|
||||
},
|
||||
complete: (data) => {
|
||||
console.log(data, '成功与否')
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
this.showpopupclickdds()
|
||||
} else {
|
||||
// 判断是否有绑定支付密码
|
||||
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
|
||||
|
|
@ -433,6 +379,63 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
// 微信支付
|
||||
async showpopupclickdds() {
|
||||
|
||||
let res = await this.api.payorderPay({
|
||||
orderId: this.listinfoid
|
||||
}) //判断是否支付成功
|
||||
if (res.code == 0) {
|
||||
// uni.showLoading({
|
||||
// title: '加载中',
|
||||
// mask: true
|
||||
// })
|
||||
// #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: "支付成功"
|
||||
})
|
||||
uni.cache.set('shopUser', '') //删除shopUser
|
||||
this.paymodfiyOrderInfo()
|
||||
setTimeout(res => {
|
||||
uni.redirectTo({
|
||||
url: '/pages/order/successful?orderId=' + this
|
||||
.listinfoid + '&orderInfo=' + JSON.stringify(
|
||||
this.orderInfo) + '&payType' + this
|
||||
.radiovalue1
|
||||
});
|
||||
}, 1000)
|
||||
// uni.redirectTo({
|
||||
// url: "/pages/mall/order/ordersuccess?id=" + datareslane.data
|
||||
// .order_id,
|
||||
// });
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
title: '支付失败'
|
||||
})
|
||||
// uni.hideLoading()
|
||||
// uni.redirectTo({
|
||||
// url: '/pages/order/order_detail?orderId=' + this.listinfoid
|
||||
// });
|
||||
},
|
||||
complete: (data) => {
|
||||
console.log(data, '成功与否')
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
// 余额支付
|
||||
async accountPayevent(pwd) {
|
||||
this.ispws = false
|
||||
|
|
|
|||
|
|
@ -310,6 +310,8 @@
|
|||
})
|
||||
try {
|
||||
if (res.data) {
|
||||
let time = new Date
|
||||
console.log(time,'时间戳')
|
||||
uni.cache.set('shopUser', res.data)
|
||||
this.handlemessage()
|
||||
}
|
||||
|
|
@ -398,11 +400,12 @@
|
|||
}
|
||||
},
|
||||
handlemessage() {
|
||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||
console.log(this.socketTicket,'是否存在socketTicket1')
|
||||
// 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)
|
||||
|
||||
console.log(this.socketTicket,'是否存在socketTicket3')
|
||||
},
|
||||
// 数据处理
|
||||
socketSendMsg(data) {
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
<template>
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<text class="t">{{shopUser.nickName}}</text>
|
||||
<text class="t"></text>
|
||||
</view>
|
||||
<view class="code-wrap">
|
||||
<view class="num-wrap">
|
||||
<text class="t">账户余额:</text>
|
||||
<text class="num">{{shopUser.amount}}</text>
|
||||
<text class="num">{{shopInfo.amount}}</text>
|
||||
</view>
|
||||
<view class="line-code">
|
||||
<tki-barcode ref="tkiBarcode" show :opations="tkiOptions"></tki-barcode>
|
||||
<tki-barcode ref="tkiBarcode" show :opations="tkiOptions"></tki-barcode>
|
||||
</view>
|
||||
<view class="ewm-wrap">
|
||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="createcardNo"></uqrcode>
|
||||
</view>
|
||||
<view class="name">
|
||||
<text>使用门店:{{shopUser.name}}</text>
|
||||
<text>使用门店:{{shopInfo.shopName}}</text>
|
||||
</view>
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
|
|
@ -35,20 +35,22 @@
|
|||
fontSize: 28,
|
||||
textMargin: 14
|
||||
},
|
||||
shopUser: {},
|
||||
createcardNo: ''
|
||||
createcardNo: '',
|
||||
shopInfo: null
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.shopUser = uni.cache.get('shopUser')
|
||||
onLoad(e) {
|
||||
this.shopInfo = JSON.parse(e.shopInfo)
|
||||
this.logincreateCardNo();
|
||||
},
|
||||
methods: {
|
||||
async logincreateCardNo() {
|
||||
let res = await this.api.logincreateCardNo()
|
||||
let res = await this.api.logincreateCardNo({
|
||||
"shopId": this.shopInfo.shopId
|
||||
})
|
||||
if (res.code == 0) {
|
||||
this.createcardNo = res.data
|
||||
this.$refs.tkiBarcode.setval(this.createcardNo)//操作属性
|
||||
this.$refs.tkiBarcode.setval(this.createcardNo) //操作属性
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue