Procházet zdrojové kódy

服务对象修改

zhanghui před 2 roky
rodič
revize
eb08d47e0a

+ 51 - 13
myPages/serviceObjectAllInfo/index.vue

@@ -163,8 +163,8 @@
                                     size="14"
                                     v-model="userInfo.wardship"
                                     placement="row">
-                                <u-radio class="radio-item" activeColor="#eac00f" name="1" label="否"></u-radio>
-                                <u-radio class="radio-item" activeColor="#eac00f" name="2" label="是"></u-radio>
+                                <u-radio class="radio-item" activeColor="#eac00f" name="2" label="否"></u-radio>
+                                <u-radio class="radio-item" activeColor="#eac00f" name="1" label="是"></u-radio>
                             </u-radio-group>
                         </view>
                     </view>
@@ -213,13 +213,14 @@
                     facePhotos: '',
                     facePhoto: '',
                     ranks: 0,
-                    wardship: '2',
+                    wardship: '1',
                     blood: '',
                     ranksState: '0',
                     facePhotoUrl: '',
                     name: '',
                     authBook: '',
-                    signPhoto: ''
+                    signPhoto: '',
+                    remark:''
                 },
                 genderShow: false,
                 date: Number(new Date()),
@@ -243,6 +244,19 @@
                 this.userInfo.facePhotoUrl = data.facePhotoUrl;
                 this.userInfo.facePhoto = data.facePhoto;
                 this.userInfo.facePhotos = data.facePhoto;
+                this.userInfo.birthday = data.birthday;
+                this.userInfo.memberType = data.memberType;
+                this.userInfo.ranks = data.ranks;
+                this.userInfo.wardship = data.wardship;
+                this.userInfo.blood = data.blood;
+                this.userInfo.ranksState = data.ranksState;
+                this.userInfo.name = data.name;
+                this.userInfo.authBook = data.authBook;
+                this.userInfo.signPhoto = data.signPhoto;
+                this.userInfo.sex = data.sex;
+                this.userInfo.nickName = data.nickName;
+                this.userInfo.remark = data.remark;
+                this.userInfo.id = data.id;
             }
         },
         methods: {
@@ -299,16 +313,40 @@
 
                 this.userInfo.auth = true;
 
-                // 保存数据
-                this.$api.saveServiceObject(this.userInfo).then((res)=>{
-                    console.log(res)
-                    uni.showToast({
-                        title: "添加成功"
+                if (this.userInfo.id){
+
+                    // 修改数据
+                    this.$api.updateServiceObject(this.userInfo).then((res)=>{
+                        console.log(res)
+                        uni.showToast({
+                            title: "修改成功"
+                        })
+                        setTimeout(()=>{
+                            uni.redirectTo({
+                                url: '/myPages/ServiceObjectManagement/index'
+                            });
+                        },2000)
+
+                    })
+
+                }else{
+
+                    // 保存数据
+                    this.$api.saveServiceObject(this.userInfo).then((res)=>{
+                        console.log(res)
+                        uni.showToast({
+                            title: "保存成功"
+                        })
+                        setTimeout(()=>{
+
+                            uni.redirectTo({
+                                url: '/myPages/ServiceObjectManagement/index'
+                            });
+                        },2000)
+
                     })
-                    uni.redirectTo({
-                        url: '/myPages/ServiceObjectManagement/index'
-                    });
-                })
+                }
+
             },
             //头像上传
             uploadImg1(imgIndex) {

+ 2 - 2
myPages/serviceObjectFaceAuth/index.vue

@@ -90,7 +90,7 @@
             serviceObject.facePhoto= this.ossId
             serviceObject.facePhotoUrl=this.facePhotoUrl
             console.log(JSON.stringify(serviceObject))
-            uni.navigateTo({
+            uni.redirectTo({
               url: '/myPages/serviceObjectAllInfo/index?data='+ JSON.stringify(serviceObject),
             })
           } else { // 人脸存在
@@ -99,7 +99,7 @@
             serviceObject.opType = "1";
             serviceObject.facePhotoUrl =  that.facePhotoUrl;
             serviceObject.facePhoto = that.reqParm.facePath;
-            uni.navigateTo({
+            uni.redirectTo({
               url: '/myPages/serviceObjectInfo/index?data=' + JSON.stringify(serviceObject),
             })
           }

+ 2 - 2
myPages/serviceObjectInfo/index.vue

@@ -162,7 +162,7 @@
                         }
                         // 去服务对象列表页
                         setTimeout(()=>{
-                            uni.navigateTo({
+                            uni.redirectTo({
                                 url: '/myPages/ServiceObjectManagement/index',
                             })
                         },3000)
@@ -175,7 +175,7 @@
                         })
                         // 去服务对象列表页
                         setTimeout(()=>{
-                            uni.navigateTo({
+                            uni.redirectTo({
                                 url: '/myPages/ServiceObjectManagement/index',
                             })
                         },3000)

+ 7 - 2
orderPages/serviceObject/index.vue

@@ -1,8 +1,8 @@
 <template>
-    <view class="" >
+    <view class="page" >
         <view v-for="(item,index) in serviceObjectList" @click="chooseServiceObject(item)" class="h-item-row">
             <view class="h-img">
-                <image :src="item.imgUrl || '/static/logo.png'" mode=""></image>
+                <image :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFill"></image>
             </view>
             <view class="h-item-content">
                 <view class="h-title">
@@ -61,6 +61,8 @@
                     if (item.facePhoto){
                         this.$api.getImgUrlByOssId({ossId:item.facePhoto}).then(res=>{
                             console.log('+++++++++++++getImgUrlByOssId+++++++++++++++',res)
+                            item.facePhotoUrl= res.data.data[0].url.replace(/^http:/, "https:")
+                            this.$set(data,i,item)
                         })
                     }
                 }
@@ -83,6 +85,9 @@
 
 <style scoped lang="scss">
     @import '/common/css/common.css';
+    .page{
+        background: #F7F7F7;
+    }
     .h-item-row{
         display: flex;
         font-family: PingFangSC-Medium, PingFang SC;

+ 5 - 1
pages/index/index.vue

@@ -251,6 +251,10 @@ export default {
   },
 
   onShow() {
+    this.userInfo = uni.getStorageSync('userInfo');
+    if (this.userInfo.selfPhoto) {
+      this.getImgUrlByOssId(this.userInfo.selfPhoto);
+    }
     // 查询门店信息
     const data = uni.getStorageSync('storeInfo');
     if (!data) {
@@ -274,7 +278,7 @@ export default {
       let scene = e.scene
       console.log('7777777777777777777777777777777',scene)
       setTimeout(()=>{
-        let userInfo = uni.getStorageSync('userInfo');
+        this.userInfo = uni.getStorageSync('userInfo');
         this.scanCode(userInfo.otherId,scene);
       },5000)
     }