add
This commit is contained in:
parent
0f86686f8b
commit
e7aefe8bff
|
@ -17,7 +17,8 @@
|
|||
|
||||
<view v-else>
|
||||
<view class="tabs">
|
||||
<text @click="currentTab = 1" :class="{ actText: currentTab == 1 }">开通{{ Role == 1 ? '行业会员' : '商户' }} </text>
|
||||
<text @click="currentTab = 1" :class="{ actText: currentTab == 1 }">开通{{ Role == 1 ? '行业会员' : '商户' }}
|
||||
</text>
|
||||
<text @click="currentTab = 2, getCount(), getLists()" :class="{ actText: currentTab == 2 }"> 已开通列表</text>
|
||||
<view class="lines" :class="{ actLine: currentTab == 2 }" />
|
||||
</view>
|
||||
|
@ -31,17 +32,19 @@
|
|||
<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>
|
||||
:placeholderStyle="{ color: '#444444' }"
|
||||
:prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
|
||||
</up-form-item>
|
||||
<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>
|
||||
:placeholderStyle="{ color: '#444444' }"
|
||||
:prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
|
||||
</up-form-item>
|
||||
<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="{
|
||||
<up-input style="pointer-events: none" v-model="formData.address" border="none"
|
||||
prefixIcon="map" readonly placeholder="点击选择地址" :customStyle="{
|
||||
background: '#F3F3F3', padding: '20rpx',
|
||||
'border-radius': '30rpx'
|
||||
}" :placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"
|
||||
|
@ -114,7 +117,8 @@
|
|||
<uni-td align="center">{{ index + 1 }}</uni-td>
|
||||
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 1'>{{ item.real_name }}</uni-td>
|
||||
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 1'>{{ item.price }}</uni-td>
|
||||
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 4'>{{ item.create_time }}</uni-td>
|
||||
<uni-td style="font-size: 20rpx;" align="center"
|
||||
v-if='Role == 4'>{{ item.create_time }}</uni-td>
|
||||
<uni-td style="font-size: 20rpx;" align="center" v-if='Role == 4'>{{ item.nickname }}</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">
|
||||
|
@ -142,8 +146,8 @@
|
|||
:activeStyle="{ color: '#20B128' }"></up-tabs>
|
||||
<up-line style="margin-top:20rpx "></up-line>
|
||||
<view class="address-content" v-if='currentAddressIndex == 0'>
|
||||
<view class="address-li" :class='{ act: item.city_code == formData.city }' v-for="item in addressList.city"
|
||||
:key="item.city_code" @click="addressLiClick(0, item)">
|
||||
<view class="address-li" :class='{ act: item.city_code == formData.city }'
|
||||
v-for="item in addressList.city" :key="item.city_code" @click="addressLiClick(0, item)">
|
||||
<text>{{ item.city_name }}</text>
|
||||
<up-icon name="arrow-right" :color="item.city_code == formData.city ? '#20B128' : '#777777'" />
|
||||
</view>
|
||||
|
@ -166,20 +170,21 @@
|
|||
<view class="address-li" v-for="item in addressList.village" @click="addressLiClick(3, item)"
|
||||
:key="item.village_code" :class='{ act: item.village_code == formData.village }'>
|
||||
<text>{{ item.village_name }}</text>
|
||||
<up-icon name="arrow-right" :color="item.village_code == formData.village ? '#20B128' : '#777777'" />
|
||||
<up-icon name="arrow-right"
|
||||
:color="item.village_code == formData.village ? '#20B128' : '#777777'" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="address-content" v-else-if='currentAddressIndex == 4'>
|
||||
<view class="address-li" :class='{ act: item.id == formData.brigade }' v-for="item in addressList.brigade"
|
||||
:key="item.id" @click="addressLiClick(4, item)">
|
||||
<view class="address-li" :class='{ act: item.id == formData.brigade }'
|
||||
v-for="item in addressList.brigade" :key="item.id" @click="addressLiClick(4, item)">
|
||||
<text>{{ item.brigade_name }}</text>
|
||||
<up-icon name="arrow-right" :color="item.id == formData.brigade ? '#20B128' : '#777777'" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</up-popup>
|
||||
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @cancel='showPop1 = false' @close="showPop1 = false"
|
||||
@open="showPop1 = true" keyName='label_name' confirmColor='#33B83A'></up-picker>
|
||||
<up-picker :show="showPop1" :columns="columns" @confirm='conformRole' @cancel='showPop1 = false'
|
||||
@close="showPop1 = false" @open="showPop1 = true" keyName='label_name' confirmColor='#33B83A'></up-picker>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
|
@ -286,6 +291,7 @@ const getCode = async () => {
|
|||
}
|
||||
// 验证码结束
|
||||
|
||||
|
||||
const currentTab = ref(1)
|
||||
const formData = reactive({
|
||||
store_id: STORE_INFO.id,
|
||||
|
@ -302,7 +308,7 @@ const formData = reactive({
|
|||
label_id: "",
|
||||
user_ship: '',
|
||||
code: '',
|
||||
|
||||
brigade: ""
|
||||
// store_id: STORE_INFO.id,
|
||||
// mobile: "19130550023",
|
||||
// province: 510000,
|
||||
|
@ -318,6 +324,17 @@ const formData = reactive({
|
|||
// user_ship: '1',
|
||||
// code: ''
|
||||
})
|
||||
const resetFormData = () => {
|
||||
for (ket key in formData) {
|
||||
formData[key] = ''
|
||||
}
|
||||
tabsList.forEach(item => {
|
||||
item.name = '请选择'
|
||||
})
|
||||
formData.province = 510000
|
||||
cutDown.value = 0
|
||||
currentAddressIndex.value = 0
|
||||
}
|
||||
|
||||
const conformRole = (e) => {
|
||||
formData.label_name = e.value[0].label_name
|
||||
|
@ -325,6 +342,7 @@ const conformRole = (e) => {
|
|||
showPop1.value = false
|
||||
}
|
||||
|
||||
|
||||
// 地址选择
|
||||
const showPop = ref(false)
|
||||
const currentAddressIndex = ref(0)
|
||||
|
@ -335,7 +353,6 @@ const currentAddressList = () => {
|
|||
else if (formData.village) return [3, 'village'];
|
||||
else if (formData.brigade) return [4, 'brigade'];
|
||||
}
|
||||
|
||||
const addressTbasChange = (e) => {
|
||||
currentAddressIndex.value = e.index
|
||||
}
|
||||
|
@ -398,7 +415,6 @@ const getCityList = async () => {
|
|||
})
|
||||
addressList.city = res.data
|
||||
}
|
||||
getCityList()
|
||||
const tabsList = reactive(
|
||||
[{
|
||||
name: "请选择"
|
||||
|
@ -423,16 +439,14 @@ const tabsList = reactive(
|
|||
|
||||
|
||||
|
||||
// 支付相关
|
||||
// scoket
|
||||
let timerInvol = null
|
||||
|
||||
// 开起一个scoket监听用户知否支付成功
|
||||
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) {
|
||||
try {
|
||||
|
@ -440,6 +454,10 @@ user_channel.on('message', function (data) {
|
|||
paySuccessToTabs2()
|
||||
} catch (error) {}
|
||||
});
|
||||
// 结束
|
||||
|
||||
|
||||
// 提交
|
||||
const submit = async () => {
|
||||
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
|
||||
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
|
||||
|
@ -477,21 +495,7 @@ const submit = async () => {
|
|||
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 = ''
|
||||
formData.code = ''
|
||||
currentAddressIndex.value = 0
|
||||
cutDown.value = 0
|
||||
tabsList.forEach(item => {
|
||||
item.name = '请选择'
|
||||
})
|
||||
resetFormData()
|
||||
getLists()
|
||||
getCount()
|
||||
})
|
||||
|
@ -526,21 +530,7 @@ const paySuccessToTabs2 = () => {
|
|||
duration: 2000,
|
||||
success() {
|
||||
currentTab.value = 2
|
||||
formData.real_name = ''
|
||||
formData.mobile = ''
|
||||
formData.address = ''
|
||||
formData.label_name = ''
|
||||
formData.city = ''
|
||||
formData.area = ''
|
||||
formData.street = ''
|
||||
formData.village = ''
|
||||
formData.brigade = ''
|
||||
formData.code = ''
|
||||
currentAddressIndex.value = 0
|
||||
cutDown.value = 0
|
||||
tabsList.forEach(item => {
|
||||
item.name = '请选择'
|
||||
})
|
||||
resetFormData()
|
||||
setTimeout(() => {
|
||||
getLists()
|
||||
getCount()
|
||||
|
@ -606,6 +596,7 @@ onLoad(() => {
|
|||
columns.value = [res.data.lists]
|
||||
})
|
||||
getPhoneOneDay()
|
||||
getCityList()
|
||||
})
|
||||
|
||||
onPullDownRefresh(() => {
|
||||
|
|
Loading…
Reference in New Issue