xiaoe_mp_npm 0.5.48 → 1.0.0-live1
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/.gitlab-ci.yml +1 -0
- package/miniprogram_dist/CouponList/components/CouponItem/index.js +4 -15
- package/miniprogram_dist/CouponList/components/CouponItem/index.scss +1 -1
- package/miniprogram_dist/CouponList/components/CouponItem/index.wxml +2 -6
- package/miniprogram_dist/CouponList/couponColumn/index.js +0 -79
- package/miniprogram_dist/CouponList/couponColumn/index.wxml +0 -1
- package/miniprogram_dist/GoodsItem/index.js +125 -203
- package/miniprogram_dist/GoodsItem/index.json +6 -6
- package/miniprogram_dist/GoodsItem/index.less +299 -0
- package/miniprogram_dist/GoodsItem/index.scss +64 -256
- package/miniprogram_dist/GoodsItem/index.wxml +76 -159
- package/miniprogram_dist/GoodsItem/index.wxss +240 -976
- package/miniprogram_dist/LiveGoodsList/index.js +14 -355
- package/miniprogram_dist/LiveGoodsList/index.wxml +32 -31
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.js +27 -0
- package/{src/CouponReceivePopup → miniprogram_dist/Task/TaskPopup/component/RewardList}/index.json +6 -6
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.scss +0 -0
- package/miniprogram_dist/Task/TaskPopup/component/RewardList/index.wxml +10 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.js +176 -0
- package/miniprogram_dist/{CouponReceivePopup → Task/TaskPopup/component/TaskItem}/index.json +5 -6
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.scss +132 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxml +43 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxs +8 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskItem/index.wxss +362 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.js +114 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.json +7 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.scss +47 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxml +25 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskList/index.wxss +38 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.js +39 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.json +9 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.scss +60 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.wxml +42 -0
- package/miniprogram_dist/Task/TaskPopup/component/TaskType/index.wxss +98 -0
- package/miniprogram_dist/Task/TaskPopup/index.js +69 -0
- package/miniprogram_dist/Task/TaskPopup/index.json +8 -0
- package/miniprogram_dist/Task/TaskPopup/index.scss +101 -0
- package/miniprogram_dist/Task/TaskPopup/index.wxml +55 -0
- package/miniprogram_dist/Task/TaskPopup/index.wxss +250 -0
- package/miniprogram_dist/TeacherGoodsList/index.js +11 -514
- package/miniprogram_dist/TeacherGoodsList/index.json +1 -3
- package/miniprogram_dist/TeacherGoodsList/index.less +62 -0
- package/miniprogram_dist/TeacherGoodsList/index.wxml +20 -89
- package/miniprogram_dist/TeacherGoodsList/index.wxss +14 -132
- package/miniprogram_dist/common/api/liveGoodsList.js +2 -10
- package/package.json +1 -1
- package/src/AliveInvite/LiveRoomVertical/index.wxss +252 -252
- package/src/CollectionAddress/index.wxss +5 -5
- package/src/ConfirmOrder/components/AddressEdit/index.wxss +120 -120
- package/src/ConfirmOrder/components/AddressManage/index.wxss +98 -98
- package/src/ConfirmOrder/components/AddressSelect/index.wxss +67 -67
- package/src/ConfirmOrder/components/ChoosePicker/index.wxss +18 -18
- package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityGiftList/index.wxss +45 -45
- package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/components/entityItem/index.wxss +100 -100
- package/src/ConfirmOrder/components/GoodsInfo/components/GoodsCommerce/index.wxss +55 -55
- package/src/ConfirmOrder/components/GoodsInfo/components/ImageData/index.wxss +13 -13
- package/src/ConfirmOrder/components/Header/index.wxss +26 -26
- package/src/ConfirmOrder/components/IntegralSelect/componenets/integralTips/index.wxss +85 -85
- package/src/ConfirmOrder/components/Invoice/components/InvoiceSelect/index.wxss +155 -155
- package/src/ConfirmOrder/components/Invoice/components/InvoiceTip/index.wxss +51 -51
- package/src/ConfirmOrder/components/ModeSelect/index.wxss +44 -44
- package/src/ConfirmOrder/components/PickupSelect/index.wxss +22 -22
- package/src/ConfirmOrder/components/SelectSite/index.wxss +82 -82
- package/src/ConfirmOrder/components/Shipper/index.wxss +76 -76
- package/src/ConfirmOrder/components/ShipperEdit/index.wxss +78 -78
- package/src/ConfirmOrder/components/WechatAddress/index.wxss +22 -22
- package/src/ConfirmOrder/index.wxss +5 -5
- package/src/CouponList/components/CouponItem/index.js +4 -15
- package/src/CouponList/components/CouponItem/index.scss +1 -1
- package/src/CouponList/components/CouponItem/index.wxml +2 -6
- package/src/CouponList/couponColumn/index.js +0 -79
- package/src/CouponList/couponColumn/index.wxml +0 -1
- package/src/CouponList/couponMsg/index.wxss +3 -3
- package/src/CustomPopup/index.wxss +22 -22
- package/src/GoodsItem/index.js +125 -203
- package/src/GoodsItem/index.json +6 -6
- package/src/GoodsItem/index.less +299 -0
- package/src/GoodsItem/index.scss +64 -256
- package/src/GoodsItem/index.wxml +76 -159
- package/src/GoodsItem/index.wxss +241 -1004
- package/src/LiveGoodsList/index.js +14 -355
- package/src/LiveGoodsList/index.wxml +32 -31
- package/src/LiveGoodsList/index.wxss +230 -230
- package/src/PayComplete/Components/CouponItem/index.wxss +122 -122
- package/src/PayComplete/Components/Header/index.wxss +27 -27
- package/src/PayComplete/Components/LeadGroup/index.wxss +33 -33
- package/src/PayComplete/Components/PayGifts/index.wxss +157 -157
- package/src/PayComplete/Components/PayState/earnIntegral/index.wxss +23 -23
- package/src/PayComplete/Components/PayState/index.wxss +20 -20
- package/src/PayComplete/index.wxss +27 -27
- package/src/PayModule/wechatLoading/index.wxss +57 -57
- package/src/Recommend/index.wxss +110 -110
- package/src/Sku/Header/index.wxss +27 -27
- package/src/Sku/goods-info/index.wxss +52 -52
- package/src/Sku/index/index.wxss +52 -52
- package/src/Sku/row-item/index.wxss +50 -50
- package/src/Sku/step/index.wxss +11 -11
- package/src/Task/TaskPopup/component/RewardList/index.js +27 -0
- package/src/Task/TaskPopup/component/RewardList/index.json +6 -0
- package/src/Task/TaskPopup/component/RewardList/index.scss +0 -0
- package/src/Task/TaskPopup/component/RewardList/index.wxml +10 -0
- package/src/Task/TaskPopup/component/TaskItem/index.js +176 -0
- package/src/Task/TaskPopup/component/TaskItem/index.json +5 -0
- package/src/Task/TaskPopup/component/TaskItem/index.scss +132 -0
- package/src/Task/TaskPopup/component/TaskItem/index.wxml +43 -0
- package/src/Task/TaskPopup/component/TaskItem/index.wxs +8 -0
- package/src/Task/TaskPopup/component/TaskItem/index.wxss +1 -0
- package/src/Task/TaskPopup/component/TaskList/index.js +114 -0
- package/src/Task/TaskPopup/component/TaskList/index.json +7 -0
- package/src/Task/TaskPopup/component/TaskList/index.scss +47 -0
- package/src/Task/TaskPopup/component/TaskList/index.wxml +25 -0
- package/src/Task/TaskPopup/component/TaskList/index.wxss +1 -0
- package/src/Task/TaskPopup/component/TaskType/index.js +39 -0
- package/src/Task/TaskPopup/component/TaskType/index.json +9 -0
- package/src/Task/TaskPopup/component/TaskType/index.scss +60 -0
- package/src/Task/TaskPopup/component/TaskType/index.wxml +42 -0
- package/src/Task/TaskPopup/component/TaskType/index.wxss +1 -0
- package/src/Task/TaskPopup/index.js +69 -0
- package/src/Task/TaskPopup/index.json +8 -0
- package/src/Task/TaskPopup/index.scss +101 -0
- package/src/Task/TaskPopup/index.wxml +55 -0
- package/src/Task/TaskPopup/index.wxss +1 -0
- package/src/TeacherGoodsList/index.js +11 -514
- package/src/TeacherGoodsList/index.json +1 -3
- package/src/TeacherGoodsList/index.less +62 -0
- package/src/TeacherGoodsList/index.wxml +20 -89
- package/src/TeacherGoodsList/index.wxss +14 -151
- package/src/common/api/liveGoodsList.js +2 -10
- package/src/common/css/theme.wxss +16 -16
- package/miniprogram_dist/CouponList/components/CouponItem/index.css +0 -1715
- package/miniprogram_dist/CouponList/components/CouponItem/index.min.css +0 -1
- package/miniprogram_dist/CouponReceivePopup/index.js +0 -72
- package/miniprogram_dist/CouponReceivePopup/index.scss +0 -99
- package/miniprogram_dist/CouponReceivePopup/index.wxml +0 -85
- package/miniprogram_dist/CouponReceivePopup/index.wxss +0 -75
- package/miniprogram_dist/GoodsItem/index.wxs +0 -19
- package/miniprogram_dist/TeacherGoodsList/index.scss +0 -146
- package/src/CouponList/components/CouponItem/index.css +0 -1715
- package/src/CouponList/components/CouponItem/index.min.css +0 -1
- package/src/CouponReceivePopup/index.js +0 -72
- package/src/CouponReceivePopup/index.scss +0 -99
- package/src/CouponReceivePopup/index.wxml +0 -85
- package/src/CouponReceivePopup/index.wxss +0 -1
- package/src/GoodsItem/index.wxs +0 -19
- package/src/TeacherGoodsList/index.scss +0 -146
- package/src/miniprogram_npm/miniprogram-computed/index.js +0 -1
package/.gitlab-ci.yml
CHANGED
|
@@ -167,15 +167,6 @@ Component({
|
|
|
167
167
|
* 组件的方法列表
|
|
168
168
|
*/
|
|
169
169
|
methods: {
|
|
170
|
-
getCouponFunction(){
|
|
171
|
-
if(this.data.isFullscreenList || (this.data.userRole === 'teacher' && !this.data.isFullScreenPopCard)){
|
|
172
|
-
this.sendCoupon()
|
|
173
|
-
}else if(this.data.coupon_type == 1 || this.data.coupon_type == 2){
|
|
174
|
-
this.getCoupon()
|
|
175
|
-
}else {
|
|
176
|
-
return
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
170
|
sendCoupon(data) {
|
|
180
171
|
this.triggerEvent("sendCoupon", {
|
|
181
172
|
couponItem: this.data.item
|
|
@@ -302,12 +293,10 @@ Component({
|
|
|
302
293
|
})
|
|
303
294
|
}
|
|
304
295
|
this.triggerEvent('receivedSuccess') //优惠券领取成功抛出方法用于直播间热度上报
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
// 抛出方法拉起弹窗
|
|
310
|
-
this.triggerEvent('showReceivePopup',{couponInfo: this.data.item})
|
|
296
|
+
wx.showToast({
|
|
297
|
+
title: '领取成功',
|
|
298
|
+
icon: 'none'
|
|
299
|
+
})
|
|
311
300
|
// 全屏端领取成功关闭优惠券弹窗
|
|
312
301
|
if (this.properties.isFullScreen) {
|
|
313
302
|
this.triggerEvent('closeCounpon')
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
<!-- 优惠券形式分为2类:一行和列表 -->
|
|
2
2
|
<!-- styleType===1 时是互动页讲师发放优惠券时的优惠券列表形式 -->
|
|
3
|
-
<view
|
|
4
|
-
class="
|
|
5
|
-
wx:if="{{styleType === 1}}"
|
|
6
|
-
catchtap
|
|
7
|
-
>
|
|
8
|
-
<view class="coupon_style1" catchtap="getCouponFunction">
|
|
3
|
+
<view class="styleType1_wrapper {{aliveMode? 'styleType1_wrapper-v' : ''}} {{ isFullScreenPopCard? 'pop-card' : 'not-pop-card'}} {{isFullscreenList ? 'full-screen-list' : 'vertical-screen'}}" wx:if="{{styleType === 1}}">
|
|
4
|
+
<view class="coupon_style1">
|
|
9
5
|
<view class="couponValue">
|
|
10
6
|
<view class="couponPriceWrap {{item.discount_way == 2 && aliveMode?'couponPriceWrap-discount-v':''}}">
|
|
11
7
|
<!-- discount_way优惠方式 1-满减券 2-折扣券 -->
|
|
@@ -30,13 +30,6 @@ Component({
|
|
|
30
30
|
observer(newVal) {
|
|
31
31
|
newVal && this.initCouponList()
|
|
32
32
|
}
|
|
33
|
-
},
|
|
34
|
-
msgCouponData: {
|
|
35
|
-
type: Object,
|
|
36
|
-
value: {},
|
|
37
|
-
observer(newVal) {
|
|
38
|
-
this.handlerListInfo(newVal)
|
|
39
|
-
}
|
|
40
33
|
}
|
|
41
34
|
},
|
|
42
35
|
|
|
@@ -68,75 +61,6 @@ Component({
|
|
|
68
61
|
* 组件的方法列表
|
|
69
62
|
*/
|
|
70
63
|
methods: {
|
|
71
|
-
/**
|
|
72
|
-
* 带货/优惠券实时同步
|
|
73
|
-
* @param {object} msgData im消息体
|
|
74
|
-
* @param {string} type 消息类型:带货goods、优惠券coupon
|
|
75
|
-
*/
|
|
76
|
-
handlerListInfo(msgData) {
|
|
77
|
-
let type = '', marketInfo = [], couponsList = this.data.couponsList
|
|
78
|
-
|
|
79
|
-
// 遍历获取操作类型
|
|
80
|
-
for (let key in msgData) {
|
|
81
|
-
switch (key) {
|
|
82
|
-
// 新增操作
|
|
83
|
-
case "conf_list":
|
|
84
|
-
type = "couponConfList";
|
|
85
|
-
marketInfo = msgData[key];
|
|
86
|
-
break;
|
|
87
|
-
// 修改操作
|
|
88
|
-
case 'update_list':
|
|
89
|
-
type = 'couponUpdateList'
|
|
90
|
-
marketInfo = msgData[key]
|
|
91
|
-
break
|
|
92
|
-
// 删除操作
|
|
93
|
-
case 'batch_del':
|
|
94
|
-
type = 'couponDelList'
|
|
95
|
-
marketInfo = msgData[key]
|
|
96
|
-
break
|
|
97
|
-
default:
|
|
98
|
-
break
|
|
99
|
-
}
|
|
100
|
-
console.log('[couponColumn] 带货实时同步im', type, marketInfo)
|
|
101
|
-
if (marketInfo?.length > 0) {
|
|
102
|
-
switch (type) {
|
|
103
|
-
case "couponConfList":
|
|
104
|
-
couponsList.push(...marketInfo);
|
|
105
|
-
break;
|
|
106
|
-
case "couponUpdateList":
|
|
107
|
-
marketInfo.map((item) => {
|
|
108
|
-
for (let index = 0; index < couponsList.length; index++) {
|
|
109
|
-
if (item.id === couponsList[index].id) {
|
|
110
|
-
// 遍历插入相应的修改值
|
|
111
|
-
for (let key in item) {
|
|
112
|
-
couponsList[index][key] = item[key];
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
break;
|
|
118
|
-
case "couponDelList":
|
|
119
|
-
marketInfo.map((id) => {
|
|
120
|
-
for (let index = 0; index < couponsList.length; index++) {
|
|
121
|
-
if (id === couponsList[index].id) {
|
|
122
|
-
// 删除操作,获取下标
|
|
123
|
-
couponsList.splice(index, 1);
|
|
124
|
-
index--;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
break;
|
|
129
|
-
default:
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
type = ''
|
|
133
|
-
marketInfo = []
|
|
134
|
-
this.setData({
|
|
135
|
-
couponsList: couponsList
|
|
136
|
-
})
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
64
|
initCouponList() {
|
|
141
65
|
console.log('couponColumncouponColumncouponColumncouponColumncouponColumncouponColumncouponColumncouponColumncouponColumncouponColumncouponColumn')
|
|
142
66
|
const params = {
|
|
@@ -168,9 +92,6 @@ Component({
|
|
|
168
92
|
this.triggerEvent("sendCoupon", {
|
|
169
93
|
couponItem: detail.couponItem
|
|
170
94
|
})
|
|
171
|
-
},
|
|
172
|
-
showReceivePopup(e) {
|
|
173
|
-
this.triggerEvent('showReceivePopup',e.detail.couponInfo)
|
|
174
95
|
}
|
|
175
96
|
}
|
|
176
97
|
})
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
bindreceivedSuccess="receivedSuccess"
|
|
21
21
|
bind:sendCoupon="sendCoupon"
|
|
22
22
|
isFullscreenList="{{isFullscreenList}}"
|
|
23
|
-
bind:showReceivePopup="showReceivePopup"
|
|
24
23
|
/>
|
|
25
24
|
</view>
|
|
26
25
|
<view class="no-data" wx:elif="{{ isFullScreen && (!aliveConf.is_coupon_on || !isInitePage && couponsList.length === 0) }}">
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
PUNCH_CARD
|
|
14
14
|
} from "../common/utils/constants.js";
|
|
15
15
|
|
|
16
|
-
const {
|
|
16
|
+
const {utils, sensorLog } = require("live-mp-tools");
|
|
17
17
|
import { showGoods } from "../common/api/liveGoodsList"
|
|
18
18
|
|
|
19
19
|
const computedBehavior = require('miniprogram-computed').behavior
|
|
@@ -31,8 +31,6 @@ Component({
|
|
|
31
31
|
type: Object,
|
|
32
32
|
value: {},
|
|
33
33
|
observer(newVal) {
|
|
34
|
-
// 商品没有的话,不处理
|
|
35
|
-
if (!newVal.id) return
|
|
36
34
|
//超级会员全免权益
|
|
37
35
|
let svipAllFree = newVal.resource_rights_type === 1
|
|
38
36
|
let currentActive = ''
|
|
@@ -60,7 +58,7 @@ Component({
|
|
|
60
58
|
let nowTime = new Date().getTime()
|
|
61
59
|
let preheating = hasPreheat && nowTime > preHeatTime.getTime() && startTime2.getTime() > nowTime
|
|
62
60
|
let isSeckill = currentActive === '秒杀'
|
|
63
|
-
let checked
|
|
61
|
+
let checked = newVal.is_display_package === 1
|
|
64
62
|
|
|
65
63
|
|
|
66
64
|
this.setData({
|
|
@@ -73,17 +71,7 @@ Component({
|
|
|
73
71
|
preheating,
|
|
74
72
|
isSeckill,
|
|
75
73
|
checked
|
|
76
|
-
}, () =>
|
|
77
|
-
const isOver =
|
|
78
|
-
newVal.stock === 0 ||
|
|
79
|
-
(newVal.is_activity &&
|
|
80
|
-
(newVal.activity_type === 8 || newVal.activity_type === 3) &&
|
|
81
|
-
newVal.activity_stock - newVal.activity_order_num === 0)
|
|
82
|
-
this.setData({
|
|
83
|
-
isOver,
|
|
84
|
-
})
|
|
85
|
-
this.countTime()
|
|
86
|
-
})
|
|
74
|
+
}, () => this.countTime())
|
|
87
75
|
}
|
|
88
76
|
},
|
|
89
77
|
sending: {
|
|
@@ -128,11 +116,11 @@ Component({
|
|
|
128
116
|
type: Boolean,
|
|
129
117
|
value: false
|
|
130
118
|
},
|
|
131
|
-
style:
|
|
119
|
+
style:{
|
|
132
120
|
type: String,
|
|
133
121
|
value: ''
|
|
134
122
|
},
|
|
135
|
-
index:
|
|
123
|
+
index:{
|
|
136
124
|
type: Number,
|
|
137
125
|
value: -1
|
|
138
126
|
},
|
|
@@ -140,15 +128,7 @@ Component({
|
|
|
140
128
|
isGrayMarketing: {
|
|
141
129
|
type: Boolean,
|
|
142
130
|
value: false
|
|
143
|
-
}
|
|
144
|
-
isManage: {
|
|
145
|
-
type: Boolean,
|
|
146
|
-
value: false
|
|
147
|
-
},
|
|
148
|
-
sendingGoodId: {
|
|
149
|
-
type: String,
|
|
150
|
-
value: '',
|
|
151
|
-
},
|
|
131
|
+
}
|
|
152
132
|
},
|
|
153
133
|
|
|
154
134
|
lifetimes: {
|
|
@@ -174,8 +154,7 @@ Component({
|
|
|
174
154
|
isSeckill: false,
|
|
175
155
|
checked: false,
|
|
176
156
|
switchLoading: false,
|
|
177
|
-
imageRadius: rpxToVmin(16)
|
|
178
|
-
isOver: false, //是否已抢光
|
|
157
|
+
imageRadius: rpxToVmin(16)
|
|
179
158
|
},
|
|
180
159
|
computed: {
|
|
181
160
|
showPreferentialPrice(properties) {
|
|
@@ -222,7 +201,7 @@ Component({
|
|
|
222
201
|
},
|
|
223
202
|
//销量/订阅。只有 实物商品 21 、专栏 6、大专栏 8、会员 5 展示,受B端店铺设置(hide_sub_count):隐藏商品销量控制 0-显示 1-隐藏
|
|
224
203
|
hasSaleNum(data) {
|
|
225
|
-
return !data.goodsItem.hide_sub_count && data.goodsItem.order_num > 0
|
|
204
|
+
return [21, 6, 8, 5, 41, 68].indexOf(data.goodsItem.resource_type) > -1 && !data.goodsItem.hide_sub_count && data.goodsItem.order_num > 0
|
|
226
205
|
},
|
|
227
206
|
//销量/订阅。只有 实物商品 21 、专栏 6、大专栏 8、会员 5 展示
|
|
228
207
|
saleNum(data) {
|
|
@@ -242,9 +221,9 @@ Component({
|
|
|
242
221
|
if (data.allContactPay || (data.isIOS && !data.IOSMiniProgramCanBuy)) {
|
|
243
222
|
// IOS小程序中不能买的展示去查看,跳转到小程序客服
|
|
244
223
|
return "去查看"
|
|
245
|
-
} else if (data.
|
|
224
|
+
} else if (data.goodsItem.hasStock && data.goodsItem.leftStock === 0) {
|
|
246
225
|
// 库存为0,已售罄
|
|
247
|
-
return "
|
|
226
|
+
return "抢光了"
|
|
248
227
|
} else if (data.goodsItem.err_code) {
|
|
249
228
|
// 券后价接口报错,领取不了优惠券的情况
|
|
250
229
|
return "查看详情"
|
|
@@ -253,9 +232,9 @@ Component({
|
|
|
253
232
|
return "免费领取"
|
|
254
233
|
} else if (data.showPreferentialPrice) {
|
|
255
234
|
// 展示券后价
|
|
256
|
-
return "
|
|
235
|
+
return "券后"
|
|
257
236
|
} else {
|
|
258
|
-
return "
|
|
237
|
+
return "去抢购"
|
|
259
238
|
}
|
|
260
239
|
},
|
|
261
240
|
//当前适用的活动或者超级会员,活动价低就是活动,会员价低就是超级会员,超级会员全免,肯定最低,适用超级会员
|
|
@@ -292,63 +271,6 @@ Component({
|
|
|
292
271
|
},
|
|
293
272
|
filterSrc(data) {
|
|
294
273
|
return utils.replaceCDN(data.goodsItem.img_url, '?imageMogr2/thumbnail/400x400>/ignore-error/1')
|
|
295
|
-
},
|
|
296
|
-
|
|
297
|
-
// 已售百分比
|
|
298
|
-
percentage(data) {
|
|
299
|
-
if (data.isOver) return 100
|
|
300
|
-
// 无库存 拼团、限时抢购
|
|
301
|
-
if (!data.goodsItem.activity_stock) return 28
|
|
302
|
-
let num = 0
|
|
303
|
-
num = (data.goodsItem.activity_order_num / data.goodsItem.activity_stock) * 100
|
|
304
|
-
// 有库存时,最低占40%
|
|
305
|
-
return num <= 40 ? 40 : num
|
|
306
|
-
},
|
|
307
|
-
// 商品剩余数量
|
|
308
|
-
residueQuantity(data) {
|
|
309
|
-
let formatNum = (num) => {
|
|
310
|
-
if (!num || isNaN(num)) return num
|
|
311
|
-
num = Number(num)
|
|
312
|
-
if (Math.abs(num) >= 100000000) {
|
|
313
|
-
num = num / 100000000
|
|
314
|
-
return this.isDecimals(Math.floor(num * 100) / 100) ? Math.floor(num * 100) / 100 + '亿' : num + '亿'
|
|
315
|
-
} else if (Math.abs(num) >= 10000) {
|
|
316
|
-
num = num / 10000
|
|
317
|
-
return this.isDecimals(Math.floor(num * 100) / 100) ? Math.floor(num * 100) / 100 + '万' : num + '万'
|
|
318
|
-
} else {
|
|
319
|
-
return num
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
// "已抢光"
|
|
324
|
-
if (data.isOver) return '已抢光'
|
|
325
|
-
|
|
326
|
-
// 没有库存 - 已开抢
|
|
327
|
-
if (!data.goodsItem.activity_stock) return '已开抢'
|
|
328
|
-
|
|
329
|
-
return `仅剩${formatNum(data.goodsItem.activity_stock - data.goodsItem.activity_order_num)}件`
|
|
330
|
-
},
|
|
331
|
-
// 配送方式(-1:全部 1:快递配送 2:自提)
|
|
332
|
-
distributionWay(data) {
|
|
333
|
-
let text = ''
|
|
334
|
-
switch (data.goodsItem.distribution_pattern) {
|
|
335
|
-
case -1:
|
|
336
|
-
text = '自提·快递'
|
|
337
|
-
break
|
|
338
|
-
case 1:
|
|
339
|
-
text = '快递'
|
|
340
|
-
break
|
|
341
|
-
case 2:
|
|
342
|
-
text = '自提'
|
|
343
|
-
break
|
|
344
|
-
default:
|
|
345
|
-
text = ''
|
|
346
|
-
break
|
|
347
|
-
}
|
|
348
|
-
return text
|
|
349
|
-
},
|
|
350
|
-
distributionPattern(data) {
|
|
351
|
-
return [-1,1,2].indexOf(data.goodsItem.distribution_pattern) !== -1
|
|
352
274
|
}
|
|
353
275
|
},
|
|
354
276
|
/**
|
|
@@ -380,19 +302,19 @@ Component({
|
|
|
380
302
|
cmm3: isFullScreen ? '全屏' : '非全屏'
|
|
381
303
|
})
|
|
382
304
|
// 线下课29课时包42/拼团 --判断权益
|
|
383
|
-
if
|
|
305
|
+
if([29,42].indexOf(this.data.goodsItem.resource_type) > -1 || this.data.goodsItem.activity_type === 6){
|
|
384
306
|
this.judgePermission()
|
|
385
307
|
return
|
|
386
308
|
}
|
|
387
309
|
let params = {
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
310
|
+
id: this.data.goodsItem.id,
|
|
311
|
+
resource_id: this.data.goodsItem.resource_id,
|
|
312
|
+
resource_type: this.data.goodsItem.resource_type,
|
|
313
|
+
price: this.data.goodsItem.price,
|
|
314
|
+
app_id:this.data.aliveInfo.app_id,
|
|
315
|
+
user_id:this.data.aliveInfo.user_id,
|
|
316
|
+
coupon_id: this.data.goodsItem.coupon_id,
|
|
317
|
+
alive_id: this.data.aliveInfo.alive_id
|
|
396
318
|
}
|
|
397
319
|
const url = this.properties.isGrayMarketing ? snapCheckNew : snapCheck
|
|
398
320
|
url(params).then(res => {
|
|
@@ -458,10 +380,10 @@ Component({
|
|
|
458
380
|
console.log("permission", permission)
|
|
459
381
|
// 有权益的情况下
|
|
460
382
|
if (permission) {
|
|
461
|
-
|
|
383
|
+
// 电子书20/班课35 鹅学习不支持,无权益的情况下,内嵌h5, 有权益TOAST提示
|
|
462
384
|
if ([20, 35].indexOf(this.data.goodsItem.resource_type) > -1) {
|
|
463
385
|
this.showToast('您已拥有该课程,小程序内暂不支持学习此课程')
|
|
464
|
-
}
|
|
386
|
+
}else {
|
|
465
387
|
// 弹出提示去小程序学习 有三种可能 -圈子小程序 -小鹅通小程序 -打卡小程序
|
|
466
388
|
this.showdialog(this.data.goodsItem)
|
|
467
389
|
}
|
|
@@ -474,8 +396,8 @@ Component({
|
|
|
474
396
|
return new Promise((resolve, reject) => {
|
|
475
397
|
let params = {
|
|
476
398
|
id: this.data.goodsItem.id,
|
|
477
|
-
app_id:
|
|
478
|
-
user_id:
|
|
399
|
+
app_id:this.data.aliveInfo.app_id,
|
|
400
|
+
user_id:this.data.aliveInfo.user_id,
|
|
479
401
|
}
|
|
480
402
|
const url = this.properties.isGrayMarketing ? getUserPermissionNew : getUserPermission
|
|
481
403
|
url(params).then((res) => {
|
|
@@ -608,111 +530,111 @@ Component({
|
|
|
608
530
|
})
|
|
609
531
|
}
|
|
610
532
|
},
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
533
|
+
//judgePermission里面 showDialog 外部弹窗调用
|
|
534
|
+
toMiniProgram(goodsInfo){
|
|
535
|
+
let { aliveInfo, sensorReportParams } = this.properties
|
|
536
|
+
sensorLog.sensors.track('click_butt',{
|
|
537
|
+
page_id:'e_alive#mini#first#alive_room',
|
|
538
|
+
page_name:'直播间页面',
|
|
539
|
+
l_program: '鹅直播',
|
|
540
|
+
page_path: '鹅直播#小程序#首页#直播间页面',
|
|
541
|
+
page_button: "前往",
|
|
542
|
+
app_id: aliveInfo.app_id,
|
|
543
|
+
c_user_id: aliveInfo.user_id,
|
|
544
|
+
union_id: wx.getStorageSync('userInfo').universal_union_id,
|
|
545
|
+
current_role: sensorReportParams.current_role,
|
|
546
|
+
resource_id: aliveInfo.alive_id,
|
|
547
|
+
$url_path: `alive/${aliveInfo.alive_id}`,
|
|
548
|
+
type: sensorReportParams.type,
|
|
549
|
+
cmm1: sensorReportParams.alive_type,
|
|
550
|
+
cmm2: sensorReportParams.version_type,
|
|
551
|
+
comm2: sensorReportParams.pay_type
|
|
552
|
+
})
|
|
553
|
+
let spu_type = goodsInfo.spu_type
|
|
554
|
+
switch(spu_type){
|
|
555
|
+
case ASSOCIATION:
|
|
556
|
+
this.toAssociation(goodsInfo);
|
|
557
|
+
break;
|
|
558
|
+
case PUNCH_CARD:
|
|
559
|
+
this.toPunchCard(goodsInfo);
|
|
560
|
+
break;
|
|
561
|
+
default:
|
|
562
|
+
this.toXiaoeLearn(goodsInfo);
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
toXiaoeLearn(goodsInfo){
|
|
567
|
+
let { aliveInfo } = this.properties
|
|
568
|
+
let h5_url = this.formatUrl(goodsInfo)
|
|
569
|
+
var path
|
|
570
|
+
// 音频 视频
|
|
571
|
+
if(goodsInfo.resource_type === 2 || goodsInfo.resource_type === 3){
|
|
572
|
+
path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&resource_id=${goodsInfo.id}&unique_type=elive`
|
|
573
|
+
}else {
|
|
574
|
+
// 其他
|
|
575
|
+
path = `/pages/index/authorizePage?user_id=${aliveInfo.user_id}&app_id=${aliveInfo.app_id}&h5_url=${h5_url}`
|
|
576
|
+
}
|
|
577
|
+
let params = {
|
|
578
|
+
appId: "wxa3589f1193170aa3",
|
|
579
|
+
path,
|
|
580
|
+
}
|
|
581
|
+
if(this.properties.envName == 'inside' || this.properties.envName == 'test'){ //开发环境 测试环境 加上这个参数可以跳转去鹅学习体验版
|
|
582
|
+
params.appId = 'wx9eb4d7b3f2a3e003'
|
|
583
|
+
params.envVersion='trial'
|
|
584
|
+
}
|
|
585
|
+
wx.navigateToMiniProgram(params)
|
|
586
|
+
},
|
|
587
|
+
toPunchCard(goodsInfo){
|
|
588
|
+
let { aliveInfo } = this.properties
|
|
589
|
+
let path = `/pages-participate-progress/pages/participate/participate?app_id=${aliveInfo.app_id}&&activity_id=${goodsInfo.resource_id}`
|
|
590
|
+
let params = {
|
|
591
|
+
appId: "wx839728854b1e23ad", //现网
|
|
592
|
+
path,
|
|
593
|
+
}
|
|
594
|
+
if(this.properties.envName == 'inside'){ //开发环境
|
|
595
|
+
params.appId = 'wx802f346b1c7dcdd9'
|
|
596
|
+
}else if(this.properties.envName == 'test'){ // 测试环境
|
|
597
|
+
params.appId = 'wx778bc88236be97d9'
|
|
598
|
+
}
|
|
599
|
+
wx.navigateToMiniProgram(params)
|
|
600
|
+
},
|
|
601
|
+
toAssociation(goodsInfo){
|
|
602
|
+
let { aliveInfo } = this.properties
|
|
603
|
+
let path = `/pages-community/pages/home/index?appId=${aliveInfo.app_id}&&communityId=${goodsInfo.resource_id}`
|
|
604
|
+
let params = {
|
|
605
|
+
appId: "wxd0ad7e76d51ae4cc",
|
|
606
|
+
path,
|
|
607
|
+
}
|
|
608
|
+
if(this.properties.envName == 'inside'){
|
|
609
|
+
params.appId = 'wx52419e90dc6dd535' //开发环境
|
|
610
|
+
}else if(this.properties.envName == 'test'){ //测试环境
|
|
611
|
+
params.appId = 'wxb245d452213c48c9' //测试环境
|
|
612
|
+
}
|
|
613
|
+
wx.navigateToMiniProgram(params)
|
|
614
|
+
},
|
|
615
|
+
sendGoodsCard(e) {
|
|
616
|
+
let dataset = e.currentTarget.dataset;
|
|
617
|
+
// 触发父组件的send
|
|
618
|
+
this.triggerEvent('sendGoodsCard', {
|
|
619
|
+
datas: dataset
|
|
620
|
+
});
|
|
621
|
+
},
|
|
622
|
+
changeShowType(){
|
|
623
|
+
if(this.data.goodsItem.teacher_auth != 2){
|
|
624
|
+
this.showToast('暂无权限')
|
|
625
|
+
return
|
|
626
|
+
}
|
|
627
|
+
this.setData({
|
|
628
|
+
switchLoading: true
|
|
629
|
+
})
|
|
708
630
|
let params = {
|
|
709
631
|
alive_id: this.properties.aliveInfo.alive_id,
|
|
710
632
|
app_id: this.properties.aliveInfo.app_id,
|
|
711
633
|
resource_id: this.data.goodsItem.id,
|
|
712
634
|
is_display_package: this.data.checked ? 0 : 1
|
|
713
635
|
};
|
|
714
|
-
showGoods(params).then((res) => {
|
|
715
|
-
console.log(res,
|
|
636
|
+
showGoods(params).then( (res) => {
|
|
637
|
+
console.log(res,"resres")
|
|
716
638
|
let { code } = res.data
|
|
717
639
|
if (code === 0) {
|
|
718
640
|
this.setData({
|
|
@@ -720,7 +642,7 @@ Component({
|
|
|
720
642
|
checked: !this.data.checked
|
|
721
643
|
})
|
|
722
644
|
this.showToast('操作成功')
|
|
723
|
-
}
|
|
645
|
+
}else{
|
|
724
646
|
this.setData({
|
|
725
647
|
switchLoading: false
|
|
726
648
|
})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"component": true,
|
|
3
|
-
"usingComponents": {
|
|
4
|
-
"van-switch": "@vant/weapp/switch/index"
|
|
5
|
-
}
|
|
6
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"component": true,
|
|
3
|
+
"usingComponents": {
|
|
4
|
+
"van-switch": "@vant/weapp/switch/index"
|
|
5
|
+
}
|
|
6
|
+
}
|