guhongwei 4 jaren geleden
bovenliggende
commit
e4113ca202

+ 2 - 2
app.js

@@ -34,9 +34,9 @@ App({
   },
   },
   globalData: {
   globalData: {
     userInfo: null,
     userInfo: null,
-    // publicUrl: 'http://192.168.1.119:11000'
+    publicUrl: 'http://192.168.1.19:11000'
     // publicUrl: 'http://124.71.143.119'
     // publicUrl: 'http://124.71.143.119'
-    publicUrl: 'https://htyd.imonsters.cn'
+    // publicUrl: 'https://htyd.imonsters.cn'
   },
   },
   id: 'wx74f916cbbb2173fa',
   id: 'wx74f916cbbb2173fa',
 })
 })

+ 2 - 0
app.json

@@ -18,6 +18,8 @@
     "pages/car/car",
     "pages/car/car",
     "pages/shareholder/shareholder",
     "pages/shareholder/shareholder",
     "pages/user/user",
     "pages/user/user",
+    "pages/adminUser/check",
+    "pages/adminUser/adminUser",
     "pages/index/index",
     "pages/index/index",
     "pages/logs/logs",
     "pages/logs/logs",
     "pages/test/test"
     "pages/test/test"

+ 13 - 11
node_modules/vant-weapp/package.json

