py 1 год назад
Родитель
Сommit
56e042b719

+ 7 - 0
api/errands.js

@@ -0,0 +1,7 @@
+import {request} from '../service/ajax.js'
+
+const newsUrl = '/api/errands/'
+// 获取轮播图
+export const errandsBanner = (data) => request(newsUrl + 'banner', 'post', { ...data },false)
+// 获取服务列表
+export const errandsServe = (data) => request(newsUrl + 'serve', 'post', { ...data },false)

+ 13 - 0
api/errandsOrder.js

@@ -0,0 +1,13 @@
+import {request} from '../service/ajax.js'
+
+const newsUrl = '/api/errandsOrder/'
+// 获取订单状态
+export const errandsOrderStatus = (data) => request(newsUrl + 'status', 'post', { ...data },false)
+// 获取支付信息
+export const errandsOrderPayInfo = (data) => request(newsUrl + 'pay_info', 'post', { ...data },false)
+// 订单支付
+export const errandsOrderPay = (data) => request(newsUrl + 'pay', 'post', { ...data },false)
+// 订单列表
+export const errandsOrderList = (data) => request(newsUrl + 'list', 'post', { ...data },false)
+// 取消订单
+export const errandsOrderCancel = (data) => request(newsUrl + 'cancel', 'post', { ...data },false)

+ 6 - 2
common/css/common.css

