From 58d63637b67a7c565618379268da604e6231fc4c Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期三, 27 八月 2025 18:16:48 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
small-program/pages/index/index.vue | 336 ++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 243 insertions(+), 93 deletions(-)
diff --git a/small-program/pages/index/index.vue b/small-program/pages/index/index.vue
index 5b2c779..1299158 100644
--- a/small-program/pages/index/index.vue
+++ b/small-program/pages/index/index.vue
@@ -1,7 +1,7 @@
<template>
<view class="index">
<!-- 鎺ュ崟鏂� -->
- <view class="index-j" v-if="typeViewId === 1">
+ <view class="index-j" v-if="userInfo && userInfo.useIdentity === 1">
<view class="index-j-head">
<view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
<view class="index-c-title" :style="{ height: navHeight + 'px' }">
@@ -74,14 +74,15 @@
<text>楼{{item.estimatedAccount / 100}}</text>
</view>
<view class="eidt">
- <sunui-mverify @change="getaccept($event, item.id, index)"></sunui-mverify>
+ <!-- <sunui-mverify @change="getaccept($event, item.id, index)"></sunui-mverify> -->
+ <view class="eidt-btn" @click="show1 = true, orderId = item.id">鎶㈠崟</view>
</view>
</view>
</view>
</view>
- <!-- 鍙戝崟鏂� -->
- <view class="index-c" v-if="typeViewId === 0">
+ <!-- 鍙戝崟鏂� -->
+ <view class="index-c" v-if="!userInfo || userInfo.useIdentity === 0">
<view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view>
<view class="index-c-title" :style="{ height: navHeight + 'px' }" @click="selectAddress(-1)">
<text class="index-c-title-logo">杩戝揩</text>
@@ -119,12 +120,13 @@
<view class="radio-item-label">{{item.name}}</view>
<view class="radio-item-list">
<view class="radio-item-list-l">
- <view :class="child.active ? 'radio-item-list-item active' : 'radio-item-list-item'" v-for="(child, childIndex) in item.list" :key="childIndex" @click="selectMenu(index, childIndex)">{{child.price}}鍏�</view>
+ <view v-if="child.price" :class="child.active ? 'radio-item-list-item active' : 'radio-item-list-item'" v-for="(child, childIndex) in item.list" :key="childIndex" @click="selectMenu(index, childIndex)">{{child.price||0}}鍏�</view>
</view>
<view class="radio-item-list-data">
- <text>浠芥暟锛�</text>
+ <text style="flex-shrink: 0;">浠芥暟锛�</text>
<input type="number" v-model="item.num" placeholder="璇疯緭鍏�">
<text style="color: #999999;">浠�</text>
+ <view class="radio-item-list-data-btn" @click="clear(index)">鍙栨秷</view>
</view>
</view>
</view>
@@ -194,7 +196,7 @@
</view>
<view class="box-hz-btn" :style="{ backgroundImage: 'url(' + btn + ')' }">
<view class="box-hz-btn-kf" @click="contactPhone()">瀹㈡湇</view>
- <view class="box-hz-btn-next" @click="submit">涓嬩竴姝�</view>
+ <view class="box-hz-btn-next" @click="submit">绔嬪嵆涓嬪崟</view>
</view>
</view>
</template>
@@ -256,14 +258,14 @@
<view :class="form.startDate ? 'box-hz-list-item-val active' : 'box-hz-list-item-val'">
<view class="box-hz-list-item-val-left">
<image class="icon" src="/static/icon/ic_time@2x.png" mode="widthFix"></image>
- <text>{{ form.startDate ? form.startDate + ' 鑷� ' + form.endDate : '璇烽�夋嫨鐢ㄥ伐鏃堕棿'}}</text>
+ <text>{{ form.startDate ? form.startDate + ' 鑷� ' + form.endDate : '璇烽�夋嫨鐢ㄨ溅鏃堕棿'}}</text>
</view>
<u-icon name="arrow-right" color="#111111" size="16"></u-icon>
</view>
</view>
<view class="box-hz-list-item">
<view class="box-hz-list-item-label">
- <text>鐢ㄨ溅鏃堕棿锛�</text>
+ <text>鐢ㄨ溅鍦扮偣锛�</text>
<text @click="addAddr">+澧炲姞閫旂粡鐐�</text>
</view>
<view class="item-d">
@@ -304,15 +306,16 @@
<view class="box-hz-btn" :style="{ backgroundImage: 'url(' + btn + ')' }">
<view class="box-hz-btn-kf" @click="contactPhone()" >瀹㈡湇</view>
- <view class="box-hz-btn-next" @click="jump()">涓嬩竴姝�</view>
+ <view class="box-hz-btn-next" @click="jump()">绔嬪嵆涓嬪崟</view>
</view>
</view>
</view>
</view>
<!-- 閫夋嫨鏃ユ湡鑼冨洿 -->
- <u-calendar :show="show" color="#00BC12" mode="range" @close="show = false" @confirm="confirmDate"></u-calendar>
- <u-popup :show="showPhone" round="15" mode="bottom" @close="contactPhone()" :closeable="true" :closeOnClickOverlay="true">
+ <u-calendar :show="show" color="#00BC12" :allowSameDay="true" mode="range" @close="show = false" @confirm="confirmDate"></u-calendar>
+
+ <u-popup :show="showPhone" round="15" mode="bottom" :safeAreaInsetBottom="true" @close="contactPhone()" :closeable="true" :closeOnClickOverlay="true">
<view class="phone">
<view class="phone-head">
<view></view>
@@ -322,9 +325,25 @@
<view></view>
<text>{{item}}</text>
</view>
+ <view style="width: 100%; height: 30rpx;"></view>
<!-- <view class="phone-botton" @click="contactPhone()" >鍏抽棴</view> -->
</view>
</u-popup>
+
+ <u-modal
+ title="娓╅Θ鎻愮ず"
+ :show="show1"
+ closeOnClickOverlay
+ showCancelButton
+ >
+ <view class="slot-content">
+ 鏄惁纭鎶㈠崟锛�
+ </view>
+ <view slot="confirmButton" style="display: flex; justify-content: space-between; align-items: center; width: 100%;">
+ <view class="btn1" @click="show1 = false">鍙栨秷</view>
+ <view class="btn2" @click="getaccept1">纭</view>
+ </view>
+ </u-modal>
</view>
</template>
@@ -401,7 +420,8 @@
linkName: '',
linkPhone: '',
estimatedAccount: '',
- price: ''
+ price: '',
+ address: ''
},
sortType: 0,
orderList: [],
@@ -409,21 +429,24 @@
page: 1,
next: true,
- isOnce: true
+ isOnce: true,
+ show1: false,
+ orderId: null
}
},
async onLoad() {
await this.$onLaunched;
-
- if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}' && this.userInfo.useIdentity === 1) {
- this.getOrderList()
- }
+ console.log('2')
+ // if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}' && this.userInfo.useIdentity === 1) {
+ // this.getOrderList()
+ // }
this.getCategoryLists()
this.getDictInfo()
if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
- this.form.linkPhone = this.userInfo.telephone
+ this.form.linkPhone = this.userInfo.telephone || ''
+ this.form.linkName = this.userInfo.name || ''
}
this.qqmapsdk = new QQMapWX({
@@ -438,16 +461,15 @@
this.form.location = ''
this.form.locationEnd = ''
this.form.wayInfoDTOList = []
- this.form.workType = 0
+ this.form.workType = 0
this.form.days = ''
this.form.locationRemark = ''
this.form.supplement = ''
this.form.multifileList = []
- this.form.linkName = ''
this.form.estimatedAccount = ''
this.form.price = ''
this.form.address = ''
- this.orderFood = []
+ this.clearAll()
})
// 鍒锋柊棣栭〉鏁版嵁
uni.$on('refresh', () => {
@@ -459,13 +481,35 @@
}
})
},
- onShow(options) {
- this.typeViewId = 0
+ async onShow(options) {
+ await this.$onLaunched;
+ console.log('2')
+ this.form.startDate = ''
+ this.form.address = ''
+ this.form.endDate = ''
+ this.form.latitude = ''
+ this.form.longitude = ''
+ this.form.location = ''
+ this.form.locationEnd = ''
+ this.form.wayInfoDTOList = []
+ this.form.workType = 0
+ this.form.days = ''
+ this.form.locationRemark = ''
+ this.form.supplement = ''
+ this.form.multifileList = []
+ this.form.estimatedAccount = ''
+ this.form.price = ''
+ this.viewStatus = false
+ this.clearAll()
+
if(this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}') {
console.log('宸茬櫥闄�')
this.isLogin = true
- if (!this.isOnce && this.userInfo.useIdentity == 1) {
+ // this.typeViewId = this.userInfo.useIdentity
+ // !this.isOnce &&
+ if (this.userInfo.useIdentity === 1) {
+ console.log('宸茬櫥闄�111')
this.page = 1
this.next = true
this.orderList = []
@@ -476,16 +520,13 @@
this.isLogin = false
console.log('鏈櫥闄�')
}
-
- if (this.userInfo && this.userInfo.useIdentity == 1) {
- this.typeViewId = 1
- }
},
watch: {
typeId: {
handler(news, old) {
+ console.log('typeId')
this.form.startDate = ''
-
+ this.form.address = ''
this.form.endDate = ''
this.form.latitude = ''
this.form.longitude = ''
@@ -497,10 +538,10 @@
this.form.locationRemark = ''
this.form.supplement = ''
this.form.multifileList = []
- this.form.linkName = ''
this.form.estimatedAccount = ''
this.form.price = ''
this.viewStatus = false
+ this.clearAll()
}
},
orderFood: {
@@ -535,6 +576,20 @@
}
},
methods: {
+ clear(index) {
+ this.orderFood[index].num = ''
+ this.orderFood[index].list.forEach(item => {
+ item.active = false
+ })
+ },
+ clearAll() {
+ this.orderFood.forEach(p=>{
+ p.num=null
+ p.list.forEach(item => {
+ item.active = false
+ })
+ })
+ },
getDictInfo(){
var that = this;
this.$u.api.getPlatformAboutUs({}).then(res =>{
@@ -553,20 +608,33 @@
}
},
// 鎵嬪姩鎺ュ崟
- getaccept(e, orderId, index) {
- if (!e.msg) return;
- this.$u.api.accept({ orderId })
- .then(res => {
- if (res.code === 200) {
+ getaccept() {
+ var that = this;
+ that.$u.api.accept({ orderId: this.orderId })
+ .then(res1 => {
+ if (res1.code === 200) {
uni.showToast({ title: '鎶㈠崟鎴愬姛锛�', icon: 'success', duration: 2000 })
setTimeout(() => {
- this.page = 1
- this.next = true
- this.orderList = []
- this.getOrderList()
+ that.page = 1
+ that.next = true
+ that.orderList = []
+ that.getOrderList()
}, 2000)
}
})
+ },
+ getaccept1() {
+ var that = this;
+ this.show1 = false
+ uni.requestSubscribeMessage({
+ tmplIds: ['tDpYImlrdv-0d3euTrHbYZ1cEZvjVHTNlqHvV0tpLHg'],
+ success(res) {
+ that.getaccept()
+ },
+ fail(err) {
+ that.getaccept()
+ }
+ })
},
clickSort(id) {
this.sortType = id
@@ -592,8 +660,8 @@
queryMyOrderType: 2,
type: this.typeVal,
sortType: this.sortType,
- queryLat: this.latitude,
- queryLgt: this.longitude
+ queryLat: uni.getStorageSync('address').latitude,
+ queryLgt: uni.getStorageSync('address').longitude
}
}).then(res => {
if (res.code !== 200) return;
@@ -620,11 +688,34 @@
},
// 鎻愪氦璁㈠崟
submit() {
+ var that = this
if (!this.form.startDate) {
return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鏃堕棿', icon: 'none' })
+ }
+ let cateringDTOList = []
+ let valid = true
+ let msg ='璇烽�夋嫨'
+ that.orderFood.forEach(item => {
+ item.list.forEach(child => {
+ if (child.active) {
+ // (Number(child.price) * Number(item.num))
+ if( !item.num){
+ msg =msg +'銆�'+item.name+'銆�';
+ valid =false
+ }
+ cateringDTOList.push({
+ name: item.name,
+ num: item.num,
+ price: child.price * 100
+ })
+ }
+ })
+ })
+ if(!valid){
+ return uni.showToast({ title: msg+'鐢ㄩ浠芥暟', icon: 'none' })
}
- if (this.form.price === 0) {
- return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鏃堕棿', icon: 'none' })
+ if (cateringDTOList.length === 0) {
+ return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鏍囧噯', icon: 'none' })
}
if (!this.form.address) {
return uni.showToast({ title: '璇烽�夋嫨鐢ㄩ鍦扮偣', icon: 'none' })
@@ -632,52 +723,48 @@
if (!this.form.linkPhone) {
return uni.showToast({ title: '璇疯緭鍏ヨ仈绯荤數璇�', icon: 'none' })
}
- let cateringDTOList = []
- this.orderFood.forEach(item => {
- item.list.forEach(child => {
- if (child.active) {
- cateringDTOList.push({
- name: item.name,
- num: item.num,
- price: (Number(child.price) * Number(item.num)) * 100
- })
- }
- })
- })
- this.$u.api.release({
- ...this.form,
- type: 2,
- price: Number(this.form.price) * 100,
- priceNum1: this.form.days,
- location: this.form.address,
- lat: this.form.latitude,
- lgt: this.form.longitude,
- cateringDTOList
- }).then(res => {
- if (res.code == 200) {
- wx.requestPayment({
- timeStamp: res.data.object.timeStamp,
- nonceStr: res.data.object.nonceStr,
- package: res.data.object.packageVal,
- signType: res.data.object.signType,
- paySign: res.data.object.paySign,
- success (res1) {
- if (res1.errMsg = 'requestPayment:ok') {
- uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
- setTimeout(() => {
- uni.navigateTo({
- url: `/pages/success/success?orderId=${res.data.id}`
- })
- }, 1500)
- }
- },
- fail(err) {
- console.log(err)
+ uni.requestSubscribeMessage({
+ tmplIds: ['oVjOBLcHxIlGzOMJsdInmgI5CHGXh-UTvMzQqfFOnIg'],
+ success(res) {
+ that.$u.api.release({
+ ...that.form,
+ type: 2,
+ price: Number(that.form.price) * 100,
+ priceNum1: that.form.days,
+ location: that.form.address,
+ lat: that.form.latitude,
+ lgt: that.form.longitude,
+ cateringDTOList
+ }).then(res => {
+ if (res.code == 200) {
+ wx.requestPayment({
+ timeStamp: res.data.object.timeStamp,
+ nonceStr: res.data.object.nonceStr,
+ package: res.data.object.packageVal,
+ signType: res.data.object.signType,
+ paySign: res.data.object.paySign,
+ success (res1) {
+ if (res1.errMsg = 'requestPayment:ok') {
+ uni.showToast({ title: '鏀粯鎴愬姛', icon: 'success', duration: 2000 });
+ setTimeout(() => {
+ uni.navigateTo({
+ url: `/pages/success/success?orderId=${res.data.id}`
+ })
+ }, 1500)
+ }
+ },
+ fail(err) {
+ console.log(err)
+ }
+ })
}
})
+ console.log(cateringDTOList)
+ },
+ fail(err) {
+ console.log(err)
}
})
- console.log(cateringDTOList)
},
uploadImg() {
uni.chooseImage({
@@ -729,7 +816,10 @@
confirmDate(e) {
this.form.startDate = e[0]
this.form.endDate = e[e.length - 1]
- this.form.days = e.length;
+
+ let time = this.form.startDate == this.form.endDate ? 1 : 0
+
+ this.form.days = e.length - time;
this.show = false
if (this.typeId === 2) {
this.getPrice()
@@ -738,18 +828,19 @@
selectAddress(type, index) {
uni.chooseLocation({
success: (res) => {
+ console.log("==================",res)
if ([1,2].includes(type)) {
this.form.latitude = res.latitude
this.form.longitude = res.longitude
- this.form.address = res.address
+ this.form.address = res.name ||res.address
} else if (type === 3) {
- this.form.locationEnd = res.address
+ this.form.locationEnd = res.name ||res.address
this.form.latEnd = res.latitude
this.form.lgtEnd = res.longitude
} else if (type === 4) {
- this.form.wayInfoDTOList[0].lat = res.latitude
- this.form.wayInfoDTOList[0].lgt = res.longitude
- this.form.wayInfoDTOList[0].location = res.address
+ this.form.wayInfoDTOList[index].lat = res.latitude
+ this.form.wayInfoDTOList[index].lgt = res.longitude
+ this.form.wayInfoDTOList[index].location = res.name|| res.address
}else if (type == -1) {
console.log(res)
this.location.latitude = res.latitude
@@ -760,6 +851,12 @@
});
},
clickType(e) {
+ if (!this.token) {
+ uni.navigateTo({
+ url: '/pages/login/login'
+ })
+ return
+ }
this.typeId = e
if (e === 2) {
this.form.categoryId = this.car[0].id
@@ -895,6 +992,36 @@
<style lang="scss" scoped>
.index {
width: 100%;
+ .slot-content {
+ width: 100%;
+ text-align: center;
+ font-weight: 400;
+ font-size: 30rpx;
+ color: #333333;
+ margin: 30rpx 0;
+ }
+ .btn1 {
+ width: 264rpx;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ font-weight: 400;
+ font-size: 32rpx;
+ color: #666666;
+ border-radius: 44rpx;
+ border: 1rpx solid #B2B2B2;
+ }
+ .btn2 {
+ width: 264rpx;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ font-weight: 500;
+ font-size: 32rpx;
+ color: #FFFFFF;
+ background: #00BC12;
+ border-radius: 44rpx;
+ }
.index-j {
width: 100%;
.index-j-head {
@@ -1001,6 +1128,17 @@
display: flex;
align-items: center;
justify-content: center;
+ .eidt-btn {
+ width: 100%;
+ height: 88rpx;
+ line-height: 88rpx;
+ text-align: center;
+ background: #00BC12;
+ border-radius: 44rpx;
+ font-weight: 500;
+ font-size: 32rpx;
+ color: #FFFFFF;
+ }
// background: #00BC12;
// border-radius: 50rpx;
// text {
@@ -1270,7 +1408,7 @@
.radio-item {
width: 100%;
display: flex;
- align-items: self-end;
+ align-items: flex-start;
margin-bottom: 30rpx;
border-bottom: 1rpx solid #E5E5E5;
&:last-child {
@@ -1329,6 +1467,18 @@
justify-content: flex-end;
margin-top: 42rpx;
margin-bottom: 34rpx;
+ .radio-item-list-data-btn {
+ width: 110rpx;
+ height: 64rpx;
+ line-height: 64rpx;
+ margin-left: 20rpx;
+ font-weight: 400;
+ font-size: 24rpx;
+ color: #666666;
+ text-align: center;
+ border: 1rpx solid #B2B2B2;
+ border-radius: 34rpx;
+ }
text {
font-weight: 400;
font-size: 30rpx;
--
Gitblit v1.9.3