Explorar o código

修改禅道问题

Qukatie hai 3 semanas
pai
achega
e1f65f1528

+ 2 - 2
common/setting.js

@@ -9,8 +9,8 @@ module.exports = {
 	// 版本号
 	version: '1.0.0',
 	// 开发环境接口Url
-	// devUrl: 'https://b2b.gubersail.com:9000/api',
-	devUrl: 'http://192.168.8.118:1080',
+	devUrl: 'https://b2b.gubersail.com:9000/api',
+	// devUrl: 'http://192.168.8.118:1080',
 	// 线上环境接口Url
 	// prodUrl: 'http://192.168.8.118:1080',
 	prodUrl: 'https://b2b.gubersail.com:9000/api',

+ 12 - 7
http/api.js

@@ -10,6 +10,7 @@ import {
 } from '@/utils/base64.js';
 import Request from '@/utils/luch-request/index.js';
 const http = new Request(options);
+let isTokenExpired = false;
 // 检查网络状态函数
 const checkNetworkStatus = () => {
 	return new Promise((resolve, reject) => {
@@ -109,14 +110,24 @@ http.interceptors.response.use((response) => {
 	}
 	return response.data;
 }, (response) => {
+	if (response.statusCode === 0 || !response.statusCode) {
+		uni.showToast({
+			title: '网络连接中断,请检查网络设置',
+			icon: 'none',
+			duration: 3000
+		});
+		return Promise.reject(response);
+	}
 	/*  对响应错误做点什么 (statusCode !== 200)*/
-	if (response.data.code === 401) {
+	if (response.data.code === 401&& !isTokenExpired) {
+		 isTokenExpired = true;
 		uni.showModal({
 			title: '提示',
 			content: '登录状态失效,点击确定重新登录',
 			showCancel: false,
 			success: function(res) {
 				if (res.confirm) {
+					 isTokenExpired = false;
 					uni.reLaunch({
 						url: '/pages/login/index'
 					});
@@ -151,12 +162,6 @@ http.interceptors.response.use((response) => {
 			icon: 'none'
 		});
 	}
-	if (response.statusCode === 0) { // 网络中断状态码
-		uni.showToast({
-			title: '网络连接中断,请检查网络设置',
-			icon: 'none'
-		});
-	}
 	return Promise.reject(response.data)
 })
 export default http;

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
     "name" : "库比森轮胎",
     "appid" : "__UNI__421BF74",
     "description" : "",
-    "versionName" : "1.0.16",
-    "versionCode" : 1016,
+    "versionName" : "1.0.17",
+    "versionCode" : 1017,
     "transformPx" : false,
     "plus" : {
         "distribute" : {

+ 22 - 10
pages/activity/index.vue

@@ -1,8 +1,7 @@
 <template>
 	<view class="widthBox">
 		<view v-for="item in data" :key="item.id" @click.stop="jumpDetails(item)">
-			<image :src="item.url"
-				style="width: 100%;height: 350rpx;border-radius: 10rpx;" mode="scaleToFill">
+			<image :src="item.url" style="width: 100%;height: 350rpx;border-radius: 10rpx;" mode="scaleToFill">
 			</image>
 		</view>
 		<u-empty v-if="data.length == 0" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" />
@@ -57,10 +56,16 @@
 			getBadge() {
 				shoppingCartList().then(res => {
 					let num = res.data.length
-					uni.setTabBarBadge({
-						index: 3, // tabIndex,tabBar的哪一项,从0开始
-						text: num.toString() // 显示的文本,超过 99 显示成 “…”
-					})
+					if (num) {
+						uni.setTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+							text: num.toString() // 显示的文本,超过 99 显示成 “…”
+						})
+					} else {
+						uni.removeTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+						})
+					}
 				})
 			},
 			// getUpdate() {
@@ -112,10 +117,17 @@
 					if (this.data.length == res.data.total) {
 						this.status = 'nomore'
 					}
-					uni.setTabBarBadge({
-						index: 1, // tabIndex,tabBar的哪一项,从0开始
-						text: res.data.total.toString() // 显示的文本,超过 99 显示成 “…”
-					})
+					if (res.data.total) {
+						uni.setTabBarBadge({
+							index: 1, // tabIndex,tabBar的哪一项,从0开始
+							text: res.data.total.toString() // 显示的文本,超过 99 显示成 “…”
+						})
+					} else {
+						uni.removeTabBarBadge({
+							index: 1, // tabIndex,tabBar的哪一项,从0开始
+						})
+					}
+
 					uni.hideLoading();
 				}).catch(err => {
 					uni.hideLoading();

+ 19 - 11
pages/goods/index.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="container">
 		<view style="background-color: #03803B;">
-			<uni-search-bar bgColor="#fff" v-model="name" placeholder="请输入综合查询" @confirm="custom"
-				@clear="custom" :radius="100" cancelButton="none">
+			<uni-search-bar bgColor="#fff" v-model="name" placeholder="请输入综合查询" @confirm="custom" @clear="custom"
+				:radius="100" cancelButton="none">
 			</uni-search-bar>
 		</view>
 		<view class="recentSearches" v-if="recentSearches.length != 0">
@@ -31,7 +31,8 @@
 				</u-tag>
 			</view>
 			<view style="margin:0 6rpx;">
-				<u-tag text="品牌" :bgColor="search.brandId?'#03803B':'#fff'" borderColor='#03803B' :color="search.brandId?'#fff':'#03803B'" @click="openBrand" size="mini">
+				<u-tag text="品牌" :bgColor="search.brandId?'#03803B':'#fff'" borderColor='#03803B'
+					:color="search.brandId?'#fff':'#03803B'" @click="openBrand" size="mini">
 				</u-tag>
 			</view>
 			<view style="margin:0 6rpx;width: 2rpx;height: 43rpx;background: #03803B;border-radius: 1rpx;"></view>
@@ -144,7 +145,7 @@
 	} from '@/api/home/index.js'
 	import {
 		isProcurement
-	} from '@/api/goods/index.js'	
+	} from '@/api/goods/index.js'
 	import {
 		shoppingCartList
 	} from '@/api/shoppingCart/index.js'
@@ -183,7 +184,7 @@
 				},
 				search: {
 					whether: '0',
-					brandId:null,
+					brandId: null,
 				},
 				checkStatus: null,
 				recentSearches: [], // 搜索数据
@@ -228,7 +229,7 @@
 					})
 				}
 			})
