|
@@ -7,41 +7,48 @@
|
|
|
<text class="gongdeng-text">我的供灯</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view v-if="list.length==0" class="empty_data_box">
|
|
|
+ <view v-if="gongdeList.length==0" class="empty_data_box">
|
|
|
<view>
|
|
|
<image src="../../../static/index/gongdeng/empty_data_icon.png" class="empty_data_img"></image>
|
|
|
<view class="empty_data_tip">暂无内容</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view v-else class="gongdeng_info_box">
|
|
|
- <view v-for="(item,index) in list" :key="index" class="gongdeng_list">
|
|
|
+ <view v-for="(item,index) in gongdeList" :key="index" class="gongdeng_list">
|
|
|
<view class="gongdeng_img_box">
|
|
|
- <image :src="item.foxiang" class="gongdeng_img"></image>
|
|
|
+ <image :src="item.fx_thumb" class="gongdeng_img"></image>
|
|
|
</view>
|
|
|
<view class="gongdeng_item_info">
|
|
|
- <view class="gongdeng_left_item">
|
|
|
+ <view class="gongdeng_left_item">
|
|
|
+ <view class="gongdeng_item_content">
|
|
|
+ <text class="gongdeng_item_title">状态</text>
|
|
|
+ <text class="gongdeng_item_text" v-if="item.status==1">未支付</text>
|
|
|
+ <text class="gongdeng_item_text" v-else-if="item.status==2">{{item.lamp_status==2? item.device_num+'号灯已点亮':(item.buy_type==2?'续费成功':'已支付')}}</text>
|
|
|
+ <text class="gongdeng_item_text" v-else-if="item.status==3">已取消</text>
|
|
|
+ </view>
|
|
|
<view class="gongdeng_item_content">
|
|
|
<text class="gongdeng_item_title">功德主</text>
|
|
|
- <text class="gongdeng_item_text">{{item.person}}</text>
|
|
|
+ <text class="gongdeng_item_text">{{item.sf_name}}</text>
|
|
|
</view>
|
|
|
<view class="gongdeng_item_content">
|
|
|
<text class="gongdeng_item_title">实付金额</text>
|
|
|
- <text class="gongdeng_item_text">{{item.money}}</text>
|
|
|
+ <text class="gongdeng_item_text">{{item.pay_money}}元</text>
|
|
|
</view>
|
|
|
<view class="gongdeng_item_content">
|
|
|
<text class="gongdeng_item_title">开始时间</text>
|
|
|
- <text class="gongdeng_item_text">{{item.startTime}}</text>
|
|
|
+ <text class="gongdeng_item_text">{{item.pay_at?item.pay_at:item.create_time}}</text>
|
|
|
</view>
|
|
|
<view class="gongdeng_item_content">
|
|
|
<text class="gongdeng_item_title">结束时间</text>
|
|
|
- <text class="gongdeng_item_text">{{item.endTime}}</text>
|
|
|
+ <text class="gongdeng_item_text" v-if="item.status==2">{{item.expire_at}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
<image v-if="item.ifFinish" src="../../../static/index/gongdeng/gongdeng_finish.png" class="deng_img"></image>
|
|
|
<image v-else src="../../../static/index/gongdeng/gongdeng_unfinish.png" class="deng_img"></image>
|
|
|
</view>
|
|
|
- <view class="show_certificate">供灯证书</view>
|
|
|
+ <view class="show_certificate" @click="lookLamp(item)">查看供灯</view>
|
|
|
</view>
|
|
|
+ <uni-load-more :status="loadStatus"></uni-load-more>
|
|
|
</view>
|
|
|
</view>
|
|
|
</template>
|
|
@@ -49,31 +56,106 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
data() {
|
|
|
- return {
|
|
|
- list: [{
|
|
|
- foxiang: '../../../static/index/gongdeng/wen_shu.jpg',
|
|
|
- person: '222',
|
|
|
- money: '0元',
|
|
|
- startTime: '2021-4-25',
|
|
|
- endTime: '2021-4-26',
|
|
|
- ifFinish: true
|
|
|
- }, {
|
|
|
- foxiang: '../../../static/index/gongdeng/wen_shu.jpg',
|
|
|
- person: '222',
|
|
|
- money: '0元',
|
|
|
- startTime: '2021-4-25',
|
|
|
- endTime: '2021-4-26',
|
|
|
- ifFinish: false
|
|
|
- }
|
|
|
- ]
|
|
|
+ return {
|
|
|
+ type: 1,
|
|
|
+ loaded: false,
|
|
|
+ loadStatus: 'false',
|
|
|
+ loadMore: false,
|
|
|
+ params: {
|
|
|
+ page: 1,
|
|
|
+ pageSize: 12,
|
|
|
+ total: 0,
|
|
|
+ },
|
|
|
+ gongdeList: [],
|
|
|
+ // 供灯图片
|
|
|
+ picList: [],
|
|
|
}
|
|
|
+ },
|
|
|
+ onLoad(option) {
|
|
|
+ this.getList()
|
|
|
+ this.type = typeof(option.type)!='undefined'? option.type : 1;
|
|
|
+
|
|
|
+ // 上拉刷新
|
|
|
+ uni.startPullDownRefresh({
|
|
|
+ success: function(){
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 下拉加载更多
|
|
|
+ onReachBottom(){
|
|
|
+ console.log('loadmore')
|
|
|
+ if(!this.loaded){
|
|
|
+ this.loadMore = true
|
|
|
+ this.params.page++;
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 上拉刷新
|
|
|
+ onPullDownRefresh() {
|
|
|
+ console.log('refresh');
|
|
|
+ this.params.page = 1
|
|
|
+ this.getList()
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
},
|
|
|
methods: {
|
|
|
backHome() {
|
|
|
- uni.navigateBack({
|
|
|
- delta: 1
|
|
|
- });
|
|
|
- },
|
|
|
+ if(this.type==1){
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/index/gongdeng/index'
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ location.href = '/pages/my/index'
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 查看供灯图片
|
|
|
+ lookLamp(data){
|
|
|
+ if(data.status != 2){
|
|
|
+ uni.showToast({
|
|
|
+ title: '抱歉,您的订单未支付,稍后会自动取消!',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(data.lamp_status != 2){
|
|
|
+ uni.showToast({
|
|
|
+ title: '抱歉,您要供奉的灯未开启成功,请联系佛祖!',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取图片
|
|
|
+ },
|
|
|
+ getList(){
|
|
|
+ let _uni = this
|
|
|
+ this.$request.api('/api/gongdeng/list', _uni.params).then(res => {
|
|
|
+ if (res.success == true) {
|
|
|
+ if(_uni.loadMore==true && res.data.length>0){
|
|
|
+ let len = res.data.length
|
|
|
+ for(let i=0; i<=len; i++){
|
|
|
+ if(typeof(res.data[i]) != 'undefined'){
|
|
|
+ _uni.gongdeList.push(res.data[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _uni.loadMore = false
|
|
|
+ }else if (res.data.length>0){
|
|
|
+ _uni.gongdeList = res.data? res.data : [];
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.params.page !=1 && res.data.length<=0){
|
|
|
+ _uni.loaded = true
|
|
|
+ }
|
|
|
+ console.log(this.gongdeList)
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ uni.showToast({
|
|
|
+ title: typeof(err.msg) != 'undefined' ? err.msg : '服务器错误',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -163,7 +245,9 @@
|
|
|
width:160rpx;
|
|
|
height:160rpx;
|
|
|
margin-top: 65rpx;
|
|
|
- margin-left: 220rpx;
|
|
|
+ // margin-left: 220rpx;
|
|
|
+ position: absolute;
|
|
|
+ right: 5px;
|
|
|
}
|
|
|
}
|
|
|
.show_certificate{
|