Commit bb363da5 authored by 石建新(贵阳日报)'s avatar 石建新(贵阳日报)
parents 699d3123 60d8f83d
......@@ -8,27 +8,17 @@
:class="{ active: selectedItem === index }"
@tap="selectItem(index)"
>
{{ item }}
{{ item.name }}
</li>
</ul>
</view>
</template>
<script setup>
import { defineProps } from 'vue';
const items = reactive([
'智能排序',
'距离优先',
'好评优先',
'销量优先',
'低价优先',
'低价优先',
'距离优先',
'好评优先',
'销量优先',
'低价优先',
'距离优先',
]);
import { defineProps, onMounted } from 'vue';
import { getTour } from '@/api/assistingAgriculture/village';
const items = ref([]);
const emit = defineEmits(['sortParams']);
const selectedItem = ref(null);
const props = defineProps({
width: {
......@@ -36,8 +26,18 @@ const props = defineProps({
default: '100%',
},
});
const selectItem = (selectItem) => {
selectedItem.value = selectItem;
onMounted(async () => {
getTourList();
});
const selectItem = (index, item) => {
selectedItem.value = index;
emit('sortParams', item);
};
// 查询景点
const getTourList = () => {
getTour().then((res) => {
console.log(res, 111);
});
};
</script>
......
......@@ -7,7 +7,7 @@
:class="{ active: selectedItem === index }"
@tap="selectItem(index)"
>
{{ item }}
{{ item.name }}
</li>
</ul>
</view>
......@@ -15,7 +15,14 @@
<script setup>
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 props = defineProps({
width: {
......@@ -23,8 +30,9 @@ const props = defineProps({
default: '100%',
},
});
const selectItem = (selectItem) => {
selectedItem.value = selectItem;
const selectItem = (index, item) => {
selectedItem.value = index;
emit('sortParams', item);
};
</script>
......
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({
url: '/sgyrdd/useraddr/add',
method: 'GET',
method: 'post',
data,
});
}
// 修改收货地址
export async function updateAddress() {
export async function updateAddress(data) {
return request({
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) {
data,
});
}
// 申请成为商家
export function editShop(data) {
return request({
url: `/sgyrdd/shop/update`,
method: 'POST',
data,
});
}
......@@ -16,4 +16,3 @@ export function applyShop(data) {
data,
});
}
{
"name" : "",
"appid" : "",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"name": "",
"appid": "",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App特有相关 */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* 模块配置 */
"modules" : {},
"modules": {},
/* 应用发布信息 */
"distribute" : {
"distribute": {
/* android打包配置 */
"android" : {
"permissions" : [
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
......@@ -41,42 +41,49 @@
]
},
/* ios打包配置 */
"ios" : {},
"ios": {},
/* SDK配置 */
"sdkConfigs" : {}
"sdkConfigs": {}
}
},
/* 快应用特有相关 */
"quickapp" : {},
"quickapp": {},
/* 小程序特有相关 */
"mp-weixin" : {
"appid" : "",
"setting" : {
"urlCheck" : false
"mp-weixin": {
"appid": "",
"setting": {
"urlCheck": false
},
"usingComponents" : true
"usingComponents": true
},
"mp-alipay" : {
"usingComponents" : true
"mp-alipay": {
"usingComponents": true
},
"mp-baidu" : {
"usingComponents" : true
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao" : {
"usingComponents" : true
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion" : "3",
"h5" : {
"router" : {
"base" : "./",
"mode" : "hash"
"vueVersion": "3",
"h5": {
"router": {
"base": "./",
"mode": "hash"
},
"optimization" : {
"treeShaking" : {
"enable" : true
"optimization": {
"treeShaking": {
"enable": true
}
},
"sdkConfigs": {
"maps": {
"qqmap": {
"key": "MN4BZ-7JXKW-2RYRD-32QGF-AHONV-PAFUN"
}
}
}
}
......
......@@ -3,13 +3,13 @@
<Header :title="newAddressFlag ? '新增收货地址' : '编辑收货地址'"></Header>
<view class="content">
<wd-form ref="form" :model="model" id="form">
<wd-form ref="reForm" :model="forMData" id="form">
<wd-cell-group>
<wd-input
label="联系人"
label-width="80px"
prop="receiver"
v-model="model.receiver"
v-model="forMData.receiver"
placeholder="请输入联系人姓名"
:rules="[{ required: false, validator: fieldNotEmpty, message: '姓名不能为空' }]"
/>
......@@ -17,43 +17,36 @@
label="手机号"
label-width="80px"
prop="mobile"
v-model="model.mobile"
v-model="forMData.mobile"
placeholder="请输入联系人手机号"
: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">
<view class="area">
<view class="area_l" @tap="changeLocation">
<view class="area_lt">这是当前定位</view>
<view class="area_lb">这是定位的详细地址点击可跳转地图选择</view>
<view class="area_l">
<view class="area_lt">当前定位</view>
<view class="area_lb">{{ forMData.city }}</view>
</view>
<view class="area_r">
<wd-icon name="location" size="22px" @tap="changeLocation"></wd-icon>
<wd-icon name="location" size="22px" @tap="changeLocation" />
</view>
</view>
</wd-cell>
</wd-checkbox-group>
<wd-checkbox-group v-model="model.commonAddr" size="large">
<wd-cell title="设置为默认地址" center clickable @tap="setDefaultAddress">
<wd-input
label="详细地址"
label-width="80px"
prop="addr"
v-model="forMData.addr"
placeholder="请输入详细地址"
:rules="[{ required: false, validator: fieldNotEmpty, message: '详细地址不能为空' }]"
/>
<wd-cell title="设置为默认地址" center>
<view>
<wd-checkbox
modelValuee="1"
ref="checkBoxAdress"
checked-color="#fa5151"
custom-style="margin-right:-18rpx"
></wd-checkbox>
<wd-checkbox v-model="forMData.commonAddr" prop="commonAddr" />
</view>
</wd-cell>
</wd-checkbox-group>
</wd-cell-group>
<view class="footer">
......@@ -67,63 +60,54 @@
<script setup>
import Header from '@/pages/order/components/Header/index.vue';
import { addAddress, updateAddress, deleteAddress } from '@/api/address';
const fileDomain = import.meta.env.VITE_APP_IMG_URL;
const newAddressFlag = ref(false);
const form = ref();
const reForm = ref();
const checkBoxAdress = ref();
const model = ref({
name: '',
phone: '',
detailAddress: '',
isDefaultAddress: [],
const forMData = ref({
receiver: '',
mobile: '',
province: '',
city: '',
area: '',
addr: '',
lng: '',
lat: '',
commonAddr: false,
});
onLoad((options) => {
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) {
if (String(val).length >= 1) {
if (val.length >= 1) {
return true;
} else {
return false;
}
}
const submit = async () => {
const res = await addAddress(model.value);
console.log(res);
const hdSubmit = async () => {
await addAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
});
};
function handleSubmit() {
form.value
console.log('model的值', reForm.value);
reForm.value
.validate()
.then(({ valid, errors }) => {
.then(({ valid }) => {
if (valid) {
xma.showToast({
title: '更新成功',
duration: 2000,
success: function () {
console.log('数据更新后跳转地址列表页');
},
});
hdSubmit();
// xma.showToast({
// title: '提交成功',
// duration: 2000,
// success: function () {
// console.log('数据更新后跳转地址列表页');
// },
// });
}
})
.catch((error) => {
......@@ -131,8 +115,23 @@ function handleSubmit() {
});
}
// 重新定位收货地址
function changeLocation() {
console.log('aaa');
async function changeLocation() {
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>
......
......@@ -55,17 +55,13 @@
:scroll-with-animation="true"
@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-->
<!-- class="img-icon"-->
<!-- src="/static/assistingAgriculture/rural/icon.png"-->
<!-- style="width: 118rpx; height: 32rpx"-->
<!-- />-->
<image
class="test5"
src="/static/assistingAgriculture/rural/img4.png"
mode="widthFix"
/>
<image class="test5" :src="item.imgUrl" mode="widthFix" />
</view>
</scroll-view>
<!-- 列表-->
......@@ -162,7 +158,13 @@ import Sort from '../../../components/assistingAgriculture/index/Sort.vue';
import DepartureDate from '../../../components/assistingAgriculture/index/DepartureDate.vue';
import ScenicSpots from '../../../components/assistingAgriculture/index/ScenicSpots.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 rotate2 = ref(false);
const rotate3 = ref(false);
......@@ -209,6 +211,7 @@ const cardList = ref([
price: '299.00',
},
]);
const popularRouterData = ref([]);
const locationFiltering = (index) => {
switch (index) {
case 0:
......@@ -237,6 +240,21 @@ const locationFiltering = (index) => {
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() {
// TODO: 跳转到线路详情
xma.navigateTo({
......
......@@ -127,24 +127,33 @@ const getSelectedItems = () => {
return acc.concat(selectedProducts);
}, []);
};
// 跳转到结算页面方法
function toSettle() {
const selected = getSelectedItems();
if (selected.length > 0) {
console.log('Selected items:', selected);
if (selected.length === 0) {
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(',');
console.log('Basket IDs:', basketIds);
// TODO: 跳转到结算页面
xma.navigateTo({
url: `/pages/assistingAgriculture/cart/ConfirmOrder?ids=${basketIds}`,
});
} else {
xma.showToast({
title: '请选择需要结算的商品!',
icon: 'none',
});
}
}
// 跳转店铺主页
const toStore = (item) => {
xma.navigateTo({
......
......@@ -134,7 +134,8 @@ const dataDetails = ref({});
const commentData = ref({});
const subscript = ref(0);
onLoad((options) => {
prodId = '43834';
// prodId = '43834';
prodId = options.prodId;
getProdDetailFn();
getEvalNumberFn();
getshoppingCartListFn();
......@@ -400,6 +401,7 @@ page {
top: -8rpx;
padding-bottom: 120rpx;
.content {
margin-top: 30rpx;
.desc {
img {
width: 100%;
......
......@@ -64,7 +64,12 @@
style="position: relative; float: right; top: -42rpx"
></wd-icon>
<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>
<!-- tabs-->
......@@ -93,7 +98,7 @@
:key="index"
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="price-page">
<text class="price">{{ item.price }}</text>
......@@ -181,7 +186,6 @@ const choice = (index, item) => {
testData.value.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.pic;
whh.value = getSlashValue(item.content);
console.log(whh.value, 333);
});
light.value = index;
};
......@@ -202,10 +206,10 @@ function handleClick(e) {
function onChange(e) {
console.log(e);
}
function toDetail() {
function toDetail(item) {
// TODO: 跳转到详情页
xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail',
url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
});
}
function toCart() {
......
......@@ -32,7 +32,7 @@
</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 class="page-title">{{ item.categoryName }}</view>
<img :src="item.img" class="main-img" />
......@@ -41,7 +41,7 @@
class="detail-border"
v-for="(item, index) in item.commodityList"
:key="index"
@click="toDetail"
@click="toDetail(item)"
>
<img :src="item.commodityImg" style="width: 216rpx; height: 176rpx" />
<view class="detail-title">{{ item.prodName }}</view>
......@@ -73,23 +73,6 @@ const swiperList = ref([]);
const current = ref(0);
// 轮播图数据
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 () => {
getList();
getPresaleCategoryList();
......@@ -120,7 +103,6 @@ const getPresaleCategoryList = () => {
// 预售板块轮播图
const getPresale = () => {
getPresaleList({ place: 'index_top' }).then((res) => {
console.log(res, 111);
res.data.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl;
});
......@@ -153,10 +135,10 @@ const toBuilding = (item) => {
}
};
// 跳转详情页
function toDetail() {
function toDetail(item) {
// TODO: 跳转到详情页
xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail',
url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
});
}
</script>
......
......@@ -47,7 +47,7 @@
</text>
</scroll-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" />
<view>
<text class="retail-price">零售价:¥{{ item.oriPrice }}/盒</text>
......@@ -71,7 +71,7 @@
</view>
<view class="waterfall">
<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">
<image :src="good.img" mode="widthFix" style="border-radius: 16rpx"></image>
<image
......@@ -148,13 +148,11 @@ const params = {
const tabsList = ref([]);
onMounted(async () => {
getPresale();
// getPresaleProd();
presaleSortList();
});
// 预售板块轮播图
const getPresale = () => {
getPresaleList({ place: 'presale' }).then((res) => {
console.log(res, 111);
res.data.forEach((item) => {
item.imgUrl = import.meta.env.VITE_APP_IMG_URL + item.imgUrl;
});
......@@ -216,11 +214,6 @@ const choice = (index, categoryId) => {
});
light.value = index;
};
// 点击商品 跳转详情
function ToDetail(id) {
console.log('点击了商品', id);
}
function handleClick(e) {
console.log(e);
}
......@@ -233,15 +226,12 @@ function toCart() {
url: '/pages/assistingAgriculture/cart/cart',
});
}
function toDetail() {
// TODO: 跳转到筑农严选
function toDetail(item) {
// TODO: 跳转到详情页
xma.navigateTo({
url: '/pages/assistingAgriculture/detail/detail',
url: `/pages/assistingAgriculture/detail/detail?prodId=${item.prodId}`,
});
}
function toTab(item) {
console.log(item, 222);
}
</script>
<style lang="scss" scoped>
......
......@@ -20,22 +20,21 @@
/>
</view>
</view>
</view>
<wd-tabs v-model="tab">
<block>
<wd-tab title="商品">
<view class="content">内容1</view>
</wd-tab>
<wd-tab title="店铺">
<view class="content">内容2</view>
<block v-for="(item, index) in tabs" :key="index">
<wd-tab :title="item">
<view class="content" v-show="tab === 0">内容1</view>
<view class="content" v-show="tab === 1">内容2</view>
</wd-tab>
</block>
</wd-tabs>
</view>
</template>
<script setup>
function toSearch(keyword) {}
const tab = ref(0);
const tabs = ref(['商品', '店铺']);
</script>
<style lang="scss" scoped>
......@@ -43,23 +42,6 @@ page {
background: #f6f6f6;
}
.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 {
width: 100%;
height: 124rpx;
......@@ -103,4 +85,13 @@ page {
gap: 20rpx;
}
}
:deep(.wd-tabs__line) {
background-color: #e9231b;
bottom: 2px;
}
.content {
line-height: 120px;
text-align: center;
background: #f6f6f6;
}
</style>
This diff is collapsed.
......@@ -72,7 +72,7 @@ const getList = async () => {
};
const shopGto = (item) => {
xma.navigateTo({
url: `/pages/storeEntry/detail${item ? `?content=0` : ''}`,
url: `/pages/storeEntry/detail${item ? `?content=${JSON.stringify(item)}` : ''}`,
success: function (res) {
// 通过eventChannel向被打开页面传送数据
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