Ver código fonte

app 弹框方式修改

shish 4 anos atrás
pai
commit
e9d1c7ff88
31 arquivos alterados com 326 adições e 536 exclusões
  1. 8 20
      ghsApp/src/admin/billing/affirm.vue
  2. 13 15
      ghsApp/src/admin/breakage/confirm.vue
  3. 0 2
      ghsApp/src/admin/breakage/index.vue
  4. 7 22
      ghsApp/src/admin/home/me.vue
  5. 8 24
      ghsApp/src/admin/home/workbench.vue
  6. 18 31
      ghsApp/src/admin/item/components/htz-image-upload/htz-image-upload.vue
  7. 6 16
      ghsApp/src/admin/item/list.vue
  8. 8 21
      ghsApp/src/admin/item/xjSelect.vue
  9. 3 9
      ghsApp/src/admin/itemClass/list.vue
  10. 14 0
      ghsApp/src/manifest.json
  11. 22 30
      ghsApp/src/mixins/BLE.js
  12. 17 45
      ghsApp/src/mixins/order.js
  13. 6 10
      ghsApp/src/mixins/product.js
  14. 6 10
      ghsApp/src/pagesArrears/details.vue
  15. 8 17
      ghsApp/src/pagesClient/member/detail.vue
  16. 6 11
      ghsApp/src/pagesGys/details.vue
  17. 5 9
      ghsApp/src/pagesOrder/components/stepShip.vue
  18. 32 66
      ghsApp/src/pagesOrder/detail.vue
  19. 9 15
      ghsApp/src/pagesOrder/refund.vue
  20. 11 15
      ghsApp/src/pagesOrder/ship.vue
  21. 4 10
      ghsApp/src/pagesPurchase/details.vue
  22. 4 10
      ghsApp/src/pagesPurchase/info.vue
  23. 4 10
      ghsApp/src/pagesStorehouse/allot/addExDetails.vue
  24. 4 10
      ghsApp/src/pagesStorehouse/allot/exDetails.vue
  25. 11 27
      ghsApp/src/pagesStorehouse/allot/putDetails.vue
  26. 7 23
      ghsApp/src/pagesStorehouse/flower/category.vue
  27. 7 24
      ghsApp/src/pagesStorehouse/flower/manage.vue
  28. 4 10
      ghsApp/src/pagesStorehouse/inventory/update.vue
  29. 4 14
      ghsApp/src/platforms/app-plus/speech/speech.vue
  30. 9 9
      ghsApp/src/utils/auth.js
  31. 61 1
      ghsApp/src/utils/util.js

+ 8 - 20
ghsApp/src/admin/billing/affirm.vue

