2 Commits 9830ef1363 ... a00d4891c0

Author SHA1 Message Date
  hmp a00d4891c0 修改 4 years ago
  hmp d3eb7ba8b9 修改 4 years ago

+ 2 - 2
App.vue

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

+ 20 - 7
assets/http/global.js

@@ -1,14 +1,27 @@
 let global = {}
 
 
-// global.baseUrl = 'https://ldt.guosen-fumao.cn/api/'
-// global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
-// global.enabledCrypto = false
-
+// const application='prod'
+// const application='dev'
+const application='test'
+
+if (application == 'prod') {
+	//正式环境
+	global.baseUrl = 'https://ldt.guosen-fumao.cn/api/'
+	global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
+	global.enabledCrypto = false
+}else if (application == 'dev') {
+	//开发环境
+	global.baseUrl = 'http://192.168.1.168:2366/'
+	global.WebSocketUrl = 'ws://192.168.1.168:2366/websocket/'
+	global.enabledCrypto = true
+}else if (application == 'test') {
+	//测试环境
+	global.baseUrl = 'http://139.159.240.119:2366/'
+	global.WebSocketUrl = 'ws://139.159.240.119:2366/websocket/'
+	global.enabledCrypto = true
+}
 
-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'

+ 0 - 2
assets/http/service.js

@@ -1,8 +1,6 @@
 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
 

+ 2 - 2
components/channel-list.vue

@@ -3,7 +3,7 @@
 		<view v-if="$isNotEmpty(channel)" @click="channelShow=true" class="channel " style="width: 100%;">
 			<view class="left">
 				<view class="center">
-					<image :src="channel.channelLogo" mode=""></image>
+					<image :src="item.channelLogo?item.channelLogo:'/static/icon/channel.png'" mode=""></image>
 				</view>
 				<view class="content">
 					<text>{{channel.channelName}}</text>
@@ -22,7 +22,7 @@
 						请选择优先使用的渠道积分
 					</view>
 					<view @click="check(item)" v-for="(item,index) in channelList" :key="index" class="channel-item">
-						<image :src="item.channelLogo" mode=""></image>
+						<image :src="item.channelLogo?item.channelLogo:'/static/icon/channel.png'" mode=""></image>
 						<text class="margin-left-10">{{item.channelName}}(剩余 ¥ {{item.available}})</text>
 						<text v-if="channel.channelId==item.channelId" class="cuIcon-check checked"></text>
 					</view>

+ 5 - 0
package-lock.json

@@ -9,6 +9,11 @@
       "resolved": "https://registry.nlark.com/@dcloudio/types/download/@dcloudio/types-2.5.6.tgz",
       "integrity": "sha1-+6kMwEIOEj6rCeiV1brOsLc+uyE="
     },
+    "base-64": {
+      "version": "1.0.0",
+      "resolved": "https://registry.nlark.com/base-64/download/base-64-1.0.0.tgz",
+      "integrity": "sha1-CdDyCE4yo/0IwkdblzeI7uauj0o="
+    },
     "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",

+ 1 - 0
package.json

@@ -11,6 +11,7 @@
   "author": "",
   "license": "ISC",
   "dependencies": {
+    "base-64": "^1.0.0",
     "luch-request": "^3.0.6",
     "uview-ui": "^1.8.4"
   },

+ 5 - 3
pages/mine/mine.vue

@@ -8,7 +8,7 @@
 			<view class="card">
 				<view class="info" v-if="vuex_userId">
 					<view class="flex margin-right-20">
-						<image class="avatar" style="box-sizing: border-box;" :src="userInfo.avatar"></image>
+						<image class="avatar"  :src="userInfo.avatar"></image>
 						<view class="nickname">
 							<block style="display: flex;">
 								<text >{{userInfo.nickName}}</text>
@@ -19,13 +19,15 @@
 						</view>
 					</view>
 					<view class="center margin-right-10">
-						<view @click="$jump('/pagesA/pages/notice/notice?ids='+JSON.stringify(notReadList))" class="margin-right-20" style="position: relative;">
+						<view @click="$jump('/pagesA/pages/notice/notice?ids='+JSON.stringify(notReadList))" class="margin-right-20 center" 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 class="center">
+							<image @click="$jump('/pagesA/pages/setting/setting')" style="width: 52rpx;height: 52rpx;" src="../../static/icon/setting2.png" mode=""></image>
+						</view>
 					</view>
 				</view>
 				<view class="info" v-else>

+ 2 - 2
pages/order/comps/card.vue

@@ -4,9 +4,9 @@
 			<view class="top">
 				<view class="center" >
 					<view class="center">
-						<image  src="https://guosen-bucket-ldt.obs.cn-south-1.myhuaweicloud.com:443/5768ef4f6e09476197322fdc7bd8136b-nOG3xq9mqJJS66fe25d830cb43186cd2bc0470d24af6.jpg" mode=""></image>
+						<image  :src="item.shopPic" mode=""></image>
 					</view>
