This commit is contained in:
zmj 2024-06-24 18:40:03 +08:00
parent b8aaa100b4
commit 6605fe5571
7 changed files with 905 additions and 696 deletions

View File

@ -99,6 +99,10 @@ export const vipRechargeApi = (data) => {
return request.post('/store/store/recharge', data);
}
export const reVipRechargeApi = (data) => {
return request.post('/store/store/again_recharge', data);
}
export const rechargeCountApi = (data) => {
return request.get('/store/store/recharge_count', data);
}

View File

@ -1,4 +1,5 @@
let BASE_URL
let WSS_URL
import store from "@/store/user.js"
// 环境
let env = "dev"
@ -8,12 +9,15 @@ let env = "dev"
switch (env) {
case 'dev':
BASE_URL = 'https://test-multi-store.lihaink.cn';
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
break;
case 'liu':
BASE_URL = 'http://192.168.1.201:8545';
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
break;
default:
BASE_URL = 'https://multi-store.lihaink.cn';
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
}
let HTTP_REQUEST_URL
@ -21,6 +25,7 @@ let HEADER
let config = {
HTTP_REQUEST_URL: BASE_URL,
WSS_URL: WSS_URL,
HEADER: {
'content-type': 'application/json',
//#ifdef MP

View File

@ -21,8 +21,8 @@
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
<text>{{item.title}}</text>
<text style="font-weight: bold;" :style="{color:item.financial_pm?'#50C758':'red'
}">{{ item.financial_pm?'+':'-' }}{{item.number}}</text>
<text style="font-weight: bold;" :style="{color:!item.financial_pm?'#50C758':'red'
}">{{ !item.financial_pm?'+':'-' }}{{item.number}}</text>
</view>
<view class="li-top" style="margin-bottom: 0;">
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
@ -33,8 +33,8 @@
<view class="li" v-for="(item,index) in lists" :key="index">
<view class="li-top">
<text>{{item.order_sn}}</text>
<text style="font-weight: bold;" :style="{color:item.status?'#50C758':'red'
}">{{ item.status?'+':'-' }}{{item.number}}</text>
<text style="font-weight: bold;" :style="{color:!item.status?'#50C758':'red'
}">{{ !item.status?'+':'-' }}{{item.number}}</text>
</view>
<view class="li-top" style="margin-bottom: 0;">
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
@ -68,10 +68,10 @@
name: '全部'
},
{
name: '支出'
name: '收入'
},
{
name: '收入'
name: '支出'
},
]);
@ -81,7 +81,6 @@
getLists()
}
const lists = ref([])
let type = ref('')
const getLists = async (isPullDown = false) => {

View File

@ -28,19 +28,19 @@
{{Role==1?'行业会员':'商户'}}开通报备
</view>
<up-form labelPosition="left" :model="formData" :borderBottom='false'>
<up-form-item label="" prop="userInfo.name">
<up-form-item label="">
<up-input v-model="formData.real_name" border="none" prefixIcon="account" placeholder="请输入真实姓名"
:customStyle="{background:'#F3F3F3',padding:'20rpx','border-radius':'30rpx'}"
:placeholderStyle="{color:'#444444'}"
:prefixIconStyle="{'margin-right':'40rpx'}"></up-input>
</up-form-item>
<up-form-item label="" prop="userInfo.name">
<up-form-item label="">
<up-input v-model="formData.mobile" border="none" prefixIcon="phone" placeholder="请输入电话号码"
:customStyle="{background:'#F3F3F3',padding:'20rpx','border-radius':'30rpx'}"
:placeholderStyle="{color:'#444444'}"
:prefixIconStyle="{'margin-right':'40rpx'}"></up-input>
</up-form-item>
<up-form-item label="" prop="userInfo.name">
<up-form-item label="">
<view @click="showPop=true" style="width: 100%;">
<up-input style="pointer-events: none" v-model="formData.address" border="none"
prefixIcon="map" readonly placeholder="点击选择地址" :customStyle="{background:'#F3F3F3',padding:'20rpx',
@ -50,7 +50,7 @@
</view>
</up-form-item>
<up-form-item label="" prop="userInfo.name" v-if='Role==1'>
<up-form-item label="" v-if='Role==1'>
<view @click="showPop1=true" style="width: 100%;">
<up-input style="pointer-events: none" v-model="formData.label_name" border="none"
prefixIcon="man-add" readonly placeholder="点击选择用户身份" :customStyle="{background:'#F3F3F3',padding:'20rpx',
@ -107,15 +107,21 @@
<uni-td style="font-size: 20rpx;" align="center" v-if='Role==1'>{{item.label_name}}</uni-td>
<uni-td style="font-size: 20rpx;" align="center">
<view v-if="item.paid ==1 ||Role==4">已开通</view>
<view v-else @click="upadtaStatus(item)" style="color:#33B83A ;">未开通,查询</view>
<view v-else style="color:#33B83A ;">
<view @click="upadtaStatus(item)">
未开通,查询
</view>
<view @click="rePay(item)">
重新支付
</view>
</view>
</uni-td>
</uni-tr>
</uni-table>
</view>
</block>
</view>
<view style="height: 50rpx;" />
<!-- 地址选择器 -->
<up-popup :show="showPop" @close="showPop=false" @open="showPop=true" :round="10">
@ -169,6 +175,7 @@
reactive,
ref
} from 'vue';
import useUserStore from "@/store/user";
import {
provinceListApi,
cityListApi,
@ -180,6 +187,7 @@
import {
vipRechargeApi,
rechargeCountApi,
reVipRechargeApi,
rechargeListsApi,
updataOrderApi,
getStoreByPhone,
@ -187,11 +195,59 @@
getUserShip,
getCreateLists
} from "@/api/user.js"
import Push from "@/utils/push.js"
import {
onPullDownRefresh,
onLoad
} from "@dcloudio/uni-app"
import {
config
} from "@/config/app.js"
// scoket
let timer = null
const userInfo = useUserStore().userInfo;
const connection = new Push({
url: config.WSS_URL, // websocket
app_key: '2ce3ce22329517213caa7dad261f5695',
});
// user-1
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}}`);
user_channel.on('message', function(data) {
console.log("收到消息--", data);
try {
if (timer) clearTimeout(timer);
uni.hideLoading()
currentTab.value = 2
formData.real_name = ''
formData.mobile = ''
formData.address = ''
formData.label_name = ''
formData.city = ''
formData.area = ''
formData.street = ''
formData.village = ''
formData.brigade = ''
currentAddressIndex.value = 0
tabsList.forEach(item => {
item.name = '请选择'
})
getLists()
getCount()
} catch (error) {
}
});
// 线
user_channel.on('close', function() {
});
// scoket
const showPop1 = ref(false)
const Role = ref('')
@ -377,22 +433,28 @@
formData.recharge_type = 'INDUSTRYMEMBERS'
formData.user_ship = 1
vipRechargeApi(formData).then(res => {
uni.$u.toast('操作成功');
currentTab.value = 2
formData.real_name = ''
formData.mobile = ''
formData.address = ''
formData.label_name = ''
formData.city = ''
formData.area = ''
formData.street = ''
formData.village = ''
formData.brigade = ''
currentAddressIndex.value = 0
uni.showLoading({
title: '支付中...'
});
timer = setTimeout(() => {
uni.hideLoading();
uni.$u.toast('支付超时');
// formData.real_name = ''
// formData.mobile = ''
// formData.address = ''
// formData.label_name = ''
// formData.city = ''
// formData.area = ''
// formData.street = ''
// formData.village = ''
// formData.brigade = ''
// currentAddressIndex.value = 0
// tabsList.forEach(item => {
// item.name = ''
// })
}, 30000)
tabsList.forEach(item => {
item.name = '请选择'
})
// uni.$u.toast('');
})
getCount()
@ -426,6 +488,24 @@
}
const rePay = (item) => {
uni.scanCode({
success: function(res) {
reVipRechargeApi({
id: item.id,
auth_code: res.result
}).then(res => {
uni.$u.toast('操作成功');
getCount()
getLists()
})
}
});
}
//
const count = ref(0)
const getCount = async () => {
@ -451,7 +531,6 @@
})
lists.value = res.data.lists
count.value = res.data.count
}
}
@ -464,13 +543,15 @@
updataOrderApi({
order_no: item.order_id,
recharge: 1
}).then(res => {
getCount()
getLists()
})
}
onLoad(() => {
getUserShip().then(res => {
console.log(res)
range.value = res.data.lists.map(item => {
return {
value: item.id,

View File

@ -53,7 +53,7 @@
"style": {
"navigationBarTitleText": "个人中心",
"enablePullDownRefresh": true,
"navigationStyle": "custom"
"navigationBarBackgroundColor": "#D3FDCA"
}
}, {
"path": "pages/charge/charge_record",

View File

@ -23,8 +23,8 @@
</style>
<template>
<view>
<up-navbar title="我的" :autoBack="true" bgColor="transparent" :fixed="true">
</up-navbar>
<!-- <up-navbar title="我的" :autoBack="true" bgColor="transparent" :fixed="true">
</up-navbar> -->
<view class="user-info">
<image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp"
mode="widthFix"></image>
@ -198,7 +198,7 @@
overflow: hidden;
position: relative;
width: 750rpx;
height: 350rpx;
height: 250rpx;
.bg {
width: 100%;
@ -212,7 +212,7 @@
box-sizing: border-box;
padding: 50rpx 0 50rpx 50rpx;
position: absolute;
top: 150rpx;
top: 50rpx;
left: 0;
z-index: 2;
display: flex;

File diff suppressed because it is too large Load Diff