@@ -1,36 +1,38 @@
 {
 {
-  "_from": "vant-weapp",
+  "_args": [
+    [
+      "vant-weapp@0.5.28",
+      "D:\\project\\progress\\鸿泰跃达\\fastNetwork"
+    ]
+  ],
+  "_from": "vant-weapp@0.5.28",
   "_id": "vant-weapp@0.5.28",
   "_id": "vant-weapp@0.5.28",
   "_inBundle": false,
   "_inBundle": false,
   "_integrity": "sha512-GAJ2PTLuhXHWpAD5B7DdRQdkEFMdjdduuMzKkThUjIiQ63ESnaJvIEUbW3RgiUNNV7PYXwhOFOd6woR/JsTFLA==",
   "_integrity": "sha512-GAJ2PTLuhXHWpAD5B7DdRQdkEFMdjdduuMzKkThUjIiQ63ESnaJvIEUbW3RgiUNNV7PYXwhOFOd6woR/JsTFLA==",
   "_location": "/vant-weapp",
   "_location": "/vant-weapp",
   "_phantomChildren": {},
   "_phantomChildren": {},
   "_requested": {
   "_requested": {
-    "type": "tag",
+    "type": "version",
     "registry": true,
     "registry": true,
-    "raw": "vant-weapp",
+    "raw": "vant-weapp@0.5.28",
     "name": "vant-weapp",
     "name": "vant-weapp",
     "escapedName": "vant-weapp",
     "escapedName": "vant-weapp",
-    "rawSpec": "",
+    "rawSpec": "0.5.28",
     "saveSpec": null,
     "saveSpec": null,
-    "fetchSpec": "latest"
+    "fetchSpec": "0.5.28"
   },
   },
   "_requiredBy": [
   "_requiredBy": [
-    "#USER",
     "/"
     "/"
   ],
   ],
   "_resolved": "https://registry.npmjs.org/vant-weapp/-/vant-weapp-0.5.28.tgz",
   "_resolved": "https://registry.npmjs.org/vant-weapp/-/vant-weapp-0.5.28.tgz",
-  "_shasum": "426edb8aec5284a1a7beab1b5e9cb73e5144c41b",
-  "_spec": "vant-weapp",
-  "_where": "D:\\project\\progress\\5G极速网络\\fastNetwork",
+  "_spec": "0.5.28",
+  "_where": "D:\\project\\progress\\鸿泰跃达\\fastNetwork",
   "author": {
   "author": {
     "name": "youzan"
     "name": "youzan"
   },
   },
   "bugs": {
   "bugs": {
     "url": "https://github.com/youzan/vant-weapp/issues"
     "url": "https://github.com/youzan/vant-weapp/issues"
   },
   },
-  "bundleDependencies": false,
-  "deprecated": false,
   "description": "轻量、可靠的小程序 UI 组件库",
   "description": "轻量、可靠的小程序 UI 组件库",
   "devDependencies": {
   "devDependencies": {
     "@babel/core": "^7.5.5",
     "@babel/core": "^7.5.5",

+ 1 - 1
package.json

@@ -15,4 +15,4 @@
   "dependencies": {
   "dependencies": {
     "vant-weapp": "^0.5.28"
     "vant-weapp": "^0.5.28"
   }
   }
-}
+}

+ 55 - 0
pages/adminUser/adminUser.js

@@ -0,0 +1,55 @@
+//获取应用实例
+const app = getApp()
+Page({
+  data: {
+    active: 0,
+    // 待审核
+    oneList: [],
+    // 审核通过
+    twoList: []
+  },
+  // 审核用户
+  checkBtn: function (data) {
+    wx.navigateTo({
+      url: `../adminUser/check?id=${data.currentTarget.dataset.id}`
+    })
+  },
+  onLoad: function () {
+    // 查询办卡列表
+    // 待审核
+    wx.request({
+      url: app.globalData.publicUrl + '/api/htyd/card',
+      method: "get",
+      data: { status: '1' },
+      success: (res) => {
+        if (res.data.errcode == '0') {
+          console.log(res.data.data);
+          this.setData({ oneList: res.data.data })
+        } else {
+          wx.showToast({
+            title: '查询失败',
+            icon: 'error',
+            duration: 2000
+          })
+        }
+      }
+    })
+    // 审核通过
+    wx.request({
+      url: app.globalData.publicUrl + '/api/htyd/card',
+      method: "get",
+      data: { status: '0' },
+      success: (res) => {
+        if (res.data.errcode == '0') {
+          this.setData({ twoList: res.data.data })
+        } else {
+          wx.showToast({
+            title: '查询失败',
+            icon: 'error',
+            duration: 2000
+          })
+        }
+      }
+    })
+  },
+})

+ 3 - 0
pages/adminUser/adminUser.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 42 - 0
pages/adminUser/adminUser.wxml

@@ -0,0 +1,42 @@
+<view class="main">
+  <view class="one">
+    用户管理
+  </view>
+  <view class="two">
+    <van-tabs active="{{ active }}">
+      <van-tab title="待审核">
+        <view class="tab">
+          <view class="list" wx:key="unique" wx:for="{{oneList}}" wx:for-item="item">
+            <view class="mobile">
+              <text>{{item.mobile}}</text>
+            </view>
+            <view class="other">
+              <view>办卡人:<text>{{item.name||'暂无'}}</text></view>
+              <view>办卡时间:<text>{{item.create_time||'暂无'}}</text></view>
+              <view>推荐人:<text>{{item.recommend||'暂无'}}</text></view>
+              <view>联系电话:<text>{{item.r_mobile||'暂无'}}</text></view>
+            </view>
+            <view class="btn">
+              <van-button type="info" round size="small" bindtap="checkBtn" data-id="{{item._id}}">审核</van-button>
+            </view>
+          </view>
+        </view>
+      </van-tab>
+      <van-tab title="审核通过">
+        <view class="tab">
+          <view class="list" wx:key="unique" wx:for="{{twoList}}" wx:for-item="item">
+            <view class="mobile">
+              <text>{{item.mobile}}</text>
+            </view>
+            <view class="other">
+              <view>办卡人:<text>{{item.name||'暂无'}}</text></view>
+              <view>办卡时间:<text>{{item.create_time||'暂无'}}</text></view>
+              <view>推荐人:<text>{{item.recommend||'暂无'}}</text></view>
+              <view>联系电话:<text>{{item.r_mobile||'暂无'}}</text></view>
+            </view>
+          </view>
+        </view>
+      </van-tab>
+    </van-tabs>
+  </view>
+</view>

+ 60 - 0
pages/adminUser/adminUser.wxss

@@ -0,0 +1,60 @@
+.main {
+  float: left;
+  width: 100%;
+  height: 100%;
+  background-color: #f6f6f6;
+}
+
+.main .one {
+  position: fixed;
+  z-index: 9999;
+  width: 100%;
+  height: 80rpx;
+  line-height: 80rpx;
+  background-color: #409eff;
+  color: #ffffff;
+  text-align: center;
+}
+
+.main .two {
+  position: absolute;
+  top: 80rpx;
+  width: 100%;
+}
+
+.main .two .tab {
+  padding: 0 20rpx;
+  margin: 20rpx 0 0 0;
+}
+
+.main .two .tab .list {
+  /* border: 1px solid #ff0000; */
+  margin: 0 0 15rpx 0;
+  padding: 15rpx;
+  border-radius: 15rpx;
+  box-shadow: 0 0 5px #999;
+}
+
+.main .two .tab .list .mobile {
+  font-size: 40rpx;
+  font-weight: bold;
+  color: #ff0000;
+}
+
+.main .two .tab .list .other {
+  font-size: 35rpx;
+  color: #666;
+}
+
+.main .two .tab .list .other view {
+  margin: 10rpx 0 0 0;
+}
+
+.main .two .tab .list .other view text {
+  color: #000;
+}
+
+.main .two .tab .list .btn {
+  text-align: center;
+  margin: 10rpx 0 0 0;
+}

+ 125 - 0
pages/adminUser/check.js

@@ -0,0 +1,125 @@
+//获取应用实例
+const app = getApp()
+Page({
+  data: {
+    form: {},
+  },
+  onLoad: function (options) {
+    wx.request({
+      url: app.globalData.publicUrl + `/api/htyd/card/${options.id}`,
+      method: "get",
+      data: {},
+      success: (res) => {
+        if (res.data.errcode == '0') {
+          let cardInfo = res.data.data;
+          wx.request({
+            url: app.globalData.publicUrl + '/api/htyd/xzqh',
+            method: "get",
+            data: { code: cardInfo.province },
+            success: (proRes) => {
+              cardInfo.province = proRes.data.data[0].name;
+              // 查询市区
+              wx.request({
+                url: app.globalData.publicUrl + '/api/htyd/xzqh',
+                method: "get",
+                data: { pcode: proRes.data.data[0].code },
+                success: (cityRes) => {
+                  let city = cityRes.data.data.find(i => i.code == cardInfo.city)
+                  cardInfo.city = city.name;
+                  // 查询套餐
+                  wx.request({
+                    url: app.globalData.publicUrl + '/api/htyd/set/' + cardInfo.set,
+                    method: "get",
+                    data: {},
+                    success: (setRes) => {
+                      if (setRes.data.errcode === 0) {
+                        cardInfo.set = setRes.data.data.title
+                        console.log(cardInfo);
+                        this.setData({ form: cardInfo })
+                      }
+                    }
+                  })
+                }
+              })
+            }
+          })
+        } else {
+          wx.showToast({
+            title: '查询失败',
+            icon: 'error',
+            duration: 2000
+          })
+        }
+      }
+    })
+  },
+  formSubmit: function (e) {
+    const params = e.detail.value;
+    wx.request({
+      url: app.globalData.publicUrl + '/api/htyd/card/check/' + this.data.form.id,
+      method: "post",
+      data: params,
+      success: (res) => {
+        if (res.data.errcode === 0) {
+          wx.showToast({
+            title: '审核成功',
+            icon: 'error',
+            duration: 2000
+          })
+          wx.redirectTo({
+            url: '/pages/adminUser/adminUser',
+          })
+        }
+      }
+    })
+  },
+
+  /**
+   * 生命周期函数--监听页面初次渲染完成
+   */
+  onReady: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面显示
+   */
+  onShow: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面隐藏
+   */
+  onHide: function () {
+
+  },
+
+  /**
+   * 生命周期函数--监听页面卸载
+   */
+  onUnload: function () {
+
+  },
+
+  /**
+   * 页面相关事件处理函数--监听用户下拉动作
+   */
+  onPullDownRefresh: function () {
+
+  },
+
+  /**
+   * 页面上拉触底事件的处理函数
+   */
+  onReachBottom: function () {
+
+  },
+
+  /**
+   * 用户点击右上角分享
+   */
+  onShareAppMessage: function () {
+
+  }
+})

+ 3 - 0
pages/adminUser/check.json

@@ -0,0 +1,3 @@
+{
+  "usingComponents": {}
+}

+ 59 - 0
pages/adminUser/check.wxml

@@ -0,0 +1,59 @@
+<view class="main">
+  <view class="one">
+    审核用户
+  </view>
+  <view class="two">
+    <form bindsubmit="formSubmit" bindreset="formReset">
+      <view class="forminput">
+        <text class="label">注册账号</text>
+        <input type='number' name="mobile" value="{{form.mobile}}" placeholder='注册账号' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">号码归属省</text>
+        <input type='text' name="province" value="{{form.province}}" placeholder='号码归属省' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">号码归属市</text>
+        <input type='text' name="city" value="{{form.city}}" placeholder='号码归属市' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">套餐</text>
+        <input type='text' name="set" value="{{form.set}}" placeholder='套餐' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">姓名</text>
+        <input type='text' name="name" value="{{form.name}}" placeholder='姓名' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">身份证号</text>
+        <input type='text' name="id_card" value="{{form.id_card}}" maxlength="18" placeholder='身份证号' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">微信账号</text>
+        <input type='text' name="wxaccount" value="{{form.wxaccount}}" placeholder='微信账号' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">推荐人</text>
+        <input type='text' name="recommend" value="{{form.recommend}}" placeholder='推荐人' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">推荐人电话</text>
+        <input type='number' name="r_mobile" value="{{form.r_mobile}}" placeholder='推荐人电话' disabled></input>
+      </view>
+      <view class="forminput">
+        <text class="label">状态</text>
+        <view class="page-section page-section-gap">
+          <radio-group name="status">
+            <label>
+              <radio value="0" />审核通过</label>
+            <label>
+              <radio value="-1" />审核拒绝</label>
+          </radio-group>
+        </view>
+      </view>
+      <view class="save">
+        <button form-type="submit">提交</button>
+      </view>
+    </form>
+  </view>
+</view>

+ 97 - 0
pages/adminUser/check.wxss

@@ -0,0 +1,97 @@
+.main {
+  float: left;
+  width: 100%;
+  height: 100%;
+  background-color: #f6f6f6;
+}
+
+.main .one {
+  position: fixed;
+  z-index: 9999;
+  width: 100%;
+  height: 80rpx;
+  line-height: 80rpx;
+  background-color: #409eff;
+  color: #ffffff;
+  text-align: center;
+}
+
+.main .two {
+  position: absolute;
+  top: 80rpx;
+  width: 100%;
+}
+
+.main .two .forminput {
+  float: left;
+  width: 94%;
+  margin: 0 20rpx;
+  border-bottom: 1px solid #ccc;
+}
+
+.main .two .forminput .label {
+  float: left;
+  width: 30%;
+  font-size: 30rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+}
+
+.main .two .forminput input {
+  float: left;
+  width: 70%;
+  padding: 18rpx 0;
+  text-align: right;
+}
+
+.main .two .forminput .tip {
+  float: left;
+  width: 100%;
+  padding: 10rpx 0;
+  font-size: 20rpx;
+  color: #ff0000;
+}
+
+.main .two .formData {
+  float: left;
+  width: 94%;
+  margin: 0 20rpx;
+  border-bottom: 1px solid #ccc;
+}
+
+.main .two .formData .label {
+  float: left;
+  width: 30%;
+  font-size: 30rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+}
+
+.main .two .formData .createTime {
+  float: right;
+  width: 70%;
+  text-align: right;
+  font-size: 30rpx;
+  height: 80rpx;
+  line-height: 80rpx;
+  color: #666;
+}
+
+.main .two .save {
+  float: left;
+  width: 94%;
+  margin: 40rpx 20rpx 0 20rpx;
+}
+
+.main .two .save button {
+  border-radius: 50rpx;
+  background-color: #ff0000;
+  color: #ffffff;
+}
+
+.page-section {
+  padding: 10rpx 0;
+}
+.page-section label {
+  margin: 0 15rpx;
+}

+ 1 - 1
pages/card/card.js

@@ -131,7 +131,7 @@ Page({
             duration: 2000
             duration: 2000
           })
           })
           wx.redirectTo({
           wx.redirectTo({
-            url: 'pages/home/home',
+            url: '/pages/home/home',
           })
           })
         } else {
         } else {
           wx.showToast({
           wx.showToast({

+ 9 - 3
pages/home/home.js

@@ -95,7 +95,6 @@ Page({
       url: '../car/car'
       url: '../car/car'
     })
     })
   },
   },
-
   // 股东奖池
   // 股东奖池
   gdBtn: function () {
   gdBtn: function () {
     wx.navigateTo({
     wx.navigateTo({
@@ -103,9 +102,15 @@ Page({
     })
     })
   },
   },
   // 用户列表
   // 用户列表
-  userBtn: function () {
+  // userBtn: function () {
+  //   wx.navigateTo({
+  //     url: '../user/user'
+  //   })
+  // },
+  // 用户管理
+  adminBtn: function () {
     wx.navigateTo({
     wx.navigateTo({
-      url: '../user/user'
+      url: '../adminUser/adminUser'
     })
     })
   },
   },
   onLoad: function () {
   onLoad: function () {
@@ -152,6 +157,7 @@ Page({
       method: 'get',
       method: 'get',
       success: res => {
       success: res => {
         const { data } = res.data
         const { data } = res.data
+        console.log(data);
         this.setData({ ...data })
         this.setData({ ...data })
       }
       }
     })
     })

+ 4 - 0
pages/home/home.wxml

@@ -96,6 +96,10 @@
         <image src="/pages/images/gd.png"></image>
         <image src="/pages/images/gd.png"></image>
         <text>股东奖池</text>
         <text>股东奖池</text>
       </view>
       </view>
+      <view class="num" bindtap="adminBtn" wx:if="{{ userInfo.admin }}">
+        <image src="/pages/images/admin.png"></image>
+        <text>用户管理</text>
+      </view>
     </van-col>
     </van-col>
   </van-row>
   </van-row>
 </view>
 </view>

BIN
pages/images/admin.png


+ 0 - 33
pages/login/login.wxss

@@ -41,36 +41,3 @@
   background-color: #ff0000;
   background-color: #ff0000;
   color: #ffffff;
   color: #ffffff;
 }
 }
-
-/* .main .one text {
-  font-size: 60rpx;
-}
-
-.main .two {
-  float: left;
-  width: 81%;
-  padding: 0 70rpx;
-}
-
-.main .two form .content {
-  margin: 0 0 30rpx 0;
-}
-
-.main .two form .content .input {
-  border: 1px solid #f1f1f1;
-  margin: 0 0 20rpx 0;
-  padding: 20rpx 10rpx;
-  border-radius: 10rpx;
-}
-
-.main .two form .save {
-  padding: 0 100rpx;
-}
-
-.main .two form .save button {
-  background-color: #ff0000;
-  color: #fff;
-  border-radius: 70rpx;
-  height: 90rpx;
-  line-height: 90rpx;
-} */

+ 1 - 0
pages/team/team.js

@@ -46,6 +46,7 @@ moment.locale('en', {
         success: (res) => {
         success: (res) => {
           if (res.data.errcode == '0') {
           if (res.data.errcode == '0') {
             let data = res.data.data;
             let data = res.data.data;
+            console.log(data);
             data.unshift({ title: '全部' });
             data.unshift({ title: '全部' });
             this.setData({ setList: res.data.data })
             this.setData({ setList: res.data.data })
           } else {
           } else {

+ 1 - 1
utils/wxValidate.js

@@ -89,7 +89,7 @@ class WxValidate {
        * 验证手机格式
        * 验证手机格式
        */
        */
       tel(value) {
       tel(value) {
-        return that.optional(value) || /^1[34578]\d{9}$/.test(value)
+        return that.optional(value) || /^1[123456789]\d{9}$/.test(value)
       },
       },
       /**
       /**
        * 验证URL格式
        * 验证URL格式