Compare commits

...

8 Commits

Author SHA1 Message Date
zmj 76daf934b1 add 2024-07-11 16:50:31 +08:00
zmj 3bf955d804 add 2024-07-06 18:26:46 +08:00
zmj ecf2da62cf add 2024-07-06 13:51:24 +08:00
zmj ec33cc6119 add 2024-07-04 13:46:05 +08:00
zmj c899d8f472 Merge branch 'dev' of https://gitea.lihaink.cn/weipengfei/purchase-let into release 2024-07-03 09:14:27 +08:00
zmj 10664005c9 add 2024-06-29 09:12:20 +08:00
zmj b115621925 add 2024-06-28 11:52:07 +08:00
zmj 4dfa00fa82 add 2024-06-28 10:29:48 +08:00
2 changed files with 865 additions and 863 deletions

View File

@ -55,8 +55,8 @@
</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' }"
@ -131,12 +131,11 @@
<up-input v-model="formData2.real_name" disabled border="none" prefixIcon="account"
placeholder="系统自动获取" color='grey'
: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 label="">
<up-input style="pointer-events: none" v-model="formData2.address" border="none"
prefixIcon="map" readonly color='grey' placeholder="系统自动获取" :customStyle="{
<up-input style="pointer-events: none" v-model="formData2.address" border="none" prefixIcon="map"
readonly color='grey' placeholder="系统自动获取" :customStyle="{
background: '#F3F3F3', padding: '20rpx',
'border-radius': '30rpx'
}" :placeholderStyle="{ color: 'grey' }" :prefixIconStyle="{ 'margin-right': '40rpx' }"></up-input>
@ -186,7 +185,10 @@
</block>
<!-- 追加经营资金结束 -->
<<<<<<< HEAD <!-- tabs2 -->
=======
<!-- 开通列表-会员 -->
>>>>>>> ae7660e239bd4c38b57ca2035f3e2b16b578f714
<block v-if="currentTab == 2 && Role == 1">
<view class="vip-card">
<text>当前已开通</text>
@ -232,7 +234,8 @@
</block>
<!-- 开通列表-会员结束 -->
<!-- 开通列表-商户 -->
<<<<<<< HEAD=======<!-- 开通列表-商户 -->
>>>>>>> ae7660e239bd4c38b57ca2035f3e2b16b578f714
<block v-if="currentTab == 1 && Role == 4">
<view class="vip-card">
<text>当前已开通</text>
@ -271,8 +274,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>
@ -295,13 +298,12 @@
<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>
@ -320,20 +322,20 @@
</up-modal>
</template>
<script setup>
import {
import {
reactive,
ref
} from 'vue';
import useUserStore from "@/store/user";
import {
} from 'vue';
import useUserStore from "@/store/user";
import {
provinceListApi,
cityListApi,
areaListApi,
streetListApi,
villageListApi,
brigadeListApi
} from "@/api/address.js"
import {
} from "@/api/address.js"
import {
vipRechargeApi,
getRechargeListApi,
isUserShipApi,
@ -347,62 +349,62 @@
getCreateLists,
getReportingSms,
getVipInfoByPhone
} from "@/api/user.js"
import Push from "@/utils/push.js"
import {
} from "@/api/user.js"
import Push from "@/utils/push.js"
import {
onPullDownRefresh,
onLoad,
onReachBottom
} from "@dcloudio/uni-app"
import {
} from "@dcloudio/uni-app"
import {
config
} from "@/config/app.js"
} from "@/config/app.js"
const currentTab = ref(0)
const showModal = ref(false)
const showPop1 = ref(false)
const Role = ref(1)
const popPhone = ref('')
const columns = ref([])
const showModa = ref(true)
const tabsLst = reactive([{
const currentTab = ref(0)
const showModal = ref(false)
const showPop1 = ref(false)
const Role = ref(1)
const popPhone = ref('')
const columns = ref([])
const showModa = ref(true)
const tabsLst = reactive([{
name: '开通行业会员'
},
{
},
{
name: '追加经营资金'
},
{
},
{
name: '已开通列表'
},
]);
const tabsLst2 = reactive([{
},
]);
const tabsLst2 = reactive([{
name: '开通商户'
},
{
},
{
name: '已开通列表'
},
]);
const vipList = reactive([1, 2, 3, 4, 5, 6, 7, 8])
},
]);
const vipList = reactive([1, 2, 3, 4, 5, 6, 7, 8])
const tabsChange = (e) => {
const tabsChange = (e) => {
currentTab.value = e.index
if (e.index == 2) {
getCount()
getLists()
}
}
}
const tabsChange1 = (e) => {
const tabsChange1 = (e) => {
currentTab.value = (e.index)
getLists()
}
}
//
const storePhone = ref('')
let STORE_INFO = reactive({
//
const storePhone = ref('')
let STORE_INFO = reactive({
id: "",
})
const confirmStore = () => {
})
const confirmStore = () => {
getStoreByPhone({
phone: storePhone.value
}).then(res => {
@ -413,10 +415,10 @@
}).catch(err => {
uni.$u.toast('未查到店铺信息,请检查手机号码')
})
}
}
//
const setPhoneOneDay = () => {
//
const setPhoneOneDay = () => {
if (uni.getStorageSync('VIP_PHONE')) return;
const currentDate = new Date();
const nextDay = new Date(currentDate);
@ -425,8 +427,8 @@
time: nextDay,
phone: storePhone.value
}));
}
const getPhoneOneDay = () => {
}
const getPhoneOneDay = () => {
if (!uni.getStorageSync('VIP_PHONE')) return;
let data = JSON.parse(uni.getStorageSync('VIP_PHONE'))
if (new Date() > data.time) {
@ -434,19 +436,19 @@
} else {
storePhone.value = data.phone
}
}
//
}
//
//
const cutDown = ref(0)
const flag = ref(true)
const code = ref('')
const checkPhone = (phone) => {
//
const cutDown = ref(0)
const flag = ref(true)
const code = ref('')
const checkPhone = (phone) => {
const regex = /^1[3-9]\d{9}$/;
return regex.test(phone) ? true : false
}
}
const getCode = async () => {
const getCode = async () => {
if (!checkPhone(formData.mobile)) return uni.$u.toast('请输入正确的手机号')
await getReportingSms({
account: formData.mobile
@ -460,9 +462,9 @@
clearInterval(timer);
}
}, 1000)
}
//
const formData = reactive({
}
//
const formData = reactive({
store_id: STORE_INFO.id,
mobile: "",
province: 510000,
@ -480,10 +482,10 @@
code: '',
brigade: "",
price: "",
})
})
const formData2 = reactive({
const formData2 = reactive({
store_id: STORE_INFO.id,
mobile: "",
province: 510000,
@ -500,10 +502,10 @@
user_ship: '',
brigade: "",
price: "",
})
})
const getFormData2 = (data) => {
const getFormData2 = (data) => {
formData2.city = data.address_info?.city
formData2.area = data.address_info?.area
formData2.province = data.address_info?.province
@ -520,10 +522,10 @@
formData2.label_limit = item.limit
}
})
}
}
const phoneChnge = async (type) => {
const phoneChnge = async (type) => {
// typewhite 1 2
if (type == 1) {
if (!checkPhone(formData.mobile)) return
@ -543,7 +545,7 @@
return uni.$u.toast('该用户已是会员,无法进行商户报备')
}
} catch (error) {}
} catch (error) { }
} else {
if (formData2.mobile.length == 0) resetFormData();
if (!checkPhone(formData2.mobile)) return
@ -571,10 +573,10 @@
uni.$u.toast('查询失败');
}
}
}
}
const resetFormData = () => {
const resetFormData = () => {
for (let key in formData) {
(key != 'price') && (formData[key] = '')
}
@ -588,37 +590,37 @@
formData2.province = 510000
cutDown.value = 0
currentAddressIndex.value = 0
}
}
const conformRole = (e) => {
const conformRole = (e) => {
formData.label_name = e.value[0].title
formData.label_id = e.value[0].id
showPop1.value = false
}
}
//
const showPop = ref(false)
const currentAddressIndex = ref(0)
const currentAddressList = () => {
//
const showPop = ref(false)
const currentAddressIndex = ref(0)
const currentAddressList = () => {
if (!formData.city) return [0, 'city'];
else if (formData.area) return [1, 'area'];
else if (formData.street) return [2, 'street'];
else if (formData.village) return [3, 'village'];
else if (formData.brigade) return [4, 'brigade'];
}
}
const addressTbasChange = (e) => {
const addressTbasChange = (e) => {
currentAddressIndex.value = e.index
}
}
const addressList = reactive({
const addressList = reactive({
city: [],
area: [],
street: [],
village: [],
brigade: []
})
const addressLiClick = async (i, item) => {
})
const addressLiClick = async (i, item) => {
if (i == 0) {
formData.city = item.city_code
tabsList[0].name = item.city_name
@ -663,14 +665,14 @@
formData.address = tabsList[0].name + tabsList[1].name + tabsList[2].name + tabsList[3].name + tabsList[4]
.name
return currentAddressIndex.value++
}
const getCityList = async () => {
}
const getCityList = async () => {
let res = await cityListApi({
province_code: formData.province
})
addressList.city = res.data
}
const tabsList = reactive(
}
const tabsList = reactive(
[{
name: "请选择"
},
@ -692,48 +694,48 @@
},
]);
let timerInvol = null
let paySuccess;
// scoket
const userInfo = useUserStore().userInfo;
const connection = new Push({
let timerInvol = null
let paySuccess;
// scoket
const userInfo = useUserStore().userInfo;
const connection = new Push({
url: config.WSS_URL, // websocket
app_key: '2ce3ce22329517213caa7dad261f5695',
});
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
user_channel.on('message', function(data) {
});
const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`);
user_channel.on('message', function (data) {
try {
paySuccess = true
uni.hideLoading();
clearTimeout(timerInvol);
paySuccessToTabs2()
} catch (error) {}
});
//
} catch (error) { }
});
//
const navgo = (url) => {
const navgo = (url) => {
uni.navigateTo({
url
})
}
}
//
const giftIndex = ref(0)
const rechargeList = ref([])
const getRechargeList = async () => {
//
const giftIndex = ref(0)
const rechargeList = ref([])
const getRechargeList = async () => {
let res = await getRechargeListApi()
rechargeList.value = res.data
formData.price = rechargeList.value[0].money
}
}
const choseGift = (index) => {
const choseGift = (index) => {
giftIndex.value = index
formData.price = rechargeList.value[index].money
}
}
//
const submit = async (type = 1) => {
//
const submit = async (type = 1) => {
if (Role.value == 4) {
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
@ -769,7 +771,7 @@
// })
// return
uni.scanCode({
success: function(res) {
success: function (res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
uni.showLoading({
title: '支付中...'
@ -821,7 +823,7 @@
// brigade: formData.brigade
// })
uni.scanCode({
success: function(res) {
success: function (res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
uni.showLoading({
title: '支付中...'
@ -840,11 +842,11 @@
});
}
}
}
}
const rePay = (item) => {
const rePay = (item) => {
uni.scanCode({
success: function(res) {
success: function (res) {
if (String(res.result.length) != 18) return uni.$u.toast('二维码未扫描完整');
uni.showLoading({
title: '等待用户支付'
@ -862,14 +864,14 @@
})
}
});
}
}
const tofixedPrice = (type = 1) => {
const tofixedPrice = (type = 1) => {
if (type == 2) return formData2.price = (+formData2.price).toFixed(2)
}
}
// formDatatabs2
const paySuccessToTabs2 = () => {
// formDatatabs2
const paySuccessToTabs2 = () => {
uni.hideLoading()
uni.showToast({
title: '支付成功',
@ -883,27 +885,27 @@
}, 500); // 1
}
});
}
}
//
let where = {
//
let where = {
page_no: 1,
page_size: 25,
loadingOver: false
}
}
const count = ref(0)
const getCount = async () => {
const count = ref(0)
const getCount = async () => {
if (Role.value == 4) return;
let res = await rechargeCountApi({
store_id: STORE_INFO.id
})
count.value = res.data.count
}
}
//
const lists = ref([])
const getLists = async () => {
//
const lists = ref([])
const getLists = async () => {
where.loadingOver = false
where.page_no = 1
where.page_size = 25
@ -923,10 +925,10 @@
count.value = res.data.count
}
}
}
const upadtaStatus = (item) => {
const upadtaStatus = (item) => {
updataOrderApi({
order_no: item.order_id,
recharge: 1
@ -935,27 +937,27 @@
getLists()
})
}
}
onLoad(() => {
onLoad(() => {
getUserShip().then(res => {
columns.value = [res.data.lists]
})
getPhoneOneDay()
getCityList()
getRechargeList()
})
})
onPullDownRefresh(() => {
onPullDownRefresh(() => {
getCount()
getLists()
setTimeout(() => {
uni.stopPullDownRefresh()
}, 1000)
})
})
onReachBottom(async () => {
onReachBottom(async () => {
if (where.loadingOver) return;
where.page_no++;
if (Role.value == 1) {
@ -978,11 +980,11 @@
}
lists.value.push(...res.data.lists)
}
})
})
</script>
<style lang='scss'>
.tabs {
.tabs {
background-color: #fff;
width: 100vw;
box-sizing: border-box;
@ -1012,17 +1014,17 @@
.actLine {
left: calc(75vw - 35rpx);
}
}
}
.card {
.card {
width: 710rpx;
margin: 20rpx auto;
background-color: #fff;
box-sizing: border-box;
border-radius: 10rpx;
}
}
.card1 {
.card1 {
padding: 30rpx;
.card1-tit {
@ -1038,9 +1040,9 @@
text-align: center;
margin-top: 20rpx;
}
}
}
.submit-btn {
.submit-btn {
/* height: 200rpx; */
position: fixed;
bottom: 50rpx;
@ -1048,10 +1050,10 @@
left: 50%;
transform: translateX(-50%);
}
}
.vip-card {
.vip-card {
width: 690rpx;
height: 270rpx;
background-image: url('https://lihai001.oss-cn-chengdu.aliyuncs.com/attach/4a92b202406162207212332.png');
@ -1070,17 +1072,17 @@
color: #7B5232;
}
}
}
.table {
.table {
width: 710rpx;
box-sizing: border-box;
font-size: 30rpx;
margin: 0 auto;
}
}
.address-content {
.address-content {
padding: 20rpx;
height: 60vh;
overflow-y: auto;
@ -1097,30 +1099,30 @@
.act {
color: #20B128;
}
}
}
.uni-table-th {
.uni-table-th {
padding: 10rpx 0 !important;
}
}
.uni-table-td {
.uni-table-td {
padding: 10rpx 0 !important;
}
}
.slot-content {
.slot-content {
/* padding-bottom: 50rpx; */
}
}
.code-btn {
.code-btn {
display: flex;
align-items: center;
}
}
.btn-text {
.btn-text {
color: #20B128;
}
}
.link {
.link {
padding-left: 20rpx;
color: #2F6BF2;
font-size: 28rpx;
@ -1129,9 +1131,9 @@
text-decoration: underline;
text-underline-offset: 10rpx;
cursor: pointer;
}
}
.link::after {
.link::after {
content: '';
width: 12rpx;
height: 12rpx;
@ -1141,9 +1143,9 @@
transform: translateY(-50%);
border-radius: 12rpx;
left: 0;
}
}
.gift-pack {
.gift-pack {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
@ -1178,5 +1180,5 @@
}
}
</style>

View File

@ -34,8 +34,8 @@
<up-transition :show="!showWeixin">
<view class="form">
<view class="input">
<up-input :customStyle="{height: '100%'}" v-model="loginForm.phone" placeholderClass="place"
border="none" placeholder="请输入手机号" type="number">
<up-input :customStyle="{ height: '100%' }" v-model="loginForm.phone"
placeholderClass="place" border="none" placeholder="请输入手机号" type="number">
<template #prefix>
<image style="height: 40rpx;width: 40rpx;margin-top: 6rpx;"
src="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/48491202404281006484208.png">
@ -44,7 +44,7 @@
</up-input>
</view>
<view class="input">
<up-input :customStyle="{height: '100%'}" v-model="loginForm.code" :maxlength="4"
<up-input :customStyle="{ height: '100%' }" v-model="loginForm.code" :maxlength="4"
placeholderClass="place" border="none" placeholder="请输入验证码" type="number">
<template #prefix>
<image style="height: 40rpx;width: 40rpx;margin-top: 6rpx;"
@ -53,7 +53,7 @@
</template>
<template #suffix>
<up-code :seconds="seconds" ref="uCodeRef" @change="codeChange"></up-code>
<view style="color: #20B128;" @click="getCode">{{tips}}</view>
<view style="color: #20B128;" @click="getCode">{{ tips }}</view>
</template>
</up-input>
</view>
@ -67,8 +67,8 @@
微信登录
</view>
<view class="agreement">
<image v-if="!isAgree" @click="isAgree=true" src="@/static/icon/n-check.png"></image>
<image v-else @click="isAgree=false" src="@/static/icon/check.png"></image>
<image v-if="!isAgree" @click="isAgree = true" src="@/static/icon/n-check.png"></image>
<image v-else @click="isAgree = false" src="@/static/icon/check.png"></image>
<view>
我已同意<text>用户协议</text><text>隐私政策</text>
</view>