gxd-uni-library-editx 1.0.14 → 1.0.15
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
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
}),
|
|
75
75
|
getCityName(){
|
|
76
76
|
if (this.$configProject.isPreview) return this.$xdUniHelper.cutStringLen(this.$settings.defaultCity.city_name, 6);
|
|
77
|
-
if(!this.stateCity.city_name) return '';
|
|
77
|
+
if(!this.stateCity.city_name) return '定位失败';
|
|
78
78
|
return this.$xdUniHelper.cutStringLen(this.stateCity.city_name, 6)
|
|
79
79
|
}
|
|
80
80
|
},
|
|
@@ -97,13 +97,21 @@
|
|
|
97
97
|
let current = {};
|
|
98
98
|
let useCode = null;
|
|
99
99
|
let switchStatus = storage.get(this.userUsePopStatus);
|
|
100
|
+
|
|
101
|
+
//接口有返回值
|
|
100
102
|
if (storage.get(this.currentLocationCity)){
|
|
101
103
|
current = storage.get(this.currentLocationCity);
|
|
102
104
|
currentCode = current.city_code;
|
|
103
105
|
}
|
|
104
106
|
|
|
105
107
|
//当前选中的城市为默认城市直接替换
|
|
106
|
-
if(storage.get(this.useSelectCity).isDefault) {
|
|
108
|
+
if(storage.get(this.useSelectCity) && storage.get(this.useSelectCity).isDefault) {
|
|
109
|
+
|
|
110
|
+
//设置的是默认值
|
|
111
|
+
if(this.$xdUniHelper.isEmpty(current)) {
|
|
112
|
+
this.$emit("done", {city: storage.get(this.useSelectCity), location: this.location});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
107
115
|
storage.remove(this.useSelectCity);
|
|
108
116
|
this.setCityInfo(current);
|
|
109
117
|
this.$emit("done", {city: current, location: this.location});
|
|
@@ -1,94 +1,108 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
<view class="xd-product-status" v-if="status !== 'ok' && initStatus">
|
|
3
|
+
<view
|
|
4
|
+
:style="{
|
|
5
|
+
background: styleObj.bgColor,
|
|
6
|
+
color: styleObj.color,
|
|
7
|
+
height: height,
|
|
8
|
+
width: width
|
|
9
|
+
}">{{styleObj['name']}}</view>
|
|
10
|
+
</view>
|
|
5
11
|
</template>
|
|
6
12
|
|
|
7
13
|
<script>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
import {
|
|
15
|
+
getParentsStyles //获取页面风格列表
|
|
16
|
+
} from '@/utils/xd.base';
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
18
|
+
const Color = require('color');
|
|
19
|
+
|
|
20
|
+
export default {
|
|
21
|
+
name: "XdProductStatus",
|
|
22
|
+
props: {
|
|
23
|
+
status: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "ok",
|
|
26
|
+
},
|
|
27
|
+
color: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "#fff",
|
|
30
|
+
},
|
|
31
|
+
bgColor: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "#fff",
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
width: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: '50%',
|
|
39
|
+
},
|
|
40
|
+
height:{
|
|
41
|
+
type: String,
|
|
42
|
+
default: '50%',
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
computed:{
|
|
48
|
+
styleObj(){
|
|
49
|
+
return this.map[this.status]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
data(){
|
|
53
|
+
return {
|
|
54
|
+
initStatus: false,
|
|
55
|
+
map: {
|
|
56
|
+
ok: {
|
|
57
|
+
name: '正常',
|
|
58
|
+
color: 'rgba(0,0,0,0)',
|
|
59
|
+
bgColor: 'rgba(0,0,0,0)'
|
|
60
|
+
},
|
|
61
|
+
soldout: {
|
|
62
|
+
name: '已售罄',
|
|
63
|
+
color: '#fff',
|
|
64
|
+
bgColor: ''
|
|
65
|
+
},
|
|
66
|
+
off: {
|
|
67
|
+
name: '已下架',
|
|
68
|
+
color: '#fff',
|
|
69
|
+
bgColor: ''
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
async created(){
|
|
75
|
+
let style = await getParentsStyles(this.$parent);
|
|
76
|
+
this.initStatus = true;
|
|
77
|
+
let soldoutBgc = Color(style['$warningColor']).alpha(0.8).toString();
|
|
78
|
+
let offBgc = Color(style['$infoColor']).alpha(0.9).toString();
|
|
79
|
+
this.$set(this.map.soldout, 'bgColor', soldoutBgc);
|
|
80
|
+
this.$set(this.map.off, 'bgColor', offBgc)
|
|
81
|
+
},
|
|
82
|
+
}
|
|
67
83
|
</script>
|
|
68
84
|
|
|
69
85
|
<style scoped lang="less">
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
86
|
+
.xd-product-status {
|
|
87
|
+
width: 100%;
|
|
88
|
+
height: 100%;
|
|
89
|
+
position: absolute;
|
|
90
|
+
top: 0;
|
|
91
|
+
left: 0;
|
|
92
|
+
right: 0;
|
|
93
|
+
bottom: 0;
|
|
94
|
+
display: flex;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
align-items: center;
|
|
97
|
+
|
|
98
|
+
&> view {
|
|
99
|
+
border-radius: 50%;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
font-size: unit(24, rpx);
|
|
102
|
+
display: flex;
|
|
103
|
+
justify-content: center;
|
|
104
|
+
align-items: center;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
}
|
|
94
108
|
</style>
|
|
@@ -40,9 +40,11 @@ export default {
|
|
|
40
40
|
|
|
41
41
|
methods:{
|
|
42
42
|
...mapMutations(['setSrollPreview']),
|
|
43
|
+
|
|
43
44
|
onJfbHide(){
|
|
44
45
|
this.showStatus = false;
|
|
45
46
|
},
|
|
47
|
+
|
|
46
48
|
onJfbShow(options){
|
|
47
49
|
this.showStatus = true;
|
|
48
50
|
this.clearDefault();
|
|
@@ -109,6 +111,7 @@ export default {
|
|
|
109
111
|
item['index'] = index;
|
|
110
112
|
return item
|
|
111
113
|
});
|
|
114
|
+
|
|
112
115
|
this.cardOrgList = this.$xdUniHelper.cloneDeep(validCardList);
|
|
113
116
|
this.cardComputedList = this.cardOrgList.slice(this.cardPageNum,this.cardPageLen);
|
|
114
117
|
this.handleCardComputed(paddingBottom).then().catch();
|
|
@@ -124,11 +127,11 @@ export default {
|
|
|
124
127
|
},
|
|
125
128
|
|
|
126
129
|
onJfbReachBottom(){
|
|
127
|
-
|
|
130
|
+
//加载在不处理,无下一页不处理,当前也为0不处理
|
|
131
|
+
if(this.cardLoading || !this.hasContent || this.cardPageNum === 0) return;
|
|
128
132
|
this.cardLoading = true;
|
|
129
133
|
this.$xdShowLoading({});
|
|
130
134
|
this.cardPageNum++;
|
|
131
|
-
console.log('onJfbReachBottom',this.cardPageNum)
|
|
132
135
|
this.$nextTick(()=>{
|
|
133
136
|
setTimeout(()=>{
|
|
134
137
|
this.cardLoading = false;
|
|
@@ -147,6 +150,7 @@ export default {
|
|
|
147
150
|
},
|
|
148
151
|
|
|
149
152
|
clearDefault(){
|
|
153
|
+
|
|
150
154
|
this.cardOrgList = [];
|
|
151
155
|
this.cardList = null;
|
|
152
156
|
this.cardPageNum = 0;
|
|
@@ -155,6 +159,7 @@ export default {
|
|
|
155
159
|
this.cardNextTop = 0;
|
|
156
160
|
this.contentStatus = false;
|
|
157
161
|
this.hasContent = true;
|
|
162
|
+
this.ajaxCardList = null;
|
|
158
163
|
//this.hasChangeStatus = false;
|
|
159
164
|
}
|
|
160
165
|
}
|