shish 3 лет назад
Родитель
Сommit
7d41bd8e26

+ 11 - 5
ghsApp/src/admin/home/login.vue

@@ -7,19 +7,23 @@
 				<image :src="`${constant.imgUrl}/logo3.png`" class="logo" mode="widthFix"></image> 
 				</view>
 				<view style="color:#666666;text-align:center;margin-bottom:50upx;font-size:35upx;">销花宝</view>
+
+<template v-if="showAccountLogin">
 				<view>
-				<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
+					<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
 				</view>
 				<view>
-				<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
+					<input @focus="password=''" v-model="password" class="experInput" placeholder="密码" type="password" />
 				</view>
 				<view style="margin-top:40upx;">
-				<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
+					<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
 				</view>
+</template>
+
 				<!-- #ifdef MP-WEIXIN -->
 				<view style="margin-top:35upx;">
 				<button class="admin-button-com small buttonText" open-type="getPhoneNumber" @getphonenumber="wxPhoneLogin"
-				style="background-color:#2BA245;border-color:#2BA245;color:white;">微信手机号一键登录</button>
+				style="background-color:#2BA245;border-color:#2BA245;color:white;height:120upx;line-height:120upx;">微信手机号一键登录</button>
 				</view>
 				<!-- #endif -->
 				<!-- #ifdef APP-PLUS -->
@@ -44,6 +48,7 @@
 				<!-- #endif -->
 				<view style="margin-top:80upx;color:#999999;width:86vw;font-size:35upx;">
 					<text style="float:right;" @click="pageTo({url: '/pagesClient/official/apply',type:2})">注册账号</text>
+					<text style="float:right;margin-right:25upx;" @click="showAccountLogin=true">使用账号密码登录</text>
 				</view>
 			</view>
 			</view>
