Przeglądaj źródła

Merge branch 'master' of http://222.85.201.140:10002/xuyunhui/chain_jje_uniapp

LuoDLeo 2 lat temu
rodzic
commit
fc6326f620

+ 9 - 1
common/js/api.js

@@ -3,7 +3,15 @@ import request from '../js/request.js';
 
 export default {
 
-	//post请求  一键付款余额支付
+	//post请求  我的权益卡列表
+	myEquityCardList(){
+		return request({
+			url: '/member/wechat/getMyEquityCard',
+			method: 'GET'
+		})
+	},
+
+	//post请求  权益卡列表
 	equityCardList(){
 		return request({
 			url: '/business/wechat/equity-card/list',

+ 4 - 3
common/js/request.js

@@ -16,10 +16,11 @@ function service(options = {}) {
 			// 如果请求回来的状态码不是200则执行以下操作
 			if (res.data.code !== 200) {
 				// 非成功状态码弹窗
+				console.log('错误信息:+++',res.data.msg)
 				uni.showToast({
 					icon: 'none',
 					duration: 3000,
-					title: `${res.data.msg}`
+					title: '错误信息:'+`${res.data.msg}`
 				});
 				// 这里可以做一些状态码判断以及操作
 				// 返回错误信息
@@ -30,12 +31,12 @@ function service(options = {}) {
 			}
 		};
 		options.fail = (err) => {
-			console.log(err)
+			console.log('错误信息:+++',err)
 			// 请求失败弹窗
 			uni.showToast({
 				icon: 'none',
 				duration: 3000,
-				title: '系统繁忙,请稍后再试'
+				title: err.errMsg
 			});
 			rejected(err);
 		};

+ 3 - 5
loginPages/login/bind-account-password.vue

@@ -46,13 +46,13 @@
 			<text>下一步</text>
 		</view>
 	</view>
-	
+
 	<view class="h-mark-desc">
 		<view class="h-text">
 			<text>*账号密码建议输入6到18位的数字、字母和特殊符号组成</text>
 		</view>
 	</view>
-	
+
   </view>
 </template>
 <script>
@@ -119,8 +119,6 @@ export default {
 						data: JSON.stringify(that.userInfo)
 					}
 				})
-			}).catch(errors => {
-				uni.$u.toast('校验失败,请认真填写')
 			})
 		},
 	}
@@ -161,4 +159,4 @@ page,body{
 	}
 }
 
-</style>
+</style>

+ 2 - 12
loginPages/login/bind-account.vue

@@ -164,18 +164,12 @@ export default {
 						url: '/loginPages/login/bind-transaction-password?data='+JSON.stringify(that.userInfo),
 					})
 				}
-			}).catch(() =>{
-				uni.showToast({
-					title: "操作失败"
-				})
-			});
+			})
 		},
 		// 去绑定账号密码页面
 		gotoBindAccountPassword(){
 			this.$refs.form1.validate().then(res => {
 				this.phoneIsExist();
-			}).catch(errors => {
-				uni.$u.toast('校验失败,请认真填写')
 			})
 		},
 		codeChange2(text) {
@@ -198,11 +192,7 @@ export default {
 				uni.$u.toast('验证码已发送');
 				// 通知验证码组件内部开始倒计时
 				that.$refs.uCode2.start();
-			}).catch(() =>{
-				uni.showToast({
-					title: "操作失败"
-				})
-			});
+			})
 		},
 	}
 }

+ 2 - 1
main.js

@@ -9,7 +9,8 @@ import api from './common/js/api'
 console.log(`process`, process.envenv)
 
 import uView from "uview-ui";
-const baseUrl = 'https://jje.admin.xinyuekj.com.cn/';
+// const baseUrl = 'https://jje.admin.xinyuekj.com.cn';
+const baseUrl = 'http://192.168.1.150:8080';
 Vue.use(uView);
 Vue.config.productionTip = false
 Vue.prototype.$baseUrl = baseUrl;

+ 55 - 48
myPages/ServiceObjectManagement/index.vue

@@ -1,38 +1,36 @@
 <template>
