提交 f52e0c11 authored 作者: 刘旭's avatar 刘旭

修改最后一版需求

上级 fe3518ee
......@@ -3,4 +3,4 @@ services:
yongxinda-h5:
build:
context: ../
image: 192.168.0.26:5000/yongxinda-h5
\ No newline at end of file
image: registrytest.lingqingkeji.com/yongxinda-h5
\ No newline at end of file
......@@ -2,6 +2,7 @@
"name": "uni-preset-vue",
"version": "0.0.0",
"scripts": {
"dev": "yarn dev:h5",
"dev:h5": "uni preview --open",
"dev:h5:ssr": "uni --ssr",
"dev:mp-weixin": "uni -p mp-weixin",
......
import { request } from '@/utils/request';
import { request } from '@/utils/request'
// 购物车初始数据
export const getCartIndex = (data: any) => request('/wx/cart/index', 'GET', data);
export const getCartIndex = (data: any) =>
request('/wx/cart/index', 'GET', data)
// 选择或取消商品
export const cartChecked = (data: any) => request('/wx/cart/checked', 'POST', data);
export const cartChecked = (data: any) =>
request('/wx/cart/checked', 'POST', data)
// 删除商品
export const cartDelete = (data: any) => request('/wx/cart/delete', 'POST', data);
export const cartDelete = (data: any) =>
request('/wx/cart/delete', 'POST', data)
// 更新商品
export const cartUpdate = (data: any) => request('/wx/cart/update', 'POST', data);
export const cartUpdate = (data: any) =>
request('/wx/cart/update', 'POST', data)
// 更新商品
export const downloadPdf = (data: string) => request('/wx/storage/download/' + data, 'GET');
export const downloadPdf = (data: string) =>
request('/wx/storage/download/' + data, 'GET')
// 查询pdf详细数据
export const getOrderPdf = (data: any) => request('/wx/order/orderPdfSource', 'GET', data);
export const getOrderPdf = (data: any) =>
request('/wx/order/orderPdfSource', 'GET', data)
// 报价-准备报价
export const quotationInit = (data: any) => request('/wx/quotation/init', 'GET', data);
export const quotationInit = (data: any) =>
request('/wx/quotation/init', 'GET', data)
// 报价-重新准备
export const quotationInitAgain = (data: any) => request('/wx/quotation/init_again', 'GET', data);
export const quotationInitAgain = (data: any) =>
request('/wx/quotation/init_again', 'GET', data)
// 报价单-订单查询
export const quotationOrder = (data: any) => request('/wx/quotation/order', 'GET', data);
export const quotationOrder = (data: any) =>
request('/wx/quotation/order', 'GET', data)
// 报价单-用户列表查询
export const quotationList = (data: any) => request('/wx/quotation/list', 'GET', data);
export const quotationList = (data: any) =>
request('/wx/quotation/list', 'GET', data)
// 报价-填报报价
export const fillQuotation = (data: any) => request('/wx/quotation/filling', 'POST', data);
export const fillQuotation = (data: any) =>
request('/wx/quotation/filling', 'POST', data)
// 报价单-逻辑删除
export const deleteQuotation = (data: any) => request('/wx/quotation/delete', 'DELETE', data);
export const deleteQuotation = (data: any) =>
request('/wx/quotation/delete', 'DELETE', data)
// 报价单-详细
export const quotationDetail = (data: any) => request('/wx/quotation/detail', 'POST', data);
export const quotationDetail = (data: any) =>
request('/wx/quotation/detail', 'POST', data)
// 报价单-execl下载
export const quotationDownload = (data: any) => request('/wx/quotation/download', 'GET', data);
export const quotationDownload = (data: any) =>
request('/wx/quotation/download', 'GET', data)
// 报价单-是否存在
export const quotationExist = (data: any) => request('/wx/quotation/exist', 'GET', data);
export const quotationExist = (data: any) =>
request('/wx/quotation/exist', 'GET', data)
// 再次加入购物车
export const orderCartAgain = (data: any) => request('/wx/order/cart/again', 'GET', data);
export const orderCartAgain = (data: any) =>
request('/wx/order/cart/again', 'GET', data)
// 报价单-交货地址集合
export const getQuotationDelivery = () => request('/wx/quotation/delivery', 'GET');
export const getQuotationDelivery = (name?: string) =>
request('/wx/quotation/delivery', 'GET', { name })
// 报价单-收款条件集合
export const getQuotationPayment = () => request('/wx/quotation/payment', 'GET');
\ No newline at end of file
export const getQuotationPayment = (name?: string) =>
request('/wx/quotation/payment', 'GET', { name })
// 报价单-客户资料集合
export const getQuotationBank = (data?: any) =>
request('/wx/bank_info', 'GET', data)
......@@ -62,3 +62,6 @@ export const goodsParts = (data: any) => request('/wx/goods/parts', 'GET', data)
// 查询商品参数属性 ?productId=1
export const orderAttribute = (data: any) => request('/wx/cart/attribute', 'GET', data);
// 查询地区信息
export const getAddrList = () => request('/wx/region/list', 'GET')
\ No newline at end of file
<template>
<u-popup
v-model="props.modelValue"
closeable
mode="bottom"
length="60%"
@close="close"
>
<view class="search">
<u-search
:placeholder="placeholder"
v-model="keyword"
:clearabled="false"
@search="search"
@custom="custom"
/>
<view class="search-list">
<u-cell-group>
<u-cell-item
v-for="(item, i) in list"
:key="i"
icon=""
:title="item.textValue"
:arrow="false"
@tap="tapCellValue(item)"
/>
</u-cell-group>
</view>
</view>
</u-popup>
</template>
<script setup lang="ts">
import { ref } from 'vue'
const props = defineProps({
placeholder: String,
modelValue: Boolean,
type: String,
list: {
type: Array,
default: () => [],
} as any,
})
const emits = defineEmits(['update:modelValue', 'search', 'textValue'])
const keyword = ref()
const search = (val: string) => {
emits('search', val, props.type)
}
const custom = (val: string) => {
emits('search', val, props.type)
}
const tapCellValue = (item: string) => {
emits('textValue', item, props.type)
emits('update:modelValue', false)
}
const close = () => {
emits('update:modelValue', false)
}
</script>
<style lang="scss" scoped>
.search {
padding: 20rpx;
.u-search {
box-sizing: border-box;
width: 100%;
position: sticky;
top: 2%;
padding-right: 12%;
}
.search-list {
margin-top: 30rpx;
}
}
</style>
......@@ -11,6 +11,7 @@
fontSize: size + 'rpx',
minHeight: '1.4em'
}"
@tap="tapStart('minus')"
@touchstart.prevent="btnTouchStart('minus')"
@touchend.stop.prevent="clearTimer"
>
......@@ -42,6 +43,7 @@
fontSize: size + 'rpx',
minHeight: '1.4em'
}"
@tap="tapStart('plus')"
@touchstart.prevent="btnTouchStart('plus')"
@touchend.stop.prevent="clearTimer"
>
......@@ -252,6 +254,9 @@ export default {
}
},
methods: {
tapStart(callback) {
this[callback]();
},
// 点击退格键
btnTouchStart(callback) {
// 先执行一遍方法,否则会造成松开手时,就执行了clearTimer,导致无法实现功能
......
{
"id": "cus-selects-fan",
"name": "自定义下拉选择",
"displayName": "自定义下拉选择",
"version": "1.0.2",
"description": "自定义下拉选择 可以清除选择,可以模糊搜素,可以精准搜索",
"keywords": [
"自定义下拉选择"
],
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
}
}
\ No newline at end of file
......@@ -11,7 +11,7 @@
</template>
<script setup lang="ts">
import { nextTick, ref, watch } from 'vue';
import { ref, watch } from 'vue';
import { addCart, fastaddCart, readdCart } from '@/api/index';
import { useSpecStore } from '@/store/useStore';
......
......@@ -19,12 +19,12 @@
<view class="left">采购邮箱</view>
<input v-model="addressData.customerEmail" type="text" placeholder-class="line" placeholder="请填写采购邮箱" />
</view>
<view class="item" @tap="showRegionPicker">
<!-- <view class="item" @tap="showRegionPicker">
<view class="left">所在地址</view>
<input v-model="addressDetails" disabled type="text" placeholder-class="line" placeholder="省市区县、乡镇等" />
</view>
<input v-model="addressDetails" disabled type="textarea" placeholder-class="line" placeholder="省市区县、乡镇等" />
</view> -->
<view class="item address">
<view class="left">详细地址</view>
<view class="left">公司所在地址</view>
<textarea v-model="addressData.addressDetail" type="text" placeholder-class="line"
placeholder="街道、楼牌等" />
</view>
......@@ -56,7 +56,7 @@
<script setup lang="ts">
import { ref, computed } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import { deleteAddress, saveAddress } from '@/api/index';
import { deleteAddress, saveAddress, getAddrList } from '@/api/index';
import { consigneeList } from '@/api/profile';
let show = ref(false);
......@@ -105,7 +105,10 @@ onLoad((options?: any) => {
});
// 打开地区选择
let showRegionPicker = () => {
let showRegionPicker = async () => {
const { data: res }: any = await getAddrList()
console.log(res);
show.value = true;
};
......@@ -152,28 +155,28 @@ let addressSave = () => {
title: '请输入采购员',
icon: 'none',
});
let emailReg = /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/
if (!emailReg.test(addressData.value.customerEmail))
return uni.showToast({
title: '邮箱为空或格式不对',
icon: 'none',
});
// let emailReg = /^[a-zA-Z0-9]+([-_.][A-Za-zd]+)*@([a-zA-Z0-9]+[-.])+[A-Za-zd]{2,5}$/
// if (!emailReg.test(addressData.value.customerEmail))
// return uni.showToast({
// title: '邮箱为空或格式不对',
// icon: 'none',
// });
let reg = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if (!reg.test(addressData.value.tel))
return uni.showToast({
title: '电话号码为空或格式不对',
icon: 'none',
});
if (!addressData.value.province)
return uni.showToast({
title: '请选择地址',
icon: 'none',
});
if (!addressData.value.addressDetail)
return uni.showToast({
title: '请输入详细地址',
icon: 'none',
});
// if (!addressData.value.province)
// return uni.showToast({
// title: '请选择地址',
// icon: 'none',
// });
// if (!addressData.value.addressDetail)
// return uni.showToast({
// title: '请输入详细地址',
// icon: 'none',
// });
saveAddress(addressData.value).then((res: any) => {
if (res.data.code === 200) {
uni.navigateBack({
......
......@@ -3,6 +3,7 @@
<view class="u-numberbox">
<view
class="u-icon-minus"
@tap.prevent="tapStart('minus')"
@touchstart.prevent="btnTouchStart('minus')"
@touchend.stop.prevent="clearTimer"
:class="{ 'u-icon-disabled': disabled || inputVal <= min }"
......@@ -34,6 +35,7 @@
/>
<view
class="u-icon-plus"
@tap.prevent="tapStart('plus')"
@touchstart.prevent="btnTouchStart('plus')"
@touchend.stop.prevent="clearTimer"
:class="{ 'u-icon-disabled': disabled || inputVal >= max }"
......@@ -253,6 +255,9 @@ export default {
}
},
methods: {
tapStart (callback) {
this[callback]();
},
// 点击退格键
btnTouchStart(callback) {
// 先执行一遍方法,否则会造成松开手时,就执行了clearTimer,导致无法实现功能
......
This source diff could not be displayed because it is too large. You can view the blob instead.
const CONFIG: any = {
// 开发环境配置
development: {
assetsPath: 'http://192.168.60:81', // 静态资源路径
// baseUrl: 'http://192.168.0.8:8089', // 后台接口请求地址
baseUrl: 'http://192.168.0.60:81', // 后台接口请求地址
hostUrl: 'http://192.168.0.60:81', // H5地址(前端运行地址)
assetsPath: 'http://192.168.1.158:81', // 静态资源路径
// baseUrl: 'http://192.168.1.158:81', // 后台接口请求地址
baseUrl: 'http://192.168.1.27:8089', // 后台接口请求地址
hostUrl: 'http://192.168.1.158:81', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
},
// 生产环境配置
production: {
assetsPath: '', // 静态资源路径
baseUrl: '', // 后台接口请求地址
// baseUrl: 'https://api.test.siccat.com/api/graphql',
hostUrl: '', // H5地址(前端运行地址)
websocketUrl: '', // websocket服务端地址
},
......
......@@ -14,21 +14,6 @@ function request(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', data?:
Authorization: uni.getStorageSync('token'),
};
}
// else {
// let pages = getCurrentPages();
// let curRoute = pages[pages.length - 1].route;
// if (curRoute != 'pages/login/login') {
// uni.showToast({
// icon: 'none',
// title: '请重新登录',
// success() {
// uni.navigateTo({
// url: '/pages/login/login',
// });
// },
// });
// }
// }
uni.request({
url: baseUrl + url,
method: method,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论