Commit bb363da5 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 699d3123 60d8f83d
...@@ -8,27 +8,17 @@ ...@@ -8,27 +8,17 @@
:class="{ active: selectedItem === index }" :class="{ active: selectedItem === index }"
@tap="selectItem(index)" @tap="selectItem(index)"
> >
{{ item }} {{ item.name }}
</li> </li>
</ul> </ul>
</view> </view>
</template> </template>
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps, onMounted } from 'vue';
const items = reactive([ import { getTour } from '@/api/assistingAgriculture/village';
'智能排序', const items = ref([]);
'距离优先', const emit = defineEmits(['sortParams']);
'好评优先',
'销量优先',
'低价优先',
'低价优先',
'距离优先',
'好评优先',
'销量优先',
'低价优先',
'距离优先',
]);
const selectedItem = ref(null); const selectedItem = ref(null);
const props = defineProps({ const props = defineProps({
width: { width: {
...@@ -36,8 +26,18 @@ const props = defineProps({ ...@@ -36,8 +26,18 @@ const props = defineProps({
default: '100%', default: '100%',
}, },
}); });
const selectItem = (selectItem) => { onMounted(async () => {
selectedItem.value = selectItem; getTourList();
});
const selectItem = (index, item) => {
selectedItem.value = index;
emit('sortParams', item);
};
// 查询景点
const getTourList = () => {
getTour().then((res) => {
console.log(res, 111);
});
}; };
</script> </script>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:class="{ active: selectedItem === index }" :class="{ active: selectedItem === index }"
@tap="selectItem(index)" @tap="selectItem(index)"
> >
{{ item }} {{ item.name }}
</li> </li>
</ul> </ul>
</view> </view>
...@@ -15,7 +15,14 @@ ...@@ -15,7 +15,14 @@
<script setup> <script setup>
import { defineProps } from 'vue'; import { defineProps } from 'vue';
const items = reactive(['智能排序', '距离优先', '好评优先', '销量优先', '低价优先', '低价优先']); const items = ref([
{ name: '距离优先', sortName: 'distance' },
{ name: '好评优先', sortName: 'grade' },
{ name: '销量优先', sortName: 'monthSoldNum' },
{ name: '低价优先', sortName: 'lowPrice' },
{ name: '高价优先', sortName: 'highPrice' },
]);
const emit = defineEmits(['sortParams']);
const selectedItem = ref(null); const selectedItem = ref(null);
const props = defineProps({ const props = defineProps({
width: { width: {
...@@ -23,8 +30,9 @@ const props = defineProps({ ...@@ -23,8 +30,9 @@ const props = defineProps({
default: '100%', default: '100%',
}, },
}); });
const selectItem = (selectItem) => { const selectItem = (index, item) => {
selectedItem.value = selectItem; selectedItem.value = index;
emit('sortParams', item);
}; };
</script> </script>
......
import { request } from '../utils/request'; import { request } from '../utils/request';
export function groupBuyList() {
return request({
url: '/sgyrdd/category/groupBuyList',
method: 'GET',
});
}
// 新增收货地址 // 新增收货地址
export async function addAddress() { export async function addAddress(data) {
return request({ return request({
url: '/sgyrdd/useraddr/add', url: '/sgyrdd/useraddr/add',
method: 'GET', method: 'post',
data,
}); });
} }
// 修改收货地址 // 修改收货地址
export async function updateAddress() { export async function updateAddress(data) {
return request({ return request({
url: '/sgyrdd/useraddr/update', url: '/sgyrdd/useraddr/update',
method: 'GET', method: 'post',
data,
}); });
} }
// 删除收货地址 // 删除收货地址
......
import { request } from '../../utils/request';
// 查询景点
export function getTour(data) {
return request({
url: `/sgyrdd/znprod/tour/list`,
method: 'GET',
data,
});
}
// 查询热门路线
export function getPopularList(data) {
return request({
url: `/sgyrdd/prod/popular`,
method: 'GET',
data,
});
}
// 查询商品列表
export function getProdList(data) {
return request({
url: `/sgyrdd/prod/prodList`,
method: 'GET',
data,
});
}
...@@ -72,3 +72,12 @@ export function applyShop(data) { ...@@ -72,3 +72,12 @@ export function applyShop(data) {
data, data,
}); });
} }
// 申请成为商家
export function editShop(data) {
return request({
url: `/sgyrdd/shop/update`,
method: 'POST',
data,
});
}
...@@ -16,4 +16,3 @@ export function applyShop(data) { ...@@ -16,4 +16,3 @@ export function applyShop(data) {
data, data,
}); });
} }
{ {
"name" : "", "name": "",
"appid" : "", "appid": "",
"description" : "", "description": "",
"versionName" : "1.0.0", "versionName": "1.0.0",
"versionCode" : "100", "versionCode": "100",
"transformPx" : false, "transformPx": false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus": {
"usingComponents" : true, "usingComponents": true,
"nvueStyleCompiler" : "uni-app", "nvueStyleCompiler": "uni-app",
"compilerVersion" : 3, "compilerVersion": 3,
"splashscreen" : { "splashscreen": {
"alwaysShowBeforeRender" : true, "alwaysShowBeforeRender": true,
"waiting" : true, "waiting": true,
"autoclose" : true, "autoclose": true,
"delay" : 0 "delay": 0
}, },
/* 模块配置 */ /* 模块配置 */
"modules" : {}, "modules": {},
/* 应用发布信息 */ /* 应用发布信息 */
"distribute" : { "distribute": {
/* android打包配置 */ /* android打包配置 */
"android" : { "android": {
"permissions" : [ "permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>", "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>", "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>", "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
...@@ -41,42 +41,49 @@ ...@@ -41,42 +41,49 @@
] ]
}, },
/* ios打包配置 */ /* ios打包配置 */
"ios" : {}, "ios": {},
/* SDK配置 */ /* SDK配置 */
"sdkConfigs" : {} "sdkConfigs": {}
} }
}, },
/* 快应用特有相关 */ /* 快应用特有相关 */
"quickapp" : {}, "quickapp": {},
/* 小程序特有相关 */ /* 小程序特有相关 */
"mp-weixin" : { "mp-weixin": {
"appid" : "", "appid": "",
"setting" : { "setting": {
"urlCheck" : false "urlCheck": false
}, },
"usingComponents" : true "usingComponents": true
}, },
"mp-alipay" : { "mp-alipay": {
"usingComponents" : true "usingComponents": true
}, },
"mp-baidu" : { "mp-baidu": {
"usingComponents" : true "usingComponents": true
}, },
"mp-toutiao" : { "mp-toutiao": {
"usingComponents" : true "usingComponents": true
}, },
"uniStatistics": { "uniStatistics": {
"enable": false "enable": false
}, },
"vueVersion" : "3", "vueVersion": "3",
"h5" : { "h5": {
"router" : { "router": {
"base" : "./", "base": "./",
"mode" : "hash" "mode": "hash"
}, },
"optimization" : { "optimization": {
"treeShaking" : { "treeShaking": {
"enable" : true "enable": true
}
},
"sdkConfigs": {
"maps": {
"qqmap": {
"key": "MN4BZ-7JXKW-2RYRD-32QGF-AHONV-PAFUN"
}
} }
} }
} }
......
...@@ -3,13 +3,13 @@ ...@@ -3,13 +3,13 @@
<Header :title="newAddressFlag ? '新增收货地址' : '编辑收货地址'"></Header> <Header :title="newAddressFlag ? '新增收货地址' : '编辑收货地址'"></Header>
<view class="content"> <view class="content">
<wd-form ref="form" :model="model" id="form"> <wd-form ref="reForm" :model="forMData" id="form">
<wd-cell-group> <wd-cell-group>
<wd-input <wd-input
label="联系人" label="联系人"
label-width="80px" label-width="80px"
prop="receiver" prop="receiver"
v-model="model.receiver" v-model="forMData.receiver"
placeholder="请输入联系人姓名" placeholder="请输入联系人姓名"
:rules="[{ required: false, validator: fieldNotEmpty, message: '姓名不能为空' }]" :rules="[{ required: false, validator: fieldNotEmpty, message: '姓名不能为空' }]"
/> />
...@@ -17,43 +17,36 @@ ...@@ -17,43 +17,36 @@
label="手机号" label="手机号"
label-width="80px" label-width="80px"
prop="mobile" prop="mobile"
v-model="model.mobile" v-model="forMData.mobile"
placeholder="请输入联系人手机号" placeholder="请输入联系人手机号"
:rules="[{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' }]" :rules="[{ required: false, pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号' }]"
/> />
<wd-input
label="详细地址"
label-width="80px"
prop="addr"
v-model="model.addr"
placeholder="请输入详细地址"
:rules="[{ required: false, validator: fieldNotEmpty, message: '详细地址不能为空' }]"
/>
<wd-checkbox-group>
<wd-cell title="所在地区" title-width="80px"> <wd-cell title="所在地区" title-width="80px">
<view class="area"> <view class="area">
<view class="area_l" @tap="changeLocation"> <view class="area_l">
<view class="area_lt">这是当前定位</view> <view class="area_lt">当前定位</view>
<view class="area_lb">这是定位的详细地址点击可跳转地图选择</view> <view class="area_lb">{{ forMData.city }}</view>
</view> </view>
<view class="area_r"> <view class="area_r">
<wd-icon name="location" size="22px" @tap="changeLocation"></wd-icon> <wd-icon name="location" size="22px" @tap="changeLocation" />
</view> </view>
</view> </view>
</wd-cell> </wd-cell>
</wd-checkbox-group>
<wd-checkbox-group v-model="model.commonAddr" size="large"> <wd-input
<wd-cell title="设置为默认地址" center clickable @tap="setDefaultAddress"> label="详细地址"
label-width="80px"
prop="addr"
v-model="forMData.addr"
placeholder="请输入详细地址"
:rules="[{ required: false, validator: fieldNotEmpty, message: '详细地址不能为空' }]"
/>
<wd-cell title="设置为默认地址" center>
<view> <view>
<wd-checkbox <wd-checkbox v-model="forMData.commonAddr" prop="commonAddr" />
modelValuee="1"
ref="checkBoxAdress"
checked-color="#fa5151"
custom-style="margin-right:-18rpx"
></wd-checkbox>
</view> </view>
</wd-cell> </wd-cell>
</wd-checkbox-group>
</wd-cell-group> </wd-cell-group>
<view class="footer"> <view class="footer">
...@@ -67,63 +60,54 @@ ...@@ -67,63 +60,54 @@
<script setup> <script setup>
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { addAddress, updateAddress, deleteAddress } from '@/api/address'; import { addAddress, updateAddress, deleteAddress } from '@/api/address';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const newAddressFlag = ref(false); const newAddressFlag = ref(false);
const form = ref(); const reForm = ref();
const checkBoxAdress = ref(); const checkBoxAdress = ref();
const model = ref({ const forMData = ref({
name: '', receiver: '',
phone: '', mobile: '',
detailAddress: '', province: '',
isDefaultAddress: [], city: '',
area: '',
addr: '',
lng: '',
lat: '',
commonAddr: false,
}); });
onLoad((options) => { onLoad((options) => {
newAddressFlag.value = options.new; newAddressFlag.value = options.new;
if (newAddressFlag.value) {
model.value = ref({
name: '',
phone: '',
detailAddress: '',
isDefaultAddress: [],
});
} else {
model.value.name = '';
model.value.phone = '';
model.value.detailAddress = '';
model.value.isDefaultAddress = ['1'];
}
}); });
function setDefaultAddress() {
// checkBoxAdress.value && checkBoxAdress.value.toggle();
console.log(model.value.isDefaultAddress);
}
function fieldNotEmpty(val) { function fieldNotEmpty(val) {
if (String(val).length >= 1) { if (val.length >= 1) {
return true; return true;
} else { } else {
return false; return false;
} }
} }
const submit = async () => {
const res = await addAddress(model.value); const hdSubmit = async () => {
console.log(res); await addAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
});
}; };
function handleSubmit() { function handleSubmit() {
form.value console.log('model的值', reForm.value);
reForm.value
.validate() .validate()
.then(({ valid, errors }) => { .then(({ valid }) => {
if (valid) { if (valid) {
xma.showToast({ hdSubmit();
title: '更新成功', // xma.showToast({
duration: 2000, // title: '提交成功',
success: function () { // duration: 2000,
console.log('数据更新后跳转地址列表页'); // success: function () {
}, // console.log('数据更新后跳转地址列表页');
}); // },
// });
} }
}) })
.catch((error) => { .catch((error) => {
...@@ -131,8 +115,23 @@ function handleSubmit() { ...@@ -131,8 +115,23 @@ function handleSubmit() {
}); });
} }
// 重新定位收货地址 // 重新定位收货地址
function changeLocation() { async function changeLocation() {
console.log('aaa'); uni.chooseLocation({
success: function (res) {
forMData.value.city = res.address;
forMData.value.addr = res.address;
forMData.value.lng = res.longitude;
forMData.value.lat = res.latitude;
console.log('位置信息:' + JSON.stringify(res));
console.log('位置名称:' + res.name);
console.log('详细地址:' + res.address);
console.log('纬度:' + res.latitude);
console.log('经度:' + res.longitude);
},
});
const res = ('26.56806', '106.714304');
console.log('地址转换结果:' + res);
} }
</script> </script>
......
...@@ -55,17 +55,13 @@ ...@@ -55,17 +55,13 @@
:scroll-with-animation="true" :scroll-with-animation="true"
@scroll="scroll" @scroll="scroll"
> >
<view class="foodCard" v-for="(item, index) in 5" :key="index"> <view class="foodCard" v-for="(item, index) in popularRouterData" :key="index">
<!-- <img--> <!-- <img-->
<!-- class="img-icon"--> <!-- class="img-icon"-->
<!-- src="/static/assistingAgriculture/rural/icon.png"--> <!-- src="/static/assistingAgriculture/rural/icon.png"-->
<!-- style="width: 118rpx; height: 32rpx"--> <!-- style="width: 118rpx; height: 32rpx"-->
<!-- />--> <!-- />-->
<image <image class="test5" :src="item.imgUrl" mode="widthFix" />
class="test5"
src="/static/assistingAgriculture/rural/img4.png"
mode="widthFix"
/>
</view> </view>
</scroll-view> </scroll-view>
<!-- 列表--> <!-- 列表-->
...@@ -162,7 +158,13 @@ import Sort from '../../../components/assistingAgriculture/index/Sort.vue'; ...@@ -162,7 +158,13 @@ import Sort from '../../../components/assistingAgriculture/index/Sort.vue';
import DepartureDate from '../../../components/assistingAgriculture/index/DepartureDate.vue'; import DepartureDate from '../../../components/assistingAgriculture/index/DepartureDate.vue';
import ScenicSpots from '../../../components/assistingAgriculture/index/ScenicSpots.vue'; import ScenicSpots from '../../../components/assistingAgriculture/index/ScenicSpots.vue';
import Screen from '../../../components/assistingAgriculture/index/Screen.vue'; import Screen from '../../../components/assistingAgriculture/index/Screen.vue';
import { getPopularList, getProdList, getTour } from '@/api/assistingAgriculture/village';
import { getPresaleList } from '@/api/assistingAgriculture/building';
import { onMounted } from 'vue';
onMounted(async () => {
getProd();
getPopular();
});
const rotate = ref(false); const rotate = ref(false);
const rotate2 = ref(false); const rotate2 = ref(false);
const rotate3 = ref(false); const rotate3 = ref(false);
...@@ -209,6 +211,7 @@ const cardList = ref([ ...@@ -209,6 +211,7 @@ const cardList = ref([
price: '299.00', price: '299.00',
}, },
]); ]);
const popularRouterData = ref([]);
const locationFiltering = (index) => { const locationFiltering = (index) => {
switch (index) { switch (index) {
case 0: case 0:
...@@ -237,6 +240,21 @@ const locationFiltering = (index) => { ...@@ -237,6 +240,21 @@ const locationFiltering = (index) => {
break; break;
} }
}; };
// 查询热门路线
const getPopular = () => {
getPopularList({ current: 1, size: 10 }).then((res) => {
res.data.records.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.pic;
});
popularRouterData.value = res.data.records;
});
};
// 查询商品列表
const getProd = () => {
getProdList({ current: 1, size: 10 }).then((res) => {
console.log(res, 222);
});
};
function toRouteDetails() { function toRouteDetails() {
// TODO: 跳转到线路详情 // TODO: 跳转到线路详情
xma.navigateTo({ xma.navigateTo({
......
...@@ -127,24 +127,33 @@ const getSelectedItems = () => { ...@@ -127,24 +127,33 @@ const getSelectedItems = () => {
return acc.concat(selectedProducts); return acc.concat(selectedProducts);
}, []); }, []);
}; };
// 跳转到结算页面方法
function toSettle() { function toSettle() {
const selected = getSelectedItems(); const selected = getSelectedItems();
if (selected.length > 0) { if (selected.length === 0) {
console.log('Selected items:', selected); xma.showToast({
title: '请选择需要结算的商品!',
icon: 'none',
});
return;
}
const shopIds = selected
.map((item) => item.shopId)
.filter((value, index, self) => self.indexOf(value) === index);
if (shopIds.length > 1) {
xma.showToast({
title: '暂不支持跨店结算,请选择同一店铺的商品!',
icon: 'none',
});
} else {
const basketIds = selected.map((item) => item.basket.basketId).join(','); const basketIds = selected.map((item) => item.basket.basketId).join(',');
console.log('Basket IDs:', basketIds);
// TODO: 跳转到结算页面 // TODO: 跳转到结算页面
xma.navigateTo({ xma.navigateTo({
url: `/pages/assistingAgriculture/cart/ConfirmOrder?ids=${basketIds}`, url: `/pages/assistingAgriculture/cart/ConfirmOrder?ids=${basketIds}`,
}); });
} else {
xma.showToast({
title: '请选择需要结算的商品!',
icon: 'none',
});
} }
} }
// 跳转店铺主页 // 跳转店铺主页
const toStore = (item) => { const toStore = (item) => {
xma.navigateTo({ xma.navigateTo({
......
...@@ -134,7 +134,8 @@ const dataDetails = ref({}); ...@@ -134,7 +134,8 @@ const dataDetails = ref({});
const commentData = ref({}); const commentData = ref({});
const subscript = ref(0); const subscript = ref(0);
onLoad((options) => { onLoad((options) => {
prodId = '43834'; // prodId = '43834';
prodId = options.prodId;
getProdDetailFn(); getProdDetailFn();
getEvalNumberFn(); getEvalNumberFn();
getshoppingCartListFn(); getshoppingCartListFn();
...@@ -400,6 +401,7 @@ page { ...@@ -400,6 +401,7 @@ page {
top: -8rpx; top: -8rpx;
padding-bottom: 120rpx; padding-bottom: 120rpx;
.content { .content {
margin-top: 30rpx;
.desc { .desc {
img { img {
width: 100%; width: 100%;
......
...@@ -64,7 +64,12 @@ ...@@ -64,7 +64,12 @@
style="position: relative; float: right; top: -42rpx" style="position: relative; float: right; top: -42rpx"
></wd-icon> ></wd-icon>
<view class="hot-img" v-for="(item, index) in hotImgList" :key="index"> <view class="hot-img" v-for="(item, index) in hotImgList" :key="index">
<img class="rice" @tap="toDetail" :src="item.img" style="width: 670rpx; height: 236rpx" /> <img
class="rice"
@tap="toDetail(item)"
:src="item.img"
style="width: 670rpx; height: 236rpx"
/>
</view> </view>
</view> </view>
<!-- tabs--> <!-- tabs-->
...@@ -93,7 +98,7 @@ ...@@ -93,7 +98,7 @@
:key="index" :key="index"
style="margin-left: 20rpx" style="margin-left: 20rpx"
> >
<img @tap="toDetail" :src="item.imgUrl" style="width: 330rpx; height: 330rpx" /> <img @tap="toDetail(item)" :src="item.imgUrl" style="width: 330rpx; height: 330rpx" />
<view class="detail-title">{{ whh }}</view> <view class="detail-title">{{ whh }}</view>
<view class="price-page"> <view class="price-page">
<text class="price">{{ item.price }}</text> <text class="price">{{ item.price }}</text>
...@@ -181,7 +186,6 @@ const choice = (index, item) => { ...@@ -181,7 +186,6 @@ const choice = (index, item) => {
testData.value.forEach((item) => { testData.value.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.pic; item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.pic;
whh.value = getSlashValue(item.content); whh.value = getSlashValue(item.content);
console.log(whh.value, 333);
}); });
light.value = index; light.value = index;
}; };
...@@ -202,10 +206,10 @@ function handleClick(e) { ...@@ -202,10 +206,10 @@ function handleClick(e) {
function onChange(e) { function onChange(e) {
console.log(e); console.log(e);
} }
function toDetail() { function toDetail(item) {
// TODO: 跳转到详情页 // TODO: 跳转到详情页
xma.navigateTo({ xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail', url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
}); });
} }
function toCart() { function toCart() {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="product-page" v-for="(item, index) in list" :key="index" @click="toDetail"> <view class="product-page" v-for="(item, index) in list" :key="index">
<view> <view>
<view class="page-title">{{ item.categoryName }}</view> <view class="page-title">{{ item.categoryName }}</view>
<img :src="item.img" class="main-img" /> <img :src="item.img" class="main-img" />
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
class="detail-border" class="detail-border"
v-for="(item, index) in item.commodityList" v-for="(item, index) in item.commodityList"
:key="index" :key="index"
@click="toDetail" @click="toDetail(item)"
> >
<img :src="item.commodityImg" style="width: 216rpx; height: 176rpx" /> <img :src="item.commodityImg" style="width: 216rpx; height: 176rpx" />
<view class="detail-title">{{ item.prodName }}</view> <view class="detail-title">{{ item.prodName }}</view>
...@@ -73,23 +73,6 @@ const swiperList = ref([]); ...@@ -73,23 +73,6 @@ const swiperList = ref([]);
const current = ref(0); const current = ref(0);
// 轮播图数据 // 轮播图数据
let lunboData; let lunboData;
const detailList = ref([
{
img: '/static/assistingAgriculture/assets/detailedMapOne.png',
price: '25',
text: '干辣椒炒肉干辣椒炒肉',
},
{
img: '/static/assistingAgriculture/assets/detailedMapTwo.png',
price: '25',
text: '贵阳辣子鸡',
},
{
img: '/static/assistingAgriculture/assets/detailedMapThree.png',
price: '25',
text: '麻辣鱼豆腐',
},
]);
onMounted(async () => { onMounted(async () => {
getList(); getList();
getPresaleCategoryList(); getPresaleCategoryList();
...@@ -120,7 +103,6 @@ const getPresaleCategoryList = () => { ...@@ -120,7 +103,6 @@ const getPresaleCategoryList = () => {
// 预售板块轮播图 // 预售板块轮播图
const getPresale = () => { const getPresale = () => {
getPresaleList({ place: 'index_top' }).then((res) => { getPresaleList({ place: 'index_top' }).then((res) => {
console.log(res, 111);
res.data.forEach((item) => { res.data.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl; item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl;
}); });
...@@ -153,10 +135,10 @@ const toBuilding = (item) => { ...@@ -153,10 +135,10 @@ const toBuilding = (item) => {
} }
}; };
// 跳转详情页 // 跳转详情页
function toDetail() { function toDetail(item) {
// TODO: 跳转到详情页 // TODO: 跳转到详情页
xma.navigateTo({ xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail', url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
}); });
} }
</script> </script>
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
</text> </text>
</scroll-view> </scroll-view>
</view> </view>
<view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail"> <view class="tab-list" v-for="(item, index) in buyList" :key="index" @tap="toDetail(item)">
<img class="buy-list" :src="item.img" style="width: 670rpx; height: 670rpx" /> <img class="buy-list" :src="item.img" style="width: 670rpx; height: 670rpx" />
<view> <view>
<text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text> <text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text>
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</view> </view>
<view class="waterfall"> <view class="waterfall">
<view class="wt-left wt-list"> <view class="wt-left wt-list">
<view class="wt-item" v-for="(good, index) in buyList" :key="index" @tap="toDetail"> <view class="wt-item" v-for="(good, index) in buyList" :key="index" @tap="toDetail(item)">
<view class="item-img"> <view class="item-img">
<image :src="good.img" mode="widthFix" style="border-radius: 16rpx"></image> <image :src="good.img" mode="widthFix" style="border-radius: 16rpx"></image>
<image <image
...@@ -148,13 +148,11 @@ const params = { ...@@ -148,13 +148,11 @@ const params = {
const tabsList = ref([]); const tabsList = ref([]);
onMounted(async () => { onMounted(async () => {
getPresale(); getPresale();
// getPresaleProd();
presaleSortList(); presaleSortList();
}); });
// 预售板块轮播图 // 预售板块轮播图
const getPresale = () => { const getPresale = () => {
getPresaleList({ place: 'presale' }).then((res) => { getPresaleList({ place: 'presale' }).then((res) => {
console.log(res, 111);
res.data.forEach((item) => { res.data.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl; item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl;
}); });
...@@ -216,11 +214,6 @@ const choice = (index, categoryId) => { ...@@ -216,11 +214,6 @@ const choice = (index, categoryId) => {
}); });
light.value = index; light.value = index;
}; };
// 点击商品 跳转详情
function ToDetail(id) {
console.log('点击了商品', id);
}
function handleClick(e) { function handleClick(e) {
console.log(e); console.log(e);
} }
...@@ -233,15 +226,12 @@ function toCart() { ...@@ -233,15 +226,12 @@ function toCart() {
url: '/pages/assistingAgriculture/cart/cart', url: '/pages/assistingAgriculture/cart/cart',
}); });
} }
function toDetail() { function toDetail(item) {
// TODO: 跳转到筑农严选 // TODO: 跳转到详情页
xma.navigateTo({ xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail', url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
}); });
} }
function toTab(item) {
console.log(item, 222);
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
...@@ -20,22 +20,21 @@ ...@@ -20,22 +20,21 @@
/> />
</view> </view>
</view> </view>
</view>
<wd-tabs v-model="tab"> <wd-tabs v-model="tab">
<block> <block v-for="(item, index) in tabs" :key="index">
<wd-tab title="商品"> <wd-tab :title="item">
<view class="content">内容1</view> <view class="content" v-show="tab === 0">内容1</view>
</wd-tab> <view class="content" v-show="tab === 1">内容2</view>
<wd-tab title="店铺">
<view class="content">内容2</view>
</wd-tab> </wd-tab>
</block> </block>
</wd-tabs> </wd-tabs>
</view>
</template> </template>
<script setup> <script setup>
function toSearch(keyword) {} function toSearch(keyword) {}
const tab = ref(0); const tab = ref(0);
const tabs = ref(['商品', '店铺']);
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -43,23 +42,6 @@ page { ...@@ -43,23 +42,6 @@ page {
background: #f6f6f6; background: #f6f6f6;
} }
.search-page { .search-page {
display: flex;
width: 750rpx;
flex-direction: column;
align-items: center;
.wd-tabs {
background-color: #fff;
}
&:deep(.wd-tabs__nav) {
background-color: #fff;
}
&:deep(.wd-tabs__line) {
background-color: #e9231b;
bottom: 2px;
}
.search { .search {
width: 100%; width: 100%;
height: 124rpx; height: 124rpx;
...@@ -103,4 +85,13 @@ page { ...@@ -103,4 +85,13 @@ page {
gap: 20rpx; gap: 20rpx;
} }
} }
:deep(.wd-tabs__line) {
background-color: #e9231b;
bottom: 2px;
}
.content {
line-height: 120px;
text-align: center;
background: #f6f6f6;
}
</style> </style>
...@@ -5,48 +5,49 @@ ...@@ -5,48 +5,49 @@
<view class="formmain"> <view class="formmain">
<wd-form ref="form" :model="formData" :rules="rules"> <wd-form ref="form" :model="formData" :rules="rules">
<wd-cell-group border> <wd-cell-group border>
<wd-picker <!--<wd-picker
label="店铺类型" label="店铺类型"
placeholder="请选择店铺类型" placeholder="请选择店铺类型"
label-width="100px" label-width="100px"
prop="promotion" prop="promotion"
v-model="formData.promotion" v-model="formData.promotion"
:columns="promotionlist" :columns="promotionlist"
/> />-->
<wd-input <wd-input
label="店铺名称" label="店铺名称"
label-width="100px" label-width="100px"
prop="xm" prop="shopName"
clearable clearable
v-model="formData.xm" v-model="formData.shopName"
placeholder="请输入店铺名称" placeholder="请输入店铺名称"
/> />
<wd-input <wd-input
label="联系电话" label="联系电话"
label-width="100px" label-width="100px"
prop="sjh" prop="tel"
clearable clearable
v-model="formData.sjh" v-model="formData.tel"
placeholder="请输入联系电话" placeholder="请输入联系电话"
/> />
<!--获取省市区县--->
<wd-input <wd-input
label="所在地区" label="所在地区"
label-width="100px" label-width="100px"
v-model="formData.szdq" v-model="formData.area"
prop="szdq" prop="area"
readonly readonly
placeholder="请选择所在地区" placeholder="请选择所在地区"
@click="getLocationFn" @click="chooseShopPosition"
/> />
<wd-input <wd-input
label="详细地址" label="详细地址"
label-width="100px" label-width="100px"
prop="xxdz" prop="shopAddress"
clearable clearable
v-model="formData.xm" v-model="formData.shopAddress"
placeholder="请输入详细地址" placeholder="请输入详细地址"
/> />
<wd-input <!--<wd-input
label="小区/学校" label="小区/学校"
label-width="100px" label-width="100px"
v-model="formData.szdq" v-model="formData.szdq"
...@@ -54,99 +55,165 @@ ...@@ -54,99 +55,165 @@
readonly readonly
placeholder="请选择" placeholder="请选择"
@click="getLocationFn" @click="getLocationFn"
/> />-->
<view class="flex"> <view class="flex">
<view class="logo">LOGO/门头照</view> <view class="logo">LOGO/门头照</view>
<view class="shopLogobox">
<wd-upload <wd-upload
:file-list="fileList1" :file-list="fileListShopLogo"
image-mode="aspectFill" image-mode="aspectFill"
:action="action" :action="action"
@change="handleChange1" @change="handleLogoFileChange"
:limit="1" :limit="1"
class="img1" class="img1"
:header="headers"
:before-remove="beforeRemove"
></wd-upload> ></wd-upload>
<view class="errormsg" v-if="shopLogoNull">LOGO/门头照未上传</view>
</view>
</view> </view>
<view class="flex"> <view class="flex">
<view class="logo">营业执照</view> <view class="logo">营业执照</view>
<view class="shopLogobox">
<wd-upload <wd-upload
:file-list="fileList1" :file-list="fileListQualifications"
image-mode="aspectFill" image-mode="aspectFill"
:action="action" :action="action"
@change="handleChange1" @change="handleQualificationsChange"
:limit="1" :limit="1"
class="img1" class="img1"
:header="headers"
:before-remove="beforeRemove"
></wd-upload> ></wd-upload>
<view class="errormsg" v-if="qualificationsNull">营业执照未上传</view>
</view> </view>
<view class="flex"> </view>
<view class="flex flexcard">
<view class="logo">身份证照</view> <view class="logo">身份证照</view>
<view class="cardblock">
<wd-upload <wd-upload
:file-list="fileList1" :file-list="fileListCardForward"
image-mode="aspectFill" image-mode="aspectFill"
:action="action" :action="action"
@change="handleChange1" @change="handleIndentityForwardChange"
:limit="1" :limit="1"
class="img1" :header="headers"
:before-remove="beforeRemove"
></wd-upload> ></wd-upload>
<view class="errormsg" v-if="cardForwardNull">正面照未上传</view>
</view>
<view class="cardblock">
<wd-upload
:file-list="fileListCardBackward"
image-mode="aspectFill"
:action="action"
@change="handleIndentityBackwardChange"
:limit="1"
:header="headers"
:before-remove="beforeRemove"
></wd-upload>
<view class="errormsg" v-if="cardBackwardNull">反面照未上传</view>
</view>
</view>
<view class="flex flexcenter">
<view class="logo">店铺分类{{ chooseCategory.categoryId }}</view>
<view class="shopcatebox">
<view class="text shopcateboxtxt" @click="showclass">
<template v-if="choosedShopInfo.length != 0">
<wd-tag
v-for="(item, index) in choosedShopInfo"
:key="index"
type="danger"
round
>
{{ item.areaName }}
</wd-tag>
</template>
<template v-else>请选择</template>
</view>
<view class="newAddCertification">
<view class="citem" v-for="(item, index) in choosedShopInfo" :key="index">
<text class="titleOfC">请上传{{ item.areaName }}相关经营许可证</text>
<wd-upload <wd-upload
:file-list="fileList1" :file-list="testFileList[item.areaId]"
image-mode="aspectFill" image-mode="aspectFill"
:action="action" :action="action"
@change="handleChange1" @change="handleCategoyChange($event, item.areaId)"
:limit="1" :limit="1"
class="img1" class="img1"
:header="headers"
:before-remove="beforeRemove"
></wd-upload> ></wd-upload>
</view> </view>
<view class="flex"> </view>
<view class="logo">店铺分类</view> <text class="text errormsg" v-if="isCategoryNull">店铺分类未选择</text>
<view class="text" @click="showclass">请选择</view> </view>
</view> </view>
<wd-textarea <wd-textarea
placeholder="请填写评价" placeholder="请填写店铺介绍"
label="店铺介绍" label="店铺介绍"
clearable
label-width="100px" label-width="100px"
v-model="formData.szdq" v-model="formData.intro"
prop="szdq" prop="intro"
/> />
<button type="primary" style="width: 80%">提交</button> <wd-button type="error" width="80%" class="submitBTN" @tap="submitData">提交</wd-button>
</wd-cell-group> </wd-cell-group>
<wd-popup <wd-popup
v-model="show" v-model="show"
position="bottom" position="bottom"
custom-style="height:300px;overflow:auto;" custom-style="height:500px;overflow:auto;"
@close="handleClose" @close="handleClose"
> >
<view class="hcontent"> <view class="hcontent">
<view class="flex1"> <view class="flex1">
<view class="text">取消</view> <view class="text" @tap="handleClose">取消</view>
<view class="text">请选择</view> <view class="text">请选择</view>
<view class="text">确定</view> <view class="text" @tap="chooseCategory">确定</view>
</view> </view>
<view class="nr"> <view class="nr">
<view class="left"> <view class="left">
<view class="name">周边美食</view> <template v-for="(item, index) in shopCategoryTree" :key="index">
<view class="name">周边美食</view> <view
<view class="name">周边美食</view> class="name"
<view class="name">周边美食</view> @tap="setActiveCategory(index)"
<view class="name">周边美食</view> :class="{ active: categoryActiveIndex == index }"
<view class="name">周边美食</view> >
<view class="name">周边美食</view> {{ item.name }}
<view class="name">周边美食</view> </view>
<view class="name">周边美食</view> </template>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
<view class="name">周边美食</view>
</view> </view>
<view class="right"> <view class="right">
<view class="item"> <template v-for="(item, index) in shopCategoryTree" :key="index">
<view class="hname">生活用品</view> <view class="item" v-show="categoryActiveIndex == index">
<view
v-for="item1 in shopCategoryTree[index].children"
:key="item1.areaId"
class="miniitem"
>
<view class="hname">
{{ item1.name }}
</view>
<view class="hnr"> <view class="hnr">
<wd-tag round>标签</wd-tag> <template v-for="sitem in item1.children" :key="sitem.areaId">
<wd-tag round>标签</wd-tag> <wd-tag
<wd-tag round>标签</wd-tag> class="tagstyle"
<wd-tag round>标签</wd-tag> :class="{
active: choosedShopInfo.some(
(item) => item.areaId === sitem.areaId,
),
}"
round
@tap="chooseShopType(sitem.areaId, sitem.name)"
>
{{ sitem.name }}
</wd-tag>
</template>
</view>
</view> </view>
</view> </view>
</template>
</view> </view>
</view> </view>
</view> </view>
...@@ -158,8 +225,163 @@ ...@@ -158,8 +225,163 @@
</template> </template>
<script setup> <script setup>
import Header from '@/pages/order/components/Header/index.vue'; import Header from '@/pages/order/components/Header/index.vue';
import { reactive, ref } from 'vue'; import { getToken } from '@/utils/auth';
const promotionlist = ref([ import { ref, reactive } from 'vue';
import { sgyrShopCategory, applyShop, editShop } from '@/api/shop';
// 用户选择的分类
const choosedShopInfo = ref([]);
// 确保choosedShopInfo内是用户最新选择的分类
const chooseShopType = (id, name) => {
let hasSameData = false;
choosedShopInfo.value.forEach((item) => {
if (item.areaId === id) {
hasSameData = true;
}
});
if (!hasSameData) {
choosedShopInfo.value.push({ areaId: id, areaName: name });
} else {
choosedShopInfo.value = choosedShopInfo.value.filter((item) => {
return item.areaId !== id;
});
}
};
const beforeRemove = ({ file, fileList, resolve }) => {
xma.showModal({
title: '提示',
content: '确定删除图片' + file.name + '吗',
success: function (res) {
if (res.confirm) {
xma.showToast({ title: '删除成功', duration: 2000 });
console.log(fileList);
resolve(true);
} else if (res.cancel) {
xma.showToast({ title: '取消删除操作', duration: 2000 });
}
},
});
};
const token = getToken();
// 上传图片地址
const action = ref(import.meta.env.VITE_APP_BASE_URL + '/sgyrdd/file/update');
const headers = ref('');
// const fileDomain = import.meta.env.VITE_APP_IMG_URL;
// 店铺logo图片组
const fileListShopLogo = ref([]);
// 身份证正面图片组
const fileListCardForward = ref([]);
// 身份证反面图片组
const fileListCardBackward = ref([]);
// 店铺资质图片组
const fileListQualifications = ref([]);
// 门头图片上传是否为空
const shopLogoNull = ref(false);
// 身份证正面上传是否为空
const cardForwardNull = ref(false);
// 身份证反面上传是否为空
const cardBackwardNull = ref(false);
// 资质图片上传是否为空
const qualificationsNull = ref(false);
/**
* 图片地址处理
*/
const processingImageAddresses = (fileList) => {
const data = fileList.value.map((item) => {
return JSON.parse(item.response).data.url;
});
return data.join(',');
};
const processingImageAddresses1 = (fileList) => {
const data = fileList.map((item) => {
return JSON.parse(item.response).data.url;
});
return data.join(',');
};
const categoryShopsList = ref({});
const testFileList = ref([]);
const handleCategoyChange = ({ fileList: files }, val) => {
testFileList.value[val] = files;
categoryShopsList.value[val] = processingImageAddresses1(testFileList.value[val]);
};
const handleLogoFileChange = ({ fileList: files }) => {
if (files.length > 0) {
shopLogoNull.value = false;
fileListShopLogo.value = files;
formData.shopLogo = processingImageAddresses(fileListShopLogo);
} else {
shopLogoNull.value = true;
fileListShopLogo.value = [];
}
};
const handleIndentityForwardChange = ({ fileList: files }) => {
if (files.length > 0) {
cardForwardNull.value = false;
fileListCardForward.value = files;
shopPersonalInformation.identityCardFront = processingImageAddresses(fileListCardForward);
} else {
cardForwardNull.value = true;
fileListCardForward.value = [];
}
};
const handleIndentityBackwardChange = ({ fileList: files }) => {
if (files.length > 0) {
cardBackwardNull.value = false;
fileListCardBackward.value = files;
shopPersonalInformation.identityCardReverse = processingImageAddresses(fileListCardBackward);
} else {
cardBackwardNull.value = true;
fileListCardBackward.value = [];
}
};
const handleQualificationsChange = ({ fileList: files }) => {
if (files.length > 0) {
qualificationsNull.value = false;
fileListQualifications.value = files;
categoryShops.qualifications = processingImageAddresses(fileListQualifications);
} else {
qualificationsNull.value = true;
fileListQualifications.value = [];
}
};
const shopCategoryTree = ref([]);
const categoryActiveIndex = ref(0);
const isNewFlag = ref(true);
onLoad((options) => {
headers.value = { Authorization: 'Bearer ' + token };
getShopCategoryFun();
if (options.content === 0) {
isNewFlag.value = false;
}
});
const getShopCategoryFun = async () => {
const res = await sgyrShopCategory();
shopCategoryTree.value = res.data;
// console.log(shopCategoryTree.value);
};
const applyShopFun = async (data) => {
const res = await applyShop(data);
console.log(res);
};
const editShopFun = async (data) => {
const res = await editShop(data);
console.log(res);
};
const setActiveCategory = (index) => {
console.log(index);
categoryActiveIndex.value = index;
choosedShopArr.value = [];
};
/* const promotionlist = ref([
{ {
value: '1', value: '1',
label: '连锁直营', label: '连锁直营',
...@@ -168,17 +390,49 @@ const promotionlist = ref([ ...@@ -168,17 +390,49 @@ const promotionlist = ref([
value: '2', value: '2',
label: '连锁加盟', label: '连锁加盟',
}, },
]); ]); */
const show = ref(false); const show = ref(false);
const fileList = ref([ const handleClose = () => {
{ show.value = false;
url: '1', // choosedShopInfo.value = [];
}, // categoryShopsList.value = {};
]); // testFileList.value = [];
// choosedShopArr.value = [];
};
let originChooseCategoryLength = 0;
const chooseCategory = () => {
show.value = false;
// 对新增资质上传,添加动态变量绑定
if (choosedShopInfo.value.length > originChooseCategoryLength) {
for (let i = originChooseCategoryLength; i < choosedShopInfo.value.length; i++) {
testFileList.value[choosedShopInfo.value[i].areaId] = [];
// testFileList.value.push({ areaId: choosedShopInfo.value[i].areaId, arr: [] });
}
originChooseCategoryLength = choosedShopInfo.value.length;
}
// 对于移除资质上传,重新匹配choosedShopInfo和categoryShopsList的值
// choosedShopInfo [{ areaId: id, areaName: name },{ areaId: id, areaName: name }]
// categoryShopsList {'3235':'xxxxx','3699':'yyyy'}
for (const key in categoryShopsList.value) {
let hasThisKey = false;
for (let i = 0; i < choosedShopInfo.value.length; i++) {
if (choosedShopInfo.value[i].areaId === key) {
hasThisKey = true;
}
}
if (!hasThisKey) {
delete categoryShopsList.value[key];
}
}
console.log(choosedShopInfo.value);
console.log(categoryShopsList.value);
};
const showclass = () => { const showclass = () => {
show.value = true; show.value = true;
}; };
const isCategoryNull = ref(false);
function chooseImage({ fileList: files }) { function chooseImage({ fileList: files }) {
xma.chooseImage({ xma.chooseImage({
count: 6, // 默认9 count: 6, // 默认9
...@@ -189,35 +443,159 @@ function chooseImage({ fileList: files }) { ...@@ -189,35 +443,159 @@ function chooseImage({ fileList: files }) {
}, },
}); });
} }
const formData = ref({
systemCode: 'one-centre', const shopDetail = reactive({
promotion: '', shopName: '', // 店铺名称
xm: '', intro: '', // 店铺简介
sfz: '', tel: '', // 联系电话
sjh: '', shopLat: 0.0, // 店铺所在纬度
szdq: '', shopLng: 0.0, // 店铺所在经度
xxdz: '', shopAddress: '', // 店铺详细地址
province: '贵州', // 省份
city: '贵阳', // 城市
area: '南明', // 区县
shopLogo: '', // 店铺LOGO
transactionStart: '', // 营业开始时间
transactionEnd: '', // 营业结束时间
communities: [], // 绑定小区
});
const shopPersonalInformation = reactive({
identityCardFront: '', // 身份证正面
identityCardReverse: '', // 身份证反面
});
const categoryShops = reactive({
categoryId: '3237', // 分类id
qualifications: '', // 经营资质图片,以,分割
});
const formData = reactive({
shopName: '我是店铺名称', // 店铺名称
intro: '我是店铺简介', // 店铺简介
tel: '13699999999', // 联系电话
shopLat: 0.0, // 店铺所在纬度
shopLng: 0.0, // 店铺所在经度
shopAddress: '', // 店铺详细地址
province: '贵州', // 省份
city: '贵阳', // 城市
area: '南明', // 区县
shopLogo: '', // 店铺LOGO
transactionStart: '', // 营业开始时间
transactionEnd: '', // 营业结束时间
communities: [], // 绑定小区
}); });
const form = ref(); const form = ref();
const test = ref();
const rules = ref({ const rules = ref({
promotion: [{ required: true, message: '请选择' }], shopName: [
xm: [{ required: true, message: '请输入店铺名称' }], {
sjh: [{ required: true, message: '请输入联系电话' }], required: true,
szdq: [{ required: true, message: '请选择' }], message: '店铺名称不能为空',
xxdz: [{ required: true, message: '请输入详细地址' }], },
],
tel: [
{
required: true,
message: '请输入联系电话',
},
{
pattern: /^1[3-9]\d{9}$/,
message: '请输入正确的手机号',
},
],
intro: [{ required: true, message: '请填写店铺介绍' }],
shopAddress: [{ required: true, message: '请输入详细地址' }],
area: [{ required: true, message: '请选择地区' }],
}); });
const shopDetail = ref({ /* const shopDetail = ref({
shopAddress: '', shopAddress: '',
}); }); */
const chooseShopPosition = async () => {
const res = await getLocationFn();
formData.shopAddress = res.address;
formData.shopLat = res.lat;
formData.shopLng = res.lon;
console.log(res);
console.log(formData.shopLat, formData.shopLng);
};
const getLocationFn = () => { const getLocationFn = () => {
return new Promise((resolve, reject) => {
xma.chooseLocation({ xma.chooseLocation({
success: function (res) { success: function (res) {
console.log('位置名称:' + res.name); resolve({ lat: res.latitude, lon: res.longitude, name: res.name, address: res.address });
console.log('详细地址:' + res.address); },
console.log('纬度:' + res.latitude); fail: function (err) {
console.log('经度:' + res.longitude); return err;
}, },
}); });
});
/* xma.chooseLocation({
success: function (res) {
console.log(res);
// console.log('位置名称:' + res.name);
// console.log('详细地址:' + res.address);
// console.log('纬度:' + res.latitude);
// console.log('经度:' + res.longitude);
formData.value.shopAddress = res.address;
formData.value.shopLat = res.latitude;
formData.value.shopLng = res.longitude;
},
}); */
};
const submitData = () => {
categoryShops.categoryId === '' ? (isCategoryNull.value = true) : (isCategoryNull.value = false);
fileListShopLogo.value.length === 0 ? (shopLogoNull.value = true) : (shopLogoNull.value = false);
fileListCardForward.value.length === 0
? (cardForwardNull.value = true)
: (cardForwardNull.value = false);
fileListCardBackward.value.length === 0
? (cardBackwardNull.value = true)
: (cardBackwardNull.value = false);
fileListQualifications.value.length === 0
? (qualificationsNull.value = true)
: (qualificationsNull.value = false);
const dealCategoryData = ref([]);
for (let i = 0; i < choosedShopInfo.value.length; i++) {
dealCategoryData.value.push({
categoryId: choosedShopInfo.value[i].areaId,
qualifications: categoryShopsList.value[choosedShopInfo.value[i].areaId] || '',
});
}
console.log(dealCategoryData.value);
form.value
.validate()
.then(({ valid, errors }) => {
if (valid) {
console.log('成功');
console.log(formData);
if (isNewFlag.value) {
applyShopFun({
shopDetail: formData,
shopPersonalInformation,
categoryShops: dealCategoryData.value,
});
} else {
editShopFun({
shopDetail: formData,
shopPersonalInformation,
categoryShops: dealCategoryData.value,
});
}
}
})
.catch((error) => {
console.log(error, 'error');
});
}; };
</script> </script>
...@@ -235,6 +613,12 @@ page { ...@@ -235,6 +613,12 @@ page {
border: 1px solid #d5d1d1; border: 1px solid #d5d1d1;
} }
.submitBTN {
display: block;
width: 80%;
margin: 20rpx auto;
}
.wd-tag { .wd-tag {
margin-left: 15rpx; margin-left: 15rpx;
} }
...@@ -249,7 +633,7 @@ page { ...@@ -249,7 +633,7 @@ page {
width: 100%; width: 100%;
justify-content: space-between; justify-content: space-between;
box-sizing: border-box; box-sizing: border-box;
border-bottom: 1px solid #ccc; border-bottom: 1rpx solid #ccc;
background: #fff; background: #fff;
z-index: 6; z-index: 6;
} }
...@@ -259,21 +643,37 @@ page { ...@@ -259,21 +643,37 @@ page {
display: flex; display: flex;
.left { .left {
background: #ebe7e7; background: rgb(244, 244, 244);
width: 33%; width: 28%;
height: 100%; height: 100%;
overflow-y: auto; position: fixed;
.name { .name {
text-align: center; text-align: left;
padding-left: 20rpx;
height: 40px; height: 40px;
line-height: 40px; line-height: 40px;
} }
.name.active {
background: #fff;
}
} }
.right { .right {
background: #fff; background: #fff;
width: 67%; width: 72%;
position: fixed;
left: 28%;
height: 100%;
overflow-y: auto;
.item {
height: auto;
padding: 10rpx 0px 40rpx 0px;
.miniitem {
margin-bottom: 40rpx;
.hname { .hname {
font-size: 14px; font-size: 14px;
...@@ -281,6 +681,19 @@ page { ...@@ -281,6 +681,19 @@ page {
padding-bottom: 10px; padding-bottom: 10px;
border-bottom: 1px solid #ccc; border-bottom: 1px solid #ccc;
} }
.hnr {
.tagstyle {
margin-bottom: 10rpx;
&.active {
color: #fa4350;
border: 1px solid #fa4350;
}
}
}
}
}
} }
} }
} }
...@@ -288,18 +701,25 @@ page { ...@@ -288,18 +701,25 @@ page {
.container { .container {
width: 375 * 2rpx; width: 375 * 2rpx;
margin: 0 auto; margin: 0 auto;
height: 100vh;
overflow-y: auto; overflow-y: auto;
padding-bottom: 40rpx; padding-bottom: 40rpx;
.content { .content {
padding-top: 88rpx; padding-top: 88rpx;
padding-bottom: 44rpx;
} }
.formmain { .formmain {
background: #f3f3f3; background: #f3f3f3;
} }
.flex.flexcard {
.cardblock {
margin-right: 20rpx;
}
}
.flex { .flex {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
...@@ -309,10 +729,17 @@ page { ...@@ -309,10 +729,17 @@ page {
.text { .text {
margin-left: 16px; margin-left: 16px;
width: 60%; width: 100%;
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px)); font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
color: var(--wot-input-placeholder-color, #bfbfbf); color: var(--wot-input-placeholder-color, #bfbfbf);
} }
.text.shopcateboxtxt {
margin-left: 0px;
}
.text.errormsg {
color: #fa4350;
}
.logo { .logo {
position: relative; position: relative;
...@@ -321,6 +748,7 @@ page { ...@@ -321,6 +748,7 @@ page {
display: inline-block; display: inline-block;
font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px)); font-size: var(--wot-input-fs, var(--wot-cell-title-fs, 14px));
line-height: var(--wot-cell-line-height, 24px); line-height: var(--wot-cell-line-height, 24px);
width: 100px;
&::after { &::after {
position: absolute; position: absolute;
...@@ -334,7 +762,24 @@ page { ...@@ -334,7 +762,24 @@ page {
} }
.img1 { .img1 {
margin-left: 16px; margin-right: 16px;
}
.errormsg {
font-size: 24rpx;
padding-left: 5rpx;
color: #fa4350;
}
}
}
.newAddCertification {
margin-top: 40rpx;
.citem {
margin-bottom: 20rpx;
.titleOfC {
margin-bottom: 10rpx;
display: block;
} }
} }
} }
......
...@@ -72,7 +72,7 @@ const getList = async () => { ...@@ -72,7 +72,7 @@ const getList = async () => {
}; };
const shopGto = (item) => { const shopGto = (item) => {
xma.navigateTo({ xma.navigateTo({
url: `/pages/storeEntry/detail${item ? `?content=0` : ''}`, url: `/pages/storeEntry/detail${item ? `?content=${JSON.stringify(item)}` : ''}`,
success: function (res) { success: function (res) {
// 通过eventChannel向被打开页面传送数据 // 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('acceptDataFromOpenerPage', { data: item }); res.eventChannel.emit('acceptDataFromOpenerPage', { data: item });
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment