jufubao-base 1.0.397 → 1.0.398-beta2

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jufubao-base",
3
- "version": "1.0.397",
3
+ "version": "1.0.398-beta2",
4
4
  "private": false,
5
5
  "description": "聚福宝业务组件基础插件包",
6
6
  "main": "index.js",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@dcloudio/uni-app-plus": "2.0.1-33920220208001",
35
35
  "@dcloudio/uni-h5": "2.0.1-33920220208001",
36
- "@dcloudio/uni-helper-json": "*",
36
+ "@dcloudio/uni-helper-json": "^1.0.13",
37
37
  "@dcloudio/uni-i18n": "2.0.1-33920220208001",
38
38
  "@dcloudio/uni-mp-360": "2.0.1-33920220208001",
39
39
  "@dcloudio/uni-mp-alipay": "2.0.1-33920220208001",
@@ -45,22 +45,22 @@
45
45
  "@dcloudio/uni-quickapp-native": "2.0.1-33920220208001",
46
46
  "@dcloudio/uni-quickapp-webview": "2.0.1-33920220208001",
47
47
  "@dcloudio/uni-stat": "2.0.1-33920220208001",
48
- "@vue/shared": "^3.0.0",
49
- "color": "^3.1.3",
50
- "core-js": "^2.6.5",
51
- "dingtalk-jsapi": "^3.0.31",
48
+ "@vue/shared": "^3.5.39",
49
+ "color": "^3.2.1",
50
+ "core-js": "^2.6.12",
51
+ "dingtalk-jsapi": "^3.2.9",
52
52
  "flyio": "^0.6.2",
53
53
  "gxd-commands-bussiness": "^1.0.12",
54
54
  "gxd-uni-library-editx": "1.0.196-beta13",
55
55
  "jweixin-module": "^1.6.0",
56
56
  "md5": "^2.3.0",
57
- "path-to-regexp": "^6.2.1",
58
- "qs": "^6.9.6",
57
+ "path-to-regexp": "^6.3.0",
58
+ "qs": "^6.15.3",
59
59
  "regenerator-runtime": "^0.12.1",
60
- "vconsole": "^3.15.0",
61
- "vue": "^2.6.10",
62
- "vue-clipboard2": "^0.3.1",
63
- "vuex": "^3.2.0"
60
+ "vconsole": "^3.15.1",
61
+ "vue": "^2.7.16",
62
+ "vue-clipboard2": "^0.3.3",
63
+ "vuex": "^3.6.2"
64
64
  },
