Browse Source

feat(客服中心): 新增客服中心页面及配送方式选择功能

- 添加客服中心页面,包含客服列表和微信二维码展示功能
- 在商品提交页面增加配送方式选择(外卖配送/到店自提)
- 修改地址选择逻辑,根据配送方式显示不同内容
- 在用户信息页面添加初中和高中学校字段
- 优化订单提交逻辑,支持不同配送方式的参数传递
master
前端-胡立永 2 days ago
parent
commit
f23bd87918
7 changed files with 476 additions and 35 deletions
  1. +7
    -0
      pages.json
  2. +4
    -1
      pages/index/index.vue
  3. +29
    -1
      pages_order/auth/wxUserInfo.vue
  4. +2
    -11
      pages_order/components/list/gourmet/productSelectList.vue
  5. +134
    -8
      pages_order/components/list/gourmet/productSubmit.vue
  6. +93
    -14
      pages_order/components/product/submitUnitSelect.vue
  7. +207
    -0
      pages_order/mine/customerService.vue

+ 7
- 0
pages.json View File

@ -189,6 +189,13 @@
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white"
}
},
{
"path": "mine/customerService",
"style": {
"navigationBarTitleText": "客服中心",
"enablePullDownRefresh": false
}
}
]
}],


+ 4
- 1
pages/index/index.vue View File

@ -139,9 +139,12 @@
</view>
<!-- 页面浮窗 -->
<createDetailPopup @customerServiceOpen="$refs.customerServicePopup.open()"
<createDetailPopup @customerServiceOpen="$utils.navigateTo('/pages_order/mine/customerService')"
@integralDetailsOpen="$refs.integralDetailsPopup.open('bottom')" />
<!-- <createDetailPopup @customerServiceOpen="$refs.customerServicePopup.open()"
@integralDetailsOpen="$refs.integralDetailsPopup.open('bottom')" /> -->
<!-- 加入我们 -->
<certificationPopup ref="certificationPopup" />


+ 29
- 1
pages_order/auth/wxUserInfo.vue View File