@@ -662,7 +662,9 @@ image {
 .p-t-20 {
 	padding-top: 20rpx;
 }
-
+.pt-15 {
+	padding-top: 15rpx;
+}
 .pt-33 {
 	padding-top: 33rpx;
 }
@@ -712,7 +714,9 @@ image {
 .plr-32 {
 	padding: 0 32rpx;
 }
-
+.ptb-15 {
+	padding: 15rpx 0;
+}
 .ptb-24 {
 	padding: 24rpx 0;
 }

+ 220 - 0
pages-takeout/run-errands.vue

@@ -0,0 +1,220 @@
+<template>
+	<view class="flex-common-css iPhone-bottom box-border-box p-24">
+		<Nav title="跑腿代拿" leftIconColor="#333" titleColor="#333"></Nav>
+		<scroll-view :scroll-y="true" class="scroll-view-css">
+			<view class="box-border-box mb-20">
+				<uni-swiper-dot :info="bannerList" mode="dot" :dotsStyles="dotStyle" :current="current">
+					<swiper class="swiper" @change="change" :autoplay='true' :circular='true' interval="4000">
+						<swiper-item v-for="(item,i) in bannerList" :key="i">
+							<image class="swiper-item" :src="item.image" mode="aspectFill">
+							</image>
+						</swiper-item>
+					</swiper>
+				</uni-swiper-dot>
+			</view>
+			<view class="align-items-center p-16 box-border-box b-rad-20 bgc-f mb-20">
+				<view class="flex-1 flex-direction align-items-center b-rad-20 ptb-15" v-for="(item,index) in serveData"
+					:key="index" @click="serveClick(item)"
+					:class="formData.errands_id === item.errands_id?'bgc-BCEAFF':'bgc-f'">
+					<image class="item-img mb-8 b-rad-16" :src="item.img" mode=""></image>
+					<view class="text-align-center fs-26">
+						{{item.name}}
+					</view>
+				</view>
+			</view>
+			<view class="form-box bgc-f b-rad-16 p-20 box-border-box">
+				<view class="align-items-flex-start mb-20">
+					<view class="fs-26 fc-3 mr-20 flex-shrink0 pt-15">
+						<text class="fc-ff3939">*</text>服务描述 :
+					</view>
+					<view class="textarea-box flex-1 bgc-F6F6F6 b-rad-16">
+						<textarea class="textarea" v-model="formData.serve_desc" maxlength='100' :placeholder="errandsData.desc" />
+					</view>
+				</view>
+				<view class="align-items-flex-start mb-20">
+					<view class="fs-26 fc-3 mr-20 flex-shrink0 pt-15">
+						图片介绍 :
+					</view>
+					<view class="up-img-box align-items-center flex-wrap-wrap">
+						<view class="up-img" v-for="(item, index) in formData.images" :key="index">
+							<image class="img" :src="item" mode="aspectFill"></image>
+							<uni-icons @click="deleteImg(index)" class="delete-icons" color="#000" type="clear"
+								size="20"></uni-icons>
+						</view>
+						<view @click="upImg" v-if="formData.images.length<= 5"
+							class="add-img-box flex-direction flex-justify-center align-items-center bgc-F6F6F6">
+							<image class="add-img" src="@/static/img/my/sc.png" mode=""></image>
+							<view class="fs-20 fc-9">
+								上传照片
+							</view>
+							<view class="fs-20 fc-9">
+								(最多6张)
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="align-items-flex-start mb-20" v-if="errandsData.errands_id != 2">
+					<view class="fs-26 fc-3 mr-20 flex-shrink0 pt-15">
+						<text class="fc-ff3939">*</text>服务地址 :
+					</view>
+					<view class="textarea-box flex-1 bgc-F6F6F6 b-rad-16">
+						<textarea class="textarea" v-model="formData.serve_address" maxlength='100' :placeholder="errandsData.add_str" />
+					</view>
+				</view>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import {
+		errandsBanner,
+		errandsServe
+	} from "@/api/errands.js"
+	import tools from '@/service/tools';
+	import {
+		upLoadingFileOss
+	} from "@/service/upLoadingFile.js"
+	export default {
+		components: {},
+		data() {
+			return {
+				bannerList: [],
+				dotStyle: {
+					width: 6,
+					bottom: 6,
+					backgroundColor: 'rgba(51, 51, 51,0.3)',
+					border: '1px rgba(0,0,0,0) solid',
+					color: '#fff',
+					selectedBackgroundColor: 'rgba(79, 179, 239,0.9)',
+					selectedBorder: '1px rgba(0,0,0,0) solid'
+				},
+				current: 0,
+				serveData: [], // 类型
+				errandsData: {}, // 类型对应的数据
+				formData: {
+					errands_id: 0,
+					serve_desc: '',
+					images: []
+				}
+			};
+		},
+		onLoad(data) {},
+		mounted() {
+			this.getBanner()
+			this.getErrandsServe()
+		},
+		methods: {
+			deleteImg(index) {
+				this.formData.images.splice(index, 1)
+			},
+			upImg() {
+				uni.chooseImage({
+					count: 6,
+					sizeType: ["compressed", "camera"],
+					sourceType: ["album", "camera"],
+					success: (res) => {
+						res.tempFiles.forEach((file) => {
+							this.uploadingFile(file);
+						})
+					}
+				})
+			},
+			uploadingFile(file) {
+				upLoadingFileOss(file.path).then((res) => {
+					if (res) {
+						this.formData.images.push(res)
+					} else {
+						tools.error('图片上传失败')
+					}
+				})
+			},
+			serveClick(item) {
+				if (this.formData.errands_id === item.errands_id) {
+					return
+				}
+				this.formData.errands_id = item.errands_id
+				this.errandsData = item
+			},
+			getBanner() {
+				errandsBanner().then((res) => {
+					if (res.code === 1) {
+						this.bannerList = res.data;
+					}
+				})
+			},
+			getErrandsServe() {
+				errandsServe().then((res) => {
+					if (res.code === 1) {
+						this.serveData = res.data
+						this.formData.errands_id = this.serveData[0].errands_id
+						this.errandsData = this.serveData[0]
+					}
+				})
+			},
+			change(e) {
+				this.current = e.detail.current
+			},
+		},
+	}
+</script>
+
+<style lang="scss" scoped>
+	.swiper {
+		width: 702rpx;
+		height: 280rpx;
+		border-radius: 20rpx;
+
+		.swiper-item {
+			width: 702rpx;
+			height: 280rpx;
+			border-radius: 20rpx;
+		}
+	}
+
+	.item-img {
+		width: 60rpx;
+		height: 60rpx;
+	}
+
+	.up-img {
+		width: 150rpx;
+		height: 150rpx;
+		margin: 0 8rpx 8rpx 0;
+		position: relative;
+
+		.img {
+			width: 100%;
+			height: 100%;
+			border-radius: 10rpx;
+		}
+
+		.delete-icons {
+			position: absolute;
+			right: 0;
+			top: 0;
+		}
+	}
+
+	.textarea-box {
+		height: 200rpx;
+	}
+
+	.textarea {
+		width: 100%;
+		height: 100%;
+		padding: 20rpx;
+		box-sizing: border-box;
+	}
+
+	.add-img-box {
+		width: 150rpx;
+		height: 150rpx;
+		border: 1px dashed #666;
+
+		.add-img {
+			width: 36rpx;
+			height: 36rpx;
+		}
+	}
+</style>

+ 10 - 4
pages.json

@@ -1,8 +1,8 @@
 {
 	"tabBar": {
 		"backgroundColor": "#fff",
-		"selectedColor": "#41ABF5",
-		"color": "#666",
+		"selectedColor": "#3BB5FE",
+		"color": "#000",
 		"borderStyle": "white",
 		"fontSize": "20rpx",
 		"iconWidth": "48rpx",
@@ -21,8 +21,8 @@
 			},
 			{
 				"pagePath": "pages/chat/index",
-				"iconPath": "static/img/tabBar/my.png",
-				"selectedIconPath": "static/img/tabBar/my-highlight.png",
+				"iconPath": "static/img/tabBar/ai.png",
+				"selectedIconPath": "static/img/tabBar/ai-highlight.png",
 				"text": "Al助手"
 			},
 			{
@@ -276,6 +276,12 @@
 					"style": {
 						"navigationBarTitleText": "优质团购"
 					}
+				},
+				{
+					"path": "run-errands",
+					"style": {
+						"navigationBarTitleText": "跑腿代拿"
+					}
 				}
 			]
 		},

+ 109 - 40
pages/chat/index.vue

@@ -138,30 +138,76 @@
 					this.aiMsgList()
 				}
 			},
