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

@ -116,3 +116,8 @@ export const updataOrderApi = (data) => {
export const getStoreByPhone = (data) => { export const getStoreByPhone = (data) => {
return request.get('/store/Store/detail', 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 v-else>
<view class="tabs"> <view class="tabs">
<text @click="currentTab=1" :class="{actText:currentTab==1}">开通行业会员</text> <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 class="lines" :class="{actLine:currentTab==2}" />
</view> </view>
@ -47,11 +47,17 @@
</up-form-item> </up-form-item>
</up-form> </up-form>
<view class="store-info"> <view class="store-info">
报备人:{{STORE_INFO.detailed_address}} 报备人:{{STORE_INFO.name}}
</view> </view>
</view> </view>
<view class="submit-btn"> <view class="submit-btn" @click="submit">
<up-button text="完成并收款" @click="submit" shape="circle" color="#50C758"></up-button> <!-- <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> </view>
</block> </block>
@ -302,12 +308,20 @@
const submit = async () => { const submit = async () => {
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('请填写电话号码');
formData.store_id = STORE_INFO.id
uni.scanCode({ uni.scanCode({
success: function(res) { success: function(res) {
formData.auth_code = res.result formData.auth_code = res.result
vipRechargeApi(formData).then(res => { vipRechargeApi(formData).then(res => {
uni.$u.toast('操作成功'); uni.$u.toast('操作成功');
currentTab.value = 2 currentTab.value = 2
formData.real_name = ''
formData.mobile = ''
formData.address = ''
tabsList.forEach(item => {
item.name = '请选择'
})
}) })
getCount() getCount()
getLists() getLists()
@ -417,6 +431,7 @@
} }
.submit-btn { .submit-btn {
/* height: 200rpx; */
position: fixed; position: fixed;
bottom: 50rpx; bottom: 50rpx;
width: 710rpx; width: 710rpx;

View File

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

View File

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

View File

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

View File

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