优化问题
This commit is contained in:
@@ -19,24 +19,24 @@ class webSocketUtils {
|
|||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log('catch');
|
console.log('catch');
|
||||||
this.reconnect();
|
// this.reconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
// 进入这个页面的时候创建websocket连接【整个页面随时使用】
|
||||||
connectSocketInit (data) {
|
connectSocketInit (data) {
|
||||||
console.log(data,"初始化")
|
console.log(data,"初始化")
|
||||||
this.data = data;
|
this.data = data;
|
||||||
// console.log('this.url==', this.url);
|
console.log('this.url==', this.url);
|
||||||
// console.log('this.params==', this.params);
|
|
||||||
this.socketTask = uni.connectSocket({
|
this.socketTask = uni.connectSocket({
|
||||||
url: this.url,
|
url: this.url,
|
||||||
success: () => {
|
success: () => {
|
||||||
console.log('正准备建立websocket中...');
|
console.log('正准备建立websocket中...');
|
||||||
uni.hideLoading();
|
// uni.hideLoading();
|
||||||
// 返回实例
|
// 返回实例
|
||||||
return this.socketTask;
|
return this.socketTask;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
console.log('this.params==', this.params);
|
||||||
this.socketTask.onOpen((res) => {
|
this.socketTask.onOpen((res) => {
|
||||||
this.connectNum = 1;
|
this.connectNum = 1;
|
||||||
console.log('WebSocket连接正常!');
|
console.log('WebSocket连接正常!');
|
||||||
@@ -48,7 +48,7 @@ class webSocketUtils {
|
|||||||
clearInterval(this.heartbeatInterval);
|
clearInterval(this.heartbeatInterval);
|
||||||
this.is_open_socket = true;
|
this.is_open_socket = true;
|
||||||
this.canReconnect = true;
|
this.canReconnect = true;
|
||||||
this.start();
|
// this.start();
|
||||||
// 注:只有连接正常打开中 ,才能正常收到消息
|
// 注:只有连接正常打开中 ,才能正常收到消息
|
||||||
this.socketTask.onMessage((e) => {
|
this.socketTask.onMessage((e) => {
|
||||||
// 字符串转json
|
// 字符串转json
|
||||||
@@ -71,7 +71,7 @@ class webSocketUtils {
|
|||||||
title: `网络连接失败,正尝试第${this.connectNum}次连接`,
|
title: `网络连接失败,正尝试第${this.connectNum}次连接`,
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
});
|
});
|
||||||
this.reconnect();
|
// this.reconnect();
|
||||||
this.connectNum += 1;
|
this.connectNum += 1;
|
||||||
} else {
|
} else {
|
||||||
// uni.$emit('connectError');
|
// uni.$emit('connectError');
|
||||||
@@ -91,7 +91,7 @@ class webSocketUtils {
|
|||||||
|
|
||||||
this.is_open_socket = false;
|
this.is_open_socket = false;
|
||||||
if (this.canReconnect) {
|
if (this.canReconnect) {
|
||||||
this.reconnect();
|
// this.reconnect();
|
||||||
this.canReconnect = false;
|
this.canReconnect = false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -12,11 +12,11 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="navTop">
|
<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 :class="[active==1?'xian':'']" style="left: 36rpx;"> </view>
|
||||||
</view>
|
</view>
|
||||||
<view @click="clickEvent(2)">
|
<view @click="clickEvent(2)" :class="[active==2?'fonts':'']">
|
||||||
积分明细
|
积分明细
|
||||||
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
|
<view :class="[active==2?'xian':'']" style="left: 36rpx;"> </view>
|
||||||
</view>
|
</view>
|
||||||
@@ -25,11 +25,11 @@
|
|||||||
<!-- <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>+{{item.amount}}</view>
|
<view :class="[item.biz_code=='accountGroupPay'?'':'colorStyle']">{{item.biz_code=='accountGroupPay'?'-':'+'}}{{item.amount}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="listrigth2">
|
<view class="listrigth2">
|
||||||
<view>{{item.create_time}}</view>
|
<view>{{$u.timeFormat(item.create_time, 'yyyy-mm-dd hh:MM:ss')}}</view>
|
||||||
<view>充值成功</view>
|
<view>余额:{{item.balance}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -84,8 +84,9 @@
|
|||||||
|
|
||||||
<style scoped lang="less">
|
<style scoped lang="less">
|
||||||
.bild {
|
.bild {
|
||||||
height: 488rpx;
|
height: 320rpx;
|
||||||
background-image: url('https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/czmxbg.png');
|
background-image: url('https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/czmxbg.png');
|
||||||
|
background-size: 750rpx 320rpx;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -113,19 +114,23 @@
|
|||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: #333;
|
color: #333;
|
||||||
margin-top: -50rpx;
|
margin-top: -60rpx;
|
||||||
padding: 0 120rpx;
|
padding: 0 120rpx;
|
||||||
|
|
||||||
|
.fonts {
|
||||||
|
font-size: 34rpx;
|
||||||
|
}
|
||||||
|
|
||||||
>view {
|
>view {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.xian {
|
.xian {
|
||||||
width: 58rpx;
|
width: 58rpx;
|
||||||
height: 6rpx;
|
height: 6rpx;
|
||||||
background: #F1CB66;
|
background: #FFAA62;
|
||||||
border-radius: 2rpx 2rpx 2rpx 2rpx;
|
border-radius: 2rpx 2rpx 2rpx 2rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -6rpx;
|
bottom: -16rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -133,6 +138,7 @@
|
|||||||
|
|
||||||
.listStyle {
|
.listStyle {
|
||||||
padding: 28rpx;
|
padding: 28rpx;
|
||||||
|
padding-top: 50rpx;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.listrigth,
|
.listrigth,
|
||||||
@@ -140,10 +146,13 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding-left: 32rpx;
|
// padding-left: 32rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.listrigth {
|
.listrigth {
|
||||||
|
.colorStyle{
|
||||||
|
color: #FF7127;
|
||||||
|
}
|
||||||
>view {
|
>view {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
|||||||
163
pages/member/components/card.vue
Normal file
163
pages/member/components/card.vue
Normal file
@@ -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>
|
<template>
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="towcontentitem">
|
<card :userInfo="userInfo"></card>
|
||||||
<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>
|
|
||||||
<view class="therecontent">
|
<view class="therecontent">
|
||||||
<input type="number" v-model="amount" placeholder="自定义金额">
|
<input type="number" v-model="amount" placeholder="自定义金额">
|
||||||
</view>
|
</view>
|
||||||
@@ -37,7 +20,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import card from './components/card.vue'
|
||||||
export default {
|
export default {
|
||||||
|
components:{card},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
inputshow: 0,
|
inputshow: 0,
|
||||||
@@ -51,11 +36,11 @@
|
|||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
console.log(e,'调试2')
|
console.log(e,'调试2')
|
||||||
if (e.type == 'list') {//从列表进来的
|
if (e.type == 'list') {//从列表进来的
|
||||||
this.paygetShopByMember(e.shopId_id)
|
this.paygetShopByMember(e.shopId)
|
||||||
}else{
|
}else{
|
||||||
this.paygetShopByMember(e.shopId_id)
|
this.paygetShopByMember(e.shopId)
|
||||||
}
|
}
|
||||||
this.paygetActive(e.shopId_id) //列表
|
this.paygetActive(e.shopId) //列表
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async paygetShopByMember(w) {
|
async paygetShopByMember(w) {
|
||||||
|
|||||||
@@ -1,24 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<!-- 会员详情 -->
|
<!-- 会员详情 -->
|
||||||
<view class="content">
|
<view class="content">
|
||||||
<view class="towcontentitem">
|
<card :userInfo="userInfo"></card>
|
||||||
<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>
|
|
||||||
<view class="memberdetailsStyle">
|
<view class="memberdetailsStyle">
|
||||||
<text>会员详情</text>
|
<text>会员详情</text>
|
||||||
<view @click="goUrl('member/billDetails')">
|
<view @click="goUrl('member/billDetails')">
|
||||||
@@ -35,7 +18,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import card from './components/card.vue'
|
||||||
export default {
|
export default {
|
||||||
|
components:{card},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
info:null,
|
info:null,
|
||||||
|
|||||||
@@ -94,7 +94,8 @@
|
|||||||
支付方式
|
支付方式
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<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">
|
<u-radio activeColor="#ffd158" name="1">
|
||||||
<view class="dfs">
|
<view class="dfs">
|
||||||
<image style="width:44rpx;height:44rpx"
|
<image style="width:44rpx;height:44rpx"
|
||||||
@@ -177,7 +178,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 支付密码 -->
|
<!-- 支付密码 -->
|
||||||
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-show="ispws"></payPassword>
|
<payPassword ref="payPwd" @accountPayevent="accountPayevent" v-if="ispws"></payPassword>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -215,13 +216,10 @@
|
|||||||
|
|
||||||
onUnload() {
|
onUnload() {
|
||||||
uni.$off('getMessage')
|
uni.$off('getMessage')
|
||||||
// uni.showToast({
|
this.ispws = false
|
||||||
// title: this.radiovalue1 + '-110',
|
|
||||||
// duration:5000
|
|
||||||
// })
|
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
|
|
||||||
// console.log(e, 140)
|
// console.log(e, 140)
|
||||||
let res = JSON.parse(e.tableId)
|
let res = JSON.parse(e.tableId)
|
||||||
this.listinfo.detailList = res
|
this.listinfo.detailList = res
|
||||||
@@ -254,6 +252,11 @@
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
groupChange(n) {
|
||||||
|
// console.log('groupChange', n);
|
||||||
|
this.radiovalue1 = n
|
||||||
|
uni.cache.set('radiovalue1',n)
|
||||||
|
},
|
||||||
// fangdouevent() {
|
// fangdouevent() {
|
||||||
// this.$u.debounce(() => {
|
// this.$u.debounce(() => {
|
||||||
// this.showpopupclick()
|
// this.showpopupclick()
|
||||||
@@ -269,6 +272,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getAount() {
|
async getAount() {
|
||||||
|
console.log(uni.cache.get('userInfo'), '余额中userId不显示打印')
|
||||||
let res = await this.api.shopUserInfo({
|
let res = await this.api.shopUserInfo({
|
||||||
// shopId:店铺ID
|
// shopId:店铺ID
|
||||||
"shopId": uni.cache.get('shopUser'),
|
"shopId": uni.cache.get('shopUser'),
|
||||||
@@ -280,7 +284,6 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getMessage(msg) {
|
getMessage(msg) {
|
||||||
|
|
||||||
if (msg.status != 'success') {
|
if (msg.status != 'success') {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: msg.msg,
|
title: msg.msg,
|
||||||
@@ -288,23 +291,17 @@
|
|||||||
})
|
})
|
||||||
this.socketTicket.Close()
|
this.socketTicket.Close()
|
||||||
uni.$off('getMessage')
|
uni.$off('getMessage')
|
||||||
return false;
|
console.log(msg, 'socke返回数据')
|
||||||
} else {
|
|
||||||
switch (msg.type) {
|
} else if (msg.type == 'createOrder') {
|
||||||
case '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
|
||||||
this.showpopupclickdd()
|
this.showpopupclickdd()
|
||||||
// let item = JSON.stringify(msg.data)
|
|
||||||
// uni.redirectTo({
|
|
||||||
// url: '/pages/order_detail/order_detail?tableId=' + item
|
|
||||||
// });
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handlemessage() {
|
handlemessage() {
|
||||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
// this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||||
this.socketTicket = new webSocketUtils(
|
this.socketTicket = new webSocketUtils(
|
||||||
`${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
|
`${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
|
||||||
5000)
|
5000)
|
||||||
@@ -358,65 +355,14 @@
|
|||||||
// 去充值
|
// 去充值
|
||||||
goRecharge() {
|
goRecharge() {
|
||||||
uni.pro.navigateTo('/pages/member/index', {
|
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) {
|
if (this.radiovalue1 == 1) {
|
||||||
let res = await this.api.payorderPay({
|
this.showpopupclickdds()
|
||||||
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
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// 判断是否有绑定支付密码
|
// 判断是否有绑定支付密码
|
||||||
// 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码
|
// 先判断是否设置支付密码。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) {
|
async accountPayevent(pwd) {
|
||||||
this.ispws = false
|
this.ispws = false
|
||||||
|
|||||||
@@ -310,6 +310,8 @@
|
|||||||
})
|
})
|
||||||
try {
|
try {
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
|
let time = new Date
|
||||||
|
console.log(time,'时间戳')
|
||||||
uni.cache.set('shopUser', res.data)
|
uni.cache.set('shopUser', res.data)
|
||||||
this.handlemessage()
|
this.handlemessage()
|
||||||
}
|
}
|
||||||
@@ -398,11 +400,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handlemessage() {
|
handlemessage() {
|
||||||
this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
console.log(this.socketTicket,'是否存在socketTicket1')
|
||||||
|
// this.socketTicket ? this.socketTicket.Close() : null //调用前先判断是否有socket正在进行 先关闭后链接
|
||||||
this.socketTicket = new webSocketUtils(
|
this.socketTicket = new webSocketUtils(
|
||||||
`${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
|
`${uni.conf.baseUrlwws}/websocket/table/${uni.cache.get('tableCode')}/${uni.cache.get('shopUser')}/${uni.cache.get('userInfo').id}`,
|
||||||
5000)
|
5000)
|
||||||
|
console.log(this.socketTicket,'是否存在socketTicket3')
|
||||||
},
|
},
|
||||||
// 数据处理
|
// 数据处理
|
||||||
socketSendMsg(data) {
|
socketSendMsg(data) {
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="header">
|
<view class="header">
|
||||||
<text class="t">{{shopUser.nickName}}</text>
|
<text class="t"></text>
|
||||||
</view>
|
</view>
|
||||||
<view class="code-wrap">
|
<view class="code-wrap">
|
||||||
<view class="num-wrap">
|
<view class="num-wrap">
|
||||||
<text class="t">账户余额:</text>
|
<text class="t">账户余额:</text>
|
||||||
<text class="num">{{shopUser.amount}}</text>
|
<text class="num">{{shopInfo.amount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="line-code">
|
<view class="line-code">
|
||||||
<tki-barcode ref="tkiBarcode" show :opations="tkiOptions"></tki-barcode>
|
<tki-barcode ref="tkiBarcode" show :opations="tkiOptions"></tki-barcode>
|
||||||
</view>
|
</view>
|
||||||
<view class="ewm-wrap">
|
<view class="ewm-wrap">
|
||||||
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="createcardNo"></uqrcode>
|
<uqrcode ref="uqrcode" canvas-id="qrcode" :value="createcardNo"></uqrcode>
|
||||||
</view>
|
</view>
|
||||||
<view class="name">
|
<view class="name">
|
||||||
<text>使用门店:{{shopUser.name}}</text>
|
<text>使用门店:{{shopInfo.shopName}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="line"></view>
|
<view class="line"></view>
|
||||||
</view>
|
</view>
|
||||||
@@ -35,20 +35,22 @@
|
|||||||
fontSize: 28,
|
fontSize: 28,
|
||||||
textMargin: 14
|
textMargin: 14
|
||||||
},
|
},
|
||||||
shopUser: {},
|
createcardNo: '',
|
||||||
createcardNo: ''
|
shopInfo: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad(e) {
|
||||||
this.shopUser = uni.cache.get('shopUser')
|
this.shopInfo = JSON.parse(e.shopInfo)
|
||||||
this.logincreateCardNo();
|
this.logincreateCardNo();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async logincreateCardNo() {
|
async logincreateCardNo() {
|
||||||
let res = await this.api.logincreateCardNo()
|
let res = await this.api.logincreateCardNo({
|
||||||
|
"shopId": this.shopInfo.shopId
|
||||||
|
})
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.createcardNo = res.data
|
this.createcardNo = res.data
|
||||||
this.$refs.tkiBarcode.setval(this.createcardNo)//操作属性
|
this.$refs.tkiBarcode.setval(this.createcardNo) //操作属性
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user