Commit 82b55e74 authored by 张娇(东信)'s avatar 张娇(东信)

Merge remote-tracking branch 'origin/master'

parents 54c10c0a e384bf5a
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,
}); });
} }
// 删除收货地址 // 删除收货地址
......
...@@ -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,43 +41,50 @@ ...@@ -41,43 +41,50 @@
] ]
}, },
/* 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"
}
} }
} }
} }
} }
\ No newline at end of file
...@@ -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-cell title="所在地区" title-width="80px">
<view class="area">
<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" />
</view>
</view>
</wd-cell>
<wd-input <wd-input
label="详细地址" label="详细地址"
label-width="80px" label-width="80px"
prop="addr" prop="addr"
v-model="model.addr" v-model="forMData.addr"
placeholder="请输入详细地址" placeholder="请输入详细地址"
:rules="[{ required: false, validator: fieldNotEmpty, message: '详细地址不能为空' }]" :rules="[{ required: false, validator: fieldNotEmpty, message: '详细地址不能为空' }]"
/> />
<wd-checkbox-group>
<wd-cell title="所在地区" title-width="80px"> <wd-cell title="设置为默认地址" center>
<view class="area"> <view>
<view class="area_l" @tap="changeLocation"> <wd-checkbox v-model="forMData.commonAddr" prop="commonAddr" />
<view class="area_lt">这是当前定位</view> </view>
<view class="area_lb">这是定位的详细地址点击可跳转地图选择</view> </wd-cell>
</view>
<view class="area_r">
<wd-icon name="location" size="22px" @tap="changeLocation"></wd-icon>
</view>
</view>
</wd-cell>
</wd-checkbox-group>
<wd-checkbox-group v-model="model.commonAddr" size="large">
<wd-cell title="设置为默认地址" center clickable @tap="setDefaultAddress">
<view>
<wd-checkbox
modelValuee="1"
ref="checkBoxAdress"
checked-color="#fa5151"
custom-style="margin-right:-18rpx"
></wd-checkbox>
</view>
</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>
......
This diff is collapsed.
...@@ -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