+			// aiMsgList() {
+			// 	aiMsgList({
+			// 		page: this.page
+			// 	}).then((res) => {
+			// 		if (res.code == 1) {
+			// 			this.total = res.data.total
+			// 			let data = res.data.items.reverse()
+			// 			data.forEach((itm) => {
+			// 				itm.showType = false
+			// 			})
+			// 			this.chatData.unshift(...data)
+			// 			let that = this
+			// 			// this.$nextTick(() => {
+			// 			// 	this.scrollToBottom()
+			// 			// })
+			// 			setTimeout(() => {
+			// 				that.scrollToBottom()
+			// 			}, 50)
+			// 		}
+			// 	})
+			// },
 			aiMsgList() {
 				aiMsgList({
 					page: this.page
 				}).then((res) => {
 					if (res.code == 1) {
-						this.total = res.data.total
-						let data = res.data.items.reverse()
-						data.forEach((itm) => {
-							itm.showType = false
-						})
-						this.chatData.unshift(...data)
-						let that = this
-						// this.$nextTick(() => {
-						// 	this.scrollToBottom()
-						// })
-						setTimeout(() => {
-							that.scrollToBottom()
-						}, 50)
+						this.total = res.data.total;
+						let data = res.data.items.reverse();
+						if (data.length === 0) {
+							console.log('没有新数据加载');
+							return;
+						}
+						if (data.length > 0) {
+							data.forEach((itm) => {
+								itm.showType = false;
+							});
+							if (this.page === 1) {
+								this.chatData.unshift(...data);
+								setTimeout(() => {
+									this.scrollToBottom()
+								}, 50)
+							} else {
+								// 记录当前 chat-box 的高度
+								let lodQuery = uni.createSelectorQuery().in(this);
+								lodQuery.select('#chat-box').boundingClientRect((rect) => {
+									console.log(rect, 'rect');
+									if (rect) {
+										let oldHeight = rect.height; // 记录旧高度
+										// 插入新数据
+										this.chatData.unshift(...data);
+										// 计算新高度并滚动到正确位置
+										this.$nextTick(() => {
+											lodQuery.select('#chat-box').boundingClientRect((newRect) => {
+												if (newRect) {
+													let newHeight = newRect.height;
+													let scrollTop = newHeight - oldHeight; // 计算需要滚动的距离
+													// 设置 scrollTop
+													this.scrollTop = scrollTop;
+													console.log(scrollTop,'???????????');
+													this.$forceUpdate();
+												}
+											})
+										});
+									}
+								}).exec()
+							}
+						}
 					}
 				})
 			},
-			// onTabItemTap() {
-			// 	uni.hideTabBar()
-			// },
 			leftClick() {
 				uni.switchTab({
 					url: 'pages/index/index'
@@ -200,39 +246,62 @@
 			scrolll(e) {
 				// console.log(e, 'eeee');
 			},
+			// scrollToBottom(num) {
+			// 	let query = uni.createSelectorQuery().in(this)
+			// 	query.select('#scroll-view-css').boundingClientRect()
+			// 	query.select('#chat-box').boundingClientRect()
+			// 	query.exec((res) => {
+			// 		console.log(res[1].height, res[0].height, 'res[0].height');
+			// 		//如果子元素高度大于父元素高度(显示高度)
+			// 		if (res[1].height > res[0].height) {
+			// 			//计算出二者差值就是需要滚动的距离
+			// 			let scrollTop = res[1].height - res[0].height
+			// 			let differenceNum = scrollTop - this.scrollTop
+			// 			console.log(differenceNum, 'differenceNum');
+			// 			console.log(scrollTop, 'scrollTop');
+			// 			console.log(num, 'num');
+			// 			if (differenceNum > 50) {
+			// 				this.scrollTop = scrollTop + 50
+			// 				console.log('differenceNum > 50 1111111111', this.scrollTop);
+			// 			} else if (num > 0) {
+			// 				this.scrollTop = scrollTop + num
+			// 				console.log('num > 0');
+			// 			} else {
+			// 				this.scrollTop = scrollTop
+			// 				console.log('differenceNum > 50 33333333333333', this.scrollTop);
+			// 			}
+			// 		} else {
+			// 			this.scrollTop = 9999999999999
+			// 		}
+			// 	})
+			// }
 			scrollToBottom(num) {
-				let query = uni.createSelectorQuery().in(this)
-				query.select('#scroll-view-css').boundingClientRect()
-				query.select('#chat-box').boundingClientRect()
+				let query = uni.createSelectorQuery().in(this);
+				query.select('#scroll-view-css').boundingClientRect();
+				query.select('#chat-box').boundingClientRect();
 				query.exec((res) => {
-					console.log(res[1].height, res[0].height, 'res[0].height');
-					//如果子元素高度大于父元素高度(显示高度)
 					if (res[1].height > res[0].height) {
-						//计算出二者差值就是需要滚动的距离
-						let scrollTop = res[1].height - res[0].height
-						let differenceNum = scrollTop - this.scrollTop
-						console.log(differenceNum, 'differenceNum');
-						console.log(scrollTop, 'scrollTop');
-						console.log(num, 'num');
+						let scrollTop = res[1].height - res[0].height;
+						let differenceNum = scrollTop - this.scrollTop;
 						if (differenceNum > 50) {
-							this.scrollTop = scrollTop + 50
-							console.log('differenceNum > 50 1111111111', this.scrollTop);
+							let topNUm = scrollTop
+							this.scrollTop = topNUm + 50;
+							console.log(scrollTop, 'scrollTop1111111111');
 						} else if (num > 0) {
-							this.scrollTop = scrollTop + num
-							console.log('num > 0');
+							let topNUm = scrollTop
+							this.scrollTop = topNUm + num;
+							console.log(scrollTop, 'scrollTop122222222');
 						} else {
-							// this.$nextTick(() => {
-							this.scrollTop = scrollTop
-							console.log('differenceNum > 50 33333333333333', this.scrollTop);
-							// 	console.log(this.scrollTop,'this.scrollTop 9999999999999');
-							// 	this.$forceUpdate()
-							// })
+							let topNUm = scrollTop
+							this.scrollTop = topNUm + 50;
+							console.log(scrollTop, 'scrollTop333333333');
 						}
+						this.$forceUpdate();
 					} else {
-						this.scrollTop = 9999999999999
+						this.scrollTop = 9999999999999;
 					}
-				})
-			},
+				});
+			}
 		},
 	}
 </script>

