Ver Fonte

基础搭建

xiaohaizhao há 2 meses atrás
pai
commit
7959e2d70c

+ 22 - 0
CRM/customer/detail.js

@@ -0,0 +1,22 @@
+Page({
+  data: {
+    customerInfo: {}
+  },
+  onLoad(options) {
+    const id = options.id;
+    this.getCustomerDetail(id);
+  },
+  getCustomerDetail(id) {
+    // 模拟获取客户详情数据
+    const mockData = {
+      id: id,
+      name: `客户${id}`,
+      phone: `1380013800${id}`,
+      address: `地址${id}`,
+      email: `customer${id}@example.com`
+    };
+    this.setData({
+      customerInfo: mockData
+    });
+  }
+});

+ 4 - 0
CRM/customer/detail.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "客户详情"
+}

+ 18 - 0
CRM/customer/detail.wxml

@@ -0,0 +1,18 @@
+<view class="container">
+  <view class="info-item">
+    <view class="label">客户名称</view>
+    <view class="value">{{customerInfo.name}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">联系电话</view>
+    <view class="value">{{customerInfo.phone}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">地址</view>
+    <view class="value">{{customerInfo.address}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">邮箱</view>
+    <view class="value">{{customerInfo.email}}</view>
+  </view>
+</view>

+ 26 - 0
CRM/customer/detail.wxss

@@ -0,0 +1,26 @@
+.container {
+  padding: 20rpx;
+  background-color: #f5f5f5;
+  min-height: 100vh;
+}
+
+.info-item {
+  display: flex;
+  align-items: center;
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+}
+
+.label {
+  width: 160rpx;
+  font-size: 28rpx;
+  color: #666;
+}
+
+.value {
+  flex: 1;
+  font-size: 28rpx;
+  color: #333;
+}

+ 25 - 0
CRM/customer/index.js

@@ -0,0 +1,25 @@
+Page({
+  data: {
+    customerList: []
+  },
+  onLoad() {
+    this.getCustomerList();
+  },
+  getCustomerList() {
+    // 模拟获取客户列表数据
+    const mockData = [
+      { id: 1, name: '客户1', phone: '13800138001' },
+      { id: 2, name: '客户2', phone: '13800138002' },
+      { id: 3, name: '客户3', phone: '13800138003' }
+    ];
+    this.setData({
+      customerList: mockData
+    });
+  },
+  goToDetail(e) {
+    const id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `./detail?id=${id}`
+    });
+  }
+});

+ 4 - 0
CRM/customer/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "客户列表"
+}

+ 9 - 0
CRM/customer/index.wxml

@@ -0,0 +1,9 @@
+<view class="container">
+  <view class="customer-item" wx:for="{{customerList}}" wx:key="id" bindtap="goToDetail" data-id="{{item.id}}">
+    <view class="customer-info">
+      <view class="customer-name">{{item.name}}</view>
+      <view class="customer-phone">{{item.phone}}</view>
+    </view>
+    <view class="arrow">></view>
+  </view>
+</view>

+ 34 - 0
CRM/customer/index.wxss

@@ -0,0 +1,34 @@
+.container {
+  padding: 10rpx;
+}
+
+.customer-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
+}
+
+.customer-info {
+  flex: 1;
+}
+
+.customer-name {
+  font-size: 32rpx;
+  font-weight: bold;
+  margin-bottom: 8rpx;
+}
+
+.customer-phone {
+  font-size: 28rpx;
+  color: #666;
+}
+
+.arrow {
+  font-size: 32rpx;
+  color: #999;
+}

+ 25 - 0
CRM/lead/detail.js

@@ -0,0 +1,25 @@
+Page({
+  data: {
+    leadInfo: {}
+  },
+  onLoad(options) {
+    const id = options.id;
+    this.getLeadDetail(id);
+  },
+  getLeadDetail(id) {
+    // 模拟获取线索详情数据
+    const mockData = {
+      id: id,
+      name: `线索${id}`,
+      source: id === 1 ? '网站' : id === 2 ? '电话' : '展会',
+      status: id === 1 ? '待跟进' : id === 2 ? '跟进中' : '已转化',
+      contact: `1380013800${id}`,
+      email: `lead${id}@example.com`,
+      description: `线索${id}的详细描述`,
+      createTime: '2026-03-30'
+    };
+    this.setData({
+      leadInfo: mockData
+    });
+  }
+});

