Parcourir la source

专属森林 退款 发票 出行人

Roebin il y a 3 ans
Parent
commit
2c0e03ccd5
3 fichiers modifiés avec 51 ajouts et 26 suppressions
  1. 5 4
      pages/order/applyAfterSale.vue
  2. 45 21
      pages/order/guide.vue
  3. 1 1
      pages/order/orderDetails.vue

+ 5 - 4
pages/order/applyAfterSale.vue

xqd xqd xqd xqd
@@ -69,10 +69,10 @@
 				</view>
 			</u--form>
 		</view>
-
+		<view style="margin-bottom: 170rpx;"></view>
 		<!-- 退款原因选择 -->
 		<u-picker :show="show" :columns="columns" confirmColor="#1E9F6A"></u-picker>
-
+		
 		<!-- <view class="" style="margin-bottom: 144rpx;"></view> -->
 		<view class="navbar" @click="applyRefund">
 			申请退款
@@ -139,6 +139,7 @@
 			},
 		
 			uploadFilePromise(url) {
+				let token = uni.getStorageSync("token")
 				return new Promise((resolve, reject) => {
 					let a = uni.uploadFile({
 						url: 'https://t38.9026.com/api/common/upload', // 仅为示例,非真实的接口地址
@@ -151,7 +152,7 @@
 							user: 'test'
 						},
 						success: (res) => {
-							console
+						
 							setTimeout(() => {
 								resolve(res.data.data)
 							}, 1000)
@@ -243,7 +244,7 @@
 		background-color: #ffffff;
 		border-radius: 8rpx 8rpx 16rpx 56rpx;
 		padding-bottom: 40rpx;
-		margin-bottom: 170rpx;
+		
 	}
 
 	.navbar {

+ 45 - 21
pages/order/guide.vue

xqd
@@ -43,35 +43,59 @@
 				});
 			},
 			savePoster() {
-				uni.getSetting({ //获取用户的当前设置
+				uni.downloadFile({
+					url: this.muster.qrcode_url,
 					success: (res) => {
-						if (res.authSetting['scope.writePhotosAlbum']) { //验证用户是否授权可以访问相册
-							this.saveImageToPhotosAlbum();
-						} else {
-							uni.authorize({ //如果没有授权,向用户发起请求
-								scope: 'scope.writePhotosAlbum',
-								success: () => {
-									this.saveImageToPhotosAlbum();
+						console.log(res)
+						if (res.statusCode === 200) {
+							uni.saveImageToPhotosAlbum({
+								filePath: res.tempFilePath,
+								success: function() {
+									uni.showToast({
+										title: "保存成功",
+										icon: "none"
+									});
 								},
-								fail: () => {
+								fail: function() {
 									uni.showToast({
-										title: "请打开保存相册权限,再点击保存相册分享",
-										icon: "none",
-										duration: 3000
+										title: "保存失败",
+										icon: "none"
 									});
-									setTimeout(() => {
-										uni.openSetting({ //调起客户端小程序设置界面,让用户开启访问相册
-											success: (res2) => {
-												this.saveImageToPhotosAlbum()
-												// console.log(res2.authSetting)
-											}
-										});
-									}, 3000);
 								}
-							})
+							});
 						}
 					}
 				})
+
+				// uni.getSetting({ //获取用户的当前设置
+				// 	success: (res) => {
+				// 		if (res.authSetting['scope.writePhotosAlbum']) { //验证用户是否授权可以访问相册
+				// 			this.saveImageToPhotosAlbum();
+				// 		} else {
+				// 			uni.authorize({ //如果没有授权,向用户发起请求
+				// 				scope: 'scope.writePhotosAlbum',
+				// 				success: () => {
+				// 					this.saveImageToPhotosAlbum();
+				// 				},
+				// 				fail: () => {
+				// 					uni.showToast({
+				// 						title: "请打开保存相册权限,再点击保存相册分享",
+				// 						icon: "none",
+				// 						duration: 3000
+				// 					});
+				// 					setTimeout(() => {
+				// 						uni.openSetting({ //调起客户端小程序设置界面,让用户开启访问相册
+				// 							success: (res2) => {
+				// 								this.saveImageToPhotosAlbum()
+				// 								// console.log(res2.authSetting)
+				// 							}
+				// 						});
+				// 					}, 3000);
+				// 				}
+				// 			})
+				// 		}
+				// 	}
+				// })
 			},
 			saveImageToPhotosAlbum() {
 				let base64 = this.muster.qrcode_url.replace(/^data:image\/\w+;base64,/, ""); //去掉data:image/png;base64,

+ 1 - 1
pages/order/orderDetails.vue

xqd
@@ -260,7 +260,7 @@
 						return
 					} else {
 						uni.navigateTo({
-							url: "/pages/order/guide"
+							url:"/pages/order/guide?muster="+encodeURIComponent(JSON.stringify(this.orderinfo.plan))
 						})
 					}