From 3756eeaca02872fb88caa7282dd83fdb5a9bc357 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 26 二月 2026 16:20:29 +0800
Subject: [PATCH] 经销商管理
---
mini-program/pages.json | 2
mini-program/pagesA/pages/shop_points/shop_points.vue | 1
mini-program/utils/shareMixin.js | 2
mini-program/store/index.js | 16 +++
mini-program/App.vue | 45 ++++++++++
admin/src/views/business/information.vue | 6
admin/src/components/business/OperaInformationWindow.vue | 7 +
mini-program/unpackage/dist/dev/mp-weixin/common/main.js | 121 +++++++++++++++++++++++++++--
admin/.env.development | 3
9 files changed, 180 insertions(+), 23 deletions(-)
diff --git a/admin/.env.development b/admin/.env.development
index 89c4ee9..184aad2 100644
--- a/admin/.env.development
+++ b/admin/.env.development
@@ -7,5 +7,4 @@
#姹熻悕鏈湴
#VUE_APP_API_BASE_URL='http://localhost:10014'
-#浠诲悍鏈湴
-VUE_APP_API_BASE_URL='http://192.168.1.17:12014'
+VUE_APP_API_BASE_URL='http://192.168.0.7/dmmall_admin_api/'
diff --git a/admin/src/components/business/OperaInformationWindow.vue b/admin/src/components/business/OperaInformationWindow.vue
index 9268057..f9805e2 100644
--- a/admin/src/components/business/OperaInformationWindow.vue
+++ b/admin/src/components/business/OperaInformationWindow.vue
@@ -1,5 +1,6 @@
<template>
<GlobalWindow
+ width="80%"
:title="title"
:visible.sync="visible"
v-loading="isUploading"
@@ -131,6 +132,12 @@
::v-deep .el-form-item__content {
flex: 0.6;
}
+::v-deep .el-select {
+ width: 100%;
+ .el-input__inner {
+ width: 100%;
+ }
+}
$image-width: 100px;
.avatar-uploader {
width: $image-width;
diff --git a/admin/src/views/business/information.vue b/admin/src/views/business/information.vue
index 63886e8..637ef7f 100644
--- a/admin/src/views/business/information.vue
+++ b/admin/src/views/business/information.vue
@@ -49,7 +49,7 @@
<!-- 琛ㄦ牸鍜屽垎椤� -->
<template v-slot:table-wrap>
<ul class="toolbar" v-permissions="['business:activity:create', 'business:activity:delete']">
- <li><el-button type="primary" @click="$refs.operaInformationWindow.open('鏂板缓')" icon="el-icon-plus" v-permissions="['business:activity:create']">鏂板缓</el-button></li>
+ <li><el-button type="primary" @click="$refs.operaInformationWindow.open('鏂板缓鐭ヨ瘑搴�')" icon="el-icon-plus" v-permissions="['business:activity:create']">鏂板缓</el-button></li>
<li><el-button type="danger" @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:activity:delete']">鍒犻櫎</el-button></li>
</ul>
<el-table
@@ -101,7 +101,7 @@
fixed="right"
>
<template slot-scope="{row}">
- <el-button type="text" @click="$refs.operaInformationWindow.open('缂栬緫', row)" icon="el-icon-edit" v-permissions="['business:activity:update']">缂栬緫</el-button>
+ <el-button type="text" @click="$refs.operaInformationWindow.open('缂栬緫鐭ヨ瘑搴�', row)" icon="el-icon-edit" v-permissions="['business:activity:update']">缂栬緫</el-button>
<el-button type="text" style="color: red;" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:activity:delete']">鍒犻櫎</el-button>
</template>
</el-table-column>
@@ -176,7 +176,7 @@
})
this.search()
labelList({
- type: 0 // 鍟嗗搧鍒嗙被
+ type: 9// 鍟嗗搧鍒嗙被
}).then(res => {
this.labels = res
})
diff --git a/mini-program/App.vue b/mini-program/App.vue
index 3898567..13baf01 100644
--- a/mini-program/App.vue
+++ b/mini-program/App.vue
@@ -5,7 +5,8 @@
computed: {
...mapState(['userInfo', 'token'])
},
- onLaunch: async function() {
+ onLaunch: async function(options) {
+ // this.dealRecShopUserBiz(options)
// 鐧诲綍
var that = this;
if (!this.token) {
@@ -44,13 +45,51 @@
await that.checkLocationAuth()
}
},
- onShow: function() {
- console.log('App Show')
+ onShow:async function(options) {
+ this.dealRecShopUserBiz(options)
},
onHide: function() {
console.log('App Hide')
},
methods: {
+ async dealRecShopUserBiz(options){
+ console.error("鍚姩鍙傛暟",options)
+ if(options.query && options.query.userId){
+ if(!this.userInfo || !this.userInfo.id){
+ await this.$store.commit('setRecUserId',options.query.userId)
+ }
+ }
+ if(options.query && options.query.scene && options.query.scene.length){
+ if(options.query.scene.indexOf("sid_")>=0){
+ let s = options.query.scene.indexOf("sid_")+4;
+ var shopId = '';
+ let e = options.query.scene.length
+ let ts = options.query.scene.slice(s, e)
+ e = ts.length
+ if(ts.indexOf("&")>0){
+ e =ts.indexOf("&")
+ }
+ if(e>0){
+ shopId =ts.slice(0, e)
+ }
+ if(shopId){
+ if(this.userInfo&& this.userInfo.id){
+ try{
+ let res = await this.$u.api.bindShopInfo({ code })
+ if(res.code != 200){
+ await this.$store.commit('setRecShopId',shopId)
+ }
+ }catch(e){
+ await this.$store.commit('setRecShopId',shopId)
+ }
+ }else{
+ await this.$store.commit('setRecShopId',shopId)
+ }
+
+ }
+ }
+ }
+ },
checkLocationAuth() {
uni.getSetting({
success: (res) => {
diff --git a/mini-program/pages.json b/mini-program/pages.json
index 0a16566..8ac9870 100644
--- a/mini-program/pages.json
+++ b/mini-program/pages.json
@@ -288,7 +288,7 @@
"path" : "pages/rich-text-page/rich-text-page",
"style" :
{
- "navigationBarTitleText" : "璇︽儏"
+ "navigationBarTitleText" : ""
}
}
]
diff --git a/mini-program/pagesA/pages/shop_points/shop_points.vue b/mini-program/pagesA/pages/shop_points/shop_points.vue
index 96bb747..9da1f06 100644
--- a/mini-program/pagesA/pages/shop_points/shop_points.vue
+++ b/mini-program/pagesA/pages/shop_points/shop_points.vue
@@ -1,6 +1,5 @@
<template>
<view class="points">
-
<view class="info-rule" @click="jumpService">绉垎瑙勫垯</view>
<view class="head" :style="{ backgroundImage: 'url(' + backImage + ')', height: 'calc(' + (navHeight + statusbarHeight + 'px + 376rpx)') }">
<view :style="{ width: '100%', height: navHeight + statusbarHeight + 'px' }"></view>
diff --git a/mini-program/store/index.js b/mini-program/store/index.js
index 9577216..dfbe7a7 100644
--- a/mini-program/store/index.js
+++ b/mini-program/store/index.js
@@ -9,6 +9,8 @@
const shopInfo = uni.getStorageSync('shopInfo');
const openid = uni.getStorageSync('openid');
const token = uni.getStorageSync('token');
+const recuserid = uni.getStorageSync('recuserid');
+const recshopid = uni.getStorageSync('recshopid');
const shopToken = uni.getStorageSync('shopToken');
@@ -23,7 +25,9 @@
token: token || '',
shopToken: shopToken || '',
openid: openid || '',
- position: null
+ position: null,
+ recuserid:recuserid||'',
+ recshopid:recshopid||'',
},
mutations: {
// 璁剧疆瀵艰埅鏍忛珮搴�
@@ -47,6 +51,14 @@
state.openid = openid
uni.setStorageSync('openid', openid);
},
+ setRecUserId(state, recuserid) {
+ state.recuserid = recuserid
+ uni.setStorageSync('recuserid', recuserid);
+ },
+ setRecShopId(state, recshopid) {
+ state.recshopid = recshopid
+ uni.setStorageSync('recshopid', recshopid);
+ },
// 璁剧疆鐢ㄦ埛淇℃伅
setUserInfo(state, val) {
state.userInfo = val
@@ -68,6 +80,8 @@
uni.removeStorageSync('userInfo');
uni.removeStorageSync('token');
uni.removeStorageSync('openid');
+ uni.removeStorageSync('recshopid');
+ uni.removeStorageSync('recshopid');
}
},
diff --git a/mini-program/unpackage/dist/dev/mp-weixin/common/main.js b/mini-program/unpackage/dist/dev/mp-weixin/common/main.js
index 7f5252f..d193727 100644
--- a/mini-program/unpackage/dist/dev/mp-weixin/common/main.js
+++ b/mini-program/unpackage/dist/dev/mp-weixin/common/main.js
@@ -132,12 +132,13 @@
var _default = {
computed: _objectSpread({}, (0, _vuex.mapState)(['userInfo', 'token'])),
onLaunch: function () {
- var _onLaunch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
+ var _onLaunch = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
var that, res;
return _regenerator.default.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
+ // this.dealRecShopUserBiz(options)
// 鐧诲綍
that = this;
if (this.token) {
@@ -197,7 +198,7 @@
}
}, _callee);
}));
- function success(_x) {
+ function success(_x2) {
return _success.apply(this, arguments);
}
return success;
@@ -229,27 +230,125 @@
}
}, _callee2, this);
}));
- function onLaunch() {
+ function onLaunch(_x) {
return _onLaunch.apply(this, arguments);
}
return onLaunch;
}(),
- onShow: function onShow() {
- console.log('App Show');
- },
+ onShow: function () {
+ var _onShow = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(options) {
+ return _regenerator.default.wrap(function _callee3$(_context3) {
+ while (1) {
+ switch (_context3.prev = _context3.next) {
+ case 0:
+ this.dealRecShopUserBiz(options);
+ case 1:
+ case "end":
+ return _context3.stop();
+ }
+ }
+ }, _callee3, this);
+ }));
+ function onShow(_x3) {
+ return _onShow.apply(this, arguments);
+ }
+ return onShow;
+ }(),
onHide: function onHide() {
console.log('App Hide');
},
methods: {
- checkLocationAuth: function checkLocationAuth() {
+ dealRecShopUserBiz: function dealRecShopUserBiz(options) {
var _this = this;
+ return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
+ var s, shopId, e, ts, res;
+ return _regenerator.default.wrap(function _callee4$(_context4) {
+ while (1) {
+ switch (_context4.prev = _context4.next) {
+ case 0:
+ console.error("鍚姩鍙傛暟", options);
+ if (!(options.query && options.query.userId)) {
+ _context4.next = 5;
+ break;
+ }
+ if (!(!_this.userInfo || !_this.userInfo.id)) {
+ _context4.next = 5;
+ break;
+ }
+ _context4.next = 5;
+ return _this.$store.commit('setRecUserId', options.query.userId);
+ case 5:
+ if (!(options.query && options.query.scene && options.query.scene.length)) {
+ _context4.next = 33;
+ break;
+ }
+ if (!(options.query.scene.indexOf("sid_") >= 0)) {
+ _context4.next = 33;
+ break;
+ }
+ s = options.query.scene.indexOf("sid_") + 4;
+ shopId = '';
+ e = options.query.scene.length;
+ ts = options.query.scene.slice(s, e);
+ e = ts.length;
+ if (ts.indexOf("&") > 0) {
+ e = ts.indexOf("&");
+ }
+ if (e > 0) {
+ shopId = ts.slice(0, e);
+ }
+ if (!shopId) {
+ _context4.next = 33;
+ break;
+ }
+ if (!(_this.userInfo && _this.userInfo.id)) {
+ _context4.next = 31;
+ break;
+ }
+ _context4.prev = 16;
+ _context4.next = 19;
+ return _this.$u.api.bindShopInfo({
+ code: code
+ });
+ case 19:
+ res = _context4.sent;
+ if (!(res.code != 200)) {
+ _context4.next = 23;
+ break;
+ }
+ _context4.next = 23;
+ return _this.$store.commit('setRecShopId', shopId);
+ case 23:
+ _context4.next = 29;
+ break;
+ case 25:
+ _context4.prev = 25;
+ _context4.t0 = _context4["catch"](16);
+ _context4.next = 29;
+ return _this.$store.commit('setRecShopId', shopId);
+ case 29:
+ _context4.next = 33;
+ break;
+ case 31:
+ _context4.next = 33;
+ return _this.$store.commit('setRecShopId', shopId);
+ case 33:
+ case "end":
+ return _context4.stop();
+ }
+ }
+ }, _callee4, null, [[16, 25]]);
+ }))();
+ },
+ checkLocationAuth: function checkLocationAuth() {
+ var _this2 = this;
uni.getSetting({
success: function success(res) {
if (!res.authSetting['scope.userLocation']) {
uni.authorize({
scope: 'scope.userLocation',
success: function success() {
- _this.positioning();
+ _this2.positioning();
},
fail: function fail() {
uni.showModal({
@@ -258,16 +357,16 @@
confirmText: '鍘昏缃�',
success: function success(res) {
if (res.confirm) {
- _this.goToAppSetting();
+ _this2.goToAppSetting();
} else {
- _this.$isResolve();
+ _this2.$isResolve();
}
}
});
}
});
} else {
- _this.positioning();
+ _this2.positioning();
}
}
});
diff --git a/mini-program/utils/shareMixin.js b/mini-program/utils/shareMixin.js
index 5fda0bd..b96e3ae 100644
--- a/mini-program/utils/shareMixin.js
+++ b/mini-program/utils/shareMixin.js
@@ -5,7 +5,7 @@
shareConfig: {
title: '榧庡厓鍐滄満鍟嗗煄',
path: '/pages/index/index',
- imageUrl: '/static/icon/default2.png'
+ imageUrl: '/static/images/share.jpg'
}
}
},
--
Gitblit v1.9.3