shish %!s(int64=3) %!d(string=hai) anos
pai
achega
25e3555325

+ 4 - 0
mallApp/src/api/user/index.js

@@ -6,4 +6,8 @@ export const recentShop = data => {
 
 export const create = data => {
 	return https.post('/user/create', data)
+}
+
+export const accountLogin = data => {
+	return https.get('/user/account-login', data)
 }

+ 2 - 1
mallApp/src/pages.json

@@ -1,5 +1,5 @@
 {
-    "pages": [{ "path": "pages/home/recent", "style": { "navigationBarTitleText": "花店" } },
+    "pages": [{ "path": "pages/home/recent", "style": { "navigationBarTitleText": "我的花店" } },
         { "path": "pages/home/index", "style": { "navigationBarTitleText": "首页" } },
         { "path": "pages/home/category", "style": { "navigationBarTitleText": "所有分类" } },
         { "path": "pages/home/shop", "style": { "navigationBarTitleText": "门店" } },
@@ -28,6 +28,7 @@
             "root": "pages/login",
             "pages": [
                 { "path": "index", "style": { "navigationBarTitleText": "登录" } },
+                { "path": "account", "style": { "navigationBarTitleText": "登录" } },
                 { "path": "result", "style": { "navigationBarTitleText": "登录成功" } }
             ]
         },

+ 85 - 0
mallApp/src/pages/login/account.vue

@@ -0,0 +1,85 @@
+<template>
+  <view class="app-content">
+    <view>
+      <form @submit="formSubmit">
+        <view class="module-com input-line-wrap">
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title" style="width:120upx;">账号</view>
+
+                <input type="number" v-model="form.mobile" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="mobile" placeholder="请填写账号" />
+
+          </tui-list-cell>
+          <tui-list-cell class="line-cell" :hover="false">
+            <view class="tui-title" style="width:120upx;">密码</view>
+
+                <input type="password" v-model="form.password" placeholder-class="phcolor" placeholder-style="color:#ccc" class="tui-input" name="password" placeholder="请填写密码" />
+
+          </tui-list-cell>
+          <view class="btn-wrap">
+            <button class="admin-button-com blue big" style="border:none;" formType="submit">登录</button>
+          </view>
+        </view>
+      </form>
+    </view>
+  </view>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell"
+const form = require("@/utils/formValidation.js")
+import { accountLogin } from "@/api/user"
+import store from '@/store'
+export default {
+  name: "account",
+  components: {
+    TuiListCell
+  },
+  data() {
+    return {
+      form: {
+        mobile:"",
+        password:""
+      }
+    };
+  },
+  methods: {
+    init(){
+
+    },
+    confirmFn() {
+      let that = this
+      accountLogin({...this.form}).then(res => {
+        if(res.code == 1){
+          uni.setStorageSync('token', res.data.token)
+          if(res.data.user && !that.$util.isEmpty(res.data.user)){
+            store.commit('setLoginInfo', res.data.user)
+            uni.navigateBack()
+          }
+        }
+      })
+    },
+    formSubmit(e) {
+      let rules = [
+        {
+          name: "mobile",
+          rule: ["required"],
+          msg: ["请填写账号"]
+        },
+        {
+          name: "password",
+          rule: ["required"],
+          msg: ["请填写密码"]
+        }
+      ]
+      let formData = this.form;
+      let checkRes = form.validation(formData, rules);
+      if (!checkRes) {
+        this.confirmFn();
+      } else {
+        this.$msg(checkRes);
+      }
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+</style>

+ 7 - 3
mallApp/src/pages/login/index.vue

@@ -15,8 +15,9 @@
             <button class="admin-button-com blue middle" style="border:none;" @click="getWxAvatar" >帮我填</button>
           </tui-list-cell>
           <view class="btn-wrap">
-            <button class="admin-button-com blue big" style="border:none;" formType="submit">确认</button>
+            <button class="admin-button-com blue big" style="border:none;" formType="submit">登录</button>
           </view>
+          <view style="float:right;font-size:30upx;margin-right:40upx;color:#333333;" @click="accountLogin()"><text>使用账号密码登录</text></view>
         </view>
       </form>
     </view>
@@ -42,9 +43,12 @@ export default {
     };
   },
   methods: {
-	init(){
+    accountLogin(){
+      this.$util.pageTo({url: "/pages/login/account",type:2})
+    },
+    init(){
 
-	},
+    },
     confirmFn() {
       let currentMiniOpenId = uni.getStorageSync('miniOpenId')
       let that = this