hmp пре 4 година
родитељ
комит
9830ef1363

+ 2 - 2
App.vue

@@ -5,9 +5,9 @@
 			//更新版本
 			this.updateApp()
 			//获取token
-			this.getToken()
+			// this.getToken()
 			//获取小程序上下线
-			this.getAudit()
+			// this.getAudit()
 		},
 		methods:{
 			getAudit(){

+ 18 - 2
assets/http/api.js

@@ -210,6 +210,8 @@ const account = {
 	remainList: p => http.get('cyzh-ldt/loginuser/remaining/list', {
 		params: p
 	}),
+	
+	
 }
 
 //webSocket
@@ -281,7 +283,19 @@ const shopConfig={
 	list: p => http.get("ldt_goods/shopconfig/list", {
 		params: p
 	}),
-} 
+}
+
+const notice={
+	notReadIdList:p => http.get('app/notice/notReadIdList', {params: p}),
+	list:p => http.get('app/notice/list', {params: p}),
+	detail:p => http.get('ldt_notice/notice/detail', {params: p}),
+	isRead: p => http.post('app/notice/isRead', p),
+}
+
+const test={
+	submit: p => http.post('/common/account/decrypt/test', p),
+	remove: p => http.post('ldt_bills/bills/remove?ids=' + p),
+}
 
 export const api = {
 	wxApp,
@@ -312,5 +326,7 @@ export const api = {
 	userChannelPoint,
 	order,
 	area,
-	shopConfig
+	shopConfig,
+	notice,
+	test
 }

+ 8 - 4
assets/http/global.js

@@ -1,12 +1,14 @@
 let global = {}
 
 
-global.baseUrl = 'https://ldt.guosen-fumao.cn/api/'
-global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
+// global.baseUrl = 'https://ldt.guosen-fumao.cn/api/'
+// global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
+// global.enabledCrypto = false
 
 
-// global.baseUrl = 'http://192.168.1.168:2366/'
-// global.WebSocketUrl = 'ws://192.168.1.168:2366/websocket/'
+global.baseUrl = 'http://192.168.1.168:2366/'
+global.WebSocketUrl = 'ws://192.168.1.168:2366/websocket/'
+global.enabledCrypto = true
 
 global.tokenUrl = global.baseUrl +
 	'blade-auth/oauth/token?tenantId=000000&password=21232f297a57a5a743894a0e4a801fc3&username=admin'
@@ -56,6 +58,8 @@ global.takeType = {
 }
 global.takeTypeList = ['店内堂食', '到店自取', '商家配送']
 
+global.mustOrder = '必选'
+
 global.payStatus = {
 	IS_WAIT: '待付款',
 	IS_PAY: '付款成功',

+ 8 - 2
assets/http/service.js

@@ -1,5 +1,8 @@
 import Request from 'luch-request'
 import Global from "./global.js"
+import crypto from '@/utils/crypto.js'
+import md5Libs from "uview-ui/libs/function/md5";
+import verify from "@/utils/verify.js";
 
 let baseURL = Global.baseUrl
 
@@ -28,6 +31,11 @@ http.interceptors.request.use((config) => {
 		...config.header,
 		"Blade-Auth": getTokenStorage()
 	}
+	if (Global.enabledCrypto && config.method == 'POST' && config.data) {
+		//报文加密
+		let encrypt= crypto.encrypt(JSON.stringify(config.data))
+		config.data=encrypt
+	}
 	return config
 }, (config) => {
 	return Promise.reject(config)
@@ -39,14 +47,12 @@ let requests = []
 http.interceptors.response.use(async (response) => {
 	/* 请求之后拦截器。可以使用async await 做异步操作  */
 	//toekn过期处理 
-		console.log(response);
 	//200 返回数据成功 0
 	if (response.data.code != 200 && response.data.code !=400) {
 		return Promise.reject(response)
 	}
 	return response.data
 }, async (err) => { // 请求错误做点什么
-		console.log(err,"////");
 	if (err.data.code == 401) {
 		let {
 			config

+ 4 - 3
components/pay-confirm.vue

@@ -7,14 +7,14 @@
 				style="color: #1C1C1C;font-size: 30rpx;"></text>
 		</view>
 
-		<view class="card" style="padding: 15rpx;">
+		<view class="card" >
 			<view class="flex flex-direction margin-bottom-40">
 				<text class="text-lg text-bold" v-text="paySuccess?'支付成功':'支付确认'"></text>
 				<text v-if="paySuccess" class=" text-sm margin-top-10"
 					style="color: #999999;">您本次交易使用积分抵扣情况,具体如下:</text>
 				<text v-else class=" text-sm margin-top-10" style="color: #999999;">您本次交易可使用积分抵扣,具体如下:</text>
 			</view>
-			<view class="item">
+			<view class="item ">
 				<view class="left">商品价格</view>
 				<view class="right price">{{info.bills.cost}}</view>
 			</view>
@@ -125,7 +125,8 @@
 	}
 
 	.card {
-		margin: 0 70rpx;
+		margin: 0 40rpx;
+		padding: 40rpx;
 		border-radius: 20rpx;
 		background-color: #FFFFFF;
 

+ 6 - 0
package-lock.json

@@ -9,6 +9,12 @@
       "resolved": "https://registry.nlark.com/@dcloudio/types/download/@dcloudio/types-2.5.6.tgz",
       "integrity": "sha1-+6kMwEIOEj6rCeiV1brOsLc+uyE="
     },
+    "crypto-js": {
+      "version": "4.1.1",
+      "resolved": "https://registry.nlark.com/crypto-js/download/crypto-js-4.1.1.tgz?cache=0&sync_timestamp=1626954954639&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcrypto-js%2Fdownload%2Fcrypto-js-4.1.1.tgz",
+      "integrity": "sha1-nkhbzwNSEEG9hYRHhrg/t2GXNs8=",
+      "dev": true
+    },
     "luch-request": {
       "version": "3.0.7",
       "resolved": "https://registry.nlark.com/luch-request/download/luch-request-3.0.7.tgz",

+ 3 - 0
package.json

@@ -13,5 +13,8 @@
   "dependencies": {
     "luch-request": "^3.0.6",
     "uview-ui": "^1.8.4"
+  },
+  "devDependencies": {
+    "crypto-js": "^4.1.1"
   }
 }

+ 24 - 12
pages.json

@@ -95,17 +95,15 @@
 				"enablePullDownRefresh": false
 			}
 
+		}, {
+			"path": "pages/order/order",
+			"style": {
+				"navigationBarTitleText": "我的订单",
+				"enablePullDownRefresh": false
+			}
+
 		}
-	    ,{
-            "path" : "pages/order/order",
-            "style" :                                                                                    
-            {
-                "navigationBarTitleText": "我的订单",
-                "enablePullDownRefresh": false
-            }
-            
-        }
-    ],
+	],
 	"subPackages": [{
 		//tarbar下mine的分包
 		"root": "pagesA",
@@ -191,6 +189,20 @@
 				"enablePullDownRefresh": false
 			}
 
+		}, {
+			"path": "pages/notice/notice",
+			"style": {
+				"navigationBarTitleText": "通知公告",
+				"enablePullDownRefresh": false
+			}
+
+		}, {
+			"path": "pages/notice/detail",
+			"style": {
+				"navigationBarTitleText": "公告详情",
+				"enablePullDownRefresh": false
+			}
+
 		}]
 	}, {
 		//tarbar下gain 代理的分包
@@ -319,7 +331,7 @@
 			"style": {
 				"navigationBarTitleText": "付款码",
 				"navigationBarTextStyle": "white",
-				"navigationBarBackgroundColor": "#18b566",
+				"navigationBarBackgroundColor": "#0aa98b",
 				"enablePullDownRefresh": false
 			}
 		}, {
@@ -358,7 +370,7 @@
 		}, {
 			"path": "pages/pay/pay",
 			"style": {
-				"navigationStyle":"custom",
+				"navigationStyle": "custom",
 				"navigationBarTitleText": "付款",
 				"enablePullDownRefresh": false
 			}

+ 27 - 8
pages/mine/mine.vue

@@ -3,23 +3,29 @@
 		<!-- 扫一扫错误回调 -->
 		<u-modal title="扫描异常"  confirm-color="#dc9b21"  v-model="scanNotify.scan" :content="scanNotify.scanMessage"></u-modal>
 		<view style="position: relative;">
-			<image src="https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/84f72f66af72481292c06f874bda7aee-hLSQUd5lf8eT5ae71ea2ce3390e3ad7b7598d4dd030b.png" class="bg-img"></image>
+			<image src="https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/00abb22b11f346b197c073772e53675c-5anE2S2y6WGxc24e57de38088eafef56be419623c2e3.png" class="bg-img"></image>
 			<image src="https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/e187781c8fa14a2fa277ab426d630000-mPfi6nPhpDetaa367231fd73497e172f2af4d37c41c4.png" class="shuiyin" mode=""></image>
 			<view class="card">
 				<view class="info" v-if="vuex_userId">
-					<view class="flex">
-						<image class="avatar" :src="userInfo.avatar"></image>
+					<view class="flex margin-right-20">
+						<image class="avatar" style="box-sizing: border-box;" :src="userInfo.avatar"></image>
 						<view class="nickname">
 							<block style="display: flex;">
 								<text >{{userInfo.nickName}}</text>
-								<view v-if="vuex_agenter_type!= '普通用户'" class="cu-tag bg-red sm radius margin-left-20">
-									<text>{{vuex_agenter_type}}</text>
+								<view v-if="vuex_agenter_type != '普通用户'" class="cu-tag sm margin-left-20" style="border-radius: 0 20rpx 20rpx 20rpx;background-color: #ea3723;color: #FFFFFF;">
+									<text>{{vuex_agenter_type}}</text>	
 								</view>
 							</block>
 						</view>
 					</view>
-					<view class="center margin-right-40">
-						<image @click="$jump('/pagesA/pages/setting/setting')" style="width: 60rpx;height: 60rpx;" src="../../static/icon/setting2.png" mode=""></image>
+					<view class="center margin-right-10">
+						<view @click="$jump('/pagesA/pages/notice/notice?ids='+JSON.stringify(notReadList))" class="margin-right-20" style="position: relative;">
+							<image  style="width: 52rpx;height: 52rpx;" src="../../static/icon/message.png" mode=""></image>
+							<view v-if="$isNotEmpty(notReadList)" class="cu-tag bg-red sm round" style="position: absolute;top: -5rpx;right: -10rpx;">
+								{{notReadList.length}}
+							</view>
+						</view>
+						<image @click="$jump('/pagesA/pages/setting/setting')" style="width: 52rpx;height: 52rpx;" src="../../static/icon/setting2.png" mode=""></image>
 					</view>
 				</view>
 				<view class="info" v-else>
@@ -139,6 +145,7 @@
 <script>
 	import myBills from "@/components/my-bills.vue"
 	import login from "@/components/login.vue"
+	import crypto from "@/utils/crypto.js"
 	export default {
 		components:{
 			login,
@@ -155,6 +162,8 @@
 				//用户信息
 				userInfo:{},
 				userDataStatistical:{},
+				//信息未读数id列表
+				notReadList:[],
 				
 				//跳回收银台的逻辑
 				query:''
@@ -178,6 +187,15 @@
 		methods: {
 			init(){
 				this.fetchUserInfo()
+				this.fetchNoticeNotReadCount()
+			},
+			fetchNoticeNotReadCount(){
+				let params={
+					receiverId:this.vuex_userId,
+				}
+				this.$api.notice.notReadIdList(params).then(res=>{
+					this.notReadList=res.data || []
+				})
 			},
 			async fetchUserInfo(){
 				let params={
@@ -242,6 +260,7 @@
 					this.showPhoneModal()
 				}
 			},
+			
 			// 登录 end
 			scanCode(){
 				if (this.$isEmpty(this.vuex_userId)) {
@@ -251,7 +270,6 @@
 				const _this = this;
 				uni.scanCode({
 				    success: function (res) {
-						console.log(res);
 						let result=res.result
 						let url=result.split("#")[1]
 						_this.jump(url)
@@ -394,6 +412,7 @@
 			}
 			
 			.nickname{
+				width: calc(100% - 120rpx);
 				font-weight: 800;
 				color: #222222;
 				font-size: 30rpx;

+ 39 - 17
pages/test/test.vue

@@ -1,26 +1,48 @@
 <template>
 	<view class="">
-		
+
 	</view>
 </template>
 
 <script>
-export default {
-	name: '',
-	data() {
-		return {
-			
-		};
-	},
-	onLoad() {
-		
-	},
-	methods:{
-		
-	}
-};
+	import md5Libs from "uview-ui/libs/function/md5";
+	import crypto from "../../utils/crypto.js"
+	export default {
+		name: '',
+		data() {
+			return {
+
+			};
+		},
+		onLoad() {
+			this.remove()
+		},
+		methods: {
+			list() {
+				this.$api.shop.list({
+					id: '1453602587696812034'
+				}).then(res => {
+					console.log(res, "/******");
+				})
+			},
+			submit() {
+				let params = {
+					"phone": "19124812874",
+					"secret": "123456"
+				}
+				this.$api.test.submit(params).then(res => {
+					console.log(res);
+				})
+			},
+			remove() {
+				this.$api.test.remove("1455095357455790082").then(res => {
+					console.log(res);
+				})
+			}
+		}
+	};
 </script>
 
 <style lang="scss" scoped>
-	
-</style>
+
+</style>

+ 1 - 1
pagesA/pages/myInfo.vue

@@ -36,7 +36,7 @@
 				<view class="center">
 					<u-input @click="calendarShow=true" disabled v-model="userData.birth" :clearable="false" inputAlign="right" placeholder="请填写生日"></u-input>
 					<text class="cuIcon-right margin-left-10"></text>
-					<u-calendar v-model="calendarShow" mode="date" @change="change"></u-calendar>
+					<u-calendar v-model="calendarShow" mode="date" active-bg-color="#FF9447" @change="change"></u-calendar>
 				</view>
 			</view>
 			<view style="height: 20upx;"></view>

+ 61 - 0
pagesA/pages/notice/detail.vue

@@ -0,0 +1,61 @@
+<template>
+	<view>
+		<!--文章标题-->
+		<view class="text-black  text-bold  title" style="font-size: 40rpx;">{{dataDetail.title}}</view>
+		<view class="text-gray " style="padding: 0 0 30rpx 30rpx;">
+			<text class="cuIcon-time padding-right-10"></text>
+			<text>{{dataDetail.createTime}}</text>
+		</view>
+		<view class="content-view-box">
+			<view class="font-view">
+				<u-parse :html="dataDetail.content"></u-parse>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	var app=getApp()
+	export default {
+		components: {
+		},
+		data() {
+			return {
+				id:'',
+				dataDetail:{},
+			}
+		},
+		onLoad(options) {
+			this.id=options.id
+			this.fetchDetail()
+		},
+		methods: {
+			 fetchDetail(){
+				 this.$api.notice.detail({id:this.id}).then(res=>{
+					 this.dataDetail=res.data
+				 })
+			 }
+		}
+	}
+</script>
+
+
+<style lang="scss">
+	page {
+		background: #FFFFFF;
+	}
+	.title {
+		margin: 36.36rpx 27.27rpx;
+	}
+
+	.content-view-box {
+		position: relative;
+		.font-view {
+			padding: 27.27rpx;
+			line-height: 1.9;
+		}
+		image {
+			width: 100%;
+		}
+	}
+</style>

+ 132 - 0
pagesA/pages/notice/notice.vue

@@ -0,0 +1,132 @@
+<template>
+	<view class="safe-area-inset-bottom margin-top-10">
+		<mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
+			:down="downOption" :up="upOption">
+			<view @click="jump(item)" class="cart-view-box" v-for="(item,index) in list" :key="index">
+				<view class="text-gray text-center text-sm">{{item.createTime}}</view>
+				<view class="bg-white margin-top-10 radius card-view">
+					<view class="content-view">
+						<view class="flex">
+							<view class="center">
+								<text class=" text-lg text-cut" style="color: #000000;">{{item.title}}</text>
+							</view>
+						</view>
+						<view class=" text-sm text-cut-2 subtitle">{{item.content | formatHtml}}</view>
+						<view class="flex text-gray justify-between "
+							style=" border-top: 1rpx solid #f2f2f2;box-sizing: border-box;padding-top: 15rpx;">
+							<view class="text-df ">
+								<text>查看详情</text>
+							</view>
+							<view style="padding-top: 8rpx;">
+								<text class="cuIcon-right "></text>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</mescroll-body>
+		<toast ref="toast"></toast>
+	</view>
+</template>
+<script>
+	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
+	export default {
+		mixins: [MescrollMixin],
+		data() {
+			return {
+				ids: [],
+				list: [],
+				downOption:{
+					auto:false
+				}
+			}
+		},
+		filters: {
+			formatHtml(str) {
+				return str.replace(/<[^>]+>/g, "");
+			}
+		},
+		onLoad(options) {
+			this.ids = JSON.parse(options.ids)
+			this.isRead()
+		},
+		methods: {
+			isRead() {
+				if (this.$isEmpty(this.ids)) {
+					return
+				}
+				let params = []
+				this.ids.forEach(item => {
+					let obj = {
+						id: item,
+						isRead: true
+					}
+					params.push(obj)
+				})
+				this.$api.notice.isRead(params)
+			},
+			jump(item) {
+				uni.navigateTo({
+					url: "detail?id=" + item.id
+				})
+			},
+			downCallback() {
+				setTimeout(() => {
+					this.$refs.toast.info('刷新成功')
+					this.mescroll.resetUpScroll();
+				}, 1000)
+			},
+			upCallback(mescroll) {
+				let params = {
+					receiverId: this.vuex_userId,
+					current: mescroll.num,
+					size: mescroll.size,
+				}
+				try {
+					this.$api.notice.list(params).then(res => {
+						let data = res.data.records
+						let total = res.data.total
+						mescroll.endBySize(data.length, total);
+						if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
+						this.list = this.list.concat(data); //追加新数据
+					})
+				} catch (e) {
+					this.mescroll.endErr()
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	page {
+		background-color: #F3F3F3;
+		font-size: 28rpx;
+	}
+
+	.subtitle {
+		color: #7e7e7e;
+		font-size: 28rpx;
+		margin: 30rpx 0 10rpx 0;
+		line-height: 52rpx;
+	}
+
+	.cart-view-box {
+		padding: 25rpx 20rpx;
+
+		.card-view {
+			background-color: #FFFFFF;
+			position: relative;
+			border-radius: 10rpx;
+
+			.head-img {
+				width: 100%;
+				height: 236rpx;
+			}
+
+			.content-view {
+				padding: 27rpx 27rpx 15rpx;
+			}
+		}
+	}
+</style>

+ 4 - 4
pagesB/pages/agent/draw-poster.vue

@@ -38,10 +38,10 @@
 			}
 		},
 		onLoad() {
-			if (this.$cache.get('posterUrl')) {
-				this.posterUrl = this.$cache.get('posterUrl')
-				return
-			}
+			// if (this.$cache.get('posterUrl')) {
+			// 	this.posterUrl = this.$cache.get('posterUrl')
+			// 	return
+			// }
 			this.draw()
 		},
 		methods: {

+ 19 - 1
pagesC/pages/checkstand/index.vue

@@ -50,6 +50,7 @@
 	import payConfirm from '@/components/pay-confirm.vue'
 	import channelList from '@/components/channel-list.vue'
 	import amountInput from '../../comps/amountInput/amountInput.vue';
+	import crypto from "@/utils/crypto.js"
 	export default {
 		components: {
 			payConfirm,
@@ -103,7 +104,7 @@
 				this.isH5=true
 			} else {
 				this.isH5=false
-				this.shopId = options.id
+				this.shopId = crypto.decrypt(options.data)
 			}
 
 			// #ifdef  MP-WEIXIN
@@ -136,6 +137,23 @@
 			console.log(this.orderAmount);
 		},
 		methods: {
+			handelScanResult(res){
+				let result=res.result
+				/**
+				 * urlParams
+				 * url和加密的参数 ["/pagesC/pages/checkstand/index","cA8f31EnoYduLe52YELaV109iQpDEOxcDQYxiizK6BA="]
+				 */
+				let urlParams=result.split("#")[1].split("?")
+				//解密参数
+				let decryptParams=crypto.decrypt(urlParams[1])
+				if (this.$isEmpty(decryptParams)) {
+					this.$refs.toast.error('参数异常')
+					return
+				}
+				//重新拼接url
+				let url=urlParams[0]+"?"+decryptParams
+				this.jump(url)
+			},
 			isWxBrowser(){
 				let na = navigator.userAgent.toLowerCase()
 				return na.indexOf('micromessenger') !== -1

+ 41 - 33
pagesC/pages/checkstand/pay-qrcode.vue

@@ -1,33 +1,36 @@
 <template>
-	<view class="code-container">
-		<view class="title center">{{isPayment? "向商家付款":"扫一扫,向我付款"}}</view>
-		<view class="main-content">
-			<view v-if="isPayment">
-				<!-- 占位 -->
-				<view style="height: 50rpx;"></view>
-				<!-- 条形码 -->
-				<view class="bar-code center">
-					<tki-barcode ref="barcode" :val="content" onval=true :opations="barOption" />
+	<view>
+		<view class="code-container " style="margin: 60rpx 35rpx;">
+			<view class="title center">{{isPayment? "向商家付款":"扫一扫,向我付款"}}</view>
+			<view class="main-content">
+				<view v-if="isPayment">
+					<!-- 占位 -->
+					<view style="height: 50rpx;"></view>
+					<!-- 条形码 -->
+					<view class="bar-code center" style="overflow-x: hidden;margin: 0 30rpx;">
+						<tki-barcode ref="barcode" :val="content" onval=true :opations="barOption" />
+					</view>
+					<!-- 付款码 -->
+					<view class="qr-code center">
+						<tki-qrcode  cid="2" ref="qrcode" :icon="avatar" :val="content" size="350" :onval="true" :loadMake="true"
+							:usingComponents="true" />
+					</view>
 				</view>
-				<!-- 付款码 -->
-				<view class="qr-code center">
-					<tki-qrcode cid="2" ref="qrcode" :icon="avatar" :val="content" size="350" :onval="true" :loadMake="true"
-						:usingComponents="true" />
+				<!-- 款码 -->
+				<view v-else class="charge-code center">
+					<tki-qrcode cid="1" ref="qrcode-charge" :val="id" :icon="avatar" size="500" :onval="true"
+						:loadMake="true" :usingComponents="true" />
 				</view>
 			</view>
-			<!-- 收款码 -->
-			<view v-else class="charge-code center">
-				<tki-qrcode cid="1" ref="qrcode-charge" :val="id" :icon="avatar" size="500" :onval="true"
-					:loadMake="true" :usingComponents="true" />
-			</view>
-		</view>
-		<view class="footer center flex-direction"  :style="$isNotEmpty(vuex_channel)?'padding: 30rpx 0rpx;':''">
-			<text class="text-xl text-bold">{{nickName}}</text>
-			<!-- #ifdef  MP-WEIXIN-->
-			<view style="width: 100%;padding: 0;">
-				<channel-list></channel-list>
+			<view class="footer center flex-direction"  :style="$isNotEmpty(vuex_channel)?'padding: 30rpx 0rpx;':''">
+				<text class="text-xl text-bold">{{nickName}}</text>
+				<!-- #ifdef  MP-WEIXIN-->
+				<view style="width: 100%;padding: 0;">
+					<channel-list></channel-list>
+				</view>
+				<!-- #endif -->
 			</view>
-			<!-- #endif -->
+			
 		</view>
 	</view>
 </template>
@@ -38,6 +41,7 @@
 	import tkiBarcode from "../../comps/tki-barcode/tki-barcode.vue"
 	import totp from "../../utils/totp.js"
 	import socket from "../../utils/socket.js"
+	import crypto from "@/utils/crypto.js"
 	export default {
 		components: {
 			channelList,
@@ -47,7 +51,8 @@
 		computed: {
 			content() {
 				let transformStr = this.id
-				return transformStr + this.secret + ";" + (this.vuex_channel ? this.vuex_channel.id : 0)
+				let qrcodeText=transformStr + this.secret + ";" + (this.vuex_channel ? this.vuex_channel.id : 0)
+				return crypto.encrypt(qrcodeText)
 			}
 		},
 		data() {
@@ -59,8 +64,8 @@
 				isPayment: true,
 				timer: '',
 				barOption: {
-					width: 3,
-					height: 130,
+					width: 1,
+					height: 120,
 					displayValue: false
 				},
 				//webSocket
@@ -148,6 +153,9 @@
 					console.log(this.secret);
 				}, 1000)
 			},
+			getSecret(){
+				this.secret = totp.getSecret(this.id);
+			},
 			async initAvatat(url) {
 				return new Promise((reslove, reject) => {
 					uni.downloadFile({
@@ -206,10 +214,11 @@
 
 <style>
 	page {
-		background-color: #18b566;
+		background-color: #0aa98b;
 	}
 </style>
 <style lang="scss" scoped>
+	$color:#0aa98b;
 	.popup-content {
 		display: flex;
 		flex-direction: column;
@@ -218,7 +227,7 @@
 		height: 100%;
 
 		.channelbtn {
-			background-color: #18b566;
+			background-color: $color;
 			color: #FFFFFF;
 			padding: 36rpx 150rpx;
 		}
@@ -236,7 +245,7 @@
 			}
 
 			.checked {
-				color: #18b566;
+				color: $color;
 				font-size: 34rpx;
 				position: absolute;
 				font-weight: 800;
@@ -296,14 +305,13 @@
 	.code-container {
 		background-color: #FFFFFF;
 		border-radius: 16rpx;
-		margin: 80rpx 20rpx;
 
 		.title {
 			border-radius: 25rpx 25rpx 0 0;
 			height: 100rpx;
 			width: 100%;
 			font-size: 35rpx;
-			color: #18b566;
+			color: $color;
 			background-color: #F7F7F7;
 			font-weight: 600;
 			letter-spacing: 3rpx;

+ 3 - 3
pagesD/pages/menu/menu.vue

@@ -280,6 +280,8 @@
 				isLoading: true,
 
 				shopId: '',
+				//是否有必点商品
+				hasMustOrder:false,
 				address: {},
 				cart: [],
 				takeType: "店内堂食",
@@ -335,7 +337,6 @@
 		},
 		onLoad(options) {
 			this.$refs.loading.showLoading()
-
 			_this = this
 			if (this.$isNotEmpty(options.q)) {
 				//获取普通二维码的参数
@@ -472,7 +473,6 @@
 				await this.initCart()
 				this.initShopConfig()
 			},
-			
 			async initShop() {
 				let params = {
 					id: this.shopId
@@ -497,7 +497,7 @@
 					shopId: this.shopId
 				})
 				this.goods = res.data;
-
+				this.hasMustOrder= this.goods.some(item=>item.goodsCategoryName.includes(this.$global.mustOrder))
 				setTimeout(() => {
 					_this.$refs.loading.hide()
 					_this.isLoading = false

BIN
static/icon/1634805315(1).jpg


BIN
static/icon/message.png


+ 35 - 0
utils/crypto.js

@@ -0,0 +1,35 @@
+var CryptoJS = require("crypto-js");
+console.log(CryptoJS.HmacSHA1("Message", "Key"));
+
+let crypto = {}
+
+//前后端定义的密钥,AES使用16位
+const CRYPTOJS_KEY = "uAY9ugkHQpvozZeA";
+// 加密
+crypto.encrypt = (plaintText) => {
+	var plaintText = plaintText;
+	var options = {
+		mode: CryptoJS.mode.ECB,
+		padding: CryptoJS.pad.Pkcs7
+	};
+	var key = CryptoJS.enc.Utf8.parse(CRYPTOJS_KEY);
+	var encryptedData = CryptoJS.AES.encrypt(plaintText, key, options);
+	var encryptedBase64Str = encryptedData.toString().replace(/\//g, "_");
+	encryptedBase64Str = encryptedBase64Str.replace(/\+/g, "-");
+	return encryptedBase64Str;
+}
+
+//解密
+crypto.decrypt = (encryptedBase64Str) => {
+	var vals = encryptedBase64Str.replace(/\-/g, '+').replace(/_/g, '/');
+	var options = {
+		mode: CryptoJS.mode.ECB,
+		padding: CryptoJS.pad.Pkcs7
+	};
+	var key = CryptoJS.enc.Utf8.parse(CRYPTOJS_KEY);
+	var decryptedData = CryptoJS.AES.decrypt(vals, key, options);
+	var decryptedStr = CryptoJS.enc.Utf8.stringify(decryptedData);
+	return decryptedStr
+}
+
+export default crypto

+ 4 - 0
utils/util.js

@@ -3,6 +3,10 @@ import dateTime from './dateTime.js'
 //工具类
 let util = {}
 
+
+
+
+
 //预览图片
 // this.$util.preview('http://....png')
 // this.$util.preview('../../test.png')