Parcourir la source

fix:新增添加服务对象时 可进行裁剪

Cooklalala il y a 1 an
Parent
commit
6c423ad2e8

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "shoppingTemplate",
     "appid" : "__UNI__1F23544",
     "description" : "",
-    "versionName" : "1.0.0",
-    "versionCode" : "100",
+    "versionName" : "2.0.1.9",
+    "versionCode" : 2019,
     "transformPx" : false,
     /* 5+App特有相关 */
     "app-plus" : {

+ 4 - 4
myPages/ServiceObjectManagement/index.vue

@@ -6,7 +6,7 @@
         <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="aspectFill" @click="magnify(item.facePhotoUrl)"></image>
+              <image  :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFit" @click="magnify(item.facePhotoUrl)"></image>
             </view>
             <view class="content">
               <view class="title-price">
@@ -14,7 +14,7 @@
                   <text>{{item.nickName || '未填写'}}</text>
                 </view>
                 <view @click="gotoUpdateServiceObject(item)" class="icon-btn">
-                  <image src="/static/me/u2299.png" mode=""></image>
+                  <image src="/static/me/u2299.png" mode="aspectFit"></image>
                 </view>
               </view>
               <view class="desc">
@@ -191,8 +191,8 @@
               text-align: right;
               padding-right: 12px;
               image{
-                height: 30px;
-                width: 30px;
+                height: 60rpx;
+                width: 60rpx;
               }
             }
           }

+ 26 - 4
myPages/serviceObjectFaceAuth/index.vue

@@ -8,7 +8,7 @@
 
     <view class="h-upload-wrap">
       <view class="h-item-row">
-        <view @click="uploadImg()" class="h-item">
+        <view @click="choose()" class="h-item">
           <view v-if="!facePhotoUrl" class="h-content">
             <image src="/static/me/u01.png" mode="aspectFill"></image>
             <view class="h-text">
@@ -33,13 +33,15 @@
       <text :style="{'margin-left':'10rpx'}">请阅读并同意</text>
       <text :style="{'color':'red'}" @click="goTermsOfService">《服务对象协议》</text>
     </view>
-
+    <yhdslCropper ref="yhdslCropper" :quality="1" mode="scale"  @uploadImg="uploadCropImg" scale=1 />
   </view>
 </template>
 
 <script>
+import yhdslCropper from '@/components/yhdsl-cropper/yhdsl-cropper.vue';
   export default {
     components: {
+      yhdslCropper
     },
     data() {
       return {
@@ -62,7 +64,10 @@
     onLoad(option) {
     },
     methods: {
-
+      choose() {
+        // 调用实例的chooseImg方法,拉起图片选择界面,待图片选择完毕后直接进入图片截取界面
+        this.$refs.yhdslCropper.chooseImage();
+      },
       goTermsOfService(){
         uni.navigateTo({
           url:'/myPages/TermsOfService/index?name='+'服务对象协议'+'&type=' + 6
@@ -142,7 +147,7 @@
           success: (chooseImageRes) => {
             const tempFilePaths = chooseImageRes.tempFilePaths;
             uni.uploadFile({
-              url: that.$baseUrl + '/resource/oss/upload', //仅为示例,非真实的接口地址
+              url: that.$baseUrl + '/resource/oss/upload',
               filePath: tempFilePaths[0],
               name: 'file',
               header: {
@@ -158,6 +163,23 @@
             });
           }
         });
+      },
+      uploadCropImg(e){
+        uni.uploadFile({
+          url: this.$baseUrl + '/resource/oss/upload',
+          filePath: e,
+          name: 'file',
+          header: {
+            'Authorization': 'Bearer ' + uni.getStorageInfo('accessToken'),
+          },
+          success: (uploadFileRes) => {
+            console.log("uploadFileRes:"+uploadFileRes)
+            let res = JSON.parse(uploadFileRes.data)
+            this.ossId = res.data.ossId;
+            this.facePhotoUrl =  res.data.url.replace("http", "https");
+            this.reqParm.facePath = res.data.ossId;
+          }
+        });
       }
     }
   }

+ 11 - 5
pages/index/index.vue

@@ -291,7 +291,7 @@ export default {
     }
   },
   onLoad(e) {
-
+    console.log(e)
     if (e.shareUserId) {
       //用户点击分享到好友或者朋友圈传递过来的参数
       uni.setStorageSync('shareUserId', e.shareUserId)
@@ -300,6 +300,7 @@ export default {
 
     if (e.q) {
       //用户扫技师端或者拓客端二维码传递过来的参数
+
       const q = decodeURIComponent(e.q)
       let a = q.split('?')
       let b = a[1].split('&')
@@ -324,7 +325,6 @@ export default {
         uni.setStorageSync('storeParam', param)
         uni.removeStorageSync('promotionParam');
       }
-
       console.log("用户扫技师端或者拓客端二维码传递过来的参数", param)
     }
 
@@ -390,18 +390,24 @@ export default {
     operLog() {
       let param = uni.getStorageSync('promotionParam')
       let userInfo = uni.getStorageSync('userInfo')
+      // #ifdef MP-WEIXIN
+      const accountInfo = wx.getAccountInfoSync();
+      console.log(accountInfo.miniProgram.version, '小程序版本号')
+      // #endif
+
       const data = {
         title: "小程序扫码记录",
         operParam: param.techNo,
         operName: userInfo.no,
-        deptName: param.storeId
+        deptName: param.storeId,
+        errorMsg: accountInfo.miniProgram.version
       }
       console.log(data)
-      this.$api.scanLogs(data).then(res =>{
+      this.$api.scanLogs(data).then(res => {
         console.log('------日志发送成功---------')
       }).catch(errors => {
 
-        console.log(errors,'------日志发送失败---------')
+        console.log(errors, '------日志发送失败---------')
       })
     },
     goQrCode() {

+ 1 - 4
storePages/myRights/index.vue

@@ -41,7 +41,7 @@
           </view>
 
           <view class=" flex-col justify-center ">
-            <image class="h-right-content-img "  :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFill" @click="magnify(item.facePhotoUrl)"></image>
+            <image class="h-right-content-img "  :src="item.facePhotoUrl || '/static/logo.png'" mode="aspectFit" @click="magnify(item.facePhotoUrl)"></image>
           </view>
         </view>
         <view v-if="showRemarkId == item.id" class="remark" style="text-indent:unset">
@@ -51,7 +51,6 @@
           </view>
           <text v-else class="remarkText">该优惠券暂无使用说明</text>
         </view>
-
 			</view>
 		</scroll-view>
 		<uni-popup ref="popup">
@@ -59,8 +58,6 @@
 				<image :src="magnifyUrl" mode="widthFix"></image>
 			</view>
 		</uni-popup>
-
-
 	</view>
 </template>
 <script>