积分优化

main
lion 1 year ago
parent b7879ffdad
commit bf8608f294

@ -3,36 +3,23 @@
<view>
<!-- <u-empty v-if="dataList.length==0" marginTop="250"></u-empty> -->
<view class="ordertop">
<view>1580</view>
<view>{{totalScore}}</view>
<view>
<text>积分规则</text>
<u-icon name="arrow-right" size="24"></u-icon>
<!-- <text>积分规则</text>
<u-icon name="arrow-right" size="24"></u-icon> -->
</view>
</view>
<view class="orderlist">
<view class="orderlist-item">
<view class="orderlist-item" v-for="item in scoreLog">
<view>
<view>积分获取</view>
<view>
<text>2024-06-27</text>
<text>09:10:10</text>
<text>{{item.created_at}}</text>
</view>
</view>
<view>
+20
</view>
</view>
<view class="orderlist-item">
<view>
<view>积分获取</view>
<view>
<text>2024-06-27</text>
<text>09:10:10</text>
</view>
</view>
<view>
+20
+{{item.score}}
</view>
</view>
</view>
@ -47,83 +34,21 @@
data() {
return {
isLoading: false,
dataList: []
totalScore:0,
scoreLog:[]
}
},
onLoad() {
// this.loadOrder(1)
this.loadScore()
},
onPullDownRefresh() {
if (!this.isLoading) {
this.loadOrder(this.currentPage + 1);
}
},
onReachBottom() {
if (!this.isLoading) {
this.loadOrder(this.currentPage + 1);
}
},
methods: {
todetail(id) {
// uni.navigateTo({
// url: "/pages/exhibit/detail?id=" + id
// });
},
loadOrder(page) {
uni.hideKeyboard()
var that = this;
that.isLoading = true;
// this.util.request({
// api: '/api/mobile/exhibit-hall/index',
// customLoading: false,
// data: {
// page: page,
// page_size: 6,
// state: this.tablist[this.current].idx,
// sort_name: 'state',
// sort_name_tow: 'release_time',
// sort_type: "DESC",
// sort_type_tow: 'DESC'
// },
// utilSuccess: function(r) {
// var res = r.data;
// that.isLoading = false;
// var hasNoMore = r.total < 6 && page > 1;
// console.log("hasNoMore", hasNoMore)
// if (hasNoMore || res.length == 0 && page > 1) {
// uni.stopPullDownRefresh(); // < ,
// //
// uni.showToast({
// title: '',
// icon: 'none'
// });
// return;
// }
// var dataList = that.dataList;
// for(var m of res){
// m.dateRange = that.util.splitTime(m.start_time,m.over_time)
// }
// if (page == 1) {
// dataList = res;
// } else {
// dataList.push(...res);
// }
// that.currentPage = page;
// that.dataList = dataList;
// },
// utilFail: function(res) {
// if (page == 1) {
// that.currentPage = page;
// }
// that.util.alert(res);
// }
// });
methods: {
async loadScore(){
const res = await this.$u.api.user()
this.totalScore = res.user.score
this.scoreLog = res.scoreLog
}
}
}

@ -28,7 +28,7 @@
<view class="orderimg">
<image
:src="item.sku?(item.sku.image_url?item.sku.image_url:require('@/static/logo-xietaitai.png')):require('@/static/logo-xietaitai.png')"
mode="widthFix"></image>
></image>
</view>
<view class="orderright">
<view class="ordertitle">{{item.sku?item.sku.name:''}}</view>
@ -45,7 +45,7 @@
<!-- -->
<text class="deleteorder" @click="copyText(item.express_number)" v-if="item.status==1"></text>
<text class="deleteorder" @click="edit(item)" v-if="item.can_update"></text>
<text class="orderinform">通知收件</text>
<text class="orderinform" @click="copyText(item,'send')"></text>
</view>
</view>
</view>
@ -120,17 +120,30 @@
})
},
//
copyText(text) {
copyText(item,type) {
//
let message = ''
if(type=='send'){
message = `${item.contact}先生/女士,您兑换的${item.sku.name}${item.sku.specs})将于${item.send_date} ${item.hh}开始配送,请保持电话${item.mobile}畅通。`
}else{
message = item
}
uni.setClipboardData({
data: text,
data: message,
success: function() {
console.log('复制成功');
// 使uni.showToast
uni.showToast({
title: '单号复制成功',
icon: 'none',
duration: 2000
});
if(type=='send'){
uni.showToast({
title: '复制成功,快发给好友吧。',
icon: 'none',
duration: 2000
});
}else{
uni.showToast({
title: '单号复制成功',
icon: 'none',
duration: 2000
});
}
},
fail: function(e) {
uni.showToast({
@ -222,7 +235,7 @@
.orderimg image {
width: 100%;
height: auto;
height: 100%;
vertical-align: middle;
}

@ -122,7 +122,8 @@
},
onLoad(option) {
this.getBanner()
if (isNull(this.vuex_token)) {
let token = uni.getStorageSync('xtt_lifeData')?uni.getStorageSync('xtt_lifeData').vuex_token:''
if (isNull(token)) {
this.getToken()
}
},

Loading…
Cancel
Save