+ 398 - 370
pages/chat/msg-item.vue

@@ -1,380 +1,408 @@
 <template>
-  <view class="">
-    <view class="dialogue-box" :class="item.msg_type == 2 ||item.msg_type == 3 ?'dialogue-box-one':'dialogue-box-two'">
-      <view class="time">
-        {{item.created_at}}
-      </view>
-      <view class="dialogue">
-        <view class="dialogue-text" :class="item.msg_type == 2 ?'dialogue-text-one':'dialogue-text-two'"
-          v-if="(item.msg_type == 1 ||item.msg_type == 2) && showText">
-          <!-- {{item.content}} -->
-          <!--					{{showText}}-->
-          <view class="" :class="item.msg_type == 2?'showText-color-one':'showText-color-two'" v-html="showText"></view>
-          <view class="voice-box" v-if="item.voice_url">
-            <view class="voice-box-left" v-if="item.msg_type == 1">
-              <image @click="voiceTwo" v-if="!voiceShwo" class="voice-img" src="@/static/img/chat/voice-n.png" mode="">
-              </image>
-              <image @click="voice(true,item)" v-else class="voice-img" src="@/static/img/chat/voice-y.png" mode="">
-              </image>
-            </view>
-            <view class="voice-box-left" v-else-if="item.msg_type == 2">
-              <image @click="voiceTwo" v-if="!voiceShwo" class="voice-img" src="@/static/img/chat/voice-n-two.png"
-                mode=""></image>
-              <image @click="voice(true,item)" v-else class="voice-img" src="@/static/img/chat/voice-y-two.png" mode="">
-              </image>
-            </view>
-            <image v-if="item.msg_type == 2" class="voice-box-right" src="../../static/img/chat/voice-img.png" mode="">
-            </image>
-            <image v-else class="voice-box-right" src="../../static/img/chat/voice-two-img.png" mode=""></image>
-          </view>
-
-        </view>
-        <view class="dialogue-text dialogue-text-one loading " v-if="item.msg_type == 2 && showText ==''">
-          <text></text>
-          <text></text>
-          <text></text>
-          <text></text>
-        </view>
-        <view class="initial-box dialogue-text-one" v-if="item.msg_type == 3">
-          <view class="initial-title">
-            {{item.title}}
-          </view>
-          <view class="initial-style" v-for="(itemTwo,indexTwo) in item.text" :key="indexTwo"
-            @click="selectStyle(itemTwo.type)">
-            {{itemTwo.msg}}
-          </view>
-        </view>
-      </view>
-      <view class="dialogue">
-        <view class="diaologue-img-box" v-if="item.img_url">
-          <image class="diaologue-img" @click="lookImg(item.img_url)" :src="item.img_url" mode="aspectFill"></image>
-        </view>
-      </view>
-      <view class="dialogue">
-        <view class="diaologue-file-box" v-if="item.file_url">
-          <image class="diaologue-file-img" src="@/static/img/chat/wj-img.png" mode="aspectFill"></image>
-          <view class="diaologue-file-name-box">
-            <view class="diaologue-file-name">
-              {{fileName(item.file_url)}}
-            </view>
-            <!-- <view class="diaologue-file-time">
+	<view class="">
+		<view class="dialogue-box"
+			:class="item.msg_type == 2 ||item.msg_type == 3 ?'dialogue-box-one':'dialogue-box-two'">
+			<view class="time">
+				{{item.created_at}}
+			</view>
+			<view class="dialogue">
+				<view class="dialogue-text" :class="item.msg_type == 2 ?'dialogue-text-one':'dialogue-text-two'"
+					v-if="(item.msg_type == 1 ||item.msg_type == 2) && showText">
+					<!-- {{item.content}} -->
+					<!--					{{showText}}-->
+					<view class="" :class="item.msg_type == 2?'showText-color-one':'showText-color-two'"
+						v-html="showText"></view>
+					<view class="align-items-center flex-justify-end" v-if="item.msg_type == 2">
+						<view class="fs-28 fc-9 fz-class" @click="copy(showText)">
+							复制
+						</view>
+					</view>
+					<view class="voice-box" v-if="item.voice_url">
+						<view class="voice-box-left" v-if="item.msg_type == 1">
+							<image @click="voiceTwo" v-if="!voiceShwo" class="voice-img"
+								src="@/static/img/chat/voice-n.png" mode="">
+							</image>
+							<image @click="voice(true,item)" v-else class="voice-img"
+								src="@/static/img/chat/voice-y.png" mode="">
+							</image>
+						</view>
+						<view class="voice-box-left" v-else-if="item.msg_type == 2">
+							<image @click="voiceTwo" v-if="!voiceShwo" class="voice-img"
+								src="@/static/img/chat/voice-n-two.png" mode=""></image>
+							<image @click="voice(true,item)" v-else class="voice-img"
+								src="@/static/img/chat/voice-y-two.png" mode="">
+							</image>
+						</view>
+						<image v-if="item.msg_type == 2" class="voice-box-right"
+							src="../../static/img/chat/voice-img.png" mode="">
+						</image>
+						<image v-else class="voice-box-right" src="../../static/img/chat/voice-two-img.png" mode="">
+						</image>
+					</view>
+				</view>
+				<view class="dialogue-text dialogue-text-one loading " v-if="item.msg_type == 2 && showText ==''">
+					<text></text>
+					<text></text>
+					<text></text>
+					<text></text>
+				</view>
+				<view class="initial-box dialogue-text-one" v-if="item.msg_type == 3">
+					<view class="initial-title">
+						{{item.title}}
+					</view>
+					<view class="initial-style" v-for="(itemTwo,indexTwo) in item.text" :key="indexTwo"
+						@click="selectStyle(itemTwo.type)">
+						{{itemTwo.msg}}
+					</view>
+				</view>
+			</view>
+			<view class="dialogue">
+				<view class="diaologue-img-box" v-if="item.img_url">
+					<image class="diaologue-img" @click="lookImg(item.img_url)" :src="item.img_url" mode="aspectFill">
+					</image>
+				</view>
+			</view>
+			<view class="dialogue">
+				<view class="diaologue-file-box" v-if="item.file_url">
+					<image class="diaologue-file-img" src="@/static/img/chat/wj-img.png" mode="aspectFill"></image>
+					<view class="diaologue-file-name-box">
+						<view class="diaologue-file-name">
+							{{fileName(item.file_url)}}
+						</view>
+						<!-- <view class="diaologue-file-time">
 							2023-12-15
 						</view> -->