-			
+
 			this.getBadge()
 			// 获取最近搜索数据
 			if (uni.getStorageSync('recentSearches')) {
@@ -239,10 +240,16 @@
 			getBadge() {
 				shoppingCartList().then(res => {
 					let num = res.data.length
-					uni.setTabBarBadge({
-						index: 3, // tabIndex,tabBar的哪一项,从0开始
-						text: num.toString() // 显示的文本,超过 99 显示成 “…”
-					})
+					if (num) {
+						uni.setTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+							text: num.toString() // 显示的文本,超过 99 显示成 “…”
+						})
+					} else {
+						uni.removeTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+						})
+					}
 				})
 			},
 			opensalesman() {
@@ -308,7 +315,7 @@
 				this.checkboxValue = []
 				this.search = {
 					whether: '0',
-					brandId:null
+					brandId: null
 				}
 				this.$refs.paging.reload()
 			},
@@ -577,6 +584,7 @@
 			position: relative;
 			top: 6rpx;
 			height: 36rpx;
+
 			.cardKc {
 				text-align: center;
 				position: absolute;

+ 0 - 2
pages/home/claim/details.vue

@@ -180,7 +180,6 @@
 					value: 'code',
 					children: 'children'
 				},
-				addressData: [],
 				labelList: [],
 				corpsTypeList: [],
 				storeAttributesList: [],
