Bladeren bron

用户体系优化V6.2.0

zhengjinyi 5 jaren geleden
bovenliggende
commit
a3921c4291

+ 3 - 8
App.vue

@@ -22,17 +22,13 @@
 		methods:{
 			getCheekeyCode(){// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
 				authorize.getCode('weixin').then(wechatcode =>{
-					// console.log(wechatcode);
 					// 根据微信的code获取用户登录状态:1已登录过 -1未登录过
 					userInfoLogin({code:wechatcode}).then(response =>{
-						this.isLogin = true;
-						this.login(response.data);
-						uni.setStorageSync('token',response.data.token)
 						uni.removeStorageSync('sessionid')
+						uni.setStorageSync('token',response.data.token)
 						uni.setStorageSync('sessionid','JSESSIONID='+response.data.sessionId)
 						this.$store.commit('updateStatus',response.data)
 					}).catch(response =>{
-						this.isLogin = false;
 						uni.removeStorageSync('sessionid')
 						uni.setStorageSync('sessionid','JSESSIONID='+response.data)
 						this.$store.commit('updateStatus',response.data)
@@ -41,9 +37,8 @@
 			},
 			refresh(){
 				let TIME = (20*60)*1000;
-				let self = this;
-				setInterval(function(){
-					self.getCheekeyCode()
+				setInterval(()=>{
+					this.getCheekeyCode()
 				},TIME)
 			}
 		},

+ 1 - 1
common/config/caimeiApi.js

@@ -137,7 +137,7 @@ const caimeiApi = {
 	// 获取用户是否登陆 1:已登陆,否则未登陆
 		return new Promise(function(resolve,reject) {
 			uni.getStorage({
-				key: 'user_key',
+				key: 'userInfo',
 				success: function (res){
 					if(res.data.code == '1'){
 						resolve(true);

+ 2 - 2
common/config/config.js

@@ -1,9 +1,9 @@
 let URL_CONFIG = ""
 if(process.env.NODE_ENV === 'development'){
     // 开发环境
-	URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
+	// URL_CONFIG = 'http://192.168.1.22:8008'	 //裴裴联调地址
 	// URL_CONFIG = 'http://192.168.1.24:8008'	 //俊俊联调地址
-    // URL_CONFIG = 'https://spi-b.caimei365.com'//采美测试地址
+    URL_CONFIG = 'https://spi-b.caimei365.com'//采美测试地址
 }else{
     // 生产环境
     URL_CONFIG = 'https://spi.caimei365.com'

+ 0 - 3
pages/goods/goods.vue

@@ -25,9 +25,6 @@
 			if(thisPage.refresh) {
 				this.setServerUrl(thisPage.listData);
 			}
-			this.$api.loginStatus().then((resolveData) => {
-				this.$refs.childList.loginStatus = resolveData;
-			});
 		},
 		onLoad(option) {
 			let self = this;

+ 1 - 4
pages/goods/product.vue

@@ -427,10 +427,8 @@
 			},
 			btnConfirm() {//加入购物车&&立即购买跳转订单页并关闭弹窗
 				if(this.isBtnType == 'add'){				
-					console.log(this.isBtnType)
 					this.getAddProductCart()				
 				}else{
-					console.log(this.number)
 					this.toConfirmation()
 				}
 			},
@@ -448,14 +446,13 @@
 				}, 200);
 			},
 			getAddProductCart(){//增加购物车成功和toast弹窗提示成功	
-				console.log(this.number)
 				shoppingAddCart({productID:this.productID,userID:this.userID,productCount:this.number}).then(response => {
 					this.specClass = 'hide';
 					this.$util.msg('加入购物车成功',1500,true,'success')
 					this.isAnimation = true
 					setTimeout(() => {this.specClass = 'none'}, 200)
 					setTimeout(() => {this.isAnimation = false},2000)
-					this.goodsData.cartCount = this.product;
+					this.goodsData.cartCount = response.data;
 				}).catch(response =>{
 					this.$util.msg(response.msg,2000);
 				})

+ 1 - 1
pages/tabBar/user/user.vue

@@ -213,7 +213,7 @@
 					this.$store.commit('updateAllNum',0)
 				}else{
 					this.$api.getStorage().then((resolve) =>{
-						console.log(resolve)
+						// console.log(resolve)
 						this.userID = resolve.userID
 						this.initData()
 						this.isShowNoLogin = false;

+ 2 - 1
pages/user/operator/list.vue

@@ -146,7 +146,8 @@
 				this.initOperatorList()
 			},
 			initOperatorList(){	
-				let params = {pageNum:this.pageNum,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
+				let params = {pageNum:1,pageSize:this.pageSize,linkName:this.linkman,mobile:this.clubMobile}
+				console.log('11111111111')
 				queryOperatorList(params).then(response =>{
 					let responseData = response.data
 					if(responseData.results&&responseData.results.length > 0){

+ 16 - 1
pages/user/order/create-order.vue

@@ -180,7 +180,21 @@
 					}
 					return {shopId:el.shopID,note:el.note,productInfo:productInfo}
 				})
-				let orderInvoice = Object.assign(this.invoiceData,'',{type:0})
+				let orderInvoice;
+				if(this.invoiceData != null){
+					orderInvoice= Object.assign(this.invoiceData,'',{type:0})
+				}else{
+					orderInvoice ={
+						type:0,
+						invoiceTitleType:'',
+						invoiceTitle:'',
+						corporationTaxNum:'',
+						registeredAddress:'',
+						registeredPhone:'',
+						bankAccountNo:'',
+						openBank:'',
+					}
+				}
 				let param = {
 						orderSource:6,
 						userId:this.userID,
@@ -265,6 +279,7 @@
 				let SelectData = uni.getStorageSync('selectAddress');
 				this.addressID = SelectData.addressID;
 				this.addressData = SelectData	
+				this.getPostage()
 			}else{
 				this.getAddressData()
 			}

+ 0 - 1
pages/user/order/order-list.vue

@@ -480,7 +480,6 @@
 		line-height: 80rpx;
 		font-size:$font-size-28;
 		color: $text-color;
-		font-weight: bold;
 	}
 
 	.active {

+ 60 - 71
pages/user/order/order-logistics.vue

@@ -60,7 +60,7 @@
 </template>
 
 <script>
-	// import logisticsRecord from '@/components/module/orderDetails/logisticsRecord'//物流信息
+	import { queryLogistics } from '@/api/order.js'
 	const thorui = require("@/components/clipboard/clipboard.thorui.js")
 	export default {
 		components:{
@@ -99,82 +99,71 @@
 				})
 			},
 			getData() {
-				let self = this;
-				self.$api.get('/order/logistics', {orderID: self.orderID},
-					response => {
-						const code = response.code;
-						if(code == 1) {
-							const resData = response.data;
-							// 添加订单列表信息
-							let orderListArr = [];
-							resData.forEach((item,index) => {
-								let logisticsArr = [],
-									companyList = [],
-									shopOrderList = item.shopOrderList,
-									logisticsInfos = item.logisticsInfos;
-								// 添加物流信息
-								if(logisticsInfos.length > 0) {
-									logisticsInfos.forEach((loItem,loIndex) => {
-										let newRouters = [];
-										logisticsArr.push({
-											expressname: loItem['logisticsCompanyName'],
-											expressNumber: loItem['nu'],
-											expressNewtime: loItem['deliveryTime'],
-											isOpen: false
-										})
-										if(loIndex == 0) {
-											logisticsArr[loIndex]['isOpen'] = true;
-										}
-										if(loItem.routers) {
-											loItem.routers.forEach((rItem,rIndex) => {
-												newRouters.push({
-													desc: rItem.desc,
-													time: self.$api.timestampToTime(rItem.time)
-												})
-											})
-											logisticsArr[loIndex]['expressRecord'] = [...newRouters];
-										} else {
-											logisticsArr[loIndex]['expressRecord'] = [];
-										}
-									})
+				queryLogistics({orderID: this.orderID}).then(response =>{
+					const resData = response.data;
+					// 添加订单列表信息
+					let orderListArr = [];
+					resData.forEach((item,index) => {
+						let logisticsArr = [],
+							companyList = [],
+							shopOrderList = item.shopOrderList,
+							logisticsInfos = item.logisticsInformationList;
+						// 添加物流信息
+						if(logisticsInfos.length > 0) {
+							logisticsInfos.forEach((loItem,loIndex) => {
+								let newRouters = [];
+								logisticsArr.push({
+									expressname: loItem['logisticsCompanyName'],
+									expressNumber: loItem['nu'],
+									expressNewtime: loItem['updateDate'],
+									isOpen: false
+								})
+								if(loIndex == 0) {
+									logisticsArr[loIndex]['isOpen'] = true;
 								}
-								
-								// 供应商信息
-								shopOrderList.forEach((shopItem,shopIndex) => {
-									let prosListArr = [],
-										cmLogisticsRecords = shopItem.cmLogisticsRecords;
-									// 商品信息
-									cmLogisticsRecords.forEach((prosItem,prosIndex) => {
-										prosListArr.push({
-											id: prosItem.organizeProductID,
-											name: prosItem.productName,
-											mainImage: prosItem.image,
-											number: prosItem.buyNum,
-											logNumber: prosItem.num
+								if(loItem.routers) {
+									loItem.routers.forEach((rItem,rIndex) => {
+										newRouters.push({
+											desc: rItem.desc,
+											time: this.$api.timestampToTime(rItem.time)
 										})
 									})
-									companyList.push({
-										shopLogo: shopItem.shopLogo,
-										name: shopItem.shopName,
-										showGoods: cmLogisticsRecords.length > 0,
-										productsList: [...prosListArr]
-									})
-								})
-								orderListArr.push({
-									logisticsData:  [...logisticsArr],
-									companyList: [...companyList]
+									logisticsArr[loIndex]['expressRecord'] = [...newRouters];
+								} else {
+									logisticsArr[loIndex]['expressRecord'] = [];
+								}
+							})
+						}
+						// 供应商信息
+						shopOrderList.forEach((shopItem,shopIndex) => {
+							let prosListArr = [],
+								cmLogisticsRecords = shopItem.logisticsRecordList;
+							// 商品信息
+							cmLogisticsRecords.forEach((prosItem,prosIndex) => {
+								prosListArr.push({
+									id: prosItem.organizeProductID,
+									name: prosItem.productName,
+									mainImage: prosItem.image,
+									number: prosItem.buyNum,
+									logNumber: prosItem.num
 								})
 							})
-							self.goodsList = [...orderListArr];
-						} else {
-							uni.showToast({
-								icon: 'none',
-								title: '网络错误,请稍后重试。',
-								duration: 3000
+							companyList.push({
+								shopLogo: shopItem.shopLogo,
+								name: shopItem.shopName,
+								showGoods: cmLogisticsRecords.length > 0,
+								productsList: [...prosListArr]
 							})
-						}
-					}
-				)
+						})
+						orderListArr.push({
+							logisticsData:  [...logisticsArr],
+							companyList: [...companyList]
+						})
+					})
+					this.goodsList = [...orderListArr];
+				}).catch(response =>{
+					this.$util.msg(response.msg,2000);
+				})
 			}
 		}
 	}

+ 2 - 3
store/index.js

@@ -8,7 +8,6 @@ const store = new Vuex.Store({
 	state: {
 		hasLogin: false,
 		userInfo: {},
-		user_key: {},
 		cartNumber:0,
 		isIphoneX:false
 	},
@@ -33,9 +32,9 @@ const store = new Vuex.Store({
 		updateStatus(state,provider){
 			let TIME = api.formatDate()
 			console.log(`${TIME}`,provider)
-			state.user_key = provider;
+			state.userInfo = provider;
 			uni.setStorage({//缓存用户登陆状态
-			    key: 'user_key',  
+			    key: 'userInfo',  
 			    data: provider  
 			}) 
 		},