add
This commit is contained in:
parent
ecf2da62cf
commit
3bf955d804
|
@ -10,7 +10,8 @@
|
||||||
<up-form labelPosition="left" label-width="100rpx">
|
<up-form labelPosition="left" label-width="100rpx">
|
||||||
<up-form-item label="身份" borderBottom>
|
<up-form-item label="身份" borderBottom>
|
||||||
<up-radio-group v-model="Role" placement="row">
|
<up-radio-group v-model="Role" placement="row">
|
||||||
<up-radio activeColor="#20b128" label="行业会员" :name="1" style="margin-right: 10rpx;"></up-radio>
|
<up-radio activeColor="#20b128" label="行业会员" :name="1"
|
||||||
|
style="margin-right: 10rpx;"></up-radio>
|
||||||
<up-radio activeColor="#20b128" label="商户" :name="4"></up-radio>
|
<up-radio activeColor="#20b128" label="商户" :name="4"></up-radio>
|
||||||
</up-radio-group>
|
</up-radio-group>
|
||||||
</up-form-item>
|
</up-form-item>
|
||||||
|
@ -21,8 +22,8 @@
|
||||||
|
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<up-sticky bgColor="#fff" style="padding: 20rpx;">
|
<up-sticky bgColor="#fff" style="padding: 20rpx;">
|
||||||
<up-tabs v-if="Role == 1" :list="tabsLst" :itemStyle="{ width: '33vw', paddingBottom: '20rpx' }" lineColor='#50C758'
|
<up-tabs v-if="Role == 1" :list="tabsLst" :itemStyle="{ width: '33vw', paddingBottom: '20rpx' }"
|
||||||
:current='currentTab' @change="tabsChange"></up-tabs>
|
lineColor='#50C758' :current='currentTab' @change="tabsChange"></up-tabs>
|
||||||
<up-tabs v-else :list="tabsLst2" :itemStyle="{ width: '50vw', paddingBottom: '20rpx' }" lineColor='#50C758'
|
<up-tabs v-else :list="tabsLst2" :itemStyle="{ width: '50vw', paddingBottom: '20rpx' }" lineColor='#50C758'
|
||||||
:current='currentTab' @change="tabsChange1"></up-tabs>
|
:current='currentTab' @change="tabsChange1"></up-tabs>
|
||||||
</up-sticky>
|
</up-sticky>
|
||||||
|
@ -51,8 +52,8 @@
|
||||||
</up-form-item>
|
</up-form-item>
|
||||||
<up-form-item label="">
|
<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" prefixIcon="map"
|
<up-input style="pointer-events: none" v-model="formData.address" border="none"
|
||||||
readonly placeholder="点击选择地址" :customStyle="{
|
prefixIcon="map" readonly placeholder="点击选择地址" :customStyle="{
|
||||||
background: '#F3F3F3', padding: '20rpx',
|
background: '#F3F3F3', padding: '20rpx',
|
||||||
'border-radius': '30rpx'
|
'border-radius': '30rpx'
|
||||||
}" :placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"
|
}" :placeholderStyle="{ color: '#444444' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"
|
||||||
|
@ -87,8 +88,8 @@
|
||||||
点击查看礼品包内容
|
点击查看礼品包内容
|
||||||
</view>
|
</view>
|
||||||
<view class="gift-pack">
|
<view class="gift-pack">
|
||||||
<view class="gift-pack-li" :class="index == giftIndex && 'act-gift'" v-for="(item, index) in rechargeList"
|
<view class="gift-pack-li" :class="index == giftIndex && 'act-gift'"
|
||||||
:key="index" @click="choseGift(index)">
|
v-for="(item, index) in rechargeList" :key="index" @click="choseGift(index)">
|
||||||
<view class="gift-pack-li-top" :class="index == giftIndex && 'act-gift-top'">
|
<view class="gift-pack-li-top" :class="index == giftIndex && 'act-gift-top'">
|
||||||
<text style="font-size: 40rpx;">{{ item.money }}</text><text>元采购包</text>
|
<text style="font-size: 40rpx;">{{ item.money }}</text><text>元采购包</text>
|
||||||
</view>
|
</view>
|
||||||
|
@ -125,11 +126,12 @@
|
||||||
<up-input v-model="formData2.real_name" disabled border="none" prefixIcon="account"
|
<up-input v-model="formData2.real_name" disabled border="none" prefixIcon="account"
|
||||||
placeholder="系统自动获取" color='grey'
|
placeholder="系统自动获取" color='grey'
|
||||||
:customStyle="{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
|
:customStyle="{ background: '#F3F3F3', padding: '20rpx', 'border-radius': '30rpx' }"
|
||||||
:placeholderStyle="{ color: 'grey' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
|
:placeholderStyle="{ color: 'grey' }"
|
||||||
|
:prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
|
||||||
</up-form-item>
|
</up-form-item>
|
||||||
<up-form-item label="">
|
<up-form-item label="">
|
||||||
<up-input style="pointer-events: none" v-model="formData2.address" border="none" prefixIcon="map"
|
<up-input style="pointer-events: none" v-model="formData2.address" border="none"
|
||||||
readonly color='grey' placeholder="系统自动获取" :customStyle="{
|
prefixIcon="map" readonly color='grey' placeholder="系统自动获取" :customStyle="{
|
||||||
background: '#F3F3F3', padding: '20rpx',
|
background: '#F3F3F3', padding: '20rpx',
|
||||||
'border-radius': '30rpx'
|
'border-radius': '30rpx'
|
||||||
}" :placeholderStyle="{ color: 'grey' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
|
}" :placeholderStyle="{ color: 'grey' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
|
||||||
|
@ -149,8 +151,8 @@
|
||||||
<view class="store-info">
|
<view class="store-info">
|
||||||
<view class="" style="width: 300rpx;margin: 0 auto;border-bottom: 1px solid #F3F3F3;">
|
<view class="" style="width: 300rpx;margin: 0 auto;border-bottom: 1px solid #F3F3F3;">
|
||||||
<up-input inputAlign='center' placeholder="请输入金额" @focus="formData2.price = ''" color='#FF6B00'
|
<up-input inputAlign='center' placeholder="请输入金额" @focus="formData2.price = ''" color='#FF6B00'
|
||||||
:placeholderStyle="{ fontSize: '28rpx' }" fontSize='20px' border="none" v-model="formData2.price"
|
:placeholderStyle="{ fontSize: '28rpx' }" fontSize='20px' border="none"
|
||||||
type='digit' @blur='tofixedPrice(2)'></up-input>
|
v-model="formData2.price" type='digit' @blur='tofixedPrice(2)'></up-input>
|
||||||
</view>
|
</view>
|
||||||
<view style="color: red;margin-top: 20rpx;font-size: 24rpx;"
|
<view style="color: red;margin-top: 20rpx;font-size: 24rpx;"
|
||||||
v-if="formData2.label_limit && formData2.price < formData2.label_limit">
|
v-if="formData2.label_limit && formData2.price < formData2.label_limit">
|
||||||
|
@ -271,8 +273,8 @@
|
||||||
:activeStyle="{ color: '#20B128' }"></up-tabs>
|
:activeStyle="{ color: '#20B128' }"></up-tabs>
|
||||||
<up-line style="margin-top:20rpx "></up-line>
|
<up-line style="margin-top:20rpx "></up-line>
|
||||||
<view class="address-content" v-if='currentAddressIndex == 0'>
|
<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"
|
<view class="address-li" :class='{ act: item.city_code == formData.city }'
|
||||||
:key="item.city_code" @click="addressLiClick(0, item)">
|
v-for="item in addressList.city" :key="item.city_code" @click="addressLiClick(0, item)">
|
||||||
<text>{{ item.city_name }}</text>
|
<text>{{ item.city_name }}</text>
|
||||||
<up-icon name="arrow-right" :color="item.city_code == formData.city ? '#20B128' : '#777777'" />
|
<up-icon name="arrow-right" :color="item.city_code == formData.city ? '#20B128' : '#777777'" />
|
||||||
</view>
|
</view>
|
||||||
|
@ -295,12 +297,13 @@
|
||||||
<view class="address-li" v-for="item in addressList.village" @click="addressLiClick(3, item)"
|
<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 }'>
|
:key="item.village_code" :class='{ act: item.village_code == formData.village }'>
|
||||||
<text>{{ item.village_name }}</text>
|
<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>
|
</view>
|
||||||
<view class="address-content" v-else-if='currentAddressIndex == 4'>
|
<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"
|
<view class="address-li" :class='{ act: item.id == formData.brigade }'
|
||||||
:key="item.id" @click="addressLiClick(4, item)">
|
v-for="item in addressList.brigade" :key="item.id" @click="addressLiClick(4, item)">
|
||||||
<text>{{ item.brigade_name }}</text>
|
<text>{{ item.brigade_name }}</text>
|
||||||
<up-icon name="arrow-right" :color="item.id == formData.brigade ? '#20B128' : '#777777'" />
|
<up-icon name="arrow-right" :color="item.id == formData.brigade ? '#20B128' : '#777777'" />
|
||||||
</view>
|
</view>
|
||||||
|
@ -317,20 +320,20 @@
|
||||||
</up-modal>
|
</up-modal>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
import {
|
||||||
reactive,
|
reactive,
|
||||||
ref
|
ref
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
import useUserStore from "@/store/user";
|
import useUserStore from "@/store/user";
|
||||||
import {
|
import {
|
||||||
provinceListApi,
|
provinceListApi,
|
||||||
cityListApi,
|
cityListApi,
|
||||||
areaListApi,
|
areaListApi,
|
||||||
streetListApi,
|
streetListApi,
|
||||||
villageListApi,
|
villageListApi,
|
||||||
brigadeListApi
|
brigadeListApi
|
||||||
} from "@/api/address.js"
|
} from "@/api/address.js"
|
||||||
import {
|
import {
|
||||||
vipRechargeApi,
|
vipRechargeApi,
|
||||||
getRechargeListApi,
|
getRechargeListApi,
|
||||||
isUserShipApi,
|
isUserShipApi,
|
||||||
|
@ -344,60 +347,60 @@ import {
|
||||||
getCreateLists,
|
getCreateLists,
|
||||||
getReportingSms,
|
getReportingSms,
|
||||||
getVipInfoByPhone
|
getVipInfoByPhone
|
||||||
} from "@/api/user.js"
|
} from "@/api/user.js"
|
||||||
import Push from "@/utils/push.js"
|
import Push from "@/utils/push.js"
|
||||||
import {
|
import {
|
||||||
onPullDownRefresh,
|
onPullDownRefresh,
|
||||||
onLoad,
|
onLoad,
|
||||||
onReachBottom
|
onReachBottom
|
||||||
} from "@dcloudio/uni-app"
|
} from "@dcloudio/uni-app"
|
||||||
import {
|
import {
|
||||||
config
|
config
|
||||||
} from "@/config/app.js"
|
} from "@/config/app.js"
|
||||||
|
|
||||||
const showModal = ref(false)
|
const showModal = ref(false)
|
||||||
const showPop1 = ref(false)
|
const showPop1 = ref(false)
|
||||||
const Role = ref(1)
|
const Role = ref(1)
|
||||||
const popPhone = ref('')
|
const popPhone = ref('')
|
||||||
// const range = ref({})
|
// const range = ref({})
|
||||||
const columns = ref([])
|
const columns = ref([])
|
||||||
const showModa = ref(true)
|
const showModa = ref(true)
|
||||||
const storePhone = ref('')
|
const storePhone = ref('')
|
||||||
const tabsLst = reactive([{
|
const tabsLst = reactive([{
|
||||||
name: '开通行业会员'
|
name: '开通行业会员'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '追加经营资金'
|
name: '追加经营资金'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '已开通列表'
|
name: '已开通列表'
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const tabsLst2 = reactive([{
|
const tabsLst2 = reactive([{
|
||||||
name: '开通商户'
|
name: '开通商户'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '已开通列表'
|
name: '已开通列表'
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const tabsChange = (e) => {
|
const tabsChange = (e) => {
|
||||||
currentTab.value = e.index
|
currentTab.value = e.index
|
||||||
if (e.index == 2) {
|
if (e.index == 2) {
|
||||||
getCount()
|
getCount()
|
||||||
getLists()
|
getLists()
|
||||||
}
|
}
|
||||||
// getLists()
|
// getLists()
|
||||||
}
|
}
|
||||||
const tabsChange1 = (e) => {
|
const tabsChange1 = (e) => {
|
||||||
currentTab.value = (e.index)
|
currentTab.value = (e.index)
|
||||||
getLists()
|
getLists()
|
||||||
}
|
}
|
||||||
|
|
||||||
const confirmStore = () => {
|
const confirmStore = () => {
|
||||||
getStoreByPhone({
|
getStoreByPhone({
|
||||||
phone: storePhone.value
|
phone: storePhone.value
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
@ -408,15 +411,15 @@ const confirmStore = () => {
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
uni.$u.toast('未查到店铺信息,请检查手机号码')
|
uni.$u.toast('未查到店铺信息,请检查手机号码')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 用户选择的门店信息
|
// 用户选择的门店信息
|
||||||
let STORE_INFO = reactive({
|
let STORE_INFO = reactive({
|
||||||
id: ""
|
id: ""
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
// 门店手机号保留一天
|
// 门店手机号保留一天
|
||||||
const setPhoneOneDay = () => {
|
const setPhoneOneDay = () => {
|
||||||
if (uni.getStorageSync('VIP_PHONE')) return;
|
if (uni.getStorageSync('VIP_PHONE')) return;
|
||||||
const currentDate = new Date();
|
const currentDate = new Date();
|
||||||
const nextDay = new Date(currentDate);
|
const nextDay = new Date(currentDate);
|
||||||
|
@ -425,8 +428,8 @@ const setPhoneOneDay = () => {
|
||||||
time: nextDay,
|
time: nextDay,
|
||||||
phone: storePhone.value
|
phone: storePhone.value
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
const getPhoneOneDay = () => {
|
const getPhoneOneDay = () => {
|
||||||
if (uni.getStorageSync('VIP_PHONE')) {
|
if (uni.getStorageSync('VIP_PHONE')) {
|
||||||
let data = JSON.parse(uni.getStorageSync('VIP_PHONE'))
|
let data = JSON.parse(uni.getStorageSync('VIP_PHONE'))
|
||||||
if (new Date() > data.time) {
|
if (new Date() > data.time) {
|
||||||
|
@ -435,20 +438,20 @@ const getPhoneOneDay = () => {
|
||||||
storePhone.value = data.phone
|
storePhone.value = data.phone
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 手机保留一天结束
|
// 手机保留一天结束
|
||||||
|
|
||||||
// 验证码
|
// 验证码
|
||||||
const vipList = reactive([1, 2, 3, 5, 6, 7, 8])
|
const vipList = reactive([1, 2, 3, 5, 6, 7, 8])
|
||||||
const cutDown = ref(0)
|
const cutDown = ref(0)
|
||||||
const flag = ref(true)
|
const flag = ref(true)
|
||||||
const code = ref('')
|
const code = ref('')
|
||||||
const checkPhone = (phone) => {
|
const checkPhone = (phone) => {
|
||||||
const regex = /^1[3-9]\d{9}$/;
|
const regex = /^1[3-9]\d{9}$/;
|
||||||
return regex.test(phone) ? true : false
|
return regex.test(phone) ? true : false
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCode = async () => {
|
const getCode = async () => {
|
||||||
if (!checkPhone(formData.mobile)) return uni.$u.toast('请输入正确的手机号')
|
if (!checkPhone(formData.mobile)) return uni.$u.toast('请输入正确的手机号')
|
||||||
await getReportingSms({
|
await getReportingSms({
|
||||||
account: formData.mobile
|
account: formData.mobile
|
||||||
|
@ -462,12 +465,12 @@ const getCode = async () => {
|
||||||
clearInterval(timer);
|
clearInterval(timer);
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000)
|
||||||
}
|
}
|
||||||
// 验证码结束
|
// 验证码结束
|
||||||
|
|
||||||
|
|
||||||
const currentTab = ref(0)
|
const currentTab = ref(0)
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
store_id: STORE_INFO.id,
|
store_id: STORE_INFO.id,
|
||||||
mobile: "",
|
mobile: "",
|
||||||
province: 510000,
|
province: 510000,
|
||||||
|
@ -500,10 +503,10 @@ const formData = reactive({
|
||||||
// user_ship: '1',
|
// user_ship: '1',
|
||||||
// price: 0.02,
|
// price: 0.02,
|
||||||
// code: '12'
|
// code: '12'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const formData2 = reactive({
|
const formData2 = reactive({
|
||||||
store_id: STORE_INFO.id,
|
store_id: STORE_INFO.id,
|
||||||
mobile: "",
|
mobile: "",
|
||||||
province: 510000,
|
province: 510000,
|
||||||
|
@ -520,10 +523,10 @@ const formData2 = reactive({
|
||||||
user_ship: '',
|
user_ship: '',
|
||||||
brigade: "",
|
brigade: "",
|
||||||
price: "",
|
price: "",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const getFormData2 = (data) => {
|
const getFormData2 = (data) => {
|
||||||
formData2.city = data.address_info?.city
|
formData2.city = data.address_info?.city
|
||||||
formData2.area = data.address_info?.area
|
formData2.area = data.address_info?.area
|
||||||
formData2.province = data.address_info?.province
|
formData2.province = data.address_info?.province
|
||||||
|
@ -540,10 +543,10 @@ const getFormData2 = (data) => {
|
||||||
formData2.label_limit = item.limit
|
formData2.label_limit = item.limit
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const phoneChnge = async (type) => {
|
const phoneChnge = async (type) => {
|
||||||
// typewhite 1 行业会员 2 经营资金
|
// typewhite 1 行业会员 2 经营资金
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
if (!checkPhone(formData.mobile)) return
|
if (!checkPhone(formData.mobile)) return
|
||||||
|
@ -563,7 +566,7 @@ const phoneChnge = async (type) => {
|
||||||
return uni.$u.toast('该用户已是会员,无法进行商户报备')
|
return uni.$u.toast('该用户已是会员,无法进行商户报备')
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) { }
|
} catch (error) {}
|
||||||
} else {
|
} else {
|
||||||
if (formData2.mobile.length == 0) resetFormData();
|
if (formData2.mobile.length == 0) resetFormData();
|
||||||
if (!checkPhone(formData2.mobile)) return
|
if (!checkPhone(formData2.mobile)) return
|
||||||
|
@ -591,10 +594,10 @@ const phoneChnge = async (type) => {
|
||||||
uni.$u.toast('查询失败');
|
uni.$u.toast('查询失败');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const resetFormData = () => {
|
const resetFormData = () => {
|
||||||
for (let key in formData) {
|
for (let key in formData) {
|
||||||
(key != 'price') && (formData[key] = '')
|
(key != 'price') && (formData[key] = '')
|
||||||
}
|
}
|
||||||
|
@ -608,38 +611,38 @@ const resetFormData = () => {
|
||||||
formData2.province = 510000
|
formData2.province = 510000
|
||||||
cutDown.value = 0
|
cutDown.value = 0
|
||||||
currentAddressIndex.value = 0
|
currentAddressIndex.value = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
const conformRole = (e) => {
|
const conformRole = (e) => {
|
||||||
formData.label_name = e.value[0].title
|
formData.label_name = e.value[0].title
|
||||||
formData.label_id = e.value[0].id
|
formData.label_id = e.value[0].id
|
||||||
showPop1.value = false
|
showPop1.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 地址选择
|
// 地址选择
|
||||||
const showPop = ref(false)
|
const showPop = ref(false)
|
||||||
const currentAddressIndex = ref(0)
|
const currentAddressIndex = ref(0)
|
||||||
const currentAddressList = () => {
|
const currentAddressList = () => {
|
||||||
if (!formData.city) return [0, 'city'];
|
if (!formData.city) return [0, 'city'];
|
||||||
else if (formData.area) return [1, 'area'];
|
else if (formData.area) return [1, 'area'];
|
||||||
else if (formData.street) return [2, 'street'];
|
else if (formData.street) return [2, 'street'];
|
||||||
else if (formData.village) return [3, 'village'];
|
else if (formData.village) return [3, 'village'];
|
||||||
else if (formData.brigade) return [4, 'brigade'];
|
else if (formData.brigade) return [4, 'brigade'];
|
||||||
}
|
}
|
||||||
|
|
||||||
const addressTbasChange = (e) => {
|
const addressTbasChange = (e) => {
|
||||||
currentAddressIndex.value = e.index
|
currentAddressIndex.value = e.index
|
||||||
}
|
}
|
||||||
|
|
||||||
const addressList = reactive({
|
const addressList = reactive({
|
||||||
city: [],
|
city: [],
|
||||||
area: [],
|
area: [],
|
||||||
street: [],
|
street: [],
|
||||||
village: [],
|
village: [],
|
||||||
brigade: []
|
brigade: []
|
||||||
})
|
})
|
||||||
const addressLiClick = async (i, item) => {
|
const addressLiClick = async (i, item) => {
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
formData.city = item.city_code
|
formData.city = item.city_code
|
||||||
tabsList[0].name = item.city_name
|
tabsList[0].name = item.city_name
|
||||||
|
@ -684,14 +687,14 @@ const addressLiClick = async (i, item) => {
|
||||||
formData.address = tabsList[0].name + tabsList[1].name + tabsList[2].name + tabsList[3].name + tabsList[4]
|
formData.address = tabsList[0].name + tabsList[1].name + tabsList[2].name + tabsList[3].name + tabsList[4]
|
||||||
.name
|
.name
|
||||||
return currentAddressIndex.value++
|
return currentAddressIndex.value++
|
||||||
}
|
}
|
||||||
const getCityList = async () => {
|
const getCityList = async () => {
|
||||||
let res = await cityListApi({
|
let res = await cityListApi({
|
||||||
province_code: formData.province
|
province_code: formData.province
|
||||||
})
|
})
|
||||||
addressList.city = res.data
|
addressList.city = res.data
|
||||||
}
|
}
|
||||||
const tabsList = reactive(
|
const tabsList = reactive(
|
||||||
[{
|
[{
|
||||||
name: "请选择"
|
name: "请选择"
|
||||||
},
|
},
|
||||||
|
@ -713,48 +716,48 @@ const tabsList = reactive(
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let timerInvol = null
|
let timerInvol = null
|
||||||
let paySuccess;
|
let paySuccess;
|
||||||
// 开起一个scoket监听用户知否支付成功
|
// 开起一个scoket监听用户知否支付成功
|
||||||
const userInfo = useUserStore().userInfo;
|
const userInfo = useUserStore().userInfo;
|
||||||
const connection = new Push({
|
const connection = new Push({
|
||||||
url: config.WSS_URL, // websocket地址
|
url: config.WSS_URL, // websocket地址
|
||||||
app_key: '2ce3ce22329517213caa7dad261f5695',
|
app_key: '2ce3ce22329517213caa7dad261f5695',
|
||||||
});
|
});
|
||||||
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
|
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
|
||||||
user_channel.on('message', function (data) {
|
user_channel.on('message', function(data) {
|
||||||
try {
|
try {
|
||||||
paySuccess = true
|
paySuccess = true
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
clearTimeout(timerInvol);
|
clearTimeout(timerInvol);
|
||||||
paySuccessToTabs2()
|
paySuccessToTabs2()
|
||||||
} catch (error) { }
|
} catch (error) {}
|
||||||
});
|
});
|
||||||
// 结束
|
// 结束
|
||||||
|
|
||||||
const navgo = (url) => {
|
const navgo = (url) => {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url
|
url
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择采购包
|
// 选择采购包
|
||||||
const giftIndex = ref(0)
|
const giftIndex = ref(0)
|
||||||
const rechargeList = ref([])
|
const rechargeList = ref([])
|
||||||
const getRechargeList = async () => {
|
const getRechargeList = async () => {
|
||||||
let res = await getRechargeListApi()
|
let res = await getRechargeListApi()
|
||||||
rechargeList.value = res.data
|
rechargeList.value = res.data
|
||||||
formData.price = rechargeList.value[0].money
|
formData.price = rechargeList.value[0].money
|
||||||
}
|
}
|
||||||
|
|
||||||
const choseGift = (index) => {
|
const choseGift = (index) => {
|
||||||
giftIndex.value = index
|
giftIndex.value = index
|
||||||
formData.price = rechargeList.value[index].money
|
formData.price = rechargeList.value[index].money
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
const submit = async (type = 1) => {
|
const submit = async (type = 1) => {
|
||||||
if (Role.value == 4) {
|
if (Role.value == 4) {
|
||||||
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
|
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
|
||||||
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
|
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
|
||||||
|
@ -790,7 +793,7 @@ const submit = async (type = 1) => {
|
||||||
// })
|
// })
|
||||||
// return
|
// return
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: function (res) {
|
success: function(res) {
|
||||||
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '支付中...'
|
title: '支付中...'
|
||||||
|
@ -798,7 +801,10 @@ const submit = async (type = 1) => {
|
||||||
formData2.auth_code = res.result
|
formData2.auth_code = res.result
|
||||||
formData2.recharge_type = 'INDUSTRYMEMBERS'
|
formData2.recharge_type = 'INDUSTRYMEMBERS'
|
||||||
formData2.user_ship = formData2.label_id
|
formData2.user_ship = formData2.label_id
|
||||||
vipRechargeApi(formData2).then(res => {
|
vipRechargeApi({
|
||||||
|
...formData2,
|
||||||
|
type: 2
|
||||||
|
}).then(res => {
|
||||||
paySuccess = false;
|
paySuccess = false;
|
||||||
timerInvol = setTimeout(() => {
|
timerInvol = setTimeout(() => {
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
|
@ -839,7 +845,7 @@ const submit = async (type = 1) => {
|
||||||
// brigade: formData.brigade
|
// brigade: formData.brigade
|
||||||
// })
|
// })
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: function (res) {
|
success: function(res) {
|
||||||
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '支付中...'
|
title: '支付中...'
|
||||||
|
@ -858,11 +864,11 @@ const submit = async (type = 1) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const rePay = (item) => {
|
const rePay = (item) => {
|
||||||
uni.scanCode({
|
uni.scanCode({
|
||||||
success: function (res) {
|
success: function(res) {
|
||||||
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '等待用户支付'
|
title: '等待用户支付'
|
||||||
|
@ -880,14 +886,14 @@ const rePay = (item) => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const tofixedPrice = (type = 1) => {
|
const tofixedPrice = (type = 1) => {
|
||||||
if (type == 2) return formData2.price = (+formData2.price).toFixed(2)
|
if (type == 2) return formData2.price = (+formData2.price).toFixed(2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 支付成功后清除formData并且切换tabs2
|
// 支付成功后清除formData并且切换tabs2
|
||||||
const paySuccessToTabs2 = () => {
|
const paySuccessToTabs2 = () => {
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '支付成功',
|
title: '支付成功',
|
||||||
|
@ -901,27 +907,27 @@ const paySuccessToTabs2 = () => {
|
||||||
}, 500); // 延迟1秒执行
|
}, 500); // 延迟1秒执行
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 邀请用户数
|
// 邀请用户数
|
||||||
let where = {
|
let where = {
|
||||||
page_no: 1,
|
page_no: 1,
|
||||||
page_size: 25,
|
page_size: 25,
|
||||||
loadingOver: false
|
loadingOver: false
|
||||||
}
|
}
|
||||||
|
|
||||||
const count = ref(0)
|
const count = ref(0)
|
||||||
const getCount = async () => {
|
const getCount = async () => {
|
||||||
if (Role.value == 4) return;
|
if (Role.value == 4) return;
|
||||||
let res = await rechargeCountApi({
|
let res = await rechargeCountApi({
|
||||||
store_id: STORE_INFO.id
|
store_id: STORE_INFO.id
|
||||||
})
|
})
|
||||||
count.value = res.data.count
|
count.value = res.data.count
|
||||||
}
|
}
|
||||||
|
|
||||||
// 邀请列表
|
// 邀请列表
|
||||||
const lists = ref([])
|
const lists = ref([])
|
||||||
const getLists = async () => {
|
const getLists = async () => {
|
||||||
where.loadingOver = false
|
where.loadingOver = false
|
||||||
where.page_no = 1
|
where.page_no = 1
|
||||||
where.page_size = 25
|
where.page_size = 25
|
||||||
|
@ -941,10 +947,10 @@ const getLists = async () => {
|
||||||
count.value = res.data.count
|
count.value = res.data.count
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const upadtaStatus = (item) => {
|
const upadtaStatus = (item) => {
|
||||||
updataOrderApi({
|
updataOrderApi({
|
||||||
order_no: item.order_id,
|
order_no: item.order_id,
|
||||||
recharge: 1
|
recharge: 1
|
||||||
|
@ -953,27 +959,27 @@ const upadtaStatus = (item) => {
|
||||||
getLists()
|
getLists()
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
getUserShip().then(res => {
|
getUserShip().then(res => {
|
||||||
columns.value = [res.data.lists]
|
columns.value = [res.data.lists]
|
||||||
})
|
})
|
||||||
getPhoneOneDay()
|
getPhoneOneDay()
|
||||||
getCityList()
|
getCityList()
|
||||||
getRechargeList()
|
getRechargeList()
|
||||||
})
|
})
|
||||||
|
|
||||||
onPullDownRefresh(() => {
|
onPullDownRefresh(() => {
|
||||||
getCount()
|
getCount()
|
||||||
getLists()
|
getLists()
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
uni.stopPullDownRefresh()
|
uni.stopPullDownRefresh()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
onReachBottom(async () => {
|
onReachBottom(async () => {
|
||||||
if (where.loadingOver) return;
|
if (where.loadingOver) return;
|
||||||
where.page_no++;
|
where.page_no++;
|
||||||
if (Role.value == 1) {
|
if (Role.value == 1) {
|
||||||
|
@ -996,11 +1002,11 @@ onReachBottom(async () => {
|
||||||
}
|
}
|
||||||
lists.value.push(...res.data.lists)
|
lists.value.push(...res.data.lists)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss'>
|
<style lang='scss'>
|
||||||
.tabs {
|
.tabs {
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
@ -1030,17 +1036,17 @@ onReachBottom(async () => {
|
||||||
.actLine {
|
.actLine {
|
||||||
left: calc(75vw - 35rpx);
|
left: calc(75vw - 35rpx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.card {
|
.card {
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
margin: 20rpx auto;
|
margin: 20rpx auto;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
border-radius: 10rpx;
|
border-radius: 10rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card1 {
|
.card1 {
|
||||||
padding: 30rpx;
|
padding: 30rpx;
|
||||||
|
|
||||||
.card1-tit {
|
.card1-tit {
|
||||||
|
@ -1056,9 +1062,9 @@ onReachBottom(async () => {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 20rpx;
|
margin-top: 20rpx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.submit-btn {
|
.submit-btn {
|
||||||
/* height: 200rpx; */
|
/* height: 200rpx; */
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 50rpx;
|
bottom: 50rpx;
|
||||||
|
@ -1066,10 +1072,10 @@ onReachBottom(async () => {
|
||||||
left: 50%;
|
left: 50%;
|
||||||
transform: translateX(-50%);
|
transform: translateX(-50%);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.vip-card {
|
.vip-card {
|
||||||
width: 690rpx;
|
width: 690rpx;
|
||||||
height: 270rpx;
|
height: 270rpx;
|
||||||
background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/4a92b202406162207212332.png');
|
background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/4a92b202406162207212332.png');
|
||||||
|
@ -1088,17 +1094,17 @@ onReachBottom(async () => {
|
||||||
color: #7B5232;
|
color: #7B5232;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.table {
|
||||||
width: 710rpx;
|
width: 710rpx;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
font-size: 30rpx;
|
font-size: 30rpx;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.address-content {
|
.address-content {
|
||||||
padding: 20rpx;
|
padding: 20rpx;
|
||||||
height: 60vh;
|
height: 60vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -1115,30 +1121,30 @@ onReachBottom(async () => {
|
||||||
.act {
|
.act {
|
||||||
color: #20B128;
|
color: #20B128;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-table-th {
|
.uni-table-th {
|
||||||
padding: 10rpx 0 !important;
|
padding: 10rpx 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.uni-table-td {
|
.uni-table-td {
|
||||||
padding: 10rpx 0 !important;
|
padding: 10rpx 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.slot-content {
|
.slot-content {
|
||||||
/* padding-bottom: 50rpx; */
|
/* padding-bottom: 50rpx; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.code-btn {
|
.code-btn {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-text {
|
.btn-text {
|
||||||
color: #20B128;
|
color: #20B128;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link {
|
.link {
|
||||||
padding-left: 20rpx;
|
padding-left: 20rpx;
|
||||||
color: #2F6BF2;
|
color: #2F6BF2;
|
||||||
font-size: 28rpx;
|
font-size: 28rpx;
|
||||||
|
@ -1147,9 +1153,9 @@ onReachBottom(async () => {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
text-underline-offset: 10rpx;
|
text-underline-offset: 10rpx;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link::after {
|
.link::after {
|
||||||
content: '';
|
content: '';
|
||||||
width: 12rpx;
|
width: 12rpx;
|
||||||
height: 12rpx;
|
height: 12rpx;
|
||||||
|
@ -1159,9 +1165,9 @@ onReachBottom(async () => {
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
border-radius: 12rpx;
|
border-radius: 12rpx;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gift-pack {
|
.gift-pack {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
@ -1196,5 +1202,5 @@ onReachBottom(async () => {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue