Parcourir la source

fix: 参加活动活动 选择服务对象优化

Cooklalala il y a 1 an
Parent
commit
fbebdf4d5f

+ 1 - 2
myPages/ServiceObjectManagement/index.vue

@@ -29,7 +29,6 @@
                 </view>
               </view>
             </view>
-
           </view>
         </view>
       </view>
@@ -85,7 +84,7 @@
         this.$api.listServiceObject(this.reqParm).then((res)=>{
           console.log(res)
           this.serviceObjectList = res.data.data
-           this.getImgUrlByBannerOssId(this.serviceObjectList);
+          this.getImgUrlByBannerOssId(this.serviceObjectList);
         })
       },
       // 获取图片

+ 4 - 1
myPages/myActivityDetail/myActivityDetail.vue

@@ -185,6 +185,7 @@ export default {
     }
   },
   onLoad(e) {
+    console.log(e)
     this.userInfo = uni.getStorageSync('userInfo')
     this.activityOrderId = e.activityOrderId
     this.myActivityDetail()
@@ -235,7 +236,9 @@ export default {
         console.log(res)
         this.activity = res.data.data
         this.$set(this.activity)
-        this.getImgUrlByBannerOssId(res.data.data.sharePicture)
+        if(res.data.data.sharePicture){
+          this.getImgUrlByBannerOssId(res.data.data.sharePicture)
+        }
       })
     },
 

+ 73 - 23
orderPages/activityDetail/activityDetail.vue

@@ -20,7 +20,8 @@
               <text>活动时间:</text>
             </view>
             <view>
-              <text v-if="activity.valid == 2">{{ activity.validBeginTime.substring(0, 10) }} 至 {{ activity.validEndTime.substring(0, 10) }}
+              <text v-if="activity.valid == 2">{{ activity.validBeginTime.substring(0, 10) }} 至
+                {{ activity.validEndTime.substring(0, 10) }}
               </text>
               <text v-else>长期有效</text>
             </view>
@@ -170,12 +171,41 @@
            :totalAmount="totalAmount" :lovePay="false" :blPay="false"
            :orderNo="subOrderNo" @payResult="payResult" @improperClose="improperClose"></myPay>
 
-    <view>
-      <u-picker :show="show" title="选择服务对象" :closeOnClickOverlay="true" @close="show = false"
-                :columns="serviceObjectList"
-                keyName="nickName" @cancel="show = false" @confirm="confirm"></u-picker>
-    </view>
+    <!--    <view>-->
+    <!--      <u-picker :show="show" title="选择服务对象" :closeOnClickOverlay="true" @close="show = false"-->
+    <!--                :columns="serviceObjectList"-->
+    <!--                keyName="nickName" @cancel="show = false" @confirm="confirm"></u-picker>-->
+    <!--    </view>-->
+    <uni-popup ref="popup" type="bottom">
+      <view class="addService">
+
+        <view class="popupTitle">
+          <text>切换服务对象</text>
+        </view>
+
+        <scroll-view class="scrollY" scroll-y>
+          <view class="flex-row objectItem" :class="{'vBackGround': selectServiceObjectIndex === index}"
+                v-for="(item,index) in serviceObjectList" :key="index"
+                @click="selectServiceObjectIndex = index">
+            <image class="objectImage" :src="item.facePhotoUrl || '/static/ud4.png'"></image>
+            <view class="flex-col objectName ">
+              <text>{{ item.nickName }}</text>
+            </view>
+            <image v-if="selectServiceObjectIndex === index" class="vImage"
+                   src="/static/index/xuanzhong.png"></image>
+          </view>
+        </scroll-view>
 
+        <view class="flex-row justify-around">
+          <view class="cancelButton" @click="closeSelectServiceObjectPopup">
+            <text>取消</text>
+          </view>
+          <view class="confirmButton" @click="confirm(serviceObjectList[selectServiceObjectIndex].id)">
+            <text>确定</text>
+          </view>
+        </view>
+      </view>
+    </uni-popup>
   </view>
 </template>
 
@@ -188,6 +218,7 @@ export default {
   },
   data() {
     return {
+      selectServiceObjectIndex:-1,
       showRemarkId: '',
       userInfo: {},
       subOrderNo: '',
@@ -204,7 +235,7 @@ export default {
       isShare: false,
       inviteUserId: null,
       inviteOrderId: null,
-      isShareMax:false,
+      isShareMax: false,
     }
   },
 
@@ -265,7 +296,7 @@ export default {
     this.activityCheck()
   },
 
-  onShow(){
+  onShow() {
     this.userInfo = uni.getStorageSync('userInfo')
     this.listServiceObject()
   },
@@ -280,6 +311,16 @@ export default {
 
       }
     },
+    getImgUrlByBannerOssId(items) {
+      for (let i = 0; i < items.length; i++) {
+        if (items[i].facePhoto) {
+          this.$api.getImgUrlByOssId({ossId: items[i].facePhoto}).then(res => {
+            items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+            this.$set(this.serviceObjectList, i, items[i])
+          })
+        }
+      }
+    },
     // 查询服务对像信息列表
     listServiceObject() {
       let serviceObjectList = []
@@ -291,9 +332,9 @@ export default {
         })
         // this.serviceObjectList[0] = serviceObjectList
 
-        this.$set(this.serviceObjectList,0,serviceObjectList)
-
-        console.log('执行了+++++++++++++++++++',this.serviceObjectList)
+        this.$set(this.serviceObjectList, 0, serviceObjectList)
+        this.getImgUrlByBannerOssId(this.serviceObjectList[0]);
+        console.log('执行了+++++++++++++++++++', this.serviceObjectList)
 
         // if (this.isShare) {
         if (serviceObjectList.length === 0) {
@@ -314,7 +355,10 @@ export default {
 
       })
     },
