diff --git a/api/user.js b/api/user.js index ae0730d..f8dbe79 100644 --- a/api/user.js +++ b/api/user.js @@ -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); } \ No newline at end of file diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue index 8dea01c..cd67bd8 100644 --- a/pageQuota/vipUser/index.vue +++ b/pageQuota/vipUser/index.vue @@ -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; diff --git a/pages/index/index.vue b/pages/index/index.vue index 47cd6db..19241d9 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -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, // 是否直接购买0否1是 // 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> \ No newline at end of file diff --git a/pages/login/login.vue b/pages/login/login.vue index 62ff847..7e22e2e 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -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 }) } } diff --git a/pages/login/test.vue b/pages/login/test.vue index 9f01aa3..6949adb 100644 --- a/pages/login/test.vue +++ b/pages/login/test.vue @@ -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) diff --git a/pages/my/my.vue b/pages/my/my.vue index 70fa08d..2afeb8c 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -177,6 +177,8 @@ const logout = () => { userStore.setToken(''); userStore.setUserInfo({}); + uni.setStorageSync("STORE_INFO", '') + uni.reLaunch({ url: '/pages/login/login' })