Jelajahi Sumber

申请开店流程

shish 4 tahun lalu
induk
melakukan
22bf84f448

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

@@ -34,9 +34,9 @@
         </view>
         <view class="account-info_box content_box">
           <view class="info-lf_box">
-            <view> 账户余额(元) </view>
+            <view> 账户余额(元) </view>
             <view> <text>¥ </text> {{ shopInfo.balance||0 }} </view>
-            <view> 可提现余额 ¥ {{ shopInfo.txBalance||0 }} <text v-if="shopInfo.txBalance > 0" @click="checkToApplyCash" class="to-cash">提现</text> </view>
+            <view> 可提现 ¥ {{ shopInfo.txBalance||0 }} <text v-if="shopInfo.txBalance > 0" @click="checkToApplyCash" class="to-cash">提现</text> </view>
           </view>
         </view>
         <view class="module-com content_box user-open_bx">
@@ -78,6 +78,10 @@
               <div class="tui-title">新手教程</div>
             </tui-list-cell>
 
+            <tui-list-cell @click="pageTo({ url: '/admin/staff/miniAutoLogin' })" class="line-cell" :hover="false" :arrow="true">
+              <div class="tui-title">帐号绑定</div>
+            </tui-list-cell>
+
           </view>
         </view>
       </view>

+ 34 - 30
hdApp/src/admin/home/workbench.vue

@@ -30,7 +30,7 @@
       </div>
     </div>
     <div class="module-com news-wrap">
-      <div class="news-list" v-for="(item, index) in data.notice" :key="index" @click="pageToFn(item.page)" >
+      <div class="news-list" v-for="(item, index) in data.notice" :key="index" @click="noticeFn(item)" >
         <div class="news-left">
           <i class="iconfont iconxiaoxi2 ling"></i>
           <span>{{ item.title }}</span>
