Explorar el Código

增加客户电话字典

zaijin hace 3 años
padre
commit
277b875661
Se han modificado 3 ficheros con 30 adiciones y 6 borrados
  1. 3 1
      common/apiurl.js
  2. 3 1
      common/http.api.js
  3. 24 4
      pages/center/index.vue

+ 3 - 1
common/apiurl.js

@@ -108,7 +108,9 @@ const apiurl = {
 	// 出场快捷支付
 	quickPayExportUrl: '/client/payment/parking/gzbank/quick',
 	// 出场聚合支付
-	polyPayExportUrl: '/client/payment/parking/gzbank/poly'
+	polyPayExportUrl: '/client/payment/parking/gzbank/poly',
+	// 获取数据字典接口
+	getDictUrl: '/admin/dict/data/type/'
 }
 
 export {

+ 3 - 1
common/http.api.js

@@ -100,6 +100,7 @@ const install = (Vue, vm) => {
 	let getOrderStateExportApi = (params = {}) => vm.$u.post(apiurl.getOrderStateExportUrl, params)
 	let quickPayExportApi = (params = {}) => vm.$u.post(apiurl.quickPayExportUrl, params)
 	let polyPayExportApi = (params = {}) => vm.$u.post(apiurl.polyPayExportUrl, params)
+	let getDictApi = (params = {}) => vm.$u.get(apiurl.getDictUrl + params.type)
 
 	// 将各个定义的接口名称,统一放进对象挂载到vm.$u.api(因为vm就是this,也即this.$u.api)下
 	vm.$u.api = {
@@ -153,7 +154,8 @@ const install = (Vue, vm) => {
 		quickPayExportApi,
 		polyPayExportApi,
 		getRoomParkingApi,
-		getRoomOrderDetail
+		getRoomOrderDetail,
+		getDictApi
 	};
 }
 

+ 24 - 4
pages/center/index.vue

@@ -74,11 +74,12 @@
 		</view>
 		<view class="u-m-t-20 u-m-b-40">
 			<u-cell-group>
-				<u-cell-item title="拨打客服电话" @click="phoneCall(phoneNo)">
+				<u-cell-item title="拨打客服电话" @click="callPhoneShow = true">
 					<u-icon slot="icon" custom-prefix="custom-icon" size="35" name="dianhua"></u-icon>
 				</u-cell-item>
 			</u-cell-group>
 		</view>
+		<u-select v-model="callPhoneShow" :list="callPhoneList" @confirm="phoneCall"></u-select>
 
 		<!-- <view class="u-m-t-20">
 			<u-cell-group>
@@ -108,14 +109,16 @@
 				pic: '/static/img/default-avatar.png',
 				// 用户信息
 				userInfo: [],
-				phoneNo: '0851-38222696',
 				logoutPop: false,
-				messageNum: 0
+				messageNum: 0,
+				callPhoneShow: false,
+				callPhoneList: []
 			}
 		},
 		onLoad() {},
 		onShow() {
 			this.getMsgNum()
+			this.getDict()
 			if (this.$store.state.vuex_hasLogin) {
 				this.userInfo = this.$store.state.vuex_user;
 				if (this.$store.state.vuex_wxinfo) {
@@ -126,6 +129,23 @@
 			}
 		},
 		methods: {
+			/**
+			 * 获取客服电话字典
+			 */
+			getDict() {
+				this.$u.api.getDictApi({
+					type: 'customer_service_phone'
+				}).then(res => {
+					if (res.code === 200) {
+						this.callPhoneList = res.data.map(item => {
+							return {
+								value: item.dictValue,
+								label: item.dictLabel
+							}
+						})
+					}
+				})
+			},
 			/**
 			 * 打开新页面
 			 * @param {String} path 跳转路径
@@ -174,7 +194,7 @@
 			// 拨打电话
 			phoneCall(phone) {
 				uni.makePhoneCall({
-					phoneNumber: phone
+					phoneNumber: phone[0].value || '0851-38222696'
 				});
 			},
 			// 登出