-					<text class="text-lg" style="color: #000;">杨国福麻辣烫</text>
+					<text class="text-lg" style="color: #000;">{{item.shopName}}</text>
 					<text class="cuIcon-right margin-left-10 text-df"></text>
 				</view>
 				<view class="center text-sm">

+ 1 - 0
pages/order/order.vue

@@ -31,6 +31,7 @@
 		},
 		methods: {
 			timeup(item){
+				return
 				let order = this.$u.deepClone(item)
 				order.payStatus = '取消付款'
 				order.orderStatus = '取消付款'

+ 23 - 4
pagesA/pages/notice/detail.vue

@@ -1,10 +1,16 @@
 <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 class="text-black  text-bold  title" style="font-size: 40rpx;">{{dataDetail.noticeManagementContent.title}}</view>
+		<view class="text-gray flex " style="padding: 0 0 30rpx 30rpx;">
+			<view class="center">
+				<text class="cuIcon-time padding-right-10"></text>
+				<text>{{dataDetail.createTime}}</text>
+			</view>
+			<view @click="jump" class="center margin-left-30">
+				<u-icon name="account" color="#b6b6b7"></u-icon>
+				<text class="padding-left-10">{{dataDetail.noticeManagementContent.sender}}</text>
+			</view>
 		</view>
 		<view class="content-view-box">
 			<view class="font-view">
@@ -33,7 +39,20 @@
 			 fetchDetail(){
 				 this.$api.notice.detail({id:this.id}).then(res=>{
 					 this.dataDetail=res.data
+					 this.dataDetail.content= decodeURIComponent(this.dataDetail.noticeManagementContent.content)
 				 })
+			 },
+			 jump(){
+				 if (this.dataDetail.senderType == 'SHOP') {
+				 	uni.navigateTo({
+				 		url:"/pages/consume/detail/shop-detail?id="+this.dataDetail.senderId
+				 	})
+				 }
+				 if (this.dataDetail.senderType == 'MALL') {
+				 	uni.navigateTo({
+				 		url:"/pages/activity/activity?id="+this.dataDetail.senderId
+				 	})
+				 }
 			 }
 		}
 	}

+ 4 - 3
pagesA/pages/notice/notice.vue

@@ -8,10 +8,10 @@
 					<view class="content-view">
 						<view class="flex">
 							<view class="center">
-								<text class=" text-lg text-cut" style="color: #000000;">{{item.title}}</text>
+								<text class=" text-lg text-cut" style="color: #000000;">{{item.noticeManagementContent.title}}</text>
 							</view>
 						</view>
-						<view class=" text-sm text-cut-2 subtitle">{{item.content | formatHtml}}</view>
+						<view class=" text-sm text-cut-2 subtitle">{{item.noticeManagementContent.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 ">
@@ -30,6 +30,7 @@
 </template>
 <script>
 	import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
+	import Base64 from 'base-64';
 	export default {
 		mixins: [MescrollMixin],
 		data() {
@@ -43,7 +44,7 @@
 		},
 		filters: {
 			formatHtml(str) {
-				return str.replace(/<[^>]+>/g, "");
+				return decodeURIComponent(str).replace(/<[^>]+>/g, "");
 			}
 		},
 		onLoad(options) {

+ 11 - 2
pagesC/pages/checkstand/pay-qrcode.vue

@@ -57,6 +57,7 @@
 		},
 		data() {
 			return {
+				isFirst:true,
 				id: '',
 				avatar: "",
 				nickName: '',
@@ -82,8 +83,11 @@
 					amountNum: 0,
 				}
 			}
-		},
+		},	
 		async onLoad(options) {
+			uni.setKeepScreenOn({
+			    keepScreenOn: true
+			});
 			let res = await this.$api.loginUser.detail({
 				id: this.vuex_userId
 			})
@@ -96,6 +100,11 @@
 			//获取用户ID
 			this.id = this.vuex_userId
 			//生成动态密码
+			if (this.isFirst) {
+				this.secret = totp.getSecret(this.id);
+				console.log(this.secret);
+			}
+			this.isFirst=false
 			this.refreshCode();
 		},
 		onUnload() {
@@ -151,7 +160,7 @@
 				this.timer = setInterval(() => {
 					this.secret = totp.getSecret(this.id);
 					console.log(this.secret);
-				}, 1000)
+				}, 10000)
 			},
 			getSecret(){
 				this.secret = totp.getSecret(this.id);

+ 1 - 1
pagesC/utils/totp.js

@@ -5,7 +5,7 @@ export default {
  getSecret: (str)=>{
   let secret = hotpOtpGenerator.totp({
          key: str,
-          X: 60,
+          X: 300,
        });
   return  secret.substr(secret.length-6,secret.length-1);
  }

BIN
static/icon/channel.png