Explorar o código

特殊商品退货须知接口调试

yuwenjun1997 %!s(int64=2) %!d(string=hai) anos
pai
achega
788065288a

+ 7 - 3
pages/goods/components/cm-return-instructions.vue

@@ -9,9 +9,7 @@
         	    <view class="close iconfont icon-iconfontguanbi" @click="close"></view>
         	    <view class="title">特殊商品退货须知</view>
                 <scroll-view :scroll-y="true" class="content">
-                    <view>
-                        为保障会员权益,特殊类商品(包括耗材/配件/私密商品等),除外观跟质量问题之外,其他原因均不支持退货!
-                    </view>
+                    <view v-html="content"></view>
                 </scroll-view>
         	</view>
         </tui-bottom-popup>
@@ -20,6 +18,12 @@
 
 <script> 
 export default {
+    props:{
+        content: {
+            type: String,
+            default: ''
+        }
+    },
     data(){
         return {
             popupShow: false

+ 9 - 3
pages/goods/product.vue

@@ -188,8 +188,8 @@
 						<text class="iconfont icon-xiayibu"></text>
 					</view>
                     <!-- 特殊商品退货须知 -->
-                    <view class="return-instructions">
-                        <cm-return-instructions></cm-return-instructions>
+                    <view class="return-instructions" v-if="returnGoodsStutas">
+                        <cm-return-instructions :content="helpContent"></cm-return-instructions>
                     </view>
 					<!-- 配套商品 -->
 					<view
@@ -743,7 +743,9 @@ export default {
 			],
 			showModal: false,
 			isShowCaimeiShop: false,
-			unitPopupType: 0 // 选择类型 1 点击加入购物车  立即购买  2:点击规格选择
+			unitPopupType: 0 ,// 选择类型 1 点击加入购物车  立即购买  2:点击规格选择
+            returnGoodsStutas: false,
+            helpContent: '',
 		}
 	},
 	computed: {
@@ -947,6 +949,10 @@ export default {
 					}
 					this.queryProductDetilsCoupons()
 					this.getCommodityCombinationList()
+                    // 特殊商品退货须知
+                    this.returnGoodsStutas = response.data.returnGoodsStutas === 2 // 1:可以 2:不可以
+                    this.helpContent = response.data.helpContent
+                    
 					setTimeout(() => {
 						this.skeletonShow = false
 						this.isRequest = true

+ 14 - 31
pages/user/order/components/cm-return-instructions.vue

@@ -14,26 +14,25 @@
                 <text @click="popupShow = true">《特殊商品退货须知》</text>
             </view>
         </view>
-        <view class="mask" v-if="popupShow"></view>
-        <uni-transition :show="popupShow" ref="ani">
-            <template>
-                <view class="popup-content">
-                    <view class="close iconfont icon-iconfontguanbi" @click="popupShow = false"></view>
-                    <view class="title">特殊商品退货须知</view>
-                    <scroll-view :scroll-y="true" class="content">
-                        <view>
-                            为保障会员权益,特殊类商品(包括耗材/配件/私密商品等),除外观跟质量问题之外,其他原因均不支持退货!
-                        </view>
-                    </scroll-view>
-                    <view class="confirm" @click="popupShow = false">确定</view>
-                </view>
-            </template>
-        </uni-transition>
+        <tui-modal :show="popupShow" custom>
+            <view class="popup-content">
+                <view class="close iconfont icon-iconfontguanbi" @click="popupShow = false"></view>
+                <view class="title">特殊商品退货须知</view>
+                <scroll-view :scroll-y="true" class="content"><view v-html="content"></view></scroll-view>
+                <view class="confirm" @click="popupShow = false">确定</view>
+            </view>
+        </tui-modal>
     </view>
 </template>
 
 <script>
 export default {
+    props: {
+        content: {
+            type: String,
+            default: ''
+        }
+    },
     data() {
         return {
             popupShow: false,
@@ -86,24 +85,8 @@ export default {
     }
 }
 
-.mask {
-    position: fixed;
-    width: 100vw;
-    height: 100vh;
-    left: 0;
-    top: 0;
-    background: rgba(0, 0, 0, 0.6);
-    z-index: 996;
-}
-
 .popup-content {
-    position: fixed;
-    left: 50%;
-    top: 50%;
-    transform: translate(-50%, -50%);
-    width: 580rpx;
     box-sizing: border-box;
-    padding: 40rpx 50rpx 30rpx;
     background-color: #fff;
     border-radius: 16rpx;
     z-index: 997;

+ 36 - 5
pages/user/order/create-order.vue

@@ -55,7 +55,7 @@
 		</view>
 		<!-- 底部 -->
 		<view class="footer-wrapper" :style="{paddingBottom :isIphoneX ? '68rpx' : '0rpx'}">
-            <cm-return-instructions></cm-return-instructions>
+            <cm-return-instructions v-if="returnGoodsStutas" :content="helpContent" @change="onAgreementChange"></cm-return-instructions>
             <view class="footer">
                 <view class="footer-le">
                 	<view class="footer-count">
@@ -80,7 +80,7 @@
 			<view class="coupon-alert-content">
 				<view class="coupon">
 					<view class="coupon-list">
-						<view class="list-cell-tags">{{ ExchangeCouponData.couponType | TypeFormat }}</text></view>
+						<view class="list-cell-tags"><text>{{ ExchangeCouponData.couponType | TypeFormat }}</text></view>
 						<view class="list-cell-le">
 							<view class="coupon-maxMoney">
 								<text class="small">¥</text>
@@ -120,6 +120,17 @@
 		   shape="circle"
 		   :maskClosable="false"
 		></tui-modal>
+        
+        <tui-modal 
+            :show="agreementModel" 
+            title="提示" 
+            content="请先阅读《特殊商品退货须知》并勾选后再提交订单~" 
+            shape="circle" 
+            color="#333" 
+            :size="28" 
+            :button="agreementModelButtons"  
+            @click="agreementModel = false"
+        ></tui-modal>
 	</view>
 </template>
 <script>
@@ -237,7 +248,19 @@
 					}
 				],
 				showModal: false,
-				showModalstauts:0
+				showModalstauts:0,
+                returnGoodsStutas: false,
+                helpContent: '',
+                agreementActive: false,
+                agreementModel: false,
+                agreementModelButtons: [{
+                    text: '确定',
+                    customStyle: {
+                        color: '#fff',
+                        bgColor: 'linear-gradient(90deg, #F28F31 0%, #E15616 100%)'
+                    },
+                    plain: false
+                }]
 			}
 		},
 		onLoad(option){//商品数据
@@ -249,6 +272,9 @@
 			},
 		},	
 		methods: {
+            onAgreementChange(val){
+                this.agreementActive = val
+            },
 			async initStorage(option){
 				const data = JSON.parse(option.data)
 				const userInfo = await this.$api.getStorage()
@@ -321,6 +347,9 @@
 				this.orderShouldPayFee = this.allPrice - this.couponAmount
 				this.totalDiscountAmount = this.reducedPrice + this.couponAmount
 				this.postageParam.skuIds = this.getProductIds(data.list)
+                // 特殊商品退货须知
+                this.returnGoodsStutas = data.returnGoodsStutas === 2 // 1:可以 2:不可以
+                this.helpContent = data.helpContent
 				this.getAddressData()
 			},
 			// 获取订单SKUId列表
@@ -543,7 +572,9 @@
 				console.log('优惠券金额',this.couponAmount)
 			},
 			orderSubmitMit(){// 提交订单按钮点击事件
-				if(this.allPrice <1000){
+                if(this.returnGoodsStutas && !this.agreementActive){
+                    this.agreementModel = true
+                }else if(this.allPrice <1000){
 					this.showModal = true
 					this.contentModalText = '采购金额过小,将扣除500采美豆,建议您前往采美旗下“颜选美学”小程序购买小额商品。'    //操作文字提示语句
 					this.showModalstauts = 1
@@ -830,6 +861,7 @@
 		left: 0;
 		bottom: 0;
         background-color: #FFFFFF;
+        z-index: 990; 
         .footer{
             display: flex;
             align-items: center;
@@ -838,7 +870,6 @@
             line-height: 110rpx;
             justify-content: space-between;
             font-size: $font-size-28;
-            z-index: 990;
             color: $text-color;
         }
 		.footer-le{

+ 6 - 3
pages/user/order/order-details.vue

@@ -30,9 +30,7 @@
 				:addressData="addressData"
 			></order-address>
             <!-- 特殊商品退货须知 -->
-            <view class="return-instructions">
-                为保障会员权益,特殊类商品(包括耗材/配件/私密商品等),除外观跟质量问题之外,其他原因均不支持退货!
-            </view>
+            <view class="return-instructions" v-if="returnGoodsStutas" v-html="helpContent"></view>
 			<!-- 商品 -->
 			<goods-list
 				ref="goods"
@@ -201,6 +199,8 @@ export default {
 					plain: false
 				}
 			],
+            returnGoodsStutas: false,
+            helpContent: '',
 		}
 	},
 	onLoad(option) {
@@ -276,6 +276,9 @@ export default {
 					this.receiptAmount = data.order.receiptAmount
 					this.returnedPurchaseFee = data.order.returnedPurchaseFee
 					this.clauseData = data.clause
+                    // 特殊商品退货须知
+                    this.returnGoodsStutas = data.returnGoodsStutas === 2 // 1:可以 2:不可以
+                    this.helpContent = data.helpContent
 					if (
 						this.information.orderSubmitType == 0 ||
 						this.information.orderSubmitType == 1 ||