-          </view>
-        </view>
-      </view>
-    </view>
-  </view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
 
 </template>
 
 <script>
-  export default {
-    props: {
-      item: {
-        default: function() {
-          return ''
-        }
-      },
-      msgText: {
-        default: function() {
-          return ''
-        }
-      },
-      showType: {
-        default: function() {
-          return false
-        }
-      }
-    },
-    data() {
-      return {
-        showText: '',
-        num: 1,
-        id: '',
-        voiceShwo: true,
-        voiceUrl: '',
-        voiceStyle: true,
-      };
-    },
-    watch: {
-      'msgText': function() {
-        if (this.msgText !== '') {
-          this.setText()
-        }
-      }
-    },
-    mounted() {
-      this.setText()
-    },
-    methods: {
-      voice(bur, id) {
-        if (this.voiceStyle) {
-          this.voiceUrl = uni.createInnerAudioContext();
-          this.voiceUrl.autoplay = true;
-          this.voiceUrl.src = this.item.voice_url;
-          this.voiceUrl.play();
-          this.voiceShwo = false;
-        } else {
-          this.voiceUrl.play();
-          this.voiceShwo = false;
-        };
-        this.voiceUrl.onEnded((res) => {
-          this.voiceShwo = true;
-          this.voiceStyle = true
-        })
-      },
-      voiceTwo() {
-        this.voiceUrl.pause();
-        this.voiceShwo = true;
-        this.voiceStyle = false
-      },
-      fileName(item) {
-        let fileName = item.match(/\/([^\/]+)$/)[1];
-        return fileName
-      },
-      lookImg(item) {
-        let imgList = []
-        imgList.push(item)
-        uni.previewImage({
-          current: 0,
-          urls: imgList,
-        });
-      },
-      selectStyle(type) {
-        this.$emit('selectStyle', type)
-      },
-      setText() {
-        if (this.showType) {
-          this.appear(this.msgText)
-        } else {
-          // console.log('---------------------------------'+this.msgText)
-          // this.showText = this.msgText.replace(/\/n/g, 'aaaaa');
-          this.showText = this.msgText;
-          // console.log(this.showText)
-        }
-      },
-      appear(content) {
-        if (content === '') {
-          return
-        }
-        const _this = this;
-        this.showText = "";
-        clearTimeout(this.timer);
-        let speed = 50; //设置定时的速度 越来越快
-        let count = 1;
-        content = content.replace(/\/n/g, '<br/>');
-        // console.log(content)
-        let num = 1;
-
-        function changeContent() {
-          _this.showText = content.substring(0, count); //截取字符串
-          count++;
-          if (count !== content.length + 1) {
-            speed -= 1;
-            if (speed < 5) speed = 5;
-
-            _this.timer = setTimeout(changeContent, speed);
-            if (_this.showText.length % 100 === 0) _this.$emit('refresh', false)
-          } else {
-            console.log("执行");
-            _this.$emit('refresh', true)
-          }
-        }
-        changeContent();
-      },
-    }
-  }
+	import tools from '@/service/tools'
+	export default {
+		props: {
+			item: {
+				default: function() {
+					return ''
+				}
+			},
+			msgText: {
+				default: function() {
+					return ''
+				}
+			},
+			showType: {
+				default: function() {
+					return false
+				}
+			}
+		},
+		data() {
+			return {
+				showText: '',
+				num: 1,
+				id: '',
+				voiceShwo: true,
+				voiceUrl: '',
+				voiceStyle: true,
+			};
+		},
+		watch: {
+			'msgText': function() {
+				if (this.msgText !== '') {
+					this.setText()
+				}
+			}
+		},
+		mounted() {
+			this.setText()
+		},
+		methods: {
+			copy(value) {
+				uni.setClipboardData({
+					data: value,
+					success() {
+						tools.success('复制成功')
+					},
+					fail() {
+						tools.error("复制失败")
+					}
+				})
+			},
+			voice(bur, id) {
+				if (this.voiceStyle) {
+					this.voiceUrl = uni.createInnerAudioContext();
+					this.voiceUrl.autoplay = true;
+					this.voiceUrl.src = this.item.voice_url;
+					this.voiceUrl.play();
+					this.voiceShwo = false;
+				} else {
+					this.voiceUrl.play();
+					this.voiceShwo = false;
+				};
+				this.voiceUrl.onEnded((res) => {
+					this.voiceShwo = true;
+					this.voiceStyle = true
+				})
+			},
+			voiceTwo() {
+				this.voiceUrl.pause();
+				this.voiceShwo = true;
+				this.voiceStyle = false
+			},
+			fileName(item) {
+				let fileName = item.match(/\/([^\/]+)$/)[1];
+				return fileName
+			},
+			lookImg(item) {
+				let imgList = []
+				imgList.push(item)
+				uni.previewImage({
+					current: 0,
+					urls: imgList,
+				});
+			},
+			selectStyle(type) {
+				this.$emit('selectStyle', type)
+			},
+			setText() {
+				if (this.showType) {
+					this.appear(this.msgText)
+				} else {
+					// console.log('---------------------------------'+this.msgText)
+					// this.showText = this.msgText.replace(/\/n/g, 'aaaaa');
+					this.showText = this.msgText;
+					// console.log(this.showText)
+				}
+			},
+			appear(content) {
+				if (content === '') {
+					return
+				}
+				const _this = this;
+				this.showText = "";
+				clearTimeout(this.timer);
+				let speed = 50; //设置定时的速度 越来越快
+				let count = 1;
+				content = content.replace(/\/n/g, '<br/>');
+				// console.log(content)
+				let num = 1;
+
+				function changeContent() {
+					_this.showText = content.substring(0, count); //截取字符串
+					count++;
+					if (count !== content.length + 1) {
+						speed -= 1;
+						if (speed < 5) speed = 5;
+
+						_this.timer = setTimeout(changeContent, speed);
+						if (_this.showText.length % 100 === 0) _this.$emit('refresh', false)
+					} else {
+						console.log("执行");
+						_this.$emit('refresh', true)
+					}
+				}
+				changeContent();
+			},
+		}
+	}
 </script>
 
 <style lang="scss">
