Bläddra i källkod

Merge branch 'v4.7.0dev' of https://gitee.com/ZhongBangKeJi/CRMEB into v4.7.0dev

From-wh 2 år sedan
förälder
incheckning
7ca75812f4

+ 6 - 1
crmeb/app/api/controller/v1/wechat/AuthController.php

@@ -37,7 +37,12 @@ class AuthController
     /**
     /**
      * 小程序授权登录
      * 小程序授权登录
      * @param Request $request
      * @param Request $request
-     * @return mixed
+     * @return \think\Response
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/02/24
      */
      */
     public function mp_auth(Request $request)
     public function mp_auth(Request $request)
     {
     {

+ 17 - 0
crmeb/app/api/controller/v2/wechat/AuthController.php

@@ -79,6 +79,23 @@ class AuthController
             return app('json')->fail(410019);
             return app('json')->fail(410019);
     }
     }
 
 
+    /**
+     * 小程序绑定手机号
+     * @param string $code
+     * @param string $iv
+     * @param string $encryptedData
+     * @return \think\Response
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/02/24
+     */
+    public function bindingPhone($code = '', $iv = '', $encryptedData = '')
+    {
+        if (!$code || !$iv || !$encryptedData) return app('json')->fail(100100);
+        $this->services->bindingPhone($code, $iv, $encryptedData);
+        return app('json')->success(410016);
+    }
+
     /** 以下方法该版本暂未使用 */
     /** 以下方法该版本暂未使用 */
     /**
     /**
      * 小程序授权登录
      * 小程序授权登录

+ 3 - 1
crmeb/app/api/route/v2.php

@@ -35,7 +35,9 @@ Route::group('v2', function () {
         //是否强制绑定手机号
         //是否强制绑定手机号
         Route::get('bind_status', 'v2.PublicController/bindPhoneStatus');
         Route::get('bind_status', 'v2.PublicController/bindPhoneStatus');
         //小程序授权绑定手机号
         //小程序授权绑定手机号
-        Route::post('auth_bindind_phone', 'v2.wechat.AuthController/authBindingPhone');
+        Route::post('auth_bindind_phone', 'v2.wechat.AuthController/bindingPhone');
+        //小程序授权后绑定手机号
+        Route::post('routine/binding_phone', 'v2.wechat.AuthController/authBindingPhone');
         //小程序手机号登录直接绑定
         //小程序手机号登录直接绑定
         Route::post('phone_silence_auth', 'v2.wechat.AuthController/silenceAuthBindingPhone');
         Route::post('phone_silence_auth', 'v2.wechat.AuthController/silenceAuthBindingPhone');
         //微信手机号登录直接绑定
         //微信手机号登录直接绑定

+ 28 - 0
crmeb/app/services/wechat/RoutineServices.php

@@ -461,6 +461,34 @@ class RoutineServices extends BaseServices
             throw new ApiException(410019);
             throw new ApiException(410019);
     }
     }
 
 
+    /**
+     * @param $code
+     * @param $iv
+     * @param $encryptedData
+     * @return bool
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/02/24
+     */
+    public function bindingPhone($code, $iv, $encryptedData)
+    {
+        [$userInfoCong, $userInfo] = app()->make(OAuth::class, ['mini_program'])->oauth($code, [
+            'iv' => $iv,
+            'encryptedData' => $encryptedData
+        ]);
+        if (!$userInfo || !isset($userInfo['purePhoneNumber'])) {
+            throw new ApiException(410079);
+        }
+        $uid = app()->make(WechatUserServices::class)->openidTouid($userInfoCong['openid']);
+        $userServices = app()->make(UserServices::class);
+        if ($userServices->count(['phone|account' => $userInfo['purePhoneNumber']])) {
+            throw new ApiException(410028);
+        }
+        $res = app()->make(UserServices::class)->update(['id' => $uid], ['phone' => $userInfo['purePhoneNumber']]);
+        if ($res) return true;
+        throw new ApiException(410017);
+    }
+
 
 
     /**
     /**
      * 更新用户信息
      * 更新用户信息

+ 10 - 2
crmeb/app/services/wechat/WechatUserServices.php

@@ -198,6 +198,10 @@ class WechatUserServices extends BaseServices
      * 授权后获取用户信息
      * 授权后获取用户信息
      * @param $openid
      * @param $openid
      * @param $user_type
      * @param $user_type
+     * @return array|\think\Model|null
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/02/24
      */
      */
     public function getAuthUserInfo($openid, $user_type)
     public function getAuthUserInfo($openid, $user_type)
     {
     {
@@ -256,10 +260,14 @@ class WechatUserServices extends BaseServices
 
 
     /**
     /**
      * 微信授权成功后
      * 微信授权成功后
-     * @param $event
+     * @param array $data
+     * @return array|mixed|\think\Model|null
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\db\exception\ModelNotFoundException
-     * @throws \think\exception\DbException
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/02/24
      */
      */
     public function wechatOauthAfter(array $data)
     public function wechatOauthAfter(array $data)
     {
     {

+ 1 - 3
template/admin/src/pages/app/wechat/menus/index.vue

@@ -1,9 +1,7 @@
 <template>
 <template>
   <div class="article-manager">
   <div class="article-manager">
-    <div class="i-layout-page-header">
-      <div class="i-layout-page-header">
+    <div class="i-layout-page-header" style="padding: 18px 32px;border-bottom: 1px solid #f2f2f2;">
         <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
         <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
-      </div>
     </div>
     </div>
     <Card :bordered="false" dis-hover class="ivu-mt">
     <Card :bordered="false" dis-hover class="ivu-mt">
       <!-- 公众号设置 -->
       <!-- 公众号设置 -->

+ 1 - 1
template/admin/src/pages/finance/billingRecords/index.vue

@@ -1,6 +1,6 @@
 <template>
 <template>
   <div>
   <div>
-    <Card :bordered="false" dis-hover class="ive-mt tablebox">
+    <Card :bordered="false" dis-hover class="ive-mt">
       <div class="ive-mt tabbox">
       <div class="ive-mt tabbox">
         <Tabs @on-click="onClickTab" class="mb20">
         <Tabs @on-click="onClickTab" class="mb20">
           <TabPane label="日账单" name="day" />
           <TabPane label="日账单" name="day" />

+ 0 - 16
template/admin/src/pages/marketing/lottery/create.vue

@@ -1,21 +1,5 @@
 <template>
 <template>
   <div>
   <div>
-    <div class="i-layout-page-header header_top">
-      <div class="i-layout-page-header fl_header">
-        <!-- <router-link :to="{ path: '/admin/marketing/lottery/index' }"
-          ><Button icon="ios-arrow-back" size="small" type="text"
-            >返回</Button
-          ></router-link
-        > -->
-        <!-- <Divider type="vertical" /> -->
-        <span
-          class="ivu-page-header-title mr20"
-          style="padding: 0"
-          v-text="$route.params.id ? '编辑抽奖信息' : '添加抽奖信息'"
-        ></span>
-      </div>
-    </div>
-
     <Card :bordered="false" dis-hover class="ivu-mt">
     <Card :bordered="false" dis-hover class="ivu-mt">
       <div>
       <div>
         <Tabs v-model="formValidate.factor" @on-click="onClickTab">
         <Tabs v-model="formValidate.factor" @on-click="onClickTab">

+ 3 - 1
template/admin/src/pages/marketing/sign/index.vue

@@ -1,5 +1,8 @@
 <template>
 <template>
   <div :style="bgcolors">
   <div :style="bgcolors">
+    <div class="i-layout-page-header">
+      <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
+    </div>
     <div class="box-wrapper">
     <div class="box-wrapper">
       <div v-if="name == 'sign_day_num'" class="iframe" :bordered="false">
       <div v-if="name == 'sign_day_num'" class="iframe" :bordered="false">
         <div class="iframe-box">
         <div class="iframe-box">
@@ -1174,7 +1177,6 @@ export default {
   padding: 20px;
   padding: 20px;
   background-color: #fff;
   background-color: #fff;
   border-radius: 5px;
   border-radius: 5px;
-  margin: 20px;
 }
 }
 
 
 .iview-video-style {
 .iview-video-style {

+ 15 - 8
template/admin/src/pages/marketing/storeCombination/combinaList.vue

@@ -348,12 +348,19 @@ export default {
 </script>
 </script>
 
 
 <style scoped lang="stylus">
 <style scoped lang="stylus">
-.tabBox_img
-    width 36px
-    height 36px
-    border-radius:4px
-    cursor pointer
-    img
-        width 100%
-        height 100%
+.article-manager{
+  margin-top: 3px;
+}
+.tabBox_img{
+  width: 36px;
+  height: 36px;
+  border-radius:4px;
+  cursor: pointer;
+  img{
+    width: 100%;
+    height: 100%;
+  }
+
+}
+
 </style>
 </style>

+ 0 - 5
template/admin/src/pages/marketing/storeCombination/index.vue

@@ -1,10 +1,5 @@
 <template>
 <template>
   <div>
   <div>
-    <div class="i-layout-page-header">
-      <div class="i-layout-page-header">
-        <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
-      </div>
-    </div>
     <Card :bordered="false" dis-hover class="ivu-mt">
     <Card :bordered="false" dis-hover class="ivu-mt">
       <Form
       <Form
         ref="formValidate"
         ref="formValidate"

+ 6 - 0
template/admin/src/pages/setting/setSystem/index.vue

@@ -1,4 +1,9 @@
 <template>
 <template>
+  <div>
+    <div class="i-layout-page-header" style="padding: 18px 32px;border-bottom: 1px solid #f2f2f2;">
+      <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
+    </div>
+
   <div class="article-manager">
   <div class="article-manager">
     <Card :bordered="false" dis-hover class="ivu-mt fromBox">
     <Card :bordered="false" dis-hover class="ivu-mt fromBox">
       <Tabs v-model="currentTab" @on-click="changeTab" v-if="headerList.length">
       <Tabs v-model="currentTab" @on-click="changeTab" v-if="headerList.length">
@@ -22,6 +27,7 @@
       <Spin size="large" fix v-if="spinShow"></Spin>
       <Spin size="large" fix v-if="spinShow"></Spin>
     </Card>
     </Card>
   </div>
   </div>
+  </div>
 </template>
 </template>
 
 
 <script>
 <script>

+ 2 - 2
template/admin/src/pages/setting/systemOutInterface/index.vue

@@ -892,7 +892,7 @@ export default {
   .main-btn {}
   .main-btn {}
   .card-tree{
   .card-tree{
     width: 270px;
     width: 270px;
-    height: calc(100vh - 190px);
+    height: calc(100vh - 115px);
     overflow-y: scroll;
     overflow-y: scroll;
   }
   }
   >>> .tree {
   >>> .tree {
@@ -981,7 +981,7 @@ export default {
   }
   }
   .right-card {
   .right-card {
     flex: 1;
     flex: 1;
-    max-height: calc(100vh - 190px);
+    max-height: calc(100vh - 115px);
     overflow-y: scroll;
     overflow-y: scroll;
   }
   }
 
 

+ 27 - 20
template/admin/src/pages/system/maintain/systemFile/login.vue

@@ -1,9 +1,7 @@
 <template>
 <template>
   <div>
   <div>
     <div class="i-layout-page-header">
     <div class="i-layout-page-header">
-      <div class="i-layout-page-header">
         <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
         <span class="ivu-page-header-title">{{ $route.meta.title }}</span>
-      </div>
     </div>
     </div>
     <Row type="flex">
     <Row type="flex">
       <Col span="24">
       <Col span="24">
@@ -105,10 +103,13 @@ export default {
 </script>
 </script>
 
 
 <style scoped lang="stylus">
 <style scoped lang="stylus">
+.i-layout-page-header{
+  padding: 18px 32px;
+}
 .maxInpt{
 .maxInpt{
-    max-width 400px
-    margin-left auto
-    margin-right auto
+    max-width: 400px;
+    margin-left: auto;
+    margin-right: auto;
 }
 }
 .index_from{
 .index_from{
   display: flex;
   display: flex;
@@ -117,27 +118,33 @@ export default {
   align-items: center;
   align-items: center;
 }
 }
 .trip{
 .trip{
-    width 400px
+    width: 400px;
     text-align: left;
     text-align: left;
-    color #aaa
+    color: #aaa;
 }
 }
 .page-account-container{
 .page-account-container{
-    text-align center
-    padding 200px 0
+    text-align: center;
+    padding: 200px 0;
 }
 }
 .page-account-top{
 .page-account-top{
-    margin-bottom 50px
+    margin-bottom: 50px;
+}
+.page-account-top-tit{
+  font-size:30px;
+  color:#1890FF;
+  font-weight:500;
+}
+
+.page-account-other{
+  text-align:center;
+  color:#1890FF;
+  font-size:12px;
+  span{
+    cursor: pointe;
+  }
 }
 }
-.page-account-top-tit
-    font-size 30px
-    color #1890FF
-    font-weight 500
-.page-account-other
-    text-align center
-    color #1890FF
-    font-size 12px
-    span
-        cursor pointer
+
+
 >>> .btn{
 >>> .btn{
   font-size: 15px !important;
   font-size: 15px !important;
 }
 }