完善本地生活

This commit is contained in:
wangxiaowei 2024-06-28 17:49:40 +08:00
parent 104eb4b27c
commit 37a9a94de3
6 changed files with 102 additions and 33 deletions

@ -366,7 +366,7 @@
fileList: [],
storeState: -1,
bgColor: '#FA844C',
localShop: []
}
},
onLoad() {
@ -382,6 +382,7 @@
async getLocalStore() {
await getLocalStore().then((res) => {
if (res.data.local) {
this.localShop = res.data.local
this.storeState = res.data.local.store_state
if (this.storeState == -1 || this.storeState == 2) {
this.bgColor = '#FA844C'
@ -496,12 +497,15 @@
// 提交表单
async onSubmit() {
const {
form,
isAgree,
fileList
} = this
const {businessLicense, crftNo1, idCard, name, empowerPhone, address} = this.form;
const {form, isAgree, fileList} = this
const {businessLicense, crftNo1, idCard, name, empowerPhone, address} = this.form
const latitude = this.cityInfo.gcj02_lat
const longitude = this.cityInfo.gcj02_lng
let lstore_id = 0
if (this.localShop) {
lstore_id = this.localShop.lstore_id
}
// let flag = true;
// Object.keys(submitObj).forEach((key) => {
@ -550,7 +554,7 @@
data,
code,
msg
} = await addLocalStore({businessLicense, crftNo1, idCard, name, empowerPhone, address})
} = await addLocalStore({businessLicense, crftNo1, idCard, name, empowerPhone, address, lstore_id, latitude, longitude})
if(code == 1) {
this.$toast({
title: msg

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

@ -1,36 +1,59 @@
<template>
<view class="shop">
<view class="shop-header">
<u-image width="140rpx" height="140rpx" border-radius="50%" :src="userInfo.avatar"></u-image>
<view>用户昵称</view>
</view>
<view class="shop-menu">
<view class="shop-menu-item" v-for="(item, index) in menu" :key="index" @click="goPage(item.src)">
<view>
<view class="bold lg">{{item.title}}</view>
</view>
<view>
<image :src="item.image"></image>
<view>
<view class="shop" v-if="storeState == 1">
<view class="shop-header">
<u-image width="140rpx" height="140rpx" border-radius="50%" :src="userInfo.avatar"></u-image>
<view>{{userInfo.nickname}}</view>
</view>
<view class="shop-menu">
<view class="shop-menu-item" v-for="(item, index) in menu" :key="index" @click="goPage(item.src)">
<view>
<view class="bold lg">{{item.title}}</view>
</view>
<view>
<image :src="item.image"></image>
</view>
</view>
</view>
</view>
<view v-else class="submit-text">
<navigator url="/bundle_b/pages/local_settled/index" hover-class="none">
点我提交入驻信息
</navigator>
</view>
</view>
</template>
<script>
import {
getLocalStore,
} from "@/api/shop"
import {mapGetters} from 'vuex'
export default {
data() {
return {
storeState: '',
menu: [
{title: '商品添加', image: '../../static/local_add.png', src: '/bundle_b/pages/local_shop/local_shop_add'},
{title: '商品管理', image: '../../static/local_shop.png', src: '/bundle_b/pages/local_shop/local_shop_manager'},
{title: '订单管理', image: '../../static/local_order.png', src: '/bundle_b/pages/local_shop/local_shop_order'},
{title: '二维码下载', image: '../../static/ercode.png', src: '/bundle_b/pages/local_shop/local_shop_order'},
{title: '信息编辑', image: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/bundle_b/local_shop/local_info.png', src: '/bundle_b/pages/local_shop/local_edit_info'},
{title: '商品添加', image: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/bundle_b/local_shop/local_add.png', src: '/bundle_b/pages/local_shop/local_shop_add'},
{title: '商品管理', image: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/bundle_b/local_shop/local_shop.png', src: '/bundle_b/pages/local_shop/local_shop_manager'},
{title: '订单管理', image: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/bundle_b/local_shop/local_order.png', src: '/bundle_b/pages/local_shop/local_shop_order'},
// {title: '二维码下载', image: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/bundle_b/local_shop/local_ercode.png', src: '/bundle_b/pages/local_shop/local_shop_order'},
]
}
},
onLoad() {
this.getLocalStore()
},
methods: {
async getLocalStore() {
await getLocalStore().then((res) => {
if (res.data.local) {
this.storeState = res.data.local.store_state
}
})
},
goPage(src) {
this.$Router.push({
path: src
@ -92,4 +115,11 @@
}
}
}
.submit-text {
text-align: center;
margin-top: 40rpx;
text-decoration: underline;
color: #FF2C3C;
}
</style>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -1109,6 +1109,24 @@
"meta": {
"auth": false
}
},
{
"path": "pages/local_search/index",
"style": {
"navigationBarTitleText": "搜索"
},
"meta": {
"auth": false
}
},
{
"path": "pages/local_shop/local_edit_info",
"style": {
"navigationBarTitleText": "商品信息编辑"
},
"meta": {
"auth": true
}
}
]
}

@ -129,13 +129,22 @@
active: 1,
distanceSort: 'asc',
navList: [
[{
image: 'https://dlh.hainings.com/uploads/images/202401151539353104e7660.jpeg',
name: '商家入驻',
is_tab: 0,
link: '/bundle_b/pages/local_settled/index',
link_type: 1
}, ]
[
{
image: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/bundle_b/local_shop/store_manager.png',
name: '商家信息',
is_tab: 0,
link: '/bundle_b/pages/local_shop/local_shop',
link_type: 1
},
{
image: 'https://zjeloong.oss-cn-hangzhou.aliyuncs.com/uniapp/bundle_b/local_shop/store_settled.png',
name: '商家入驻',
is_tab: 0,
link: '/bundle_b/pages/local_settled/index',
link_type: 1
},
]
],
shop: [{
image: 'https://dlh.hainings.com/uploads/images/20230617152038ec2d56794.png',
@ -254,8 +263,8 @@
width: 20%;
.nav-icon {
width: 82rpx;
height: 82rpx;
width: 60rpx;
height: 60rpx;
}
}