Commit 8b99a8c4 authored by xinzhedeai's avatar xinzhedeai

add:商户编辑 、列表分页

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