chenrui 4 năm trước cách đây
mục cha
commit
754598285c

+ 6 - 0
components/autograph-to-pic/autograph-to-pic.vue

@@ -31,6 +31,7 @@
 
 <script>
 import Handwriting from './js/signature.js'
+import { saveImgToAliOss } from '@/libs/tools.js'
 export default {
 	props: {
 		//  签字画布id
@@ -94,9 +95,14 @@ export default {
 		},
 		// 保存  生成图片
 		subCanvas(){
+			const _this = this
 			this.handwriting.saveCanvas().then(res=>{
 				this.showimg = res
 				console.log(res)
+				saveImgToAliOss(res, function(ret) {
+					console.log(ret,'-----阿里云')
+					_this.$emit('generatePictures', ret)
+				})
 			}).catch(err=>{
 				console.log(err)
 			})

+ 64 - 17
pages/shopTourOver/shopTourOver.vue

@@ -4,14 +4,14 @@
 		<view class="autograph-con">
 			<text class="autograph-tit">店长签名:</text>
 			<view class="autograph-main">
-				<autograph-to-pic ref="dz" canvasId="handWriting-dz"/>
+				<autograph-to-pic ref="dz" canvasId="handWriting-dz" @generatePictures="autographDz"/>
 			</view>
 		</view>
 		<!-- 巡店人签名 -->
 		<view class="autograph-con">
 			<text class="autograph-tit">巡店人签名:</text>
 			<view class="autograph-main">
-				<autograph-to-pic ref="xdr" canvasId="handWriting-xd" />
+				<autograph-to-pic ref="xdr" canvasId="handWriting-xd" @generatePictures="autographXdr" />
 			</view>
 		</view>
 		<u-button type="primary" shape="circle" class="submit-btn" @click="submitFun">提交</u-button>
@@ -29,20 +29,73 @@
 		data(){
 			return{
 				taskId: '',
-				inspectorSign:'', // 巡店人签名
 				storeManagerSign:'', // 店长签名
+				inspectorSign:'', // 巡店人签名
+				sign: 0  //  标记  是否两张签名都已生成
 			}
 		},
 		onLoad(opts) {
 			this.taskId = opts.taskId
 		},
 		methods: {
+			//  店长签名 生成图片
+			autographDz(res){
+				console.log(res,'店长签名+++')
+				if(res.status == 200){
+					this.storeManagerSign = res.data
+				}else{
+					this.storeManagerSign = ''
+					// uni.showToast({ icon: 'none', title: res.message })
+					// return
+				}
+				this.sign++
+				this.isSubmit()
+			},
+			//  巡店人签名 生成图片
+			autographXdr(res){
+				console.log(res,'巡店人签名+++')
+				if(res.status == 200){
+					this.inspectorSign = res.data
+				}else{
+					this.inspectorSign = ''
+					// uni.showToast({ icon: 'none', title: res.message })
+					// return
+				}
+				this.sign++
+				this.isSubmit()
+			},
+			//  是否提交
+			isSubmit(){
+				if(this.sign == 2){
+					if(this.storeManagerSign && this.inspectorSign){
+						console.log('正常提交')
+						clzConfirm({
+							title: '提示',
+							content: '确定提交本次巡店?',
+							success: function(res) {
+								if (res.confirm || res.index == 0) {
+									// 上传图片后提交代码
+									_this.submitTask()
+								}
+							}
+						})
+					}else{
+						if(!this.storeManagerSign){
+							uni.showToast({ icon: 'none', title: '店长签名生成失败,请重新提交' })
+							return
+						}
+						if(!this.inspectorSign){
+							uni.showToast({ icon: 'none', title: '巡店人签名生成失败,请重新提交' })
+							return
+						}
+					}
+				}
+				
+			},
 			// 提交本次任务
 			submitFun(){
-				const _this = this
-				console.log(_this.$refs.dz.isEmpty)
-				const dzIsEmpty = _this.$refs.dz.isEmpty
-				const xdrIsEmpty = _this.$refs.xdr.isEmpty
+				const dzIsEmpty = this.$refs.dz.isEmpty
+				const xdrIsEmpty = this.$refs.xdr.isEmpty
 				if(dzIsEmpty){
 					uni.showToast({
 						icon:'none',
@@ -57,18 +110,12 @@
 					})
 					return
 				}
-				clzConfirm({
-					title: '提示',
-					content: '确定提交本次巡店?',
-					success: function(res) {
-						if (res.confirm || res.index == 0) {
-							// 上传图片后提交代码
-							//_this.submitTask()
-						}
-					}
-				});
+				this.$refs.dz.subCanvas()
+				this.$refs.xdr.subCanvas()
 			},
+			//  提交
 			submitTask(){
+				const _this = this
 				submitTask({
 					id: _this.taskId,
 					inspectorSign: _this.inspectorSign,

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
unpackage/dist/dev/app-plus/app-config-service.js


+ 1 - 2
unpackage/dist/dev/app-plus/app-config.js

@@ -10,7 +10,7 @@
 /******/ 		var moduleId, chunkId, i = 0, resolves = [];
 /******/ 		for(;i < chunkIds.length; i++) {
 /******/ 			chunkId = chunkIds[i];
-/******/ 			if(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {
+/******/ 			if(installedChunks[chunkId]) {
 /******/ 				resolves.push(installedChunks[chunkId][0]);
 /******/ 			}
 /******/ 			installedChunks[chunkId] = 0;
@@ -46,7 +46,6 @@
 /******/ 				result = __webpack_require__(__webpack_require__.s = deferredModule[0]);
 /******/ 			}
 /******/ 		}
-/******/
 /******/ 		return result;
 /******/ 	}
 /******/

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 3 - 3
unpackage/dist/dev/app-plus/app-service.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 14 - 14
unpackage/dist/dev/app-plus/app-view.js


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
unpackage/dist/dev/app-plus/view.umd.min.js


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác