|
@@ -140,13 +140,45 @@
|
|
|
<u-icon name="arrow-right" size="15" color="#999"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
+
|
|
|
+ <!-- 兑换成功 -->
|
|
|
+ <u-popup :show="tipShow" mode="center">
|
|
|
+ <view class="tip-show">
|
|
|
+ <view class="tip-show-title">
|
|
|
+ <view>确认选择后,如需变更规格,请联系客服</view>
|
|
|
+ </view>
|
|
|
+ <view class="tip-show-titletwo">
|
|
|
+ <view>当前规格:{{tipData.properties}}</view>
|
|
|
+ </view>
|
|
|
+ <view class="flex tip-show-btn">
|
|
|
+ <view class="close" @click="tipShow = false">取消</view>
|
|
|
+ <view class="prize" @click="tipSecction">确认选择</view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </u-popup>
|
|
|
+
|
|
|
+ <!-- 商品选择sku -->
|
|
|
+ <sku-popup
|
|
|
+ :popup-show="skuPopupShow"
|
|
|
+ :detailInfo="info"
|
|
|
+ :popup-info="payInfo"
|
|
|
+ :sku-list-init="skuListInit"
|
|
|
+ :sku-list-popup="skuList"
|
|
|
+ @close="close"
|
|
|
+ @success="skuSuccess"
|
|
|
+ v-if="skuPopupShow"
|
|
|
+ />
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import env from '../../config/env.js'
|
|
|
import $http from '@/utils/request.js'
|
|
|
+ import skuPopup from '../components/sku-popup/sku-popup.vue'
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ skuPopup
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
@@ -172,6 +204,15 @@
|
|
|
pagesNum: "",
|
|
|
|
|
|
statusIndex: 1,
|
|
|
+
|
|
|
+ info: {},
|
|
|
+ skuPopupShow: false,//选择框
|
|
|
+ skuList: [],
|
|
|
+ skuListInit: [],
|
|
|
+ tipShow: false,
|
|
|
+ tipData: {},
|
|
|
+ payInfo: {},
|
|
|
+ // infoItem: {},
|
|
|
};
|
|
|
},
|
|
|
onShow() {
|
|
@@ -223,6 +264,7 @@
|
|
|
this.loading = false
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
getListTwo(){
|
|
|
let _this = this
|
|
|
let url = '/api/v1/mp/user/prize/recovery/list'
|
|
@@ -232,7 +274,6 @@
|
|
|
uni.hideLoading();
|
|
|
this.loading = false
|
|
|
if (res.code == 0) {
|
|
|
- console.log(res);
|
|
|
res.rows.forEach(item => {
|
|
|
item.status = 3
|
|
|
item.goodsNum = item.num
|
|
@@ -293,8 +334,79 @@
|
|
|
this.pageList()
|
|
|
this.checkedAll = false
|
|
|
},
|
|
|
+
|
|
|
+ close() {
|
|
|
+ this.skuPopupShow = false
|
|
|
+ this.tipShow = false
|
|
|
+ },
|
|
|
+ skuSuccess(data) {
|
|
|
+ this.tipData = data
|
|
|
+ this.close()
|
|
|
+ this.tipShow = true
|
|
|
+ // this.pageList()
|
|
|
+ },
|
|
|
+
|
|
|
+ tipSecction() {
|
|
|
+ uni.showLoading({
|
|
|
+ title: '兑换中'
|
|
|
+ });
|
|
|
+ $http.post('/api/v1/mp/user/mine/prize/saveSku', this.tipData).then(res => {
|
|
|
+ uni.hideLoading();
|
|
|
+ if (res.code == 0) {
|
|
|
+ for (var i = 0; i < this.list.length; i++) {
|
|
|
+ if(this.list[i].storageId == this.info.storageId){
|
|
|
+ this.$set(this.list[i],"properties",this.tipData.properties)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.close()
|
|
|
+ } else if (res.code == 1021) {
|
|
|
+ uni.$u.toast(res.msg);
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
changeChecked(e, item) {
|
|
|
+ if(item.checked == false && item.isMoreSku == 1 && item.inType.value != 2 && item.properties == ""){
|
|
|
+ $http.post('/api/v1/mp/user/exchange/goods/detail', {
|
|
|
+ goodsId: item.goodsId,
|
|
|
+ noToken: true
|
|
|
+ }).then(res => {
|
|
|
+ this.info = item
|
|
|
+ this.skuPopupShow = true
|
|
|
+ this.skuListInit = res.data.skuList
|
|
|
+ if (res.data.skuList.length) {
|
|
|
+ let skuProp = JSON.parse(res.data.skuProp)
|
|
|
+ skuProp.forEach(item => {
|
|
|
+ item.actionIndex = 0,
|
|
|
+ item.txt = `${item.name}:${item.value[0]}`
|
|
|
+ })
|
|
|
+ let actionSku = skuProp.map(item => {
|
|
|
+ return item.txt
|
|
|
+ }).join(';')
|
|
|
+ let sku = res.data.skuList.find(item => {
|
|
|
+ return item.properties == actionSku
|
|
|
+ })
|
|
|
+ this.payInfo = {
|
|
|
+ ...sku,
|
|
|
+ exValue: sku.exchangePrice,
|
|
|
+ storageId: item.storageId,
|
|
|
+ price: sku.value,
|
|
|
+ picUrl: env.filePublic + sku.picUrl
|
|
|
+ }
|
|
|
+ this.skuList = skuProp
|
|
|
+ } else {
|
|
|
+ this.payInfo = {
|
|
|
+ ...res.data,
|
|
|
+ price: this.info.value,
|
|
|
+ exValue: this.info.exchangePrice,
|
|
|
+ picUrl: this.picUrlArr[0],
|
|
|
+ storageId: item.storageId,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
this.$set(item, 'checked', e)
|
|
|
let flag = this.list.every(item => item.checked == true)
|
|
|
this.checkedAll = flag
|
|
@@ -319,6 +431,49 @@
|
|
|
// 立即提货
|
|
|
toSettlement() {
|
|
|
let arr = []
|
|
|
+ for (var i = 0; i < this.list.length; i++) {
|
|
|
+ //选中 && 是多sku && 不为盲豆兑换 && sku为空
|
|
|
+ if(this.list[i].checked && this.list[i].isMoreSku == 1 && this.list[i].inType.value != 2 && this.list[i].properties == ""){
|
|
|
+ $http.post('/api/v1/mp/user/exchange/goods/detail', {
|
|
|
+ goodsId: this.list[i].goodsId,
|
|
|
+ noToken: true
|
|
|
+ }).then(res => {
|
|
|
+ this.info = this.list[i]
|
|
|
+ this.skuPopupShow = true
|
|
|
+ this.skuListInit = res.data.skuList
|
|
|
+ if (res.data.skuList.length) {
|
|
|
+ let skuProp = JSON.parse(res.data.skuProp)
|
|
|
+ skuProp.forEach(item => {
|
|
|
+ item.actionIndex = 0,
|
|
|
+ item.txt = `${item.name}:${item.value[0]}`
|
|
|
+ })
|
|
|
+ let actionSku = skuProp.map(item => {
|
|
|
+ return item.txt
|
|
|
+ }).join(';')
|
|
|
+ let sku = res.data.skuList.find(item => {
|
|
|
+ return item.properties == actionSku
|
|
|
+ })
|
|
|
+ this.payInfo = {
|
|
|
+ ...sku,
|
|
|
+ exValue: sku.exchangePrice,
|
|
|
+ storageId: this.list[i].storageId,
|
|
|
+ price: sku.value,
|
|
|
+ picUrl: env.filePublic + sku.picUrl
|
|
|
+ }
|
|
|
+ this.skuList = skuProp
|
|
|
+ } else {
|
|
|
+ this.payInfo = {
|
|
|
+ ...res.data,
|
|
|
+ price: this.info.value,
|
|
|
+ exValue: this.info.exchangePrice,
|
|
|
+ picUrl: this.picUrlArr[0],
|
|
|
+ storageId: this.list[i].storageId,
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
this.list.forEach(item => {
|
|
|
if (item.checked) {
|
|
|
arr.push(item)
|
|
@@ -701,4 +856,57 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ .tip-show {
|
|
|
+ width: 80vw;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ border-radius: 10rpx;
|
|
|
+ padding: 60rpx 40rpx;
|
|
|
+
|
|
|
+ &-title {
|
|
|
+ margin-bottom: 64rpx;
|
|
|
+
|
|
|
+ view {
|
|
|
+ margin-left: 20rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &-titletwo {
|
|
|
+ margin-bottom: 64rpx;
|
|
|
+
|
|
|
+ view {
|
|
|
+ margin-left: 20rpx;
|
|
|
+ color: #999; font-size: 26rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-btn {
|
|
|
+ justify-content: space-around;
|
|
|
+
|
|
|
+ .close {
|
|
|
+ width: 160rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ color: rgba(235, 112, 9, 100);
|
|
|
+ font-size: 28rpx;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid rgba(235, 112, 9, 100);
|
|
|
+ }
|
|
|
+
|
|
|
+ .prize {
|
|
|
+ width: 160rpx;
|
|
|
+ height: 60rpx;
|
|
|
+ line-height: 60rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ color: rgba(235, 112, 9, 100);
|
|
|
+ font-size: 28rpx;
|
|
|
+ text-align: center;
|
|
|
+ background-color: rgba(235, 112, 9, 100);
|
|
|
+ color: rgba(255, 255, 255, 100);
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
</style>
|