65
65
  "repository": {
66
66
  "type": "git",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "homepage": "http://uni.e56buy.com/",
70
70
  "devDependencies": {
71
- "@dcloudio/types": "*",
71
+ "@dcloudio/types": "^3.4.32",
72
72
  "@dcloudio/uni-automator": "2.0.1-33920220208001",
73
73
  "@dcloudio/uni-cli-i18n": "2.0.1-33920220208001",
74
74
  "@dcloudio/uni-cli-shared": "2.0.1-33920220208001",
@@ -79,38 +79,38 @@
79
79
  "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.1-33920220208001",
80
80
  "@dcloudio/webpack-uni-mp-loader": "2.0.1-33920220208001",
81
81
  "@dcloudio/webpack-uni-pages-loader": "2.0.1-33920220208001",
82
- "@types/uni-app": "*",
82
+ "@types/uni-app": "^1.4.8",
83
83
  "@vue/cli-plugin-babel": "^3.12.0",
84
84
  "@vue/cli-service": "^3.12.0",
85
- "babel-plugin-import": "^1.11.0",
86
- "cross-env": "^7.0.2",
85
+ "ali-oss": "^6.23.0",
86
+ "art-template": "^4.13.4",
87
+ "babel-plugin-import": "^1.13.8",
88
+ "copy-dir": "^1.3.0",
89
+ "copy-webpack-plugin": "5.1.2",
90
+ "cross-env": "^7.0.3",
91
+ "ejs": "^3.1.10",
87
92
  "jest": "^25.4.0",
88
- "less": "^3.12.2",
89
- "less-loader": "^7.0.1",
90
- "mini-css-extract-plugin": "^1.1.1",
91
- "mini-types": "*",
92
- "miniprogram-api-typings": "*",
93
+ "js-base64": "^2.6.4",
94
+ "js-beautify": "^1.15.4",
95
+ "less": "^3.13.1",
96
+ "less-loader": "^7.3.0",
97
+ "md5": "^2.3.0",
98
+ "mini-css-extract-plugin": "^1.6.2",
99
+ "mini-types": "^0.1.7",
100
+ "miniprogram-api-typings": "^5.2.1",
101
+ "mockjs": "1.0.1-beta3",
93
102
  "postcss-comment": "^2.0.0",
103
+ "progress": "^2.0.3",
94
104
  "require-context": "^1.1.0",
95
- "sass": "^1.29.0",
105
+ "sass": "^1.101.0",
96
106
  "sass-loader": "^8.0.2",
97
- "sass-resources-loader": "^2.1.1",
107
+ "sass-resources-loader": "^2.2.5",
98
108
  "scss-loader": "0.0.1",
99
109
  "uglifyjs-webpack-plugin": "^1.1.1",
100
- "vue-template-compiler": "^2.6.10",
101
110
  "uni-read-pages": "^1.0.5",
102
- "webpack": "4.44.2",
103
- "js-base64": "^2.6.4",
104
- "progress": "^2.0.3",
105
- "ali-oss": "^6.16.0",
106
- "ejs": "^3.1.6",
107
- "js-beautify": "^1.14.0",
108
- "art-template": "^4.13.2",
109
- "mockjs": "1.0.1-beta3",
110
111
  "vue-baidu-map": "^0.21.22",
111
- "copy-webpack-plugin": "5.1.2",
112
- "copy-dir": "^1.3.0",
113
- "md5": "^2.3.0"
112
+ "vue-template-compiler": "^2.7.16",
113
+ "webpack": "4.44.2"
114
114
  },
115
115
  "browserslist": [
116
116
  "Android >= 4",
@@ -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
  ];
@@ -724,6 +724,20 @@ export default {
724
724
  { label: '隐藏', value: '0' },
725
725
  ]
726
726
  },
727
+ {
728
+ label: '在线客服展示/隐藏:',
729
+ ele: 'xd-radio',
730
+ valueKey: 'is_show_customer_service',
731
+ value: data['is_show_customer_service'] || 'Y',
732
+ groupKey:'content',
733
+ placeholder: '请选择在线客服展示/隐藏',
734
+ multiple: false,
735
+ className: 'input80',
736
+ list: [
737
+ { label: '显示', value: 'Y' },
738
+ { label: '隐藏', value: 'N' },
739
+ ]
740
+ },
727
741
  {
728
742
  label: '售后服务页面路径:',
729
743
  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) || is_show_customer_service === '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) || is_show_customer_service === 'Y'"
867
867
  >
868
+ <view>
869
+ <view
870
+ v-if="is_show_customer_service === 'Y'"
871
+ class="cs-btn"
872
+ @click="handleCustomerService"
873
+ >
874
+ <xd-font-icon icon="iconkefu" 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[0].sale_price" :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" @click="handleGoCustomerService(item)">
1046
+ <xd-button type="primary" size="small">去咨询</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,7 @@ export default {
1132
1179
 
1133
1180
  code_location: 'none',
1134
1181
  is_show_invoice: 'N',
1182
+ is_show_customer_service: 'Y',
1135
1183
  invoicePath: '',
1136
1184
  isShowInvoice: false,
1137
1185
  invoiceStatus: '',
@@ -1140,6 +1188,9 @@ export default {
1140
1188
  reorderTips: [],
1141
1189
  reorderBtnItem: null,
1142
1190
 
1191
+ showCustomerDrawer: false,
1192
+ customerSubOrders: [],
1193
+
1143
1194
  //是否显示电话
1144
1195
  isSHowPhone:'N', //是否显示手机号码
1145
1196
  isPhoneReg: /^[\d-]+$/
@@ -1635,6 +1686,7 @@ export default {
1635
1686
  }
1636
1687
  }
1637
1688
  this.is_show_invoice = getContainerPropsValue(container, "content.is_show_invoice", "N");
1689
+ this.is_show_customer_service = getContainerPropsValue(container, "content.is_show_customer_service", "Y");
1638
1690
  this.invoicePath = getContainerPropsValue(container, "content.invoicePath", { value: "", }).value;
1639
1691
  this.viewInvoicePath = getContainerPropsValue(container, "content.viewInvoicePath", { value: "", }).value;
1640
1692
  },
