Commit 610a21c4 authored by 张娇(东信)'s avatar 张娇(东信)

Merge remote-tracking branch 'origin/master'

parents 493cd4a5 efdd8151
...@@ -20,7 +20,7 @@ export async function updateAddress(data) { ...@@ -20,7 +20,7 @@ export async function updateAddress(data) {
export async function deleteAddress(addrId) { export async function deleteAddress(addrId) {
return request({ return request({
url: `/sgyrdd/useraddr/delete/${addrId}`, url: `/sgyrdd/useraddr/delete/${addrId}`,
method: 'GET', method: 'POST',
}); });
} }
// 查询收货地址列表 // 查询收货地址列表
......
import { request } from '../utils/request';
// 查询商家相册列表
export function getPhoto(data) {
return request({
url: `/sgyrdd/photo/getPhoto`,
method: 'GET',
data,
});
}
...@@ -79,9 +79,11 @@ const forMData = ref({ ...@@ -79,9 +79,11 @@ const forMData = ref({
lat: '', lat: '',
commonAddr: false, commonAddr: false,
}); });
const content = ref([]);
onLoad((options) => { onLoad((options) => {
newAddressFlag.value = options.new; newAddressFlag.value = options.new;
content.value = JSON.parse(options.content);
forMData.value = content.value;
}); });
function fieldNotEmpty(val) { function fieldNotEmpty(val) {
...@@ -93,6 +95,7 @@ function fieldNotEmpty(val) { ...@@ -93,6 +95,7 @@ function fieldNotEmpty(val) {
} }
const hdSubmit = async () => { const hdSubmit = async () => {
if (!content.value.addrId) {
await addAddress({ await addAddress({
...forMData.value, ...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0, commonAddr: forMData.value.commonAddr ? 1 : 0,
...@@ -100,6 +103,15 @@ const hdSubmit = async () => { ...@@ -100,6 +103,15 @@ const hdSubmit = async () => {
city: forMData.value.city, city: forMData.value.city,
area: forMData.value.area, area: forMData.value.area,
}); });
} else {
await updateAddress({
...forMData.value,
commonAddr: forMData.value.commonAddr ? 1 : 0,
});
}
uni.navigateTo({
url: '/pages/address/addressList',
});
}; };
function handleSubmit() { function handleSubmit() {
reForm.value reForm.value
...@@ -126,7 +138,6 @@ async function changeLocation() { ...@@ -126,7 +138,6 @@ async function changeLocation() {
forMData.value.addr = res.address; forMData.value.addr = res.address;
forMData.value.lng = res.longitude; forMData.value.lng = res.longitude;
forMData.value.lat = res.latitude; forMData.value.lat = res.latitude;
console.log('位置信息:' + JSON.stringify(res));
uni.request({ uni.request({
url: '/ws/geocoder/v1/', url: '/ws/geocoder/v1/',
data: { data: {
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
</view> </view>
<view class="full_list" v-else> <view class="full_list" v-else>
<wd-swipe-action>
<view class="additem" v-for="(item, index) in addressList" :key="index"> <view class="additem" v-for="(item, index) in addressList" :key="index">
<view class="additem_l"> <view class="additem_l">
<view class="address">{{ item.addr }}</view> <view class="address">{{ item.addr }}</view>
...@@ -22,16 +23,17 @@ ...@@ -22,16 +23,17 @@
<view class="txt">默认</view> <view class="txt">默认</view>
</view> </view>
<view v-else class="box"> <view v-else class="box" @click="deleteAdd(item.addrId)">
<wd-icon name="circle1" size="12px"></wd-icon> <wd-icon name="circle1" size="12px"></wd-icon>
<view class="txt">默认</view> <view class="txt">删除</view>
</view> </view>
</view> </view>
</view> </view>
<view class="additem_r"> <view class="additem_r">
<wd-icon name="edit-outline" size="14px" @tap="editAddress"></wd-icon> <wd-icon name="edit-outline" size="14px" @tap="editAddress(item)"></wd-icon>
</view> </view>
</view> </view>
</wd-swipe-action>
<wd-button type="error" block class="addBtn" @tap="addNewAddress">新增地址</wd-button> <wd-button type="error" block class="addBtn" @tap="addNewAddress">新增地址</wd-button>
</view> </view>
...@@ -45,7 +47,6 @@ import Header from '@/pages/order/components/Header/index.vue'; ...@@ -45,7 +47,6 @@ import Header from '@/pages/order/components/Header/index.vue';
import { getAddressList, deleteAddress } from '@/api/address'; import { getAddressList, deleteAddress } from '@/api/address';
const isAdressEmpty = ref(false); const isAdressEmpty = ref(false);
const mainAddFlag = ref(false);
const addressList = ref([]); const addressList = ref([]);
const getAddressListData = async () => { const getAddressListData = async () => {
...@@ -56,26 +57,32 @@ const getAddressListData = async () => { ...@@ -56,26 +57,32 @@ const getAddressListData = async () => {
res.length === 0 ? (isAdressEmpty.value = true) : (isAdressEmpty.value = false); res.length === 0 ? (isAdressEmpty.value = true) : (isAdressEmpty.value = false);
} }
}; };
onLoad(() => {});
getAddressListData(); getAddressListData();
const addNewAddress = () => { const addNewAddress = () => {
xma.navigateTo({ url: '/pages/address/addressEdit?new=true' }); xma.navigateTo({ url: '/pages/address/addressEdit?new=true' });
}; };
const editAddress = () => { const editAddress = (col) => {
xma.navigateTo({ url: '/pages/address/addressEdit' }); xma.navigateTo({
url: `/pages/address/addressEdit?content=${JSON.stringify(col)}`,
});
}; };
const deleteAdd = async (id) => {
onLoad(() => { console.log(id);
xma.getLocation({ xma.showModal({
success: (res) => { title: '提示',
console.log(res); content: '确定删除该地址吗?',
}, showCancel: true,
fail: (err) => { confirmText: '确定',
console.log(err); cancelText: '取消',
success: async (res) => {
if (res.confirm) {
await deleteAddress(id);
getAddressListData();
}
}, },
}); });
}); };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -92,6 +99,7 @@ page { ...@@ -92,6 +99,7 @@ page {
.full_list { .full_list {
margin-top: 20rpx; margin-top: 20rpx;
padding-bottom: 180rpx;
.additem { .additem {
width: 710rpx; width: 710rpx;
...@@ -146,6 +154,7 @@ page { ...@@ -146,6 +154,7 @@ page {
display: flex; display: flex;
font-size: 18rpx; font-size: 18rpx;
align-items: center; align-items: center;
// justify-content: space-between;
.txt { .txt {
margin-left: 5rpx; margin-left: 5rpx;
......
<template> <template>
<div class="card"> <div class="card" v-for="(item, index) in photoData" :key="index">
<div class="img-wrap"> <div class="img-wrap">
<wd-img <wd-img v-for="(item, index) in item.images" :key="index" :src="item" enable-preview />
v-for="v in 3"
:key="v"
:src="`/src/static/assistingAgriculture/comment/${v}.png`"
enable-preview
/>
</div> </div>
<div class="text"> <div class="text">
跟团游行程紧凑有序,充分利用了时间,让游客...跟团游行程紧凑有序,充分利用了时间,让游客...跟团游行程紧凑有序,充分利用了时间,让游客...跟团游行程紧凑有序,充分利用了时间,让游客...跟团游行程紧凑有序,充分利用了时间,让游客...跟团游行程紧凑有序,充分利用了时间,让游客...跟团游行程紧凑有序,充分利用了时间,让游客...跟团游行程紧凑有序,充分利用了时间,让游客... {{ item.evaluation }}
</div> </div>
<div class="user-info flex-between"> <div class="user-info flex-between">
<div class="info flex-align-center"> <div class="info flex-align-center">
...@@ -24,7 +19,15 @@ ...@@ -24,7 +19,15 @@
</div> </div>
</template> </template>
<script setup></script> <script setup>
const showMore = ref(false);
const props = defineProps({
photoData: {
type: Array,
default: () => [],
},
});
</script>
<style lang="scss" scoped> <style lang="scss" scoped>
.card { .card {
......
<template> <template>
<div class="album"> <div class="album">
<scroll-view class="content" scroll-y> <scroll-view class="content" @scrolltolower="scrolltolower" scroll-y>
<div class="filter-box"> <!-- <div class="filter-box">
<div class="active">全部</div> <div class="active">全部</div>
<div v-for="(v, i) in filterList" :key="i">{{ v.text }}({{ v.value }})</div> <div v-for="(v, i) in filterList" :key="i">{{ v.text }}({{ v.value }})</div>
</div> </div> -->
<div class="card-wrap"> <div class="card-wrap">
<card v-for="v in 13" :key="v" /> <card :photoData="photoData" />
</div> </div>
</scroll-view> </scroll-view>
<div class="back"> <div class="back">
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<script setup> <script setup>
import card from './card.vue'; import card from './card.vue';
import { getPhoto } from '../../../api/photo';
const imgUrl = import.meta.env.VITE_APP_IMG_URL;
// let total
const filterList = [ const filterList = [
{ {
text: '家人', text: '家人',
...@@ -59,6 +62,36 @@ const filterList = [ ...@@ -59,6 +62,36 @@ const filterList = [
value: 514, value: 514,
}, },
]; ];
const photoData = ref([]);
const params = {
prodId: '43828',
shopId: '1818876196597334017',
};
onLoad(() => {
getPhotoFn();
});
// const scrolltolower = () => {
// console.log('触底加载触底加载触底加载');
// if (commentData.value.length < total) {
// commentParameters.current++;
// getCommentListFn();
// return;
// }
// show.value = true;
// };
const getPhotoFn = () => {
getPhoto(params).then((res) => {
res.data.forEach((v) => {
if (v.images) {
v.images = v.images.split(',').map((item) => {
item = imgUrl + item;
return item;
});
}
});
photoData.value = [...photoData.value, ...res.data];
});
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
...@@ -94,7 +127,7 @@ uni-page-body { ...@@ -94,7 +127,7 @@ uni-page-body {
} }
} }
.card-wrap { .card-wrap {
margin-top: 5px; // margin-top: 5px;
display: grid; display: grid;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
gap: 5px; gap: 5px;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<img :src="item.avatar" alt="" /> <img :src="item.avatar" alt="" />
<div class="name"> <div class="name">
<p>{{ item.nickName }}</p> <p>{{ item.nickName }}</p>
<div class="grade flex-align-center">5.0分</div> <text class="grade flex-align-center">5.0分</text>
</div> </div>
</div> </div>
<div class="info">{{ item.createTime[0] }}发表</div> <div class="info">{{ item.createTime[0] }}发表</div>
...@@ -55,15 +55,15 @@ const props = defineProps({ ...@@ -55,15 +55,15 @@ const props = defineProps({
} }
.grade { .grade {
margin-top: 18rpx; margin-top: 18rpx;
display: inline-block;
font-size: 16rpx; font-size: 16rpx;
background: rgba(253, 223, 109, 0.1686); background: rgba(253, 223, 109, 0.1686);
line-height: 24rpx;
color: #e1961d; color: #e1961d;
// width: 116rpx; padding: 2rpx 10rpx;
border-radius: 200rpx; border-radius: 16rpx;
// padding-left: 32rpx; // // padding-left: 32rpx;
box-sizing: border-box; // box-sizing: border-box;
position: relative; // position: relative;
// img { // img {
// height: 24rpx; // height: 24rpx;
// position: absolute; // position: absolute;
......
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