zhongtianhaoyuan 2 éve
szülő
commit
6668bab3c2
2 módosított fájl, 93 hozzáadás és 22 törlés
  1. 57 2
      pages/mine/cargoowner/editEnerprise.vue
  2. 36 20
      pages/release/selectAddress.vue

+ 57 - 2
pages/mine/cargoowner/editEnerprise.vue

@@ -18,7 +18,11 @@
 			</view>
 		</view>
 		<view class='content1'>
-			<view class="title">上传企业授权书</view>
+			<!-- <view class="title">上传企业授权书</view> -->
+			<view class="flex">
+				<view class="title">上传企业授权书</view>
+				<view class="title title_css" @click="formWork">授权书模板</view>
+			</view>
 			<!-- {{show}} -->
 <!-- 			<button type="default" @click="()=>{show = true}" style="width: 80%;background-color: #007AFF;color: #fff;margin-top: 60rpx;">选择文件</button>
 				<view class="textStyle" v-for="(item,index) in pathArr" :key="index">
@@ -76,6 +80,8 @@
 				提交
 			</view>
 		</view>
+		<u-picker :show="formWorkShow" @cancel="formWorkShow = false" @close="formWorkShow = false"
+			:columns="formWorkColumns" @confirm="formWorkSubmit"></u-picker>
 	</view>
 </template>
 
@@ -103,7 +109,11 @@
 				uploadType:'',
 				index:0,
 				fileList1: [],
-				urlList:[]
+				urlList:[],
+				formWorkShow: false,
+				formWorkColumns: [
+					["复制下载链接", "预览模板"]
+				]
 			}
 		},
 		computed: {
@@ -144,6 +154,44 @@
 		
 		},
 		methods: {
+			formWork() {
+				this.formWorkShow = true
+			},
+			formWorkSubmit(e) {
+				let that = this
+				console.log(e.value[0])
+				if (e.value[0] == "复制下载链接") {
+					uni.setClipboardData({
+						data: 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/contractPdf/1069f84fcbbe4c2d9ce048bf98ea7a63.pdf',
+						success: function() {
+							uni.showToast({
+								title: '复制成功',
+							});
+							that.formWorkShow = false
+						},
+						fail: function() {
+							uni.showToast({
+								title: '复制失败',
+							});
+						}
+					});
+				} else {
+					uni.downloadFile({
+						url: 'https://taohaoliang.oss-cn-beijing.aliyuncs.com/contractPdf/1069f84fcbbe4c2d9ce048bf98ea7a63.pdf',
+						success: function(res) {
+							var filePath = res.tempFilePath;
+							uni.openDocument({
+								filePath: filePath,
+								showMenu: true,
+								success: function(res) {
+									console.log('打开文档成功');
+									that.formWorkShow = false
+								}
+							});
+						}
+					});
+				}
+			},
 			async get_camera_permission() {
 				var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
 				if(photol == false){
@@ -384,6 +432,13 @@
 		.title {
 			color: #999999;
 			margin: 20rpx 0;
+			width: 50%;
+		}
+		.title_css {
+			text-align: right;
+			color: #2772FB;
+			margin: 20rpx 0;
+			font-size: 30rpx;
 		}
 	}
 	.u-input{

+ 36 - 20
pages/release/selectAddress.vue

@@ -52,6 +52,9 @@
 			<view class="btn-left" @click="selectAddress(0)">选择临时地址</view>
 			<view class="btn-right" @click="selectAddress(1)">新增地址</view>
 		</view>
+		<u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
+			:showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick"
+			@cancel="cancelClick"></u-modal>
 		<u-toast ref="uToast"></u-toast>
 	</view>
 </template>
@@ -92,6 +95,10 @@
 					},
 
 				],
+				delId:"",
+				isShowAlert:false,
+				alertTitle:"",
+				alertContent:"",
 			}
 		},
 		computed: {
@@ -107,6 +114,32 @@
 			this.getList()
 		},
 		methods: {
+			confirmClick(){
+				this.isShowAlert = false
+				this.$request.baseRequest('post', '/cargoOwnerAddressInfo/api/deleteCargoOwnerAddress', {
+						id: this.delId,
+					}).then(res => {
+						if (res.code == 200) {
+							this.$refs.uToast.show({
+								type: 'success',
+								message: "删除成功",
+								complete() {
+									that.getList()
+								}
+							})
+						}
+					})
+					.catch(res => {
+						uni.showToast({
+							title: res.message,
+							icon: 'none',
+							duration: 2000
+						})
+					});
+			},
+			cancelClick(){
+				this.isShowAlert = false
+			},
 			configAddress(val) {
 				if (this.type == 0) {
 					uni.setStorageSync('storage_faddress', val);
@@ -227,26 +260,9 @@
 				uni.$u.route('/pages/release/editAddress', val);
 			},
 			del(val) {
-				this.$request.baseRequest('post', '/cargoOwnerAddressInfo/api/deleteCargoOwnerAddress', {
-						id: val.id,
-					}).then(res => {
-						if (res.code == 200) {
-							this.$refs.uToast.show({
-								type: 'success',
-								message: "删除成功",
-								complete() {
-									that.getList()
-								}
-							})
-						}
-					})
-					.catch(res => {
-						uni.showToast({
-							title: res.message,
-							icon: 'none',
-							duration: 2000
-						})
-					});
+				this.delId = val.id
+				this.isShowAlert = true
+				this.alertTitle = "确定将要删除该常用地址?"
 			},
 			selectAddress(type) {
 				// 0临时地址 1 新增地址