@@ -1855,6 +1907,97 @@ export default {
1855
1907
  console.error(`item.action=${item.action}, 此action不可用`)
1856
1908
  }
1857
1909
  },
1910
+ handleCustomerService() {
1911
+ jfbRootExec("checkCustomerService", {
1912
+ vm: this,
1913
+ data: {
1914
+ main_order_id: this.main_order_id,
1915
+ },
1916
+ })
1917
+ .then((res) => {
1918
+ if (res.is_pop === 'Y') {
1919
+ // 弹出子订单选择弹框
1920
+ this.customerSubOrders = this.info.sub_orders || [];
1921
+ this.showCustomerDrawer = true;
1922
+ } else {
1923
+ // 直接跳转客服
1924
+ this.goCustomerServicePage();
1925
+ }
1926
+ })
1927
+ .catch((err) => {
1928
+ console.log(err, 'checkCustomerService err');
1929
+ });
1930
+ },
1931
+ goCustomerServicePage(subOrder) {
1932
+ const order = subOrder || (this.info.sub_orders && this.info.sub_orders[0]);
1933
+ if (order) {
1934
+ const product = order.products && order.products[0];
1935
+ const orderTime = this.getOrderTime();
1936
+ const content = {
1937
+ title: product ? product.product_name : '',
1938
+ desc: product ? product.product_sku_name : '',
1939
+ picture: product ? getServiceUrl(product.product_thumb, 'size4') : '',
1940
+ url: product && product.product_detail_url ? (() => {
1941
+ try {
1942
+ const urlObj = JSON.parse(product.product_detail_url);
1943
+ return location.origin + '/' + urlObj.dir + urlObj.path + "?product_id=" + product.product_id;
1944
+ } catch (e) {
1945
+ return '';
1946
+ }
1947
+ })() : '',
1948
+ orderSku: product ? product.product_sku_name : '',
1949
+ orderCount: order.products ? order.products.reduce((sum, p) => sum + p.product_num, 0) : 0,
1950
+ payMoney: order.products ? `¥${order.products.reduce((sum, p) => sum + p.sale_price * p.product_num, 0).toFixed(2)}` : '',
1951
+ goodsId: product ? String(product.product_id) : '',
1952
+ orderStatus: order.status ? order.status.status_name : '',
1953
+ orderId: order.sub_order_id,
1954
+ orderTime: orderTime,
1955
+ orderStageType: this.getOrderStageType(order.status),
1956
+ };
1957
+ jfbRootExec("updateCustomerService", {
1958
+ vm: this,
1959
+ data: {
1960
+ supplier_id: order.supplier_id,
1961
+ content: JSON.stringify(content),
1962
+ namespace: this.biz_code,
1963
+ },
1964
+ })
1965
+ .then((res) => {
1966
+ this.doOpenCustomerService(res);
1967
+ })
1968
+ .catch((err) => {
1969
+ console.log(err, 'updateCustomerService err');
1970
+ });
1971
+ }
1972
+ },
1973
+ getOrderTime() {
1974
+ if (!this.info.detail || !Array.isArray(this.info.detail)) return '';
1975
+ const item = this.info.detail.find(d => d.label === '下单时间');
1976
+ return item ? item.value : '';
1977
+ },
1978
+ getOrderStageType(status) {
1979
+ if (!status) return '';
1980
+ const statusName = status.status_name || '';
1981
+ // 售前阶段:10000 发货前阶段:20000 发货后阶段:30000 售后阶段:40000
1982
+ if (statusName.includes('退款') || statusName.includes('退货') || statusName.includes('售后')) return '40000';
1983
+ if (statusName.includes('发货') || statusName.includes('配送') || statusName.includes('完成')) return '30000';
1984
+ if (statusName.includes('待发货') || statusName.includes('待付款')) return '20000';
1985
+ return '10000';
1986
+ },
1987
+ doOpenCustomerService(data) {
1988
+ const isSandbox = this.projectAttr.api_host && this.projectAttr.api_host.includes('sandbox');
1989
+ let host = isSandbox ? 'sandbox-misc.jufubao.cn' : location.host;
1990
+ let query = `from=order&sdk_key=${data.app_key}&data_key=${data.redis_key}&api=${this.projectAttr.api_host}`;
1991
+ let url = `http://${host}/cm/index.html?${query}`;
1992
+ console.log("customerService url: " + url);
1993
+ this.$xdUniHelper.redirectTo({
1994
+ url: url,
1995
+ })
1996
+ },
1997
+ handleGoCustomerService(item) {
1998
+ this.showCustomerDrawer = false;
1999
+ this.goCustomerServicePage(item);
2000
+ },
1858
2001
  handleReorderDlgConfirm(){
1859
2002
  this.showReorderDialog = false;
1860
2003
  if(this.reorderStatus !== 'not'){
@@ -2614,7 +2757,7 @@ export default {
2614
2757
  background: #fff;
2615
2758
  z-index: 3000;
2616
2759
  display: flex;
2617
- justify-content: flex-end;
2760
+ justify-content: space-between;
2618
2761
  align-items: center;
2619
2762
 
2620
2763
  .btn_wrap{
@@ -2624,6 +2767,30 @@ export default {
2624
2767
  font-size: @xd-font-size-lg;
2625
2768
  }
2626
2769
  }
2770
+
2771
+ .cs-btn {
2772
+ display: flex;
2773
+ flex-direction: column;
2774
+ align-items: center;
2775
+ justify-content: center;
2776
+ min-width: unit(100, rpx);
2777
+ height: 100%;
2778
+ padding: 0 unit(20, rpx);
2779
+ background: none;
2780
+ border: none;
2781
+ outline: none;
2782
+
2783
+ &__text {
2784
+ font-size: unit(20, rpx);
2785
+ color: #333;
2786
+ margin-top: unit(6, rpx);
2787
+ }
2788
+ }
2789
+
2790
+ .cs-btn--button {
2791
+ padding: 0;
2792
+ line-height: 1;
2793
+ }
2627
2794
  }
2628
2795
 
2629
2796
  &-product {
@@ -2698,6 +2865,58 @@ export default {
2698
2865
  font-size: 28rpx;
2699
2866
  }
2700
2867
  }
2868
+
2869
+ .customer-drawer {
2870
+ padding: 24rpx;
2871
+ &-title {
2872
+ display: flex;
2873
+ align-items: center;
2874
+ color: #666666;
2875
+ font-size: 28rpx;
2876
+ }
2877
+ &-list {
2878
+ margin-top: 40rpx;
2879
+ }
2880
+ &-item {
2881
+ background: #fff;
2882
+ border-radius: 16rpx;
2883
+ padding: 32rpx;
2884
+ margin-bottom: 32rpx;
2885
+ &-sub {
2886
+ font-size: 24rpx;
2887
+ color: #999;
2888
+ margin-bottom: 24rpx;
2889
+ }
2890
+ &-body {
2891
+ display: flex;
2892
+ align-items: center;
2893
+ image {
2894
+ width: 140rpx;
2895
+ height: 140rpx;
2896
+ border-radius: 10rpx;
2897
+ }
2898
+ }
2899
+ &-info {
2900
+ flex: 1;
2901
+ margin-left: 28rpx;
2902
+ display: flex;
2903
+ flex-direction: column;
2904
+ justify-content: center;
2905
+ }
2906
+ &-price {
2907
+ color: #333;
2908
+ font-size: 32rpx;
2909
+ }
2910
+ &-count {
2911
+ margin-top: 8rpx;
2912
+ font-size: 24rpx;
2913
+ color: #999;
2914
+ }
2915
+ &-btn {
2916
+ flex-shrink: 0;
2917
+ }
2918
+ }
2919
+ }
2701
2920
  }
2702
2921
 
2703
2922
  // 自动刷新倒计时
@@ -1,22 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * @description 第三方库
5
- * @param threePackagePath {String} 第三方库所在项目路径存放路径路
6
- * @param packname {String} 包名字
7
- * @returns {string|*}
8
- */
9
- const getPackagePath = (threePackagePath, packname = 'gxd-commands-bussiness')=>{
10
- if(packname === 'gxd-commands-bussiness') {
11
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-commands-bussiness/${threePackagePath}`;
12
- }
13
-
14
- if (packname === 'gxd-uni-library-editx') {
15
- return `/Users/shiyonggao/Desktop/code/BASE/UNIAPP/xd-uni-library-editx/${threePackagePath}`;
16
- }
17
-
18
- };
19
-
20
- module.exports = {
21
- getPackagePath
22
- }