@ -84,6 +84,16 @@
{{ form.address || '请选择居住地址'}}
</view>
<input type="text"
placeholder="初中学校名字(选填)"
class="school-input"
v-model="form.middleSchool" />
<input type="text"
placeholder="高中学校名字(选填)"
class="school-input"
v-model="form.highSchool" />
<view class="line">
<view class="">
手机号
@ -140,6 +150,8 @@
yearDate : this.$dayjs().add(-18, 'y').valueOf(),//18
address : '',
phone : '',
middleSchool: '',
highSchool: '',
},
maxDate : this.$dayjs().valueOf(),
minDate : this.$dayjs().add(-100, 'y').valueOf(),
@ -218,7 +230,7 @@
}
})
},
getUserInfo(){
getUserInfo(){
this.$api('getInfo', res => {
if(res.code == 200){
@ -234,6 +246,10 @@
this.$dayjs(res.result.yearDate + '-01-01').valueOf() || this.form.yearDate
this.form.address = res.result.address || this.form.address
this.form.middleSchool = res.result.middleSchool || this.form.middleSchool
this.form.highSchool = res.result.highSchool || this.form.highSchool
}
})
},
@ -399,6 +415,18 @@
line-height: 80rpx;
color: #555;
}
.school-input{
background-color: #f7f7f7;
width: 600rpx;
height: 80rpx;
text-align: center;
border-radius: 40rpx;
margin-top: 30rpx;
padding: 0 30rpx;
box-sizing: border-box;
color: #333;
}
.btn {
// background: $uni-linear-gradient-btn-color;


+ 2
- 11
pages_order/components/list/gourmet/productSelectList.vue View File

@ -214,19 +214,10 @@
}
this.$refs.productSubmit.open()
},
submit({addressId}){
if(!addressId){
uni.showToast({
title: '请选择地址',
icon: 'none'
})
return
}
submit(submitData){
this.$api('createSumOrder', {
addressId,
...submitData,
list : JSON.stringify(this.priceList)
}, res => {
if(res.code == 200){


+ 134
- 8
pages_order/components/list/gourmet/productSubmit.vue View File

@ -4,8 +4,29 @@
bgColor="#f7f7f7">
<view class="content">
<!-- 地址 -->
<view class="address" @click="openAddress">
<!-- 配送方式选择 -->
<view class="delivery-method">
<view class="title">配送方式</view>
<view class="options">
<view
:class="['option', { active: deliveryMethod == '0' }]"
@click="selectDeliveryMethod('0')"
>
<view class="icon">🚚</view>
<view class="text">外卖配送</view>
</view>
<view
:class="['option', { active: deliveryMethod == '1' }]"
@click="selectDeliveryMethod('1')"
>
<view class="icon">🏪</view>
<view class="text">到店自提</view>
</view>
</view>
</view>
<!-- 地址仅外卖显示 -->
<view class="address" @click="openAddress" v-if="deliveryMethod == '0'">
<image src="/static/image/address/selectIcon.png" mode=""></image>
<view>
{{ address.name }}
@ -18,6 +39,19 @@
</view>
</view>
<!-- 店铺地址仅到店自提显示 -->
<!-- <view class="store-address" v-if="deliveryMethod === '1'">
<image src="/static/image/address/storeIcon.png" mode=""></image>
<view>
<view class="store-name">店铺地址</view>
<addressSpot
:address="shopInfo.address"
:latitude="shopInfo.latitude"
:longitude="shopInfo.longitude"
/>
</view>
</view> -->
<!-- 优惠劵 -->
<!-- <view style="padding: 0 20rpx;
background-color: #fff;">
@ -55,12 +89,15 @@
<view class="">
应付款
</view>
<view class="">
<view class="" v-ifan class="s">="deliveryMethod === '0'">
{{ totalPrice }}
</view>
<view class="" v-if="deliveryMethod === '1'">
{{ totalPrice - priceMap.pei_money }}
</view>
</view>
<view>
<view v-ifan class="s">="deliveryMethod === '0'">
<view class="">
配送费
</view>
@ -152,6 +189,8 @@
// price : 0,
},
couponText : '请选择',
deliveryMethod: '0',
shopInfo : {},
}
},
methods: {
@ -216,10 +255,26 @@
this.$refs.addressPopup.close()
},
orderPay() {
this.$emit('submit', {
addressId : this.address.id,
couponId : this.coupon.id
})
let submitData = {
couponId : this.coupon.id,
deliveryMethod: this.deliveryMethod
}
//
if (this.deliveryMethod === '0') {
if (!this.address.id) {
return uni.showToast({
title: '请选择收货地址',
icon: 'none'
})
}
submitData.addressId = this.address.id
}
this.$emit('submit', submitData)
},
selectDeliveryMethod(method) {
this.deliveryMethod = method
},
}
}
@ -232,6 +287,48 @@
overflow-y: auto;
padding-top: 30rpx;
.delivery-method {
padding: 20rpx;
background-color: #fff;
margin-bottom: 20rpx;
.title {
font-weight: 600;
margin-bottom: 20rpx;
}
.options {
display: flex;
gap: 20rpx;
.option {
padding: 15rpx 30rpx;
background-color: #F6F6F6;
border-radius: 10rpx;
flex: 1;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border: 2rpx solid transparent;
&.active {
background-color: $uni-color;
color: #fff;
border-color: $uni-color;
}
.icon {
margin-right: 10rpx;
}
.text {
font-size: 28rpx;
}
}
}
}
.address {
display: flex;
padding: 20rpx;
@ -256,6 +353,35 @@
}
}
.store-address {
display: flex;
padding: 20rpx;
background-color: #fff;
margin-bottom: 20rpx;
image {
width: 30rpx;
height: 30rpx;
margin: 20rpx;
}
view {
margin: 20rpx;
overflow: hidden; //
text-overflow: ellipsis; //
white-space: nowrap; //
}
.store-name {
font-weight: 600;
}
.store-detail {
color: #717171;
margin-top: 10rpx;
}
}
.payInfoMessage{
line-height: 50rpx;
padding: 20rpx;


+ 93
- 14
pages_order/components/product/submitUnitSelect.vue View File

@ -4,9 +4,31 @@
bgColor="#f7f7f7">
<view class="content">
<!-- 地址 -->
<!-- 配送方式选择 -->
<view class="delivery-method">
<view class="title">配送方式</view>
<view class="options">
<view
:class="['option', { active: deliveryMethod === '0' }]"
@click="selectDeliveryMethod('0')"
>
<view class="icon">🚚</view>
<view class="text">外卖配送</view>
</view>
<view
:class="['option', { active: deliveryMethod === '1' }]"
@click="selectDeliveryMethod('1')"
>
<view class="icon">🏪</view>
<view class="text">到店自提</view>
</view>
</view>
</view>
<!-- 地址仅外卖显示 -->
<view class="address"
@click="openAddress">
@click="openAddress"
v-if="deliveryMethod === '0'">
<image src="../../static/address/selectIcon.png" mode=""></image>
<view class="">
{{ address.name }}
@ -20,6 +42,17 @@
name="arrow-right"></uv-icon>
</view>
</view>
<!-- 店铺地址仅到店自提显示 -->
<view class="store-address" v-if="deliveryMethod == '1' && detail.shop && detail.shop.address">
<view>
<addressSpot
:address="detail.shop.address"
:latitude="detail.shop.latitude"
:longitude="detail.shop.longitude"
/>
</view>
</view>
<!-- 商品信息和数量 -->
<view class="submit-info">
@ -143,6 +176,7 @@
num : 1,
unit : {},
addressTotal : 0,
deliveryMethod : '0',
}
},
methods: {
@ -190,14 +224,19 @@
let data = {
shopId : this.detail.id,//id
addressId : this.address.id,//id
num : this.num,
deliveryMethod: this.deliveryMethod
}
if(this.$utils.verificationAll(data, {
addressId : '请选择地址',
})){
return
//
if (this.deliveryMethod === 'delivery') {
if (!this.address.id) {
return uni.showToast({
title: '请选择收货地址',
icon: 'none'
})
}
data.addressId = this.address.id
}
this.$api('createPointsOrder', data, res => {
@ -213,17 +252,20 @@
let data = {
shopId : this.detail.id,//id
// skuId : this.unit.id,//id
addressId : this.address.id,//id
// sku : this.unit.title,//
num : this.num,
deliveryMethod: this.deliveryMethod
}
if(this.$utils.verificationAll(data, {
// skuId : '',
addressId : '请选择地址',
})){
return
//
if (this.deliveryMethod == '0') {
if (!this.address.id) {
return uni.showToast({
title: '请选择收货地址',
icon: 'none'
})
}
data.addressId = this.address.id
}
this.$api('createOrder', data, res => {
@ -252,6 +294,9 @@
}
})
},
selectDeliveryMethod(method){
this.deliveryMethod = method
},
}
}
</script>
@ -261,6 +306,40 @@
max-height: 80vh;
overflow: hidden;
overflow-y: auto;
.delivery-method{
padding: 20rpx;
background-color: #fff;
.title{
font-size: 30rpx;
padding: 10rpx;
font-weight: 600;
}
.options{
display: flex;
gap: 20rpx;
.option{
padding: 15rpx 30rpx;
border: 2rpx solid #F3F3F3;
border-radius: 10rpx;
display: flex;
align-items: center;
justify-content: center;
flex: 1;
background-color: #F6F6F6;
&.active{
border-color: $uni-price-color;
background-color: $uni-price-color;
color: #fff;
}
.icon{
margin-right: 10rpx;
}
.text{
font-size: 28rpx;
}
}
}
}
.address{
display: flex;
padding: 20rpx;


+ 207
- 0
pages_order/mine/customerService.vue View File

@ -0,0 +1,207 @@
<template>
<view class="customer-service">
<navbar leftClick @leftClick="$utils.navigateBack" title="客服中心" />
<view class="content">
<!-- 客服介绍 -->
<view class="intro">
<view class="title">我们为您提供贴心服务</view>
<view class="desc">如有任何问题请随时联系我们的客服团队</view>
</view>
<!-- 客服列表 -->
<view class="service-list">
<view
class="service-item"
v-for="(item, index) in serviceList"
:key="index"
@click="showQRCode(item)"
>
<image class="avatar" :src="item.avatar" mode="aspectFill"></image>
<view class="info">
<view class="name">{{ item.name }}</view>
<view class="contact">{{ item.contact }}</view>
</view>
<uv-icon name="arrow-right" size="24rpx" color="#999"></uv-icon>
</view>
</view>
</view>
<!-- 微信二维码弹窗 -->
<uv-popup ref="qrPopup" :round="20" bgColor="#fff">
<view class="qr-popup">
<view class="qr-header">
<view class="title">{{ currentService.name }}</view>
<view class="subtitle">扫码添加微信</view>
</view>
<view class="qr-content">
<image class="qr-code" :src="currentService.qrCode" mode="aspectFit"></image>
<view class="qr-tips">长按保存二维码微信扫码添加</view>
</view>
<view class="qr-actions">
<uv-button type="primary" @click="$refs.qrPopup.close()">知道了</uv-button>
</view>
</view>
</uv-popup>
</view>
</template>
<script>
export default {
data() {
return {
currentService: {},
serviceList: [
{
name: '客服小美',
contact: '微信:kefu001',
avatar: '/static/image/avatar/kefu1.jpg',
qrCode: '/static/image/qrcode/kefu1_qr.jpg'
},
{
name: '客服小丽',
contact: '手机:138-8888-8888',
avatar: '/static/image/avatar/kefu2.jpg',
qrCode: '/static/image/qrcode/kefu2_qr.jpg'
},
{
name: '客服小雨',
contact: '微信:kefu003',
avatar: '/static/image/avatar/kefu3.jpg',
qrCode: '/static/image/qrcode/kefu3_qr.jpg'
},
{
name: '客服小花',
contact: '手机:139-9999-9999',
avatar: '/static/image/avatar/kefu4.jpg',
qrCode: '/static/image/qrcode/kefu4_qr.jpg'
}
]
}
},
methods: {
//
showQRCode(service) {
this.currentService = service
this.$refs.qrPopup.open('center')
}
}
}
</script>
<style scoped lang="scss">
.customer-service {
background-color: #f5f5f5;
min-height: 100vh;
.content {
padding: 20rpx;
}
.intro {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 40rpx;
border-radius: 20rpx;
margin-bottom: 30rpx;
.title {
color: #fff;
font-size: 36rpx;
font-weight: bold;
margin-bottom: 10rpx;
}
.desc {
color: rgba(255, 255, 255, 0.8);
font-size: 28rpx;
}
}
.service-list {
background-color: #fff;
border-radius: 20rpx;
padding: 20rpx;
margin-bottom: 30rpx;
.service-item {
display: flex;
align-items: center;
padding: 30rpx 20rpx;
border-bottom: 1rpx solid #f0f0f0;
&:last-child {
border-bottom: none;
}
.avatar {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 20rpx;
}
.info {
flex: 1;
.name {
font-size: 32rpx;
font-weight: bold;
color: #333;
margin-bottom: 8rpx;
}
.contact {
font-size: 26rpx;
color: #666;
}
}
}
}
.qr-popup {
padding: 40rpx;
text-align: center;
width: 600rpx;
.qr-header {
margin-bottom: 30rpx;
.title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-bottom: 10rpx;
}
.subtitle {
font-size: 28rpx;
color: #666;
}
}
.qr-content {
margin-bottom: 30rpx;
.qr-code {
width: 400rpx;
height: 400rpx;
border-radius: 20rpx;
margin-bottom: 20rpx;
}
.qr-tips {
font-size: 24rpx;
color: #999;
line-height: 1.5;
}
}
.qr-actions {
display: flex;
justify-content: center;
}
}
}
</style>

Loading…
Cancel
Save