@@ -267,7 +267,7 @@ export default {
 		// #ifdef APP-PLUS
 		moreToDo(item){
 			//查询是否已经连接蓝牙
-			let _this=this;
+			let that=this;
 			let doList = ['打印标签', '打印标签2个', '打印标签5个','打印标签10个','打印标签20个']
 			let doNum = [1,2,5,10,20]
 			uni.showActionSheet({
@@ -277,20 +277,14 @@ export default {
 
 					plug.state({},ret=>{
 						if(ret.code == 1){
-							uni.showModal({
-								title: '提示',
-								content: '您还没有连接蓝牙,请先链接',
-								success: function (res) {
-									if (res.confirm) {
-										_this.pageTo({url:'/admin/tools/blue'})
-									}
-								}
-							})
+              that.$util.confirmModal({content:'您还没有连接蓝牙,请先链接'},() => {
+                that.pageTo({url:'/admin/tools/blue'})
+              })
 						}else{
 							let currentNum = Number(doNum[index])
 							console.log(currentNum)
 							for (let i = 0; i < currentNum; i++) {
-								plug.printer({"TSC":_this.OrderLable(item.name,item.id)},ret=>{
+								plug.printer({"TSC":that.OrderLable(item.name,item.id)},ret=>{
 									//uni.showToast({ title: JSON.stringify(ret), duration: 5000 })
 								})
 							}
@@ -411,15 +405,9 @@ export default {
           this.$msg(hasError);
           return false;
         }
-        uni.showModal({
-          title: '提示',
-          content: '确认提交?',
-          success: function (res) {
-              if (res.confirm) {
-                  self.formSubmit();
-              }
-          }
-        })        
+        self.$util.confirmModal({content:'确认提交'},() => {
+          self.formSubmit()
+        })
     },
     async formSubmit () {
       let formData = this.form;

+ 13 - 15
ghsApp/src/admin/breakage/confirm.vue

@@ -215,21 +215,19 @@ export default {
           itemId: ele.itemId
         };
       });
-      uni.showModal({
-        title: "提示",
-        content: "确认报损?",
-        success: function (res) {
-          if (res.confirm) {
-            wastage({product:JSON.stringify(product),remark:that.form.remark}).then((res) => {
-              //删除记忆
-              that.removeMemoryDirect()
-              const {data: { id, orderSn },} = res;
-              let url = '/admin/breakage/result';
-              uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },});
-            });
-          }
-        },
-      });
+
+      that.$util.confirmModal({content:'确认报损?'},() => {
+
+          wastage({product:JSON.stringify(product),remark:that.form.remark}).then((res) => {
+            //删除记忆
+            that.removeMemoryDirect()
+            const {data: { id, orderSn },} = res;
+            let url = '/admin/breakage/result';
+            uni.redirectTo({url: url,success: (result) => { },fail: () => { },complete: () => { },});
+          });
+
+      })
+
     },
     gobackEvent () {
       uni.navigateBack({delta: 1,})

+ 0 - 2
ghsApp/src/admin/breakage/index.vue

@@ -70,8 +70,6 @@
 		<!-- 花材不足提示框 -->
 		<modal-module
 			:show="showSubmitModel"
-			@cancel="cancelEvent"
-			@click="submitEvent"
 			:title="confirmContent"
 			color="#333"
 			:size="32"

+ 7 - 22
ghsApp/src/admin/home/me.vue

@@ -167,18 +167,10 @@ export default {
     },
     loginOut(){
         let that = this
-        uni.showModal({
-          title: "提示",
-          content: "确认退出?",
-          confirmText: "确认",
-          success: function (res) {
-            if (res.confirm) {
+        that.$util.confirmModal({content:'确认退出?'},() => {
               uni.clearStorage()
               that.$store.commit("setLoginInfo", {})
               plus.runtime.restart()
-              //that.$util.pageTo({url: "/admin/home/workbench",type: 3})
-            }
-          }
         })
     },
     async selectSussess () {
@@ -198,21 +190,14 @@ export default {
       }
     },
     checkToApplyCash () {
-      let self = this;
+      let that = this;
       //没有设置提现账号则提示
-      if (self.shopInfo.cashAccount == "") {
-        uni.showModal({
-          title: "提示",
-          content: "您还没有设置提现账号",
-          confirmText: "去设置",
-          success: function (res) {
-            if (res.confirm) {
-              self.$util.pageTo({ url: "/pagesStore/me/cashSet" });
-            }
-          },
-        });
+      if (that.shopInfo.cashAccount == "") {
+        that.$util.confirmModal({content:'您还没有设置提现账号'},() => {
+          that.$util.pageTo({ url: "/pagesStore/me/cashSet" });
+        })
       } else {
-        self.applyCash();
+        that.applyCash();
       }
     },
     applyCash () {

+ 8 - 24
ghsApp/src/admin/home/workbench.vue

@@ -231,20 +231,12 @@ export default {
 		},
 		closeBook(){
 			let that = this
-			uni.showModal({
-				title: "确定关闭?",
-				content: "关闭后可以在底部菜单【我的】-【使用手册】重新打开",
-				success: function (res) {
-					if (res.confirm) {
-						closeBook().then((res) => {
-
-							//这个切换得更彻底
-							that.$store.commit("setLoginInfo", {})
-							that.$util.pageTo({url: "/admin/home/workbench",type: 3})
-
-						});
-					}
-				},
+			that.$util.confirmModal({title:"确定关闭?",content:'关闭后可以在底部菜单【我的】,找到【使用手册】重新打开'},() => {
+				closeBook().then((res) => {
+					//这个切换得更彻底
+					that.$store.commit("setLoginInfo", {})
+					that.$util.pageTo({url: "/admin/home/workbench",type: 3})
+				})
 			})
 		},
 		skKd(){
@@ -259,16 +251,8 @@ export default {
 			if(currentId > 0){
 				this.$util.pageTo({url: "/admin/billing/index",query: {customId: currentId}})
 			}else{
-				uni.showModal({
-					title: '提示',
-					content: '请设置您的零售店',
-					cancelText: "取消",
-					confirmText: "好的",
-					success: function (res) {
-						if (res.confirm) {
-							that.$util.pageTo({url: '/admin/shop/sk'})
-						}
-					}
+				that.$util.confirmModal({content:'请设置您的零售店',okText:'好的',cancelText:'取消'},() => {
+					that.$util.pageTo({url: '/admin/shop/sk'})	
 				})
 			}
 		},

+ 18 - 31
ghsApp/src/admin/item/components/htz-image-upload/htz-image-upload.vue

@@ -133,21 +133,13 @@
 			}
 		},
 		mounted: function() {
+			let that = this
 			this.$nextTick(function() {
 				this.uploadLists = this.value;
 				if (this.mediaTypeData.indexOf(this.mediaType) == -1) {
-					uni.showModal({
-						title: '提示',
-						content: 'mediaType参数不正确',
-						showCancel: false,
-						success: function(res) {
-							if (res.confirm) {
-								//console.log('用户点击确定');
-							} else if (res.cancel) {
-								//console.log('用户点击取消');
-							}
-						}
-					});
+					that.$util.confirmModal({content:'mediaType参数不正确'},() => {
+						//console.log('用户点击确定');
+					})
 				}
 			});
 		},
@@ -168,25 +160,20 @@
 				console.log('previewVideoClose', this.previewVideoSrc)
 			},
 			imgDel(index) {
-				uni.showModal({
-					title: '提示',
-					content: '您确定要删除么?',
-					success: (res) => {
-						if (res.confirm) {
-							// this.uploadLists.splice(index, 1)
-							// this.$emit("input", this.uploadLists);
-							// this.$emit("imgDelete", this.uploadLists);
-							let delUrl = this.uploadLists[index]
-							this.uploadLists.splice(index, 1)
-							this.$emit("input", this.uploadLists);
-							this.$emit("imgDelete", {
-								del: delUrl,
-								tempFilePaths: this.uploadLists,
-								index:index
-							});
-						} else if (res.cancel) {}
-					}
-				});
+				let that = this
+				that.$util.confirmModal({content:'确认删除?'},() => {
+					// that.uploadLists.splice(index, 1)
+					// that.$emit("input", that.uploadLists);
+					// that.$emit("imgDelete", that.uploadLists);
+					let delUrl = that.uploadLists[index]
+					that.uploadLists.splice(index, 1)
+					that.$emit("input", that.uploadLists);
+					that.$emit("imgDelete", {
+						del: delUrl,
+						tempFilePaths: that.uploadLists,
+						index:index
+					});					
+				})
 			},
 			imgPreview(index) {
 

+ 6 - 16
ghsApp/src/admin/item/list.vue

@@ -105,15 +105,11 @@ export default {
 
 					plug.state({},ret=>{
 						if(ret.code == 1){
-							uni.showModal({
-								title: '提示',
-								content: '您还没有连接蓝牙,请先链接',
-								success: function (res) {
-									if (res.confirm) {
-										that.pageTo({url:'/admin/tools/blue'})
-									}
-								}
+
+							that.$util.confirmModal({content:'您还没有连接蓝牙,请先链接'},() => {
+								that.pageTo({url:'/admin/tools/blue'})
 							})
+
 						}else{
 							let currentNum = Number(doNum[index])
 							console.log(currentNum)
@@ -189,14 +185,8 @@ export default {
 			let that = this
 			plug.state({},ret=>{
 				if(ret.code == 1){
-					uni.showModal({
-						title: '提示',
-						content: '您还没有连接蓝牙,请先链接',
-						success: function (res) {
-							if (res.confirm) {
-								that.pageTo({url:'/admin/tools/blue'})
-							}
-						}
+					that.$util.confirmModal({content:'您还没有连接蓝牙,请先链接'},() => {
+						that.pageTo({url:'/admin/tools/blue'})
 					})
 				}else{
 					if(!that.$util.isEmpty(this.globalClassItemList)){

+ 8 - 21
ghsApp/src/admin/item/xjSelect.vue

@@ -103,28 +103,15 @@ export default {
 	},
 	methods: {
 		clearXj(){
-			let self = this
-			uni.showModal({
-				title: '确认清除?',
-				content: "",
-				showCancel: true,
-				cancelText: "取消",
-				cancelColor: "#000000",
-				confirmText: "确定",
-				confirmColor: "#3CC51F",
-				success: async result => {
-					if (result.confirm) {
-						clearAll().then(res => {
-							self.$msg(res.msg)
-							if(res.code == 1){
-								self.initXj()
-							}
-						})
+			let that = this
+			that.$util.confirmModal({content:'确认清空全部小菊?'},() => {
+				clearAll().then(res => {
+					that.$msg(res.msg)
+					if(res.code == 1){
+						that.initXj()
 					}
-				},
-				fail: () => {},
-				complete: () => {}
-			});
+				})
+			})
 		},
 		previewImage(url){
 			uni.previewImage({

+ 3 - 9
ghsApp/src/admin/itemClass/list.vue

@@ -133,15 +133,9 @@ export default {
 			let that = this
 			plug.state({},ret=>{
 				if(ret.code == 1){
-					uni.showModal({
-						title: '提示',
-						content: '您还没有连接蓝牙,请先链接',
-						success: function (res) {
-							if (res.confirm) {
-								that.pageTo({url:'/admin/tools/blue'})
-							}
-						}
-					})
+					that.$util.confirmModal({content:'您还没有连接蓝牙,请先链接'},() => {
+                		that.pageTo({url:'/admin/tools/blue'})
+              		})
 				}else{
 					allProduct({classId:classId}).then(res=>{
 						if(res.code == 1){

+ 14 - 0
ghsApp/src/manifest.json

@@ -123,6 +123,20 @@
                     "pid" : "462",
                     "parameters" : {}
                 }
+            },
+            "CL-Dialog" : {
+                "__plugin_info__" : {
+                    "name" : "确认提示框",
+                    "description" : "为了统一两个平台的提示(对话框)框的效果,以及对文字颜色内容的可自定义",
+                    "platforms" : "Android,iOS",
+                    "url" : "https://ext.dcloud.net.cn/plugin?id=1497",
+                    "android_package_name" : "zhh.huahuibao.app",
+                    "ios_bundle_id" : "",
+                    "isCloud" : true,
+                    "bought" : 1,
+                    "pid" : "1497",
+                    "parameters" : {}
+                }
             }
         }
     },

+ 22 - 30
ghsApp/src/mixins/BLE.js

@@ -31,22 +31,18 @@ export default {
 		//断开蓝牙链接
 		destroyed(BleVal) {
 			this.BleVal = BleVal;
-			let self = this;
+			let that = this;
 			if(!uni.getStorageSync('BLE')){
-				uni.showModal({
-					title: '提示', content: '请先连接蓝牙',
-					confirmText: "去连接",
-					success: function (res) {
-						if (res.confirm) {
-							uni.navigateTo({url:'/pagesOrder/print'});
-						}
-					}
-				});
+
+				that.$util.confirmModal({content:'请先连接蓝牙'},() => {
+					uni.navigateTo({url:'/pagesOrder/print'});
+				})
+
 				return;
 			}
 			uni.closeBLEConnection({deviceId: uni.getStorageSync('BLE').deviceId,complete(res) {
 					console.log(res);
-					self.autoLinkBle(BleVal);
+					that.autoLinkBle(BleVal);
 				}
 			});
 			// if (this.connId != "") {
@@ -167,27 +163,23 @@ export default {
 		//自动链接蓝牙-初始化蓝牙模块
 		autoLinkBle(BleVal){
 			this.BleVal = BleVal;
-			let self = this;
+			let that = this;
 			if(!uni.getStorageSync('BLE')){
-				uni.showModal({
-					title: '提示', content: '请先连接蓝牙',
-					confirmText: "去连接",
-					success: function (res) {
-						if (res.confirm) {
-							uni.navigateTo({url:'/pagesOrder/print'});
-						}
-					}
-				});
+
+				that.$util.confirmModal({content:'请先连接蓝牙'},() => {
+					uni.navigateTo({url:'/pagesOrder/print'})
+				})
+
 				return;
 			}
 			uni.showLoading({title: '打印中...'});
-			self.isAutoBle = true;
+			that.isAutoBle = true;
 			let deviceId = uni.getStorageSync('BLE');
 			//初始化蓝牙模块
 			uni.openBluetoothAdapter({
 				success(res) {
 					console.log('初始化成功',res)
-					self.autoLinkBleFun(deviceId);
+					that.autoLinkBleFun(deviceId);
 				},fail(e){
 					console.log('初始化失败',e)
 				}
@@ -330,7 +322,7 @@ export default {
 
 		senBleLabel() {
 			let BleVal = this.BleVal;
-			let self = this;
+			let that = this;
 			console.log(BleVal,'BleValBleVal')
 			let currDev = uni.getStorageSync('BLE');
 			let deviceId = currDev.deviceId;
@@ -407,13 +399,13 @@ export default {
 			}
 
 			//增加打印次数
-			addPrintNum({id:self.orderId}).then(res=>{
-				if(!self.$util.isEmpty(self.detailInfo)){
-					self.detailInfo.printNum++;
+			addPrintNum({id:that.orderId}).then(res=>{
+				if(!that.$util.isEmpty(that.detailInfo)){
+					that.detailInfo.printNum++;
 				}
-				if(!self.$util.isEmpty(self.list.data)){
-					self.list.data.forEach(ele=>{
-						if (ele.id==self.orderId) {
+				if(!that.$util.isEmpty(that.list.data)){
+					that.list.data.forEach(ele=>{
+						if (ele.id==that.orderId) {
 							ele.printNum++;
 						}
 					})

+ 17 - 45
ghsApp/src/mixins/order.js

@@ -14,15 +14,9 @@ export default {
     methods: {
     toConfrim(params,title){
         let that = this
-            uni.showModal({
-                title: '订单完成',
-                content: title,
-                success: function (res) {
-                    if (res.confirm) {
-                        that.toConfirmRequest(params)
-                    }
-                }
-            });
+        that.$util.confirmModal({title: '订单完成',content:title},() => {
+          that.toConfirmRequest(params)
+        })
     },
     toConfirmRequest(params){
         let that = this
@@ -65,17 +59,10 @@ export default {
             this.orderId=item.id;
             if (s.type === "selfGet") {
               this.operateData = item;
-              let self = this;
-              uni.showModal({
-                title: "提示",
-                content: "确认客户已自取",
-                confirmText: "确认",
-                success: function (res) {
-                  if (res.confirm) {
-                    self.freeShipModalClick();
-                  }
-                },
-              });
+              let that = this;
+              that.$util.confirmModal({content:'确认客户已自取?'},() => {
+                that.freeShipModalClick();
+              })
               //发货
             } else if (s.type === "send") {
               this.pageTo({
@@ -90,16 +77,8 @@ export default {
                 uni.hideLoading()
                 if(res.code == 1){
                   if(res.data.hasNoPrint == 1){
-                    uni.showModal({
-                      title: "提示",
-                      content: "您还没有设置打印机",
-                      cancelText: "取消",
-                      confirmText: "去设置",
-                      success: function (res) {
-                        if (res.confirm) {
-                          that.$util.pageTo({url: "/admin/shop/print"})
-                        }
-                      },
+                    that.$util.confirmModal({content:'请先设置打印机'},() => {
+                      that.$util.pageTo({url: "/admin/shop/print"})
                     })
                     return false
                   }else{
@@ -142,21 +121,14 @@ export default {
                           }
                       });
             }else if(s.type == 'cancel'){
-                      let self = this;
-                      uni.showModal({
-                          title: '提示',
-                          content: '确认取消?',
-                          success: function (res) {
-                              if (res.confirm) {
-                                  cancel({id:item.id}).then((res) => {
-                                      uni.showToast({title:res.msg,icon:'none'})
-                                      this._list();
-                                  })
-      
-                              }
-                          }
-                      });
-                  }
+              let that = this;
+              that.$util.confirmModal({content:'确认取消?'},() => {
+                cancel({id:item.id}).then((res) => {
+                  uni.showToast({title:res.msg,icon:'none'})
+                  that._list();
+                })
+              })
+            }
         },
     }
 }

+ 6 - 10
ghsApp/src/mixins/product.js

@@ -146,16 +146,12 @@ export default {
 		//清除记忆花材
 		removeMemory(customId=0){
 			let that = this
-			uni.showModal({
-				title: '提示',
-				content: '确认清除花材?',
-				success: function (res) {
-					if (res.confirm) {
-						that.removeMemoryDirect(customId)
-						that.$msg('已清除')
-					}
-				}
-			})
+
+			that.$util.confirmModal({content:'确认清除花材?'},() => {
+				that.removeMemoryDirect(customId)
+				that.$msg('已清除')
+              })
+
 		},
 		//直接清除记忆花材不提示
 		removeMemoryDirect(customId=0){

+ 6 - 10
ghsApp/src/pagesArrears/details.vue

@@ -224,16 +224,12 @@ export default {
 					id:JSON.stringify(ids),
 				customId:this.customInfo.id,
 			}
-			let self = this;
-				uni.showModal({
-					title: '提示',
-					content: '确定已收款?',
-					success: function (res) {
-						if (res.confirm) {
-							self.paySuccess(parameter)
-						}
-					}
-				});
+			let that = this;
+
+			that.$util.confirmModal({content:'确定已收款?'},() => {
+				that.paySuccess(parameter)
+			})
+
 			} catch (error) {}
 		},
 		// 支付成功

+ 8 - 17
ghsApp/src/pagesClient/member/detail.vue

@@ -179,23 +179,14 @@ export default {
           let currentIndex = respond.tapIndex
           let levelName =   levelList[currentIndex] || '';
 
-            uni.showModal({
-							title: "提示",
-							content: "确认修改客户等级为"+levelName+"?",
-							confirmText: "确认",
-							success: function (res) {
-								if (res.confirm) {
-									changeLevel({customId:that.option.id,level:currentIndex}).then(res => {
-										if(res.code == 1) {
-                      that.getUserDetail()
-											that.$msg(res.msg)
-										}
-									}).catch(err => {
-										console.log('err', err)
-									})
-								}
-							},
-						});
+          that.$util.confirmModal({content:"确认修改客户等级为"+levelName+"?"},() => {
+            changeLevel({customId:that.option.id,level:currentIndex}).then(res => {
+              if(res.code == 1) {
+                that.getUserDetail()
+                that.$msg(res.msg)
+              }
+            })
+          })
 
         }
       })

+ 6 - 11
ghsApp/src/pagesGys/details.vue

@@ -205,19 +205,14 @@ export default {
 			}
 			let that = this;
 
-			uni.showModal({
-				title: '提示',
-				content: '确认提交?',
-				success: function (res) {
-					if (res.confirm) {
-						clearOrderApi(parameter).then(ret=>{
-							if(ret.code == 1){
-								that.pageTo({url:'/common/success', type: 2,query:{titleType:1}})
-							}
-						})
+			that.$util.confirmModal({content:'确认提交?'},() => {
+				clearOrderApi(parameter).then(ret=>{
+					if(ret.code == 1){
+						that.pageTo({url:'/common/success', type: 2,query:{titleType:1}})
 					}
-				}
+				})
 			})
+
 		}
 	}
 };

+ 5 - 9
ghsApp/src/pagesOrder/components/stepShip.vue

@@ -145,15 +145,11 @@ export default {
     // type 本店送-发快递
     // 确认送达
     sendConfirm (type) {
-      let self = this;
-      uni.showModal({
-        title: '提示', content: type == '本店送' ? '确认送到了?' : '快递送到后会自动确认,需要自己确定?',
-        success: function (res) {
-          if (res.confirm) {
-            self.$emit('sendConfirm', type)
-          }
-        }
-      });
+      let that = this;
+      let content = type == '本店送' ? '确认送到了?' : '快递送到后会自动确认,需要自己确定?'
+      that.$util.confirmModal({content:content},() => {
+        that.$emit('sendConfirm', type)
+      })
     },
     // 发快递
     sendParcel () {

+ 32 - 66
ghsApp/src/pagesOrder/detail.vue

@@ -257,22 +257,14 @@ export default {
 							payWay:payWay,
 							modifyPrice:actPrice
 						}
-						uni.showModal({
-							title: "提示",
-							content: "确认结清欠款?",
-							confirmText: "确认",
-							success: function (res) {
-								if (res.confirm) {
-									clearOrderApi(params).then(res => {
-										if(res.code == 1) {
-											that.pageTo({url:'/common/success', type: 2,query:{titleType:1}});
-										}
-									}).catch(err => {
-										console.log('err', err)
-									})
+
+						that.$util.confirmModal({content:'确认结清欠款?'},() => {
+							clearOrderApi(params).then(res => {
+								if(res.code == 1) {
+									that.pageTo({url:'/common/success', type: 2,query:{titleType:1}});
 								}
-							},
-						});
+							})
+						})
 
 					}else{
 						this.$msg("请选择收款方式");
@@ -326,13 +318,9 @@ export default {
 			if (s.type === "selfGet") {
 				// 自取
 				let self = this;
-				uni.showModal({title: "提示",content: "确认客户已自取",confirmText: "确认",
-					success: function (res) {
-						if (res.confirm) {
-							self.freeShipModalClick();
-						}
-					},
-				});
+				self.$util.confirmModal({content:'确认客户已自取'},() => {
+					self.freeShipModalClick()
+				})
 				this.freeShipModal = true;
 			} else if (s.type === "print") {
 				if(item.hasCloudPrint == 1){
@@ -360,32 +348,22 @@ export default {
 			}else if (s.type === "debtPay") {
 				let self = this;
 				//延期收款
-				uni.showModal({
-					content: '您确认要延期收款',
-					success: function (res) {
-						if (res.confirm) {
-							return debtPay({ id: self.option.id }).then(res => {
-								console.log(res)
-								uni.showToast({title:'操作成功!',icon:'none'})
-								self.init();
-							})
-						}
-					}
-				});
+				self.$util.confirmModal({content:'确认要延期收款?'},() => {
+					return debtPay({ id: self.option.id }).then(res => {
+						console.log(res)
+						uni.showToast({title:'操作成功!',icon:'none'})
+						self.init();
+					})
+				})
 			}else if (s.type === "hasPay") {
 				let self = this;
 				//已收款
-				uni.showModal({
-					content: '您确认已收款',
-					success: function (res) {
-						if (res.confirm) {
-							return hasPay({ id: self.option.id }).then(res => {
-								uni.showToast({title:'操作成功!',icon:'none'})
-								self.init();
-							})
-						}
-					}
-				});
+				self.$util.confirmModal({content:'您确认已收款?'},() => {
+					return hasPay({ id: self.option.id }).then(res => {
+						uni.showToast({title:'操作成功!',icon:'none'})
+						self.init();
+					})
+				})
 			}else if (s.type === "modifyProduct") {
 				//修改花材
 				let self = this;
@@ -435,31 +413,19 @@ export default {
 				});
 			}else if(s.type == 'cancel'){
 				let self = this;
-				uni.showModal({
-					title: '提示',
-					content: '确认取消订单?',
-					success: function (res) {
-						if (res.confirm) {
-							cancel({id:item.id}).then((res) => {
-								uni.showToast({title:res.msg,icon:'none'})
-								self.init();
-							})
-						}
-					}
-				});
+				self.$util.confirmModal({content:'确认取消订单?'},() => {
+					cancel({id:item.id}).then((res) => {
+						uni.showToast({title:res.msg,icon:'none'})
+						self.init();
+					})
+				})
 			}
 		},
 		toConfrim(params,title){
 			let that = this
-			uni.showModal({
-				title: '订单完成',
-				content: title,
-				success: function (res) {
-					if (res.confirm) {
-						that.toConfirmRequest(params)
-					}
-				}
-			});
+			that.$util.confirmModal({content:'订单完成'},() => {
+				that.toConfirmRequest(params)
+			})
 		},
 		toConfirmRequest(params){
 			let self = this;

+ 9 - 15
ghsApp/src/pagesOrder/refund.vue

@@ -196,6 +196,7 @@ export default {
 		refundFun(){
 			let product = [];
 			let hasError = false;
+			let that = this
 			this.product.forEach(ele=>{
 				if(ele.big>0||ele.small>0){
 					product.push({"productId":ele.productId,"bigNum":ele.big?ele.big:0,"smallNum":ele.small?ele.small:0});
@@ -222,23 +223,16 @@ export default {
 				return;
 			}
 			let parameter = {id:this.option.id,product:JSON.stringify(product),price:this.refundMoney,remark:this.remark,refundType:this.refundType,getOriginalItem:1};
-			uni.showModal({
-				title: "提示",
-				content: "确认退款?",
-				confirmText: "确认",
-				success: function (res) {
-					if (res.confirm) {
-						uni.showLoading({title: "提交中",mask:true})
-						refund(parameter).then(res => {
-							if(res.code == 1){
-								uni.hideLoading()
-								uni.navigateTo({url:'/common/success',query:{titleType:1}})
-							}
-						})
+
+			that.$util.confirmModal({content:'确认退款?'},() => {
+				uni.showLoading({title: "提交中",mask:true})
+				refund(parameter).then(res => {
+					if(res.code == 1){
+						uni.hideLoading()
+						uni.navigateTo({url:'/common/success',query:{titleType:1}})
 					}
-				},
+				})
 			})
-
 		},
 		inputFun(e){
 			this.product.forEach(ele=>{

+ 11 - 15
ghsApp/src/pagesOrder/ship.vue

@@ -193,21 +193,17 @@ export default {
 		}, // 自己送
 		selfSend(val){
 			let self = this;
-			uni.showModal({
-				title: '提示',
-				content: '确定自己送货?',
-				success: function (res) {
-					if (res.confirm) {
-						selfSend({
-							id:self.option.id
-						}).then(res=>{
-							self.modalCancel()
-							self.$msg('发货状态已更新')
-							self.init()
-						})
-					}
-				}
-			});
+
+			self.$util.confirmModal({content:'确定自己送货?'},() => {
+				selfSend({
+					id:self.option.id
+				}).then(res=>{
+					self.modalCancel()
+					self.$msg('发货状态已更新')
+					self.init()
+				})
+			})
+
 			// // return;
 			// this.currentTitType = val
 			// this.titText = val.text;

+ 4 - 10
ghsApp/src/pagesPurchase/details.vue

@@ -336,16 +336,10 @@ export default {
 			} catch (error) {}
 		},
 		formSubmitFun(){
-			let self = this;
-			uni.showModal({
-				title: '提示',
-				content: '确认提交订单?',
-				success: function (res) {
-					if (res.confirm) {
-						self.confirmFn();
-					}
-				}
-			});
+			let that = this;
+			that.$util.confirmModal({content:''},() => {
+				that.confirmFn();
+			})
 		},
 		// 表单验证
 		formSubmit(e) {

+ 4 - 10
ghsApp/src/pagesPurchase/info.vue

@@ -233,16 +233,10 @@ export default {
 	methods: {
 		//咨询是否结账
 		clearOrder(item){
-			let self = this
-			uni.showModal({
-				title: '提示',
-				content: '确定结账?',
-				success: function (res) {
-					if (res.confirm) {
-						self.doClearOrder(item)
-					}
-				}
-			});
+			let that = this
+			that.$util.confirmModal({content:'确定结账?'},() => {
+				that.doClearOrder(item)
+			})
 		},
 		//结账
 		doClearOrder(item) {

+ 4 - 10
ghsApp/src/pagesStorehouse/allot/addExDetails.vue

@@ -175,16 +175,10 @@ export default {
 				let checkRes = formUtil.validation(formData, rules);
 				// 验证通过!
 				if (!checkRes) {
-					let self = this;
-					uni.showModal({
-						title: '提示',
-						content: '确定出库?',
-						success: function (res) {
-							if (res.confirm) {
-								self.confirmStockOut(formData)
-							}
-						}
-					});
+					let that = this;
+					that.$util.confirmModal({content:'确定出库?'},() => {
+						that.confirmStockOut(formData)
+					})
 				} else {
 					this.$msg(checkRes);
 				}

+ 4 - 10
ghsApp/src/pagesStorehouse/allot/exDetails.vue

@@ -197,16 +197,10 @@ export default {
 			} catch (error) {}
 		},
 		confirmEventPop(){
-			let self = this;
-			uni.showModal({
-				title: '提示',
-				content: '确定出库?',
-				success: function (res) {
-					if (res.confirm) {
-						self.confirmEvent();
-					}
-				}
-			});
+			let that = this;
+			that.$util.confirmModal({content:'确定出库?'},() => {
+				that.confirmEvent()
+			})
 		},
 		async confirmEvent() {
 			try {

+ 11 - 27
ghsApp/src/pagesStorehouse/allot/putDetails.vue

@@ -178,16 +178,10 @@ export default {
 			return name;
 		},
 		confirmPutEvent(){
-			let self = this;
-			uni.showModal({
-				title: '提示',
-				content: '确定入库',
-				success: function (res) {
-					if (res.confirm) {
-						self.putEvent();
-					}
-				}
-			});
+			let that = this;
+			that.$util.confirmModal({content:'确认入库?'},() => {
+				that.putEvent();
+			})
 		},
 		async putEvent() {
 			try {
@@ -199,25 +193,15 @@ export default {
 			} catch (error) {}
 		},
 		cancelPutEvent(){
-			let self = this;
-			uni.showModal({
-				title: '提示',
-				content: '确定取消',
-				success: function (res) {
-					if (res.confirm) {
-						self.cancelEvent();
-					}
-				}
-			});
+			let that = this;
+			that.$util.confirmModal({content:'确定取消?'},() => {
+				that.cancelEvent();
+			})
 		},
 		async cancelEvent(){
-			try {
-				await cancelOrder(this.orderSn);
-				await this.initData();
-				wx.showToast({
-					title: "已取消"
-				});
-			} catch (error) {}
+			await cancelOrder(this.orderSn)
+			await this.initData()
+			wx.showToast({ title: "已取消" })
 		}
 	}
 };

+ 7 - 23
ghsApp/src/pagesStorehouse/flower/category.vue

@@ -186,29 +186,13 @@ export default {
 			} catch (error) {}
 		},
 		delEvent(item, index) {
-			uni.showModal({
-				title: `确认删除${item.name || ""}`,
-				content: "",
-				showCancel: true,
-				cancelText: "取消",
-				cancelColor: "#000000",
-				confirmText: "确定",
-				confirmColor: "#3CC51F",
-				success: async result => {
-					if (result.confirm) {
-						try {
-							await deleteFlowerApi(item.id);
-							uni.showToast({
-								title: "删除成功"
-							});
-							this.resetList();
-							this._list();
-						} catch (error) {}
-					}
-				},
-				fail: () => {},
-				complete: () => {}
-			});
+			let that = this
+			that.$util.confirmModal({content:`确认删除${item.name || ""}`},() => {
+				await deleteFlowerApi(item.id)
+				uni.showToast({ title: "删除成功" })
+				that.resetList()
+				that._list()
+			})
 		},
 		changeItem: lodash.debounce(function(e, item, key, index) {
 			console.log(33333, e);

+ 7 - 24
ghsApp/src/pagesStorehouse/flower/manage.vue

@@ -162,30 +162,13 @@ export default {
 			} catch (error) {}
 		},
 		async delEvent(item, index) {
-			uni.showModal({
-				title: `确认删除${item.name}`,
-				content: "",
-				showCancel: true,
-				cancelText: "取消",
-				cancelColor: "#000000",
-				confirmText: "确定",
-				confirmColor: "#3CC51F",
-				success: async result => {
-					if (result.confirm) {
-						try {
-							await deleteFlowerCategoryApi(item.id);
-							uni.showToast({
-								title: "删除成功"
-							});
-
-							this.resetList();
-							this._list();
-						} catch (error) {}
-					}
-				},
-				fail: () => {},
-				complete: () => {}
-			});
+			let that = this
+			that.$util.confirmModal({content:`确认删除${item.name}`},() => {
+				await deleteFlowerCategoryApi(item.id)
+				uni.showToast({ title: "删除成功" })
+				that.resetList()
+				that._list()
+			})
 		},
 		editEvent(item) {
 			uni.navigateTo({

+ 4 - 10
ghsApp/src/pagesStorehouse/inventory/update.vue

@@ -233,16 +233,10 @@ export default {
 			} catch (error) {}
 		},
 		confirmPop(type) {
-			let self = this;
-			uni.showModal({
-				title: '提示',
-				content: '确认盘点?',
-				success: function (res) {
-					if (res.confirm) {
-						self.saveCheckOrder(type);
-					}
-				}
-			});
+			let that = this;
+			that.$util.confirmModal({content:'确认盘点?'},() => {
+				that.saveCheckOrder(type);
+			})
 		},
 		async saveCheckOrder(type) {
 			try {

+ 4 - 14
ghsApp/src/platforms/app-plus/speech/speech.vue

@@ -69,28 +69,18 @@
             // #ifdef APP-PLUS
             ,
             async checkPermission() {
+                let that = this
                 let status = permision.isIOS ? await permision.requestIOS('record') :
                     await permision.requestAndroid('android.permission.RECORD_AUDIO');
 
                 if (status === null || status === 1) {
                     status = 1;
                 } else if (status === 2) {
-                    uni.showModal({
-                        content: "系统麦克风已关闭",
-                        confirmText: "确定",
-                        showCancel: false,
-                        success: function(res) {
-                        }
+                    that.$util.confirmModal({content:'系统麦克风已关闭'},() => {
                     })
                 } else {
-                    uni.showModal({
-                        content: "需要麦克风权限",
-                        confirmText: "设置",
-                        success: function(res) {
-                            if (res.confirm) {
-                                permision.gotoAppSetting();
-                            }
-                        }
+                    that.$util.confirmModal({content:'需要麦克风权限',okText:'设置'},() => {
+                        permision.gotoAppSetting();
                     })
                 }
                 return status;

+ 9 - 9
ghsApp/src/utils/auth.js

@@ -105,7 +105,7 @@ export async function uniLoginFn(update,type) {
 						//启动更新逻辑 shish 2020.5.18
 						if (subRes.data.update == 1) {
 
-							
+							// #ifdef MP-WEIXIN
 							const updateManager = uni.getUpdateManager();
 							updateManager.onCheckForUpdate(function(res) {
 								// 请求完新版本信息的回调
@@ -119,13 +119,13 @@ export async function uniLoginFn(update,type) {
 											success(res2) {
 												if (res2.confirm) {
 													// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-													updateManager.applyUpdate();
+													updateManager.applyUpdate()
 												}
 											}
-										});
-									});
+										})
+									})
 								}
-							});
+							})
 				
 							updateManager.onUpdateFailed(function(res) {
 								// 新的版本下载失败
@@ -135,12 +135,12 @@ export async function uniLoginFn(update,type) {
 									success(res) {
 										if (res.confirm) {
 											// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-											updateManager.applyUpdate();
+											updateManager.applyUpdate()
 										}
 									}
-								});
-							});
-
+								})
+							})
+							// #endif
 
 						}
 

+ 61 - 1
ghsApp/src/utils/util.js

@@ -347,6 +347,65 @@ export const unique = (arr) => {
 	}
 	return arr;
 };
+//#ifdef APP-PLUS
+const CLDialog=uni.requireNativePlugin("CL-Dialog")
+//#endif
+export const confirmModal = (item,okCallback=null,cancelCallback=null) => {
+
+	let title = item.title || '提示'
+	let content = item.content || '确认操作?'
+	let okText = item.okText || '确认'
+	let cancelText = item.cancelText || '取消'
+	let cacelTextColor = '#999999'
+	let okTextColor = '#38ADFF'
+
+	//#ifdef APP-PLUS
+	let options={
+		title:title,//标题 (可选)
+		con:content,//内容(可选)但是标题和内容至少选择一个
+		okTitle:okText,//确认按钮文字(可选)
+		cancleTitle:cancelText,//取消按钮文字(可选)
+		okTextColor:"#38ADFF",//确认按钮颜色(可选)
+		cancleTextColor:"#999999",//取消按钮颜色(可选)
+		singer:false,//是否只显示确认按钮,默认false(可选)
+		textAlign:"center",//对齐方式 //left居左,center居中,right 居右 默认居中
+		conColor:"",
+		bgColor:"#FFFFFF",//自定义弹框颜色
+		titleColor:"#3d3d3d"//自定义title颜色
+	}
+	CLDialog.show(options,()=>{
+		if(okCallback!=null){
+			okCallback()
+		}
+	},()=>{
+		if(cancelCallback!=null){
+			cancelCallback()
+		}
+	})
+	//#endif
+	// #ifdef MP-WEIXIN
+	uni.showModal({
+		title: title,
+		content: content,
+		showCancel: true,
+		cancelText: cancelText,
+		cancelColor: cacelTextColor,
+		confirmText: okText,
+		confirmColor: okTextColor,
+		success: function (res) {
+			if (res.confirm) {
+				if(okCallback!=null){
+					okCallback()
+				}
+			} else if (res.cancel) {
+				if(cancelCallback!=null){
+					cancelCallback()
+				}
+			}
+		}
+	})
+	//#endif
+}
 export default {
 	isEmpty,
 	copyObject,
@@ -367,5 +426,6 @@ export default {
 	isNumber,
 	noStockRemind,
 	callUp,
-	hitRemind
+	hitRemind,
+	confirmModal
 };