From 5751ee0f04dbf1c43020fe4a401813a0bf2b81b7 Mon Sep 17 00:00:00 2001 From: Cxpller Date: Tue, 24 Oct 2023 23:41:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=B8=AA=E4=BA=BA=E4=B8=AD=E5=BF=83=20?= =?UTF-8?q?=E5=AE=A2=E6=9C=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/usercenter/index.js | 43 ++++++++++--------- pages/usercenter/index.wxml | 40 ++++++----------- pages/usercenter/index.wxss | 30 ++++++++++--- services/usercenter/getCustomerServiceList.js | 19 ++++++++ 4 files changed, 78 insertions(+), 54 deletions(-) create mode 100644 services/usercenter/getCustomerServiceList.js diff --git a/pages/usercenter/index.js b/pages/usercenter/index.js index 8ca6303..80bae1f 100644 --- a/pages/usercenter/index.js +++ b/pages/usercenter/index.js @@ -1,14 +1,16 @@ import { fetchUserCenter } from '~/services/usercenter/fetchUsercenter'; +import { + getCustomerServiceList +} from '~/services/usercenter/getCustomerServiceList'; import { getOpenId } from '~/services/login/getOpenId'; import Toast from 'tdesign-miniprogram/toast/index'; const menuData = [ - [ - { + [{ title: '申请开店', tit: '', url: '', @@ -48,7 +50,7 @@ const menuData = [ // type: 'help-center', // }, { - title: '客服热线', + title: '联系客服', tit: '', url: '', type: 'service', @@ -115,14 +117,14 @@ const getDefaultData = () => ({ customerServiceInfo: {}, currAuthStep: 1, showKefu: true, - versionNo: '', + CustomerService: {}, }); Page({ data: getDefaultData(), onLoad() { - this.getVersionInfo(); + this.onGetCustomerServiceList(); }, onShow() { @@ -161,13 +163,13 @@ Page({ // ...v, // ...orderInfo[index], // })); - console.log(collectData,'数据'); + console.log(collectData, '数据'); this.data.orderTagInfos[0].orderNum = collectData.waitPayCount this.data.orderTagInfos[1].orderNum = collectData.deliverCount this.data.orderTagInfos[2].orderNum = collectData.packageCount this.data.orderTagInfos[3].orderNum = collectData.commentCount this.data.orderTagInfos[4].orderNum = collectData.exchangCount - console.log(this.data.orderTagInfos,'asdasdasd'); + console.log(this.data.orderTagInfos, 'asdasdasd'); this.setData({ userInfo, collectData, @@ -271,16 +273,16 @@ Page({ }, jumpCollect() { - wx.navigateTo({ - url: '/pages/usercenter/goods-collect/index' - }); + wx.navigateTo({ + url: '/pages/usercenter/goods-collect/index' + }); }, jumpHistory() { wx.navigateTo({ url: '/pages/usercenter/goods-history/index' }); -}, + }, openMakePhone() { this.setData({ @@ -327,14 +329,15 @@ Page({ } }, - getVersionInfo() { - const versionInfo = wx.getAccountInfoSync(); - const { - version, - envVersion = __wxConfig - } = versionInfo.miniProgram; - this.setData({ - versionNo: envVersion === 'release' ? version : envVersion, - }); + // 获取客服列表 + onGetCustomerServiceList() { + getCustomerServiceList().then((res) => { + console.log(res); + if (res.code == 200) { + this.setData({ + CustomerService: res.data[0] + }) + } + }) }, }); \ No newline at end of file diff --git a/pages/usercenter/index.wxml b/pages/usercenter/index.wxml index 4ae4670..b60a7f3 100644 --- a/pages/usercenter/index.wxml +++ b/pages/usercenter/index.wxml @@ -1,12 +1,4 @@ - + @@ -28,35 +20,27 @@ - + -当前版本 {{versionNo}} + + 客服电话 {{CustomerService.customerServicePhone}} + 工作时间 {{CustomerService.workingHoursBeginTime}}-{{CustomerService.workingHoursEndTime}} + - + + + + 取消 - + \ No newline at end of file diff --git a/pages/usercenter/index.wxss b/pages/usercenter/index.wxss index c06d4d6..ed97a32 100644 --- a/pages/usercenter/index.wxss +++ b/pages/usercenter/index.wxss @@ -25,9 +25,11 @@ page { overflow: hidden; margin-bottom: 20rpx; } + .icon-color { color: #aaa; } + .cell-class { height: 100rpx; display: flex; @@ -60,6 +62,7 @@ page { -ms-transform: translate(-50%, -50%); transform: translate(-50%, -50%); } + .order-content-t { margin-top: 10rpx; font-size: 24rpx; @@ -73,6 +76,7 @@ page { margin-bottom: env(safe-area-inset-bottom); border-radius: 16rpx 16rpx 0 0; } + .popup-content .popup-title { background: #fff; text-align: center; @@ -101,6 +105,7 @@ page { transform-origin: left top; border-bottom: 2rpx solid #e5e5e5; } + .popup-content .popup-phone, .popup-content .popup-close { background: #fff; @@ -114,16 +119,24 @@ page { font-weight: 400; color: #333; } + .popup-content .popup-phone.online { margin-bottom: 20rpx; } + .popup-content .popup-phone.online::after { content: none; } + .popup-content .popup-close { color: #333; border: 0; - margin-top: 16rpx; + /* margin-top: 16rpx; */ +} + +.customer-service-img, +.customer-service-img>image { + width: 100%; } .my-order { @@ -132,36 +145,41 @@ page { .footer__version { text-align: center; - margin-top: 50rpx; color: #999; margin-bottom: 4rpx; font-size: 24rpx; line-height: 32rpx; } + .cell-box .order-group__left { margin-right: 0; } + .cell-box .t-cell-padding { padding: 24rpx 18rpx 24rpx 32rpx; } -.order-history-box{ + +.order-history-box { width: 90%; display: flex; justify-content: space-around; margin: 30rpx auto; } -.order-history-content-box{ + +.order-history-content-box { display: flex; flex-direction: column; align-items: center; cursor: pointer; } -.order-history-content-num{ + +.order-history-content-num { font-size: 35rpx; font-weight: bold; margin-bottom: 10rpx; } -.order-history-content-line{ + +.order-history-content-line { /* width: 1rpx; */ height: 80rpx; border: 1px solid black; diff --git a/services/usercenter/getCustomerServiceList.js b/services/usercenter/getCustomerServiceList.js new file mode 100644 index 0000000..6171d73 --- /dev/null +++ b/services/usercenter/getCustomerServiceList.js @@ -0,0 +1,19 @@ +import { + request +} from '../_utils/request'; + +/** 获取客服列表 */ +export function getCustomerServiceList() { + return new Promise((resolve, reject) => { + request({ + url: `CustomerServiceApi/getCustomerServiceList`, + method: 'GET', + success: function (res) { + resolve(res); + }, + fail: function (error) { + reject(error); + } + }); + }); +} \ No newline at end of file