xiaoe_mp_npm 0.5.45 → 0.5.46

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.
Files changed (65) hide show
  1. package/miniprogram_dist/ConfirmOrder/components/AddressSelect/index.js +2 -1
  2. package/miniprogram_dist/ConfirmOrder/components/ConfirmOrderContent/index.js +14 -1
  3. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.js +130 -0
  4. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.json +9 -0
  5. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.scss +59 -0
  6. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.wxml +25 -0
  7. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.wxss +49 -0
  8. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.js +3 -0
  9. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.json +2 -1
  10. package/miniprogram_dist/ConfirmOrder/components/GoodsInfo/index.wxml +8 -2
  11. package/miniprogram_dist/ConfirmOrder/components/PayBar/index.js +2 -2
  12. package/miniprogram_dist/CopGoodsCard/constans.js +462 -0
  13. package/miniprogram_dist/CopGoodsCard/index.js +148 -0
  14. package/miniprogram_dist/CopGoodsCard/index.json +3 -0
  15. package/miniprogram_dist/CopGoodsCard/index.scss +100 -0
  16. package/miniprogram_dist/CopGoodsCard/index.wxml +20 -0
  17. package/miniprogram_dist/CopGoodsCard/index.wxss +95 -0
  18. package/miniprogram_dist/GoodsItem/index.js +1 -1
  19. package/miniprogram_dist/LiveGoodsList/index.js +2 -2
  20. package/miniprogram_dist/Sku/commSelect/index.js +663 -425
  21. package/miniprogram_dist/Sku/commSelect/index.json +3 -1
  22. package/miniprogram_dist/Sku/commSelect/index.less +11 -0
  23. package/miniprogram_dist/Sku/commSelect/index.wxml +58 -43
  24. package/miniprogram_dist/Sku/commSelect/index.wxss +8 -0
  25. package/miniprogram_dist/Sku/goods-info/index.js +5 -1
  26. package/miniprogram_dist/Sku/goods-info/index.wxml +1 -1
  27. package/miniprogram_dist/Sku/index/index.js +10 -2
  28. package/miniprogram_dist/Sku/index/index.wxml +1 -0
  29. package/miniprogram_dist/common/api/confirmOrder.js +6 -0
  30. package/miniprogram_dist/common/api/sku.js +17 -2
  31. package/miniprogram_dist/common/utils/constants.js +8 -1
  32. package/miniprogram_dist/common/utils/helper.js +3 -0
  33. package/package.json +3 -3
  34. package/src/ConfirmOrder/components/AddressSelect/index.js +2 -1
  35. package/src/ConfirmOrder/components/ConfirmOrderContent/index.js +14 -1
  36. package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.js +130 -0
  37. package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.json +9 -0
  38. package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.scss +59 -0
  39. package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.wxml +25 -0
  40. package/src/ConfirmOrder/components/GoodsInfo/components/CopGoodsList/index.wxss +1 -0
  41. package/src/ConfirmOrder/components/GoodsInfo/index.js +3 -0
  42. package/src/ConfirmOrder/components/GoodsInfo/index.json +2 -1
  43. package/src/ConfirmOrder/components/GoodsInfo/index.wxml +8 -2
  44. package/src/ConfirmOrder/components/PayBar/index.js +2 -2
  45. package/src/CopGoodsCard/constans.js +462 -0
  46. package/src/CopGoodsCard/index.js +148 -0
  47. package/src/CopGoodsCard/index.json +3 -0
  48. package/src/CopGoodsCard/index.scss +100 -0
  49. package/src/CopGoodsCard/index.wxml +20 -0
  50. package/src/CopGoodsCard/index.wxss +1 -0
  51. package/src/GoodsItem/index.js +1 -1
  52. package/src/LiveGoodsList/index.js +2 -2
  53. package/src/Sku/commSelect/index.js +663 -425
  54. package/src/Sku/commSelect/index.json +3 -1
  55. package/src/Sku/commSelect/index.less +11 -0
  56. package/src/Sku/commSelect/index.wxml +58 -43
  57. package/src/Sku/commSelect/index.wxss +8 -0
  58. package/src/Sku/goods-info/index.js +5 -1
  59. package/src/Sku/goods-info/index.wxml +1 -1
  60. package/src/Sku/index/index.js +10 -2
  61. package/src/Sku/index/index.wxml +1 -0
  62. package/src/common/api/confirmOrder.js +6 -0
  63. package/src/common/api/sku.js +17 -2
  64. package/src/common/utils/constants.js +8 -1
  65. package/src/common/utils/helper.js +3 -0
