Explorar o código

fix: 参加活动 未选择服务对象时 提示

Cooklalala hai 1 ano
pai
achega
c4da192294
Modificáronse 2 ficheiros con 18 adicións e 2 borrados
  1. 10 2
      orderPages/activityDetail/activityDetail.vue
  2. 8 0
      storePages/rights/index.vue

+ 10 - 2
orderPages/activityDetail/activityDetail.vue

@@ -199,7 +199,7 @@
           <view class="cancelButton" @click="closeSelectServiceObjectPopup">
             <text>取消</text>
           </view>
-          <view class="confirmButton" @click="confirm(serviceObjectList[selectServiceObjectIndex].id)">
+          <view class="confirmButton" @click="confirm(serviceObjectList[selectServiceObjectIndex])">
             <text>确定</text>
           </view>
         </view>
@@ -416,7 +416,15 @@ export default {
       // console.log(e)
       // this.serviceObjectId = e.value[0].id
       console.log(e)
-      this.serviceObjectId = e
+      if(!e){
+        uni.showToast({
+          duration: 2000,
+          title: '请选择一个服务对象',
+          icon: 'none'
+        });
+        return
+      }
+      this.serviceObjectId = e.id
       // this.show = false
       this.$refs.popup.close()
       this.commitOrder()

+ 8 - 0
storePages/rights/index.vue

@@ -283,6 +283,14 @@ export default {
 
     confirm(e) {
       console.log(e)
+      if(!e){
+        uni.showToast({
+          duration: 2000,
+          title: '请选择一个服务对象',
+          icon: 'none'
+        });
+        return
+      }
       // this.serviceObject = e.value[0]
       this.serviceObject = e
       // this.show = false