-  <view class="">
-    <view class="service-object-wrap">
-
-      <view class="service-object-list" >
-
-        <view v-for="item in serviceObjectList" class="store-content">
-          <view class="store-img">
-            <image v-if="item.facePhotoUrl" :src="item.facePhotoUrl" mode=""></image>
-            <image v-else src="../../static/logo.png" mode=""></image>
-          </view>
-          <view class="content">
-            <view class="title-price">
-              <view class="title">
-                <text v-if="item.nickName">{{item.nickName}}</text>
-                <text v-else>未填写</text>
-              </view>
-              <view @click="gotoUpdateServiceObject(item)" class="icon-btn">
-                <image src="/static/me/u2299.png" mode=""></image>
-              </view>
+  <view class="page" :style="{'height':windowHeight}">
+    <scroll-view :style="{'height':windowHeight}" scroll-y>
+      <view class="service-object-wrap">
+
+        <view class="service-object-list" >
+          <view v-for="(item,index) in serviceObjectList" class="store-content" :key="index">
+            <view class="store-img">
+              <image  :src="item.facePhotoUrl || '/static/logo.png'" mode=""></image>
             </view>
-            <view class="desc">
-              <view class="in-progress">关系:{{item.blood}}</view>
-              <view class="completed" >
-                备注:<text>{{item.remark || '无'}}</text>
+            <view class="content">
+              <view class="title-price">
+                <view class="title">
+                  <text>{{item.nickName || '未填写'}}</text>
+                </view>
+                <view @click="gotoUpdateServiceObject(item)" class="icon-btn">
+                  <image src="/static/me/u2299.png" mode=""></image>
+                </view>
+              </view>
+              <view class="desc">
+                <view class="in-progress">关系:{{item.blood}}</view>
+                <view class="completed" >
+                  备注:<text>{{item.remark || '无'}}</text>
+                </view>
               </view>
             </view>
           </view>
         </view>
       </view>
 
-      <view @click="gotoAddServiceObject()" class="add">
-        +<text class="name">添加服务对象</text>
-      </view>
-
+    </scroll-view>
+    <view @click="gotoAddServiceObject()" class="add">
+      +<text class="name">添加服务对象</text>
     </view>
   </view>
 </template>
@@ -41,6 +39,7 @@
   export default {
     data() {
       return {
+        windowHeight:'',
         reqParm: {
           auth: true
         },
@@ -51,7 +50,8 @@
     mounted() {
     },
     onLoad() {
-
+      let sysInfo = uni.getSystemInfoSync()
+      this.windowHeight =sysInfo.windowHeight -100  +'px'//除标题栏栏外的屏幕可用高度
     },
     onShow(){
       // 查询服务对象列表
@@ -75,7 +75,9 @@
         for(let i = 0; i <items.length; i++) {
           if (items[i].facePhoto){
             this.$api.getImgUrlByOssId({ossId:items[i].facePhoto}).then(res=>{
+              console.log('++++++++++++facePhotoUrl+++++++++',res.data.data[0].url.replace(/^http:/, "https:"))
               items[i].facePhotoUrl = res.data.data[0].url.replace(/^http:/, "https:")
+              this.$set(this.serviceObjectList,i,items[i])
             })
           }
         }
@@ -110,27 +112,32 @@
 </script>
 
 <style lang="scss" scoped>
+
+  .page{
+    background: #f7f7f7;
+    border-top: 1px solid #f7f7f7;
+  }
+
+  .add{
+    width: 686rpx;
+    margin-left: 32rpx;
+    margin-top: 30px;
+    text-align: center;
+    color: #333333;
+    line-height: 42px;
+    border-radius: 6px;
+    font-size: 16px;
+    height: 42px;
+    background: #FFE05C;
+    border-radius: 27px;
+    .name{
+      padding-left: 6px;
+    }
+  }
   .service-object-wrap{
     margin-left: 12px;
     margin-right: 12px;
-    .add{
-      position: fixed;
-      bottom: 12px;
-      right: 12px;
-      left: 12px;
-      margin-top: 20px;
-      text-align: center;
-      color: #333333;
-      line-height: 42px;
-      border-radius: 6px;
-      font-size: 16px;
-      height: 42px;
-      background: #FFE05C;
-      border-radius: 27px;
-      .name{
-        padding-left: 6px;
-      }
-    }
+
     .service-object-list{
       .store-content{
         padding:10px;
@@ -163,8 +170,8 @@
               text-align: right;
               padding-right: 12px;
               image{
-                height: 36px;
-                width: 36px;
+                height: 30px;
+                width: 30px;
               }
             }
           }

+ 3 - 15
myPages/recharge/index.vue

@@ -194,11 +194,7 @@
 				this.$api.getRechargeList(this.reqOrderParm).then((res)=>{
 					console.log('++++++++++++++getRechargeList+++++++++++++++++',res)
 					this.rechargeList = res.data.data;
-				}).catch(() =>{
-					uni.showToast({
-						title: "操作失败"
-					})
-				});
+				})
 			},
 			// 提交订单
 			submitOrder(){
@@ -224,11 +220,7 @@
 					that.reqPayParm.orderNo = res.data.data.orderNo;
 					// 调用微信支付
 					that.wechatPay();
-				}).catch(() =>{
-					uni.showToast({
-						title: "操作失败"
-					})
-				});
+				})
 			},
 			// 微信支付
 			wechatPay(){
@@ -258,11 +250,7 @@
 							});
 						}
 					});