@@ -1,7 +1,7 @@
1
1
  // src/ConfirmOrder/components/AddressSelect/index.js
2
2
  const computedBehavior = require('miniprogram-computed').behavior
3
3
  import {
4
- ENTITY_GOODS
4
+ ENTITY_GOODS,COP_GOODS
5
5
  } from '../../../common/utils/constants';
6
6
  import {
7
7
  isEmptyObject
@@ -101,6 +101,7 @@ Component({
101
101
  showAddressSelect(data) {
102
102
  return (
103
103
  data.baseInfoQuery.spu_type === ENTITY_GOODS ||
104
+ data.baseInfoQuery.spu_type === COP_GOODS ||
104
105
  (data.goodsInfo.is_goods_package && data.hasEntityGoods) ||
105
106
  (data.isCart &&
106
107
  data.cartGoodsList.some((goodsInfo) => {
@@ -85,7 +85,7 @@ Component({
85
85
  */
86
86
  data: {
87
87
  activeMode: 0, // 0:快递配送,1:自提
88
- express_type: 1, // 接口下发配送信息 1-快递配送 2-商品自提
88
+ express_type: 0, // 接口下发配送信息 1-快递配送 2-商品自提
89
89
  userCanPick: 1, // 商家是否支持自提 1支持 0不支持
90
90
  shopConf: {},
91
91
  confirmOrderInfo: {
@@ -260,6 +260,14 @@ Component({
260
260
  this.setData({
261
261
  express_type: val
262
262
  })
263
+ }else if (val === 0) {
264
+ this.setData({
265
+ express_type: val
266
+ })
267
+ }else if (val === -1) {
268
+ this.setData({
269
+ express_type: 1
270
+ })
263
271
  }
264
272
  },
265
273
  marketingData(marketingData) {
@@ -805,6 +813,11 @@ Component({
805
813
  distributionMode: res.data.goods_info.distribution_pattern
806
814
  })
807
815
  }
816
+ if(this.data.baseInfoQuery.spu_type == "COP"){
817
+ this.setData({
818
+ distributionMode: res.data.goods_info.sku_info.distribution_pattern
819
+ })
820
+ }
808
821
  if (!this.data.isCart) {
809
822
  let addressInfo = res.data.address_info;
810
823
  this.setData({
@@ -0,0 +1,130 @@
1
+ const computedBehavior = require('miniprogram-computed').behavior;
2
+ import {
3
+ getGoodsList
4
+ } from "../../../../../common/api/confirmOrder"
5
+
6
+ Component({
7
+ behaviors: [computedBehavior],
8
+ /**
9
+ * 组件的属性列表
10
+ */
11
+ properties: {
12
+ spuId:{
13
+ type: String,
14
+ value: ''
15
+ },
16
+ skuId:{
17
+ type: String,
18
+ value: ''
19
+ },
20
+ isFullScreen: {
21
+ type: Boolean,
22
+ value: false
23
+ }
24
+ },
25
+
26
+ /**
27
+ * 组件的初始数据
28
+ */
29
+ data: {
30
+ showList: false,
31
+ goodsList: [],
32
+ // item: {
33
+ // "master_spu_id": "SPU_COP_1694610367Pn9ZXbFK6glLT",
34
+ // "master_sku_id": "SKU_COP_1698052496eW4Bk4af1v1mi",
35
+ // "spu_id": "i_647f4d72e4b09d723799c040",
36
+ // "resource_id": "i_647f4d72e4b09d723799c040",
37
+ // "sku_id": "SKU_ITX_6860644988815AFbtG77",
38
+ // "sku_business_id": "",
39
+ // "spu_type": "ITX",
40
+ // "resource_type": 1,
41
+ // "is_public": 1,
42
+ // "is_free": 0,
43
+ // "is_password": 0,
44
+ // "goods_name": "1-商家独立车-旗舰版(内灰)1-商家独立车-旗舰版(内灰)1-商家独立车-旗舰版(内灰)",
45
+ // "sale_status": 1,
46
+ // "is_display": 1,
47
+ // "is_stop_sell": 0,
48
+ // "stock_deduct_mode": 0,
49
+ // "freight": 0,
50
+ // "distribution_pattern": 1,
51
+ // "is_uniform_freight": 0,
52
+ // "freight_template_id": 0,
53
+ // "img_url_compressed": "http://wechatapppro-1252524126.file.myqcloud.com/appegbzh7h16457/image/compress/414320701l1a507dv0a9c.png",
54
+ // "is_single": 1,
55
+ // "is_deleted": 0,
56
+ // "is_forbid": 0,
57
+ // "order_stock_limit": 0,
58
+ // "sku_state": 1,
59
+ // "new_period_value": "",
60
+ // "new_period_type": -1,
61
+ // "period_value": "-1",
62
+ // "period_type": 0,
63
+ // "limit_purchase": 0,
64
+ // "limit_purchase_type": 0,
65
+ // "goods_img": [
66
+ // "https://wechatapppro-1252524126.file.myqcloud.com/appegbzh7h16457/image/b_u_61de508a8916c_18VwY3Or/l1a507dv0a9c.png"
67
+ // ],
68
+ // "sell_type": 1,
69
+ // "sku_price": 2200,
70
+ // "price_low": 2200,
71
+ // "spu_extend": "",
72
+ // "goods_sn": "",
73
+ // "can_sold_start": "0001-01-01 00:00:00",
74
+ // "can_sold_end": "0001-01-01 00:00:00",
75
+ // "sku_img": "https://wechatapppro-1252524126.file.myqcloud.com/appegbzh7h16457/image/b_u_61de508a8916c_18VwY3Or/l1a507dv0a9c.png",
76
+ // "sku_cost_price": 0,
77
+ // "sku_weight": "",
78
+ // "sku_volume": "",
79
+ // "sku_spec_code": "",
80
+ // "sku_num": 1,
81
+ // "sku_min_purchase": 0,
82
+ // "sku_desc": "",
83
+ // "sku_name": "1-商家独立车-旗舰版(内灰)1-商家独立车-旗舰版(内灰)1-商家独立车-旗舰版(内灰)",
84
+ // "left_stock": 999999,
85
+ // "sales": 0,
86
+ // "attr_value_list": null,
87
+ // "goods_state": 0
88
+ // }
89
+ },
90
+ lifetimes: {
91
+ attached: function () {
92
+ //this.getGoodsList();
93
+ // if (this.data.spuId) {
94
+ // this.getGoodsList();
95
+ // }
96
+ },
97
+ },
98
+ /**
99
+ * 组件的方法列表
100
+ */
101
+ methods: {
102
+ onClose() {
103
+ this.setData({
104
+ showList: false,
105
+ goodsList: []
106
+
107
+ })
108
+ },
109
+ openCombinedList() {
110
+ this.getGoodsList();
111
+ this.setData({
112
+ showList: true
113
+ })
114
+ },
115
+ getGoodsList(){
116
+ const params = {
117
+ spu_id: this.data.spuId,
118
+ sku_id: this.data.skuId,
119
+ }
120
+ getGoodsList(params).then(res => {
121
+ const { data, code } = res.data
122
+ if(code == 0 ){
123
+ this.setData({
124
+ goodsList: Array.isArray(data) ? data : []
125
+ })
126
+ }
127
+ })
128
+ },
129
+ }
130
+ })
@@ -0,0 +1,9 @@
1
+ {
2
+ "component": true,
3
+ "usingComponents": {
4
+ "van-popup": "@vant/weapp/popup/index",
5
+ "van-loading": "@vant/weapp/loading/index",
6
+ "CustomPopup": "../../../../../CustomPopup/index",
7
+ "CopGoodsCard": "../../../../../CopGoodsCard/index"
8
+ }
9
+ }
@@ -0,0 +1,59 @@
1
+ $deviceWidth: 750;
2
+ @function vmin($rpx) {
3
+ @return #{$rpx * 100 / $deviceWidth}vmin;
4
+ }
5
+
6
+ @mixin combined-goods-list{
7
+ width: 100%;
8
+ overflow: hidden;
9
+ .combined-goods-select{
10
+ display: flex;
11
+ justify-content: space-between;
12
+ align-items: center;
13
+ padding: 0 vmin(32);
14
+ padding-bottom: vmin(32);
15
+ background: #fff;
16
+ .combined-goods-desc{
17
+ font-size: vmin(28);
18
+ color: #333;
19
+ }
20
+ .arron-right{
21
+ width: vmin(32);
22
+ height: vmin(32);
23
+ }
24
+ }
25
+ .header-cont {
26
+ height: 100%;
27
+ display: flex;
28
+ align-items: center;
29
+ justify-content: center;
30
+ position: relative;
31
+
32
+ .header-title {
33
+ color: rgba(51, 51, 51, 1);
34
+ font-size: 4.27vmin;
35
+ font-weight: 600;
36
+ }
37
+
38
+ .img {
39
+ width: 4.27vmin;
40
+ height: 4.27vmin;
41
+ position: absolute;
42
+ right: 4.27vmin;
43
+ top: 4.27vmin;
44
+ }
45
+ .img-left{
46
+ width: 4.27vmin;
47
+ height: 4.27vmin;
48
+ position: absolute;
49
+ top: 4.27vmin;
50
+ left: 4.27vmin;
51
+ }
52
+ }
53
+ .cop-goods-card{
54
+ margin: 0 vmin(32)
55
+ }
56
+ }
57
+ .combined-goods-list{
58
+ @include combined-goods-list
59
+ }
@@ -0,0 +1,25 @@
1
+ <view class="combined-goods-list">
2
+ <view class="combined-goods-select" bindtap="openCombinedList">
3
+ <view class="combined-goods-desc">内含商品</view>
4
+ <image src="../../../../../common/assets/images/zhixiang.png" class="iconfont arron-right"></image>
5
+ </view>
6
+ <CustomPopup
7
+ showPopup="{{ showList }}"
8
+ bind:onClose="onClose"
9
+ round="{{ !isFullScreen }}"
10
+ customStyle="{{ isFullScreen ? 'height: 100%;width: 100vmin;' : 'height: 80%;' }}"
11
+ overlay="{{ !isFullScreen }}"
12
+ >
13
+ <view slot="header" class="header-cont">
14
+ <image src="../../../../../common/assets/images/left.png" class="img-left" bindtap="onClose" wx:if="{{ isFullScreen }}"></image>
15
+ <view class="header-title">内含商品</view>
16
+ <image src="../../../../../common/assets/images/close.png" class="img" bindtap="onClose" wx:if="{{ !isFullScreen }}"></image>
17
+ </view>
18
+ <view slot="content">
19
+ <view class="cop-goods-card" wx:for="{{goodsList}}" wx:for-item="item" wx:key="index">
20
+ <CopGoodsCard goodsInfo="{{ item }}"></CopGoodsCard>
21
+ </view>
22
+ </view>
23
+ </CustomPopup>
24
+ </view>
25
+
@@ -0,0 +1,49 @@
1
+ .combined-goods-list {
2
+ width: 100%;
3
+ overflow: hidden;
4
+ }
5
+ .combined-goods-list .combined-goods-select {
6
+ display: flex;
7
+ justify-content: space-between;
8
+ align-items: center;
9
+ padding: 0 4.26667vmin;
10
+ padding-bottom: 4.26667vmin;
11
+ background: #fff;
12
+ }
13
+ .combined-goods-list .combined-goods-select .combined-goods-desc {
14
+ font-size: 3.73333vmin;
15
+ color: #333;
16
+ }
17
+ .combined-goods-list .combined-goods-select .arron-right {
18
+ width: 4.26667vmin;
19
+ height: 4.26667vmin;
20
+ }
21
+ .combined-goods-list .header-cont {
22
+ height: 100%;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ position: relative;
27
+ }
28
+ .combined-goods-list .header-cont .header-title {
29
+ color: #333;
30
+ font-size: 4.27vmin;
31
+ font-weight: 600;
32
+ }
33
+ .combined-goods-list .header-cont .img {
34
+ width: 4.27vmin;
35
+ height: 4.27vmin;
36
+ position: absolute;
37
+ right: 4.27vmin;
38
+ top: 4.27vmin;
39
+ }
40
+ .combined-goods-list .header-cont .img-left {
41
+ width: 4.27vmin;
42
+ height: 4.27vmin;
43
+ position: absolute;
44
+ top: 4.27vmin;
45
+ left: 4.27vmin;
46
+ }
47
+ .combined-goods-list .cop-goods-card {
48
+ margin: 0 4.26667vmin;
49
+ }
@@ -94,6 +94,9 @@ Component({
94
94
  first: true,
95
95
  },
96
96
  computed: {
97
+ isCop(data){
98
+ return data.goodsInfo?.spu_type == 'COP'
99
+ },
97
100
  historyBuy(data) {
98
101
  return data.goodsInfo?.has_buy_num
99
102
  },
@@ -4,6 +4,7 @@
4
4
  "ImageData": "./components/ImageData/index",
5
5
  "van-tag": "@vant/weapp/tag/index",
6
6
  "van-stepper": "@vant/weapp/stepper/index",
7
- "GoodsCommerce": "./components/GoodsCommerce/index"
7
+ "GoodsCommerce": "./components/GoodsCommerce/index",
8
+ "CopGoodsList": "./components/CopGoodsList/index"
8
9
  }
9
10
  }
@@ -10,7 +10,7 @@
10
10
  <view class="goods-wrapper">
11
11
  <view class="goods-thumbnail">
12
12
  <ImageData class="img" wx:if="{{ goodsImgSrc }}" src="{{ goodsImgSrc }}" compressWidth="120" compressHeight="120" showCompress="true"></ImageData>
13
- <view class="goods-type" wx:if="{{ goodsInfo.goods_tag_is_show }}">{{ goodsTag }}</view>
13
+ <view class="goods-type" wx:if="{{ goodsInfo.goods_tag_is_show || goodsInfo.spu_type == 'COP'}}">{{ goodsTag }}</view>
14
14
  <view class="svip-tag svip-tag-text" wx:if="{{ useSvipPrice }}">超级会员</view>
15
15
  </view>
16
16
  <view class="goods-detail">
@@ -66,11 +66,17 @@
66
66
  </view>
67
67
  <GoodsCommerce
68
68
  class="goods-commerce"
69
- wx:if="{{ !isCart }}"
69
+ wx:if="{{ !isCart && !isCop}}"
70
70
  spuId="{{ baseInfo.id }}"
71
71
  resourceId="{{ baseInfo.resource_id }}"
72
72
  resourceType="{{ baseInfo.resource_type }}"
73
73
  isAlive="{{ baseInfo.isAlive }}"
74
74
  isFullScreen="{{ isFullScreen }}"
75
75
  ></GoodsCommerce>
76
+ <CopGoodsList
77
+ wx-if="{{isCop}}"
78
+ spuId="{{goodsInfo.spu_id}}"
79
+ skuId="{{goodsInfo.sku_id}}"
80
+ >
81
+ </CopGoodsList>
76
82
  </view>
@@ -133,8 +133,8 @@ Component({
133
133
  return {
134
134
  ...data.pickerUserInfo,
135
135
  express_type: data.express_type,
136
- place_id: data.picksiteInfo?.place_id,
137
- picker_id: data.pickerUserInfo.id,
136
+ place_id: data.express_type == 2 ? data.picksiteInfo?.place_id : '',
137
+ picker_id: data.express_type == 2 ? data.pickerUserInfo.id : '',
138
138
  ...data.addressInfo,
139
139
  ...data.baseInfo,
140
140
  pre_pay_type: data.baseInfo?.pre_pay_type || 1,