wl-design-mobile 0.1.9 → 0.2.1
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/list/lambo-list.vue +8 -5
- package/package.json +1 -1
- package/util/jssdk.js +35 -2
package/list/lambo-list.vue
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<div :style="{ height: listHeight }" class="custom-list">
|
|
17
17
|
<van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
18
18
|
<van-list v-model="loading" :finished="finished" :finished-text="finishedTxt" :offset="200" @load="onLoad"
|
|
19
|
-
:error.sync="error" :error-text="errorText">
|
|
19
|
+
:error.sync="error" :error-text="errorText" :immediate-check="false">
|
|
20
20
|
<div v-for="(item, index) in list" :key="index" class="list-item">
|
|
21
21
|
<div class="card-item">
|
|
22
22
|
<slot name="head" v-bind:item="item"></slot>
|
|
@@ -90,9 +90,11 @@ export default {
|
|
|
90
90
|
this.list = [];
|
|
91
91
|
this.refreshing = false;
|
|
92
92
|
}
|
|
93
|
+
this.loading = true
|
|
93
94
|
if (this.testMode === true) {
|
|
95
|
+
console.log("lambo-list -- onLoad -- loadData:", this.pageNum)
|
|
94
96
|
setTimeout(() => {
|
|
95
|
-
this.
|
|
97
|
+
console.log('this.searchParams',this.searchParams)
|
|
96
98
|
let arr = [
|
|
97
99
|
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-01", person:"01", dpt: "储配部", note: "测试"},
|
|
98
100
|
{title: "盐城市亭湖区大树酒业商行", time: "2024-01-02", person:"02", dpt: "储配部", note: "测试"},
|
|
@@ -107,9 +109,10 @@ export default {
|
|
|
107
109
|
]
|
|
108
110
|
this.list.push(...arr)
|
|
109
111
|
this.finished = false
|
|
112
|
+
this.loading = false
|
|
110
113
|
this.offset = this.pageNum * 10
|
|
111
114
|
this.pageNum++;
|
|
112
|
-
}, 1000); // 暂停
|
|
115
|
+
}, 1000); // 暂停1秒
|
|
113
116
|
|
|
114
117
|
}else{
|
|
115
118
|
let params = {offset: this.offset, limit: this.limit, ...this.searchParams}
|
|
@@ -138,14 +141,14 @@ export default {
|
|
|
138
141
|
console.error("lambo-init-list -- onLoad -- 查询[" + this.title + "]数据失败", res)
|
|
139
142
|
Toast.fail("查询[" + this.title + "]数据失败:" + res.data || '')
|
|
140
143
|
this.error = true;
|
|
141
|
-
this.errorText = res.data
|
|
144
|
+
this.errorText = '请求失败\n'+res.data
|
|
142
145
|
}
|
|
143
146
|
this.loading = false; // 加载状态结束
|
|
144
147
|
}).catch(err => {
|
|
145
148
|
console.error("lambo-init-list -- onLoad -- 查询[" + this.title + "]异常:", err)
|
|
146
149
|
Toast.fail("查询[" + this.url + "]数据异常")
|
|
147
150
|
this.error = true;
|
|
148
|
-
this.errorText = err
|
|
151
|
+
this.errorText = '请求失败\n'+err
|
|
149
152
|
this.loading = false; // 加载状态结束
|
|
150
153
|
})
|
|
151
154
|
}
|
package/package.json
CHANGED
package/util/jssdk.js
CHANGED
|
@@ -198,7 +198,39 @@ let JsSDK = (function () {
|
|
|
198
198
|
reject('微信获取位置失败:'+error)
|
|
199
199
|
})
|
|
200
200
|
}
|
|
201
|
-
|
|
201
|
+
})
|
|
202
|
+
}
|
|
203
|
+
function openLocation({longitude,latitude,name,address,scale= 15} = {}){
|
|
204
|
+
return new Promise((resolve, reject)=>{
|
|
205
|
+
if(getAppType() === '30'){
|
|
206
|
+
configDd().then(()=>{
|
|
207
|
+
dd.openLocation({
|
|
208
|
+
title: name,
|
|
209
|
+
address: address,
|
|
210
|
+
latitude: latitude,
|
|
211
|
+
longitude: longitude,
|
|
212
|
+
success: () => {},
|
|
213
|
+
fail: () => {},
|
|
214
|
+
complete: () => {},
|
|
215
|
+
});
|
|
216
|
+
resolve()
|
|
217
|
+
}).catch((error)=>{
|
|
218
|
+
reject('钉钉启动内置地图位置失败:'+error)
|
|
219
|
+
})
|
|
220
|
+
}else{
|
|
221
|
+
configWx().then(()=>{
|
|
222
|
+
wx.openLocation({
|
|
223
|
+
latitude: latitude,//目的地latitude
|
|
224
|
+
longitude: longitude,//目的地longitude
|
|
225
|
+
name: name,
|
|
226
|
+
address: address,
|
|
227
|
+
scale: scale//地图缩放大小,可根据情况具体调整
|
|
228
|
+
});
|
|
229
|
+
resolve()
|
|
230
|
+
}).catch((error)=>{
|
|
231
|
+
reject('微信启动内置地图失败:'+error)
|
|
232
|
+
})
|
|
233
|
+
}
|
|
202
234
|
})
|
|
203
235
|
}
|
|
204
236
|
|
|
@@ -206,7 +238,8 @@ let JsSDK = (function () {
|
|
|
206
238
|
return {
|
|
207
239
|
init:init,
|
|
208
240
|
scanQRCode: scanQRCode,
|
|
209
|
-
getLocation:getLocation
|
|
241
|
+
getLocation:getLocation,
|
|
242
|
+
openLocation:openLocation
|
|
210
243
|
};
|
|
211
244
|
})();
|
|
212
245
|
|