李天标 3 vuotta sitten
vanhempi
commit
bcd6b6369b

+ 10 - 5
.hbuilderx/launch.json

@@ -2,10 +2,15 @@
   // launchtype项可配置值为local或remote, local代表前端连本地云函数,remote代表前端连云端云函数
     "version": "0.0",
     "configurations": [{
-            "type": "uniCloud",
-            "default": {
-                "launchtype": "remote"
-            }
-        }
+     	"default" : 
+     	{
+     		"launchtype" : "remote"
+     	},
+     	"mp-weixin" : 
+     	{
+     		"launchtype" : "remote"
+     	},
+     	"type" : "uniCloud"
+     }
     ]
 }

+ 10 - 2
packageA/pages/remote/alarmClockItem.vue

@@ -57,10 +57,10 @@
 			<button v-if="clock=='add'" type="primary" formType="submit" @click="add()" class="button">
 				<p class="p1">添加</p>
 			</button>
-			<button v-if="clock!='add'" type="primary" formType="submit" @click="update()" class="button">
+			<button v-if="clock!='add'" v-show="ushow" type="primary" formType="submit" @click="update()" class="button">
 				<p class="p1">修改</p>
 			</button>
-			<button v-if="clock!='add'" type="warn" formType="submit" @click="delet()" class="button">
+			<button v-if="clock!='add'" v-show="ushow" type="warn" formType="submit" @click="delet()" class="button">
 				<p class="p1">删除</p>
 			</button>
 		</view>
@@ -110,6 +110,7 @@
 				equipmentIds: [],
 				clock: null,
 				status: true,
+				ushow:false
 			}
 		},
 		onShow() {
@@ -134,6 +135,13 @@
 					that.selectOne();
 				}
 			}, 2000)