@@ -189,7 +188,6 @@
 			}
 		},
 		onLoad(option) {
-			this.addressData = JSON.parse(uni.getStorageSync("addressData"))
 			if (option && option.id) {
 				this.getDetail(option.id)
 			}

+ 17 - 9
pages/home/index.vue

@@ -213,11 +213,6 @@
 			}
 		},
 		onLoad() {
-			if (uni.getStorageSync('accessToken')) {
-				this.getAddressdata()
-			}
-			// this.getbrandDescList()
-
 			this.page = {
 				total: 0,
 				size: 10,
@@ -266,10 +261,17 @@
 				// })
 				shoppingCartList().then(res => {
 					let num = res.data.length
-					uni.setTabBarBadge({
-						index: 3, // tabIndex,tabBar的哪一项,从0开始
-						text: num.toString() // 显示的文本,超过 99 显示成 “…”
-					})
+					if (num) {
+						uni.setTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+							text: num.toString() // 显示的文本,超过 99 显示成 “…”
+						})
+					} else {
+						uni.removeTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+						})
+					}
+
 				})
 			},
 			getbrandDescList() {
@@ -449,6 +451,11 @@
 			},
 			allClick(name) {
 				this.$u.api.isDisable()
+				if (name == '新建注册') {
+					uni.navigateTo({
+						url: '/pages/home/insurance/details'
+					});
+				}
 				if (name == '轮胎保注册') {
 					uni.navigateTo({
 						url: '/pages/home/insurance/index'
@@ -538,6 +545,7 @@
 				flex-direction: column;
 				align-items: center;
 				padding: 20rpx 0;
+
 				.uni-grid-item__box {
 					justify-content: center;
 				}

+ 1 - 7
pages/home/insurance/details.vue

@@ -31,12 +31,8 @@
 						placeholder-class="placeholder-right" placeholder="请输入内容" :inputBorder="false"
 						:disabled="form.status>0" :clearable="false"></uni-easyinput>
 				</uni-forms-item> -->
-				<uni-forms-item name="vehicleNumber" label="车牌号">
+				<uni-forms-item name="vehicleNumber" label="车牌号" required>
 					<view style="display: flex;align-items: center;">
-						<!-- <uni-easyinput v-model="form.vehicleNumber" class="right-align"
-							placeholder-class="placeholder-right" placeholder="请输入车牌号" :inputBorder="false"
-							:disabled="form.status>0" :clearable="false" @change="carNoVerify"
-							maxlength="8"></uni-easyinput> -->
 						<view style="display: flex;align-items: center;height: 36px;width: 100%;">
 							<view @click="handleInputFocus()" style="width: 100%;text-align: right;padding: 0 20rpx;"
 								:style="form.vehicleNumber?'color:#000;':'color:#B5B4B4;font-size: 24rpx;'">
@@ -267,7 +263,6 @@
 					value: 'code',
 					children: 'children'
 				},
-				addressData: [],
 				labelList: [],
 				corpsTypeList: [],
 				storeAttributesList: [],
@@ -280,7 +275,6 @@
 			}
 		},
 		onLoad(option) {
-			this.addressData = JSON.parse(uni.getStorageSync("addressData"))
 			if (option && option.id) {
 				this.getDetail(option.id)
 			} else {

+ 18 - 20
pages/me/index.vue

@@ -8,7 +8,7 @@
 					</image>
 				</view>
 				<view style="color:#fff;margin-left: 13rpx;font-size: 30rpx;font-weight: 500;">
-					{{userData.user_name?userData.user_name:''}}
+					{{shopInfo.cname?shopInfo.cname:''}}
 				</view>
 			</view>
 		</view>
@@ -68,7 +68,7 @@
 				</u-cell>
 			</u-cell-group>
 			<view style="display: flex;justify-content: space-around;">
-<!--				<view style="display: flex;flex-direction:column;align-items: center;" @click="obligationBtn('待付款')">
+				<!--				<view style="display: flex;flex-direction:column;align-items: center;" @click="obligationBtn('待付款')">
 					<image src="/static/images/me/280@2x(1).png" style="width:81rpx;height: 81rpx;" mode="scaleToFill">
 					</image>
 					<view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">待付款</view>
@@ -136,6 +136,9 @@
 </template>
 
 <script>
+	import {
+		getAppDetails
+	} from '@/api/home/store.js'
 	export default {
 		data() {
 			return {
@@ -145,24 +148,19 @@
 				badgeList: [],
 				form: {},
 				adminShow: false,
+				shopInfo: {}
 			}
 		},
 		onShow() {
 			this.$u.api.isDisable()
 			this.getUpdate()
-			this.getUserData()
+			this.getAppDetails()
 		},
 		methods: {
-			getUserData() {
-				// details().then(res => {
-				// 	this.userData = res.data
-				// 	corpPointsDetail({
-				// 		corpId: res.data.id
-				// 	}).then(e => {
-				// 		this.form = e.data
-				// 		this.form.recoveredBalance = res.data.recoveredBalance
-				// 	})
-				// })
+			getAppDetails() {
+				getAppDetails().then(res => {
+					this.shopInfo = res.data
+				})
 			},
 			showActionSheet() {
 				if (this.userData.checkStatus != '通过') {
@@ -289,32 +287,32 @@
 				this.$u.route('/pages/me/setting/index');
 			},
 			allClick(name) {
-				if (name == '我的订单'){
+				if (name == '我的订单') {
 					uni.navigateTo({
 						url: '/pages/me/myOrder',
 					});
 				}
-				if(name=='待发货'){
+				if (name == '待发货') {
 					uni.navigateTo({
 						url: '/pages/me/myOrder?xcxStatus=待发货&current=1',
 					});
 				}
-				if(name=='待收货'){
+				if (name == '待收货') {
 					uni.navigateTo({
 						url: '/pages/me/myOrder?xcxStatus=待收货&current=2',
 					});
 				}
-				if(name=='已收货'){
+				if (name == '已收货') {
 					uni.navigateTo({
 						url: '/pages/me/myOrder?xcxStatus=已收货&current=3',
 					});
 				}
-				if(name=='退款售后'){
+				if (name == '退款售后') {
 					uni.navigateTo({
 						url: '/pages/me/myOrder?xcxStatus=退款请核,退款中,已取消&current=4',
 					});
 				}
-				if(name=='个人资料'){
+				if (name == '个人资料') {
 					uni.navigateTo({
 						url: '/pages/me/myInfo',
 					});
@@ -479,4 +477,4 @@
 			color: #797979;
 		}
 	}
-</style>
+</style>

+ 10 - 43
pages/shoppingCart/index.vue

@@ -161,17 +161,6 @@
 			this.getTabbarHeight()
 		},
 		onShow() {
-			this.getUpdate()
-			// activityList({
-			// 	current: 1,
-			// 	size: 10,
-			// 	status: 1
-			// }).then(res => {
-			// 	uni.setTabBarBadge({
-			// 		index: 1, // tabIndex,tabBar的哪一项,从0开始
-			// 		text: res.data.total.toString() // 显示的文本,超过 99 显示成 “…”
-			// 	})
-			// })
 			// 获取审核状态
 			details().then(res => {
 				this.checkStatus = res.data.checkStatus
@@ -203,34 +192,6 @@
 				// #endif
 
 			},
-			getUpdate() {
-				const updateManager = uni.getUpdateManager();
-				updateManager.onCheckForUpdate(function(res) {
-					// 请求完新版本信息的回调
-					if (res.hasUpdate) {
-						updateManager.onUpdateReady(function() {
-							uni.showModal({
-								title: '更新提示',
-								content: '新版本已经准备好,是否重启应用?',
-								success: function(res) {
-									if (res.confirm) {
-										// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
-										updateManager.applyUpdate();
-									}
-								}
-							});
-						});
-
-						updateManager.onUpdateFailed(function() {
-							// 新的版本下载失败
-							uni.showModal({
-								title: '已经有新版本了哟~',
-								content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
-							});
-						});
-					}
-				});
-			},
 			// 库存弹窗
 			inventoryfun(arr) {
 				let sum = ''
@@ -257,10 +218,16 @@
 					this.radiovalue = []
 					const res = await shoppingCartList()
 					this.companyValueLength = res.data.length
-					uni.setTabBarBadge({
-						index: 3, // tabIndex,tabBar的哪一项,从0开始
-						text: this.companyValueLength.toString() // 显示的文本,超过 99 显示成 “…”
-					})
+					if(this.companyValueLength){
+						uni.setTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+							text: this.companyValueLength.toString() // 显示的文本,超过 99 显示成 “…”
+						})
+					}else{
+						uni.removeTabBarBadge({
+							index: 3, // tabIndex,tabBar的哪一项,从0开始
+						})
+					}
 					this.$refs.paging.complete(res.data)
 				} catch (e) {
 					this.$refs.paging.complete(false)