Commit 8b99a8c4 authored by xinzhedeai's avatar xinzhedeai

add:商户编辑 、列表分页

parent 49912ae1
......@@ -211,8 +211,8 @@
<option
v-for="(item, i) in dict4changhsuoType"
:key="i"
:label="item.dictLabel"
:value="Number(item.dictValue)"
:label="item.categoryName"
:value="item.id"
></option>
</select>
</div>
......
......@@ -6,6 +6,12 @@ window.addEventListener('load', function () {
el: '#app',
data() {
return {
loading: false,
finished: false,
page: 0,
size: 9999,
total: 0,
activeTab: 0,
flag: 'XQ',
canvasReady: false,
......@@ -77,6 +83,19 @@ window.addEventListener('load', function () {
this.getDict4industryType()
// this.getDict4changhsuoType()
},
watch: {
'formData.industryType': {
handler(newVal) {
// 选择后晴空下级下拉框值
this.dict4changhsuoType = []
this.getDict4changhsuoType({
industryId: newVal
})
},
deep: true // 深度监听对象属性
}
},
methods: {
viewDetail(item) {
let params = {
......@@ -100,19 +119,25 @@ window.addEventListener('load', function () {
});
},
getConsumerSuggestList() {
vant.Toast.loading({
message: '正在加载...',
forbidClick: true,
loadingType: 'spinner',
});
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
interfacePublicKey: API_KEY_MAP["page"]["publicKey"],
interfacePrivateKey: API_KEY_MAP["page"]["privateKey"],
reqParams: {
page: 1,
size: 9999,
page: this.page++, // 每次请求增加下一页
size: this.size,
sign: 18, // 消费者建议列表
"merId": gemhoUtil.getParameter('merId'),
}
}, (res) => {
if (!res) { // 中台返回为undefined 重新请求
vant.Toast.clear()
this.page = this.page - 1 // 重新请求后,分页数恢复上一次请求的值
setTimeout(() => {
this.consumerSuggestList()
}, 0);
......@@ -126,9 +151,19 @@ window.addEventListener('load', function () {
})
}, 0);
var result = JSON.parse(res)
this.consumerSuggestList = result.rows
this.consumerSuggestList.push(...result.rows);
this.total = result.totalElements
if (this.page * this.size >= this.total) {
this.finished = true; // 下滑不在刷新数据
}
}
this.loading = false
setTimeout(() => {
this.$nextTick(()=>{
vant.Toast.clear()
})
}, 0);
})
},
getDict4changhsuoType(param) {
......@@ -159,17 +194,20 @@ window.addEventListener('load', function () {
}, 0);
var result = JSON.parse(res)
this.dict4changhsuoType = result.data.body.data
if(!this.dict4businessType.length){ // 如果下拉列表为空,则置空场所类型的值。
this.formData.smallPlaceTypeId = null
}
}
})
},
handleIndustryChange(val) {
// 选择后晴空下级下拉框值
this.dict4changhsuoType = []
this.getDict4changhsuoType({
industryId: this.formData.industryType
})
},
// handleIndustryChange(val) {
// // 选择后晴空下级下拉框值
// this.dict4changhsuoType = []
// this.getDict4changhsuoType({
// industryId: this.formData.industryType
// })
// },
getDict4industryType() {
http2.post({
serviceId: API_KEY_MAP["page"]['id'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment