From 9c34e8cc2ff136db5c27a5adc2eb2e140ac0580a Mon Sep 17 00:00:00 2001
From: whycq <you@example.com>
Date: 星期日, 01 一月 2023 06:17:15 +0800
Subject: [PATCH] #
---
pages/business/cstmr/addCsmtr.vue | 2 --
pages/business/cstmr/csmtr.vue | 34 +++++++++++++++++++++++++---------
pages/business/cstmr/cstmrDetails.vue | 17 ++++-------------
main.js | 2 +-
4 files changed, 30 insertions(+), 25 deletions(-)
diff --git a/main.js b/main.js
index 9770a12..b71239c 100644
--- a/main.js
+++ b/main.js
@@ -3,7 +3,7 @@
// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
-Vue.prototype.baseUrl = 'http://192.168.4.188:9528'
+Vue.prototype.baseUrl = 'http://127.0.0.1:9528'
App.mpType = 'app'
const app = new Vue({
...App
diff --git a/pages/business/cstmr/addCsmtr.vue b/pages/business/cstmr/addCsmtr.vue
index 4527d80..569908b 100644
--- a/pages/business/cstmr/addCsmtr.vue
+++ b/pages/business/cstmr/addCsmtr.vue
@@ -50,7 +50,6 @@
export default {
data() {
return {
- baseUrl: '',
cstmrTypes: [],
cstmrType: '',
directors: [],
@@ -147,7 +146,6 @@
onShow() {
// 鑾峰彇鐪佸競鍖�
this.citysData = test.citysData
- this.baseUrl = uni.getStorageSync('baseUrl')
this.autoLoad('cstmrType','')
this.autoLoad('user','')
},
diff --git a/pages/business/cstmr/csmtr.vue b/pages/business/cstmr/csmtr.vue
index ee74470..e81e043 100644
--- a/pages/business/cstmr/csmtr.vue
+++ b/pages/business/cstmr/csmtr.vue
@@ -4,7 +4,7 @@
<view class="search-bg">
<uni-search-bar placeholder="瀹㈡埛浠e彿/鍚嶇О" bgColor="#f4f4f4" @confirm="search" />
</view>
- <scroll-view>
+ <view>
<!-- 瀹㈡埛鍒楄〃 -->
<view class="c-list" @click="getDetails(item.id)" v-for="(item,index) in csmtrList" :key="index">
<view class="titles"><y-title :title="item.name"></y-title></view><view></view>
@@ -17,7 +17,8 @@
<view class="list-item1">鍒涘缓浜�</view><view class="list-item2">{{item.createBy$}}</view>
<view class="list-item1">鍒涘缓鏃堕棿</view><view class="list-item2">{{item.createTime$}}</view>
</view>
- </scroll-view>
+ </view>
+ <uni-load-more :status="status" :icon-size="16" :content-text="contentText" />
</view>
</template>
@@ -25,8 +26,16 @@
export default {
data() {
return {
- baseUrl: '',
csmtrList: [],
+ last_id: '',
+ reload: false,
+ status: 'more',
+ curr:1,
+ contentText: {
+ contentdown: '涓婃媺鍔犺浇鏇村',
+ contentrefresh: '鍔犺浇涓�',
+ contentnomore: '娌℃湁鏇村'
+ }
}
},
// 鏂板缓鎸夐挳浜嬩欢
@@ -36,8 +45,11 @@
})
},
onShow() {
- this.baseUrl = uni.getStorageSync('baseUrl')
this.getCsmtr()
+ },
+ onReachBottom() {
+ this.status = 'more';
+ this.getCsmtr();
},
methods: {
getCsmtr() {
@@ -52,10 +64,9 @@
});
}, 1000);
},
- header: {'token' : uni.getStorageSync('token'),
- "content-type": "application/json"},
- data: {curr:1,limit:16},
- method:'POST',
+ header: {'token' : uni.getStorageSync('token'),},
+ data: {curr:that.curr,limit:4},
+ method:'GET',
success(result) {
if (result.statusCode === 404) {
uni.showToast({title: '璇烽噸鏂扮櫥褰�', icon: "none", position: 'top'})
@@ -63,7 +74,12 @@
}
var res = result.data
if (res.code === 200) {
- that.csmtrList = res.data.records
+ let list = res.data.records
+ that.csmtrList = that.reload ? list : that.csmtrList.concat(list);
+ that.curr = that.curr + 1
+ if (res.data.records.length == 0) {
+ that.status = 'noMore'
+ }
} else if (res.code === 403) {
uni.showToast({title: res.msg, icon: "none", position: 'top'})
setTimeout(() => {
diff --git a/pages/business/cstmr/cstmrDetails.vue b/pages/business/cstmr/cstmrDetails.vue
index 76ed48a..1bf8a5d 100644
--- a/pages/business/cstmr/cstmrDetails.vue
+++ b/pages/business/cstmr/cstmrDetails.vue
@@ -63,13 +63,12 @@
data() {
return {
id: 0,
- baseUrl: '',
cstmr: {
id: '',
- name: '娌冲寳鍚涢偊涔充笟鏈夐檺鍏徃',
- tel: '15067665399',
- addr: '娌冲寳鐪侀偗閮稿競鍚涢偊涔充笟鏈夐檺鍏徃',
- cstman: '鏈辨槑蹇�'
+ name: '',
+ tel: '',
+ addr: '',
+ cstman: ''
},
addFollower: {
follower: '',
@@ -82,14 +81,11 @@
},
onLoad(option) {
this.id = option.id
- this.baseUrl = uni.getStorageSync('baseUrl')
this.init()
this.autoLoad('follower','')
setTimeout(()=>{
this.getFollowers()
},500)
-
-
},
methods: {
init() {
@@ -115,7 +111,6 @@
data: {ids: ids},
method: 'POST',
success(res) {
- console.log(res);
res = res.data
if (res.code === 200) {
uni.navigateBack()
@@ -157,7 +152,6 @@
success(result) {
var res = result.data
that.getFollowers()
- console.log(res);
}
})
this.addFollower.follower = ''
@@ -174,7 +168,6 @@
method: 'POST',
success(result) {
var res = result.data
- console.log(res);
if (res.code === 200) {
var element;
if (type == 'follower') {
@@ -203,7 +196,6 @@
},
removeFollowers(userId) {
let that = this
- console.log(that.cstmrId);
uni.request({
url: that.baseUrl + '/cstmr/followers/remove/auth',
header:{
@@ -218,7 +210,6 @@
success(res) {
res = res.data
that.getFollowers()
- console.log(res);
}
})
}
--
Gitblit v1.9.1