Sfoglia il codice sorgente

分享采购页的流程优化

jf 5 anni fa
parent
commit
750a75f929

+ 2 - 1
ghsApp/src/components/module/allSelectInput.vue

@@ -27,7 +27,7 @@
 </style>
 <template>
 	<view class="change-input" :style="'width:'+width+'rpx !important;height:'+height+'rpx !important;'" >
-			<input :focus="isFocus" :style="isActive?'caret-color:rgba(0,0,0,0)':'caret-color:rgba(0,0,0,1)'"  type="number" @focus="initAllInput" @blur="moveAllInput" v-model="inputVal" @input="changeAllInput" :placeholder="value==''&&inputVal==''?placeholder:''">
+			<input :focus="isFocus" :style="isActive?'caret-color:rgba(0,0,0,0)':'caret-color:rgba(0,0,0,1)'"  :type="inputType?inputType:'number'" @focus="initAllInput" @blur="moveAllInput" v-model="inputVal" @input="changeAllInput" :placeholder="value==''&&inputVal==''?placeholder:''">
 			<text :class="isActive?'active':''">{{value?value:''}}</text>
 	</view>
 </template>
@@ -41,6 +41,7 @@ export default {
 		isFocus: '',
 		value: '',
 		placeholder: '',
+		inputType:'',
 	},
 	data() {
 		return {

+ 1 - 1
ghsApp/src/components/module/app-commodity.vue

@@ -22,7 +22,7 @@
 					<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click="addEvents"></i>
 				</view>
 				<view class="open-bx" v-else-if="type == COMMODITY_TYPE.CHANGE">
-					<allSelectInput :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="changeAutoPrice" :placeholder="'自动调价'"
+					<allSelectInput :inputType="'digit'" :isActive="isAloneAllActive" :isFocus="isAloneAllFocus" :value="changeAutoPrice" :placeholder="'自动调价'"
 						@deleteInputVal="deleteInputVal" @initAllInput="initAloneAllInput" @moveAllInput="moveAllInput">
 					</allSelectInput>
 					<!--<input class="change-input" v-model="changeAutoPrice" type="digit" placeholder="自动调价"  selection-start="0" selection-end="1" />-->

+ 31 - 38
ghsApp/src/mixins/globalMixins.js

@@ -28,50 +28,43 @@ export default {
 			uni.setStorageSync('account', option.account)
 		}
 		uni.setStorageSync('currentQuery', JSON.stringify(option))
-		// if (isLogin()) {
-		// 	if (this.init) {
-		// 		this.init()
-		// 	}
-		// }else{}
-
-
-
+		if (!isLogin()) {
+			wxLoginFn(true).then(res => {
+				//客户可以访问的页面
+				var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official','pagesClient/member/bind','pagesShare/pay'];
+				var redirectPage = res.redirectPage;
+				var needRedirect = true;
+				urlArr.forEach((item, index, array) => {
+					if (redirectPage.indexOf(item) != -1) {
+						needRedirect = false;
+					}
+				})
+				if (needRedirect === true) {
+					//客户访问不能查看的页面跳转去官网
+					if (res.data.shopAdminId == '0') {
+						this.$util.pageTo({
+							url: "/pagesClient/official/index",
+							type: 2,
+							query: {
+								...this.option
+							}
+						});
+					}
+				}
+				getUser(true)
+				//获取门店信息
+				this.setUserShopAll()
+				if (this.init) {
+					this.init()
+				}
+			})
+		}
 	},
 	onShow(){
 		if (isLogin()) {
 			if (this.init) {
 				this.init()
 			}
-		}else{
-			wxLoginFn(true).then(res => {
-					//客户可以访问的页面
-					var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official','pagesClient/member/bind','pagesShare/pay'];
-					var redirectPage = res.redirectPage;
-					var needRedirect = true;
-					urlArr.forEach((item, index, array) => {
-						if (redirectPage.indexOf(item) != -1) {
-							needRedirect = false;
-						}
-					})
-					if (needRedirect === true) {
-						//客户访问不能查看的页面跳转去官网
-						if (res.data.shopAdminId == '0') {
-							this.$util.pageTo({
-								url: "/pagesClient/official/index",
-								type: 2,
-								query: {
-									...this.option
-								}
-							});
-						}
-					}
-					getUser(true)
-					//获取门店信息
-					this.setUserShopAll()
-					if (this.init) {
-						this.init()
-					}
-				})
 		}
 
 	},

+ 0 - 1
hdApp/src/App.vue

@@ -2,7 +2,6 @@
 import store from '@/store'
 import { mapMutations, mapActions, mapGetters } from 'vuex'
 import { setTimeout } from 'timers'
-import { getUser, wxLoginFn } from '@/utils/auth'
 import { getDictionaries } from '@/api/mini'
 import util from "./utils/util"
 export default {

+ 0 - 2
hdApp/src/admin/home/workbench.vue

@@ -278,14 +278,12 @@ export default {
     ...mapGetters({ loginInfo: "getLoginInfo" })
   },
   onLoad (option) {
-
    },
   onPullDownRefresh () {
     this.init();
     uni.stopPullDownRefresh();
   },
   onShow () {
-    this.init();
   },
   methods: {
     goPage (item) {

+ 10 - 9
hdApp/src/mixins/globalMixins.js

@@ -12,7 +12,7 @@ export default {
 			// 全局混入,插入全局工具函数
 			$util: this.$util,
 			// 全局混入,插入全局跳转函数
-			pageTo: pageTo
+			pageTo: pageTo,
 		}
 	},
 	computed: {
@@ -29,14 +29,7 @@ export default {
 		}
 		uni.setStorageSync('currentQuery', JSON.stringify(option))
 
-
-	},
-	onShow(){
-		if (isLogin()) {
-			if (this.init) {
-				this.init()
-			}
-		}else{
+		if (!isLogin()) {
 			wxLoginFn(true).then(res => {
 				//客户可以访问的地址
 				var urlArr = ['admin/shopAdmin/bind', 'pagesClient/official', 'pagesClient/member/bind', 'pagesShare/pay','pagesPurchase/ghsProduct'];
@@ -67,6 +60,14 @@ export default {
 				}
 			})
 		}
+
+	},
+	onShow(){
+		if (isLogin()) {
+			if (this.init) {
+				this.init()
+			}
+		}
 	},
 	methods: {
 		...mapActions(['setUserShopAll'])

+ 1 - 1
hdApp/src/mixins/product.js

@@ -33,7 +33,7 @@ export default {
 		}
 		if (this.autoLoad) {
 			if(this.isGhsProduct){
-				this.initGhsData(id,shopId);//采购-进店下单
+				// this.initGhsData(id,shopId);//采购-进店下单
 			}else{
 				this.initGoodsData();//成品
 				this.initData();//组合

+ 19 - 17
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -188,25 +188,27 @@ export default {
 			path: `pagesPurchase/gshProudct?hdShopAdminId=${this.loginInfo.shopAdminId}&ghsShopAdminId=${this.option.ghsShopAdminId}&shopId=${this.option.shopId}`
 		}
 	},
-  onShow() {
-    if(this.option.id == 0) {
-      ghsInfo({shopId: this.option.shopId}).then(res => {
-        this.pageInfo = res.data
-        uni.setNavigationBarTitle({
-          title: this.pageInfo.name
-        })
-      }).catch(err => {})
-    } else {
-      getGhsDataApi({id: this.option.id}).then(res => {
-        this.pageInfo = res.data
-        uni.setNavigationBarTitle({
-          title: this.pageInfo.name
-        })
-      }).catch(err => {})
-    }
-  },
 
 	methods: {
+		init(){
+			const { shopId,id} = this.options;
+			this.initGhsData(id,shopId);//采购-进店下单
+			if(this.option.id == 0) {
+				ghsInfo({shopId: this.option.shopId}).then(res => {
+					this.pageInfo = res.data
+					uni.setNavigationBarTitle({
+						title: this.pageInfo.name
+					})
+				}).catch(err => {})
+			} else {
+				getGhsDataApi({id: this.option.id}).then(res => {
+					this.pageInfo = res.data
+					uni.setNavigationBarTitle({
+						title: this.pageInfo.name
+					})
+				}).catch(err => {})
+			}
+		},
 		//自定义数量
 		customNum(info) {
 			this.isModel = true;