-
+    closeSelectServiceObjectPopup(){
+      this.selectServiceObjectIndex = -1
+      this.$refs.popup.close()
+    },
     //支付结果回调
     payResult(e) {
       console.log(e)
@@ -324,6 +368,11 @@ export default {
           title: '支付成功!'
         });
         this.isActivityCheck = true
+        setTimeout(() => {
+          uni.navigateTo({
+            url: '/myPages/myActivity/myActivity'
+          })
+        }, 2000)
       } else {
         uni.showToast({
           duration: 2000,
@@ -341,12 +390,12 @@ export default {
 
     beforeCommitOrder() {
 
-      if (!this.userInfo.phone){
+      if (!this.userInfo.phone) {
         uni.showModal({
-          title:'温馨提示',
-          content:'请先绑定手机号',
-          success:res=>{
-            if (res.confirm){
+          title: '温馨提示',
+          content: '请先绑定手机号',
+          success: res => {
+            if (res.confirm) {
               uni.navigateTo({
                 url: '/myPages/setting/setting-telphone',
               })
@@ -357,20 +406,22 @@ export default {
       }
 
       if (this.activity.isAddServiceObject == 1) {
-        this.show = true
+        // this.show = true
+        this.$refs.popup.open()
       } else {
         this.commitOrder()
       }
     },
 
     confirm(e) {
+      // console.log(e)
+      // this.serviceObjectId = e.value[0].id
       console.log(e)
-      this.serviceObjectId = e.value[0].id
-      this.show = false
-
+      this.serviceObjectId = e
+      // this.show = false
+      this.$refs.popup.close()
       this.commitOrder()
     },
-
     //提交订单
     commitOrder() {
       // if (this.subOrderNo){
@@ -412,7 +463,6 @@ export default {
       // }
     },
 
-
     activityDetail() {
       console.log(this.id, '活动ID')
       const data = {

+ 82 - 1
orderPages/activityDetail/index.rpx.scss

@@ -167,7 +167,8 @@
 .activityValue {
   flex: 1;
 }
-.remark{
+
+.remark {
   width: 646rpx;
   font-size: 25rpx;
   line-height: 40rpx;
@@ -177,3 +178,83 @@
   text-indent: 2em;
   color: #999999;
 }
+
+.addService {
+  width: 750rpx;
+  background: #FFFFFF;
+  padding: 24rpx 0;
+  border-radius: 24rpx 24rpx 0rpx 0rpx;
+}
+
+.popupTitle {
+  height: 44rpx;
+  font-size: 32rpx;
+  font-weight: 600;
+  color: #333333;
+  line-height: 44rpx;
+  margin-left: 34rpx;
+}
+.scrollY {
+  height: 504rpx;
+  margin-top: 34rpx;
+  margin-bottom: 24rpx;
+}
+.cancelButton {
+  width: 332rpx;
+  height: 80rpx;
+  background: #F5F5F5;
+  border-radius: 54rpx;
+  text-align: center;
+  line-height: 80rpx;
+  font-size: 28rpx;
+  font-weight: 400;
+  color: #666666;
+}
+.confirmButton {
+  width: 332rpx;
+  height: 80rpx;
+  background: #FFE05C;
+  border-radius: 54rpx;
+  text-align: center;
+  line-height: 80rpx;
+  font-size: 28rpx;
+  font-weight: 400;
+  color: #333333;
+}
+.vBackGround {
+  background: rgba(255, 224, 92, 0.1);
+  border: 4rpx solid #FFE05C;
+  box-sizing: border-box;
+}
+.objectImage {
+  width: 108rpx;
+  height: 108rpx;
+  border-radius: 56rpx;
+  border: 2rpx solid #FFFFFF;
+  margin-top: 24rpx;
+  margin-left: 24rpx;
+}
+.objectItem {
+  width: 686rpx;
+  height: 160rpx;
+  background: #FAFAFA;
+  border-radius: 16rpx;
+  margin-left: 32rpx;
+  position: relative;
+  margin-top: 24rpx;
+}
+.objectName {
+  height: 160rpx;
+  font-size: 32rpx;
+  font-weight: 600;
+  color: #111111;
+  line-height: 160rpx;
+  margin-left: 24rpx;
+}
+.vImage {
+  position: absolute;
+  top: 0;
+  right: 0;
+  width: 32rpx;
+  height: 32rpx;
+}

+ 0 - 3
orderPages/activityList/module/mescrollUni-item.vue

@@ -105,9 +105,6 @@ export default {
       })
     },
 
-
-
-
 		/*下拉刷新的回调 */
 		downCallback() {
 			// 这里加载你想下拉刷新的数据, 比如刷新轮播数据

BIN
static/index/xuanzhong.png