合完了
This commit is contained in:
parent
56a9798605
commit
0bcacb5f82
|
@ -1,7 +1,10 @@
|
|||
export const Url = 'http://localhost:9092/api' //后端接口文档
|
||||
export const testUrl = 'http://123.249.108.160:8888/api' //自己组的服务器接口地址
|
||||
export const suiUrl = 'http://154.8.193.216:9092/api' //隋宇霏的接口地址
|
||||
export const develop = 'http://154.8.193.216:9092/api' //隋宇霏的接口地址(开发环境)
|
||||
export const test = 'http://154.8.193.216:9093/api' //隋宇霏的接口地址(测试环境)
|
||||
export const domain = 'https://www.carboner.cn/api'
|
||||
export const myIp = 'http://8.130.119.119:9092/api'
|
||||
|
||||
export const nwct = 'https://winning-mouse-internally.ngrok-free.app/api'
|
||||
export const suiUrl = ''
|
||||
export const baseUrl = testUrl
|
||||
|
12
common/globalFunction.js
Normal file
12
common/globalFunction.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
export const dealResult = (res) => {
|
||||
let response = res.data
|
||||
if (response.code !== 1) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: response.message,
|
||||
showCancel: false
|
||||
})
|
||||
return false
|
||||
}
|
||||
return response.data
|
||||
}
|
14
pages.json
14
pages.json
|
@ -263,6 +263,20 @@
|
|||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/activity/activityHome/activityHome",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/mine/PersonCenter/PersonCenter",
|
||||
"style" :
|
||||
{
|
||||
"navigationBarTitleText" : ""
|
||||
}
|
||||
}
|
||||
],
|
||||
"plugins" : {
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
<script setup>
|
||||
import {
|
||||
onMounted,
|
||||
onUnmounted,
|
||||
ref
|
||||
} from 'vue';
|
||||
import emitter from '../../../utils/emitter';
|
||||
|
@ -53,15 +54,23 @@
|
|||
import {
|
||||
baseUrl
|
||||
} from '../../../api/request';
|
||||
import { dealResult } from '../../../common/globalFunction';
|
||||
const productBrief = ref({}) //商品简要对象
|
||||
const quantity = ref(1)
|
||||
const userInfo = ref({})
|
||||
|
||||
const productHandler = (val) => {
|
||||
productBrief.value = val
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('product', (val) => {
|
||||
// console.log(val);
|
||||
productBrief.value = val
|
||||
})
|
||||
emitter.on('product', productHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('product', productHandler)
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
userInfo.value = wx.getStorageSync('userInfo') //获取用户信息
|
||||
})
|
||||
|
@ -82,6 +91,9 @@
|
|||
quantity: quantity.value
|
||||
}
|
||||
})
|
||||
if(!dealResult(res)) {
|
||||
return ;
|
||||
}
|
||||
if (res.data.code === 1) {
|
||||
uni.showToast({
|
||||
icon: 'success',
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ref , onMounted} from 'vue'
|
||||
import {ref , onMounted, onUnmounted} from 'vue'
|
||||
import { testUrl , baseUrl , suiUrl } from '../../../api/request';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import emitter from '../../../utils/emitter';
|
||||
|
@ -71,15 +71,20 @@ onLoad((options)=>{
|
|||
}
|
||||
// console.log(options);
|
||||
})
|
||||
onShow(()=>{
|
||||
})
|
||||
|
||||
const regionHandler = (val) => {
|
||||
addressParam.value.region = val
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
emitter.on('region',(val)=>{ //将地址弹窗的值传到当前页面
|
||||
addressParam.value.region = val
|
||||
// console.log('val--->',val);
|
||||
})
|
||||
emitter.on('region', regionHandler)
|
||||
if(!isAdd.value) emitter.emit('addRegion', addressParam.value.region)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('region', regionHandler)
|
||||
})
|
||||
|
||||
//勾选默认地址的选项
|
||||
const defaultAddress =(event)=>{
|
||||
event.detail.value[0] ? addressParam.value.isDefault = 1 : addressParam.value.isDefault = 0
|
||||
|
|
|
@ -196,7 +196,7 @@ const getServiceCart = async () => {
|
|||
//更改实体商品和服务类方法
|
||||
const changeType = async (num)=>{
|
||||
current.value = num;
|
||||
if(num ===1 ) { //为一的时候就获取用户商品购物车
|
||||
if (num === 1 ) { //为一的时候就获取用户商品购物车
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,8 +109,8 @@
|
|||
</view>
|
||||
<view class="flex-row items-center">
|
||||
<text class="font_2 text_12">合计:{{ totalPrice }}元</text>
|
||||
<view class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-7">
|
||||
<text class="font_4 text_13" @click="editOrSettle" :style="{ pointerEvents: isLoading ? 'none' : 'auto' }">{{ stateText.bottomBtn }}</text>
|
||||
<view class="flex-col justify-start items-center shrink-0 text-wrapper_3 ml-7" @click="editOrSettle" :style="{ pointerEvents: isLoading ? 'none' : 'auto' }" >
|
||||
<text class="font_4 text_13">{{ stateText.bottomBtn }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
11
pages/activity/activityHome/activityHome.vue
Normal file
11
pages/activity/activityHome/activityHome.vue
Normal file
|
@ -0,0 +1,11 @@
|
|||
<template>
|
||||
<web-view src="https://mp.weixin.qq.com/s?__biz=Mzk0NTYyNDIwMw==&mid=2247484925&idx=1&sn=1548a0df724a25d55b46c067fecb4b57&chksm=c313c019f464490fa00790f4a36f569e02ffae23df0fa871c3703fe4ca12c893add30d483ca8#rd"></web-view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
</style>
|
|
@ -42,9 +42,9 @@
|
|||
<view class="flex-col group_3">
|
||||
<text class="self-start font text_5">拍摄场地</text>
|
||||
|
||||
<radio-group class="flex-row equal-division mt-17" @change="handlerRadioChange">
|
||||
<radio-group class="flex-row equal-division mt-17 my-radio" @change="handlerRadioChange">
|
||||
|
||||
<view class="flex-col section_2 equal-division-item">
|
||||
<view class="flex-col section_2 equal-division-item" v-if="!disabled1">
|
||||
<view class="flex-row justify-between items-end self-stretch">
|
||||
<image
|
||||
class="image_7"
|
||||
|
@ -55,7 +55,7 @@
|
|||
<text class="self-start font_2 text_6 mt-5">室内</text>
|
||||
</view>
|
||||
|
||||
<view class="flex-col section_2 equal-division-item ml-19">
|
||||
<view class="flex-col section_2 equal-division-item" v-if="!disabled2">
|
||||
<view class="flex-row justify-between items-end self-stretch">
|
||||
<image
|
||||
class="image_8"
|
||||
|
@ -90,10 +90,12 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {nextTick, onMounted, ref} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref} from 'vue'
|
||||
import emitter from '../../../utils/emitter';
|
||||
import feeTipsVue from './feeTips.vue';
|
||||
import { bookUrl } from '../../../common/globalImagesUrl';
|
||||
import { baseUrl } from '../../../api/request';
|
||||
import { dealResult } from '../../../common/globalFunction';
|
||||
const number = ref(1)
|
||||
const field = ref('')
|
||||
const feeTips = ref(null)
|
||||
|
@ -105,39 +107,58 @@
|
|||
const checked1 = ref(false)
|
||||
const checked2 = ref(false)
|
||||
const type = ref('')
|
||||
const cookie = wx.getStorageSync('cookie')
|
||||
|
||||
|
||||
const closeFeeTipsHandler = () => {
|
||||
nextTick(() => {
|
||||
if (feeTips.value) {
|
||||
feeTips.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const getProductsTypeHandler = (val:any) => {
|
||||
type.value = val
|
||||
console.log('=================================================>', type.value)
|
||||
}
|
||||
|
||||
const getProductObjHandler = (val:any) => {
|
||||
obj.value = val
|
||||
totalPrice.value = val.price * val.minNumber
|
||||
number.value = obj.value.minNumber
|
||||
shotScene.value = obj.value.shotScene
|
||||
if (shotScene.value === '室内') {
|
||||
disabled2.value = true
|
||||
checked1.value = true
|
||||
field.value = '室内'
|
||||
} else if (shotScene.value === '室外'){
|
||||
disabled1.value = true
|
||||
checked2.value = true
|
||||
field.value = '室外'
|
||||
}
|
||||
console.log(totalPrice.value)
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('closeFeeTips', () => {
|
||||
nextTick(() => {
|
||||
if (feeTips.value) {
|
||||
feeTips.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeFeeTips', closeFeeTipsHandler)
|
||||
|
||||
emitter.on('getProductsType', (val:any) => {
|
||||
type.value = val
|
||||
console.log('=================================================>', type.value)
|
||||
})
|
||||
emitter.on('getProductsType', getProductsTypeHandler)
|
||||
|
||||
emitter.on('getProductObj', (val:any) => {
|
||||
obj.value = val
|
||||
totalPrice.value = val.price * val.minNumber
|
||||
number.value = obj.value.minNumber
|
||||
shotScene.value = obj.value.shotScene
|
||||
if (shotScene.value === '室内') {
|
||||
disabled1.value = true
|
||||
checked2.value = true
|
||||
field.value = '室内'
|
||||
} else {
|
||||
disabled2.value = true
|
||||
checked1.value = true
|
||||
field.value = '室外'
|
||||
}
|
||||
console.log(totalPrice.value)
|
||||
})
|
||||
emitter.on('getProductObj', getProductObjHandler)
|
||||
})
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeFeeTips', closeFeeTipsHandler)
|
||||
|
||||
emitter.off('getProductsType', getProductsTypeHandler)
|
||||
|
||||
emitter.off('getProductObj', getProductObjHandler)
|
||||
})
|
||||
|
||||
|
||||
const sub = () => {
|
||||
if (number.value > obj.value.minNumber) {
|
||||
number.value --
|
||||
|
@ -164,7 +185,7 @@
|
|||
feeTips.value.open('center')
|
||||
}
|
||||
|
||||
const jumpToOrder = () => {
|
||||
const jumpToOrder = async () => {
|
||||
if (field.value === '' || field.value === undefined || field.value === null) {
|
||||
uni.showToast({
|
||||
title: '请选择场地',
|
||||
|
@ -172,15 +193,37 @@
|
|||
})
|
||||
return ;
|
||||
}
|
||||
|
||||
let res = await checkPhotoProducts()
|
||||
if (!dealResult(res)) return ;
|
||||
|
||||
uni.navigateTo({
|
||||
url: '/pages/book/photoProductsOrder/photoProductsOrder?field=' + field.value + '&number=' + number.value + '&id=' + obj.value.id + '&type=' + type.value
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const checkPhotoProducts = async () => {
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/advanceOrder/check/photoProducts',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie
|
||||
},
|
||||
data: {
|
||||
id: obj.value.id
|
||||
}
|
||||
})
|
||||
return res
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.my-radio {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.fee-tips {
|
||||
justify-content: center;
|
||||
background-color: #fff;
|
||||
|
@ -307,7 +350,7 @@
|
|||
}
|
||||
.section_2 {
|
||||
position: relative;
|
||||
flex: 1 1 320.63rpx;
|
||||
width: 320.63rpx;
|
||||
}
|
||||
.equal-division-item {
|
||||
padding: 18.75rpx 26.25rpx;
|
||||
|
|
|
@ -9,17 +9,23 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import emitter from '../../../utils/emitter';
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
||||
const oid = ref(0)
|
||||
const cookie = wx.getStorageSync("cookie") //请求头
|
||||
onMounted(() => {
|
||||
emitter.on('sendBookingOrderId', (orderId:any) => {
|
||||
oid.value = orderId
|
||||
console.log(oid.value)
|
||||
})
|
||||
emitter.on('sendBookingOrderId', sendBookingOrderIdHandler)
|
||||
})
|
||||
|
||||
const sendBookingOrderIdHandler = (orderId:any) => {
|
||||
oid.value = orderId
|
||||
console.log(oid.value)
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('sendBookingOrderId', sendBookingOrderIdHandler)
|
||||
})
|
||||
|
||||
const cancelBookingOrder = async () => {
|
||||
|
|
|
@ -12,20 +12,28 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import emitter from '../../../utils/emitter';
|
||||
import { baseUrl } from '../../../api/request';
|
||||
import { dealResult } from '../../../common/globalFunction';
|
||||
const cookie = wx.getStorageSync("cookie") //请求头
|
||||
|
||||
const orderObj = ref({})
|
||||
const isIndoors = ref(0)
|
||||
const isMakeup = ref(1)
|
||||
const isPhotography = ref(1)
|
||||
|
||||
const getBookingOrderDataHandler = (val:any) => {
|
||||
orderObj.value = val
|
||||
console.log(val)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('getBookingOrderData', (val:any) => {
|
||||
orderObj.value = val
|
||||
console.log(val)
|
||||
})
|
||||
emitter.on('getBookingOrderData', getBookingOrderDataHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('getBookingOrderData', getBookingOrderDataHandler)
|
||||
})
|
||||
|
||||
const closeConfirmBookingPopup = async () => {
|
||||
|
@ -54,8 +62,8 @@ const cookie = wx.getStorageSync("cookie") //请求头
|
|||
data: {
|
||||
photoProductId: orderObj.value.id,
|
||||
contactsId: orderObj.value.contactId,
|
||||
specificDate: orderObj.value.bookingDate,
|
||||
timePoint: orderObj.value.bookingTime,
|
||||
bookingDateId: orderObj.value.bookingDateId,
|
||||
bookingTimeId: orderObj.value.bookingTimeId,
|
||||
isIndoors: isIndoors.value,
|
||||
isMakeup: isMakeup.value,
|
||||
isPhotography: isPhotography.value,
|
||||
|
@ -63,10 +71,11 @@ const cookie = wx.getStorageSync("cookie") //请求头
|
|||
}
|
||||
})
|
||||
console.log('订单id==========================>', res.data.data)
|
||||
if (res.data.code === 1) {
|
||||
wxPay(res.data.data)
|
||||
}
|
||||
|
||||
if (!dealResult(res)) {
|
||||
emitter.emit('closeMask')
|
||||
return
|
||||
}
|
||||
wxPay(res.data.data)
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -9,17 +9,24 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import emitter from '../../../utils/emitter';
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
||||
const oid = ref(0)
|
||||
const cookie = wx.getStorageSync("cookie") //请求头
|
||||
|
||||
const sendDeleteOrderIdHandler = (orderId:any) => {
|
||||
oid.value = orderId
|
||||
console.log(oid.value)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('sendDeleteOrderId', (orderId:any) => {
|
||||
oid.value = orderId
|
||||
console.log(oid.value)
|
||||
})
|
||||
emitter.on('sendDeleteOrderId', sendDeleteOrderIdHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('sendDeleteOrderId', sendDeleteOrderIdHandler)
|
||||
})
|
||||
|
||||
const deleteBookingOrder = async () => {
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import {nextTick, onMounted, ref} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref} from 'vue'
|
||||
import emitter from "../../../utils/emitter";
|
||||
import bookingSelectedVue from "../component/bookingSelected.vue";
|
||||
import { baseUrl } from "../../../api/request";
|
||||
|
@ -82,14 +82,20 @@
|
|||
})
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('closeBookingPopup', () => {
|
||||
nextTick(() => {
|
||||
if (bookingSelected.value) {
|
||||
bookingSelected.value.close()
|
||||
}
|
||||
})
|
||||
const closeBookingPopupHandler = () => {
|
||||
nextTick(() => {
|
||||
if (bookingSelected.value) {
|
||||
bookingSelected.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('closeBookingPopup', closeBookingPopupHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeBookingPopup', closeBookingPopupHandler)
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -91,6 +91,7 @@
|
|||
}
|
||||
|
||||
const isSelected = (item:any, index:any) => {
|
||||
if (categoryId.value === item.id) return
|
||||
categoryId.value = item.id
|
||||
categoryName.value = item.name
|
||||
for (var i = 0; i < asideStyle.value.length; i ++ ) {
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {nextTick, onMounted, ref} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref} from 'vue'
|
||||
import emitter from '../../../utils/emitter';
|
||||
import bookingTipsVue from '../component/bookingTips.vue';
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
@ -128,6 +128,8 @@
|
|||
|
||||
const bookingDate = ref('请选择')
|
||||
const bookingTime = ref('请选择')
|
||||
const bookingDateId = ref(0)
|
||||
const bookingTimeId = ref(0)
|
||||
const bookingTips = ref(null)
|
||||
const contactsPopup = ref(null)
|
||||
const confirmBookingInfo = ref(null)
|
||||
|
@ -192,6 +194,8 @@
|
|||
id: id.value,
|
||||
contactId: contactInfo.value.id,
|
||||
name: photoProduct.value.name,
|
||||
bookingDateId: bookingDateId.value,
|
||||
bookingTimeId: bookingTimeId.value,
|
||||
bookingDate: bookingDate.value,
|
||||
bookingTime: bookingTime.value,
|
||||
type: type.value
|
||||
|
@ -207,50 +211,77 @@
|
|||
type.value = options.type
|
||||
})
|
||||
|
||||
const closeBookingTipsHandler = () => {
|
||||
nextTick(() => {
|
||||
if (bookingTips.value) {
|
||||
bookingTips.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const closeHandler = () => {
|
||||
nextTick(() => {
|
||||
if (contactsPopup.value) {
|
||||
contactsPopup.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const contactsNowInfoHandler = (val) => {
|
||||
contactInfo.value = val
|
||||
contactTemplateString.value = val.name + ' ' + val.phone
|
||||
console.log(val)
|
||||
}
|
||||
|
||||
const closeConfirmBookingInfoHandler = () => {
|
||||
nextTick(() => {
|
||||
if (confirmBookingInfo.value) {
|
||||
confirmBookingInfo.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const openMaskHandler = () => {
|
||||
showLoading()
|
||||
isShow.value = true
|
||||
}
|
||||
|
||||
const closeMaskHandler = () => {
|
||||
hideLoading()
|
||||
isShow.value = false
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getFonts()
|
||||
getDefaultAddress()
|
||||
getPhotoProductsById()
|
||||
emitter.on('closeBookingTips', () => {
|
||||
nextTick(() => {
|
||||
if (bookingTips.value) {
|
||||
bookingTips.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeBookingTips', closeBookingTipsHandler)
|
||||
|
||||
emitter.on('close', () => {
|
||||
nextTick(() => {
|
||||
if (contactsPopup.value) {
|
||||
contactsPopup.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('close', closeHandler)
|
||||
|
||||
emitter.on('contactsNowInfo', (val) =>{
|
||||
contactInfo.value = val
|
||||
contactTemplateString.value = val.name + ' ' + val.phone
|
||||
console.log(val)
|
||||
})
|
||||
emitter.on('contactsNowInfo', contactsNowInfoHandler)
|
||||
|
||||
emitter.on('closeConfirmBookingInfo', () => {
|
||||
nextTick(() => {
|
||||
if (confirmBookingInfo.value) {
|
||||
confirmBookingInfo.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeConfirmBookingInfo', closeConfirmBookingInfoHandler)
|
||||
|
||||
emitter.on('openMask', () => {
|
||||
showLoading()
|
||||
isShow.value = true
|
||||
})
|
||||
emitter.on('openMask', openMaskHandler)
|
||||
|
||||
// emitter.on('closeMask', () => {
|
||||
// hideLoading()
|
||||
// isShow.value = false
|
||||
// })
|
||||
emitter.on('closeMask', closeMaskHandler)
|
||||
|
||||
})
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeBookingTips', closeBookingTipsHandler)
|
||||
|
||||
emitter.off('close', closeHandler)
|
||||
|
||||
emitter.off('contactsNowInfo', contactsNowInfoHandler)
|
||||
|
||||
emitter.off('closeConfirmBookingInfo', closeConfirmBookingInfoHandler)
|
||||
|
||||
emitter.off('openMask', openMaskHandler)
|
||||
|
||||
emitter.off('closeMask', closeMaskHandler)
|
||||
|
||||
})
|
||||
|
||||
|
@ -279,6 +310,7 @@
|
|||
timeSelectedStyle.value[0].backgroundColor = '#FFB6B9'
|
||||
timeFontStyle.value[0].color = '#C35C5D'
|
||||
bookingDate.value = bookingDateVOList.value[0].specificDate
|
||||
bookingDateId.value = bookingDateVOList.value[0].id
|
||||
|
||||
for (var i = 0; i < bookingDateVOList.value.length; i ++ ) {
|
||||
let len = bookingDateVOList.value[i].bookingTimeVOList.length
|
||||
|
@ -299,9 +331,12 @@
|
|||
|
||||
|
||||
const selectTime = (index:any) => {
|
||||
if (bid.value === index) return ;
|
||||
bookingTime.value = '请选择'
|
||||
bookingTimeId.value = 0
|
||||
bid.value = index
|
||||
bookingDate.value = bookingDateVOList.value[index].specificDate
|
||||
bookingDateId.value = bookingDateVOList.value[index].id
|
||||
for (var i = 0; i < bookingDateVOList.value.length; i ++ ) {
|
||||
if (i == index) {
|
||||
timeSelectedStyle.value[i].backgroundColor = '#FFB6B9'
|
||||
|
@ -321,6 +356,7 @@
|
|||
|
||||
const selectTpTime = (index:any) => {
|
||||
bookingTime.value = bookingDateVOList.value[bid.value].bookingTimeVOList[index].timePoint
|
||||
bookingTimeId.value = bookingDateVOList.value[bid.value].bookingTimeVOList[index].id
|
||||
let len = bookingDateVOList.value[bid.value].bookingTimeVOList.length
|
||||
for (var i = 0; i < len; i ++ ) {
|
||||
if (i == index) {
|
||||
|
|
|
@ -122,7 +122,7 @@
|
|||
import deleteOrderVue from '../component/deleteOrder.vue';
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
import { getFonts } from '../../../common/globalFont';
|
||||
import { getFonts } from '../../../common/globalFont';
|
||||
const cookie = wx.getStorageSync("cookie") //请求头
|
||||
const isShow = ref([true, false, false])
|
||||
const cancelBookingOrder = ref(null)
|
||||
|
@ -134,45 +134,45 @@ import { getFonts } from '../../../common/globalFont';
|
|||
getFonts()
|
||||
})
|
||||
|
||||
const flushAdvanceOrderListHandler = () => {
|
||||
getAdvanceOrder()
|
||||
};
|
||||
|
||||
const closeCancelOrderPopupHandler = () => {
|
||||
nextTick(() => {
|
||||
if (cancelBookingOrder.value) {
|
||||
cancelBookingOrder.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const closeDeleteOrderPopupHandler = () => {
|
||||
nextTick(() => {
|
||||
if (deleteBookingOrder.value) {
|
||||
deleteBookingOrder.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
onMounted( async () => {
|
||||
getFonts()
|
||||
await getAdvanceOrder()
|
||||
emitter.on('closeCancelOrderPopup', () => {
|
||||
nextTick(() => {
|
||||
if (cancelBookingOrder.value) {
|
||||
cancelBookingOrder.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeCancelOrderPopup', closeCancelOrderPopupHandler)
|
||||
|
||||
emitter.on('closeDeleteOrderPopup', () => {
|
||||
nextTick(() => {
|
||||
if (deleteBookingOrder.value) {
|
||||
deleteBookingOrder.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeDeleteOrderPopup', closeDeleteOrderPopupHandler)
|
||||
|
||||
emitter.on('flushAdvanceOrderList', () => {
|
||||
getAdvanceOrder()
|
||||
})
|
||||
emitter.on('flushAdvanceOrderList', flushAdvanceOrderListHandler)
|
||||
})
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
console.log('组件已卸载')
|
||||
emitter.off('closeCancelOrderPopup', closeCancelOrderPopupHandler)
|
||||
emitter.off('closeDeleteOrderPopup', closeDeleteOrderPopupHandler)
|
||||
emitter.off('flushAdvanceOrderList', flushAdvanceOrderListHandler)
|
||||
})
|
||||
|
||||
|
||||
const getAdvanceOrder = async () => {
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/advanceOrder/list/my',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie
|
||||
}
|
||||
})
|
||||
advanceOrderList.value = res.data.data
|
||||
console.log(res.data.data)
|
||||
advanceOrderList.value.forEach((order) => {
|
||||
startCountdown(order)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const openCancelBookingOrderPopup = (orderId:any) => {
|
||||
|
@ -288,6 +288,64 @@ import { getFonts } from '../../../common/globalFont';
|
|||
|
||||
|
||||
|
||||
|
||||
const getAdvanceOrder = async () => {
|
||||
advanceOrderList.value.forEach(order => {
|
||||
if (order.countdownInterval) {
|
||||
clearInterval(order.countdownInterval); // 清除定时器
|
||||
}
|
||||
})
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/advanceOrder/list/my',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie
|
||||
}
|
||||
})
|
||||
advanceOrderList.value = res.data.data
|
||||
console.log('订单列表打印==================>')
|
||||
advanceOrderList.value.forEach(order => {
|
||||
if (order.orderStatus === '待支付') {
|
||||
startCountdown(order)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 启动每个订单的倒计时(仅对待支付订单有效)
|
||||
const startCountdown = (order) => {
|
||||
|
||||
if (order.orderStatus === '待支付') {
|
||||
order.endTime = add30Minutes(order.createTime); // 设置最终取消时间
|
||||
|
||||
order.countdownInterval = setInterval(() => {
|
||||
const now = Math.floor(Date.now() / 1000); // 获取当前时间的时间戳(秒)
|
||||
const remainingTime = order.endTime - now;
|
||||
if (remainingTime <= 0) {
|
||||
order.countdown = '00:00';
|
||||
clearInterval(order.countdownInterval); // 清除定时器
|
||||
order.orderStatus = '交易关闭'
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '订单超时未支付,已取消',
|
||||
showCancel: false
|
||||
})
|
||||
} else {
|
||||
const minutes = Math.floor(remainingTime / 60); // 计算剩余分钟
|
||||
const seconds = remainingTime % 60; // 计算剩余秒数
|
||||
order.countdown = `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -309,47 +367,17 @@ import { getFonts } from '../../../common/globalFont';
|
|||
// 给订单创建时间加上30分钟
|
||||
const add30Minutes = (createdTime) => {
|
||||
const date = parseDate(createdTime);
|
||||
date.setMinutes(date.getMinutes() + 2); // 加上30分钟
|
||||
date.setMinutes(date.getMinutes() + 1); // 加上30分钟
|
||||
return Math.floor(date.getTime() / 1000); // 返回时间戳(秒)
|
||||
};
|
||||
|
||||
// 启动每个订单的倒计时(仅对待支付订单有效)
|
||||
const startCountdown = (order) => {
|
||||
if (order.orderStatus === '待支付') {
|
||||
order.endTime = add30Minutes(order.createTime); // 设置最终取消时间
|
||||
order.countdownInterval = setInterval(() => {
|
||||
const now = Math.floor(Date.now() / 1000); // 获取当前时间的时间戳(秒)
|
||||
const remainingTime = order.endTime - now;
|
||||
|
||||
if (remainingTime <= 0) {
|
||||
order.countdown = '00:00';
|
||||
clearInterval(order.countdownInterval); // 清除定时器
|
||||
getAdvanceOrder()
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '订单超时未支付,交易关闭',
|
||||
// showCancel: false
|
||||
// })
|
||||
|
||||
} else {
|
||||
const minutes = Math.floor(remainingTime / 60); // 计算剩余分钟
|
||||
const seconds = remainingTime % 60; // 计算剩余秒数
|
||||
order.countdown = `${String(minutes).padStart(2, '0')}:${String(seconds).padStart(2, '0')}`;
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
};
|
||||
|
||||
// 在组件挂载时启动待支付订单的倒计时
|
||||
|
||||
|
||||
|
||||
// 在组件卸载时清除所有定时器,避免内存泄漏
|
||||
onBeforeUnmount(() => {
|
||||
advanceOrderList.value.forEach(order => {
|
||||
if (order.countdownInterval) {
|
||||
clearInterval(order.countdownInterval);
|
||||
}
|
||||
});
|
||||
advanceOrderList.value.forEach(order => {
|
||||
if (order.countdownInterval) {
|
||||
clearInterval(order.countdownInterval); // 清除定时器
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref, onMounted, nextTick} from 'vue'
|
||||
import {ref, onMounted, nextTick, onUnmounted} from 'vue'
|
||||
import { baseUrl } from '@/api/request';
|
||||
import confirmPopupVue from '../component/confirmPopup.vue';
|
||||
import popupVue from '../../popup.vue';
|
||||
|
@ -61,22 +61,31 @@
|
|||
|
||||
const coupon = ref(0)
|
||||
|
||||
const closeConfirmPopupHandler = () => {
|
||||
nextTick(() => {
|
||||
if (exchange.value) {
|
||||
exchange.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const confirmExchangeHandler = async () => {
|
||||
await pointsExchangeCoupon()
|
||||
await getMyUserInfo()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getMyUserInfo()
|
||||
getCouponList()
|
||||
emitter.on('closeConfirmPopup', () => {
|
||||
nextTick(() => {
|
||||
if (exchange.value) {
|
||||
exchange.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeConfirmPopup', closeConfirmPopupHandler)
|
||||
|
||||
emitter.on('confirmExchange', async () => {
|
||||
await pointsExchangeCoupon()
|
||||
await getMyUserInfo()
|
||||
})
|
||||
emitter.on('confirmExchange', confirmExchangeHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeConfirmPopup', closeConfirmPopupHandler)
|
||||
|
||||
emitter.off('confirmExchange', confirmExchangeHandler)
|
||||
})
|
||||
|
||||
const getMyUserInfo = async () => {
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {onMounted, ref} from 'vue'
|
||||
import {onMounted, onUnmounted, ref} from 'vue'
|
||||
import emitter from '../../../utils/emitter';
|
||||
import { baseUrl } from '../../../api/request';
|
||||
import { onShow } from "@dcloudio/uni-app";
|
||||
|
@ -92,15 +92,19 @@
|
|||
|
||||
|
||||
|
||||
|
||||
const getTotalPriceHandler = (val:any) => {
|
||||
totalAmount = val
|
||||
getMyCouponList()
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
emitter.on('getTotalPrice', (val:any) => {
|
||||
totalAmount = val
|
||||
getMyCouponList()
|
||||
})
|
||||
emitter.on('getTotalPrice', getTotalPriceHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('getTotalPrice', getTotalPriceHandler)
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
<text class="mt-12 font_3 text_6">伊人摸样,丹青绘画</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row relative grid-item_4" @click="showStop">
|
||||
<view class="flex-row relative grid-item_4" @click="jumpToActivity">
|
||||
<image
|
||||
class="shrink-0 self-center image_4"
|
||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FlMKuKgjS-fourthicon.png"
|
||||
|
@ -96,6 +96,13 @@ const jump_store =()=>{
|
|||
url: '/pages/store-home/main/testMain'
|
||||
})
|
||||
}
|
||||
|
||||
const jumpToActivity = () => {
|
||||
uni.navigateTo({
|
||||
url: '../activity/activityHome/activityHome'
|
||||
})
|
||||
}
|
||||
|
||||
const getFonts =()=>{
|
||||
uni.loadFontFace({
|
||||
family: 'ZhongShanFonts',
|
||||
|
@ -119,11 +126,12 @@ const getFonts =()=>{
|
|||
})
|
||||
}
|
||||
//为了上架的提示框
|
||||
const showTest = ref(false)
|
||||
const showStop =()=>{
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '正在开发中!'
|
||||
})
|
||||
showTest.value = true
|
||||
// uni.navigateTo({
|
||||
// url: '../activity/activityHome/activityHome'
|
||||
// })
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
|
@ -36,23 +36,33 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick } from 'vue'
|
||||
import { ref, onMounted, nextTick, onUnmounted } from 'vue'
|
||||
import { baseUrl } from '../../../api/request'
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import emitter from '../../../utils/emitter';
|
||||
import contactPopVue from '../component/contactPop.vue'; //导入联系人弹窗
|
||||
const ContactArr = ref() //联系人数组
|
||||
const popup = ref(null) //弹窗对象
|
||||
const closeContactPopHandler = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
const updateInfoHandler = () => {
|
||||
getContactInfo()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getFonts()
|
||||
getContactInfo() //获取联系人信息
|
||||
emitter.on('closeContactPop',()=>{
|
||||
close()
|
||||
})
|
||||
emitter.on('updateInfo',()=>{ //更新联系人信息
|
||||
getContactInfo()
|
||||
})
|
||||
emitter.on('closeContactPop', closeContactPopHandler)
|
||||
emitter.on('updateInfo', updateInfoHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeContactPop', closeContactPopHandler)
|
||||
emitter.off('updateInfo', updateInfoHandler)
|
||||
})
|
||||
|
||||
onShow(()=>{
|
||||
getContactInfo() //获取联系人信息
|
||||
})
|
||||
|
|
13
pages/mine/PersonCenter/PersonCenter.vue
Normal file
13
pages/mine/PersonCenter/PersonCenter.vue
Normal file
|
@ -0,0 +1,13 @@
|
|||
<template>
|
||||
<view>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup >
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
|
@ -24,7 +24,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ref , onMounted} from 'vue'
|
||||
import {ref , onMounted, onUnmounted} from 'vue'
|
||||
import { testUrl , baseUrl , suiUrl } from '../../../api/request';
|
||||
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||
import emitter from '../../../utils/emitter';
|
||||
|
@ -34,24 +34,27 @@ const contactParam = ref({
|
|||
isDefault: 0
|
||||
})
|
||||
const checked = ref(false) //是否选中
|
||||
onLoad(()=>{
|
||||
})
|
||||
onShow(()=>{
|
||||
})
|
||||
|
||||
const contactInfoHandler = (val) => {
|
||||
console.log('当前编辑的联系人信息',val);
|
||||
if(val != null) {
|
||||
contactParam.value.id = val.id
|
||||
contactParam.value.name = val.name
|
||||
contactParam.value.phone = val.phone
|
||||
contactParam.value.isDefault = val.isDefault
|
||||
val.isDefault ? checked.value = true : checked.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
getFonts() //获取字体
|
||||
emitter.on('contactInfo',(val)=>{ //编辑按钮传来的联系人信息
|
||||
console.log('当前编辑的联系人信息',val);
|
||||
if(val != null) {
|
||||
contactParam.value.id = val.id
|
||||
contactParam.value.name = val.name
|
||||
contactParam.value.phone = val.phone
|
||||
contactParam.value.isDefault = val.isDefault
|
||||
val.isDefault ? checked.value = true : checked.value = false
|
||||
}
|
||||
})
|
||||
emitter.on('contactInfo', contactInfoHandler)
|
||||
defaultAddress()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('contactInfo', contactInfoHandler)
|
||||
})
|
||||
//勾选默认联系人的选项
|
||||
const defaultAddress =(event)=>{
|
||||
event.detail.value[0] ? contactParam.value.isDefault = 1 : contactParam.value.isDefault = 0
|
||||
|
|
|
@ -2,11 +2,16 @@
|
|||
<view class="flex-col page">
|
||||
<view class="flex-col group">
|
||||
<view class="flex-row items-center group_2">
|
||||
<image class="image"
|
||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FtiKFGDAi-avator.png" />
|
||||
<button class="image avatar_button" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
|
||||
<image class="image" :src="myAvatar" />
|
||||
</button>
|
||||
|
||||
|
||||
<view class="ml-20 flex-col items-start flex-1">
|
||||
<text class="text">微信用户</text>
|
||||
<text class="mt-18 font text_2">剩余积分:40</text>
|
||||
<!-- <text class="text">微信用户</text> -->
|
||||
|
||||
<input class= "text" type="nickname" :value="nickName" placeholder="请输入昵称" name="nickname" @blur="onUpdateNick" />
|
||||
<text class="mt-18 font text_2">剩余积分:{{ myPoints }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-row equal-division">
|
||||
|
@ -39,7 +44,8 @@
|
|||
</view>
|
||||
<view class="flex-col mt-37">
|
||||
<view class="flex-col group_3">
|
||||
<view class="flex-row justify-between relative" @click="jump_addressList()">
|
||||
|
||||
<view class="flex-row justify-between relative" @click="jump_addressList">
|
||||
<image class="image_3"
|
||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FSJZTOttL-address.png" />
|
||||
<image class="self-start image_4 image_5"
|
||||
|
@ -47,6 +53,7 @@
|
|||
<text class="font_2 text_8 pos">地 址 列 表</text>
|
||||
<view class="divider pos_2"></view>
|
||||
</view>
|
||||
|
||||
<view class="flex-row justify-between relative" @click="goToText">
|
||||
<image class="image_6"
|
||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FejVXliLM-contact.png" />
|
||||
|
@ -67,6 +74,7 @@
|
|||
</view>
|
||||
<view class="flex-col group_5">
|
||||
<view class="divider view"></view>
|
||||
|
||||
<view class="flex-row justify-between items-center group_6" @click="jumpToMyCoupon">
|
||||
<view class="flex-row items-center">
|
||||
<image class="shrink-0 image_10"
|
||||
|
@ -76,19 +84,21 @@
|
|||
<image class="image_4 image_11"
|
||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FwQgycnra-rush.png" />
|
||||
</view>
|
||||
|
||||
<view class="divider view_2"></view>
|
||||
<view class="flex-row justify-between group_7">
|
||||
|
||||
<view class="flex-row justify-between group_7" @click="userLogout">
|
||||
<view class="flex-row self-center">
|
||||
<view class="flex-row shrink-0">
|
||||
<image class="shrink-0 image_12"
|
||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FlGcdVAji-setting.png" />
|
||||
<text class="ml-10 self-start font_3 text_10">设</text>
|
||||
<text class="ml-10 self-start font_3 text_10">退 出 登 录</text>
|
||||
</view>
|
||||
<text class="ml-60 self-start font_3 text_11">置</text>
|
||||
</view>
|
||||
<image class="self-start image_4 image_13"
|
||||
src="https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FwQgycnra-rush.png" />
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -103,14 +113,13 @@ import {
|
|||
onShow,
|
||||
onLoad
|
||||
} from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
||||
onMounted(() => {
|
||||
getFonts() //启动使从服务器下载字体
|
||||
getMyUser()
|
||||
})
|
||||
// const goto = () => { //跳转到订单
|
||||
// uni.navigateTo({
|
||||
// url: "/pages/mine/mineorders/mineorders"
|
||||
// })
|
||||
// }
|
||||
|
||||
const goToText = () => { //跳转到联系人信息
|
||||
uni.navigateTo({
|
||||
url: '/pages/mine/Contact/testContact'
|
||||
|
@ -156,6 +165,103 @@ const jump_addressList = () => {
|
|||
url: '/pages/mine/addressList/addressList'
|
||||
})
|
||||
}
|
||||
const cookie = wx.getStorageSync('cookie')
|
||||
|
||||
|
||||
|
||||
const logout = async () => {
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/user/mini/logout',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const userLogout = () => {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您确定要退出登录吗?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
logout()
|
||||
uni.showToast({
|
||||
title: '退出成功'
|
||||
})
|
||||
uni.redirectTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
let tempFile = ''
|
||||
const myAvatar = ref('')
|
||||
const onChooseAvatar = (e) => {
|
||||
tempFile = e.detail.avatarUrl
|
||||
console.log(tempFile)
|
||||
uni.uploadFile({
|
||||
url: baseUrl + '/file/upload/single',
|
||||
filePath: tempFile,
|
||||
name: 'file',
|
||||
header: {
|
||||
cookie
|
||||
},
|
||||
success: (res) => {
|
||||
myAvatar.value = JSON.parse(res.data).data
|
||||
console.log(myAvatar.value)
|
||||
updateMyUser()
|
||||
},
|
||||
fail: (e) => {
|
||||
console.log(e)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const nickName = ref('')
|
||||
const onUpdateNick = (e) => {
|
||||
nickName.value = e.detail.value
|
||||
updateMyUser()
|
||||
}
|
||||
|
||||
|
||||
const updateMyUser = async () => {
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/user/update/my',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie
|
||||
},
|
||||
data: {
|
||||
userName: nickName.value,
|
||||
userAvatar: myAvatar.value
|
||||
}
|
||||
})
|
||||
console.log(res.data.data)
|
||||
}
|
||||
|
||||
const myPoints = ref(0)
|
||||
const getMyUser = async () => {
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/user/get/login',
|
||||
method: 'GET',
|
||||
header: {
|
||||
cookie
|
||||
}
|
||||
})
|
||||
console.log(res.data.data)
|
||||
nickName.value = res.data.data.userName
|
||||
myAvatar.value = res.data.data.userAvatar
|
||||
myPoints.value = res.data.data.points
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -168,7 +274,7 @@ const jump_addressList = () => {
|
|||
}
|
||||
|
||||
.page {
|
||||
padding: 135rpx 0 211.88rpx;
|
||||
padding: 100rpx 0 211.88rpx;
|
||||
background-color: #ffffff00;
|
||||
background-image: url('https://carbon2.obs.cn-north-4.myhuaweicloud.com:443/feiyi%2Ftest%2F0%2FQfLHXSAU-feiyigongfangbeijin.png');
|
||||
background-size: 100% 100%;
|
||||
|
@ -193,10 +299,13 @@ const jump_addressList = () => {
|
|||
width: 150rpx;
|
||||
height: 151.88rpx;
|
||||
}
|
||||
.avatar_button {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.text {
|
||||
color: #000000;
|
||||
font-size: 45rpx;
|
||||
font-size: 40rpx;
|
||||
font-family: FangZhengFonts;
|
||||
line-height: 40.61rpx;
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
<view v-if="isShow" class="overlay"></view>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
<script setup lang="ts">
|
||||
import { ref,onMounted,toRaw, onBeforeUnmount } from 'vue';
|
||||
import { baseUrl } from '@/api/request';
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
|
@ -395,6 +395,15 @@ const confirm =()=> { //确认收货方法
|
|||
|
||||
|
||||
|
||||
const updateOrderList = async () => {
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/order/list',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie: wx.getStorageSync('cookie')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -428,13 +437,12 @@ const confirm =()=> { //确认收货方法
|
|||
if (remainingTime <= 0) {
|
||||
order.countdown = '00:00';
|
||||
clearInterval(order.countdownInterval); // 清除定时器
|
||||
Getorder()
|
||||
// uni.showModal({
|
||||
// title: '提示',
|
||||
// content: '订单超时未支付,交易关闭',
|
||||
// showCancel: false
|
||||
// })
|
||||
|
||||
order.orderStatus = '交易关闭'
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '订单超时未支付,已取消',
|
||||
showCancel: false
|
||||
})
|
||||
} else {
|
||||
const minutes = Math.floor(remainingTime / 60); // 计算剩余分钟
|
||||
const seconds = remainingTime % 60; // 计算剩余秒数
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, nextTick } from 'vue'
|
||||
import { ref, onMounted, nextTick, onUnmounted } from 'vue'
|
||||
import { baseUrl } from '../../../api/request'
|
||||
import { onShow, onLoad } from "@dcloudio/uni-app";
|
||||
import emitter from '../../../utils/emitter';
|
||||
|
@ -57,15 +57,29 @@
|
|||
const popup = ref(null) //弹窗对象
|
||||
const selectedContact = ref() //在订单确认页面已经选择的联系人信息
|
||||
const current = ref(0) //当前数组位置
|
||||
|
||||
const closeContactPopHandler = () => {
|
||||
closeContactPop()
|
||||
}
|
||||
|
||||
const updateInfoHandler = () => {
|
||||
getContactInfo()
|
||||
}
|
||||
|
||||
onMounted( async () => {
|
||||
getContactInfo() //获取联系人信息
|
||||
emitter.on('closeContactPop',()=>{
|
||||
closeContactPop()
|
||||
})
|
||||
emitter.on('updateInfo',()=>{
|
||||
getContactInfo()
|
||||
})
|
||||
emitter.on('closeContactPop', closeContactPopHandler)
|
||||
emitter.on('updateInfo', updateInfoHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeContactPop', closeContactPopHandler)
|
||||
emitter.off('updateInfo', updateInfoHandler)
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
onShow(()=>{
|
||||
getContactInfo() //获取联系人信息
|
||||
})
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {nextTick, onMounted, ref, toRaw} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref, toRaw} from 'vue'
|
||||
import emitter from '../../../utils/emitter'
|
||||
import { onLoad , onShow } from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
@ -200,45 +200,69 @@ const coupon = ref(null)
|
|||
const conditionAmount = ref(0)
|
||||
|
||||
|
||||
|
||||
const closeHandler = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
const addressInfoHandler = (val) => {
|
||||
addressRealInfo.value = val
|
||||
}
|
||||
|
||||
const closeCouponHandler = () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cancelCouponHandler = () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
}
|
||||
|
||||
const getCouponObjHandler = (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getFonts()
|
||||
//将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
||||
emitter.on('close', () => {
|
||||
close()
|
||||
})
|
||||
emitter.on('close', closeHandler)
|
||||
//获取地址信息
|
||||
emitter.on('addressInfo', (val) =>{
|
||||
addressRealInfo.value = val
|
||||
})
|
||||
emitter.on('addressInfo', addressInfoHandler)
|
||||
|
||||
emitter.on('closeCoupon', () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.on('cancelCoupon', () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
})
|
||||
emitter.on('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
|
||||
emitter.on('getCouponObj', (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
})
|
||||
console.log('===============start===============')
|
||||
emitter.on('getCouponObj', getCouponObjHandler)
|
||||
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
//将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
||||
emitter.off('close', closeHandler)
|
||||
//获取地址信息
|
||||
emitter.off('addressInfo', addressInfoHandler)
|
||||
|
||||
emitter.off('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.off('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
emitter.off('getCouponObj', getCouponObjHandler)
|
||||
})
|
||||
|
||||
|
||||
onLoad( async (options)=>{
|
||||
totalInfo.value = JSON.parse(options.cartInfo)
|
||||
console.log('options.cartInfo-->',JSON.parse(options.cartInfo));
|
||||
|
|
|
@ -140,7 +140,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {nextTick, onMounted, ref, toRaw} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref, toRaw} from 'vue'
|
||||
import emitter from '../../../utils/emitter'
|
||||
import { onLoad , onShow } from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
@ -178,46 +178,67 @@
|
|||
const textColor = ref('')
|
||||
|
||||
|
||||
const closeHandler = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
const contactsNowInfoHandler = (val) => {
|
||||
contactRealInfo.value = val
|
||||
}
|
||||
|
||||
const closeCouponHandler = () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cancelCouponHandler = () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
}
|
||||
|
||||
const getCouponObjHandler = (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getFonts()
|
||||
//将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
||||
emitter.on('close', () => {
|
||||
close()
|
||||
})
|
||||
emitter.on('close', closeHandler)
|
||||
//获取联系人信息
|
||||
emitter.on('contactsNowInfo', (val) =>{
|
||||
contactRealInfo.value = val
|
||||
})
|
||||
emitter.on('contactsNowInfo', contactsNowInfoHandler)
|
||||
|
||||
emitter.on('closeCoupon', () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.on('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
emitter.on('cancelCoupon', () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
})
|
||||
|
||||
|
||||
emitter.on('getCouponObj', (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
})
|
||||
console.log('===============start===============')
|
||||
|
||||
emitter.on('getCouponObj', getCouponObjHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
//将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
||||
emitter.off('close', closeHandler)
|
||||
//获取联系人信息
|
||||
emitter.off('contactsNowInfo', contactsNowInfoHandler)
|
||||
|
||||
emitter.off('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.off('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
emitter.off('getCouponObj', getCouponObjHandler)
|
||||
})
|
||||
|
||||
onLoad( async (options)=>{
|
||||
if(options.cartInfo === undefined) {
|
||||
singleService.value = JSON.parse(options.obj)
|
||||
|
|
|
@ -169,7 +169,7 @@
|
|||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {nextTick, onMounted, ref, toRaw} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref, toRaw} from 'vue'
|
||||
import emitter from '../../../utils/emitter'
|
||||
import { onLoad , onShow } from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
@ -211,56 +211,68 @@ const textColor = ref('')
|
|||
|
||||
|
||||
|
||||
const closeAddressHandler = () => {
|
||||
nextTick(() => {
|
||||
if (popup.value) {
|
||||
popup.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const closeCouponHandler = () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const addressInfoHandler = (val) => {
|
||||
addressRealInfo.value = val
|
||||
}
|
||||
|
||||
const cancelCouponHandler = () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
}
|
||||
|
||||
|
||||
const getCouponObjHandler = (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getFonts()
|
||||
// 将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
||||
emitter.on('closeAddress', () => {
|
||||
nextTick(() => {
|
||||
if (popup.value) {
|
||||
popup.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeCoupon', () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
emitter.on('closeAddress', closeAddressHandler)
|
||||
emitter.on('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.on('addressInfo', (val:any) => {
|
||||
addressRealInfo.value = val
|
||||
})
|
||||
emitter.on('addressInfo', addressInfoHandler)
|
||||
|
||||
emitter.on('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
emitter.on('cancelCoupon', () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
})
|
||||
|
||||
|
||||
emitter.on('getCouponObj', (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
})
|
||||
console.log('===============start===============')
|
||||
emitter.on('getCouponObj', getCouponObjHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeAddress', closeAddressHandler)
|
||||
emitter.off('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.off('addressInfo', addressInfoHandler)
|
||||
|
||||
emitter.off('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
emitter.off('getCouponObj', getCouponObjHandler)
|
||||
})
|
||||
|
||||
onLoad( async (options)=>{
|
||||
totalInfo.value = JSON.parse(options.cartInfo)
|
||||
await getProduct()
|
||||
|
|
|
@ -139,7 +139,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import {nextTick, onMounted, ref, toRaw} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref, toRaw} from 'vue'
|
||||
import emitter from '../../../utils/emitter'
|
||||
import { onLoad , onShow } from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
|
@ -175,46 +175,66 @@
|
|||
const useCouponId = ref(null)
|
||||
const textColor = ref('')
|
||||
|
||||
const closeHandler = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
const contactsNowInfoHandler = (val) => {
|
||||
contactRealInfo.value = val
|
||||
}
|
||||
|
||||
const closeCouponHandler = () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const cancelCouponHandler = () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
}
|
||||
|
||||
const getCouponObjHandler = (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
}
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getFonts()
|
||||
//将关闭弹窗方法传入弹窗页面,绑定弹窗按钮可关闭弹窗
|
||||
emitter.on('close', () => {
|
||||
close()
|
||||
})
|
||||
emitter.on('close', closeHandler)
|
||||
//获取联系人信息
|
||||
emitter.on('contactsNowInfo', (val) =>{
|
||||
contactRealInfo.value = val
|
||||
})
|
||||
emitter.on('contactsNowInfo', contactsNowInfoHandler)
|
||||
|
||||
|
||||
emitter.on('closeCoupon', () => {
|
||||
nextTick(() => {
|
||||
if (coupon.value) {
|
||||
coupon.value.close()
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
emitter.on('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.on('cancelCoupon', () => {
|
||||
templateString.value = myCouponList.value.length + '张优惠券可用'
|
||||
sfAmount.value = sumprice.value
|
||||
useCouponId.value = null
|
||||
textColor.value = '#818181'
|
||||
})
|
||||
emitter.on('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
emitter.on('getCouponObj', getCouponObjHandler)
|
||||
})
|
||||
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('close', closeHandler)
|
||||
//获取联系人信息
|
||||
emitter.off('contactsNowInfo', contactsNowInfoHandler)
|
||||
|
||||
emitter.on('getCouponObj', (val) => {
|
||||
couponObj.value = val
|
||||
templateString.value = "-¥" + val.couponVO.conditionAmount.toFixed(2)
|
||||
conditionAmount.value = val.couponVO.conditionAmount
|
||||
sfAmount.value = sumprice.value - conditionAmount.value
|
||||
useCouponId.value = val.id
|
||||
textColor.value = '#FFB6B9'
|
||||
console.log(val)
|
||||
})
|
||||
console.log('===============start===============')
|
||||
})
|
||||
emitter.off('closeCoupon', closeCouponHandler)
|
||||
|
||||
emitter.off('cancelCoupon', cancelCouponHandler)
|
||||
|
||||
emitter.off('getCouponObj', getCouponObjHandler)
|
||||
})
|
||||
|
||||
onLoad((options)=>{
|
||||
singleService.value = JSON.parse(options.obj)
|
||||
|
|
|
@ -82,11 +82,12 @@
|
|||
</template>
|
||||
|
||||
<script setup >
|
||||
import {nextTick, onMounted, ref} from 'vue'
|
||||
import {nextTick, onMounted, onUnmounted, ref} from 'vue'
|
||||
import { onLoad , onShow } from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
import emitter from '../../../utils/emitter'
|
||||
import addProduct from '../../Shopping-cart/component/addProduct.vue';
|
||||
import { dealResult } from '../../../common/globalFunction';
|
||||
const popup = ref(null) //弹窗对象
|
||||
const goodObject = ref({}) //商品对象
|
||||
const idInfo = ref(0) //发送到下一页的商品id
|
||||
|
@ -94,6 +95,7 @@ const userInfo = ref({}) //用户信息
|
|||
const labelList = ref([]) //标签
|
||||
const imgArr = ref([]) //商品图片数组
|
||||
const coupon = ref(0) //当前商品可用的优惠卷
|
||||
const cookie = wx.getStorageSync('cookie')
|
||||
//转换上一页面传来的商品
|
||||
onLoad((options) => {
|
||||
getProduct(JSON.parse(options.gid)) //页面加载的时候获取商品信息
|
||||
|
@ -101,19 +103,27 @@ onLoad((options) => {
|
|||
onShow(()=>{
|
||||
userInfo.value = wx.getStorageSync('userInfo') //获取用户信息
|
||||
})
|
||||
|
||||
const closeHandler = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
emitter.on('close',()=>{ //将关闭弹窗方法传入组件
|
||||
close()
|
||||
})
|
||||
emitter.on('close', closeHandler)
|
||||
getFonts()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('close', closeHandler)
|
||||
})
|
||||
|
||||
const getProduct = async (gid) =>{ //根据商品获取商品信息
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/goods/getById',
|
||||
method: 'POST',
|
||||
data: { id: gid },
|
||||
header: {
|
||||
cookie: wx.getStorageSync('cookie')
|
||||
cookie
|
||||
}
|
||||
})
|
||||
console.log('请求请求--->',res.data);
|
||||
|
@ -141,11 +151,14 @@ const close =()=>{
|
|||
})
|
||||
}
|
||||
//将商品对象发送到下一个页面
|
||||
const jump_buy =()=> {
|
||||
const jump_buy = async ()=> {
|
||||
let res = await checkGeneralGood()
|
||||
if (!dealResult(res)) return
|
||||
uni.navigateTo({
|
||||
url: '../../../pages/order/singleGoodOrder/singleGoodOrder?cartInfo=' + JSON.stringify(idInfo.value)
|
||||
})
|
||||
}
|
||||
|
||||
//获取字体
|
||||
const getFonts =()=>{
|
||||
uni.loadFontFace({
|
||||
|
@ -167,6 +180,31 @@ const previewImage = (index) => {
|
|||
urls: imgArr.value
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const checkGeneralGood = async () => {
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/goods/checkGeneralGood',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie
|
||||
},
|
||||
data: {
|
||||
id: idInfo.value
|
||||
}
|
||||
})
|
||||
return res
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -67,7 +67,6 @@ const product_type = [{
|
|||
detail: "提供材料自行DIY"
|
||||
}]
|
||||
onMounted( async () => {
|
||||
console.log('cookie--->',cookie);
|
||||
await Getsort() //获取商品类别
|
||||
await changeTypes( sort.value[0] , 0 ) //首先获取最开始的类别
|
||||
})
|
||||
|
|
|
@ -79,9 +79,6 @@ const product_type = ref({
|
|||
type: "材料包"
|
||||
})
|
||||
|
||||
onMounted( async () => {
|
||||
console.log('cookie--->',cookie);
|
||||
})
|
||||
onLoad( async (options)=>{
|
||||
await Getsort()
|
||||
await changeTypes( sort.value[0] , 0 ) //首先获取最开始的类别
|
||||
|
@ -279,8 +276,8 @@ const imgList = ref([{
|
|||
border-radius: 28.13rpx;
|
||||
}
|
||||
.image {
|
||||
width: 60.63rpx;
|
||||
height: 45rpx;
|
||||
width: 60.63rpx;
|
||||
height: 45rpx;
|
||||
}
|
||||
.text-wrapper {
|
||||
padding: 0 10rpx 0;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<script setup lang="ts">
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { onMounted } from "vue";
|
||||
import { baseUrl, testUrl } from "../../api/request";
|
||||
import { baseUrl } from "../../api/request";
|
||||
|
||||
let waybillToken = ''
|
||||
let access_token = ''
|
||||
|
|
|
@ -1,67 +0,0 @@
|
|||
<view class="flex-col justify-start relative page">
|
||||
<view class="section"></view>
|
||||
<text class="font text pos">选择预约类别</text>
|
||||
<view class="flex-row equal-division group">
|
||||
<view class="flex-col equal-division-item section_2">
|
||||
<image
|
||||
class="self-start image"
|
||||
src="https://ide.code.fun/api/image?token=675fbf94797f850011f2bedf&name=e29908fd7c3623fbb6854b38b828c5b8.png"
|
||||
/>
|
||||
<text class="self-center font mt-7">整套约拍</text>
|
||||
</view>
|
||||
<view class="ml-48 flex-col equal-division-item section_3">
|
||||
<image
|
||||
class="self-start image"
|
||||
src="https://ide.code.fun/api/image?token=675fbf94797f850011f2bedf&name=ca4da1e3507e3276bd2cf0946c8322bd.png"
|
||||
/>
|
||||
<text class="mt-8 self-center font text_2">自带服装</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="font text_3 pos_2">选择服装类别</text>
|
||||
<view class="flex-col section_4 pos_3">
|
||||
<view class="flex-col list">
|
||||
<view class="flex-row justify-between section_5" v-for="(item, index) in items" :key="index">
|
||||
<view class="flex-row items-end self-center">
|
||||
<image
|
||||
class="image_2"
|
||||
src="https://ide.code.fun/api/image?token=675fbf94797f850011f2bedf&name=72dc2b1fa62db33ed73692af7f65cb9b.png"
|
||||
/>
|
||||
<view class="ml-20 flex-col group_2">
|
||||
<text class="self-start font_2 text_4">简约风尚</text>
|
||||
<view class="flex-row items-center self-stretch group_3">
|
||||
<view class="group_4">
|
||||
<text class="font_2">价位</text>
|
||||
<text class="font_4">:</text>
|
||||
</view>
|
||||
<text class="ml-6 font_3 text_5">¥100-200</text>
|
||||
</view>
|
||||
<text class="self-stretch font_5 text_6">传承非遗之美,简约演绎经典</text>
|
||||
</view>
|
||||
</view>
|
||||
<image
|
||||
class="self-start image_3 image_4"
|
||||
src="https://ide.code.fun/api/image?token=675fbf94797f850011f2bedf&name=eee721f36de3196113485ea7e5c6b5ad.png"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="mt-22 flex-row justify-between items-center section_9">
|
||||
<view class="flex-row">
|
||||
<image
|
||||
class="shrink-0 self-center image_9"
|
||||
src="https://ide.code.fun/api/image?token=675fbf94797f850011f2bedf&name=0ed6323496056f793bd3c25b3dcd9eb6.png"
|
||||
/>
|
||||
<text class="self-start text_15">88.</text>
|
||||
<text class="self-center font_2 text_14">定金:</text>
|
||||
<text class="self-center text_17">00</text>
|
||||
<view class="flex-row shrink-0 section_10">
|
||||
<text class="text_18">费用说明</text>
|
||||
<image
|
||||
class="shrink-0 image_10 ml-3"
|
||||
src="https://ide.code.fun/api/image?token=675fbf94797f850011f2bedf&name=0455b173571a47fdc438588e788f26c5.png"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="flex-col justify-start items-center text-wrapper"><text class="font text_16">确定预约</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
|
@ -32,7 +32,7 @@
|
|||
</view>
|
||||
<view class="flex-row equal-division group_4">
|
||||
<view class="flex-col items-center section equal-division-item" :style="selectObj[index]" v-for="(item, index) in appointmentDateVOList" :key="index" @click="isSelected(index)">
|
||||
<text class="font" :style="fontColor[index]">星期二</text>
|
||||
<text class="font" :style="fontColor[index]">{{ getWeekday(item.specificDate) }}</text>
|
||||
<text class="font_3 mt-12" :style="fontColor[index]">{{item.specificDate.substring(5)}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -69,7 +69,7 @@
|
|||
<view class="flex-col justify-start items-center text-wrapper_3" @click="selectStatus()"><text class="font text_8">{{ btnText }}</text></view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="tip" :animation="false" @maskClick="maskClosehandler">
|
||||
<uni-popup ref="tip" :animation="false">
|
||||
<view class="pop">
|
||||
<tipVue></tipVue>
|
||||
</view>
|
||||
|
@ -79,19 +79,21 @@
|
|||
|
||||
<script setup>
|
||||
import tipVue from './tip.vue';
|
||||
import {onMounted, ref} from 'vue'
|
||||
import {onMounted, onUnmounted, ref} from 'vue'
|
||||
import emitter from '../../../utils/emitter';
|
||||
import { baseUrl } from '../../../api/request';
|
||||
import { workshopUrl } from '../../../common/globalImagesUrl';
|
||||
import { dealResult } from '../../../common/globalFunction';
|
||||
|
||||
|
||||
let selectObj = ref([])
|
||||
let fontColor = ref([])
|
||||
let fontColor = ref([])
|
||||
let itemSelectObj = ref([])
|
||||
let itemFontColor = ref([])
|
||||
|
||||
const cookie = wx.getStorageSync("cookie") //请求头
|
||||
const appIdx = ref(0)
|
||||
const tIdx = ref(0)
|
||||
const cnt = ref(1)
|
||||
const productObject = ref()
|
||||
const appointmentDateVOList = ref([])
|
||||
|
@ -100,60 +102,75 @@
|
|||
|
||||
|
||||
const restNumber = ref('请选择时间段')
|
||||
|
||||
|
||||
let countMap = new Map()
|
||||
|
||||
|
||||
|
||||
const getGoodDataHandler = (val) => {
|
||||
productObject.value = val
|
||||
appointmentDateVOList.value = val.appointmentDateVOList
|
||||
selectObj.value = new Array(appointmentDateVOList.value.length).fill(null).map(() => ({
|
||||
backgroundColor: '#fff',
|
||||
borderColor: '#C35C5D'
|
||||
}));
|
||||
fontColor.value = new Array(appointmentDateVOList.value.length).fill(null).map(() => ({
|
||||
color: '#323233'
|
||||
}))
|
||||
|
||||
selectObj.value[0] = {backgroundColor: '#FBDEDF', borderColor: '#FBDEDF'}
|
||||
fontColor.value[0] = {color: '#C35C5D'}
|
||||
|
||||
for (var i = 0; i < appointmentDateVOList.value.length; i ++ ) {
|
||||
var col = appointmentDateVOList.value[i].timePeriodVOList.length
|
||||
itemSelectObj.value[i] = new Array(col).fill(null).map(() => ({
|
||||
backgroundColor: '#F3F3F3'
|
||||
}))
|
||||
itemFontColor.value[i] = new Array(col).fill(null).map(() => ({
|
||||
color: '#323233'
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const getBookingNumberMapHandler = (val) => {
|
||||
countMap = val
|
||||
console.log("val==============>", val)
|
||||
appointmentDate = appointmentDateVOList.value[appIdx.value].specificDate;
|
||||
}
|
||||
|
||||
const countHandler = (val) => {
|
||||
nowSelected.value = val
|
||||
console.log('现在选择的是---->',nowSelected.value);
|
||||
statusChange() //更改按钮文字
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(() => {
|
||||
getFonts() //获取字体
|
||||
closeyyxzTip()
|
||||
emitter.on('getGoodData', (val) => {
|
||||
productObject.value = val
|
||||
// console.log('');
|
||||
appointmentDateVOList.value = val.appointmentDateVOList
|
||||
selectObj.value = new Array(appointmentDateVOList.value.length).fill(null).map(() => ({
|
||||
backgroundColor: '#fff',
|
||||
borderColor: '#C35C5D'
|
||||
}));
|
||||
fontColor.value = new Array(appointmentDateVOList.value.length).fill(null).map(() => ({
|
||||
color: '#323233'
|
||||
}))
|
||||
|
||||
selectObj.value[0] = {backgroundColor: '#FBDEDF', borderColor: '#FBDEDF'}
|
||||
fontColor.value[0] = {color: '#C35C5D'}
|
||||
|
||||
for (var i = 0; i < appointmentDateVOList.value.length; i ++ ) {
|
||||
var col = appointmentDateVOList.value[i].timePeriodVOList.length
|
||||
itemSelectObj.value[i] = new Array(col).fill(null).map(() => ({
|
||||
backgroundColor: '#F3F3F3'
|
||||
}))
|
||||
itemFontColor.value[i] = new Array(col).fill(null).map(() => ({
|
||||
color: '#323233'
|
||||
}))
|
||||
}
|
||||
})
|
||||
emitter.on('getGoodData', getGoodDataHandler)
|
||||
|
||||
emitter.on('getBookingNumberMap', (val) => { //将map集合传过来
|
||||
countMap = val
|
||||
console.log("val==============>", val)
|
||||
appointmentDate = appointmentDateVOList.value[appIdx.value].specificDate;
|
||||
})
|
||||
emitter.on('getBookingNumberMap', getBookingNumberMapHandler)
|
||||
|
||||
emitter.on('count',(val)=>{
|
||||
nowSelected.value = val
|
||||
console.log('现在选择的是---->',nowSelected.value);
|
||||
statusChange() //更改按钮文字
|
||||
})
|
||||
emitter.on('count', countHandler)
|
||||
})
|
||||
|
||||
|
||||
const maskClosehandler = () => {
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('getGoodData', getGoodDataHandler)
|
||||
|
||||
}
|
||||
emitter.off('getBookingNumberMap', getBookingNumberMapHandler)
|
||||
|
||||
emitter.off('count', countHandler)
|
||||
})
|
||||
|
||||
|
||||
const addCart = async () =>{ //加入购物车方法
|
||||
console.log('日期--->',appointmentDate,'时间段--->',timeSlot,'数量--->',cnt.value,'商品id---->',productObject.value.id);
|
||||
if(appointmentDate === '' || timeSlot === '' ) {
|
||||
await uni.showToast({
|
||||
uni.showToast({
|
||||
icon: 'error',
|
||||
title: "字段不能为空"
|
||||
})
|
||||
|
@ -163,15 +180,16 @@
|
|||
url: baseUrl + '/cartExperience/add',
|
||||
method: 'POST',
|
||||
header: {
|
||||
'cookie': wx.getStorageSync('cookie')
|
||||
cookie
|
||||
},
|
||||
data: {
|
||||
goodId : productObject.value.id,
|
||||
quantity : cnt.value,
|
||||
reservationDate : appointmentDate,
|
||||
timeSlot : timeSlot
|
||||
timeSlot : timeSlot,
|
||||
quantity : cnt.value
|
||||
}
|
||||
})
|
||||
if (!dealResult(res)) return
|
||||
console.log('加入购物车结果',res);
|
||||
if(res.data.code === 1) {
|
||||
uni.showToast({
|
||||
|
@ -226,6 +244,7 @@
|
|||
|
||||
|
||||
const isSelected = (index) => { //选择预约日期方法
|
||||
if (appIdx.value === index) return
|
||||
appIdx.value = index
|
||||
restNumber.value = '请选择时间段'
|
||||
appointmentDate = appointmentDateVOList.value[appIdx.value].specificDate;
|
||||
|
@ -281,7 +300,8 @@
|
|||
goToBook()
|
||||
}
|
||||
}
|
||||
const goToBook =()=> { //去预约方法
|
||||
|
||||
const goToBook = async () => { //去预约方法
|
||||
console.log('日期--->',appointmentDate,'时间段--->',timeSlot,'数量--->',cnt.value,'商品id---->',productObject.value.id);
|
||||
if(appointmentDate === '' || timeSlot === '' ) {
|
||||
uni.showToast({
|
||||
|
@ -290,8 +310,24 @@
|
|||
})
|
||||
return;
|
||||
}
|
||||
console.log('productObj--->',productObject.value);
|
||||
console.log('数量--->',cnt.value);
|
||||
console.log('id---------------------------->',productObject.value.id);
|
||||
|
||||
const res = await uni.request({
|
||||
url: baseUrl + '/goods/checkServiceGood',
|
||||
method: 'POST',
|
||||
header: {
|
||||
cookie
|
||||
},
|
||||
data: {
|
||||
goodId: productObject.value.id,
|
||||
reservationDate: appointmentDate,
|
||||
timeSlot: timeSlot,
|
||||
quantity: cnt.value
|
||||
}
|
||||
})
|
||||
console.log(res)
|
||||
if (!dealResult(res)) return ;
|
||||
|
||||
uni.navigateTo({ //跳转到待支付页面
|
||||
//商品信息+数量
|
||||
url: '/pages/order/singleServiceWait/singleServiceWait?obj='
|
||||
|
@ -312,6 +348,14 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function getWeekday(dateStr) {
|
||||
const date = new Date(dateStr);
|
||||
const weekdays = ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"];
|
||||
return weekdays[date.getDay()];
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref,onMounted, nextTick } from 'vue'
|
||||
import { ref,onMounted, nextTick, onUnmounted } from 'vue'
|
||||
import { onLoad } from "@dcloudio/uni-app";
|
||||
import { baseUrl } from '../../../api/request';
|
||||
import timeSelectVue from '../component/timeSelect.vue';
|
||||
|
@ -83,11 +83,19 @@ const productObject = ref({})
|
|||
const popup = ref(null) //弹窗对象
|
||||
const pObj = {}
|
||||
const appointmentDateVOList = ref([])
|
||||
|
||||
const closeTimeDialogHandler = () => {
|
||||
close()
|
||||
}
|
||||
|
||||
onMounted(()=>{
|
||||
emitter.on('closeTimeDialog',()=>{
|
||||
close()
|
||||
})
|
||||
emitter.on('closeTimeDialog', closeTimeDialogHandler)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off('closeTimeDialog', closeTimeDialogHandler)
|
||||
})
|
||||
|
||||
onLoad((options)=>{
|
||||
pid.value = JSON.parse(options.info)
|
||||
getProduct()
|
||||
|
|
|
@ -49,11 +49,6 @@
|
|||
|
||||
|
||||
const goToSearch = () => {
|
||||
// if (type.value == 1) {
|
||||
// routerJump('pages/store-home/main/testMain')
|
||||
// } else {
|
||||
// uni.navigateBack({})
|
||||
// }
|
||||
uni.redirectTo({
|
||||
url: '/pages/workshop/searchGood/searchGood'
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue
Block a user