Răsfoiți Sursa

注册流程

shish 4 ani în urmă
părinte
comite
5e0d87c702

+ 2 - 2
ghsApp/src/admin/home/mall.vue

@@ -3,12 +3,12 @@
     <view class="img_box">
       <image :src="imgUrl" class="img_url"></image>
     </view>
-    <view style="margin:50upx 0 0 30upx;font-size:30upx;">保存图片到手机,用于分享或打印</view>
+    <view style="margin:50upx 0 0 30upx;font-size:30upx;">保存图片到手机,可分享或打印张贴</view>
     <div class="confirm-btn">
       <button class="admin-button-com big blue" @click="downloadImg">保存图片</button>
     </div>
     <!-- #ifdef MP-WEIXIN -->
-    <view style="margin:50upx 0 0 30upx;font-size:30upx;">打开即可直接分享给客户</view>
+    <view style="margin:50upx 0 0 30upx;font-size:30upx;">打开直接分享给客户</view>
     <div class="confirm-btn1">
       <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">打开商城</button>
     </div>

+ 2 - 2
hdApp/src/admin/cg/mall.vue

@@ -3,12 +3,12 @@
     <view class="img_box">
       <image :src="imgUrl" class="img_url"></image>
     </view>
-    <view style="margin:50upx 0 0 30upx;font-size:30upx;">保存图片到手机,用于分享或打印</view>
+    <view style="margin:50upx 0 0 30upx;font-size:30upx;">保存图片到手机,可分享或打印张贴</view>
     <div class="confirm-btn">
       <button class="admin-button-com big blue" @click="downloadImg">保存图片</button>
     </div>
     <!-- #ifdef MP-WEIXIN -->
-    <view style="margin:50upx 0 0 30upx;font-size:30upx;">打开即可直接分享给客户</view>
+    <view style="margin:50upx 0 0 30upx;font-size:30upx;">打开直接分享给客户</view>
     <div class="confirm-btn1">
       <button class="admin-button-com big blue" @click="goToMallPt('pages/home/index')">打开商城</button>
     </div>

+ 2 - 2
hdApp/src/admin/home/me.vue

@@ -4,7 +4,7 @@
     <template>
       <view class="me-user_box">
         <view class="user-info_item">
-          <view v-if="shopInfo.shopAdminId > 0"> <view class="name"> {{ shopInfo.adminName }} </view> <view class="mobile"> ID:{{ shopInfo.shopAdminId }} </view> </view>
+          <view v-if="shopInfo.shopAdminId > 0"> <view class="name"> {{ shopInfo.adminName||'' }} </view> <view class="mobile"> ID:{{ shopInfo.shopAdminId }} </view> </view>
         </view>
       </view>
       <view class="me-shop_box">
@@ -18,7 +18,7 @@
               </image>
 
               <view class="top-info_box" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
-                <view> {{ shopInfo.shopName }} </view> <view> <text>{{ shopInfo.sjName }}</text> </view>
+                <view> {{ shopInfo.shopName||'' }} </view> <view> <text>{{ shopInfo.sjName||'' }}</text> </view>
               </view>
 
               <view class="top-info_box" @click="pageTo({url:'/admin/home/login'})" v-else>

+ 20 - 71
hdApp/src/components/module/dorpdownSelect.vue

@@ -1,68 +1,25 @@
 <template>
   <view class="select-bg_bx">
-
-    <view
-      v-if="isShowTit"
-      @click="switchCut"
-      :class="['select-title',dropdownShow?'select_corlor':'']"
-    >
-      <!--            {{menuObjActive?menuObjActive:menuObj.title}}-->
+    <view v-if="isShowTit" @click="switchCut" :class="['select-title',dropdownShow?'select_corlor':'']" >
       <text v-if="typeTime">{{selectItemId?menuObjActive:menuObj.title}}</text>
       <text v-else>{{menuObjActive?menuObjActive:getMyShopInfo.shopName}}</text>
-      <i
-        v-if="isShowMore"
-        class="iconfont iconsanjiao_xia"
-      ></i>
+      <i v-if="isShowMore" class="iconfont iconsanjiao_xia" ></i>
     </view>