+ 4 - 0
CRM/lead/detail.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "线索详情"
+}

+ 30 - 0
CRM/lead/detail.wxml

@@ -0,0 +1,30 @@
+<view class="container">
+  <view class="info-item">
+    <view class="label">线索名称</view>
+    <view class="value">{{leadInfo.name}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">来源</view>
+    <view class="value">{{leadInfo.source}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">状态</view>
+    <view class="value">{{leadInfo.status}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">联系电话</view>
+    <view class="value">{{leadInfo.contact}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">邮箱</view>
+    <view class="value">{{leadInfo.email}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">创建时间</view>
+    <view class="value">{{leadInfo.createTime}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">描述</view>
+    <view class="value">{{leadInfo.description}}</view>
+  </view>
+</view>

+ 26 - 0
CRM/lead/detail.wxss

@@ -0,0 +1,26 @@
+.container {
+  padding: 20rpx;
+  background-color: #f5f5f5;
+  min-height: 100vh;
+}
+
+.info-item {
+  display: flex;
+  align-items: center;
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+}
+
+.label {
+  width: 160rpx;
+  font-size: 28rpx;
+  color: #666;
+}
+
+.value {
+  flex: 1;
+  font-size: 28rpx;
+  color: #333;
+}

+ 25 - 0
CRM/lead/index.js

@@ -0,0 +1,25 @@
+Page({
+  data: {
+    leadList: []
+  },
+  onLoad() {
+    this.getLeadList();
+  },
+  getLeadList() {
+    // 模拟获取线索列表数据
+    const mockData = [
+      { id: 1, name: '线索1', source: '网站', status: '待跟进' },
+      { id: 2, name: '线索2', source: '电话', status: '跟进中' },
+      { id: 3, name: '线索3', source: '展会', status: '已转化' }
+    ];
+    this.setData({
+      leadList: mockData
+    });
+  },
+  goToDetail(e) {
+    const id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `./detail?id=${id}`
+    });
+  }
+});

+ 4 - 0
CRM/lead/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "线索列表"
+}

+ 9 - 0
CRM/lead/index.wxml

@@ -0,0 +1,9 @@
+<view class="container">
+  <view class="lead-item" wx:for="{{leadList}}" wx:key="id" bindtap="goToDetail" data-id="{{item.id}}">
+    <view class="lead-info">
+      <view class="lead-name">{{item.name}}</view>
+      <view class="lead-source">来源: {{item.source}}</view>
+    </view>
+    <view class="lead-status">{{item.status}}</view>
+  </view>
+</view>

+ 37 - 0
CRM/lead/index.wxss

@@ -0,0 +1,37 @@
+.container {
+  padding: 10rpx;
+}
+
+.lead-item {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
+}
+
+.lead-info {
+  flex: 1;
+}
+
+.lead-name {
+  font-size: 32rpx;
+  font-weight: bold;
+  margin-bottom: 8rpx;
+}
+
+.lead-source {
+  font-size: 26rpx;
+  color: #666;
+}
+
+.lead-status {
+  font-size: 28rpx;
+  color: #085CDF;
+  padding: 4rpx 16rpx;
+  background-color: #e6f0ff;
+  border-radius: 16rpx;
+}

+ 27 - 0
CRM/order/detail.js

@@ -0,0 +1,27 @@
+Page({
+  data: {
+    orderInfo: {}
+  },
+  onLoad(options) {
+    const id = options.id;
+    this.getOrderDetail(id);
+  },
+  getOrderDetail(id) {
+    // 模拟获取订单详情数据
+    const mockData = {
+      id: id,
+      orderNo: `ORD00${id}`,
+      amount: `${id}000`,
+      status: id === 1 ? '已完成' : id === 2 ? '处理中' : '待处理',
+      customerName: `客户${id}`,
+      createTime: '2026-03-30',
+      items: [
+        { name: '商品1', quantity: 1, price: '500' },
+        { name: '商品2', quantity: 1, price: '500' }
+      ]
+    };
+    this.setData({
+      orderInfo: mockData
+    });
+  }
+});

+ 4 - 0
CRM/order/detail.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "订单详情"
+}

+ 32 - 0
CRM/order/detail.wxml

@@ -0,0 +1,32 @@
+<view class="container">
+  <view class="info-item">
+    <view class="label">订单号</view>
+    <view class="value">{{orderInfo.orderNo}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">客户名称</view>
+    <view class="value">{{orderInfo.customerName}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">订单金额</view>
+    <view class="value">¥{{orderInfo.amount}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">订单状态</view>
+    <view class="value">{{orderInfo.status}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">创建时间</view>
+    <view class="value">{{orderInfo.createTime}}</view>
+  </view>
+  <view class="section-title">商品明细</view>
+  <view class="item-list">
+    <view class="item" wx:for="{{orderInfo.items}}" wx:key="index">
+      <view class="item-name">{{item.name}}</view>
+      <view class="item-info">
+        <view class="item-quantity">x{{item.quantity}}</view>
+        <view class="item-price">¥{{item.price}}</view>
+      </view>
+    </view>
+  </view>
+</view>

+ 73 - 0
CRM/order/detail.wxss

@@ -0,0 +1,73 @@
+.container {
+  padding: 20rpx;
+  background-color: #f5f5f5;
+  min-height: 100vh;
+}
+
+.info-item {
+  display: flex;
+  align-items: center;
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+}
+
+.label {
+  width: 160rpx;
+  font-size: 28rpx;
+  color: #666;
+}
+
+.value {
+  flex: 1;
+  font-size: 28rpx;
+  color: #333;
+}
+
+.section-title {
+  font-size: 32rpx;
+  font-weight: bold;
+  margin: 20rpx 0;
+  color: #333;
+}
+
+.item-list {
+  background-color: #fff;
+  border-radius: 8rpx;
+  padding: 20rpx;
+}
+
+.item {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 15rpx 0;
+  border-bottom: 1rpx solid #f0f0f0;
+}
+
+.item:last-child {
+  border-bottom: none;
+}
+
+.item-name {
+  font-size: 28rpx;
+  color: #333;
+}
+
+.item-info {
+  display: flex;
+  align-items: center;
+}
+
+.item-quantity {
+  font-size: 26rpx;
+  color: #666;
+  margin-right: 20rpx;
+}
+
+.item-price {
+  font-size: 28rpx;
+  font-weight: bold;
+  color: #333;
+}

+ 25 - 0
CRM/order/index.js

@@ -0,0 +1,25 @@
+Page({
+  data: {
+    orderList: []
+  },
+  onLoad() {
+    this.getOrderList();
+  },
+  getOrderList() {
+    // 模拟获取订单列表数据
+    const mockData = [
+      { id: 1, orderNo: 'ORD001', amount: '1000', status: '已完成' },
+      { id: 2, orderNo: 'ORD002', amount: '2000', status: '处理中' },
+      { id: 3, orderNo: 'ORD003', amount: '3000', status: '待处理' }
+    ];
+    this.setData({
+      orderList: mockData
+    });
+  },
+  goToDetail(e) {
+    const id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `./detail?id=${id}`
+    });
+  }
+});

+ 4 - 0
CRM/order/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "订单列表"
+}

+ 9 - 0
CRM/order/index.wxml

@@ -0,0 +1,9 @@
+<view class="container">
+  <view class="order-item" wx:for="{{orderList}}" wx:key="id" bindtap="goToDetail" data-id="{{item.id}}">
+    <view class="order-header">
+      <view class="order-no">订单号: {{item.orderNo}}</view>
+      <view class="order-status">{{item.status}}</view>
+    </view>
+    <view class="order-amount">金额: ¥{{item.amount}}</view>
+  </view>
+</view>

+ 33 - 0
CRM/order/index.wxss

@@ -0,0 +1,33 @@
+.container {
+  padding: 10rpx;
+}
+
+.order-item {
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
+}
+
+.order-header {
+  display: flex;
+  justify-content: space-between;
+  margin-bottom: 10rpx;
+}
+
+.order-no {
+  font-size: 28rpx;
+  color: #333;
+}
+
+.order-status {
+  font-size: 28rpx;
+  color: #085CDF;
+}
+
+.order-amount {
+  font-size: 32rpx;
+  font-weight: bold;
+  color: #333;
+}

+ 28 - 0
CRM/warehouse/detail.js

@@ -0,0 +1,28 @@
+Page({
+  data: {
+    warehouseInfo: {}
+  },
+  onLoad(options) {
+    const id = options.id;
+    this.getWarehouseDetail(id);
+  },
+  getWarehouseDetail(id) {
+    // 模拟获取仓库详情数据
+    const mockData = {
+      id: id,
+      name: `仓库${id}`,
+      location: `位置${id}`,
+      capacity: `${id}000`,
+      manager: `管理员${id}`,
+      contact: `1380013800${id}`,
+      items: [
+        { name: '商品1', quantity: 100 },
+        { name: '商品2', quantity: 200 },
+        { name: '商品3', quantity: 300 }
+      ]
+    };
+    this.setData({
+      warehouseInfo: mockData
+    });
+  }
+});

+ 4 - 0
CRM/warehouse/detail.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "仓库详情"
+}

+ 29 - 0
CRM/warehouse/detail.wxml

@@ -0,0 +1,29 @@
+<view class="container">
+  <view class="info-item">
+    <view class="label">仓库名称</view>
+    <view class="value">{{warehouseInfo.name}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">位置</view>
+    <view class="value">{{warehouseInfo.location}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">容量</view>
+    <view class="value">{{warehouseInfo.capacity}} 件</view>
+  </view>
+  <view class="info-item">
+    <view class="label">管理员</view>
+    <view class="value">{{warehouseInfo.manager}}</view>
+  </view>
+  <view class="info-item">
+    <view class="label">联系电话</view>
+    <view class="value">{{warehouseInfo.contact}}</view>
+  </view>
+  <view class="section-title">库存商品</view>
+  <view class="item-list">
+    <view class="item" wx:for="{{warehouseInfo.items}}" wx:key="index">
+      <view class="item-name">{{item.name}}</view>
+      <view class="item-quantity">数量: {{item.quantity}}</view>
+    </view>
+  </view>
+</view>

+ 61 - 0
CRM/warehouse/detail.wxss

@@ -0,0 +1,61 @@
+.container {
+  padding: 20rpx;
+  background-color: #f5f5f5;
+  min-height: 100vh;
+}
+
+.info-item {
+  display: flex;
+  align-items: center;
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+}
+
+.label {
+  width: 160rpx;
+  font-size: 28rpx;
+  color: #666;
+}
+
+.value {
+  flex: 1;
+  font-size: 28rpx;
+  color: #333;
+}
+
+.section-title {
+  font-size: 32rpx;
+  font-weight: bold;
+  margin: 20rpx 0;
+  color: #333;
+}
+
+.item-list {
+  background-color: #fff;
+  border-radius: 8rpx;
+  padding: 20rpx;
+}
+
+.item {
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  padding: 15rpx 0;
+  border-bottom: 1rpx solid #f0f0f0;
+}
+
+.item:last-child {
+  border-bottom: none;
+}
+
+.item-name {
+  font-size: 28rpx;
+  color: #333;
+}
+
+.item-quantity {
+  font-size: 28rpx;
+  color: #666;
+}

+ 25 - 0
CRM/warehouse/index.js

@@ -0,0 +1,25 @@
+Page({
+  data: {
+    warehouseList: []
+  },
+  onLoad() {
+    this.getWarehouseList();
+  },
+  getWarehouseList() {
+    // 模拟获取仓库列表数据
+    const mockData = [
+      { id: 1, name: '仓库1', location: '位置1', capacity: '1000' },
+      { id: 2, name: '仓库2', location: '位置2', capacity: '2000' },
+      { id: 3, name: '仓库3', location: '位置3', capacity: '3000' }
+    ];
+    this.setData({
+      warehouseList: mockData
+    });
+  },
+  goToDetail(e) {
+    const id = e.currentTarget.dataset.id;
+    wx.navigateTo({
+      url: `./detail?id=${id}`
+    });
+  }
+});

+ 4 - 0
CRM/warehouse/index.json

@@ -0,0 +1,4 @@
+{
+  "usingComponents": {},
+  "navigationBarTitleText": "仓库管理"
+}

+ 10 - 0
CRM/warehouse/index.wxml

@@ -0,0 +1,10 @@
+<view class="container">
+  <view class="warehouse-item" wx:for="{{warehouseList}}" wx:key="id" bindtap="goToDetail" data-id="{{item.id}}">
+    <view class="warehouse-name">{{item.name}}</view>
+    <view class="warehouse-info">
+      <view class="location">位置: {{item.location}}</view>
+      <view class="capacity">容量: {{item.capacity}} 件</view>
+    </view>
+    <view class="arrow">></view>
+  </view>
+</view>

+ 42 - 0
CRM/warehouse/index.wxss

@@ -0,0 +1,42 @@
+.container {
+  padding: 10rpx;
+}
+
+.warehouse-item {
+  display: flex;
+  align-items: center;
+  padding: 20rpx;
+  background-color: #fff;
+  margin-bottom: 10rpx;
+  border-radius: 8rpx;
+  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
+}
+
+.warehouse-name {
+  font-size: 32rpx;
+  font-weight: bold;
+  margin-bottom: 8rpx;
+  flex: 1;
+}
+
+.warehouse-info {
+  flex: 1;
+  margin-left: 20rpx;
+}
+
+.location {
+  font-size: 26rpx;
+  color: #666;
+  margin-bottom: 4rpx;
+}
+
+.capacity {
+  font-size: 26rpx;
+  color: #666;
+}
+
+.arrow {
+  font-size: 32rpx;
+  color: #999;
+  margin-left: 20rpx;
+}

+ 15 - 1
app.json

@@ -110,6 +110,19 @@
         "submission/details",
         "submission/details",
         "mediaLibrary/index"
         "mediaLibrary/index"
       ]
       ]
+    },
+    {
+      "root": "CRM",
+      "pages": [
+        "customer/index",
+        "customer/detail",
+        "order/index",
+        "order/detail",
+        "warehouse/index",
+        "warehouse/detail",
+        "lead/index",
+        "lead/detail"
+      ]
     }
     }
   ],
   ],
   "preloadRule": {
   "preloadRule": {
@@ -118,7 +131,8 @@
         "packageA",
         "packageA",
         "select",
         "select",
         "Universal",
         "Universal",
-        "marketing"
+        "marketing",
+        "CRM"
       ],
       ],
       "network": "all"
       "network": "all"
     }
     }

