Jelajahi Sumber

feat: 下单页面弹窗提示

zhanghui 1 tahun lalu
induk
melakukan
c7840a120c
3 mengubah file dengan 82 tambahan dan 0 penghapusan
  1. 8 0
      common/js/api.js
  2. 38 0
      orderPages/bookService/index.vue
  3. 36 0
      orderPages/storeService/index.vue

+ 8 - 0
common/js/api.js

@@ -3,6 +3,14 @@ import request from '../js/request.js';
 
 export default {
 
+    //根据key获取系统配置
+    getConfigKey(data) {
+        return request({
+            url: '/system/config/configKey/'+ data.key,
+            method: 'GET',
+        })
+    },
+
     //拓客专员二维码被扫记录
     addRecordForAttach(data) {
         return request({

+ 38 - 0
orderPages/bookService/index.vue

@@ -164,6 +164,12 @@
 		</view>
 		<myPay ref="myPay" :selectBlPay="userInfo.balance *1 >= price *1" :balance="userInfo.balance" :totalAmount="price" :storeId="store.storeId"
 			   :orderNo="subOrderNo" @payResult="payResult" @improperClose="improperClose"></myPay>
+
+		<uni-popup ref="reservationQueuePopup">
+			<uni-popup-dialog :type="msgType" cancelText="不在提示" confirmText="已知晓" title="提示" :content="configContent" @confirm="dialogConfirm"
+							  @close="dialogClose"></uni-popup-dialog>
+		</uni-popup>
+
 	</view>
 </template>
 
@@ -175,6 +181,8 @@
 		},
 		data() {
 			return {
+				msgType:null,
+				configContent:'',
 				timeoutId:null,
 				templateId:[],
 				//服务对象列表
@@ -245,6 +253,13 @@
 			},1000*60*5)
 		},
 		onShow() {
+
+			//获取弹窗设置
+			let reservationQueueContent = uni.getStorageSync('reservation_queue_content');
+			if (!reservationQueueContent){
+				this.getConfigKey('reservation_queue_content')
+			}
+
 			this.userInfo = uni.getStorageSync('userInfo')
       // 查询门店信息
       const data = uni.getStorageSync('storeInfo');
@@ -266,6 +281,29 @@
 			clearTimeout(this.timeoutId);
 		},
 		methods: {
+
+
+			dialogConfirm(){
+				this.configContent = '';
+			},
+
+			dialogClose(){
+				uni.setStorageSync('reservation_queue_content',true);
+				this.configContent = '';
+			},
+
+			getConfigKey(key){
+
+				this.$api.getConfigKey({key:key}).then(res=>{
+					console.log('获取到的配置信息',res.data.msg)
+					if (res.data.msg){
+						//打开弹窗
+						this.configContent = res.data.msg
+						this.$refs.reservationQueuePopup.open()
+					}
+				})
+			},
+
 // 获取门店列表数据
       getStoreListData(data) {
         let that = this;

+ 36 - 0
orderPages/storeService/index.vue

@@ -99,6 +99,12 @@
 			<view class="submitButton " @click="openSetting">提交</view>
 		</view>
 
+		<uni-popup ref="sameDayQueuePopup">
+			<uni-popup-dialog :type="msgType" cancelText="不在提示" confirmText="已知晓" title="提示" :content="configContent" @confirm="dialogConfirm"
+							  @close="dialogClose"></uni-popup-dialog>
+
+		</uni-popup>
+
 	</view>
 </template>
 
@@ -108,6 +114,8 @@
 		},
 		data() {
 			return {
+				msgType:null,
+				configContent:'',
 				timeoutId:null,
 				templateId:[],
 				periodTimeList:[],
@@ -167,6 +175,12 @@
 		},
 		onShow() {
 
+			//获取弹窗设置
+			let sameDayQueueContent = uni.getStorageSync('same_day_queue_content');
+			if (!sameDayQueueContent){
+				this.getConfigKey('same_day_queue_content')
+			}
+
       // 查询门店信息
       const data = uni.getStorageSync('storeInfo');
       this.store = uni.getStorageSync('storeInfo')
@@ -185,6 +199,28 @@
 			clearTimeout(this.timeoutId);
 		},
 		methods: {
+
+			dialogConfirm(){
+				this.configContent = '';
+			},
+
+			dialogClose(){
+				uni.setStorageSync('same_day_queue_content',true);
+				this.configContent = '';
+			},
+
+			getConfigKey(key){
+
+				this.$api.getConfigKey({key:key}).then(res=>{
+					console.log('获取到的配置信息',res.data.msg)
+					if (res.data.msg){
+						//打开弹窗
+						this.configContent = res.data.msg
+						this.$refs.sameDayQueuePopup.open()
+					}
+				})
+			},
+
       // 获取门店列表数据
       getStoreListData(data) {
         let that = this;