-    <view
-      class="select-mark-view"
-      v-show="dropdownShow"
-      @click="switchCut"
-    ></view>
-    <view
-      v-if="dropdownShow"
-      :style="{
-                top
-            }"
-      class="select-fixed_bx"
-    >
+    <view class="select-mark-view" v-show="dropdownShow" @click="switchCut" ></view>
+    <view v-if="dropdownShow" :style="{ top }" class="select-fixed_bx" >
       <slot>
         <view class="select-item-box">
           <view class="title">{{menuObj.titleChild}}</view>
           <view class="item-child_box">
-            <button
-              v-for="(item,index) in menuObj.list"
-              :key="index"
-              @click="changeItem(item)"
-              :class="['admin-button-com','mini-btn',selectItemId === item.id?'blue':'default']"
-            >
+            <button v-for="(item,index) in menuObj.list" :key="index" @click="changeItem(item)" :class="['admin-button-com','mini-btn',selectItemId === item.id?'blue':'default']" >
               {{item.name}}
             </button>
           </view>
         </view>
-        <view
-          v-if="typeSelect === 1"
-          class="select-item-box"
-        >
-          <view class="title">其他时间选择</view>
-          <view class="item-child_box">
-            <view
-              class="admin-button-com mini-btn default custom"
-              @tap="changeItem({name:'自定义',id:'custom'})"
-            >自定义</view>
-            <!--                        <picker-->
-            <!--                            class="admin-button-com mini-btn default custom"-->
-            <!--                                mode="date" :value="selectItemId" @change="endTimeFn">-->
-            <!--                            <div v-if="selectItemId&&formatSelect">{{ selectItemId }}</div>-->
-            <!--                            <div class="tui-placeholder" v-else>自定义时间</div>-->
-            <!--                        </picker>-->
-          </view>
-        </view>
       </slot>
     </view>
   </view>
 </template>
-
 <script>
 import DropdownList from "@/components/plugin/dropdown-list";
 import AppDatePicker from "@/components/app-date-picker";
@@ -82,11 +39,6 @@ export default {
         list: [{ name: '昨天', id: '0' }, { name: '今天', id: '1' }, { name: '本月', id: '2' }, { name: '上月', id: '3' }, { name: '今年', id: '4' }]
       })
     },