-				}).catch(() =>{
-					uni.showToast({
-						title: "操作失败"
-					})
-				});
+				})
 			},
 
 			getUserInfo(){

+ 37 - 51
myPages/serviceObjectAllInfo/index.vue

@@ -58,12 +58,15 @@
                             <view class="">宝贝生日</view>
                         </view>
                     </view>
-                    <view @click="chooseServiceDate()" class="arrow-right">
-                        <view class="change-store">
-                            <text v-if="userInfo.birthday">{{userInfo.birthday}}</text>
-                            <text v-else>请选择生日</text>
-                        </view>
-                        <u-icon name="arrow-right" color="#666" size="16"></u-icon>
+                    <view  class="arrow-right">
+
+                        <picker mode="date" :value="date" :start="date"  @change="bindDateChange">
+                            <view class="picker-change-store">
+                                <text v-if="userInfo.birthday">{{userInfo.birthday}}</text>
+                                <text v-else>请选择生日</text>
+                                <u-icon name="arrow-right" color="#666" size="16"></u-icon>
+                            </view>
+                        </picker>
                     </view>
                 </view>
             </view>
@@ -188,13 +191,6 @@
         </view>
 
 
-        <!-- 日期时间选择 -->
-        <u-datetime-picker
-                :show="dateShow"
-                v-model="value1"
-                mode="date"
-                @confirm="sureChooseDate()"
-        ></u-datetime-picker>
 
         <!-- 性别选择 -->
         <u-picker :show="genderShow" keyName="gender"  @confirm="sureChooseGender" :columns="genderList"></u-picker>
@@ -226,8 +222,7 @@
                     signPhoto: ''
                 },
                 genderShow: false,
