Compare commits

..

No commits in common. "51874e8daba918d1a7b5901cf309b542e7a06200" and "6edc6205094214d73b6983a2b22a349a006599d6" have entirely different histories.

4 changed files with 13 additions and 30 deletions

View File

@ -43,8 +43,7 @@
<text class="points-label">当前积分{{ userPoints }}</text> <text class="points-label">当前积分{{ userPoints }}</text>
</view> </view>
<view v-if="userPoints < selectedGoodsInfo.points" class="insufficient-points"> <view v-if="userPoints < selectedGoodsInfo.points" class="insufficient-points">
<text v-if="!isLoggedIn" >暂未登录,请先登录</text> 积分不足还差{{ selectedGoodsInfo.points - userPoints }}积分哦
<text v-else>积分不足还差{{ selectedGoodsInfo.points - userPoints }}积分哦</text>
</view> </view>
<button v-else class="exchange-btn" @click="showSpecPopup = true">立即兑换</button> <button v-else class="exchange-btn" @click="showSpecPopup = true">立即兑换</button>
<!-- <button class="exchange-btn" @click="showSpecPopup = true">立即兑换</button> --> <!-- <button class="exchange-btn" @click="showSpecPopup = true">立即兑换</button> -->
@ -112,8 +111,7 @@ export default {
selectedSpecId: 1, selectedSpecId: 1,
selectedSpec: '', selectedSpec: '',
quantity: 1, quantity: 1,
selectedGoodsInfo: {}, selectedGoodsInfo: {}
isLoggedIn: false
}; };
}, },
computed: { computed: {
@ -173,9 +171,6 @@ export default {
}, },
// //
getPointNum() { getPointNum() {
if (!uni.getStorageSync("ctoken")) {
return 0;
}
request(apiArr2.getUserInfo, 'POST', {}, { silent: false }).then(res => { request(apiArr2.getUserInfo, 'POST', {}, { silent: false }).then(res => {
this.userPoints = res.points; this.userPoints = res.points;
}); });
@ -183,13 +178,9 @@ export default {
}, },
onshow() { onshow() {
this.getPointNum(); this.getPointNum();
//
this.isLoggedIn = !!uni.getStorageSync("ctoken");
}, },
onLoad(options) { onLoad(options) {
this.getPointNum(); this.getPointNum();
//
this.isLoggedIn = !!uni.getStorageSync("ctoken");
const orderInfo = JSON.parse(options.product); const orderInfo = JSON.parse(options.product);
const params = { const params = {
id: orderInfo.id id: orderInfo.id

View File

@ -38,9 +38,9 @@
<scroll-view scroll-y="true" @scrolltolower="loadMore" style="height: calc(100vh - 300rpx);"> <scroll-view scroll-y="true" @scrolltolower="loadMore" style="height: calc(100vh - 300rpx);">
<view class="product-list"> <view class="product-list">
<view v-for="(product, index) in products" :key="index" class="product-item"> <view v-for="(product, index) in products" :key="index" class="product-item">
<image class="product-image" :src="product.commodity_pic" mode="aspectFill" @click="toDetail(product)"></image> <image class="product-image" :src="product.commodity_pic" mode="aspectFill"></image>
<view class="product-title" @click="toDetail(product)">{{ product.commodity_name }}</view> <view class="product-title">{{ product.commodity_name }}</view>
<view class="product-info" @click="toDetail(product)"> <view class="product-info">
<view class="product-points">{{ product.goods_info_list[0].points }} 积分</view> <view class="product-points">{{ product.goods_info_list[0].points }} 积分</view>
<view class="product-sold">已兑换{{ product.exchange_count }}</view> <view class="product-sold">已兑换{{ product.exchange_count }}</view>
</view> </view>
@ -90,9 +90,6 @@ export default {
}, },
methods: { methods: {
getNum() { getNum() {
if (!uni.getStorageSync("ctoken")) {
return 0;
}
request(apiArr2.getUserInfo, 'POST', {}, { silent: false }).then(res => { request(apiArr2.getUserInfo, 'POST', {}, { silent: false }).then(res => {
this.pointsNum = res.points; this.pointsNum = res.points;
}); });
@ -104,7 +101,7 @@ export default {
}, },
getList() { getList() {
if (this.loading || this.noMore) return; if (this.loading || this.noMore) return;
this.loading = true; this.loading = true;
const params = { const params = {
category_id: this.activeCategory, category_id: this.activeCategory,
@ -113,21 +110,21 @@ export default {
} }
request(apiArr.pointShopPage, 'POST', params, { silent: false }, false).then(res => { request(apiArr.pointShopPage, 'POST', params, { silent: false }, false).then(res => {
this.loading = false; this.loading = false;
const newProducts = res.row.map(item => { const newProducts = res.row.map(item => {
return { return {
...item, ...item,
commodity_pic: picUrl + item.commodity_pic, commodity_pic: picUrl + item.commodity_pic,
} }
}); });
// //
if (this.page_num === 1) { if (this.page_num === 1) {
this.products = newProducts; this.products = newProducts;
} else { } else {
this.products = [...this.products, ...newProducts]; this.products = [...this.products, ...newProducts];
} }
// //
if (newProducts.length < this.page_size) { if (newProducts.length < this.page_size) {
this.noMore = true; this.noMore = true;
@ -156,7 +153,7 @@ export default {
} }
}, },
toDetail(product) { toDetail(product) {
NavgateTo('/packages/jfShop/detail/index?product=' + JSON.stringify(product) + '&pointNum=' + this.pointsNum, { isLogin: false }); NavgateTo('/packages/jfShop/detail/index?product=' + JSON.stringify(product) + '&pointNum=' + this.pointsNum);
} }
} }
} }

View File

@ -136,9 +136,6 @@ page {
.orderItem_row_label { .orderItem_row_label {
width: 200rpx; width: 200rpx;
} }
.orderItem_row_status{
min-width: 90rpx;
}
.orderItem_row_state { .orderItem_row_state {
font-size: 28rpx; font-size: 28rpx;

View File

@ -37,7 +37,7 @@
<view class="orderItem_row_con">{{ item.room.name }}</view> <view class="orderItem_row_con">{{ item.room.name }}</view>
</view> </view>
<view class="orderItem_row_status" :class="['orderItem_row_state', statusType[item.status].color]"> <view :class="['orderItem_row_state', statusType[item.status].color]">
{{ statusType[item.status].desc }} {{ statusType[item.status].desc }}
</view> </view>
</view> </view>
@ -183,9 +183,7 @@ export default {
const meun = menuButtonInfo(); const meun = menuButtonInfo();
this.top = meun.top; this.top = meun.top;
this.localHeight = meun.height; this.localHeight = meun.height;
if (options.communityId) { this.communityId = JSON.parse(options.communityId);
this.communityId = JSON.parse(options.communityId);
}
}, },
onShow() { onShow() {
this.page_num = 1; this.page_num = 1;
@ -195,7 +193,7 @@ export default {
}, },
onReachBottom() { onReachBottom() {
if (this.flag) { if (this.flag) {
this.getTabsList(); this.init();
} }
}, },
} }