-    // 1 是时间  2是其他
-    typeSelect: {
-      type: Number,
-      default: 2
-    },
     top: {
       type: String,
       default: 'auto'
@@ -132,6 +84,8 @@ export default {
       this.dropdownShow = !this.dropdownShow
     },
     changeItem (val) {
+      console.log(this.menuObj)
+      console.log('abc')
       if (val.id == this.selectItemId && val.name != '自定义') {
         return false
       }
@@ -163,14 +117,13 @@ export default {
   }
 }
 </script>
-
 <style lang="scss" scoped>
 .select-bg_bx {
   .select-title {
     color: #666666;
-    font-size: 26upx;
+    font-size: 26px;
     & .iconsanjiao_xia {
-      margin-left: 10upx;
+      margin-left: 10px;
     }
     &.select_corlor {
       color: #3385ff;
@@ -186,38 +139,34 @@ export default {
     width: 100%;
     background-color: rgba(0, 0, 0, 0.5);
     left: 0;
-    top: 0upx;
+    top: 0px;
     z-index: 900;
   }
   & .select-fixed_bx {
     position: fixed;
     width: 100%;
     background-color: #ffffff;
-    left: 0;
+    left: 0upx;
+    top:0upx;
     z-index: 999;
-    // box-shadow: 0 6upx 10upx #cccccc;
-    padding: 120upx 30upx 40upx;
-    border-radius: 0upx 0upx 20upx 20upx;
+    padding: 120px 30px 40px;
+    border-radius: 0px 0px 20px 20px;
     transition: all 0.5s ease-in-out;
-    // top: 100upx;
     & .select-item-box {
       & .title {
-        font-size: 24upx;
+        font-size: 24px;
         color: #333333;
         font-weight: 600;
         text-align: left;
       }
       & .item-child_box {
-        // display: flex;
-        padding: 20upx 0 0;
+        padding: 20px 0 0;
         align-items: center;
-        // flex-flow: wrap;
         display: inline-block;
-        // justify-content: space-between;
         & .admin-button-com {
-          margin-bottom: 20upx;
-          margin-right: 20upx;
-          padding: 18upx 50upx;
+          margin-bottom: 20px;
+          margin-right: 20px;
+          padding: 18px 50px;
           &.custom {
             width: 100%;
           }
@@ -226,4 +175,4 @@ export default {
     }
   }
 }
-</style>
+</style>

+ 3 - 3
hdApp/src/mixins/globalMixins.js

@@ -1,8 +1,8 @@
 import { mapGetters,mapActions } from 'vuex'
-import { pageTo, getCheckLogin, isLogin } from '@/utils/util.js'
+import { pageTo } from '@/utils/util.js'
 import { getUser, wxLoginFn } from '@/utils/auth'
-import { postWxCode, getDictionaries } from '@/api/mini'
-import { getStaffApi,hasTokenAutoLogin } from '@/api/common'
+import { getDictionaries } from '@/api/mini'
+import { hasTokenAutoLogin } from '@/api/common'
 import constant from '@/constant'
 export default {
 	data() {

+ 4 - 16
hdApp/src/mixins/selectShop.js

@@ -2,11 +2,7 @@ import { mapState,mapGetters } from 'vuex'
 export default {
     data(){
         return {
-            menuObj:{
-				title:'门店',
-				titleChild:'请选择门店',
-				list: []
-			},
+            menuObj:{ title:'门店', titleChild:'请选择门店', list: [] },
 			shopId:0
         }
     },
@@ -17,22 +13,14 @@ export default {
         ...mapGetters({ 
             loginInfo: "getLoginInfo",
             userInfo: 'getUser'
-    })
+        })
     },
   mounted () {
-        this.menuObj.list = this.userShopAll.map(i=>({
-            ...i,
-            name:i.shopName
-        }));
+        this.menuObj.list = this.userShopAll.map(i=>({ ...i, name:i.shopName }))
     },
 	watch:{
     userShopAll (val) {
-			if(!this.$util.isEmpty(val)) {
-				this.menuObj.list = val.map(i=>({
-					...i,
-					name:i.shopName
-				}));
-			}
+			if(!this.$util.isEmpty(val)) { this.menuObj.list = val.map(i=>({ ...i, name:i.shopName })); }
 		}
 	}
 }

+ 44 - 3
hdApp/src/pagesClient/official/apply.vue

@@ -84,12 +84,15 @@ import AppUploader from "@/components/app-uploader";
 const form = require("@/utils/formValidation.js");
 import {getIntroduce,applyRegister} from "@/api/official";
 import {getAuthCode} from "@/api/apply";
-import { mapGetters } from "vuex"
+import { replaceClientId } from '@/api/admin'
+import { mapGetters,mapActions } from "vuex"
 //图片上传插件来源:https://ext.dcloud.net.cn/plugin?id=2922 已改造,不能再升级 shish 20211228
 import htzImageUpload from '../components/htz-image-upload/htz-image-upload.vue'
 import { mapResolve } from "@/api/map";
 import util from '@/utils/util';
 import { APIHOST } from '@/config'
+import { getUser} from "@/utils/auth";
+import { getDictionaries } from '@/api/mini'
 export default {
   name: "apply-data",
   components: {
@@ -168,6 +171,7 @@ export default {
 
 	},
   methods: {
+    ...mapActions(['setUserShopAll']),
     requestAuthCode(){
       let that = this
       let mobile = this.form.mobile
@@ -271,11 +275,48 @@ export default {
       }
     },
     confirmFn () {
+      uni.showLoading({mask:true})
       let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
       let style = this.option.style || 0
       let from = this.option.from || 0
-      applyRegister({hdShopAdminId:this.option.hdShopAdminId,ghsShopAdminId:this.option.ghsShopAdminId,...this.form,style:style,from:from,miniOpenId:currentMiniOpenId}).then(res => {
-        this.$util.pageTo({ url: "/pagesClient/official/result", type: 2, query: { pagestatus: 3 } })
+      let that = this
+      applyRegister({hdShopAdminId:this.option.hdShopAdminId,ghsShopAdminId:this.option.ghsShopAdminId,...this.form,style:style,from:from,miniOpenId:currentMiniOpenId}).then(subRes => {
+
+        let token = subRes.data.token || ''
+        uni.hideLoading()
+        if (that.$util.isEmpty(token)) {
+          that.$msg('出错了')
+          return false
+        }
+        //有几个地方涉及登陆,需要统一方法,请搜索关键词 uni_login
+        if(subRes.code == 1){
+          if (that.$util.isEmpty(subRes)) {
+            that.$msg('出错了')
+            return false
+          }
+          uni.setStorageSync('token', subRes.data.token)
+          uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
+          getDictionaries({ token: subRes.data.token }).then(res => {
+            if (that.$util.isEmpty(res)) {
+              return false
+            }
+            that.$store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+            that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
+          })
+          that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
+          getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+          that.setUserShopAll()
+          // #ifdef APP-PLUS
+          //保存安卓的clientId
+          let hasClientId = !that.$util.isEmpty(subRes.data.admin.clientId) ? subRes.data.admin.clientId : ''
+          const clientInfo = plus.push.getClientInfo()
+          let currentClientId = !that.$util.isEmpty(clientInfo.clientid) ? clientInfo.clientid : ''
+          if(hasClientId == '' || hasClientId != currentClientId){
+            replaceClientId({id:currentClientId})
+          }
+          // #endif
+        }
+        this.$util.pageTo({url: "/pagesClient/official/result", type:2})
       });
     }
   },

+ 17 - 3
hdApp/src/pagesClient/official/result.vue

@@ -1,8 +1,8 @@
 <template>
-	<appResult title="已提交">
-      <!-- <view class="dec">审核时间为一个工作日</view> -->
+	<appResult title="注册成功">
       <view class="dec"></view>
-		<button class="admin-button-com blue big" @click="goBack()" >返回</button>
+		<button class="admin-button-com blue big" v-if="scene==''" @click="goBack()" >返回</button>
+    <button class="admin-button-com blue big" v-else @click="beginCg()" >开始采购</button>
 	</appResult>
 </template>
 <script>
@@ -12,9 +12,23 @@ export default {
 	components:{
 		appResult
     },
+    data(){
+      return {
+        scene:''
+      }
+    },
     onUnload() {
     },
+    onLoad () {
+      let scene = uni.getStorageSync('ghs_cg_scene')
+      if(scene){
+        this.scene = scene
+      }
+    },
     methods:{
+      beginCg(){
+        this.$util.pageTo({url: "/pagesPurchase/ghsProduct",query: {scene:this.scene},type:2})
+      },
       goBack() {
         uni.navigateBack()
       }

+ 4 - 4
hdApp/src/pagesPurchase/components/wangCg.vue

@@ -1,8 +1,8 @@
 <template>
   <view class="model" v-if="show">
     <image :src="`${constant.imgUrl}/ghs/home/deserve.png`" class="noData_img"></image>
-    <view class="freeApply" @click="learnCg" style="margin:50upx auto 50upx auto">快速了解采购流程</view>
-    <view class="freeApply" @click="apply">开始采购</view>
+    <view style="margin:30upx 0;color:white;font-size:34upx;">首次下单,请先完善资料</view>
+    <view class="freeApply" @click="apply">完善资料</view>
   </view>
 </template>
 <script>
@@ -67,12 +67,12 @@ export default {
     margin: 50upx 0;
   }
   & > .freeApply {
-    width: 370upx;
+    width: 280upx;
     height: 80upx;
     line-height: 88upx;
     background: linear-gradient(90deg, #3385ff, #33b0ff);
     border-radius: 44upx;
-    margin: 0 auto;
+    margin: 20upx auto;
     font-size: 30upx;
     color: #ffffff;
     text-align: center;

+ 6 - 3
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -19,7 +19,7 @@
 
 			<view v-else class="shop_intro">
 				<text style="margin-right: 20upx;">已采购:{{ghsInfo.expendAmount || '0.00'}}</text>
-				<text>欠:{{ghsInfo.debtAmount || '0.00'}}</text>
+				<text>欠:{{ghsInfo.debtAmount || '0.00'}}</text>
 			</view>
 
         </view>
@@ -210,6 +210,7 @@ export default {
 		}
 	},
 	onShow(){
+
 		if(this.xjData.hasUpdate == 1){
 
 			const list = this.selectList;
@@ -314,7 +315,9 @@ export default {
 
 			//扫码采购 shish 20210614
 			if(this.option.scene){
-				console.log('scene',this.option.scene)
+				
+				uni.setStorageSync('ghs_cg_scene', this.option.scene)
+
 				const scene = decodeURIComponent(this.option.scene);
 				var sceneItem = scene.split("&");
 				var arr, name, value;
@@ -415,7 +418,7 @@ export default {
 			})
 		},
 		goToCg() {
-			this.$util.pageTo({ url: "/pagesClient/official/apply",query:{ghsShopAdminId:this.ghsShopAdminId,hdShopAdminId:this.hdShopAdminId,fromGhsId:this.fromGhsId}})
+			this.$util.pageTo({ url: "/pagesClient/official/apply",query:{ghsShopAdminId:this.ghsShopAdminId,hdShopAdminId:this.hdShopAdminId,fromGhsId:this.fromGhsId},type:2})
 		},
 		// 拨打电话  wangn  2021-5-6
 		toPhone(phone){

+ 8 - 35
hdApp/src/utils/auth.js

@@ -1,24 +1,8 @@
 import store from '@/store'
-// #ifdef H5
-// import jweixin from 'jweixin-module'
-// #endif
-// import { share } from '@/mixins'
-import CONSTANT from '@/constant'
-// import util from '@/utils/util'
-
-import {
-	getStaffApi,
-	getUserApi,
-	getShopUserApi
-	// checkLogin,
-} from '@/api/common'
+import { getStaffApi, getUserApi, getShopUserApi } from '@/api/common'
 import { postWxCode,getDictionaries } from '@/api/mini'
-
 import util from './util'
-/**
- * 获取商城端用户信息
- * @parmas update为true时会重新触发请求,重置vuex的数据
- */
+//获取商城端用户信息 update为true时会重新触发请求,重置vuex的数据
 export async function getShopUser(update) {
 	let userInfo = store.getters.getShopUser
 	if (!util.isEmpty(userInfo) && !update) {
@@ -86,7 +70,6 @@ export async function wxLoginFn(update) {
 		uni.login({
 			provider: 'weixin',
 			success: res => {
-				console.log('res',res)
 				uni.setStorageSync('code', res.code)
 				postWxCode({ code: res.code }).then(subRes => {
 					if (util.isEmpty(subRes)) {
@@ -100,26 +83,16 @@ export async function wxLoginFn(update) {
 					if (util.isEmpty(token)) {
 						return false
 					}
-
 					uni.setStorageSync('token', subRes.data.token)
 					uni.setStorageSync('shopId', subRes.data.admin.currentShopId)
 					getDictionaries({ token: subRes.data.token }).then(res => {
-								if (util.isEmpty(res)) {
-									return false
-								}
-								store.commit('setDictionariesInfo', {
-									...res.data.dict,
-									...res.data
-								})
-								store.commit('setMyShopInfo', {
-									...res.data.shop,
-									...res.data
-								})
-						})
-					store.commit('setLoginInfo', {
-						...subRes.data.admin,
-						...subRes.data
+						if (util.isEmpty(res)) {
+							return false
+						}
+						store.commit('setDictionariesInfo', { ...res.data.dict, ...res.data })
+						store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
 					})
+					store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
 
 					//启动更新逻辑 shish 2020.5.18
 					if (subRes.data.update == 1) {