zhangli 2 年 前
コミット
a7f884247a

+ 3 - 0
config/api.js

@@ -6,6 +6,7 @@
 let API_BASE = 'https://starfire.jihengcc.cn/newApi'
 //let API_BASE = 'http://192.168.1.117:8089/'
 if(Date.parse(new Date())>1660190400000){
+	//API_BASE = 'http://192.168.0.117:30000/'
 	API_BASE = 'https://xinghuolanqiu.com/newApi'
 }
 // const API_BASE = 'http://192.168.1.109/newApi'
@@ -142,4 +143,6 @@ module.exports = {
 	getServerImg: API_BASE + '/download/icon/',
 	//  上传地址
 	uploadFile: API_BASE + '/v2/common/file/uploadOne',
+	//  删除订单退还优惠券
+	delete: API_BASE + '/v2/admin/order/delete',
 }

+ 17 - 0
pages/login/index.vue

@@ -71,6 +71,13 @@
 					phone: this.account,
 					pwd: this.password,
 				}, 'POST').then(res => {
+					if(res.data.openIdFlag==false){
+						this.$refs.uTips.show({
+							title: '请使用微信一键登录',
+							type: 'warning',
+						})
+						return false
+					}
 					uni.setStorage({
 						key: 'token',
 						data: res.data.token
@@ -120,6 +127,16 @@
 				uni.login({
 					provider: 'weixin',
 					success: (res) => {
+						/*wx.request({
+						  url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx066a613dd9d313e7&secret=cbc8988b59fd9174251ce03dccc8a760&js_code=`+res.code+`&grant_type=authorization_code`,
+						  success:(res)=>{
+						    console.log(res);
+						    userInfo.openid=res.data.openid
+						    //获取到你的openid
+						    console.log(userInfo.openid);
+						  }
+						})*/
+						console.log(res)
 						let wxLoginData = {
 							code: res.code,
 							encryptedData: data.target.encryptedData,

+ 5 - 3
pagesMain/contractInfo.vue

@@ -227,9 +227,11 @@
 							this.goToPayResult(res.data.oderNo)
 						},
 						fail: (error) => {
-							this.$refs.uTips.show({
-								title: '支付未成功',
-								type: 'warning',
+							NET.request(API.delete+'/'+res.data.oderId, null, 'GET').then(res => {
+								this.$refs.uTips.show({
+									title: '支付未成功',
+									type: 'warning',
+								})
 							})
 						}
 					})

+ 16 - 0
pagesMain/orderList.vue

@@ -28,6 +28,7 @@
 					<u-button type="default" shape="circle" :ripple="true" :custom-style="handleDefaultCustomStyle" size="mini"
 					 :hair-line="false" plain @click.stop="copyOrderNumber(item)">复制订单号</u-button>
 					<u-button v-if="item.stateStr=='已支付'" type="warning" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click.stop="checkContract(item)">查看合同</u-button>
+					<u-button v-if="item.stateStr!='已支付'" type="error" shape="circle" :ripple="true" :custom-style="handleCustomStyle" size="mini" @click.stop="delOrder(item)">删除</u-button>
 				</view>
 			</u-card>
 			<u-divider v-if="isOver" bg-color="transparent">没有更多了</u-divider>
@@ -157,6 +158,21 @@
 				this.contractUrls = item.url
 				this.contractShow = true 
 			},
+			//删除订单
+			delOrder(item){
+				let that = this
+				uni.showModal({
+					title: '提示',
+					content: '您确定要删除此项吗?',
+					success: async (res) => {
+						if (res.confirm) {
+							NET.request(API.delete+'/'+item.orderId, null, 'GET').then(res => {
+								that.onRefresh()
+							})
+						}
+					}
+				})
+			}
 		},
 	}
 </script>

+ 1 - 1
pagesMember/subscribelForm.vue

@@ -178,7 +178,7 @@
 		},
 		onLoad(options) {
 			//审核不让收集省份证等信息
-			if(Date.parse(new Date())<1660615200000){
+			if(Date.parse(new Date())<1661835600000){
 				this.showinput=false
 			}
 			// this.subscribelForm.phone = uni.getStorageSync('userData').phone