From 735851a9e5d01f95e5754a744b3fdda5fb9a079e Mon Sep 17 00:00:00 2001
From: chen-xin-zhi <3588068430@qq.com>
Date: Tue, 4 Mar 2025 14:07:24 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=AE=8C=E4=BA=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/request.ts | 2 +-
pages.json | 26 ++++++++--------
pages/book/photoProducts/photoProducts.vue | 31 +++++++++++++++++--
pages/order/component/addressComponent.vue | 21 ++++++++++---
.../order/product-waitpay/product-waitpay.vue | 14 +++++++--
.../service-paystatus/service-paystatus.vue | 2 +-
pages/order/serviceWaitPay/serviceWaitPay.vue | 9 +++++-
.../order/singleGoodOrder/singleGoodOrder.vue | 18 +++++++++--
.../singleServiceWait/singleServiceWait.vue | 11 +++++--
pages/workshop/component/timeSelect.vue | 4 ++-
10 files changed, 108 insertions(+), 30 deletions(-)
diff --git a/api/request.ts b/api/request.ts
index aa8d37c..391010b 100644
--- a/api/request.ts
+++ b/api/request.ts
@@ -4,4 +4,4 @@ export const suiUrl = 'http://154.8.193.216:9092/api' //隋宇霏的接口地
export const domain = 'https://www.carboner.cn/api'
export const myIp = 'http://8.130.119.119:9092/api'
-export const baseUrl = testUrl
+export const baseUrl = Url
diff --git a/pages.json b/pages.json
index 768589e..ffc58c8 100644
--- a/pages.json
+++ b/pages.json
@@ -1,5 +1,14 @@
{
"pages": [
+ {
+ "path" : "pages/home/home",
+ "style" :
+ {
+ "navigationBarTitleText" : "首页",
+ "enablePullDownRefresh":true, //开启下拉刷新
+ "navigationBarBackgroundColor": "#ede8e7"
+ }
+ },
{
"path" : "pages/workshop/searchResult/searchResult",
"style" :
@@ -15,15 +24,6 @@
"navigationBarTitleText" : ""
}
},
- {
- "path" : "pages/home/home",
- "style" :
- {
- "navigationBarTitleText" : "首页",
- "enablePullDownRefresh":true, //开启下拉刷新
- "navigationBarBackgroundColor": "#ede8e7"
- }
- },
{
"path" : "pages/order/service-paystatus/service-paystatus",
"style" :
@@ -269,11 +269,11 @@
"logisticsPlugin" : {
"version": "2.3.0",
"provider": "wx9ad912bf20548d92"
- },
- "routePlan": {
- "version": "1.0.19",
- "provider": "wx50b5593e81dd937a"
}
+ // "routePlan": {
+ // "version": "1.0.19",
+ // "provider": "wx50b5593e81dd937a"
+ // }
},
"globalStyle": {
"navigationBarTextStyle": "black",
diff --git a/pages/book/photoProducts/photoProducts.vue b/pages/book/photoProducts/photoProducts.vue
index 0ffbb89..253a026 100644
--- a/pages/book/photoProducts/photoProducts.vue
+++ b/pages/book/photoProducts/photoProducts.vue
@@ -69,12 +69,25 @@
const asideStyle = ref([])
const categoryId = ref(0)
const categoryName = ref('')
+ const ids = ref([])
+ const point = ref(0)
onMounted( async () => {
await getAllCategory()
await getPhotoProductsByCategoryId(categoryName.value)
+ getSpecialIds()
})
+ const getSpecialIds = async () => {
+ const res = await uni.request({
+ url: baseUrl + '/photoProducts/special/get',
+ method: 'POST',
+ header: {
+ cookie
+ }
+ })
+ ids.value = res.data.data
+ }
const isSelected = (item:any, index:any) => {
categoryId.value = item.id
@@ -132,9 +145,23 @@
})
}
- const jumpNextToDetail = (type:any) => {
+ const jumpNextToDetail = async (type:any) => {
+ await getSpecialIds()
+ if (type === '摄影') {
+ point.value = ids.value[0]
+ } else {
+ point.value = ids.value[1]
+ }
+ if (point.value === 0) {
+ uni.showModal({
+ title: '提示',
+ content: '当前写真产品未上架',
+ showCancel: false
+ })
+ return ;
+ }
uni.navigateTo({
- url: '../photoProductDetail/photoProductDetail?id=' + 76 + "&type=" + type
+ url: '../photoProductDetail/photoProductDetail?id=' + point.value + "&type=" + type
})
}
diff --git a/pages/order/component/addressComponent.vue b/pages/order/component/addressComponent.vue
index 81e753b..a774ece 100644
--- a/pages/order/component/addressComponent.vue
+++ b/pages/order/component/addressComponent.vue
@@ -45,7 +45,6 @@ import {nextTick, onMounted , ref } from 'vue'
import emitter from '../../../utils/emitter'
import { testUrl , baseUrl , suiUrl } from '../../../api/request';
import { onShow } from "@dcloudio/uni-app";
-const items = ref([null, null,null,null,null,null, null,null,null,null])
const addressList = ref([])
const userInfo = wx.getStorageSync('userInfo')
//页面跳转回来之后,刷新一次地址列表 onShow就是在页面显示后执行
@@ -73,7 +72,7 @@ const radioChange = ( event ) => {
const temp = addressList.value[index] //通过emitter传入暂时的地址信息
// console.log('temp',temp);
emitter.emit('addressInfo', temp)
- emitter.emit('close')
+ emitter.emit('closeAddress')
}
//跳转到新建地址页面
const toNewAddress =()=>{
@@ -118,7 +117,7 @@ const deleteAddress = async( id ) =>{
}
//关闭按钮
const closeWindow =()=> {
- emitter.emit('close')
+ emitter.emit('closeAddress')
}
@@ -128,7 +127,6 @@ const closeWindow =()=> {
margin-left: 20.57rpx;
}
.page {
- padding-bottom: 29.93rpx;
background-color: #f5f5dc;
border-radius: 28.05rpx 28.05rpx 0rpx 0rpx;
background-image: url('https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQfLHXSAU-feiyigongfangbeijin.png');
@@ -138,6 +136,12 @@ const closeWindow =()=> {
overflow-y: auto;
overflow-x: hidden;
height: 100%;
+
+ position: fixed;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ margin: 0 auto;
}
.section_2 {
position: fixed;
@@ -168,6 +172,12 @@ const closeWindow =()=> {
}
.list {
margin: 100.96rpx 14.96rpx 0 16.83rpx;
+ height: 580rpx;
+ padding-bottom: 20rpx;
+ overflow-y: auto;
+}
+::-webkit-scrollbar {
+ display: none;
}
.list-item {
padding: 26.18rpx 16.01rpx 30.41rpx 16.03rpx;
@@ -210,11 +220,12 @@ const closeWindow =()=> {
width: 572.32rpx;
}
.text-wrapper {
- margin-top: 80.72rpx;
padding: 26.75rpx 0 29.61rpx;
background-color: #ffb6b9;
border-radius: 74.81rpx;
width: 637.78rpx;
+ position: fixed;
+ bottom: 40rpx;
}
.text_3 {
color: #ffffff;
diff --git a/pages/order/product-waitpay/product-waitpay.vue b/pages/order/product-waitpay/product-waitpay.vue
index 998bc54..cbc96c0 100644
--- a/pages/order/product-waitpay/product-waitpay.vue
+++ b/pages/order/product-waitpay/product-waitpay.vue
@@ -159,7 +159,7 @@
-
+
@@ -178,7 +178,9 @@ const sumprice = ref(0) //总价格
//11.4开发 不应该删掉的
const popup = ref(null) //弹窗对象
const addressRealInfo = ref({
- detailAddress: '请选择/添加地址'
+ phone: '',
+ region: '请选择',
+ detailAddress: '地址'
}) //地址页 选择地址传过来的值 进入页面首先是默认地址,若无默认地址,则为空
const productArr = ref([]) //商品对象
const labelList = ref([]) //老套路,商品标签
@@ -440,6 +442,14 @@ const getFonts =()=>{
}, 1000)
}
const wxPayFd = () => { //微信支付按钮防抖
+ console.log(addressRealInfo.value)
+ if (addressRealInfo.value.name === null || addressRealInfo.value.name === '' || addressRealInfo.value.name === undefined) {
+ uni.showToast({
+ title: '请选择地址',
+ icon: 'error'
+ })
+ return ;
+ }
clearTimeout(wxPayTimer)
showLoading()
isShow.value = true
diff --git a/pages/order/service-paystatus/service-paystatus.vue b/pages/order/service-paystatus/service-paystatus.vue
index b5f4300..826a0e0 100644
--- a/pages/order/service-paystatus/service-paystatus.vue
+++ b/pages/order/service-paystatus/service-paystatus.vue
@@ -80,7 +80,7 @@
{{ orderObject.note }}
-
+
diff --git a/pages/order/serviceWaitPay/serviceWaitPay.vue b/pages/order/serviceWaitPay/serviceWaitPay.vue
index 04a5db3..05fb579 100644
--- a/pages/order/serviceWaitPay/serviceWaitPay.vue
+++ b/pages/order/serviceWaitPay/serviceWaitPay.vue
@@ -119,7 +119,7 @@
{{ sfAmount.toFixed(2) }}
- 微信支付
@@ -425,6 +425,13 @@
}, 1000)
}
const wxPayFd = () => { //微信支付按钮防抖
+ if (contactRealInfo.value.phone === null || contactRealInfo.value.phone === '' || contactRealInfo.value.phone === undefined) {
+ uni.showToast({
+ title: '请选择联系人',
+ icon: 'error'
+ })
+ return ;
+ }
clearTimeout(wxPayTimer)
showLoading()
isShow.value = true
diff --git a/pages/order/singleGoodOrder/singleGoodOrder.vue b/pages/order/singleGoodOrder/singleGoodOrder.vue
index 00a5d69..113e54e 100644
--- a/pages/order/singleGoodOrder/singleGoodOrder.vue
+++ b/pages/order/singleGoodOrder/singleGoodOrder.vue
@@ -182,7 +182,9 @@ const sumprice = ref(0) //总价格
//11.4开发 不应该删掉的
const popup = ref(null) //弹窗对象
const addressRealInfo = ref({
- detailAddress: '请选择/添加地址'
+ phone: '',
+ region: '请选择',
+ detailAddress: '地址'
}) //地址页 选择地址传过来的值 进入页面首先是默认地址,若无默认地址,则为空
const productObject = ref({}) //商品对象
const labelList = ref([]) //老套路,商品标签
@@ -234,6 +236,10 @@ const textColor = ref('')
})
})
+ emitter.on('addressInfo', (val:any) => {
+ addressRealInfo.value = val
+ })
+
emitter.on('cancelCoupon', () => {
templateString.value = myCouponList.value.length + '张优惠券可用'
@@ -321,6 +327,13 @@ const textColor = ref('')
}
const wxPayFd = () => {
+ if (addressRealInfo.value.name === null || addressRealInfo.value.name === '' || addressRealInfo.value.name === undefined) {
+ uni.showToast({
+ title: '请选择地址',
+ icon: 'error'
+ })
+ return ;
+ }
clearTimeout(wxPayTimer)
showLoading()
isShow.value = true
@@ -405,6 +418,7 @@ const getDefaultAddress = async () =>{
addressRealInfo.value = res.data.data[key]
}
}
+ console.log('==================>', addressRealInfo.value)
}
const createOrder = async () => { //创建单个商品订单的方法
console.log('地址信息-->',addressRealInfo.value);
@@ -546,7 +560,7 @@ const textAssign = (e) => { //文本输入框赋值方法
}
.popup-content {
- height: 300px;
+ height: 400px;
align-items: center;
justify-content: center;
// background-color: #fff;
diff --git a/pages/order/singleServiceWait/singleServiceWait.vue b/pages/order/singleServiceWait/singleServiceWait.vue
index 2710179..95ff827 100644
--- a/pages/order/singleServiceWait/singleServiceWait.vue
+++ b/pages/order/singleServiceWait/singleServiceWait.vue
@@ -220,8 +220,8 @@
singleService.value = JSON.parse(options.obj)
cnt.value = JSON.parse(options.cnt)
restNumber.value = JSON.parse(options.rest)
- bookDate.value = singleService.value.appointmentDateVOList[0].specificDate
- timeSlot.value = singleService.value.appointmentDateVOList[0].timePeriodVOList[0].timeSlot
+ bookDate.value = options.appointmentDate
+ timeSlot.value = options.timeSlot
sumprice.value = cnt.value * singleService.value.price
sfAmount.value = cnt.value * singleService.value.price
console.log('单个服务类--->',singleService.value);
@@ -405,6 +405,13 @@
const wxPayFd = () => { //微信支付按钮防抖
+ if (contactRealInfo.value.phone === null || contactRealInfo.value.phone === '' || contactRealInfo.value.phone === undefined) {
+ uni.showToast({
+ title: '请选择联系人',
+ icon: 'error'
+ })
+ return ;
+ }
clearTimeout(wxPayTimer)
showLoading()
isShow.value = true
diff --git a/pages/workshop/component/timeSelect.vue b/pages/workshop/component/timeSelect.vue
index c36b995..bebd7da 100644
--- a/pages/workshop/component/timeSelect.vue
+++ b/pages/workshop/component/timeSelect.vue
@@ -293,7 +293,9 @@
console.log('数量--->',cnt.value);
uni.navigateTo({ //跳转到待支付页面
//商品信息+数量
- url: '/pages/order/singleServiceWait/singleServiceWait?obj=' + JSON.stringify(productObject.value) + '&cnt=' + JSON.stringify(cnt.value) + '&rest=' + JSON.stringify(restNumber.value)
+ url: '/pages/order/singleServiceWait/singleServiceWait?obj='
+ + JSON.stringify(productObject.value) + '&cnt=' + JSON.stringify(cnt.value) + '&rest=' + JSON.stringify(restNumber.value)
+ + '&appointmentDate=' + appointmentDate + '&timeSlot=' + timeSlot
})
}