@@ -66,7 +71,8 @@ export default {
 			mobile:'',
 			password: '',
 			hasMobileNet:false,
-			agree:0
+			agree:0,
+			showAccountLogin:false
 		}
 	},
 	computed: {

+ 66 - 24
ghsApp/src/admin/home/workbench.vue

@@ -1,4 +1,26 @@
 <template>
+<view>
+  <block v-if="loginStyle  == 0">
+
+    <view style="width:100vw;height:400upx;display:flex;align-items:center;justify-content:center;position:relative;">
+      <view style="position:absolute;top:60upx;font-size:35upx;">
+        <text style="color:#333333;margin-left:8upx;font-weight:bold;">花店买花点这里</text>
+      </view>
+      <button class="admin-button-com big blue" style="width:260upx;" @click="buyItem()">去买花</button>
+    </view>
+
+    <view style="width:100vw;height:400upx;display:flex;align-items:center;justify-content:center;position:relative;">
+      <view style="position:absolute;top:60upx;font-size:35upx;">
+        <text style="color:#333333;margin-left:8upx;font-weight:bold;">批发店点这里</text>
+      </view>
+      <button class="admin-button-com big blue" style="width:260upx;" @click="pageTo({url:'/admin/home/login'})">去登录</button>
+    </view>
+
+  </block>
+
+  <block v-else>
+
+
 	<view class="app-main app-content">
 
 <template v-if="(loginInfo.staff && loginInfo.staff.super && loginInfo.staff.super == 1) || (loginInfo.staff && loginInfo.staff.lookStat && loginInfo.staff.lookStat ==1)">
@@ -115,14 +137,15 @@
 			</div>
 		</template>
 
-		<NotLogin></NotLogin>
-
 	</view>
+  </block>
+
+	
+</view>
 </template>
 
 <script>
 import { mapGetters,mapActions } from "vuex";
-import NotLogin from "@/components/not-login";
 import { getShopInfo } from "@/utils/auth";
 import { consoleIndex } from "@/api/workbench";
 import { closeBook } from "@/api/book";
@@ -130,9 +153,10 @@ import productMins from "@/mixins/product";
 import { allProduct } from '@/api/product'
 import { getStat,getStrokeCount } from '@/api/console'
 import autoUpdateMixins from "@/mixins/autoUpdate";
+import { getWeixinId } from "@/api/invite/index";
 export default {
 	name: "admin-workbench",
-	components: { NotLogin },
+	components: { },
 	mixins: [productMins,autoUpdateMixins],
 	data() {
 		return {
@@ -167,7 +191,9 @@ export default {
 			todayDebt:0,
 			totalDebt:0,
 			countStat:{systemIncome:0,systemCount:0,debtCount:0,debtIncome:0,kfWxCount:0,kfWxIncome:0},
-			overview:[]
+			overview:[],
+			//登录状态 0未登录 1登录
+			loginStyle :0
 		};
 	},
 	onShareAppMessage(res) {
@@ -181,6 +207,13 @@ export default {
 		...mapGetters({ loginInfo: "getLoginInfo" }),
 		...mapGetters({ myShopInfo: "getMyShopInfo" }),
 	},
+	watch: {
+		loginInfo(newVal) {
+			if(!this.$util.isEmpty(newVal.admin) && newVal.admin.currentGhsShopId > 0){
+				this.loginStyle = 1				
+			}
+		}
+	},
 	onLoad(option) {
 		if(this.$util.isScanEnv()){
 			this.isScanEnv = true
@@ -192,9 +225,32 @@ export default {
 	},
 	onShow() {
 		this.getShopInfo()
+
+		if(!this.$util.isEmpty(this.loginInfo.admin) && this.loginInfo.admin.currentGhsShopId > 0){
+			this.loginStyle  = 1
+		}
+
 	},
 	methods: {
 		...mapActions(['setUserShopAll']),
+		buyItem() {
+			let that = this
+			// #ifdef MP-WEIXIN
+			uni.navigateToMiniProgram({
+				//姜枫-2021.04.13
+				appId: that.getappIdList.hd.miniAppId,
+				path: 'admin/home/workbench',
+				//develop 开发版 trial 体验版 release 正式版
+				envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+				extraData: {},
+				success (res) {
+				}
+			})
+			// #endif
+			// #ifdef APP-PLUS
+				that.$msg("请用微信打开")
+			// #endif
+		},
 		getShopInfo(){
 			getShopInfo().then(res => {
 				if(res.name){
@@ -265,6 +321,10 @@ export default {
 				}
 			})
 
+			getWeixinId().then(res => {
+				this.getappIdList = res.data
+			})
+
 		},
 		setIndex(){
 			// #ifdef MP-WEIXIN
@@ -284,25 +344,7 @@ export default {
 		},
 		pageToNewOrderList(item) {
 			this.$util.pageTo({url: "newOrderList?type="+item,type:1})
-		},
-		getMyMall(){
-			console.log('pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId)
-			uni.navigateToMiniProgram({
-				//姜枫-2021.04.13
-				appId: this.getappIdList.hd.miniAppId,
-				path: 'pagesPurchase/ghsProduct?shopId='+ this.loginInfo.shopId+'&id=0&ghsShopAdminId='+this.loginInfo.shopAdminId,
-				//develop 开发版 trial 体验版 release 正式版
-				envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
-				extraData: {
-					'shopId': this.loginInfo.shopId,
-					'id': 0,
-					'name': '假数据',
-				},
-				success(res) {
-					// 打开成功
-				}
-			})
-		},
+		}
 	}
 };
 </script>

+ 15 - 0
ghsApp/src/mixins/product.js

@@ -280,18 +280,33 @@ export default {
 				if(this.py.indexOf('fs') == 0 && this.py.length <= 2){
 					return
 				}
+				if(this.py.indexOf('粉色') == 0 && this.py.length <= 2){
+					return
+				}
 				if(this.py.indexOf('hs') == 0 && this.py.length <= 2){
 					return
 				}
+				if(this.py.indexOf('红色') == 0 && this.py.length <= 2){
+					return
+				}
 				if(this.py.indexOf('zs') == 0 && this.py.length <= 2){
 					return
 				}
+				if(this.py.indexOf('紫色') == 0 && this.py.length <= 2){
+					return
+				}
 				if(this.py.indexOf('ls') == 0 && this.py.length <= 2){
 					return
 				}
+				if(this.py.indexOf('绿色') == 0 && this.py.length <= 2){
+					return
+				}
 				if(this.py.indexOf('bs') == 0 && this.py.length <= 2){
 					return
 				}
+				if(this.py.indexOf('白色') == 0 && this.py.length <= 2){
+					return
+				}
 				if(this.py.indexOf('yj') == 0 && this.py.length <= 2){
 					return
 				}

+ 1 - 0
ghsApp/src/pages.json

@@ -82,6 +82,7 @@
 			"root": "pagesOrder",
 			"pages": [
 				{"path": "detail","style": {"navigationBarTitleText": "订单详情", "enablePullDownRefresh": true}},
+				{"path": "showOrder","style": {"navigationBarTitleText": "订单", "enablePullDownRefresh": true}},
 				{"path": "info","style": {"navigationBarTitleText": "订单详情", "enablePullDownRefresh": true}},
 				{"path": "arrival","style": {"navigationBarTitleText": "到货处理"}},
 				{"path": "result","style": {"navigationBarTitleText": "结果"}},

+ 33 - 22
ghsApp/src/pagesOrder/detail.vue

@@ -238,7 +238,10 @@
 		</view>
 		<div class="app-footer">
 			<!-- #ifdef MP-WEIXIN -->
-			<button class="admin-button-com default" v-if="detailInfo.status == 4" @click="shareTo()">打开并分享</button>
+			<button class="admin-button-com default" v-if="detailInfo.status == 4"  open-type="share">分享</button>
+			<!-- #endif -->
+			<!-- #ifdef APP-PLUS -->
+			<button class="admin-button-com default" v-if="detailInfo.status == 4" @click="shareOrder()">分享</button>
 			<!-- #endif -->
 			<button @click="cancelOrderFn(detailInfo)" v-if="detailInfo.status == 1" class="admin-button-com default" :class="active">取消</button>
 			<template v-for="s in detailInfo.buttonList">
@@ -303,6 +306,14 @@ export default {
 		uni.stopPullDownRefresh()
 		})
 	},
+	onShareAppMessage(res) {
+		console.log("pagesOrder/showOrder?id="+this.detailInfo.purchaseId)
+		return {
+			title: this.title,
+			desc: "",
+			path: "pagesOrder/showOrder?id="+this.detailInfo.purchaseId,
+		}
+	},
 	onShow() {
 
         getWeixinId().then(res => {
@@ -315,27 +326,30 @@ export default {
 		...mapGetters({ loginInfo: "getLoginInfo" }),
 	},
 	methods: {
-		shareTo(){
-			// #ifdef APP-PLUS
-			this.$msg('暂时只支持小程序')
-			// #endif
-			if(this.$util.isEmpty(this.detailInfo)){
-				this.$msg('稍等3秒再点')
-				return false
-			}
+		shareOrder(){
+			console.log("pagesOrder/showOrder?id="+this.detailInfo.purchaseId)
 			let that = this
-			console.log('pagesPurchase/purDetails?id='+ that.detailInfo.purchaseId)
-			// #ifdef MP-WEIXIN
-			uni.navigateToMiniProgram({
-				appId: that.getappIdList.hd.miniAppId,
-				path: 'pagesPurchase/purDetails?id='+ that.detailInfo.purchaseId,
-				//develop 开发版 trial 体验版 release 正式版
-				envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
-				extraData: {},
-				success (res) {
+			let miniOriginalId = that.dictInfo.miniOriginalId && that.dictInfo.miniOriginalId.current && that.dictInfo.miniOriginalId.current.ghs ? that.dictInfo.miniOriginalId.current.ghs : ''
+			uni.share({
+				provider: "weixin", //分享服务提供商(即weixin|qq|sinaweibo)
+				scene: 'WXSceneSession', //场景,可取值参考下面说明。
+				type: 5, //分享形式
+				title: '查账和结账', //分享内容的标题
+				summary: '暂无', //分享内容的摘要
+				imageUrl: IMGHOST+'/custom/hit_me_clear.jpg',//图片一定要有,不然会分享失败
+				miniProgram: {
+					id: miniOriginalId,//小程序原始id,发起分享的 App 与小程序属于同一微信开放平台帐号
+					path: "pagesOrder/showOrder?id="+this.detailInfo.purchaseId,
+					type: 0,// 0-正式版; 1-测试版; 2-体验版
+					webUrl: 'https://www.wixhb.com'
+				},
+				success: function(res) {
+					//console.log(res)
+				},
+				fail: function(err) {
+					//console.log(err)
 				}
 			})
-			// #endif
 		},
 		goRefund(){
 			if(this.detailInfo.payWay == 1){
@@ -384,9 +398,6 @@ export default {
 		},
 		modalCancel() {
 			this.freeShipModal = false;
-		},
-		shareOrder(info){
-
 		},
 		cancelOrderFn(info) {
 			let that = this

+ 92 - 0
ghsApp/src/pagesOrder/showOrder.vue

@@ -0,0 +1,92 @@
+<template>
+	<view class="app-content">
+		<view class="billing_box_bg">
+			<view class="top-view"> </view>
+			<view class="result-view">
+                <button v-if="showButton" class="admin-button-com big blue" style="width:45vw;" @click="showCgOrder()">点我查看订单</button>
+			</view>
+		</view>
+	</view>
+</template>
+<script>
+import { getWeixinId } from "@/api/invite/index"
+export default {
+    name: "showCgOrder",
+	data() {
+		return {
+			getAppIdList:{},
+			showButton:false
+		};
+	},
+	onLoad() {
+		let that = this
+		getWeixinId().then(res => {
+			that.getAppIdList = res.data
+			that.showButton = true
+		})
+	},
+	methods: {
+		showCgOrder() {
+			let that = this
+			console.log('pagesPurchase/purDetails?id='+that.option.id)
+			uni.navigateToMiniProgram({
+				//姜枫-2021.04.13
+				appId: that.getAppIdList.hd.miniAppId,
+				path: 'pagesPurchase/purDetails?id='+that.option.id,
+				//develop 开发版 trial 体验版 release 正式版
+				envVersion: process.env.NODE_ENV === 'development' ? 'develop' : 'release',
+				extraData: {
+					'id': that.option.id
+				},
+				success (res) {
+				}
+			})
+		}
+	}
+};
+</script>
+<style lang="scss" scoped>
+.go-back{
+	width: 80%;
+	height: 80upx;
+	color: #FFFFFF;
+	margin-top: 50upx;
+	background: #3385FF;
+	border-radius: 10upx;
+	font-size:30upx;
+}
+.billing_box_bg {
+	position: relative;
+	padding: 60upx 30upx;
+	display: flex;
+	background: white;
+	flex-direction: column;
+    background-color: #f5f5f5;
+	.top-view {
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 299upx;
+	}
+	.result-view {
+		position: relative;
+		display: flex;
+		flex-direction: column;
+		align-items: center;
+		padding: 70upx;
+		width: 100%;
+		background: #ffffff;
+		border-radius: 20upx;
+		z-index: 1;
+		.iconchenggong {
+			font-size: 170upx;
+			color: $mainColor1;
+		}
+		.result-title {
+			margin: 50upx 0 70upx;
+			font-size: 32upx;
+		}
+	}
+}
+</style>

+ 10 - 3
hdApp/src/admin/home/login.vue

@@ -7,6 +7,8 @@
 				<image :src="`${constant.imgUrl}/logo4.png`" class="logo" mode="widthFix"></image>
 				</view>
 				<view style="color:#666666;text-align:center;margin-bottom:20upx;font-size:35upx;">花掌柜</view>
+
+<template v-if="showAccountLogin">
 				<view>
 				<input @focus="mobile=''" v-model="mobile" class="experInput" placeholder="手机号" type="number" />
 				</view>
@@ -16,6 +18,8 @@
 				<view style="margin-top:10upx;">
 				<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
 				</view>
+</template>
+
 				<!-- #ifdef MP-WEIXIN -->
 				<view style="margin-top:55upx;">
 				<button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;height:120upx;line-height:120upx;"
@@ -42,8 +46,10 @@
 					</radio-group>
 				</view>
 				<!-- #endif -->
-				<view style="margin-top:60upx;color:#999999;width:88%;font-size:30upx;">
-				<text style="float:right;" @click="pageTo({url: '/pagesClient/official/apply',type:2})">注册帐号</text>
+
+				<view style="margin-top:60upx;color:#999999;width:88%;font-size:34upx;">
+					<text style="float:right;" @click="pageTo({url: '/pagesClient/official/apply',type:2})">注册帐号</text>
+					<text style="float:right;margin-right:25upx;" @click="showAccountLogin=true">使用账号密码登录</text>
 				</view>
 			</view>
 			</view>
@@ -67,7 +73,8 @@ export default {
 		return {
 			mobile:'',
 			password:'',
-			agree:0
+			agree:0,
+			showAccountLogin:false
 		};
 	},
 	computed: {

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

@@ -3,8 +3,10 @@
   <block v-if="loginStyle  == 0">
     <view style="width:100vw;height:500upx;display:flex;align-items:center;justify-content:center;">
       <button class="admin-button-com big blue" @click="pageTo({url:'/admin/home/login'})">点我登录</button>
-      <view style="position:absolute;top:340upx;font-size:35upx;">请选择<text style="color:red;margin-left:8upx;font-weight:bold;">微信手机号一键登录</text></view>
-      <view style="position:absolute;top:420upx;font-size:28upx;">如您的<text style="color:red;font-weight:bold;">伙伴和员工</text>也需要登录,请联系批发店</view>
+      <view style="position:absolute;top:360upx;font-size:30upx;">
+        <text style="color:red;font-weight:bold;">伙伴和员工</text>
+        需要登录,请联系批发店添加员工
+      </view>
     </view>
   </block>
   <block v-else>

+ 8 - 0
hdApp/src/pagesPurchase/components/item.vue

@@ -28,6 +28,10 @@
 						</text>
 						<i class="iconfont iconzeng" :class="addAnimationData?'animation':''" @click.stop="addEvents(info.variety)"></i>
 					</view>
+<template v-if="showStock && showStock == 1">
+					<text v-if="Number(info.stock) > Number(info.stockWarning)" style="color:#333;margin-right:65upx;">还剩 {{ parseFloat(info.stock) }}</text>
+					<text v-else style="color:red;font-weight:bold;margin-right:65upx;">还剩 {{ parseFloat(info.stock) }}</text>
+</template>
 				</view>
 			</view>
 		</view>
@@ -75,6 +79,10 @@ export default {
 			type: Number,
 			default: 1
 		},
+		showStock:{
+			type: Number,
+			default: 0
+		},
 		autoPrice: {},
 		offPrice: {
 			type: Boolean,

+ 9 - 2
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -58,6 +58,7 @@
 									:bigCount="getSelectItemById(productItem.id, classItem.classId).bigCount"
 									:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
 									:discount.sync="ghsInfo.giveDiscount"
+									:showStock.sync="ghsInfo.showStock"
 									@customNum="customNum"
 									@add="addEvent"
 									@addOneEvent="addCustomNumEvent"
@@ -85,7 +86,12 @@
 		<modal-module :show="isModel" @cancel="modalCancel" @click="affirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
 			<template slot="customContent">
 				<view class="select-cmd_bx" v-if="customData">
-					<view class="kc"> </view>
+					<view class="kc">
+						<text v-if="ghsInfo.showStock && ghsInfo.showStock==1">
+						{{customData.stock?parseFloat(customData.stock):0}}
+						{{customData.bigUnit}}
+						</text>
+					</view>
 					<view class="num_bx">
 						<input v-if="globalUnitType == 0" v-model="customData.bigCount" :focus="isFocus" type="number" placeholder="扎数" />
 						<input v-if="globalUnitType == 1" v-model="customData.smallCount" :focus="isFocus" type="number" placeholder="支数" />
@@ -223,7 +229,8 @@ export default {
 				name:' ',
 				mobile:'',
 				expendAmount:'0.00',
-				debtAmount:'0.00'
+				debtAmount:'0.00',
+				showStock:0
 			},
 			myClass: 'fadeInSmall',
 			shopId:0,