-                dateShow: false,
-                value1: '2023-12-12',
+                date: Number(new Date()),
                 // 服务时间
                 genderList: [
                     [{gender:'男',id:'0'},
@@ -241,12 +236,13 @@
         mounted() {
         },
         onLoad(option) {
-            if(!this.$isDataEmpty(option.data)){
+
+            if(option.data){
                 const data = JSON.parse(option.data);
+                console.log('+++++++JSON.parse(option.data)++++++',option.data)
                 this.userInfo.facePhotoUrl = data.facePhotoUrl;
                 this.userInfo.facePhoto = data.facePhoto;
-                this.userInfo.selfPhoto = data.facePhoto;
-                this.userInfo.facePhotos = data.facePhotos;
+                this.userInfo.facePhotos = data.facePhoto;
             }
         },
         methods: {
@@ -273,40 +269,28 @@
                 this.userInfo.sex = e.value[0].id;
             },
             // 确定选择的服务日期
-            sureChooseDate(){
-                this.dateShow = false;
-                this.userInfo.birthday = this.$formatDate(this.value1)
-            },
-            // 选择服务日期
-            chooseServiceDate(){
-                this.value1 = Date.now();
-                this.dateShow = true;
-            },
-            // 去会员信息页
-            gotoMemberInfo(){
-                uni.$u.route({
-                    url: '/pages/member/member-info',
-                    params: {
-                        name: 'lisa'
-                    }
-                })
+            bindDateChange(e){
+                console.log(e)
+                this.userInfo.birthday = e.detail.value
             },
+
+
             // 保存用户信息
             saveUserInfo(){
 
-                if(this.$isDataEmpty(this.userInfo.nickName)){
+                if(!this.userInfo.nickName){
                     uni.showToast({
                         title: "请认真填写宝贝昵称"
                     })
                     return;
                 }
-                if(this.$isDataEmpty(this.userInfo.blood)){
+                if(!this.userInfo.blood){
                     uni.showToast({
                         title: "请认真填写关系"
                     })
                     return;
                 }
-                if(this.$isDataEmpty(this.userInfo.birthday)){
+                if(!this.userInfo.birthday){
                     uni.showToast({
                         title: "请认真填写宝贝生日"
                     })
@@ -316,22 +300,15 @@
                 this.userInfo.auth = true;
 
                 // 保存数据
-                saveServiceObject(null,{data:this.userInfo}).then((res)=>{
+                this.$api.saveServiceObject(this.userInfo).then((res)=>{
                     console.log(res)
-                    // 去服务对象列表页
-                    // 关闭当前页面并跳转到目标页面
-                    uni.reLaunch({
-                        url: '/pages/me/service-object-mgt'  // 目标页面的路径
-                    });
-                    /* uni.$u.route({
-                        url: '/pages/me/service-object-mgt',
-                        params: {}
-                    }) */
-                }).catch(() =>{
                     uni.showToast({
-                        title: "操作失败"
+                        title: "添加成功"
                     })
-                });
+                    uni.redirectTo({
+                        url: '/myPages/ServiceObjectManagement/index'
+                    });
+                })
             },
             //头像上传
             uploadImg1(imgIndex) {
@@ -442,6 +419,7 @@
                             image{
                                 width: 50px;
                                 height: 50px;
+                                border-radius: 25px;
                             }
                         }
                         .change-store{
@@ -494,4 +472,12 @@
     .radio-item{
         padding-right: 6px;
     }
+    .picker-change-store{
+        font-size: 14px;
+        color: #999;
+        line-height: 22px;
+
+        display: flex;
+        flex-direction: row;
+    }
 </style>

+ 20 - 127
myPages/serviceObjectFaceAuth/index.vue

@@ -8,15 +8,15 @@
 
     <view class="h-upload-wrap">
       <view class="h-item-row">
-        <view @click="uploadImg1(1)" class="h-item">
-          <view v-if="!imgUrl1" class="h-content">
-            <image src="../../static/me/u01.png" mode=""></image>
+        <view @click="uploadImg()" class="h-item">
+          <view v-if="!facePhotoUrl" class="h-content">
+            <image src="/static/me/u01.png" mode=""></image>
             <view class="h-text">
               <text>添加人脸影像</text>
             </view>
           </view>
           <view v-else class="h-upload-img">
-            <image mode="aspectFit" class="imgBox" :src="imgUrl1"></image>
+            <image mode="aspectFit" class="imgBox" :src="facePhotoUrl"></image>
           </view>
         </view>
       </view>
@@ -36,120 +36,37 @@
     },
     data() {
       return {
+        ossId:'',
+        facePhotoUrl:'',
         height:'',
-        errShow: false,
-        okShow: false,
-        imgUrl1: '',
-        imgUrl2: '',
-        imgUrl3: '',
-        imgUrl4: '',
-        imgUrl5: '',
-        show: false,
         reqParm: {
           auth: true,
           facePath: '',
           businessId: ''
         },
-        userInfo: {
+        userInfo: {},
 
-        },
-        parms: {
-          userName: '',
-          facePhoto: '',
-          facePhotos: '',
-          facePhotoUrl: ''
-        },
-        imgPaths: "",
-        ossImg: {
-          ossId1: "",
-          ossId2: "",
-          ossId3: "",
-          ossId4: "",
-          ossId5: ""
-        },
       }
     },
     onReady() {
     },
     onLoad(option) {
-      // 用户信息
-      // let user = this.$store.state.loginUserInfo;
-      // this.userInfo = user;
 
       let sysInfo= uni.getSystemInfoSync()
       this.height = sysInfo.screenHeight + 'px'
 
     },
     methods: {
-      // 去签订协议
-      gotoAutoLetter(){
-        if(!this.$isDataEmpty(this.parms.userName)){
-          this.okShow = false;
-          uni.$u.route({
-            url: '/pages/me/service-object-all-info',
-            params: {
-              data: JSON.stringify(this.userInfo)
-            }
-          })
-          // uni.$u.route({
-          // 	url: '/pages/me/service-object-auth-letter',
-          // 	params: {
-          // 		data: JSON.stringify(this.parms)
-          // 	}
-          // })
-        } else{
-          uni.$u.toast('请认真填写宝贝昵称')
-        }
-      },
-      // 实名认证
-      getoRealNameAuth(){
-        this.errShow = false;
-        // 已认证
-        uni.$u.route({
-          url: '/pages/me/real-name-auth',
-          params: {
-          }
-        })
-      },
+
+
       // 连接已上传的图片地址
       verifyImgUpload(){
-        let img1 = this.ossImg.ossId1;
-        let img2 = this.ossImg.ossId2;
-        let img3 = this.ossImg.ossId3;
-        let img4 = this.ossImg.ossId4;
-        let img5 = this.ossImg.ossId5;
-        if(!img1){
+        if(!this.ossId){
           uni.showToast({
-            title: "请上传第1张图片"
+            title: "请上传人脸照片"
           })
           return false;
         }
-        /* if(this.$isDataEmpty(img2)){
-            uni.showToast({
-                title: "请上传第2张图片"
-            })
-            return false;
-        }
-        if(this.$isDataEmpty(img3)){
-            uni.showToast({
-                title: "请上传第3张图片"
-            })
-            return false;
-        }
-        if(this.$isDataEmpty(img4)){
-            uni.showToast({
-                title: "请上传第4张图片"
-            })
-            return false;
-        }
-        if(this.$isDataEmpty(img5)){
-            uni.showToast({
-                title: "请上传第5张图片"
-            })
-            return false;
-        } */
-        // this.parms.facePhotos = img1+","+img2+","+img3+","+img4+","+img5;
-        this.parms.facePhotos = img1;
         return true;
       },
 
@@ -169,12 +86,12 @@
         this.$api.verifyFace(that.reqParm).then((res)=>{
           uni.hideLoading();
           if(res.data.data.code == '500'){ //人脸不存在
-            res.facePhotoUrl = that.imgUrl1;
-            res.facePhoto = that.ossImg.ossId1;
-            res.facePhotos = that.parms.facePhotos;
+            let serviceObject = {}
+            serviceObject.facePhoto= this.ossId
+            serviceObject.facePhotoUrl=this.facePhotoUrl
+            console.log(JSON.stringify(serviceObject))
             uni.navigateTo({
-              url: '/myPages/serviceObjectAllInfo/index?data'+ JSON.stringify(res),
-
+              url: '/myPages/serviceObjectAllInfo/index?data='+ JSON.stringify(serviceObject),
             })
           } else { // 人脸存在
             res.opType = "1";
@@ -192,7 +109,7 @@
 
       },
       //头像上传
-      uploadImg1(imgIndex) {
+      uploadImg() {
         let that = this;
         uni.chooseImage({
           count: 1,
@@ -208,33 +125,9 @@
               success: (uploadFileRes) => {
                 console.log("uploadFileRes:"+uploadFileRes)
                 let res = JSON.parse(uploadFileRes.data)
-                let ossId = res.data.ossId;
-                let url = res.data.url;
-                let imgUrl =  url.startsWith("https")? res.data.url : url.replace("http", "https");
-                console.log("imgUrl:"+imgUrl)
-                if(imgIndex == 1){
-                  that.ossImg.ossId1 = ossId;
-                  that.parms.facePhotoUrl = imgUrl;
-                  that.imgUrl1 = imgUrl;
-                }
-                if(imgIndex == 2){
-                  that.ossImg.ossId2 = ossId;
-                  that.imgUrl2 = imgUrl;
-                }
-                if(imgIndex == 3){
-                  that.ossImg.ossId3 = ossId;
-                  that.imgUrl3 = imgUrl;
-                }
-                if(imgIndex == 4){
-                  that.ossImg.ossId4 = ossId;
-                  that.imgUrl4 = imgUrl;
-                }
-                if(imgIndex == 5){
-                  that.ossImg.ossId5 = ossId;
-                  that.imgUrl5 = imgUrl;
-                }
-                this.reqParm.facePath = ossId;
-                this.parms.facePhoto = ossId;
+                that.ossId = res.data.ossId;
+                that.facePhotoUrl =  res.data.url.replace("http", "https");
+                that.reqParm.facePath = res.data.ossId;
               }
             });
           }

+ 0 - 16
pages/index/index.vue

@@ -355,10 +355,6 @@ export default {
       let that = this;
       this.$api.getSlideshowList({data: this.reqParm}).then((res) => {
         this.getImgUrlByBannerOssId(res.data.data);
-      }).catch(() => {
-        uni.showToast({
-          title: "操作失败"
-        })
       })
     },
     async getImgUrlByBannerOssId(items) {
@@ -379,10 +375,6 @@ export default {
         that.storeInfo = res.data.data[0]
         // 更新用户选择的门店信息
         uni.setStorageSync('storeInfo', res.data.data[0])
-      }).catch(() => {
-        uni.showToast({
-          title: "操作失败"
-        })
       })
     },
 
@@ -398,10 +390,6 @@ export default {
         } else {
           this.noticeList = res.data.rows;
         }
-      }).catch(() => {
-        uni.showToast({
-          title: "操作失败"
-        })
       })
     },
 
@@ -471,10 +459,6 @@ export default {
       // 用户绑定门店
       this.$api.userBindStore(this.reqParm).then((res) => {
         console.log(this.reqParm)
-      }).catch(() => {
-        uni.showToast({
-          title: "操作失败"
-        })
       })
     },
 

+ 4 - 3
pages/my/index.vue

@@ -150,10 +150,10 @@ export default {
 			this.group1[0].rightText = '未实名认证,去认证'
 		}
 
-		if (this.userInfo.selfPhoto){
-			this.getImgUrlByOssId(this.userInfo.selfPhoto)
-		}
+
 		this.getUserInfo()
+
+
 	},
 
 	methods: {
@@ -163,6 +163,7 @@ export default {
 				console.log('++++++++++++获取用户信息++++++++++++++++++',res)
 				uni.setStorageSync('userInfo',res.data.data)
 				this.userInfo = res.data.data
+				this.getImgUrlByOssId(this.userInfo.selfPhoto)
 			})
 		},
 

+ 3 - 19
pages/order/index.vue

@@ -253,12 +253,7 @@
 							that.getUserInfo()
 						}
 					});
-				}).catch(() =>{
-					uni.showToast({
-						title: "操作失败",
-						icon:'error'
-					})
-				});
+				})
 			},
 
 
@@ -312,14 +307,7 @@
 						that.$refs.MescrollItem[that.tabIndex].downCallback()
 						that.getUserInfo()
 						that.password = ''
-					}).catch((err) =>{
-						that.$refs.popup.close()
-						uni.showToast({
-							title: err.msg,
-							icon:'error'
-						})
-						that.password = ''
-					});
+					})
 				}
 
 
@@ -393,11 +381,7 @@
 									that.getUserInfo()
 								}
 							});
-						}).catch(() =>{
-							uni.showToast({
-								title: "操作失败"
-							})
-						});
+						})
 					}
 				}
 			},

+ 1 - 5
storePages/rights/index.vue

@@ -189,11 +189,7 @@
 							});
 						}
 					});
-				}).catch(() =>{
-					uni.showToast({
-						title: "操作失败"
-					})
-				});
+				})
 			},
 
 			getUserInfo(){