diff --git a/api/store.js b/api/store.js
index d935139..c0beaa5 100644
--- a/api/store.js
+++ b/api/store.js
@@ -545,4 +545,7 @@ export function priceRuleApi(id) {
noAuth: true
});
}
-
+// 酒道馆登录
+export function storeLogin(data) {
+ return request.get("store/merchant/login", data);
+}
diff --git a/api/supplier.js b/api/supplier.js
index 0393a63..db46fa7 100644
--- a/api/supplier.js
+++ b/api/supplier.js
@@ -12,6 +12,10 @@ export function supplierApplyRecord(data) {
export function supplierApplyInfo(data) {
return request.get(`supplier/apply_info`, data);
}
+// 供应商商品列表
+export function supplierGoodsList(data) {
+ return request.get(`supplier/goods_list`, data);
+}
diff --git a/pages.json b/pages.json
index 025ff01..732621d 100644
--- a/pages.json
+++ b/pages.json
@@ -1369,10 +1369,6 @@
"navigationBarTitleText": "佣金明细"
}
}
-
-
-
-
]
},
{
@@ -1390,7 +1386,16 @@
"style": {
"navigationBarTitleText": "申请记录"
}
+ },
+ {
+ "path": "stock/with_goods",
+ "style": {
+ "navigationBarTitleText": "立即进货"
+ }
}
+
+
+
]
},
{
diff --git a/pages/admin/business/index.vue b/pages/admin/business/index.vue
index b7efe0d..dfb4455 100644
--- a/pages/admin/business/index.vue
+++ b/pages/admin/business/index.vue
@@ -1,25 +1,42 @@
-
-
-
-
- {{item.title}}
-
-
-
-
-
-
+
+
+
+
+
+
+ {{item.title}}
+
+
+
+
+
+
+
+
+ 账号密码
+
+
+
+
+
+
+
+
+ 登录
+
+
+
@@ -35,6 +52,8 @@ import emptyPage from '@/components/emptyPage.vue'
import shopList from '@/components/shopList';
import {promoteQrCodes,onlinePaymentQrCodes} from "@/api/service";
import { getSiteQrCode } from '@/api/exchange.js';
+import {mapGetters} from "vuex";
+import {storeLogin} from "@/api/store";
export default {
name: 'business',
@@ -50,6 +69,11 @@ export default {
storeList: {},
// 二维码
qrCode: '',
+ // 酒道馆登录相关
+ loginInfo:{
+ account: '',
+ password: ''
+ },
}
},
computed: {
@@ -138,23 +162,37 @@ export default {
if(this.service.purchase_permission){
list.push({
title: '进货',
- url: '/pages/store/shopStreet/index?merchant_type=2',
+ url: '/pages/supplier/stock/with_goods',
icon: 'iconfont icon-shangjiadingdan'
});
}
return list;
- }
+ },
+ ...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor', 'shopToken', 'shopIsLogin', 'shopMerId'])
},
onLoad: function(options) {
this.is_sys = options.is_sys;
- this.getStoreList({is_sys: this.is_sys});
+ // 设置页面标题
uni.setNavigationBarTitle({
title: this.is_sys == 1 ? '平台管理' : (this.is_sys == 2 ? '酒道馆管理' : '商家管理')
})
+
+
+ console.log("商户登录相关")
+ console.log({
+ shopIsLogin: this.shopIsLogin,
+ shopToken: this.shopToken
+
+ })
+ // 登录后操作
+ if(this.is_sys == 1 || this.shopIsLogin){
+ this.getStoreList({is_sys: this.is_sys});
+ }
},
methods: {
getStoreList: function(data) {
+ data.appoint_mer_id = this.shopMerId || '';
this.$nextTick(() => {
this.$refs.shopList.getStoreList(data)
});
@@ -271,109 +309,187 @@ export default {
closeQrCode(){
this.$refs.qrCodePopup.close();
},
+ // 商户登录 - 提交登录信息
+ clickLogin(){
+ let _this = this;
+ let params = _this.loginInfo || {};
+ storeLogin(params).then(res => {
+ if (res.status == 200) {
+ let data = res.data || {};
+ // console.log("商户登录成功")
+ // console.log(data)
+ _this.$store.commit("SHOP_LOGIN", {
+ 'token': data.token,
+ 'time': data.exp,
+ 'shop_mer_id': data.mer_id,
+ });
+ this.getStoreList({is_sys: this.is_sys});
+ }
+ }).catch(err => {
+ this.$util.Tips({ title: err });
+ });
+ }
+
+
+
+
}
}
diff --git a/pages/supplier/stock/with_goods.vue b/pages/supplier/stock/with_goods.vue
new file mode 100644
index 0000000..6e58b4b
--- /dev/null
+++ b/pages/supplier/stock/with_goods.vue
@@ -0,0 +1,382 @@
+
+
+
+
+
+
+
+
+ 搜索
+
+
+
+ 请添加你需要的商品进行进货!
+
+
+
+
+
+
+
+
+ {{ item.store_name }}
+ ¥{{ item.price }}
+
+
+
+
+
+ 按{{ item.batch_unit }}购买
+ 按{{ item.unit_name }}购买
+
+
+
+
+
+
+
+
+
+
+
+ 箱 共12瓶
+
+
+
+
+
+
+
+
+
+ 99+
+
+
+ 合计:¥54288.00
+
+
+ 立即结算
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pages/user/index.vue b/pages/user/index.vue
index 68b2a42..ad37cbf 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -183,7 +183,7 @@
{{ operation_center.province_title }}
-
+
{{ operation_center.county_title }}
@@ -264,18 +264,20 @@
-
- 商家管理
-
- 进入商家管理中心
+
+
+ 商家管理
+
+ 商家管理中心
+
-
-
- 酒道馆管理
-
- 进入酒道馆管理中心
+
+ 酒道馆管理
+
+ 酒道馆管理中心
+
-
+
@@ -296,7 +298,7 @@
{{ item.corporate_name || '' }}
-
+
{{ tagItem || '' }}
@@ -515,6 +517,14 @@
})
},
toService(is_sys){
+ // 判断:如果为0 || 2 清除商户登录状态
+ if(is_sys == 0 || is_sys == 2){
+ this.$store.commit("SHOP_LOGIN", {
+ 'token': null,
+ 'time': null,
+ 'shop_mer_id': null,
+ });
+ }
uni.navigateTo({
url: '/pages/admin/business/index?is_sys=' + is_sys
})
diff --git a/store/getters.js b/store/getters.js
index fedaa52..0b4ec2e 100644
--- a/store/getters.js
+++ b/store/getters.js
@@ -1,3 +1,4 @@
+import Cache from "../utils/cache";
export default {
token: state => state.app.token,
@@ -11,6 +12,10 @@ export default {
copyPwd: state => state.app.copyPwd,
viewColor: state => state.app.viewColor,
keyColor: state => state.app.keyColor,
+ // 商户登录相关
+ shopToken: state => state.app.shopToken,
+ shopIsLogin: state => !!state.app.shopToken,
+ shopMerId: state => state.app.shopMerId,
};
// export default {
// token: state => 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJrYWlmYS5jcm1lYi5uZXQiLCJhdWQiOiJrYWlmYS5jcm1lYi5uZXQiLCJpYXQiOjE1NzcwODM1MzQsIm5iZiI6MTU3NzA4MzUzNCwiZXhwIjoxNTc3MDk0MzM0LCJqdGkiOnsiaWQiOjExMCwidHlwZSI6InVzZXIifX0.U-i1pbdRjyXI1gr79Uq2XBPZ89T8f5Ai9jwrR8woTwE',
diff --git a/store/modules/app.js b/store/modules/app.js
index ce03bd1..fbe81b5 100644
--- a/store/modules/app.js
+++ b/store/modules/app.js
@@ -22,6 +22,9 @@ const state = {
pageFooter:uni.getStorageSync('pageFoot') || {},
keyColor: Cache.get('KEY_COLOR') || '_default',
viewColor: Cache.get('VIEW_COLOR') || '--view-theme: #E93323;--view-assist:#FF7612;--view-priceColor:#E93323;--view-bgColor:rgba(255, 118, 18,.1);--view-minorColor:rgba(233, 51, 35,.1);--view-bntColor11:#FDA923;--view-bntColor12:#FD6523;--view-bntColor21:#F11B09;--view-bntColor22:#F67A38;',
+ // 商户登录相关
+ shopToken: Cache.get('SHOP_LOGIN_STATUS_TOKEN') || null,
+ shopMerId: Cache.get('SHOP_MER_ID') || null,
};
const mutations = {
@@ -30,6 +33,11 @@ const mutations = {
Cache.set(LOGIN_STATUS, opt.token, opt.time);
uni.removeStorageSync('auth_token');
},
+ SHOP_LOGIN(state, opt) {
+ state.shopToken = opt.token;
+ Cache.set('SHOP_LOGIN_STATUS_TOKEN', opt.token, opt.time);
+ Cache.set('SHOP_MER_ID', opt.shop_mer_id);
+ },
SETUID(state,val){
state.uid = val;
Cache.set(UID, val);
diff --git a/utils/request.js b/utils/request.js
index 8a0c47a..d2aeab5 100644
--- a/utils/request.js
+++ b/utils/request.js
@@ -69,6 +69,7 @@ function baseRequest(url, method, data, {
}
}
if (store.state.app.token) header[TOKENNAME] = 'Bearer ' + store.state.app.token;
+ if (store.state.app.shopToken) header['Shop-Token'] = 'Bearer ' + store.state.app.shopToken;
return new Promise((reslove, reject) => {
uni.request({
url: Url + '/api/' + url,