jufubao-base 1.0.399 → 1.0.400

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,11 +8,11 @@
8
8
  */
9
9
  const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
10
10
  if(packname === 'gxd-commands-bussiness') {
11
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
11
+ return `/Users/shiyonggao/home/root/Base-Jufubao/xd-commands-bussiness/${threePackagePath}`;
12
12
  }
13
13
 
14
14
  if (packname === 'gxd-uni-library-editx') {
15
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
15
+ return `/Users/shiyonggao/home/root/Base-Jufubao/xd-uni-library-editx/${threePackagePath}`;
16
16
  }
17
17
 
18
18
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.399",
3
+ "version": "1.0.400",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -96,4 +96,28 @@ module.exports = [
96
96
  isConsole: true,
97
97
  disabled: true,
98
98
  },
99
+ {
100
+ title: "C端查看app_key",
101
+ path: "/aftersale/v1/online-customer-service/check",
102
+ mapFnName: "checkCustomerService",
103
+ isRule: false,
104
+ params: {
105
+ main_order_id: ['订单ID', 'String', true],
106
+ },
107
+ isConsole: true,
108
+ disabled: true,
109
+ },
110
+ {
111
+ title: "根据供应商ID更新在线客服内容",
112
+ path: "/aftersale/v1/online-customer-service/update",
113
+ mapFnName: "updateCustomerService",
114
+ isRule: false,
115
+ data: {
116
+ supplier_id: ['供应商ID', 'Number', true],
117
+ content: ['在线客服内容', 'String', true],
118
+ namespace: ['业务线', 'String', true],
119
+ },
120
+ isConsole: true,
121
+ disabled: true,
122
+ }
99
123
  ];
@@ -1,9 +1,16 @@
1
1
  'use strict';
2
+ import {
3
+ dataVal,
4
+ statusDataVal,
5
+ statusShow,
6
+ getRemoteOptions
7
+ } from "@/utils/AttrTools";
8
+ import ICONS from "@/ICONS.js"
2
9
 
