This commit is contained in:
zmj 2024-06-17 20:47:54 +08:00
parent 6f7eed451f
commit f171b8be9a
6 changed files with 57 additions and 25 deletions

View File

@ -115,4 +115,9 @@ export const updataOrderApi = (data) => {
export const getStoreByPhone = (data) => {
return request.get('/store/Store/detail', data);
}
export const getStoreInfo = (data) => {
return request.get('/config', data);
}

View File

@ -13,7 +13,7 @@
<view v-else>
<view class="tabs">
<text @click="currentTab=1" :class="{actText:currentTab==1}">开通行业会员</text>
<text @click="currentTab=2" :class="{actText:currentTab==2}"> 已开通列表</text>
<text @click="currentTab=2,getCount(),getLists()" :class="{actText:currentTab==2}"> 已开通列表</text>
<view class="lines" :class="{actLine:currentTab==2}" />
</view>
@ -47,11 +47,17 @@
</up-form-item>
</up-form>
<view class="store-info">
报备人:{{STORE_INFO.detailed_address}}
报备人:{{STORE_INFO.name}}
</view>
</view>
<view class="submit-btn">
<up-button text="完成并收款" @click="submit" shape="circle" color="#50C758"></up-button>
<view class="submit-btn" @click="submit">
<!-- <up-button text="完成并收款" size='large' :customStyle="{height:'100rpx',fontSize:'50rpx'}" @click="submit"
shape="circle" color="#50C758"></up-button> -->
<view
style='width: 710rpx;height: 100rpx;text-align: center;line-height: 100rpx;text-align: center;color: white;background-color: #33B83A;border-radius: 50rpx;font-size:40rpx ;'>
完成并收款
</view>
</view>
</block>
@ -302,12 +308,20 @@
const submit = async () => {
if (!formData.real_name) return uni.$u.toast('请填写真实姓名');
if (!formData.mobile) return uni.$u.toast('请填写电话号码');
formData.store_id = STORE_INFO.id
uni.scanCode({
success: function(res) {
formData.auth_code = res.result
vipRechargeApi(formData).then(res => {
uni.$u.toast('操作成功');
currentTab.value = 2
formData.real_name = ''
formData.mobile = ''
formData.address = ''
tabsList.forEach(item => {
item.name = '请选择'
})
})
getCount()
getLists()
@ -417,6 +431,7 @@
}
.submit-btn {
/* height: 200rpx; */
position: fixed;
bottom: 50rpx;
width: 710rpx;

View File

@ -21,15 +21,15 @@
<view class="content">
<up-navbar placeholder style="z-index: 10080;">
<template #left>
<view class="store-info" @click="navgo('/multipleShop/index/index')">
<view style="display: flex;font-size: 30rpx;font-weight: bold;">
<text
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{shareInfo.real_name?(shareInfo.real_name + '的' + STORE_INFO.name):STORE_INFO.name}}</text>
<text v-if="userStore.userInfo.vip_name=='行业会员'"
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{(shareInfo.real_name||userStore.userInfo.nickname + '的供销个人门店' )}}</text>
<text v-else
style="max-width: 400rpx;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">{{shareInfo.real_name?(shareInfo.real_name + '的' + STORE_INFO.name):STORE_INFO.store_name}}</text>
<up-icon name="arrow-right"></up-icon>
</view>
<view style="display: flex;font-size: 24rpx;color:#777777 ;">
{{STORE_INFO.detailed_address}}
</view>
</view>
</template>
</up-navbar>
@ -226,7 +226,7 @@
const STORE_INFO = ref({
name: '',
id: '',
id: 5,
detailed_address: '',
image: ''
});
@ -260,11 +260,11 @@
})
const navgo = (url) => {
if (shareInfo.value.real_name) return
if (userStore.userInfo.vip_name) return
uni.navigateTo({
url
})
// uni.navigateTo({
// url
// })
}
/*商品列表滚动隐藏头部导航 */
@ -315,7 +315,7 @@
cart_num: cart_num,
is_new: 0, // 01
// goods_id: id,
store_id: STORE_INFO.value.id,
store_id: STORE_INFO.value.id || 5,
product_id: product_id
}).then(res => {
getCartList();
@ -343,7 +343,7 @@
name: '',
order: '',
store_name: '',
store_id: STORE_INFO.value.id || ''
store_id: STORE_INFO.value.id || '5'
})
const loading = ref(true);
@ -392,7 +392,7 @@
page_no: page_no,
page_size: 30,
level: three,
store_id: STORE_INFO.value.id || '' // id
store_id: STORE_INFO.value.id || '5' // id
}).then(res => {
if (pid == 0) { //
if (!res.data?.lists?.length) return;
@ -500,7 +500,7 @@
productLogApi({
product_id: item.product_id,
cate_id: item.cate_id,
store_id: STORE_INFO.value.id || ''
store_id: STORE_INFO.value.id || '5'
});
};
const changeGood = (data) => { //
@ -566,9 +566,9 @@
onLoad(async (opt) => {
// id
if (opt.id) {
where.value.store_id = opt.id;
where.value.store_id = 5;
const info = await shopDetailApi({
store_id: opt.id
store_id: 5
});
STORE_INFO.value = info.data;
@ -592,7 +592,7 @@
const info = uni.getStorageSync('STORE_INFO');
if (info) {
STORE_INFO.value = JSON.parse(info);
where.value.store_id = STORE_INFO.value.id;
where.value.store_id = 5;
}
//
@ -1056,6 +1056,6 @@
.store-info {
margin: 0 0 20rpx 20rpx;
margin-top: 80rpx;
margin-top: 20rpx;
}
</style>

View File

@ -90,7 +90,8 @@
import {
userLoginApi,
userLoginWeixinApi,
getMobileByMnpApi
getMobileByMnpApi,
getStoreInfo
} from "@/api/user.js";
import useUserStore from "@/store/user.js"
import bindPhone from "@/components/bindPhone.vue"
@ -155,6 +156,9 @@
}).then(res => {
uni.hideLoading();
userStore.setToken(res.data.token);
getStoreInfo().then(res => {
uni.setStorageSync("STORE_INFO", JSON.stringify(res.data))
})
if (!res.data.mobile) { //
return showBind.value = true;
@ -180,7 +184,7 @@
} else {
//
uni.reLaunch({
url: "/multipleShop/index/index"
url: "/pages/index/index?id=" + storeInfo.id
})
}
}

View File

@ -9,7 +9,8 @@
<script setup>
import {
userLoginApi,
userInfoApi
userInfoApi,
getStoreInfo
} from "@/api/user.js";
import {
ref
@ -25,6 +26,11 @@
"terminal": 2,
"scene": 1
}).then(res => {
getStoreInfo().then(res => {
uni.setStorageSync("STORE_INFO", JSON.stringify(res.data))
})
uni.setStorageSync('token', res.data.token);
userStore.setToken(res.data.token);
console.log(res.data.token)

View File

@ -177,6 +177,8 @@
const logout = () => {
userStore.setToken('');
userStore.setUserInfo({});
uni.setStorageSync("STORE_INFO", '')
uni.reLaunch({
url: '/pages/login/login'
})