瀏覽代碼

重新对接

lianghanqiang 4 年之前
父節點
當前提交
aaf43e745b
共有 7 個文件被更改,包括 83 次插入54 次删除
  1. 19 18
      assets/http/api.js
  2. 17 5
      assets/http/global.js
  3. 18 14
      pages/agent/pay.vue
  4. 18 7
      pages/checkstand/pay-qrcode.vue
  5. 4 4
      pages/mine/mine.vue
  6. 6 6
      pages/mine/myInfo.vue
  7. 1 0
      pages/mine/setting/question.vue

+ 19 - 18
assets/http/api.js

@@ -23,9 +23,9 @@ const activity = {
 
 //用户管理
 const loginUser={
-	detail:p => http.get('cyzh-ldt/loginuser/detail', {params:p}),
-	submit:p => http.post('cyzh-ldt/loginuser/submit', p),
-	login:p => http.post('cyzh-ldt/loginuser/login', p),
+	detail:p => http.get('ldt_user/loginuser/detail', {params:p}),
+	submit:p => http.post('ldt_user/loginuser/submit', p),
+	login:p => http.post('client/user/login', p),
 	payBefore:p => http.post('cyzh-ldt/loginuser/payBeforeNew', p),
 	payBeforeForNormal:p => http.post('cyzh-ldt/loginuser/payBeforeForNormal', p),
 	getBillrecordFromRedis:p => http.get('cyzh-ldt/loginuser/getBillrecordFromRedis', {params:p}),
@@ -34,35 +34,35 @@ const loginUser={
 
 //商户管理
 const shop={
-	list:p => http.get('cyzh-ldt/shop/list', {params:p}),
-	detail:p => http.get('cyzh-ldt/shop/detail', {params:p}),
+	list:p => http.get('ldt_shop/shop/list', {params:p}),
+		detail:p => http.get('ldt_shop/shop/detail', {params:p}),
 }
 
 //商场管理
 const mall={
 	//获取商场列表
-	list:p => http.get('cyzh-ldt/mall/list',{params:p}),
+	list:p => http.get('ldt_mall/mall/list',{params:p}),
 }
 
 //代理商
 const agenter={
-	list:p => http.get('cyzh-ldt/agenter/list',{params:p}),
-	submit:p => http.post('cyzh-ldt/agenter/submit', p),
+	list:p => http.get('ldt_agent/agentrecord/list',{params:p}),
+	submit:p => http.post('ldt_agent/agentrecord/submit', p),
 }
 
 //代理类型
 const agenterType={
-	detail:p => http.get('cyzh-ldt/agentertype/detail',{params:p}),
+	detail:p => http.get('ldt_platform/platformsetting/detail',{params:p}),
 }
 
 
 //用户银行
 const userBank={
-	detail:p => http.get('cyzh-ldt/userbank/detail',{params:p}),
-	list:p => http.get('cyzh-ldt/userbank/list',{params:p}),
-	appList:p => http.get('cyzh-ldt/userbank/appList',{params:p}),
-	submit:p => http.post('cyzh-ldt/userbank/submit', p),
-	remove:p => http.post('cyzh-ldt/userbank/remove?ids='+p),
+	detail:p => http.get('ldt_user/userbank/detail',{params:p}),
+	list:p => http.get('ldt_user/userbank/list',{params:p}),
+	appList:p => http.get('ldt_user/userbank/appList',{params:p}),
+	submit:p => http.post('ldt_user/userbank/submit', p),
+	remove:p => http.post('ldt_user/userbank/remove?ids='+p),
 }
 
 //支付
@@ -76,12 +76,13 @@ const pay={
 }
 
 const billRecord={
-	submit:p => http.post('cyzh-ldt/billrecord/submit', p),
-	detail:p => http.get('cyzh-ldt/billrecord/detail', {params:p}),
+	addAgentOrder: p => http.post('/app/agent/addAgentOrder',p),
+	submit:p => http.post('ldt_bills/bills/submit', p),
+	detail:p => http.get('ldt_bills/bills/detail', {params:p}),
 }
 
 const setting = {
-	feedback: p => http.post('feedback/submit', p)
+	feedback: p => http.post('ldt_feedback/feedback/submit', p)
 }
 
 const account = {
@@ -91,7 +92,7 @@ const account = {
 
 //webSocket
 const webSocket={
-	sendInfo:p => http.post('cyzh-ldt/webSocket/sendInfo',p),
+	sendInfo:p => http.post('/webSocket/sendInfo',p),
 }
 
 

+ 17 - 5
assets/http/global.js

@@ -1,16 +1,28 @@
 let global = {}
 
 // global.baseUrl='http://192.168.1.244:1888/api/'
-global.baseUrl='https://ldt.guosen-fumao.cn/api/'
+// global.baseUrl='https://ldt.guosen-fumao.cn/api/'
 
-// global.baseUrl='http://localhost:2539/'
+global.baseUrl='http://localhost:2366/'
 
-global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
+// global.WebSocketUrl='wss://ldt.guosen-fumao.cn/websocket/'
+global.WebSocketUrl='ws://localhost:2366/websocket/'
 
-global.tokenUrl=global.baseUrl+ 'blade-auth/oauth/token?tenantId=000000&password=f67e0b29283bb804f96e28f43ddce79f&username=admin'
+global.tokenUrl=global.baseUrl+ 'blade-auth/oauth/token?tenantId=000000&password=21232f297a57a5a743894a0e4a801fc3&username=admin'
 
-global.agenterTypeId='1423464045809364994'
+// global.agenterTypeId='1423464045809364994'
+global.agenterTypeId='agent_channel_setting'
 
+global.paymentScene={
+	SCAN_CODE:'SCAN_CODE',
+	TRANSFER:'TRANSFER',
+	PAY_CODE:'PAY_CODE',
+	MINI_PROGRAM:'MINI_PROGRAM'
+}
+
+global.paymentType={
+	YEE_PAY: "YEE_PAY"
+}
 global.orderType={
 	USER_PAY:'USER_PAY',
 	AGENT_CHARGE:'AGENT_CHARGE',

+ 18 - 14
pages/agent/pay.vue

@@ -58,32 +58,36 @@
 		},
 		methods: {
 			fetchDetail(){
-				this.$api.agenterType.detail({id:this.$global.agenterTypeId}).then(res=>{
-					this.detail=res.data
+				this.$api.agenterType.detail({settingKey:this.$global.agenterTypeId}).then(res=>{
+					this.detail=JSON.parse(res.data.settingValue)
 				})
 			},
 			change(index) {
 				this.current = index;
 			},
 			async pay() {
-				let expireTime= this.$dateTime.getExpireTime(5)
+				let exTime= this.$dateTime.getExpireTime(5)
 				let billRecord={
-					appId:this.$global.wxParams.APPID,
-					openId:this.$cache.get('userInfo').openId,
-					userId:this.vuex_userId,
-					price:this.detail.cost,
-					type:this.$global.orderType.AGENT_CHARGE,
-					payAmount:this.detail.cost,
-					billsTitle:'渠道合伙人充值',
-					expireTime
+						appid:this.$global.wxParams.APPID,
+						openid:this.$cache.get('userInfo').openId,
+						payId:this.vuex_userId,
+						price:this.detail.cost,
+						channel: this.$global.paymentType.YEE_PAY,
+						payway: this.$global.paymentScene.MINI_PROGRAM,
+						cost:this.detail.cost,
+						discount: 1.00,
+						type:this.$global.orderType.AGENT_CHARGE,
+						// payAmount:this.detail.cost,
+						title:'渠道合伙人充值',
+						exTime
 				}
-				let resp=await this.$api.billRecord.submit(billRecord)
-				if (this.$isEmpty(resp.data)) {
+				let resp=await this.$api.billRecord.addAgentOrder(billRecord)
+				if (!resp.success) {
 					return
 				}
 				let params={
 					orderType:this.$global.orderType.AGENT_CHARGE,
-					orderId:resp.data,
+					orderId: resp.data.id,
 					payStatus:this.$global.payStatus.IS_WAIT
 				}
 				let res=await this.$api.pay.payOrder(params)

+ 18 - 7
pages/checkstand/pay-qrcode.vue

@@ -68,7 +68,7 @@
 			this.nickName=res.data.nickName
 			// this.avatar =(await  this.initAvatat(res.data.avatar)).tempFilePath;
 			//清除缓存
-			await this.clearBillRecordCache()
+			// await this.clearBillRecordCache()
 			//连接websocket
 			this.onSocketOpen()
 		},
@@ -81,9 +81,9 @@
 		onUnload() {
 			this.handelOut()
 		},
-		beforeDestroy() {
-			this.handelOut()
-		},
+		// beforeDestroy() {
+		// 	this.handelOut()
+		// },
 		methods: {
 			handelOut(){
 				uni.hideLoading()
@@ -93,17 +93,27 @@
 			},
 			// 启动webSocket
 			onSocketOpen() {
-				this.webSocket=new socket({
+				this.webSocket= new socket({
 					sid:this.vuex_userId
 				})
 				this.webSocket.init(()=>{
 					console.log("启动成功");
 					//连接成功,清除轮询
-					clearInterval(this.timerBillRecords)
+					// clearInterval(this.timerBillRecords)
 				});
 				this.webSocket.error = ()=>{
 					//连接失败就轮询查询订单
-					 this.timerBillRecords =  setInterval(this.queryBillRecords,5000);
+					 // this.timerBillRecords =  setInterval(this.queryBillRecords,5000);
+					 this.webSocket.closeSocket();
+					 uni.showModal({
+					 	    content: '网络异常',
+							showCancel: false,
+					 	    success:  (res) => {
+								uni.navigateBack({
+								    delta: 1
+								});
+							}
+					 })
 				}
 				this.webSocket.acceptMessage=(res)=>{
 					console.log(res.content);
@@ -117,6 +127,7 @@
 			refreshCode() {
 				this.timer = setInterval(() => {
 					this.secret = totp.getSecret(this.id);
+					console.log(this.secret);
 				}, 1000)
 			},
 			async initAvatat(url) {

+ 4 - 4
pages/mine/mine.vue

@@ -61,13 +61,13 @@
 			<text class="title">我的账户</text>
 			
 			<view class="menu">
-				<view class="item" @click="jump('/pages/mine/my-points/my-points?point='+userInfo.pointValue)">
-					<text>{{userInfo.pointValue || 0}}</text>
+				<view class="item" @click="jump('/pages/mine/my-points/my-points?point='+userInfo.channelPoint)">
+					<text>{{userInfo.channelPoint || 0}}</text>
 					通兑积分
 				</view>
 				
-				<view class="item" @click="jump('/pages/mine/my-balance/my-balance?pointValue='+userInfo.pointValue)">
-					<text>{{userInfo.pointValue || 0}}</text>
+				<view class="item" @click="jump('/pages/mine/my-balance/my-balance?pointValue='+userInfo.balance)">
+					<text>{{userInfo.balance || 0}}</text>
 					积分余额
 				</view>
 			</view>

+ 6 - 6
pages/mine/myInfo.vue

@@ -34,7 +34,7 @@
 			<view class="flex padding justify-between align-center" @click="calendarShow = true">
 				<view class="title">生日</view>
 				<view class="center">
-					<u-input @click="calendarShow=true" disabled v-model="userData.birthday" :clearable="false" inputAlign="right" placeholder="请填写生日"></u-input>
+					<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>
 				</view>
@@ -84,9 +84,9 @@
 			getUserInfo() {
 				this.$api.loginUser.detail({id: this.vuex_userId}).then(res => {
 					this.userData = res.data;
-					if (res.gender == 1) {
+					if (this.userData.sex == 1) {
 						this.sex = '男';
-					} else if (res.gender == 2) {
+					} else if (this.userData.sex == 2) {
 						this.sex = "女";
 					} else {
 						this.sex = "未知"; 
@@ -98,7 +98,7 @@
 				this.sex = this.actionSheetList[index].text;
 			},
 			change(e) {
-				this.userData.birthday = e.result;
+				this.userData.birth = e.result;
 			},
 			async upload() {
 				let resp = await this.$mpi.chooseImage()
@@ -123,9 +123,9 @@
 					let data = {
 						id: this.userData.id,
 						nickName: this.userData.nickName,
-						gender: this.sex == '男' ? 1 : this.sex == '女' ? 2 : 0,
+						sex: this.sex == '男' ? 1 : this.sex == '女' ? 2 : 0,
 						phone: this.userData.phone,
-						birthday: this.userData.birthday,
+						birth: this.userData.birth,
 						avatar: this.userData.avatar
 					}
 					this.$api.loginUser.submit(data).then(res => {

+ 1 - 0
pages/mine/setting/question.vue

@@ -74,6 +74,7 @@
 
 				let p = {
 					type: 1,
+					userId: this.vuex_userId,
 					content: this.form.content,
 					pics: this.imgList.length > 0 ? this.imgList.join(",") : '',
 					phone: this.form.phone,