From e22b9321aae0322de93d50c0e21407f3cb514659 Mon Sep 17 00:00:00 2001 From: wk Date: 星期二, 13 八月 2024 17:30:20 +0800 Subject: [PATCH] feat:供货商 --- pages/customer-page/customer-my/customer-my.vue | 87 ++++++++++++++++++++++++++++++++++++------- 1 files changed, 72 insertions(+), 15 deletions(-) diff --git a/pages/customer-page/customer-my/customer-my.vue b/pages/customer-page/customer-my/customer-my.vue index 1478493..89df8e2 100644 --- a/pages/customer-page/customer-my/customer-my.vue +++ b/pages/customer-page/customer-my/customer-my.vue @@ -35,7 +35,7 @@ </view> <view class="huodai-list"> <view class="buylist"> - <view v-for="(item, index) in BuyCardData" class="buylists"> + <view v-for="(item, index) in BuyCardData" :key="index" class="buylists"> <view >{{item.productName}}</view> <view >{{item.buyTotal}}/{{item.surplus}}</view> <view >{{item.endDate}}</view> @@ -62,7 +62,7 @@ <view class="personal-information-block"> <view class="block-main"> <view class="huodai"> - <combined-title title="鎴戠殑璐т唬" + <combined-title title="鎴戠殑鎵胯繍鍟�" @rightText="addHuoDai"> <template v-slot:rightText> <text>娣诲姞</text> @@ -139,6 +139,9 @@ <view class="logout"><u-button text="閫�鍑虹櫥褰�" type="primary" @click="logout()"></u-button></view> + <view class="logout"><u-button text="鑱旂郴鎴戜滑" + type="primary" + @click="contactUs()"></u-button></view> </view> <u-toast ref="uToast"></u-toast> <!-- 鏂板缓杞﹂槦寮瑰嚭妗� --> @@ -171,8 +174,7 @@ @click="addNewGroupClick"></u-button></view> </u-popup> </view> - - <!-- 鍒犻櫎璐т唬妯℃�佹 --> + <!-- 鍒犻櫎鎵胯繍鍟嗘ā鎬佹 --> <view class="deleteHuoDaiModal"> <u-modal :show="deleteHuoDaiShow" :title="deleteHuoDaiTitle" @@ -209,6 +211,7 @@ </template> <script> + import { BaseUrl } from '@/api/publicInterface.js' import combinedTitle from '@/components/combined-title/combined-title.vue'; import { customerId, redirectLogin } from '@/utils/status'; export default { @@ -231,8 +234,8 @@ options1: [{ text: '鍒犻櫎' }], - // 鍒犻櫎璐т唬妯℃�佹 - deleteHuoDaiId: null, // 鍒犻櫎璐т唬id + // 鍒犻櫎鎵胯繍鍟嗘ā鎬佹 + deleteHuoDaiId: null, // 鍒犻櫎鎵胯繍鍟唅d deleteHuoDaiShow: false, deleteHuoDaiTitle: '', deleteHuoDaiContent: '', @@ -249,7 +252,8 @@ userEntity: {}, initPwdShow: false, modifyPwdShow: false, - passwordModified: '' + passwordModified: '', + phoneList:[] }; }, computed: { @@ -266,6 +270,40 @@ this.getAllHuoDaiByCustomerId(); this.getFleet(); this.getUserEntity(); + uni.request({ + url: `${BaseUrl}/admin/dict/page`, + method: 'GET', + data: { + dictType:'phone' + }, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), + clientToc: 'Y', + 'CLIENT_TOC': 'Y', + }, + success: res => { + let dictId=res.data.data?.records[0].id + uni.request({ + url: `${BaseUrl}/admin/dict/item/page`, + method: 'GET', + data: { + dictId:dictId + }, + header: { + Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'), + clientToc: 'Y', + 'CLIENT_TOC': 'Y', + }, + success: res => { + this.phoneList=res.data.data.records + }, + fail: err => { + } + }) + }, + fail: err => { + } + }) }, getUserEntity() { uni.showLoading({ @@ -285,7 +323,7 @@ this.BuyCardData = res.data; }); }, - // 鑾峰彇璐т唬鍒楄〃 + // 鑾峰彇鎵胯繍鍟嗗垪琛� getAllHuoDaiByCustomerId() { uni.showLoading({ title: '鍔犺浇涓�...' @@ -305,16 +343,16 @@ this.fleetData = res.data; }); }, - // 娣诲姞璐т唬 + // 娣诲姞鎵胯繍鍟� addHuoDai() { uni.navigateTo({ - url: '/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver?role=1' // 1浠h〃鐨勬槸璐т唬 + url: '/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver?role=1' // 1浠h〃鐨勬槸鎵胯繍鍟� }); }, // 娣诲姞璐拱璇� addGouMai(){ uni.navigateTo({ - url: '/pages/customer-page/addTo-freightForwarder-purchasePermit/addTo-freightForwarder-purchasePermit' + url: '/subPages/addTo-freightForwarder-purchasePermit/addTo-freightForwarder-purchasePermit' }); }, // 娣诲姞杞﹂槦 @@ -355,14 +393,14 @@ }); this.updateGroupShow = false; }, - // 鍒犻櫎璐т唬 + // 鍒犻櫎鎵胯繍鍟� deleteHuoDaiClick(args) { - console.log(args, '璐т唬id'); + console.log(args, '鎵胯繍鍟唅d'); this.deleteHuoDaiId = args.name; this.deleteHuoDaiShow = true; this.huoDaiData.forEach(item => { if (item.userId == this.deleteHuoDaiId) { - this.deleteHuoDaiContent = '纭鍒犻櫎璐т唬' + item.name + '鍚楋紵'; + this.deleteHuoDaiContent = '纭鍒犻櫎鎵胯繍鍟�' + item.name + '鍚楋紵'; } }); }, @@ -426,7 +464,7 @@ this.getFleet(); }); }, - // 璐т唬璇︽儏 + // 鎵胯繍鍟嗚鎯� toFreightForwarderDetails(userId) { uni.navigateTo({ url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?userId=${userId}` @@ -441,6 +479,25 @@ logout() { this.logoutShow = true; }, + contactUs(){ + let data=[] + this.phoneList.map(item=>{ + item.value.split(',').map(ite=>{ + data.push(ite) + }) + }) + uni.showActionSheet({ + itemList: Array.from(new Set(data)), + success: (res) => { + uni.makePhoneCall({ + phoneNumber:Array.from(new Set(data))[res.tapIndex + 1] + }) + }, + fail: (err) => { + console.log('寮圭獥鍙栨秷'); + } + }); + }, logoutConfirm() { redirectLogin(); this.$store.commit('changeisLogin', false) -- Gitblit v1.9.1