@@ -92,7 +92,8 @@ export default {
         admin: {},
         asset: {},
         notice: {},
-        todayData: { income:0.00, order:0, custom:0, expend:0.00 }
+        todayData: { income:0.00, order:0, custom:0, expend:0.00 },
+        isMini:0
       },
       orderData: [
         { name: "待配送", value: 0, url: "/admin/home/order", type: 4, query: { tabIndex: 2 } },
@@ -182,35 +183,38 @@ export default {
       this.$util.pageTo(item)
     },
     init () {
-					getWeixinId().then(res => {
-						this.getappIdList = res.data
-					});
-					getUser().then(res => {
-						uni.setNavigationBarTitle({
-							title: res.name
-						});
-					});
-					consoleIndex().then(res => {
-						this.data = res.data;
-						const { asset, todayData } = res.data;
-						if (!this.$util.isEmpty(asset)) {
-							// 订单总览
-							this.orderData[0].value = asset.unSendOrder;
-							this.orderData[1].value = asset.sendingOrder;
-							this.orderData[2].value = todayData.order;
-							// 总览数据
-							this.totalData[0].value = asset.totalUser;
-							this.totalData[1].value = asset.totalView;
-							this.totalData[2].value = asset.totalOrder;
-							this.totalData[3].value = asset.totalIncome;
-							this.totalData[4].value = asset.totalExpend;
-							this.totalData[5].value = asset.totalPurchase;
-						}
-					});
+        getWeixinId().then(res => {
+          this.getappIdList = res.data
+        });
+        getUser().then(res => {
+          uni.setNavigationBarTitle({
+            title: res.name
+          });
+        })
+        // #ifdef MP-WEIXIN
+        this.isMini = 1
+        // #endif
+        consoleIndex({isMini:this.isMini}).then(res => {
+          this.data = res.data;
+          const { asset, todayData } = res.data;
+          if (!this.$util.isEmpty(asset)) {
+            // 订单总览
+            this.orderData[0].value = asset.unSendOrder;
+            this.orderData[1].value = asset.sendingOrder;
+            this.orderData[2].value = todayData.order;
+            // 总览数据
+            this.totalData[0].value = asset.totalUser;
+            this.totalData[1].value = asset.totalView;
+            this.totalData[2].value = asset.totalOrder;
+            this.totalData[3].value = asset.totalIncome;
+            this.totalData[4].value = asset.totalExpend;
+            this.totalData[5].value = asset.totalPurchase;
+          }
+        });
     },
-    // 跳转
-    pageToFn (page) {
-      this.$util.pageTo({ url: page })
+    //通知处理
+    noticeFn (item) {
+      this.$util.pageTo({ url: item.page })
     },
     // 新学员列表
     goNewStudent () {

+ 8 - 45
hdApp/src/admin/shopAdmin/bind.vue

@@ -3,34 +3,18 @@
     <div v-if="showBindArea">
       <form @submit="formSubmit">
         <div class="module-com input-line-wrap">
-          <div
-            class="prompt-text"
-            style="padding-top:20upx;margin-bottom:20upx;font-size:30upx;"
-          >请按以下操作完成绑定:</div>
-
+          <div class="prompt-text" style="padding-top:20upx;margin-bottom:20upx;font-size:30upx;" >请按以下操作完成绑定:</div>
           <tui-list-cell class="line-cell" :hover="false">
             <div class="tui-title required" style="width:120upx;">手机号</div>
             <view style="width:400upx;">{{form.mobile}}</view>
-            <button
-              class="admin-button-com blue mini-btn"
-              open-type="getPhoneNumber"
-              @getphonenumber="getWxMobile"
-            >帮我填</button>
+            <button class="admin-button-com blue mini-btn" open-type="getPhoneNumber" @getphonenumber="getWxMobile" >帮我填</button>
           </tui-list-cell>
           <tui-list-cell class="line-cell" :hover="false">
             <div class="tui-title required" style="width:120upx;">昵称</div>
             <view style="width:400upx;">{{form.name}}</view>
-            <button
-              class="admin-button-com blue mini-btn"
-              @click="getWxAvatar"
-            >帮我填</button>
+            <button class="admin-button-com blue mini-btn" @click="getWxAvatar" >帮我填</button>
           </tui-list-cell>
-
-          <div
-            class="prompt-text"
-            style="margin-top:20upx;margin-bottom:20upx;font-size:30upx;"
-          >关注公众号,第一时间接收门店动态:</div>
-
+          <div class="prompt-text" style="margin-top:20upx;margin-bottom:20upx;font-size:30upx;" >关注公众号,第一时间接收门店动态:</div>
           <tui-list-cell>
             <block>
               <official-account></official-account>
@@ -44,25 +28,15 @@
     </div>
     <div v-if="showSuccessArea">
       <view style="text-align:center;padding-top:50upx;">
-        <img
-          :src="`${constant.imgUrl}/retail/callback/success.png`"
-          alt
-          mode="widthFix"
-          style="width:30vh;margin:0 auto;"
-        />
+        <img :src="`${constant.imgUrl}/retail/callback/success.png`" alt mode="widthFix" style="width:30vh;margin:0 auto;" />
       </view>
       <view style="text-align:center;font-size:40upx;margin-top:30upx;">绑定成功</view>
       <view style="text-align:center;margin-top:5vh">
-        <button
-          class="admin-button-com blue big"
-          style="width:260upx;"
-          @click="redirectToCenter"
-        >管理中心</button>
+        <button class="admin-button-com blue big" style="width:260upx;" @click="redirectToCenter" >管理中心</button>
       </view>
     </div>
   </div>
 </template>
-
 <script>
 import { mapGetters } from "vuex";
 import TuiListCell from "@/components/plugin/list-cell";
@@ -165,15 +139,6 @@ export default {
     },
     // 获取微信信息
     getWxAvatar() {
-      // uni.getUserInfo({
-      //   provider: "weixin",
-      //   success: res => {
-          
-      //   },
-      //   fail: () => {
-      //     // this.loading = false
-      //   }
-      // });
        uni.getUserProfile({
           desc:'登录',
           success:(res)=>{
@@ -186,10 +151,8 @@ export default {
                 });
               }
             );
-          },
-          fail:(res)=>{
           }
-        });
+        })
     },
     redirectToCenter() {
       this.$store.commit("setLoginInfo", {});
@@ -202,4 +165,4 @@ export default {
 };
 </script>
 <style lang="scss" scoped>
-</style>
+</style>

+ 51 - 0
hdApp/src/admin/staff/miniAutoLogin.vue

@@ -0,0 +1,51 @@
+<template>
+  <view class="app-content">
+    <form>
+      <view class="module-com input-line-wrap">
+        <view class="btn-wrap">
+          <view style="padding:30upx 0 30upx 0;font-size:30upx;">帐号绑定微信,下次打开小程序自动登录后台</view>
+          <button class="admin-button-com blue middle" @click="autoLogin()">授权并绑定</button>
+        </view>
+      </view>
+    </form>
+  </view>
+</template>
+<script>
+import { bindAutoLogin} from "@/api/mini";
+export default {
+  name: "miniAutoLogin",
+  components: {
+  },
+  data() {
+    return {
+    };
+  },
+  computed: {},
+  onLoad(props) {
+
+  },
+  methods: {
+     autoLogin() {
+       let currentMiniOpenId = uni.getStorageSync('currentMiniOpenId')
+       if(this.$util.isEmpty(currentMiniOpenId)){
+         this.$msg('启用失败')
+         return false
+       }
+       let that = this
+       uni.getUserProfile({
+          desc:'登录',
+          success:(res)=>{
+            bindAutoLogin({ iv: res.iv, encryptedData: res.encryptedData,miniOpenId:currentMiniOpenId }).then( res => {
+              if(res.code == 1){
+                that.$msg('绑定成功')
+                setTimeout(() => {
+									uni.navigateBack()
+								},900)
+              }
+            });
+          }
+        })
+    }
+  }
+};
+</script>

+ 4 - 0
hdApp/src/api/mini/index.js

@@ -25,3 +25,7 @@ export const getWxInfo = data => {
 export const getWxPhone = data => {
 	return https.post('/admin/mini-mobile', data)
 }
+
+export const bindAutoLogin = data => {
+	return https.post('/admin/bind-auto-login', data)
+}

+ 4 - 1
hdApp/src/mixins/globalMixins.js

@@ -42,7 +42,10 @@ export default {
 			if(this.$util.isEmpty(token)){
 				if(currentRoute == 'admin/home/workbench'){
 					wxLoginFn(true).then(res => {
-						let token = res.token || ''
+						let token = res.data.token || ''
+						//用于开启小程序自动登录
+						let currentMiniOpenId = res.data.currentMiniOpenId || ''
+						uni.setStorageSync('currentMiniOpenId', currentMiniOpenId)
 						if (!this.$util.isEmpty(token)) {
 							getUser(true)
 							this.setUserShopAll()

+ 5 - 24
hdApp/src/pages.json

@@ -187,30 +187,11 @@
 		{
 			"root": "admin/staff",
 			"pages": [
-				{
-					"path": "list",
-					"style": {
-						"navigationBarTitleText": "员工管理"
-					}
-				},
-				{
-					"path": "add",
-					"style": {
-						"navigationBarTitleText": ""
-					}
-				},
-				{
-					"path": "sel-member",
-					"style": {
-						"navigationBarTitleText": "客户列表"
-					}
-				},
-				{
-					"path": "achieve",
-					"style": {
-						"navigationBarTitleText": "员工业绩"
-					}
-				}
+				{ "path": "list", "style": { "navigationBarTitleText": "员工管理" } },
+				{ "path": "add", "style": { "navigationBarTitleText": "" } },
+				{ "path": "sel-member", "style": { "navigationBarTitleText": "客户列表" } },
+				{ "path": "achieve", "style": { "navigationBarTitleText": "员工业绩" } },
+				{ "path": "miniAutoLogin", "style": { "navigationBarTitleText": "绑定帐号" } }
 			]
 		},
 		{

+ 5 - 16
hdApp/src/pagesClient/official/apply.vue

@@ -256,12 +256,10 @@ export default {
       ];
       let formData = this.form;
       let checkRes = form.validation(formData, rules);
-
       if(this.$util.isEmpty(this.form.cover)){
         this.$msg('请上传照片')
         return false
       }
-
       if (!checkRes) {
         uni.showLoading({mask:true})
         setTimeout(() => {
@@ -273,20 +271,11 @@ export default {
       }
     },
     confirmFn () {
-      applyRegister({
-        hdShopAdminId: this.option.hdShopAdminId,
-        ghsShopAdminId: this.option.ghsShopAdminId,
-        ...this.form,
-        style: this.option.style || 0,
-        from: this.option.from || 0
-      }).then(res => {
-        this.$util.pageTo({
-          url: "/pagesClient/official/result",
-          type: 2,
-          query: {
-            pagestatus: 3
-          }
-        });
+      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 } })
       });
     }
   },