-  .loading {
-    width: auto;
-    height: 15rpx;
-    display: flex;
-    align-items: center;
-    padding: 17rpx 30rpx;
-  }
-
-  .loading text {
-    // display: inline-block;
-    width: 15rpx;
-    height: 15rpx;
-    margin-right: 5px;
-    border-radius: 50%;
-    background: #F2BA0B;
-    -webkit-animation: load 1.04s ease infinite;
-  }
-
-  .loading text:last-child {
-    margin-right: 0px;
-  }
-
-  @-webkit-keyframes load {
-    0% {
-      opacity: 1;
-    }
-
-    100% {
-      opacity: 0;
-    }
-  }
-
-  .loading text:nth-child(1) {
-    -webkit-animation-delay: 0.13s;
-  }
-
-  .loading text:nth-child(2) {
-    -webkit-animation-delay: 0.26s;
-  }
-
-  .loading text:nth-child(3) {
-    -webkit-animation-delay: 0.39s;
-  }
-
-  .loading text:nth-child(4) {
-    -webkit-animation-delay: 0.52s;
-  }
-
-  .dialogue-box {
-    // width: 100%;
-    height: auto;
-    margin: 0 0 40rpx 0;
-    display: flex;
-    flex-direction: column;
-
-    .time {
-      font-size: 24rpx;
-      color: #999999;
-      margin: 0 0 8rpx 0;
-    }
-
-    .dialogue {
-      // word-break: break-all;
-      // font-size: 30rpx;
-
-      .dialogue-text {
-        padding: 24rpx;
-        box-sizing: border-box;
-        white-space: pre-wrap;
-
-        .voice-box {
-          padding: 20rpx 0 0 0;
-          display: flex;
-          align-items: center;
-
-          .voice-box-left {
-            .voice-img {
-              width: 48rpx;
-              height: 48rpx;
-              margin: 0 16rpx 0 0;
-            }
-          }
-
-          .voice-box-right {
-            width: 120rpx;
-            height: 26rpx;
-          }
-        }
-      }
-
-      .showText-color-one {
-        color: #333333;
-      }
-
-      .showText-color-two {
-        color: #FFFFFF;
-      }
-
-      .diaologue-img-box {
-        max-width: 638rpx;
-        height: auto;
-        background: #fff;
-        margin: 8rpx 0 0 0;
-
-        .diaologue-img {
-          border-radius: 20rpx;
-        }
-      }
-
-      .diaologue-file-box {
-        display: flex;
-        align-items: center;
-        padding: 24rpx;
-        box-sizing: border-box;
-        // background: #fff;
-        border: 2rpx solid #EEEEEE;
-        border-radius: 10rpx;
-        margin: 8rpx 0 0 0;
-
-        .diaologue-file-img {
-          width: 63rpx;
-          height: 77rpx;
-          margin: 0 16rpx 0 0;
-        }
-
-        .diaologue-file-name-box {
-          .diaologue-file-name {
-            max-width: 534rpx;
-            font-size: 30rpx;
-            color: #323333;
-            margin: 0 0 4rpx 0;
-            white-space: nowrap;
-            text-overflow: ellipsis;
-            overflow: hidden;
-            word-break: break-all;
-          }
-
-          .diaologue-file-time {
-            font-size: 24rpx;
-            color: #999999;
-          }
-        }
-      }
-
-
-
-      .dialogue-text-one {
-        background: #F7F8FC;
-        border-radius: 10rpx 10rpx 10rpx 0;
-      }
-
-      .dialogue-text-two {
-        background: #5CC2FF;
-        border-radius: 10rpx 10rpx 0 10rpx;
-        max-width: 592rpx;
-      }
-
-      .initial-box {
-        padding: 24rpx;
-        box-sizing: border-box;
-
-        .initial-title {
-          font-size: 30rpx;
-          font-weight: 600;
-          color: #333333;
-          // margin: 0 0 12rpx 0;
-          padding: 0 0 12rpx 0;
-        }
-
-        .initial-style {
-          font-size: 30rpx;
-          color: #2F80ED;
-          margin: 0 0 12rpx 0;
-        }
-
-        .initial-style:last-child {
-          margin: 0;
-        }
-      }
-    }
-  }
-
-  .dialogue-box-one {
-    align-items: flex-start;
-  }
-
-  .dialogue-box-two {
-    align-items: flex-end;
-  }
-</style>
+	.fz-class {
+		padding: 5rpx 0 0;
+	}
+
+	.loading {
+		width: auto;
+		height: 15rpx;
+		display: flex;
+		align-items: center;
+		padding: 17rpx 30rpx;
+	}
+
+	.loading text {
+		// display: inline-block;
+		width: 15rpx;
+		height: 15rpx;
+		margin-right: 5px;
+		border-radius: 50%;
+		background: #F2BA0B;
+		-webkit-animation: load 1.04s ease infinite;
+	}
+
+	.loading text:last-child {
+		margin-right: 0px;
+	}
+
+	@-webkit-keyframes load {
+		0% {
+			opacity: 1;
+		}
+
+		100% {
+			opacity: 0;
+		}
+	}
+
+	.loading text:nth-child(1) {
+		-webkit-animation-delay: 0.13s;
+	}
+
+	.loading text:nth-child(2) {
+		-webkit-animation-delay: 0.26s;
+	}
+
+	.loading text:nth-child(3) {
+		-webkit-animation-delay: 0.39s;
+	}
+
+	.loading text:nth-child(4) {
+		-webkit-animation-delay: 0.52s;
+	}
+
+	.dialogue-box {
+		// width: 100%;
+		height: auto;
+		margin: 0 0 40rpx 0;
+		display: flex;
+		flex-direction: column;
+
+		.time {
+			font-size: 24rpx;
+			color: #999999;
+			margin: 0 0 8rpx 0;
+		}
+
+		.dialogue {
+			// word-break: break-all;
+			// font-size: 30rpx;
+
+			.dialogue-text {
+				padding: 24rpx;
+				box-sizing: border-box;
+				white-space: pre-wrap;
+
+				.voice-box {
+					padding: 20rpx 0 0 0;
+					display: flex;
+					align-items: center;
+
+					.voice-box-left {
+						.voice-img {
+							width: 48rpx;
+							height: 48rpx;
+							margin: 0 16rpx 0 0;
+						}
+					}
+
+					.voice-box-right {
+						width: 120rpx;
+						height: 26rpx;
+					}
+				}
+			}
+
+			.showText-color-one {
+				color: #333333;
+			}
+
+			.showText-color-two {
+				color: #FFFFFF;
+			}
+
+			.diaologue-img-box {
+				max-width: 638rpx;
+				height: auto;
+				background: #fff;
+				margin: 8rpx 0 0 0;
+
+				.diaologue-img {
+					border-radius: 20rpx;
+				}
+			}
+
+			.diaologue-file-box {
+				display: flex;
+				align-items: center;
+				padding: 24rpx;
+				box-sizing: border-box;
+				// background: #fff;
+				border: 2rpx solid #EEEEEE;
+				border-radius: 10rpx;
+				margin: 8rpx 0 0 0;
+
+				.diaologue-file-img {
+					width: 63rpx;
+					height: 77rpx;
+					margin: 0 16rpx 0 0;
+				}
+
+				.diaologue-file-name-box {
+					.diaologue-file-name {
+						max-width: 534rpx;
+						font-size: 30rpx;
+						color: #323333;
+						margin: 0 0 4rpx 0;
+						white-space: nowrap;
+						text-overflow: ellipsis;
+						overflow: hidden;
+						word-break: break-all;
+					}
+
+					.diaologue-file-time {
+						font-size: 24rpx;
+						color: #999999;
+					}
+				}
+			}
+
+
+
+			.dialogue-text-one {
+				background: #F7F8FC;
+				border-radius: 10rpx 10rpx 10rpx 0;
+			}
+
+			.dialogue-text-two {
+				background: #5CC2FF;
+				border-radius: 10rpx 10rpx 0 10rpx;
+				max-width: 592rpx;
+			}
+
+			.initial-box {
+				padding: 24rpx;
+				box-sizing: border-box;
+
+				.initial-title {
+					font-size: 30rpx;
+					font-weight: 600;
+					color: #333333;
+					// margin: 0 0 12rpx 0;
+					padding: 0 0 12rpx 0;
+				}
+
+				.initial-style {
+					font-size: 30rpx;
+					color: #2F80ED;
+					margin: 0 0 12rpx 0;
+				}
+
+				.initial-style:last-child {
+					margin: 0;
+				}
+			}
+		}
+	}
+
+	.dialogue-box-one {
+		align-items: flex-start;
+	}
+
+	.dialogue-box-two {
+		align-items: flex-end;
+	}
+</style>

+ 6 - 2
pages/index/index.vue

@@ -397,7 +397,7 @@
 					{
 						name: "跑腿代拿",
 						img: require('@/static/img/index/index-ptdn.png'),
-						type: 7
+						type: 10
 					},
 					{
 						name: "实习岗位",
@@ -865,7 +865,11 @@
 					})
 				} else if (type === 9) {
 					// 平台客服
-
+				} else if (type === 10) {
+					// 跑腿代拿
+					uni.navigateTo({
+						url: '/pages-takeout/run-errands'
+					})
 				} else {
 					tools.error('暂未开放')
 				}

BIN
static/img/tabBar/ai-highlight.png


BIN
static/img/tabBar/ai.png


BIN
static/img/tabBar/business-highlight.png


BIN
static/img/tabBar/business.png


BIN
static/img/tabBar/home-highlight.png


BIN
static/img/tabBar/home.png


BIN
static/img/tabBar/my-highlight.png


BIN
static/img/tabBar/my.png