+			// 回显
+			setTimeout(function() {
+				if (that.clock != "add") {
+					that.ushow = true;
+				}
+			}, 4000)
+			
 		},
 		methods: {
 			...mapActions('chart', ['getEquipmentListByUser', 'addAlarmClock', 'addAlarmClockItem', 'updateAlarmClock']),

+ 29 - 3
packageA/pages/user/editor/editor.vue

@@ -4,7 +4,7 @@
 			<form @submit="formSubmit" @reset="formReset">
 				<view class="select-input">
 					<input class="input" style="display:none;" />
-					<text>标题:</text><input class="input" name="title" placeholder="请输入标题" />
+					<text>标题:</text><input class="input" name="title" v-model="title" placeholder="请输入标题" />
 				</view>
 				<view class="head-wrapper">
 					<view class='wrapper'>
@@ -98,15 +98,41 @@
 		data() {
 			return {
 				readOnly: false,
+				title:'',
 				formats: {}
 			}
 		},
 		methods: {
 			formSubmit: function(e) {
-				console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value))
+				console.log('form发生了submit事件,携带数据为:' + JSON.stringify(e.detail.value.title))
+				var title = this.title;
 				this.editorCtx.getContents({
-					success: function(res) {
+					success: (res) => {
 						console.log(res.html)
+						var note = res.html;
+						var that = this;
+						// var id = uni.getStorageSync("globalUser").id;
+						var token = uni.getStorageSync("token");
+						uni.request({
+							url: this.serverurl + '/TNotice/addNotice',
+							data: {
+								"title": title,
+								"note":note
+							},
+							header: {
+								'token': token
+							},
+							method: "POST",
+							success: (res) => {
+								uni.showModal({
+									title: "提示",
+									content: res.data.message,
+									success: (res) => {
+								
+									}
+								})
+							},
+						});
 					},
 					fail: function(error) {
 						console.log(error)

+ 15 - 2
packageA/pages/user/orderEit.vue

@@ -52,12 +52,22 @@
 				payDate:null,
 				refundDate:null,
 				status:null,
-				altMainBalance:0
+				altMainBalance:0,
+				production:0
 			}
 		},
 		onLoad: function(option) {
 			const order = JSON.parse(decodeURIComponent(option.order));
 			this.order = order;
+			if(order.type==1){
+				this.production = order.agencyProportion;
+			}
+			if(order.type==2){
+				this.production = order.merchantProportion;
+			}
+			if(order.type==3){
+				this.production = order.personageProportion;
+			}
 			this.sn = order.sn;
 			this.clientId = order.clientId;
 			this.productName = order.productName;
@@ -73,8 +83,11 @@
 		methods: {
 			orderSubmit(e) {
 				var price = this.price;
+				var production = this.production;
 				var altMainBalance = this.altMainBalance;
-				if(altMainBalance<price){
+				var refusePrice = price*production/100;
+				// console.log("refusePrice="+refusePrice)
+				if(altMainBalance<refusePrice){
 					uni.showToast({
 					    title: '余额不足',
 					    duration: 2000

+ 95 - 75
pages/Charts/mainStatistics.vue

@@ -133,7 +133,7 @@
 					<image @click="next('day')" class="nextImg" src="/static/img/rightTriangle.png"></image>
 				</view>
 			</view>
-			<view class="qiun-charts" style="background-color: #FFFFFF;">
+			<view v-show="noticeTRUE" class="qiun-charts" style="background-color: #FFFFFF;">
 				<canvas canvas-id="canvaColumn1" id="canvaColumn1" class="charts" disable-scroll=true
 					@touchstart="touchLine1" @touchmove="moveLine1" @touchend="touchEndLine1"
 					style="background-color: #FFFFFF;"></canvas>
@@ -151,7 +151,7 @@
 					<image @click="next('week')" class="nextImg" src="/static/img/rightTriangle.png"></image>
 				</view>
 			</view>
-			<view class="qiun-charts" style="background-color: #FFFFFF;">
+			<view v-show="noticeTRUE" class="qiun-charts" style="background-color: #FFFFFF;">
 				<canvas canvas-id="canvaColumn2" id="canvaColumn2" class="charts" disable-scroll=true
 					@touchstart="touchLine2" @touchmove="moveLine2" @touchend="touchEndLine2"
 					style="background-color: #FFFFFF;"></canvas>
@@ -169,7 +169,7 @@
 					<image @click="next('month')" class="nextImg" src="/static/img/rightTriangle.png"></image>
 				</view>
 			</view>
-			<view class="qiun-charts" style="background-color: #FFFFFF;">
+			<view v-show="noticeTRUE" class="qiun-charts" style="background-color: #FFFFFF;">
 				<canvas canvas-id="canvaColumn3" id="canvaColumn3" class="charts" disable-scroll=true
 					@touchstart="touchLine3" @touchmove="moveLine3" @touchend="touchEndLine3"
 					style="background-color: #FFFFFF;"></canvas>
@@ -187,41 +187,20 @@
 					<image @click="next('year')" class="nextImg" src="/static/img/rightTriangle.png"></image>
 				</view>
 			</view>
-			<view class="qiun-charts" style="background-color: #FFFFFF;">
+			<view v-show="noticeTRUE" class="qiun-charts" style="background-color: #FFFFFF;">
 				<canvas canvas-id="canvaColumn4" id="canvaColumn4" class="charts" disable-scroll=true
 					@touchstart="touchLine4" @touchmove="moveLine4" @touchend="touchEndLine4"
 					style="background-color: #FFFFFF;"></canvas>
 			</view>
 		</view>
-		<view>
+		<view v-show="noticeShow">
 			<uni-popup id="popupDialog" ref="popupDialog" type="dialog">
 				<uni-popup-dialog :type="msgType" title="通知" content="欢迎使用 unisdfdd-popup!"
-								  :before-close="true" @confirm="dialogConfirm" @close="dialogClose">
+								  :before-close="true" @confirm="dialogConfirm(noticeId)" @close="dialogClose">
 					<scroll-view  scroll-y="true" class="scroll-Y" :style="{height:scrollHeight*0.8+'px'}">
 						<view class="scroll-view-item ">
-							投诉处理通知书 <br/>
-							背景:消费者投诉是指消费者在买糖之后,在微信或者支付宝平台对该笔订单发起投诉。该功能是微信及支付宝所拥有的功能。
-							消费者投诉后,支付宝或者微信会通知到我们公司,我们公司再通知到商家。商家接到消费者投诉后需要进行处理。
-							如果商家在收到短信24小时后还不处理,我们将会进行退款处理。<br/>
-							处理需知:我们申泽会以短信的信息通知到商家,通知的内容里我们会加上消费者的联系方式,以供商家去核实情况,如果没有消费者的联系方式,可以在微信群联系我们,然后把商家的联系方式发送到我们这边,我们公司会把商家的联系方式发送到消费者的微信上,让消费者自己去联系商家。
-							以下是处理方式:<br/>
-							1,退款<br/>
-							退款一般是在消费者离开机器现场后,在微信或者支付平台上投诉的情况。<br/>
-							1.1在小程序“申泽智能物联”上退款<br/>
-							我们推荐使用这种方式,因为在我们申泽的平台上退款后,我们会有已退款的记录凭证,以免后续不必要的纠纷。
-							如果商家在我们公司的账户里没钱,可推荐红包或转账的方式<br/>
-							1.2用红包或转账的方式<br/>
-							商家可用红包或转账的方式给消费者退款,但是需要收集3个资料:消费者的支付凭证,截图红包或者转账的界面(红包最好写上备注),
-							聊天界面-消费者同意用红包或转账的方式退款。商家收集这3个资料给到我们公司,由我们公司反馈上去。<br/>
-							2,不退款<br/>
-							不退款一般发生在消费者还在机器的情况下,商家和消费者取得了联系,用其他方式补偿。<br/>
-							2.1重新做糖<br/>
-							商家可以用重新做糖给消费者的形式补偿,但是商家也需要收集证据。
-								需要收集:1消费者的支付凭证;2聊天界面-消费者同意截图;商家需要把这些收集好。
-								如果消费者投诉了这个有重新做糖的订单,可以把这些信息发送到我们申泽这边,这样就可以不用退款。<br/>
-							2.2消费者提供不了证据<br/>
-							这个情况是在商家与消费者取得联系后,消费者无法提供证据说明商品有问题。
-							商家可以把聊天记录--确认消费者提供不了证据的界面的截图提供到我们这边。由我们把情况反馈上去。<br/>
+							{{noticeTitle}}<br/>
+							<p v-html="noticeNote">{{noticeNote}}</p>
 						</view>
 					
 					</scroll-view>
@@ -284,16 +263,21 @@
 				id: 0,
 				length:0,
 				type:null,
+				noticeShow:false,
+				noticeTRUE:true,
+				noticeTitle:'',
+				noticeNote:'',
+				noticeId:'',
 				msgType: 'success',
 				scrollHeight:uni.getSystemInfoSync().windowHeight - 130,
 			}
 		},
 		onReady() {
 			// 页面打开自动打开对话框
-			setTimeout(() => {
-				// this.msgType = 'success'
-				this.$refs.popupDialog.open()
-			}, 500)
+			// setTimeout(() => {
+			// 	// this.msgType = 'success'
+			// 	this.$refs.popupDialog.open()
+			// }, 500)
 		},
 		computed: {
 			...mapState(['loginUser']),
@@ -313,6 +297,14 @@
 			});
 			this.id = 0;
 			this.index = 0;
+			var test = uni.getStorageSync('test');
+			var globalUser = uni.getStorageSync("globalUser");
+			//test 判断是不是初次登陆
+			if(globalUser.id!=1&&test==1){
+				setTimeout(()=>{
+					this.getNOtice();
+				}, 5000);
+			}
 			var token = uni.getStorageSync("token");
 			if (token.toString().length > 1) {
 				this.init();
@@ -321,24 +313,14 @@
 					url: '../Login/Login',
 				});
 			}
-			// console.log("onShow");
-			var test = uni.getStorageSync('test');
-			var globalUser = uni.getStorageSync("globalUser");
 			if (globalUser.toString().length > 1) {
-				//判断是不是初次登陆
-				// if (test == 2) {
-				// 	this.init();
-				// }
 				if (globalUser.type > 0&&globalUser.type<4) {
 					this.getAdmin();
 				}
 				this.id = globalUser.id;
 				this.type = globalUser.type;
 			}
-			// var id = this.adminId;
-
 			this.day();
-			// this.equipmentStatus();
 		},
 		mounted() {
 			var token = uni.getStorageSync("token");
@@ -372,11 +354,40 @@
 				await this.initDateRang(new Date(), 'week');
 				await this.initDateRang(new Date(), 'month');
 				await this.initDateRang(new Date(), 'year');
-
+				var test = uni.getStorageSync('test');
+				var globalUser = uni.getStorageSync("globalUser");
 				//初次登陆跳转后,把test变成2
 				uni.setStorageSync('test', '2');
 
 			},
+			getNOtice(){
+				// console.log("notice")
+				var globalUser = uni.getStorageSync("globalUser");
+				var token = uni.getStorageSync("token");
+				uni.request({
+					url: this.serverurl + '/TNotice/getNotice?id='+globalUser.id,
+					// data: {
+					// 	"id": globalUser.id
+					// },
+					header: {
+						'token': token
+					},
+					method: "POST",
+					success: (res) => {
+						if(res.data.code){
+							if(res.data.message=='1'){
+								var notice = res.data.data;
+								this.noticeTitle =notice.title,
+								this.noticeNote = notice.note,
+								this.noticeId = notice.id,
+								this.noticeTRUE = false,
+								this.noticeShow = true,
+								this.$refs.popupDialog.open()
+							}
+						}
+					},
+				});
+			},
 			day() {
 				var date = new Date();
 				// var daystr = dateUtils.formateDate(date, 'yyyy年MM月dd日');
@@ -402,22 +413,33 @@
 					success: (res) => {
 						if (res.data.code) {
 							var admins = res.data.data;
-							this.admins = admins;
+							// this.admins = admins;
+							var adminss = []; 
 							var adminList = [];
 							adminList.push('本商户');
 							if (admins.length > 0) {
 								this.length = admins.length;
 								adminList.push('所有下级');
-								for (var i = 1; i < admins.length; i++) {
+								for (var i = 0; i < admins.length; i++) {
 									// console.log(admins[i].name)
+									if(i==0){
+										var globalUser = uni.getStorageSync("globalUser");
+										var id = admins[i].id;
+										if(id==globalUser.id){
+											continue;
+										}
+									}
 									if (admins[i].name != null || admins[i].name != '') {
+										adminss.push(admins[i]);
 										adminList.push(admins[i].name);
 									} else {
 										adminList.push(admins[i].username);
+										adminss.push(admins[i]);
 									}
 								}
 							}
 							this.adminList = adminList;
+							this.admins = adminss;
 						} else {
 							uni.showToast({
 								title: `获取信息失败:` + res.data.message,
@@ -426,40 +448,14 @@
 						}
 					},
 				});
-				// this.selectLowAdmin(param)
-				// 	.then(res => {
-				// 		if (res.code) {
-				// 			var admins = res.data;
-				// 			this.admins = admins;
-				// 			var adminList = [];
-				// 			adminList.push('本商户');
-				// 			if (admins.length > 0) {
-				// 				this.length = admins.length;
-				// 				adminList.push('所有下级');
-				// 				for (var i = 1; i < admins.length; i++) {
-				// 					// console.log(admins[i].name)
-				// 					if (admins[i].name != null || admins[i].name != '') {
-				// 						adminList.push(admins[i].name);
-				// 					} else {
-				// 						adminList.push(admins[i].username);
-				// 					}
-				// 				}
-				// 			}
-				// 			this.adminList = adminList;
-				// 		} else {
-				// 			uni.showToast({
-				// 				title: `获取信息失败:` + res.message,
-				// 				icon: 'none'
-				// 			})
-				// 		}
-				// 	});
+				
 			},
 			// 改变商家
 			changeAdmin: function(e){
 				this.index = e.target.value;
 				var id = '';
 				if(e.target.value>1){
-					id = this.admins[e.target.value-1].id;
+					id = this.admins[e.target.value-2].id;
 				}
 				if(e.target.value==1){
 					id = 'all';
@@ -951,11 +947,35 @@
 				}
 			},
 			// 点击确定
-			dialogConfirm(done){
+			dialogConfirm(id){
+				this.noticeTRUE = true;
+				var adminId = uni.getStorageSync("globalUser").id;
+				var token = uni.getStorageSync("token");
+				uni.request({
+					url: this.serverurl + '/TNotice/updateNotice?adminId='+adminId+'&noticeId='+id,
+					// data: {
+					// 	"adminId": adminId,
+					// 	"noticeId":id
+					// },
+					header: {
+						'token': token
+					},
+					method: "POST",
+					success: (res) => {
+						uni.showModal({
+							title: "提示",
+							content: res.data.message,
+							success: (res) => {
+						
+							}
+						})
+					},
+				});
 				this.$refs.popupDialog.close()
 			},
 			//点击取消
 			dialogClose(done){
+				this.noticeTRUE = true,
 				// this.msgType = 'success'
 				// 需要执行 done 才能关闭对话框
 				this.$refs.popupDialog.close()

+ 4 - 1
pages/User/user.vue

@@ -42,7 +42,7 @@
 				<view>
 					<uni-list-item title="退款" @click="refuse()" />
 				</view>
-				<view>
+				<view v-if="noticeShow">
 					<uni-list-item title="编辑公告" @click="notice()" />
 				</view>
 			</uni-list>
@@ -74,6 +74,7 @@
 			return {
 				name: '',
 				show: false,
+				noticeShow:false,
 				showRemote: true,
 				ifForeign: false,
 				listName: [],
@@ -112,6 +113,8 @@
 			if (gid != 1) {
 				this.gid = true;
 				this.show = true;
+			}else{
+				this.noticeShow = true;
 			}
 			// if (gid == 236||name == "邱咪") {
 			// 	this.showRemote = false;

+ 2 - 2
uni_modules/uni-popup/components/uni-popup-dialog/uni-popup-dialog.vue

@@ -15,10 +15,10 @@
 		</view>
 		<view class="uni-dialog-button-group">
 			<view class="uni-dialog-button" @click="closeDialog">
-				<text class="uni-dialog-button-text">取消</text>
+				<text class="uni-dialog-button-text">下次再看</text>
 			</view>
 			<view class="uni-dialog-button uni-border-left" @click="onOk">
-				<text class="uni-dialog-button-text uni-button-color">确定</text>
+				<text class="uni-dialog-button-text uni-button-color">我知道了</text>
 			</view>
 		</view>