+ 51 - 0
pages/index/index.js

@@ -88,6 +88,11 @@ Page({
 		if (page && wx.getStorageSync('userauth').length != 0) {
 		if (page && wx.getStorageSync('userauth').length != 0) {
 			let authList = {},
 			let authList = {},
 				entrance = [{
 				entrance = [{
+					label: "CRM",
+					appid: "wx7505ddb0a1ec6146",
+					icon: "work-E-dingdan",
+					list: getcrm()
+				},{
 					label: "E-订单",
 					label: "E-订单",
 					appid: "wx7505ddb0a1ec6146",
 					appid: "wx7505ddb0a1ec6146",
 					icon: "work-E-dingdan",
 					icon: "work-E-dingdan",
@@ -209,6 +214,52 @@ Page({
 				});
 				});
 				return dye(list.sort((a, b) => a.index - b.index))
 				return dye(list.sort((a, b) => a.index - b.index))
 			};
 			};
+			//CRM
+			function getcrm() {
+				let paths = [{
+					name: "客户",
+					key: "wcrmcustomer",
+					path: "/CRM/customer/index",
+					icon: "work-kehu"
+				}, {
+					name: "订单",
+					key: "wcrmorder",
+					path: "/CRM/order/index",
+					icon: "work-dingdan"
+				}, {
+					name: "仓库管理",
+					key: "wcrmwarehouse",
+					path: "/CRM/warehouse/index",
+					icon: "work-cangku"
+				}, {
+					name: "线索",
+					key: "wcrmlead",
+					path: "/CRM/lead/index",
+					icon: "work-xiansuo"
+				}];
+				let crm = getApp().globalData.queryPer.query(wx.getStorageSync('userauth'), ["CRM"], ["crm"]),
+					list = [];
+				crm.forEach(v => {
+					v.apps.forEach(s => {
+						authList[s.name] = {
+							options: s.meta.auth.map(a => a.option),
+							optionnames: s.meta.auth.map(a => a.optionname),
+							forms: s.meta.forms,
+							tables: s.meta.tables,
+						}
+						if (authList[s.name].options.some(s => s == "read")) {
+							let i = paths.findIndex(k => k.key == s.name || k.name == s.meta.title);
+							if (i != -1) {
+								paths[i].name = s.meta.title;
+								paths[i].index = i;
+								paths[i].isneedpay = s.isneedpay;
+								list.push(paths[i])
+							}
+						}
+					})
+				});
+				return dye(list.sort((a, b) => a.index - b.index))
+			};
 			//染色
 			//染色
 			function dye(list) {
 			function dye(list) {
 				let colorList = [{
 				let colorList = [{