hmp 4 年之前
父節點
當前提交
47da75a32c

+ 0 - 12
assets/http/config.js

@@ -1,12 +0,0 @@
-let config = {}
-
-config.baseURL='https://ldt.guosen-fumao.cn/api/'
-config.webSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
-
-// config.baseURL='http://localhost:2366/'
-// config.webSocketUrl='ws://localhost:2366/websocket/'
-
-
-export default config
-
-

+ 16 - 2
assets/http/service.js

@@ -1,7 +1,10 @@
 import Request from 'luch-request'
-import config from './config.js'
+import setting from './setting.js'
+import crypto from '@/utils/crypto.js'
+import md5Libs from "uview-ui/libs/function/md5";
+import verify from "@/utils/verify.js";
 
-let baseURL = config.baseURL
+let baseURL = setting.baseURL
 
 let refreshTokenUrl = baseURL + "blade-auth/oauth/token"
 
@@ -44,6 +47,17 @@ http.interceptors.request.use((config) => {
 		Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0",
 		"Blade-Auth": getTokenStorage()
 	}
+	if (setting.enabledCrypto && config.method == 'POST') {
+		let data=config.data || {}
+		//报文加密
+		if (!verify.isEmpty(config.data)) {
+			let encrypt= crypto.encrypt(JSON.stringify(config.data))
+			config.data=encrypt
+		}
+		//签名
+		data.signKey=crypto.SIGN_KEY
+		config.header.sign= md5Libs.md5(crypto.objSort(data))
+	}
 	return config
 }, (config) => {
 	return Promise.reject(config)

+ 14 - 0
assets/http/setting.js

@@ -0,0 +1,14 @@
+let setting = {}
+
+setting.baseURL='https://ldt.guosen-fumao.cn/api/'
+setting.webSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
+setting.enabledCrypto = false
+
+// setting.baseURL='http://192.168.1.168:2366/'
+// setting.webSocketUrl='ws://192.168.1.168:2366/websocket/'
+// setting.enabledCrypto = true
+
+
+export default setting
+
+

+ 53 - 0
components/read-text.vue

@@ -0,0 +1,53 @@
+<template>
+	<view class="">
+	</view>
+</template>
+
+<script>
+	var plugin = requirePlugin("WechatSI")
+	let manager = plugin.getRecordRecognitionManager()
+	export default {
+		data() {
+			return {
+				
+			};
+		},
+		created() {
+			this.innerAudioContext = wx.createInnerAudioContext();
+			this.innerAudioContext.onError(function(res) {
+				uni.showToast({
+					title: '语音播放初始化失败',
+				})
+			})
+		},
+		methods: {
+			//阅读文字
+			read(content) {
+				var that = this;
+				plugin.textToSpeech({
+					lang: "zh_CN",
+					tts: true,
+					content,
+					success: function(res) {
+						that.auidoSrc=res.filename
+						that.doRead();
+					},
+					fail: function(res) {
+						wx.showToast({
+							title: '语音转换失败',
+						})
+					}
+				})
+			},
+			doRead() {
+				this.innerAudioContext.src = this.auidoSrc //设置音频地址
+				this.innerAudioContext.play(); //播放音频
+			},
+
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+
+</style>

+ 10 - 1
main.js

@@ -64,6 +64,11 @@ import verify from 'utils/verify.js'
 Vue.prototype.$verify = verify
 
 
+//加密处理
+import crypto from './utils/crypto.js'
+Vue.prototype.$crypto = crypto
+
+
 //跳转
 Vue.prototype.$jump=function(url){
 	uni.navigateTo({
@@ -156,12 +161,16 @@ Vue.prototype.$isNotEmpty=function(value){
 	return true;
 }
 
+//消息模板
 Vue.prototype.$tmplIds=[
-	//设备告警通知
+	//认证消息模板
 	'yAtQ6AY8zBHDT1PxXHv7x7gS-qiN1DnSedN4MWLbHwk',
+	//收款消息模板
+	'2TcoWv042wo8Bf0SLRkjSLG00JAb9bE-usMy_aAW3Js'
 ]
 
 
+
 Vue.config.productionTip = false
 
 App.mpType = 'app'

+ 6 - 2
manifest.json

@@ -51,8 +51,8 @@
 	/* 小程序特有相关 */
 	"mp-weixin": {
 		"appid": "wx2db9c41e85d5a4fc",
-		"optimization" : {
-		    "subPackages" : true
+		"optimization": {
+			"subPackages": true
 		},
 		"setting": {
 			"urlCheck": false,
@@ -70,6 +70,10 @@
 			"ocr-plugin": {
 				"version": "3.0.4",
 				"provider": "wx4418e3e031e551be"
+			},
+			"WechatSI": {
+				"version": "0.3.5",
+				"provider": "wx069ba97219f66d99"
 			}
 		}
 	},

+ 6 - 0
package-lock.json

@@ -9,6 +9,12 @@
       "resolved": "https://registry.nlark.com/@dcloudio/types/download/@dcloudio/types-2.3.3.tgz?cache=0&sync_timestamp=1626160250541&other_urls=https%3A%2F%2Fregistry.nlark.com%2F%40dcloudio%2Ftypes%2Fdownload%2F%40dcloudio%2Ftypes-2.3.3.tgz",
       "integrity": "sha1-DkDCovGSXVbbKXw0xSjqjIz7tOc="
     },
+    "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.6",
       "resolved": "https://registry.nlark.com/luch-request/download/luch-request-3.0.6.tgz",

+ 1 - 0
package.json

@@ -17,6 +17,7 @@
     "uview-ui": "^1.8.4"
   },
   "devDependencies": {
+    "crypto-js": "^4.1.1",
     "u-draw-poster": "^1.1.6"
   }
 }

+ 45 - 41
pages/card/card.vue

@@ -1,37 +1,22 @@
 <template>
 	<view>
-		<view class="" v-for="(item,index) in menuList" :key="index" @click="jump(item.path)">
-			<button v-if="index!=4" class="card btnCss" style="font-size: 30rpx;color: #5c5c5c;border-radius: 0;border: none;">
+		<block class="" v-for="(item,index) in menuList" :key="index" >
+			<button @click="jump(item)" class="card u-reset-button" :open-type="item.name=='在线咨询'?'contact':''">
 				<view style="display: flex;">
-					<view class="center">
-						<image v-if="index!=1 && index!=5" style="width:36rpx;height: 36rpx;" :src="item.icon" ></image>
-						<image v-else style="width:38rpx;height: 38rpx;" :src="item.icon"></image>
+					<view class="center"> 
+						<text :class="item.icon" style="font-size: 34rpx;"></text>
 					</view>
 					<view class="center">
 						<text class="padding-left-10">{{item.name}}</text>
 					</view>
 				</view>
 				<view class="">
-					<text class="cuIcon-right"></text>
-				</view>
-			</button>
-			
-			<button v-else open-type="contact" class="card btnCss"
-				style="font-size: 30rpx;color: #5c5c5c;border-radius: 0;border: none;">
-				<view style="display: flex;">
-					<view class="center">
-						<image style="width: 36rpx;height: 36rpx;" src="/static/icon/kefu1.png"></image>
-					</view>
-					<view class="center">
-						<text class="padding-left-10">在线咨询</text>
-					</view>
-				</view>
-				<view class="">
-					<text class="cuIcon-right"></text>
+					<text class="cuIcon-right text-gray"></text>
 				</view>
 			</button>
-		</view>
+		</block>
 		
+		<toast ref="toast" ></toast>
 		<u-modal @confirm="$jump('/pages/member/member')" :show-cancel-button="true"  confirm-color="#ff9447" confirm-text="立即开启" cancel-text="暂不开启" v-model="isOpenMemberShow" content="请先创建会员中心"></u-modal>
 	</view>
 </template>
@@ -41,33 +26,45 @@
 		data() {
 			return {
 				menuList: [{
-						icon: '/static/icon/info.png',
+						icon: 'cuIcon-shop',
 						name: '商家资料',
+						verify:true,
 						path: '/pages/shop-info/shop-info?edit=true&phone=' + this.$cache.get('phone')
 					},
 					{
-						icon: '/static/icon/yinhangka.png',
+						icon: 'cuIcon-pay',
 						name: '银行卡',
+						verify:true,
 						path: '/pages/userBank/userBank'
 					},
 					{
-						icon: '/static/icon/xiazai1.png',
+						icon: 'cuIcon-down',
 						name: '物料下载',
+						verify:true,
 						path: '/pages/material-download/material-download'
 					},
 					{
-						icon: '/static/icon/yijian.png',
+						icon: 'cuIcon-community',
 						name: '意见反馈',
+						verify:false,
 						path: '/pages/card/feedback'
 					},
 					{
-						icon: '/static/icon/kefu1.png',
+						icon: 'cuIcon-service',
 						name: '在线咨询',
+						verify:false,
 						path: '/pages/card/feedback'
 					},
 					{
-						icon: '/static/icon/logout1.png',
+						icon: 'cuIcon-settings',
+						name: '授权设置',
+						verify:false,
+						path: '/pages/card/feedback'
+					},
+					{
+						icon: 'cuIcon-exit',
 						name: '退出登录',
+						verify:false,
 						path: 'logout'
 					},
 				],
@@ -83,25 +80,32 @@
 					})
 				})
 			},
-			jump(url) {
-				if (url=='logout') {
-					this.logout()
+			jump(item) {
+				if (item.verify && this.vuex_shopStatus != 'PASS') {
+					this.$refs.toast.error('商户资料审核通过后开放')
 					return
 				}
-				
-				if (this.$isEmpty(url)) {
-					this.$u.toast('即将推出')
+				if (item.name=='物料下载'&&!this.vuex_isOpenMember) {
+					this.isOpenMemberShow=true
 					return
 				}
-				if (url=='/pages/material-download/material-download'&&!this.vuex_isOpenMember) {
-					//物料下载
-					this.isOpenMemberShow=true
+				if (item.name=='退出登录') {
+					this.logout()
+					return
+				}
+				if (item.name=='授权设置') {
+					uni.openSetting({
+					  success(res) {
+					    console.log(res.authSetting)
+					  }
+					});
 					return
 				}
 				uni.navigateTo({
-					url
+					url:item.path
 				})
-			}
+			},
+			
 		}
 	}
 </script>
@@ -110,8 +114,8 @@
 	.card {
 		display: flex;
 		justify-content: space-between;
-		margin: 16rpx 0;
-		padding: 8rpx 30rpx;
+		margin: 14rpx 0;
+		padding: 25rpx 30rpx;
 		background-color: #FFFFFF;
 	}
 </style>

+ 47 - 47
pages/checkstand/pay-qrcode.vue

@@ -1,69 +1,66 @@
 <template>
 	<view class="code-container">
 		<view class="title center">扫一扫,向我付款</view>
-		<view  class="main-content">
+		<view class="main-content center">
 			<!-- 收款码 -->
 			<view class="charge-code center">
-				 <tki-qrcode
-					cid="1"
-				    ref="qrcode-charge"
-				    :val="id"
-					size="420"
-				    :onval="true"
-				    :loadMake="true"
-				    :usingComponents="true"
-				    />
+				<tki-qrcode cid="1" ref="qrcode-charge" :val="id" size="420" :onval="true" :icon="avatar"
+					:loadMake="true" :usingComponents="true" />
 			</view>
 		</view>
 		<view class="footer center">
 			<text class="text-xl text-bold">{{shopDetail.name}}</text>
 		</view>
-		
+
 	</view>
 </template>
 
 <script>
 	import tkiQrcode from "tki-qrcode"
 	export default {
-		components: {tkiQrcode},
-		computed:{
-			content(){
-				let  transformStr = (this.id*this.$global.TRANSFORM_PARAMS)*2
-				return transformStr+this.secret
+		components: {
+			tkiQrcode
+		},
+		computed: {
+			content() {
+				let transformStr = (this.id * this.$global.TRANSFORM_PARAMS) * 2
+				return transformStr + this.secret
 			}
 		},
 		data() {
 			return {
 				id: "",
-				shopDetail:{},//商户详情
+				shopDetail: {}, //商户详情
 				avatar: "",
 				secret: '000000',
 				timer: '',
 			}
 		},
 		methods: {
-			async initAvatat(url){
-				return new Promise((reslove,reject)=>{
+			async initAvatat(url) {
+				return new Promise((reslove, reject) => {
 					uni.downloadFile({
-							url,
-							success: (res)=> {
-								reslove(res);
-							},
-							fail: (err) => {
-								reject(err)
-							}
+						url,
+						success: (res) => {
+							reslove(res);
+						},
+						fail: (err) => {
+							reject(err)
+						}
 					})
 				})
-				
+
 			}
 		},
-		async mounted(option){
-			let res=await this.$api.shop.detail({id:this.vuex_shopId})
-			this.shopDetail=res.data
-			let avatar=res.data.cover
-			// this.avatar =(await  this.initAvatat(avatar)).tempFilePath;
+		async mounted(option) {
+			let res = await this.$api.shop.detail({
+				id: this.vuex_shopId
+			})
+			this.shopDetail = res.data
+			let avatar = res.data.cover
+			this.avatar = (await this.initAvatat(avatar)).tempFilePath;
 			//获取用户ID
-			this.id = this.$global.QR_PATH+this.vuex_shopId
+			this.id = this.$global.QR_PATH + this.$crypto.encrypt(this.vuex_shopId)
 			//生成动态密码
 		},
 		beforeDestroy() {
@@ -78,50 +75,53 @@
 	}
 </style>
 <style lang="scss" scoped>
-
-	.code-container{
+	.code-container {
 		background-color: #FFFFFF;
 		border-radius: 16rpx;
 		// min-height: 900rpx;
 		min-height: 800rpx;
-		margin: 60rpx  20rpx;
-		.title{
+		margin: 60rpx 20rpx;
+
+		.title {
 			border-radius: 25rpx 25rpx 0 0;
 			height: 100rpx;
 			width: 100%;
 			font-size: 35rpx;
 			color: #FE9644;
 			background-color: #F7F7F7;
-			 font-weight: 600;
-			 letter-spacing: 3rpx;
+			font-weight: 600;
+			letter-spacing: 3rpx;
 		}
-		
-		.footer{
+
+		.footer {
 			width: 90%;
 			height: 120rpx;
 			margin-left: 5%;
 			border-top: 1rpx dashed #dddddd;
 		}
-		.main-content{
+
+		.main-content {
 			width: 100%;
-			height: 600rpx;
+			height: 620rpx;
 			scroll-margin-top: 600rpx;
+
 			// overflow: hidden;
-			.bar-code{
+			.bar-code {
 				margin-left: 5%;
 				width: 90%;
 				height: 150rpx;
 			}
-			.qr-code{
+
+			.qr-code {
 				width: 100%;
 				height: 450rpx;
 			}
-			.charge-code{
+
+			.charge-code {
 				width: 100%;
 				height: 600rpx;
 				transition: transform 1s ease-in-out;
 			}
 		}
 	}
-
 </style>

+ 65 - 60
pages/index/index.vue

@@ -76,7 +76,7 @@
 					</view>
 				</view>
 			</view>
-			
+
 			<view class="market">
 				<text class="title">数字化系统</text>
 				<view class="cu-list grid col-4 no-border margin-top-30">
@@ -93,8 +93,9 @@
 
 		<u-modal @confirm="$jump('/pages/member/member')" :show-cancel-button="true" confirm-color="#ff9447"
 			confirm-text="立即开启" cancel-text="暂不开启" v-model="isOpenMemberShow" content="请先创建会员中心"></u-modal>
-			
-		<u-select confirm-color="#EF9944" @confirm="shopConfirm" :default-value="defaultValue" v-model="shopShow" value-name="id" label-name="name" :list="shopList">
+
+		<u-select confirm-color="#EF9944" @confirm="shopConfirm" :default-value="defaultValue" v-model="shopShow"
+			value-name="id" label-name="name" :list="shopList">
 		</u-select>
 	</view>
 </template>
@@ -107,7 +108,7 @@
 				shopShow: false,
 				//我的商铺列表
 				shopList: [],
-				defaultValue:[0],
+				defaultValue: [0],
 				//选中的商铺id
 				shopId: '',
 				//选中的商铺labe
@@ -167,8 +168,7 @@
 						icon: '/static/index/mendian.png',
 						name: '门店管理',
 						path: ''
-					}
-					, {
+					}, {
 						icon: '/static/index/waimai.png',
 						name: '外卖平台',
 						path: ''
@@ -221,7 +221,7 @@
 					return
 				}
 				if (this.$cache.get('defaultValue')) {
-					this.defaultValue=this.$cache.get('defaultValue')
+					this.defaultValue = this.$cache.get('defaultValue')
 				}
 				this.shopList = res.data.records
 				let item = this.shopList[this.defaultValue[0]]
@@ -231,13 +231,13 @@
 				this.labelNames = item.labelNames
 				this.mallId = item.mallId
 				this.cacheSelectedShop(item)
-				
+
 				this.getTaskDetail()
 				if (!this.isFirst) {
 					this.handelShopStatus()
 				}
-				this.isFirst=true
-				
+				this.isFirst = true
+
 				//获取统计数据
 				this.getStatistic()
 			},
@@ -268,10 +268,10 @@
 			shopConfirm(e) {
 				this.shopId = e[0].value
 				this.shopLable = e[0].label
-				let item = this.shopList.filter((item,index) => {
+				let item = this.shopList.filter((item, index) => {
 					if (this.shopId == item.id) {
-						this.defaultValue=[index]
-						this.$cache.put('defaultValue',this.defaultValue)
+						this.defaultValue = [index]
+						this.$cache.put('defaultValue', this.defaultValue)
 						return true
 					}
 				})
@@ -283,14 +283,18 @@
 				//获取统计数据
 				this.getStatistic()
 			},
-			jump(path){
-				let flag=this.handelShopStatus()
+			jump(path) {
+				let flag = this.handelShopStatus()
 				if (this.$isNotEmpty(flag)) {
 					this.$jump(path)
 				}
 			},
 			operate(index) {
-				let flag=this.handelShopStatus()
+				if (index == 2) {
+					this.$jump('/pages/card/card')
+					return
+				}
+				let flag = this.handelShopStatus()
 				if (this.$isEmpty(flag)) {
 					return
 				}
@@ -303,12 +307,10 @@
 					this.$jump('/pages/pay/pay')
 				} else if (index == 1) {
 					this.$jump('/pages/checkstand/pay-qrcode')
-				} else if (index == 2) {
-					this.$jump('/pages/card/card')
 				}
 			},
 			handelShopStatus() {
-				let _this=this
+				let _this = this
 				//商户审核通过
 				if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.PASS) {
 					return true
@@ -316,16 +318,16 @@
 				//未完善商户资料
 				if (!this.vuex_shopStatus) {
 					uni.showModal({
-						cancelText:'暂不完善',
-						confirmText:'去完善',
-						confirmColor:'#FF9447',
-						cancelColor:'#606266',
-						showCancel:true,
-						title:'提示',
-						content:'商户资料未完善',
+						cancelText: '暂不完善',
+						confirmText: '去完善',
+						confirmColor: '#FF9447',
+						cancelColor: '#606266',
+						showCancel: true,
+						title: '提示',
+						content: '商户资料未完善',
 						success: (res) => {
 							if (res.confirm) {
-								this.$jump('/pages/shop-info/shop-info?phone'+ this.$cache.get('phone'))
+								this.$jump('/pages/shop-info/shop-info?phone' + this.$cache.get('phone'))
 							}
 						}
 					})
@@ -346,7 +348,7 @@
 				}
 				//商户已停用
 				if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.STOP) {
-					this.$dialog.showModal('该商户已停用',false)
+					this.$dialog.showModal('该商户已停用', false)
 					return
 				}
 				//待审核中
@@ -354,50 +356,52 @@
 					if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_SIGN) {
 						//待签约状态,去签约
 						uni.showModal({
-						    title: '提示',
-						    content: '商户资料审核通过,请进行签约?',
-							cancelText:'暂不签约',
-							confirmColor:'#FF9447',
-							confirmText:'去签约',
-						    success: function (res) {
-						        if (res.confirm) {
-									_this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables.signUrl)
-						        } 
-						    }
+							title: '提示',
+							content: '商户资料审核通过,请进行签约?',
+							cancelText: '暂不签约',
+							confirmColor: '#FF9447',
+							confirmText: '去签约',
+							success: function(res) {
+								if (res.confirm) {
+									_this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables
+										.signUrl)
+								}
+							}
 						});
 						return
 					}
 					if (this.vuex_shopStatus == this.$global.SHOP_AUDIT.WAITING_AUTH) {
 						//待商户认证状态
 						uni.showModal({
-						    title: '提示',
-						    content: '商户资料审核通过,请进行认证?',
-							cancelText:'暂不认证',
-							confirmColor:'#FF9447',
-							confirmText:'去认证',
-						    success: function (res) {
-						        if (res.confirm) {
-									_this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables.qrcodeUrl)
-						        } 
-						    }
+							title: '提示',
+							content: '商户资料审核通过,请进行认证?',
+							cancelText: '暂不认证',
+							confirmColor: '#FF9447',
+							confirmText: '去认证',
+							success: function(res) {
+								if (res.confirm) {
+									_this.$jump('/pages/webView/webView?url=' + _this.taskDetail.variables
+										.qrcodeUrl)
+								}
+							}
 						});
 						return
 					}
 					//待商场审核,待平台审核,待易宝审核状态下,去审核流程详情页
 					uni.showModal({
-					    title: '提示',
-					    content: '商户资料审核中,查看审核流程?',
-						cancelText:'暂不查看',
-						confirmColor:'#FF9447',
-						confirmText:'查看',
-					    success: function (res) {
-					        if (res.confirm) {
+						title: '提示',
+						content: '商户资料审核中,查看审核流程?',
+						cancelText: '暂不查看',
+						confirmColor: '#FF9447',
+						confirmText: '查看',
+						success: function(res) {
+					  if (res.confirm) {
 								_this.$jump('/pages/flow/flow')
-					        } 
-					    }
+							}
+						}
 					});
 				}
-				
+
 			},
 			/**
 			 * 获取流程节点信息
@@ -427,8 +431,9 @@
 		left: 54%;
 		margin-left: 20rpx;
 	}
+
 	.cu-list.grid.no-border {
-	    padding: 10rpx;
+		padding: 10rpx;
 	}
 
 	.title {
@@ -503,7 +508,7 @@
 						color: #303030;
 						font-weight: 400;
 					}
-					
+
 					text:last-child {
 						margin-bottom: 10rpx;
 						font-size: 28rpx;

+ 3 - 0
pages/login/account-login.vue

@@ -82,6 +82,8 @@
 			this.$refs.uForm.setRules(this.rules);
 		},
 		async onLoad(options) {
+			console.log(this.$u.guid(20));
+			
 			this.form.phone=options.phone || ''
 			if (this.$cache.get('phone')) {
 				this.$refs.loading.show("登录中..")
@@ -103,6 +105,7 @@
 				});
 			},
 			async loginIn() {
+				await this.$mpi.subscribe(this.$tmplIds)
 				let p = {
 					type: this.form.type,
 					phone: this.form.phone,

+ 1 - 2
pages/material-download/createPoster.vue

@@ -49,8 +49,7 @@
 			let borderImg='/static/icon/border.png'
 			let shopDetail = this.$cache.get('selectedShop')
 			let text=shopDetail.name
-			
-			let qrCodeText = this.$global.QR_PATH + this.vuex_shopId
+			let qrCodeText = this.$global.QR_PATH + this.$crypto.encrypt(this.vuex_shopId)
 			console.log(text.length,"/************");
 			let titleParams={
 				x:w / 2 - (text.length/2 * 34),

+ 12 - 31
pages/member/add.vue

@@ -16,7 +16,7 @@
 				<u-form :model="form" ref="uForm" label-width="180" label-align="right">
 					<u-form-item label="积分兑率" :border-bottom="false">
 						<view class="margin-left-20">
-							<u-slider :min="1" height="10" v-model="value"  active-color="#EF9944" :use-slot="true" >
+							<u-slider :min="1" height="10" :max="30" v-model="value"  active-color="#EF9944" :use-slot="true" >
 								<view class="">
 									<view class="" >
 										<view class="badge-button">
@@ -26,27 +26,22 @@
 								</view>
 							</u-slider>
 						</view>
-					</u-form-item>
-					<u-form-item label="消费1元赠送" :border-bottom="false">
-						<view class="center" style="justify-content: flex-start;margin-left: 20rpx;">
-							<u-input type="digit" style="width: 90%;" height="60" :border="true" :clearable="false"
-								v-model="form.consumeOnePoint" placeholder="请输入积分数" />
-							<view class="cu-tag bg-color radius" style="height: 60rpx;">
-								积分
-							</view>
-						</view>
+						<text slot="right" style="margin-left: 30rpx;">%</text>
 					</u-form-item>
 				</u-form>
 			</view>
 			<view class="title" style="margin-top: 20rpx;">
-				<text class="bold">积分价值</text>
-				<text class="desc">1积分={{value / 100}}元</text>
+				<text class="bold">消费返利</text>
+				<text class="desc">消费1元赠送 {{pointsValue}} 元</text>
+			</view>
+			<view class="margin-top-20 text-sm text-red">
+				<text>系统风险阈值为0.3元</text>
 			</view>
 
-			<view class="desc" style="margin-top: 60rpx;" v-if="false">
+			<view class="desc" style="margin-top: 30rpx;" >
 				提示:消费返利赠送积分比例建议不超过30%,如超过30%需要另外
 				进行申请,审批通过后即可。
-				<text class="text-base">申请更高返利</text>
+				<text class="text-base" @click="$u.toast('暂未开放')">申请更高返利</text>
 				<text class="cuIcon-right text-base"></text>
 			</view>
 		</view>
@@ -60,17 +55,10 @@
 				<text>提交代表已同意</text>
 				<text style="color: #3099F1;">会员中心规则说明</text>
 			</view>
-			<view @click="confirmShow=true" class="cu-btn bg-color round" style="width: 70%;height: 90rpx;font-size: 36rpx;">
+			<view @click="submit" class="cu-btn bg-color round" style="width: 70%;height: 90rpx;font-size: 36rpx;">
 				提交
 			</view>
 		</view>
-		<u-modal :mask-close-able="true" v-model="confirmShow" @confirm="confirm" :confirm-text="isHigh?'重新设置':'确认'" confirm-color="#EF9944">
-			<view class="slot-content">
-				<text class="text-lg text-bold">消费1元赠送 {{form.consumeOnePoint}} 积分</text>
-				<text class="text-lg text-bold">积分折合 {{pointsValue}} 元</text>
-				<text v-if="isHigh" class="text-red margin-top-20 text-sm">*赠送积分价值高于系统风险阈值!</text>
-			</view>
-		</u-modal>
 		<u-select confirm-color="#EF9944" v-model="show" :list="list"></u-select>
 	</view>
 </template>
@@ -99,7 +87,7 @@
 					}
 				],
 				form:{
-					consumeOnePoint:'5'
+					consumeOnePoint:'1'
 				}
 			}
 		},
@@ -123,18 +111,11 @@
 			}
 		},
 		methods: {
-			confirm(){
+			submit(){
 				if (this.$isEmpty(this.form.consumeOnePoint)) {
 					this.$u.toast('请输入积分规则')
 					return
 				}
-				this.confirmShow=false
-				if (!this.isHigh) {
-					this.submit()
-				}
-			},
-			
-			submit(){
 				let id=this.vuex_shopId
 				let params={
 					id,

+ 8 - 0
pages/pay/pay-result.vue

@@ -11,12 +11,17 @@
 				确认
 			</view>
 		</view>
+		<read-text ref="readText"></read-text>
 	</view>
 </template>
 
 <script>
 	import socket from "@/utils/socket.js"
+	import readText from "@/components/read-text.vue"
 	export default {
+		components:{
+			readText
+		},
 		data() {
 			return {
 				//webSocket
@@ -120,6 +125,9 @@
 						desc:'已收款'+this.payAmount+'元',
 						icon:"/static/icon/pay-success.png"
 					}
+					let text='小程序收款'+this.payAmount+'元'
+					this.$refs.readText.read(text)
+					
 				}else if (type==2) {
 					this.payData={
 						payStatus:2,

+ 4 - 1
pages/pay/pay.vue

@@ -22,6 +22,7 @@
 
 <script>
 	import amountInput from '@/components/amountInput/amountInput.vue';
+	import crypto from '@/utils/crypto.js'
 	export default {
 		components: {
 			amountInput
@@ -45,8 +46,10 @@
 				uni.scanCode({
 					onlyFromCamera:true,
 				    success: function (res) {
+						//解密后的数据
+						let decryptResult=crypto.decrypt(res.result)
 						//用户id
-						let result=res.result.split(';')
+						let result=decryptResult.split(';')
 						_this.secret=result[0]
 						_this.userId=_this.secret.substr(0,19)
 						_this.channelId=result[1]

+ 0 - 1
pages/shop-info/shop-info.vue

@@ -1199,7 +1199,6 @@
 			},
 			async submit() {
 				let _this=this
-				await this.$mpi.subscribe(this.$tmplIds)
 
 				if (this.$isEmpty(this.auditForm.idCardFront)) {
 					this.$refs.toast.info('请上传身份证正面照')

+ 45 - 81
pages/test/test1.vue

@@ -1,90 +1,54 @@
 <template>
 	<view class="">
-		<view class="card">
-			<view class="top">
-				<view class="center">
-					<text class="cuIcon-time margin-right-10"></text>
-					<text style="color: #333333;">2021-10-18 14:36:43</text>
-				</view>
-				<text class="text-base">已付款</text>
-			</view>
-			<view class="content">
-				<scroll-view :scroll-x="true">
-					<image v-for="(item,index) in 8" :key="index" src="https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/f6a8c0cb362e47f5a8ec1b7831e21fc2-maltan.png" mode=""></image>
-				</scroll-view>
-			</view>
-			<view class="data">
-				<text style="font-size: 24rpx;color: #848484" class="price">共10件商品,合计:88</text>
-			</view>
-			
-			<view class="bottom">
-				<view class="cu-btn round line-base sm">
-					确认订单
-				</view>
-			</view>
-		</view>
+		
 	</view>
 </template>
 
 <script>
-export default {
-	name: '',
-	data() {
-		return {
-			
-		};
-	},
-	onLoad() {
-		
-	},
-	methods:{
-		
-	}
-};
-</script>
+	var plugin = requirePlugin("WechatSI")
+	let manager = plugin.getRecordRecognitionManager()
+	export default {
+		data() {
+			return {
+				
+			};
+		},
+		mounted() {
+			this.innerAudioContext = wx.createInnerAudioContext();
+			this.innerAudioContext.onError(function(res) {
+				uni.showToast({
+					title: '语音播放初始化失败',
+				})
+			})
+		},
+		methods: {
+			//阅读文字
+			readText(content) {
+				var that = this;
+				plugin.textToSpeech({
+					lang: "zh_CN",
+					tts: true,
+					content,
+					success: function(res) {
+						that.auidoSrc=res.filename
+						that.readStart();
+					},
+					fail: function(res) {
+						wx.showToast({
+							title: '语音转换失败',
+						})
+					}
+				})
+			},
+			readStart() {
+				this.innerAudioContext.src = this.auidoSrc //设置音频地址
+				this.innerAudioContext.play(); //播放音频
+			},
 
-<style>
-	page{
-		background-color: #f2f2f2;
-	}
-</style>
+		}
+	};
+</script>
 
 <style lang="scss" scoped>
-	.card{
-		border-radius: 20rpx;
-		padding: 15rpx;
-		background-color: #FFFFFF;
-		margin: 15rpx;
-		box-shadow: 10rpx 10rpx 10rpx #dedede;
-		
-		.top{
-			font-size: 28rpx;
-			padding:10rpx;
-			display: flex;
-			justify-content: space-between;
-			border-bottom: 1rpx dashed   #DDDDDD;
-		}
-		
-		.content{
-			white-space: nowrap;
-			padding: 20rpx 0;
-			image{
-				width: 120rpx;
-				height: 120rpx;
-				border-radius: 10rpx;
-				margin-right: 15rpx;
-			}
-		}
-		
-		.data{
-			display: flex;
-			justify-content: flex-end;
-		}
-		
-		.bottom{
-			padding-top: 30rpx;
-			display: flex;
-			justify-content: flex-end;
-		}
-	}
-</style>
+
+</style>

+ 14 - 1
pages/userBank/userBank.vue

@@ -8,7 +8,7 @@
 
 			<view class="top center" style="justify-content: flex-start;">
 				<view class="center margin-top-10">
-					<image :src="'/static/bank/'+'DEF'+'.png'"></image>
+					<image @error="error" :src="bankImg(item.bankCode)"></image>
 				</view>
 				<view class="">
 					<text class="bankType">{{item.bankName}}</text>
@@ -35,6 +35,7 @@
 	export default {
 		data() {
 			return {
+				imgError:false,
 				bankList: []
 			}
 		},
@@ -52,9 +53,21 @@
 				return data => {
 					return this.$getBankCodeType(data)
 				}
+			},
+			
+			bankImg(){
+				return (data)=>{
+					if (this.imgError) {
+						return '/static/icon/card1.png'
+					}
+					return '/static/bank/'+data+'.png'
+				}
 			}
 		},
 		methods: {
+			error(){
+				this.imgError=true
+			},
 			fetchCardList() {
 				let params = {
 					merchantNo: this.vuex_merchantNo

+ 1 - 0
pagesGoods/pages/menu/menu.vue

@@ -429,6 +429,7 @@
 			//商品属性begin
 			operateSku(goods) {
 				let params = {
+					price:goods.defaultPrice,
 					goodsName: goods.name,
 					goodsId: goods.id
 				}

+ 40 - 5
pagesGoods/pages/menu/sku.vue

@@ -4,7 +4,10 @@
 			<view class="" style="padding: 20rpx 30rpx;">
 				<u-form :model="form" ref="uForm" label-width="140">
 					<u-form-item label="商品名称">
-						<u-input v-model="form.goodsName" />
+						<u-input disabled v-model="form.goodsName" />
+					</u-form-item>
+					<u-form-item label="默认价格">
+						<text class="price">{{defaultPrice}}</text>
 					</u-form-item>
 					<u-form-item label="商品属性">
 						<u-input v-model="form.category" :select-open="goodsPropertyShow" type="select"
@@ -56,7 +59,7 @@
 
 
 		</view>
-		<view class="center" style="margin-top: 40rpx;">
+		<view class="center" style="margin: 40rpx 0 60rpx;">
 			<view @click="submit" class="cu-btn  flex  text-lg btn-bg-color radius"
 				style="padding: 46rpx 0;width: 90%;">
 				确认
@@ -74,6 +77,8 @@
 			return {
 				goodsPropertyShow: false,
 				goodsPropertyList: [],
+				
+				price:'',
 				form: {
 					shopId: '',
 					goodsName: '',
@@ -101,10 +106,21 @@
 					return true
 				}
 				return false
+			},
+			defaultPrice(){
+				if (this.form.category=='大小') {
+					let arr= this.inputList.filter(item=>item.isDefault)
+					if (this.$isEmpty(arr)) {
+						return this.price
+					}
+					return arr[0].rebasePrice
+				}
+				return this.price
 			}
 		},
 		onLoad(options) {
 			this.goodsPropertyList = this.$global.goodsPropertyList
+			this.price=options.price / 100
 			this.form.goodsName = options.goodsName
 			this.form.goodsId = options.goodsId
 			this.form.shopId = this.vuex_shopId
@@ -115,14 +131,25 @@
 				let params = {
 					goodsId: this.form.goodsId
 				}
+				if (this.$isNotEmpty(this.form.category)) {
+					params.category=this.form.category
+				}
 				let res=await this.$api.goodsProperty.list(params)
 				if (this.$isEmpty(res.data.records)) {
+					if (this.form.category=='加料') {
+						//除了加料其他全部必选
+						this.activeIndex=-1
+					}
+					this.resetInput()
 					return
 				}
 				this.isEdit=true
-				this.inputList = res.data.records
-				this.form.category = this.inputList[0].category
-				this.inputList.forEach(item => {
+				this.form.category = res.data.records[0].category
+				this.inputList = res.data.records.filter(item=>item.category == this.form.category)
+				this.inputList.forEach((item,index) => {
+					if (item.isDefault) {
+						this.activeIndex=index
+					}
 					if (this.$isNotEmpty(item.extraPrice)) {
 						item.extraPrice=item.extraPrice  / 100
 					}
@@ -134,6 +161,7 @@
 			},
 			propertyConfirm(e) {
 				this.form.category = e[0].value
+				this.fecthList()
 			},
 			delInput(index) {
 				let id=this.inputList[index].id
@@ -154,6 +182,13 @@
 					})
 				})
 			},
+			resetInput(){
+				this.inputList=[{
+					propertyOption: '',
+					extraPrice: '',
+					rebasePrice: '',
+				}]
+			},
 			addInput() {
 				let obj = {
 					rebasePrice:'',

二進制
static/icon/card1.png


+ 54 - 0
utils/crypto.js

@@ -0,0 +1,54 @@
+var CryptoJS = require("crypto-js");
+console.log(CryptoJS.HmacSHA1("Message", "Key"));
+
+let crypto = {}
+
+//前后端定义的密钥,AES使用16位
+const CRYPTOJS_KEY = "uAY9ugkHQpvozZeA";
+//签名key
+crypto.SIGN_KEY="uRJW6a2Qofpa3pGIdILc"
+// 加密
+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
+}
+
+
+//通过key排序后得到value
+crypto.objSort=(arys)=> { 
+	//先用Object内置类的keys方法获取要排序对象的属性名,再利用Array原型上的sort方法对获取的属性名进行排序,newkey是一个数组
+	var newkey = Object.keys(arys).sort();   
+	//console.log('newkey='+newkey);
+	var newStr = ""; //创建一个新的对象,用于存放排好序的键值对
+	for(var i = 0; i < newkey.length; i++) {
+		//遍历newkey数组
+		newStr=newStr + arys[newkey[i]]
+		//向新创建的对象中按照排好的顺序依次增加键值对
+
+	}
+	return newStr; //返回排好序的新对象
+}
+
+
+export default crypto

+ 1 - 1
utils/global.js

@@ -16,7 +16,7 @@ let global = {
 	},
 	
 	//商户收款码
-	QR_PATH:'https://ldt.guosen-fumao.cn/h5/#/pagesC/pages/checkstand/index?id=',
+	QR_PATH:'https://ldt.guosen-fumao.cn/h5/#/pagesC/pages/checkstand/index?data=',
 	//商家订餐码
 	ORDER_QR_PATH:'https://ldt.guosen-fumao.cn/wapp/menu',
 	

+ 2 - 2
utils/socket.js

@@ -1,5 +1,5 @@
-import  config from '@/assets/http/config.js'
-const baseSocketUrl=config.webSocketUrl
+import  setting from '@/assets/http/setting.js'
+const baseSocketUrl=setting.webSocketUrl
 class socket {
 	constructor(options) {
 		//用户id