3
10
  export default {
4
11
  style: [],
5
12
  advanced: [],
6
- content: (data)=>{
13
+ content: (data, gValue, gColor, oldData)=>{
7
14
  return [
8
15
  {
9
16
  label: "申请售后:",
@@ -724,6 +731,34 @@ export default {
724
731
  { label: '隐藏', value: '0' },
725
732
  ]
726
733
  },
734
+ {
735
+ label: '底部客服',
736
+ ele: 'xd-cus-switch',
737
+ valueKey: 'showService',
738
+ value: dataVal({ data, key: 'showService', dValue: gValue.isAdd && gValue.isFirst ? 'Y' : "N", gValue }),
739
+ className: 'input100',
740
+ groupKey:'content',
741
+ labelInline: true,
742
+ cusStyle: { marginBottom: '10px' },
743
+ setting: {
744
+ tips: ['显示', '不显示'],
745
+ isBackType: 'string'
746
+ },
747
+ },
748
+ { ele: 'group_start' },
749
+ {
750
+ label: '图标样式',
751
+ ele: 'xd-select-list',
752
+ valueKey: 'serviceIcon',
753
+ labelInline: true,
754
+ value: data['serviceIcon'] || '',
755
+ placeholder: '请选择客服ICON',
756
+ className: 'input60',
757
+ groupKey:'content',
758
+ list: ICONS,
759
+ hidden: data.showService !== 'Y'
760
+ },
761
+ { ele: 'group_end' },
727
762
  {
728
763
  label: '售后服务页面路径:',
729
764
  ele: 'xd-select-pages-path',
@@ -858,13 +858,24 @@
858
858
  </view>
859
859
  <view
860
860
  style="height: 100rpx"
861
- v-if="info.buttons && info.buttons.length > 0"
861
+ v-if="(info.buttons && info.buttons.length > 0) || showService === 'Y'"
862
862
  ></view>
863
863
  <view
864
864
  class="jfb-base-order-detail__body-btn"
865
865
  :style="prod_bottom"
866
- v-if="info.buttons && info.buttons.length > 0"
866
+ v-if="(info.buttons && info.buttons.length > 0) || showService === 'Y'"
867
867
  >
868
+ <view>
869
+ <view
870
+ v-if="showService === 'Y'"
871
+ class="cs-btn"
872
+ @click="handleCustomerService"
873
+ >
874
+ <xd-font-icon :icon="serviceIcon" size="40" color="#333"></xd-font-icon>
875
+ <text class="cs-btn__text">客服</text>
876
+ </view>
877
+ </view>
878
+
868
879
  <view :style="[bottomBoxStyle]" class="btn_wrap">
869
880
  <view v-for="(item, index) in info.buttons" :key="index">
870
881
  <view
@@ -1003,6 +1014,42 @@
1003
1014
  <xd-button type="primary" @click="showSupplement=false">关闭</xd-button>
1004
1015
  </view>
1005
1016
  </XdDownDrawer>
1017
+ <XdDownDrawer :isClose="false" height="auto" :show.sync="showCustomerDrawer">
1018
+ <view class="customer-drawer">
1019
+ <view class="customer-drawer-title">
1020
+ <view style="margin: 0 auto">请选择要咨询的订单</view>
1021
+ </view>
1022
+ <view class="customer-drawer-list">
1023
+ <view
1024
+ v-for="(item, index) in customerSubOrders"
1025
+ :key="index"
1026
+ class="customer-drawer-item"
1027
+ >
1028
+ <view class="customer-drawer-item-sub">子单号:{{ item.sub_order_id }}</view>
1029
+ <view class="customer-drawer-item-body">
1030
+ <xd-jfb-image
1031
+ width="120"
1032
+ height="120"
1033
+ bgc="#f8f8f8"
1034
+ radius="10"
1035
+ shadow="10"
1036
+ mode="scaleToFill"
1037
+ :src="item.products[0].product_thumb"
1038
+ ></xd-jfb-image>
1039
+ <view class="customer-drawer-item-info">
1040
+ <view class="customer-drawer-item-price">
1041
+ <xd-unit :price="item.products.reduce((sum, p) => sum + p.sale_price * p.product_num, 0)" :color="mainColor" :fontSize="32"></xd-unit>
1042
+ </view>
1043
+ <view class="customer-drawer-item-count">共{{ item.products.reduce((sum, p) => sum + p.product_num, 0) }}件</view>
1044
+ </view>
1045
+ <view class="customer-drawer-item-btn">
1046
+ <xd-button type="primary" size="small" @click="handleGoCustomerService(item)">去咨询</xd-button>
1047
+ </view>
1048
+ </view>
1049
+ </view>
1050
+ </view>
1051
+ </view>
1052
+ </XdDownDrawer>
1006
1053
  </view>
1007
1054
  </template>
1008
1055
 
@@ -1132,6 +1179,8 @@ export default {
1132
1179
 
1133
1180
  code_location: 'none',
1134
1181
  is_show_invoice: 'N',
1182
+ showService: 'Y',
1183
+ serviceIcon: '',
1135
1184
  invoicePath: '',
1136
1185
  isShowInvoice: false,
1137
1186
  invoiceStatus: '',
@@ -1140,6 +1189,9 @@ export default {
1140
1189
  reorderTips: [],
1141
1190
  reorderBtnItem: null,
1142
1191
 
1192
+ showCustomerDrawer: false,
1193
+ customerSubOrders: [],
1194
+
1143
1195
  //是否显示电话
1144
1196
  isSHowPhone:'N', //是否显示手机号码
1145
1197
  isPhoneReg: /^[\d-]+$/
@@ -1635,6 +1687,8 @@ export default {
1635
1687
  }
1636
1688
  }
1637
1689
  this.is_show_invoice = getContainerPropsValue(container, "content.is_show_invoice", "N");
1690
+ this.showService = getContainerPropsValue(container, "content.showService", "");
1691
+ this.serviceIcon = getContainerPropsValue(container, "content.serviceIcon", 'iconkefu');
1638
1692
  this.invoicePath = getContainerPropsValue(container, "content.invoicePath", { value: "", }).value;
1639
1693
  this.viewInvoicePath = getContainerPropsValue(container, "content.viewInvoicePath", { value: "", }).value;
1640
1694
  },
@@ -1855,6 +1909,133 @@ export default {
1855
1909
  console.error(`item.action=${item.action}, 此action不可用`)
1856
1910
  }
1857
1911
  },
1912
+ handleCustomerService() {
1913
+ if (this.info.customer_info) {
1914
+ // customer_info 存在时,直接跳转客服,不再调 checkCustomerService 接口
1915
+ this.goCustomerServicePage();
1916
+ return;
1917
+ }
1918
+ jfbRootExec("checkCustomerService", {
1919
+ vm: this,
1920
+ data: {
1921
+ main_order_id: this.main_order_id,
1922
+ },
1923
+ })
1924
+ .then((res) => {
1925
+ if (res.is_pop === 'Y') {
1926
+ // 弹出子订单选择弹框
1927
+ this.customerSubOrders = this.info.sub_orders || [];
1928
+ this.showCustomerDrawer = true;
1929
+ } else {
1930
+ // 直接跳转客服
1931
+ this.goCustomerServicePage();
1932
+ }
1933
+ })
1934
+ .catch((err) => {
1935
+ console.log(err, 'checkCustomerService err');
1936
+ });
1937
+ },
1938
+ goCustomerServicePage(subOrder) {
1939
+ // customer_info 存在时,直接从 customer_info 获取数据,不走原有子订单逻辑
1940
+ if (this.info.customer_info) {
1941
+ const ci = this.info.customer_info;
1942
+ const content = {
1943
+ title: ci.settle_tag_name || '',
1944
+ picture: ci.shop_icon ? getServiceUrl(ci.shop_icon, 'size4') : '',
1945
+ orderCount: 'x' + ci.num || 0,
1946
+ payMoney: ci.total_amount ? `¥${(ci.total_amount / 100).toFixed(2)}` : '',
1947
+ url: location.href,
1948
+ orderId: this.main_order_id,
1949
+ orderTime: this.getOrderTime(),
1950
+ orderStatus: this.info.status ? this.info.status.status_name : '',
1951
+ orderStageType: this.getOrderStageType(this.info.status),
1952
+ };
1953
+ jfbRootExec("updateCustomerService", {
1954
+ vm: this,
1955
+ data: {
1956
+ supplier_id: ci.supplier_id,
1957
+ content: JSON.stringify(content),
1958
+ namespace: this.biz_code,
1959
+ },
1960
+ })
1961
+ .then((res) => {
1962
+ this.doOpenCustomerService(res);
1963
+ })
1964
+ .catch((err) => {
1965
+ console.log(err, 'updateCustomerService err');
1966
+ });
1967
+ return;
1968
+ }
1969
+
1970
+ const order = subOrder || (this.info.sub_orders && this.info.sub_orders[0]);
1971
+ if (order) {
1972
+ const product = order.products && order.products[0];
1973
+ const orderTime = this.getOrderTime();
1974
+ const content = {
1975
+ title: product ? product.product_name : '',
1976
+ desc: product ? product.product_sku_name : '',
1977
+ picture: product ? getServiceUrl(product.product_thumb, 'size4') : '',
1978
+ url: product && product.product_detail_url ? (() => {
1979
+ try {
1980
+ const urlObj = JSON.parse(product.product_detail_url);
1981
+ return location.origin + '/' + urlObj.dir + urlObj.path + "?product_id=" + product.product_id;
1982
+ } catch (e) {
1983
+ return '';
1984
+ }
1985
+ })() : '',
1986
+ orderSku: '',
1987
+ orderCount: 'x' + (order.products ? order.products.reduce((sum, p) => sum + p.product_num, 0) : 0),
1988
+ payMoney: order.products ? `¥${order.products.reduce((sum, p) => sum + p.sale_price * p.product_num, 0).toFixed(2)}` : '',
1989
+ goodsId: product ? String(product.product_id) : '',
1990
+ orderStatus: order.status ? order.status.status_name : '',
1991
+ orderId: order.sub_order_id,
1992
+ orderTime: orderTime,
1993
+ orderStageType: this.getOrderStageType(order.status),
1994
+ };
1995
+ jfbRootExec("updateCustomerService", {
1996
+ vm: this,
1997
+ data: {
1998
+ supplier_id: order.supplier_id,
1999
+ content: JSON.stringify(content),
2000
+ namespace: this.biz_code,
2001
+ },
2002
+ })
2003
+ .then((res) => {
2004
+ this.doOpenCustomerService(res);
2005
+ })
2006
+ .catch((err) => {
2007
+ console.log(err, 'updateCustomerService err');
2008
+ });
2009
+ }
2010
+ },
2011
+ getOrderTime() {
2012
+ if (!this.info.detail || !Array.isArray(this.info.detail)) return '';
2013
+ const item = this.info.detail.find(d => d.label === '下单时间');
2014
+ return item ? item.value : '';
2015
+ },
2016
+ getOrderStageType(status) {
2017
+ if (!status) return '';
2018
+ const statusName = status.status_name || '';
2019
+ // 售前阶段:10000 发货前阶段:20000 发货后阶段:30000 售后阶段:40000
2020
+ if (statusName.includes('退款') || statusName.includes('退货') || statusName.includes('售后')) return '40000';
2021
+ if (statusName.includes('发货') || statusName.includes('配送') || statusName.includes('完成')) return '30000';
2022
+ if (statusName.includes('待发货') || statusName.includes('待付款')) return '20000';
2023
+ return '10000';
2024
+ },
2025
+ doOpenCustomerService(data) {
2026
+ const isSandbox = this.projectAttr.api_host && this.projectAttr.api_host.includes('sandbox');
2027
+ let host = isSandbox ? 'sandbox-misc.jufubao.cn' : location.host;
2028
+ let query = `from=order&sdk_key=${data.app_key}&data_key=${data.redis_key}&api=${this.projectAttr.api_host}`;
2029
+ let url = `http://${host}/cm/index.html?${query}`;
2030
+ console.log("customerService url: " + url);
2031
+ this.$xdUniHelper.redirectTo({
2032
+ url: url,
2033
+ })
2034
+ },
2035
+ handleGoCustomerService(item) {
2036
+ this.showCustomerDrawer = false;
2037
+ this.goCustomerServicePage(item);
2038
+ },
1858
2039
  handleReorderDlgConfirm(){
1859
2040
  this.showReorderDialog = false;
1860
2041
  if(this.reorderStatus !== 'not'){
@@ -2614,7 +2795,7 @@ export default {
2614
2795
  background: #fff;
2615
2796
  z-index: 3000;
2616
2797
  display: flex;
2617
- justify-content: flex-end;
2798
+ justify-content: space-between;
2618
2799
  align-items: center;
2619
2800
 
2620
2801
  .btn_wrap{
@@ -2624,6 +2805,30 @@ export default {
2624
2805
  font-size: @xd-font-size-lg;
2625
2806
  }
2626
2807
  }
2808
+
2809
+ .cs-btn {
2810
+ display: flex;
2811
+ flex-direction: column;
2812
+ align-items: center;
2813
+ justify-content: center;
2814
+ min-width: unit(100, rpx);
2815
+ height: 100%;
2816
+ padding: 0 unit(20, rpx);
2817
+ background: none;
2818
+ border: none;
2819
+ outline: none;
2820
+
2821
+ &__text {
2822
+ font-size: unit(20, rpx);
2823
+ color: #333;
2824
+ margin-top: unit(6, rpx);
2825
+ }
2826
+ }
2827
+
2828
+ .cs-btn--button {
2829
+ padding: 0;
2830
+ line-height: 1;
2831
+ }
2627
2832
  }
2628
2833
 
2629
2834
  &-product {
@@ -2698,6 +2903,60 @@ export default {
2698
2903
  font-size: 28rpx;
2699
2904
  }
2700
2905
  }
2906
+
2907
+ .customer-drawer {
2908
+ padding: 24rpx;
2909
+ &-title {
2910
+ display: flex;
2911
+ align-items: center;
2912
+ color: #666666;
2913
+ font-size: 28rpx;
2914
+ }
2915
+ &-list {
2916
+ margin-top: 40rpx;
2917
+ max-height: 60vh;
2918
+ overflow-y: auto;
2919
+ }
2920
+ &-item {
2921
+ background: #fff;
2922
+ border-radius: 16rpx;
2923
+ padding: 32rpx;
2924
+ margin-bottom: 32rpx;
2925
+ &-sub {
2926
+ font-size: 24rpx;
2927
+ color: #999;
2928
+ margin-bottom: 24rpx;
2929
+ }
2930
+ &-body {
2931
+ display: flex;
2932
+ align-items: center;
2933
+ image {
2934
+ width: 140rpx;
2935
+ height: 140rpx;
2936
+ border-radius: 10rpx;
2937
+ }
2938
+ }
2939
+ &-info {
2940
+ flex: 1;
2941
+ margin-left: 28rpx;
2942
+ display: flex;
2943
+ flex-direction: column;
2944
+ justify-content: center;
2945
+ }
2946
+ &-price {
2947
+ color: #333;
2948
+ font-size: 32rpx;
2949
+ }
2950
+ &-count {
2951
+ margin-top: 8rpx;
2952
+ font-size: 24rpx;
2953
+ color: #999;
2954
+ }
2955
+ &-btn {
2956
+ flex-shrink: 0;
2957
+ }
2958
+ }
2959
+ }
2701
2960
  }
2702
2961
 
2703
2962
  // 自动刷新倒计时