diff --git a/src/apps/AppCreditPoints/AppCreditPoints.vue b/src/apps/AppCreditPoints/AppCreditPoints.vue index aece2f3b..753ea2c0 100644 --- a/src/apps/AppCreditPoints/AppCreditPoints.vue +++ b/src/apps/AppCreditPoints/AppCreditPoints.vue @@ -1,8 +1,8 @@ @@ -166,39 +120,33 @@ export default { name: "AppCreditPoints", appName: '积分排行', computed: { - ...mapState(["user", "token"]), + ...mapState(["user"]), }, data() { return { tabList: ["家庭积分", "个人积分"], tabIndex: 0, - showDetail: false, //是否显示积分明细 info: {}, - current: 1, - list: [], - areaId: "", + areaId: '', + areaName: '', + list: [] }; }, - onLoad(options) { - // if (uni.getStorageSync("areaId")) { - // this.areaId = uni.getStorageSync("areaId"); - // } else { - // this.areaId = this.$areaId; - // } - // if (options.type == "detail") { - // this.showDetail = true; - // this.getList(); - // } - // uni.setNavigationBarTitle({ - // title: options.title, - // }); + onLoad() { + this.areaName = this.user.areaName || '' this.getInfo(); }, + onShow() { + document.title = '积分排行' + }, methods: { + areaSelect(e) { + this.areaId = e + this.getInfo() + }, tabClick(index) { this.tabIndex = index; this.getInfo(); - this.getList(); }, // 积分排行 getInfo() { @@ -211,29 +159,13 @@ export default { } }); }, - // 积分明细列表 - getList() { - // var url = `/app/appvillagerintegraldetail/IntegralList?residentId=00255e188d1225f3fe022cb4eed44a84&type=${this.tabIndex}¤t=${this.current}&size=10` //积分明细 - var url = `/app/appvillagerintegraldetail/IntegralList?residentId=${this.user.residentId}&type=${this.tabIndex}¤t=${this.current}&size=10`; //积分明细 - this.$http.post(url).then((res) => { - if (res.code === 0) { - if (this.current > res.data.pages) { - return; - } - const records = - this.current > 1 - ? [...this.list, ...res.data.records] - : res.data.records; - this.list = records; - } - }); + formatName(name) { + if (name == undefined) { + return + } + return name.substr(name.length - 2, name.length > 2 ? (name.length - 1) : name.length) }, }, - onReachBottom() { - if (!this.showDetail) return; - this.current = this.current + 1; - this.getList(); - }, }; diff --git a/src/apps/AppCreditPoints/components/img/local-icon.png b/src/apps/AppCreditPoints/components/img/local-icon.png new file mode 100644 index 00000000..3e23aff6 Binary files /dev/null and b/src/apps/AppCreditPoints/components/img/local-icon.png differ