add
This commit is contained in:
parent
b8aaa100b4
commit
6605fe5571
|
@ -99,6 +99,10 @@ export const vipRechargeApi = (data) => {
|
||||||
return request.post('/store/store/recharge', data);
|
return request.post('/store/store/recharge', data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const reVipRechargeApi = (data) => {
|
||||||
|
return request.post('/store/store/again_recharge', data);
|
||||||
|
}
|
||||||
|
|
||||||
export const rechargeCountApi = (data) => {
|
export const rechargeCountApi = (data) => {
|
||||||
return request.get('/store/store/recharge_count', data);
|
return request.get('/store/store/recharge_count', data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
let BASE_URL
|
let BASE_URL
|
||||||
|
let WSS_URL
|
||||||
import store from "@/store/user.js"
|
import store from "@/store/user.js"
|
||||||
// 环境
|
// 环境
|
||||||
let env = "dev"
|
let env = "dev"
|
||||||
|
@ -8,12 +9,15 @@ let env = "dev"
|
||||||
switch (env) {
|
switch (env) {
|
||||||
case 'dev':
|
case 'dev':
|
||||||
BASE_URL = 'https://test-multi-store.lihaink.cn';
|
BASE_URL = 'https://test-multi-store.lihaink.cn';
|
||||||
|
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
|
||||||
break;
|
break;
|
||||||
case 'liu':
|
case 'liu':
|
||||||
BASE_URL = 'http://192.168.1.201:8545';
|
BASE_URL = 'http://192.168.1.201:8545';
|
||||||
|
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BASE_URL = 'https://multi-store.lihaink.cn';
|
BASE_URL = 'https://multi-store.lihaink.cn';
|
||||||
|
WSS_URL = 'wss://test-multi-store.lihaink.cn/pull'
|
||||||
}
|
}
|
||||||
|
|
||||||
let HTTP_REQUEST_URL
|
let HTTP_REQUEST_URL
|
||||||
|
@ -21,6 +25,7 @@ let HEADER
|
||||||
|
|
||||||
let config = {
|
let config = {
|
||||||
HTTP_REQUEST_URL: BASE_URL,
|
HTTP_REQUEST_URL: BASE_URL,
|
||||||
|
WSS_URL: WSS_URL,
|
||||||
HEADER: {
|
HEADER: {
|
||||||
'content-type': 'application/json',
|
'content-type': 'application/json',
|
||||||
//#ifdef MP
|
//#ifdef MP
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
<view class="li" v-for="(item,index) in lists" :key="index">
|
<view class="li" v-for="(item,index) in lists" :key="index">
|
||||||
<view class="li-top">
|
<view class="li-top">
|
||||||
<text>{{item.title}}</text>
|
<text>{{item.title}}</text>
|
||||||
<text style="font-weight: bold;" :style="{color:item.financial_pm?'#50C758':'red'
|
<text style="font-weight: bold;" :style="{color:!item.financial_pm?'#50C758':'red'
|
||||||
}">{{ item.financial_pm?'+':'-' }}{{item.number}}</text>
|
}">{{ !item.financial_pm?'+':'-' }}{{item.number}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li-top" style="margin-bottom: 0;">
|
<view class="li-top" style="margin-bottom: 0;">
|
||||||
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
|
<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" v-for="(item,index) in lists" :key="index">
|
||||||
<view class="li-top">
|
<view class="li-top">
|
||||||
<text>{{item.order_sn}}</text>
|
<text>{{item.order_sn}}</text>
|
||||||
<text style="font-weight: bold;" :style="{color:item.status?'#50C758':'red'
|
<text style="font-weight: bold;" :style="{color:!item.status?'#50C758':'red'
|
||||||
}">{{ item.status?'+':'-' }}{{item.number}}</text>
|
}">{{ !item.status?'+':'-' }}{{item.number}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li-top" style="margin-bottom: 0;">
|
<view class="li-top" style="margin-bottom: 0;">
|
||||||
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
|
<text style="font-size: 24rpx;color: grey;">{{item.create_time}}</text>
|
||||||
|
@ -68,10 +68,10 @@
|
||||||
name: '全部'
|
name: '全部'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '支出'
|
name: '收入'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '收入'
|
name: '支出'
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -81,7 +81,6 @@
|
||||||
getLists()
|
getLists()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const lists = ref([])
|
const lists = ref([])
|
||||||
let type = ref('')
|
let type = ref('')
|
||||||
const getLists = async (isPullDown = false) => {
|
const getLists = async (isPullDown = false) => {
|
||||||
|
|
|
@ -28,19 +28,19 @@
|
||||||
{{Role==1?'行业会员':'商户'}}开通报备
|
{{Role==1?'行业会员':'商户'}}开通报备
|
||||||
</view>
|
</view>
|
||||||
<up-form labelPosition="left" :model="formData" :borderBottom='false'>
|
<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="请输入真实姓名"
|
<up-input v-model="formData.real_name" border="none" prefixIcon="account" placeholder="请输入真实姓名"
|
||||||
:customStyle="{background:'#F3F3F3',padding:'20rpx','border-radius':'30rpx'}"
|
:customStyle="{background:'#F3F3F3',padding:'20rpx','border-radius':'30rpx'}"
|
||||||
:placeholderStyle="{color:'#444444'}"
|
:placeholderStyle="{color:'#444444'}"
|
||||||
:prefixIconStyle="{'margin-right':'40rpx'}"></up-input>
|
:prefixIconStyle="{'margin-right':'40rpx'}"></up-input>
|
||||||
</up-form-item>
|
</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="请输入电话号码"
|
<up-input v-model="formData.mobile" border="none" prefixIcon="phone" placeholder="请输入电话号码"
|
||||||
:customStyle="{background:'#F3F3F3',padding:'20rpx','border-radius':'30rpx'}"
|
:customStyle="{background:'#F3F3F3',padding:'20rpx','border-radius':'30rpx'}"
|
||||||
:placeholderStyle="{color:'#444444'}"
|
:placeholderStyle="{color:'#444444'}"
|
||||||
:prefixIconStyle="{'margin-right':'40rpx'}"></up-input>
|
:prefixIconStyle="{'margin-right':'40rpx'}"></up-input>
|
||||||
</up-form-item>
|
</up-form-item>
|
||||||
<up-form-item label="" prop="userInfo.name">
|
<up-form-item label="">
|
||||||
<view @click="showPop=true" style="width: 100%;">
|
<view @click="showPop=true" style="width: 100%;">
|
||||||
<up-input style="pointer-events: none" v-model="formData.address" border="none"
|
<up-input style="pointer-events: none" v-model="formData.address" border="none"
|
||||||
prefixIcon="map" readonly placeholder="点击选择地址" :customStyle="{background:'#F3F3F3',padding:'20rpx',
|
prefixIcon="map" readonly placeholder="点击选择地址" :customStyle="{background:'#F3F3F3',padding:'20rpx',
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
</view>
|
</view>
|
||||||
</up-form-item>
|
</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%;">
|
<view @click="showPop1=true" style="width: 100%;">
|
||||||
<up-input style="pointer-events: none" v-model="formData.label_name" border="none"
|
<up-input style="pointer-events: none" v-model="formData.label_name" border="none"
|
||||||
prefixIcon="man-add" readonly placeholder="点击选择用户身份" :customStyle="{background:'#F3F3F3',padding:'20rpx',
|
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" v-if='Role==1'>{{item.label_name}}</uni-td>
|
||||||
<uni-td style="font-size: 20rpx;" align="center">
|
<uni-td style="font-size: 20rpx;" align="center">
|
||||||
<view v-if="item.paid ==1 ||Role==4">已开通</view>
|
<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-td>
|
||||||
</uni-tr>
|
</uni-tr>
|
||||||
</uni-table>
|
</uni-table>
|
||||||
</view>
|
</view>
|
||||||
</block>
|
</block>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="height: 50rpx;" />
|
||||||
|
|
||||||
|
|
||||||
<!-- 地址选择器 -->
|
<!-- 地址选择器 -->
|
||||||
<up-popup :show="showPop" @close="showPop=false" @open="showPop=true" :round="10">
|
<up-popup :show="showPop" @close="showPop=false" @open="showPop=true" :round="10">
|
||||||
|
@ -169,6 +175,7 @@
|
||||||
reactive,
|
reactive,
|
||||||
ref
|
ref
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
import useUserStore from "@/store/user";
|
||||||
import {
|
import {
|
||||||
provinceListApi,
|
provinceListApi,
|
||||||
cityListApi,
|
cityListApi,
|
||||||
|
@ -180,6 +187,7 @@
|
||||||
import {
|
import {
|
||||||
vipRechargeApi,
|
vipRechargeApi,
|
||||||
rechargeCountApi,
|
rechargeCountApi,
|
||||||
|
reVipRechargeApi,
|
||||||
rechargeListsApi,
|
rechargeListsApi,
|
||||||
updataOrderApi,
|
updataOrderApi,
|
||||||
getStoreByPhone,
|
getStoreByPhone,
|
||||||
|
@ -187,11 +195,59 @@
|
||||||
getUserShip,
|
getUserShip,
|
||||||
getCreateLists
|
getCreateLists
|
||||||
} from "@/api/user.js"
|
} from "@/api/user.js"
|
||||||
|
import Push from "@/utils/push.js"
|
||||||
import {
|
import {
|
||||||
onPullDownRefresh,
|
onPullDownRefresh,
|
||||||
onLoad
|
onLoad
|
||||||
} from "@dcloudio/uni-app"
|
} 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 showPop1 = ref(false)
|
||||||
const Role = ref('')
|
const Role = ref('')
|
||||||
|
@ -377,22 +433,28 @@
|
||||||
formData.recharge_type = 'INDUSTRYMEMBERS'
|
formData.recharge_type = 'INDUSTRYMEMBERS'
|
||||||
formData.user_ship = 1
|
formData.user_ship = 1
|
||||||
vipRechargeApi(formData).then(res => {
|
vipRechargeApi(formData).then(res => {
|
||||||
uni.$u.toast('操作成功');
|
uni.showLoading({
|
||||||
currentTab.value = 2
|
title: '支付中...'
|
||||||
formData.real_name = ''
|
});
|
||||||
formData.mobile = ''
|
timer = setTimeout(() => {
|
||||||
formData.address = ''
|
uni.hideLoading();
|
||||||
formData.label_name = ''
|
uni.$u.toast('支付超时');
|
||||||
formData.city = ''
|
// formData.real_name = ''
|
||||||
formData.area = ''
|
// formData.mobile = ''
|
||||||
formData.street = ''
|
// formData.address = ''
|
||||||
formData.village = ''
|
// formData.label_name = ''
|
||||||
formData.brigade = ''
|
// formData.city = ''
|
||||||
currentAddressIndex.value = 0
|
// formData.area = ''
|
||||||
|
// formData.street = ''
|
||||||
|
// formData.village = ''
|
||||||
|
// formData.brigade = ''
|
||||||
|
// currentAddressIndex.value = 0
|
||||||
|
// tabsList.forEach(item => {
|
||||||
|
// item.name = '请选择'
|
||||||
|
// })
|
||||||
|
}, 30000)
|
||||||
|
|
||||||
tabsList.forEach(item => {
|
// uni.$u.toast('操作成功');
|
||||||
item.name = '请选择'
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
})
|
||||||
getCount()
|
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 count = ref(0)
|
||||||
const getCount = async () => {
|
const getCount = async () => {
|
||||||
|
@ -451,7 +531,6 @@
|
||||||
})
|
})
|
||||||
lists.value = res.data.lists
|
lists.value = res.data.lists
|
||||||
count.value = res.data.count
|
count.value = res.data.count
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -464,13 +543,15 @@
|
||||||
updataOrderApi({
|
updataOrderApi({
|
||||||
order_no: item.order_id,
|
order_no: item.order_id,
|
||||||
recharge: 1
|
recharge: 1
|
||||||
|
}).then(res => {
|
||||||
|
getCount()
|
||||||
|
getLists()
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getUserShip().then(res => {
|
getUserShip().then(res => {
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
range.value = res.data.lists.map(item => {
|
range.value = res.data.lists.map(item => {
|
||||||
return {
|
return {
|
||||||
value: item.id,
|
value: item.id,
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "个人中心",
|
"navigationBarTitleText": "个人中心",
|
||||||
"enablePullDownRefresh": true,
|
"enablePullDownRefresh": true,
|
||||||
"navigationStyle": "custom"
|
"navigationBarBackgroundColor": "#D3FDCA"
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
"path": "pages/charge/charge_record",
|
"path": "pages/charge/charge_record",
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<view>
|
<view>
|
||||||
<up-navbar title="我的" :autoBack="true" bgColor="transparent" :fixed="true">
|
<!-- <up-navbar title="我的" :autoBack="true" bgColor="transparent" :fixed="true">
|
||||||
</up-navbar>
|
</up-navbar> -->
|
||||||
<view class="user-info">
|
<view class="user-info">
|
||||||
<image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp"
|
<image class="bg" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/e3a7b202404261113002322.webp"
|
||||||
mode="widthFix"></image>
|
mode="widthFix"></image>
|
||||||
|
@ -198,7 +198,7 @@
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 750rpx;
|
width: 750rpx;
|
||||||
height: 350rpx;
|
height: 250rpx;
|
||||||
|
|
||||||
.bg {
|
.bg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
@ -212,7 +212,7 @@
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 50rpx 0 50rpx 50rpx;
|
padding: 50rpx 0 50rpx 50rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 150rpx;
|
top: 50rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
1436
utils/push.js
1436
utils/push.js
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue